-
Notifications
You must be signed in to change notification settings - Fork 357
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(Button): consume Penta tokens and update examples #9934
Conversation
Preview: https://patternfly-react-pr-9934.surge.sh A11y report: https://patternfly-react-pr-9934-a11y.surge.sh |
can we open a code mod issue to track this breaking change? |
sure! codemod followup: patternfly/pf-codemods#546 |
How is |
hey @jeff-phillips-18! With v6/penta, we introduced tokens (global vars) for colors and borders and stuff that we're currently calling "clicked" (you can see here, just look for One issue with calling it "active" is we have modifiers classes for certain things to apply the hover/focus/active styling when the thing isn't actually hovered/focused/active. Eg, in a typeahead select, the text input in the toggle has actual focus, so when you're using the keyboard to navigate the open menu items, we apply Does that make sense or do you think we should reconsider anything? Naming things is hard, so your feedback is much appreciated! |
/** Sets state of the stateful button variant. Default is "unread" */ | ||
state?: 'read' | 'unread' | 'attention'; | ||
/** Applies no padding on a plain button variant. Use when plain button is placed inline with text */ | ||
noPadding?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! Good to have you back @adamviktora !
I get it now. Naming is hard, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just s few small comments
xtest('Renders with class pf-m-active when isActive = true', () => { | ||
render(<Button isActive>Active Button</Button>); | ||
expect(screen.getByRole('button')).toHaveClass('pf-m-active'); | ||
xtest('Renders with class pf-m-clicked when isClicked = true', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reenable this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there will no longer be the isActive
prop and the pf-m-active
modifier in V6, it is renamed to isClicked
. So I don't think we should reenable that test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you modified it for the isClicked
. Does the test fail? I that why it is still disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened this issue #9989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did not realize that when it is marked as xtest
and not test
that it means the test is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix PR: #10013
packages/react-core/src/components/Button/examples/ButtonAriaDisabled.tsx
Show resolved
Hide resolved
packages/react-core/src/components/Button/examples/ButtonDisabled.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/Button/examples/ButtonStateful.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@mcoker I am noticing a slight difference in the border color of a stateful read button variant when applying the Applying
Focus or hover:
|
Hey @adamviktora, here is the design - it looks like that's intentional? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #9907
This is a followup to a core PR: patternfly/patternfly#6127
isActive
prop toisClicked
, codemod issue followup: Button - Penta updates pf-codemods#546hasNoPadding
prop,stateful
variant +state
propFlex
so buttons are not that tight next to each other