feat(Button): consume Penta tokens and update examples#9934
feat(Button): consume Penta tokens and update examples#9934tlabaj merged 4 commits intopatternfly:v6from
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; |
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Approved! Good to have you back @adamviktora !
I get it now. Naming is hard, |
tlabaj
left a comment
There was a problem hiding this comment.
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.
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.
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.
Oh, I did not realize that when it is marked as xtest and not test that it means the test is disabled.
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
|
@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?
|
|
Your changes have been released in:
Thanks for your contribution! 🎉 |




What: Closes #9907
This is a followup to a core PR: patternfly/patternfly#6127
isActiveprop toisClicked, codemod issue followup: Button - Penta updates pf-codemods#546hasNoPaddingprop,statefulvariant +statepropFlexso buttons are not that tight next to each other