@splunk/react-ui 4.3.0 → 4.5.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 (138) 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 +57 -0
  10. package/Calendar.js +14 -14
  11. package/Card.js +51 -25
  12. package/CardLayout.js +31 -10
  13. package/Chip.js +77 -53
  14. package/Clickable.js +6 -6
  15. package/CloseButton.js +6 -6
  16. package/Code.js +1279 -1120
  17. package/CollapsiblePanel.js +6 -6
  18. package/Color.js +180 -209
  19. package/ColumnLayout.js +4 -4
  20. package/ComboBox.js +22 -17
  21. package/Concertina.js +56 -51
  22. package/ControlGroup.js +121 -32
  23. package/Date.js +62 -25
  24. package/DefinitionList.js +2 -2
  25. package/Dropdown.js +12 -12
  26. package/EventListener.js +168 -0
  27. package/FetchOptions.js +8 -8
  28. package/File.js +122 -96
  29. package/FormRows.js +66 -58
  30. package/Heading.js +2 -2
  31. package/Image.js +14 -14
  32. package/JSONTree.js +5 -5
  33. package/Layer.js +32 -20
  34. package/Link.js +8 -8
  35. package/List.js +2 -2
  36. package/Markdown.js +250 -88
  37. package/Menu.js +70 -64
  38. package/Message.js +18 -18
  39. package/Modal.js +70 -16
  40. package/ModalLayer.js +4 -4
  41. package/Monogram.js +12 -11
  42. package/Multiselect.js +124 -80
  43. package/Number.js +44 -34
  44. package/Paginator.js +10 -10
  45. package/Paragraph.js +2 -2
  46. package/Popover.js +54 -40
  47. package/Progress.js +8 -8
  48. package/RadioBar.js +45 -38
  49. package/RadioList.js +2 -2
  50. package/Resize.js +19 -15
  51. package/ResultsMenu.js +6 -6
  52. package/ScreenReaderContent.js +2 -2
  53. package/Scroll.js +25 -23
  54. package/ScrollContainerContext.js +5 -5
  55. package/Search.d.ts +2 -0
  56. package/Search.js +797 -0
  57. package/Select.js +85 -45
  58. package/SidePanel.js +6 -6
  59. package/Slider.js +34 -30
  60. package/SlidingPanels.js +6 -6
  61. package/StaticContent.js +2 -2
  62. package/StepBar.js +56 -52
  63. package/Switch.js +8 -8
  64. package/TabBar.js +126 -85
  65. package/TabLayout.js +4 -5
  66. package/Table.js +266 -155
  67. package/Text.js +486 -401
  68. package/Tooltip.js +11 -11
  69. package/TransitionOpen.js +11 -11
  70. package/WaitSpinner.js +3 -4
  71. package/package.json +5 -6
  72. package/types/src/Accordion/AccordionContext.d.ts +10 -0
  73. package/types/src/Accordion/Panel.d.ts +0 -9
  74. package/types/src/Button/Button.d.ts +4 -2
  75. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +7 -0
  76. package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
  77. package/types/src/Card/Card.d.ts +2 -0
  78. package/types/src/CardLayout/CardLayoutContext.d.ts +8 -0
  79. package/types/src/Color/Color.d.ts +2 -2
  80. package/types/src/Color/Swatch.d.ts +4 -15
  81. package/types/src/ComboBox/ComboBox.d.ts +4 -3
  82. package/types/src/Concertina/ConcertinaContext.d.ts +8 -0
  83. package/types/src/Concertina/Panel.d.ts +2 -4
  84. package/types/src/ControlGroup/ControlGroup.d.ts +11 -1
  85. package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
  86. package/types/src/Date/Date.d.ts +6 -4
  87. package/types/src/EventListener/EventListener.d.ts +18 -0
  88. package/types/src/EventListener/index.d.ts +2 -0
  89. package/types/src/File/File.d.ts +6 -4
  90. package/types/src/File/FileContext.d.ts +9 -0
  91. package/types/src/File/Item.d.ts +5 -10
  92. package/types/src/FormRows/FormRows.d.ts +2 -2
  93. package/types/src/FormRows/FormRowsContext.d.ts +10 -0
  94. package/types/src/FormRows/Row.d.ts +5 -16
  95. package/types/src/Markdown/Markdown.d.ts +2 -0
  96. package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +14 -0
  97. package/types/src/Markdown/renderers/MarkdownCode.d.ts +15 -0
  98. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +16 -0
  99. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +15 -0
  100. package/types/src/Markdown/renderers/MarkdownImage.d.ts +18 -0
  101. package/types/src/Markdown/renderers/MarkdownItem.d.ts +14 -0
  102. package/types/src/Markdown/renderers/MarkdownLink.d.ts +18 -0
  103. package/types/src/Markdown/renderers/MarkdownList.d.ts +26 -0
  104. package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +14 -0
  105. package/types/src/Markdown/renderers/index.d.ts +10 -0
  106. package/types/src/Modal/Modal.d.ts +15 -3
  107. package/types/src/Monogram/Monogram.d.ts +5 -1
  108. package/types/src/Multiselect/Compact.d.ts +12 -4
  109. package/types/src/Multiselect/Multiselect.d.ts +14 -4
  110. package/types/src/Multiselect/Normal.d.ts +7 -2
  111. package/types/src/Number/Number.d.ts +11 -7
  112. package/types/src/Popover/Popover.d.ts +2 -2
  113. package/types/src/RadioBar/Option.d.ts +1 -15
  114. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  115. package/types/src/RadioBar/RadioBarContext.d.ts +9 -0
  116. package/types/src/Scroll/Inner.d.ts +2 -2
  117. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +4 -4
  118. package/types/src/Search/Option.d.ts +60 -0
  119. package/types/src/Search/Search.d.ts +97 -0
  120. package/types/src/Search/index.d.ts +2 -0
  121. package/types/src/Select/Select.d.ts +6 -2
  122. package/types/src/Select/SelectBase.d.ts +12 -5
  123. package/types/src/Slider/Slider.d.ts +2 -2
  124. package/types/src/StepBar/Step.d.ts +1 -13
  125. package/types/src/StepBar/StepBarContext.d.ts +8 -0
  126. package/types/src/TabBar/Tab.d.ts +5 -13
  127. package/types/src/TabBar/TabBarContext.d.ts +14 -0
  128. package/types/src/Table/Body.d.ts +1 -1
  129. package/types/src/Table/Head.d.ts +3 -1
  130. package/types/src/Table/HeadCell.d.ts +1 -1
  131. package/types/src/Table/HeadInner.d.ts +3 -3
  132. package/types/src/Table/Row.d.ts +10 -3
  133. package/types/src/Table/Table.d.ts +10 -5
  134. package/types/src/Text/Text.d.ts +33 -12
  135. package/types/src/icons/Sort.d.ts +3 -0
  136. package/types/src/usePrevious/index.d.ts +2 -0
  137. package/types/src/usePrevious/usePrevious.d.ts +12 -0
  138. package/usePrevious.js +137 -0
