@splunk/react-ui 4.23.0 → 4.25.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/Breadcrumbs.js +99 -124
- package/Button.js +8 -7
- package/ButtonSimple.js +40 -39
- package/CHANGELOG.md +22 -0
- package/Code.js +193 -100
- package/Color.js +18 -15
- package/ComboBox.js +49 -37
- package/JSONTree.js +210 -177
- package/Menu.js +643 -472
- package/Modal.js +265 -226
- package/Multiselect.js +634 -620
- package/RadioList.js +12 -11
- package/ResultsMenu.js +863 -148
- package/Search.js +3 -1
- package/Select.js +427 -416
- package/TabBar.js +2 -2
- package/Table.js +2 -2
- package/Tree.js +617 -0
- package/cypress/README.md +11 -0
- package/cypress/support/commands.ts +1 -0
- package/cypress/support/component.ts +0 -1
- package/cypress/tsconfig.cypress.json +14 -0
- package/package.json +12 -12
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +7 -1
- package/types/src/Breadcrumbs/Item.d.ts +8 -2
- package/types/src/Button/Button.d.ts +4 -2
- package/types/src/Button/docs/examples/Block.d.ts +2 -2
- package/types/src/Button/docs/examples/Dimmed.d.ts +2 -0
- package/types/src/Button/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Button/docs/examples/Icons.d.ts +2 -2
- package/types/src/Button/docs/examples/Menus.d.ts +2 -2
- package/types/src/Button/docs/examples/To.d.ts +2 -2
- package/types/src/Button/docs/examples/Truncated.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/Basic.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/Block.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/Dimmed.d.ts +2 -0
- package/types/src/Button/docs/examples/prisma/Disabled.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/Menus.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/To.d.ts +2 -2
- package/types/src/Button/docs/examples/prisma/Truncated.d.ts +2 -2
- package/types/src/ButtonSimple/ButtonSimple.d.ts +4 -2
- package/types/src/Color/Color.d.ts +5 -3
- package/types/src/ComboBox/ComboBox.d.ts +6 -0
- package/types/src/JSONTree/JSONTree.d.ts +3 -2
- package/types/src/Menu/Menu.d.ts +14 -1
- package/types/src/Modal/Header.d.ts +0 -2
- package/types/src/Modal/Modal.d.ts +7 -0
- package/types/src/Modal/ModalContext.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +6 -0
- package/types/src/Multiselect/Multiselect.d.ts +7 -0
- package/types/src/RadioList/RadioList.d.ts +27 -27
- package/types/src/RadioList/RadioListContext.d.ts +5 -4
- package/types/src/ResultsMenu/ResultsMenu.d.ts +53 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.d.ts +9 -0
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +33 -0
- package/types/src/ResultsMenu/VirtualizedResultsMenu/groupChildren.d.ts +16 -0
- package/types/src/ResultsMenu/VirtualizedResultsMenu/index.d.ts +3 -0
- package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +21 -0
- package/types/src/ResultsMenu/index.d.ts +2 -1
- package/types/src/Select/Select.d.ts +2 -0
- package/types/src/Select/SelectBase.d.ts +6 -0
- package/types/src/Tree/Tree.d.ts +24 -0
- package/types/src/Tree/TreeContext.d.ts +13 -0
- package/types/src/Tree/TreeItem.d.ts +31 -0
- package/types/src/Tree/index.d.ts +3 -0
- package/types/src/Tree/treeUtils.d.ts +29 -0
- package/types/unit-test-setup-testing-library.d.ts +1 -0
- package/types/src/Modal/docs/examples/prisma/TypicalUsage.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.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.",
|
|
@@ -29,7 +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": "tsc --emitDeclarationOnly --declaration --declarationDir ./types && node ./scripts/pruneTypes.js",
|
|
32
|
+
"types:build": "yarn types:build:cypress && tsc --emitDeclarationOnly --declaration --declarationDir ./types && node ./scripts/pruneTypes.js",
|
|
33
|
+
"types:build:cypress": "tsc --p cypress/tsconfig.cypress.json",
|
|
33
34
|
"types:start": "yarn types:build --watch"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
@@ -44,13 +45,6 @@
|
|
|
44
45
|
"@splunk/react-icons": "^4.2.0",
|
|
45
46
|
"@splunk/themes": "^0.16.4",
|
|
46
47
|
"@splunk/ui-utils": "^1.6.0",
|
|
47
|
-
"@types/commonmark": "^0.27.6",
|
|
48
|
-
"@types/lodash": "^4.14.156",
|
|
49
|
-
"@types/react": "^16.9.38",
|
|
50
|
-
"@types/react-dom": "^16.9.8",
|
|
51
|
-
"@types/react-resize-detector": "^3.1.1",
|
|
52
|
-
"@types/styled-components": "^5.1.0",
|
|
53
|
-
"@types/tinycolor2": "^1.4.2",
|
|
54
48
|
"commonmark": "^0.30.0",
|
|
55
49
|
"commonmark-react-renderer": "^4.3.2",
|
|
56
50
|
"decimal.js-light": "^2.2.3",
|
|
@@ -86,11 +80,17 @@
|
|
|
86
80
|
"@testing-library/react": "^12.1.2",
|
|
87
81
|
"@testing-library/react-hooks": "^7.0.2",
|
|
88
82
|
"@testing-library/user-event": "^14.4.3",
|
|
83
|
+
"@types/commonmark": "^0.27.6",
|
|
89
84
|
"@types/jest": "^26.0.0",
|
|
90
|
-
"@types/
|
|
85
|
+
"@types/lodash": "^4.14.156",
|
|
91
86
|
"@types/node": "^10.17.26",
|
|
92
|
-
"@types/prismjs": "^1.
|
|
87
|
+
"@types/prismjs": "^1.26.3",
|
|
88
|
+
"@types/react": "^16.9.38",
|
|
89
|
+
"@types/react-dom": "^16.9.8",
|
|
90
|
+
"@types/react-resize-detector": "^3.1.1",
|
|
93
91
|
"@types/sinon": "^4.3.3",
|
|
92
|
+
"@types/styled-components": "^5.1.0",
|
|
93
|
+
"@types/tinycolor2": "^1.4.2",
|
|
94
94
|
"@types/webdriverio": "^5.0.0",
|
|
95
95
|
"@types/webpack-env": "^1.15.2",
|
|
96
96
|
"@typescript-eslint/eslint-plugin": "^4.8.2",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"jest-stare": "^2.4.1",
|
|
127
127
|
"mkdirp": "^0.5.1",
|
|
128
128
|
"playwright": "^1.23.3",
|
|
129
|
-
"prismjs": "^1.
|
|
129
|
+
"prismjs": "^1.29.0",
|
|
130
130
|
"prompt": "^1.0.0",
|
|
131
131
|
"raw-loader": "^4.0.2",
|
|
132
132
|
"react": "^16.12.0",
|
|
@@ -11,14 +11,20 @@ interface BreadcrumbsPropsBase {
|
|
|
11
11
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
12
12
|
*/
|
|
13
13
|
elementRef?: React.Ref<HTMLElement>;
|
|
14
|
+
/**
|
|
15
|
+
* By default, the current page is a dimmed link. This prop changes this behavior by enabling the current page link.
|
|
16
|
+
*/
|
|
17
|
+
enableCurrentPage?: boolean;
|
|
14
18
|
}
|
|
15
19
|
declare type BreadcrumbsProps = ComponentProps<BreadcrumbsPropsBase, 'nav'>;
|
|
16
|
-
declare function Breadcrumbs({ children, elementRef, ...otherProps }: BreadcrumbsProps): JSX.Element;
|
|
20
|
+
declare function Breadcrumbs({ children, elementRef, enableCurrentPage, ...otherProps }: BreadcrumbsProps): JSX.Element;
|
|
17
21
|
declare namespace Breadcrumbs {
|
|
18
22
|
var propTypes: {
|
|
19
23
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
20
24
|
elementRef: PropTypes.Requireable<object>;
|
|
25
|
+
enableCurrentPage: PropTypes.Requireable<boolean>;
|
|
21
26
|
};
|
|
27
|
+
var defaultProps: Required<Pick<BreadcrumbsPropsBase, "enableCurrentPage">>;
|
|
22
28
|
var Item: typeof import("./Item").default;
|
|
23
29
|
}
|
|
24
30
|
export default Breadcrumbs;
|
|
@@ -6,12 +6,16 @@ interface ItemPropsBase {
|
|
|
6
6
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
7
7
|
*/
|
|
8
8
|
elementRef?: React.Ref<HTMLAnchorElement>;
|
|
9
|
+
/**
|
|
10
|
+
* @private. Passed by Breadcrumbs.
|
|
11
|
+
*/
|
|
12
|
+
enableCurrentPage?: boolean;
|
|
9
13
|
/**
|
|
10
14
|
* Adornment at the end of the label.
|
|
11
15
|
*/
|
|
12
16
|
endAdornment?: React.ReactNode;
|
|
13
17
|
/**
|
|
14
|
-
* @private
|
|
18
|
+
* @private. Passed by Breadcrumbs.
|
|
15
19
|
*/
|
|
16
20
|
isCurrent?: boolean;
|
|
17
21
|
/**
|
|
@@ -28,15 +32,17 @@ interface ItemPropsBase {
|
|
|
28
32
|
to: string;
|
|
29
33
|
}
|
|
30
34
|
declare type ItemProps = ComponentProps<ItemPropsBase, 'a'>;
|
|
31
|
-
declare function Item({ endAdornment, isCurrent, label, startAdornment, to, ...otherProps }: ItemProps): JSX.Element;
|
|
35
|
+
declare function Item({ enableCurrentPage, endAdornment, isCurrent, label, startAdornment, to, ...otherProps }: ItemProps): JSX.Element;
|
|
32
36
|
declare namespace Item {
|
|
33
37
|
var propTypes: {
|
|
34
38
|
elementRef: PropTypes.Requireable<object>;
|
|
39
|
+
enableCurrentPage: PropTypes.Requireable<boolean>;
|
|
35
40
|
endAdornment: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
36
41
|
isCurrent: PropTypes.Requireable<boolean>;
|
|
37
42
|
label: PropTypes.Validator<string>;
|
|
38
43
|
startAdornment: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
39
44
|
to: PropTypes.Validator<string>;
|
|
40
45
|
};
|
|
46
|
+
var defaultProps: Required<Pick<ItemPropsBase, "enableCurrentPage" | "isCurrent">>;
|
|
41
47
|
}
|
|
42
48
|
export default Item;
|
|
@@ -21,8 +21,10 @@ interface ButtonPropsBase {
|
|
|
21
21
|
children?: React.ReactNode;
|
|
22
22
|
/** @private An additional className to add to the button. */
|
|
23
23
|
classNamePrivate?: string;
|
|
24
|
-
/** Prevents user from clicking the button.
|
|
25
|
-
|
|
24
|
+
/** Prevents user from clicking the button. If set to `dimmed`, the button
|
|
25
|
+
* does not respond to mouse events but can still receive focus, and
|
|
26
|
+
* `aria-disabled` is set to `true`. */
|
|
27
|
+
disabled?: boolean | 'dimmed';
|
|
26
28
|
/**
|
|
27
29
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
28
30
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Block(): JSX.Element;
|
|
2
|
+
export default Block;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Disabled(): JSX.Element;
|
|
2
|
+
export default Disabled;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Icons(): JSX.Element;
|
|
2
|
+
export default Icons;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Menus(): JSX.Element;
|
|
2
|
+
export default Menus;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function To(): JSX.Element;
|
|
2
|
+
export default To;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Truncated(): JSX.Element;
|
|
2
|
+
export default Truncated;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Basic(): JSX.Element;
|
|
2
|
+
export default Basic;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Block(): JSX.Element;
|
|
2
|
+
export default Block;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Disabled(): JSX.Element;
|
|
2
|
+
export default Disabled;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Menus(): JSX.Element;
|
|
2
|
+
export default Menus;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function To(): JSX.Element;
|
|
2
|
+
export default To;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Truncated(): JSX.Element;
|
|
2
|
+
export default Truncated;
|
|
@@ -14,8 +14,10 @@ interface ButtonSimplePropsBase {
|
|
|
14
14
|
* append things to it. */
|
|
15
15
|
append?: boolean;
|
|
16
16
|
children?: React.ReactNode;
|
|
17
|
-
/** Add a disabled attribute and prevent clicking.
|
|
18
|
-
|
|
17
|
+
/** Add a disabled attribute and prevent clicking. If set to `dimmed`,
|
|
18
|
+
* the button does not respond to mouse events but can still receive
|
|
19
|
+
* focus, and `aria-disabled` is set to `true`. */
|
|
20
|
+
disabled?: boolean | 'dimmed';
|
|
19
21
|
/**
|
|
20
22
|
* Adds error styling to the button and applies `aria-invalid`.
|
|
21
23
|
*/
|