@primer/primitives 11.7.1 → 11.8.0-rc.d6a26ac6

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.
@@ -65,18 +65,26 @@
65
65
 
66
66
  ### Motion
67
67
 
68
- | Keyword | Rule |
69
- | ------- | -------------------------------------------------------------- |
70
- | MUST | Use motion for interactive state changes (hover, focus, press) |
71
- | MUST | Keep animations ≤300ms for UI interactions |
72
- | MUST | Respect `prefers-reduced-motion` media query |
73
- | MUST | Provide instant alternatives when motion is reduced |
74
- | SHOULD | Use 100-200ms for micro-interactions |
75
- | SHOULD | Use 200-300ms for state changes |
76
- | NEVER | Exceed 500ms for UI interactions |
77
- | NEVER | Use motion purely for decoration |
78
- | NEVER | Create indefinitely looping motion without user control |
79
- | NEVER | Rely solely on motion to convey information |
68
+ ```
69
+ --motion-[property]-[semantic]
70
+ ├── property: duration | easing | transition
71
+ └── semantic: micro | short | medium | long (duration)
72
+ hover | enter | exit | move | linear (easing)
73
+ hover | stateChange | enter | exit (transition)
74
+ ```
75
+
76
+ | Keyword | Rule |
77
+ | ------- | -------------------------------------------------------------------------- |
78
+ | MUST | Use `motion.transition.*` tokens for interactive state changes |
79
+ | MUST | Keep animations ≤`motion.duration.medium` (300ms) for UI interactions |
80
+ | MUST | Respect `prefers-reduced-motion` media query |
81
+ | MUST | Provide instant alternatives when motion is reduced |
82
+ | SHOULD | Use `motion.duration.micro` (100ms) for hover and focus micro-interactions |
83
+ | SHOULD | Use `motion.duration.short` (200ms) for state changes |
84
+ | NEVER | Exceed `motion.duration.long` (500ms) for UI interactions |
85
+ | NEVER | Use motion purely for decoration |
86
+ | NEVER | Create indefinitely looping motion without user control |
87
+ | NEVER | Rely solely on motion to convey information |
80
88
 
81
89
  ### Typography
82
90
 
@@ -126,10 +134,10 @@
126
134
 
127
135
  ## Decision Tree: Easing Selection
128
136
 
129
- 1. Is element entering/exiting viewport? → ease-out (default)
130
- 2. Is element moving/morphing on screen? → ease-in-out
131
- 3. Is this a hover state change? → ease
132
- 4. Is this constant motion (loaders)? → linear
137
+ 1. Is element entering/exiting viewport? → `motion.easing.enter` / `motion.easing.exit`
138
+ 2. Is element moving/morphing on screen? → `motion.easing.move`
139
+ 3. Is this a hover state change? → `motion.easing.hover`
140
+ 4. Is this constant motion (loaders)? → `motion.easing.linear`
133
141
 
134
142
  ---
135
143
 
@@ -148,11 +156,11 @@
148
156
  font: var(--text-body-shorthand-medium);
149
157
  cursor: pointer;
150
158
 
151
- /* Motion: MUST be <300ms */
159
+ /* Motion: Use functional motion tokens */
152
160
  transition:
153
- background-color 150ms ease,
154
- box-shadow 150ms ease,
155
- transform 100ms ease;
161
+ background-color var(--motion-transition-hover),
162
+ box-shadow var(--motion-transition-hover),
163
+ transform var(--motion-transition-hover);
156
164
  }
157
165
 
158
166
  /* State: Hover */
@@ -429,6 +429,73 @@ Display font stack for headings and titles. Same as sansSerif but semantically d
429
429
  **U:** display-text, heading, title
430
430
  **R:** Use for headings and display text. Prefer over sansSerif for titles.
431
431
 
