@tendaui/components 1.3.0 → 1.3.1

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.
Files changed (142) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +176 -176
  3. package/button/_example/ghost.tsx +2 -5
  4. package/color-picker/utils/color-picker/cmyk.ts +89 -89
  5. package/color-picker/utils/color-picker/color.ts +467 -467
  6. package/color-picker/utils/color-picker/constants.ts +187 -187
  7. package/color-picker/utils/color-picker/draggable.ts +99 -99
  8. package/color-picker/utils/color-picker/format.ts +90 -90
  9. package/color-picker/utils/color-picker/gradient.ts +237 -237
  10. package/color-picker/utils/color-picker/index.ts +7 -7
  11. package/color-picker/utils/color-picker/types.ts +33 -33
  12. package/dialog/hooks/useDialogPosition.ts +35 -35
  13. package/form/type.ts +519 -519
  14. package/global-config/default-config.ts +95 -95
  15. package/global-config/locale/ar_KW.ts +259 -259
  16. package/global-config/locale/en_US.ts +265 -265
  17. package/global-config/locale/it_IT.ts +264 -264
  18. package/global-config/locale/ja_JP.ts +264 -264
  19. package/global-config/locale/ko_KR.ts +264 -264
  20. package/global-config/locale/ru_RU.ts +277 -277
  21. package/global-config/locale/zh_CN.ts +265 -265
  22. package/global-config/locale/zh_TW.ts +265 -265
  23. package/global-config/mobile/default-config.ts +6 -6
  24. package/global-config/mobile/locale/ar_KW.ts +112 -112
  25. package/global-config/mobile/locale/en_US.ts +113 -113
  26. package/global-config/mobile/locale/it_IT.ts +113 -113
  27. package/global-config/mobile/locale/ja_JP.ts +100 -100
  28. package/global-config/mobile/locale/ko_KR.ts +100 -100
  29. package/global-config/mobile/locale/ru_RU.ts +112 -112
  30. package/global-config/mobile/locale/zh_CN.ts +100 -100
  31. package/global-config/mobile/locale/zh_TW.ts +100 -100
  32. package/global-config/t.ts +111 -111
  33. package/input-number/InputNumber.tsx +124 -124
  34. package/input-number/defaultProps.ts +17 -17
  35. package/input-number/index.ts +9 -9
  36. package/input-number/style/css.js +1 -1
  37. package/input-number/style/index.js +1 -1
  38. package/input-number/useInputNumber.tsx +270 -270
  39. package/list/ListItem.tsx +36 -36
  40. package/list/ListItemMeta.tsx +40 -40
  41. package/list/defaultProps.ts +11 -11
  42. package/list/hooks/useListVirtualScroll.ts +82 -82
  43. package/list/style/css.js +1 -1
  44. package/list/style/index.js +1 -1
  45. package/locale/LocalReceiver.ts +55 -55
  46. package/locale/ar_KW.ts +7 -7
  47. package/locale/en_US.ts +7 -7
  48. package/locale/it_IT.ts +6 -6
  49. package/locale/ja_JP.ts +6 -6
  50. package/locale/ko_KR.ts +6 -6
  51. package/locale/ru_RU.ts +6 -6
  52. package/locale/zh_CN.ts +5 -5
  53. package/locale/zh_TW.ts +7 -7
  54. package/package.json +2 -2
  55. package/radio/_example/default.tsx +2 -2
  56. package/select/type.ts +382 -382
  57. package/select-input/type.ts +280 -280
  58. package/slider/SliderHandleButton.tsx +50 -50
  59. package/slider/defaultProps.ts +15 -15
  60. package/slider/style/css.js +1 -1
  61. package/slider/style/index.js +1 -1
  62. package/styles/_global.scss +40 -40
  63. package/styles/_vars.scss +374 -374
  64. package/styles/components/alert/_index.scss +175 -175
  65. package/styles/components/alert/_vars.scss +41 -41
  66. package/styles/components/badge/_index.scss +71 -71
  67. package/styles/components/badge/_vars.scss +26 -26
  68. package/styles/components/button/_index.scss +499 -499
  69. package/styles/components/button/_mixins.scss +40 -40
  70. package/styles/components/button/_vars.scss +121 -121
  71. package/styles/components/checkbox/_index.scss +158 -158
  72. package/styles/components/checkbox/_var.scss +59 -59
  73. package/styles/components/color-picker/_index.scss +586 -586
  74. package/styles/components/color-picker/_vars.scss +79 -79
  75. package/styles/components/dialog/_animate.scss +133 -133
  76. package/styles/components/dialog/_index.scss +310 -310
  77. package/styles/components/dialog/_vars.scss +60 -60
  78. package/styles/components/drawer/_index.scss +206 -206
  79. package/styles/components/drawer/_var.scss +55 -55
  80. package/styles/components/fireworks/_index.scss +86 -86
  81. package/styles/components/fireworks/_vars.scss +5 -5
  82. package/styles/components/form/_index.scss +175 -175
  83. package/styles/components/form/_mixins.scss +74 -74
  84. package/styles/components/form/_vars.scss +101 -101
  85. package/styles/components/input/_index.scss +350 -350
  86. package/styles/components/input/_mixins.scss +120 -120
  87. package/styles/components/input/_vars.scss +130 -130
  88. package/styles/components/input-number/_index.scss +327 -327
  89. package/styles/components/input-number/_vars.scss +56 -56
  90. package/styles/components/ip-input/_index.scss +277 -277
  91. package/styles/components/layout/_index.scss +47 -47
  92. package/styles/components/layout/_vars.scss +19 -19
  93. package/styles/components/layout/doc.scss +74 -74
  94. package/styles/components/list/_index.scss +172 -172
  95. package/styles/components/list/_vars.scss +42 -42
  96. package/styles/components/loading/_index.scss +113 -113
  97. package/styles/components/loading/_vars.scss +40 -40
  98. package/styles/components/notification/_index.scss +140 -140
  99. package/styles/components/notification/_mixins.scss +13 -13
  100. package/styles/components/notification/_vars.scss +60 -60
  101. package/styles/components/popup/_index.scss +78 -78
  102. package/styles/components/popup/_mixin.scss +149 -149
  103. package/styles/components/popup/_vars.scss +33 -33
  104. package/styles/components/radio/_index.scss +376 -376
  105. package/styles/components/radio/_vars.scss +89 -89
  106. package/styles/components/select/_index.scss +291 -291
  107. package/styles/components/select/_var.scss +64 -64
  108. package/styles/components/select-input/_index.scss +5 -5
  109. package/styles/components/select-input/_var.scss +4 -4
  110. package/styles/components/slider/_index.scss +241 -241
  111. package/styles/components/slider/_vars.scss +51 -51
  112. package/styles/components/switch/_index.scss +175 -175
  113. package/styles/components/switch/_vars.scss +63 -63
  114. package/styles/components/table/_index.scss +194 -194
  115. package/styles/components/table/_var.scss +52 -52
  116. package/styles/components/tabs/_index.scss +165 -165
  117. package/styles/components/tabs/_mixins.scss +11 -11
  118. package/styles/components/tabs/_vars.scss +72 -72
  119. package/styles/components/tag/_index.scss +317 -317
  120. package/styles/components/tag/_var.scss +86 -86
  121. package/styles/components/tag-input/_index.scss +164 -164
  122. package/styles/components/tag-input/_vars.scss +17 -17
  123. package/styles/mixins/_focus.scss +8 -8
  124. package/styles/mixins/_layout.scss +32 -32
  125. package/styles/mixins/_reset.scss +11 -11
  126. package/styles/mixins/_scrollbar.scss +32 -32
  127. package/styles/mixins/_text.scss +50 -50
  128. package/styles/themes/_dark.scss +169 -169
  129. package/styles/themes/_font.scss +69 -69
  130. package/styles/themes/_index.scss +5 -5
  131. package/styles/themes/_light.scss +170 -170
  132. package/styles/themes/_radius.scss +9 -9
  133. package/styles/themes/_size.scss +68 -68
  134. package/styles/utilities/_animation.scss +58 -58
  135. package/styles/utilities/_tips.scss +10 -10
  136. package/switch/_example/with-label.tsx +1 -1
  137. package/utils/input-number/large-number.ts +423 -423
  138. package/utils/input-number/number.ts +257 -257
  139. package/utils/log/index.ts +3 -3
  140. package/utils/log/log.ts +29 -29
  141. package/utils/log/types.ts +9 -9
  142. package/utils/style.ts +58 -58
