@patternfly/react-core 4.227.4 → 4.227.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.227.5 (2022-07-27)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-core
9
+
10
+
11
+
12
+
13
+
6
14
  ## 4.227.4 (2022-07-27)
7
15
 
8
16
  **Note:** Version bump only for package @patternfly/react-core
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.227.4",
3
+ "version": "4.227.5",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.78.4",
38
- "@patternfly/react-styles": "^4.77.4",
39
- "@patternfly/react-tokens": "^4.79.4",
37
+ "@patternfly/react-icons": "^4.78.5",
38
+ "@patternfly/react-styles": "^4.77.5",
39
+ "@patternfly/react-tokens": "^4.79.5",
40
40
  "focus-trap": "6.9.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "bf9f5697021d8b85cd20ce4c5c8899dbcf922cdd"
63
+ "gitHead": "da70962a8c1722d6564f4a679297985ea9567fda"
64
64
  }
@@ -7,104 +7,48 @@ ouia: true
7
7
  ---
8
8
 
9
9
  ## Examples
10
+
10
11
  ### Controlled
11
- ```js
12
- import React from 'react';
13
- import { Radio } from '@patternfly/react-core';
14
-
15
- class ControlledRadio extends React.Component {
16
- constructor(props) {
17
- super(props);
18
- this.state = {
19
- check1: false,
20
- };
21
-
22
- this.handleChange = (_, event) => {
23
- const { value } = event.currentTarget;
24
- this.setState({ [value]: true });
25
- };
26
- }
27
-
28
- render() {
29
- return (
30
- <React.Fragment>
31
- <Radio
32
- isChecked={this.state.check1}
33
- name="radio-1"
34
- onChange={this.handleChange}
35
- label="Controlled radio"
36
- id="radio-controlled"
37
- value="check1"
38
- />
39
- </React.Fragment>
40
- );
41
- }
42
- }
12
+
13
+ ```ts file="./RadioControlled.tsx"
43
14
  ```
44
15
 
45
16
  ### Uncontrolled
46
- ```js
47
- import React from 'react';
48
- import { Radio } from '@patternfly/react-core';
49
17
 
50
- <Radio label="Uncontrolled radio example" id="radio-uncontrolled" name="radio-2" />
18
+ ```ts file="./RadioUncontrolled.tsx"
51
19
  ```
52
20
 
53
21
  ### Reversed
54
- ```js
55
- import React from 'react';
56
- import { Radio } from '@patternfly/react-core';
57
22
 
58
- <Radio isLabelBeforeButton label="Reversed radio example" id="radio-reversed" name="radio-3" />
23
+ ```ts file="./RadioReversed.tsx"
59
24
  ```
60
25
 
61
26
  ### Label wraps
62
- ```js
63
- import React from 'react';
64
- import { Radio } from '@patternfly/react-core';
65
27
 
66
- <Radio isLabelWrapped label="Label wraps input example" id="radio-label-wraps-input" name="radio-4" />
28
+ ```ts file="./RadioLabelWraps.tsx"
67
29
  ```
68
30
 
69
31
  ### Disabled
70
- ```js
71
- import React from 'react';
72
- import { Radio } from '@patternfly/react-core';
73
-
74
- <React.Fragment>
75
- <Radio id="radio-disabled" label="Disabled radio example" isDisabled name="radio-5" />
76
- <Radio id="radio-disabled-checked" defaultChecked label="Disabled and checked radio example" isDisabled name="radio-6" />
77
- </React.Fragment>
32
+
33
+ ```ts file="./RadioDisabled.tsx"
78
34
  ```
79
35
 
80
36
  ### With description
81
- ```js
82
- import React from 'react';
83
- import { Radio } from '@patternfly/react-core';
84
37
 
85
- <Radio id="radio-with-description" label="Radio with description example" description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP." />
38
+ ```ts file="./RadioWithDescription.tsx"
86
39
  ```
87
40
 
88
41
  ### With body
89
- ```js
90
- import React from 'react';
91
- import { Radio } from '@patternfly/react-core';
92
42
 
93
- <Radio id="radio-with-body" label="Radio with body" body="This is where custom content goes." />
43
+ ```ts file="./RadioWithBody.tsx"
94
44
  ```
95
45
 
96
46
  ### With description and body
97
- ```js
98
- import React from 'react';
99
- import { Radio } from '@patternfly/react-core';
100
47
 
101
- <Radio id="radio-description-body" label="Radio with description and body" description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP." body="This is where custom content goes." />
48
+ ```ts file="./RadioWithDescriptionAndBody.tsx"
102
49
  ```
103
50
 
104
51
  ### Standalone input
105
- ```js
106
- import React from 'react';
107
- import { Radio } from '@patternfly/react-core';
108
52
 
109
- <Radio id="radio-standalone" aria-label="Standalone input" name="exampleRadioStandalone"/>
53
+ ```ts file="./RadioStandaloneInput.tsx"
110
54
  ```
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioControlled: React.FunctionComponent = () => {
5
+ const [check1, setCheck1] = React.useState(false);
6
+
7
+ const handleChange = () => {
8
+ setCheck1(true);
9
+ };
10
+ return (
11
+ <React.Fragment>
12
+ <Radio
13
+ isChecked={check1}
14
+ name="radio-1"
15
+ onChange={handleChange}
16
+ label="Controlled Radio"
17
+ id="radio-controlled"
18
+ ></Radio>
19
+ </React.Fragment>
20
+ );
21
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioDisabled: React.FunctionComponent = () => (
5
+ <React.Fragment>
6
+ <Radio id="radio-disabled" label="Disabled radio example" isDisabled name="radio-5" />
7
+ <Radio
8
+ id="radio-disabled-checked"
9
+ defaultChecked
10
+ label="Disabled and checked radio example"
11
+ isDisabled
12
+ name="radio-6"
13
+ />
14
+ </React.Fragment>
15
+ );
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioLabelWraps: React.FunctionComponent = () => (
5
+ <Radio isLabelWrapped label="Label wraps input example" id="radio-label-wraps-input" name="radio-4" />
6
+ );
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioReversed: React.FunctionComponent = () => (
5
+ <Radio isLabelBeforeButton label="Reversed radio example" id="radio-reversed" name="radio-3" />
6
+ );
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioStandaloneInput: React.FunctionComponent = () => (
5
+ <Radio id="radio-standalone" aria-label="Standalone input" name="exampleRadioStandalone" />
6
+ );
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioUncontrolled: React.FunctionComponent = () => (
5
+ <Radio label="Uncontrolled radio example" id="radio-uncontrolled" name="radio-2" />
6
+ );
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioWithBody: React.FunctionComponent = () => (
5
+ <Radio id="radio-with-body" label="Radio with body" name="radio-8" body="This is where custom content goes." />
6
+ );
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioWithDescription: React.FunctionComponent = () => (
5
+ <Radio
6
+ id="radio-with-description"
7
+ label="Radio with description example"
8
+ name="radio-7"
9
+ description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP."
10
+ />
11
+ );
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Radio } from '@patternfly/react-core';
3
+
4
+ export const RadioWithDescriptionAndBody: React.FunctionComponent = () => (
5
+ <Radio
6
+ id="radio-description-body"
7
+ label="Radio with description and body"
8
+ description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP."
9
+ body="This is where custom content goes."
10
+ name="radio-8"
11
+ />
12
+ );