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

feat(Label): add LabelGroup and missing docs #576

Merged
merged 8 commits into from
Oct 3, 2016
Merged

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Oct 1, 2016

This PR:

  • adds all doc examples from SUI;
  • adds Group component;
  • cleanups component and tests;
  • improves props handling.

Requires merge of #551.

@codecov-io
Copy link

codecov-io commented Oct 1, 2016

Current coverage is 99.52% (diff: 100%)

Merging #576 into master will decrease coverage by 0.10%

@@             master       #576   diff @@
==========================================
  Files           118        119     +1   
  Lines          1870       1878     +8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1863       1869     +6   
- Misses            7          9     +2   
  Partials          0          0          

Powered by Codecov. Last update 2c144d1...599c1ea

@layershifter
Copy link
Member Author

@levithomason @jcarbo I need review there

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Looks great, left a few minor comments.

import React from 'react'
import { Grid, Image, Label, Segment } from 'stardust'

const imageStyles = {
Copy link
Member

Choose a reason for hiding this comment

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

Are these style required? I'd like to avoid any styles in the docs. It would seem that SUI alone should handle all styling.

Copy link
Member Author

Choose a reason for hiding this comment

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

If I remove them, example will look ugly 😿

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should ever include styles in the examples. I think it gives the impression that we require inline styles to be used for the example to work. If we truly must include styles, there are doc site css rules in the index.ejs template for this, but let's not put them in the JSX.

In this case, I think there is little enough difference that we can just leave them out:

http://g.recordit.co/c0Js946Z9x.gif

Alternatively, we could use <Segment padded> to give whitespace similar to what the inline image styles did:

http://g.recordit.co/EZpy8uQuZp.gif

import React from 'react'
import { Grid, Image, Label, Segment } from 'stardust'

const imageStyles = {
Copy link
Member

Choose a reason for hiding this comment

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

Same regarding styles here, any way to remove them?

import { Label } from 'stardust'

const LabelExampleCircular = () => {
const colors = [
Copy link
Member

Choose a reason for hiding this comment

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

When we have data for examples, let's put it up top outside the scope of the example itself.

Copy link
Member

Choose a reason for hiding this comment

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

Same comment re: sizes, should use Label._meta.props.color

import { Label } from 'stardust'

const LabelExampleSize = () => {
const sizes = ['mini', 'tiny', 'small', 'medium', 'large', 'big', 'huge', 'massive']
Copy link
Member

Choose a reason for hiding this comment

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

More data here, let's move it up top. There are several other examples with data to update so I won't comment on all of them.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think better would be to just use Label._meta.props.size, this way the sizes we give examples for are all the sizes the component supports. There are a few other places in the docs we should update to do this as well.

Copy link
Member

Choose a reason for hiding this comment

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

I don't want to expose the private _meta property. It may change or completely go away in the future.

Copy link
Member

Choose a reason for hiding this comment

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

More info, meta used to have more keys and have more purpose. Over time, it keeps shrinking. Considering the parent, type, and name keys are only for documentation, I hope to pull them out of the code and into the doc block. We already parse the docblock for docs so grabbing type, parent, and name from there makes sense.

This leaves only the props in the meta. In farther out, less defined goals, I'd like to better formalize how we define props to support the missing abilities of the component explorer #427.

@layershifter
Copy link
Member Author

Updated to master and fixed comments.

@levithomason levithomason changed the title fix(Label): Add docs feat(Label): add LabelGroup and missing docs Oct 3, 2016
@levithomason levithomason merged commit d287f80 into master Oct 3, 2016
@levithomason levithomason deleted the fix/label-docs branch October 3, 2016 04:33
@levithomason
Copy link
Member

Released in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants