chore: change Segmented token name (#46688)

* chore: change Segmented token name

* chore: change Segmented token name
This commit is contained in:
afc163 2023-12-29 16:25:01 +08:00 committed by GitHub
parent 37e615228d
commit 87adc388d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,15 +37,15 @@ export interface ComponentToken {
*/
itemSelectedColor: string;
/**
* @desc Segmented padding
* @descEN Padding of Segmented control
* @desc Segmented padding
* @descEN Padding of Segmented container
*/
controlPadding: string | number;
trackPadding: string | number;
/**
* @desc Segmented padding
* @descEN Padding of Segmented control
* @desc Segmented
* @descEN Background of Segmented container
*/
controlBg: string;
trackBg: string;
}
interface SegmentedToken extends FullToken<'Segmented'> {
@ -82,15 +82,15 @@ const genSegmentedStyle: GenerateStyle<SegmentedToken> = (token: SegmentedToken)
const labelHeight = token
.calc(token.controlHeight)
.sub(token.calc(token.controlPadding).mul(2))
.sub(token.calc(token.trackPadding).mul(2))
.equal();
const labelHeightLG = token
.calc(token.controlHeightLG)
.sub(token.calc(token.controlPadding).mul(2))
.sub(token.calc(token.trackPadding).mul(2))
.equal();
const labelHeightSM = token
.calc(token.controlHeightSM)
.sub(token.calc(token.controlPadding).mul(2))
.sub(token.calc(token.trackPadding).mul(2))
.equal();
return {
@ -98,9 +98,9 @@ const genSegmentedStyle: GenerateStyle<SegmentedToken> = (token: SegmentedToken)
...resetComponent(token),
display: 'inline-block',
padding: token.controlPadding,
padding: token.trackPadding,
color: token.itemColor,
backgroundColor: token.controlBg,
background: token.trackBg,
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
@ -262,8 +262,8 @@ export const prepareComponentToken: GetDefaultToken<'Segmented'> = (token) => {
colorBgLayout,
} = token;
return {
controlPadding: lineWidthBold,
controlBg: colorBgLayout,
trackPadding: lineWidthBold,
trackBg: colorBgLayout,
itemColor: colorTextLabel,
itemHoverColor: colorText,
itemHoverBg: colorFillSecondary,