@patternfly/react-core 4.251.0 → 4.251.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 +8 -0
- package/dist/umd/react-core.min.css +966 -966
- package/package.json +2 -2
- package/src/components/SkipToContent/examples/SkipToContent.md +1 -103
- package/src/components/SkipToContent/examples/SkipToContentBasic.tsx +128 -0
- package/src/components/TextInput/examples/TextInput.md +8 -231
- package/src/components/TextInput/examples/TextInputBasic.tsx +7 -0
- package/src/components/TextInput/examples/TextInputDisabled.tsx +6 -0
- package/src/components/TextInput/examples/TextInputIcon.tsx +39 -0
- package/src/components/TextInput/examples/TextInputIconSprite.tsx +63 -0
- package/src/components/TextInput/examples/TextInputInvalid.tsx +16 -0
- package/src/components/TextInput/examples/TextInputLeftTruncated.tsx +17 -0
- package/src/components/TextInput/examples/TextInputReadOnly.tsx +25 -0
- package/src/components/TextInput/examples/TextInputSelectUsingRef.tsx +16 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox, TextInput } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextInputReadOnly: React.FunctionComponent = () => {
|
|
5
|
+
const [isPlainChecked, setIsPlainChecked] = React.useState(false);
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<div style={{ marginBottom: '12px' }}>
|
|
9
|
+
<Checkbox
|
|
10
|
+
id="isPlain"
|
|
11
|
+
key="isPlain"
|
|
12
|
+
label="Plain read only variant"
|
|
13
|
+
isChecked={isPlainChecked}
|
|
14
|
+
onChange={checked => setIsPlainChecked(checked)}
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<TextInput
|
|
18
|
+
value="read only text input example"
|
|
19
|
+
type="text"
|
|
20
|
+
readOnlyVariant={isPlainChecked ? 'plain' : 'default'}
|
|
21
|
+
aria-label="readonly input example"
|
|
22
|
+
/>
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextInputSelectUsingRef: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('select all on click');
|
|
6
|
+
const ref = React.useRef<HTMLInputElement>(null);
|
|
7
|
+
return (
|
|
8
|
+
<TextInput
|
|
9
|
+
ref={ref}
|
|
10
|
+
value={value}
|
|
11
|
+
onFocus={() => ref?.current?.select()}
|
|
12
|
+
onChange={value => setValue(value)}
|
|
13
|
+
aria-label="select-all"
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
};
|