@douyinfe/semi-foundation 2.24.0-alpha.0 → 2.24.0-beta.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.
Files changed (60) hide show
  1. package/cascader/cascader.scss +32 -8
  2. package/cascader/variables.scss +3 -3
  3. package/form/foundation.ts +1 -1
  4. package/highlight/constants.ts +7 -0
  5. package/highlight/highlight.scss +11 -0
  6. package/highlight/variables.scss +5 -0
  7. package/image/previewInnerFoundation.ts +9 -5
  8. package/lib/cjs/cascader/cascader.css +14 -4
  9. package/lib/cjs/cascader/cascader.scss +32 -8
  10. package/lib/cjs/cascader/variables.scss +3 -3
  11. package/lib/cjs/form/foundation.d.ts +1 -1
  12. package/lib/cjs/highlight/constants.d.ts +4 -0
  13. package/lib/cjs/highlight/constants.js +13 -0
  14. package/lib/cjs/highlight/highlight.css +8 -0
  15. package/lib/cjs/highlight/highlight.scss +11 -0
  16. package/lib/cjs/highlight/variables.scss +5 -0
  17. package/lib/cjs/image/previewInnerFoundation.d.ts +2 -0
  18. package/lib/cjs/image/previewInnerFoundation.js +4 -0
  19. package/lib/cjs/select/foundation.d.ts +6 -1
  20. package/lib/cjs/select/foundation.js +31 -16
  21. package/lib/cjs/switch/rtl.scss +14 -14
  22. package/lib/cjs/switch/switch.scss +14 -14
  23. package/lib/cjs/switch/variables.scss +15 -15
  24. package/lib/cjs/tagInput/tagInput.css +0 -1
  25. package/lib/cjs/tagInput/tagInput.scss +1 -1
  26. package/lib/cjs/treeSelect/treeSelect.css +13 -5
  27. package/lib/cjs/treeSelect/treeSelect.scss +31 -9
  28. package/lib/cjs/treeSelect/variables.scss +3 -3
  29. package/lib/cjs/utils/Event.d.ts +1 -1
  30. package/lib/es/cascader/cascader.css +14 -4
  31. package/lib/es/cascader/cascader.scss +32 -8
  32. package/lib/es/cascader/variables.scss +3 -3
  33. package/lib/es/form/foundation.d.ts +1 -1
  34. package/lib/es/highlight/constants.d.ts +4 -0
  35. package/lib/es/highlight/constants.js +5 -0
  36. package/lib/es/highlight/highlight.css +8 -0
  37. package/lib/es/highlight/highlight.scss +11 -0
  38. package/lib/es/highlight/variables.scss +5 -0
  39. package/lib/es/image/previewInnerFoundation.d.ts +2 -0
  40. package/lib/es/image/previewInnerFoundation.js +4 -0
  41. package/lib/es/select/foundation.d.ts +6 -1
  42. package/lib/es/select/foundation.js +31 -16
  43. package/lib/es/switch/rtl.scss +14 -14
  44. package/lib/es/switch/switch.scss +14 -14
  45. package/lib/es/switch/variables.scss +15 -15
  46. package/lib/es/tagInput/tagInput.css +0 -1
  47. package/lib/es/tagInput/tagInput.scss +1 -1
  48. package/lib/es/treeSelect/treeSelect.css +13 -5
  49. package/lib/es/treeSelect/treeSelect.scss +31 -9
  50. package/lib/es/treeSelect/variables.scss +3 -3
  51. package/lib/es/utils/Event.d.ts +1 -1
  52. package/package.json +2 -2
  53. package/select/foundation.ts +34 -14
  54. package/switch/rtl.scss +14 -14
  55. package/switch/switch.scss +14 -14
  56. package/switch/variables.scss +15 -15
  57. package/tagInput/tagInput.scss +1 -1
  58. package/treeSelect/treeSelect.scss +31 -9
  59. package/treeSelect/variables.scss +3 -3
  60. package/utils/Event.ts +1 -1
@@ -159,23 +159,47 @@ $module: #{$prefix}-cascader;
159
159
  background: transparent;
160
160
  margin-left: $spacing-cascader_selection_tagInput-marginLeft;
161
161
  }
162
-
162
+
163
163
  .#{$prefix}-tagInput {