432
+ ## Motion
433
+
434
+ ### motion-duration-long
435
+ Longer duration for complex multi-step animations or large-scale layout shifts. Use sparingly.
436
+ **U:** complex-animation, layout-shift, multi-step
437
+ **R:** Use sparingly for complex animations. NEVER use for simple UI interactions.
438
+
439
+ ### motion-duration-medium
440
+ Standard duration for elements entering or exiting the viewport, such as modals and dropdowns.
441
+ **U:** dropdown-appear, modal-open, tooltip-show
442
+ **R:** Use for elements entering or leaving the viewport. Maximum recommended duration for UI interactions.
443
+
444
+ ### motion-duration-micro
445
+ Fast micro-interactions like hover, focus ring, and color shifts.
446
+ **U:** color-shift, focus-ring, hover-transition
447
+ **R:** Use for instantaneous feedback on hover and focus states.
448
+
449
+ ### motion-duration-short
450
+ Quick transitions for state changes like expand/collapse, toggles, and visibility changes.
451
+ **U:** expand-collapse, toggle, visibility-change
452
+ **R:** Use for interactive state changes that need to feel responsive.
453
+
454
+ ### motion-easing-enter
455
+ Decelerating easing for elements entering the viewport or appearing on screen.
456
+ **U:** element-appearing, enter-animation, modal-open
457
+ **R:** RECOMMENDED default for enter animations. Element decelerates into its final position.
458
+
459
+ ### motion-easing-exit
460
+ Accelerating easing for elements exiting the viewport or leaving the screen.
461
+ **U:** element-leaving, exit-animation, modal-close
462
+ **R:** Use for elements leaving the viewport. Element accelerates away.
463
+
464
+ ### motion-easing-hover
465
+ Easing for hover state changes and micro-interactions.
466
+ **U:** button-hover, hover-state, micro-interaction
467
+ **R:** Use for hover state changes.
468
+
469
+ ### motion-easing-linear
470
+ Constant motion with no acceleration. Use for continuous animations like progress bars or loaders.
471
+ **U:** continuous-animation, loader, progress-bar
472
+ **R:** Use only for constant, uninterrupted motion.
473
+
474
+ ### motion-easing-move
475
+ Smooth easing for elements moving or morphing within the viewport.
476
+ **U:** morph-animation, position-change, size-change
477
+ **R:** Use for elements that move or change shape on screen.
478
+
479
+ ### motion-transition-enter
480
+ Transition for elements entering the viewport, such as modals, dropdowns, and tooltips.
481
+ **U:** dropdown-appear, modal-open, tooltip-show
482
+ **R:** Use for elements appearing on screen. Element decelerates into final position.
483
+
484
+ ### motion-transition-exit
485
+ Transition for elements exiting the viewport, such as closing modals and dismissing dropdowns.
486
+ **U:** dropdown-dismiss, modal-close, tooltip-hide
487
+ **R:** Use for elements leaving the screen. Shorter than enter to feel snappy.
488
+
489
+ ### motion-transition-hover
490
+ Transition for hover state changes on interactive elements like buttons and links.
491
+ **U:** button-hover, interactive-hover, link-hover
492
+ **R:** Use for all hover state transitions. Keeps interactions feeling instantaneous.
493
+
494
+ ### motion-transition-stateChange
495
+ Transition for state changes like toggles, expand/collapse, and visibility changes.
496
+ **U:** accordion, expand-collapse, toggle
497
+ **R:** Use for interactive elements that change between states.
498
+
432
499
  ## Overlay
433
500
 
434
501
  Tokens for modals, dialogs, popovers, and dropdown menus.
@@ -22,6 +22,10 @@ export const transitionToCss = {
22
22
  }
23
23
  // check required properties
24
24
  checkRequiredTokenProperties(value, ['duration', 'timingFunction']);
