-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Adds Checkbox as a new web component #27450
Adds Checkbox as a new web component #27450
Conversation
…erbrady/fluentui-fork into web-components-v3
change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
align-items: center; | ||
justify-content: center; | ||
color: ${colorNeutralForegroundInverted}; | ||
height: 16px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
height was no necessary
| --------------- | ------- | ----------------------- | ----------------------------- | -------------------------------------------------- | | ||
| `labelPosition` | public | `CheckboxLabelPosition` | `CheckboxLabelPosition.after` | Indicates postion of label | | ||
| `checked` | public | `boolean` | `false` | Indicates whether input is checked | | ||
| `indeterminate` | public | `boolean` | `false` | Indicates whether input is initially indeterminate | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FUIR9 uses checked: boolean | 'mixed'
.
The difference should be covered in Fluent Web Component v3 v.s Fluent React 9 section of the readme
|
||
<br /> | ||
|
||
### **Attributes** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to document Fields and Attributes separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been following FASTUI docs on these but this has come up a lot so I have removed the fields table and made sure everything is documented in the attributes table.
| Name | Field | | ||
| ---------------- | ------------- | | ||
| `label-position` | labelPosition | | ||
| `checked` | checked | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing indeterminate
|
||
| Name | Description | Type | | ||
| ----------------------- | -------------------- | -------------------------------------------- | | ||
| `checkboxLabelPosition` | label position types | `{ before: "before", after: "after" }` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these variables? I cannot find them anywhere in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the exported options from checkbox.options.ts
…000d31.json Co-authored-by: Miroslav Stastny <[email protected]>
🕵 FluentUI-web-components No visual regressions between this PR and main |
…ub.com/brianchristopherbrady/fluentui-fork into user/brianbrady/web-component-checkbox
height: 20px; | ||
} | ||
:host([aria-checked='mixed'][size='large']) .indeterminate-indicator { | ||
width: 10px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕵 fluentui-web-components-v3 No visual regressions between this PR and main |
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
* radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * checkbox init * updats checkbox styles * checkbox: adds attributes to Checkbox * checkbox: updates checked-indicator svg and storybook templates * checkbox: updates styles * checkbox: adds exports * checkbox: organizes css * checkbox: updates styles * checkbox: adds README * checkbox: formats README * deletes dead file * checkbox: cleans up * checkbox: updates storybook content * checkbox: removes file * checkbox: yarn change * checkbox: updates README * checkbox: updates styles * checkbox: fixes styling bug * checkbox: optimze css * checkbox: updates storybook * checkbox: adds required story * checkbox: updates stories * Update change/@fluentui-web-components-eba99a5e-947a-4735-815b-86d613000d31.json Co-authored-by: Miroslav Stastny <[email protected]> * checkbox: updates README, adds focus styles * checkbox: api-report * reverts api report * checkbox: updates styles --------- Co-authored-by: Miroslav Stastny <[email protected]>
Checkbox
Design Spec
Link to Checkbox Design Spec in Figma
Engineering Spec
Fluent WC3 Checkbox extends from the FAST Checkbox and is intended to be as close to the Fluent UI React 9 Checkbox implementation as possible. However, due to the nature of web components there will not be 100% parity between the two.
Class:
Checkbox
Component Name
<fluent-checkbox>
Component Template
FAST
checkboxTemplate
Variables
checkboxLabelPosition
{ before: "before", after: "after" }
checkboxShape
{ square: "square", circular: "circular" }
checkboxSize
{ medium: "medium", large: "large" }
Fields
labelPosition
CheckboxLabelPosition
CheckboxLabelPosition.after
checked
boolean
false
indeterminate
boolean
false
disabled
boolean
false
required
boolean
false
size
CheckboxSize
CheckboxSize.medium
shape
CheckboxShape
CheckboxShape.square
Methods
keypressHandler
clickHandler
Events
change
FASTCheckbox
Attributes
label-position
checked
disabled
required
size
shape
IDL Attributes
checked
boolean
indeterminate
boolean
Slots
checked-indicator
indeterminate-indicator
Accessibility
W3C Checkbox Spec
WAI-ARIA Roles, States, and Properties
role="checkbox"
aria-checked
aria-required
aria-disabled