@splunk/react-ui 4.14.0 → 4.16.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 (137) hide show
  1. package/.dockerignore +2 -0
  2. package/Accordion.js +41 -16
  3. package/Anchor.js +9 -9
  4. package/Animation.js +6 -6
  5. package/AnimationToggle.js +2 -2
  6. package/Box.js +9 -9
  7. package/Button.js +54 -51
  8. package/ButtonGroup.js +9 -9
  9. package/ButtonSimple.js +68 -64
  10. package/CHANGELOG.md +46 -0
  11. package/Calendar.js +124 -106
  12. package/Card.js +68 -68
  13. package/CardLayout.js +9 -9
  14. package/Chip.js +22 -22
  15. package/Clickable.js +38 -14
  16. package/CloseButton.js +23 -23
  17. package/Code.js +484 -436
  18. package/CollapsiblePanel.js +59 -34
  19. package/Color.js +297 -187
  20. package/ColumnLayout.js +18 -17
  21. package/ComboBox.js +81 -32
  22. package/Concertina.js +88 -27
  23. package/ControlGroup.js +81 -24
  24. package/Date.js +54 -36
  25. package/DefinitionList.js +14 -8
  26. package/Divider.d.ts +2 -0
  27. package/Divider.js +9 -9
  28. package/Dockerfile.enterprise.storybook +7 -0
  29. package/Dockerfile.prisma.storybook +7 -0
  30. package/Dockerfile.visual +10 -0
  31. package/Dropdown.js +78 -18
  32. package/EventListener.js +17 -17
  33. package/File.js +108 -46
  34. package/FormRows.js +38 -37
  35. package/Heading.js +83 -55
  36. package/Image.js +63 -38
  37. package/JSONTree.js +106 -21
  38. package/Layer.js +59 -34
  39. package/Link.js +17 -17
  40. package/List.js +3 -3
  41. package/MIGRATION.md +21 -0
  42. package/Markdown.js +71 -65
  43. package/Menu.js +155 -121
  44. package/Message.js +129 -129
  45. package/MessageBar.js +136 -136
  46. package/Modal.js +57 -32
  47. package/ModalLayer.js +15 -15
  48. package/Monogram.js +18 -17
  49. package/Multiselect.js +2807 -2310
  50. package/Number.js +74 -37
  51. package/Paginator.js +96 -83
  52. package/Paragraph.js +10 -10
  53. package/Popover.js +191 -54
  54. package/Progress.js +23 -22
  55. package/RadioBar.js +32 -14
  56. package/RadioList.js +17 -11
  57. package/Resize.js +33 -20
  58. package/ResultsMenu.js +36 -23
  59. package/ScreenReaderContent.js +9 -9
  60. package/Scroll.js +51 -26
  61. package/ScrollContainerContext.js +48 -48
  62. package/Search.js +68 -31
  63. package/Select.js +501 -204
  64. package/SidePanel.js +37 -24
  65. package/Slider.js +54 -24
  66. package/SlidingPanels.js +52 -14
  67. package/SplitButton.js +23 -22
  68. package/StaticContent.js +9 -9
  69. package/StepBar.js +22 -22
  70. package/Switch.js +18 -13
  71. package/TabBar.js +22 -22
  72. package/TabLayout.js +46 -18
  73. package/Table.js +424 -166
  74. package/Text.js +91 -49
  75. package/TextArea.d.ts +2 -0
  76. package/TextArea.js +127 -49
  77. package/Tooltip.js +236 -59
  78. package/TransitionOpen.js +39 -26
  79. package/Typography.d.ts +2 -0
  80. package/Typography.js +18 -17
  81. package/WaitSpinner.js +15 -15
  82. package/docker-compose.yml +42 -0
  83. package/package.json +13 -12
  84. package/test-runner-jest.config.js +11 -6
  85. package/types/src/Accordion/AccordionContext.d.ts +1 -0
  86. package/types/src/Button/Button.d.ts +5 -2
  87. package/types/src/Button/docs/examples/Basic.d.ts +2 -2
  88. package/types/src/Button/docs/examples/Selected.d.ts +2 -2
  89. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +1 -0
  90. package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -11
  91. package/types/src/Calendar/Calendar.d.ts +2 -0
  92. package/types/src/CardLayout/CardLayoutContext.d.ts +1 -0
  93. package/types/src/Concertina/ConcertinaContext.d.ts +1 -0
  94. package/types/src/ControlGroup/ControlGroup.d.ts +15 -8
  95. package/types/src/ControlGroup/docs/examples/HelpWithErrorText.d.ts +2 -0
  96. package/types/src/ControlGroup/docs/examples/Required.d.ts +2 -0
  97. package/types/src/File/File.d.ts +4 -2
  98. package/types/src/File/FileContext.d.ts +1 -0
  99. package/types/src/FormRows/FormRowsContext.d.ts +1 -0
  100. package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
  101. package/types/src/Menu/MenuContext.d.ts +1 -0
  102. package/types/src/Modal/ModalContext.d.ts +1 -0
  103. package/types/src/Multiselect/Compact.d.ts +14 -1
  104. package/types/src/Multiselect/Multiselect.d.ts +15 -1
  105. package/types/src/Multiselect/Normal.d.ts +2 -0
  106. package/types/src/Popover/Popover.d.ts +25 -5
  107. package/types/src/Popover/PopoverContext.d.ts +1 -0
  108. package/types/src/RadioBar/RadioBar.d.ts +5 -3
  109. package/types/src/RadioBar/RadioBarContext.d.ts +1 -0
  110. package/types/src/RadioList/RadioList.d.ts +5 -1
  111. package/types/src/RadioList/RadioListContext.d.ts +1 -0
  112. package/types/src/Select/Select.d.ts +3 -1
  113. package/types/src/Select/SelectBase.d.ts +14 -0
  114. package/types/src/Slider/Slider.d.ts +5 -3
  115. package/types/src/StepBar/StepBarContext.d.ts +1 -0
  116. package/types/src/Switch/Switch.d.ts +2 -0
  117. package/types/src/TabBar/TabBarContext.d.ts +1 -0
  118. package/types/src/TabLayout/Panel.d.ts +3 -0
  119. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  120. package/types/src/Table/Body.d.ts +2 -0
  121. package/types/src/Table/Head.d.ts +2 -0
  122. package/types/src/Table/Row.d.ts +11 -3
  123. package/types/src/Table/Table.d.ts +5 -3
  124. package/types/src/Table/TableContext.d.ts +1 -0
  125. package/types/src/Text/Text.d.ts +5 -3
  126. package/types/src/TextArea/TextArea.d.ts +5 -3
  127. package/types/src/Tooltip/Tooltip.d.ts +16 -4
  128. package/types/src/Typography/Typography.d.ts +1 -1
  129. package/types/src/useForceUpdate/useForceUpdate.d.ts +1 -0
  130. package/useForceUpdate.js +9 -9
  131. package/useKeyPress.js +2 -2
  132. package/usePrevious.js +9 -9
  133. package/.storybook-visual/config/snapshotResolver.js +0 -29
  134. package/.storybook-visual/main.js +0 -22
  135. package/.storybook-visual/preview.jsx +0 -31
  136. package/.storybook-visual/scripts/test.sh +0 -108
  137. package/.storybook-visual/test-runner.js +0 -108
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { OptionClickHandler, OnKeyDownHandler } from './Option';
2
3
  export interface RadioBarContext {
3
4
  appearance?: 'default' | 'pill' | 'prisma';
@@ -42,6 +42,8 @@ interface RadioListPropsBase {
42
42
  * change.
43
43
  */
44
44
  onChange?: RadioListChangeHandler;
45
+ /** @private. */
46
+ required?: boolean;
45
47
  /**
46
48
  * When placed in a ControlGroup, this is automatically set to the ControlGroup's label.
47
49
  * @private
@@ -64,7 +66,7 @@ interface RadioListPropsBaseUncontrolled extends RadioListPropsBase {
64
66
  value?: never;
65
67
  }
66
68
  declare type RadioListProps = ComponentProps<RadioListPropsBaseControlled | RadioListPropsBaseUncontrolled, 'div'>;
67
- declare function RadioList({ children, defaultValue: defaultValueProp, describedBy, direction, disabled, error, labelledBy, name: nameProp, onChange, value: valueProp, ...otherProps }: RadioListProps): JSX.Element;
69
+ declare function RadioList({ children, defaultValue: defaultValueProp, describedBy, direction, disabled, error, labelledBy, name: nameProp, onChange, required, value: valueProp, ...otherProps }: RadioListProps): JSX.Element;
68
70
  declare namespace RadioList {
69
71
  var propTypes: {
70
72
  direction: PropTypes.Requireable<string>;
@@ -75,6 +77,8 @@ declare namespace RadioList {
75
77
  error: PropTypes.Requireable<boolean>;
76
78
  name: PropTypes.Requireable<string>;
77
79
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
80
+ /** @private. */
81
+ required: PropTypes.Requireable<boolean>;
78
82
  value: PropTypes.Requireable<any>;
79
83
  labelledBy: PropTypes.Requireable<string>;
80
84
  describedBy: PropTypes.Requireable<string>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
2
3
  export interface RadioListContext {
3
4
  value?: RadioListValueTypes;
@@ -1,6 +1,6 @@
1
1
  import React, { Component } from 'react';
2
2
  import { ClassComponentProps } from '../utils/types';
3
- import { Divider as BaseDivider, Heading as BaseHeading } from './SelectBase';
3
+ import { Divider as BaseDivider, Heading as BaseHeading, SelectBaseProps } from './SelectBase';
4
4
  import Option from './Option';
5
5
  /** @public */
6
6
  declare type SelectChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>, data: {
@@ -161,6 +161,8 @@ interface SelectPropsBase {
161
161
  * toggle.
162
162
  */
163
163
  value?: string | number | boolean;
164
+ /** @private */
165
+ toggle?: SelectBaseProps['toggle'];
164
166
  }
165
167
  declare const defaultProps: Required<Pick<SelectPropsBase, 'allowKeyMatching' | 'animateLoading' | 'appearance' | 'append' | 'children' | 'defaultPlacement' | 'disabled' | 'error' | 'filter' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'noOptionsMessage' | 'placeholder' | 'prepend'>>;
166
168
  interface SelectPropsBaseControlled extends SelectPropsBase {
@@ -139,6 +139,8 @@ interface SelectBasePropsBase {
139
139
  * A callback function invoked when the popover opens.
140
140
  */
141
141
  onOpen?: () => void;
142
+ /** @private. */
143
+ required?: boolean;
142
144
  /**
143
145
  * If 'values' is undefined or don't match an item, the Button will display this text.
144
146
  */
@@ -167,6 +169,17 @@ interface SelectBasePropsBase {
167
169
  * toggle.
168
170
  */
169
171
  values?: (string | number | boolean)[];
172
+ /**
173
+ * @private
174
+ *
175
+ * A toggle, such as a button or equivalent component that accepts `ref`, must be passed.
176
+ * This prop is only supported for Select and Multiselect Compact.
177
+ * `aria-haspopup`, `aria-expanded`, and `aria-controls` attributes are applied to the toggle to support accessibility.
178
+ * The result of the `ref` placed on the toggle must be an instance of `HTMLElement`. Results that are instances
179
+ * of class components are not supported. `Button`, `Clickable`, and `Link` are exempt from this restriction.
180
+ * Also see ["Forwarding Refs"](https://reactjs.org/docs/forwarding-refs.html).
181
+ */
182
+ toggle?: React.ReactElement;
170
183
  }
171
184
  declare const defaultProps: Required<Pick<SelectBasePropsBase, 'allowKeyMatching' | 'allowNewValues' | 'animateLoading' | 'appearance' | 'append' | 'defaultPlacement' | 'disabled' | 'filter' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'multiple' | 'noOptionsMessage' | 'placeholder' | 'prepend' | 'repositionMode' | 'tabConfirmsNewValue'>>;
172
185
  interface SelectBasePropsBaseControlled extends SelectBasePropsBase {
@@ -240,6 +253,7 @@ declare class SelectBase extends Component<SelectBaseProps, SelectBaseState> {
240
253
  */
241
254
  focus(): void;
242
255
  private renderControls;
256
+ private createToggle;
243
257
  private createChildren;
244
258
  private wrapLabel;
245
259
  render(): JSX.Element;