164
+ &-wrapper {
165
+ &-default {
166
+ min-height: $height-cascader_selection_tagInput_wrapper_default;
167
+ }
168
+
169
+ &-small {
170
+ min-height: $height-cascader_selection_tagInput_wrapper_small;
171
+ }
172
+
173
+ &-large {
174
+ min-height: $height-cascader_selection_tagInput_wrapper_large;
175
+ }
176
+ }
177
+
164
178
  .#{$prefix}-input-wrapper {
165
- height: $height-cascader_selection_tagInput_input_default;
179
+ // height: $height-cascader_selection_tagInput_input_default;
166
180
 
167
181
  margin-left: $spacing-cascader_selection_input-marginLeft;
168
182
  .#{$prefix}-input {
169
183
  padding-left: 0;
170
184
  }
171
- }
172
185
 
173
- .#{$prefix}-input-wrapper-small {
174
- height: $height-cascader_selection_tagInput_input_small;
175
- }
176
- .#{$prefix}-input-wrapper-large {
177
- height: $height-cascader_selection_tagInput_input_large;
186
+ &-default {
187
+ margin-top: $spacing-cascader_selection_tag-marginY;
188
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
189
+ }
190
+
191
+ &-large {
192
+ margin-top: $spacing-cascader_selection_tag-marginY;
193
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
194
+ }
178
195
  }
196
+
197
+ // .#{$prefix}-input-wrapper-small {
198
+ // height: $height-cascader_selection_tagInput_input_small;
199
+ // }
200
+ // .#{$prefix}-input-wrapper-large {
201
+ // height: $height-cascader_selection_tagInput_input_large;
202
+ // }
179
203
  }
180
204
 
181
205
  &-text {
@@ -93,9 +93,9 @@ $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
93
93
  $width-cascader-icon: 16px; // 级联选择图标尺寸
94
94
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
95
95
  $height-cascader_option_list: 180px; // 级联选择菜单高度
96
- $height-cascader_selection_tagInput_input_small: 22px;
97
- $height-cascader_selection_tagInput_input_default: 30px;
98
- $height-cascader_selection_tagInput_input_large: 38px;
96
+ $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
97
+ $height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
98
+ $height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
99
99
  $height-cascader_selection_wrapper: 30px;
100
100
 
101
101
  $spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
@@ -8,7 +8,7 @@ import scrollIntoView, { Options as scrollIntoViewOptions } from 'scroll-into-vi
8
8
 
9
9
  import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
10
10
 
11
- export { BaseFormAdapter };
11
+ export type { BaseFormAdapter };
12
12
 
13
13
  export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
14
14
 
@@ -0,0 +1,7 @@
1
+ import { BASE_CLASS_PREFIX } from "../base/constants";
2
+
3
+ const cssClasses = {
4
+ PREFIX: `${BASE_CLASS_PREFIX}-highlight`,
5
+ } as const;
6
+
7
+ export { cssClasses };
@@ -0,0 +1,11 @@
1
+ //@import '../theme/variables.scss';
2
+ @import "./variables.scss";
3
+
4
+ $highlight: #{$prefix}-highlight;
5
+ $tag: #{$prefix}-highlight-tag;
6
+
7
+ .#{$tag} {
8
+ color: $color-highlight-text-default;
9
+ background-color: $color-highlight-text-bg-default;
10
+ font-weight: $font-highlight-text-fontWeight;
11
+ }
@@ -0,0 +1,5 @@
1
+
2
+ $color-highlight-text-default: rgba(var(--semi-yellow-4), 1); // 高亮文字颜色
3
+ $color-highlight-text-bg-default: transparent; // 高亮文字背景颜色
4
+
5
+ $font-highlight-text-fontWeight: 600; // 高亮文字字重
@@ -18,7 +18,9 @@ export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string,
18
18
  setStopTiming: (value: boolean) => void;
19
19
  getStartMouseDown: () => {x: number; y: number};
20
20
  setStartMouseDown: (x: number, y: number) => void;
21
- setMouseActiveTime: (time: number) => void
21
+ setMouseActiveTime: (time: number) => void;
22
+ disabledBodyScroll: () => void;
23
+ enabledBodyScroll: () => void
22
24
  }
23
25
 
24
26
  const NOT_CLOSE_TARGETS = ["icon", "footer"];
@@ -31,10 +33,12 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
31
33
 
32
34
  beforeShow() {
33
35
  this._adapter.registerKeyDownListener();
36
+ this._adapter.disabledBodyScroll();
34
37
  }
35
38
 
36
39
  afterHide() {
37
40
  this._adapter.unregisterKeyDownListener();
41
+ this._adapter.enabledBodyScroll();
38
42
  }
39
43
 
40
44
  handleRatio(type: string) {
@@ -125,7 +129,7 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
125
129
  rotation: 0,
126
130
  } as any);
127
131
  this._adapter.notifyRotateChange(0);
128
- }
132
+ }
129
133
 
130
134
  handleDownload = () => {
131
135
  const { currentIndex, imgSrc } = this.getStates();
@@ -194,7 +198,7 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
194
198
  callback(e);
195
199
  };
196
200
  Img.onerror = callback;
197
- Img.src = preloadImages[0];
201
+ Img.src = preloadImages[0];
198
202
  }
199
203
 
200
204
  // 在切换左右图片时,当被切换图片完成加载后,根据方向决定下一个预加载的图片
@@ -260,5 +264,5 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
260
264
  } else {
261
265
  this.preloadSingleImage();
262
266
  }
263
- }
264
- }
267
+ }
268
+ }
@@ -136,18 +136,28 @@
136
136
  background: transparent;
137
137
  margin-left: -4px;
138
138
  }
139
+ .semi-cascader-selection .semi-tagInput-wrapper-default {
140
+ min-height: 30px;
141
+ }
142
+ .semi-cascader-selection .semi-tagInput-wrapper-small {
143
+ min-height: 22px;
144
+ }
145
+ .semi-cascader-selection .semi-tagInput-wrapper-large {
146
+ min-height: 38px;
147
+ }
139
148
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper {
140
- height: 30px;
141
149
  margin-left: 4px;
142
150
  }
143
151
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper .semi-input {
144
152
  padding-left: 0;
145
153
  }
146
- .semi-cascader-selection .semi-tagInput .semi-input-wrapper-small {
147
- height: 22px;
154
+ .semi-cascader-selection .semi-tagInput .semi-input-wrapper-default {
155
+ margin-top: 1px;
156
+ margin-bottom: 1px;
148
157
  }
149
158
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper-large {
150
- height: 38px;
159
+ margin-top: 1px;
160
+ margin-bottom: 1px;
151
161
  }
152
162
  .semi-cascader-selection-text-inactive {
153
163
  color: var(--semi-color-text-2);
@@ -159,23 +159,47 @@ $module: #{$prefix}-cascader;
159
159
  background: transparent;
160
160
  margin-left: $spacing-cascader_selection_tagInput-marginLeft;
161
161
  }
162
-
162
+
163
163
  .#{$prefix}-tagInput {
164
+ &-wrapper {
165
+ &-default {
166
+ min-height: $height-cascader_selection_tagInput_wrapper_default;
167
+ }
168
+
169
+ &-small {
170
+ min-height: $height-cascader_selection_tagInput_wrapper_small;
171
+ }
172
+
173
+ &-large {
174
+ min-height: $height-cascader_selection_tagInput_wrapper_large;
175
+ }
176
+ }
177
+
164
178
  .#{$prefix}-input-wrapper {
165
- height: $height-cascader_selection_tagInput_input_default;
179
+ // height: $height-cascader_selection_tagInput_input_default;
166
180
 
167
181
  margin-left: $spacing-cascader_selection_input-marginLeft;
168
182
  .#{$prefix}-input {
169
183
  padding-left: 0;
170
184
  }
171
- }
172
185
 
173
- .#{$prefix}-input-wrapper-small {
174
- height: $height-cascader_selection_tagInput_input_small;
175
- }
176
- .#{$prefix}-input-wrapper-large {
177
- height: $height-cascader_selection_tagInput_input_large;
186
+ &-default {
187
+ margin-top: $spacing-cascader_selection_tag-marginY;
188
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
189
+ }
190
+
191
+ &-large {
192
+ margin-top: $spacing-cascader_selection_tag-marginY;
193
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
194
+ }
178
195
  }
196
+
197
+ // .#{$prefix}-input-wrapper-small {
198
+ // height: $height-cascader_selection_tagInput_input_small;
199
+ // }
200
+ // .#{$prefix}-input-wrapper-large {
201
+ // height: $height-cascader_selection_tagInput_input_large;
202
+ // }
179
203
  }
180
204
 
181
205
  &-text {
@@ -93,9 +93,9 @@ $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
93
93
  $width-cascader-icon: 16px; // 级联选择图标尺寸
94
94
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
95
95
  $height-cascader_option_list: 180px; // 级联选择菜单高度
96
- $height-cascader_selection_tagInput_input_small: 22px;
97
- $height-cascader_selection_tagInput_input_default: 30px;
98
- $height-cascader_selection_tagInput_input_large: 38px;
96
+ $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
97
+ $height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
98
+ $height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
99
99
  $height-cascader_selection_wrapper: 30px;
100
100
 
101
101
  $spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
@@ -1,7 +1,7 @@
1
1
  import BaseFoundation from '../base/foundation';
2
2
  import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
4
- export { BaseFormAdapter };
4
+ export type { BaseFormAdapter };
5
5
  export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
6
6
  data: FormState;
7
7
  fields: Map<string, FieldStaff>;
@@ -0,0 +1,4 @@
1
+ declare const cssClasses: {
2
+ readonly PREFIX: "semi-highlight";
3
+ };
4
+ export { cssClasses };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cssClasses = void 0;
7
+
8
+ var _constants = require("../base/constants");
9
+
10
+ const cssClasses = {
11
+ PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-highlight")
12
+ };
13
+ exports.cssClasses = cssClasses;
@@ -0,0 +1,8 @@
1
+ /* shadow */
2
+ /* sizing */
3
+ /* spacing */
4
+ .semi-highlight-tag {
5
+ color: rgba(var(--semi-yellow-4), 1);
6
+ background-color: transparent;
7
+ font-weight: 600;
8
+ }
@@ -0,0 +1,11 @@
1
+ //@import '../theme/variables.scss';
2
+ @import "./variables.scss";
3
+
4
+ $highlight: #{$prefix}-highlight;
5
+ $tag: #{$prefix}-highlight-tag;
6
+
7
+ .#{$tag} {
8
+ color: $color-highlight-text-default;
9
+ background-color: $color-highlight-text-bg-default;
10
+ font-weight: $font-highlight-text-fontWeight;
11
+ }
@@ -0,0 +1,5 @@
1
+
2
+ $color-highlight-text-default: rgba(var(--semi-yellow-4), 1); // 高亮文字颜色
3
+ $color-highlight-text-bg-default: transparent; // 高亮文字背景颜色
4
+
5
+ $font-highlight-text-fontWeight: 600; // 高亮文字字重
@@ -19,6 +19,8 @@ export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string,
19
19
  };
20
20
  setStartMouseDown: (x: number, y: number) => void;
21
21
  setMouseActiveTime: (time: number) => void;
22
+ disabledBodyScroll: () => void;
23
+ enabledBodyScroll: () => void;
22
24
  }
23
25
  export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<PreviewInnerAdapter<P, S>, P, S> {
24
26
  constructor(adapter: PreviewInnerAdapter<P, S>);
@@ -324,10 +324,14 @@ class PreviewInnerFoundation extends _foundation.default {
324
324
 
325
325
  beforeShow() {
326
326
  this._adapter.registerKeyDownListener();
327
+
328
+ this._adapter.disabledBodyScroll();
327
329
  }
328
330
 
329
331
  afterHide() {
330
332
  this._adapter.unregisterKeyDownListener();
333
+
334
+ this._adapter.enabledBodyScroll();
331
335
  }
332
336
 
333
337
  handleRatio(type) {
@@ -42,6 +42,10 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
42
42
  getActiveElement(): any;
43
43
  setIsFocusInContainer(isFocusInContainer: boolean): void;
44
44
  getIsFocusInContainer(): boolean;
45
+ on(eventName: string, eventCallback: () => void): void;
46
+ off(eventName: string): void;
47
+ emit(eventName: string): void;
48
+ once(eventName: string, eventCallback: () => void): void;
45
49
  }
46
50
  declare type LabelValue = string | number;
47
51
  declare type PropValue = LabelValue | Record<string, any>;
@@ -67,7 +71,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
67
71
  handleClick(e: any): void;
68
72
  open(acInput?: string, originalOptions?: BasicOptionProps[]): void;
69
73
  toggle2SearchInput(isShow: boolean): void;
70
- close(e?: any): void;
74
+ close(e?: any, closeCb?: () => void): void;
71
75
  onSelect(option: BasicOptionProps, optionIndex: number, event: MouseEvent | KeyboardEvent): void;
72
76
  _handleSingleSelect({ value, label, ...rest }: BasicOptionProps, event: any): void;
73
77
  _handleMultipleSelect({ value, label, ...rest }: BasicOptionProps, event: MouseEvent | KeyboardEvent): void;
@@ -126,5 +130,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
126
130
  checkMultipleProps(props?: Record<string, any>): void;
127
131
  updateScrollTop(): void;
128
132
  updateIsFullTags(): void;
133
+ handlePopoverClose(): void;
129
134
  }
130
135
  export {};
@@ -430,16 +430,8 @@ class SelectFoundation extends _foundation.default {
430
430
  }
431
431
  }
