@kingsoft-ai/design 0.1.18 → 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 +7211 -7849
- 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 +14 -13
- package/dist/styles.css +0 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select Styled Tokens
|
|
3
|
+
*
|
|
4
|
+
* 将 Select 的 JS tokens 与 CSS 变量映射,实现:
|
|
5
|
+
* - 有 ThemeProvider 时:使用 JS token 值(可被用户自定义)
|
|
6
|
+
* - 无 ThemeProvider 时:fallback 到 CSS 变量(基础样式)
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Select 组件的 Styled Tokens
|
|
10
|
+
*/
|
|
11
|
+
export declare const $select: {
|
|
12
|
+
readonly smHeight: (props: {
|
|
13
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
14
|
+
_useCSSVariables?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}) => string;
|
|
17
|
+
readonly smFontSize: (props: {
|
|
18
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
19
|
+
_useCSSVariables?: boolean;
|
|
20
|
+
};
|
|
21
|
+
}) => string;
|
|
22
|
+
readonly smPaddingInline: (props: {
|
|
23
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
24
|
+
_useCSSVariables?: boolean;
|
|
25
|
+
};
|
|
26
|
+
}) => string;
|
|
27
|
+
readonly smIconSize: (props: {
|
|
28
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
29
|
+
_useCSSVariables?: boolean;
|
|
30
|
+
};
|
|
31
|
+
}) => string;
|
|
32
|
+
readonly mdHeight: (props: {
|
|
33
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
34
|
+
_useCSSVariables?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}) => string;
|
|
37
|
+
readonly mdFontSize: (props: {
|
|
38
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
39
|
+
_useCSSVariables?: boolean;
|
|
40
|
+
};
|
|
41
|
+
}) => string;
|
|
42
|
+
readonly mdPaddingInline: (props: {
|
|
43
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
44
|
+
_useCSSVariables?: boolean;
|
|
45
|
+
};
|
|
46
|
+
}) => string;
|
|
47
|
+
readonly mdIconSize: (props: {
|
|
48
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
49
|
+
_useCSSVariables?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}) => string;
|
|
52
|
+
readonly lgHeight: (props: {
|
|
53
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
54
|
+
_useCSSVariables?: boolean;
|
|
55
|
+
};
|
|
56
|
+
}) => string;
|
|
57
|
+
readonly lgFontSize: (props: {
|
|
58
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
59
|
+
_useCSSVariables?: boolean;
|
|
60
|
+
};
|
|
61
|
+
}) => string;
|
|
62
|
+
readonly lgPaddingInline: (props: {
|
|
63
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
64
|
+
_useCSSVariables?: boolean;
|
|
65
|
+
};
|
|
66
|
+
}) => string;
|
|
67
|
+
readonly lgIconSize: (props: {
|
|
68
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
69
|
+
_useCSSVariables?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}) => string;
|
|
72
|
+
readonly borderDefault: (props: {
|
|
73
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
74
|
+
_useCSSVariables?: boolean;
|
|
75
|
+
};
|
|
76
|
+
}) => string;
|
|
77
|
+
readonly borderHover: (props: {
|
|
78
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
79
|
+
_useCSSVariables?: boolean;
|
|
80
|
+
};
|
|
81
|
+
}) => string;
|
|
82
|
+
readonly borderFocus: (props: {
|
|
83
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
84
|
+
_useCSSVariables?: boolean;
|
|
85
|
+
};
|
|
86
|
+
}) => string;
|
|
87
|
+
readonly borderError: (props: {
|
|
88
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
89
|
+
_useCSSVariables?: boolean;
|
|
90
|
+
};
|
|
91
|
+
}) => string;
|
|
92
|
+
readonly borderDisabled: (props: {
|
|
93
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
94
|
+
_useCSSVariables?: boolean;
|
|
95
|
+
};
|
|
96
|
+
}) => string;
|
|
97
|
+
readonly bgDefault: (props: {
|
|
98
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
99
|
+
_useCSSVariables?: boolean;
|
|
100
|
+
};
|
|
101
|
+
}) => string;
|
|
102
|
+
readonly bgHover: (props: {
|
|
103
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
104
|
+
_useCSSVariables?: boolean;
|
|
105
|
+
};
|
|
106
|
+
}) => string;
|
|
107
|
+
readonly bgDisabled: (props: {
|
|
108
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
109
|
+
_useCSSVariables?: boolean;
|
|
110
|
+
};
|
|
111
|
+
}) => string;
|
|
112
|
+
readonly textDefault: (props: {
|
|
113
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
114
|
+
_useCSSVariables?: boolean;
|
|
115
|
+
};
|
|
116
|
+
}) => string;
|
|
117
|
+
readonly textPlaceholder: (props: {
|
|
118
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
119
|
+
_useCSSVariables?: boolean;
|
|
120
|
+
};
|
|
121
|
+
}) => string;
|
|
122
|
+
readonly textDisabled: (props: {
|
|
123
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
124
|
+
_useCSSVariables?: boolean;
|
|
125
|
+
};
|
|
126
|
+
}) => string;
|
|
127
|
+
readonly textError: (props: {
|
|
128
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
129
|
+
_useCSSVariables?: boolean;
|
|
130
|
+
};
|
|
131
|
+
}) => string;
|
|
132
|
+
readonly borderRadius: (props: {
|
|
133
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
134
|
+
_useCSSVariables?: boolean;
|
|
135
|
+
};
|
|
136
|
+
}) => string;
|
|
137
|
+
readonly gap: (props: {
|
|
138
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
139
|
+
_useCSSVariables?: boolean;
|
|
140
|
+
};
|
|
141
|
+
}) => string;
|
|
142
|
+
readonly transition: (props: {
|
|
143
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
144
|
+
_useCSSVariables?: boolean;
|
|
145
|
+
};
|
|
146
|
+
}) => string;
|
|
147
|
+
readonly popoverBg: (props: {
|
|
148
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
149
|
+
_useCSSVariables?: boolean;
|
|
150
|
+
};
|
|
151
|
+
}) => string;
|
|
152
|
+
readonly popoverBorder: (props: {
|
|
153
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
154
|
+
_useCSSVariables?: boolean;
|
|
155
|
+
};
|
|
156
|
+
}) => string;
|
|
157
|
+
readonly popoverBorderRadius: (props: {
|
|
158
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
159
|
+
_useCSSVariables?: boolean;
|
|
160
|
+
};
|
|
161
|
+
}) => string;
|
|
162
|
+
readonly popoverShadow: (props: {
|
|
163
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
164
|
+
_useCSSVariables?: boolean;
|
|
165
|
+
};
|
|
166
|
+
}) => string;
|
|
167
|
+
readonly popoverPadding: (props: {
|
|
168
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
169
|
+
_useCSSVariables?: boolean;
|
|
170
|
+
};
|
|
171
|
+
}) => string;
|
|
172
|
+
readonly optionHeight: (props: {
|
|
173
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
174
|
+
_useCSSVariables?: boolean;
|
|
175
|
+
};
|
|
176
|
+
}) => string;
|
|
177
|
+
readonly optionPaddingInline: (props: {
|
|
178
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
179
|
+
_useCSSVariables?: boolean;
|
|
180
|
+
};
|
|
181
|
+
}) => string;
|
|
182
|
+
readonly optionFontSize: (props: {
|
|
183
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
184
|
+
_useCSSVariables?: boolean;
|
|
185
|
+
};
|
|
186
|
+
}) => string;
|
|
187
|
+
readonly optionBorderRadius: (props: {
|
|
188
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
189
|
+
_useCSSVariables?: boolean;
|
|
190
|
+
};
|
|
191
|
+
}) => string;
|
|
192
|
+
readonly optionGap: (props: {
|
|
193
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
194
|
+
_useCSSVariables?: boolean;
|
|
195
|
+
};
|
|
196
|
+
}) => string;
|
|
197
|
+
readonly optionBgDefault: (props: {
|
|
198
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
199
|
+
_useCSSVariables?: boolean;
|
|
200
|
+
};
|
|
201
|
+
}) => string;
|
|
202
|
+
readonly optionBgHover: (props: {
|
|
203
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
204
|
+
_useCSSVariables?: boolean;
|
|
205
|
+
};
|
|
206
|
+
}) => string;
|
|
207
|
+
readonly optionBgSelected: (props: {
|
|
208
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
209
|
+
_useCSSVariables?: boolean;
|
|
210
|
+
};
|
|
211
|
+
}) => string;
|
|
212
|
+
readonly optionBgFocused: (props: {
|
|
213
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
214
|
+
_useCSSVariables?: boolean;
|
|
215
|
+
};
|
|
216
|
+
}) => string;
|
|
217
|
+
readonly optionTextDefault: (props: {
|
|
218
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
219
|
+
_useCSSVariables?: boolean;
|
|
220
|
+
};
|
|
221
|
+
}) => string;
|
|
222
|
+
readonly optionTextHover: (props: {
|
|
223
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
224
|
+
_useCSSVariables?: boolean;
|
|
225
|
+
};
|
|
226
|
+
}) => string;
|
|
227
|
+
readonly optionTextSelected: (props: {
|
|
228
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
229
|
+
_useCSSVariables?: boolean;
|
|
230
|
+
};
|
|
231
|
+
}) => string;
|
|
232
|
+
readonly optionTextDisabled: (props: {
|
|
233
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
234
|
+
_useCSSVariables?: boolean;
|
|
235
|
+
};
|
|
236
|
+
}) => string;
|
|
237
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select 组件 Token 类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface SelectTokens {
|
|
5
|
+
size: {
|
|
6
|
+
sm: {
|
|
7
|
+
height: string;
|
|
8
|
+
fontSize: string;
|
|
9
|
+
paddingInline: string;
|
|
10
|
+
iconSize: string;
|
|
11
|
+
};
|
|
12
|
+
md: {
|
|
13
|
+
height: string;
|
|
14
|
+
fontSize: string;
|
|
15
|
+
paddingInline: string;
|
|
16
|
+
iconSize: string;
|
|
17
|
+
};
|
|
18
|
+
lg: {
|
|
19
|
+
height: string;
|
|
20
|
+
fontSize: string;
|
|
21
|
+
paddingInline: string;
|
|
22
|
+
iconSize: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
border: {
|
|
26
|
+
default: string;
|
|
27
|
+
hover: string;
|
|
28
|
+
focus: string;
|
|
29
|
+
error: string;
|
|
30
|
+
disabled: string;
|
|
31
|
+
};
|
|
32
|
+
background: {
|
|
33
|
+
default: string;
|
|
34
|
+
hover: string;
|
|
35
|
+
disabled: string;
|
|
36
|
+
};
|
|
37
|
+
text: {
|
|
38
|
+
default: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
disabled: string;
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
borderRadius: string;
|
|
44
|
+
gap: string;
|
|
45
|
+
transition: string;
|
|
46
|
+
popover: {
|
|
47
|
+
background: string;
|
|
48
|
+
border: string;
|
|
49
|
+
borderRadius: string;
|
|
50
|
+
boxShadow: string;
|
|
51
|
+
padding: string;
|
|
52
|
+
};
|
|
53
|
+
option: {
|
|
54
|
+
height: string;
|
|
55
|
+
paddingInline: string;
|
|
56
|
+
fontSize: string;
|
|
57
|
+
borderRadius: string;
|
|
58
|
+
gap: string;
|
|
59
|
+
background: {
|
|
60
|
+
default: string;
|
|
61
|
+
hover: string;
|
|
62
|
+
selected: string;
|
|
63
|
+
focused: string;
|
|
64
|
+
};
|
|
65
|
+
text: {
|
|
66
|
+
default: string;
|
|
67
|
+
hover: string;
|
|
68
|
+
selected: string;
|
|
69
|
+
disabled: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skeleton 骨架屏样式
|
|
3
|
-
*
|
|
4
|
-
* 基于 CSS 变量的三层 Token 体系:
|
|
5
|
-
* - Tier 1 (Global): 全局基础值 --ksd-colors-*, --ksd-spacing-*, etc.
|
|
6
|
-
* - Tier 2 (Semantic): 语义化映射 --ksd-brand-*, --ksd-text-*, etc.
|
|
7
|
-
* - Tier 3 (Component): 组件专用 Token --ksd-skeleton-*
|
|
8
|
-
*
|
|
9
|
-
* 无需 ThemeProvider,直接使用 CSS 变量
|
|
10
|
-
*/
|
|
11
1
|
export type SkeletonVariant = 'text' | 'rect' | 'block' | 'circle';
|
|
12
2
|
export type SkeletonRadius = 'sm' | 'md' | 'lg' | 'pill' | 'circle';
|
|
13
|
-
/**
|
|
14
|
-
* Skeleton 基础元素
|
|
15
|
-
*/
|
|
16
3
|
export declare const SkeletonRoot: import("@emotion/styled").StyledComponent<{
|
|
17
4
|
theme?: import("@emotion/react").Theme;
|
|
18
5
|
as?: React.ElementType;
|
|
@@ -23,18 +10,12 @@ export declare const SkeletonRoot: import("@emotion/styled").StyledComponent<{
|
|
|
23
10
|
$radius?: SkeletonRadius;
|
|
24
11
|
$animate?: boolean;
|
|
25
12
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
-
/**
|
|
27
|
-
* Skeleton 文本容器(多行)
|
|
28
|
-
*/
|
|
29
13
|
export declare const SkeletonStack: import("@emotion/styled").StyledComponent<{
|
|
30
14
|
theme?: import("@emotion/react").Theme;
|
|
31
15
|
as?: React.ElementType;
|
|
32
16
|
} & {
|
|
33
17
|
$width?: string;
|
|
34
18
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
35
|
-
/**
|
|
36
|
-
* Skeleton 文本行
|
|
37
|
-
*/
|
|
38
19
|
export declare const SkeletonLine: import("@emotion/styled").StyledComponent<{
|
|
39
20
|
theme?: import("@emotion/react").Theme;
|
|
40
21
|
as?: React.ElementType;
|
|
@@ -43,11 +24,5 @@ export declare const SkeletonLine: import("@emotion/styled").StyledComponent<{
|
|
|
43
24
|
$customWidth?: string;
|
|
44
25
|
$animate?: boolean;
|
|
45
26
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
46
|
-
/**
|
|
47
|
-
* Variant 映射(向后兼容)
|
|
48
|
-
*/
|
|
49
27
|
export declare const skeletonVariants: Record<string, SkeletonVariant>;
|
|
50
|
-
/**
|
|
51
|
-
* Radius 映射(向后兼容)
|
|
52
|
-
*/
|
|
53
28
|
export declare const skeletonRadii: Record<string, SkeletonRadius>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton Styled Tokens
|
|
3
|
+
*
|
|
4
|
+
* 将 Skeleton 的 JS tokens 与 CSS 变量映射,实现:
|
|
5
|
+
* - 有 ThemeProvider 时:使用 JS token 值(可被用户自定义)
|
|
6
|
+
* - 无 ThemeProvider 时:fallback 到 CSS 变量(基础样式)
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Skeleton 组件的 Styled Tokens
|
|
10
|
+
*/
|
|
11
|
+
export declare const $skeleton: {
|
|
12
|
+
readonly bgBase: (props: {
|
|
13
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
14
|
+
_useCSSVariables?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}) => string;
|
|
17
|
+
readonly bgHighlight: (props: {
|
|
18
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
19
|
+
_useCSSVariables?: boolean;
|
|
20
|
+
};
|
|
21
|
+
}) => string;
|
|
22
|
+
readonly animationDuration: (props: {
|
|
23
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
24
|
+
_useCSSVariables?: boolean;
|
|
25
|
+
};
|
|
26
|
+
}) => string;
|
|
27
|
+
readonly animationEasing: (props: {
|
|
28
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
29
|
+
_useCSSVariables?: boolean;
|
|
30
|
+
};
|
|
31
|
+
}) => string;
|
|
32
|
+
readonly radiusSm: (props: {
|
|
33
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
34
|
+
_useCSSVariables?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}) => string;
|
|
37
|
+
readonly radiusMd: (props: {
|
|
38
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
39
|
+
_useCSSVariables?: boolean;
|
|
40
|
+
};
|
|
41
|
+
}) => string;
|
|
42
|
+
readonly radiusLg: (props: {
|
|
43
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
44
|
+
_useCSSVariables?: boolean;
|
|
45
|
+
};
|
|
46
|
+
}) => string;
|
|
47
|
+
readonly radiusPill: (props: {
|
|
48
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
49
|
+
_useCSSVariables?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}) => string;
|
|
52
|
+
readonly radiusCircle: (props: {
|
|
53
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
54
|
+
_useCSSVariables?: boolean;
|
|
55
|
+
};
|
|
56
|
+
}) => string;
|
|
57
|
+
readonly blockHeight: (props: {
|
|
58
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
59
|
+
_useCSSVariables?: boolean;
|
|
60
|
+
};
|
|
61
|
+
}) => string;
|
|
62
|
+
readonly textLineHeight: (props: {
|
|
63
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
64
|
+
_useCSSVariables?: boolean;
|
|
65
|
+
};
|
|
66
|
+
}) => string;
|
|
67
|
+
readonly textGap: (props: {
|
|
68
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
69
|
+
_useCSSVariables?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}) => string;
|
|
72
|
+
readonly textLastLineWidth: (props: {
|
|
73
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
74
|
+
_useCSSVariables?: boolean;
|
|
75
|
+
};
|
|
76
|
+
}) => string;
|
|
77
|
+
readonly circleSize: (props: {
|
|
78
|
+
theme?: import("@kingsoft-ai/theme").Theme & {
|
|
79
|
+
_useCSSVariables?: boolean;
|
|
80
|
+
};
|
|
81
|
+
}) => string;
|
|
82
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton 组件 Token 类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface SkeletonTokens {
|
|
5
|
+
background: {
|
|
6
|
+
base: string;
|
|
7
|
+
highlight: string;
|
|
8
|
+
};
|
|
9
|
+
animation: {
|
|
10
|
+
duration: string;
|
|
11
|
+
easing: string;
|
|
12
|
+
};
|
|
13
|
+
radius: {
|
|
14
|
+
sm: string;
|
|
15
|
+
md: string;
|
|
16
|
+
lg: string;
|
|
17
|
+
pill: string;
|
|
18
|
+
circle: string;
|
|
19
|
+
};
|
|
20
|
+
block: {
|
|
21
|
+
height: string;
|
|
22
|
+
};
|
|
23
|
+
text: {
|
|
24
|
+
lineHeight: string;
|
|
25
|
+
gap: string;
|
|
26
|
+
lastLineWidth: string;
|
|
27
|
+
};
|
|
28
|
+
circle: {
|
|
29
|
+
size: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AriaSliderProps } from 'react-aria';
|
|
3
|
+
import { type SliderSize } from './Slider.style';
|
|
4
|
+
export declare const SIZES: readonly ["sm", "md", "lg"];
|
|
5
|
+
export interface SliderMark {
|
|
6
|
+
/** 刻度值 */
|
|
7
|
+
value: number;
|
|
8
|
+
/** 刻度标签 */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export type SliderProps = Omit<AriaSliderProps, 'isDisabled'> & {
|
|
12
|
+
/** 滑块尺寸:小号(4px轨道)、标准(6px轨道)、大号(8px轨道) */
|
|
13
|
+
size?: SliderSize;
|
|
14
|
+
/** 是否禁用(替代 isDisabled) */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** 是否占满容器宽度 */
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
/** 是否显示当前数值 */
|
|
19
|
+
showValue?: boolean;
|
|
20
|
+
/** 是否显示 tooltip */
|
|
21
|
+
showTooltip?: boolean | 'always' | 'hover';
|
|
22
|
+
/** 刻度标记 */
|
|
23
|
+
marks?: SliderMark[] | boolean;
|
|
24
|
+
/** 数值格式化函数 */
|
|
25
|
+
formatValue?: (value: number) => string;
|
|
26
|
+
/** 自定义类名 */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** 自定义样式(支持 CSS 变量定制) */
|
|
29
|
+
style?: React.CSSProperties;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Slider 滑动组件
|
|
33
|
+
*
|
|
34
|
+
* 基于 react-aria 实现,支持无障碍访问、键盘导航和主题定制。
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // 基础用法
|
|
39
|
+
* <Slider label="音量" defaultValue={50} />
|
|
40
|
+
*
|
|
41
|
+
* // 带刻度标记
|
|
42
|
+
* <Slider
|
|
43
|
+
* label="进度"
|
|
44
|
+
* marks={[
|
|
45
|
+
* { value: 0, label: '0%' },
|
|
46
|
+
* { value: 50, label: '50%' },
|
|
47
|
+
* { value: 100, label: '100%' },
|
|
48
|
+
* ]}
|
|
49
|
+
* />
|
|
50
|
+
*
|
|
51
|
+
* // 范围选择
|
|
52
|
+
* <Slider label="价格范围" defaultValue={[20, 80]} />
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const Slider: import("react").ForwardRefExoticComponent<Omit<AriaSliderProps<number | number[]>, "isDisabled"> & {
|
|
56
|
+
/** 滑块尺寸:小号(4px轨道)、标准(6px轨道)、大号(8px轨道) */
|
|
57
|
+
size?: SliderSize;
|
|
58
|
+
/** 是否禁用(替代 isDisabled) */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** 是否占满容器宽度 */
|
|
61
|
+
fullWidth?: boolean;
|
|
62
|
+
/** 是否显示当前数值 */
|
|
63
|
+
showValue?: boolean;
|
|
64
|
+
/** 是否显示 tooltip */
|
|
65
|
+
showTooltip?: boolean | "always" | "hover";
|
|
66
|
+
/** 刻度标记 */
|
|
67
|
+
marks?: SliderMark[] | boolean;
|
|
68
|
+
/** 数值格式化函数 */
|
|
69
|
+
formatValue?: (value: number) => string;
|
|
70
|
+
/** 自定义类名 */
|
|
71
|
+
className?: string;
|
|
72
|
+
/** 自定义样式(支持 CSS 变量定制) */
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export declare const sliderSizes: readonly ["sm", "md", "lg"];
|
|
2
|
+
export type SliderSize = (typeof sliderSizes)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Slider 根容器
|
|
5
|
+
*/
|
|
6
|
+
export declare const SliderRoot: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
} & {
|
|
10
|
+
size: SliderSize;
|
|
11
|
+
isDisabled: boolean;
|
|
12
|
+
fullWidth: boolean;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
/**
|
|
15
|
+
* 标签和数值区域
|
|
16
|
+
*/
|
|
17
|
+
export declare const SliderHeader: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
theme?: import("@emotion/react").Theme;
|
|
19
|
+
as?: React.ElementType;
|
|
20
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
21
|
+
/**
|
|
22
|
+
* 标签文字
|
|
23
|
+
*/
|
|
24
|
+
export declare const SliderLabel: import("@emotion/styled").StyledComponent<{
|
|
25
|
+
theme?: import("@emotion/react").Theme;
|
|
26
|
+
as?: React.ElementType;
|
|
27
|
+
} & {
|
|
28
|
+
isDisabled: boolean;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {}>;
|
|
30
|
+
/**
|
|
31
|
+
* 数值显示
|
|
32
|
+
*/
|
|
33
|
+
export declare const SliderValue: import("@emotion/styled").StyledComponent<{
|
|
34
|
+
theme?: import("@emotion/react").Theme;
|
|
35
|
+
as?: React.ElementType;
|
|
36
|
+
} & {
|
|
37
|
+
isDisabled: boolean;
|
|
38
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
39
|
+
/**
|
|
40
|
+
* 轨道容器 - 包含轨道、填充和滑块
|
|
41
|
+
*/
|
|
42
|
+
export declare const SliderTrackContainer: import("@emotion/styled").StyledComponent<{
|
|
43
|
+
theme?: import("@emotion/react").Theme;
|
|
44
|
+
as?: React.ElementType;
|
|
45
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
46
|
+
/**
|
|
47
|
+
* 轨道背景
|
|
48
|
+
*/
|
|
49
|
+
export declare const SliderTrack: import("@emotion/styled").StyledComponent<{
|
|
50
|
+
theme?: import("@emotion/react").Theme;
|
|
51
|
+
as?: React.ElementType;
|
|
52
|
+
} & {
|
|
53
|
+
isDisabled: boolean;
|
|
54
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
55
|
+
/**
|
|
56
|
+
* 已填充区域
|
|
57
|
+
*/
|
|
58
|
+
export declare const SliderFill: import("@emotion/styled").StyledComponent<{
|
|
59
|
+
theme?: import("@emotion/react").Theme;
|
|
60
|
+
as?: React.ElementType;
|
|
61
|
+
} & {
|
|
62
|
+
isDisabled: boolean;
|
|
63
|
+
isHovered: boolean;
|
|
64
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
65
|
+
/**
|
|
66
|
+
* 滑块(拖动按钮)
|
|
67
|
+
*/
|
|
68
|
+
export declare const SliderThumb: import("@emotion/styled").StyledComponent<{
|
|
69
|
+
theme?: import("@emotion/react").Theme;
|
|
70
|
+
as?: React.ElementType;
|
|
71
|
+
} & {
|
|
72
|
+
isDisabled: boolean;
|
|
73
|
+
isFocusVisible: boolean;
|
|
74
|
+
isDragging: boolean;
|
|
75
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
76
|
+
/**
|
|
77
|
+
* 刻度标记容器
|
|
78
|
+
*/
|
|
79
|
+
export declare const SliderMarks: import("@emotion/styled").StyledComponent<{
|
|
80
|
+
theme?: import("@emotion/react").Theme;
|
|
81
|
+
as?: React.ElementType;
|
|
82
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
83
|
+
/**
|
|
84
|
+
* 单个刻度标记
|
|
85
|
+
*/
|
|
86
|
+
export declare const SliderMark: import("@emotion/styled").StyledComponent<{
|
|
87
|
+
theme?: import("@emotion/react").Theme;
|
|
88
|
+
as?: React.ElementType;
|
|
89
|
+
} & {
|
|
90
|
+
isActive: boolean;
|
|
91
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
92
|
+
/**
|
|
93
|
+
* 刻度点
|
|
94
|
+
*/
|
|
95
|
+
export declare const SliderMarkDot: import("@emotion/styled").StyledComponent<{
|
|
96
|
+
theme?: import("@emotion/react").Theme;
|
|
97
|
+
as?: React.ElementType;
|
|
98
|
+
} & {
|
|
99
|
+
isActive: boolean;
|
|
100
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
101
|
+
/**
|
|
102
|
+
* 刻度标签
|
|
103
|
+
*/
|
|
104
|
+
export declare const SliderMarkLabel: import("@emotion/styled").StyledComponent<{
|
|
105
|
+
theme?: import("@emotion/react").Theme;
|
|
106
|
+
as?: React.ElementType;
|
|
107
|
+
} & {
|
|
108
|
+
isActive: boolean;
|
|
109
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
110
|
+
/**
|
|
111
|
+
* Tooltip
|
|
112
|
+
*/
|
|
113
|
+
export declare const SliderTooltip: import("@emotion/styled").StyledComponent<{
|
|
114
|
+
theme?: import("@emotion/react").Theme;
|
|
115
|
+
as?: React.ElementType;
|
|
116
|
+
} & {
|
|
117
|
+
isVisible: boolean;
|
|
118
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
119
|
+
/**
|
|
120
|
+
* 输出容器 - 用于显示输入框
|
|
121
|
+
*/
|
|
122
|
+
export declare const SliderOutput: import("@emotion/styled").StyledComponent<{
|
|
123
|
+
theme?: import("@emotion/react").Theme;
|
|
124
|
+
as?: React.ElementType;
|
|
125
|
+
}, import("react").DetailedHTMLProps<import("react").OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>, {}>;
|