package/ControlGroup.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 = 151);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 135);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -108,14 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
108
108
 
109
109
  /***/ }),
110
110
 
111
- /***/ 14:
112
- /***/ (function(module, exports) {
113
-
114
- module.exports = require("@splunk/react-ui/ScreenReaderContent");
115
-
116
- /***/ }),
117
-
118
- /***/ 151:
111
+ /***/ 135:
119
112
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
120
113
 
121
114
  "use strict";
@@ -124,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
124
117
 
125
118
  // EXPORTS
126
119
  __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_ControlGroup_ControlGroup; });
120
+ __webpack_require__.d(__webpack_exports__, "ControlGroupContext", function() { return /* reexport */ ControlGroup_ControlGroupContext; });
127
121
 
128
122
  // EXTERNAL MODULE: external "react"
129
123
  var external_react_ = __webpack_require__(2);
@@ -147,11 +141,11 @@ var Box_ = __webpack_require__(8);
147
141
  var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
148
142
 
149
143
  // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
150
- var ScreenReaderContent_ = __webpack_require__(14);
144
+ var ScreenReaderContent_ = __webpack_require__(15);
151
145
  var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
152
146
 
153
147
  // EXTERNAL MODULE: external "@splunk/react-ui/Tooltip"
154
- var Tooltip_ = __webpack_require__(45);
148
+ var Tooltip_ = __webpack_require__(46);
155
149
  var Tooltip_default = /*#__PURE__*/__webpack_require__.n(Tooltip_);
156
150
 
157
151
  // EXTERNAL MODULE: external "styled-components"
@@ -221,11 +215,26 @@ var StyledHelp = external_styled_components_default.a.div.withConfig({
221
215
  prisma: '4px'
222
216
  }));
