Skip to content

Commit

Permalink
fix: update cursor for legend (#2087)
Browse files Browse the repository at this point in the history
  • Loading branch information
shleewhite committed Dec 1, 2021
1 parent 926abf3 commit eb7fce3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/tricky-rules-wonder.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/label': patch
'@twilio-paste/core': patch
---

[Label] Update the cursor
10 changes: 9 additions & 1 deletion packages/paste-core/components/label/src/Label.tsx
Expand Up @@ -27,6 +27,14 @@ const Label = React.forwardRef<HTMLLabelElement, LabelProps>(
} else if (variant === 'inverse') {
textColor = 'colorTextInverse';
}

let cursor = 'pointer';
if (disabled) {
cursor = 'not-allowed';
} else if (as === 'legend') {
cursor = 'default';
}

return (
<Box
{...safelySpreadBoxProps(props)}
Expand All @@ -44,7 +52,7 @@ const Label = React.forwardRef<HTMLLabelElement, LabelProps>(
fontWeight="fontWeightBold"
lineHeight="lineHeight30"
color={textColor}
cursor={disabled ? 'not-allowed' : 'pointer'}
cursor={cursor}
ref={ref}
>
<MediaObject verticalAlign="top">
Expand Down

0 comments on commit eb7fce3

Please sign in to comment.