diff --git a/.changeset/wild-llamas-appear.md b/.changeset/wild-llamas-appear.md new file mode 100644 index 00000000000..b5903a974ce --- /dev/null +++ b/.changeset/wild-llamas-appear.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Adds shadow and color change to IssueLabelToken on hover diff --git a/src/Token/IssueLabelToken.tsx b/src/Token/IssueLabelToken.tsx index 5d81939ecc6..cc2d8209c15 100644 --- a/src/Token/IssueLabelToken.tsx +++ b/src/Token/IssueLabelToken.tsx @@ -112,8 +112,24 @@ const IssueLabelToken = forwardRef((props, forwardedRef) => { }, } : {}), + ...(isTokenInteractive(props) + ? { + '&:hover': { + ...(isLightScheme + ? { + backgroundImage: + 'linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)), linear-gradient(rgb(var(--label-r),var(--label-g),var(--label-b)), rgb(var(--label-r),var(--label-g),var(--label-b)))', + } + : { + background: + 'hsla(var(--label-h), calc(var(--label-s) * 1%), calc(calc(var(--label-l) + 10) * 1%), 0.3);', + }), + boxShadow: 'shadow.medium', + }, + } + : {}), } - }, [fillColor, resolvedColorScheme, hideRemoveButton, onRemove, isSelected]) + }, [fillColor, resolvedColorScheme, hideRemoveButton, onRemove, isSelected, props]) return ( { gap: get('space.2'), }} > - + @@ -54,7 +54,12 @@ export const TokenWithOnRemoveFn = () => { }} > - + @@ -77,7 +82,11 @@ export const InteractiveIssueLabelToken = () => { gap: get('space.2'), }} > - + @@ -96,7 +105,12 @@ export const IssueLabelTokenWithOnRemoveFn = () => { }} > - + export const LargeToken = () => export const XLargeToken = () => + +export const IssueLabelTokenCustomColors = () => { + return ( + + + + + + +

Color examples

+ + + + + + + + + + + + + + + + + + + + + +
+ ) +} diff --git a/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap b/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap index 326d560ea91..f2119138454 100644 --- a/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap +++ b/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap @@ -17848,6 +17848,11 @@ exports[`TextInputWithTokens renders with tokens using a custom token component border-color: hsla(var(--label-h),calc(var(--label-s) * 1%),calc((var(--label-l) - 25) * 1%),var(--border-alpha)); } +.c4:hover { + background-image: linear-gradient(rgba(0,0,0,0.15),rgba(0,0,0,0.15)),linear-gradient(rgb(var(--label-r),var(--label-g),var(--label-b)),rgb(var(--label-r),var(--label-g),var(--label-b))); + box-shadow: 0 3px 6px rgba(140,149,159,0.15); +} + .c6 { background-color: transparent; font-family: inherit;