Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Adding component specs for Button, Checkbox, Icon, Link, Menu and Slider #2134

Merged
merged 12 commits into from
Dec 18, 2019

Conversation

khmakoto
Copy link
Member

@khmakoto khmakoto commented Nov 28, 2019

This PR brings the component specs that have been reviewed internally by the Fabric team and reside in our staging repo into the main repo so that we can have a larger conversation about these components.

Microsoft Reviewers: Open in CodeFlow

@DustyTheBot
Copy link
Collaborator

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

Generated by 🚫 dangerJS

Copy link
Member

@dzearing dzearing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get drafts in here to start a review process and make updates until we are happy with them.


## Related variant considerations

- Toggle: should be a separate component because it has different anatomy & warrants unique themability.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

We should pull the "why" behind stances like this into a Design Principles document. There is a branch started for this. @levithomason to update.


## Reference implementations

https://codesandbox.io/s/checkboxes-ggpx1
Copy link
Member

@levithomason levithomason Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

Would be awesome to have a page like this in the repo where devs can do in depth research on how other libraries think about the same component.

| ---- | ---- | ------------- |


### Recommended props
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

We should note what prop interfaces are being extended as well.


| Name | Type | Notes |
| -------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------|
| animation | AnimationProp | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

This is solved by agreeing on component best practices. This is a global shorthand prop on all components. It allows <Animation /> to be easily added to any component. The same practice is followed for other components like <Tooltip /> and <Popup />. The idea is, make it easier to use components, doing things like animating should be easy.

| root | label |
| input | actual checkbox element - what gets checked/unchecked |
| icon | visual checkmark, sideways if indeterminate |
| box | wraps input & icon - what actual gets the styling |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

What are our design principles for slots? Inline replaceable? Can I add a slot to a component? Etc.


Both Fluent and Teams themes and other custom themes will be made with compose and the design tokens specified below. Screenshots of themed variants will be posted here soon after that work is done like the example code below.

The `Checkbox` uses `react-texture` to provide a recomposable implementation that has no runtime performance penalties. The `BaseCheckbox` implementation can be used to provide new `slots` and default `props`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP REVIEW:

Reminder, react-texture to be replaced here.

@khmakoto khmakoto changed the title Adding component specs for Checkbox, Icon, Link and Slider. Adding component specs for Button, Checkbox, Icon, Link, Menu and Slider Dec 9, 2019
@aneeshack4 aneeshack4 merged commit 624698a into master Dec 18, 2019
@aneeshack4 aneeshack4 deleted the docs/componentSpecs branch December 18, 2019 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants