This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Terra-Form-Field] Added Inline label examples for form field compone…
…nts (#4001) Co-authored-by: SM051274 <sm051274@cerner.net>
- Loading branch information
1 parent
2fe3156
commit d750eda
Showing
11 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../terra-core-docs/src/terra-dev-site/doc/form-input/common/InputFieldDocCommon.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:local { | ||
.field-label { | ||
font-weight: 700; | ||
} | ||
|
||
.flex-box-container { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 0.5rem; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/terra-core-docs/src/terra-dev-site/doc/form-input/example/InlineLabelField.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import InputField from 'terra-form-input/lib/InputField'; | ||
import styles from '../common/InputFieldDocCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const label = 'Profile Name'; | ||
const InlineLabelFieldExample = () => ( | ||
<div className={cx('flex-box-container')}> | ||
<div> | ||
<span className={cx('field-label')}>{label}</span> | ||
</div> | ||
<div> | ||
<InputField | ||
inputId="profile-name" | ||
isLabelHidden | ||
isInline | ||
label={label} | ||
help="Note: profile name cannot be changed in the future" | ||
type="text" | ||
inputAttrs={{ | ||
name: 'profile', | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default InlineLabelFieldExample; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,8 @@ | |
outline: 0; | ||
text-align: left; | ||
} | ||
|
||
.field-label { | ||
font-weight: 700; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
.../terra-core-docs/src/terra-dev-site/doc/form-select/example/combobox/InlineLabelField.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import Grid from 'terra-grid'; | ||
import ComboboxField from 'terra-form-select/lib/ComboboxField'; | ||
import styles from '../FormSelectDocCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const label = 'T-shirt size'; | ||
const InlineLabelFieldExample = () => ( | ||
<Grid> | ||
<Grid.Row> | ||
<Grid.Column small={1}> | ||
<span className={cx('field-label')}>{label}</span> | ||
</Grid.Column> | ||
<Grid.Column small={3}> | ||
<ComboboxField | ||
label={label} | ||
isLabelHidden | ||
placeholder="Select a size" | ||
selectId="tshirt-size-field-1" | ||
className={cx('form-select')} | ||
help="Please take note that product sizes may vary." | ||
> | ||
<ComboboxField.Option value="xSmall" display="Extra Small" /> | ||
<ComboboxField.Option value="small" display="Small" /> | ||
<ComboboxField.Option value="medium" display="Medium" /> | ||
<ComboboxField.Option value="large" display="Large" /> | ||
<ComboboxField.Option value="xLarge" display="Extra Large" /> | ||
</ComboboxField> | ||
</Grid.Column> | ||
</Grid.Row> | ||
</Grid> | ||
); | ||
|
||
export default InlineLabelFieldExample; |
39 changes: 39 additions & 0 deletions
39
...-docs/src/terra-dev-site/doc/form-select/example/native-select-field/InlineLabelField.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import Grid from 'terra-grid'; | ||
import NativeSelectField from 'terra-form-select/lib/native-select/NativeSelectField'; | ||
import styles from '../FormSelectDocCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const label = 'Select a Day'; | ||
const InlineLabelFieldExample = () => ( | ||
<Grid> | ||
<Grid.Row> | ||
<Grid.Column small={1}> | ||
<span className={cx('field-label')}>{label}</span> | ||
</Grid.Column> | ||
<Grid.Column small={3}> | ||
<NativeSelectField | ||
label={label} | ||
isLabelHidden | ||
isInline | ||
help="Note: Shop will be closed on weekends" | ||
options={[ | ||
{ value: 'monday', display: 'Volvo' }, | ||
{ value: 'tuesday', display: 'Tuesday' }, | ||
{ value: 'wednesday', display: 'Wednesday' }, | ||
{ value: 'thursday', display: 'Thursday' }, | ||
{ value: 'friday', display: 'Friday' }, | ||
{ value: 'saturday', disabled: true, display: 'Saturday' }, | ||
{ value: 'sunday', disabled: true, display: 'Sunday' }, | ||
]} | ||
selectId="default-example" | ||
className={cx('form-select')} | ||
/> | ||
</Grid.Column> | ||
</Grid.Row> | ||
</Grid> | ||
); | ||
|
||
export default InlineLabelFieldExample; |
36 changes: 36 additions & 0 deletions
36
...es/terra-core-docs/src/terra-dev-site/doc/form-select/example/single/InlineLabelField.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import Grid from 'terra-grid'; | ||
import SingleSelectField from 'terra-form-select/lib/SingleSelectField'; | ||
import styles from '../FormSelectDocCommon.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const label = 'T-shirt size'; | ||
const InlineLabelFieldExample = () => ( | ||
<Grid> | ||
<Grid.Row> | ||
<Grid.Column small={1}> | ||
<span className={cx('field-label')}>{label}</span> | ||
</Grid.Column> | ||
<Grid.Column small={3}> | ||
<SingleSelectField | ||
label={label} | ||
isLabelHidden | ||
placeholder="Select a size" | ||
selectId="tshirt-size-field-1" | ||
className={cx('form-select')} | ||
help="Please take note that product sizes may vary." | ||
> | ||
<SingleSelectField.Option value="xSmall" display="Extra Small" /> | ||
<SingleSelectField.Option value="small" display="Small" /> | ||
<SingleSelectField.Option value="medium" display="Medium" /> | ||
<SingleSelectField.Option value="large" display="Large" /> | ||
<SingleSelectField.Option value="xLarge" display="Extra Large" /> | ||
</SingleSelectField> | ||
</Grid.Column> | ||
</Grid.Row> | ||
</Grid> | ||
); | ||
|
||
export default InlineLabelFieldExample; |