minishouyin/node_modules/antd/lib/button/style/token.d.ts

243 lines
7.0 KiB
TypeScript
Raw Normal View History

2025-11-12 11:35:57 +08:00
import type { CSSProperties } from 'react';
import type { FullToken, GenStyleFn, GetDefaultToken, PresetColorKey } from '../../theme/internal';
/** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken {
/**
* @desc
* @descEN Font weight of text
*/
fontWeight: CSSProperties['fontWeight'];
/**
* @desc
* @descEN Gap between icon and text
*/
iconGap: CSSProperties['gap'];
/**
* @desc
* @descEN Shadow of default button
*/
defaultShadow: string;
/**
* @desc
* @descEN Shadow of primary button
*/
primaryShadow: string;
/**
* @desc
* @descEN Shadow of danger button
*/
dangerShadow: string;
/**
* @desc
* @descEN Text color of primary button
*/
primaryColor: string;
/**
* @desc
* @descEN Text color of default button
*/
defaultColor: string;
/**
* @desc
* @descEN Background color of default button
*/
defaultBg: string;
/**
* @desc
* @descEN Border color of default button
*/
defaultBorderColor: string;
/**
* @desc
* @descEN Text color of danger button
*/
dangerColor: string;
/**
* @desc
* @descEN Background color of default button when hover
*/
defaultHoverBg: string;
/**
* @desc
* @descEN Text color of default button when hover
*/
defaultHoverColor: string;
/**
* @desc
* @descEN Border color of default button
*/
defaultHoverBorderColor: string;
/**
* @desc
* @descEN Background color of default button when active
*/
defaultActiveBg: string;
/**
* @desc
* @descEN Text color of default button when active
*/
defaultActiveColor: string;
/**
* @desc
* @descEN Border color of default button when active
*/
defaultActiveBorderColor: string;
/**
* @desc
* @descEN Border color of disabled button
*/
borderColorDisabled: string;
/**
* @desc
* @descEN Text color of default ghost button
*/
defaultGhostColor: string;
/**
* @desc
* @descEN Background color of ghost button
*/
ghostBg: string;
/**
* @desc
* @descEN Border color of default ghost button
*/
defaultGhostBorderColor: string;
/**
* @desc
* @descEN Background color of primary filled button
*/
/**
* @desc
* @descEN Default text color for solid buttons.
*/
solidTextColor: string;
/**
* @desc
* @descEN Default text color for text buttons
*/
textTextColor: string;
/**
* @desc
* @descEN Default text color for text buttons on hover
*/
textTextHoverColor: string;
/**
* @desc
* @descEN Default text color for text buttons on active
*/
textTextActiveColor: string;
/**
* @desc
* @descEN Horizontal padding of button
*/
paddingInline: CSSProperties['paddingInline'];
/**
* @desc
* @descEN Horizontal padding of large button
*/
paddingInlineLG: CSSProperties['paddingInline'];
/**
* @desc
* @descEN Horizontal padding of small button
*/
paddingInlineSM: CSSProperties['paddingInline'];
/**
* @desc
* @descEN Vertical padding of button
*/
paddingBlock: CSSProperties['paddingBlock'];
/**
* @desc
* @descEN Vertical padding of large button
*/
paddingBlockLG: CSSProperties['paddingBlock'];
/**
* @desc
* @descEN Vertical padding of small button
*/
paddingBlockSM: CSSProperties['paddingBlock'];
/**
* @desc
* @descEN Icon size of button which only contains icon
*/
onlyIconSize: number | string;
/**
* @desc
* @descEN Icon size of large button which only contains icon
*/
onlyIconSizeLG: number | string;
/**
* @desc
* @descEN Icon size of small button which only contains icon
*/
onlyIconSizeSM: number | string;
/**
* @desc
* @descEN Border color of button group
*/
groupBorderColor: string;
/**
* @desc
* @descEN Background color of link button when hover
*/
linkHoverBg: string;
/**
* @desc
* @descEN Background color of text button when hover
*/
textHoverBg: string;
/**
* @desc
* @descEN Font size of button content
*/
contentFontSize: number;
/**
* @desc
* @descEN Font size of large button content
*/
contentFontSizeLG: number;
/**
* @desc
* @descEN Font size of small button content
*/
contentFontSizeSM: number;
/**
* @desc
* @descEN Line height of button content
*/
contentLineHeight: number;
/**
* @desc
* @descEN Line height of large button content
*/
contentLineHeightLG: number;
/**
* @desc
* @descEN Line height of small button content
*/
contentLineHeightSM: number;
}
type ShadowColorMap = {
[Key in `${PresetColorKey}ShadowColor`]: string;
};
export interface ButtonToken extends FullToken<'Button'>, ShadowColorMap {
/**
* @desc
* @descEN Horizontal padding of button
*/
buttonPaddingHorizontal: CSSProperties['paddingInline'];
/**
* @desc
* @descEN Vertical padding of button
*/
buttonPaddingVertical: CSSProperties['paddingBlock'];
/**
* @desc
* @descEN Icon size of button which only contains icon
*/
buttonIconOnlyFontSize: number | string;
}
export declare const prepareToken: (token: Parameters<GenStyleFn<'Button'>>[0]) => ButtonToken;
export declare const prepareComponentToken: GetDefaultToken<'Button'>;
export {};