@splunk/react-ui 4.29.0 → 4.31.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 +39 -3
- package/Card.js +17 -17
- package/Chip.js +5 -5
- 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/Divider.js +96 -45
- package/DualListbox.js +1 -1
- package/Link.js +77 -75
- package/MIGRATION.mdx +51 -1
- package/Markdown.js +10 -9
- package/Menu.js +5 -5
- package/Message.js +160 -149
- package/ModalLayer.js +2 -1
- package/Multiselect.js +9 -6
- package/Number.js +19 -18
- package/Paginator.js +239 -223
- package/RadioBar.js +43 -39
- package/ResultsMenu.js +14 -11
- package/Search.js +227 -220
- package/Select.js +77 -72
- package/SidePanel.js +1 -1
- package/StepBar.js +1 -1
- package/Table.js +2082 -1594
- package/Text.js +1 -0
- package/TextArea.d.ts +1 -1
- package/cypress/support/component.ts +2 -2
- package/package.json +21 -20
- 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/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 +7 -2
- package/types/src/Divider/docs/examples/Decorative.d.ts +2 -0
- 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 +18 -12
- 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/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 +3 -3
- 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 +1 -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/Divider/docs/examples/AriaHidden.d.ts +0 -2
- package/types/src/Resize/docs/examples/Typical.d.ts +0 -2
|
@@ -23,14 +23,14 @@ interface CardLayoutPropsBase {
|
|
|
23
23
|
/** Lets `Card`s wrap to a new line when the container gets narrow. */
|
|
24
24
|
wrapCards?: boolean;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
type CardLayoutProps = ComponentProps<CardLayoutPropsBase, 'div'>;
|
|
27
27
|
declare function CardLayout({ alignCards, cardMaxWidth, cardMinWidth, cardWidth, children, elementRef, gutterSize, style, wrapCards, ...otherProps }: CardLayoutProps): JSX.Element;
|
|
28
28
|
declare namespace CardLayout {
|
|
29
29
|
var propTypes: {
|
|
30
30
|
alignCards: PropTypes.Requireable<string>;
|
|
31
|
-
cardMaxWidth: PropTypes.Requireable<
|
|
32
|
-
cardMinWidth: PropTypes.Requireable<
|
|
33
|
-
cardWidth: PropTypes.Requireable<
|
|
31
|
+
cardMaxWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
32
|
+
cardMinWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
33
|
+
cardWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
34
34
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
35
35
|
elementRef: PropTypes.Requireable<object>;
|
|
36
36
|
gutterSize: PropTypes.Requireable<number>;
|
package/types/src/Chip/Chip.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
/** @public */
|
|
5
|
-
|
|
5
|
+
type ChipRequestRemoveHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
6
6
|
value?: any;
|
|
7
7
|
}) => void;
|
|
8
8
|
interface ChipPropsBase {
|
|
@@ -38,21 +38,21 @@ interface ChipPropsBase {
|
|
|
38
38
|
value?: any;
|
|
39
39
|
}
|
|
40
40
|
declare const defaultProps: Required<Pick<ChipPropsBase, 'disabled'>>;
|
|
41
|
-
|
|
41
|
+
type ChipInteractiveProps = ComponentProps<ChipPropsBase, 'button'> & typeof defaultProps & {
|
|
42
42
|
elementRef?: React.Ref<HTMLButtonElement>;
|
|
43
43
|
onRequestRemove: ChipRequestRemoveHandler;
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
type ChipNonInteractiveProps = ComponentProps<ChipPropsBase, 'div'> & typeof defaultProps & {
|
|
46
46
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
47
47
|
onRequestRemove?: never;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
type ChipProps = ChipInteractiveProps | ChipNonInteractiveProps;
|
|
50
50
|
declare function Chip(props: ChipProps): JSX.Element;
|
|
51
51
|
declare namespace Chip {
|
|
52
52
|
var propTypes: {
|
|
53
53
|
appearance: PropTypes.Requireable<string>;
|
|
54
54
|
backgroundColor: PropTypes.Requireable<string>;
|
|
55
|
-
children: PropTypes.Validator<
|
|
55
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
56
56
|
disabled: PropTypes.Requireable<boolean>;
|
|
57
57
|
elementRef: PropTypes.Requireable<object>;
|
|
58
58
|
foregroundColor: PropTypes.Requireable<string>;
|
|
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { legacyRefMode } from '@splunk/react-ui/Dropdown';
|
|
3
3
|
import { NavigationContext, NavigationProviderClickHandler } from './NavigationProvider';
|
|
4
4
|
import { ClassComponentProps } from '../utils/types';
|
|
5
|
+
export declare const isRootRelativeLink: (to: string | undefined) => boolean;
|
|
5
6
|
export declare const isInternalLink: (to: string | undefined) => boolean;
|
|
6
7
|
interface ClickablePropsBase {
|
|
7
8
|
/**
|
|
@@ -44,9 +45,9 @@ interface ClickablePropsBase {
|
|
|
44
45
|
to?: string;
|
|
45
46
|
}
|
|
46
47
|
declare const defaultProps: Required<Pick<ClickablePropsBase, 'disabled' | 'openInNewContext'>>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
type ClickableButtonProps = ClassComponentProps<ClickablePropsBase, typeof defaultProps, 'button'>;
|
|
49
|
+
type ClickableLinkProps = ClassComponentProps<ClickablePropsBase, typeof defaultProps, 'a', 'href'>;
|
|
50
|
+
type ClickableProps = ClickableButtonProps | ClickableLinkProps;
|
|
50
51
|
/**
|
|
51
52
|
* `Clickable` renders as a `button` element, or as an `a` element if the `to` prop is set
|
|
52
53
|
* and the `disabled` prop is `false`. This is called link mode.
|
|
@@ -57,13 +58,20 @@ declare class Clickable extends Component<ClickableProps> {
|
|
|
57
58
|
static contextType: React.Context<{
|
|
58
59
|
onClick?: NavigationProviderClickHandler | undefined;
|
|
59
60
|
prefix?: string | undefined;
|
|
61
|
+
transformUrl?: import("./NavigationProvider").NavigationProviderTransformUrl | undefined; /**
|
|
62
|
+
* The text representation of the navigational link.
|
|
63
|
+
* This should be provided if child content is not a string.
|
|
64
|
+
*
|
|
65
|
+
* Ignored if not in link mode.
|
|
66
|
+
*/
|
|
60
67
|
}>;
|
|
61
|
-
static propTypes: React.WeakValidationMap<
|
|
68
|
+
static propTypes: React.WeakValidationMap<ClickableProps>;
|
|
62
69
|
static defaultProps: Required<Pick<ClickablePropsBase, "disabled" | "openInNewContext">>;
|
|
63
70
|
static [legacyRefMode]: boolean;
|
|
64
71
|
constructor(props: Readonly<ClickableProps>);
|
|
65
72
|
private handleMount;
|
|
66
73
|
private createHandleOnClick;
|
|
74
|
+
private getTransformedUrl;
|
|
67
75
|
/**
|
|
68
76
|
* Place focus on the element.
|
|
69
77
|
*/
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
/** @public */
|
|
4
|
-
|
|
4
|
+
type NavigationProviderClickHandler = (event: React.MouseEvent<HTMLAnchorElement>, data: {
|
|
5
5
|
openInNewContext?: boolean;
|
|
6
6
|
to: string;
|
|
7
7
|
originalTo: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
}) => void;
|
|
10
|
-
|
|
10
|
+
type NavigationProviderTransformUrl = (url: string, data: {
|
|
11
|
+
isInternal?: boolean;
|
|
12
|
+
isRootRelative?: boolean;
|
|
13
|
+
}) => string;
|
|
14
|
+
interface NavigationProviderPropsBase {
|
|
11
15
|
children?: React.ReactNode;
|
|
12
16
|
/**
|
|
13
17
|
* An `onClick` handler to use when a link is clicked if no other `onClick` handler is supplied.
|
|
@@ -15,25 +19,42 @@ interface NavigationProviderProps {
|
|
|
15
19
|
*/
|
|
16
20
|
onClick?: NavigationProviderClickHandler;
|
|
17
21
|
/**
|
|
22
|
+
* @deprecated Use the `transformUrl` prop instead.
|
|
18
23
|
* If set, all links that use the NavigationProvider's context will have this prepended to them.
|
|
24
|
+
* This is ignored if `transformUrl` is set.
|
|
19
25
|
*/
|
|
20
26
|
prefix?: string;
|
|
27
|
+
/**
|
|
28
|
+
* If set, all links that use the NavigationProvider's context will be transformed using this function.
|
|
29
|
+
*/
|
|
30
|
+
transformUrl?: NavigationProviderTransformUrl;
|
|
31
|
+
}
|
|
32
|
+
interface NavigationProviderPropsWithPrefix extends NavigationProviderPropsBase {
|
|
33
|
+
prefix?: never;
|
|
34
|
+
transformUrl?: NavigationProviderTransformUrl;
|
|
35
|
+
}
|
|
36
|
+
interface NavigationProviderPropsWithoutPrefix extends NavigationProviderPropsBase {
|
|
37
|
+
prefix?: string;
|
|
38
|
+
transformUrl?: never;
|
|
21
39
|
}
|
|
22
|
-
|
|
40
|
+
type NavigationContextValue = {
|
|
23
41
|
onClick?: NavigationProviderClickHandler;
|
|
24
42
|
prefix?: string;
|
|
43
|
+
transformUrl?: NavigationProviderTransformUrl;
|
|
25
44
|
};
|
|
26
45
|
declare const NavigationContext: React.Context<NavigationContextValue>;
|
|
46
|
+
type NavigationProviderProps = NavigationProviderPropsWithPrefix | NavigationProviderPropsWithoutPrefix;
|
|
27
47
|
/**
|
|
28
48
|
* Used to provide an override for the `onClick` for links for single page applications so that
|
|
29
49
|
* internal links can navigate without a page reload.
|
|
30
50
|
*/
|
|
31
|
-
declare function NavigationProvider({ children, onClick, prefix }: NavigationProviderProps): JSX.Element;
|
|
51
|
+
declare function NavigationProvider({ children, onClick, prefix, transformUrl }: NavigationProviderProps): JSX.Element;
|
|
32
52
|
declare namespace NavigationProvider {
|
|
33
53
|
var propTypes: {
|
|
34
54
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
35
55
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
56
|
prefix: PropTypes.Requireable<string>;
|
|
57
|
+
transformUrl: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
58
|
};
|
|
38
59
|
}
|
|
39
|
-
export { NavigationContext, NavigationProvider, NavigationProviderClickHandler };
|
|
60
|
+
export { NavigationContext, NavigationProvider, NavigationProviderClickHandler, NavigationProviderTransformUrl, };
|
|
@@ -9,7 +9,7 @@ interface CloseButtonPropsBase {
|
|
|
9
9
|
elementRef?: React.Ref<HTMLButtonElement>;
|
|
10
10
|
screenReaderText?: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type CloseButtonProps = ComponentProps<CloseButtonPropsBase, 'button'>;
|
|
13
13
|
declare function CloseButton({ disabled, screenReaderText, ...otherProps }: CloseButtonProps): JSX.Element;
|
|
14
14
|
declare namespace CloseButton {
|
|
15
15
|
var propTypes: {
|
package/types/src/Code/Code.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
|
|
4
|
+
type CodeSupportedLanguages = 'bash' | 'clike' | 'css' | 'html' | 'json' | 'javascript' | 'js' | 'jsx' | 'typescript' | 'ts' | 'tsx' | 'markup' | 'mathml' | 'splunk-spl' | 'svg' | 'xml' | 'yaml' | 'yml';
|
|
5
5
|
interface CodePropsBase {
|
|
6
6
|
/**
|
|
7
7
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
@@ -29,7 +29,7 @@ interface CodePropsBase {
|
|
|
29
29
|
*/
|
|
30
30
|
value?: string;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
type CodeProps = ComponentProps<CodePropsBase, 'pre'>;
|
|
33
33
|
declare function Code({ elementRef, indentChars, language, languageFallback, showIndentGuide, value, ...otherProps }: CodeProps): JSX.Element;
|
|
34
34
|
declare namespace Code {
|
|
35
35
|
var propTypes: {
|
|
@@ -3,19 +3,19 @@ import SingleOpenPanelGroup, { SingleOpenPanelGroupChangeHandler } from './Singl
|
|
|
3
3
|
import SingleOpenPanelGroupContext from './SingleOpenPanelGroupContext';
|
|
4
4
|
import { ClassComponentProps } from '../utils/types';
|
|
5
5
|
/** @public @deprecated Use `CollapsiblePanelChangeHandler` */
|
|
6
|
-
|
|
6
|
+
type CollapsiblePanelRequestCloseHandler = (data: {
|
|
7
7
|
event: React.MouseEvent<HTMLButtonElement>;
|
|
8
8
|
panelId?: string | number;
|
|
9
9
|
reason: 'toggleClick';
|
|
10
10
|
}) => void;
|
|
11
11
|
/** @public @deprecated Use `CollapsiblePanelChangeHandler` */
|
|
12
|
-
|
|
12
|
+
type CollapsiblePanelRequestOpenHandler = (data: {
|
|
13
13
|
event: React.MouseEvent<HTMLButtonElement>;
|
|
14
14
|
panelId?: string | number;
|
|
15
15
|
reason: 'toggleClick';
|
|
16
16
|
}) => void;
|
|
17
17
|
/** @public */
|
|
18
|
-
|
|
18
|
+
type CollapsiblePanelChangeHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
19
19
|
action: 'open' | 'close';
|
|
20
20
|
panelId?: string | number;
|
|
21
21
|
reason: 'toggleClick';
|
|
@@ -117,7 +117,7 @@ interface CollapsiblePanelUncontrolledProps extends CollapsiblePanelPropsBase {
|
|
|
117
117
|
open?: never;
|
|
118
118
|
}
|
|
119
119
|
declare const defaultProps: Required<Pick<CollapsiblePanelPropsBase, 'disabled' | 'inset' | 'overflow' | 'renderChildrenWhenCollapsed' | 'titleWithActions'>>;
|
|
120
|
-
|
|
120
|
+
type CollapsiblePanelProps = ClassComponentProps<CollapsiblePanelDeprecatedControlledProps | CollapsiblePanelUncontrolledProps | CollapsiblePanelControlledProps, typeof defaultProps, 'div'>;
|
|
121
121
|
interface CollapsiblePanelState {
|
|
122
122
|
animating: boolean;
|
|
123
123
|
open?: boolean;
|
|
@@ -126,13 +126,17 @@ declare class CollapsiblePanel extends Component<CollapsiblePanelProps, Collapsi
|
|
|
126
126
|
private controlledExternally;
|
|
127
127
|
private containerId;
|
|
128
128
|
private toggleId;
|
|
129
|
-
static propTypes: React.WeakValidationMap<CollapsiblePanelDeprecatedControlledProps & Required<Pick<CollapsiblePanelPropsBase, "overflow" | "disabled" | "inset" | "renderChildrenWhenCollapsed" | "titleWithActions">> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">> | React.WeakValidationMap<CollapsiblePanelControlledProps & Required<Pick<CollapsiblePanelPropsBase, "overflow" | "disabled" | "inset" | "renderChildrenWhenCollapsed" | "titleWithActions">> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">> | React.WeakValidationMap<CollapsiblePanelUncontrolledProps & Required<Pick<CollapsiblePanelPropsBase, "overflow" | "disabled" | "inset" | "renderChildrenWhenCollapsed" | "titleWithActions">> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">>;
|
|
129
|
+
static propTypes: React.WeakValidationMap<CollapsiblePanelProps>;
|
|
130
130
|
static defaultProps: Required<Pick<CollapsiblePanelPropsBase, "overflow" | "disabled" | "inset" | "renderChildrenWhenCollapsed" | "titleWithActions">>;
|
|
131
131
|
context: React.ContextType<typeof SingleOpenPanelGroupContext>;
|
|
132
132
|
static contextType: React.Context<SingleOpenPanelGroupContext>;
|
|
133
133
|
constructor(props: Readonly<CollapsiblePanelProps>);
|
|
134
134
|
componentDidMount(): void;
|
|
135
135
|
componentDidUpdate(prevProps: Readonly<CollapsiblePanelProps>): void;
|
|
136
|
+
/**
|
|
137
|
+
* SingleOpenPanelGroup already takes into account if it is controlled or not in determining openPanelId
|
|
138
|
+
* so this.context.openPanelId is used for both the controlled and uncontrolled case.
|
|
139
|
+
*/
|
|
136
140
|
private isOpen;
|
|
137
141
|
private handleRequestClose;
|
|
138
142
|
private handleRequestOpen;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
/** @public */
|
|
5
|
-
|
|
5
|
+
type SingleOpenPanelGroupChangeHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
6
6
|
action: 'open' | 'close';
|
|
7
7
|
panelId?: string | number;
|
|
8
8
|
reason: 'toggleClick';
|
|
@@ -46,7 +46,7 @@ interface SingleOpenPanelGroupUncontrolledProps extends SingleOpenPanelGroupProp
|
|
|
46
46
|
defaultOpenPanelId?: string | number;
|
|
47
47
|
openPanelId?: never;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
type SingleOpenPanelGroupProps = ComponentProps<SingleOpenPanelGroupControlledProps | SingleOpenPanelGroupUncontrolledProps, 'div'>;
|
|
50
50
|
declare function SingleOpenPanelGroup(props: SingleOpenPanelGroupProps): JSX.Element;
|
|
51
51
|
declare namespace SingleOpenPanelGroup {
|
|
52
52
|
var propTypes: {
|