Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Allowing EuiFormRow props on EuiFieldText #3837

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-docs/src/services/playground/knobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const markup = (text) => {
}
return token;
});
return [...values, <br key="lineBreak" />];
return [...values, ' '];
});
};

Expand Down
4 changes: 1 addition & 3 deletions src-docs/src/views/accordion/accordion_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const repeatableForm = (
<EuiForm component="form">
<EuiFlexGroup>
<EuiFlexItem>
<EuiFormRow label="Username">
<EuiFieldText icon="user" placeholder="John" />
</EuiFormRow>
<EuiFieldText label="Username" icon="user" placeholder="John" />
</EuiFlexItem>

<EuiFlexItem>
Expand Down
9 changes: 5 additions & 4 deletions src-docs/src/views/copy/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
EuiButton,
EuiFieldText,
EuiSpacer,
EuiFormRow,
} from '../../../../src/components/';

export default () => {
Expand All @@ -17,9 +16,11 @@ export default () => {

return (
<div>
<EuiFormRow label="Enter text that will be copied to clipboard">
<EuiFieldText value={copyText} onChange={onChange} />
</EuiFormRow>
<EuiFieldText
label="Enter text that will be copied to clipboard"
value={copyText}
onChange={onChange}
/>

<EuiSpacer size="m" />

Expand Down
7 changes: 3 additions & 4 deletions src-docs/src/views/flyout/flyout_max_width.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ export default () => {
<EuiSpacer />

<EuiForm component="form">
<EuiFormRow
<EuiFieldText
label="Text field"
helpText="I am some friendly help text."
>
<EuiFieldText name="first" />
</EuiFormRow>
name="first"
/>

<EuiFormRow label="Select (with no initial selection)">
<EuiSelect
Expand Down
9 changes: 6 additions & 3 deletions src-docs/src/views/form_compressed/complex_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ export default () => {

return (
<EuiPanel style={{ maxWidth: 432 }}>
<EuiFormRow label="Name" display="columnCompressed">
<EuiFieldText prepend="Label" placeholder="Input" compressed />
</EuiFormRow>
<EuiFieldText
prepend="Label"
placeholder="Input"
label="Name"
display="columnCompressed"
/>

<EuiFormRow label="Visibility" display="columnCompressed">
<EuiDualRange
Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/form_compressed/form_compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export default () => {
};
return (
<EuiPanel style={{ maxWidth: 300 }}>
<EuiFormRow
<EuiFieldText
name="first"
isLoading
label="Text field"
helpText="I am some friendly help text."
display="rowCompressed"
>
<EuiFieldText name="first" isLoading compressed />
</EuiFormRow>
compressed
/>

<EuiFormRow label="Select" display="rowCompressed">
<EuiSelect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ export default () => {
isFullWidth
/>
</EuiFormRow>
<EuiFormRow label="Text field" display="columnCompressed">
<EuiFieldText name="first" compressed />
</EuiFormRow>

<EuiFieldText
name="first"
label="Text field"
display="columnCompressed"
/>

<EuiFormRow label={'Select'} display="columnCompressed">
<EuiSelect
Expand Down
9 changes: 5 additions & 4 deletions src-docs/src/views/form_compressed/form_horizontal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ export default () => {

return (
<EuiPanel style={{ maxWidth: 300 }}>
<EuiFormRow
<EuiFieldText
label="Text field"
helpText="I am some friendly help text."
display="columnCompressed"
>
<EuiFieldText name="first" isLoading compressed />
</EuiFormRow>
name="first"
isLoading
compressed
/>

<EuiFormRow label="Select" display="columnCompressed">
<EuiSelect
Expand Down
7 changes: 3 additions & 4 deletions src-docs/src/views/form_compressed/form_horizontal_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import { EuiToolTip } from '../../../../src/components/tool_tip';

export default () => (
<EuiPanel style={{ maxWidth: 300 }}>
<EuiFormRow
<EuiFieldText
name="first"
label="Text field"
helpText="Show validation help text only."
display="columnCompressed"
>
<EuiFieldText name="first" compressed />
</EuiFormRow>
/>

<EuiFormRow
label={
Expand Down
16 changes: 6 additions & 10 deletions src-docs/src/views/form_controls/field_text.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';

import { EuiFieldText } from '../../../../src/components';
import { DisplayToggles } from './display_toggles';

export default function () {
const [value, setValue] = useState('');
Expand All @@ -11,14 +10,11 @@ export default function () {
};

return (
/* DisplayToggles wrapper for Docs only */
<DisplayToggles canPrepend canAppend>
<EuiFieldText
placeholder="Placeholder text"
value={value}
onChange={(e) => onChange(e)}
aria-label="Use aria labels when no actual label is in use"
/>
</DisplayToggles>
<EuiFieldText
placeholder="Placeholder text"
value={value}
onChange={(e) => onChange(e)}
label="This text field has its own label prop"
/>
);
}
Loading