432
432
 
433
- close(e) {
433
+ close(e, closeCb) {
434
434
  // to support A11y, closing the panel trigger does not necessarily lose focus
435
- const isFilterable = this._isFilterable();
436
-
437
- if (isFilterable) {
438
- // this.unBindKeyBoardEvent();
439
- this.clearInput();
440
- this.toggle2SearchInput(false);
441
- }
442
-
443
435
  this._adapter.closeMenu();
444
436
 
445
437
  this._adapter.notifyDropdownVisibleChange(false);
@@ -450,6 +442,22 @@ class SelectFoundation extends _foundation.default {
450
442
 
451
443
  this._adapter.unregisterClickOutsideHandler(); // this._adapter.updateFocusState(false);
452
444
 
445
+
446
+ const isFilterable = this._isFilterable();
447
+
448
+ if (isFilterable) {
449
+ this.toggle2SearchInput(false);
450
+ }
451
+
452
+ this._adapter.once('popoverClose', () => {
453
+ if (isFilterable) {
454
+ this.clearInput();
455
+ }
456
+
457
+ if (closeCb) {
458
+ closeCb();
459
+ }
460
+ });
453
461
  }
454
462
 
455
463
  onSelect(option, optionIndex, event) {
@@ -493,21 +501,24 @@ class SelectFoundation extends _foundation.default {
493
501
  value,
494
502
  label
495
503
  }, rest)); // If it is a controlled component, directly notify
504
+ // Make sure that the operations of updating updateOptions are done after the animation ends
505
+ // otherwise the content will be updated when the popup layer is not collapsed, and it looks like it will flash once when it is closed
496
506
 
497
507
 
498
508
  if (this._isControlledComponent()) {
499
- this._notifyChange(selections);
500
-
501
- this.close(event);
509
+ this.close(event, () => {
510
+ this._notifyChange(selections);
511
+ });
502
512
  } else {
503
513
  this._adapter.updateSelection(selections); // notify user
504
514
 
505
515
 
506
- this._notifyChange(selections); // Update the selected item in the drop-down box
507
-
516
+ this._notifyChange(selections);
508
517
 
509
- this.close(event);
510
- this.updateOptionsActiveStatus(selections);
518
+ this.close(event, () => {
519
+ // Update the selected item in the drop-down box
520
+ this.updateOptionsActiveStatus(selections);
521
+ });
511
522
  }
512
523
  }
513
524
 
@@ -1398,6 +1409,10 @@ class SelectFoundation extends _foundation.default {
1398
1409
  }
1399
1410
  }
1400
1411
 
1412
+ handlePopoverClose() {
1413
+ this._adapter.emit('popoverClose');
1414
+ }
1415
+
1401
1416
  }
1402
1417
 
1403
1418
  exports.default = SelectFoundation;
@@ -7,12 +7,12 @@ $module: #{$prefix}-switch;
7
7
 
8
8
  &-checked {
9
9
  .#{$module}-knob {
10
- transform: translateX(-$motion-switch_checked-translateX);
10
+ transform: translateX(-$spacing-switch_checked-translateX);
11
11
  }
12
12
 
13
13
  &:active {
14
14
  .#{$module}-knob {
15
- transform: translateX($width-switch_knob_expand - $motion-switch_checked-translateX);
15
+ transform: translateX($width-switch_knob_expand - $spacing-switch_checked-translateX);
16
16
  }
17
17
  }
18
18
  }
@@ -34,51 +34,51 @@ $module: #{$prefix}-switch;
34
34
 
35
35
  .#{$module}-loading {
36
36
  .#{$module}-loading-spin {
37
- transform: translateX(-$motion-switch_spin_unchecked-translateX);
37
+ transform: translateX(-$spacing-switch_spin_unchecked-translateX);
38
38
  }
