@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
package/README.md
CHANGED
|
@@ -50,6 +50,10 @@ do the following in your project:
|
|
|
50
50
|
Both the `motion` function and mixin support passing in the name of the motion
|
|
51
51
|
curve and the mode you want to work in.
|
|
52
52
|
|
|
53
|
+
> **Build note:** Token values are generated at build time from
|
|
54
|
+
> `src/dtcg/motion.json`. Run `yarn build` (or `npm run build`) once after
|
|
55
|
+
> cloning so that `js/generated/` and `scss/generated/` are present.
|
|
56
|
+
|
|
53
57
|
### JavaScript
|
|
54
58
|
|
|
55
59
|
If you're using `@carbon/motion` as a JavaScript dependency, we export our
|
package/es/index.js
CHANGED
|
@@ -1,36 +1,64 @@
|
|
|
1
|
-
//#region
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
1
|
+
//#region js/generated/tokens.js
|
|
2
|
+
/** Micro-interactions such as button and toggle. Instant response to user action. */
|
|
3
|
+
const durationFast01 = "70ms";
|
|
4
|
+
/** Micro-interactions such as fade in. Subtle entrance or exit of small UI elements. */
|
|
5
|
+
const durationFast02 = "110ms";
|
|
6
|
+
/** Micro-interactions, small expansion, short distance movements. Default transition speed. */
|
|
7
|
+
const durationModerate01 = "150ms";
|
|
8
|
+
/** Expansion, system communication, toast. Slightly longer interactions with more visual weight. */
|
|
9
|
+
const durationModerate02 = "240ms";
|
|
10
|
+
/** Large expansion, important system notifications. Deliberate, prominent transitions. */
|
|
11
|
+
const durationSlow01 = "400ms";
|
|
12
|
+
/** Background dimming, large hero transitions. Slow, immersive motion for maximum emphasis. */
|
|
13
|
+
const durationSlow02 = "700ms";
|
|
14
|
+
/** @deprecated Use `durationFast01` instead */
|
|
15
|
+
const fast01 = durationFast01;
|
|
16
|
+
/** @deprecated Use `durationFast02` instead */
|
|
17
|
+
const fast02 = durationFast02;
|
|
18
|
+
/** @deprecated Use `durationModerate01` instead */
|
|
19
|
+
const moderate01 = durationModerate01;
|
|
20
|
+
/** @deprecated Use `durationModerate02` instead */
|
|
21
|
+
const moderate02 = durationModerate02;
|
|
22
|
+
/** @deprecated Use `durationSlow01` instead */
|
|
23
|
+
const slow01 = durationSlow01;
|
|
24
|
+
/** @deprecated Use `durationSlow02` instead */
|
|
25
|
+
const slow02 = durationSlow02;
|
|
26
|
+
const easings = {
|
|
27
|
+
standard: {
|
|
28
|
+
productive: "cubic-bezier(0.2, 0, 0.38, 0.9)",
|
|
29
|
+
expressive: "cubic-bezier(0.4, 0.14, 0.3, 1)"
|
|
30
|
+
},
|
|
31
|
+
entrance: {
|
|
32
|
+
productive: "cubic-bezier(0, 0, 0.38, 0.9)",
|
|
33
|
+
expressive: "cubic-bezier(0, 0, 0.3, 1)"
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
productive: "cubic-bezier(0.2, 0, 1, 0.9)",
|
|
37
|
+
expressive: "cubic-bezier(0.4, 0.14, 1, 1)"
|
|
38
|
+
}
|
|
39
|
+
};
|
|
20
40
|
const unstable_tokens = [
|
|
21
|
-
"fast01",
|
|
22
|
-
"fast02",
|
|
23
|
-
"moderate01",
|
|
24
|
-
"moderate02",
|
|
25
|
-
"slow01",
|
|
26
|
-
"slow02",
|
|
27
41
|
"durationFast01",
|
|
28
42
|
"durationFast02",
|
|
29
43
|
"durationModerate01",
|
|
30
44
|
"durationModerate02",
|
|
31
45
|
"durationSlow01",
|
|
32
|
-
"durationSlow02"
|
|
46
|
+
"durationSlow02",
|
|
47
|
+
"fast01",
|
|
48
|
+
"fast02",
|
|
49
|
+
"moderate01",
|
|
50
|
+
"moderate02",
|
|
51
|
+
"slow01",
|
|
52
|
+
"slow02"
|
|
33
53
|
];
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/tokens.ts
|
|
56
|
+
/**
|
|
57
|
+
* Copyright IBM Corp. 2018, 2026
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
60
|
+
* LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/
|
|
34
62
|
const durations = {
|
|
35
63
|
"fast-01": durationFast01,
|
|
36
64
|
"fast-02": durationFast02,
|
|
@@ -83,24 +111,9 @@ const easingCurves = {
|
|
|
83
111
|
]
|
|
84
112
|
}
|
|
85
113
|
};
|
|
86
|
-
const formatEasing = (curve) => `cubic-bezier(${curve.join(", ")})`;
|
|
87
|
-
const easings = {
|
|
88
|
-
standard: {
|
|
89
|
-
productive: formatEasing(easingCurves.standard.productive),
|
|
90
|
-
expressive: formatEasing(easingCurves.standard.expressive)
|
|
91
|
-
},
|
|
92
|
-
entrance: {
|
|
93
|
-
productive: formatEasing(easingCurves.entrance.productive),
|
|
94
|
-
expressive: formatEasing(easingCurves.entrance.expressive)
|
|
95
|
-
},
|
|
96
|
-
exit: {
|
|
97
|
-
productive: formatEasing(easingCurves.exit.productive),
|
|
98
|
-
expressive: formatEasing(easingCurves.exit.expressive)
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
114
|
const motion = (name, mode) => {
|
|
102
|
-
if (!easings[name]) throw new Error(`Unable to find easing \`${name}\` in our supported easings. Expected one of: ${Object.keys(easings).join(", ")}`);
|
|
103
115
|
const easing = easings[name];
|
|
116
|
+
if (!easing) throw new Error(`Unable to find easing \`${name}\` in our supported easings. Expected one of: ${Object.keys(easings).join(", ")}`);
|
|
104
117
|
if (!easing[mode]) throw new Error(`Unable to find a mode for the easing \`${name}\` called: \`${mode}\`. Expected one of: ${Object.keys(easing).join(", ")}`);
|
|
105
118
|
return easing[mode];
|
|
106
119
|
};
|
|
@@ -115,85 +128,75 @@ const resolveDuration = (name) => {
|
|
|
115
128
|
if (!duration) throw new Error(`Unable to find duration \`${name}\` in our supported durations. Expected one of: ${Object.keys(durations).join(", ")}`);
|
|
116
129
|
return duration;
|
|
117
130
|
};
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/surfaces.ts
|
|
120
|
-
/**
|
|
121
|
-
* Named motion intents. These definitions are engine and framework agnostic.
|
|
122
|
-
*
|
|
123
|
-
* `prefers-reduced-motion` is intentionally not represented here: surfaces
|
|
124
|
-
* never animate when the users request reduced motion. Framework adapters
|
|
125
|
-
* bail before running, and the Sass output is wrapped in a
|
|
126
|
-
* `prefers-reduced-motion: no-preference` media query
|
|
127
|
-
*/
|
|
128
131
|
const surfaces = {
|
|
129
132
|
disclosure: {
|
|
130
|
-
kind: "reveal",
|
|
131
|
-
duration: "moderate-01",
|
|
132
|
-
enter: {
|
|
133
|
-
blockSize: "auto",
|
|
134
|
-
opacity: 1
|
|
133
|
+
"kind": "reveal",
|
|
134
|
+
"duration": "moderate-01",
|
|
135
|
+
"enter": {
|
|
136
|
+
"blockSize": "auto",
|
|
137
|
+
"opacity": 1
|
|
135
138
|
},
|
|
136
|
-
exit: {
|
|
137
|
-
blockSize: 0,
|
|
138
|
-
opacity: 0
|
|
139
|
+
"exit": {
|
|
140
|
+
"blockSize": 0,
|
|
141
|
+
"opacity": 0
|
|
139
142
|
},
|
|
140
|
-
enterEasing: ["entrance", "productive"],
|
|
141
|
-
exitEasing: ["exit", "productive"]
|
|
143
|
+
"enterEasing": ["entrance", "productive"],
|
|
144
|
+
"exitEasing": ["exit", "productive"]
|
|
142
145
|
},
|
|
143
146
|
contextual: {
|
|
144
|
-
kind: "reveal",
|
|
145
|
-
duration: "fast-02",
|
|
146
|
-
enter: {
|
|
147
|
-
opacity: 1,
|
|
148
|
-
transform: "scale(1)"
|
|
147
|
+
"kind": "reveal",
|
|
148
|
+
"duration": "fast-02",
|
|
149
|
+
"enter": {
|
|
150
|
+
"opacity": 1,
|
|
151
|
+
"transform": "scale(1)"
|
|
149
152
|
},
|
|
150
|
-
exit: {
|
|
151
|
-
opacity: 0,
|
|
152
|
-
transform: "scale(0.96)"
|
|
153
|
+
"exit": {
|
|
154
|
+
"opacity": 0,
|
|
155
|
+
"transform": "scale(0.96)"
|
|
153
156
|
},
|
|
154
|
-
enterEasing: ["entrance", "expressive"],
|
|
155
|
-
exitEasing: ["exit", "expressive"]
|
|
157
|
+
"enterEasing": ["entrance", "expressive"],
|
|
158
|
+
"exitEasing": ["exit", "expressive"]
|
|
156
159
|
},
|
|
157
160
|
stretch: {
|
|
158
|
-
kind: "reveal",
|
|
159
|
-
duration: "slow-01",
|
|
160
|
-
enter: {
|
|
161
|
-
opacity: 1,
|
|
162
|
-
clipPath: "inset(0 0 0 0)"
|
|
161
|
+
"kind": "reveal",
|
|
162
|
+
"duration": "slow-01",
|
|
163
|
+
"enter": {
|
|
164
|
+
"opacity": 1,
|
|
165
|
+
"clipPath": "inset(0 0 0 0)"
|
|
163
166
|
},
|
|
164
|
-
exit: {
|
|
165
|
-
opacity: 0,
|
|
166
|
-
clipPath: "inset(50% 0 50% 0)"
|
|
167
|
+
"exit": {
|
|
168
|
+
"opacity": 0,
|
|
169
|
+
"clipPath": "inset(50% 0 50% 0)"
|
|
167
170
|
},
|
|
168
|
-
enterEasing: ["entrance", "expressive"],
|
|
169
|
-
exitEasing: ["exit", "expressive"]
|
|
171
|
+
"enterEasing": ["entrance", "expressive"],
|
|
172
|
+
"exitEasing": ["exit", "expressive"]
|
|
170
173
|
},
|
|
171
174
|
expand: {
|
|
172
|
-
kind: "shared-element",
|
|
173
|
-
duration: "moderate-02",
|
|
174
|
-
enter: {
|
|
175
|
-
opacity: 1,
|
|
176
|
-
transform: "scale(1)"
|
|
175
|
+
"kind": "shared-element",
|
|
176
|
+
"duration": "moderate-02",
|
|
177
|
+
"enter": {
|
|
178
|
+
"opacity": 1,
|
|
179
|
+
"transform": "scale(1)"
|
|
177
180
|
},
|
|
178
|
-
exit: {
|
|
179
|
-
opacity: 0,
|
|
180
|
-
transform: "scale(0.96)"
|
|
181
|
+
"exit": {
|
|
182
|
+
"opacity": 0,
|
|
183
|
+
"transform": "scale(0.96)"
|
|
181
184
|
},
|
|
182
|
-
enterEasing: ["standard", "productive"],
|
|
183
|
-
exitEasing: ["standard", "productive"]
|
|
185
|
+
"enterEasing": ["standard", "productive"],
|
|
186
|
+
"exitEasing": ["standard", "productive"]
|
|
184
187
|
},
|
|
185
188
|
invoke: {
|
|
186
|
-
kind: "shared-element",
|
|
187
|
-
origin: "trigger",
|
|
188
|
-
duration: "moderate-02",
|
|
189
|
-
enterEasing: ["standard", "expressive"],
|
|
190
|
-
exitEasing: ["standard", "expressive"]
|
|
189
|
+
"kind": "shared-element",
|
|
190
|
+
"origin": "trigger",
|
|
191
|
+
"duration": "moderate-02",
|
|
192
|
+
"enterEasing": ["standard", "expressive"],
|
|
193
|
+
"exitEasing": ["standard", "expressive"]
|
|
191
194
|
}
|
|
192
195
|
};
|
|
193
|
-
|
|
196
|
+
function getMotionSurface(name) {
|
|
194
197
|
const surface = surfaces[name];
|
|
195
|
-
if (!surface) throw new Error(`Unable to find motion surface \`${name}\`. Expected one of:
|
|
198
|
+
if (!surface) throw new Error(`Unable to find motion surface \`${name}\`. Expected one of: ${Object.keys(surfaces).join(", ")}`);
|
|
196
199
|
return surface;
|
|
197
|
-
}
|
|
200
|
+
}
|
|
198
201
|
//#endregion
|
|
199
202
|
export { durationFast01, durationFast02, durationModerate01, durationModerate02, durationSlow01, durationSlow02, easings, fast01, fast02, getMotionSurface, moderate01, moderate02, motion, resolveDuration, resolveEasing, slow01, slow02, surfaces, unstable_tokens };
|
package/index.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright IBM Corp. 2018,
|
|
2
|
+
// Copyright IBM Corp. 2018, 2026
|
|
3
3
|
//
|
|
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.
|
|
@@ -7,31 +7,36 @@
|
|
|
7
7
|
|
|
8
8
|
@use 'sass:list';
|
|
9
9
|
@use 'sass:map';
|
|
10
|
+
@use './scss/generated/tokens' as tokens;
|
|
10
11
|
@use 'scss/generated/surfaces' as generated;
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
$
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
// Re-forward all generated token variables as public API
|
|
14
|
+
$easings: tokens.$easings !default;
|
|
15
|
+
$duration-fast-01: tokens.$duration-fast-01 !default;
|
|
16
|
+
$duration-fast-02: tokens.$duration-fast-02 !default;
|
|
17
|
+
$duration-moderate-01: tokens.$duration-moderate-01 !default;
|
|
18
|
+
$duration-moderate-02: tokens.$duration-moderate-02 !default;
|
|
19
|
+
$duration-slow-01: tokens.$duration-slow-01 !default;
|
|
20
|
+
$duration-slow-02: tokens.$duration-slow-02 !default;
|
|
21
|
+
|
|
22
|
+
/// V10 backwards compatibility tokens
|
|
23
|
+
/// @deprecated
|
|
24
|
+
$fast-01: tokens.$fast-01 !default;
|
|
25
|
+
/// @deprecated
|
|
26
|
+
$fast-02: tokens.$fast-02 !default;
|
|
27
|
+
/// @deprecated
|
|
28
|
+
$moderate-01: tokens.$moderate-01 !default;
|
|
29
|
+
/// @deprecated
|
|
30
|
+
$moderate-02: tokens.$moderate-02 !default;
|
|
31
|
+
/// @deprecated
|
|
32
|
+
$slow-01: tokens.$slow-01 !default;
|
|
33
|
+
/// @deprecated
|
|
34
|
+
$slow-02: tokens.$slow-02 !default;
|
|
30
35
|
|
|
31
36
|
/// Get the transition-timing-function for a given easing and motion mode
|
|
32
37
|
/// @param {String} $name - Can be `standard`, `entrance`, or `exit`
|
|
33
38
|
/// @param {String} $mode [productive] - Can be `productive` or `expressive`
|
|
34
|
-
/// @param {Map} $easings [$
|
|
39
|
+
/// @param {Map} $easings [$easings] - Easings map
|
|
35
40
|
/// @access public
|
|
36
41
|
/// @group @carbon/motion
|
|
37
42
|
/// @return {Function} CSS `cubic-bezier()` function
|
|
@@ -57,73 +62,6 @@ $easings: (
|
|
|
57
62
|
transition-timing-function: motion($name, $mode);
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
/// @access public
|
|
61
|
-
/// @type Duration
|
|
62
|
-
/// @group @carbon/motion
|
|
63
|
-
$duration-fast-01: 70ms;
|
|
64
|
-
|
|
65
|
-
/// @access public
|
|
66
|
-
/// @type Duration
|
|
67
|
-
/// @group @carbon/motion
|
|
68
|
-
$duration-fast-02: 110ms;
|
|
69
|
-
|
|
70
|
-
/// @access public
|
|
71
|
-
/// @type Duration
|
|
72
|
-
/// @group @carbon/motion
|
|
73
|
-
$duration-moderate-01: 150ms;
|
|
74
|
-
|
|
75
|
-
/// @access public
|
|
76
|
-
/// @type Duration
|
|
77
|
-
/// @group @carbon/motion
|
|
78
|
-
$duration-moderate-02: 240ms;
|
|
79
|
-
|
|
80
|
-
/// @access public
|
|
81
|
-
/// @type Duration
|
|
82
|
-
/// @group @carbon/motion
|
|
83
|
-
$duration-slow-01: 400ms;
|
|
84
|
-
|
|
85
|
-
/// @access public
|
|
86
|
-
/// @type Duration
|
|
87
|
-
/// @group @carbon/motion
|
|
88
|
-
$duration-slow-02: 700ms;
|
|
89
|
-
|
|
90
|
-
/// V10 backwards compatibility tokens
|
|
91
|
-
/// @access public
|
|
92
|
-
/// @deprecated
|
|
93
|
-
/// @type Duration
|
|
94
|
-
/// @group @carbon/motion
|
|
95
|
-
$fast-01: $duration-fast-01;
|
|
96
|
-
|
|
97
|
-
/// @access public
|
|
98
|
-
/// @deprecated
|
|
99
|
-
/// @type Duration
|
|
100
|
-
/// @group @carbon/motion
|
|
101
|
-
$fast-02: $duration-fast-02;
|
|
102
|
-
|
|
103
|
-
/// @access public
|
|
104
|
-
/// @deprecated
|
|
105
|
-
/// @type Duration
|
|
106
|
-
/// @group @carbon/motion
|
|
107
|
-
$moderate-01: $duration-moderate-01;
|
|
108
|
-
|
|
109
|
-
/// @access public
|
|
110
|
-
/// @deprecated
|
|
111
|
-
/// @type Duration
|
|
112
|
-
/// @group @carbon/motion
|
|
113
|
-
$moderate-02: $duration-moderate-02;
|
|
114
|
-
|
|
115
|
-
/// @access public
|
|
116
|
-
/// @deprecated
|
|
117
|
-
/// @type Duration
|
|
118
|
-
/// @group @carbon/motion
|
|
119
|
-
$slow-01: $duration-slow-01;
|
|
120
|
-
|
|
121
|
-
/// @access public
|
|
122
|
-
/// @deprecated
|
|
123
|
-
/// @type Duration
|
|
124
|
-
/// @group @carbon/motion
|
|
125
|
-
$slow-02: $duration-slow-02;
|
|
126
|
-
|
|
127
65
|
/// Named motion intents shared across Carbon implementations
|
|
128
66
|
/// @type Map
|
|
129
67
|
/// @access public
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
/** Accordion, table-row expand — reveal in place. */
|
|
9
|
+
export declare const disclosure: {
|
|
10
|
+
kind: "reveal",
|
|
11
|
+
duration: "moderate-01",
|
|
12
|
+
enter: {
|
|
13
|
+
blockSize: "auto",
|
|
14
|
+
opacity: 1
|
|
15
|
+
},
|
|
16
|
+
exit: {
|
|
17
|
+
blockSize: 0,
|
|
18
|
+
opacity: 0
|
|
19
|
+
},
|
|
20
|
+
enterEasing: [
|
|
21
|
+
"entrance",
|
|
22
|
+
"productive"
|
|
23
|
+
],
|
|
24
|
+
exitEasing: [
|
|
25
|
+
"exit",
|
|
26
|
+
"productive"
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** Icon → tooltip/popover — fade and scale reveal. */
|
|
31
|
+
export declare const contextual: {
|
|
32
|
+
kind: "reveal",
|
|
33
|
+
duration: "fast-02",
|
|
34
|
+
enter: {
|
|
35
|
+
opacity: 1,
|
|
36
|
+
transform: "scale(1)"
|
|
37
|
+
},
|
|
38
|
+
exit: {
|
|
39
|
+
opacity: 0,
|
|
40
|
+
transform: "scale(0.96)"
|
|
41
|
+
},
|
|
42
|
+
enterEasing: [
|
|
43
|
+
"entrance",
|
|
44
|
+
"expressive"
|
|
45
|
+
],
|
|
46
|
+
exitEasing: [
|
|
47
|
+
"exit",
|
|
48
|
+
"expressive"
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Component reveal stretching from the vertical axis. */
|
|
53
|
+
export declare const stretch: {
|
|
54
|
+
kind: "reveal",
|
|
55
|
+
duration: "slow-01",
|
|
56
|
+
enter: {
|
|
57
|
+
opacity: 1,
|
|
58
|
+
clipPath: "inset(0 0 0 0)"
|
|
59
|
+
},
|
|
60
|
+
exit: {
|
|
61
|
+
opacity: 0,
|
|
62
|
+
clipPath: "inset(50% 0 50% 0)"
|
|
63
|
+
},
|
|
64
|
+
enterEasing: [
|
|
65
|
+
"entrance",
|
|
66
|
+
"expressive"
|
|
67
|
+
],
|
|
68
|
+
exitEasing: [
|
|
69
|
+
"exit",
|
|
70
|
+
"expressive"
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Card/tile → side-panel/tearsheet — shared-element morph. */
|
|
75
|
+
export declare const expand: {
|
|
76
|
+
kind: "shared-element",
|
|
77
|
+
duration: "moderate-02",
|
|
78
|
+
enter: {
|
|
79
|
+
opacity: 1,
|
|
80
|
+
transform: "scale(1)"
|
|
81
|
+
},
|
|
82
|
+
exit: {
|
|
83
|
+
opacity: 0,
|
|
84
|
+
transform: "scale(0.96)"
|
|
85
|
+
},
|
|
86
|
+
enterEasing: [
|
|
87
|
+
"standard",
|
|
88
|
+
"productive"
|
|
89
|
+
],
|
|
90
|
+
exitEasing: [
|
|
91
|
+
"standard",
|
|
92
|
+
"productive"
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** Button → modal/menu/popover — shared-element morph from the trigger. */
|
|
97
|
+
export declare const invoke: {
|
|
98
|
+
kind: "shared-element",
|
|
99
|
+
origin: "trigger",
|
|
100
|
+
duration: "moderate-02",
|
|
101
|
+
enterEasing: [
|
|
102
|
+
"standard",
|
|
103
|
+
"expressive"
|
|
104
|
+
],
|
|
105
|
+
exitEasing: [
|
|
106
|
+
"standard",
|
|
107
|
+
"expressive"
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export declare const surfaces: {
|
|
112
|
+
disclosure: typeof disclosure;
|
|
113
|
+
contextual: typeof contextual;
|
|
114
|
+
stretch: typeof stretch;
|
|
115
|
+
expand: typeof expand;
|
|
116
|
+
invoke: typeof invoke;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export declare function getMotionSurface(name: 'disclosure' | 'contextual' | 'stretch' | 'expand' | 'invoke'): (typeof surfaces)[typeof name];
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
/** Accordion, table-row expand — reveal in place. */
|
|
9
|
+
export const disclosure = {
|
|
10
|
+
"kind": "reveal",
|
|
11
|
+
"duration": "moderate-01",
|
|
12
|
+
"enter": {
|
|
13
|
+
"blockSize": "auto",
|
|
14
|
+
"opacity": 1
|
|
15
|
+
},
|
|
16
|
+
"exit": {
|
|
17
|
+
"blockSize": 0,
|
|
18
|
+
"opacity": 0
|
|
19
|
+
},
|
|
20
|
+
"enterEasing": [
|
|
21
|
+
"entrance",
|
|
22
|
+
"productive"
|
|
23
|
+
],
|
|
24
|
+
"exitEasing": [
|
|
25
|
+
"exit",
|
|
26
|
+
"productive"
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** Icon → tooltip/popover — fade and scale reveal. */
|
|
31
|
+
export const contextual = {
|
|
32
|
+
"kind": "reveal",
|
|
33
|
+
"duration": "fast-02",
|
|
34
|
+
"enter": {
|
|
35
|
+
"opacity": 1,
|
|
36
|
+
"transform": "scale(1)"
|
|
37
|
+
},
|
|
38
|
+
"exit": {
|
|
39
|
+
"opacity": 0,
|
|
40
|
+
"transform": "scale(0.96)"
|
|
41
|
+
},
|
|
42
|
+
"enterEasing": [
|
|
43
|
+
"entrance",
|
|
44
|
+
"expressive"
|
|
45
|
+
],
|
|
46
|
+
"exitEasing": [
|
|
47
|
+
"exit",
|
|
48
|
+
"expressive"
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Component reveal stretching from the vertical axis. */
|
|
53
|
+
export const stretch = {
|
|
54
|
+
"kind": "reveal",
|
|
55
|
+
"duration": "slow-01",
|
|
56
|
+
"enter": {
|
|
57
|
+
"opacity": 1,
|
|
58
|
+
"clipPath": "inset(0 0 0 0)"
|
|
59
|
+
},
|
|
60
|
+
"exit": {
|
|
61
|
+
"opacity": 0,
|
|
62
|
+
"clipPath": "inset(50% 0 50% 0)"
|
|
63
|
+
},
|
|
64
|
+
"enterEasing": [
|
|
65
|
+
"entrance",
|
|
66
|
+
"expressive"
|
|
67
|
+
],
|
|
68
|
+
"exitEasing": [
|
|
69
|
+
"exit",
|
|
70
|
+
"expressive"
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Card/tile → side-panel/tearsheet — shared-element morph. */
|
|
75
|
+
export const expand = {
|
|
76
|
+
"kind": "shared-element",
|
|
77
|
+
"duration": "moderate-02",
|
|
78
|
+
"enter": {
|
|
79
|
+
"opacity": 1,
|
|
80
|
+
"transform": "scale(1)"
|
|
81
|
+
},
|
|
82
|
+
"exit": {
|
|
83
|
+
"opacity": 0,
|
|
84
|
+
"transform": "scale(0.96)"
|
|
85
|
+
},
|
|
86
|
+
"enterEasing": [
|
|
87
|
+
"standard",
|
|
88
|
+
"productive"
|
|
89
|
+
],
|
|
90
|
+
"exitEasing": [
|
|
91
|
+
"standard",
|
|
92
|
+
"productive"
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** Button → modal/menu/popover — shared-element morph from the trigger. */
|
|
97
|
+
export const invoke = {
|
|
98
|
+
"kind": "shared-element",
|
|
99
|
+
"origin": "trigger",
|
|
100
|
+
"duration": "moderate-02",
|
|
101
|
+
"enterEasing": [
|
|
102
|
+
"standard",
|
|
103
|
+
"expressive"
|
|
104
|
+
],
|
|
105
|
+
"exitEasing": [
|
|
106
|
+
"standard",
|
|
107
|
+
"expressive"
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const surfaces = {
|
|
112
|
+
disclosure,
|
|
113
|
+
contextual,
|
|
114
|
+
stretch,
|
|
115
|
+
expand,
|
|
116
|
+
invoke,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export function getMotionSurface(name) {
|
|
120
|
+
const surface = surfaces[name];
|
|
121
|
+
if (!surface) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`Unable to find motion surface \`${name}\`. Expected one of: ${Object.keys(surfaces).join(', ')}`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return surface;
|
|
127
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 declare const durationFast01: string;
|
|
11
|
+
/** Micro-interactions such as fade in. Subtle entrance or exit of small UI elements. */
|
|
12
|
+
export declare const durationFast02: string;
|
|
13
|
+
/** Micro-interactions, small expansion, short distance movements. Default transition speed. */
|
|
14
|
+
export declare const durationModerate01: string;
|
|
15
|
+
/** Expansion, system communication, toast. Slightly longer interactions with more visual weight. */
|
|
16
|
+
export declare const durationModerate02: string;
|
|
17
|
+
/** Large expansion, important system notifications. Deliberate, prominent transitions. */
|
|
18
|
+
export declare const durationSlow01: string;
|
|
19
|
+
/** Background dimming, large hero transitions. Slow, immersive motion for maximum emphasis. */
|
|
20
|
+
export declare const durationSlow02: string;
|
|
21
|
+
|
|
22
|
+
// Duration tokens (V10 — deprecated aliases)
|
|
23
|
+
/** @deprecated Use `durationFast01` instead */
|
|
24
|
+
export declare const fast01: string;
|
|
25
|
+
/** @deprecated Use `durationFast02` instead */
|
|
26
|
+
export declare const fast02: string;
|
|
27
|
+
/** @deprecated Use `durationModerate01` instead */
|
|
28
|
+
export declare const moderate01: string;
|
|
29
|
+
/** @deprecated Use `durationModerate02` instead */
|
|
30
|
+
export declare const moderate02: string;
|
|
31
|
+
/** @deprecated Use `durationSlow01` instead */
|
|
32
|
+
export declare const slow01: string;
|
|
33
|
+
/** @deprecated Use `durationSlow02` instead */
|
|
34
|
+
export declare const slow02: string;
|
|
35
|
+
|
|
36
|
+
// Easing tokens
|
|
37
|
+
export declare const easings: Record<'standard' | 'entrance' | 'exit', Record<'productive' | 'expressive', string>>;
|
|
38
|
+
|
|
39
|
+
export declare const unstable_tokens: readonly string[];
|