25
- return `${value.duration} ${cubicBezierArrayToCss(value.timingFunction, token.path)} ${value.delay ? value.delay : ''}`.trim();
25
+ // timingFunction may already be a CSS string if resolved from a cubicBezier reference
26
+ const timing = typeof value.timingFunction === 'string'
27
+ ? value.timingFunction
28
+ : cubicBezierArrayToCss(value.timingFunction, token.path);
29
+ return `${value.duration} ${timing} ${value.delay ? value.delay : ''}`.trim();
26
30
  },
27
31
  };
@@ -0,0 +1,15 @@
1
+ :root {
2
+ --motion-duration-long: var(--base-duration-500); /** Longer duration for complex multi-step animations or large-scale layout shifts. Use sparingly. */
3
+ --motion-duration-medium: var(--base-duration-300); /** Standard duration for elements entering or exiting the viewport, such as modals and dropdowns. */
4
+ --motion-duration-micro: var(--base-duration-100); /** Fast micro-interactions like hover, focus ring, and color shifts. */
5
+ --motion-duration-short: var(--base-duration-200); /** Quick transitions for state changes like expand/collapse, toggles, and visibility changes. */
6
+ --motion-easing-enter: var(--base-easing-easeOut); /** Decelerating easing for elements entering the viewport or appearing on screen. */
7
+ --motion-easing-exit: var(--base-easing-easeIn); /** Accelerating easing for elements exiting the viewport or leaving the screen. */
8
+ --motion-easing-hover: var(--base-easing-ease); /** Easing for hover state changes and micro-interactions. */
9
+ --motion-easing-linear: var(--base-easing-linear); /** Constant motion with no acceleration. Use for continuous animations like progress bars or loaders. */
10
+ --motion-easing-move: var(--base-easing-easeInOut); /** Smooth easing for elements moving or morphing within the viewport. */
11
+ --motion-transition-enter: var(--motion-duration-medium) var(--motion-easing-enter); /** Transition for elements entering the viewport, such as modals, dropdowns, and tooltips. */
12
+ --motion-transition-exit: var(--motion-duration-short) var(--motion-easing-exit); /** Transition for elements exiting the viewport, such as closing modals and dismissing dropdowns. */
13
+ --motion-transition-hover: var(--motion-duration-micro) var(--motion-easing-hover); /** Transition for hover state changes on interactive elements like buttons and links. */
14
+ --motion-transition-stateChange: var(--motion-duration-short) var(--motion-easing-move); /** Transition for state changes like toggles, expand/collapse, and visibility changes. */
15
+ }
@@ -6,6 +6,7 @@
6
6
  @import './base/size/size.css';
7
7
  @import './base/size/z-index.css';
8
8
  @import './base/typography/typography.css';
9
+ @import './functional/motion/motion.css';
9
10
  @import './functional/size/border.css';
10
11
  @import './functional/size/breakpoints.css';
11
12
  @import './functional/size/radius.css';
