-
Notifications
You must be signed in to change notification settings - Fork 561
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
Adds 'inactive' state to buttons #3812
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
a45f5d5
adds inactive state to button components
mperrotti 557b012
update snapshots
mperrotti f3f0f40
adds changeset
mperrotti 749e57a
Merge branch 'main' into mp/inactive-button
mperrotti 16f34a0
test(vrt): update snapshots
mperrotti 032dc7b
Merge branch 'main' into mp/inactive-button
mperrotti 78d638e
Merge branch 'main' into mp/inactive-button
mperrotti 4f64d94
Merge branch 'main' into mp/inactive-button
mperrotti 38e9cae
Update src/Button/ButtonBase.tsx
mperrotti a6395a9
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti e9f368d
follow-up on resolving merge conflicts
mperrotti 7ee2525
adds new button style for inactive buttons
mperrotti fd935c0
refactors inactive styles, lets disabled style override inactive style
mperrotti 5814f73
adds docs for 'inactive' prop
mperrotti d17ff65
Merge branch 'main' into mp/inactive-button
mperrotti e76533d
Merge branch 'main' into mp/inactive-button
mperrotti 2d40c6a
Merge branch 'main' into mp/inactive-button
mperrotti 466b029
upgrades styled components, fixes hover and active style bugs on inac…
mperrotti e51226a
Merge branch 'mp/inactive-button' of github.com:primer/react into mp/…
mperrotti 83c424b
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti 2f515f9
fix drafts/Button2 inactive implementation
mperrotti 48d08d7
cursor style tweak, update snapshots, update package-lock.json
mperrotti 36b2c53
test(vrt): update snapshots
mperrotti 7820947
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti 1f04313
upgrades @primer/primitives
mperrotti ab5cc5d
Merge branch 'mp/inactive-button' of github.com:primer/react into mp/…
mperrotti 63928f5
Merge branch 'main' into mp/inactive-button
mperrotti 772d196
Merge branch 'main' into mp/inactive-button
mperrotti c019d0e
test next primitives release
mperrotti d48a3e2
upgrades @primer/primitives to 7.15.3
mperrotti bfa9133
updates jest snaps
mperrotti 7c0acc2
test(vrt): update snapshots
mperrotti 80a85da
Merge branch 'main' into mp/inactive-button
mperrotti 5c9ab5a
Merge branch 'main' into mp/inactive-button
ericwbailey 2758520
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti 5e4cba9
Merge branch 'mp/inactive-button' of github.com:primer/react into mp/…
mperrotti 5650687
Merge branch 'main' into mp/inactive-button
mperrotti d4117fa
Merge branch 'main' into mp/inactive-button
mperrotti 4865b69
rm disabled styles
mperrotti d2aeaee
Merge branch 'mp/inactive-button' of github.com:primer/react into mp/…
mperrotti 8d3cd3a
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti fc9d713
preserves border on inactive buttons
mperrotti 737b6ca
test(vrt): update snapshots
mperrotti 05e8b53
Merge branch 'main' of github.com:primer/react into mp/inactive-button
mperrotti 2196c4a
Merge branch 'mp/inactive-button' of github.com:primer/react into mp/…
mperrotti cdfaebe
Merge branch 'main' into mp/inactive-button
mperrotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@primer/react': minor | ||
--- | ||
|
||
Adds an 'inactive' state to buttons. An inactive button looks disabled and has aria-disabled, but it can still be clicked and focused. This was added to support buttons that are broken due to availability issues, but can't be removed from the page. | ||
|
||
<!-- Changed components: Button, Button2, IconButton --> |
Binary file added
BIN
+6.15 KB
...s/components/Button.test.ts-snapshots/Button-Inactive-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.04 KB
...shots/components/Button.test.ts-snapshots/Button-Inactive-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.22 KB
...omponents/Button.test.ts-snapshots/Button-Inactive-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
...ht/snapshots/components/Button.test.ts-snapshots/Button-Inactive-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
...s/components/Button.test.ts-snapshots/Button-Inactive-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
.../components/Button.test.ts-snapshots/Button-Inactive-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
...mponents/Button.test.ts-snapshots/Button-Inactive-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
...t/snapshots/components/Button.test.ts-snapshots/Button-Inactive-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.15 KB
.../components/Button.test.ts-snapshots/Button-Inactive-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Curious, what if we just continue to use
disabled
as a prop but change it to usearia-disabled
instead ofdisabled
across the board?Is this primarily used for the loading state? So it looked disabled but it can be focused.. can it also still be clicked and follow through with the on click action?
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 think there are still rare cases where we want a real
disabled
button.The loading state is one way we can use this pattern, but it's mostly to support "degraded" buttons: https://primer.style/design/ui-patterns/degraded-experiences#indicating-a-button-is-non-functional-without-disabling-it
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 like the general idea of that, but it should come with handling click events with a useful message, which I'm not confident would happen :(
Also fair!