39
39
 
40
40
  &.#{$module}-checked {
41
41
  .#{$module}-loading-spin {
42
- transform: translateX(-$motion-switch_spin_checked-translateX);
42
+ transform: translateX(-$spacing-switch_spin_checked-translateX);
43
43
  }
44
44
  }
45
45
  }
46
46
 
47
47
  .#{$module}-loading.#{$module}-small {
48
48
  .#{$module}-loading-spin {
49
- transform: translateX(-$motion-switch_spin_unchecked_small-translateX);
49
+ transform: translateX(-$spacing-switch_spin_unchecked_small-translateX);
50
50
  }
51
51
  &.#{$module}-checked{
52
52
  .#{$module}-loading-spin {
53
- transform: translateX(-$motion-switch_spin_checked_small-translateX);
53
+ transform: translateX(-$spacing-switch_spin_checked_small-translateX);
54
54
  }
55
55
  }
56
56
  }
57
57
 
58
58
  .#{$module}-loading.#{$module}-large {
59
59
  .#{$module}-loading-spin {
60
- transform: translateX(-$motion-switch_spin_unchecked_large-translateX);
60
+ transform: translateX(-$spacing-switch_spin_unchecked_large-translateX);
61
61
  }
62
62
 
63
63
  &.#{$module}-checked {
64
64
  .#{$module}-loading-spin {
65
- transform: translateX(-$motion-switch_spin_checked_large-translateX);
65
+ transform: translateX(-$spacing-switch_spin_checked_large-translateX);
66
66
  }
67
67
  }
68
68
  }
69
69
 
70
70
  .#{$module}-large {
71
71
  .#{$module}-knob {
72
- transform: translateX(-$motion-switch_unchecked_large-translateX);
72
+ transform: translateX(-$spacing-switch_unchecked_large-translateX);
73
73
  }
74
74
  &.#{$module}-checked {
75
75
  .#{$module}-knob {
76
- transform: translateX(-$motion-switch_checked_large-translateX);
76
+ transform: translateX(-$spacing-switch_checked_large-translateX);
77
77
  }
78
78
 
79
79
  &:active {
80
80
  .#{$module}-knob {
81
- transform: translateX($motion-switch_expand_large-translateX - $motion-switch_checked_large-translateX);
81
+ transform: translateX($spacing-switch_expand_large-translateX - $spacing-switch_checked_large-translateX);
82
82
  }
83
83
  }
84
84
  }
@@ -86,16 +86,16 @@ $module: #{$prefix}-switch;
86
86
 
87
87
  .#{$module}-small {
88
88
  .#{$module}-knob {
89
- transform: translateX(-$motion-switch_unchecked_small-translateX);
89
+ transform: translateX(-$spacing-switch_unchecked_small-translateX);
90
90
  }
91
91
  &.#{$module}-checked {
92
92
  .#{$module}-knob {
93
- transform: translateX(-$motion-switch_checked_small-translateX);
93
+ transform: translateX(-$spacing-switch_checked_small-translateX);
94
94
  }
95
95
 
96
96
  &:active {
97
97
  .#{$module}-knob {
98
- transform: translateX($motion-switch_expand_small-translateX - $motion-switch_checked_small-translateX);
98
+ transform: translateX($spacing-switch_expand_small-translateX - $spacing-switch_checked_small-translateX);
99
99
  }
100
100
  }
101
101
  }
@@ -44,12 +44,12 @@ $module: #{$prefix}-switch;
44
44
  }
45
45
 
46
46
  .#{$module}-knob {
47
- transform: translateX($motion-switch_checked-translateX);
47
+ transform: translateX($spacing-switch_checked-translateX);
48
48
  }
49
49
 
50
50
  &:active {
51
51
  .#{$module}-knob {
52
- transform: translateX($motion-switch_checked-translateX - $width-switch_knob_expand);
52
+ transform: translateX($spacing-switch_checked-translateX - $width-switch_knob_expand);
53
53
  }
54
54
  }
55
55
  }
@@ -157,7 +157,7 @@ $module: #{$prefix}-switch;
157
157
  .#{$module}-loading {
158
158
 
159
159
  .#{$module}-loading-spin {
160
- transform: translateX($motion-switch_spin_unchecked-translateX);
160
+ transform: translateX($spacing-switch_spin_unchecked-translateX);
161
161
 
