xt-element-ui 1.0.9 → 1.1.0
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/lib/index.common.js +135 -43
- package/lib/index.css +1 -1
- package/lib/index.umd.js +135 -43
- package/lib/index.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/components/button/index.vue +29 -23
- package/src/components/button/style/index copy.scss +221 -0
- package/src/components/button/style/index.scss +31 -25
- package/src/components/card/style/index.scss +1 -1
- package/src/components/card-item/style/index.scss +1 -1
- package/src/components/config-provider/index.vue +18 -1
- package/src/components/index.scss +4 -1
- package/src/components/input/style/index.scss +1 -1
- package/src/components/text/index.js +2 -0
- package/src/components/text/index.vue +42 -0
- package/src/components/text/style/index.scss +45 -0
- package/src/index.js +7 -4
- package/src/styles/{vars.scss → css-variables.scss} +1 -1
- package/src/styles/theme/colors.scss +11 -0
- package/src/styles/theme/{component.scss → component-variables.scss} +3 -3
- package/src/styles/theme/index.scss +9 -9
- package/src/utils/index.js +3 -5
- package/src/styles/theme/color.scss +0 -11
- /package/src/styles/{theme-element.scss → element-theme.scss} +0 -0
- /package/src/styles/theme/{bg.scss → background.scss} +0 -0
- /package/src/styles/theme/{radius.scss → border-radius.scss} +0 -0
- /package/src/styles/theme/{border.scss → borders.scss} +0 -0
- /package/src/styles/theme/{dark.scss → dark-variables.scss} +0 -0
- /package/src/styles/theme/{shadow.scss → shadows.scss} +0 -0
- /package/src/styles/theme/{transition.scss → transitions.scss} +0 -0
- /package/src/styles/theme/{text.scss → typography.scss} +0 -0
- /package/src/styles/{export.scss → variables-export.scss} +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
// 颜色(使用主题变量)
|
|
4
|
+
$button-color-map: (
|
|
5
|
+
default: $xt-color-text-regular,
|
|
6
|
+
primary: $xt-color-primary,
|
|
7
|
+
success: $xt-color-success,
|
|
8
|
+
warning: $xt-color-warning,
|
|
9
|
+
danger: $xt-color-danger
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
$button-bg-color-map: (
|
|
13
|
+
default: transparent,
|
|
14
|
+
primary: $xt-color-primary,
|
|
15
|
+
success: $xt-color-success,
|
|
16
|
+
warning: $xt-color-warning,
|
|
17
|
+
danger: $xt-color-danger
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
$button-hover-bg-map: (
|
|
21
|
+
default: lighten($xt-color-primary, 10%),
|
|
22
|
+
primary: lighten($xt-color-primary, 10%),
|
|
23
|
+
success: lighten($xt-color-success, 10%),
|
|
24
|
+
warning: lighten($xt-color-warning, 10%),
|
|
25
|
+
danger: lighten($xt-color-danger, 10%)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
$button-active-bg-map: (
|
|
29
|
+
default: darken($xt-color-primary, 10%),
|
|
30
|
+
primary: darken($xt-color-primary, 10%),
|
|
31
|
+
success: darken($xt-color-success, 10%),
|
|
32
|
+
warning: darken($xt-color-warning, 10%),
|
|
33
|
+
danger: darken($xt-color-danger, 10%)
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// 尺寸
|
|
37
|
+
$button-size-map: (
|
|
38
|
+
large: 40px,
|
|
39
|
+
medium: 36px,
|
|
40
|
+
small: 32px,
|
|
41
|
+
mini: 28px
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
$button-font-size-map: (
|
|
45
|
+
large: 14px,
|
|
46
|
+
medium: 14px,
|
|
47
|
+
small: 12px,
|
|
48
|
+
mini: 12px
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// 圆角
|
|
52
|
+
$button-radius: 4px;
|
|
53
|
+
|
|
54
|
+
// 基础按钮
|
|
55
|
+
.xt-button {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
border: 1px solid $xt-color-border;
|
|
62
|
+
border-radius: $button-radius;
|
|
63
|
+
padding: 0 15px;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
outline: none;
|
|
66
|
+
transition: all 0.2s;
|
|
67
|
+
|
|
68
|
+
// 默认尺寸:medium
|
|
69
|
+
height: map-get($button-size-map, medium);
|
|
70
|
+
font-size: map-get($button-font-size-map, medium);
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
opacity: 0.9;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:active {
|
|
77
|
+
opacity: 0.8;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 禁用状态
|
|
81
|
+
&.is-disabled {
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 圆角
|
|
87
|
+
&.is-round {
|
|
88
|
+
border-radius: 20px;
|
|
89
|
+
padding: 0 18px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ------------------------------
|
|
94
|
+
// 循环生成所有类型按钮
|
|
95
|
+
// ------------------------------
|
|
96
|
+
@each $type, $color in $button-color-map {
|
|
97
|
+
$bg: map-get($button-bg-color-map, $type);
|
|
98
|
+
$hover-bg: map-get($button-hover-bg-map, $type);
|
|
99
|
+
$active-bg: map-get($button-active-bg-map, $type);
|
|
100
|
+
|
|
101
|
+
.xt-button--#{$type} {
|
|
102
|
+
@if $type == default {
|
|
103
|
+
color: $color;
|
|
104
|
+
border-color: $xt-color-border;
|
|
105
|
+
} @else {
|
|
106
|
+
color: #fff;
|
|
107
|
+
border-color: $bg;
|
|
108
|
+
}
|
|
109
|
+
background: $bg;
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
background: $hover-bg;
|
|
113
|
+
border-color: $hover-bg;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:active {
|
|
117
|
+
background: $active-bg;
|
|
118
|
+
border-color: $active-bg;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// default 按钮 hover 特殊处理
|
|
122
|
+
@if $type == default {
|
|
123
|
+
&:hover {
|
|
124
|
+
color: $hover-bg;
|
|
125
|
+
background: #ffffff;
|
|
126
|
+
border-color: $hover-bg;
|
|
127
|
+
}
|
|
128
|
+
&:active {
|
|
129
|
+
background: #fff;
|
|
130
|
+
border-color: $active-bg;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ------------------------------
|
|
137
|
+
// 循环生成所有尺寸
|
|
138
|
+
// ------------------------------
|
|
139
|
+
@each $size, $height in $button-size-map {
|
|
140
|
+
$font: map-get($button-font-size-map, $size);
|
|
141
|
+
|
|
142
|
+
.xt-button--#{$size} {
|
|
143
|
+
height: $height;
|
|
144
|
+
font-size: $font;
|
|
145
|
+
|
|
146
|
+
@if $size == large {
|
|
147
|
+
padding: 0 20px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ------------------------------
|
|
153
|
+
// Plain 模式
|
|
154
|
+
// ------------------------------
|
|
155
|
+
.xt-button--plain {
|
|
156
|
+
background-color: transparent;
|
|
157
|
+
border-color: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@each $type, $color in $button-color-map {
|
|
161
|
+
$bg: map-get($button-bg-color-map, $type);
|
|
162
|
+
|
|
163
|
+
.xt-button--#{$type}.xt-button--plain {
|
|
164
|
+
@if $type == default {
|
|
165
|
+
color: $xt-color-text-regular;
|
|
166
|
+
background: transparent;
|
|
167
|
+
border-color: $xt-color-border;
|
|
168
|
+
&:hover {
|
|
169
|
+
background: $xt-color-bg-hover;
|
|
170
|
+
border-color: $xt-color-border-light;
|
|
171
|
+
}
|
|
172
|
+
} @else {
|
|
173
|
+
color: $bg;
|
|
174
|
+
background: transparent;
|
|
175
|
+
border-color: $bg;
|
|
176
|
+
&:hover {
|
|
177
|
+
background: rgba($bg, 0.1);
|
|
178
|
+
color: $bg;
|
|
179
|
+
border-color: $bg;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// ------------------------------
|
|
186
|
+
// 暗色主题
|
|
187
|
+
// ------------------------------
|
|
188
|
+
html.dark .xt-button {
|
|
189
|
+
border-color: $xt-dark-color-border;
|
|
190
|
+
background: $xt-dark-color-bg-primary;
|
|
191
|
+
color: $xt-dark-color-text-primary;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
html.dark .xt-button:hover {
|
|
195
|
+
background: $xt-dark-color-bg-secondary;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
html.dark .xt-button--primary {
|
|
199
|
+
background: $xt-color-primary;
|
|
200
|
+
border-color: $xt-color-primary;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
html.dark .xt-button--success {
|
|
204
|
+
background: $xt-dark-color-success;
|
|
205
|
+
border-color: $xt-dark-color-success;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
html.dark .xt-button--warning {
|
|
209
|
+
background: $xt-dark-color-warning;
|
|
210
|
+
border-color: $xt-dark-color-warning;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
html.dark .xt-button--danger {
|
|
214
|
+
background: $xt-dark-color-danger;
|
|
215
|
+
border-color: $xt-dark-color-danger;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
html.dark .xt-button--info {
|
|
219
|
+
background: $xt-dark-color-info;
|
|
220
|
+
border-color: $xt-dark-color-info;
|
|
221
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@import '../../../styles/variables.scss';
|
|
2
2
|
|
|
3
3
|
.xt-button {
|
|
4
|
-
--xt-button-bg-color:
|
|
5
|
-
--xt-button-border-color: var(--xt-color-
|
|
6
|
-
--xt-button-text-color: #
|
|
4
|
+
--xt-button-bg-color: transparent;
|
|
5
|
+
--xt-button-border-color: var(--xt-color-border, #DCDFE6);
|
|
6
|
+
--xt-button-text-color: var(--xt-color-text-regular, #606266);
|
|
7
7
|
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
justify-content: center;
|
|
@@ -27,29 +27,44 @@
|
|
|
27
27
|
border-radius: var(--xt-border-radius-base, 4px);
|
|
28
28
|
padding: var(--xt-button-padding-y, 8px) var(--xt-button-padding-x, 15px);
|
|
29
29
|
font-size: var(--xt-font-size-base, 14px);
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
--xt-button-bg-color: var(--xt-color-bg-hover, #f5f5f5);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:active {
|
|
36
|
+
--xt-button-bg-color: var(--xt-color-bg-secondary, #f5f7fa);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:disabled {
|
|
40
|
+
--xt-button-bg-color: transparent;
|
|
41
|
+
--xt-button-border-color: var(--xt-color-border-light, #E4E7ED);
|
|
42
|
+
--xt-button-text-color: var(--xt-color-text-disabled, #C0C4CC);
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
30
45
|
}
|
|
31
46
|
|
|
32
47
|
.xt-button--primary {
|
|
33
|
-
--xt-button-bg-color: var(--xt-color-primary, #
|
|
34
|
-
--xt-button-border-color: var(--xt-color-primary, #
|
|
48
|
+
--xt-button-bg-color: var(--xt-color-primary, #1890ff);
|
|
49
|
+
--xt-button-border-color: var(--xt-color-primary, #1890ff);
|
|
35
50
|
--xt-button-text-color: #fff;
|
|
36
51
|
}
|
|
37
52
|
|
|
38
53
|
.xt-button--success {
|
|
39
|
-
--xt-button-bg-color: var(--xt-color-success, #
|
|
40
|
-
--xt-button-border-color: var(--xt-color-success, #
|
|
54
|
+
--xt-button-bg-color: var(--xt-color-success, #37c3a4);
|
|
55
|
+
--xt-button-border-color: var(--xt-color-success, #37c3a4);
|
|
41
56
|
--xt-button-text-color: #fff;
|
|
42
57
|
}
|
|
43
58
|
|
|
44
59
|
.xt-button--warning {
|
|
45
|
-
--xt-button-bg-color: var(--xt-color-warning, #
|
|
46
|
-
--xt-button-border-color: var(--xt-color-warning, #
|
|
60
|
+
--xt-button-bg-color: var(--xt-color-warning, #FFB74D);
|
|
61
|
+
--xt-button-border-color: var(--xt-color-warning, #FFB74D);
|
|
47
62
|
--xt-button-text-color: #fff;
|
|
48
63
|
}
|
|
49
64
|
|
|
50
65
|
.xt-button--danger {
|
|
51
|
-
--xt-button-bg-color: var(--xt-color-danger, #
|
|
52
|
-
--xt-button-border-color: var(--xt-color-danger, #
|
|
66
|
+
--xt-button-bg-color: var(--xt-color-danger, #EA1D34);
|
|
67
|
+
--xt-button-border-color: var(--xt-color-danger, #EA1D34);
|
|
53
68
|
--xt-button-text-color: #fff;
|
|
54
69
|
}
|
|
55
70
|
|
|
@@ -85,23 +100,23 @@ html.dark .xt-button--info {
|
|
|
85
100
|
.xt-button--danger[plain],
|
|
86
101
|
.xt-button--info[plain] {
|
|
87
102
|
--xt-button-bg-color: var(--xt-color-bg-primary, #fff);
|
|
88
|
-
--xt-button-text-color: var(--xt-color-primary, #
|
|
103
|
+
--xt-button-text-color: var(--xt-color-primary, #1890ff);
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
.xt-button--success[plain] {
|
|
92
|
-
--xt-button-text-color: var(--xt-color-success, #
|
|
107
|
+
--xt-button-text-color: var(--xt-color-success, #37c3a4);
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
.xt-button--warning[plain] {
|
|
96
|
-
--xt-button-text-color: var(--xt-color-warning, #
|
|
111
|
+
--xt-button-text-color: var(--xt-color-warning, #FFB74D);
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
.xt-button--danger[plain] {
|
|
100
|
-
--xt-button-text-color: var(--xt-color-danger, #
|
|
115
|
+
--xt-button-text-color: var(--xt-color-danger, #EA1D34);
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
.xt-button--info[plain] {
|
|
104
|
-
--xt-button-text-color: var(--xt-color-info, #
|
|
119
|
+
--xt-button-text-color: var(--xt-color-info, #999999);
|
|
105
120
|
}
|
|
106
121
|
|
|
107
122
|
html.dark .xt-button--success[plain] {
|
|
@@ -118,13 +133,4 @@ html.dark .xt-button--danger[plain] {
|
|
|
118
133
|
|
|
119
134
|
html.dark .xt-button--info[plain] {
|
|
120
135
|
--xt-button-text-color: var(--xt-dark-color-info, #3f4249);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.xt-button:hover {
|
|
124
|
-
opacity: 0.8;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.xt-button:disabled {
|
|
128
|
-
opacity: 0.6;
|
|
129
|
-
cursor: not-allowed;
|
|
130
136
|
}
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
props: {
|
|
18
18
|
theme: {
|
|
19
19
|
type: String,
|
|
20
|
-
default: '
|
|
20
|
+
default: 'white'
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
23
|
type: String,
|
|
@@ -80,6 +80,23 @@ export default {
|
|
|
80
80
|
result['--xt-color-border'] = '#434343'
|
|
81
81
|
result['--xt-color-border-light'] = '#3d3d3d'
|
|
82
82
|
|
|
83
|
+
if (this.injectBackground) {
|
|
84
|
+
result.backgroundColor = result['--xt-color-bg-primary']
|
|
85
|
+
}
|
|
86
|
+
if (this.injectColor) {
|
|
87
|
+
result.color = result['--xt-color-text-primary']
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
// 恢复默认主题颜色(white 主题)
|
|
91
|
+
result['--xt-color-text-primary'] = '#303133'
|
|
92
|
+
result['--xt-color-text-regular'] = '#606266'
|
|
93
|
+
result['--xt-color-text-secondary'] = '#909399'
|
|
94
|
+
result['--xt-color-bg-primary'] = '#ffffff'
|
|
95
|
+
result['--xt-color-bg-secondary'] = '#f5f7fa'
|
|
96
|
+
result['--xt-color-bg-container'] = '#f5f7fa'
|
|
97
|
+
result['--xt-color-border'] = '#DCDFE6'
|
|
98
|
+
result['--xt-color-border-light'] = '#E4E7ED'
|
|
99
|
+
|
|
83
100
|
if (this.injectBackground) {
|
|
84
101
|
result.backgroundColor = result['--xt-color-bg-primary']
|
|
85
102
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../../styles/variables.scss';
|
|
2
2
|
|
|
3
3
|
.xt-input .el-input__inner {
|
|
4
|
-
--xt-input-focus-color: var(--xt-color-primary, #
|
|
4
|
+
--xt-input-focus-color: var(--xt-color-primary, #1890ff);
|
|
5
5
|
|
|
6
6
|
background-color: var(--xt-input-bg-color, #ffffff);
|
|
7
7
|
border-color: var(--xt-input-border-color, #DCDFE6);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="xt-text"
|
|
4
|
+
:class="[
|
|
5
|
+
type ? 'xt-text--' + type : '',
|
|
6
|
+
{ 'xt-text--bold': bold }
|
|
7
|
+
]"
|
|
8
|
+
:style="customStyle"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</span>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'XtText',
|
|
17
|
+
props: {
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
|
|
22
|
+
},
|
|
23
|
+
bold: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
letterSpacing: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
customStyle() {
|
|
34
|
+
const style = {}
|
|
35
|
+
if (this.letterSpacing) {
|
|
36
|
+
style.letterSpacing = typeof this.letterSpacing === 'number' ? `${this.letterSpacing}px` : this.letterSpacing
|
|
37
|
+
}
|
|
38
|
+
return style
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
// 文字组件
|
|
4
|
+
.xt-text {
|
|
5
|
+
letter-spacing: $xt-spacing-xs;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// 不同类型文字颜色
|
|
9
|
+
.xt-text--primary {
|
|
10
|
+
color: $xt-color-primary;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.xt-text--success {
|
|
14
|
+
color: $xt-color-success;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.xt-text--warning {
|
|
18
|
+
color: $xt-color-warning;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.xt-text--danger {
|
|
22
|
+
color: $xt-color-danger;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 粗体
|
|
26
|
+
.xt-text--bold {
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 暗色主题
|
|
31
|
+
html.dark .xt-text--primary {
|
|
32
|
+
color: $xt-color-primary;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
html.dark .xt-text--success {
|
|
36
|
+
color: $xt-dark-color-success;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
html.dark .xt-text--warning {
|
|
40
|
+
color: $xt-dark-color-warning;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
html.dark .xt-text--danger {
|
|
44
|
+
color: $xt-dark-color-danger;
|
|
45
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// 导入主题样式(定义 CSS 变量)
|
|
2
|
-
import './styles/
|
|
2
|
+
import './styles/css-variables.scss'
|
|
3
3
|
|
|
4
4
|
// 导入组件样式(统一入口)
|
|
5
5
|
import './components/index.scss'
|
|
6
6
|
|
|
7
7
|
// 导入 SCSS 变量(通过 CSS Modules :export 导出)
|
|
8
|
-
import variables from './styles/export.scss'
|
|
8
|
+
import variables from './styles/variables-export.scss'
|
|
9
9
|
|
|
10
10
|
import utilsModule from './utils/index'
|
|
11
11
|
|
|
@@ -22,6 +22,7 @@ import FlexBox from './components/flex-box'
|
|
|
22
22
|
import Card from './components/card'
|
|
23
23
|
import CardItem from './components/card-item'
|
|
24
24
|
import ConfigProvider from './components/config-provider'
|
|
25
|
+
import Text from './components/text'
|
|
25
26
|
|
|
26
27
|
// 存储组件列表
|
|
27
28
|
const components = [
|
|
@@ -30,7 +31,8 @@ const components = [
|
|
|
30
31
|
FlexBox,
|
|
31
32
|
Card,
|
|
32
33
|
CardItem,
|
|
33
|
-
ConfigProvider
|
|
34
|
+
ConfigProvider,
|
|
35
|
+
Text
|
|
34
36
|
]
|
|
35
37
|
|
|
36
38
|
|
|
@@ -93,7 +95,8 @@ export default {
|
|
|
93
95
|
FlexBox,
|
|
94
96
|
Card,
|
|
95
97
|
CardItem,
|
|
96
|
-
ConfigProvider
|
|
98
|
+
ConfigProvider,
|
|
99
|
+
Text
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
// 导出工具函数和变量
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
$xt-color-primary: #1890ff; // 主颜色 - XT UI 标准蓝色
|
|
2
|
+
$xt-color-success: #37c3a4; // 成功色 - XT UI 标准绿色
|
|
3
|
+
$xt-color-warning: #FFB74D; // 警告色 - XT UI 标准橙色
|
|
4
|
+
$xt-color-danger: #EA1D34; // 危险色 - XT UI 标准红色
|
|
5
|
+
$xt-color-info: #999999; // 信息色 - XT UI 标准灰色
|
|
6
|
+
|
|
7
|
+
$xt-color-primary-light-3: #5DB1FF; // 主色浅色 30%
|
|
8
|
+
$xt-color-primary-light-5: #8CC8FF; // 主色浅色 50%
|
|
9
|
+
$xt-color-primary-light-7: #BADEFF; // 主色浅色 70%
|
|
10
|
+
$xt-color-primary-light-8: #D1E9FF; // 主色浅色 80%
|
|
11
|
+
$xt-color-primary-light-9: #E8F4FF; // 主色浅色 90%
|
|
@@ -45,10 +45,10 @@ $xt-flex-box-gap: 8px; // FlexBox 默认间距
|
|
|
45
45
|
// ===========================
|
|
46
46
|
$xt-header-bg: #ffffff; // 头部背景色
|
|
47
47
|
$xt-header-text-color: #303133; // 头部文字颜色
|
|
48
|
-
$xt-header-active-text: #
|
|
49
|
-
$xt-header-hover-text: #
|
|
48
|
+
$xt-header-active-text: #1890ff; // 头部激活状态文字颜色
|
|
49
|
+
$xt-header-hover-text: #1890ff; // 头部悬停状态文字颜色
|
|
50
50
|
|
|
51
|
-
$xt-hamburger-bg: #
|
|
51
|
+
$xt-hamburger-bg: #1890ff; // 汉堡按钮背景色
|
|
52
52
|
|
|
53
53
|
$xt-menu-bg: #304156; // 菜单背景色
|
|
54
54
|
$xt-menu-hover: #263445; // 菜单悬停背景色
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
@import './
|
|
2
|
-
@import './
|
|
3
|
-
@import './
|
|
4
|
-
@import './
|
|
1
|
+
@import './colors.scss';
|
|
2
|
+
@import './typography.scss';
|
|
3
|
+
@import './background.scss';
|
|
4
|
+
@import './borders.scss';
|
|
5
5
|
@import './font.scss';
|
|
6
6
|
@import './spacing.scss';
|
|
7
|
-
@import './radius.scss';
|
|
8
|
-
@import './
|
|
9
|
-
@import './
|
|
10
|
-
@import './dark.scss';
|
|
11
|
-
@import './component.scss';
|
|
7
|
+
@import './border-radius.scss';
|
|
8
|
+
@import './shadows.scss';
|
|
9
|
+
@import './transitions.scss';
|
|
10
|
+
@import './dark-variables.scss';
|
|
11
|
+
@import './component-variables.scss';
|
package/src/utils/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// 默认配置
|
|
2
2
|
const defaultConfig = {
|
|
3
|
-
theme: '
|
|
3
|
+
theme: 'white',
|
|
4
4
|
size: 'medium',
|
|
5
|
-
primaryColor: '#
|
|
5
|
+
primaryColor: '#1890ff'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// 当前配置
|
|
@@ -46,7 +46,7 @@ export const setConfig = function(config) {
|
|
|
46
46
|
|
|
47
47
|
// 设置主题
|
|
48
48
|
export const setTheme = function(theme) {
|
|
49
|
-
const validThemes = ['
|
|
49
|
+
const validThemes = ['white', 'dark']
|
|
50
50
|
if (!validThemes.includes(theme)) {
|
|
51
51
|
console.warn(`[XtElementUI] 无效的主题值: ${theme},可选值: ${validThemes.join(', ')}`)
|
|
52
52
|
return
|
|
@@ -57,10 +57,8 @@ export const setTheme = function(theme) {
|
|
|
57
57
|
|
|
58
58
|
// 使用类名方式切换主题(兼容 Element Plus 风格)
|
|
59
59
|
if (theme === 'dark') {
|
|
60
|
-
root.classList.add('dark')
|
|
61
60
|
root.setAttribute('data-theme', 'dark')
|
|
62
61
|
} else {
|
|
63
|
-
root.classList.remove('dark')
|
|
64
62
|
root.removeAttribute('data-theme')
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
$xt-color-primary: #409EFF; // 主颜色 - Element UI 标准蓝色
|
|
2
|
-
$xt-color-success: #67C23A; // 成功色 - Element UI 标准绿色
|
|
3
|
-
$xt-color-warning: #E6A23C; // 警告色 - Element UI 标准橙色
|
|
4
|
-
$xt-color-danger: #F56C6C; // 危险色 - Element UI 标准红色
|
|
5
|
-
$xt-color-info: #909399; // 信息色 - Element UI 标准灰色
|
|
6
|
-
|
|
7
|
-
$xt-color-primary-light-3: #79BBFF; // 主色浅色 30%
|
|
8
|
-
$xt-color-primary-light-5: #A0CFFF; // 主色浅色 50%
|
|
9
|
-
$xt-color-primary-light-7: #C6E2FF; // 主色浅色 70%
|
|
10
|
-
$xt-color-primary-light-8: #D9ECFF; // 主色浅色 80%
|
|
11
|
-
$xt-color-primary-light-9: #ECF5FF; // 主色浅色 90%
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|