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

docs(modal): introduce title-only modal examples #4703

Merged
merged 6 commits into from
Nov 21, 2019

Conversation

asudoh
Copy link
Contributor

@asudoh asudoh commented Nov 18, 2019

Refs #4607.

Changelog

New

  • Stories for title-only modals.

Testing / Reviewing

Testing should make sure modal stories are not broken.

@netlify
Copy link

netlify bot commented Nov 18, 2019

Deploy preview for the-carbon-components ready!

Built with commit 9e8366f

https://deploy-preview-4703--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Nov 18, 2019

Deploy preview for carbon-components-react ready!

Built with commit 9e8366f

https://deploy-preview-4703--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Nov 18, 2019

Deploy preview for carbon-elements ready!

Built with commit 9e8366f

https://deploy-preview-4703--carbon-elements.netlify.com

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

Looking good! This type of modal should still be able to have buttons as well (I didn't see a knob to add/remove them).

Passive modal title as the message. Should be direct and 3 lines or less.
`.trim()
),
modalAriaLabel: text(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a knob?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes so people can test change in the prop.

Copy link
Contributor

Choose a reason for hiding this comment

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

What would they be testing by changing it?

'A label to be read by screen readers on the modal root node'
),
size: select('Size (size)', sizes, 'sm'),
iconDescription: text(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a knob?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes so people can test change in the prop.

@asudoh asudoh requested a review from a team as a code owner November 19, 2019 03:06
@asudoh
Copy link
Contributor Author

asudoh commented Nov 19, 2019

@aagonzales Updated with the option to have buttons. Thanks!

@abbeyhrt
Copy link
Contributor

@asudoh I noticed that in the title-only example, the danger knob doesn't change anything like it does in the other examples, should it?

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

🎉 Looks good!

@@ -153,6 +187,25 @@ storiesOf('Modal', module)
},
}
)
.add(
'Title only',
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance we could have this new example be without knobs? As we're adding stories, might make more sense to drop knob usage as they can make it harder to see how to use the component from the story.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The knobs are still needed for heading content, etc. I think the discussion was around a story variant like this title only example, which was introduced as a story variant instead of a knob.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, not sure I understand. Just was speaking to the Title only example being hard to know how to use because of the knobs. In other words, this snippet doesn't really help an external user understand how to use the component easily as it has the knob abstraction applied to it

image

This is something that's been coming up in our dev channels where we have been talking about not using knobs because they can make it harder to use Storybook as a reference for how to use a component.

Copy link
Contributor Author

@asudoh asudoh Nov 19, 2019

Choose a reason for hiding this comment

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

I see your point about the snippet readability. I'd like to keep the ability to demonstrate different options here, esp. to keep the consistency of other modal demos.

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't to suggest that we have to remove how we demonstrate these options, just was speaking to how we're choosing to demonstrate these options through knobs and how that makes things hard for existing content. Would be great if new content didn't fall into the same problem 👍

Copy link
Contributor Author

@asudoh asudoh Nov 19, 2019

Choose a reason for hiding this comment

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

Do you want to include that to your v11 proposal list? I'd like to keep the knobs usage consistent across other modal stories for this PR, but we can always revisit the pattern in future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely understand 👍 Since it's related to docs, doubt we need to wait for v11 but can be an effort over time to update.

@asudoh
Copy link
Contributor Author

asudoh commented Nov 19, 2019

@abbeyhrt At https://deploy-preview-4703--carbon-components-react.netlify.com/?path=/story/modal--title-only, changing danger knob should change the primary button to danger button. Please let us know if you see it otherwise. Thanks!

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

should we only show the danger knob only when the footer buttons are present? otherwise looks good to me

@asudoh
Copy link
Contributor Author

asudoh commented Nov 20, 2019

Good point @emyarod - Updated.

Copy link
Contributor

@abbeyhrt abbeyhrt left a comment

Choose a reason for hiding this comment

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

Yeah, looks good to me! Sorry for the confusion!

@asudoh asudoh merged commit 62e9186 into carbon-design-system:master Nov 21, 2019
@asudoh asudoh deleted the modal-titleonly branch November 21, 2019 00:19
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.

None yet

6 participants