@@ -0,0 +1,427 @@
1
+ {
2
+ "motion-duration-long": {
3
+ "key": "{motion.duration.long}",
4
+ "$extensions": {
5
+ "org.primer.llm": {
6
+ "usage": ["complex-animation", "multi-step", "layout-shift", "page-transition"],
7
+ "rules": "Use sparingly for complex animations. NEVER use for simple UI interactions."
8
+ }
9
+ },
10
+ "filePath": "src/tokens/functional/motion/motion.json5",
11
+ "isSource": true,
12
+ "original": {
13
+ "$value": "{base.duration.500}",
14
+ "$type": "duration",
15
+ "$description": "Longer duration for complex multi-step animations or large-scale layout shifts. Use sparingly.",
16
+ "$extensions": {
17
+ "org.primer.llm": {
18
+ "usage": ["complex-animation", "multi-step", "layout-shift", "page-transition"],
19
+ "rules": "Use sparingly for complex animations. NEVER use for simple UI interactions."
20
+ }
21
+ },
22
+ "key": "{motion.duration.long}"
23
+ },
24
+ "name": "motion-duration-long",
25
+ "attributes": {},
26
+ "path": ["motion", "duration", "long"],
27
+ "value": {
28
+ "value": 500,
29
+ "unit": "ms"
30
+ },
31
+ "type": "duration",
32
+ "description": "Longer duration for complex multi-step animations or large-scale layout shifts. Use sparingly."
33
+ },
34
+ "motion-duration-medium": {
35
+ "key": "{motion.duration.medium}",
36
+ "$extensions": {
37
+ "org.primer.llm": {
38
+ "usage": ["modal-open", "dropdown-appear", "tooltip-show", "enter-exit-viewport"],
39
+ "rules": "Use for elements entering or leaving the viewport. Maximum recommended duration for UI interactions."
40
+ }
41
+ },
42
+ "filePath": "src/tokens/functional/motion/motion.json5",
43
+ "isSource": true,
44
+ "original": {
45
+ "$value": "{base.duration.300}",
46
+ "$type": "duration",
47
+ "$description": "Standard duration for elements entering or exiting the viewport, such as modals and dropdowns.",
48
+ "$extensions": {
49
+ "org.primer.llm": {
50
+ "usage": ["modal-open", "dropdown-appear", "tooltip-show", "enter-exit-viewport"],
51
+ "rules": "Use for elements entering or leaving the viewport. Maximum recommended duration for UI interactions."
52
+ }
53
+ },
54
+ "key": "{motion.duration.medium}"
55
+ },
56
+ "name": "motion-duration-medium",
57
+ "attributes": {},
58
+ "path": ["motion", "duration", "medium"],
59
+ "value": {
60
+ "value": 300,
61
+ "unit": "ms"
62
+ },
63
+ "type": "duration",
64
+ "description": "Standard duration for elements entering or exiting the viewport, such as modals and dropdowns."
65
+ },
66
+ "motion-duration-micro": {
67
+ "key": "{motion.duration.micro}",
68
+ "$extensions": {
69
+ "org.primer.llm": {
70
+ "usage": ["hover-transition", "focus-ring", "color-shift", "opacity-change"],
71
+ "rules": "Use for instantaneous feedback on hover and focus states."
72
+ }
73
+ },
74
+ "filePath": "src/tokens/functional/motion/motion.json5",
75
+ "isSource": true,
76
+ "original": {
77
+ "$value": "{base.duration.100}",
78
+ "$type": "duration",
79
+ "$description": "Fast micro-interactions like hover, focus ring, and color shifts.",
80
+ "$extensions": {
81
+ "org.primer.llm": {
82
+ "usage": ["hover-transition", "focus-ring", "color-shift", "opacity-change"],
83
+ "rules": "Use for instantaneous feedback on hover and focus states."
84
+ }
85
+ },
86
+ "key": "{motion.duration.micro}"
87
+ },
88
+ "name": "motion-duration-micro",
89
+ "attributes": {},
90
+ "path": ["motion", "duration", "micro"],
91
+ "value": {
92
+ "value": 100,
93
+ "unit": "ms"
94
+ },
95
+ "type": "duration",
96
+ "description": "Fast micro-interactions like hover, focus ring, and color shifts."
97
+ },
98
+ "motion-duration-short": {
99
+ "key": "{motion.duration.short}",
100
+ "$extensions": {
101
+ "org.primer.llm": {
102
+ "usage": ["expand-collapse", "toggle", "visibility-change", "state-transition"],
103
+ "rules": "Use for interactive state changes that need to feel responsive."
104
+ }
105
+ },
106
+ "filePath": "src/tokens/functional/motion/motion.json5",
107
+ "isSource": true,
108
+ "original": {
109
+ "$value": "{base.duration.200}",
110
+ "$type": "duration",
111
+ "$description": "Quick transitions for state changes like expand/collapse, toggles, and visibility changes.",
112
+ "$extensions": {
113
+ "org.primer.llm": {
114
+ "usage": ["expand-collapse", "toggle", "visibility-change", "state-transition"],
115
+ "rules": "Use for interactive state changes that need to feel responsive."
116
+ }
117
+ },
118
+ "key": "{motion.duration.short}"
119
+ },
120
+ "name": "motion-duration-short",
121
+ "attributes": {},
122
+ "path": ["motion", "duration", "short"],
123
+ "value": {
124
+ "value": 200,
125
+ "unit": "ms"
126
+ },
127
+ "type": "duration",
128
+ "description": "Quick transitions for state changes like expand/collapse, toggles, and visibility changes."
129
+ },
130
+ "motion-easing-enter": {
131
+ "key": "{motion.easing.enter}",
132
+ "$extensions": {
133
+ "org.primer.llm": {
134
+ "usage": ["enter-animation", "element-appearing", "modal-open", "dropdown-open", "tooltip-appear"],
135
+ "rules": "RECOMMENDED default for enter animations. Element decelerates into its final position."
136
+ }
137
+ },
138
+ "filePath": "src/tokens/functional/motion/motion.json5",
139
+ "isSource": true,
140
+ "original": {
141
+ "$value": "{base.easing.easeOut}",
142
+ "$type": "cubicBezier",
143
+ "$description": "Decelerating easing for elements entering the viewport or appearing on screen.",
144
+ "$extensions": {
145
+ "org.primer.llm": {
146
+ "usage": ["enter-animation", "element-appearing", "modal-open", "dropdown-open", "tooltip-appear"],
147
+ "rules": "RECOMMENDED default for enter animations. Element decelerates into its final position."
148
+ }
149
+ },
150
+ "key": "{motion.easing.enter}"
151
+ },
152
+ "name": "motion-easing-enter",
153
+ "attributes": {},
154
+ "path": ["motion", "easing", "enter"],
155
+ "value": [0.3, 0.8, 0.6, 1],
156
+ "type": "cubicBezier",
157
+ "description": "Decelerating easing for elements entering the viewport or appearing on screen."
158
+ },
159
+ "motion-easing-exit": {
160
+ "key": "{motion.easing.exit}",
161
+ "$extensions": {
162
+ "org.primer.llm": {
163
+ "usage": ["exit-animation", "element-leaving", "modal-close", "dismiss"],
164
+ "rules": "Use for elements leaving the viewport. Element accelerates away."
165
+ }
166
+ },
167
+ "filePath": "src/tokens/functional/motion/motion.json5",
168
+ "isSource": true,
169
+ "original": {
170
+ "$value": "{base.easing.easeIn}",
171
+ "$type": "cubicBezier",
172
+ "$description": "Accelerating easing for elements exiting the viewport or leaving the screen.",
173
+ "$extensions": {
174
+ "org.primer.llm": {
175
+ "usage": ["exit-animation", "element-leaving", "modal-close", "dismiss"],
176
+ "rules": "Use for elements leaving the viewport. Element accelerates away."
177
+ }
178
+ },
179
+ "key": "{motion.easing.exit}"
180
+ },
181
+ "name": "motion-easing-exit",
182
+ "attributes": {},
183
+ "path": ["motion", "easing", "exit"],
184
+ "value": [0.7, 0.1, 0.75, 0.9],
185
+ "type": "cubicBezier",
186
+ "description": "Accelerating easing for elements exiting the viewport or leaving the screen."
187
+ },
188
+ "motion-easing-hover": {
189
+ "key": "{motion.easing.hover}",
190
+ "$extensions": {
191
+ "org.primer.llm": {
192
+ "usage": ["hover-state", "micro-interaction", "button-hover", "link-hover"],
193
+ "rules": "Use for hover state changes."
194
+ }
195
+ },
196
+ "filePath": "src/tokens/functional/motion/motion.json5",
197
+ "isSource": true,
198
+ "original": {
199
+ "$value": "{base.easing.ease}",
200
+ "$type": "cubicBezier",
201
+ "$description": "Easing for hover state changes and micro-interactions.",
202
+ "$extensions": {
203
+ "org.primer.llm": {
204
+ "usage": ["hover-state", "micro-interaction", "button-hover", "link-hover"],
205
+ "rules": "Use for hover state changes."
206
+ }
207
+ },
208
+ "key": "{motion.easing.hover}"
209
+ },
210
+ "name": "motion-easing-hover",
211
+ "attributes": {},
212
+ "path": ["motion", "easing", "hover"],
213
+ "value": [0.25, 0.1, 0.25, 1],
214
+ "type": "cubicBezier",
215
+ "description": "Easing for hover state changes and micro-interactions."
216
+ },
217
+ "motion-easing-linear": {
218
+ "key": "{motion.easing.linear}",
219
+ "$extensions": {
220
+ "org.primer.llm": {
221
+ "usage": ["progress-bar", "loader", "continuous-animation", "scrolling"],
222
+ "rules": "Use only for constant, uninterrupted motion."
223
+ }
224
+ },
225
+ "filePath": "src/tokens/functional/motion/motion.json5",
226
+ "isSource": true,
227
+ "original": {
228
+ "$value": "{base.easing.linear}",
229
+ "$type": "cubicBezier",
230
+ "$description": "Constant motion with no acceleration. Use for continuous animations like progress bars or loaders.",
231
+ "$extensions": {
232
+ "org.primer.llm": {
233
+ "usage": ["progress-bar", "loader", "continuous-animation", "scrolling"],
234
+ "rules": "Use only for constant, uninterrupted motion."
235
+ }
236
+ },
237
+ "key": "{motion.easing.linear}"
238
+ },
239
+ "name": "motion-easing-linear",
240
+ "attributes": {},
241
+ "path": ["motion", "easing", "linear"],
242
+ "value": [0, 0, 1, 1],
243
+ "type": "cubicBezier",
244
+ "description": "Constant motion with no acceleration. Use for continuous animations like progress bars or loaders."
245
+ },
246
+ "motion-easing-move": {
247
+ "key": "{motion.easing.move}",
248
+ "$extensions": {
249
+ "org.primer.llm": {
250
+ "usage": ["position-change", "size-change", "morph-animation", "expand-collapse", "slide-transition"],
251
+ "rules": "Use for elements that move or change shape on screen."
252
+ }
253
+ },
254
+ "filePath": "src/tokens/functional/motion/motion.json5",
255
+ "isSource": true,
256
+ "original": {
257
+ "$value": "{base.easing.easeInOut}",
258
+ "$type": "cubicBezier",
259
+ "$description": "Smooth easing for elements moving or morphing within the viewport.",
260
+ "$extensions": {
261
+ "org.primer.llm": {
262
+ "usage": ["position-change", "size-change", "morph-animation", "expand-collapse", "slide-transition"],
263
+ "rules": "Use for elements that move or change shape on screen."
264
+ }
265
+ },
266
+ "key": "{motion.easing.move}"
267
+ },
268
+ "name": "motion-easing-move",
269
+ "attributes": {},
270
+ "path": ["motion", "easing", "move"],
271
+ "value": [0.6, 0, 0.2, 1],
272
+ "type": "cubicBezier",
273
+ "description": "Smooth easing for elements moving or morphing within the viewport."
274
+ },
275
+ "motion-transition-enter": {
276
+ "key": "{motion.transition.enter}",
277
+ "$extensions": {
278
+ "org.primer.llm": {
279
+ "usage": ["modal-open", "dropdown-appear", "tooltip-show", "popover-enter", "overlay-appear"],
280
+ "rules": "Use for elements appearing on screen. Element decelerates into final position."
281
+ }
282
+ },
283
+ "filePath": "src/tokens/functional/motion/motion.json5",
284
+ "isSource": true,
285
+ "original": {
286
+ "$value": {
287
+ "duration": "{motion.duration.medium}",
288
+ "timingFunction": "{motion.easing.enter}"
289
+ },
290
+ "$type": "transition",
291
+ "$description": "Transition for elements entering the viewport, such as modals, dropdowns, and tooltips.",
292
+ "$extensions": {
293
+ "org.primer.llm": {
294
+ "usage": ["modal-open", "dropdown-appear", "tooltip-show", "popover-enter", "overlay-appear"],
295
+ "rules": "Use for elements appearing on screen. Element decelerates into final position."
296
+ }
297
+ },
298
+ "key": "{motion.transition.enter}"
299
+ },
300
+ "name": "motion-transition-enter",
301
+ "attributes": {},
302
+ "path": ["motion", "transition", "enter"],
303
+ "value": {
304
+ "duration": {
305
+ "value": 300,
306
+ "unit": "ms"
307
+ },
308
+ "timingFunction": [0.3, 0.8, 0.6, 1]
309
+ },
310
+ "type": "transition",
311
+ "description": "Transition for elements entering the viewport, such as modals, dropdowns, and tooltips."
312
+ },
313
+ "motion-transition-exit": {
314
+ "key": "{motion.transition.exit}",
315
+ "$extensions": {
316
+ "org.primer.llm": {
317
+ "usage": ["modal-close", "dropdown-dismiss", "tooltip-hide", "popover-exit", "overlay-dismiss"],
318
+ "rules": "Use for elements leaving the screen. Shorter than enter to feel snappy."
319
+ }
320
+ },
321
+ "filePath": "src/tokens/functional/motion/motion.json5",
322
+ "isSource": true,
323
+ "original": {
324
+ "$value": {
325
+ "duration": "{motion.duration.short}",
326
+ "timingFunction": "{motion.easing.exit}"
327
+ },
328
+ "$type": "transition",
329
+ "$description": "Transition for elements exiting the viewport, such as closing modals and dismissing dropdowns.",
330
+ "$extensions": {
331
+ "org.primer.llm": {
332
+ "usage": ["modal-close", "dropdown-dismiss", "tooltip-hide", "popover-exit", "overlay-dismiss"],
333
+ "rules": "Use for elements leaving the screen. Shorter than enter to feel snappy."
334
+ }
335
+ },
336
+ "key": "{motion.transition.exit}"
337
+ },
338
+ "name": "motion-transition-exit",
339
+ "attributes": {},
340
+ "path": ["motion", "transition", "exit"],
341
+ "value": {
342
+ "duration": {
343
+ "value": 200,
344
+ "unit": "ms"
345
+ },
346
+ "timingFunction": [0.7, 0.1, 0.75, 0.9]
347
+ },
348
+ "type": "transition",
349
+ "description": "Transition for elements exiting the viewport, such as closing modals and dismissing dropdowns."
350
+ },
351
+ "motion-transition-hover": {
352
+ "key": "{motion.transition.hover}",
353
+ "$extensions": {
354
+ "org.primer.llm": {
355
+ "usage": ["button-hover", "link-hover", "interactive-hover", "color-transition"],
356
+ "rules": "Use for all hover state transitions. Keeps interactions feeling instantaneous."
357
+ }
358
+ },
359
+ "filePath": "src/tokens/functional/motion/motion.json5",
360
+ "isSource": true,
361
+ "original": {
362
+ "$value": {
363
+ "duration": "{motion.duration.micro}",
364
+ "timingFunction": "{motion.easing.hover}"
365
+ },
366
+ "$type": "transition",
367
+ "$description": "Transition for hover state changes on interactive elements like buttons and links.",
368
+ "$extensions": {
369
+ "org.primer.llm": {
370
+ "usage": ["button-hover", "link-hover", "interactive-hover", "color-transition"],
371
+ "rules": "Use for all hover state transitions. Keeps interactions feeling instantaneous."
372
+ }
373
+ },
374
+ "key": "{motion.transition.hover}"
375
+ },
376
+ "name": "motion-transition-hover",
377
+ "attributes": {},
378
+ "path": ["motion", "transition", "hover"],
379
+ "value": {
380
+ "duration": {
381
+ "value": 100,
382
+ "unit": "ms"
383
+ },
384
+ "timingFunction": [0.25, 0.1, 0.25, 1]
385
+ },
386
+ "type": "transition",
387
+ "description": "Transition for hover state changes on interactive elements like buttons and links."
388
+ },
389
+ "motion-transition-stateChange": {
390
+ "key": "{motion.transition.stateChange}",
391
+ "$extensions": {
392
+ "org.primer.llm": {
393
+ "usage": ["toggle", "expand-collapse", "accordion", "tab-switch", "visibility-change"],
394
+ "rules": "Use for interactive elements that change between states."
395
+ }
396
+ },
397
+ "filePath": "src/tokens/functional/motion/motion.json5",
398
+ "isSource": true,
399
+ "original": {
400
+ "$value": {
401
+ "duration": "{motion.duration.short}",
402
+ "timingFunction": "{motion.easing.move}"
403
+ },
404
+ "$type": "transition",
405
+ "$description": "Transition for state changes like toggles, expand/collapse, and visibility changes.",
406
+ "$extensions": {
407
+ "org.primer.llm": {
408
+ "usage": ["toggle", "expand-collapse", "accordion", "tab-switch", "visibility-change"],
409
+ "rules": "Use for interactive elements that change between states."
410
+ }
411
+ },
412
+ "key": "{motion.transition.stateChange}"
413
+ },
414
+ "name": "motion-transition-stateChange",
415
+ "attributes": {},
416
+ "path": ["motion", "transition", "stateChange"],
417
+ "value": {
418
+ "duration": {
419
+ "value": 200,
420
+ "unit": "ms"
421
+ },
422
+ "timingFunction": [0.6, 0, 0.2, 1]
423
+ },
424
+ "type": "transition",
425
+ "description": "Transition for state changes like toggles, expand/collapse, and visibility changes."
426
+ }
427
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "--motion-duration-micro": {
3
+ "value": 100,
4
+ "unit": "ms"
5
+ },
6
+ "--motion-duration-short": {
7
+ "value": 200,
8
+ "unit": "ms"
9
+ },
10
+ "--motion-duration-medium": {
11
+ "value": 300,
12
+ "unit": "ms"
13
+ },
14
+ "--motion-duration-long": {
15
+ "value": 500,
16
+ "unit": "ms"
17
+ },
18
+ "--motion-easing-hover": [0.25, 0.1, 0.25, 1],
19
+ "--motion-easing-enter": [0.3, 0.8, 0.6, 1],
20
+ "--motion-easing-exit": [0.7, 0.1, 0.75, 0.9],
21
+ "--motion-easing-move": [0.6, 0, 0.2, 1],
22
+ "--motion-easing-linear": [0, 0, 1, 1],
23
+ "--motion-transition-hover": {
24
+ "duration": {
25
+ "value": 100,
26
+ "unit": "ms"
27
+ },
28
+ "timingFunction": [0.25, 0.1, 0.25, 1]
29
+ },
30
+ "--motion-transition-stateChange": {
31
+ "duration": {
32
+ "value": 200,
33
+ "unit": "ms"
34
+ },
35
+ "timingFunction": [0.6, 0, 0.2, 1]
36
+ },
37
+ "--motion-transition-enter": {
38
+ "duration": {
39
+ "value": 300,
40
+ "unit": "ms"
41
+ },
42
+ "timingFunction": [0.3, 0.8, 0.6, 1]
43
+ },
44
+ "--motion-transition-exit": {
45
+ "duration": {
46
+ "value": 200,
47
+ "unit": "ms"
48
+ },
49
+ "timingFunction": [0.7, 0.1, 0.75, 0.9]
50
+ }
51
+ }