@@ -1,51 +1,51 @@
1
- @use "../../_vars.scss" as *;
2
- $slider-background: $bg-color-secondarycomponent;
3
- $slider-background-current: $brand-color;
4
- $slider-text: $text-color-primary;
5
- $slider-control-bar-background: #fff; // 滑块背景色不随默认深色模式切换改变,固定为白色,故不使用背景色 token
6
- $slider-control-bar-border: $brand-color;
7
-
8
- $slider-background-hover: $bg-color-secondarycomponent-hover;
9
- $slider-control-bar-background-hover: $gray-color-1; // 滑块背景色不随默认深色模式切换改变,hover 后颜色固定为 $gray-color-1
10
-
11
- $slider-background-disabled: $bg-color-component-disabled;
12
- $slider-background-current-disabled: $brand-color-disabled;
13
- $slider-control-bar-border-disabled: $brand-color-disabled;
14
- $slider-text-disabled: $text-color-disabled;
15
- $slider-shadow: $shadow-1;
16
- $slider-input-shadow: 0 0 0px 2px $brand-color-focus;
17
- $slider-center-line-background: rgba(0, 0, 0, 90%);
18
-
19
- // 尺寸
20
- $slider-input-width: 80px;
21
- $slider-row-input-width: 120px;
22
- $slider-rail-track-step-size: $size-2;
23
- $slider-height: calc($comp-paddingTB-xs * 2 + $slider-rail-track-step-size);
24
- $slider-control-bar-size: $comp-size-xxxs;
25
- $slider-vertical-height: 100%;
26
- $slider-vertical-mark-width: 18px;
27
- $slider-stop-width: 1px;
28
- $slider-stop-height: $size-2;
29
- $slider-center-line-width: $size-4;
30
- $slider-center-line-height: 1px;
31
-
32
- // 边距
33
- $slider-input-margin-left: $comp-margin-xxl;
34
- $slider-input-vertical-padding-top: $comp-paddingTB-l;
35
- $slider-input-vertical-margin-left: 0px;
36
- $slider-padding: $comp-paddingTB-xs 0;
37
- $slider-vertical-padding: 0;
38
- $slider-vertical-handle-margin-top: -6px;
39
- $slider-vertical-handle-margin-left: -5px;
40
- $slider-vertical-text-margin-top: 0;
41
- $slider-vertical-text-margin-left: $comp-margin-xxs;
42
- $slider-center-line-margin: 0 $comp-margin-s;
43
-
44
- // 字体
45
- $slider-text-font: $font-body-small;
46
-
47
- // 边框
48
- $slider-border-radius: $border-radius-round;
49
-
50
- // 定位
51
- $slider-text-top: calc($slider-rail-track-step-size + $comp-paddingTB-xs + 2px);
1
+ @use "../../_vars.scss" as *;
2
+ $slider-background: $bg-color-secondarycomponent;
3
+ $slider-background-current: $brand-color;
4
+ $slider-text: $text-color-primary;
5
+ $slider-control-bar-background: #fff; // 滑块背景色不随默认深色模式切换改变,固定为白色,故不使用背景色 token
6
+ $slider-control-bar-border: $brand-color;
7
+
8
+ $slider-background-hover: $bg-color-secondarycomponent-hover;
9
+ $slider-control-bar-background-hover: $gray-color-1; // 滑块背景色不随默认深色模式切换改变,hover 后颜色固定为 $gray-color-1
10
+
11
+ $slider-background-disabled: $bg-color-component-disabled;
12
+ $slider-background-current-disabled: $brand-color-disabled;
13
+ $slider-control-bar-border-disabled: $brand-color-disabled;
14
+ $slider-text-disabled: $text-color-disabled;
15
+ $slider-shadow: $shadow-1;
16
+ $slider-input-shadow: 0 0 0px 2px $brand-color-focus;
17
+ $slider-center-line-background: rgba(0, 0, 0, 90%);
18
+
19
+ // 尺寸
20
+ $slider-input-width: 80px;
21
+ $slider-row-input-width: 120px;
22
+ $slider-rail-track-step-size: $size-2;
23
+ $slider-height: calc($comp-paddingTB-xs * 2 + $slider-rail-track-step-size);
24
+ $slider-control-bar-size: $comp-size-xxxs;
25
+ $slider-vertical-height: 100%;
26
+ $slider-vertical-mark-width: 18px;
27
+ $slider-stop-width: 1px;
28
+ $slider-stop-height: $size-2;
29
+ $slider-center-line-width: $size-4;
30
+ $slider-center-line-height: 1px;
31
+
32
+ // 边距
33
+ $slider-input-margin-left: $comp-margin-xxl;
34
+ $slider-input-vertical-padding-top: $comp-paddingTB-l;
35
+ $slider-input-vertical-margin-left: 0px;
36
+ $slider-padding: $comp-paddingTB-xs 0;
37
+ $slider-vertical-padding: 0;
38
+ $slider-vertical-handle-margin-top: -6px;
39
+ $slider-vertical-handle-margin-left: -5px;
40
+ $slider-vertical-text-margin-top: 0;
41
+ $slider-vertical-text-margin-left: $comp-margin-xxs;
42
+ $slider-center-line-margin: 0 $comp-margin-s;
43
+
44
+ // 字体
45
+ $slider-text-font: $font-body-small;
46
+
47
+ // 边框
48
+ $slider-border-radius: $border-radius-round;
49
+
50
+ // 定位
51
+ $slider-text-top: calc($slider-rail-track-step-size + $comp-paddingTB-xs + 2px);
@@ -1,38 +1,38 @@
1
- @use "../../_vars.scss" as *;
2
- @use "../../_vars.scss" as *;
3
-
4
- @use "./_vars.scss" as *;
5
-
6
- @use "./_mixins.scss" as *;
7
-
8
- @use "../../mixins/_reset.scss" as *;
9
-
10
- .#{$prefix}-switch {
11
- @include reset;
12
-
13
- position: relative;
14
- display: inline-flex;
15
- vertical-align: middle;
16
- align-items: center;
17
- outline: none;
18
- border: 0;
19
- padding: 0;
20
- margin: 0;
21
- height: $switch-height-default;
22
- line-height: $switch-height-default;
23
- border-radius: $border-radius-round;
24
- min-width: $switch-min-width-default;
25
- transition: $switch-transition;
26
- background-color: $switch-unchecked-bg-color;
27
- cursor: pointer;
28
- user-select: none;
29
-
30
- &:hover {
31
- background-color: $switch-unchecked-bg-color-hover;
32
- }
33
-
34
- &__handle {
35
- position: absolute;
1
+ @use "../../_vars.scss" as *;
2
+ @use "../../_vars.scss" as *;
3
+
4
+ @use "./_vars.scss" as *;
5
+
6
+ @use "./_mixins.scss" as *;
7
+
8
+ @use "../../mixins/_reset.scss" as *;
9
+
10
+ .#{$prefix}-switch {
11
+ @include reset;
12
+
13
+ position: relative;
14
+ display: inline-flex;
15
+ vertical-align: middle;
16
+ align-items: center;
17
+ outline: none;
18
+ border: 0;
19
+ padding: 0;
20
+ margin: 0;
21
+ height: $switch-height-default;
22
+ line-height: $switch-height-default;
23
+ border-radius: $border-radius-round;
24
+ min-width: $switch-min-width-default;
25
+ transition: $switch-transition;
26
+ background-color: $switch-unchecked-bg-color;
27
+ cursor: pointer;
28
+ user-select: none;
29
+
30
+ &:hover {
31
+ background-color: $switch-unchecked-bg-color-hover;
32
+ }
33
+
34
+ &__handle {
35
+ position: absolute;
36
36
  display: flex;
37
37
  align-items: center;
38
38
  justify-content: center;
@@ -43,25 +43,25 @@
43
43
  border-radius: $border-radius-round;
44
44
  transition: $switch-handle-transition;
45
45
  box-shadow: $shadow-1;
46
-
47
- .t-icon {
48
- font-size: calc($switch-height-default - 4px);
49
- color: transparent;
50
- }
51
-
52
- &::before {
53
- content: "";
54
- position: absolute;
55
- top: 0;
56
- left: 0;
57
- right: 0;
58
- bottom: 0;
59
- border-radius: $border-radius-round;
60
- background-color: $switch-handle-bg-color;
61
- transition: $switch-handle-transition;
62
- }
63
- }
64
-
46
+
47
+ .t-icon {
48
+ font-size: calc($switch-height-default - 4px);
49
+ color: transparent;
50
+ }
51
+
52
+ &::before {
53
+ content: "";
54
+ position: absolute;
55
+ top: 0;
56
+ left: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ border-radius: $border-radius-round;
60
+ background-color: $switch-handle-bg-color;
61
+ transition: $switch-handle-transition;
62
+ }
63
+ }
64
+
65
65
  &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
66
66
  .#{$prefix}-switch__handle::before {
67
67
  left: 0;
@@ -74,34 +74,34 @@
74
74
  left: -6px;
75
75
  }
76
76
  }
77
-
78
- .#{$prefix}-switch__content {
79
- opacity: 0;
80
- }
81
- }
82
-
83
- &__content {
84
- box-sizing: border-box;
85
- display: inline-flex;
86
- align-items: center;
87
- color: $switch-content-color-unchecked;
88
- padding: 0 $switch-content-margin-right-default 0 $switch-content-margin-left-default;
89
- font-size: $switch-content-font-size-default;
90
- min-width: $switch-min-width-default;
91
- transition: $switch-content-transition;
92
-
93
- .t-icon {
94
- font-size: $font-size-l;
95
- }
96
- }
97
-
98
- &.#{$prefix}-is-checked {
99
- background-color: $switch-checked-bg-color;
100
-
101
- &:hover {
102
- background-color: $switch-checked-bg-color-hover;
103
- }
104
-
77
+
78
+ .#{$prefix}-switch__content {
79
+ opacity: 0;
80
+ }
81
+ }
82
+
83
+ &__content {
84
+ box-sizing: border-box;
85
+ display: inline-flex;
86
+ align-items: center;
87
+ color: $switch-content-color-unchecked;
88
+ padding: 0 $switch-content-margin-right-default 0 $switch-content-margin-left-default;
89
+ font-size: $switch-content-font-size-default;
90
+ min-width: $switch-min-width-default;
91
+ transition: $switch-content-transition;
92
+
93
+ .t-icon {
94
+ font-size: $font-size-l;
95
+ }
96
+ }
97
+
98
+ &.#{$prefix}-is-checked {
99
+ background-color: $switch-checked-bg-color;
100
+
101
+ &:hover {
102
+ background-color: $switch-checked-bg-color-hover;
103
+ }
104
+
105
105
  .#{$prefix}-switch__handle {
