@kingsoft-ai/design 0.1.19 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3150 -2478
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7430 -6241
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/DesignThemeProvider.d.ts +25 -20
- package/dist/types/button/Button.d.ts +4 -19
- package/dist/types/button/Button.style.d.ts +4 -35
- package/dist/types/button/IconButton.d.ts +4 -5
- package/dist/types/button/IconButton.style.d.ts +4 -7
- package/dist/types/button/styled-tokens.d.ts +582 -0
- package/dist/types/button/tokens.d.ts +1 -1
- package/dist/types/button/tokens.types.d.ts +190 -0
- package/dist/types/card/Card.d.ts +0 -6
- package/dist/types/card/Card.style.d.ts +4 -7
- package/dist/types/card/styled-tokens.d.ts +130 -0
- package/dist/types/card/tokens.d.ts +1 -1
- package/dist/types/card/tokens.types.d.ts +48 -0
- package/dist/types/checkbox/Checkbox.d.ts +0 -7
- package/dist/types/checkbox/Checkbox.style.d.ts +29 -7
- package/dist/types/checkbox/CheckboxButton.d.ts +0 -16
- package/dist/types/checkbox/CheckboxButton.style.d.ts +24 -12
- package/dist/types/checkbox/styled-tokens.d.ts +122 -0
- package/dist/types/checkbox/tokens.d.ts +1 -1
- package/dist/types/checkbox/tokens.types.d.ts +39 -0
- package/dist/types/collapse/Collapse.d.ts +2 -34
- package/dist/types/collapse/Collapse.style.d.ts +4 -43
- package/dist/types/collapse/styled-tokens.d.ts +77 -0
- package/dist/types/collapse/tokens.d.ts +1 -1
- package/dist/types/collapse/tokens.types.d.ts +28 -0
- package/dist/types/context/ThemeContext.d.ts +24 -0
- package/dist/types/context/index.d.ts +2 -0
- package/dist/types/floatButton/FloatButton.d.ts +0 -21
- package/dist/types/floatButton/FloatButton.style.d.ts +0 -31
- package/dist/types/floatButton/styled-tokens.d.ts +127 -0
- package/dist/types/floatButton/tokens.d.ts +1 -1
- package/dist/types/floatButton/tokens.types.d.ts +66 -0
- package/dist/types/index.d.ts +5 -4
- package/dist/types/input/Input.d.ts +4 -22
- package/dist/types/input/Input.style.d.ts +4 -48
- package/dist/types/input/styled-tokens.d.ts +147 -0
- package/dist/types/input/tokens.d.ts +1 -1
- package/dist/types/input/tokens.types.d.ts +46 -0
- package/dist/types/link/Link.d.ts +4 -0
- package/dist/types/link/Link.style.d.ts +4 -10
- package/dist/types/link/styled-tokens.d.ts +107 -0
- package/dist/types/link/tokens.d.ts +1 -1
- package/dist/types/link/tokens.types.d.ts +39 -0
- package/dist/types/menu/Menu.d.ts +0 -25
- package/dist/types/menu/Menu.style.d.ts +4 -43
- package/dist/types/menu/MenuItem.d.ts +0 -6
- package/dist/types/menu/styled-tokens.d.ts +217 -0
- package/dist/types/menu/tokens.d.ts +1 -1
- package/dist/types/menu/tokens.types.d.ts +79 -0
- package/dist/types/modal/Modal.d.ts +0 -8
- package/dist/types/modal/Modal.style.d.ts +4 -11
- package/dist/types/modal/styled-tokens.d.ts +370 -0
- package/dist/types/modal/tokens.d.ts +1 -1
- package/dist/types/modal/tokens.types.d.ts +107 -0
- package/dist/types/numberInput/NumberInput.d.ts +2 -22
- package/dist/types/numberInput/NumberInput.style.d.ts +4 -7
- package/dist/types/numberInput/styled-tokens.d.ts +192 -0
- package/dist/types/numberInput/tokens.d.ts +1 -1
- package/dist/types/numberInput/tokens.types.d.ts +65 -0
- package/dist/types/progress/Progress.d.ts +4 -27
- package/dist/types/progress/Progress.style.d.ts +4 -43
- package/dist/types/progress/styled-tokens.d.ts +137 -0
- package/dist/types/progress/tokens.d.ts +3 -0
- package/dist/types/progress/tokens.types.d.ts +52 -0
- package/dist/types/radio/Radio.d.ts +4 -0
- package/dist/types/radio/Radio.style.d.ts +9 -28
- package/dist/types/radio/styled-tokens.d.ts +122 -0
- package/dist/types/radio/tokens.d.ts +1 -1
- package/dist/types/radio/tokens.types.d.ts +41 -0
- package/dist/types/select/Select.style.d.ts +4 -7
- package/dist/types/select/styled-tokens.d.ts +237 -0
- package/dist/types/select/tokens.d.ts +1 -1
- package/dist/types/select/tokens.types.d.ts +72 -0
- package/dist/types/skeleton/Skeleton.style.d.ts +0 -25
- package/dist/types/skeleton/styled-tokens.d.ts +82 -0
- package/dist/types/skeleton/tokens.d.ts +1 -1
- package/dist/types/skeleton/tokens.types.d.ts +31 -0
- package/dist/types/slider/Slider.d.ts +74 -0
- package/dist/types/slider/Slider.style.d.ts +125 -0
- package/dist/types/slider/__tests__/Slider.test.d.ts +13 -0
- package/dist/types/slider/index.d.ts +2 -0
- package/dist/types/slider/styled-tokens.d.ts +252 -0
- package/dist/types/slider/tokens.d.ts +3 -0
- package/dist/types/slider/tokens.types.d.ts +121 -0
- package/dist/types/stepper/Stepper.d.ts +3 -0
- package/dist/types/stepper/Stepper.style.d.ts +4 -7
- package/dist/types/stepper/styled-tokens.d.ts +157 -0
- package/dist/types/stepper/tokens.d.ts +1 -1
- package/dist/types/stepper/tokens.types.d.ts +68 -0
- package/dist/types/switch/Switch.d.ts +4 -35
- package/dist/types/switch/Switch.style.d.ts +4 -56
- package/dist/types/switch/styled-tokens.d.ts +132 -0
- package/dist/types/switch/tokens.d.ts +1 -1
- package/dist/types/switch/tokens.types.d.ts +45 -0
- package/dist/types/table/Table.d.ts +2 -0
- package/dist/types/table/Table.style.d.ts +4 -7
- package/dist/types/table/styled-tokens.d.ts +182 -0
- package/dist/types/table/tokens.d.ts +3 -0
- package/dist/types/table/tokens.types.d.ts +43 -0
- package/dist/types/tag/Tag.d.ts +4 -36
- package/dist/types/tag/Tag.style.d.ts +5 -41
- package/dist/types/tag/styled-tokens.d.ts +140 -0
- package/dist/types/tag/tokens.d.ts +1 -1
- package/dist/types/tag/tokens.types.d.ts +76 -0
- package/dist/types/theme.d.ts +1 -2
- package/dist/types/tooltip/Tooltip.d.ts +0 -18
- package/dist/types/tooltip/Tooltip.style.d.ts +0 -19
- package/dist/types/tooltip/styled-tokens.d.ts +72 -0
- package/dist/types/tooltip/tokens.d.ts +1 -1
- package/dist/types/tooltip/tokens.types.d.ts +21 -0
- package/dist/types/transfer/Transfer.d.ts +0 -20
- package/dist/types/transfer/Transfer.style.d.ts +0 -10
- package/dist/types/transfer/styled-tokens.d.ts +252 -0
- package/dist/types/transfer/tokens.d.ts +1 -1
- package/dist/types/transfer/tokens.types.d.ts +79 -0
- package/dist/types/types/index.d.ts +64 -4
- package/dist/types/upload/Upload.d.ts +2 -21
- package/dist/types/upload/Upload.style.d.ts +4 -64
- package/dist/types/upload/styled-tokens.d.ts +227 -0
- package/dist/types/upload/tokens.d.ts +3 -0
- package/dist/types/upload/tokens.types.d.ts +66 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/styled-token.d.ts +117 -0
- package/package.json +5 -4
- package/dist/styles.css +0 -1
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - Tier 3 (Component): 组件专用 Token
|
|
8
8
|
*/
|
|
9
9
|
import { TokenGenerator } from '../types/theme-utils';
|
|
10
|
-
import { ModalTokens } from '
|
|
10
|
+
import { ModalTokens } from './tokens.types';
|
|
11
11
|
export declare const getModalTokens: TokenGenerator<ModalTokens>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal 组件 Token 类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface ModalTokens {
|
|
5
|
+
size: {
|
|
6
|
+
sm: {
|
|
7
|
+
width: string;
|
|
8
|
+
maxWidth: string;
|
|
9
|
+
padding: string;
|
|
10
|
+
headerPadding: string;
|
|
11
|
+
footerPadding: string;
|
|
12
|
+
titleFontSize: string;
|
|
13
|
+
};
|
|
14
|
+
md: {
|
|
15
|
+
width: string;
|
|
16
|
+
maxWidth: string;
|
|
17
|
+
padding: string;
|
|
18
|
+
headerPadding: string;
|
|
19
|
+
footerPadding: string;
|
|
20
|
+
titleFontSize: string;
|
|
21
|
+
};
|
|
22
|
+
lg: {
|
|
23
|
+
width: string;
|
|
24
|
+
maxWidth: string;
|
|
25
|
+
padding: string;
|
|
26
|
+
headerPadding: string;
|
|
27
|
+
footerPadding: string;
|
|
28
|
+
titleFontSize: string;
|
|
29
|
+
};
|
|
30
|
+
xl: {
|
|
31
|
+
width: string;
|
|
32
|
+
maxWidth: string;
|
|
33
|
+
padding: string;
|
|
34
|
+
headerPadding: string;
|
|
35
|
+
footerPadding: string;
|
|
36
|
+
titleFontSize: string;
|
|
37
|
+
};
|
|
38
|
+
fullscreen: {
|
|
39
|
+
width: string;
|
|
40
|
+
maxWidth: string;
|
|
41
|
+
padding: string;
|
|
42
|
+
headerPadding: string;
|
|
43
|
+
footerPadding: string;
|
|
44
|
+
titleFontSize: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
overlay: {
|
|
48
|
+
background: string;
|
|
49
|
+
backdropFilter: string;
|
|
50
|
+
};
|
|
51
|
+
container: {
|
|
52
|
+
background: string;
|
|
53
|
+
borderRadius: string;
|
|
54
|
+
boxShadow: string;
|
|
55
|
+
border: string;
|
|
56
|
+
maxHeight: string;
|
|
57
|
+
};
|
|
58
|
+
header: {
|
|
59
|
+
background: string;
|
|
60
|
+
borderBottom: string;
|
|
61
|
+
minHeight: string;
|
|
62
|
+
gap: string;
|
|
63
|
+
};
|
|
64
|
+
title: {
|
|
65
|
+
color: string;
|
|
66
|
+
fontWeight: number;
|
|
67
|
+
lineHeight: string;
|
|
68
|
+
};
|
|
69
|
+
description: {
|
|
70
|
+
color: string;
|
|
71
|
+
fontSize: string;
|
|
72
|
+
lineHeight: string;
|
|
73
|
+
marginTop: string;
|
|
74
|
+
};
|
|
75
|
+
closeButton: {
|
|
76
|
+
size: string;
|
|
77
|
+
iconSize: string;
|
|
78
|
+
color: string;
|
|
79
|
+
hoverColor: string;
|
|
80
|
+
hoverBackground: string;
|
|
81
|
+
borderRadius: string;
|
|
82
|
+
};
|
|
83
|
+
content: {
|
|
84
|
+
color: string;
|
|
85
|
+
fontSize: string;
|
|
86
|
+
lineHeight: string;
|
|
87
|
+
maxHeight: string;
|
|
88
|
+
};
|
|
89
|
+
footer: {
|
|
90
|
+
background: string;
|
|
91
|
+
borderTop: string;
|
|
92
|
+
minHeight: string;
|
|
93
|
+
gap: string;
|
|
94
|
+
justifyContent: string;
|
|
95
|
+
};
|
|
96
|
+
animation: {
|
|
97
|
+
duration: string;
|
|
98
|
+
easing: string;
|
|
99
|
+
scaleFrom: string;
|
|
100
|
+
scaleTo: string;
|
|
101
|
+
};
|
|
102
|
+
zIndex: {
|
|
103
|
+
overlay: number;
|
|
104
|
+
container: number;
|
|
105
|
+
};
|
|
106
|
+
transition: string;
|
|
107
|
+
}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数字输入框组件
|
|
3
|
-
*
|
|
4
|
-
* 基于 react-aria 实现无障碍访问的数字输入框组件
|
|
5
|
-
* 完全符合 Figma 设计稿规范
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* <NumberInput
|
|
10
|
-
* size="md"
|
|
11
|
-
* defaultValue={10}
|
|
12
|
-
* min={0}
|
|
13
|
-
* max={100}
|
|
14
|
-
* step={1}
|
|
15
|
-
* label="数量"
|
|
16
|
-
* description="请输入数量"
|
|
17
|
-
* controls="buttons"
|
|
18
|
-
* onValueChange={(v) => console.log(v)}
|
|
19
|
-
* />
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
1
|
import { type ReactNode, type ChangeEvent } from 'react';
|
|
23
2
|
export type NumberInputProps = {
|
|
24
3
|
/** 初始数值(受控请使用 value) */
|
|
@@ -57,11 +36,12 @@ export type NumberInputProps = {
|
|
|
57
36
|
disabled?: boolean;
|
|
58
37
|
/** 自定义类名 */
|
|
59
38
|
className?: string;
|
|
39
|
+
/** 自定义样式(支持 CSS 变量定制) */
|
|
40
|
+
style?: React.CSSProperties;
|
|
60
41
|
/** 自定义 ID */
|
|
61
42
|
id?: string;
|
|
62
43
|
/** 原生 input onChange 事件(用于表单库等场景) */
|
|
63
44
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
64
45
|
};
|
|
65
|
-
/** 数字输入框组件 */
|
|
66
46
|
export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
67
47
|
export default NumberInput;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NumberInput
|
|
2
|
+
* NumberInput Styled Components
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* - Tier 3 (Component): 组件专用 Token --ksd-number-input-*
|
|
8
|
-
*
|
|
9
|
-
* 无需 ThemeProvider,直接使用 CSS 变量
|
|
4
|
+
* 使用 Styled Token System 实现样式:
|
|
5
|
+
* - JS Token 优先(来自 ThemeProvider,支持用户自定义)
|
|
6
|
+
* - CSS 变量作为 fallback(无 Provider 时的兜底)
|
|
10
7
|
*/
|
|
11
8
|
export declare const NumberRoot: import("@emotion/styled").StyledComponent<{
|
|
12
9
|
theme?: import("@emotion/react").Theme;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberInput Styled Tokens
|
|
3
|
+
*
|
|
4
|
+
* 将 NumberInput 的 JS tokens 与 CSS 变量映射,实现:
|
|
5
|
+
* - 有 ThemeProvider 时:使用 JS token 值(可被用户自定义)
|
|
6
|
+
* - 无 ThemeProvider 时:fallback 到 CSS 变量(基础样式)
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* NumberInput 组件的 Styled Tokens
|
|
10
|
+
*/
|
|
11
|
+
export declare const $numberInput: {
|
|
12
|
+
readonly mdHeight: (props: {
|
|
13
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
14
|
+
_useCSSVariables?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}) => string;
|
|
17
|
+
readonly mdFontSize: (props: {
|
|
18
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
19
|
+
_useCSSVariables?: boolean;
|
|
20
|
+
};
|
|
21
|
+
}) => string;
|
|
22
|
+
readonly mdPaddingInline: (props: {
|
|
23
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
24
|
+
_useCSSVariables?: boolean;
|
|
25
|
+
};
|
|
26
|
+
}) => string;
|
|
27
|
+
readonly lgHeight: (props: {
|
|
28
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
29
|
+
_useCSSVariables?: boolean;
|
|
30
|
+
};
|
|
31
|
+
}) => string;
|
|
32
|
+
readonly lgFontSize: (props: {
|
|
33
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
34
|
+
_useCSSVariables?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}) => string;
|
|
37
|
+
readonly lgPaddingInline: (props: {
|
|
38
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
39
|
+
_useCSSVariables?: boolean;
|
|
40
|
+
};
|
|
41
|
+
}) => string;
|
|
42
|
+
readonly inputWidth: (props: {
|
|
43
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
44
|
+
_useCSSVariables?: boolean;
|
|
45
|
+
};
|
|
46
|
+
}) => string;
|
|
47
|
+
readonly inputHeight: (props: {
|
|
48
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
49
|
+
_useCSSVariables?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}) => string;
|
|
52
|
+
readonly inputPaddingInline: (props: {
|
|
53
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
54
|
+
_useCSSVariables?: boolean;
|
|
55
|
+
};
|
|
56
|
+
}) => string;
|
|
57
|
+
readonly inputFontSize: (props: {
|
|
58
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
59
|
+
_useCSSVariables?: boolean;
|
|
60
|
+
};
|
|
61
|
+
}) => string;
|
|
62
|
+
readonly inputFontWeight: (props: {
|
|
63
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
64
|
+
_useCSSVariables?: boolean;
|
|
65
|
+
};
|
|
66
|
+
}) => string;
|
|
67
|
+
readonly inputLineHeight: (props: {
|
|
68
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
69
|
+
_useCSSVariables?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}) => string;
|
|
72
|
+
readonly controlSideButtonSm: (props: {
|
|
73
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
74
|
+
_useCSSVariables?: boolean;
|
|
75
|
+
};
|
|
76
|
+
}) => string;
|
|
77
|
+
readonly controlSideButtonLg: (props: {
|
|
78
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
79
|
+
_useCSSVariables?: boolean;
|
|
80
|
+
};
|
|
81
|
+
}) => string;
|
|
82
|
+
readonly controlSideInset: (props: {
|
|
83
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
84
|
+
_useCSSVariables?: boolean;
|
|
85
|
+
};
|
|
86
|
+
}) => string;
|
|
87
|
+
readonly controlSideGap: (props: {
|
|
88
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
89
|
+
_useCSSVariables?: boolean;
|
|
90
|
+
};
|
|
91
|
+
}) => string;
|
|
92
|
+
readonly controlSideIconSize: (props: {
|
|
93
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
94
|
+
_useCSSVariables?: boolean;
|
|
95
|
+
};
|
|
96
|
+
}) => string;
|
|
97
|
+
readonly controlSideWidthSm: (props: {
|
|
98
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
99
|
+
_useCSSVariables?: boolean;
|
|
100
|
+
};
|
|
101
|
+
}) => string;
|
|
102
|
+
readonly controlSideWidthLg: (props: {
|
|
103
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
104
|
+
_useCSSVariables?: boolean;
|
|
105
|
+
};
|
|
106
|
+
}) => string;
|
|
107
|
+
readonly controlArrowsButtonSm: (props: {
|
|
108
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
109
|
+
_useCSSVariables?: boolean;
|
|
110
|
+
};
|
|
111
|
+
}) => string;
|
|
112
|
+
readonly controlArrowsButtonLg: (props: {
|
|
113
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
114
|
+
_useCSSVariables?: boolean;
|
|
115
|
+
};
|
|
116
|
+
}) => string;
|
|
117
|
+
readonly controlArrowsIconSize: (props: {
|
|
118
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
119
|
+
_useCSSVariables?: boolean;
|
|
120
|
+
};
|
|
121
|
+
}) => string;
|
|
122
|
+
readonly controlArrowsGap: (props: {
|
|
123
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
124
|
+
_useCSSVariables?: boolean;
|
|
125
|
+
};
|
|
126
|
+
}) => string;
|
|
127
|
+
readonly controlArrowsWidthSm: (props: {
|
|
128
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
129
|
+
_useCSSVariables?: boolean;
|
|
130
|
+
};
|
|
131
|
+
}) => string;
|
|
132
|
+
readonly controlArrowsWidthLg: (props: {
|
|
133
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
134
|
+
_useCSSVariables?: boolean;
|
|
135
|
+
};
|
|
136
|
+
}) => string;
|
|
137
|
+
readonly border: (props: {
|
|
138
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
139
|
+
_useCSSVariables?: boolean;
|
|
140
|
+
};
|
|
141
|
+
}) => string;
|
|
142
|
+
readonly borderHover: (props: {
|
|
143
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
144
|
+
_useCSSVariables?: boolean;
|
|
145
|
+
};
|
|
146
|
+
}) => string;
|
|
147
|
+
readonly borderDisabled: (props: {
|
|
148
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
149
|
+
_useCSSVariables?: boolean;
|
|
150
|
+
};
|
|
151
|
+
}) => string;
|
|
152
|
+
readonly bg: (props: {
|
|
153
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
154
|
+
_useCSSVariables?: boolean;
|
|
155
|
+
};
|
|
156
|
+
}) => string;
|
|
157
|
+
readonly bgHover: (props: {
|
|
158
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
159
|
+
_useCSSVariables?: boolean;
|
|
160
|
+
};
|
|
161
|
+
}) => string;
|
|
162
|
+
readonly bgDisabled: (props: {
|
|
163
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
164
|
+
_useCSSVariables?: boolean;
|
|
165
|
+
};
|
|
166
|
+
}) => string;
|
|
167
|
+
readonly text: (props: {
|
|
168
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
169
|
+
_useCSSVariables?: boolean;
|
|
170
|
+
};
|
|
171
|
+
}) => string;
|
|
172
|
+
readonly textPlaceholder: (props: {
|
|
173
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
174
|
+
_useCSSVariables?: boolean;
|
|
175
|
+
};
|
|
176
|
+
}) => string;
|
|
177
|
+
readonly textDisabled: (props: {
|
|
178
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
179
|
+
_useCSSVariables?: boolean;
|
|
180
|
+
};
|
|
181
|
+
}) => string;
|
|
182
|
+
readonly borderRadius: (props: {
|
|
183
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
184
|
+
_useCSSVariables?: boolean;
|
|
185
|
+
};
|
|
186
|
+
}) => string;
|
|
187
|
+
readonly transition: (props: {
|
|
188
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
189
|
+
_useCSSVariables?: boolean;
|
|
190
|
+
};
|
|
191
|
+
}) => string;
|
|
192
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberField 组件 Token 类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface NumberFieldTokens {
|
|
5
|
+
controls: {
|
|
6
|
+
default: 'buttons' | 'arrows';
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
md: {
|
|
10
|
+
height: string;
|
|
11
|
+
fontSize: string;
|
|
12
|
+
paddingInline: string;
|
|
13
|
+
};
|
|
14
|
+
lg: {
|
|
15
|
+
height: string;
|
|
16
|
+
fontSize: string;
|
|
17
|
+
paddingInline: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
input: {
|
|
21
|
+
width: string;
|
|
22
|
+
height: string;
|
|
23
|
+
paddingInline: string;
|
|
24
|
+
fontSize: string;
|
|
25
|
+
fontWeight: number;
|
|
26
|
+
lineHeight: string;
|
|
27
|
+
fontFamily: string;
|
|
28
|
+
};
|
|
29
|
+
control: {
|
|
30
|
+
side: {
|
|
31
|
+
buttonSizeSm: string;
|
|
32
|
+
buttonSizeLg: string;
|
|
33
|
+
inset: string;
|
|
34
|
+
gap: string;
|
|
35
|
+
iconSize: string;
|
|
36
|
+
widthsm: string;
|
|
37
|
+
widthLg: string;
|
|
38
|
+
};
|
|
39
|
+
arrows: {
|
|
40
|
+
buttonSizeSm: string;
|
|
41
|
+
buttonSizeLg: string;
|
|
42
|
+
iconSize: string;
|
|
43
|
+
gap: string;
|
|
44
|
+
widthsm: string;
|
|
45
|
+
widthLg: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
borderRadius: string;
|
|
49
|
+
border: {
|
|
50
|
+
default: string;
|
|
51
|
+
hover: string;
|
|
52
|
+
disabled: string;
|
|
53
|
+
};
|
|
54
|
+
background: {
|
|
55
|
+
default: string;
|
|
56
|
+
hover: string;
|
|
57
|
+
disabled: string;
|
|
58
|
+
};
|
|
59
|
+
text: {
|
|
60
|
+
default: string;
|
|
61
|
+
placeholder: string;
|
|
62
|
+
disabled: string;
|
|
63
|
+
};
|
|
64
|
+
transition: string;
|
|
65
|
+
}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress 进度条组件
|
|
3
|
-
*
|
|
4
|
-
* 基于 react-aria 实现无障碍访问的进度条组件
|
|
5
|
-
* 完全符合 Figma 设计稿规范
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // 线型进度条
|
|
10
|
-
* <Progress value={60} />
|
|
11
|
-
*
|
|
12
|
-
* // 环形进度条
|
|
13
|
-
* <Progress type="circle" value={80} />
|
|
14
|
-
*
|
|
15
|
-
* // 带状态的进度条
|
|
16
|
-
* <Progress value={100} status="success" />
|
|
17
|
-
*
|
|
18
|
-
* // 不显示百分比
|
|
19
|
-
* <Progress value={60} showPercent={false} />
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
1
|
import type { AriaProgressBarProps } from 'react-aria';
|
|
23
2
|
import { type ProgressType, type ProgressSize, type ProgressStatus } from './Progress.style';
|
|
24
3
|
export declare const TYPES: readonly ["line", "circle"];
|
|
@@ -39,13 +18,9 @@ export type ProgressProps = Omit<AriaProgressBarProps, 'value'> & {
|
|
|
39
18
|
showIcon?: boolean;
|
|
40
19
|
/** 自定义类名 */
|
|
41
20
|
className?: string;
|
|
21
|
+
/** 自定义样式(支持 CSS 变量定制) */
|
|
22
|
+
style?: React.CSSProperties;
|
|
42
23
|
};
|
|
43
|
-
/**
|
|
44
|
-
* Progress 进度条组件
|
|
45
|
-
*
|
|
46
|
-
* 基于 Figma 设计规范实现的进度条组件,支持线型和环形两种类型
|
|
47
|
-
* 使用 react-aria 保证无障碍访问性
|
|
48
|
-
*/
|
|
49
24
|
export declare const Progress: import("react").ForwardRefExoticComponent<Omit<AriaProgressBarProps, "value"> & {
|
|
50
25
|
/** 进度条类型:线型、环形 */
|
|
51
26
|
type?: ProgressType;
|
|
@@ -61,4 +36,6 @@ export declare const Progress: import("react").ForwardRefExoticComponent<Omit<Ar
|
|
|
61
36
|
showIcon?: boolean;
|
|
62
37
|
/** 自定义类名 */
|
|
63
38
|
className?: string;
|
|
39
|
+
/** 自定义样式(支持 CSS 变量定制) */
|
|
40
|
+
style?: React.CSSProperties;
|
|
64
41
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Progress
|
|
2
|
+
* Progress Styled Components
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* - Tier 3 (Component): 组件专用 Token --ksd-progress-*
|
|
8
|
-
*
|
|
9
|
-
* 无需 ThemeProvider,直接使用 CSS 变量
|
|
4
|
+
* 使用 Styled Token System 实现样式:
|
|
5
|
+
* - JS Token 优先(来自 ThemeProvider,支持用户自定义)
|
|
6
|
+
* - CSS 变量作为 fallback(无 Provider 时的兜底)
|
|
10
7
|
*/
|
|
11
8
|
export declare const progressTypes: readonly ["line", "circle"];
|
|
12
9
|
export declare const progressSizes: readonly ["sm", "md", "lg"];
|
|
@@ -14,27 +11,18 @@ export declare const progressStatuses: readonly ["normal", "error", "warning", "
|
|
|
14
11
|
export type ProgressType = (typeof progressTypes)[number];
|
|
15
12
|
export type ProgressSize = (typeof progressSizes)[number];
|
|
16
13
|
export type ProgressStatus = (typeof progressStatuses)[number];
|
|
17
|
-
/**
|
|
18
|
-
* 线型进度条容器
|
|
19
|
-
*/
|
|
20
14
|
export declare const LineProgressRoot: import("@emotion/styled").StyledComponent<{
|
|
21
15
|
theme?: import("@emotion/react").Theme;
|
|
22
16
|
as?: React.ElementType;
|
|
23
17
|
} & {
|
|
24
18
|
size: ProgressSize;
|
|
25
19
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
-
/**
|
|
27
|
-
* 线型进度条轨道
|
|
28
|
-
*/
|
|
29
20
|
export declare const LineProgressTrack: import("@emotion/styled").StyledComponent<{
|
|
30
21
|
theme?: import("@emotion/react").Theme;
|
|
31
22
|
as?: React.ElementType;
|
|
32
23
|
} & {
|
|
33
24
|
size: ProgressSize;
|
|
34
25
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
35
|
-
/**
|
|
36
|
-
* 线型进度条填充
|
|
37
|
-
*/
|
|
38
26
|
export declare const LineProgressBar: import("@emotion/styled").StyledComponent<{
|
|
39
27
|
theme?: import("@emotion/react").Theme;
|
|
40
28
|
as?: React.ElementType;
|
|
@@ -42,73 +30,46 @@ export declare const LineProgressBar: import("@emotion/styled").StyledComponent<
|
|
|
42
30
|
status: ProgressStatus;
|
|
43
31
|
percent: number;
|
|
44
32
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
45
|
-
/**
|
|
46
|
-
* 进度百分比文字
|
|
47
|
-
*/
|
|
48
33
|
export declare const ProgressText: import("@emotion/styled").StyledComponent<{
|
|
49
34
|
theme?: import("@emotion/react").Theme;
|
|
50
35
|
as?: React.ElementType;
|
|
51
36
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
52
|
-
/**
|
|
53
|
-
* 状态图标容器
|
|
54
|
-
*/
|
|
55
37
|
export declare const StatusIcon: import("@emotion/styled").StyledComponent<{
|
|
56
38
|
theme?: import("@emotion/react").Theme;
|
|
57
39
|
as?: React.ElementType;
|
|
58
40
|
} & {
|
|
59
41
|
status: ProgressStatus;
|
|
60
42
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
61
|
-
/**
|
|
62
|
-
* 线型进度条信息区域(百分比+图标)
|
|
63
|
-
*/
|
|
64
43
|
export declare const LineProgressInfo: import("@emotion/styled").StyledComponent<{
|
|
65
44
|
theme?: import("@emotion/react").Theme;
|
|
66
45
|
as?: React.ElementType;
|
|
67
46
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
68
|
-
/**
|
|
69
|
-
* 环形进度条容器
|
|
70
|
-
*/
|
|
71
47
|
export declare const CircleProgressRoot: import("@emotion/styled").StyledComponent<{
|
|
72
48
|
theme?: import("@emotion/react").Theme;
|
|
73
49
|
as?: React.ElementType;
|
|
74
50
|
} & {
|
|
75
51
|
size: ProgressSize;
|
|
76
52
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
77
|
-
/**
|
|
78
|
-
* 环形进度条 SVG
|
|
79
|
-
*/
|
|
80
53
|
export declare const CircleProgressSvg: import("@emotion/styled").StyledComponent<{
|
|
81
54
|
theme?: import("@emotion/react").Theme;
|
|
82
55
|
as?: React.ElementType;
|
|
83
56
|
}, import("react").SVGProps<SVGSVGElement>, {}>;
|
|
84
|
-
/**
|
|
85
|
-
* 环形进度条轨道圆
|
|
86
|
-
*/
|
|
87
57
|
export declare const CircleProgressTrack: import("@emotion/styled").StyledComponent<{
|
|
88
58
|
theme?: import("@emotion/react").Theme;
|
|
89
59
|
as?: React.ElementType;
|
|
90
60
|
}, import("react").SVGProps<SVGCircleElement>, {}>;
|
|
91
|
-
/**
|
|
92
|
-
* 环形进度条填充圆
|
|
93
|
-
*/
|
|
94
61
|
export declare const CircleProgressBar: import("@emotion/styled").StyledComponent<{
|
|
95
62
|
theme?: import("@emotion/react").Theme;
|
|
96
63
|
as?: React.ElementType;
|
|
97
64
|
} & {
|
|
98
65
|
status: ProgressStatus;
|
|
99
66
|
}, import("react").SVGProps<SVGCircleElement>, {}>;
|
|
100
|
-
/**
|
|
101
|
-
* 环形进度条内容(百分比文字或图标)
|
|
102
|
-
*/
|
|
103
67
|
export declare const CircleProgressContent: import("@emotion/styled").StyledComponent<{
|
|
104
68
|
theme?: import("@emotion/react").Theme;
|
|
105
69
|
as?: React.ElementType;
|
|
106
70
|
} & {
|
|
107
71
|
size: ProgressSize;
|
|
108
72
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
109
|
-
/**
|
|
110
|
-
* 小号环形进度条的图标
|
|
111
|
-
*/
|
|
112
73
|
export declare const CircleProgressIcon: import("@emotion/styled").StyledComponent<{
|
|
113
74
|
theme?: import("@emotion/react").Theme;
|
|
114
75
|
as?: React.ElementType;
|