straw-ui-vue 0.1.39 → 0.1.40
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/components/st-button/base.d.ts +244 -26
- package/dist/components/st-button/index.d.ts +6 -0
- package/dist/components/st-button/st-button-group.d.ts +1 -0
- package/dist/components/st-button/types/st-button-group.d.ts +3 -0
- package/dist/components/st-button/types/st-button.d.ts +3 -3
- package/dist/straw-ui.js +1313 -1084
- package/package.json +7 -7
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
export declare const base = "inline-flex items-center justify-center transition-all duration-150 ease-in-out border-none outline-none select-none";
|
|
2
|
-
/**
|
|
2
|
+
/** 按钮尺寸映射(只管尺寸:高度、水平内边距、字号、图标间距,键与 UnoCSS size token 同名) */
|
|
3
3
|
export declare const sizeMap: {
|
|
4
|
-
|
|
4
|
+
xxs: string;
|
|
5
|
+
xs: string;
|
|
6
|
+
sm: string;
|
|
5
7
|
default: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const typeMap: {
|
|
10
|
-
default: string;
|
|
11
|
-
icon: string;
|
|
8
|
+
lg: string;
|
|
9
|
+
xl: string;
|
|
10
|
+
xxl: string;
|
|
12
11
|
};
|
|
13
12
|
/** 图标按钮复合变体(type=icon 时补齐同刻度宽度并抹除水平内边距,保证正方形形态) */
|
|
14
13
|
export declare const iconCompoundVariants: readonly [{
|
|
15
14
|
readonly variants: {
|
|
16
15
|
readonly type: "icon";
|
|
17
|
-
readonly size: "
|
|
16
|
+
readonly size: "xxs";
|
|
17
|
+
};
|
|
18
|
+
readonly className: "w-xxs px-0";
|
|
19
|
+
}, {
|
|
20
|
+
readonly variants: {
|
|
21
|
+
readonly type: "icon";
|
|
22
|
+
readonly size: "xs";
|
|
23
|
+
};
|
|
24
|
+
readonly className: "w-xs px-0";
|
|
25
|
+
}, {
|
|
26
|
+
readonly variants: {
|
|
27
|
+
readonly type: "icon";
|
|
28
|
+
readonly size: "sm";
|
|
18
29
|
};
|
|
19
30
|
readonly className: "w-sm px-0";
|
|
20
31
|
}, {
|
|
@@ -26,16 +37,88 @@ export declare const iconCompoundVariants: readonly [{
|
|
|
26
37
|
}, {
|
|
27
38
|
readonly variants: {
|
|
28
39
|
readonly type: "icon";
|
|
29
|
-
readonly size: "
|
|
40
|
+
readonly size: "lg";
|
|
30
41
|
};
|
|
31
42
|
readonly className: "w-lg px-0";
|
|
43
|
+
}, {
|
|
44
|
+
readonly variants: {
|
|
45
|
+
readonly type: "icon";
|
|
46
|
+
readonly size: "xl";
|
|
47
|
+
};
|
|
48
|
+
readonly className: "w-xl px-0";
|
|
49
|
+
}, {
|
|
50
|
+
readonly variants: {
|
|
51
|
+
readonly type: "icon";
|
|
52
|
+
readonly size: "xxl";
|
|
53
|
+
};
|
|
54
|
+
readonly className: "w-xxl px-0";
|
|
32
55
|
}];
|
|
56
|
+
/** 按钮组容器尺寸映射(横向组定高、纵向组定宽,交叉轴尺寸由子按钮撑开) */
|
|
57
|
+
export declare const groupAxisSizeMap: {
|
|
58
|
+
readonly horizontal: {
|
|
59
|
+
readonly xxs: "h-xxs";
|
|
60
|
+
readonly xs: "h-xs";
|
|
61
|
+
readonly sm: "h-sm";
|
|
62
|
+
readonly default: "h-default";
|
|
63
|
+
readonly lg: "h-lg";
|
|
64
|
+
readonly xl: "h-xl";
|
|
65
|
+
readonly xxl: "h-xxl";
|
|
66
|
+
};
|
|
67
|
+
readonly vertical: {
|
|
68
|
+
readonly xxs: "w-xxs";
|
|
69
|
+
readonly xs: "w-xs";
|
|
70
|
+
readonly sm: "w-sm";
|
|
71
|
+
readonly default: "w-default";
|
|
72
|
+
readonly lg: "w-lg";
|
|
73
|
+
readonly xl: "w-xl";
|
|
74
|
+
readonly xxl: "w-xxl";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
33
77
|
/** 按钮变体样式映射(基础样式,不含交互状态) */
|
|
34
78
|
export declare const variantMap: {
|
|
35
79
|
primary: string;
|
|
36
80
|
default: string;
|
|
37
|
-
|
|
81
|
+
success: string;
|
|
82
|
+
warning: string;
|
|
83
|
+
danger: string;
|
|
38
84
|
};
|
|
85
|
+
/** 幽灵样式映射(独立于 variant 的布尔轴:抹除填充色,语义文字色由 compound 变体补齐,交互态由 hover/active 轴提供) */
|
|
86
|
+
export declare const ghostMap: {
|
|
87
|
+
true: string;
|
|
88
|
+
false: string;
|
|
89
|
+
};
|
|
90
|
+
/** 幽灵 × 变体复合变体(ghost 叠加 variant 时保留对应语义文字色) */
|
|
91
|
+
export declare const ghostVariantCompoundVariants: readonly [{
|
|
92
|
+
readonly variants: {
|
|
93
|
+
readonly ghost: true;
|
|
94
|
+
readonly variant: "primary";
|
|
95
|
+
};
|
|
96
|
+
readonly className: "text-primary";
|
|
97
|
+
}, {
|
|
98
|
+
readonly variants: {
|
|
99
|
+
readonly ghost: true;
|
|
100
|
+
readonly variant: "default";
|
|
101
|
+
};
|
|
102
|
+
readonly className: "text-secondary-foreground";
|
|
103
|
+
}, {
|
|
104
|
+
readonly variants: {
|
|
105
|
+
readonly ghost: true;
|
|
106
|
+
readonly variant: "success";
|
|
107
|
+
};
|
|
108
|
+
readonly className: "text-success";
|
|
109
|
+
}, {
|
|
110
|
+
readonly variants: {
|
|
111
|
+
readonly ghost: true;
|
|
112
|
+
readonly variant: "warning";
|
|
113
|
+
};
|
|
114
|
+
readonly className: "text-warning";
|
|
115
|
+
}, {
|
|
116
|
+
readonly variants: {
|
|
117
|
+
readonly ghost: true;
|
|
118
|
+
readonly variant: "danger";
|
|
119
|
+
};
|
|
120
|
+
readonly className: "text-danger";
|
|
121
|
+
}];
|
|
39
122
|
export declare const disabledMap: {
|
|
40
123
|
true: string;
|
|
41
124
|
false: string;
|
|
@@ -45,21 +128,156 @@ export declare const loadingMap: {
|
|
|
45
128
|
false: string;
|
|
46
129
|
};
|
|
47
130
|
export declare const groupMap: {
|
|
131
|
+
none: string;
|
|
48
132
|
vertical: string;
|
|
49
133
|
horizontal: string;
|
|
50
|
-
false: string;
|
|
51
|
-
};
|
|
52
|
-
/** 桌面端交互态映射(hover) */
|
|
53
|
-
export declare const hoverMap: {
|
|
54
|
-
primary: string;
|
|
55
|
-
default: string;
|
|
56
|
-
ghost: string;
|
|
57
|
-
disabled: string;
|
|
58
|
-
};
|
|
59
|
-
/** 移动端交互态映射(active) */
|
|
60
|
-
export declare const activeMap: {
|
|
61
|
-
primary: string;
|
|
62
|
-
default: string;
|
|
63
|
-
ghost: string;
|
|
64
|
-
disabled: string;
|
|
65
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* 桌面端 hover 态复合变体(variant × ghost 两个独立轴的配合;disabled 显式门控,禁用态不产出 hover 类)
|
|
137
|
+
* - 非 ghost:在原填充色上加深
|
|
138
|
+
* - ghost:叠加对应语义的半透明底色,default 走中性 accent
|
|
139
|
+
* 类名需保持字面量,供 UnoCSS 静态扫描收集
|
|
140
|
+
* */
|
|
141
|
+
export declare const hoverCompoundVariants: readonly [{
|
|
142
|
+
readonly variants: {
|
|
143
|
+
readonly variant: "primary";
|
|
144
|
+
readonly ghost: false;
|
|
145
|
+
readonly disabled: false;
|
|
146
|
+
};
|
|
147
|
+
readonly className: "hover:bg-primary/90";
|
|
148
|
+
}, {
|
|
149
|
+
readonly variants: {
|
|
150
|
+
readonly variant: "default";
|
|
151
|
+
readonly ghost: false;
|
|
152
|
+
readonly disabled: false;
|
|
153
|
+
};
|
|
154
|
+
readonly className: "hover:bg-secondary/80";
|
|
155
|
+
}, {
|
|
156
|
+
readonly variants: {
|
|
157
|
+
readonly variant: "success";
|
|
158
|
+
readonly ghost: false;
|
|
159
|
+
readonly disabled: false;
|
|
160
|
+
};
|
|
161
|
+
readonly className: "hover:bg-success/90";
|
|
162
|
+
}, {
|
|
163
|
+
readonly variants: {
|
|
164
|
+
readonly variant: "warning";
|
|
165
|
+
readonly ghost: false;
|
|
166
|
+
readonly disabled: false;
|
|
167
|
+
};
|
|
168
|
+
readonly className: "hover:bg-warning/90";
|
|
169
|
+
}, {
|
|
170
|
+
readonly variants: {
|
|
171
|
+
readonly variant: "danger";
|
|
172
|
+
readonly ghost: false;
|
|
173
|
+
readonly disabled: false;
|
|
174
|
+
};
|
|
175
|
+
readonly className: "hover:bg-danger/90";
|
|
176
|
+
}, {
|
|
177
|
+
readonly variants: {
|
|
178
|
+
readonly variant: "primary";
|
|
179
|
+
readonly ghost: true;
|
|
180
|
+
readonly disabled: false;
|
|
181
|
+
};
|
|
182
|
+
readonly className: "hover:bg-primary/10";
|
|
183
|
+
}, {
|
|
184
|
+
readonly variants: {
|
|
185
|
+
readonly variant: "default";
|
|
186
|
+
readonly ghost: true;
|
|
187
|
+
readonly disabled: false;
|
|
188
|
+
};
|
|
189
|
+
readonly className: "hover:bg-accent";
|
|
190
|
+
}, {
|
|
191
|
+
readonly variants: {
|
|
192
|
+
readonly variant: "success";
|
|
193
|
+
readonly ghost: true;
|
|
194
|
+
readonly disabled: false;
|
|
195
|
+
};
|
|
196
|
+
readonly className: "hover:bg-success/10";
|
|
197
|
+
}, {
|
|
198
|
+
readonly variants: {
|
|
199
|
+
readonly variant: "warning";
|
|
200
|
+
readonly ghost: true;
|
|
201
|
+
readonly disabled: false;
|
|
202
|
+
};
|
|
203
|
+
readonly className: "hover:bg-warning/10";
|
|
204
|
+
}, {
|
|
205
|
+
readonly variants: {
|
|
206
|
+
readonly variant: "danger";
|
|
207
|
+
readonly ghost: true;
|
|
208
|
+
readonly disabled: false;
|
|
209
|
+
};
|
|
210
|
+
readonly className: "hover:bg-danger/10";
|
|
211
|
+
}];
|
|
212
|
+
/** 移动端按压态复合变体(active:门控与配色规则同 hoverCompoundVariants) */
|
|
213
|
+
export declare const activeCompoundVariants: readonly [{
|
|
214
|
+
readonly variants: {
|
|
215
|
+
readonly variant: "primary";
|
|
216
|
+
readonly ghost: false;
|
|
217
|
+
readonly disabled: false;
|
|
218
|
+
};
|
|
219
|
+
readonly className: "active:bg-primary/90";
|
|
220
|
+
}, {
|
|
221
|
+
readonly variants: {
|
|
222
|
+
readonly variant: "default";
|
|
223
|
+
readonly ghost: false;
|
|
224
|
+
readonly disabled: false;
|
|
225
|
+
};
|
|
226
|
+
readonly className: "active:bg-secondary/80";
|
|
227
|
+
}, {
|
|
228
|
+
readonly variants: {
|
|
229
|
+
readonly variant: "success";
|
|
230
|
+
readonly ghost: false;
|
|
231
|
+
readonly disabled: false;
|
|
232
|
+
};
|
|
233
|
+
readonly className: "active:bg-success/90";
|
|
234
|
+
}, {
|
|
235
|
+
readonly variants: {
|
|
236
|
+
readonly variant: "warning";
|
|
237
|
+
readonly ghost: false;
|
|
238
|
+
readonly disabled: false;
|
|
239
|
+
};
|
|
240
|
+
readonly className: "active:bg-warning/90";
|
|
241
|
+
}, {
|
|
242
|
+
readonly variants: {
|
|
243
|
+
readonly variant: "danger";
|
|
244
|
+
readonly ghost: false;
|
|
245
|
+
readonly disabled: false;
|
|
246
|
+
};
|
|
247
|
+
readonly className: "active:bg-danger/90";
|
|
248
|
+
}, {
|
|
249
|
+
readonly variants: {
|
|
250
|
+
readonly variant: "primary";
|
|
251
|
+
readonly ghost: true;
|
|
252
|
+
readonly disabled: false;
|
|
253
|
+
};
|
|
254
|
+
readonly className: "active:bg-primary/10";
|
|
255
|
+
}, {
|
|
256
|
+
readonly variants: {
|
|
257
|
+
readonly variant: "default";
|
|
258
|
+
readonly ghost: true;
|
|
259
|
+
readonly disabled: false;
|
|
260
|
+
};
|
|
261
|
+
readonly className: "active:bg-accent";
|
|
262
|
+
}, {
|
|
263
|
+
readonly variants: {
|
|
264
|
+
readonly variant: "success";
|
|
265
|
+
readonly ghost: true;
|
|
266
|
+
readonly disabled: false;
|
|
267
|
+
};
|
|
268
|
+
readonly className: "active:bg-success/10";
|
|
269
|
+
}, {
|
|
270
|
+
readonly variants: {
|
|
271
|
+
readonly variant: "warning";
|
|
272
|
+
readonly ghost: true;
|
|
273
|
+
readonly disabled: false;
|
|
274
|
+
};
|
|
275
|
+
readonly className: "active:bg-warning/10";
|
|
276
|
+
}, {
|
|
277
|
+
readonly variants: {
|
|
278
|
+
readonly variant: "danger";
|
|
279
|
+
readonly ghost: true;
|
|
280
|
+
readonly disabled: false;
|
|
281
|
+
};
|
|
282
|
+
readonly className: "active:bg-danger/10";
|
|
283
|
+
}];
|
|
@@ -35,6 +35,7 @@ export declare const StButton: {
|
|
|
35
35
|
type: import('./index.ts').StButtonType;
|
|
36
36
|
variant: import('./index.ts').StButtonVariant;
|
|
37
37
|
disabled: boolean;
|
|
38
|
+
ghost: boolean;
|
|
38
39
|
loading: boolean;
|
|
39
40
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
40
41
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
@@ -49,6 +50,7 @@ export declare const StButton: {
|
|
|
49
50
|
type: import('./index.ts').StButtonType;
|
|
50
51
|
variant: import('./index.ts').StButtonVariant;
|
|
51
52
|
disabled: boolean;
|
|
53
|
+
ghost: boolean;
|
|
52
54
|
loading: boolean;
|
|
53
55
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
54
56
|
}>;
|
|
@@ -60,6 +62,7 @@ export declare const StButton: {
|
|
|
60
62
|
type: import('./index.ts').StButtonType;
|
|
61
63
|
variant: import('./index.ts').StButtonVariant;
|
|
62
64
|
disabled: boolean;
|
|
65
|
+
ghost: boolean;
|
|
63
66
|
loading: boolean;
|
|
64
67
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
65
68
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
@@ -124,6 +127,7 @@ export declare const StButtonGroup: {
|
|
|
124
127
|
type: import('./index.ts').StButtonType;
|
|
125
128
|
variant: import('./index.ts').StButtonVariant;
|
|
126
129
|
disabled: boolean;
|
|
130
|
+
ghost: boolean;
|
|
127
131
|
loading: boolean;
|
|
128
132
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
129
133
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
@@ -138,6 +142,7 @@ export declare const StButtonGroup: {
|
|
|
138
142
|
type: import('./index.ts').StButtonType;
|
|
139
143
|
variant: import('./index.ts').StButtonVariant;
|
|
140
144
|
disabled: boolean;
|
|
145
|
+
ghost: boolean;
|
|
141
146
|
loading: boolean;
|
|
142
147
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
143
148
|
}>;
|
|
@@ -149,6 +154,7 @@ export declare const StButtonGroup: {
|
|
|
149
154
|
type: import('./index.ts').StButtonType;
|
|
150
155
|
variant: import('./index.ts').StButtonVariant;
|
|
151
156
|
disabled: boolean;
|
|
157
|
+
ghost: boolean;
|
|
152
158
|
loading: boolean;
|
|
153
159
|
direction: import('./index.ts').StButtonGroupDirection;
|
|
154
160
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
@@ -8,6 +8,7 @@ declare const __VLS_base: import('vue').DefineComponent<StButtonGroupProps, {},
|
|
|
8
8
|
type: import('./index.ts').StButtonType;
|
|
9
9
|
variant: import('./index.ts').StButtonVariant;
|
|
10
10
|
disabled: boolean;
|
|
11
|
+
ghost: boolean;
|
|
11
12
|
loading: boolean;
|
|
12
13
|
direction: StButtonGroupDirection;
|
|
13
14
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -9,6 +9,7 @@ export interface StButtonGroupContext {
|
|
|
9
9
|
variant: ComputedRef<StButtonVariant>;
|
|
10
10
|
type: ComputedRef<StButtonType>;
|
|
11
11
|
size: ComputedRef<StButtonSize>;
|
|
12
|
+
ghost: ComputedRef<boolean>;
|
|
12
13
|
disabled: ComputedRef<boolean>;
|
|
13
14
|
loading: ComputedRef<boolean>;
|
|
14
15
|
inGroup: ComputedRef<boolean>;
|
|
@@ -22,6 +23,8 @@ export interface StButtonGroupProps {
|
|
|
22
23
|
type?: StButtonType;
|
|
23
24
|
/** 按钮尺寸 */
|
|
24
25
|
size?: StButtonSize;
|
|
26
|
+
/** 是否开启ghost样式 */
|
|
27
|
+
ghost?: boolean;
|
|
25
28
|
/** 是否禁用 */
|
|
26
29
|
disabled?: boolean;
|
|
27
30
|
/** 是否显示加载状态 */
|
|
@@ -8,13 +8,13 @@ import type {
|
|
|
8
8
|
import type { StButtonPhoneEmits, StButtonPhoneProps, StButtonPhoneSlots } from '../phone/types/st-button-phone.d.ts';
|
|
9
9
|
|
|
10
10
|
/** 按钮变体类型 */
|
|
11
|
-
export type StButtonVariant = 'default' | 'primary' | 'success' | '
|
|
11
|
+
export type StButtonVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
12
12
|
|
|
13
13
|
/** 按钮类型 */
|
|
14
14
|
export type StButtonType = 'default' | 'icon';
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
export type StButtonSize = 'default' | '
|
|
16
|
+
/** 按钮尺寸(与 UnoCSS 预设 size token 刻度同名) */
|
|
17
|
+
export type StButtonSize = 'xxs' | 'xs' | 'sm' | 'default' | 'lg' | 'xl' | 'xxl';
|
|
18
18
|
|
|
19
19
|
/** 按钮组件基础属性 */
|
|
20
20
|
export interface StButtonBaseProps {
|