@alauda/ui 6.4.8-beta.36 → 6.4.8-beta.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/ui",
3
- "version": "6.4.8-beta.36",
3
+ "version": "6.4.8-beta.37",
4
4
  "description": "Angular UI components by Alauda Frontend Team.",
5
5
  "repository": "git+https://github.com/alauda/alauda-ui.git",
6
6
  "author": "Alauda Frontend",
@@ -20,5 +20,12 @@
20
20
  }
21
21
 
22
22
  // Animation
23
- $animation-duration: 0.3s;
23
+ $animation-duration-slow: 0.3s; // Modal
24
+ $animation-duration-base: 0.24s; // Tab、Dropdown
25
+ $animation-duration-fast: 0.2s;
26
+
27
+ $ease-out: cubic-bezier(0, 0, 0.2, 1);
28
+ $ease-in: cubic-bezier(0.8, 0, 1, 0.9);
29
+ $ease-in-out: cubic-bezier(0.38, 0, 0.24, 1);
30
+
24
31
  $animation-interpolation: ease;
package/theme/_mixin.scss CHANGED
@@ -133,8 +133,14 @@
133
133
  }
134
134
  }
135
135
 
136
+ @mixin overlay-pane() {
137
+ justify-content: center;
138
+ overflow: auto;
139
+ @include scroll-bar;
140
+ }
141
+
136
142
  @mixin transition($target: all) {
137
- transition: $target $animation-duration $animation-interpolation;
143
+ transition: $target $animation-duration-slow $animation-interpolation;
138
144
  }
139
145
 
140
146
  @mixin absolute-center() {
@@ -142,6 +148,7 @@
142
148
  position: absolute;
143
149
  top: 50%;
144
150
  left: 50%;
151
+ transform-origin: -50% -50%;
145
152
  transform: translate(-50%, -50%);
146
153
  }
147
154
 
@@ -299,3 +306,36 @@
299
306
  background-size: 100% 14px;
300
307
  height: 100%;
301
308
  }
309
+
310
+ // Motion
311
+ @mixin motion-common($duration: $animation-duration-base) {
312
+ animation-duration: $duration;
313
+ animation-fill-mode: both;
314
+ }
315
+
316
+ @mixin use-motion(
317
+ $className,
318
+ $keyframeName,
319
+ $duration: $animation-duration-base
320
+ ) {
321
+ .#{$className}-enter {
322
+ @include motion-common($duration);
323
+
324
+ animation-play-state: paused;
325
+ }
326
+ .#{$className}-leave {
327
+ @include motion-common($duration);
328
+
329
+ animation-play-state: paused;
330
+ }
331
+
332
+ .#{$className}-enter.#{$className}-enter-active {
333
+ animation-name: #{$keyframeName}-in;
334
+ animation-play-state: running;
335
+ }
336
+ .#{$className}-leave.#{$className}-leave-active {
337
+ animation-name: #{$keyframeName}-out;
338
+ animation-play-state: running;
339
+ pointer-events: none;
340
+ }
341
+ }
package/utils/fn.d.ts CHANGED
@@ -4,3 +4,7 @@ export declare const last: <T>(values: T[]) => T;
4
4
  export declare const isTemplateRef: (label: any) => label is TemplateRef<unknown>;
5
5
  export declare const isString: (label: any) => label is string;
6
6
  export declare const handlePixel: (value: number | string) => string;
7
+ export declare function getElementOffset(elem: HTMLElement): {
8
+ top: number;
9
+ left: number;
10
+ };