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

Support Dropdown sub component markup #347

Merged
merged 1 commit into from
Jul 23, 2016
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Jul 23, 2016

See #346 for more information. This PR enables support for Dropdown markup via sub components. Currently we only support an array of options to configure the Dropdown. Now we support this:

<Dropdown text='File'>
  <Dropdown.Menu>
    <Dropdown.Item text='New' />
    <Dropdown.Item text='Open...' description='ctrl + o' />
    <Dropdown.Item text='Save as...' description='ctrl + s' />
    <Dropdown.Item text='Rename' description='ctrl + r' />
    <Dropdown.Item text='Make a copy' />
    <Dropdown.Item icon='trash' text='Move to trash' />
    <Dropdown.Divider />
    <Dropdown.Item text='Download As...' />
    <Dropdown.Item text='Publish To Web' />
    {/* item text can also be defined as children */}
    <Dropdown.Item>E-mail Collaborators</Dropdown.Item>
  </Dropdown.Menu>
</Dropdown>

image

There are known limitations. Sub menus are not supported. Fixes #346

@codecov-io
Copy link

Current coverage is 92.57% (diff: 100%)

No coverage report found for master at f1c7795.

Powered by Codecov. Last update f1c7795...0ae0ba8

@levithomason
Copy link
Member Author

levithomason commented Jul 23, 2016

@tslater could you install this branch and see if it works for you? Note there is a slight difference from the example you previously followed. The first child to a Dropdown must be a Dropdown.Menu.

npm i TechnologyAdvice/stardust#feature/dropdown-menu

If you do this ^ you'd have to build it as well.

@tslater
Copy link
Contributor

tslater commented Jul 23, 2016

Ok. i'll try it. Thanks!

@levithomason
Copy link
Member Author

It seems building from a branch in this way is somewhat difficult. I have tests for the functionality and I've also written a doc site example and test that manually. I'm going to just ship this as a minor version so you can install it from NPM normally.

@levithomason levithomason merged commit 353ba08 into master Jul 23, 2016
@levithomason levithomason deleted the feature/dropdown-menu branch July 23, 2016 17:55
@levithomason
Copy link
Member Author

Released in v0.27.0.

@tslater
Copy link
Contributor

tslater commented Jul 23, 2016

Awesome. I got it imported and it looks like it's working so far. Thanks so much.

@levithomason
Copy link
Member Author

👍 Glad it worked out!

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

Successfully merging this pull request may close these issues.

3 participants