diff --git a/packages/patternfly-4/react-core/src/components/Form/Form.docs.js b/packages/patternfly-4/react-core/src/components/Form/Form.docs.js index 723f69ad8f4..67872bd6963 100644 --- a/packages/patternfly-4/react-core/src/components/Form/Form.docs.js +++ b/packages/patternfly-4/react-core/src/components/Form/Form.docs.js @@ -1,6 +1,5 @@ import Simple from './examples/SimpleForm'; import Horizontal from './examples/HorizontalForm'; -import Various from './examples/VariousLabelsForm'; import Invalid from './examples/InvalidForm'; import { Form, FormGroup, ActionGroup } from '@patternfly/react-core'; @@ -14,11 +13,6 @@ export default { examples: [ { component: Simple, title: 'Simple Form' }, { component: Horizontal, title: 'Horizontal form' }, - { component: Invalid, title: 'Invalid form' }, - { - component: Various, - title: 'Various labels and helper text', - description: 'Label and helperText can be a string, a function or a node.' - } + { component: Invalid, title: 'Invalid form' } ] }; diff --git a/packages/patternfly-4/react-core/src/components/Form/examples/InvalidForm.js b/packages/patternfly-4/react-core/src/components/Form/examples/InvalidForm.js index 8417906c6a2..2d873e5309c 100644 --- a/packages/patternfly-4/react-core/src/components/Form/examples/InvalidForm.js +++ b/packages/patternfly-4/react-core/src/components/Form/examples/InvalidForm.js @@ -2,28 +2,35 @@ import React from 'react'; import { Form, FormGroup, TextInput } from '@patternfly/react-core'; class InvalidForm extends React.Component { + state = { + value: 'Five', + isValid: false + }; + + handleTextInputChange = value => { + this.setState({ value, isValid: /^\d+$/.test(value) }); + }; + render() { + const { value, isValid } = this.state; + return (
- - - - +
); diff --git a/packages/patternfly-4/react-core/src/components/Form/examples/SimpleForm.js b/packages/patternfly-4/react-core/src/components/Form/examples/SimpleForm.js index dfa535a4868..1a642179117 100644 --- a/packages/patternfly-4/react-core/src/components/Form/examples/SimpleForm.js +++ b/packages/patternfly-4/react-core/src/components/Form/examples/SimpleForm.js @@ -82,6 +82,9 @@ class SimpleForm extends React.Component { aria-label="Please don't contact me" /> + + + diff --git a/packages/patternfly-4/react-core/src/components/Form/examples/VariousLabelsForm.js b/packages/patternfly-4/react-core/src/components/Form/examples/VariousLabelsForm.js deleted file mode 100644 index b5de185d224..00000000000 --- a/packages/patternfly-4/react-core/src/components/Form/examples/VariousLabelsForm.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { Form, FormGroup, TextInput, Badge } from '@patternfly/react-core'; - -class VariousLabelsForm extends React.Component { - state = { - value1: '', - value2: '' - }; - - handleTextInputChange1 = value1 => { - this.setState({ value1 }); - }; - - handleTextInputChange2 = value2 => { - this.setState({ value2 }); - }; - - render() { - const d = new Date(); - const renderHelperText = () => `This is a function from ${String(d.getSeconds())}th second of this minute!`; - const { value1, value2 } = this.state; - - return ( -
- - - - This is a just header} helperText={Badge here!} fieldId="object-id"> - - -
- ); - } -} - -export default VariousLabelsForm;