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: storybook for Icon component #10515

Merged
merged 6 commits into from
Aug 5, 2020

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Aug 4, 2020

SUMMARY

Adds a storybook entry for the Icon component, and puts that Icon component in a folder.

Sadly, the knobs for the color palette are relying on the SupersetTheme... I was having some issues getting withTheme to work here, but I'd rather use the ThemeProvider to do this. I'll give that another shot later, as it'll be handy in other stories, I'm sure.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

export const SupersetIcon = () => {
return (
<>
{Object.keys(iconsRegistry).map(iconName => (
Copy link
Member

Choose a reason for hiding this comment

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

A bit of a nit, do you think we could display these icons in such a way that they take up a bit less space? I've liked a design like this lately: https://airbnb.io/lunar/?path=/story/icons--icon-gallery

{Object.keys(iconsRegistry).map(iconName => (
<>
{iconName}: <br />
<Icon
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a knob for size as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... I don't see a size prop in use in the codebase, or explicitly supported by the Icon component.

Copy link
Member Author

Choose a reason for hiding this comment

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

Otherwise, I'm down to add knobs for all the things

Copy link
Member

Choose a reason for hiding this comment

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

width and height are svg props which can be passed into the Icon component, along with viewBox to properly scale to svg.

Copy link
Member

Choose a reason for hiding this comment

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

perhaps we should consider abstracting width, height, and viewBox away into a size prop? But regardless, that's for a future pr. This is good as is then

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

🏷 svg

@mistercrunch
Copy link
Member

Oh the label bot is working again!? Came back to life!?!?!!

About the storybook, I'd go for much more density, maybe in a grid? Small text?

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

Ok, icons are now in a nice little grid... sorry for being a lazy bum :P

And hooray label bot!

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

I also sorted the icons alphabetically, so it doesn't hurt people's brains.

@mistercrunch
Copy link
Member

🏷️ storybook

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

🏷 storybook

@mistercrunch
Copy link
Member

WHAT? bot only listens to you!?

@mistercrunch
Copy link
Member

🗑️ 🏷️ storybook

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

🗑🏷 svg

@superset-github-bot superset-github-bot bot removed the svg label Aug 5, 2020
@mistercrunch
Copy link
Member

🏷️ .ui

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

mad panda

@mistercrunch
Copy link
Member

That's super offensive. Bot revolts against its maker.

@rusackas
Copy link
Member Author

rusackas commented Aug 5, 2020

I'll go tag some random PR I'm NOT the author of to see if it works there.

@mistercrunch
Copy link
Member

🏷️ css

@rusackas rusackas merged commit 3d74c3c into apache:master Aug 5, 2020
@rusackas rusackas deleted the storybook-for-icon branch August 5, 2020 05:39
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
* storybook for Icon component

* fixing webpack aliases

* linting ✨

* Icons are now in a nice little grid.

* lint

* EOF fix for alert.txt. Ugh.
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* storybook for Icon component

* fixing webpack aliases

* linting ✨

* Icons are now in a nice little grid.

* lint

* EOF fix for alert.txt. Ugh.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants