-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: style .form-control as disabled when parent fieldset is disabled * docs: add the changeset * refactor(fieldset[disable]): use scss parent + nested selector instead of mixin
- Loading branch information
Showing
3 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/css": patch | ||
--- | ||
|
||
Make .form-control elements render as disabled when a parent fieldset is disabled |
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' | ||
|
||
export default { | ||
title: 'Components/Forms/Fieldset', | ||
decorators: [ | ||
Story => ( | ||
<form> | ||
<Story/> | ||
</form> | ||
) | ||
], | ||
argTypes: { | ||
disabled: { | ||
description: 'disabled fieldset', | ||
control: {type: 'boolean'}, | ||
table: { | ||
category: 'Interactive' | ||
} | ||
} | ||
} | ||
} | ||
|
||
const FieldsetTemplate = ({disabled}) => ( | ||
<fieldset disabled={disabled}> | ||
<label htmlFor="email">Email</label> | ||
<input className="form-control" id="email" placeholder="email"/> | ||
|
||
<label htmlFor="username">Username</label> | ||
<input className="form-control" id="username" placeholder="username"/> | ||
</fieldset> | ||
) | ||
|
||
export const Playground = FieldsetTemplate.bind({}) | ||
Playground.args = { | ||
disabled: false | ||
} |
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