@mezzanine-ui/system 1.0.0-canary.2 → 1.0.0-canary.3

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.
@@ -3,21 +3,37 @@
3
3
 
4
4
  $prefix: mzn-motion;
5
5
 
6
- $duration-names: (shortest, shorter, short, standard, long);
6
+ $duration-names: (fast, moderate, slow, loop, pause-short, pause-long);
7
7
  $default-durations: (
8
- shortest: 150ms,
9
- shorter: 200ms,
10
- short: 250ms,
11
- standard: 300ms,
12
- long: 375ms,
8
+ fast: 150ms,
9
+ moderate: 250ms,
10
+ slow: 400ms,
11
+ loop: 1600ms,
12
+ pause-short: 3000ms,
13
+ pause-long: 10000ms,
13
14
  );
14
15
 
15
- $easing-names: (standard, emphasized, decelerated, accelerated);
16
+ $easing-names: (entrance, exit, standard);
16
17
  $default-easings: (
17
- standard: cubic-bezier(0.58, 0.01, 0.29, 1.01),
18
- emphasized: cubic-bezier(0.83, 0, 0.17, 1),
19
- decelerated: cubic-bezier(0, 0, 0.3, 1),
20
- accelerated: cubic-bezier(0.32, 0, 0.67, 0),
18
+ entrance: cubic-bezier(0.0, 0.0, 0.58, 1),
19
+ exit: cubic-bezier(0.42, 0.0, 1, 1),
20
+ standard: cubic-bezier(0.4, 0.0, 0.2, 1),
21
+ );
22
+
23
+ $pattern-names: (breathe, skeleton-loading, spin);
24
+ $default-pattern: (
25
+ breathe: (
26
+ duration: loop,
27
+ easing: standard,
28
+ ),
29
+ skeleton-loading: (
30
+ duration: loop,
31
+ easing: standard,
32
+ ),
33
+ spin: (
34
+ duration: loop,
35
+ easing: entrance,
36
+ ),
21
37
  );
22
38
 
23
39
  $default-options: (
@@ -33,6 +49,10 @@ $default-options: (
33
49
  @return list.includes($easing-names, $easing-name);
34
50
  }
35
51
 
52
+ @function is-pattern-name-valid($pattern-name) {
53
+ @return list.includes($pattern-names, $pattern-name);
54
+ }
55
+
36
56
  @function duration($duration-name) {
37
57
  @if not is-duration-name-valid($duration-name) {
38
58
  @error 'Invalid duration name #{$duration-name}. Please choose one of #{$duration-names}';
@@ -62,3 +82,19 @@ $default-options: (
62
82
  --#{$prefix}-easing-#{$name}: #{$value};
63
83
  }
64
84
  }
85
+
86
+ @mixin pattern($pattern-name, $action-name: animation) {
87
+ @if not is-pattern-name-valid($pattern-name) {
88
+ @error 'Invalid pattern name #{$pattern-name}. Please choose one of #{$pattern-names}';
89
+ }
90
+
91
+ $pattern: map.get($default-pattern, $pattern-name);
92
+
93
+ @if $pattern {
94
+ $duration-name: map.get($pattern, duration);
95
+ $easing-name: map.get($pattern, easing);
96
+
97
+ #{$action-name}-duration: duration($duration-name);
98
+ #{$action-name}-timing-function: easing($easing-name);
99
+ }
100
+ }
@@ -1,2 +1,2 @@
1
- export type MotionDurationType = 'shortest' | 'shorter' | 'short' | 'standard' | 'long';
1
+ export type MotionDurationType = 'fast' | 'moderate' | 'slow' | 'loop' | 'pauseShort' | 'pauseLong';
2
2
  export declare const MOTION_DURATION: Readonly<Record<MotionDurationType, number>>;
@@ -1,9 +1,10 @@
1
1
  const MOTION_DURATION = {
2
- shortest: 150,
3
- shorter: 200,
4
- short: 250,
5
- standard: 300,
6
- long: 375,
2
+ fast: 150,
3
+ moderate: 250,
4
+ slow: 400,
5
+ loop: 1600,
6
+ pauseShort: 3000,
7
+ pauseLong: 10000,
7
8
  };
8
9
 
9
10
  export { MOTION_DURATION };
@@ -1,2 +1,2 @@
1
- export type MotionEasingType = 'standard' | 'emphasized' | 'decelerated' | 'accelerated';
1
+ export type MotionEasingType = 'entrance' | 'exit' | 'standard';
2
2
  export declare const MOTION_EASING: Readonly<Record<MotionEasingType, string>>;
package/motion/easing.js CHANGED
@@ -1,8 +1,7 @@
1
1
  const MOTION_EASING = {
2
- standard: 'cubic-bezier(0.58, 0.01, 0.29, 1.01)',
3
- emphasized: 'cubic-bezier(0.83, 0, 0.17, 1)',
4
- decelerated: 'cubic-bezier(0, 0, 0.3, 1)',
5
- accelerated: 'cubic-bezier(0.32, 0, 0.67, 0)',
2
+ entrance: 'cubic-bezier(0, 0, 0.58, 1)',
3
+ exit: 'cubic-bezier(0.42, 0, 1, 1)',
4
+ standard: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
6
5
  };
7
6
 
8
7
  export { MOTION_EASING };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezzanine-ui/system",
3
- "version": "1.0.0-canary.2",
3
+ "version": "1.0.0-canary.3",
4
4
  "description": "Design System for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -354,8 +354,8 @@ $semantic-spacings: (
354
354
  compact: primitive.variable(40),
355
355
  ),
356
356
  ultra: (
357
- default: primitive.variable(56),
358
- compact: primitive.variable(48),
357
+ default: primitive.variable(64),
358
+ compact: primitive.variable(56),
359
359
  ),
360
360
  ),
