-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(tabs): Add new tab variant for draggable tabs #74867
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
Changes from all commits
66ad96a
5ac2ab8
d78cd4b
285009f
6b97593
e1a5d4e
f59efbc
75954c7
4e3a182
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,11 @@ import {defined} from 'sentry/utils'; | |
| interface StateLayerProps extends React.HTMLAttributes<HTMLSpanElement> { | ||
| as?: React.ElementType; | ||
| color?: string; | ||
| /** | ||
| * Controls if the opacity is increased when the element is in a | ||
| * selected or expanded state (aria-selected='true' or aria-expanded='true') | ||
| */ | ||
| hasSelectedBackground?: boolean; | ||
| higherOpacity?: boolean; | ||
| isHovered?: boolean; | ||
| isPressed?: boolean; | ||
|
|
@@ -65,11 +70,16 @@ const InteractionStateLayer = styled( | |
| ` | ||
| : // If isPressed is undefined, then fallback to default press selectors | ||
| css` | ||
| *:active > &&, | ||
| *[aria-expanded='true'] > &&, | ||
| *[aria-selected='true'] > && { | ||
| *:active > && { | ||
| opacity: ${p.higherOpacity ? 0.12 : 0.09}; | ||
| } | ||
| ${p.hasSelectedBackground && | ||
| css` | ||
| *[aria-expanded='true'] > &&, | ||
| *[aria-selected='true'] > && { | ||
| opacity: ${p.higherOpacity ? 0.12 : 0.09}; | ||
| } | ||
| `} | ||
| `} | ||
|
|
||
|
|
||
|
|
@@ -79,4 +89,8 @@ const InteractionStateLayer = styled( | |
| } | ||
| `; | ||
|
|
||
| InteractionStateLayer.defaultProps = { | ||
| hasSelectedBackground: true, | ||
| }; | ||
|
Comment on lines
+92
to
+94
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how default props have to be defined apparently 🫠 (setting
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see, because it's a styled component I guess |
||
|
|
||
| export default InteractionStateLayer; | ||
Uh oh!
There was an error while loading. Please reload this page.