@patternfly/react-core 4.216.0 → 4.217.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/HelperText/HelperTextItem.d.ts +4 -0
- package/dist/esm/components/HelperText/HelperTextItem.d.ts.map +1 -1
- package/dist/esm/components/HelperText/HelperTextItem.js +7 -2
- package/dist/esm/components/HelperText/HelperTextItem.js.map +1 -1
- package/dist/esm/components/Select/Select.js +2 -2
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/js/components/HelperText/HelperTextItem.d.ts +4 -0
- package/dist/js/components/HelperText/HelperTextItem.d.ts.map +1 -1
- package/dist/js/components/HelperText/HelperTextItem.js +7 -2
- package/dist/js/components/HelperText/HelperTextItem.js.map +1 -1
- package/dist/js/components/Select/Select.js +2 -2
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/umd/react-core.css +69 -69
- package/dist/umd/react-core.js +9 -4
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +5 -5
- package/src/components/HelperText/HelperTextItem.tsx +10 -1
- package/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap +5 -0
- package/src/components/Select/Select.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.217.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,9 +34,9 @@
|
|
|
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.68.1",
|
|
38
|
+
"@patternfly/react-styles": "^4.67.1",
|
|
39
|
+
"@patternfly/react-tokens": "^4.69.1",
|
|
40
40
|
"focus-trap": "6.2.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": "
|
|
63
|
+
"gitHead": "e49da36e9926344b36f8aad556214491af4ec202"
|
|
64
64
|
}
|
|
@@ -29,6 +29,10 @@ export interface HelperTextItemProps extends React.HTMLProps<HTMLDivElement | HT
|
|
|
29
29
|
* assistive technologies.
|
|
30
30
|
*/
|
|
31
31
|
id?: string;
|
|
32
|
+
/** Text that is only accessible to screen readers in order to announce the status of a helper text item.
|
|
33
|
+
* This prop can only be used when the isDynamic prop is also passed in.
|
|
34
|
+
*/
|
|
35
|
+
screenReaderText?: string;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
const variantStyle = {
|
|
@@ -48,6 +52,7 @@ export const HelperTextItem: React.FunctionComponent<HelperTextItemProps> = ({
|
|
|
48
52
|
isDynamic = false,
|
|
49
53
|
hasIcon = isDynamic,
|
|
50
54
|
id,
|
|
55
|
+
screenReaderText = `${variant} status`,
|
|
51
56
|
...props
|
|
52
57
|
}: HelperTextItemProps) => {
|
|
53
58
|
const Component = component as any;
|
|
@@ -70,7 +75,11 @@ export const HelperTextItem: React.FunctionComponent<HelperTextItemProps> = ({
|
|
|
70
75
|
{variant === 'error' && <ExclamationCircleIcon />}
|
|
71
76
|
</span>
|
|
72
77
|
)}
|
|
73
|
-
|
|
78
|
+
|
|
79
|
+
<span className={css(styles.helperTextItemText)}>
|
|
80
|
+
{children}
|
|
81
|
+
{isDynamic && <span className="pf-u-screen-reader">: {screenReaderText};</span>}
|
|
82
|
+
</span>
|
|
74
83
|
</Component>
|
|
75
84
|
);
|
|
76
85
|
};
|
|
@@ -679,13 +679,13 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
679
679
|
};
|
|
680
680
|
|
|
681
681
|
handleTypeaheadKeys = (position: string, shiftKey: boolean = false) => {
|
|
682
|
-
const { isOpen, onFavorite } = this.props;
|
|
682
|
+
const { isOpen, onFavorite, isCreatable } = this.props;
|
|
683
683
|
const { typeaheadCurrIndex, tabbedIntoFavoritesMenu } = this.state;
|
|
684
684
|
const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
|
|
685
685
|
if (isOpen) {
|
|
686
686
|
if (position === 'enter') {
|
|
687
687
|
if (
|
|
688
|
-
typeaheadCurrIndex !== -1 && // do not allow selection without moving to an initial option
|
|
688
|
+
(typeaheadCurrIndex !== -1 || (isCreatable && this.refCollection.length === 1)) && // do not allow selection without moving to an initial option unless it is a single create option
|
|
689
689
|
(typeaheadActiveChild || (this.refCollection[0] && this.refCollection[0][0]))
|
|
690
690
|
) {
|
|
691
691
|
if (typeaheadActiveChild) {
|