-
Notifications
You must be signed in to change notification settings - Fork 639
Update Token
close button sizing
#7017
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
update token close button sizing |
Binary file modified
BIN
-490 Bytes
(98%)
...rol.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-565 Bytes
(97%)
...Control.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-486 Bytes
(98%)
....test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-490 Bytes
(98%)
...ts/FormControl.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-490 Bytes
(98%)
...rol.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-603 Bytes
(97%)
...ol.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-311 Bytes
(99%)
...test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-603 Bytes
(97%)
...s/FormControl.test.ts-snapshots/FormControl-With-Complex-Inputs-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 modified
BIN
-603 Bytes
(97%)
...ol.test.ts-snapshots/FormControl-With-Complex-Inputs-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.
Binary file modified
BIN
-1.24 KB
(88%)
...hTokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.38 KB
(87%)
...tWithTokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.67 KB
(84%)
...kens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.24 KB
(88%)
...extInputWithTokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.24 KB
(88%)
...hTokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.45 KB
(86%)
...Tokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.68 KB
(84%)
...ens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.45 KB
(86%)
...xtInputWithTokens.test.ts-snapshots/TextInputWithTokens-Default-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 modified
BIN
-1.45 KB
(86%)
...Tokens.test.ts-snapshots/TextInputWithTokens-Default-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.
Binary file modified
BIN
-428 Bytes
(97%)
...kens.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-494 Bytes
(96%)
...thTokens.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-847 Bytes
(94%)
...s.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-428 Bytes
(97%)
...InputWithTokens.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-428 Bytes
(97%)
...kens.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-400 Bytes
(97%)
...ens.test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-703 Bytes
(95%)
....test.ts-snapshots/TextInputWithTokens-Max-Height-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 modified
BIN
-400 Bytes
(97%)
...nputWithTokens.test.ts-snapshots/TextInputWithTokens-Max-Height-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-400 Bytes
(97%)
...ens.test.ts-snapshots/TextInputWithTokens-Max-Height-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-282 Bytes
(97%)
...hots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-323 Bytes
(97%)
...napshots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-424 Bytes
(95%)
...s/TextInputWithTokens-Prevent-Tokens-From-Wrapping-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-282 Bytes
(97%)
...st.ts-snapshots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-282 Bytes
(97%)
...hots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-235 Bytes
(98%)
...ots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-423 Bytes
(95%)
.../TextInputWithTokens-Prevent-Tokens-From-Wrapping-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-235 Bytes
(98%)
...t.ts-snapshots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-235 Bytes
(98%)
...ots/TextInputWithTokens-Prevent-Tokens-From-Wrapping-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-298 Bytes
(97%)
...okens.test.ts-snapshots/TextInputWithTokens-Truncated-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-361 Bytes
(97%)
...ithTokens.test.ts-snapshots/TextInputWithTokens-Truncated-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-659 Bytes
(94%)
...ns.test.ts-snapshots/TextInputWithTokens-Truncated-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-298 Bytes
(97%)
...tInputWithTokens.test.ts-snapshots/TextInputWithTokens-Truncated-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-298 Bytes
(97%)
...okens.test.ts-snapshots/TextInputWithTokens-Truncated-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-423 Bytes
(96%)
...kens.test.ts-snapshots/TextInputWithTokens-Truncated-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-457 Bytes
(96%)
...s.test.ts-snapshots/TextInputWithTokens-Truncated-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-423 Bytes
(96%)
...InputWithTokens.test.ts-snapshots/TextInputWithTokens-Truncated-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-423 Bytes
(96%)
...kens.test.ts-snapshots/TextInputWithTokens-Truncated-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.38 KB
(87%)
....ts-snapshots/TextInputWithTokens-With-Leading-Visual-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.46 KB
(86%)
...test.ts-snapshots/TextInputWithTokens-With-Leading-Visual-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.74 KB
(84%)
...-snapshots/TextInputWithTokens-With-Leading-Visual-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.38 KB
(87%)
...Tokens.test.ts-snapshots/TextInputWithTokens-With-Leading-Visual-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.38 KB
(87%)
....ts-snapshots/TextInputWithTokens-With-Leading-Visual-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.49 KB
(86%)
...ts-snapshots/TextInputWithTokens-With-Leading-Visual-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.78 KB
(84%)
...snapshots/TextInputWithTokens-With-Leading-Visual-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.49 KB
(86%)
...okens.test.ts-snapshots/TextInputWithTokens-With-Leading-Visual-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.49 KB
(86%)
...ts-snapshots/TextInputWithTokens-With-Leading-Visual-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.26 KB
(88%)
...ts-snapshots/TextInputWithTokens-With-Trailing-Visual-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.4 KB
(87%)
...est.ts-snapshots/TextInputWithTokens-With-Trailing-Visual-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-352 Bytes
(96%)
...snapshots/TextInputWithTokens-With-Trailing-Visual-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.26 KB
(88%)
...okens.test.ts-snapshots/TextInputWithTokens-With-Trailing-Visual-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.26 KB
(88%)
...ts-snapshots/TextInputWithTokens-With-Trailing-Visual-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.42 KB
(87%)
...s-snapshots/TextInputWithTokens-With-Trailing-Visual-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-453 Bytes
(95%)
...napshots/TextInputWithTokens-With-Trailing-Visual-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.42 KB
(87%)
...kens.test.ts-snapshots/TextInputWithTokens-With-Trailing-Visual-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.42 KB
(87%)
...s-snapshots/TextInputWithTokens-With-Trailing-Visual-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-352 Bytes
(95%)
...pshots/Token-Default-IssueLabelToken-with-onRemove-fn-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-311 Bytes
(95%)
...-snapshots/Token-Default-IssueLabelToken-with-onRemove-fn-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-324 Bytes
(95%)
...ots/Token-Default-IssueLabelToken-with-onRemove-fn-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-352 Bytes
(95%)
...test.ts-snapshots/Token-Default-IssueLabelToken-with-onRemove-fn-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-352 Bytes
(95%)
...pshots/Token-Default-IssueLabelToken-with-onRemove-fn-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-457 Bytes
(93%)
...shots/Token-Default-IssueLabelToken-with-onRemove-fn-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-457 Bytes
(93%)
...ts/Token-Default-IssueLabelToken-with-onRemove-fn-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-457 Bytes
(93%)
...est.ts-snapshots/Token-Default-IssueLabelToken-with-onRemove-fn-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-457 Bytes
(93%)
...shots/Token-Default-IssueLabelToken-with-onRemove-fn-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-335 Bytes
(95%)
...est.ts-snapshots/Token-Default-Token-with-onRemove-fn-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-334 Bytes
(95%)
...en.test.ts-snapshots/Token-Default-Token-with-onRemove-fn-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-305 Bytes
(96%)
....ts-snapshots/Token-Default-Token-with-onRemove-fn-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-335 Bytes
(95%)
...nts/Token.test.ts-snapshots/Token-Default-Token-with-onRemove-fn-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-335 Bytes
(95%)
...est.ts-snapshots/Token-Default-Token-with-onRemove-fn-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-319 Bytes
(95%)
...st.ts-snapshots/Token-Default-Token-with-onRemove-fn-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-302 Bytes
(96%)
...ts-snapshots/Token-Default-Token-with-onRemove-fn-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-319 Bytes
(95%)
...ts/Token.test.ts-snapshots/Token-Default-Token-with-onRemove-fn-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-319 Bytes
(95%)
...st.ts-snapshots/Token-Default-Token-with-onRemove-fn-light-tritanopia-linux.png
Oops, something went wrong.
2,528 changes: 1,264 additions & 1,264 deletions
2,528
packages/react/src/TextInputWithTokens/__snapshots__/TextInputWithTokens.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ import type React from 'react' | |
import {XIcon} from '@primer/octicons-react' | ||
import {clsx} from 'clsx' | ||
import type {TokenSizeKeys} from './TokenBase' | ||
import {tokenSizes, defaultTokenSize} from './TokenBase' | ||
import {defaultTokenSize} from './TokenBase' | ||
|
||
import classes from './_RemoveTokenButton.module.css' | ||
|
||
|
@@ -12,8 +12,6 @@ interface TokenButtonProps { | |
isParentInteractive?: boolean | ||
} | ||
|
||
const getTokenButtonIconSize = (size?: TokenSizeKeys) => parseInt(tokenSizes[size || defaultTokenSize], 10) * 0.75 | ||
|
||
type RemoveTokenButtonProps = TokenButtonProps & Omit<React.HTMLProps<HTMLSpanElement | HTMLButtonElement>, 'size'> | ||
|
||
const RemoveTokenButton = ({ | ||
|
@@ -39,7 +37,7 @@ const RemoveTokenButton = ({ | |
transform: `translate(${borderOffset}px, -${borderOffset}px)`, | ||
}} | ||
> | ||
<XIcon size={getTokenButtonIconSize(size)} /> | ||
<XIcon size={size === 'small' || size === 'medium' || size === 'large' ? 12 : 16} /> | ||
</span> | ||
) | ||
} | ||
|
@@ -56,7 +54,7 @@ const RemoveTokenButton = ({ | |
ref={rest.ref as React.Ref<HTMLButtonElement>} | ||
type="button" | ||
> | ||
<XIcon size={getTokenButtonIconSize(size)} /> | ||
<XIcon size={size === 'small' || size === 'medium' || size === 'large' ? 12 : 16} /> | ||
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. [nitpick] This duplicates the same conditional logic from line 40. Consider extracting this into a shared function or constant to avoid code duplication. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
</button> | ||
) | ||
} | ||
|
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.
[nitpick] The repeated conditional logic for icon sizing could be extracted into a helper function or constant mapping for better maintainability and consistency.
Copilot uses AI. Check for mistakes.