Skip to content

Commit 299914c

Browse files
committed
fix react-docs version
1 parent 18d9b7b commit 299914c

File tree

15 files changed

+160
-59
lines changed

15 files changed

+160
-59
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
import resolve from '@rollup/plugin-node-resolve';
3+
import commonjs from '@rollup/plugin-commonjs';
4+
// import css from 'rollup-plugin-css-porter';
5+
import scss from 'rollup-plugin-scss'
6+
7+
export default {
8+
input: 'dist/esm/index.js',
9+
// input: 'test.js',
10+
output: {
11+
name: 'react-core',
12+
file: 'dist/react-core.umd.js',
13+
format: 'umd'
14+
},
15+
plugins: [
16+
resolve({ extensions: ['.js', '.css'] }),
17+
commonjs({
18+
include: [/node_modules/, /react-styles\/css/, /react-tokens/]
19+
}),
20+
scss()
21+
],
22+
external: ['react', 'react-dom', 'focus-trap']
23+
}

packages/react-core/src/components/AboutModal/AboutModalContainer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as React from 'react';
2-
3-
// eslint-disable-next-line @typescript-eslint/no-var-requires
4-
const FocusTrap: any = require('focus-trap-react');
2+
import { FocusTrap } from '../../helpers';
53

64
import styles from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
75
import { css } from '@patternfly/react-styles';

packages/react-core/src/components/ContextSelector/ContextSelector.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import { Button, ButtonVariant } from '../Button';
99
import { TextInput } from '../TextInput';
1010
import { InputGroup } from '../InputGroup';
1111
import { KEY_CODES } from '../../helpers/constants';
12-
13-
// Can't use ES6 imports :(
14-
// The types for it are also wrong, we should probably ditch this dependency.
15-
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
16-
const FocusTrap: any = require('focus-trap-react');
12+
import { FocusTrap } from '../../helpers';
1713

1814
// seed for the aria-labelledby ID
1915
let currentId = 0;

packages/react-core/src/components/Modal/ModalContent.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as React from 'react';
22

3-
// Can't use ES6 imports :(
4-
// The types for it are also wrong, we should probably ditch this dependency.
5-
// eslint-disable-next-line @typescript-eslint/no-var-requires
6-
const FocusTrap: any = require('focus-trap-react');
7-
3+
import { FocusTrap } from '../../helpers';
84
import styles from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
95
import titleStyles from '@patternfly/react-styles/css/components/Title/title';
106
import modalStyles from '@patternfly/react-styles/css/components/ModalBox/modal-box';

packages/react-core/src/components/Popover/Popover.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import GenerateId from '../../helpers/GenerateId/GenerateId';
1515
import popoverMaxWidth from '@patternfly/react-tokens/dist/js/c_popover_MaxWidth';
1616
import { ReactElement } from 'react';
1717
import { PickOptional } from '../../helpers/typeUtils';
18-
// Can't use ES6 imports :(
19-
// The types for it are also wrong, we should probably ditch this dependency.
20-
// eslint-disable-next-line @typescript-eslint/no-var-requires
21-
const FocusTrap: any = require('focus-trap-react');
18+
import { FocusTrap } from '../../helpers';
2219

2320
export enum PopoverPosition {
2421
auto = 'auto',

packages/react-core/src/components/Select/SelectMenu.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { css } from '@patternfly/react-styles';
55
import { SelectOptionObject } from './SelectOption';
66
import { SelectConsumer, SelectVariant } from './selectConstants';
77
import { Omit, PickOptional } from '../../helpers/typeUtils';
8-
9-
// eslint-disable-next-line @typescript-eslint/no-var-requires
10-
const FocusTrap: any = require('focus-trap-react');
8+
import { FocusTrap } from '../../helpers';
119

1210
export interface SelectMenuProps extends Omit<React.HTMLProps<HTMLElement>, 'checked' | 'selected' | 'ref'> {
1311
/** Content rendered inside the SelectMenu */

packages/react-core/src/components/Wizard/examples/FinishedStep.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
4-
const propTypes = {
5-
onClose: PropTypes.func.isRequired
6-
};
72

83
class FinishedStep extends React.Component {
94
constructor(props) {
@@ -77,6 +72,4 @@ class FinishedStep extends React.Component {
7772
}
7873
}
7974

80-
FinishedStep.propTypes = propTypes;
81-
8275
export default FinishedStep;

packages/react-core/src/components/Wizard/examples/SampleForm.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { Form } from '@patternfly/react-core/dist/js/components/Form/Form';
43
import { FormGroup } from '@patternfly/react-core/dist/js/components/Form/FormGroup';
54
import { TextInput } from '@patternfly/react-core/dist/js/components/TextInput/TextInput';
65

7-
const propTypes = {
8-
formValue: PropTypes.string,
9-
isFormValid: PropTypes.bool,
10-
onChange: PropTypes.func
11-
};
126

137
const defaultProps = {
148
formValue: '',
@@ -17,7 +11,6 @@ const defaultProps = {
1711
};
1812

1913
class SampleForm extends React.Component {
20-
static propTypes = propTypes;
2114
static defaultProps = defaultProps;
2215

2316
state = {

packages/react-core/src/helpers/GenerateId/GenerateId.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,13 @@
1616
*/
1717

1818
import React from 'react';
19-
import PropTypes from 'prop-types';
2019

2120
let currentId = 0;
2221

23-
const propTypes = {
24-
/** String to prefix the random id with */
25-
prefix: PropTypes.string,
26-
/** Component to be rendered with the generated id */
27-
children: PropTypes.func.isRequired
28-
};
29-
3022
class GenerateId extends React.Component {
3123
static defaultProps = {
3224
prefix: 'pf-random-id-'
3325
};
34-
static propTypes = propTypes;
3526
id = `${this.props.prefix}${currentId++}`;
3627

3728
render() {

packages/react-core/src/helpers/PopoverBase/PopoverBase.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import PropTypes from 'prop-types';
43
import tippy from 'tippy.js';
54

65
// These props are not native to `tippy.js` and are specific to React only.
@@ -25,16 +24,6 @@ class PopoverBase extends React.Component {
2524

2625
container = typeof document !== 'undefined' && document.createElement('div');
2726

28-
static propTypes = {
29-
children: PropTypes.element.isRequired,
30-
content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
31-
isEnabled: PropTypes.bool,
32-
isVisible: PropTypes.bool,
33-
onCreate: PropTypes.func,
34-
trigger: PropTypes.string,
35-
hideOnClick: PropTypes.bool
36-
};
37-
3827
static defaultProps = {
3928
isEnabled: undefined,
4029
isVisible: undefined,

0 commit comments

Comments
 (0)