106
106
  left: calc(100% - $switch-width-border-check-default);
107
107
  transform: translate(-100%, 0);
@@ -109,57 +109,57 @@
109
109
  height: calc($switch-height-default - 2 * $switch-width-border-check-default);
110
110
  top: $switch-width-border-check-default;
111
111
  }
112
-
113
- .#{$prefix}-switch__content {
114
- padding: 0 $switch-content-margin-left-default 0 $switch-content-margin-right-default;
115
- color: $switch-content-color-checked;
116
- }
117
- }
118
-
119
- &.#{$prefix}-is-loading {
120
- cursor: not-allowed;
121
- background-color: $switch-unchecked-bg-color-loading;
122
-
123
- .#{$prefix}-loading {
124
- display: inline-flex;
125
- }
126
-
127
- .#{$prefix}-switch__handle {
128
- .t-icon {
129
- color: $switch-unchecked-bg-color-loading;
130
- }
131
- }
132
-
133
- &.#{$prefix}-is-checked {
134
- background-color: $switch-checked-bg-color-loading;
135
-
136
- .#{$prefix}-switch__handle {
137
- .t-icon {
138
- color: $switch-checked-bg-color-loading;
139
- }
140
- }
141
- }
142
- }
143
-
144
- &.#{$prefix}-is-disabled {
145
- cursor: not-allowed;
146
- background-color: $switch-unchecked-bg-color-disabled;
147
-
148
- .#{$prefix}-switch__handle {
149
- box-shadow: none;
150
- }
151
-
152
- &.#{$prefix}-is-checked {
153
- background-color: $switch-checked-bg-color-disabled;
154
-
155
- .#{$prefix}-switch__handle {
156
- box-shadow: none;
157
-
158
- .t-icon {
159
- color: $switch-checked-bg-color-disabled;
160
- }
161
- }
162
- }
112
+
113
+ .#{$prefix}-switch__content {
114
+ padding: 0 $switch-content-margin-left-default 0 $switch-content-margin-right-default;
115
+ color: $switch-content-color-checked;
116
+ }
117
+ }
118
+
119
+ &.#{$prefix}-is-loading {
120
+ cursor: not-allowed;
121
+ background-color: $switch-unchecked-bg-color-loading;
122
+
123
+ .#{$prefix}-loading {
124
+ display: inline-flex;
125
+ }
126
+
127
+ .#{$prefix}-switch__handle {
128
+ .t-icon {
129
+ color: $switch-unchecked-bg-color-loading;
130
+ }
131
+ }
132
+
133
+ &.#{$prefix}-is-checked {
134
+ background-color: $switch-checked-bg-color-loading;
135
+
136
+ .#{$prefix}-switch__handle {
137
+ .t-icon {
138
+ color: $switch-checked-bg-color-loading;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ &.#{$prefix}-is-disabled {
145
+ cursor: not-allowed;
146
+ background-color: $switch-unchecked-bg-color-disabled;
147
+
148
+ .#{$prefix}-switch__handle {
149
+ box-shadow: none;
150
+ }
151
+
152
+ &.#{$prefix}-is-checked {
153
+ background-color: $switch-checked-bg-color-disabled;
154
+
155
+ .#{$prefix}-switch__handle {
156
+ box-shadow: none;
157
+
158
+ .t-icon {
159
+ color: $switch-checked-bg-color-disabled;
160
+ }
161
+ }
162
+ }
163
163
  }