223
217
 
218
+ // CONCATENATED MODULE: ./src/ControlGroup/ControlGroupContext.tsx
219
+
220
+
221
+ /**
222
+ * A React context used to inform subcomponets of ControlGroup of parent component values.
223
+ * The context interface is `ControlGroupContextValue`.
224
+ * Defaults to `'{}'`.
225
+ * @public
226
+ */
227
+ var ControlGroupContext = /*#__PURE__*/external_react_default.a.createContext({});
228
+ /* harmony default export */ var ControlGroup_ControlGroupContext = (ControlGroupContext);
224
229
  // CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
225
230
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
226
231
 
227
232
  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); }
228
233
 
234
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
235
+
236
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
237
+
229
238
  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; }
230
239
 
231
240
  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; }
@@ -273,6 +282,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
273
282
 
274
283
 
275
284
 
285
+ // props ControlGroup may access and/or override on children
286
+
276
287
  var propTypes = {
277
288
  children: external_prop_types_default.a.node,
278
289
  controlsLayout: external_prop_types_default.a.oneOf(['fill', 'fillJoin', 'none', 'stack']),
@@ -298,7 +309,14 @@ var defaultProps = {
298
309
  labelWidth: 120,
299
310
  size: 'medium'
300
311
  };
301
-
312
+ // Style cloned onto child elements when fill behavior set.
313
+ var FLEX_GROW_STYLE = {
314
+ flexGrow: 1
315
+ }; // Margin bootom values cloned onto child elements when the stacking behavior is needed.
316
+
317
+ var CHILD_MARGIN_BOTTOM_DEFAULT = '0';
318
+ var CHILD_MARGIN_BOTTOM_PRISMA = '16px';
319
+ var CHILD_MARGIN_BOTTOM_PRISMA_COMPACT = '12px';
302
320
  /**
303
321
  * `ControlGroup` places a label and optional help text around one or more controls. The `ControlGroup`
304
322
  * will automatically add aria attributes to associate the controls with the labels and help text to
@@ -317,6 +335,7 @@ var defaultProps = {
317
335
  * attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
318
336
  * supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
319
337
  */
338
+
320
339
  var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
321
340
  _inherits(ControlGroup, _Component);
322
341
 
@@ -334,6 +353,38 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
334
353
 
335
354
  _defineProperty(_assertThisInitialized(_this), "labelId", void 0);
336
355
 
356
+ _defineProperty(_assertThisInitialized(_this), "contextValue", void 0);
357
+
358
+ _defineProperty(_assertThisInitialized(_this), "childIds", void 0);
359
+
360
+ _defineProperty(_assertThisInitialized(_this), "stackLayoutChildStyle", void 0);
361
+
362
+ _defineProperty(_assertThisInitialized(_this), "getChildID", function (key, index) {
363
+ var childKey = "".concat(key, "-").concat(index);
364
+ var value = _this.childIds[childKey];
365
+
366
+ if (!value || !value.length) {
367
+ value = Object(id_["createDOMID"])(key);
368
+ _this.childIds[childKey] = value;
369
+ }
370
+
371
+ return value;
372
+ });
373
+
374
+ _defineProperty(_assertThisInitialized(_this), "getStackLayoutChildStyle", function (isPrisma, isCompact) {
375
+ if (isPrisma) {
376
+ if (isCompact) {
377
+ _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA_COMPACT;
378
+ }
379
+
380
+ _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA;
381
+ } else {
382
+ _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_DEFAULT;
383
+ }
384
+
385
+ return _this.stackLayoutChildStyle;
386
+ });
387
+
337
388
  _defineProperty(_assertThisInitialized(_this), "hasInputId", function (item) {
338
389
  return item.type && item.type.propTypes && Object.prototype.hasOwnProperty.call(item.type.propTypes, 'inputId');
339
390
  });
@@ -370,10 +421,43 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
370
421
 
371
422
  _this.labelId = Object(id_["createDOMID"])('label');
372
423
  _this.helpId = Object(id_["createDOMID"])('help');
424
+ _this.contextValue = _this.createContextValue();
425
+ _this.childIds = {};
426
+ _this.stackLayoutChildStyle = {};
373
427
  return _this;
374
428
  }
375
429
 
