@splunk/react-ui 5.0.0-beta.3 → 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 +1 -1
- package/ButtonSimple.js +47 -41
- package/CHANGELOG.md +12 -2
- package/CHANGELOG.v5.mdx +38 -0
- package/Calendar.js +352 -469
- package/Chip.js +149 -280
- package/Code.js +19 -12
- package/Color.js +32 -32
- package/ComboBox.js +8 -6
- package/Date.js +1 -1
- package/DualListbox.js +298 -296
- package/File.js +294 -281
- package/FormRows.js +165 -153
- package/Image.js +124 -251
- package/Layout.d.ts +2 -0
- package/MIGRATION.v5.mdx +1 -1
- package/Menu.js +1 -1
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +2 -2
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1978 -2323
- package/NonInteractiveCheckbox.js +29 -117
- package/Number.js +114 -114
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Scroll.js +2 -2
- package/Select.js +236 -240
- package/SidePanel.js +17 -21
- package/Slider.js +366 -370
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +39 -25
- package/StepBar.js +1 -1
- package/Switch.js +70 -64
- package/TabBar.js +544 -417
- package/Table.js +1580 -1434
- package/Text.js +34 -34
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +2 -2
- 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 +1 -1
- 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/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/ComboBox/ComboBox.d.ts +3 -3
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -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/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +4 -4
- 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 +2 -1
- 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 +4 -4
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/SortableRow.d.ts +1 -1
- 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 +46 -21
- package/types/src/Multiselect/Multiselect.d.ts +70 -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 +8 -7
- 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/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 +15 -2
- 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/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 +3 -2
- 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/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- 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/Image/icons/Cross.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
package/TransitionOpen.js
CHANGED
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
const s = require("@splunk/ui-utils/focus");
|
|
79
79
|
// CONCATENATED MODULE: external "@splunk/ui-utils/style"
|
|
80
80
|
const c = require("@splunk/ui-utils/style");
|
|
81
|
-
// CONCATENATED MODULE: external "react-spring"
|
|
82
|
-
const f = require("react-spring");
|
|
81
|
+
// CONCATENATED MODULE: external "@react-spring/web"
|
|
82
|
+
const f = require("@react-spring/web");
|
|
83
83
|
// CONCATENATED MODULE: external "styled-components"
|
|
84
84
|
const d = require("styled-components");
|
|
85
85
|
var m = e.n(d);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.4",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -44,16 +44,15 @@
|
|
|
44
44
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
45
45
|
"@dnd-kit/sortable": "^8.0.0",
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
|
-
"@
|
|
48
|
-
"@splunk/
|
|
47
|
+
"@react-spring/web": "^9.7.5",
|
|
48
|
+
"@splunk/react-icons": "5.0.0-beta.4",
|
|
49
|
+
"@splunk/themes": "1.0.0-beta.4",
|
|
49
50
|
"@splunk/ui-utils": "^1.8.0",
|
|
50
51
|
"decimal.js-light": "^2.2.3",
|
|
51
52
|
"lodash": "^4.17.14",
|
|
52
53
|
"moment": "^2.29.4",
|
|
53
54
|
"prop-types": "^15.6.2",
|
|
54
55
|
"react-markdown": "^8.0.7",
|
|
55
|
-
"react-resize-detector": "^3.2.1",
|
|
56
|
-
"react-spring": "9.2.4",
|
|
57
56
|
"remark-gfm": "^1.0.0",
|
|
58
57
|
"tinycolor2": "^1.4.1",
|
|
59
58
|
"use-typed-event-listener": "^3.0.0"
|
|
@@ -86,14 +85,13 @@
|
|
|
86
85
|
"@types/prismjs": "^1.26.3",
|
|
87
86
|
"@types/react": "^18.2.0",
|
|
88
87
|
"@types/react-dom": "^18.2.0",
|
|
89
|
-
"@types/react-resize-detector": "^3.1.1",
|
|
90
88
|
"@types/sinon": "^4.3.3",
|
|
91
89
|
"@types/styled-components": "^5.1.0",
|
|
92
90
|
"@types/tinycolor2": "^1.4.2",
|
|
93
91
|
"@types/webdriverio": "^5.0.0",
|
|
94
92
|
"@types/webpack-env": "^1.15.2",
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
96
|
-
"@typescript-eslint/parser": "^
|
|
93
|
+
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
94
|
+
"@typescript-eslint/parser": "^8.29.1",
|
|
97
95
|
"axe-html-reporter": "^2.2.3",
|
|
98
96
|
"axe-playwright": "^1.1.11",
|
|
99
97
|
"babel-loader": "^8.3.0",
|
|
@@ -139,7 +137,7 @@
|
|
|
139
137
|
"storybook": "^7.6.17",
|
|
140
138
|
"styled-components": "^5.3.10",
|
|
141
139
|
"stylelint": "^15.11.0",
|
|
142
|
-
"typescript": "^
|
|
140
|
+
"typescript": "^5.8.3",
|
|
143
141
|
"webpack": "^5.88.2",
|
|
144
142
|
"webpack-cli": "^5.1.4",
|
|
145
143
|
"webpack-dev-server": "^4.15.1",
|
|
@@ -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;
|
|
@@ -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>;
|
|
@@ -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 };
|
|
@@ -137,8 +137,8 @@ type ComboBoxProps = ComponentProps<ComboBoxPropsBaseControlled | ComboBoxPropsB
|
|
|
137
137
|
*/
|
|
138
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
139
|
declare namespace ComboBox {
|
|
140
|
-
var Divider: typeof import("
|
|
141
|
-
var Heading: typeof import("
|
|
140
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
141
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
142
142
|
var Option: typeof import("./Option").default;
|
|
143
143
|
var propTypes: {
|
|
144
144
|
animateLoading: PropTypes.Requireable<boolean>;
|
|
@@ -178,4 +178,4 @@ declare namespace ComboBox {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
export default ComboBox;
|
|
181
|
-
export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, ComboBoxProps, Option, Divider, Heading, };
|
|
181
|
+
export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, ComboBoxProps, ComboBoxScrollBottomHandler, Option, Divider, Heading, };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SwitchClickHandler } from '@splunk/react-ui/Switch';
|
|
3
|
-
declare class CustomizedLabelTarget extends Component<
|
|
3
|
+
declare class CustomizedLabelTarget extends Component<object, {
|
|
4
4
|
values: number[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleClick: SwitchClickHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { DateChangeHandler } from '@splunk/react-ui/Date';
|
|
3
|
-
declare class Controlled extends Component<
|
|
3
|
+
declare class Controlled extends Component<object, {
|
|
4
4
|
value: string;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: DateChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { DateChangeHandler } from '@splunk/react-ui/Date';
|
|
3
|
-
declare class HighlightToday extends Component<
|
|
3
|
+
declare class HighlightToday extends Component<object, {
|
|
4
4
|
value: string;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: DateChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -53,6 +53,10 @@ interface DualListboxPropsBase {
|
|
|
53
53
|
* When true, `Options`'s `listName` and `selected` state props are fully controlled.
|
|
54
54
|
*/
|
|
55
55
|
controlled?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
58
|
+
*/
|
|
59
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
56
60
|
/**
|
|
57
61
|
* When true, fill height and width of the relative parent container.
|
|
58
62
|
*/
|
|
@@ -78,7 +82,7 @@ interface DualListboxPropsBase {
|
|
|
78
82
|
onSelect?: DualListboxSelectHandler;
|
|
79
83
|
}
|
|
80
84
|
type DualListboxProps = ComponentProps<DualListboxPropsBase, 'div'>;
|
|
81
|
-
declare function DualListbox({ children, controlled, fill, inline, onChange, onSelect, lists, ...otherProps }: DualListboxProps): React.JSX.Element;
|
|
85
|
+
declare function DualListbox({ children, controlled, elementRef, fill, inline, onChange, onSelect, lists, ...otherProps }: DualListboxProps): React.JSX.Element;
|
|
82
86
|
declare namespace DualListbox {
|
|
83
87
|
var propTypes: React.WeakValidationMap<DualListboxPropsBase>;
|
|
84
88
|
var Option: typeof import("./Option").default;
|
package/types/src/File/File.d.ts
CHANGED
|
@@ -9,22 +9,22 @@ type FileRequestAddHandler = (files: globalThis.File[], data: {
|
|
|
9
9
|
/** @public */
|
|
10
10
|
type FileRequestRemoveHandler = (data: {
|
|
11
11
|
event: {
|
|
12
|
-
itemId?:
|
|
12
|
+
itemId?: string;
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
15
|
filename: string;
|
|
16
16
|
index: number;
|
|
17
|
-
itemId?:
|
|
17
|
+
itemId?: string;
|
|
18
18
|
name?: string;
|
|
19
19
|
}) => void;
|
|
20
20
|
type FileRequestRetryHandler = (data: {
|
|
21
21
|
event: {
|
|
22
|
-
itemId?:
|
|
22
|
+
itemId?: string;
|
|
23
23
|
name: string;
|
|
24
24
|
};
|
|
25
25
|
filename: string;
|
|
26
26
|
index: number;
|
|
27
|
-
itemId?:
|
|
27
|
+
itemId?: string;
|
|
28
28
|
name?: string;
|
|
29
29
|
}) => void;
|
|
30
30
|
interface FilePropsBase {
|
package/types/src/File/Item.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
|
type ItemClickHandler = (data: {
|
|
5
|
-
itemId?:
|
|
5
|
+
itemId?: string;
|
|
6
6
|
name: string;
|
|
7
7
|
index: number;
|
|
8
8
|
}) => void;
|
|
@@ -14,8 +14,14 @@ interface ItemPropsBase {
|
|
|
14
14
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
15
15
|
/** Show the Item in an error state. */
|
|
16
16
|
error?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The icon or thumbnail image to show before the label.
|
|
19
|
+
* If not passed this will be generated from the filename extension.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
icon?: React.ReactNode;
|
|
17
23
|
/** A unique for this file. */
|
|
18
|
-
itemId?:
|
|
24
|
+
itemId?: string;
|
|
19
25
|
/** The name is displayed on the item. */
|
|
20
26
|
name: string;
|
|
21
27
|
/** @private */
|
|
@@ -25,13 +31,15 @@ interface ItemPropsBase {
|
|
|
25
31
|
uploadPercentage?: number;
|
|
26
32
|
}
|
|
27
33
|
type ItemProps = ComponentProps<ItemPropsBase, 'div'>;
|
|
28
|
-
declare function Item({ disabled, elementRef, error, itemId, name, index, uploadPercentage, ...otherProps }: ItemProps): React.JSX.Element;
|
|
34
|
+
declare function Item({ disabled, elementRef, error, icon, itemId, name, index, uploadPercentage, ...otherProps }: ItemProps): React.JSX.Element;
|
|
29
35
|
declare namespace Item {
|
|
30
36
|
var propTypes: {
|
|
31
37
|
disabled: PropTypes.Requireable<boolean>;
|
|
32
38
|
elementRef: PropTypes.Requireable<object>;
|
|
33
39
|
error: PropTypes.Requireable<boolean>;
|
|
34
40
|
/** @private */
|
|
41
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
42
|
+
/** @private */
|
|
35
43
|
index: PropTypes.Requireable<number>;
|
|
36
44
|
itemId: PropTypes.Requireable<any>;
|
|
37
45
|
name: PropTypes.Validator<string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ItemIconProps {
|
|
3
3
|
name: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
4
5
|
}
|
|
5
|
-
declare const ItemIcon: ({ name }: ItemIconProps) => React.JSX.Element;
|
|
6
|
+
declare const ItemIcon: ({ name, icon }: ItemIconProps) => React.JSX.Element;
|
|
6
7
|
export default ItemIcon;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class Disabled extends Component<
|
|
3
|
+
declare class Disabled extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
}> {
|
|
6
6
|
private fileReader;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleAddFiles: FileRequestAddHandler;
|
|
9
9
|
handleRemoveFile: () => void;
|
|
10
10
|
render(): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class DropAnywhere extends Component<
|
|
3
|
+
declare class DropAnywhere extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
open: boolean;
|
|
6
6
|
}> {
|
|
7
7
|
private fileReader;
|
|
8
|
-
constructor(props:
|
|
8
|
+
constructor(props: object);
|
|
9
9
|
handleAddFiles: FileRequestAddHandler;
|
|
10
10
|
handleRemoveFile: () => void;
|
|
11
11
|
handleOpen: () => void;
|
|
@@ -4,11 +4,11 @@ interface FileItem {
|
|
|
4
4
|
name: string;
|
|
5
5
|
value?: string | ArrayBuffer | null;
|
|
6
6
|
}
|
|
7
|
-
declare class Multi extends Component<
|
|
7
|
+
declare class Multi extends Component<object, {
|
|
8
8
|
files: FileItem[];
|
|
9
9
|
}> {
|
|
10
10
|
static loadFile(file: globalThis.File): FileItem;
|
|
11
|
-
constructor(props:
|
|
11
|
+
constructor(props: object);
|
|
12
12
|
handleAddFiles: FileRequestAddHandler;
|
|
13
13
|
handleRemoveFile: FileRequestRemoveHandler;
|
|
14
14
|
render(): React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class Single extends Component<
|
|
3
|
+
declare class Single extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
}> {
|
|
6
6
|
private fileReader;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleAddFiles: FileRequestAddHandler;
|
|
9
9
|
handleRemoveFile: () => void;
|
|
10
10
|
render(): React.JSX.Element;
|
|
@@ -29,7 +29,7 @@ interface FormRowsPropsBase {
|
|
|
29
29
|
onRequestMove?: FormRowsRequestMoveHandler;
|
|
30
30
|
}
|
|
31
31
|
type FormRowsProps = ComponentProps<FormRowsPropsBase, 'div'>;
|
|
32
|
-
declare function FormRows({ addLabel, children, disabled, header, menu, onRequestAdd, onRequestMove, ...otherProps }: FormRowsProps): React.JSX.Element;
|
|
32
|
+
declare function FormRows({ addLabel, children, disabled, elementRef, header, menu, onRequestAdd, onRequestMove, ...otherProps }: FormRowsProps): React.JSX.Element;
|
|
33
33
|
declare namespace FormRows {
|
|
34
34
|
var propTypes: {
|
|
35
35
|
addLabel: PropTypes.Requireable<string>;
|
|
@@ -42,9 +42,9 @@ declare namespace FormRows {
|
|
|
42
42
|
onRequestMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
43
|
};
|
|
44
44
|
var Row: typeof import("./Row").default;
|
|
45
|
-
var addRow: (element: React.ReactElement
|
|
46
|
-
var moveRow: (fromIndex: number, toIndex: number, items: React.ReactElement
|
|
47
|
-
var removeRow: (index: number, items: React.ReactElement
|
|
45
|
+
var addRow: (element: React.ReactElement, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
46
|
+
var moveRow: (fromIndex: number, toIndex: number, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
47
|
+
var removeRow: (index: number, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
48
48
|
}
|
|
49
49
|
export default FormRows;
|
|
50
50
|
export { Row };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RowKeyDownHandler } from './Row';
|
|
3
2
|
export interface FormRowsContext {
|
|
4
|
-
|
|
3
|
+
disabledRemoveButton: boolean | undefined;
|
|
5
4
|
onKeyDown?: RowKeyDownHandler;
|
|
6
5
|
hasOnRequestAdd?: boolean;
|
|
7
6
|
sortable: boolean;
|
|
@@ -8,7 +8,7 @@ type RowRequestRemoveHandler = (event: React.MouseEvent<HTMLButtonElement>, data
|
|
|
8
8
|
}) => void;
|
|
9
9
|
interface RowPropsBase {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
/** Index of the row. */
|
|
11
|
+
/** Index of the row. This is required if the rows are sortable. */
|
|
12
12
|
index?: number;
|
|
13
13
|
/** Callback when Remove button is clicked. */
|
|
14
14
|
onRequestRemove?: RowRequestRemoveHandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler, RowRequestRemoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
|
-
declare class Basic extends Component<
|
|
3
|
+
declare class Basic extends Component<object, {
|
|
4
4
|
items: React.ReactElement[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleRequestAdd: () => void;
|
|
8
8
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
9
9
|
handleRequestRemove: RowRequestRemoveHandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler, RowRequestRemoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
|
-
declare class Header extends Component<
|
|
3
|
+
declare class Header extends Component<object, {
|
|
4
4
|
items: React.ReactElement[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleRequestAdd: () => void;
|
|
8
8
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
9
9
|
handleRequestRemove: RowRequestRemoveHandler;
|