@splunk/react-ui 5.3.0 → 5.5.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 +31 -31
- package/Avatar.js +13 -13
- package/Badge.js +154 -0
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +43 -0
- package/CardLayout.js +39 -36
- package/Clickable.js +5 -6
- package/Code.js +917 -424
- package/CollapsiblePanel.js +1 -1
- package/Color.js +904 -1025
- package/ComboBox.js +6 -5
- package/DefinitionList.js +1 -1
- package/FormRows.js +13 -11
- package/JSONTree.js +682 -1408
- package/Link.js +74 -44
- package/MIGRATION.md +32 -1
- package/Markdown.js +9 -5
- package/Menu.js +100 -97
- package/Multiselect.js +1223 -2858
- package/Number.js +3 -3
- package/PhoneNumber.d.ts +2 -0
- package/PhoneNumber.js +769 -0
- package/Popover.js +235 -232
- package/RadioList.js +166 -151
- package/Resize.js +11 -8
- package/ResultsMenu.js +911 -1030
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -425
- package/Select.js +267 -1947
- package/SelectBase.d.ts +2 -0
- package/SelectBase.js +1681 -0
- package/Slider.js +202 -199
- package/SlidingPanels.js +170 -175
- package/StepBar.js +123 -97
- package/Switch.js +137 -118
- package/TabBar.js +296 -295
- package/TabLayout.js +14 -14
- package/Table.js +1562 -1516
- package/TextArea.js +596 -684
- package/TransitionOpen.js +82 -74
- package/Tree.js +638 -682
- package/docker-compose.yml +99 -52
- package/package.json +16 -12
- package/stubs-splunkui.d.ts +0 -86
- package/test-runner-jest.config.js +1 -0
- package/types/src/Badge/Badge.d.ts +29 -0
- package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
- package/types/src/Badge/docs/examples/Count.d.ts +6 -0
- package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
- package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
- package/types/src/Badge/index.d.ts +2 -0
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Code/Code.d.ts +4 -3
- package/types/src/Code/index.d.ts +1 -0
- package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/LinkContext.d.ts +14 -0
- package/types/src/Link/docs/examples/Visited.d.ts +7 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +3 -3
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
- package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/PhoneNumber/index.d.ts +2 -0
- package/types/src/PhoneNumber/utils.d.ts +47 -0
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +7 -2
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
- package/types/src/Select/Option.d.ts +8 -3
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
- package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
- package/types/src/SelectBase/index.d.ts +2 -0
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +10 -1
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/Body.d.ts +6 -1
- package/types/src/Table/Cell.d.ts +5 -1
- package/types/src/Table/Head.d.ts +6 -2
- package/types/src/Table/HeadCell.d.ts +5 -1
- package/types/src/Table/Row.d.ts +5 -1
- package/types/src/Table/Table.d.ts +21 -1
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
- package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
- package/useControlled.js +61 -97
- package/usePrevious.d.ts +2 -0
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +71 -136
- package/useRovingFocus.js +96 -41
- /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
4
|
+
/** @public */
|
|
5
|
+
type PhoneNumberChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement | HTMLSpanElement>, data: {
|
|
6
|
+
name?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
displayValue: string;
|
|
9
|
+
country?: string;
|
|
10
|
+
isPossibleNumber: boolean;
|
|
11
|
+
isValidNumber: boolean;
|
|
12
|
+
internationalFormat: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
/** @public */
|
|
15
|
+
type PhoneNumberBlurHandler = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
16
|
+
name?: string;
|
|
17
|
+
value: string;
|
|
18
|
+
displayValue: string;
|
|
19
|
+
country?: string;
|
|
20
|
+
isPossibleNumber: boolean;
|
|
21
|
+
isValidNumber: boolean;
|
|
22
|
+
internationalFormat: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
/** @public */
|
|
25
|
+
type PhoneNumberFocusHandler = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
26
|
+
name?: string;
|
|
27
|
+
value: string;
|
|
28
|
+
displayValue: string;
|
|
29
|
+
country?: string;
|
|
30
|
+
isPossibleNumber: boolean;
|
|
31
|
+
isValidNumber: boolean;
|
|
32
|
+
internationalFormat: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
interface PhoneNumberPropsBase {
|
|
35
|
+
/** Append removes rounded corners and the border from the right side. */
|
|
36
|
+
append?: boolean;
|
|
37
|
+
/** Include an "X" button to clear the value. */
|
|
38
|
+
canClear?: boolean;
|
|
39
|
+
/** The iso2 country code to use for the phone number input. */
|
|
40
|
+
defaultCountry?: string;
|
|
41
|
+
/** Set this property instead of value to make the value uncontrolled. */
|
|
42
|
+
defaultValue?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The id of the description. When placed in a ControlGroup, this is automatically set to the
|
|
45
|
+
* ControlGroup's help component.
|
|
46
|
+
*/
|
|
47
|
+
describedBy?: string;
|
|
48
|
+
/** Determines whether or not the input is disabled. */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
52
|
+
*/
|
|
53
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
54
|
+
/** Highlight the field as having an error. */
|
|
55
|
+
error?: boolean;
|
|
56
|
+
/** When true, displays inline with a default width. */
|
|
57
|
+
inline?: boolean;
|
|
58
|
+
/** An id for the text input. */
|
|
59
|
+
inputId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A React ref which is set to the text input element when the component mounts, and null when it unmounts.
|
|
62
|
+
*/
|
|
63
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
64
|
+
/**
|
|
65
|
+
* The id of the label. When placed in a ControlGroup, this is automatically set to the
|
|
66
|
+
* ControlGroup's label.
|
|
67
|
+
*/
|
|
68
|
+
labelledBy?: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
/** A callback for when the input loses focus. */
|
|
71
|
+
onBlur?: PhoneNumberBlurHandler;
|
|
72
|
+
/**
|
|
73
|
+
* Called whenever the value changes.
|
|
74
|
+
* If the value prop is set, this callback is required.
|
|
75
|
+
*/
|
|
76
|
+
onChange?: PhoneNumberChangeHandler;
|
|
77
|
+
/** A callback for when the input is clicked. */
|
|
78
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
79
|
+
/** A callback for when the input takes focus. */
|
|
80
|
+
onFocus?: PhoneNumberFocusHandler;
|
|
81
|
+
/** A callback for when the user selects text. */
|
|
82
|
+
onSelect?: React.ReactEventHandler<HTMLInputElement>;
|
|
83
|
+
/** Prepend removes rounded borders from the left side. */
|
|
84
|
+
prepend?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @private
|
|
87
|
+
* Do not format the number as the user types.
|
|
88
|
+
*/
|
|
89
|
+
skipFormatting?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* A React ref which is set to the dropdown toggle when the component mounts and null when it unmounts.
|
|
92
|
+
*/
|
|
93
|
+
toggleRef?: React.Ref<HTMLButtonElement>;
|
|
94
|
+
/**
|
|
95
|
+
* The contents of the input. Setting this value makes the input controlled. A callback is required.
|
|
96
|
+
*/
|
|
97
|
+
value?: string;
|
|
98
|
+
}
|
|
99
|
+
interface PhoneNumberPropsBaseControlled extends PhoneNumberPropsBase {
|
|
100
|
+
defaultValue?: never;
|
|
101
|
+
onChange: PhoneNumberChangeHandler;
|
|
102
|
+
value?: string;
|
|
103
|
+
}
|
|
104
|
+
interface PhoneNumberPropsBaseUncontrolled extends PhoneNumberPropsBase {
|
|
105
|
+
defaultValue?: string;
|
|
106
|
+
value?: never;
|
|
107
|
+
}
|
|
108
|
+
type PhoneNumberProps = ComponentProps<PhoneNumberPropsBaseControlled | PhoneNumberPropsBaseUncontrolled, 'div'>;
|
|
109
|
+
declare function PhoneNumber({ append, canClear, defaultCountry, defaultValue, describedBy, disabled, elementRef, error, inline, inputRef, name, onBlur, onChange, onFocus, prepend, skipFormatting, toggleRef, value, ...otherProps }: PhoneNumberProps): React.JSX.Element;
|
|
110
|
+
declare namespace PhoneNumber {
|
|
111
|
+
var componentType: string;
|
|
112
|
+
var propTypes: {
|
|
113
|
+
append: PropTypes.Requireable<boolean>;
|
|
114
|
+
canClear: PropTypes.Requireable<boolean>;
|
|
115
|
+
defaultCountry: PropTypes.Requireable<string>;
|
|
116
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
117
|
+
describedBy: PropTypes.Requireable<string>;
|
|
118
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
119
|
+
elementRef: PropTypes.Requireable<object>;
|
|
120
|
+
error: PropTypes.Requireable<boolean>;
|
|
121
|
+
inline: PropTypes.Requireable<boolean>;
|
|
122
|
+
inputId: PropTypes.Requireable<string>;
|
|
123
|
+
inputRef: PropTypes.Requireable<object>;
|
|
124
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
125
|
+
name: PropTypes.Requireable<string>;
|
|
126
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
127
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
128
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
129
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
130
|
+
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
131
|
+
prepend: PropTypes.Requireable<boolean>;
|
|
132
|
+
/** @private */
|
|
133
|
+
skipFormatting: PropTypes.Requireable<boolean>;
|
|
134
|
+
value: PropTypes.Requireable<string>;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export default PhoneNumber;
|
|
138
|
+
export { PhoneNumberBlurHandler, PhoneNumberChangeHandler, PhoneNumberFocusHandler };
|
|
139
|
+
export type { PhoneNumberProps, PhoneNumberPropsBase, PhoneNumberPropsBaseControlled, PhoneNumberPropsBaseUncontrolled, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name Uncontrolled
|
|
4
|
+
* @description Alternatively, Phone Number can be uncontrolled and optionally provided a `defaultValue`. The `onChange` callback still fires. The `value` prop cannot be set or updated externally.
|
|
5
|
+
*/
|
|
6
|
+
declare function Uncontrolled(): React.JSX.Element;
|
|
7
|
+
export default Uncontrolled;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type IntlTelInputUtils = typeof import('intl-tel-input/intlTelInputWithUtils').default.utils;
|
|
2
|
+
type CountryData = {
|
|
3
|
+
areaCodes: string[] | null;
|
|
4
|
+
countryName: string;
|
|
5
|
+
dialCode: string;
|
|
6
|
+
flag: string;
|
|
7
|
+
iso2: string;
|
|
8
|
+
iso2Upper: string;
|
|
9
|
+
nationalPrefix: string | null;
|
|
10
|
+
priority?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const PHONE_NUMBER_INVALID_CHAR_REGEX: RegExp;
|
|
13
|
+
declare const UNKNOWN_FLAG = "\uD83C\uDF10";
|
|
14
|
+
declare const loadUtils: () => Promise<{
|
|
15
|
+
formatNumber(number: string, iso2: string | undefined, format?: number): string;
|
|
16
|
+
formatNumberAsYouType(number: string, iso2: string | undefined): string;
|
|
17
|
+
getCoreNumber(number: string, iso2: string | undefined): string;
|
|
18
|
+
getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: number, useE164?: boolean): string;
|
|
19
|
+
getExtension(number: string, iso2: string | undefined): string;
|
|
20
|
+
getNumberType(number: string, iso2: string | undefined): number;
|
|
21
|
+
getValidationError(number: string, iso2: string | undefined): number;
|
|
22
|
+
isPossibleNumber(number: string, iso2: string | undefined, numberType?: ("FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP")[] | null): boolean;
|
|
23
|
+
isValidNumber(number: string, iso2: string | undefined, numberType?: ("FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP")[] | null): boolean;
|
|
24
|
+
numberFormat: {
|
|
25
|
+
NATIONAL: number;
|
|
26
|
+
INTERNATIONAL: number;
|
|
27
|
+
E164: number;
|
|
28
|
+
RFC3966: number;
|
|
29
|
+
};
|
|
30
|
+
numberType: object;
|
|
31
|
+
} | null | undefined>;
|
|
32
|
+
declare const getCountryFlag: (countryCode: string) => string;
|
|
33
|
+
declare const getCountries: () => CountryData[];
|
|
34
|
+
/**
|
|
35
|
+
* Main function to process phone input using intl-tel-input utilities
|
|
36
|
+
*/
|
|
37
|
+
declare const processPhoneInput: (utils: IntlTelInputUtils | null, inputValue: string, country?: string, countries?: CountryData[]) => {
|
|
38
|
+
displayValue: string;
|
|
39
|
+
value: string;
|
|
40
|
+
internationalFormat: string;
|
|
41
|
+
country: string;
|
|
42
|
+
isPossibleNumber: boolean;
|
|
43
|
+
isValidNumber: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare const replaceDialCode: (inputValue: string, previousCountry: string, newCountry: string, countries: CountryData[]) => string;
|
|
46
|
+
export { getCountries, getCountryFlag, loadUtils, processPhoneInput, replaceDialCode, PHONE_NUMBER_INVALID_CHAR_REGEX, UNKNOWN_FLAG, };
|
|
47
|
+
export type { IntlTelInputUtils };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { RadioListChangeHandler, RadioListValueTypes } from '
|
|
3
|
+
import { RadioListChangeHandler, RadioListValueTypes } from '@splunk/react-ui/RadioList';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface OptionPropsBase {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Additional information to explain the option.
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
7
11
|
disabled?: boolean;
|
|
8
12
|
error?: boolean;
|
|
9
13
|
id?: string;
|
|
@@ -14,10 +18,11 @@ interface OptionPropsBase {
|
|
|
14
18
|
value: RadioListValueTypes;
|
|
15
19
|
}
|
|
16
20
|
type OptionProps = ComponentProps<OptionPropsBase, 'div'>;
|
|
17
|
-
declare function Option({ children, disabled: disabledProp, error: errorProp, id: idProp, onChange, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
21
|
+
declare function Option({ children, description, disabled: disabledProp, error: errorProp, id: idProp, onChange, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
18
22
|
declare namespace Option {
|
|
19
23
|
var propTypes: {
|
|
20
24
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
|
+
description: PropTypes.Requireable<string>;
|
|
21
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
22
27
|
error: PropTypes.Requireable<boolean>;
|
|
23
28
|
id: PropTypes.Requireable<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { OptionClickHandler as OptionBaseClickHandler } from '@splunk/react-ui/SelectBase';
|
|
2
3
|
import { ComponentProps } from '../utils/types';
|
|
3
|
-
import type { OptionClickHandler } from './OptionBase';
|
|
4
4
|
interface OptionPropsBase {
|
|
5
5
|
/** @private */
|
|
6
6
|
active?: boolean;
|
|
@@ -26,6 +26,11 @@ interface OptionPropsBase {
|
|
|
26
26
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
27
27
|
*/
|
|
28
28
|
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
29
|
+
/**
|
|
30
|
+
* Allow the endAdornment to be passed to the underlying Menu.Item.
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
endAdornment?: React.ReactNode;
|
|
29
34
|
/**
|
|
30
35
|
* Adding hidden options can be useful for resolving the selected display label and icon,
|
|
31
36
|
* when the option should not be in the list. This scenario can arise when Select's filter is
|
|
@@ -55,7 +60,7 @@ interface OptionPropsBase {
|
|
|
55
60
|
end: number;
|
|
56
61
|
}[];
|
|
57
62
|
/** @private */
|
|
58
|
-
onClick?:
|
|
63
|
+
onClick?: OptionBaseClickHandler;
|
|
59
64
|
/** @private */
|
|
60
65
|
role?: 'menuitemcheckbox' | 'option';
|
|
61
66
|
/** @private */
|
|
@@ -76,4 +81,4 @@ type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
|
76
81
|
declare function Option({ children, descriptionPosition, elementRef, label, ...otherProps }: OptionProps): React.JSX.Element;
|
|
77
82
|
declare const OptionMemoized: React.MemoExoticComponent<typeof Option>;
|
|
78
83
|
export default OptionMemoized;
|
|
79
|
-
export type {
|
|
84
|
+
export type { OptionBaseClickHandler, OptionPropsBase };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Divider as BaseDivider, Heading as BaseHeading, SelectBaseProps } from '@splunk/react-ui/SelectBase';
|
|
3
4
|
import Option from './Option';
|
|
4
|
-
import { Divider as BaseDivider, Heading as BaseHeading, SelectBaseProps } from './SelectBase';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
/** @public */
|
|
7
7
|
type SelectChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>, data: {
|
|
@@ -30,6 +30,11 @@ interface OptionPropsBase {
|
|
|
30
30
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
31
31
|
*/
|
|
32
32
|
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
33
|
+
/**
|
|
34
|
+
* Allow the endAdornment to be passed to the underlying Menu.Item.
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
endAdornment?: React.ReactNode;
|
|
33
38
|
/**
|
|
34
39
|
* Adding hidden options can be useful for resolving the selected display label and icon,
|
|
35
40
|
* when the option should not be in the list. This scenario can arise when Select's filter is
|
|
@@ -81,7 +86,7 @@ type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
|
81
86
|
/**
|
|
82
87
|
* An option within a `Multiselect`.
|
|
83
88
|
*/
|
|
84
|
-
declare function Option({ children, descriptionPosition, disabled, elementRef, icon, label, multiple, onClick, role, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
89
|
+
declare function Option({ children, descriptionPosition, disabled, elementRef, endAdornment, icon, label, multiple, onClick, role, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
85
90
|
declare namespace Option {
|
|
86
91
|
var propTypes: {
|
|
87
92
|
/** @private */
|
|
@@ -91,6 +96,7 @@ declare namespace Option {
|
|
|
91
96
|
descriptionPosition: PropTypes.Requireable<string>;
|
|
92
97
|
disabled: PropTypes.Requireable<boolean>;
|
|
93
98
|
elementRef: PropTypes.Requireable<object>;
|
|
99
|
+
endAdornment: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
94
100
|
hidden: PropTypes.Requireable<boolean>;
|
|
95
101
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
96
102
|
label: PropTypes.Validator<string>;
|
|
@@ -114,4 +120,4 @@ declare namespace Option {
|
|
|
114
120
|
var type: typeof Item;
|
|
115
121
|
}
|
|
116
122
|
export default Option;
|
|
117
|
-
export { OptionClickHandler };
|
|
123
|
+
export type { OptionClickHandler };
|
|
@@ -3,7 +3,9 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Divider, Heading } from '@splunk/react-ui/Menu';
|
|
4
4
|
import { TextBlurHandler, TextChangeHandler, TextFocusHandler } from '@splunk/react-ui/Text';
|
|
5
5
|
import Option from './OptionBase';
|
|
6
|
+
import SelectAllOption from './SelectAllOption';
|
|
6
7
|
import { ComponentProps } from '../utils/types';
|
|
8
|
+
import type { OptionClickHandler } from './OptionBase';
|
|
7
9
|
type SelectBaseFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent, data: {
|
|
8
10
|
keyword: string;
|
|
9
11
|
}) => void;
|
|
@@ -286,4 +288,4 @@ declare namespace SelectBase {
|
|
|
286
288
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
287
289
|
}
|
|
288
290
|
export default SelectBase;
|
|
289
|
-
export { Controls, ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
|
|
291
|
+
export { Controls, ChildrenElement, Divider, Heading, Option, SelectAllOption, OptionClickHandler, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
|
|
@@ -17,15 +17,18 @@ interface StepBarPropsBase {
|
|
|
17
17
|
* Setting inline to true makes the Step Bar an inline element. It assumes its minimum width.
|
|
18
18
|
*/
|
|
19
19
|
inline?: boolean;
|
|
20
|
+
/** The flow direction of steps. */
|
|
21
|
+
orientation?: 'horizontal' | 'vertical';
|
|
20
22
|
}
|
|
21
23
|
type StepBarProps = ComponentProps<StepBarPropsBase, 'ul'>;
|
|
22
|
-
declare function StepBar({ activeStepId, children, elementRef, inline, ...otherProps }: StepBarProps): React.JSX.Element;
|
|
24
|
+
declare function StepBar({ activeStepId, children, elementRef, inline, orientation, ...otherProps }: StepBarProps): React.JSX.Element;
|
|
23
25
|
declare namespace StepBar {
|
|
24
26
|
var propTypes: {
|
|
25
27
|
activeStepId: PropTypes.Validator<any>;
|
|
26
28
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
29
|
elementRef: PropTypes.Requireable<object>;
|
|
28
30
|
inline: PropTypes.Requireable<boolean>;
|
|
31
|
+
orientation: PropTypes.Requireable<string>;
|
|
29
32
|
};
|
|
30
33
|
var Step: typeof import("./Step").default;
|
|
31
34
|
}
|
|
@@ -20,6 +20,11 @@ interface SwitchPropsBase {
|
|
|
20
20
|
*/
|
|
21
21
|
appearance?: 'checkbox' | 'toggle';
|
|
22
22
|
children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The id of the description. When placed in a ControlGroup, this is automatically set to the
|
|
25
|
+
* ControlGroup's help component.
|
|
26
|
+
*/
|
|
27
|
+
describedBy?: string;
|
|
23
28
|
disabled?: boolean;
|
|
24
29
|
/**
|
|
25
30
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
@@ -52,10 +57,12 @@ interface SwitchPropsBase {
|
|
|
52
57
|
*/
|
|
53
58
|
selected?: boolean | 'some';
|
|
54
59
|
/**
|
|
60
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
55
61
|
* The customized content presented to screen readers when selected.
|
|
56
62
|
*/
|
|
57
63
|
selectedLabel?: string;
|
|
58
64
|
/**
|
|
65
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
59
66
|
* The customized content presented to screen readers when selected="some".
|
|
60
67
|
*/
|
|
61
68
|
someSelectedLabel?: string;
|
|
@@ -64,6 +71,7 @@ interface SwitchPropsBase {
|
|
|
64
71
|
*/
|
|
65
72
|
toggleRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>;
|
|
66
73
|
/**
|
|
74
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
67
75
|
* The customized content presented to screen readers when unselected.
|
|
68
76
|
*/
|
|
69
77
|
unselectedLabel?: string;
|
|
@@ -88,11 +96,12 @@ type SwitchProps = ComponentProps<SwitchCheckboxWithSomePropsBase | SwitchNoSome
|
|
|
88
96
|
/**
|
|
89
97
|
* `Switch` is a basic form control with an on/off state.
|
|
90
98
|
*/
|
|
91
|
-
declare function Switch({ appearance, children, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
|
|
99
|
+
declare function Switch({ appearance, children, describedBy, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
|
|
92
100
|
declare namespace Switch {
|
|
93
101
|
var propTypes: {
|
|
94
102
|
appearance: PropTypes.Requireable<string>;
|
|
95
103
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
104
|
+
describedBy: PropTypes.Requireable<string>;
|
|
96
105
|
disabled: PropTypes.Requireable<boolean>;
|
|
97
106
|
elementRef: PropTypes.Requireable<object>;
|
|
98
107
|
error: PropTypes.Requireable<boolean>;
|
|
@@ -41,7 +41,9 @@ interface TabPropsBase {
|
|
|
41
41
|
* instead of a <button> tag. */
|
|
42
42
|
to?: string;
|
|
43
43
|
/**
|
|
44
|
-
* Content to show in a tooltip.
|
|
44
|
+
* Content to show in a tooltip when the user hovers over or focuses on the Tab.
|
|
45
|
+
*
|
|
46
|
+
* Note: The tooltip will override the label for the Tab for screen readers.
|
|
45
47
|
*/
|
|
46
48
|
tooltip?: React.ReactNode;
|
|
47
49
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Icons
|
|
4
|
+
* @description Icons can be used in tabs to provide additional context.
|
|
5
|
+
* Use icons sparingly and only when they add value that the text alone cannot communicate.
|
|
6
|
+
*
|
|
7
|
+
* Icon only tabs are not recommended. If you do use an icon only tab, a tooltip is required to provide an accessible name to the tab.
|
|
4
8
|
*/
|
|
5
9
|
declare function IconsLeft(): React.JSX.Element;
|
|
6
10
|
export default IconsLeft;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Tooltips
|
|
4
|
+
* @description Tooltips must be used when the entire tab label is not visible: e.g. due to truncation.
|
|
5
|
+
* The tooltip will override the accessible name of the tab.
|
|
6
|
+
* Tooltips should not be used to add a description or additional information.
|
|
4
7
|
*/
|
|
5
8
|
declare function Tooltips(): React.JSX.Element;
|
|
6
9
|
export default Tooltips;
|
|
@@ -22,6 +22,8 @@ interface PanelPropsBase {
|
|
|
22
22
|
panelId: string;
|
|
23
23
|
/**
|
|
24
24
|
* Content to show in a tooltip when the user hovers over or focuses on the tab.
|
|
25
|
+
*
|
|
26
|
+
* Note: The tooltip will override the label for the Panel for screen readers.
|
|
25
27
|
*/
|
|
26
28
|
tooltip?: React.ReactNode;
|
|
27
29
|
/** Prevents user from clicking the tab. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { PinnedColumnsProp } from '@splunk/react-ui/Table';
|
|
3
4
|
import { RowRequestMoveRowHandler } from './Row';
|
|
4
5
|
import { ComponentProps } from '../utils/types';
|
|
5
6
|
type BodyRequestMoveRowHandler = RowRequestMoveRowHandler;
|
|
@@ -20,13 +21,15 @@ interface BodyPropsBase {
|
|
|
20
21
|
rowExpansion?: 'single' | 'multi' | 'none' | 'controlled';
|
|
21
22
|
/** @private. Generally passed by Table rather than added directly. */
|
|
22
23
|
onRequestMoveRow?: BodyRequestMoveRowHandler;
|
|
24
|
+
/** @private. */
|
|
25
|
+
pinnedColumns?: PinnedColumnsProp;
|
|
23
26
|
/** Indicates the column to use as the primary label for each row. */
|
|
24
27
|
primaryColumnIndex?: number;
|
|
25
28
|
/** @private. Generally passed by Table rather than added directly. */
|
|
26
29
|
stripeRows?: boolean;
|
|
27
30
|
}
|
|
28
31
|
type BodyProps = ComponentProps<BodyPropsBase, 'tbody'>;
|
|
29
|
-
declare function Body({ actions, children, elementRef, movableColumns, onRequestMoveRow, rowExpansion, primaryColumnIndex, stripeRows, ...otherProps }: BodyProps): React.JSX.Element | null;
|
|
32
|
+
declare function Body({ actions, children, elementRef, pinnedColumns, movableColumns, onRequestMoveRow, rowExpansion, primaryColumnIndex, stripeRows, ...otherProps }: BodyProps): React.JSX.Element | null;
|
|
30
33
|
declare namespace Body {
|
|
31
34
|
var propTypes: {
|
|
32
35
|
/** @private. Generally passed by Table rather than added directly. */
|
|
@@ -39,6 +42,8 @@ declare namespace Body {
|
|
|
39
42
|
rowExpansion: PropTypes.Requireable<string>;
|
|
40
43
|
/** @private. Generally passed by Table rather than added directly. */
|
|
41
44
|
onRequestMoveRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
/** @private. */
|
|
46
|
+
pinnedColumns: PropTypes.Requireable<object>;
|
|
42
47
|
/** @private. Generally passed by Table rather than added directly. */
|
|
43
48
|
primaryColumnIndex: PropTypes.Requireable<number>;
|
|
44
49
|
/** @private. Generally passed by Table rather than added directly. */
|
|
@@ -24,6 +24,8 @@ interface CellPropsBase {
|
|
|
24
24
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
25
25
|
*/
|
|
26
26
|
elementRef?: React.Ref<HTMLTableCellElement>;
|
|
27
|
+
/** @private. */
|
|
28
|
+
isPinned?: boolean;
|
|
27
29
|
/**
|
|
28
30
|
* @private
|
|
29
31
|
* Used to style the primary cell when row is clickable
|
|
@@ -44,7 +46,7 @@ interface CellPropsBase {
|
|
|
44
46
|
variant?: 'toggle' | 'expand' | 'drag' | 'actions';
|
|
45
47
|
}
|
|
46
48
|
type CellProps = ComponentProps<CellPropsBase, 'td'>;
|
|
47
|
-
declare function Cell({ align, appearance, appearClickable, children, data, disabled, elementRef, isPrimaryCell, onClick, onKeyDown, stripe, variant, ...otherProps }: CellProps): React.JSX.Element;
|
|
49
|
+
declare function Cell({ align, appearance, appearClickable, children, data, disabled, elementRef, isPinned, isPrimaryCell, onClick, onKeyDown, stripe, variant, ...otherProps }: CellProps): React.JSX.Element;
|
|
48
50
|
declare namespace Cell {
|
|
49
51
|
var propTypes: {
|
|
50
52
|
align: PropTypes.Requireable<string>;
|
|
@@ -57,6 +59,8 @@ declare namespace Cell {
|
|
|
57
59
|
elementRef: PropTypes.Requireable<object>;
|
|
58
60
|
/** @private */
|
|
59
61
|
isPrimaryCell: PropTypes.Requireable<boolean>;
|
|
62
|
+
/** @private */
|
|
63
|
+
isPinned: PropTypes.Requireable<boolean>;
|
|
60
64
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
65
|
/** @private */
|
|
62
66
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TableRequestMoveColumnHandler } from '
|
|
3
|
+
import { PinnedColumnsProp, TableRequestMoveColumnHandler } from '@splunk/react-ui/Table';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
|
|
6
6
|
columnId?: string;
|
|
@@ -42,11 +42,13 @@ interface HeadPropsBase {
|
|
|
42
42
|
/** @private. */
|
|
43
43
|
onRequestToggleAllRows?: () => void;
|
|
44
44
|
/** @private. */
|
|
45
|
+
pinnedColumns?: PinnedColumnsProp;
|
|
46
|
+
/** @private. */
|
|
45
47
|
rowSelection?: 'all' | 'some' | 'none';
|
|
46
48
|
}
|
|
47
49
|
type HeadProps = ComponentProps<HeadPropsBase, 'thead'>;
|
|
48
50
|
declare const getCellWidths: (headEl: HTMLTableSectionElement | null) => number[];
|
|
49
|
-
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
|
|
51
|
+
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, pinnedColumns, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
|
|
50
52
|
declare namespace Head {
|
|
51
53
|
var propTypes: {
|
|
52
54
|
/** @private. */
|
|
@@ -70,6 +72,8 @@ declare namespace Head {
|
|
|
70
72
|
/** @private. */
|
|
71
73
|
onRequestToggleAllRows: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
74
|
/** @private. */
|
|
75
|
+
pinnedColumns: PropTypes.Requireable<object>;
|
|
76
|
+
/** @private. */
|
|
73
77
|
rowSelection: PropTypes.Requireable<string>;
|
|
74
78
|
};
|
|
75
79
|
var splunkUiType: string;
|
|
@@ -46,6 +46,8 @@ interface HeadCellPropsBase {
|
|
|
46
46
|
/** @private The index of the cell, skipping the info column. */
|
|
47
47
|
index?: number;
|
|
48
48
|
/** @private. */
|
|
49
|
+
isPinned?: boolean;
|
|
50
|
+
/** @private. */
|
|
49
51
|
onAutosizeColumn?: HeadCellAutosizeColumnHandler;
|
|
50
52
|
/**
|
|
51
53
|
* A callback invoked when this head cell is clicked. If provided, this HeadCell is
|
|
@@ -97,7 +99,7 @@ interface HeadCellPropsBase {
|
|
|
97
99
|
variant?: 'toggleAll' | 'info' | 'actions';
|
|
98
100
|
}
|
|
99
101
|
type HeadCellProps = ComponentProps<HeadCellPropsBase, 'th'>;
|
|
100
|
-
declare function HeadCell({ align, appearClickable, children, columnId, elementRef, dragId, headCellScreenReaderText, id, index, onAutosizeColumn, onClick, onKeyDown, onRequestMoveColumn, onRequestResize, onSort, resizable, sortDir, sortKey, style, tooltip, truncate: truncateProp, variant, visible, width, ...otherProps }: HeadCellProps): React.JSX.Element;
|
|
102
|
+
declare function HeadCell({ align, appearClickable, children, columnId, elementRef, dragId, headCellScreenReaderText, id, index, isPinned, onAutosizeColumn, onClick, onKeyDown, onRequestMoveColumn, onRequestResize, onSort, resizable, sortDir, sortKey, style, tooltip, truncate: truncateProp, variant, visible, width, ...otherProps }: HeadCellProps): React.JSX.Element;
|
|
101
103
|
declare namespace HeadCell {
|
|
102
104
|
var propTypes: {
|
|
103
105
|
align: PropTypes.Requireable<string>;
|
|
@@ -112,6 +114,8 @@ declare namespace HeadCell {
|
|
|
112
114
|
/** @private The index of the cell, skipping the info column. */
|
|
113
115
|
index: PropTypes.Requireable<number>;
|
|
114
116
|
/** @private. */
|
|
117
|
+
isPinned: PropTypes.Requireable<boolean>;
|
|
118
|
+
/** @private. */
|
|
115
119
|
onAutosizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
|
|
116
120
|
/** @private. */
|
|
117
121
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|