376
430
  _createClass(ControlGroup, [{
431
+ key: "shouldComponentUpdate",
432
+ value: function shouldComponentUpdate(nextProps) {
433
+ if (external_react_default.a.Children.count(nextProps.children) !== external_react_default.a.Children.count(this.props.children)) {
434
+ this.childIds = {};
435
+ }
436
+
437
+ return true;
438
+ }
439
+ }, {
440
+ key: "createContextValue",
441
+ value: function createContextValue() {
442
+ return {
443
+ labelAttrs: {
444
+ text: this.props.label,
445
+ id: this.labelId
446
+ }
447
+ };
448
+ }
449
+ }, {
450
+ key: "getContextValue",
451
+ value: function getContextValue() {
452
+ var _this$contextValue$la, _this$contextValue$la2;
453
+
454
+ if (this.props.label !== ((_this$contextValue$la = this.contextValue.labelAttrs) === null || _this$contextValue$la === void 0 ? void 0 : _this$contextValue$la.text) || this.labelId !== ((_this$contextValue$la2 = this.contextValue.labelAttrs) === null || _this$contextValue$la2 === void 0 ? void 0 : _this$contextValue$la2.id)) {
455
+ this.contextValue = this.createContextValue();
456
+ }
457
+
458
+ return this.contextValue;
459
+ }
460
+ }, {
377
461
  key: "render",
378
462
  value: function render() {
379
463
  var _this2 = this;
@@ -393,19 +477,11 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
393
477
  tooltip = _this$props.tooltip,
394
478
  otherProps = _objectWithoutProperties(_this$props, ["children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "size", "splunkTheme", "tooltip"]);
395
479
 
396
- var isPrisma = splunkTheme.family === 'prisma';
397
- var isCompact = splunkTheme.density === 'compact';
480
+ var isPrisma = splunkTheme.isPrisma,
481
+ isCompact = splunkTheme.isCompact;
398
482
  var validChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
399
483
  var count = validChildren.length;
400
- var writableOtherProps = otherProps;
401
- var stackMarginBottom = '0px';
402
-
403
- if (isPrisma && isCompact) {
404
- stackMarginBottom = '12px';
405
- } else if (isPrisma) {
406
- stackMarginBottom = '16px';
407
- } // Clean the Children
408
-
484
+ var writableOtherProps = otherProps; // Clean the Children
409
485
 
410
486
  var cloneWithProps = function cloneWithProps(item, i) {
411
487
  var cloneProps = {
@@ -448,8 +524,10 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
448
524
  cloneProps.inline = false;
449
525
 
450
526
  if (i < count - 1) {
451
- cloneProps.style = item.props.style ? Object(external_lodash_["clone"])(item.props.style) : {};
452
- cloneProps.style.marginBottom = stackMarginBottom;
527
+ // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
528
+ var stackStyle = _this2.getStackLayoutChildStyle(isPrisma, isCompact);
529
+
530
+ cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), stackStyle) : stackStyle;
453
531
  }
454
532
  }
455
533
 
@@ -467,15 +545,16 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
467
545
  }
468
546
 
469
547
  if (count === 1 && (controlsLayout === 'fillJoin' || controlsLayout === 'fill')) {
470
- cloneProps.style = item.props.style ? Object(external_lodash_["clone"])(item.props.style) : {};
471
- cloneProps.style.flexGrow = 1; // some controls like Select do not grow by default
548
+ // Some controls like Select do not grow by default, so flexGrow is applied
549
+ // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
550
+ cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), FLEX_GROW_STYLE) : FLEX_GROW_STYLE;
472
551
  }
473
552
 
474
553
  if (!labelFor && item) {
475
554
  if (_this2.hasInputId(item)) {
476
- cloneProps.inputId = item.props.inputId || Object(id_["createDOMID"])('id');
555
+ cloneProps.inputId = item.props.inputId || _this2.getChildID('input-id', i);
477
556
  } else {
478
- cloneProps.id = item.props.id || Object(id_["createDOMID"])('id');
557
+ cloneProps.id = item.props.id || _this2.getChildID('id', i);
479
558
  }
480
559
  }
481
560
 
@@ -514,7 +593,9 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
514
593
  return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
515
594
  "data-test": "control-group",
516
595
  $error: error
517
- }, writableOtherProps), hideLabel ? /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default.a.createElement(StyledControlsComponent, {
596
+ }, writableOtherProps), /*#__PURE__*/external_react_default.a.createElement(ControlGroup_ControlGroupContext.Provider, {
597
+ value: this.getContextValue()
598
+ }, hideLabel ? /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default.a.createElement(StyledControlsComponent, {
518
599
  "data-test": "controls",
519
600
  flex: controlsLayout !== 'none',
520
601
  style: contentMarginStyle
@@ -522,7 +603,7 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
522
603
  "data-test": "help",
523
604
  id: this.helpId,
524
605
  style: contentMarginStyle
525
- }, help));
606
+ }, help)));
526
607
  }