162
162
  &>.#{$prefix}-spin-wrapper>svg{
163
163
  width: $width-switch_spin-default;
@@ -169,7 +169,7 @@ $module: #{$prefix}-switch;
169
169
  background-color: $color-switch_spin_checked-bg-default;
170
170
 
171
171
  .#{$module}-loading-spin {
172
- transform: translateX($motion-switch_spin_checked-translateX);
172
+ transform: translateX($spacing-switch_spin_checked-translateX);
173
173
  }
174
174
  }
175
175
  }
@@ -177,7 +177,7 @@ $module: #{$prefix}-switch;
177
177
  .#{$module}-loading.#{$module}-small {
178
178
 
179
179
  .#{$module}-loading-spin {
180
- transform: translateX($motion-switch_spin_unchecked_small-translateX);
180
+ transform: translateX($spacing-switch_spin_unchecked_small-translateX);
181
181
 
182
182
  &>.#{$prefix}-spin-wrapper>svg{
183
183
  width: $width-switch_spin-small;
@@ -187,7 +187,7 @@ $module: #{$prefix}-switch;
187
187
  &.#{$module}-checked{
188
188
 
189
189
  .#{$module}-loading-spin {
190
- transform: translateX($motion-switch_spin_checked_small-translateX);
190
+ transform: translateX($spacing-switch_spin_checked_small-translateX);
191
191
  }
192
192
  }
193
193
  }
@@ -195,7 +195,7 @@ $module: #{$prefix}-switch;
195
195
  .#{$module}-loading.#{$module}-large {
196
196
 
197
197
  .#{$module}-loading-spin {
198
- transform: translateX($motion-switch_spin_unchecked_large-translateX);
198
+ transform: translateX($spacing-switch_spin_unchecked_large-translateX);
199
199
 
200
200
  &>.#{$prefix}-spin-wrapper>svg{
201
201
  width: $width-switch_spin-large;
@@ -206,7 +206,7 @@ $module: #{$prefix}-switch;
206
206
  &.#{$module}-checked {
207
207
 
208
208
  .#{$module}-loading-spin {
209
- transform: translateX($motion-switch_spin_checked_large-translateX);
209
+ transform: translateX($spacing-switch_spin_checked_large-translateX);
210
210
  }
211
211
  }
212
212
  }
@@ -224,16 +224,16 @@ $module: #{$prefix}-switch;
224
224
  height: $width-switch_knob_large;
225
225
  top: $spacing-switch_knob_large-padding;
226
226
  border-radius: $width-switch_knob_large * 0.5;
227
- transform: translateX($motion-switch_unchecked_large-translateX);
227
+ transform: translateX($spacing-switch_unchecked_large-translateX);
228
228
  }
229
229
  &.#{$module}-checked {
230
230
  .#{$module}-knob {
231
- transform: translateX($motion-switch_checked_large-translateX);
231
+ transform: translateX($spacing-switch_checked_large-translateX);
232
232
  }
233
233
 
234
234
  &:active {
235
235
  .#{$module}-knob {
236
- transform: translateX($motion-switch_checked_large-translateX - $motion-switch_expand_large-translateX);
236
+ transform: translateX($spacing-switch_checked_large-translateX - $spacing-switch_expand_large-translateX);
237
237
  }
238
238
  }
239
239
  }
@@ -259,16 +259,16 @@ $module: #{$prefix}-switch;
259
259
  height: $width-switch_knob_large_small;
260
260
  top: $spacing-switch_knob_small-padding;
261
261
  border-radius: $width-switch_knob_large_small * 0.5;
262
- transform: translateX($motion-switch_unchecked_small-translateX);
262
+ transform: translateX($spacing-switch_unchecked_small-translateX);
263
263
  }
264
264
  &.#{$module}-checked {
265
265
  .#{$module}-knob {
266
- transform: translateX($motion-switch_checked_small-translateX);
266
+ transform: translateX($spacing-switch_checked_small-translateX);
267
267
  }
268
268
 
269
269
  &:active {
270
270
  .#{$module}-knob {
271
- transform: translateX($motion-switch_checked_small-translateX - $motion-switch_expand_small-translateX);
271
+ transform: translateX($spacing-switch_checked_small-translateX - $spacing-switch_expand_small-translateX);
272
272
  }
273
273
  }
274
274
  }