@splunk/react-ui 4.18.0 → 4.19.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 +6 -6
- package/Anchor.js +2 -2
- package/Animation.js +2 -2
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +4 -4
- package/ButtonGroup.js +2 -2
- package/ButtonSimple.js +2 -2
- package/CHANGELOG.md +11 -1
- package/Calendar.js +8 -8
- package/Card.js +8 -8
- package/CardLayout.js +2 -2
- package/Chip.js +23 -16
- package/Clickable.js +11 -11
- package/CloseButton.js +2 -2
- package/Code.js +12 -12
- package/CollapsiblePanel.js +4 -4
- package/Color.js +16 -16
- package/ColumnLayout.js +6 -6
- package/ComboBox.js +14 -14
- package/Concertina.js +10 -10
- package/ControlGroup.js +2 -2
- package/Date.js +13 -13
- package/DefinitionList.js +2 -2
- package/Divider.js +2 -2
- package/Dropdown.js +13 -13
- package/DualListbox.js +4 -4
- package/EventListener.js +4 -4
- package/File.js +8 -8
- package/FormRows.js +266 -105
- package/Heading.js +45 -49
- package/Image.js +15 -15
- package/JSONTree.js +14 -14
- package/Layer.js +12 -12
- package/Link.js +4 -4
- package/List.js +2 -2
- package/Markdown.js +16 -16
- package/Menu.js +18 -18
- package/Message.js +21 -21
- package/MessageBar.js +19 -19
- package/Modal.js +11 -11
- package/ModalLayer.js +4 -4
- package/Monogram.js +3 -3
- package/Multiselect.js +34 -34
- package/Number.js +4 -4
- package/Paginator.js +6 -6
- package/Paragraph.js +2 -2
- package/Popover.js +22 -22
- package/Progress.js +4 -4
- package/RadioBar.js +4 -4
- package/RadioList.js +2 -2
- package/Resize.js +4 -4
- package/ResultsMenu.js +8 -8
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +4 -4
- package/ScrollContainerContext.js +2 -2
- package/Search.js +14 -14
- package/Select.js +12 -12
- package/SidePanel.js +4 -4
- package/Slider.js +6 -6
- package/SlidingPanels.js +8 -8
- package/SplitButton.js +4 -4
- package/StaticContent.js +2 -2
- package/StepBar.js +2 -2
- package/Switch.js +4 -4
- package/TabBar.js +4 -4
- package/TabLayout.js +6 -6
- package/Table.js +46 -45
- package/Text.js +23 -21
- package/TextArea.js +23 -21
- package/Tooltip.js +11 -11
- package/TransitionOpen.js +2 -2
- package/Typography.js +4 -4
- package/WaitSpinner.js +2 -2
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +27 -0
- package/cypress.config.ts +19 -0
- package/package.json +9 -9
- package/types/src/Clickable/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -12
- package/types/src/FormRows/RowInternal.d.ts +19 -0
- package/types/src/FormRows/SortableList.d.ts +8 -2
- package/types/src/FormRows/SortableRow.d.ts +20 -0
- package/types/src/Heading/Heading.d.ts +1 -1
- package/useForceUpdate.js +2 -2
- package/useKeyPress.js +2 -2
- package/usePrevious.js +2 -2
- package/useRovingFocus.js +2 -2
- package/cypress/plugins/index.ts +0 -15
- package/cypress/support/index.ts +0 -10
- package/cypress.json +0 -13
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig } from 'cypress';
|
|
2
|
+
import webpackConfig from './webpack.test.config.js';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
env: {},
|
|
6
|
+
defaultCommandTimeout: 1000,
|
|
7
|
+
fixturesFolder: false,
|
|
8
|
+
video: false,
|
|
9
|
+
videoUploadOnPasses: false,
|
|
10
|
+
chromeWebSecurity: false,
|
|
11
|
+
component: {
|
|
12
|
+
specPattern: '**/**/tests/*.spec.tsx',
|
|
13
|
+
devServer: {
|
|
14
|
+
framework: 'react',
|
|
15
|
+
bundler: 'webpack',
|
|
16
|
+
webpackConfig,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.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.",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"test:ci": "JEST_JUNIT_OUTPUT_DIR=./test-reports JEST_JUNIT_OUTPUT_NAME=unit-results.xml JEST_JUNIT_CLASSNAME=unit yarn run test --ci --reporters=default jest-junit --coverage --coverageDirectory=coverage_report/coverage_maps_unit --coverageReporters=cobertura",
|
|
29
29
|
"test:watch": "jest --watch",
|
|
30
|
-
"test:cypress": "yarn cypress open
|
|
31
|
-
"test:cypress:ci": "yarn cypress run
|
|
30
|
+
"test:cypress": "yarn cypress open --component",
|
|
31
|
+
"test:cypress:ci": "yarn cypress run --component",
|
|
32
32
|
"types:build": "tsc --emitDeclarationOnly --declaration --declarationDir ./types && node ./scripts/pruneTypes.js",
|
|
33
33
|
"types:start": "yarn types:build --watch"
|
|
34
34
|
},
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"styled-components": "^5.3.10"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@dnd-kit/core": "6.0.8",
|
|
42
|
+
"@dnd-kit/sortable": "7.0.2",
|
|
43
|
+
"@dnd-kit/utilities": "3.2.1",
|
|
41
44
|
"@splunk/react-icons": "^4.0.1",
|
|
42
45
|
"@splunk/themes": "^0.16.1",
|
|
43
46
|
"@splunk/ui-utils": "^1.6.0",
|
|
@@ -55,7 +58,6 @@
|
|
|
55
58
|
"moment": "^2.29.4",
|
|
56
59
|
"prop-types": "^15.6.2",
|
|
57
60
|
"react-resize-detector": "^3.2.1",
|
|
58
|
-
"react-sortable-hoc": "^1.11.0",
|
|
59
61
|
"react-spring": "9.2.4",
|
|
60
62
|
"tinycolor2": "^1.4.1",
|
|
61
63
|
"use-typed-event-listener": "^3.0.0"
|
|
@@ -63,8 +65,6 @@
|
|
|
63
65
|
"devDependencies": {
|
|
64
66
|
"@babel/core": "^7.2.0",
|
|
65
67
|
"@babel/plugin-transform-runtime": "^7.18.6",
|
|
66
|
-
"@cypress/react": "^5.12.4",
|
|
67
|
-
"@cypress/webpack-dev-server": "^1.8.2",
|
|
68
68
|
"@splunk/babel-preset": "^4.0.0",
|
|
69
69
|
"@splunk/cicd-tools": "^0.5.0",
|
|
70
70
|
"@splunk/docs-gen": "1.0.0-beta.5",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@storybook/react": "^6.5.9",
|
|
81
81
|
"@storybook/test-runner": "^0.9.0",
|
|
82
82
|
"@storybook/testing-react": "^1.3.0",
|
|
83
|
-
"@testing-library/cypress": "^
|
|
83
|
+
"@testing-library/cypress": "^9.0.0",
|
|
84
84
|
"@testing-library/jest-dom": "^5.16.1",
|
|
85
85
|
"@testing-library/react": "^12.1.2",
|
|
86
86
|
"@testing-library/react-hooks": "^7.0.2",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"babel-plugin-transform-require-context": "^0.1.1",
|
|
103
103
|
"core-js": "^3.6.4",
|
|
104
104
|
"cross-env": "^6.0.3",
|
|
105
|
-
"cypress": "^
|
|
106
|
-
"cypress-real-events": "^1.
|
|
105
|
+
"cypress": "^12.17.1",
|
|
106
|
+
"cypress-real-events": "^1.9.1",
|
|
107
107
|
"docgen-loader": "^1.3.4",
|
|
108
108
|
"eslint": "^7.14.0",
|
|
109
109
|
"eslint-config-airbnb": "^18.2.1",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
export default
|
|
1
|
+
declare function Basic(): JSX.Element;
|
|
2
|
+
export default Basic;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import Row from './Row';
|
|
4
3
|
import type { RowRequestRemoveHandler, RowWithoutSortable } from './Row';
|
|
5
4
|
import { ClassComponentProps } from '../utils/types';
|
|
@@ -33,7 +32,7 @@ declare type FormRowsProps = ClassComponentProps<FormRowsPropsBase, typeof defau
|
|
|
33
32
|
declare class FormRows extends Component<FormRowsProps, {}> {
|
|
34
33
|
static propTypes: React.WeakValidationMap<ClassComponentProps<FormRowsPropsBase, Required<Pick<FormRowsPropsBase, "header" | "disabled" | "addLabel">>, "div", never>>;
|
|
35
34
|
static defaultProps: Required<Pick<FormRowsPropsBase, "header" | "disabled" | "addLabel">>;
|
|
36
|
-
static Row:
|
|
35
|
+
static Row: typeof Row;
|
|
37
36
|
/**
|
|
38
37
|
* Static function for adding a row.
|
|
39
38
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import FormRowsContext from './FormRowsContext';
|
|
4
3
|
declare type RowKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>, data: {
|
|
5
4
|
index: number;
|
|
@@ -14,16 +13,10 @@ interface RowPropsBase {
|
|
|
14
13
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
15
14
|
*/
|
|
16
15
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
17
|
-
/** Index of the row */
|
|
16
|
+
/** Index of the row. This is required if the rows are sortable. */
|
|
18
17
|
index?: number;
|
|
19
18
|
/** Callback when remove button is clicked. */
|
|
20
19
|
onRequestRemove?: RowRequestRemoveHandler;
|
|
21
|
-
/**
|
|
22
|
-
* @private
|
|
23
|
-
* Sortable HOC consumes and removes `index`, so we have `rowIndex` to keep
|
|
24
|
-
* track of it internally.
|
|
25
|
-
*/
|
|
26
|
-
rowIndex?: number;
|
|
27
20
|
/** The contents of Row */
|
|
28
21
|
value?: React.ReactNode;
|
|
29
22
|
}
|
|
@@ -31,10 +24,7 @@ declare class Row extends Component<RowPropsBase, {}> {
|
|
|
31
24
|
static propTypes: React.WeakValidationMap<RowPropsBase>;
|
|
32
25
|
context: React.ContextType<typeof FormRowsContext>;
|
|
33
26
|
static contextType: React.Context<FormRowsContext>;
|
|
34
|
-
private handleKeyDown;
|
|
35
|
-
private handleRequestRemove;
|
|
36
27
|
render(): JSX.Element;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
|
-
export default SortableRow;
|
|
29
|
+
export default Row;
|
|
40
30
|
export type { Row as RowWithoutSortable, RowKeyDownHandler, RowPropsBase, RowRequestRemoveHandler };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** @public */
|
|
3
|
+
declare type RowRequestRemoveHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
4
|
+
index: number;
|
|
5
|
+
}) => void;
|
|
6
|
+
interface RowInternalPropsBase {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Index of the row. This is required if the rows are sortable. */
|
|
9
|
+
index?: number;
|
|
10
|
+
/** Callback when remove button is clicked. */
|
|
11
|
+
onRequestRemove?: RowRequestRemoveHandler;
|
|
12
|
+
renderDragHandle?: () => React.ReactNode;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
/** The contents of Row */
|
|
15
|
+
value?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare const RowInternal: React.ForwardRefExoticComponent<RowInternalPropsBase & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default RowInternal;
|
|
19
|
+
export type { RowInternalPropsBase, RowRequestRemoveHandler };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare type SortEndHandler = ({ oldIndex, newIndex }: {
|
|
3
|
+
oldIndex: number;
|
|
4
|
+
newIndex: number;
|
|
5
|
+
}) => void;
|
|
6
|
+
declare const SortableList: ({ children, onSortEnd, }: {
|
|
3
7
|
children?: React.ReactNode;
|
|
4
|
-
|
|
8
|
+
onSortEnd: SortEndHandler;
|
|
9
|
+
}) => JSX.Element;
|
|
5
10
|
export default SortableList;
|
|
11
|
+
export { SortEndHandler };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type RowKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>, data: {
|
|
3
|
+
index: number;
|
|
4
|
+
}) => void;
|
|
5
|
+
/** @public */
|
|
6
|
+
declare type RowRequestRemoveHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
7
|
+
index: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
interface RowPropsBase {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Index of the row. */
|
|
12
|
+
index?: number;
|
|
13
|
+
/** Callback when remove button is clicked. */
|
|
14
|
+
onRequestRemove?: RowRequestRemoveHandler;
|
|
15
|
+
/** The contents of Row */
|
|
16
|
+
value?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const Row: React.ForwardRefExoticComponent<RowPropsBase & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export default Row;
|
|
20
|
+
export type { Row as RowWithoutSortable, RowKeyDownHandler, RowPropsBase, RowRequestRemoveHandler };
|
|
@@ -34,7 +34,7 @@ declare const levelToElement: {
|
|
|
34
34
|
readonly '5': "h5";
|
|
35
35
|
readonly '6': "h6";
|
|
36
36
|
};
|
|
37
|
-
declare function Heading({
|
|
37
|
+
declare function Heading({ children, elementRef, level, variant, ...otherProps }: HeadingProps): JSX.Element;
|
|
38
38
|
declare namespace Heading {
|
|
39
39
|
var propTypes: {
|
|
40
40
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
package/useForceUpdate.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 242);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -94,7 +94,7 @@ module.exports = require("react");
|
|
|
94
94
|
|
|
95
95
|
/***/ }),
|
|
96
96
|
|
|
97
|
-
/***/
|
|
97
|
+
/***/ 242:
|
|
98
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
99
|
|
|
100
100
|
"use strict";
|
package/useKeyPress.js
CHANGED
|
@@ -82,12 +82,12 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 168);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
|
-
/***/
|
|
90
|
+
/***/ 168:
|
|
91
91
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
92
|
|
|
93
93
|
"use strict";
|
package/usePrevious.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 243);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -94,7 +94,7 @@ module.exports = require("react");
|
|
|
94
94
|
|
|
95
95
|
/***/ }),
|
|
96
96
|
|
|
97
|
-
/***/
|
|
97
|
+
/***/ 243:
|
|
98
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
99
|
|
|
100
100
|
"use strict";
|
package/useRovingFocus.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 244);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -94,7 +94,7 @@ module.exports = require("react");
|
|
|
94
94
|
|
|
95
95
|
/***/ }),
|
|
96
96
|
|
|
97
|
-
/***/
|
|
97
|
+
/***/ 244:
|
|
98
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
99
|
|
|
100
100
|
"use strict";
|
package/cypress/plugins/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-env node */
|
|
2
|
-
|
|
3
|
-
import { startDevServer } from '@cypress/webpack-dev-server';
|
|
4
|
-
import webpackConfig from '../../webpack.test.config';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @type {Cypress.PluginConfig}
|
|
8
|
-
*/
|
|
9
|
-
module.exports = (on, config) => {
|
|
10
|
-
if (config.testingType === 'component') {
|
|
11
|
-
on('dev-server:start', (options) => startDevServer({ options, webpackConfig }));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return config;
|
|
15
|
-
};
|
package/cypress/support/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { setGlobalConfig } from '@storybook/testing-react';
|
|
2
|
-
import { configure } from '@testing-library/cypress';
|
|
3
|
-
import 'cypress-real-events/support';
|
|
4
|
-
|
|
5
|
-
import './commands';
|
|
6
|
-
import * as sbPreview from '../../.storybook/preview';
|
|
7
|
-
|
|
8
|
-
configure({ testIdAttribute: 'data-test' });
|
|
9
|
-
|
|
10
|
-
setGlobalConfig(sbPreview);
|
package/cypress.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"baseUrl": "http://localhost:8080",
|
|
3
|
-
"env": {},
|
|
4
|
-
"defaultCommandTimeout": 1000,
|
|
5
|
-
"fixturesFolder": false,
|
|
6
|
-
"video": false,
|
|
7
|
-
"videoUploadOnPasses": false,
|
|
8
|
-
"chromeWebSecurity": false,
|
|
9
|
-
"component": {
|
|
10
|
-
"componentFolder": "src",
|
|
11
|
-
"testFiles": "**/**/tests/*.spec.tsx"
|
|
12
|
-
}
|
|
13
|
-
}
|