@splunk/react-ui 5.0.0-beta.2 → 5.0.0-beta.4
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 +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -4
- package/ButtonGroup.js +10 -11
- package/ButtonSimple.js +48 -42
- package/CHANGELOG.md +26 -0
- package/CHANGELOG.v5.mdx +81 -0
- package/Calendar.js +352 -469
- package/Card.js +178 -321
- package/Chip.js +154 -296
- package/Clickable.js +30 -30
- package/Code.js +64 -49
- package/Color.js +546 -462
- package/ComboBox.js +575 -767
- package/Date.js +144 -136
- package/Divider.js +29 -26
- package/DualListbox.js +441 -444
- package/File.js +707 -981
- package/FormRows.js +260 -286
- package/Image.js +124 -251
- package/JSONTree.js +129 -129
- package/Layout.d.ts +2 -0
- package/Link.js +12 -12
- package/MIGRATION.mdx +22 -1
- package/MIGRATION.v5.mdx +12 -1
- package/Menu.js +76 -76
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +42 -40
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1989 -2362
- package/NonInteractiveCheckbox.js +30 -118
- package/Number.js +75 -73
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Resize.js +62 -65
- package/Scroll.js +2 -2
- package/Select.js +281 -283
- package/SidePanel.js +53 -55
- package/Slider.js +370 -364
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +170 -343
- package/StaticContent.js +15 -13
- package/StepBar.js +61 -60
- package/Switch.js +150 -164
- package/TabBar.js +544 -417
- package/Table.js +1711 -1540
- package/Text.js +28 -26
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +179 -158
- package/Tree.d.ts +2 -0
- package/WaitSpinner.js +1 -1
- package/package.json +7 -9
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +27 -14
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +1 -1
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/Color/Color.d.ts +3 -3
- package/types/src/Color/ColorInput.d.ts +27 -0
- package/types/src/Color/Palette.d.ts +11 -18
- package/types/src/Color/Swatch.d.ts +3 -1
- package/types/src/ComboBox/ComboBox.d.ts +46 -50
- package/types/src/ComboBox/Option.d.ts +34 -18
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/Date.d.ts +3 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/Divider/Divider.d.ts +14 -6
- package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +6 -6
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +7 -0
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +8 -8
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/MessageBar/MessageBar.d.ts +5 -1
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +49 -21
- package/types/src/Multiselect/Multiselect.d.ts +73 -30
- package/types/src/Multiselect/Normal.d.ts +46 -57
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +9 -8
- package/types/src/Number/Number.d.ts +1 -0
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/SidePanel/SidePanel.d.ts +8 -3
- package/types/src/Slider/Slider.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +34 -20
- package/types/src/SplitButton/SplitButton.d.ts +4 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/Switch.d.ts +1 -9
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +4 -3
- package/types/src/TabBar/TabBarContext.d.ts +7 -2
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/File/Icon.d.ts +0 -3
- package/types/src/File/IconCloud.d.ts +0 -3
- package/types/src/File/PaperClip.d.ts +0 -3
- package/types/src/File/Retry.d.ts +0 -2
- package/types/src/File/Trash.d.ts +0 -3
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- package/types/src/Tooltip/InfoIcon.d.ts +0 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import Panel from './Panel';
|
|
3
|
-
import {
|
|
4
|
+
import { ComponentProps } from '../utils/types';
|
|
4
5
|
/** @public */
|
|
5
6
|
type AccordionChangeHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
6
7
|
event: React.MouseEvent<HTMLButtonElement>;
|
|
@@ -47,30 +48,22 @@ interface AccordionUncontrolledProps extends AccordionPropsBase {
|
|
|
47
48
|
defaultOpenPanelId?: string | number;
|
|
48
49
|
openPanelId?: never;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
inset: boolean;
|
|
52
|
-
};
|
|
53
|
-
type AccordionProps = ClassComponentProps<AccordionControlledProps | AccordionUncontrolledProps, typeof defaultProps, 'div'>;
|
|
54
|
-
interface AccordionState {
|
|
55
|
-
openPanelId?: string | number;
|
|
56
|
-
}
|
|
51
|
+
type AccordionProps = ComponentProps<AccordionControlledProps | AccordionUncontrolledProps, 'div'>;
|
|
57
52
|
/**
|
|
58
53
|
* @deprecated
|
|
59
54
|
* Accordion has been deprecated and will be removed in a future major version. Use Collapsible Panel's SingleOpenPanelGroup API instead.
|
|
60
55
|
*/
|
|
61
|
-
declare
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
declare function Accordion({ children, defaultOpenPanelId, elementRef, inset, onChange, openPanelId: openPanelIdProp, ...otherProps }: AccordionProps): React.JSX.Element;
|
|
57
|
+
declare namespace Accordion {
|
|
58
|
+
var propTypes: {
|
|
59
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
60
|
+
defaultOpenPanelId: PropTypes.Requireable<any>;
|
|
61
|
+
elementRef: PropTypes.Requireable<object>;
|
|
62
|
+
inset: PropTypes.Requireable<boolean>;
|
|
63
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
|
+
openPanelId: PropTypes.Requireable<any>;
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
constructor(props: Readonly<AccordionProps>);
|
|
69
|
-
componentDidUpdate(prevProps: Readonly<AccordionProps>): void;
|
|
70
|
-
private getCurrentOpenPanel;
|
|
71
|
-
private handleChange;
|
|
72
|
-
private isControlled;
|
|
73
|
-
render(): React.JSX.Element;
|
|
66
|
+
var Panel: typeof import("./Panel").default;
|
|
74
67
|
}
|
|
75
68
|
export default Accordion;
|
|
76
69
|
export { AccordionChangeHandler, Panel };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { SpringComponentProps as RSSpringComponentProps, TransitionComponentProps as RSTransitionComponentProps, UseSpringProps as RSUseSpringProps, UseTransitionProps as RSUseTransitionProps } from 'react-spring';
|
|
1
|
+
import { SpringComponentProps as RSSpringComponentProps, TransitionComponentProps as RSTransitionComponentProps, UseSpringProps as RSUseSpringProps, UseTransitionProps as RSUseTransitionProps } from '@react-spring/web';
|
|
3
2
|
declare function useAnimation({ immediate, ...otherProps }: RSUseSpringProps): {
|
|
4
3
|
[x: string]: any;
|
|
5
4
|
[x: number]: any;
|
|
6
5
|
};
|
|
7
|
-
declare function useAnimationTransition(items: any, { immediate, ...otherProps }: RSUseTransitionProps): import("react-spring").TransitionFn<any, {
|
|
6
|
+
declare function useAnimationTransition(items: any, { immediate, ...otherProps }: RSUseTransitionProps): import("@react-spring/core").TransitionFn<any, {
|
|
8
7
|
[x: string]: any;
|
|
9
8
|
[x: number]: any;
|
|
10
9
|
[Symbol.hasInstance]: (value: any) => boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
declare class Provider extends Component<
|
|
2
|
+
declare class Provider extends Component<object, {
|
|
3
3
|
animatedTransitions: boolean;
|
|
4
4
|
open: boolean;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleButtonClick: () => void;
|
|
8
8
|
handleSwitchClick: () => void;
|
|
9
9
|
render(): React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
declare class ToggleComponent extends Component<
|
|
2
|
+
declare class ToggleComponent extends Component<object, {
|
|
3
3
|
animatedTransitions: boolean;
|
|
4
4
|
}> {
|
|
5
|
-
constructor(props:
|
|
5
|
+
constructor(props: object);
|
|
6
6
|
handleSwitchClick: () => void;
|
|
7
7
|
render(): React.JSX.Element;
|
|
8
8
|
}
|
|
@@ -12,7 +12,7 @@ interface ButtonPropsBase {
|
|
|
12
12
|
action?: string;
|
|
13
13
|
/** Changes the style of the button.
|
|
14
14
|
*/
|
|
15
|
-
appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary' | 'subtle';
|
|
15
|
+
appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary' | 'standalone' | 'subtle';
|
|
16
16
|
/** Removes the right border and border-radius of the button so you can
|
|
17
17
|
* append other elements to it. */
|
|
18
18
|
append?: boolean;
|
|
@@ -84,4 +84,4 @@ type ButtonProps = ButtonButtonProps | ButtonLinkProps;
|
|
|
84
84
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
85
85
|
export default Button;
|
|
86
86
|
export { ButtonClickHandler };
|
|
87
|
-
export type { ButtonPropsBase };
|
|
87
|
+
export type { ButtonProps, ButtonPropsBase };
|
|
@@ -2,14 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { ButtonVariant } from './ButtonSimpleStyles';
|
|
3
3
|
import buttonMixin from './mixin';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
|
-
declare const appearances: readonly ["default", "secondary", "primary", "destructive", "destructiveSecondary", "subtle"];
|
|
6
|
-
type Appearance = typeof appearances[number];
|
|
7
5
|
interface ButtonSimplePropsBase {
|
|
8
6
|
/** Returns a value on click. Use when composing or testing. */
|
|
9
7
|
action?: string;
|
|
10
8
|
/** Changes the style of the button.
|
|
11
9
|
*/
|
|
12
|
-
appearance?:
|
|
10
|
+
appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary' | 'subtle' | 'standalone';
|
|
13
11
|
/** Removes the right border and border-radius of the button so you can
|
|
14
12
|
* append things to it. */
|
|
15
13
|
append?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyTheme, Interpolation, InterpolationResult, ThemedProps } from '@splunk/themes';
|
|
2
|
-
declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle"];
|
|
2
|
+
declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle", "standalone"];
|
|
3
3
|
type ButtonVariant = typeof buttonVariants[number];
|
|
4
4
|
type ButtonStyleProps = ThemedProps & Partial<{
|
|
5
5
|
$append: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { DateGridChangeHandler } from './DateGrid';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
|
-
type CalendarChangeHandler =
|
|
5
|
+
type CalendarChangeHandler = DateGridChangeHandler;
|
|
6
6
|
declare const calendarActiveSelector = "[data-active-day=\"true\"]";
|
|
7
7
|
interface CalendarPropsBase {
|
|
8
8
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
type
|
|
4
|
+
type DateGridChangeHandler = (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, data: {
|
|
5
5
|
value: string;
|
|
6
6
|
}) => void;
|
|
7
|
-
interface
|
|
7
|
+
interface DateGridPropsBase {
|
|
8
8
|
displayValue: string;
|
|
9
9
|
highlightToday?: boolean;
|
|
10
10
|
labelledBy?: string;
|
|
11
11
|
locale?: string;
|
|
12
|
-
onChange?:
|
|
13
|
-
onInternalChange?:
|
|
12
|
+
onChange?: DateGridChangeHandler;
|
|
13
|
+
onInternalChange?: DateGridChangeHandler;
|
|
14
14
|
selectedValue: string;
|
|
15
15
|
todayValue?: string;
|
|
16
16
|
}
|
|
17
|
-
type
|
|
18
|
-
declare function
|
|
19
|
-
declare namespace
|
|
17
|
+
type DateGridProps = ComponentProps<DateGridPropsBase, 'div'>;
|
|
18
|
+
declare function DateGrid({ displayValue, highlightToday, labelledBy, locale, onChange, onInternalChange, selectedValue, todayValue, ...otherProps }: DateGridProps): React.JSX.Element;
|
|
19
|
+
declare namespace DateGrid {
|
|
20
20
|
var propTypes: {
|
|
21
21
|
displayValue: PropTypes.Validator<string>;
|
|
22
22
|
highlightToday: PropTypes.Requireable<boolean>;
|
|
@@ -28,5 +28,5 @@ declare namespace DateTable {
|
|
|
28
28
|
todayValue: PropTypes.Requireable<string>;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
export default
|
|
32
|
-
export {
|
|
31
|
+
export default DateGrid;
|
|
32
|
+
export { DateGridChangeHandler };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
type DayClickHandler = (event: React.MouseEvent<
|
|
4
|
+
type DayClickHandler = (event: React.MouseEvent<HTMLDivElement>, data: {
|
|
5
5
|
value: string;
|
|
6
6
|
}) => void;
|
|
7
|
-
type DayKeyDownHandler = (event: React.KeyboardEvent<
|
|
7
|
+
type DayKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>, data: {
|
|
8
8
|
value: string;
|
|
9
9
|
}) => void;
|
|
10
10
|
interface DayPropsBase {
|
|
11
11
|
/** Whether or not this day has the active cursor. */
|
|
12
12
|
active?: boolean;
|
|
13
|
+
/** @private */
|
|
14
|
+
dayOfWeek?: number;
|
|
13
15
|
/** Locale set by language and localization specifiers. */
|
|
14
16
|
locale?: string;
|
|
15
17
|
/** Callback for click */
|
|
@@ -23,11 +25,13 @@ interface DayPropsBase {
|
|
|
23
25
|
/** Day number to be displayed */
|
|
24
26
|
value: string;
|
|
25
27
|
}
|
|
26
|
-
type DayProps = ComponentProps<DayPropsBase, '
|
|
27
|
-
declare function Day({ active, locale, onClick, onKeyDown, selected, today, value, ...otherProps }: DayProps): React.JSX.Element;
|
|
28
|
+
type DayProps = ComponentProps<DayPropsBase, 'div'>;
|
|
29
|
+
declare function Day({ active, dayOfWeek, locale, onClick, onKeyDown, selected, today, value, ...otherProps }: DayProps): React.JSX.Element;
|
|
28
30
|
declare namespace Day {
|
|
29
31
|
var propTypes: {
|
|
30
32
|
active: PropTypes.Requireable<boolean>;
|
|
33
|
+
/** @private. */
|
|
34
|
+
dayOfWeek: PropTypes.Requireable<number>;
|
|
31
35
|
locale: PropTypes.Requireable<string>;
|
|
32
36
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
37
|
onKeydown: PropTypes.Requireable<(...args: any[]) => any>;
|
package/types/src/Card/Card.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import Body from './Body';
|
|
3
4
|
import Footer from './Footer';
|
|
4
5
|
import Header from './Header';
|
|
5
|
-
import {
|
|
6
|
+
import { ComponentProps } from '../utils/types';
|
|
6
7
|
/** @public */
|
|
7
8
|
type CardClickHandler = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>, data: {
|
|
8
9
|
selected: boolean;
|
|
@@ -48,7 +49,6 @@ interface CardPropsBase {
|
|
|
48
49
|
/** Overrides the HTML tag for the Card component. Defaults to `article`. */
|
|
49
50
|
tag?: 'article' | 'div' | 'aside' | 'section';
|
|
50
51
|
}
|
|
51
|
-
declare const defaultProps: Required<Pick<CardPropsBase, 'openInNewContext'>>;
|
|
52
52
|
interface CardPropsBaseNonClickable extends CardPropsBase {
|
|
53
53
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
54
54
|
onClick?: never;
|
|
@@ -67,18 +67,31 @@ interface CardPropsBaseClickable extends CardPropsBase {
|
|
|
67
67
|
selected?: never;
|
|
68
68
|
to?: string;
|
|
69
69
|
}
|
|
70
|
-
type CardNonClickableProps =
|
|
71
|
-
type CardClickableButtonProps =
|
|
72
|
-
type CardClickableLinkProps =
|
|
70
|
+
type CardNonClickableProps = ComponentProps<CardPropsBaseNonClickable, 'div' | 'article'>;
|
|
71
|
+
type CardClickableButtonProps = ComponentProps<CardPropsBaseOnClickClickable | CardPropsBaseClickable, 'button'>;
|
|
72
|
+
type CardClickableLinkProps = ComponentProps<CardPropsBaseOnClickClickable | CardPropsBaseClickable, 'a', 'href'>;
|
|
73
73
|
type CardProps = CardNonClickableProps | CardClickableButtonProps | CardClickableLinkProps;
|
|
74
|
-
declare
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
declare function Card(props: CardProps): React.JSX.Element;
|
|
75
|
+
declare namespace Card {
|
|
76
|
+
var propTypes: {
|
|
77
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
78
|
+
elementRef: PropTypes.Requireable<object>;
|
|
79
|
+
/** @private */
|
|
80
|
+
margin: PropTypes.Requireable<number>;
|
|
81
|
+
/** @private */
|
|
82
|
+
maxWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
83
|
+
/** @private */
|
|
84
|
+
minWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
85
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
86
|
+
openInNewContext: PropTypes.Requireable<boolean>;
|
|
87
|
+
selected: PropTypes.Requireable<boolean>;
|
|
88
|
+
to: PropTypes.Requireable<string>;
|
|
89
|
+
value: PropTypes.Requireable<any>;
|
|
90
|
+
tag: PropTypes.Requireable<string>;
|
|
91
|
+
};
|
|
92
|
+
var Header: typeof import("./Header").default;
|
|
93
|
+
var Body: typeof import("./Body").default;
|
|
94
|
+
var Footer: typeof import("./Footer").default;
|
|
82
95
|
}
|
|
83
96
|
export default Card;
|
|
84
97
|
export { CardClickHandler, Header, Body, Footer };
|
|
@@ -11,8 +11,8 @@ interface InteractiveState {
|
|
|
11
11
|
setAsWidth: boolean;
|
|
12
12
|
hasMaxWidth: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare class Interactive extends Component<
|
|
15
|
-
constructor(props:
|
|
14
|
+
declare class Interactive extends Component<object, InteractiveState> {
|
|
15
|
+
constructor(props: object);
|
|
16
16
|
handleChangeAmount: NumberChangeHandler;
|
|
17
17
|
handleChangeMinWidth: NumberChangeHandler;
|
|
18
18
|
handleChangeMaxWidth: NumberChangeHandler;
|
|
@@ -51,4 +51,4 @@ type ClickableProps = ClickableButtonProps | ClickableLinkProps;
|
|
|
51
51
|
*/
|
|
52
52
|
declare const Clickable: React.ForwardRefExoticComponent<ClickableProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
53
53
|
export default Clickable;
|
|
54
|
-
export { ClickableProps };
|
|
54
|
+
export { ClickableButtonProps, ClickableLinkProps, ClickableProps, ClickablePropsBase };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { defaultPalette } from './Palette';
|
|
3
4
|
import { ComponentProps } from '../utils/types';
|
|
4
5
|
/** @public */
|
|
5
6
|
type ColorChangeHandler = (data: {
|
|
@@ -54,7 +55,6 @@ interface ColorPropsBase {
|
|
|
54
55
|
*/
|
|
55
56
|
value?: string | null;
|
|
56
57
|
}
|
|
57
|
-
export declare const defaultPalette: string[];
|
|
58
58
|
interface ColorPropsBaseControlled extends ColorPropsBase {
|
|
59
59
|
defaultValue?: never;
|
|
60
60
|
onChange: ColorChangeHandler;
|
|
@@ -87,5 +87,5 @@ declare namespace Color {
|
|
|
87
87
|
var componentType: string;
|
|
88
88
|
}
|
|
89
89
|
export default Color;
|
|
90
|
-
export {
|
|
91
|
-
export type { ColorPropsBase, ColorPropsBaseControlled, ColorPropsBaseUncontrolled };
|
|
90
|
+
export { defaultPalette };
|
|
91
|
+
export type { ColorChangeHandler, ColorPropsBase, ColorPropsBaseControlled, ColorPropsBaseUncontrolled, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextProps } from '@splunk/react-ui/Text';
|
|
3
|
+
import { naLowercase, transparent } from './Swatch';
|
|
4
|
+
type ColorInputChangeHandler = (event: React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>, data: {
|
|
5
|
+
value?: string | null;
|
|
6
|
+
}) => void;
|
|
7
|
+
type ColorInputProps = {
|
|
8
|
+
/** Allow "transparent" as a valid value */
|
|
9
|
+
allowTransparent?: boolean;
|
|
10
|
+
/** Append removes rounded borders and the border from the right side. */
|
|
11
|
+
append?: boolean;
|
|
12
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
13
|
+
onChange?: ColorInputChangeHandler;
|
|
14
|
+
/** Prepend removes rounded borders from the left side. */
|
|
15
|
+
prepend?: boolean;
|
|
16
|
+
/** Show a button for the system color picker */
|
|
17
|
+
showPicker?: boolean;
|
|
18
|
+
/** Show a button for submitting the value */
|
|
19
|
+
showSubmitButton?: boolean;
|
|
20
|
+
value?: string | null;
|
|
21
|
+
/** Whether or not the value is a custom value */
|
|
22
|
+
valueIsCustom?: boolean;
|
|
23
|
+
} & Omit<TextProps, 'onChange' | 'value'>;
|
|
24
|
+
declare const ColorInput: ({ allowTransparent, append, disabled, inputRef, labelledBy, onChange, showPicker, showSubmitButton, value, valueIsCustom, ...otherProps }: ColorInputProps) => React.JSX.Element;
|
|
25
|
+
export default ColorInput;
|
|
26
|
+
export { naLowercase, transparent };
|
|
27
|
+
export type { ColorInputChangeHandler };
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ColorInputChangeHandler } from './ColorInput';
|
|
2
3
|
import { ComponentProps } from '../utils/types';
|
|
3
4
|
interface PalettePropsBase {
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
palette: (string | null)[];
|
|
8
|
-
/**
|
|
9
|
-
* Current value of the Color input
|
|
10
|
-
*/
|
|
11
|
-
value?: string | null;
|
|
12
|
-
/**
|
|
13
|
-
* This ref is passed to the swatch that should be focused for Color to control focus
|
|
6
|
+
* This ref is passed to the swatch that should be focused for Color to control focus.
|
|
7
|
+
* If the color is not in the palette, this is the ref to the text input instead.
|
|
14
8
|
*/
|
|
15
|
-
|
|
9
|
+
activeInputRef: React.RefObject<HTMLButtonElement & HTMLInputElement> | null;
|
|
16
10
|
/**
|
|
17
11
|
* Callback for handling when a swatch is selected
|
|
18
12
|
*/
|
|
19
|
-
|
|
20
|
-
value?: string | null;
|
|
21
|
-
}) => void;
|
|
13
|
+
onChange: ColorInputChangeHandler;
|
|
22
14
|
/**
|
|
23
|
-
*
|
|
15
|
+
* Complete list of palettes values to be rendered as swatches
|
|
24
16
|
*/
|
|
25
|
-
|
|
17
|
+
palette?: (string | null)[];
|
|
26
18
|
/**
|
|
27
|
-
*
|
|
19
|
+
* Current value of the Color input
|
|
28
20
|
*/
|
|
29
|
-
|
|
21
|
+
value?: string | null;
|
|
30
22
|
}
|
|
31
23
|
type PaletteProps = ComponentProps<PalettePropsBase, 'div'> & {
|
|
32
24
|
disabled?: boolean;
|
|
33
25
|
};
|
|
34
|
-
declare
|
|
26
|
+
export declare const defaultPalette: string[];
|
|
27
|
+
declare function Palette({ activeInputRef, disabled, onChange, palette: paletteProp, value: valueProp, ...otherProps }: PaletteProps): React.JSX.Element;
|
|
35
28
|
export default Palette;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { naLowercase, transparent } from './SwatchStyles';
|
|
2
3
|
type SwatchClickHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
3
4
|
value?: string | null;
|
|
4
5
|
}) => void;
|
|
@@ -25,4 +26,5 @@ interface SwatchPropsBase {
|
|
|
25
26
|
}
|
|
26
27
|
declare const Swatch: React.ForwardRefExoticComponent<SwatchPropsBase & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref" | "css" | keyof SwatchPropsBase> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
27
28
|
export default Swatch;
|
|
28
|
-
export {
|
|
29
|
+
export { naLowercase, transparent };
|
|
30
|
+
export type { SwatchPropsBase, SwatchClickHandler };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { Divider, Heading } from '@splunk/react-ui/Menu';
|
|
3
4
|
import Option from './Option';
|
|
4
|
-
import {
|
|
5
|
+
import { ComponentProps } from '../utils/types';
|
|
5
6
|
/** @public */
|
|
6
7
|
type ComboBoxChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement | HTMLSpanElement> | React.KeyboardEvent<HTMLInputElement>, data: {
|
|
7
8
|
name?: string;
|
|
@@ -120,7 +121,6 @@ interface ComboBoxPropsBase {
|
|
|
120
121
|
*/
|
|
121
122
|
virtualization?: number;
|
|
122
123
|
}
|
|
123
|
-
declare const defaultProps: Required<Pick<ComboBoxPropsBase, 'animateLoading' | 'controlledFilter' | 'defaultPlacement' | 'disabled' | 'error' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'placeholder'>>;
|
|
124
124
|
interface ComboBoxPropsBaseControlled extends ComboBoxPropsBase {
|
|
125
125
|
defaultValue?: never;
|
|
126
126
|
onChange: ComboBoxChangeHandler;
|
|
@@ -130,56 +130,52 @@ interface ComboBoxPropsBaseUncontrolled extends ComboBoxPropsBase {
|
|
|
130
130
|
defaultValue?: string;
|
|
131
131
|
value?: never;
|
|
132
132
|
}
|
|
133
|
-
type ComboBoxProps =
|
|
134
|
-
interface ComboBoxState {
|
|
135
|
-
activeIndex: number;
|
|
136
|
-
anchor: HTMLDivElement | null;
|
|
137
|
-
open: boolean;
|
|
138
|
-
typedValue: string | undefined;
|
|
139
|
-
value: string;
|
|
140
|
-
}
|
|
133
|
+
type ComboBoxProps = ComponentProps<ComboBoxPropsBaseControlled | ComboBoxPropsBaseUncontrolled, 'div'>;
|
|
141
134
|
/**
|
|
142
135
|
* `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
|
|
143
136
|
* and `Multiselect`, `Option` value must always be a string.
|
|
144
137
|
*/
|
|
145
|
-
declare
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
138
|
+
declare function ComboBox({ animateLoading, append, children, controlledFilter, defaultPlacement, defaultValue, describedBy, disabled, elementRef, error, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onBlur, onChange, onClose, onFocus, onKeyDown, onOpen, onScroll, onScrollBottom, onSelect, placeholder, prepend, value: valueProp, virtualization, ...otherProps }: ComboBoxProps): React.JSX.Element;
|
|
139
|
+
declare namespace ComboBox {
|
|
140
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
141
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
142
|
+
var Option: typeof import("./Option").default;
|
|
143
|
+
var propTypes: {
|
|
144
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
145
|
+
append: PropTypes.Requireable<boolean>;
|
|
146
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
147
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
148
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
149
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
150
|
+
describedBy: PropTypes.Requireable<string>;
|
|
151
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
152
|
+
elementRef: PropTypes.Requireable<object>;
|
|
153
|
+
error: PropTypes.Requireable<boolean>;
|
|
154
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
155
|
+
inline: PropTypes.Requireable<boolean>;
|
|
156
|
+
inputId: PropTypes.Requireable<string>;
|
|
157
|
+
inputRef: PropTypes.Requireable<object>;
|
|
158
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
159
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
160
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
161
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
162
|
+
name: PropTypes.Requireable<string>;
|
|
163
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
164
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
165
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
166
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
167
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
168
|
+
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
169
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
170
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
171
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
172
|
+
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
173
|
+
placeholder: PropTypes.Requireable<string>;
|
|
174
|
+
prepend: PropTypes.Requireable<boolean>;
|
|
175
|
+
value: PropTypes.Requireable<string>;
|
|
176
|
+
/** @private. */
|
|
177
|
+
virtualization: PropTypes.Requireable<number>;
|
|
178
|
+
};
|
|
183
179
|
}
|
|
184
180
|
export default ComboBox;
|
|
185
|
-
export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, Option, Divider, Heading, };
|
|
181
|
+
export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, ComboBoxProps, ComboBoxScrollBottomHandler, Option, Divider, Heading, };
|