Skip to content

Commit a450139

Browse files
Remove extralarge from Tokens
1 parent 5746c74 commit a450139

File tree

6 files changed

+44
-1361
lines changed

6 files changed

+44
-1361
lines changed

src/TextInputWithTokens/TextInputWithTokens.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ const overflowCountFontSizeMap: Record<TokenSizeKeys, number> = {
6060
small: 0,
6161
medium: 1,
6262
large: 1,
63-
extralarge: 2,
64-
xlarge: 2, // will eventually replace "extralarge" per this ADR: https://github.com/github/primer/blob/main/adrs/2022-02-09-size-naming-guidelines.md
63+
xlarge: 2,
6564
}
6665

6766
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
@@ -240,8 +239,7 @@ function TextInputWithTokensInnerComponent<TokenComponentType extends AnyReactCo
240239
small: 'small',
241240
medium: 'small',
242241
large: 'medium',
243-
extralarge: 'medium',
244-
xlarge: 'medium', // will eventually replace "extralarge" per this ADR: https://github.com/github/primer/blob/main/adrs/2022-02-09-size-naming-guidelines.md
242+
xlarge: 'medium',
245243
}
246244
const showLeadingLoadingIndicator =
247245
loading && (loaderPosition === 'leading' || Boolean(LeadingVisual && loaderPosition !== 'trailing'))

src/Token/Token.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const LeadingVisualContainer: React.FC<React.PropsWithChildren<Pick<TokenBasePro
2525
sx={{
2626
flexShrink: 0,
2727
lineHeight: 0,
28-
marginRight: size && ['large', 'extralarge', 'xlarge'].includes(size) ? 2 : 1,
28+
marginRight: size && ['large', 'xlarge'].includes(size) ? 2 : 1,
2929
}}
3030
>
3131
{children}

src/Token/TokenBase.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@ import {get} from '../constants'
55
import sx, {SxProp} from '../sx'
66
import {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic'
77

8-
// TODO: remove invalid "extralarge" size name in next breaking change
9-
/** @deprecated 'extralarge' to be removed to align with size naming ADR https://github.com/github/primer/blob/main/adrs/2022-02-09-size-naming-guidelines.md **/
10-
type ExtraLarge = 'extralarge'
11-
export type TokenSizeKeys = 'small' | 'medium' | 'large' | 'xlarge' | ExtraLarge
12-
13-
const xlargeSize = '32px'
8+
export type TokenSizeKeys = 'small' | 'medium' | 'large' | 'xlarge'
149

1510
export const tokenSizes: Record<TokenSizeKeys, string> = {
1611
small: '16px',
1712
medium: '20px',
1813
large: '24px',
19-
extralarge: xlargeSize,
20-
xlarge: xlargeSize,
14+
xlarge: '32px',
2115
}
2216

2317
export const defaultTokenSize: TokenSizeKeys = 'medium'
@@ -112,7 +106,6 @@ const variants = variant<
112106
paddingLeft: 2,
113107
paddingRight: 2,
114108
},
115-
extralarge: xlargeVariantStyles,
116109
xlarge: xlargeVariantStyles,
117110
},
118111
})

src/Token/_RemoveTokenButton.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ const variants = variant<{height: string; width: string}, TokenSizeKeys>({
2828
height: tokenSizes.large,
2929
width: tokenSizes.large,
3030
},
31-
extralarge: {
32-
height: tokenSizes.extralarge,
33-
width: tokenSizes.extralarge,
34-
},
35-
// xlarge will eventually replace "extralarge" per this ADR: https://github.com/github/primer/blob/main/adrs/2022-02-09-size-naming-guidelines.md
3631
xlarge: {
3732
height: tokenSizes.xlarge,
3833
width: tokenSizes.xlarge,
@@ -62,7 +57,6 @@ const StyledTokenButton = styled.span<TokenButtonProps & SxProp>`
6257
${props => {
6358
switch (props.size) {
6459
case 'large':
65-
case 'extralarge':
6660
case 'xlarge':
6761
return css`
6862
margin-left: ${get('space.2')};

0 commit comments

Comments
 (0)