527
608
  }]);
528
609
 
@@ -536,10 +617,18 @@ _defineProperty(ControlGroup_ControlGroup, "defaultProps", defaultProps);
536
617
  var ControlGroupWithTheme = Object(themes_["withSplunkTheme"])(ControlGroup_ControlGroup);
537
618
  ControlGroupWithTheme.propTypes = ControlGroup_ControlGroup.propTypes;
538
619
  /* harmony default export */ var src_ControlGroup_ControlGroup = (ControlGroupWithTheme);
620
+
539
621
  // CONCATENATED MODULE: ./src/ControlGroup/index.ts
540
622
 
541
623
 
542
624
 
625
+ /***/ }),
626
+
627
+ /***/ 15:
628
+ /***/ (function(module, exports) {
629
+
630
+ module.exports = require("@splunk/react-ui/ScreenReaderContent");
631
+
543
632
  /***/ }),
544
633
 
545
634
  /***/ 2:
@@ -563,7 +652,7 @@ module.exports = require("lodash");
563
652
 
564
653
  /***/ }),
565
654
 
566
- /***/ 45:
655
+ /***/ 46:
567
656
  /***/ (function(module, exports) {
568
657
 
569
658
  module.exports = require("@splunk/react-ui/Tooltip");
package/Date.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 = 132);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 136);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -108,7 +108,34 @@ module.exports = require("@splunk/ui-utils/id");
108
108
 
109
109
  /***/ }),
110
110
 
111
- /***/ 132:
111
+ /***/ 11:
112
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
113
+
114
+ "use strict";
115
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
116
+ /**
117
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
118
+ *
119
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
120
+ * @param current - The new value of the ref.
121
+ */
122
+ function updateReactRef(ref, current) {
123
+ if (ref) {
124
+ if (typeof ref === 'function') {
125
+ ref(current);
126
+ } else {
127
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
128
+ // the intention here is to signal "we will take care of setting 'current', not you".
129
+ ref.current = current; // eslint-disable-line no-param-reassign
130
+ }
131
+ }
132
+ }
133
+
134
+
135
+
136
+ /***/ }),
137
+
138
+ /***/ 136:
112
139
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
113
140
 
114
141
  "use strict";
@@ -141,11 +168,11 @@ var id_ = __webpack_require__(10);
141
168
  var keyboard_ = __webpack_require__(9);
142
169
 
143
170
  // EXTERNAL MODULE: external "@splunk/react-ui/Calendar"
144
- var Calendar_ = __webpack_require__(75);
171
+ var Calendar_ = __webpack_require__(77);
145
172
  var Calendar_default = /*#__PURE__*/__webpack_require__.n(Calendar_);
146
173
 
147
174
  // EXTERNAL MODULE: external "@splunk/react-ui/Popover"
148
- var Popover_ = __webpack_require__(17);
175
+ var Popover_ = __webpack_require__(16);
149
176
  var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
150
177
 
151
178
  // EXTERNAL MODULE: external "@splunk/themes"
@@ -156,7 +183,7 @@ var external_styled_components_ = __webpack_require__(3);
156
183
  var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
157
184
 
158
185
  // EXTERNAL MODULE: external "@splunk/react-ui/Text"
159
- var Text_ = __webpack_require__(26);
186
+ var Text_ = __webpack_require__(21);
160
187
  var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
161
188
 
162
189
  // CONCATENATED MODULE: ./src/Date/DateStyles.ts
