@splunk/react-ui 5.2.0 → 5.4.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 +64 -59
- package/Box.js +2 -1
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +47 -0
- package/Calendar.js +8 -4
- package/CardLayout.js +39 -36
- package/Checkbox.d.ts +2 -0
- package/Checkbox.js +350 -0
- package/Clickable.js +5 -6
- package/Code.js +451 -536
- package/CollapsiblePanel.js +184 -210
- package/Color.js +903 -1023
- package/ControlGroup.js +2 -1
- package/Date.js +123 -119
- package/DefinitionList.js +100 -77
- package/Dropdown.js +2 -2
- package/DualListbox.js +409 -353
- package/File.js +102 -99
- package/FormRows.js +13 -11
- package/JSONTree.js +679 -1391
- package/Link.js +7 -7
- package/MIGRATION.md +27 -0
- package/Markdown.js +171 -156
- package/Menu.js +107 -100
- package/Modal.js +3 -3
- package/Multiselect.js +2698 -2767
- package/Paginator.js +2 -1
- package/Popover.js +201 -196
- package/Resize.js +11 -8
- package/ResultsMenu.js +913 -1029
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -424
- package/Search.js +131 -127
- package/Select.js +1741 -1831
- package/Slider.js +1 -1
- package/SlidingPanels.js +129 -127
- package/StepBar.js +123 -97
- package/Switch.js +214 -242
- package/TabBar.js +10 -10
- package/Table.js +1255 -1248
- package/Text.js +180 -206
- package/TextArea.js +596 -675
- package/Tooltip.js +144 -139
- package/Tree.js +638 -682
- package/package.json +15 -16
- package/tsconfig.check-docs.json +8 -0
- package/types/src/Avatar/docs/examples/Basic.d.ts +1 -1
- 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/Checkbox/Checkbox.d.ts +90 -0
- package/types/src/Checkbox/docs/examples/Basic.d.ts +7 -0
- package/types/src/Checkbox/docs/examples/Disabled.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Error.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/Checkbox/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -1
- package/types/src/Code/LineHighlights.d.ts +1 -0
- package/types/src/Code/LineNumbers.d.ts +2 -1
- package/types/src/Code/docs/examples/CustomizeContainer.d.ts +7 -0
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +3 -3
- package/types/src/Date/Date.d.ts +7 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +7 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +1 -1
- package/types/src/DefinitionList/docs/examples/StackedLayout.d.ts +6 -0
- package/types/src/DualListbox/DualListbox.d.ts +1 -1
- package/types/src/DualListbox/Label.d.ts +7 -7
- package/types/src/DualListbox/Listbox.d.ts +2 -2
- package/types/src/DualListbox/ListboxContext.d.ts +1 -1
- package/types/src/File/File.d.ts +7 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +5 -3
- package/types/src/JSONTree/renderTreeItems.d.ts +3 -2
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +2 -1
- package/types/src/Menu/docs/examples/Dimmed.d.ts +1 -1
- package/types/src/Menu/docs/examples/Disabled.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +9 -3
- package/types/src/Multiselect/Multiselect.d.ts +7 -1
- package/types/src/Multiselect/Normal.d.ts +9 -3
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/Search/Search.d.ts +5 -1
- 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 +13 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -10
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -9
- 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/ExpandButton.d.ts +1 -1
- package/types/src/Table/Head.d.ts +1 -1
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -0
- package/types/src/Tooltip/Tooltip.d.ts +14 -1
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/useControlled.js +61 -97
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +95 -127
- package/NonInteractiveCheckbox.js +0 -101
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +0 -12
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +0 -22
- package/types/src/NonInteractiveCheckbox/index.d.ts +0 -1
- package/types/src/Switch/docs/examples/Error.d.ts +0 -6
- package/types/src/Text/IconOutlinedHide.d.ts +0 -3
- package/types/src/Text/IconOutlinedView.d.ts +0 -3
- /package/cypress/{tsconfig.cypress.json → tsconfig.check-cypress.json} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"docs:publish:external": "eval $(splunk-docs-package docs-external --suffix=public) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
|
|
12
12
|
"docs:start": "INTERNAL=true webpack serve --config docs.gen.webpack.config.js",
|
|
13
13
|
"docs:start:external": "webpack serve --config docs.gen.webpack.config.js",
|
|
14
|
-
"eslint": "eslint src .storybook --ext \".ts,.tsx,.js,.jsx\"",
|
|
14
|
+
"eslint": "eslint --rulesdir ../../infra/eslint/rules src .storybook --ext \".ts,.tsx,.js,.jsx\"",
|
|
15
15
|
"eslint:fix": "yarn run eslint --fix",
|
|
16
16
|
"eslint:ci": "yarn run eslint -f junit -o test-reports/lint-results.xml",
|
|
17
17
|
"lint": "yarn run eslint && yarn run stylelint",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test:watch": "jest --watch",
|
|
30
30
|
"test:cypress": "yarn cypress open --component",
|
|
31
31
|
"test:cypress:ci": "yarn cypress run --component",
|
|
32
|
-
"types:build": "yarn types:
|
|
33
|
-
"types:
|
|
32
|
+
"types:build": "yarn types:noemit && yarn tsc --emitDeclarationOnly --declaration --declarationDir ./types && node ./scripts/pruneTypes.js",
|
|
33
|
+
"types:noemit": "tsc --p cypress/tsconfig.check-cypress.json && tsc --p tsconfig.check-docs.json",
|
|
34
34
|
"types:start": "yarn types:build --watch"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@dnd-kit/sortable": "^8.0.0",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-spring/web": "^9.7.5",
|
|
47
|
-
"@splunk/react-icons": "^5.
|
|
48
|
-
"@splunk/themes": "^1.
|
|
49
|
-
"@splunk/ui-utils": "^1.
|
|
50
|
-
"decimal.js-light": "^2.
|
|
47
|
+
"@splunk/react-icons": "^5.4.0",
|
|
48
|
+
"@splunk/themes": "^1.3.0",
|
|
49
|
+
"@splunk/ui-utils": "^1.11.0",
|
|
50
|
+
"decimal.js-light": "^2.5.1",
|
|
51
51
|
"lodash": "^4.17.14",
|
|
52
52
|
"moment": "^2.29.4",
|
|
53
53
|
"prop-types": "^15.6.2",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@babel/core": "^7.28.0",
|
|
61
61
|
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
62
62
|
"@splunk/babel-preset": "^4.0.0",
|
|
63
|
-
"@splunk/docs-gen": "^1.
|
|
63
|
+
"@splunk/docs-gen": "^1.2.0",
|
|
64
64
|
"@splunk/eslint-config": "^5.0.0",
|
|
65
|
-
"@splunk/react-docs": "^1.
|
|
65
|
+
"@splunk/react-docs": "^1.4.0",
|
|
66
66
|
"@splunk/stylelint-config": "^5.0.0",
|
|
67
67
|
"@splunk/test-runner-utils": "^0.4.1",
|
|
68
68
|
"@splunk/webpack-configs": "^7.0.2",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"@storybook/react-webpack5": "^7.6.20",
|
|
75
75
|
"@storybook/test-runner": "0.16.0",
|
|
76
76
|
"@testing-library/cypress": "^9.0.0",
|
|
77
|
-
"@testing-library/dom": "^10.4.
|
|
77
|
+
"@testing-library/dom": "^10.4.1",
|
|
78
78
|
"@testing-library/jest-dom": "^6.6.3",
|
|
79
79
|
"@testing-library/react": "^16.3.0",
|
|
80
80
|
"@testing-library/react-hooks": "^8.0.1",
|
|
81
81
|
"@testing-library/user-event": "^14.6.1",
|
|
82
|
-
"@types/jest": "^
|
|
82
|
+
"@types/jest": "^30.0.0",
|
|
83
83
|
"@types/lodash": "^4.14.156",
|
|
84
84
|
"@types/node": "^18.16.0",
|
|
85
85
|
"@types/prismjs": "^1.26.3",
|
|
@@ -87,14 +87,13 @@
|
|
|
87
87
|
"@types/react-dom": "^18.2.0",
|
|
88
88
|
"@types/styled-components": "^5.1.0",
|
|
89
89
|
"@types/tinycolor2": "^1.4.2",
|
|
90
|
-
"@types/webdriverio": "^5.0.0",
|
|
91
90
|
"@types/webpack-env": "^1.15.2",
|
|
92
91
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
93
92
|
"@typescript-eslint/parser": "^8.29.1",
|
|
94
93
|
"axe-html-reporter": "^2.2.11",
|
|
95
94
|
"axe-playwright": "^1.1.11",
|
|
96
95
|
"babel-loader": "^8.3.0",
|
|
97
|
-
"babel-plugin-istanbul": "^5.
|
|
96
|
+
"babel-plugin-istanbul": "^5.2.0",
|
|
98
97
|
"babel-plugin-styled-components": "^1.10.7",
|
|
99
98
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
100
99
|
"babel-plugin-transform-require-context": "^0.1.1",
|
|
@@ -119,8 +118,8 @@
|
|
|
119
118
|
"fs-readdir-recursive": "^1.0.0",
|
|
120
119
|
"glob": "^7.1.6",
|
|
121
120
|
"http-server": "^14.1.1",
|
|
122
|
-
"jest": "^
|
|
123
|
-
"jest-environment-jsdom": "^
|
|
121
|
+
"jest": "^30.1.3",
|
|
122
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
124
123
|
"jest-image-snapshot": "^5.1.0",
|
|
125
124
|
"jest-junit": "^10.0.0",
|
|
126
125
|
"jest-stare": "^2.4.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Basic
|
|
4
|
-
* @description An Avatar can show one to three characters. You can use the getInitials helper to shorten a name.
|
|
4
|
+
* @description An Avatar can show one to three characters. You can use the `getInitials` helper to shorten a name.
|
|
5
5
|
*/
|
|
6
6
|
export default function Basic(): React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import BreadcrumbsContext from './BreadcrumbsContext';
|
|
3
4
|
import Item from './Item';
|
|
4
5
|
import { ComponentProps } from '../utils/types';
|
|
5
6
|
/** @public */
|
|
@@ -27,11 +28,6 @@ interface BreadcrumbsPropsBase {
|
|
|
27
28
|
onClick?: BreadcrumbsClickHandler;
|
|
28
29
|
}
|
|
29
30
|
type BreadcrumbsProps = ComponentProps<BreadcrumbsPropsBase, 'nav'>;
|
|
30
|
-
type BreadcrumbsContextValue = {
|
|
31
|
-
onClick?: BreadcrumbsClickHandler;
|
|
32
|
-
prefix?: string;
|
|
33
|
-
};
|
|
34
|
-
declare const BreadcrumbsContext: React.Context<BreadcrumbsContextValue>;
|
|
35
31
|
declare function Breadcrumbs({ children, elementRef, enableCurrentPage, onClick, ...otherProps }: BreadcrumbsProps): React.JSX.Element;
|
|
36
32
|
declare namespace Breadcrumbs {
|
|
37
33
|
var propTypes: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
2
|
+
export interface BreadcrumbsContext {
|
|
3
|
+
onClick?: BreadcrumbsClickHandler;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const BreadcrumbsContext: import("react").Context<BreadcrumbsContext>;
|
|
7
|
+
export default BreadcrumbsContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { BreadcrumbsClickHandler } from '
|
|
3
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface ItemPropsBase {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyTheme, Interpolation, InterpolationResult, ThemedProps } from '@splunk/themes';
|
|
2
2
|
declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle", "standalone"];
|
|
3
|
-
type ButtonVariant = typeof buttonVariants[number];
|
|
3
|
+
type ButtonVariant = (typeof buttonVariants)[number];
|
|
4
4
|
type ButtonStyleProps = ThemedProps & Partial<{
|
|
5
5
|
$append: boolean;
|
|
6
6
|
$prepend: boolean;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
4
|
+
/** @public */
|
|
5
|
+
type CheckboxChangeHandler = (event: React.ChangeEvent<HTMLInputElement>, data: {
|
|
6
|
+
checked: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
interface CheckboxPropsBase {
|
|
11
|
+
/**
|
|
12
|
+
* Setting this value makes the component controlled. If set, the onChange callback is required.
|
|
13
|
+
* A setting of "indeterminate" is considered unchecked for the purposes of form submission.
|
|
14
|
+
*/
|
|
15
|
+
checked?: boolean | 'indeterminate';
|
|
16
|
+
/** The content to display inside the checkbox label. */
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/** Set this property instead of checked to make the component uncontrolled. */
|
|
19
|
+
defaultChecked?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The id of the description.
|
|
22
|
+
* When placed in a ControlGroup, this is automatically set to the ControlGroup's help component.
|
|
23
|
+
*/
|
|
24
|
+
describedBy?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
28
|
+
*/
|
|
29
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
30
|
+
/**
|
|
31
|
+
* Mark the component as having an error.
|
|
32
|
+
*/
|
|
33
|
+
error?: boolean;
|
|
34
|
+
inert?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* A React ref which is set to the input element when the component mounts and null when it unmounts.
|
|
37
|
+
*/
|
|
38
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
39
|
+
/**
|
|
40
|
+
* The id of the label.
|
|
41
|
+
* When placed in a ControlGroup, this is automatically set to the ControlGroup's label.
|
|
42
|
+
*/
|
|
43
|
+
labelledBy?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The name is returned with onChange events, which can be used to identify the
|
|
46
|
+
* control when multiple controls share an onChange callback.
|
|
47
|
+
*/
|
|
48
|
+
name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Fires when the checked state changes.
|
|
51
|
+
*/
|
|
52
|
+
onChange?: CheckboxChangeHandler;
|
|
53
|
+
/** @private. */
|
|
54
|
+
required?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Returned by the onChange handler and submitted during form submission if the checkbox is checked.
|
|
57
|
+
* This defaults to "on" if the input is checked.
|
|
58
|
+
*/
|
|
59
|
+
value?: string;
|
|
60
|
+
}
|
|
61
|
+
interface CheckboxPropsBaseControlled extends CheckboxPropsBase {
|
|
62
|
+
defaultChecked?: never;
|
|
63
|
+
onChange: CheckboxChangeHandler;
|
|
64
|
+
}
|
|
65
|
+
interface CheckboxPropsBaseUncontrolled extends CheckboxPropsBase {
|
|
66
|
+
defaultChecked?: boolean;
|
|
67
|
+
checked?: never;
|
|
68
|
+
}
|
|
69
|
+
type CheckboxProps = ComponentProps<CheckboxPropsBaseControlled | CheckboxPropsBaseUncontrolled, 'input'>;
|
|
70
|
+
declare const Checkbox: {
|
|
71
|
+
({ checked, children, defaultChecked, describedBy, disabled, elementRef, error, id, inert, inputRef, labelledBy, name, onChange, required, role, tabIndex, value, ...otherProps }: CheckboxProps): React.JSX.Element;
|
|
72
|
+
propTypes: {
|
|
73
|
+
checked: PropTypes.Requireable<string | boolean>;
|
|
74
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
75
|
+
defaultChecked: PropTypes.Requireable<boolean>;
|
|
76
|
+
describedBy: PropTypes.Requireable<string>;
|
|
77
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
78
|
+
elementRef: PropTypes.Requireable<object>;
|
|
79
|
+
error: PropTypes.Requireable<boolean>;
|
|
80
|
+
inert: PropTypes.Requireable<boolean>;
|
|
81
|
+
inputRef: PropTypes.Requireable<object>;
|
|
82
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
83
|
+
name: PropTypes.Requireable<string>;
|
|
84
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
85
|
+
/** @private. */
|
|
86
|
+
required: PropTypes.Requireable<boolean>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export default Checkbox;
|
|
90
|
+
export { CheckboxChangeHandler, CheckboxPropsBase, CheckboxPropsBaseControlled, CheckboxPropsBaseUncontrolled, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name Uncontrolled
|
|
4
|
+
* @description Checkbox can also used as an uncontrolled component, using defaultChecked to set the initial checked state.
|
|
5
|
+
*/
|
|
6
|
+
declare const Uncontrolled: () => React.JSX.Element;
|
|
7
|
+
export default Uncontrolled;
|
package/types/src/Code/Code.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
type CodeSupportedLanguages = 'bash' | 'clike' | 'css' | 'html' | 'json' | 'javascript' | 'js' | 'jsx' | 'typescript' | 'ts' | 'tsx' | 'markup' | 'mathml' | 'plain' | 'plaintext' | 'splunk-spl' | 'sql' | 'svg' | 'text' | 'txt' | 'xml' | 'yaml' | 'yml';
|
|
5
5
|
interface CodePropsBase {
|
|
6
|
+
/** Change the style of the Code container. */
|
|
7
|
+
containerAppearance?: 'none' | 'section';
|
|
6
8
|
/**
|
|
7
9
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
8
10
|
*/
|
|
@@ -43,9 +45,10 @@ interface CodePropsBase {
|
|
|
43
45
|
value?: string;
|
|
44
46
|
}
|
|
45
47
|
type CodeProps = ComponentProps<CodePropsBase, 'pre'>;
|
|
46
|
-
declare function Code({ elementRef, indentChars, language, languageFallback, lineHighlights, lineNumberStart, showIndentGuide, showLineNumbers, value, ...otherProps }: CodeProps): React.JSX.Element;
|
|
48
|
+
declare function Code({ containerAppearance, elementRef, indentChars, language, languageFallback, lineHighlights, lineNumberStart, showIndentGuide, showLineNumbers, value, ...otherProps }: CodeProps): React.JSX.Element;
|
|
47
49
|
declare namespace Code {
|
|
48
50
|
var propTypes: {
|
|
51
|
+
containerAppearance: PropTypes.Requireable<string>;
|
|
49
52
|
elementRef: PropTypes.Requireable<object>;
|
|
50
53
|
indentChars: PropTypes.Requireable<number>;
|
|
51
54
|
language: PropTypes.Requireable<string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface LineNumbersProps {
|
|
3
|
+
containerAppearance: 'none' | 'section';
|
|
3
4
|
value?: string;
|
|
4
5
|
}
|
|
5
|
-
declare function LineNumbers({ value }: LineNumbersProps): React.JSX.Element;
|
|
6
|
+
declare function LineNumbers({ containerAppearance, value }: LineNumbersProps): React.JSX.Element;
|
|
6
7
|
export default LineNumbers;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxChangeHandler } from '@splunk/react-ui/Checkbox';
|
|
3
3
|
/**
|
|
4
4
|
* @name Customized label target
|
|
5
5
|
* @description Change the focus/activation target that should be linked to the label.
|
|
6
6
|
*/
|
|
7
7
|
declare class CustomizedLabelTarget extends Component<object, {
|
|
8
|
-
values:
|
|
8
|
+
values: string[];
|
|
9
9
|
}> {
|
|
10
10
|
constructor(props: object);
|
|
11
|
-
handleClick:
|
|
11
|
+
handleClick: CheckboxChangeHandler;
|
|
12
12
|
render(): React.JSX.Element;
|
|
13
13
|
}
|
|
14
14
|
export default CustomizedLabelTarget;
|
package/types/src/Date/Date.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ type DateFocusHandler = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
|
17
17
|
value: string;
|
|
18
18
|
}) => void;
|
|
19
19
|
interface DatePropsBase {
|
|
20
|
+
/** Append removes rounded borders and the border from the right side. */
|
|
21
|
+
append?: boolean;
|
|
20
22
|
/**
|
|
21
23
|
* Include an "X" button to clear the value.
|
|
22
24
|
*/
|
|
@@ -71,6 +73,8 @@ interface DatePropsBase {
|
|
|
71
73
|
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
72
74
|
onFocus?: DateFocusHandler;
|
|
73
75
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
76
|
+
/** Prepend removes rounded borders from the left side. */
|
|
77
|
+
prepend?: boolean;
|
|
74
78
|
/**
|
|
75
79
|
* Setting this value makes the property controlled. An onChange callback is required.
|
|
76
80
|
*
|
|
@@ -93,9 +97,10 @@ interface DatePropsBaseUncontrolled extends DatePropsBase {
|
|
|
93
97
|
}
|
|
94
98
|
type DateProps = ComponentProps<DatePropsBaseControlled | DatePropsBaseUncontrolled, 'div'>;
|
|
95
99
|
declare const validateValue: (value: string | undefined) => void;
|
|
96
|
-
declare function Date({ canClear, defaultValue, disabled, elementRef, highlightToday, inline, inputOnly, locale, name, onChange, onClick, onFocus, onKeyDown, value: valueProp, ...otherProps }: DateProps): React.JSX.Element;
|
|
100
|
+
declare function Date({ append, canClear, defaultValue, disabled, elementRef, highlightToday, inline, inputOnly, locale, name, onChange, onClick, onFocus, onKeyDown, prepend, value: valueProp, ...otherProps }: DateProps): React.JSX.Element;
|
|
97
101
|
declare namespace Date {
|
|
98
102
|
var propTypes: {
|
|
103
|
+
append: PropTypes.Requireable<boolean>;
|
|
99
104
|
canClear: PropTypes.Requireable<boolean>;
|
|
100
105
|
defaultValue: PropTypes.Requireable<string>;
|
|
101
106
|
describedBy: PropTypes.Requireable<string>;
|
|
@@ -114,6 +119,7 @@ declare namespace Date {
|
|
|
114
119
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
115
120
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
116
121
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
122
|
+
prepend: PropTypes.Requireable<boolean>;
|
|
117
123
|
value: PropTypes.Requireable<string>;
|
|
118
124
|
};
|
|
119
125
|
var momentFormat: string;
|
|
@@ -8,6 +8,7 @@ interface DefinitionListPropsBase {
|
|
|
8
8
|
/**
|
|
9
9
|
* Defines the width of the `Description`.
|
|
10
10
|
* Can be set to a specific pixel or string value. If not specified, will fill to take up available space.
|
|
11
|
+
* This prop is ignored when `layout="stacked"`.
|
|
11
12
|
*/
|
|
12
13
|
descriptionWidth?: string;
|
|
13
14
|
/**
|
|
@@ -19,17 +20,21 @@ interface DefinitionListPropsBase {
|
|
|
19
20
|
*
|
|
20
21
|
* - `fixed`: The `Term` uses a fixed width. The `Description` fills remaining available space.
|
|
21
22
|
* - `auto`: Both `Term` and `Description` size proportionally based on their container, taking an equal portion of available space.
|
|
23
|
+
* - `stacked`: `Term` is displayed above the `Description`. Custom `termWidth` and `descriptionWidth` are ignored. Both `Term` and `Description` size proportionally.
|
|
24
|
+
*
|
|
22
25
|
* `fixed` layout is the current default. In the next major version, this prop will default to `auto`.
|
|
23
26
|
*/
|
|
24
|
-
layout?: 'fixed' | 'auto';
|
|
27
|
+
layout?: 'fixed' | 'auto' | 'stacked';
|
|
25
28
|
/**
|
|
26
29
|
* Sets the character used to separate key-value pair.
|
|
30
|
+
* Only supported in `layout="fixed"` and `layout="auto"`. Will not be rendered in `layout="stacked"`.
|
|
27
31
|
*/
|
|
28
32
|
separatorCharacter?: string;
|
|
29
33
|
/**
|
|
30
34
|
* Defines the width of the `Term`.
|
|
31
35
|
* Can be set to a specific pixel or string value.
|
|
32
|
-
* The default value is ignored when layout="auto"
|
|
36
|
+
* The default value is ignored when `layout="auto"`.
|
|
37
|
+
* This prop is ignored when `layout="stacked"`.
|
|
33
38
|
*/
|
|
34
39
|
termWidth?: string;
|
|
35
40
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Option from './Option';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
/** @public */
|
|
5
|
-
type DualListboxSelectHandler = (event: React.MouseEvent<
|
|
5
|
+
type DualListboxSelectHandler = (event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLUListElement> | React.ChangeEvent<HTMLInputElement>, data: {
|
|
6
6
|
/**
|
|
7
7
|
* The list `name` associated to the batch action.
|
|
8
8
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxChangeHandler } from '@splunk/react-ui/Checkbox';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
type
|
|
4
|
+
type ListboxLabelCheckboxChangeHandler = CheckboxChangeHandler;
|
|
5
5
|
interface ListboxLabelPropsBase {
|
|
6
6
|
/**
|
|
7
|
-
* ID for the label. Used to label the
|
|
7
|
+
* ID for the label. Used to label the checkbox and associated listbox.
|
|
8
8
|
*/
|
|
9
9
|
id: string;
|
|
10
10
|
/**
|
|
@@ -20,18 +20,18 @@ interface ListboxLabelPropsBase {
|
|
|
20
20
|
*/
|
|
21
21
|
name: string;
|
|
22
22
|
/**
|
|
23
|
-
* Toggle callback for the "select-all"
|
|
23
|
+
* Toggle callback for the "select-all" checkbox.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
onCheckboxChange: ListboxLabelCheckboxChangeHandler;
|
|
26
26
|
/**
|
|
27
27
|
* The value of this option and the label shown for it.
|
|
28
28
|
*/
|
|
29
29
|
value: string;
|
|
30
30
|
}
|
|
31
31
|
type ListboxLabelProps = ComponentProps<ListboxLabelPropsBase, 'div'>;
|
|
32
|
-
declare function ListboxLabel({ id, index, listId, name,
|
|
32
|
+
declare function ListboxLabel({ id, index, listId, name, onCheckboxChange, value }: ListboxLabelProps): React.JSX.Element | null;
|
|
33
33
|
declare namespace ListboxLabel {
|
|
34
34
|
var propTypes: React.WeakValidationMap<ListboxLabelPropsBase>;
|
|
35
35
|
}
|
|
36
36
|
export default ListboxLabel;
|
|
37
|
-
export {
|
|
37
|
+
export { ListboxLabelCheckboxChangeHandler };
|
|
@@ -7,9 +7,9 @@ type ListboxClickHandler = (event: React.MouseEvent<HTMLLIElement> | React.Keybo
|
|
|
7
7
|
type ListboxKeyDownHandler = (event: React.KeyboardEvent<HTMLUListElement>, data: {
|
|
8
8
|
name: string;
|
|
9
9
|
}) => void;
|
|
10
|
-
type ListboxSelectAllClickHandler = (event: React.
|
|
10
|
+
type ListboxSelectAllClickHandler = (event: React.ChangeEvent<HTMLInputElement>, data: {
|
|
11
11
|
name: string;
|
|
12
|
-
selected: true | false | '
|
|
12
|
+
selected: true | false | 'indeterminate';
|
|
13
13
|
}) => void;
|
|
14
14
|
interface ListboxPropsBase {
|
|
15
15
|
/**
|
|
@@ -10,7 +10,7 @@ export type GetOptionStateHandler = (value: string) => {
|
|
|
10
10
|
};
|
|
11
11
|
export type GetLabelStateHandler = () => {
|
|
12
12
|
disabled: boolean;
|
|
13
|
-
selected: boolean | '
|
|
13
|
+
selected: boolean | 'indeterminate';
|
|
14
14
|
selectedValueCount: number;
|
|
15
15
|
valueCount: number;
|
|
16
16
|
};
|
package/types/src/File/File.d.ts
CHANGED
|
@@ -49,6 +49,11 @@ interface FilePropsBase {
|
|
|
49
49
|
fullscreen?: boolean;
|
|
50
50
|
/** Show help text. */
|
|
51
51
|
help?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* An id for the input, which may be necessary for accessibility, such as for aria
|
|
54
|
+
* attributes.
|
|
55
|
+
*/
|
|
56
|
+
inputId?: string;
|
|
52
57
|
/** The name is returned with onRequestAdd and onRequestRemove events,
|
|
53
58
|
* which can be used to identify the
|
|
54
59
|
* control when multiple controls share an onChange callback. */
|
|
@@ -74,7 +79,7 @@ type FileProps = ComponentProps<FilePropsBase, 'div'>;
|
|
|
74
79
|
* file readers, only a reference to the file. This can be used to post binary content, or
|
|
75
80
|
* upload using an array buffer.
|
|
76
81
|
*/
|
|
77
|
-
declare function File({ accept, allowMultiple, children, disabled, dropAnywhere, elementRef, error, fullscreen, help, name, onRequestAdd, onRequestRemove, onRequestRetry, required, supportsMessage: supportsMessageProp, ...otherProps }: FileProps): React.JSX.Element;
|
|
82
|
+
declare function File({ accept, allowMultiple, children, disabled, dropAnywhere, elementRef, error, fullscreen, help, inputId: inputIdProp, name, onRequestAdd, onRequestRemove, onRequestRetry, required, supportsMessage: supportsMessageProp, ...otherProps }: FileProps): React.JSX.Element;
|
|
78
83
|
declare namespace File {
|
|
79
84
|
var propTypes: {
|
|
80
85
|
accept: PropTypes.Requireable<string>;
|
|
@@ -86,6 +91,7 @@ declare namespace File {
|
|
|
86
91
|
fullscreen: PropTypes.Requireable<boolean>;
|
|
87
92
|
error: PropTypes.Requireable<boolean>;
|
|
88
93
|
help: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
94
|
+
inputId: PropTypes.Requireable<string>;
|
|
89
95
|
name: PropTypes.Requireable<string>;
|
|
90
96
|
onRequestAdd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
91
97
|
onRequestRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { JSONElement } from '
|
|
4
|
-
import { TreeItemPropsBase } from '
|
|
3
|
+
import { JSONElement } from '@splunk/react-ui/JSONTree';
|
|
4
|
+
import { TreeItemPropsBase } from '@splunk/react-ui/Tree';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
export type ExpandLinkRenderer = (params: {
|
|
7
7
|
onToggleExpansion: (event: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLSpanElement>, data?: {
|
|
@@ -20,6 +20,7 @@ interface JSONTreeItemPropsBase extends TreeItemPropsBase {
|
|
|
20
20
|
indentArray?: string[];
|
|
21
21
|
index: number;
|
|
22
22
|
initialOpenState: boolean;
|
|
23
|
+
isRoot?: boolean;
|
|
23
24
|
properties?: string[];
|
|
24
25
|
propertyDataPath: string;
|
|
25
26
|
propertyElement?: JSX.Element | undefined;
|
|
@@ -28,7 +29,7 @@ interface JSONTreeItemPropsBase extends TreeItemPropsBase {
|
|
|
28
29
|
value?: JSONElement;
|
|
29
30
|
}
|
|
30
31
|
type JSONTreeItemProps = ComponentProps<JSONTreeItemPropsBase, 'li'>;
|
|
31
|
-
export declare function JSONTreeItem({ clickableKeyRef, clickableValRef, hasChildren, indentArray, index, initialOpenState, onFocus, properties, propertyDataPath, propertyElement, renderExpandLink, representation, value, ...otherProps }: JSONTreeItemProps): React.JSX.Element;
|
|
32
|
+
export declare function JSONTreeItem({ clickableKeyRef, clickableValRef, hasChildren, indentArray, index, initialOpenState, isRoot, onFocus, properties, propertyDataPath, propertyElement, renderExpandLink, representation, value, ...otherProps }: JSONTreeItemProps): React.JSX.Element;
|
|
32
33
|
export declare namespace JSONTreeItem {
|
|
33
34
|
var propTypes: {
|
|
34
35
|
clickableKeyRef: PropTypes.Requireable<object>;
|
|
@@ -37,6 +38,7 @@ export declare namespace JSONTreeItem {
|
|
|
37
38
|
indentArray: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
38
39
|
index: PropTypes.Requireable<number>;
|
|
39
40
|
initialOpenState: PropTypes.Requireable<boolean>;
|
|
41
|
+
isRoot: PropTypes.Requireable<boolean>;
|
|
40
42
|
properties: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
41
43
|
propertyDataPath: PropTypes.Requireable<string>;
|
|
42
44
|
propertyElement: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '
|
|
2
|
+
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '@splunk/react-ui/JSONTree';
|
|
3
3
|
type RenderTreeItemsProps = {
|
|
4
|
+
baseId: string;
|
|
4
5
|
defaultOpen?: boolean;
|
|
5
6
|
defaultExpanded?: boolean;
|
|
6
7
|
expandChildrenOnShiftKey?: boolean;
|
|
@@ -14,5 +15,5 @@ type RenderTreeItemsProps = {
|
|
|
14
15
|
shift?: boolean;
|
|
15
16
|
updateShift: ((newShift: boolean) => void) | undefined;
|
|
16
17
|
};
|
|
17
|
-
export declare function renderTreeItems({ defaultOpen, defaultExpanded, expandChildrenOnShiftKey, indent, indentLevel, obj, onClickKey, onClickValue, overflow, path, shift, updateShift, }: RenderTreeItemsProps): React.JSX.Element | React.JSX.Element[];
|
|
18
|
+
export declare function renderTreeItems({ baseId, defaultOpen, defaultExpanded, expandChildrenOnShiftKey, indent, indentLevel, obj, onClickKey, onClickValue, overflow, path, shift, updateShift, }: RenderTreeItemsProps): React.JSX.Element | React.JSX.Element[];
|
|
18
19
|
export {};
|
|
@@ -3,9 +3,10 @@ import { ComponentProps } from '../../utils/types';
|
|
|
3
3
|
import { StyledCodeBlock } from '../MarkdownStyles';
|
|
4
4
|
interface MarkdownCodeBlockPropsBase {
|
|
5
5
|
children: React.ReactNode[];
|
|
6
|
+
containerAppearance?: 'none' | 'section';
|
|
6
7
|
language?: string;
|
|
7
8
|
}
|
|
8
9
|
type MarkdownCodeBlockProps = ComponentProps<MarkdownCodeBlockPropsBase, 'div'>;
|
|
9
|
-
declare function MarkdownCodeBlock({ children, language, ...otherProps }: MarkdownCodeBlockProps): React.JSX.Element;
|
|
10
|
+
declare function MarkdownCodeBlock({ children, containerAppearance, language, ...otherProps }: MarkdownCodeBlockProps): React.JSX.Element;
|
|
10
11
|
export default MarkdownCodeBlock;
|
|
11
12
|
export { StyledCodeBlock };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Dimmed
|
|
4
|
-
* @description
|
|
4
|
+
* @description Rendering a 'dimmed' Menu Item ensures the Menu Item is still discoverable and can receive focus, but the Menu Item cannot not be activated by the user.
|
|
5
5
|
*/
|
|
6
6
|
declare function Dimmed(): React.JSX.Element;
|
|
7
7
|
export default Dimmed;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Disabled
|
|
4
|
+
* @description Consider using a 'dimmed' Menu Item. Disabling Menu Items creates barriers for all users and can exclude people with disabilities. If necessary, a Menu Item can be completely disabled by setting disabled='disabled'. In these cases, consider contacting us to collaborate on alternatives for a more inclusive experience.
|
|
4
5
|
*/
|
|
5
6
|
declare function Disabled(): React.JSX.Element;
|
|
6
7
|
export default Disabled;
|