164
164
  }
165
165
 
@@ -197,7 +197,7 @@
197
197
  height: $switch-height-l;
198
198
  line-height: $switch-height-l;
199
199
  border-radius: $border-radius-round;
200
-
200
+
201
201
  &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
202
202
  .#{$prefix}-switch__handle::before {
203
203
  left: 0;
@@ -217,22 +217,22 @@
217
217
  left: $switch-width-border-l;
218
218
  width: calc($switch-height-l - 2 * $switch-width-border-l);
219
219
  height: calc($switch-height-l - 2 * $switch-width-border-l);
220
-
221
- .t-icon {
222
- font-size: calc($switch-height-l - 4px);
223
- }
224
- }
225
-
226
- .#{$prefix}-switch__content {
227
- padding: 0 $switch-content-margin-right-l 0 $switch-content-margin-left-l;
228
- min-width: $switch-min-width-l;
229
- font-size: $switch-content-font-size-l;
230
-
231
- .t-icon {
232
- font-size: $switch-content-font-size-l;
233
- }
234
- }
235
-
220
+
221
+ .t-icon {
222
+ font-size: calc($switch-height-l - 4px);
223
+ }
224
+ }
225
+
226
+ .#{$prefix}-switch__content {
227
+ padding: 0 $switch-content-margin-right-l 0 $switch-content-margin-left-l;
228
+ min-width: $switch-min-width-l;
229
+ font-size: $switch-content-font-size-l;
230
+
231
+ .t-icon {
232
+ font-size: $switch-content-font-size-l;
233
+ }
234
+ }
235
+
236
236
  &.#{$prefix}-is-checked {