361
361
  vertical: (
@@ -1,17 +1,33 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:string';
1
3
  @use '../motion';
2
4
 
3
- @function enter($property, $duration: motion.duration(short), $delay: 0ms) {
4
- @return $property $duration motion.easing(decelerated) $delay;
5
- }
5
+ @function entrance($property, $duration: moderate, $delay: 0ms) {
6
+ $duration-value: if(
7
+ meta.type-of($duration) == number or string.index(meta.inspect($duration), 'calc') != null,
8
+ $duration,
9
+ motion.duration($duration)
10
+ );
6
11
 
7
- @function exit($property, $duration: motion.duration(shorter), $delay: 0ms) {
8
- @return $property $duration motion.easing(accelerated) $delay;
12
+ @return $property $duration-value motion.easing(entrance) $delay;
9
13
  }
10
14
 
11
- @function emphasized($property, $duration: motion.duration(short), $delay: 0ms) {
12
- @return $property $duration motion.easing(emphasized) $delay;
15
+ @function exit($property, $duration: moderate, $delay: 0ms) {
16
+ $duration-value: if(
17
+ meta.type-of($duration) == number or string.index(meta.inspect($duration), 'calc') != null,
18
+ $duration,
19
+ motion.duration($duration)
20
+ );
21
+
22
+ @return $property $duration-value motion.easing(exit) $delay;
13
23
  }
14
24
 
15
- @function standard($property, $duration: motion.duration(short), $delay: 0ms) {
16
- @return $property $duration motion.easing(standard) $delay;
25
+ @function standard($property, $duration: moderate, $delay: 0ms) {
26
+ $duration-value: if(
27
+ meta.type-of($duration) == number or string.index(meta.inspect($duration), 'calc') != null,
28
+ $duration,
29
+ motion.duration($duration)
30
+ );
31
+
32
+ @return $property $duration-value motion.easing(standard) $delay;
17
33
  }
@@ -133,14 +133,14 @@ $semantic-typographies: (
133
133
  ),
134
134
  input: (
135
135
  font-size: primitive.font-size-variable(14),
136
- font-weight: primitive.font-weight-variable(semibold),
136
+ font-weight: primitive.font-weight-variable(regular),
137
137
  line-height: primitive.line-height-variable(functional),
138
138
  letter-spacing: primitive.letter-spacing-variable(0),
139
139
  ),
140
140
  input-mono: (
141
141
  font-family: primitive.font-family-variable(sfmono),
142
142
  font-size: primitive.font-size-variable(14),
143
- font-weight: primitive.font-weight-variable(semibold),
143
+ font-weight: primitive.font-weight-variable(regular),
144
144
  line-height: primitive.line-height-variable(functional),
145
145
  letter-spacing: primitive.letter-spacing-variable(0),
146
146
  ),
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * SF Mono is a monospaced font designed by Apple.
5
5
  * This file provides @font-face declarations to load SF Mono from file.
6
+ * download link: https://www.cufonfonts.com/font/sf-mono
6
7
  */
7
8
 
8
9
  /* SF Mono Regular (400) */
@@ -11,7 +12,7 @@
11
12
  font-style: normal;
12
13
  font-weight: 400;
13
14
  font-display: swap;
14
- src: url('~@mezzanine-ui/system/typography/SF-Mono/SF-Mono-Regular.otf') format('opentype');
15
+ src: url('~@mezzanine-ui/system/typography/SF-Mono/SFMonoRegular.woff') format('woff');
15
16
  }
16
17
 
17
18
  /* SF Mono Medium (500) */
@@ -20,7 +21,7 @@
20
21
  font-style: normal;
21
22
  font-weight: 500;
22
23
  font-display: swap;
23
- src: url('~@mezzanine-ui/system/typography/SF-Mono/SF-Mono-Medium.otf') format('opentype');
24
+ src: url('~@mezzanine-ui/system/typography/SF-Mono/SFMonoMedium.woff') format('woff');
24
25
  }
25
26
 
26
27
  /* SF Mono Semibold (600) */
@@ -29,5 +30,5 @@
29
30
  font-style: normal;
30
31
  font-weight: 600;
31
32
  font-display: swap;
32
- src: url('~@mezzanine-ui/system/typography/SF-Mono/SF-Mono-Semibold.otf') format('opentype');
33
+ src: url('~@mezzanine-ui/system/typography/SF-Mono/SFMonoSemibold.woff') format('woff');
33
34
  }
@@ -1,7 +1,7 @@
1
1
  @use '../utils/list';
2
2
 
3
3
  $prefix: mzn-z-index;
4
- $orders: (modal, drawer, popover, feedback);
4
+ $orders: (base, alert, modal, drawer, popover, feedback);
5
5
 
6
6
  @mixin variables($base: 1000) {
7
7
  @for $index from 1 through list.length($orders) {