@splunk/react-ui 4.28.2 → 4.30.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 +1 -0
- package/CHANGELOG.md +42 -1
- package/Card.js +17 -17
- package/Chip.js +162 -153
- package/Clickable.js +107 -87
- package/Code.js +10 -22
- package/CollapsiblePanel.js +8 -8
- package/ComboBox.js +43 -38
- package/Date.js +6 -6
- package/DualListbox.js +1 -1
- package/Link.js +70 -68
- package/MIGRATION.mdx +141 -1
- package/Markdown.js +10 -9
- package/Menu.js +5 -5
- package/Message.js +160 -149
- package/Multiselect.js +52 -48
- package/Number.js +19 -18
- package/Paginator.js +390 -485
- package/RadioBar.js +43 -39
- package/ResultsMenu.js +14 -11
- package/Search.js +227 -220
- package/Select.js +77 -72
- package/StepBar.js +1 -1
- package/Table.js +2082 -1594
- package/Text.js +1 -0
- package/TextArea.d.ts +1 -1
- package/WaitSpinner.js +17 -16
- package/cypress/support/component.ts +2 -2
- package/package.json +22 -21
- package/test-runner-jest.config.js +1 -0
- package/types/src/Accordion/Accordion.d.ts +3 -7
- package/types/src/Accordion/Panel.d.ts +2 -2
- package/types/src/Anchor/Anchor.d.ts +1 -1
- package/types/src/AnimationToggle/AnimationToggle.d.ts +3 -3
- package/types/src/Box/Box.d.ts +1 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/Button/Button.d.ts +5 -5
- package/types/src/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -10
- package/types/src/Calendar/Calendar.d.ts +3 -3
- package/types/src/Calendar/DateTable.d.ts +2 -2
- package/types/src/Calendar/Day.d.ts +3 -3
- package/types/src/Calendar/MonthHeader.d.ts +6 -6
- package/types/src/Card/Body.d.ts +1 -1
- package/types/src/Card/Card.d.ts +6 -6
- package/types/src/Card/Footer.d.ts +1 -1
- package/types/src/Card/Header.d.ts +1 -1
- package/types/src/CardLayout/CardLayout.d.ts +4 -4
- package/types/src/Chip/Chip.d.ts +5 -5
- package/types/src/Chip/docs/examples/RemovableWithNonStringChildren.d.ts +2 -0
- package/types/src/Clickable/Clickable.d.ts +12 -4
- package/types/src/Clickable/NavigationProvider.d.ts +26 -5
- package/types/src/CloseButton/CloseButton.d.ts +1 -1
- package/types/src/Code/Code.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +9 -5
- package/types/src/CollapsiblePanel/SingleOpenPanelGroup.d.ts +2 -2
- package/types/src/CollapsiblePanel/docs/examples/SingleOpenPanelGroupInset.d.ts +2 -0
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +8 -8
- package/types/src/Color/Swatch.d.ts +2 -2
- package/types/src/ColumnLayout/Column.d.ts +1 -1
- package/types/src/ColumnLayout/ColumnLayout.d.ts +1 -1
- package/types/src/ColumnLayout/Row.d.ts +1 -1
- package/types/src/ComboBox/ComboBox.d.ts +7 -6
- package/types/src/ComboBox/Option.d.ts +3 -3
- package/types/src/Concertina/Concertina.d.ts +2 -2
- package/types/src/Concertina/Heading.d.ts +3 -3
- package/types/src/Concertina/Panel.d.ts +4 -4
- package/types/src/Concertina/types.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +5 -5
- package/types/src/Date/Date.d.ts +10 -10
- package/types/src/DefinitionList/DefinitionList.d.ts +2 -2
- package/types/src/DefinitionList/Description.d.ts +1 -1
- package/types/src/DefinitionList/Term.d.ts +1 -1
- package/types/src/Divider/Divider.d.ts +1 -1
- package/types/src/Dropdown/Dropdown.d.ts +10 -10
- package/types/src/DualListbox/DualListbox.d.ts +4 -4
- package/types/src/DualListbox/DualListboxContext.d.ts +7 -7
- package/types/src/DualListbox/Label.d.ts +2 -2
- package/types/src/DualListbox/Listbox.d.ts +4 -4
- package/types/src/DualListbox/ListboxContext.d.ts +3 -3
- package/types/src/DualListbox/Option.d.ts +2 -2
- package/types/src/DualListbox/ToolbarButton.d.ts +3 -3
- package/types/src/DualListbox/ToolbarContext.d.ts +3 -3
- package/types/src/EventListener/EventListener.d.ts +1 -1
- package/types/src/File/File.d.ts +8 -8
- package/types/src/File/Item.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +6 -6
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableList.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/Heading/Heading.d.ts +2 -2
- package/types/src/Image/Image.d.ts +2 -2
- package/types/src/JSONTree/JSONTree.d.ts +6 -6
- package/types/src/JSONTree/JSONTreeItem.d.ts +3 -3
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Layer/Layer.d.ts +3 -3
- package/types/src/Link/Link.d.ts +4 -4
- package/types/src/List/Item.d.ts +1 -1
- package/types/src/List/List.d.ts +3 -3
- package/types/src/Markdown/Markdown.d.ts +19 -13
- package/types/src/Markdown/renderers/MarkdownAnchorHeading.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCode.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownImage.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownItem.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownList.d.ts +3 -3
- package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +1 -1
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/Heading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +10 -10
- package/types/src/Menu/Menu.d.ts +9 -9
- package/types/src/Message/Link.d.ts +3 -3
- package/types/src/Message/Message.d.ts +1 -1
- package/types/src/MessageBar/MessageBar.d.ts +2 -2
- package/types/src/MessageBar/docs/examples/Basic.d.ts +2 -0
- package/types/src/Modal/Body.d.ts +1 -1
- package/types/src/Modal/Footer.d.ts +1 -1
- package/types/src/Modal/Header.d.ts +1 -1
- package/types/src/Modal/Modal.d.ts +4 -4
- package/types/src/ModalLayer/ModalLayer.d.ts +3 -3
- package/types/src/Monogram/Monogram.d.ts +5 -5
- package/types/src/Multiselect/Compact.d.ts +2 -2
- package/types/src/Multiselect/Multiselect.d.ts +7 -7
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Multiselect/Option.d.ts +3 -3
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +1 -1
- package/types/src/Number/Number.d.ts +22 -22
- package/types/src/Paginator/Button.d.ts +15 -10
- package/types/src/Paginator/Compact.d.ts +4 -4
- package/types/src/Paginator/PageControl.d.ts +2 -2
- package/types/src/Paginator/PageSelect.d.ts +2 -2
- package/types/src/Paginator/Paginator.d.ts +2 -2
- package/types/src/Paragraph/Paragraph.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +11 -11
- package/types/src/Popover/PopoverHitArea.d.ts +1 -1
- package/types/src/Progress/Progress.d.ts +1 -1
- package/types/src/RadioBar/Option.d.ts +8 -4
- package/types/src/RadioBar/RadioBar.d.ts +8 -8
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioList.d.ts +3 -3
- package/types/src/Resize/Resize.d.ts +4 -4
- package/types/src/Resize/docs/examples/Basic.d.ts +2 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +7 -5
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -2
- package/types/src/ScreenReaderContent/ScreenReaderContent.d.ts +2 -2
- package/types/src/Scroll/Inner.d.ts +3 -3
- package/types/src/Scroll/Scroll.d.ts +2 -2
- package/types/src/Search/Option.d.ts +8 -8
- package/types/src/Search/Search.d.ts +4 -4
- package/types/src/Select/Option.d.ts +2 -2
- package/types/src/Select/OptionBase.d.ts +8 -8
- package/types/src/Select/Select.d.ts +5 -5
- package/types/src/Select/SelectAllOption.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +9 -8
- package/types/src/SidePanel/SidePanel.d.ts +3 -3
- package/types/src/Slider/Slider.d.ts +8 -8
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +2 -2
- package/types/src/SplitButton/SplitButton.d.ts +1 -1
- package/types/src/StaticContent/StaticContent.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/Switch/Switch.d.ts +4 -8
- package/types/src/TabBar/Tab.d.ts +7 -8
- package/types/src/TabBar/TabBar.d.ts +5 -5
- package/types/src/TabLayout/Panel.d.ts +2 -2
- package/types/src/TabLayout/TabLayout.d.ts +3 -3
- package/types/src/Table/Body.d.ts +4 -8
- package/types/src/Table/Caption.d.ts +2 -2
- package/types/src/Table/Cell.d.ts +3 -3
- package/types/src/Table/DragHandle.d.ts +1 -1
- package/types/src/Table/Head.d.ts +6 -6
- package/types/src/Table/HeadCell.d.ts +9 -9
- package/types/src/Table/HeadDropdownCell.d.ts +11 -11
- package/types/src/Table/HeadInner.d.ts +5 -5
- package/types/src/Table/HeadTable.d.ts +2 -2
- package/types/src/Table/KeyboardSensor.d.ts +79 -0
- package/types/src/Table/Row.d.ts +12 -14
- package/types/src/Table/RowDragCell.d.ts +9 -40
- package/types/src/Table/Table.d.ts +12 -10
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Table/docs/examples/FilterColumnValues.d.ts +1 -1
- package/types/src/Text/Text.d.ts +13 -11
- package/types/src/TextArea/TextArea.d.ts +10 -10
- package/types/src/Tooltip/Tooltip.d.ts +9 -9
- package/types/src/TransitionOpen/TransitionOpen.d.ts +2 -2
- package/types/src/Tree/Tree.d.ts +3 -3
- package/types/src/Tree/TreeItem.d.ts +4 -4
- package/types/src/Typography/Typography.d.ts +5 -5
- package/types/src/WaitSpinner/WaitSpinner.d.ts +2 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -2
- package/types/src/useKeyPress/index.d.ts +2 -2
- package/types/src/utils/types.d.ts +4 -4
- package/types/src/Resize/docs/examples/Typical.d.ts +0 -2
|
@@ -2,17 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
/** @public */
|
|
5
|
-
|
|
5
|
+
type JSONElement = string | {
|
|
6
6
|
[x: string]: JSONElement;
|
|
7
7
|
} | number | boolean | null | JSONElement[];
|
|
8
8
|
/** @public */
|
|
9
|
-
|
|
9
|
+
type JSONTreeClickValueHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
10
10
|
key: string;
|
|
11
11
|
keyPath: (string | number)[];
|
|
12
12
|
value: string;
|
|
13
13
|
}) => void;
|
|
14
14
|
/** @public */
|
|
15
|
-
|
|
15
|
+
type JSONTreeClickKeyHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
16
16
|
key: string;
|
|
17
17
|
keyPath: (string | number)[];
|
|
18
18
|
}) => void;
|
|
@@ -64,7 +64,7 @@ interface JSONTreePropsBase {
|
|
|
64
64
|
*/
|
|
65
65
|
expandChildrenOnShiftKey?: boolean;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
type JSONTreeProps = ComponentProps<JSONTreePropsBase, 'code'>;
|
|
68
68
|
/**
|
|
69
69
|
* Used to visualize a JSON string.
|
|
70
70
|
*/
|
|
@@ -72,9 +72,9 @@ declare function JSONTree({ elementRef, expandChildren, indent, json, onClickKey
|
|
|
72
72
|
declare namespace JSONTree {
|
|
73
73
|
var propTypes: {
|
|
74
74
|
elementRef: PropTypes.Requireable<object>;
|
|
75
|
-
expandChildren: PropTypes.Requireable<string | boolean
|
|
75
|
+
expandChildren: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
76
76
|
indent: PropTypes.Requireable<number>;
|
|
77
|
-
json: PropTypes.Validator<string | number | boolean | object
|
|
77
|
+
json: PropTypes.Validator<NonNullable<NonNullable<string | number | boolean | object | null | undefined>>>;
|
|
78
78
|
onClickKey: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
79
|
onClickValue: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
80
|
overflow: PropTypes.Requireable<string>;
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { JSONElement } from './JSONTree';
|
|
4
4
|
import { TreeItemPropsBase } from '../Tree';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
|
-
|
|
6
|
+
type ExpandLinkHandler = (data: {
|
|
7
7
|
open: boolean;
|
|
8
8
|
withTooltip: boolean;
|
|
9
9
|
}) => {
|
|
@@ -24,7 +24,7 @@ interface JSONTreeItemPropsBase extends TreeItemPropsBase {
|
|
|
24
24
|
representation?: JSX.Element | JSX.Element[];
|
|
25
25
|
value?: JSONElement;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
type JSONTreeItemProps = ComponentProps<JSONTreeItemPropsBase, 'li'>;
|
|
28
28
|
export declare function JSONTreeItem({ clickableKeyRef, clickableValRef, hasChildren, indentArray, index, initialOpenState, onFocus, properties, propertyDataPath, propertyElement, renderExpandLink, representation, value, ...otherProps }: JSONTreeItemProps): JSX.Element;
|
|
29
29
|
export declare namespace JSONTreeItem {
|
|
30
30
|
var propTypes: {
|
|
@@ -39,7 +39,7 @@ export declare namespace JSONTreeItem {
|
|
|
39
39
|
propertyElement: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
40
|
renderExpandLink: PropTypes.Requireable<(...args: any[]) => any>;
|
|
41
41
|
representation: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
42
|
-
value: PropTypes.Requireable<string | number | boolean | object
|
|
42
|
+
value: PropTypes.Requireable<NonNullable<string | number | boolean | object | null | undefined>>;
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from './JSONTree';
|
|
2
|
-
|
|
2
|
+
type renderTreeItemsProps = {
|
|
3
3
|
defaultOpen?: boolean;
|
|
4
4
|
expandChildren?: boolean | 'withShiftModifier';
|
|
5
5
|
expandChildrenOnShiftKey?: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { LayerStackContext } from './LayerStack';
|
|
3
3
|
/** @public */
|
|
4
|
-
|
|
4
|
+
type LayerPossibleCloseReason = 'clickAway' | 'escapeKey';
|
|
5
5
|
/** @public */
|
|
6
|
-
|
|
6
|
+
type LayerRequestCloseHandler = (data: {
|
|
7
7
|
event: MouseEvent | KeyboardEvent | TouchEvent;
|
|
8
8
|
reason: LayerPossibleCloseReason;
|
|
9
9
|
}) => void;
|
|
@@ -24,7 +24,7 @@ interface LayerPropsBase {
|
|
|
24
24
|
open?: boolean;
|
|
25
25
|
}
|
|
26
26
|
declare const defaultProps: Required<Pick<LayerPropsBase, 'closeReasons' | 'open'>>;
|
|
27
|
-
|
|
27
|
+
type LayerProps = LayerPropsBase & typeof defaultProps;
|
|
28
28
|
declare class Layer extends Component<LayerProps, {}> {
|
|
29
29
|
private layerClickEvent;
|
|
30
30
|
private static layerContainer;
|
package/types/src/Link/Link.d.ts
CHANGED
|
@@ -31,16 +31,16 @@ interface LinkPropsBase {
|
|
|
31
31
|
to?: string;
|
|
32
32
|
}
|
|
33
33
|
declare const defaultProps: Required<Pick<LinkPropsBase, 'disabled' | 'openInNewContext'>>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
type LinkLinkProps = ClassComponentProps<LinkPropsBase, typeof defaultProps, 'a', 'href'>;
|
|
35
|
+
type LinkButtonProps = ClassComponentProps<LinkPropsBase, typeof defaultProps, 'button'>;
|
|
36
|
+
type LinkProps = LinkLinkProps | LinkButtonProps;
|
|
37
37
|
/**
|
|
38
38
|
* `Link` is a simple method for configuring `Button` for inline links. For more complex behaviors,
|
|
39
39
|
* see the `Button` documentation.
|
|
40
40
|
*/
|
|
41
41
|
declare class Link extends Component<LinkProps> {
|
|
42
42
|
private component;
|
|
43
|
-
static propTypes: React.WeakValidationMap<
|
|
43
|
+
static propTypes: React.WeakValidationMap<LinkProps>;
|
|
44
44
|
static defaultProps: Required<Pick<LinkPropsBase, "disabled" | "openInNewContext">>;
|
|
45
45
|
static [legacyRefMode]: boolean;
|
|
46
46
|
private handleMount;
|
package/types/src/List/Item.d.ts
CHANGED
package/types/src/List/List.d.ts
CHANGED
|
@@ -33,9 +33,9 @@ interface ListUnorderedPropsBase extends ListPropsBase {
|
|
|
33
33
|
elementRef?: React.Ref<HTMLUListElement>;
|
|
34
34
|
type?: 'disc';
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
type ListOrderedProps = ComponentProps<ListOrderedPropsBase | ListOrderedTypePropsBase, 'ol'> & typeof defaultProps;
|
|
37
|
+
type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'> & typeof defaultProps;
|
|
38
|
+
type ListProps = ListOrderedProps | ListUnorderedProps;
|
|
39
39
|
declare function List({ children, elementRef, type, ordered, ...otherProps }: ListProps): JSX.Element;
|
|
40
40
|
declare namespace List {
|
|
41
41
|
var propTypes: {
|
|
@@ -3,55 +3,55 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
import { MarkdownBlockquote, MarkdownCodeBlock, MarkdownCode, MarkdownHeading, MarkdownAnchorHeading, MarkdownImage, MarkdownItem, MarkdownLink, MarkdownList, MarkdownParagraph } from './renderers';
|
|
5
5
|
/** @public */
|
|
6
|
-
|
|
6
|
+
type AnchorHeadingRenderer = (data: {
|
|
7
7
|
children: React.ReactNode[];
|
|
8
8
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
9
9
|
nodeKey: string;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
11
|
/** @public */
|
|
12
|
-
|
|
12
|
+
type BlockquoteRenderer = (data: {
|
|
13
13
|
children: React.ReactNode[];
|
|
14
14
|
nodeKey: string;
|
|
15
15
|
}) => React.ReactNode;
|
|
16
16
|
/** @public */
|
|
17
|
-
|
|
17
|
+
type CodeRenderer = (data: {
|
|
18
18
|
inline: true;
|
|
19
19
|
literal: string;
|
|
20
20
|
nodeKey: string;
|
|
21
21
|
}) => React.ReactNode;
|
|
22
22
|
/** @public */
|
|
23
|
-
|
|
23
|
+
type CodeBlockRenderer = (data: {
|
|
24
24
|
language?: string;
|
|
25
25
|
literal: string;
|
|
26
26
|
nodeKey: string;
|
|
27
27
|
}) => React.ReactNode;
|
|
28
28
|
/** @public */
|
|
29
|
-
|
|
29
|
+
type HeadingRenderer = (data: {
|
|
30
30
|
children: React.ReactNode[];
|
|
31
31
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
32
32
|
nodeKey: string;
|
|
33
33
|
}) => React.ReactNode;
|
|
34
34
|
/** @public */
|
|
35
|
-
|
|
35
|
+
type ImageRenderer = (data: {
|
|
36
36
|
alt: string;
|
|
37
37
|
nodeKey: string;
|
|
38
38
|
src: string;
|
|
39
39
|
title?: string;
|
|
40
40
|
}) => React.ReactNode;
|
|
41
41
|
/** @public */
|
|
42
|
-
|
|
42
|
+
type ItemRenderer = (data: {
|
|
43
43
|
children: React.ReactNode[];
|
|
44
44
|
nodeKey: string;
|
|
45
45
|
}) => React.ReactNode;
|
|
46
46
|
/** @public */
|
|
47
|
-
|
|
47
|
+
type LinkRenderer = (data: {
|
|
48
48
|
children: React.ReactNode[];
|
|
49
49
|
href: string;
|
|
50
50
|
nodeKey: string;
|
|
51
51
|
title?: string;
|
|
52
52
|
}) => React.ReactNode;
|
|
53
53
|
/** @public */
|
|
54
|
-
|
|
54
|
+
type ListRenderer = (data: {
|
|
55
55
|
children: React.ReactNode[];
|
|
56
56
|
nodeKey: string;
|
|
57
57
|
start: number | null;
|
|
@@ -60,7 +60,7 @@ declare type ListRenderer = (data: {
|
|
|
60
60
|
ordered: boolean;
|
|
61
61
|
}) => React.ReactNode;
|
|
62
62
|
/** @public */
|
|
63
|
-
|
|
63
|
+
type ParagraphRenderer = (data: {
|
|
64
64
|
children: React.ReactNode[];
|
|
65
65
|
nodeKey: string;
|
|
66
66
|
}) => React.ReactNode;
|
|
@@ -76,7 +76,7 @@ interface MarkdownPropsBase {
|
|
|
76
76
|
codeRenderer?: CodeRenderer;
|
|
77
77
|
/**
|
|
78
78
|
* A custom code block renderer. The function is passed an object containing `language`,
|
|
79
|
-
* `literal`, and `nodeKey`.
|
|
79
|
+
* `literal`, and `nodeKey`. It supports the same languages as used in the `Code` component.
|
|
80
80
|
*/
|
|
81
81
|
codeBlockRenderer?: CodeBlockRenderer;
|
|
82
82
|
/**
|
|
@@ -113,14 +113,19 @@ interface MarkdownPropsBase {
|
|
|
113
113
|
paragraphRenderer?: ParagraphRenderer;
|
|
114
114
|
/** The content to be parsed and rendered. */
|
|
115
115
|
text: string;
|
|
116
|
+
/**
|
|
117
|
+
* @private
|
|
118
|
+
* Object of type RendererOptions that can use used to override the props for ReactCommonmarkRenderer.
|
|
119
|
+
*/
|
|
120
|
+
rendererOptions?: object;
|
|
116
121
|
}
|
|
117
|
-
|
|
122
|
+
type MarkdownProps = ComponentProps<MarkdownPropsBase, 'div'>;
|
|
118
123
|
/**
|
|
119
124
|
* The `Markdown` component renders the given Markdown text as a React component.
|
|
120
125
|
* The component prefers @splunk/react-ui components over plain HTML components. For example
|
|
121
126
|
* links are rendered as the `@splunk/react-ui/Link` component instead of plain `<a>` tag.
|
|
122
127
|
*/
|
|
123
|
-
declare function Markdown({ blockquoteRenderer, codeBlockRenderer, codeRenderer, elementRef, headingRenderer, imageRenderer, itemRenderer, linkRenderer, listRenderer, paragraphRenderer, text, ...otherProps }: MarkdownProps): JSX.Element;
|
|
128
|
+
declare function Markdown({ blockquoteRenderer, codeBlockRenderer, codeRenderer, elementRef, headingRenderer, imageRenderer, itemRenderer, linkRenderer, listRenderer, paragraphRenderer, text, rendererOptions: rendererOptionsOverride, ...otherProps }: MarkdownProps): JSX.Element;
|
|
124
129
|
declare namespace Markdown {
|
|
125
130
|
var propTypes: {
|
|
126
131
|
blockquoteRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -134,6 +139,7 @@ declare namespace Markdown {
|
|
|
134
139
|
listRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
135
140
|
paragraphRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
136
141
|
text: PropTypes.Validator<string>;
|
|
142
|
+
rendererOptions: PropTypes.Requireable<object>;
|
|
137
143
|
};
|
|
138
144
|
}
|
|
139
145
|
export default Markdown;
|
|
@@ -5,7 +5,7 @@ interface MarkdownAnchorHeadingPropsBase {
|
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type MarkdownAnchorHeadingProps = ComponentProps<MarkdownAnchorHeadingPropsBase, 'h1'>;
|
|
9
9
|
declare function MarkdownAnchorHeading({ level, children, ...otherProps }: MarkdownAnchorHeadingProps): JSX.Element;
|
|
10
10
|
declare namespace MarkdownAnchorHeading {
|
|
11
11
|
var propTypes: {
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from '../../utils/types';
|
|
|
4
4
|
interface MarkdownBlockquotePropsBase {
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type MarkdownBlockquoteProps = ComponentProps<MarkdownBlockquotePropsBase, 'blockquote'>;
|
|
8
8
|
declare function MarkdownBlockquote({ children, ...otherProps }: MarkdownBlockquoteProps): JSX.Element;
|
|
9
9
|
declare namespace MarkdownBlockquote {
|
|
10
10
|
var propTypes: {
|
|
@@ -4,7 +4,7 @@ interface MarkdownCodePropsBase {
|
|
|
4
4
|
inline: true;
|
|
5
5
|
literal: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type MarkdownCodeProps = ComponentProps<MarkdownCodePropsBase, 'code'>;
|
|
8
8
|
declare function MarkdownCode({ literal, ...otherProps }: MarkdownCodeProps): JSX.Element;
|
|
9
9
|
declare namespace MarkdownCode {
|
|
10
10
|
var propTypes: {
|
|
@@ -4,7 +4,7 @@ interface MarkdownCodeBlockPropsBase {
|
|
|
4
4
|
language?: string;
|
|
5
5
|
literal: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type MarkdownCodeBlockProps = ComponentProps<MarkdownCodeBlockPropsBase, 'div'>;
|
|
8
8
|
declare function MarkdownCodeBlock({ literal, language, ...otherProps }: MarkdownCodeBlockProps): JSX.Element;
|
|
9
9
|
declare namespace MarkdownCodeBlock {
|
|
10
10
|
var propTypes: {
|
|
@@ -5,7 +5,7 @@ interface MarkdownHeadingPropsBase {
|
|
|
5
5
|
children: React.ReactNode | React.ReactNode[];
|
|
6
6
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type MarkdownHeadingProps = ComponentProps<MarkdownHeadingPropsBase, 'h1'>;
|
|
9
9
|
declare function MarkdownHeading({ level, children, ...otherProps }: MarkdownHeadingProps): JSX.Element;
|
|
10
10
|
declare namespace MarkdownHeading {
|
|
11
11
|
var propTypes: {
|
|
@@ -5,7 +5,7 @@ interface MarkdownImagePropsBase {
|
|
|
5
5
|
src: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type MarkdownImageProps = ComponentProps<MarkdownImagePropsBase, 'img'>;
|
|
9
9
|
declare function MarkdownImage({ src, title, alt, ...otherProps }: MarkdownImageProps): JSX.Element;
|
|
10
10
|
declare namespace MarkdownImage {
|
|
11
11
|
var propTypes: {
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from '../../utils/types';
|
|
|
4
4
|
interface MarkdownItemPropsBase {
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type MarkdownItemProps = ComponentProps<MarkdownItemPropsBase, 'li'>;
|
|
8
8
|
declare function MarkdownItem({ children, ...otherProps }: MarkdownItemProps): JSX.Element;
|
|
9
9
|
declare namespace MarkdownItem {
|
|
10
10
|
var propTypes: {
|
|
@@ -6,7 +6,7 @@ interface MarkdownLinkPropsBase {
|
|
|
6
6
|
href: string;
|
|
7
7
|
title?: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
type MarkdownLinkProps = ComponentProps<MarkdownLinkPropsBase, 'a'>;
|
|
10
10
|
declare function MarkdownLink({ children, href, ...otherProps }: MarkdownLinkProps): JSX.Element;
|
|
11
11
|
declare namespace MarkdownLink {
|
|
12
12
|
var propTypes: {
|
|
@@ -15,9 +15,9 @@ interface MarkdownListOrderedPropsBase extends MarkdownListPropsBase {
|
|
|
15
15
|
interface MarkdownListUnorderedPropsBase extends MarkdownListPropsBase {
|
|
16
16
|
type: 'bullet';
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
type MarkdownListOrderedProps = ComponentProps<MarkdownListOrderedPropsBase, 'ol'>;
|
|
19
|
+
type MarkdownListUnorderedProps = ComponentProps<MarkdownListUnorderedPropsBase, 'ul'>;
|
|
20
|
+
type MarkdownListProps = MarkdownListOrderedProps | MarkdownListUnorderedProps;
|
|
21
21
|
declare function MarkdownList({ children, type, ...otherProps }: MarkdownListProps): JSX.Element;
|
|
22
22
|
declare namespace MarkdownList {
|
|
23
23
|
var propTypes: {
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from '../../utils/types';
|
|
|
4
4
|
interface MarkdownParagraphPropsBase {
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type MarkdownParagraphProps = ComponentProps<MarkdownParagraphPropsBase, 'p'>;
|
|
8
8
|
declare function MarkdownParagraph({ children, ...otherProps }: MarkdownParagraphProps): JSX.Element;
|
|
9
9
|
declare namespace MarkdownParagraph {
|
|
10
10
|
var propTypes: {
|
|
@@ -10,7 +10,7 @@ interface HeadingPropsBase {
|
|
|
10
10
|
title?: boolean;
|
|
11
11
|
outerStyle?: React.CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
type HeadingProps = ComponentProps<HeadingPropsBase, 'div'>;
|
|
14
14
|
/**
|
|
15
15
|
* A non-interactive `Menu` item used to separate and label groups of `Menu` items.
|
|
16
16
|
*/
|