@splunk/react-ui 5.0.0-beta.2 → 5.0.0-beta.4

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 (187) hide show
  1. package/Accordion.js +185 -243
  2. package/Animation.js +2 -2
  3. package/Button.js +4 -4
  4. package/ButtonGroup.js +10 -11
  5. package/ButtonSimple.js +48 -42
  6. package/CHANGELOG.md +26 -0
  7. package/CHANGELOG.v5.mdx +81 -0
  8. package/Calendar.js +352 -469
  9. package/Card.js +178 -321
  10. package/Chip.js +154 -296
  11. package/Clickable.js +30 -30
  12. package/Code.js +64 -49
  13. package/Color.js +546 -462
  14. package/ComboBox.js +575 -767
  15. package/Date.js +144 -136
  16. package/Divider.js +29 -26
  17. package/DualListbox.js +441 -444
  18. package/File.js +707 -981
  19. package/FormRows.js +260 -286
  20. package/Image.js +124 -251
  21. package/JSONTree.js +129 -129
  22. package/Layout.d.ts +2 -0
  23. package/Link.js +12 -12
  24. package/MIGRATION.mdx +22 -1
  25. package/MIGRATION.v5.mdx +12 -1
  26. package/Menu.js +76 -76
  27. package/Message.js +77 -100
  28. package/MessageBar.js +141 -251
  29. package/Modal.js +42 -40
  30. package/ModalLayer.js +12 -12
  31. package/Multiselect.js +1989 -2362
  32. package/NonInteractiveCheckbox.js +30 -118
  33. package/Number.js +75 -73
  34. package/Popover.js +348 -350
  35. package/Progress.js +1 -1
  36. package/RadioBar.js +136 -136
  37. package/Resize.js +62 -65
  38. package/Scroll.js +2 -2
  39. package/Select.js +281 -283
  40. package/SidePanel.js +53 -55
  41. package/Slider.js +370 -364
  42. package/SlidingPanels.js +100 -102
  43. package/SplitButton.js +170 -343
  44. package/StaticContent.js +15 -13
  45. package/StepBar.js +61 -60
  46. package/Switch.js +150 -164
  47. package/TabBar.js +544 -417
  48. package/Table.js +1711 -1540
  49. package/Text.js +28 -26
  50. package/TextArea.js +26 -26
  51. package/Tooltip.js +416 -562
  52. package/TransitionOpen.js +179 -158
  53. package/Tree.d.ts +2 -0
  54. package/WaitSpinner.js +1 -1
  55. package/package.json +7 -9
  56. package/types/src/Accordion/Accordion.d.ts +14 -21
  57. package/types/src/Accordion/AccordionContext.d.ts +0 -1
  58. package/types/src/Animation/Animation.d.ts +2 -3
  59. package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
  60. package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
  61. package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
  62. package/types/src/Button/Button.d.ts +2 -2
  63. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
  64. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
  65. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  66. package/types/src/Calendar/Calendar.d.ts +2 -2
  67. package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
  68. package/types/src/Calendar/Day.d.ts +8 -4
  69. package/types/src/Card/Card.d.ts +27 -14
  70. package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
  71. package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
  72. package/types/src/Clickable/Clickable.d.ts +1 -1
  73. package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
  74. package/types/src/Color/Color.d.ts +3 -3
  75. package/types/src/Color/ColorInput.d.ts +27 -0
  76. package/types/src/Color/Palette.d.ts +11 -18
  77. package/types/src/Color/Swatch.d.ts +3 -1
  78. package/types/src/ComboBox/ComboBox.d.ts +46 -50
  79. package/types/src/ComboBox/Option.d.ts +34 -18
  80. package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
  81. package/types/src/Date/Date.d.ts +3 -2
  82. package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
  83. package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
  84. package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
  85. package/types/src/Divider/Divider.d.ts +14 -6
  86. package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
  87. package/types/src/DualListbox/DualListbox.d.ts +5 -1
  88. package/types/src/File/File.d.ts +6 -6
  89. package/types/src/File/FileContext.d.ts +0 -1
  90. package/types/src/File/Item.d.ts +11 -3
  91. package/types/src/File/ItemIcon.d.ts +7 -0
  92. package/types/src/File/docs/examples/Disabled.d.ts +2 -2
  93. package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
  94. package/types/src/File/docs/examples/Multi.d.ts +2 -2
  95. package/types/src/File/docs/examples/Single.d.ts +2 -2
  96. package/types/src/FormRows/FormRows.d.ts +8 -8
  97. package/types/src/FormRows/FormRowsContext.d.ts +1 -2
  98. package/types/src/FormRows/Row.d.ts +2 -2
  99. package/types/src/FormRows/RowInternal.d.ts +1 -1
  100. package/types/src/FormRows/SortableRow.d.ts +3 -3
  101. package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
  102. package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
  103. package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
  104. package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
  105. package/types/src/Image/Image.d.ts +1 -4
  106. package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
  107. package/types/src/Layout/Layout.d.ts +1 -0
  108. package/types/src/Link/icons/External.d.ts +1 -2
  109. package/types/src/Menu/Divider.d.ts +1 -1
  110. package/types/src/Menu/MenuContext.d.ts +0 -1
  111. package/types/src/MessageBar/MessageBar.d.ts +5 -1
  112. package/types/src/Modal/ModalContext.d.ts +0 -1
  113. package/types/src/Multiselect/Compact.d.ts +49 -21
  114. package/types/src/Multiselect/Multiselect.d.ts +73 -30
  115. package/types/src/Multiselect/Normal.d.ts +46 -57
  116. package/types/src/Multiselect/Option.d.ts +42 -18
  117. package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
  118. package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
  119. package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
  120. package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
  121. package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
  122. package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
  123. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
  124. package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
  125. package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
  126. package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +9 -8
  127. package/types/src/Number/Number.d.ts +1 -0
  128. package/types/src/Number/docs/examples/Basic.d.ts +2 -2
  129. package/types/src/Number/docs/examples/Limits.d.ts +2 -2
  130. package/types/src/Number/docs/examples/Locale.d.ts +2 -2
  131. package/types/src/Popover/Popover.d.ts +1 -1
  132. package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
  133. package/types/src/RadioBar/RadioBar.d.ts +1 -1
  134. package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
  135. package/types/src/RadioList/RadioListContext.d.ts +0 -1
  136. package/types/src/Scroll/Inner.d.ts +1 -1
  137. package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
  138. package/types/src/Search/Search.d.ts +2 -2
  139. package/types/src/Select/SelectBase.d.ts +2 -2
  140. package/types/src/SidePanel/SidePanel.d.ts +8 -3
  141. package/types/src/Slider/Slider.d.ts +1 -1
  142. package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
  143. package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
  144. package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
  145. package/types/src/SlidingPanels/Panel.d.ts +2 -2
  146. package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
  147. package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
  148. package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
  149. package/types/src/SplitButton/Item.d.ts +34 -20
  150. package/types/src/SplitButton/SplitButton.d.ts +4 -1
  151. package/types/src/StaticContent/StaticContent.d.ts +3 -1
  152. package/types/src/StepBar/Step.d.ts +1 -1
  153. package/types/src/StepBar/StepBar.d.ts +1 -1
  154. package/types/src/StepBar/StepBarContext.d.ts +0 -1
  155. package/types/src/Switch/Switch.d.ts +1 -9
  156. package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
  157. package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
  158. package/types/src/TabBar/Tab.d.ts +12 -5
  159. package/types/src/TabBar/TabBar.d.ts +4 -3
  160. package/types/src/TabBar/TabBarContext.d.ts +7 -2
  161. package/types/src/Table/Head.d.ts +4 -15
  162. package/types/src/Table/HeadCell.d.ts +23 -25
  163. package/types/src/Table/HeadDropdownCell.d.ts +23 -26
  164. package/types/src/Table/HeadInner.d.ts +4 -10
  165. package/types/src/Table/Row.d.ts +6 -6
  166. package/types/src/Table/Table.d.ts +3 -8
  167. package/types/src/Table/TableContext.d.ts +0 -1
  168. package/types/src/Table/Toggle.d.ts +1 -1
  169. package/types/src/Text/Text.d.ts +5 -1
  170. package/types/src/Tooltip/Tooltip.d.ts +26 -58
  171. package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
  172. package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
  173. package/types/src/Tree/TreeContext.d.ts +0 -1
  174. package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
  175. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
  176. package/types/src/utils/types.d.ts +2 -3
  177. package/useResizeObserver.js +26 -19
  178. package/types/src/File/Icon.d.ts +0 -3
  179. package/types/src/File/IconCloud.d.ts +0 -3
  180. package/types/src/File/PaperClip.d.ts +0 -3
  181. package/types/src/File/Retry.d.ts +0 -2
  182. package/types/src/File/Trash.d.ts +0 -3
  183. package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
  184. package/types/src/Image/icons/Cross.d.ts +0 -3
  185. package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +0 -3
  186. package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
  187. package/types/src/Tooltip/InfoIcon.d.ts +0 -4
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
2
  import { NumberChangeHandler } from '@splunk/react-ui/Number';
3
- declare class Limits extends Component<{}, {
3
+ declare class Limits extends Component<object, {
4
4
  value?: number;
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  handleChange: NumberChangeHandler;
8
8
  render(): React.JSX.Element;
9
9
  }
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
2
  import { NumberChangeHandler } from '@splunk/react-ui/Number';
3
- declare class Locale extends Component<{}, {
3
+ declare class Locale extends Component<object, {
4
4
  value?: number;
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  handleChange: NumberChangeHandler;
8
8
  render(): React.JSX.Element;
9
9
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { SpringConfig } from 'react-spring';
3
+ import { SpringConfig } from '@react-spring/web';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  /** @public */
6
6
  type PopoverChildrenRenderer = (data: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface PopoverMenuContextValue {
3
2
  retainFocus?: boolean;
4
3
  }
@@ -64,7 +64,7 @@ type RadioBarProps = ComponentProps<RadioBarPropsBaseControlled | RadioBarPropsB
64
64
  /**
65
65
  * RadioBar is a form control that provides the ability to select one option out of a group.
66
66
  */
67
- declare function RadioBar({ children, defaultValue: defaultValueProp, describedBy, error, labelledBy, name, onChange, required, role, value: valueProp, ...otherProps }: RadioBarProps): React.JSX.Element;
67
+ declare function RadioBar({ children, defaultValue: defaultValueProp, describedBy, elementRef, error, labelledBy, name, onChange, required, role, value: valueProp, ...otherProps }: RadioBarProps): React.JSX.Element;
68
68
  declare namespace RadioBar {
69
69
  var Option: typeof import("./Option").default;
70
70
  var propTypes: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { OptionClickHandler, OnKeyDownHandler } from './Option';
3
2
  export interface RadioBarContext {
4
3
  onClick?: OptionClickHandler;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
3
2
  export interface RadioListContext {
4
3
  disabled?: boolean;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { SpringValue } from 'react-spring';
3
+ import { SpringValue } from '@react-spring/web';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface InnerPropsBase {
6
6
  children?: React.ReactNode;
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
- declare class Basic extends Component<{}, {
2
+ declare class Basic extends Component<object, {
3
3
  top?: number;
4
4
  }> {
5
5
  private scrollEl;
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  handleClickDown: () => void;
8
8
  handleClickUp: () => void;
9
9
  handleScrollComplete: () => void;
@@ -104,8 +104,8 @@ declare function Search({ animateLoading, children, defaultPlacement, defaultVal
104
104
  declare namespace Search {
105
105
  var propTypes: React.WeakValidationMap<SearchPropsBase>;
106
106
  var Option: typeof import("./Option").default;
107
- var Divider: typeof import("../Menu/Divider").default;
108
- var Heading: typeof import("../Menu/Heading").default;
107
+ var Divider: typeof import("@splunk/react-ui/Menu").Divider;
108
+ var Heading: typeof import("@splunk/react-ui/Menu").Heading;
109
109
  }
110
110
  export default Search;
111
111
  export { SearchBlurHandler, SearchChangeHandler, SearchFocusHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
@@ -282,8 +282,8 @@ declare namespace SelectBase {
282
282
  };
283
283
  var componentType: string;
284
284
  var Option: typeof import("./OptionBase").default;
285
- var Divider: typeof import("../Menu/Divider").default;
286
- var Heading: typeof import("../Menu/Heading").default;
285
+ var Divider: typeof import("@splunk/react-ui/Menu").Divider;
286
+ var Heading: typeof import("@splunk/react-ui/Menu").Heading;
287
287
  }
288
288
  export default SelectBase;
289
289
  export { Controls, ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
@@ -10,9 +10,13 @@ type SidePanelRequestCloseHandler = (data: {
10
10
  interface SidePanelPropsBase extends TransitionOpenPropsBase {
11
11
  children?: React.ReactNode;
12
12
  /**
13
- * The position of the panel on the screen.
13
+ * The position of the Panel on the screen.
14
14
  */
15
15
  dockPosition?: 'top' | 'bottom' | 'left' | 'right';
16
+ /**
17
+ * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
18
+ */
19
+ elementRef?: React.Ref<HTMLDivElement>;
16
20
  /**
17
21
  * The inner element can control the width of the side bar when placed left or right and
18
22
  * the height when placed top or bottom.
@@ -56,16 +60,17 @@ interface SidePanelPropsBase extends TransitionOpenPropsBase {
56
60
  outerStyle?: React.CSSProperties;
57
61
  /**
58
62
  * Indicates whether to add an overlay mask on the whole page, blocking other interactions
59
- * while the panel is open.
63
+ * while the Panel is open.
60
64
  */
61
65
  useLayerForClickAway?: boolean;
62
66
  }
63
67
  type SidePanelProps = ComponentProps<SidePanelPropsBase, 'div'>;
64
- declare function SidePanel({ children, dockPosition, innerClassName, innerStyle, onAnimationEnd, onRequestClose, open, outerClassName, outerStyle, useLayerForClickAway, ...otherProps }: SidePanelProps): React.JSX.Element;
68
+ declare function SidePanel({ children, dockPosition, elementRef, innerClassName, innerStyle, onAnimationEnd, onRequestClose, open, outerClassName, outerStyle, useLayerForClickAway, ...otherProps }: SidePanelProps): React.JSX.Element;
65
69
  declare namespace SidePanel {
66
70
  var propTypes: {
67
71
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
68
72
  dockPosition: PropTypes.Requireable<string>;
73
+ elementRef: PropTypes.Requireable<object>;
69
74
  innerClassName: PropTypes.Requireable<string>;
70
75
  innerStyle: PropTypes.Requireable<object>;
71
76
  onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
@@ -43,7 +43,7 @@ interface SliderPropsBase {
43
43
  /** The maximum value of the Slider input. */
44
44
  max?: number;
45
45
  /**
46
- * The label shown to the left of the slider. Defaults to the max value.
46
+ * The label shown to the right of the slider. Defaults to the max value.
47
47
  * Set to null to remove.
48
48
  */
49
49
  maxLabel?: React.ReactNode;
@@ -1,10 +1,10 @@
1
1
  import React, { Component } from 'react';
2
2
  import { SliderChangeHandler } from '@splunk/react-ui/Slider';
3
3
  import { NumberChangeHandler } from '@splunk/react-ui/Number';
4
- declare class Controlled extends Component<{}, {
4
+ declare class Controlled extends Component<object, {
5
5
  value?: number;
6
6
  }> {
7
- constructor(props: {});
7
+ constructor(props: object);
8
8
  handleSliderChange: SliderChangeHandler;
9
9
  handleNumberChange: NumberChangeHandler;
10
10
  render(): React.JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import React, { Component } from 'react';
2
2
  import { SliderChangeHandler } from '@splunk/react-ui/Slider';
3
- declare class CustomLabels extends Component<{}, {
3
+ declare class CustomLabels extends Component<object, {
4
4
  displayValue: string;
5
5
  value: number;
6
6
  }> {
7
7
  static convertValueToLabel(value: number): string;
8
- constructor(props: {});
8
+ constructor(props: object);
9
9
  handleChange: SliderChangeHandler;
10
10
  render(): React.JSX.Element;
11
11
  }
@@ -0,0 +1,8 @@
1
+ import { AnyTheme, InterpolationResult } from '@splunk/themes';
2
+ declare function getStepMarksBackground<T extends AnyTheme, A extends object>({ stepWidth, thumbPosition, beforeThumbStepColor, afterThumbStepColor, }: {
3
+ stepWidth: number;
4
+ thumbPosition?: number;
5
+ beforeThumbStepColor: InterpolationResult<T, A>;
6
+ afterThumbStepColor: InterpolationResult<T, A>;
7
+ }): import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@splunk/themes").ThemedProps<T> & A, any>>;
8
+ export default getStepMarksBackground;
@@ -22,7 +22,7 @@ interface PanelPropsBase {
22
22
  /**
23
23
  * A unique `id` for this panel and used by the SlidingPanels to keep track of the open panel.
24
24
  */
25
- panelId: any;
25
+ panelId: string | number;
26
26
  }
27
27
  type PanelProps = ComponentProps<PanelPropsBase, 'div'>;
28
28
  /**
@@ -37,7 +37,7 @@ declare namespace Panel {
37
37
  onMount: PropTypes.Requireable<(...args: any[]) => any>;
38
38
  /** @private */
39
39
  onUnmount: PropTypes.Requireable<(...args: any[]) => any>;
40
- panelId: PropTypes.Validator<any>;
40
+ panelId: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
41
41
  };
42
42
  }
43
43
  export default Panel;
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import Panel from './Panel';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface SlidingPanelsPropsBase {
6
- activePanelId: any;
6
+ activePanelId: string | number;
7
7
  children?: React.ReactNode;
8
8
  /**
9
9
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
@@ -23,7 +23,7 @@ type SlidingPanelsProps = ComponentProps<SlidingPanelsPropsBase, 'div'>;
23
23
  declare function SlidingPanels({ activePanelId, children, elementRef, innerClassName, innerStyle, onAnimationEnd, outerClassName, outerStyle, transition, ...otherProps }: SlidingPanelsProps): React.JSX.Element;
24
24
  declare namespace SlidingPanels {
25
25
  var propTypes: {
26
- activePanelId: PropTypes.Validator<any>;
26
+ activePanelId: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
27
27
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
28
28
  elementRef: PropTypes.Requireable<object>;
29
29
  innerClassName: PropTypes.Requireable<string>;
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
- declare class Basic extends Component<{}, {
2
+ declare class Basic extends Component<object, {
3
3
  activePanelId: string;
4
4
  transition: 'forward' | 'backward';
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  goBack: () => void;
8
8
  goForward: () => void;
9
9
  render(): React.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
- declare class DropdownExample extends Component<{}, {
2
+ declare class DropdownExample extends Component<object, {
3
3
  activePanelId: string;
4
4
  transition: 'forward' | 'backward';
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  goBack: () => void;
8
8
  goForward: () => void;
9
9
  render(): React.JSX.Element;
@@ -1,11 +1,19 @@
1
- import React, { PureComponent } from 'react';
2
- import { ClassComponentProps } from '../utils/types';
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { ComponentProps } from '../utils/types';
4
+ /** @public */
5
+ type ItemClickHandler = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>, data: {
6
+ action?: string;
7
+ icon?: React.ReactNode;
8
+ label?: React.ReactNode;
9
+ value?: any;
10
+ }) => void;
3
11
  interface ItemPropsBase {
4
12
  /**
5
13
  * Changes the style if isMain=true, passed from SplitButton.
6
14
  * @private
7
15
  */
8
- appearance: 'default' | 'primary' | 'destructive';
16
+ appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary';
9
17
  /**
10
18
  * Becomes the label.
11
19
  */
@@ -14,6 +22,14 @@ interface ItemPropsBase {
14
22
  * Prevents user from clicking the button.
15
23
  */
16
24
  disabled?: boolean;
25
+ /**
26
+ * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
27
+ */
28
+ elementRef?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
29
+ /**
30
+ * Applies an icon in front of the label.
31
+ */
32
+ icon?: React.ReactNode;
17
33
  /**
18
34
  * Becomes the main button. If no `Item`s have this prop, the first `Item` is the main button.
19
35
  */
@@ -21,25 +37,23 @@ interface ItemPropsBase {
21
37
  /**
22
38
  * A callback for when an item is clicked.
23
39
  */
24
- onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
40
+ onClick?: ItemClickHandler;
25
41
  }
26
- declare const defaultProps: Required<Pick<ItemPropsBase, 'appearance'>>;
27
- type ItemProps = ClassComponentProps<ItemPropsBase, typeof defaultProps, 'button'>;
42
+ type ItemProps = ComponentProps<ItemPropsBase, 'button'>;
28
43
  /**
29
- * An item within a `SplitButton`. This inherits from
30
- * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
31
- * so any elements passed to it must also be pure.
44
+ * An item within a `SplitButton`.
32
45
  */
33
- declare class Item extends PureComponent<ItemProps, {}> {
34
- private itemRef;
35
- static propTypes: React.WeakValidationMap<ItemProps>;
36
- static defaultProps: Required<Pick<ItemPropsBase, "appearance">>;
37
- private handleClick;
38
- scrollIntoViewIfNeeded(): void;
39
- /**
40
- * Place focus on the item.
41
- */
42
- focus(): void;
43
- render(): React.JSX.Element;
46
+ declare function Item({ appearance, disabled, elementRef, icon: iconProp, isMain, children, onClick, ...otherProps }: ItemProps): React.JSX.Element;
47
+ declare namespace Item {
48
+ var propTypes: {
49
+ appearance: PropTypes.Requireable<string>;
50
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
51
+ disabled: PropTypes.Requireable<boolean>;
52
+ elementRef: PropTypes.Requireable<object>;
53
+ icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
54
+ isMain: PropTypes.Requireable<boolean>;
55
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
56
+ };
44
57
  }
45
58
  export default Item;
59
+ export { ItemClickHandler };
@@ -5,8 +5,11 @@ import { ComponentProps } from '../utils/types';
5
5
  interface SplitButtonPropsBase {
6
6
  /**
7
7
  * Changes the style of the main button and toggle.
8
+ *
9
+ * @deprecatedValue 'default'
10
+ * The `default` value is deprecated and will be removed in a future major version.
8
11
  */
9
- appearance?: 'default' | 'primary' | 'destructive';
12
+ appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary';
10
13
  /**
11
14
  * Must be `SplitButton.Item`. By default the first child becomes the main button. The remaining children become dropdown items.
12
15
  */
@@ -9,18 +9,20 @@ interface StaticContentPropsBase {
9
9
  elementRef?: React.Ref<HTMLDivElement>;
10
10
  /** When true, display as inline-block with auto width. */
11
11
  inline?: boolean;
12
+ labelledBy?: string;
12
13
  }
13
14
  type StaticContentProps = ComponentProps<StaticContentPropsBase, 'div'>;
14
15
  /**
15
16
  * This component is intended for use in a control group, either to display a static value or
16
17
  * between two controls.
17
18
  */
18
- declare function StaticContent({ children, elementRef, inline, ...otherProps }: StaticContentProps): React.JSX.Element;
19
+ declare function StaticContent({ children, elementRef, inline, labelledBy, ...otherProps }: StaticContentProps): React.JSX.Element;
19
20
  declare namespace StaticContent {
20
21
  var propTypes: {
21
22
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
23
  elementRef: PropTypes.Requireable<object>;
23
24
  inline: PropTypes.Requireable<boolean>;
25
+ labelledBy: PropTypes.Requireable<string>;
24
26
  };
25
27
  }
26
28
  export default StaticContent;
@@ -13,7 +13,7 @@ interface StepPropsBase {
13
13
  * A unique `id` for this step and used by the `StepBar` to keep track of the open `Step`.
14
14
  * Defaults to a zero-based index matching the component's position in `StepBar`.
15
15
  */
16
- stepId?: any;
16
+ stepId?: number;
17
17
  }
18
18
  type StepProps = ComponentProps<StepPropsBase, 'li'>;
19
19
  declare function Step({ children, elementRef, error, // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -4,7 +4,7 @@ import Step from './Step';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface StepBarPropsBase {
6
6
  /** The `stepId` of the `StepBar.Step` to activate. */
7
- activeStepId: any;
7
+ activeStepId: number;
8
8
  /**
9
9
  * Must be `StepBar.Step`.
10
10
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface StepBarContext {
3
2
  activeStepId: number;
4
3
  idCounter?: string;
@@ -32,12 +32,6 @@ interface SwitchPropsBase {
32
32
  * Make the control an inline block with variable width.
33
33
  */
34
34
  inline?: boolean;
35
- /**
36
- * In a couple of cases, the switch is to show state, but is not interactive in itself.
37
- * The parent takes focus and handles click. Set interactive to false to prevent focus and
38
- * hover states, and remove accessibility properties.
39
- * @private */
40
- interactive?: boolean;
41
35
  /**
42
36
  * If `Switch` is not provided children as the label, an id can be provided to
43
37
  * another element.
@@ -88,7 +82,7 @@ type SwitchProps = ComponentProps<SwitchCheckboxWithSomePropsBase | SwitchNoSome
88
82
  /**
89
83
  * `Switch` is a basic form control with an on/off state.
90
84
  */
91
- declare function Switch({ appearance, children, disabled, elementRef, error, id, inline, interactive, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
85
+ declare function Switch({ appearance, children, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
92
86
  declare namespace Switch {
93
87
  var propTypes: {
94
88
  appearance: PropTypes.Requireable<string>;
@@ -98,8 +92,6 @@ declare namespace Switch {
98
92
  error: PropTypes.Requireable<boolean>;
99
93
  id: PropTypes.Requireable<string>;
100
94
  inline: PropTypes.Requireable<boolean>;
101
- /** @private */
102
- interactive: PropTypes.Requireable<boolean>;
103
95
  labelledBy: PropTypes.Requireable<string>;
104
96
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
105
97
  /** @private. */
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
2
  import { SwitchClickHandler } from '@splunk/react-ui/Switch';
3
- declare class Basic extends Component<{}, {
3
+ declare class Basic extends Component<object, {
4
4
  values: number[];
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  handleClick: SwitchClickHandler;
8
8
  render(): React.JSX.Element;
9
9
  }
@@ -1,9 +1,9 @@
1
1
  import React, { Component } from 'react';
2
2
  import { SwitchClickHandler } from '@splunk/react-ui/Switch';
3
- declare class Disabled extends Component<{}, {
3
+ declare class Disabled extends Component<object, {
4
4
  values: number[];
5
5
  }> {
6
- constructor(props: {});
6
+ constructor(props: object);
7
7
  handleClick: SwitchClickHandler;
8
8
  render(): React.JSX.Element;
9
9
  }
@@ -8,8 +8,6 @@ type TabFocusHandler = (event: React.FocusEvent<HTMLButtonElement>, data: {
8
8
  tabId: string;
9
9
  }) => void;
10
10
  interface TabPropsBase {
11
- /** @private. Is the tab active. */
12
- active?: boolean;
13
11
  /**
14
12
  * The ariaControls prop is the element `id` of the content displayed when the tab is selected.
15
13
  */
@@ -53,13 +51,16 @@ interface TabPropsBase {
53
51
  * The `menu` prop is only supported in horizontal layout due to both design constraints as well as keyboard support.
54
52
  */
55
53
  menu?: React.ReactNode;
54
+ /**
55
+ * @private
56
+ * Internal prop injected by TabBar to track focus order.
57
+ */
58
+ index?: number;
56
59
  }
57
60
  type TabProps = ComponentProps<TabPropsBase, 'div'>;
58
61
  declare const Tab: {
59
- ({ active, ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, ...otherProps }: TabProps): React.JSX.Element;
62
+ ({ ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, index, ...otherProps }: TabProps): React.JSX.Element;
60
63
  propTypes: {
61
- /** @private. Is the tab active. */
62
- active: PropTypes.Requireable<boolean>;
63
64
  ariaControls: PropTypes.Requireable<string>;
64
65
  count: PropTypes.Requireable<number>;
65
66
  disabled: PropTypes.Requireable<boolean>;
@@ -79,7 +80,13 @@ declare const Tab: {
79
80
  * The `menu` prop is only supported in horizontal layout due to both design constraints as well as keyboard support.
80
81
  */
81
82
  menu: PropTypes.Requireable<PropTypes.ReactNodeLike>;
83
+ /**
84
+ * @private
85
+ * Internal prop injected by TabBar to track order.
86
+ */
87
+ index: PropTypes.Requireable<number>;
82
88
  };
89
+ as: string;
83
90
  };
84
91
  export default Tab;
85
92
  export { TabClickHandler, TabFocusHandler };
@@ -46,9 +46,8 @@ declare namespace TabBar {
46
46
  tabWidth: PropTypes.Requireable<number>;
47
47
  };
48
48
  var Tab: {
49
- ({ active, ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, ...otherProps }: import("./Tab").TabPropsBase & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "css" | keyof import("./Tab").TabPropsBase>): React.JSX.Element;
49
+ ({ ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, index, ...otherProps }: import("./Tab").TabPropsBase & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "css" | keyof import("./Tab").TabPropsBase>): React.JSX.Element;
50
50
  propTypes: {
51
- active: PropTypes.Requireable<boolean>;
52
51
  ariaControls: PropTypes.Requireable<string>;
53
52
  count: PropTypes.Requireable<number>;
54
53
  disabled: PropTypes.Requireable<boolean>;
@@ -61,9 +60,11 @@ declare namespace TabBar {
61
60
  to: PropTypes.Requireable<string>;
62
61
  tooltip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
63
62
  menu: PropTypes.Requireable<PropTypes.ReactNodeLike>;
63
+ index: PropTypes.Requireable<number>;
64
64
  };
65
+ as: string;
65
66
  };
66
67
  }
67
68
  export default TabBar;
68
69
  export { Tab };
69
- export type { TabBarChangeHandler };
70
+ export type { TabBarChangeHandler, TabBarPropsBase };
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import type { DropdownRequestCloseHandler } from '@splunk/react-ui/Dropdown';
3
2
  import type { TabClickHandler, TabFocusHandler } from './Tab';
4
3
  export interface TabBarContext {
5
4
  active?: string;
6
5
  disabled?: boolean;
7
- focusedTabId: string | null;
6
+ focusedTabId?: string;
8
7
  iconPosition?: 'above' | 'left';
9
8
  layout?: 'horizontal' | 'vertical';
10
9
  onClick?: TabClickHandler;
@@ -13,6 +12,12 @@ export interface TabBarContext {
13
12
  onMenuOpen: (menusTabId: string) => void;
14
13
  onMenuClose: DropdownRequestCloseHandler;
15
14
  isMenuOpen: boolean;
15
+ registerTab: ({ tabId, element, index, }: {
16
+ tabId: string;
17
+ element: HTMLButtonElement | HTMLAnchorElement | null;
18
+ index: number;
19
+ }) => void;
20
+ activeTabId?: string;
16
21
  }
17
22
  export declare const TabBarContext: import("react").Context<TabBarContext>;
18
23
  export default TabBarContext;
@@ -3,15 +3,12 @@ import PropTypes from 'prop-types';
3
3
  import { TableRequestMoveColumnHandler } from './Table';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
6
- columnId: any;
6
+ columnId?: string;
7
7
  index: number;
8
8
  }) => void;
9
- type HeadDragStartHandler = (data: {
10
- dragIndex?: number;
11
- }) => void;
12
9
  type HeadRequestMoveColumnHandler = TableRequestMoveColumnHandler;
13
10
  type HeadRequestResizeColumnHandler = (event: React.KeyboardEvent<HTMLHRElement> | MouseEvent, data: {
14
- columnId: any;
11
+ columnId?: string;
15
12
  id?: string;
16
13
  index: number;
17
14
  width: number;
@@ -32,16 +29,12 @@ interface HeadPropsBase {
32
29
  */
33
30
  elementRef?: React.Ref<HTMLTableSectionElement>;
34
31
  /** @private. */
35
- guidelineIndex?: number;
36
- /** @private. */
37
32
  hasDragColumn?: boolean;
38
33
  /** @private. */
39
34
  hasInfoColumn?: boolean;
40
35
  /** @private. */
41
36
  onAutosizeColumn?: HeadAutosizeColumnHandler;
42
37
  /** @private. */
43
- onDragStart?: HeadDragStartHandler;
44
- /** @private. */
45
38
  onRequestMoveColumn?: HeadRequestMoveColumnHandler;
46
39
  /** @private. */
47
40
  onRequestResizeColumn?: HeadRequestResizeColumnHandler;
@@ -52,7 +45,7 @@ interface HeadPropsBase {
52
45
  }
53
46
  type HeadProps = ComponentProps<HeadPropsBase, 'thead'>;
54
47
  declare const getCellWidths: (headEl: HTMLTableSectionElement | null) => number[];
55
- declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, guidelineIndex, hasDragColumn, hasInfoColumn, onAutosizeColumn, onDragStart, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
48
+ declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
56
49
  declare namespace Head {
57
50
  var propTypes: {
58
51
  /** @private. */
@@ -64,16 +57,12 @@ declare namespace Head {
64
57
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
65
58
  elementRef: PropTypes.Requireable<object>;
66
59
  /** @private. */
67
- guidelineIndex: PropTypes.Requireable<number>;
68
- /** @private. */
69
60
  hasDragColumn: PropTypes.Requireable<boolean>;
70
61
  /** @private. */
71
62
  hasInfoColumn: PropTypes.Requireable<boolean>;
72
63
  /** @private. */
73
64
  onAutosizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
74
65
  /** @private. */
75
- onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
76
- /** @private. */
77
66
  onRequestMoveColumn: PropTypes.Requireable<(...args: any[]) => any>;
78
67
  /** @private. */
79
68
  onRequestResizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
@@ -85,4 +74,4 @@ declare namespace Head {
85
74
  var splunkUiType: string;
86
75
  }
87
76
  export default Head;
88
- export { HeadAutosizeColumnHandler, HeadDragStartHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler, getCellWidths, };
77
+ export { HeadAutosizeColumnHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler, getCellWidths, };