@mezzanine-ui/system 1.0.0-canary.1 → 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.
@@ -9,9 +9,6 @@ $effect-contexts: (shadow, focus);
9
9
 
10
10
  $effect-values: (
11
11
  shadow: (
12
- none: (
13
- value: 0 0 0 0 rgb(0 0 0 / 0%),
14
- ),
15
12
  raised: (
16
13
  value: 0 0 6px 0 semantic.variable(shadow, dark),
17
14
  ),
@@ -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.1",
3
+ "version": "1.0.0-canary.3",
4
4
  "description": "Design System for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -10,6 +10,7 @@ $primitive-scales: (
10
10
  0,
11
11
  1,
12
12
  2,
13
+ 3,
13
14
  4,
14
15
  6,
15
16
  8,
@@ -29,7 +30,9 @@ $primitive-scales: (
29
30
  56,
30
31
  60,
31
32
  64,
33
+ 70,
32
34
  80,
35
+ 140,
33
36
  160,
34
37
  240,
35
38
  320,
@@ -48,6 +51,7 @@ $default-primitives: (
48
51
  0: 0,
49
52
  1: 1px,
50
53
  2: 2px,
54
+ 3: 3px,
51
55
  4: 4px,
52
56
  6: 6px,
53
57
  8: 8px,
@@ -67,7 +71,9 @@ $default-primitives: (
67
71
  56: 56px,
68
72
  60: 60px,
69
73
  64: 64px,
74
+ 70: 70px,
70
75
  80: 80px,
76
+ 140: 140px,
71
77
  160: 160px,
72
78
  240: 240px,
73
79
  320: 320px,
@@ -16,6 +16,7 @@ $padding-categories: (horizontal, vertical);
16
16
  // 定義各個分類下的 tones
17
17
  $element-tones: (
18
18
  hairline,
19
+ micro,
19
20
  tiny,
20
21
  tight,
21
22
  compact,
@@ -37,7 +38,9 @@ $element-tones: (
37
38
 
38
39
  $container-tones: (
39
40
  collapsed,
41
+ compressed,
40
42
  tiny,
43
+ snug,
41
44
  tight,
42
45
  slim,
43
46
  narrow,
@@ -64,11 +67,13 @@ $horizontal-tones: (
64
67
  comfort-fixed,
65
68
  roomy,
66
69
  spacious,
70
+ open,
67
71
  relaxed,
68
72
  airy,
69
73
  breath,
70
74
  wide,
71
- max
75
+ max,
76
+ ultra
72
77
  );
73
78
 
74
79
  $vertical-tones: (
@@ -92,6 +97,10 @@ $semantic-spacings: (
92
97
  default: primitive.variable(1),
93
98
  compact: primitive.variable(1),
94
99
  ),
100
+ micro: (
101
+ default: primitive.variable(3),
102
+ compact: primitive.variable(3),
103
+ ),
95
104
  tiny: (
96
105
  default: primitive.variable(4),
97
106
  compact: primitive.variable(4),
@@ -166,10 +175,18 @@ $semantic-spacings: (
166
175
  default: primitive.variable(52),
167
176
  compact: primitive.variable(52),
168
177
  ),
178
+ compressed: (
179
+ default: primitive.variable(70),
180
+ compact: primitive.variable(70),
181
+ ),
169
182
  tiny: (
170
183
  default: primitive.variable(80),
171
184
  compact: primitive.variable(80),
172
185
  ),
186
+ snug: (
187
+ default: primitive.variable(140),
188
+ compact: primitive.variable(140),
189
+ ),
173
190
  tight: (
174
191
  default: primitive.variable(160),
175
192
  compact: primitive.variable(160),
@@ -312,6 +329,10 @@ $semantic-spacings: (
312
329
  default: primitive.variable(16),
313
330
  compact: primitive.variable(14),
314
331
  ),
332
+ open: (
333
+ default: primitive.variable(20),
334
+ compact: primitive.variable(16),
335
+ ),
315
336
  relaxed: (
316
337
  default: primitive.variable(24),
317
338
  compact: primitive.variable(20),
@@ -332,6 +353,10 @@ $semantic-spacings: (
332
353
  default: primitive.variable(48),
333
354
  compact: primitive.variable(40),
334
355
  ),
356
+ ultra: (
357
+ default: primitive.variable(64),
358
+ compact: primitive.variable(56),
359
+ ),
335
360
  ),
336
361
  vertical: (
337
362
  none: (
@@ -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) {