237
237
  .#{$prefix}-switch__handle {
238
238
  left: calc(100% - $switch-width-border-check-l);
@@ -241,10 +241,10 @@
241
241
  width: calc($switch-height-l - 2 * $switch-width-border-check-l);
242
242
  height: calc($switch-height-l - 2 * $switch-width-border-check-l);
243
243
  }
244
-
245
- .#{$prefix}-switch__content {
246
- padding: 0 $switch-content-margin-left-l 0 $switch-content-margin-right-l;
247
- }
244
+
245
+ .#{$prefix}-switch__content {
246
+ padding: 0 $switch-content-margin-left-l 0 $switch-content-margin-right-l;
247
+ }
248
248
  }
249
249
  }
250
250
 
@@ -282,7 +282,7 @@
282
282
  height: $switch-height-s;
283
283
  line-height: $switch-height-s;
284
284
  border-radius: $border-radius-round;
285
-
285
+
286
286
  &:active:not(.#{$prefix}-is-disabled):not(.#{$prefix}-is-loading) {
287
287
  .#{$prefix}-switch__handle::before {
288
288
  left: 0;
@@ -302,22 +302,22 @@
302
302
  left: $switch-width-border-s;
303
303
  width: calc($switch-height-s - 2 * $switch-width-border-s);
304
304
  height: calc($switch-height-s - 2 * $switch-width-border-s);
305
-
306
- .t-icon {
307
- font-size: calc($switch-height-s - 4px);
308
- }
309
- }
310
-
311
- .#{$prefix}-switch__content {
312
- padding: 0 $switch-content-margin-right-s 0 $switch-content-margin-left-s;
313
- min-width: $switch-min-width-s;
314
- font-size: $switch-content-font-size-s;
315
-
316
- .t-icon {
317
- font-size: $switch-content-font-size-l;
318
- }
319
- }
320
-
305
+
306
+ .t-icon {
307
+ font-size: calc($switch-height-s - 4px);
308
+ }
309
+ }
310
+
311
+ .#{$prefix}-switch__content {
312
+ padding: 0 $switch-content-margin-right-s 0 $switch-content-margin-left-s;
313
+ min-width: $switch-min-width-s;
314
+ font-size: $switch-content-font-size-s;
315
+
316
+ .t-icon {
317
+ font-size: $switch-content-font-size-l;
318
+ }
319
+ }
320
+
321
321
  &.#{$prefix}-is-checked {
