@splunk/react-ui 4.17.1 → 4.18.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/Accordion.js +2 -2
- package/AnimationToggle.js +5 -5
- package/Button.js +2 -2
- package/ButtonSimple.js +2 -2
- package/CHANGELOG.md +18 -2
- package/Calendar.js +2 -2
- package/Code.js +4 -4
- package/Color.js +202 -175
- package/ColumnLayout.js +6 -6
- package/Concertina.js +6 -6
- package/DefinitionList.js +2 -2
- package/Dropdown.js +4 -4
- package/DualListbox.js +9 -6
- package/File.js +7 -7
- package/FormRows.js +4 -4
- package/Heading.js +8 -4
- package/JSONTree.js +30 -28
- package/Layer.js +10 -10
- package/Link.js +2 -2
- package/List.js +7 -4
- package/MIGRATION.mdx +295 -0
- package/Markdown.js +12 -7
- package/Menu.js +15 -15
- package/Message.js +19 -19
- package/MessageBar.js +17 -17
- package/Modal.js +7 -7
- package/Multiselect.js +11 -11
- package/Number.js +3 -2
- package/Paginator.js +2 -2
- package/Popover.js +15 -11
- package/RadioBar.js +2 -2
- package/RadioList.js +2 -2
- package/Resize.js +2 -2
- package/Scroll.js +2 -2
- package/Select.js +6 -6
- package/SidePanel.js +2 -2
- package/Slider.js +5 -5
- package/StepBar.js +2 -2
- package/Switch.js +2 -2
- package/TabBar.js +66 -49
- package/Table.js +10 -10
- package/Text.js +5 -5
- package/TextArea.js +4 -4
- package/Typography.js +2 -2
- package/package.json +6 -11
- package/stubs-dependencies.d.ts +0 -9
- package/types/src/Button/Button.d.ts +5 -3
- package/types/src/Clickable/Clickable.d.ts +2 -1
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -0
- package/types/src/Color/Color.d.ts +6 -6
- package/types/src/Color/Palette.d.ts +46 -0
- package/types/src/Concertina/Panel.d.ts +1 -0
- package/types/src/FormRows/Row.d.ts +1 -0
- package/types/src/Heading/Heading.d.ts +7 -2
- package/types/src/JSONTree/JSONTree.d.ts +2 -1
- package/types/src/Layer/Layer.d.ts +2 -0
- package/types/src/List/List.d.ts +9 -1
- package/types/src/List/docs/examples/CustomizedList.d.ts +2 -0
- package/types/src/List/docs/examples/OrderedList.d.ts +2 -0
- package/types/src/List/docs/examples/UnorderedList.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -0
- package/types/src/Markdown/renderers/MarkdownList.d.ts +2 -0
- package/types/src/Number/Number.d.ts +9 -4
- package/types/src/Popover/Popover.d.ts +2 -0
- package/types/src/TabBar/Tab.d.ts +2 -0
- package/types/src/Table/Head.d.ts +1 -0
- package/types/src/Table/HeadCell.d.ts +1 -0
- package/types/src/Table/HeadDropdownCell.d.ts +1 -0
- package/types/src/Table/Table.d.ts +3 -1
- package/types/src/Text/Text.d.ts +3 -1
- package/types/src/TextArea/TextArea.d.ts +2 -0
- package/MIGRATION.md +0 -49
- package/types/src/List/docs/examples/Decimal.d.ts +0 -2
- package/types/src/List/docs/examples/Disc.d.ts +0 -2
- package/types/src/List/docs/examples/LowerAlpha.d.ts +0 -2
- package/types/src/List/docs/examples/UpperAlpha.d.ts +0 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Clickable from '@splunk/react-ui/Clickable';
|
|
3
|
+
interface PaletteProps {
|
|
4
|
+
/**
|
|
5
|
+
* In the prisma theme, controls if the palette is expanded
|
|
6
|
+
*/
|
|
7
|
+
expanded: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Complete list of palettes values to be rendered as swatches
|
|
10
|
+
* In enterprise themes this list is always shown.
|
|
11
|
+
* In prisma themes the entire list is only shown when the palette is `expanded`
|
|
12
|
+
*/
|
|
13
|
+
palette: (string | null)[];
|
|
14
|
+
/**
|
|
15
|
+
* Current value of the Color input
|
|
16
|
+
*/
|
|
17
|
+
value?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* This ref is passed to the swatch that should be focused for Color to control focus
|
|
20
|
+
*/
|
|
21
|
+
swatchToFocusRef: React.RefObject<Clickable & HTMLInputElement> | null;
|
|
22
|
+
/**
|
|
23
|
+
* Callback for handling when a swatch is selected
|
|
24
|
+
*/
|
|
25
|
+
onSwatchClick: (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
26
|
+
value?: string | null;
|
|
27
|
+
}) => void;
|
|
28
|
+
/**
|
|
29
|
+
* ref for the expandButton so Color can control the state
|
|
30
|
+
*/
|
|
31
|
+
expandButtonRef: React.RefObject<Clickable> | null;
|
|
32
|
+
/**
|
|
33
|
+
* Callback for handling when the expand button is pressed
|
|
34
|
+
*/
|
|
35
|
+
onPaletteExpand: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Render function for injecting the toolbar and input below the rendered swatches
|
|
38
|
+
*/
|
|
39
|
+
renderInput?: () => JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Callback for handling activation of the system color picker, only used in prisma themes.
|
|
42
|
+
*/
|
|
43
|
+
onSystemColorPickerChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
44
|
+
}
|
|
45
|
+
declare function Palette({ expanded, palette, value, swatchToFocusRef, onSwatchClick, expandButtonRef, onPaletteExpand, onSystemColorPickerChange, renderInput, }: PaletteProps): JSX.Element;
|
|
46
|
+
export default Palette;
|
|
@@ -42,6 +42,7 @@ declare class Panel extends Component<PanelProps, PanelState> {
|
|
|
42
42
|
private lastHeight?;
|
|
43
43
|
static propTypes: React.WeakValidationMap<ClassComponentProps<PanelPropsBase, Required<Pick<PanelPropsBase, "status">>, "div", never>>;
|
|
44
44
|
static defaultProps: Required<Pick<PanelPropsBase, "status">>;
|
|
45
|
+
context: React.ContextType<typeof ConcertinaContext>;
|
|
45
46
|
static contextType: React.Context<ConcertinaContext>;
|
|
46
47
|
constructor(props: Readonly<PanelProps>);
|
|
47
48
|
componentDidUpdate(prevProps: Readonly<PanelProps>, prevState: Readonly<PanelState>): void;
|
|
@@ -29,6 +29,7 @@ interface RowPropsBase {
|
|
|
29
29
|
}
|
|
30
30
|
declare class Row extends Component<RowPropsBase, {}> {
|
|
31
31
|
static propTypes: React.WeakValidationMap<RowPropsBase>;
|
|
32
|
+
context: React.ContextType<typeof FormRowsContext>;
|
|
32
33
|
static contextType: React.Context<FormRowsContext>;
|
|
33
34
|
private handleKeyDown;
|
|
34
35
|
private handleRequestRemove;
|
|
@@ -9,8 +9,12 @@ interface HeadingPropsBase {
|
|
|
9
9
|
*/
|
|
10
10
|
elementRef?: React.Ref<HTMLHeadingElement>;
|
|
11
11
|
/**
|
|
12
|
-
* Corresponds to the respective `<hX>` HTML tags and `typography(titleX)` `@splunk/themes` typography variant.
|
|
13
|
-
*
|
|
12
|
+
* Corresponds to the respective `<hX>` HTML tags and `typography(titleX)` `@splunk/themes` typography variant.
|
|
13
|
+
* Styles will be set corresponding to level if variant is not provided: e.g. `level=3` will default to using `title3` from `mixins`.
|
|
14
|
+
*
|
|
15
|
+
* @deprecatedValue 's' and 'ss'
|
|
16
|
+
* The `s` and `ss` values are deprecated and will be removed in a future major version.
|
|
17
|
+
* See the migration guide for how to maintain the same styling as `level="s"` and `level="ss"`.
|
|
14
18
|
*/
|
|
15
19
|
level?: 1 | 2 | 3 | 4 | 's' | 'ss' | 5 | 6;
|
|
16
20
|
/**
|
|
@@ -36,6 +40,7 @@ declare namespace Heading {
|
|
|
36
40
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
37
41
|
elementRef: PropTypes.Requireable<object>;
|
|
38
42
|
level: PropTypes.Requireable<React.ReactText>;
|
|
43
|
+
variant: PropTypes.Requireable<string>;
|
|
39
44
|
};
|
|
40
45
|
}
|
|
41
46
|
export default Heading;
|
|
@@ -46,7 +46,8 @@ interface JSONTreePropsBase {
|
|
|
46
46
|
onClickValue?: JSONTreeClickValueHandler;
|
|
47
47
|
/**
|
|
48
48
|
* Starts with all nodes expanded if set to `true`. The default is `false`, which expands only the first
|
|
49
|
-
* level of properties.
|
|
49
|
+
* level of properties. If set to `withShiftModifier`, using `SHIFT + CLICK” or `SHIFT + ENTER` will expand or collapse all
|
|
50
|
+
* levels of the tree at once.
|
|
50
51
|
*/
|
|
51
52
|
expandChildren?: boolean | 'withShiftModifier';
|
|
52
53
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
+
import { LayerStackContext } from './LayerStack';
|
|
2
3
|
/** @public */
|
|
3
4
|
declare type LayerPossibleCloseReason = 'clickAway' | 'escapeKey';
|
|
4
5
|
/** @public */
|
|
@@ -30,6 +31,7 @@ declare class Layer extends Component<LayerProps, {}> {
|
|
|
30
31
|
static possibleCloseReasons: LayerPossibleCloseReason[];
|
|
31
32
|
static propTypes: React.WeakValidationMap<LayerProps>;
|
|
32
33
|
static defaultProps: Required<Pick<LayerPropsBase, "open" | "closeReasons">>;
|
|
34
|
+
context: React.ContextType<typeof LayerStackContext>;
|
|
33
35
|
static contextType: React.Context<Layer[]>;
|
|
34
36
|
constructor(props: Readonly<LayerProps>);
|
|
35
37
|
componentDidMount(): void;
|
package/types/src/List/List.d.ts
CHANGED
|
@@ -10,10 +10,17 @@ interface ListPropsBase {
|
|
|
10
10
|
* `HTMLUListElement` if type is 'disc', `HTMLOListElement` otherwise.
|
|
11
11
|
*/
|
|
12
12
|
elementRef?: React.Ref<HTMLOListElement | HTMLUListElement>;
|
|
13
|
+
/** Sets the element as an `HTMLOListElement` otherwise it defaults to `HTMLUListElement`. */
|
|
14
|
+
ordered?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* This prop is deprecated and will be removed in a future major version. List will default to `HTMLUListElement`. Use `ordered` prop to set list to `HTMLOListElement`. Use CSS to style the `list-style-type` property.
|
|
18
|
+
*/
|
|
13
19
|
type?: 'disc' | 'decimal' | 'lower-alpha' | 'upper-alpha';
|
|
14
20
|
}
|
|
15
21
|
interface ListOrderedPropsBase extends ListPropsBase {
|
|
16
22
|
elementRef?: React.Ref<HTMLOListElement>;
|
|
23
|
+
ordered?: boolean;
|
|
17
24
|
type: 'decimal' | 'lower-alpha' | 'upper-alpha';
|
|
18
25
|
}
|
|
19
26
|
interface ListUnorderedPropsBase extends ListPropsBase {
|
|
@@ -23,11 +30,12 @@ interface ListUnorderedPropsBase extends ListPropsBase {
|
|
|
23
30
|
declare type ListOrderedProps = ComponentProps<ListOrderedPropsBase, 'ol'>;
|
|
24
31
|
declare type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'>;
|
|
25
32
|
declare type ListProps = ListOrderedProps | ListUnorderedProps;
|
|
26
|
-
declare function List({ children, elementRef, type, ...otherProps }: ListProps): JSX.Element;
|
|
33
|
+
declare function List({ children, elementRef, type, ordered, ...otherProps }: ListProps): JSX.Element;
|
|
27
34
|
declare namespace List {
|
|
28
35
|
var propTypes: {
|
|
29
36
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
30
37
|
elementRef: PropTypes.Requireable<object>;
|
|
38
|
+
ordered: PropTypes.Requireable<boolean>;
|
|
31
39
|
type: PropTypes.Requireable<string>;
|
|
32
40
|
};
|
|
33
41
|
var Item: typeof import("./Item").default;
|
|
@@ -6,9 +6,11 @@ interface MarkdownListPropsBase {
|
|
|
6
6
|
start: number | null;
|
|
7
7
|
tight: boolean;
|
|
8
8
|
type: 'bullet' | 'ordered';
|
|
9
|
+
ordered: boolean;
|
|
9
10
|
}
|
|
10
11
|
interface MarkdownListOrderedPropsBase extends MarkdownListPropsBase {
|
|
11
12
|
type: 'ordered';
|
|
13
|
+
ordered: boolean;
|
|
12
14
|
}
|
|
13
15
|
interface MarkdownListUnorderedPropsBase extends MarkdownListPropsBase {
|
|
14
16
|
type: 'bullet';
|