@@ -179,7 +206,10 @@ var StyledText = external_styled_components_default()(Text_default.a).withConfig
179
206
  var IconContainer = external_styled_components_default.a.div.withConfig({
180
207
  displayName: "DateStyles__IconContainer",
181
208
  componentId: "kacgdc-1"
182
- })(["position:absolute;height:100%;left:0;top:0;z-index:1;display:flex;align-items:center;padding:0 8px;border-bottom-left-radius:3px;border-top-left-radius:3px;color:", ";pointer-events:none;"], Object(themes_["pickVariant"])('$disabled', {
209
+ })(["display:flex;align-items:center;padding:", ";color:", ";pointer-events:none;"], Object(themes_["pick"])({
210
+ comfortable: '0 8px',
211
+ compact: '0 6px'
212
+ }), Object(themes_["pickVariant"])('$disabled', {
183
213
  "false": themes_["variables"].contentColorMuted,
184
214
  "true": themes_["variables"].contentColorDisabled
185
215
  }));
@@ -204,6 +234,9 @@ function CalendarIcon(props) {
204
234
  d: "M16.6001 2C17.1524 2 17.6001 2.44772 17.6001 3V4H19C20.1046 4 21 4.89543 21 6V8.5V9.5V19.5C21 19.7761 20.7761 20 20.5 20H3.5C3.22386 20 3 19.7761 3 19.5V9.5V8.5V6C3 4.89543 3.89543 4 5 4H6.6001V3C6.6001 2.44772 7.04781 2 7.6001 2C8.15238 2 8.6001 2.44772 8.6001 3V4H15.6001V3C15.6001 2.44772 16.0478 2 16.6001 2ZM6.6001 6C6.6001 6.55228 7.04781 7 7.6001 7C8.15238 7 8.6001 6.55228 8.6001 6H15.6001C15.6001 6.55228 16.0478 7 16.6001 7C17.1524 7 17.6001 6.55228 17.6001 6H19V8H5L5 6H6.6001ZM19 10H5V18H19V10Z"
205
235
  }));
206
236
  }
237
+ // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
238
+ var updateReactRef = __webpack_require__(11);
239
+
207
240
  // CONCATENATED MODULE: ./src/Date/Date.tsx
208
241
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
209
242
 
@@ -242,6 +275,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
242
275
 
243
276
 
244
277
 
278
+
245
279
  var propTypes = {
246
280
  defaultValue: external_prop_types_default.a.string,
247
281
  describedBy: external_prop_types_default.a.string,
@@ -413,6 +447,14 @@ var _Date = /*#__PURE__*/function (_Component) {
413
447
  _this.setState({
414
448
  anchor: el
415
449
  });
450
+
451
+ Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
452
+ });
453
+
454
+ _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) {
455
+ _this.setState({
456
+ input: el
457
+ });
416
458
  });
417
459
 