322
322
  .#{$prefix}-switch__handle {
323
323
  left: calc(100% - $switch-width-border-check-s);
@@ -326,10 +326,10 @@
326
326
  width: calc($switch-height-s - 2 * $switch-width-border-check-s);
327
327
  height: calc($switch-height-s - 2 * $switch-width-border-check-s);
328
328
  }
329
-
330
- .#{$prefix}-switch__content {
331
- padding: 0 $switch-content-margin-left-s 0 $switch-content-margin-right-s;
332
- }
329
+
330
+ .#{$prefix}-switch__content {
331
+ padding: 0 $switch-content-margin-left-s 0 $switch-content-margin-right-s;
332
+ }
333
333
  }
334
334
  }
335
335
 
@@ -1,63 +1,63 @@
1
- @use "../../_vars.scss" as *;
2
-
3
- // 颜色
4
- $switch-checked-bg-color: $brand-color;
5
- $switch-checked-bg-color-hover: $brand-color-hover;
6
- $switch-checked-bg-color-loading: $brand-color-focus;
7
- $switch-checked-bg-color-disabled: $brand-color-disabled;
8
-
9
- $switch-unchecked-bg-color: $bg-color-secondarycomponent;
10
- $switch-unchecked-bg-color-hover: $bg-color-secondarycomponent-hover;
11
- $switch-unchecked-bg-color-loading: $bg-color-component-disabled;
12
- $switch-unchecked-bg-color-disabled: $bg-color-component-disabled;
13
-
14
- $switch-handle-bg-color: #fff;
15
- $switch-content-color-checked: $text-color-anti;
16
- $switch-content-color-unchecked: $text-color-anti;
17
-
18
- // 尺寸
19
- $switch-height-l: $comp-size-xs;
20
- $switch-height-default: $comp-size-xxs;
21
- $switch-height-s: $comp-size-xxxs;
22
-
23
- $switch-min-width-l: calc($switch-height-l / 0.618);
24
- $switch-min-width-default: calc($switch-height-default / 0.618);
25
- $switch-min-width-s: calc($switch-height-s / 0.618);
26
-
27
- //change uncheck handle size
28
- $switch-width-border-base: 5px;
29
- $switch-width-border-value: 1px; //公差
30
-
31
- $switch-width-border-l: $switch-width-border-base;
32
- $switch-width-border-default: ($switch-width-border-base - $switch-width-border-value * 1);
33
- $switch-width-border-s: ($switch-width-border-base - $switch-width-border-value * 2);
34
-
35
- //change check handle size
36
- $switch-width-border-check-base: 3px;
37
- $switch-width-border-check-value: 0.5px; //公差
38
-
39
- $switch-width-border-check-l: $switch-width-border-check-base;
40
- $switch-width-border-check-default: ($switch-width-border-check-base - $switch-width-border-check-value * 1);
41
- $switch-width-border-check-s: ($switch-width-border-check-base - $switch-width-border-check-value * 2);
42
-
43
- // 字体
44
- $switch-content-font-size-l: $font-size-l;
45
- $switch-content-font-size-default: $font-size-s;
46
- $switch-content-font-size-s: 9px;
47
-
48
- // 间距
49
- $switch-content-margin-left-l: calc($switch-min-width-l / 2 + 4px);
50
- $switch-content-margin-right-l: $comp-margin-s;
51
-
52
- $switch-content-margin-left-default: calc($switch-min-width-default / 2 + 2px);
53
- $switch-content-margin-right-default: $comp-margin-xs;
54
-
55
- $switch-content-margin-left-s: calc($switch-min-width-s / 2 + 2px);
56
- $switch-content-margin-right-s: $comp-margin-xxs;
57
-
58
- // 动画
59
- $switch-transition: all $anim-duration-base $anim-time-fn-easing;
60
- $switch-handle-transition: all $anim-duration-base $anim-time-fn-easing;
61
- $switch-content-transition:
62
- padding $anim-duration-base $anim-time-fn-easing,
63
- opacity $anim-duration-base linear;
1
+ @use "../../_vars.scss" as *;
2
+
3
+ // 颜色
4
+ $switch-checked-bg-color: $brand-color;
5
+ $switch-checked-bg-color-hover: $brand-color-hover;
6
+ $switch-checked-bg-color-loading: $brand-color-focus;
7
+ $switch-checked-bg-color-disabled: $brand-color-disabled;
8
+
9
+ $switch-unchecked-bg-color: $bg-color-secondarycomponent;
10
+ $switch-unchecked-bg-color-hover: $bg-color-secondarycomponent-hover;
11
+ $switch-unchecked-bg-color-loading: $bg-color-component-disabled;
12
+ $switch-unchecked-bg-color-disabled: $bg-color-component-disabled;
13
+
14
+ $switch-handle-bg-color: #fff;
15
+ $switch-content-color-checked: $text-color-anti;
16
+ $switch-content-color-unchecked: $text-color-anti;
17
+
18
+ // 尺寸
19
+ $switch-height-l: $comp-size-xs;
20
+ $switch-height-default: $comp-size-xxs;
21
+ $switch-height-s: $comp-size-xxxs;
22
+
23
+ $switch-min-width-l: calc($switch-height-l / 0.618);
24
+ $switch-min-width-default: calc($switch-height-default / 0.618);
25
+ $switch-min-width-s: calc($switch-height-s / 0.618);
26
+
27
+ //change uncheck handle size
28
+ $switch-width-border-base: 5px;
29
+ $switch-width-border-value: 1px; //公差
30
+
31
+ $switch-width-border-l: $switch-width-border-base;
32
+ $switch-width-border-default: ($switch-width-border-base - $switch-width-border-value * 1);
33
+ $switch-width-border-s: ($switch-width-border-base - $switch-width-border-value * 2);
34
+
35
+ //change check handle size
36
+ $switch-width-border-check-base: 3px;
37
+ $switch-width-border-check-value: 0.5px; //公差
38
+
39
+ $switch-width-border-check-l: $switch-width-border-check-base;
40
+ $switch-width-border-check-default: ($switch-width-border-check-base - $switch-width-border-check-value * 1);
41
+ $switch-width-border-check-s: ($switch-width-border-check-base - $switch-width-border-check-value * 2);
42
+
43
+ // 字体
44
+ $switch-content-font-size-l: $font-size-l;
45
+ $switch-content-font-size-default: $font-size-s;
46
+ $switch-content-font-size-s: 9px;
47
+
48
+ // 间距
49
+ $switch-content-margin-left-l: calc($switch-min-width-l / 2 + 4px);
50
+ $switch-content-margin-right-l: $comp-margin-s;
51
+
52
+ $switch-content-margin-left-default: calc($switch-min-width-default / 2 + 2px);
53
+ $switch-content-margin-right-default: $comp-margin-xs;
54
+
55
+ $switch-content-margin-left-s: calc($switch-min-width-s / 2 + 2px);
56
+ $switch-content-margin-right-s: $comp-margin-xxs;
57
+
58
+ // 动画
59
+ $switch-transition: all $anim-duration-base $anim-time-fn-easing;
60
+ $switch-handle-transition: all $anim-duration-base $anim-time-fn-easing;
61
+ $switch-content-transition:
62
+ padding $anim-duration-base $anim-time-fn-easing,
63
+ opacity $anim-duration-base linear;