@patternfly/react-core 4.223.2 → 4.224.1
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 +30 -0
- package/dist/esm/components/Form/FormGroup.d.ts +4 -2
- package/dist/esm/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/esm/components/Form/FormGroup.js +4 -3
- package/dist/esm/components/Form/FormGroup.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +25 -23
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +9 -0
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +6 -3
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.d.ts +6 -0
- package/dist/esm/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.js +6 -2
- package/dist/esm/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/components/Wizard/WizardDrawerWrapper.d.ts +11 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.d.ts.map +1 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.js +3 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.js.map +1 -0
- package/dist/esm/components/Wizard/WizardToggle.d.ts +5 -1
- package/dist/esm/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.js +4 -2
- package/dist/esm/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/components/Form/FormGroup.d.ts +4 -2
- package/dist/js/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/js/components/Form/FormGroup.js +4 -3
- package/dist/js/components/Form/FormGroup.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +25 -23
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts +9 -0
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js +6 -3
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/components/Wizard/WizardBody.d.ts +6 -0
- package/dist/js/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardBody.js +6 -2
- package/dist/js/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/components/Wizard/WizardDrawerWrapper.d.ts +11 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.d.ts.map +1 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.js +7 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.js.map +1 -0
- package/dist/js/components/Wizard/WizardToggle.d.ts +5 -1
- package/dist/js/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.js +4 -2
- package/dist/js/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/umd/react-core.js +45 -33
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Form/FormGroup.tsx +40 -29
- package/src/components/Form/examples/Form.md +12 -1271
- package/src/components/Form/examples/FormBasic.tsx +122 -0
- package/src/components/Form/examples/FormFieldGroups.tsx +324 -0
- package/src/components/Form/examples/FormGrid.tsx +66 -0
- package/src/components/Form/examples/FormGroupLabelInfo.tsx +72 -0
- package/src/components/Form/examples/FormHorizontal.tsx +118 -0
- package/src/components/Form/examples/FormHorizontalHelper.tsx +23 -0
- package/src/components/Form/examples/FormHorizontalStacked.tsx +11 -0
- package/src/components/Form/examples/FormInvalid.tsx +47 -0
- package/src/components/Form/examples/FormInvalidWithFormAlert.tsx +52 -0
- package/src/components/Form/examples/FormLimitWidth.tsx +122 -0
- package/src/components/Form/examples/FormSections.tsx +44 -0
- package/src/components/Form/examples/FormValidated.tsx +60 -0
- package/src/components/Select/Select.tsx +35 -33
- package/src/components/Wizard/Wizard.tsx +21 -1
- package/src/components/Wizard/WizardBody.tsx +23 -2
- package/src/components/Wizard/WizardDrawerWrapper.tsx +18 -0
- package/src/components/Wizard/WizardToggle.tsx +12 -2
- package/src/components/Wizard/__tests__/Wizard.test.tsx +24 -7
- package/src/components/Wizard/examples/Wizard.md +157 -2
- package/src/demos/Wizard/WizardDemo.md +1033 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.224.1",
|
|
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,16 +34,16 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
37
|
+
"@patternfly/react-icons": "^4.75.1",
|
|
38
|
+
"@patternfly/react-styles": "^4.74.1",
|
|
39
|
+
"@patternfly/react-tokens": "^4.76.1",
|
|
40
40
|
"focus-trap": "6.9.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
43
43
|
"tslib": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@patternfly/patternfly": "4.202.
|
|
46
|
+
"@patternfly/patternfly": "4.202.1",
|
|
47
47
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
49
49
|
"@rollup/plugin-replace": "^3.0.0",
|
|
@@ -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": "
|
|
63
|
+
"gitHead": "93c060f88f3510aa99becc66350ed2016727f585"
|
|
64
64
|
}
|
|
@@ -3,6 +3,7 @@ import styles from '@patternfly/react-styles/css/components/Form/form';
|
|
|
3
3
|
import { ASTERISK } from '../../helpers/htmlConstants';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import { ValidatedOptions } from '../../helpers/constants';
|
|
6
|
+
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
|
|
6
7
|
|
|
7
8
|
export interface FormGroupProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
|
|
8
9
|
/** Anything that can be rendered as FormGroup content. */
|
|
@@ -39,8 +40,10 @@ export interface FormGroupProps extends Omit<React.HTMLProps<HTMLDivElement>, 'l
|
|
|
39
40
|
helperTextIcon?: React.ReactNode;
|
|
40
41
|
/** Icon displayed to the left of the helper text when the field is invalid. */
|
|
41
42
|
helperTextInvalidIcon?: React.ReactNode;
|
|
42
|
-
/** ID of
|
|
43
|
-
|
|
43
|
+
/** ID of an individual field or a group of multiple fields. Required when a role of "group" or "radiogroup" is passed in.
|
|
44
|
+
* If only one field is included, its ID attribute and this prop must be the same.
|
|
45
|
+
*/
|
|
46
|
+
fieldId?: string;
|
|
44
47
|
/** Sets the role of the form group. Pass in "radiogroup" when the form group contains multiple
|
|
45
48
|
* radio inputs, or pass in "group" when the form group contains multiple of any other input type.
|
|
46
49
|
*/
|
|
@@ -120,38 +123,46 @@ export const FormGroup: React.FunctionComponent<FormGroupProps> = ({
|
|
|
120
123
|
);
|
|
121
124
|
|
|
122
125
|
return (
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
{...(role && { role })}
|
|
126
|
-
{...(isGroupOrRadioGroup && { 'aria-labelledby': `${fieldId}-legend` })}
|
|
127
|
-
{...props}
|
|
128
|
-
>
|
|
129
|
-
{label && (
|
|
126
|
+
<GenerateId>
|
|
127
|
+
{randomId => (
|
|
130
128
|
<div
|
|
131
|
-
className={css(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
)}
|
|
136
|
-
{...(isGroupOrRadioGroup && { id: `${fieldId}-legend` })}
|
|
129
|
+
className={css(styles.formGroup, className)}
|
|
130
|
+
{...(role && { role })}
|
|
131
|
+
{...(isGroupOrRadioGroup && { 'aria-labelledby': `${fieldId || randomId}-legend` })}
|
|
132
|
+
{...props}
|
|
137
133
|
>
|
|
138
|
-
{
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
{label && (
|
|
135
|
+
<div
|
|
136
|
+
className={css(
|
|
137
|
+
styles.formGroupLabel,
|
|
138
|
+
labelInfo && styles.modifiers.info,
|
|
139
|
+
hasNoPaddingTop && styles.modifiers.noPaddingTop
|
|
140
|
+
)}
|
|
141
|
+
{...(isGroupOrRadioGroup && { id: `${fieldId || randomId}-legend` })}
|
|
142
|
+
>
|
|
143
|
+
{labelInfo && (
|
|
144
|
+
<React.Fragment>
|
|
145
|
+
<div className={css(styles.formGroupLabelMain)}>{labelContent}</div>
|
|
146
|
+
<div className={css(styles.formGroupLabelInfo)}>{labelInfo}</div>
|
|
147
|
+
</React.Fragment>
|
|
148
|
+
)}
|
|
149
|
+
{!labelInfo && labelContent}
|
|
150
|
+
</div>
|
|
143
151
|
)}
|
|
144
|
-
|
|
152
|
+
<div
|
|
153
|
+
className={css(
|
|
154
|
+
styles.formGroupControl,
|
|
155
|
+
isInline && styles.modifiers.inline,
|
|
156
|
+
isStack && styles.modifiers.stack
|
|
157
|
+
)}
|
|
158
|
+
>
|
|
159
|
+
{isHelperTextBeforeField && helperTextToDisplay}
|
|
160
|
+
{children}
|
|
161
|
+
{!isHelperTextBeforeField && helperTextToDisplay}
|
|
162
|
+
</div>
|
|
145
163
|
</div>
|
|
146
164
|
)}
|
|
147
|
-
|
|
148
|
-
className={css(styles.formGroupControl, isInline && styles.modifiers.inline, isStack && styles.modifiers.stack)}
|
|
149
|
-
>
|
|
150
|
-
{isHelperTextBeforeField && helperTextToDisplay}
|
|
151
|
-
{children}
|
|
152
|
-
{!isHelperTextBeforeField && helperTextToDisplay}
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
165
|
+
</GenerateId>
|
|
155
166
|
);
|
|
156
167
|
};
|
|
157
168
|
FormGroup.displayName = 'FormGroup';
|