@carbon/motion 11.49.0 → 11.50.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.
- package/README.md +4 -0
- package/es/index.js +103 -100
- package/index.scss +25 -87
- package/js/generated/surfaces.d.ts +119 -0
- package/js/generated/surfaces.js +127 -0
- package/js/generated/tokens.d.ts +39 -0
- package/js/generated/tokens.js +65 -0
- package/lib/index.js +103 -100
- package/lib/surfaces.d.ts +3 -140
- package/lib/tokens.d.ts +1 -14
- package/package.json +10 -5
- package/scss/generated/_surfaces.scss +11 -41
- package/scss/generated/_tokens.scss +99 -0
- package/src/dtcg/motion.json +80 -0
- package/src/dtcg/surfaces.json +100 -0
- package/src/surfaces.ts +20 -77
- package/src/tokens.ts +37 -55
- package/umd/index.js +103 -100
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Code generated by @carbon/motion. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2026
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
|
|
8
|
+
// Duration tokens (V11)
|
|
9
|
+
/** Micro-interactions such as button and toggle. Instant response to user action. */
|
|
10
|
+
export const durationFast01 = '70ms';
|
|
11
|
+
/** Micro-interactions such as fade in. Subtle entrance or exit of small UI elements. */
|
|
12
|
+
export const durationFast02 = '110ms';
|
|
13
|
+
/** Micro-interactions, small expansion, short distance movements. Default transition speed. */
|
|
14
|
+
export const durationModerate01 = '150ms';
|
|
15
|
+
/** Expansion, system communication, toast. Slightly longer interactions with more visual weight. */
|
|
16
|
+
export const durationModerate02 = '240ms';
|
|
17
|
+
/** Large expansion, important system notifications. Deliberate, prominent transitions. */
|
|
18
|
+
export const durationSlow01 = '400ms';
|
|
19
|
+
/** Background dimming, large hero transitions. Slow, immersive motion for maximum emphasis. */
|
|
20
|
+
export const durationSlow02 = '700ms';
|
|
21
|
+
|
|
22
|
+
// Duration tokens (V10 — deprecated aliases)
|
|
23
|
+
/** @deprecated Use `durationFast01` instead */
|
|
24
|
+
export const fast01 = durationFast01;
|
|
25
|
+
/** @deprecated Use `durationFast02` instead */
|
|
26
|
+
export const fast02 = durationFast02;
|
|
27
|
+
/** @deprecated Use `durationModerate01` instead */
|
|
28
|
+
export const moderate01 = durationModerate01;
|
|
29
|
+
/** @deprecated Use `durationModerate02` instead */
|
|
30
|
+
export const moderate02 = durationModerate02;
|
|
31
|
+
/** @deprecated Use `durationSlow01` instead */
|
|
32
|
+
export const slow01 = durationSlow01;
|
|
33
|
+
/** @deprecated Use `durationSlow02` instead */
|
|
34
|
+
export const slow02 = durationSlow02;
|
|
35
|
+
|
|
36
|
+
// Easing tokens
|
|
37
|
+
export const easings = {
|
|
38
|
+
standard: {
|
|
39
|
+
productive: 'cubic-bezier(0.2, 0, 0.38, 0.9)',
|
|
40
|
+
expressive: 'cubic-bezier(0.4, 0.14, 0.3, 1)',
|
|
41
|
+
},
|
|
42
|
+
entrance: {
|
|
43
|
+
productive: 'cubic-bezier(0, 0, 0.38, 0.9)',
|
|
44
|
+
expressive: 'cubic-bezier(0, 0, 0.3, 1)',
|
|
45
|
+
},
|
|
46
|
+
exit: {
|
|
47
|
+
productive: 'cubic-bezier(0.2, 0, 1, 0.9)',
|
|
48
|
+
expressive: 'cubic-bezier(0.4, 0.14, 1, 1)',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const unstable_tokens = [
|
|
53
|
+
'durationFast01',
|
|
54
|
+
'durationFast02',
|
|
55
|
+
'durationModerate01',
|
|
56
|
+
'durationModerate02',
|
|
57
|
+
'durationSlow01',
|
|
58
|
+
'durationSlow02',
|
|
59
|
+
'fast01',
|
|
60
|
+
'fast02',
|
|
61
|
+
'moderate01',
|
|
62
|
+
'moderate02',
|
|
63
|
+
'slow01',
|
|
64
|
+
'slow02',
|
|
65
|
+
];
|
package/lib/index.js
CHANGED
|
@@ -1,37 +1,65 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
2
|
+
//#region js/generated/tokens.js
|
|
3
|
+
/** Micro-interactions such as button and toggle. Instant response to user action. */
|
|
4
|
+
const durationFast01 = "70ms";
|
|
5
|
+
/** Micro-interactions such as fade in. Subtle entrance or exit of small UI elements. */
|
|
6
|
+
const durationFast02 = "110ms";
|
|
7
|
+
/** Micro-interactions, small expansion, short distance movements. Default transition speed. */
|
|
8
|
+
const durationModerate01 = "150ms";
|
|
9
|
+
/** Expansion, system communication, toast. Slightly longer interactions with more visual weight. */
|
|
10
|
+
const durationModerate02 = "240ms";
|
|
11
|
+
/** Large expansion, important system notifications. Deliberate, prominent transitions. */
|
|
12
|
+
const durationSlow01 = "400ms";
|
|
13
|
+
/** Background dimming, large hero transitions. Slow, immersive motion for maximum emphasis. */
|
|
14
|
+
const durationSlow02 = "700ms";
|
|
15
|
+
/** @deprecated Use `durationFast01` instead */
|
|
16
|
+
const fast01 = durationFast01;
|
|
17
|
+
/** @deprecated Use `durationFast02` instead */
|
|
18
|
+
const fast02 = durationFast02;
|
|
19
|
+
/** @deprecated Use `durationModerate01` instead */
|
|
20
|
+
const moderate01 = durationModerate01;
|
|
21
|
+
/** @deprecated Use `durationModerate02` instead */
|
|
22
|
+
const moderate02 = durationModerate02;
|
|
23
|
+
/** @deprecated Use `durationSlow01` instead */
|
|
24
|
+
const slow01 = durationSlow01;
|
|
25
|
+
/** @deprecated Use `durationSlow02` instead */
|
|
26
|
+
const slow02 = durationSlow02;
|
|
27
|
+
const easings = {
|
|
28
|
+
standard: {
|
|
29
|
+
productive: "cubic-bezier(0.2, 0, 0.38, 0.9)",
|
|
30
|
+
expressive: "cubic-bezier(0.4, 0.14, 0.3, 1)"
|
|
31
|
+
},
|
|
32
|
+
entrance: {
|
|
33
|
+
productive: "cubic-bezier(0, 0, 0.38, 0.9)",
|
|
34
|
+
expressive: "cubic-bezier(0, 0, 0.3, 1)"
|
|
35
|
+
},
|
|
36
|
+
exit: {
|
|
37
|
+
productive: "cubic-bezier(0.2, 0, 1, 0.9)",
|
|
38
|
+
expressive: "cubic-bezier(0.4, 0.14, 1, 1)"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
21
41
|
const unstable_tokens = [
|
|
22
|
-
"fast01",
|
|
23
|
-
"fast02",
|
|
24
|
-
"moderate01",
|
|
25
|
-
"moderate02",
|
|
26
|
-
"slow01",
|
|
27
|
-
"slow02",
|
|
28
42
|
"durationFast01",
|
|
29
43
|
"durationFast02",
|
|
30
44
|
"durationModerate01",
|
|
31
45
|
"durationModerate02",
|
|
32
46
|
"durationSlow01",
|
|
33
|
-
"durationSlow02"
|
|
47
|
+
"durationSlow02",
|
|
48
|
+
"fast01",
|
|
49
|
+
"fast02",
|
|
50
|
+
"moderate01",
|
|
51
|
+
"moderate02",
|
|
52
|
+
"slow01",
|
|
53
|
+
"slow02"
|
|
34
54
|
];
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/tokens.ts
|
|
57
|
+
/**
|
|
58
|
+
* Copyright IBM Corp. 2018, 2026
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
61
|
+
* LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/
|
|
35
63
|
const durations = {
|
|
36
64
|
"fast-01": durationFast01,
|
|
37
65
|
"fast-02": durationFast02,
|
|
@@ -84,24 +112,9 @@ const easingCurves = {
|
|
|
84
112
|
]
|
|
85
113
|
}
|
|
86
114
|
};
|
|
87
|
-
const formatEasing = (curve) => `cubic-bezier(${curve.join(", ")})`;
|
|
88
|
-
const easings = {
|
|
89
|
-
standard: {
|
|
90
|
-
productive: formatEasing(easingCurves.standard.productive),
|
|
91
|
-
expressive: formatEasing(easingCurves.standard.expressive)
|
|
92
|
-
},
|
|
93
|
-
entrance: {
|
|
94
|
-
productive: formatEasing(easingCurves.entrance.productive),
|
|
95
|
-
expressive: formatEasing(easingCurves.entrance.expressive)
|
|
96
|
-
},
|
|
97
|
-
exit: {
|
|
98
|
-
productive: formatEasing(easingCurves.exit.productive),
|
|
99
|
-
expressive: formatEasing(easingCurves.exit.expressive)
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
115
|
const motion = (name, mode) => {
|
|
103
|
-
if (!easings[name]) throw new Error(`Unable to find easing \`${name}\` in our supported easings. Expected one of: ${Object.keys(easings).join(", ")}`);
|
|
104
116
|
const easing = easings[name];
|
|
117
|
+
if (!easing) throw new Error(`Unable to find easing \`${name}\` in our supported easings. Expected one of: ${Object.keys(easings).join(", ")}`);
|
|
105
118
|
if (!easing[mode]) throw new Error(`Unable to find a mode for the easing \`${name}\` called: \`${mode}\`. Expected one of: ${Object.keys(easing).join(", ")}`);
|
|
106
119
|
return easing[mode];
|
|
107
120
|
};
|
|
@@ -116,86 +129,76 @@ const resolveDuration = (name) => {
|
|
|
116
129
|
if (!duration) throw new Error(`Unable to find duration \`${name}\` in our supported durations. Expected one of: ${Object.keys(durations).join(", ")}`);
|
|
117
130
|
return duration;
|
|
118
131
|
};
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/surfaces.ts
|
|
121
|
-
/**
|
|
122
|
-
* Named motion intents. These definitions are engine and framework agnostic.
|
|
123
|
-
*
|
|
124
|
-
* `prefers-reduced-motion` is intentionally not represented here: surfaces
|
|
125
|
-
* never animate when the users request reduced motion. Framework adapters
|
|
126
|
-
* bail before running, and the Sass output is wrapped in a
|
|
127
|
-
* `prefers-reduced-motion: no-preference` media query
|
|
128
|
-
*/
|
|
129
132
|
const surfaces = {
|
|
130
133
|
disclosure: {
|
|
131
|
-
kind: "reveal",
|
|
132
|
-
duration: "moderate-01",
|
|
133
|
-
enter: {
|
|
134
|
-
blockSize: "auto",
|
|
135
|
-
opacity: 1
|
|
134
|
+
"kind": "reveal",
|
|
135
|
+
"duration": "moderate-01",
|
|
136
|
+
"enter": {
|
|
137
|
+
"blockSize": "auto",
|
|
138
|
+
"opacity": 1
|
|
136
139
|
},
|
|
137
|
-
exit: {
|
|
138
|
-
blockSize: 0,
|
|
139
|
-
opacity: 0
|
|
140
|
+
"exit": {
|
|
141
|
+
"blockSize": 0,
|
|
142
|
+
"opacity": 0
|
|
140
143
|
},
|
|
141
|
-
enterEasing: ["entrance", "productive"],
|
|
142
|
-
exitEasing: ["exit", "productive"]
|
|
144
|
+
"enterEasing": ["entrance", "productive"],
|
|
145
|
+
"exitEasing": ["exit", "productive"]
|
|
143
146
|
},
|
|
144
147
|
contextual: {
|
|
145
|
-
kind: "reveal",
|
|
146
|
-
duration: "fast-02",
|
|
147
|
-
enter: {
|
|
148
|
-
opacity: 1,
|
|
149
|
-
transform: "scale(1)"
|
|
148
|
+
"kind": "reveal",
|
|
149
|
+
"duration": "fast-02",
|
|
150
|
+
"enter": {
|
|
151
|
+
"opacity": 1,
|
|
152
|
+
"transform": "scale(1)"
|
|
150
153
|
},
|
|
151
|
-
exit: {
|
|
152
|
-
opacity: 0,
|
|
153
|
-
transform: "scale(0.96)"
|
|
154
|
+
"exit": {
|
|
155
|
+
"opacity": 0,
|
|
156
|
+
"transform": "scale(0.96)"
|
|
154
157
|
},
|
|
155
|
-
enterEasing: ["entrance", "expressive"],
|
|
156
|
-
exitEasing: ["exit", "expressive"]
|
|
158
|
+
"enterEasing": ["entrance", "expressive"],
|
|
159
|
+
"exitEasing": ["exit", "expressive"]
|
|
157
160
|
},
|
|
158
161
|
stretch: {
|
|
159
|
-
kind: "reveal",
|
|
160
|
-
duration: "slow-01",
|
|
161
|
-
enter: {
|
|
162
|
-
opacity: 1,
|
|
163
|
-
clipPath: "inset(0 0 0 0)"
|
|
162
|
+
"kind": "reveal",
|
|
163
|
+
"duration": "slow-01",
|
|
164
|
+
"enter": {
|
|
165
|
+
"opacity": 1,
|
|
166
|
+
"clipPath": "inset(0 0 0 0)"
|
|
164
167
|
},
|
|
165
|
-
exit: {
|
|
166
|
-
opacity: 0,
|
|
167
|
-
clipPath: "inset(50% 0 50% 0)"
|
|
168
|
+
"exit": {
|
|
169
|
+
"opacity": 0,
|
|
170
|
+
"clipPath": "inset(50% 0 50% 0)"
|
|
168
171
|
},
|
|
169
|
-
enterEasing: ["entrance", "expressive"],
|
|
170
|
-
exitEasing: ["exit", "expressive"]
|
|
172
|
+
"enterEasing": ["entrance", "expressive"],
|
|
173
|
+
"exitEasing": ["exit", "expressive"]
|
|
171
174
|
},
|
|
172
175
|
expand: {
|
|
173
|
-
kind: "shared-element",
|
|
174
|
-
duration: "moderate-02",
|
|
175
|
-
enter: {
|
|
176
|
-
opacity: 1,
|
|
177
|
-
transform: "scale(1)"
|
|
176
|
+
"kind": "shared-element",
|
|
177
|
+
"duration": "moderate-02",
|
|
178
|
+
"enter": {
|
|
179
|
+
"opacity": 1,
|
|
180
|
+
"transform": "scale(1)"
|
|
178
181
|
},
|
|
179
|
-
exit: {
|
|
180
|
-
opacity: 0,
|
|
181
|
-
transform: "scale(0.96)"
|
|
182
|
+
"exit": {
|
|
183
|
+
"opacity": 0,
|
|
184
|
+
"transform": "scale(0.96)"
|
|
182
185
|
},
|
|
183
|
-
enterEasing: ["standard", "productive"],
|
|
184
|
-
exitEasing: ["standard", "productive"]
|
|
186
|
+
"enterEasing": ["standard", "productive"],
|
|
187
|
+
"exitEasing": ["standard", "productive"]
|
|
185
188
|
},
|
|
186
189
|
invoke: {
|
|
187
|
-
kind: "shared-element",
|
|
188
|
-
origin: "trigger",
|
|
189
|
-
duration: "moderate-02",
|
|
190
|
-
enterEasing: ["standard", "expressive"],
|
|
191
|
-
exitEasing: ["standard", "expressive"]
|
|
190
|
+
"kind": "shared-element",
|
|
191
|
+
"origin": "trigger",
|
|
192
|
+
"duration": "moderate-02",
|
|
193
|
+
"enterEasing": ["standard", "expressive"],
|
|
194
|
+
"exitEasing": ["standard", "expressive"]
|
|
192
195
|
}
|
|
193
196
|
};
|
|
194
|
-
|
|
197
|
+
function getMotionSurface(name) {
|
|
195
198
|
const surface = surfaces[name];
|
|
196
|
-
if (!surface) throw new Error(`Unable to find motion surface \`${name}\`. Expected one of:
|
|
199
|
+
if (!surface) throw new Error(`Unable to find motion surface \`${name}\`. Expected one of: ${Object.keys(surfaces).join(", ")}`);
|
|
197
200
|
return surface;
|
|
198
|
-
}
|
|
201
|
+
}
|
|
199
202
|
//#endregion
|
|
200
203
|
exports.durationFast01 = durationFast01;
|
|
201
204
|
exports.durationFast02 = durationFast02;
|
package/lib/surfaces.d.ts
CHANGED
|
@@ -4,13 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
export { surfaces, getMotionSurface } from '../js/generated/surfaces.js';
|
|
8
|
+
import type { DurationName, EasingName, EasingMode } from './tokens';
|
|
8
9
|
type MotionEasing = readonly [EasingName, EasingMode];
|
|
9
|
-
/**
|
|
10
|
-
* from/to styles for reveal surface - plain CSS property/value pairs
|
|
11
|
-
* keep values engine-neutral so CSS, WAAPI, and Motion can all consume
|
|
12
|
-
* them
|
|
13
|
-
*/
|
|
14
10
|
type RevealKeyframe = Record<string, string | number>;
|
|
15
11
|
interface MotionSurfaceBase {
|
|
16
12
|
duration: DurationName;
|
|
@@ -29,137 +25,4 @@ interface SharedElementSurface extends MotionSurfaceBase {
|
|
|
29
25
|
origin?: 'trigger';
|
|
30
26
|
}
|
|
31
27
|
export type MotionSurfaceDefinition = SharedElementSurface | RevealSurface;
|
|
32
|
-
|
|
33
|
-
* Named motion intents. These definitions are engine and framework agnostic.
|
|
34
|
-
*
|
|
35
|
-
* `prefers-reduced-motion` is intentionally not represented here: surfaces
|
|
36
|
-
* never animate when the users request reduced motion. Framework adapters
|
|
37
|
-
* bail before running, and the Sass output is wrapped in a
|
|
38
|
-
* `prefers-reduced-motion: no-preference` media query
|
|
39
|
-
*/
|
|
40
|
-
export declare const surfaces: {
|
|
41
|
-
readonly disclosure: {
|
|
42
|
-
readonly kind: "reveal";
|
|
43
|
-
readonly duration: "moderate-01";
|
|
44
|
-
readonly enter: {
|
|
45
|
-
readonly blockSize: "auto";
|
|
46
|
-
readonly opacity: 1;
|
|
47
|
-
};
|
|
48
|
-
readonly exit: {
|
|
49
|
-
readonly blockSize: 0;
|
|
50
|
-
readonly opacity: 0;
|
|
51
|
-
};
|
|
52
|
-
readonly enterEasing: readonly ["entrance", "productive"];
|
|
53
|
-
readonly exitEasing: readonly ["exit", "productive"];
|
|
54
|
-
};
|
|
55
|
-
readonly contextual: {
|
|
56
|
-
readonly kind: "reveal";
|
|
57
|
-
readonly duration: "fast-02";
|
|
58
|
-
readonly enter: {
|
|
59
|
-
readonly opacity: 1;
|
|
60
|
-
readonly transform: "scale(1)";
|
|
61
|
-
};
|
|
62
|
-
readonly exit: {
|
|
63
|
-
readonly opacity: 0;
|
|
64
|
-
readonly transform: "scale(0.96)";
|
|
65
|
-
};
|
|
66
|
-
readonly enterEasing: readonly ["entrance", "expressive"];
|
|
67
|
-
readonly exitEasing: readonly ["exit", "expressive"];
|
|
68
|
-
};
|
|
69
|
-
readonly stretch: {
|
|
70
|
-
readonly kind: "reveal";
|
|
71
|
-
readonly duration: "slow-01";
|
|
72
|
-
readonly enter: {
|
|
73
|
-
readonly opacity: 1;
|
|
74
|
-
readonly clipPath: "inset(0 0 0 0)";
|
|
75
|
-
};
|
|
76
|
-
readonly exit: {
|
|
77
|
-
readonly opacity: 0;
|
|
78
|
-
readonly clipPath: "inset(50% 0 50% 0)";
|
|
79
|
-
};
|
|
80
|
-
readonly enterEasing: readonly ["entrance", "expressive"];
|
|
81
|
-
readonly exitEasing: readonly ["exit", "expressive"];
|
|
82
|
-
};
|
|
83
|
-
readonly expand: {
|
|
84
|
-
readonly kind: "shared-element";
|
|
85
|
-
readonly duration: "moderate-02";
|
|
86
|
-
readonly enter: {
|
|
87
|
-
readonly opacity: 1;
|
|
88
|
-
readonly transform: "scale(1)";
|
|
89
|
-
};
|
|
90
|
-
readonly exit: {
|
|
91
|
-
readonly opacity: 0;
|
|
92
|
-
readonly transform: "scale(0.96)";
|
|
93
|
-
};
|
|
94
|
-
readonly enterEasing: readonly ["standard", "productive"];
|
|
95
|
-
readonly exitEasing: readonly ["standard", "productive"];
|
|
96
|
-
};
|
|
97
|
-
readonly invoke: {
|
|
98
|
-
readonly kind: "shared-element";
|
|
99
|
-
readonly origin: "trigger";
|
|
100
|
-
readonly duration: "moderate-02";
|
|
101
|
-
readonly enterEasing: readonly ["standard", "expressive"];
|
|
102
|
-
readonly exitEasing: readonly ["standard", "expressive"];
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export type MotionSurfaceName = keyof typeof surfaces;
|
|
106
|
-
export declare const getMotionSurface: (name: MotionSurfaceName) => {
|
|
107
|
-
readonly kind: "reveal";
|
|
108
|
-
readonly duration: "moderate-01";
|
|
109
|
-
readonly enter: {
|
|
110
|
-
readonly blockSize: "auto";
|
|
111
|
-
readonly opacity: 1;
|
|
112
|
-
};
|
|
113
|
-
readonly exit: {
|
|
114
|
-
readonly blockSize: 0;
|
|
115
|
-
readonly opacity: 0;
|
|
116
|
-
};
|
|
117
|
-
readonly enterEasing: readonly ["entrance", "productive"];
|
|
118
|
-
readonly exitEasing: readonly ["exit", "productive"];
|
|
119
|
-
} | {
|
|
120
|
-
readonly kind: "reveal";
|
|
121
|
-
readonly duration: "fast-02";
|
|
122
|
-
readonly enter: {
|
|
123
|
-
readonly opacity: 1;
|
|
124
|
-
readonly transform: "scale(1)";
|
|
125
|
-
};
|
|
126
|
-
readonly exit: {
|
|
127
|
-
readonly opacity: 0;
|
|
128
|
-
readonly transform: "scale(0.96)";
|
|
129
|
-
};
|
|
130
|
-
readonly enterEasing: readonly ["entrance", "expressive"];
|
|
131
|
-
readonly exitEasing: readonly ["exit", "expressive"];
|
|
132
|
-
} | {
|
|
133
|
-
readonly kind: "reveal";
|
|
134
|
-
readonly duration: "slow-01";
|
|
135
|
-
readonly enter: {
|
|
136
|
-
readonly opacity: 1;
|
|
137
|
-
readonly clipPath: "inset(0 0 0 0)";
|
|
138
|
-
};
|
|
139
|
-
readonly exit: {
|
|
140
|
-
readonly opacity: 0;
|
|
141
|
-
readonly clipPath: "inset(50% 0 50% 0)";
|
|
142
|
-
};
|
|
143
|
-
readonly enterEasing: readonly ["entrance", "expressive"];
|
|
144
|
-
readonly exitEasing: readonly ["exit", "expressive"];
|
|
145
|
-
} | {
|
|
146
|
-
readonly kind: "shared-element";
|
|
147
|
-
readonly duration: "moderate-02";
|
|
148
|
-
readonly enter: {
|
|
149
|
-
readonly opacity: 1;
|
|
150
|
-
readonly transform: "scale(1)";
|
|
151
|
-
};
|
|
152
|
-
readonly exit: {
|
|
153
|
-
readonly opacity: 0;
|
|
154
|
-
readonly transform: "scale(0.96)";
|
|
155
|
-
};
|
|
156
|
-
readonly enterEasing: readonly ["standard", "productive"];
|
|
157
|
-
readonly exitEasing: readonly ["standard", "productive"];
|
|
158
|
-
} | {
|
|
159
|
-
readonly kind: "shared-element";
|
|
160
|
-
readonly origin: "trigger";
|
|
161
|
-
readonly duration: "moderate-02";
|
|
162
|
-
readonly enterEasing: readonly ["standard", "expressive"];
|
|
163
|
-
readonly exitEasing: readonly ["standard", "expressive"];
|
|
164
|
-
};
|
|
165
|
-
export {};
|
|
28
|
+
export type MotionSurfaceName = 'disclosure' | 'contextual' | 'stretch' | 'expand' | 'invoke';
|
package/lib/tokens.d.ts
CHANGED
|
@@ -4,25 +4,12 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
export declare const fast02 = "110ms";
|
|
9
|
-
export declare const moderate01 = "150ms";
|
|
10
|
-
export declare const moderate02 = "240ms";
|
|
11
|
-
export declare const slow01 = "400ms";
|
|
12
|
-
export declare const slow02 = "700ms";
|
|
13
|
-
export declare const durationFast01 = "70ms";
|
|
14
|
-
export declare const durationFast02 = "110ms";
|
|
15
|
-
export declare const durationModerate01 = "150ms";
|
|
16
|
-
export declare const durationModerate02 = "240ms";
|
|
17
|
-
export declare const durationSlow01 = "400ms";
|
|
18
|
-
export declare const durationSlow02 = "700ms";
|
|
19
|
-
export declare const unstable_tokens: readonly ["fast01", "fast02", "moderate01", "moderate02", "slow01", "slow02", "durationFast01", "durationFast02", "durationModerate01", "durationModerate02", "durationSlow01", "durationSlow02"];
|
|
7
|
+
export { durationFast01, durationFast02, durationModerate01, durationModerate02, durationSlow01, durationSlow02, fast01, fast02, moderate01, moderate02, slow01, slow02, easings, unstable_tokens, } from '../js/generated/tokens.js';
|
|
20
8
|
export type DurationName = 'fast-01' | 'fast-02' | 'moderate-01' | 'moderate-02' | 'slow-01' | 'slow-02';
|
|
21
9
|
export type EasingName = 'standard' | 'entrance' | 'exit';
|
|
22
10
|
export type EasingMode = 'productive' | 'expressive';
|
|
23
11
|
export type CubicBezier = readonly [number, number, number, number];
|
|
24
12
|
export type EasingMap = Record<EasingName, Record<EasingMode, string>>;
|
|
25
|
-
export declare const easings: EasingMap;
|
|
26
13
|
export declare const motion: (name: EasingName, mode: EasingMode) => string;
|
|
27
14
|
export declare const resolveEasing: (name: EasingName, mode: EasingMode) => CubicBezier;
|
|
28
15
|
export declare const resolveDuration: (name: DurationName) => string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/motion",
|
|
3
3
|
"description": "Motion helpers for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.50.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"index.scss",
|
|
8
|
+
"scss/**/*.scss"
|
|
9
|
+
],
|
|
6
10
|
"main": "lib/index.js",
|
|
7
11
|
"module": "es/index.js",
|
|
8
12
|
"types": "lib/index.d.ts",
|
|
@@ -27,13 +31,14 @@
|
|
|
27
31
|
"provenance": true
|
|
28
32
|
},
|
|
29
33
|
"scripts": {
|
|
34
|
+
"build:tokens": "node tasks/build.js",
|
|
30
35
|
"build:types": "tsc -p tsconfig.types.json",
|
|
31
|
-
"build": "yarn clean && carbon-cli bundle src/index.ts --name CarbonMotion &&
|
|
32
|
-
"clean": "rimraf es lib umd scss/generated",
|
|
36
|
+
"build": "yarn clean && yarn build:tokens && carbon-cli bundle src/index.ts --name CarbonMotion && yarn build:types",
|
|
37
|
+
"clean": "rimraf es lib umd js/generated scss/generated",
|
|
33
38
|
"postinstall": "ibmtelemetry --config=telemetry.yml"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
|
-
"@carbon/cli": "^11.
|
|
41
|
+
"@carbon/cli": "^11.48.0",
|
|
37
42
|
"rimraf": "^6.0.1",
|
|
38
43
|
"typescript": "^6.0.3",
|
|
39
44
|
"typescript-config-carbon": "^0.11.0"
|
|
@@ -41,5 +46,5 @@
|
|
|
41
46
|
"dependencies": {
|
|
42
47
|
"@ibm/telemetry-js": "^1.5.0"
|
|
43
48
|
},
|
|
44
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "188d23202ec1092322dee92cf0df9d9958224ae4"
|
|
45
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by @carbon/motion. DO NOT EDIT.
|
|
2
2
|
//
|
|
3
|
-
// Copyright IBM Corp. 2026
|
|
3
|
+
// Copyright IBM Corp. 2018, 2026
|
|
4
4
|
//
|
|
5
5
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
6
|
// LICENSE file in the root directory of this source tree.
|
|
@@ -18,14 +18,8 @@ $surfaces: (
|
|
|
18
18
|
block-size: 0,
|
|
19
19
|
opacity: 0,
|
|
20
20
|
),
|
|
21
|
-
enter-easing: (
|
|
22
|
-
|
|
23
|
-
'productive',
|
|
24
|
-
),
|
|
25
|
-
exit-easing: (
|
|
26
|
-
'exit',
|
|
27
|
-
'productive',
|
|
28
|
-
),
|
|
21
|
+
enter-easing: ('entrance', 'productive'),
|
|
22
|
+
exit-easing: ('exit', 'productive'),
|
|
29
23
|
),
|
|
30
24
|
contextual: (
|
|
31
25
|
kind: 'reveal',
|
|
@@ -38,14 +32,8 @@ $surfaces: (
|
|
|
38
32
|
opacity: 0,
|
|
39
33
|
transform: 'scale(0.96)',
|
|
40
34
|
),
|
|
41
|
-
enter-easing: (
|
|
42
|
-
|
|
43
|
-
'expressive',
|
|
44
|
-
),
|
|
45
|
-
exit-easing: (
|
|
46
|
-
'exit',
|
|
47
|
-
'expressive',
|
|
48
|
-
),
|
|
35
|
+
enter-easing: ('entrance', 'expressive'),
|
|
36
|
+
exit-easing: ('exit', 'expressive'),
|
|
49
37
|
),
|
|
50
38
|
stretch: (
|
|
51
39
|
kind: 'reveal',
|
|
@@ -58,14 +46,8 @@ $surfaces: (
|
|
|
58
46
|
opacity: 0,
|
|
59
47
|
clip-path: 'inset(50% 0 50% 0)',
|
|
60
48
|
),
|
|
61
|
-
enter-easing: (
|
|
62
|
-
|
|
63
|
-
'expressive',
|
|
64
|
-
),
|
|
65
|
-
exit-easing: (
|
|
66
|
-
'exit',
|
|
67
|
-
'expressive',
|
|
68
|
-
),
|
|
49
|
+
enter-easing: ('entrance', 'expressive'),
|
|
50
|
+
exit-easing: ('exit', 'expressive'),
|
|
69
51
|
),
|
|
70
52
|
expand: (
|
|
71
53
|
kind: 'shared-element',
|
|
@@ -78,26 +60,14 @@ $surfaces: (
|
|
|
78
60
|
opacity: 0,
|
|
79
61
|
transform: 'scale(0.96)',
|
|
80
62
|
),
|
|
81
|
-
enter-easing: (
|
|
82
|
-
|
|
83
|
-
'productive',
|
|
84
|
-
),
|
|
85
|
-
exit-easing: (
|
|
86
|
-
'standard',
|
|
87
|
-
'productive',
|
|
88
|
-
),
|
|
63
|
+
enter-easing: ('standard', 'productive'),
|
|
64
|
+
exit-easing: ('standard', 'productive'),
|
|
89
65
|
),
|
|
90
66
|
invoke: (
|
|
91
67
|
kind: 'shared-element',
|
|
92
68
|
origin: 'trigger',
|
|
93
69
|
duration: 'moderate-02',
|
|
94
|
-
enter-easing: (
|
|
95
|
-
|
|
96
|
-
'expressive',
|
|
97
|
-
),
|
|
98
|
-
exit-easing: (
|
|
99
|
-
'standard',
|
|
100
|
-
'expressive',
|
|
101
|
-
),
|
|
70
|
+
enter-easing: ('standard', 'expressive'),
|
|
71
|
+
exit-easing: ('standard', 'expressive'),
|
|
102
72
|
),
|
|
103
73
|
);
|