@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.
- package/effect/_effect.scss +0 -3
- package/motion/_motion.scss +47 -11
- package/motion/duration.d.ts +1 -1
- package/motion/duration.js +6 -5
- package/motion/easing.d.ts +1 -1
- package/motion/easing.js +3 -4
- package/package.json +1 -1
- package/spacing/_primitives.scss +6 -0
- package/spacing/_semantic.scss +26 -1
- package/transition/_transition.scss +25 -9
- package/typography/SF-Mono/SFMonoMedium.woff +0 -0
- package/typography/SF-Mono/SFMonoRegular.woff +0 -0
- package/typography/SF-Mono/SFMonoSemibold.woff +0 -0
- package/typography/_semantic.scss +2 -2
- package/typography/_sf-mono.scss +4 -3
- package/z-index/_z-index.scss +1 -1
- package/typography/SF-Mono/SF-Mono-Medium.otf +0 -0
- package/typography/SF-Mono/SF-Mono-Regular.otf +0 -0
- package/typography/SF-Mono/SF-Mono-Semibold.otf +0 -0
package/effect/_effect.scss
CHANGED
package/motion/_motion.scss
CHANGED
|
@@ -3,21 +3,37 @@
|
|
|
3
3
|
|
|
4
4
|
$prefix: mzn-motion;
|
|
5
5
|
|
|
6
|
-
$duration-names: (
|
|
6
|
+
$duration-names: (fast, moderate, slow, loop, pause-short, pause-long);
|
|
7
7
|
$default-durations: (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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: (
|
|
16
|
+
$easing-names: (entrance, exit, standard);
|
|
16
17
|
$default-easings: (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
+
}
|
package/motion/duration.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type MotionDurationType = '
|
|
1
|
+
export type MotionDurationType = 'fast' | 'moderate' | 'slow' | 'loop' | 'pauseShort' | 'pauseLong';
|
|
2
2
|
export declare const MOTION_DURATION: Readonly<Record<MotionDurationType, number>>;
|
package/motion/duration.js
CHANGED
package/motion/easing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type MotionEasingType = '
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
package/spacing/_primitives.scss
CHANGED
|
@@ -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,
|
package/spacing/_semantic.scss
CHANGED
|
@@ -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
|
|
4
|
-
|
|
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
|
-
@
|
|
8
|
-
@return $property $duration motion.easing(accelerated) $delay;
|
|
12
|
+
@return $property $duration-value motion.easing(entrance) $delay;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
@function
|
|
12
|
-
|
|
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:
|
|
16
|
-
|
|
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
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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(
|
|
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(
|
|
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
|
),
|
package/typography/_sf-mono.scss
CHANGED
|
@@ -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/
|
|
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/
|
|
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/
|
|
33
|
+
src: url('~@mezzanine-ui/system/typography/SF-Mono/SFMonoSemibold.woff') format('woff');
|
|
33
34
|
}
|
package/z-index/_z-index.scss
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|