@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.
- package/.dockerignore +2 -0
- package/Accordion.js +41 -16
- package/Anchor.js +9 -9
- package/Animation.js +6 -6
- package/AnimationToggle.js +2 -2
- package/Box.js +9 -9
- package/Button.js +54 -51
- package/ButtonGroup.js +9 -9
- package/ButtonSimple.js +68 -64
- package/CHANGELOG.md +46 -0
- package/Calendar.js +124 -106
- package/Card.js +68 -68
- package/CardLayout.js +9 -9
- package/Chip.js +22 -22
- package/Clickable.js +38 -14
- package/CloseButton.js +23 -23
- package/Code.js +484 -436
- package/CollapsiblePanel.js +59 -34
- package/Color.js +297 -187
- package/ColumnLayout.js +18 -17
- package/ComboBox.js +81 -32
- package/Concertina.js +88 -27
- package/ControlGroup.js +81 -24
- package/Date.js +54 -36
- package/DefinitionList.js +14 -8
- package/Divider.d.ts +2 -0
- package/Divider.js +9 -9
- package/Dockerfile.enterprise.storybook +7 -0
- package/Dockerfile.prisma.storybook +7 -0
- package/Dockerfile.visual +10 -0
- package/Dropdown.js +78 -18
- package/EventListener.js +17 -17
- package/File.js +108 -46
- package/FormRows.js +38 -37
- package/Heading.js +83 -55
- package/Image.js +63 -38
- package/JSONTree.js +106 -21
- package/Layer.js +59 -34
- package/Link.js +17 -17
- package/List.js +3 -3
- package/MIGRATION.md +21 -0
- package/Markdown.js +71 -65
- package/Menu.js +155 -121
- package/Message.js +129 -129
- package/MessageBar.js +136 -136
- package/Modal.js +57 -32
- package/ModalLayer.js +15 -15
- package/Monogram.js +18 -17
- package/Multiselect.js +2807 -2310
- package/Number.js +74 -37
- package/Paginator.js +96 -83
- package/Paragraph.js +10 -10
- package/Popover.js +191 -54
- package/Progress.js +23 -22
- package/RadioBar.js +32 -14
- package/RadioList.js +17 -11
- package/Resize.js +33 -20
- package/ResultsMenu.js +36 -23
- package/ScreenReaderContent.js +9 -9
- package/Scroll.js +51 -26
- package/ScrollContainerContext.js +48 -48
- package/Search.js +68 -31
- package/Select.js +501 -204
- package/SidePanel.js +37 -24
- package/Slider.js +54 -24
- package/SlidingPanels.js +52 -14
- package/SplitButton.js +23 -22
- package/StaticContent.js +9 -9
- package/StepBar.js +22 -22
- package/Switch.js +18 -13
- package/TabBar.js +22 -22
- package/TabLayout.js +46 -18
- package/Table.js +424 -166
- package/Text.js +91 -49
- package/TextArea.d.ts +2 -0
- package/TextArea.js +127 -49
- package/Tooltip.js +236 -59
- package/TransitionOpen.js +39 -26
- package/Typography.d.ts +2 -0
- package/Typography.js +18 -17
- package/WaitSpinner.js +15 -15
- package/docker-compose.yml +42 -0
- package/package.json +13 -12
- package/test-runner-jest.config.js +11 -6
- package/types/src/Accordion/AccordionContext.d.ts +1 -0
- package/types/src/Button/Button.d.ts +5 -2
- package/types/src/Button/docs/examples/Basic.d.ts +2 -2
- package/types/src/Button/docs/examples/Selected.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +1 -0
- package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -11
- package/types/src/Calendar/Calendar.d.ts +2 -0
- package/types/src/CardLayout/CardLayoutContext.d.ts +1 -0
- package/types/src/Concertina/ConcertinaContext.d.ts +1 -0
- package/types/src/ControlGroup/ControlGroup.d.ts +15 -8
- package/types/src/ControlGroup/docs/examples/HelpWithErrorText.d.ts +2 -0
- package/types/src/ControlGroup/docs/examples/Required.d.ts +2 -0
- package/types/src/File/File.d.ts +4 -2
- package/types/src/File/FileContext.d.ts +1 -0
- package/types/src/FormRows/FormRowsContext.d.ts +1 -0
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +14 -1
- package/types/src/Multiselect/Multiselect.d.ts +15 -1
- package/types/src/Multiselect/Normal.d.ts +2 -0
- package/types/src/Popover/Popover.d.ts +25 -5
- package/types/src/Popover/PopoverContext.d.ts +1 -0
- package/types/src/RadioBar/RadioBar.d.ts +5 -3
- package/types/src/RadioBar/RadioBarContext.d.ts +1 -0
- package/types/src/RadioList/RadioList.d.ts +5 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -0
- package/types/src/Select/Select.d.ts +3 -1
- package/types/src/Select/SelectBase.d.ts +14 -0
- package/types/src/Slider/Slider.d.ts +5 -3
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/Switch/Switch.d.ts +2 -0
- package/types/src/TabBar/TabBarContext.d.ts +1 -0
- package/types/src/TabLayout/Panel.d.ts +3 -0
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/Body.d.ts +2 -0
- package/types/src/Table/Head.d.ts +2 -0
- package/types/src/Table/Row.d.ts +11 -3
- package/types/src/Table/Table.d.ts +5 -3
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Text/Text.d.ts +5 -3
- package/types/src/TextArea/TextArea.d.ts +5 -3
- package/types/src/Tooltip/Tooltip.d.ts +16 -4
- package/types/src/Typography/Typography.d.ts +1 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +1 -0
- package/useForceUpdate.js +9 -9
- package/useKeyPress.js +2 -2
- package/usePrevious.js +9 -9
- package/.storybook-visual/config/snapshotResolver.js +0 -29
- package/.storybook-visual/main.js +0 -22
- package/.storybook-visual/preview.jsx +0 -31
- package/.storybook-visual/scripts/test.sh +0 -108
- package/.storybook-visual/test-runner.js +0 -108
|
@@ -41,6 +41,8 @@ interface SwitchPropsBase {
|
|
|
41
41
|
*/
|
|
42
42
|
labelledBy?: string;
|
|
43
43
|
onClick?: SwitchClickHandler | SwitchCheckboxWithSomeClickHandler;
|
|
44
|
+
/** @private. */
|
|
45
|
+
required?: boolean;
|
|
44
46
|
/**
|
|
45
47
|
* 'some' is only valid when appearance is 'checkbox'. The current value of `selected` is
|
|
46
48
|
* passed to the onClick handler.
|
|
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
interface PanelPropsBase {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
/** Inserts number in tab label. */
|
|
7
|
+
count?: number;
|
|
6
8
|
/**
|
|
7
9
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
8
10
|
*/
|
|
@@ -28,6 +30,7 @@ elementRef, panelId, ...otherProps }: PanelProps): JSX.Element;
|
|
|
28
30
|
declare namespace Panel {
|
|
29
31
|
var propTypes: {
|
|
30
32
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
33
|
+
count: PropTypes.Requireable<number>;
|
|
31
34
|
disabled: PropTypes.Requireable<boolean>;
|
|
32
35
|
elementRef: PropTypes.Requireable<object>;
|
|
33
36
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -17,6 +17,8 @@ interface TabLayoutPropsBase {
|
|
|
17
17
|
* Must be `TabLayout.Panel`.
|
|
18
18
|
*/
|
|
19
19
|
children?: React.ReactNode;
|
|
20
|
+
/** Inserts number in tab label. */
|
|
21
|
+
count?: number;
|
|
20
22
|
/**
|
|
21
23
|
* Sets the active panel on the initial render. It must match the `panelId` of one of
|
|
22
24
|
* the child `TabLayout.Panel`s. Only use `defaultActivePanelId` when using `TabLayout`
|
|
@@ -19,6 +19,8 @@ interface BodyPropsBase {
|
|
|
19
19
|
rowExpansion?: 'single' | 'multi' | 'none' | 'controlled';
|
|
20
20
|
/** @private. Generally passed by Table rather than added directly. */
|
|
21
21
|
onRequestMoveRow?: BodyRequestMoveRowHandler;
|
|
22
|
+
/** Indicates the column to use as the primary label for each row. */
|
|
23
|
+
primaryColumnIndex?: number;
|
|
22
24
|
/** @private. Generally passed by Table rather than added directly. */
|
|
23
25
|
stripeRows?: boolean;
|
|
24
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { TableRequestMoveColumnHandler } from './Table';
|
|
3
|
+
import TableContext from './TableContext';
|
|
3
4
|
import { ClassComponentProps } from '../utils/types';
|
|
4
5
|
declare type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
5
6
|
columnId: any;
|
|
@@ -59,6 +60,7 @@ interface HeadState {
|
|
|
59
60
|
declare class Head extends Component<HeadProps, HeadState> {
|
|
60
61
|
private cells?;
|
|
61
62
|
private el;
|
|
63
|
+
static contextType: React.Context<TableContext>;
|
|
62
64
|
static splunkUiType: string;
|
|
63
65
|
static propTypes: React.WeakValidationMap<ClassComponentProps<HeadPropsBase, Required<Pick<HeadPropsBase, "actions">>, "thead", never>>;
|
|
64
66
|
static defaultProps: Required<Pick<HeadPropsBase, "actions">>;
|
package/types/src/Table/Row.d.ts
CHANGED
|
@@ -75,6 +75,14 @@ interface RowPropsBase {
|
|
|
75
75
|
* An event handler for toggle of the row. resize of columns. The function is passed the event and the `data` prop for this row.
|
|
76
76
|
*/
|
|
77
77
|
onRequestToggle?: RowRequestToggleHandler;
|
|
78
|
+
/**
|
|
79
|
+
* @private. Generally passed by Table rather than added directly. Indicates the column to use as the primary label for each row.
|
|
80
|
+
*/
|
|
81
|
+
primaryColumnIndex?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Indicates the row's label when selected or unselected.
|
|
84
|
+
*/
|
|
85
|
+
rowScreenReaderText?: string;
|
|
78
86
|
/**
|
|
79
87
|
* When an `onRequestToggle` handler is defined, this prop determines the appearance
|
|
80
88
|
* of the toggle.
|
|
@@ -85,12 +93,12 @@ interface RowPropsBase {
|
|
|
85
93
|
/** @private. */
|
|
86
94
|
stripe?: 'odd' | 'even' | 'none';
|
|
87
95
|
}
|
|
88
|
-
declare const defaultProps: Required<Pick<RowPropsBase, 'stripe'>>;
|
|
96
|
+
declare const defaultProps: Required<Pick<RowPropsBase, 'stripe' | 'primaryColumnIndex'>>;
|
|
89
97
|
declare type RowProps = ClassComponentProps<RowPropsBase, typeof defaultProps, 'tr'>;
|
|
90
98
|
declare class Row extends Component<RowProps, {}> {
|
|
91
99
|
static splunkUiType: string;
|
|
92
|
-
static propTypes: React.WeakValidationMap<ClassComponentProps<RowPropsBase, Required<Pick<RowPropsBase, "stripe">>, "tr", never>>;
|
|
93
|
-
static defaultProps: Required<Pick<RowPropsBase, "stripe">>;
|
|
100
|
+
static propTypes: React.WeakValidationMap<ClassComponentProps<RowPropsBase, Required<Pick<RowPropsBase, "stripe" | "primaryColumnIndex">>, "tr", never>>;
|
|
101
|
+
static defaultProps: Required<Pick<RowPropsBase, "stripe" | "primaryColumnIndex">>;
|
|
94
102
|
private elementRef;
|
|
95
103
|
private handleClick;
|
|
96
104
|
private handleKeyDown;
|
|
@@ -93,6 +93,8 @@ interface TablePropsBase {
|
|
|
93
93
|
* * `none`: The default with no row expansion.
|
|
94
94
|
*/
|
|
95
95
|
rowExpansion?: 'single' | 'multi' | 'controlled' | 'none';
|
|
96
|
+
/** Indicates the column to use as the primary label for each row. */
|
|
97
|
+
primaryColumnIndex?: number;
|
|
96
98
|
/**
|
|
97
99
|
* When an `onRequestToggleAllRows` handler is defined, this prop determines the appearance
|
|
98
100
|
* of the toggle all rows button.
|
|
@@ -128,7 +130,7 @@ interface TablePropsBase {
|
|
|
128
130
|
*/
|
|
129
131
|
resizableFillLayout?: boolean;
|
|
130
132
|
}
|
|
131
|
-
declare const defaultProps: Required<Pick<TablePropsBase, 'actions' | 'dockOffset' | 'headType' | 'rowExpansion' | 'rowSelection' | 'resizableFillLayout'>>;
|
|
133
|
+
declare const defaultProps: Required<Pick<TablePropsBase, 'actions' | 'dockOffset' | 'headType' | 'rowExpansion' | 'rowSelection' | 'resizableFillLayout' | 'primaryColumnIndex'>>;
|
|
132
134
|
declare type TableProps = ClassComponentProps<TablePropsBase, typeof defaultProps, 'div'>;
|
|
133
135
|
interface TableState {
|
|
134
136
|
cellWidths?: number[];
|
|
@@ -148,9 +150,9 @@ declare class Table extends Component<TableProps, TableState> {
|
|
|
148
150
|
private scrollSource?;
|
|
149
151
|
private table;
|
|
150
152
|
private tableContainer;
|
|
151
|
-
static propTypes: React.WeakValidationMap<ClassComponentProps<TablePropsBase, Required<Pick<TablePropsBase, "actions" | "headType" | "rowSelection" | "resizableFillLayout" | "dockOffset" | "rowExpansion">>, "div", never>>;
|
|
153
|
+
static propTypes: React.WeakValidationMap<ClassComponentProps<TablePropsBase, Required<Pick<TablePropsBase, "actions" | "headType" | "rowSelection" | "resizableFillLayout" | "primaryColumnIndex" | "dockOffset" | "rowExpansion">>, "div", never>>;
|
|
152
154
|
static contextType: React.Context<Window | Document | HTMLElement | null | undefined>;
|
|
153
|
-
static defaultProps: Required<Pick<TablePropsBase, "actions" | "headType" | "rowSelection" | "resizableFillLayout" | "dockOffset" | "rowExpansion">>;
|
|
155
|
+
static defaultProps: Required<Pick<TablePropsBase, "actions" | "headType" | "rowSelection" | "resizableFillLayout" | "primaryColumnIndex" | "dockOffset" | "rowExpansion">>;
|
|
154
156
|
static Caption: typeof Caption;
|
|
155
157
|
static Head: typeof Head;
|
|
156
158
|
static HeadCell: typeof HeadCell;
|