418
460
  _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (_ref3) {
@@ -429,6 +471,7 @@ var _Date = /*#__PURE__*/function (_Component) {
429
471
  _this.state = {
430
472
  anchor: null,
431
473
  calendarOpen: false,
474
+ input: null,
432
475
  value: _this.isControlled() ? undefined : dateString
433
476
  };
434
477
  _this.popoverId = Object(id_["createDOMID"])('calender');
@@ -467,9 +510,9 @@ var _Date = /*#__PURE__*/function (_Component) {
467
510
  }, {
468
511
  key: "focus",
469
512
  value: function focus() {
470
- var _this$state$anchor;
513
+ var _this$state$input;
471
514
 
472
- (_this$state$anchor = this.state.anchor) === null || _this$state$anchor === void 0 ? void 0 : _this$state$anchor.focus();
515
+ (_this$state$input = this.state.input) === null || _this$state$input === void 0 ? void 0 : _this$state$input.focus();
473
516
  }
474
517
  }, {
475
518
  key: "render",
@@ -477,8 +520,11 @@ var _Date = /*#__PURE__*/function (_Component) {
477
520
  var _this$props5 = this.props,
478
521
  highlightToday = _this$props5.highlightToday,
479
522
  splunkTheme = _this$props5.splunkTheme;
480
- var isPrisma = splunkTheme.family === 'prisma';
523
+ var isPrisma = splunkTheme.isPrisma;
481
524
  var currentValue = this.getValue();
525
+ var startAdornment = isPrisma && /*#__PURE__*/external_react_default.a.createElement(IconContainer, {
526
+ $disabled: this.props.disabled
527
+ }, /*#__PURE__*/external_react_default.a.createElement(CalendarIcon, null));
482
528
  return /*#__PURE__*/external_react_default.a.createElement(StyledText, Date_extends({
483
529
  autoCapitalize: "off",
484
530
  autoComplete: "off",
@@ -487,24 +533,15 @@ var _Date = /*#__PURE__*/function (_Component) {
487
533
  "data-test": "date",
488
534
  "data-test-value": currentValue,
489
535
  "data-test-popover-id": this.popoverId,
536
+ elementRef: this.handleMount,
537
+ inputRef: this.handleInputMount,
490
538
  onChange: this.handleInputChange,
491
539
  onClick: this.handleClick,
492
540
  onFocus: this.handleFocus,
493
541
  onKeyDown: this.handleKeyDown,
494
542
  value: this.getTextInputValue(),
495
- inputRef: this.handleMount
496
- }, Object(external_lodash_["omit"])(this.props, 'className', 'defaultValue', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value'), {
497
- inputStyle: isPrisma ? {
498
- paddingLeft: '26px'
499
- } : undefined
500
- }), isPrisma && /*#__PURE__*/external_react_default.a.createElement(IconContainer, {
501
- $disabled: this.props.disabled
502
- }, /*#__PURE__*/external_react_default.a.createElement(CalendarIcon, {
503
- style: {
504
- width: 24,
505
- height: 24
506
- }
507
- })), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, {
543
+ startAdornment: startAdornment
544
+ }, Object(external_lodash_["omit"])(this.props, 'className', 'defaultValue', 'elementRef', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value')), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, {
508
545
  anchor: this.state.anchor,
509
546
  id: this.popoverId,
510
547
  open: this.props.disabled ? false : this.state.calendarOpen,
@@ -539,7 +576,7 @@ DateWithTheme.momentFormat = _Date.momentFormat;
539
576
 
540
577
  /***/ }),
541
578
 
542
- /***/ 17:
579
+ /***/ 16:
543
580
  /***/ (function(module, exports) {
544
581
 
545
582
  module.exports = require("@splunk/react-ui/Popover");
@@ -560,7 +597,7 @@ module.exports = require("moment");
560
597
 
561
598
  /***/ }),
562
599
 
563
- /***/ 26:
600
+ /***/ 21:
564
601
  /***/ (function(module, exports) {
565
602
 
566
603
  module.exports = require("@splunk/react-ui/Text");
@@ -581,7 +618,7 @@ module.exports = require("lodash");
581
618
 
582
619
  /***/ }),
583
620
 
584
- /***/ 75:
621
+ /***/ 77:
585
622
  /***/ (function(module, exports) {
586
623
 
587
624
  module.exports = require("@splunk/react-ui/Calendar");
package/DefinitionList.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 = 120);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
101
101
 
102
102
  /***/ }),
103
103
 
104
- /***/ 115:
104
+ /***/ 120:
105
105
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
106
 
107
107
  "use strict";
package/Dropdown.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 = 167);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 171);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -101,7 +101,7 @@ module.exports = require("@splunk/ui-utils/id");
101
101
 
102
102
  /***/ }),
103
103
 
104
- /***/ 12:
104
+ /***/ 11:
105
105
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
106
 
107
107
  "use strict";
@@ -128,7 +128,14 @@ function updateReactRef(ref, current) {
128
128
 
129
129
  /***/ }),
130
130
 
131
- /***/ 167:
131
+ /***/ 16:
132
+ /***/ (function(module, exports) {
133
+
134
+ module.exports = require("@splunk/react-ui/Popover");
135
+
136
+ /***/ }),
137
+
138
+ /***/ 171:
132
139
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
133
140
 
134
141
  "use strict";
@@ -154,11 +161,11 @@ var external_lodash_ = __webpack_require__(4);
154
161
  var id_ = __webpack_require__(10);
155
162
 
156
163
  // EXTERNAL MODULE: external "@splunk/react-ui/Popover"
157
- var Popover_ = __webpack_require__(17);
164
+ var Popover_ = __webpack_require__(16);
158
165
  var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
159
166
 
160
167
  // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
161
- var updateReactRef = __webpack_require__(12);
168
+ var updateReactRef = __webpack_require__(11);
162
169
 
163
170
  // CONCATENATED MODULE: ./src/Dropdown/Dropdown.tsx
164
171
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
@@ -444,13 +451,6 @@ _defineProperty(Dropdown_Dropdown, "defaultProps", defaultProps);
444
451
 
445
452
 
446
453
 
447
- /***/ }),
448
-
449
- /***/ 17:
450
- /***/ (function(module, exports) {
451
-
452
- module.exports = require("@splunk/react-ui/Popover");
453
-
454
454
  /***/ }),
455
455
 
456
456
  /***/ 2: