@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.
- package/Accordion.js +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -4
- package/ButtonGroup.js +10 -11
- package/ButtonSimple.js +48 -42
- package/CHANGELOG.md +26 -0
- package/CHANGELOG.v5.mdx +81 -0
- package/Calendar.js +352 -469
- package/Card.js +178 -321
- package/Chip.js +154 -296
- package/Clickable.js +30 -30
- package/Code.js +64 -49
- package/Color.js +546 -462
- package/ComboBox.js +575 -767
- package/Date.js +144 -136
- package/Divider.js +29 -26
- package/DualListbox.js +441 -444
- package/File.js +707 -981
- package/FormRows.js +260 -286
- package/Image.js +124 -251
- package/JSONTree.js +129 -129
- package/Layout.d.ts +2 -0
- package/Link.js +12 -12
- package/MIGRATION.mdx +22 -1
- package/MIGRATION.v5.mdx +12 -1
- package/Menu.js +76 -76
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +42 -40
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1989 -2362
- package/NonInteractiveCheckbox.js +30 -118
- package/Number.js +75 -73
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Resize.js +62 -65
- package/Scroll.js +2 -2
- package/Select.js +281 -283
- package/SidePanel.js +53 -55
- package/Slider.js +370 -364
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +170 -343
- package/StaticContent.js +15 -13
- package/StepBar.js +61 -60
- package/Switch.js +150 -164
- package/TabBar.js +544 -417
- package/Table.js +1711 -1540
- package/Text.js +28 -26
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +179 -158
- package/Tree.d.ts +2 -0
- package/WaitSpinner.js +1 -1
- package/package.json +7 -9
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +27 -14
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +1 -1
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/Color/Color.d.ts +3 -3
- package/types/src/Color/ColorInput.d.ts +27 -0
- package/types/src/Color/Palette.d.ts +11 -18
- package/types/src/Color/Swatch.d.ts +3 -1
- package/types/src/ComboBox/ComboBox.d.ts +46 -50
- package/types/src/ComboBox/Option.d.ts +34 -18
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/Date.d.ts +3 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/Divider/Divider.d.ts +14 -6
- package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +6 -6
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +7 -0
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +8 -8
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/MessageBar/MessageBar.d.ts +5 -1
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +49 -21
- package/types/src/Multiselect/Multiselect.d.ts +73 -30
- package/types/src/Multiselect/Normal.d.ts +46 -57
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +9 -8
- package/types/src/Number/Number.d.ts +1 -0
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/SidePanel/SidePanel.d.ts +8 -3
- package/types/src/Slider/Slider.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +34 -20
- package/types/src/SplitButton/SplitButton.d.ts +4 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/Switch.d.ts +1 -9
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +4 -3
- package/types/src/TabBar/TabBarContext.d.ts +7 -2
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/File/Icon.d.ts +0 -3
- package/types/src/File/IconCloud.d.ts +0 -3
- package/types/src/File/PaperClip.d.ts +0 -3
- package/types/src/File/Retry.d.ts +0 -2
- package/types/src/File/Trash.d.ts +0 -3
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- 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: {
|
|
@@ -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,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("
|
|
108
|
-
var Heading: typeof import("
|
|
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("
|
|
286
|
-
var Heading: typeof import("
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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<
|
|
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:
|
|
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<
|
|
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
|
|
2
|
-
import
|
|
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
|
|
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?:
|
|
40
|
+
onClick?: ItemClickHandler;
|
|
25
41
|
}
|
|
26
|
-
|
|
27
|
-
type ItemProps = ClassComponentProps<ItemPropsBase, typeof defaultProps, 'button'>;
|
|
42
|
+
type ItemProps = ComponentProps<ItemPropsBase, 'button'>;
|
|
28
43
|
/**
|
|
29
|
-
* An item within a `SplitButton`.
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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?:
|
|
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
|
|
@@ -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,
|
|
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
|
-
({
|
|
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
|
-
({
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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,
|
|
77
|
+
export { HeadAutosizeColumnHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler, getCellWidths, };
|