@tensor_1/tokens 2.45.1 → 2.46.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/styles/motion.css CHANGED
@@ -1,12 +1,23 @@
1
- /* uix motion — shared keyframes, enter/exit helpers, and the reduced-motion guard.
2
- Components reference these tokens/keyframes; overlays pair the helpers with @starting-style. */
1
+ /* uix motion — shared keyframes, enter/exit helpers, the instant-surface rule and the reduced-motion policy.
2
+ Components reference these tokens/keyframes; overlays pair the helpers with @starting-style.
3
+ The contract (docs → Foundations → Motion) is checked by packages/tokens/scripts/check-motion.mjs. */
3
4
 
4
- /* Reduced-motion guard — UNLAYERED so its !important beats every component transition. */
5
+ /* Reduced-motion policy — UNLAYERED. `prefers-reduced-motion: reduce` removes MOVEMENT, not feedback:
6
+ - Transitions keep only fades and colour changes. Transform, translate, scale, rotate and any layout
7
+ glide drop out of every transition list, so a popover or drawer still fades but no longer travels.
8
+ allow-discrete keeps display/overlay exits painted while their fade runs.
9
+ - Keyframe animations end at once (we cannot tell a product's keyframes from a fade). UIx's own
10
+ still-working indicators (Spinner, Button loading, skeleton, indeterminate progress, SaveStatus,
11
+ a running flow node, Heartbeat) opt back in from their component layer with a slow opacity pulse
12
+ (`uix-pulse`, --uix-loop-pulse) declared !important — a layered !important beats this unlayered one —
13
+ so the status stays visibly alive instead of freezing. */
5
14
  @media (prefers-reduced-motion: reduce) {
6
15
  *, *::before, *::after {
16
+ transition-property: opacity, color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, visibility, overlay, display !important;
17
+ transition-behavior: allow-discrete !important;
18
+ /* motion-allow: ends product keyframes at once while still firing animationend (a 0s duration is skipped by some engines' event paths) */
7
19
  animation-duration: .001ms !important;
8
20
  animation-iteration-count: 1 !important;
9
- transition-duration: .001ms !important;
10
21
  scroll-behavior: auto !important;
11
22
  }
12
23
  }
@@ -21,15 +32,27 @@
21
32
  @keyframes uix-slide-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
22
33
  @keyframes uix-spin { to { transform: rotate(1turn); } }
23
34
  @keyframes uix-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
35
+ /* The reduced-motion stand-in for every looping indicator: no movement, a slow breath of opacity. */
36
+ @keyframes uix-pulse { 50% { opacity: .35; } }
24
37
 
25
38
  @layer uix.motion {
26
39
  .uix-anim-fade { animation: uix-fade-in var(--uix-dur) var(--uix-ease-out); }
27
40
  .uix-anim-pop { animation: uix-pop-in var(--uix-dur-fast) var(--uix-ease-out); }
28
41
  .uix-anim-up { animation: uix-slide-in-up var(--uix-dur) var(--uix-ease-out); }
42
+ @media (prefers-reduced-motion: reduce) {
43
+ /* the entrance helpers keep their fade and lose their travel */
44
+ .uix-anim-fade, .uix-anim-pop, .uix-anim-up { animation: uix-fade-in var(--uix-dur) var(--uix-ease-out) !important; }
45
+ }
29
46
 
30
- /* Hover-lift affordance for interactive cards/tiles. Gated so touch devices don't get a stuck hover. */
31
- .uix-lift-hover { transition: transform var(--uix-dur-fast) var(--uix-ease-out), box-shadow var(--uix-dur-fast) var(--uix-ease-out); }
47
+ /* Hover-lift affordance for interactive cards/tiles. Gated so touch devices don't get a stuck hover.
48
+ The shadow steps; only the lift animates (box-shadow is never animated). */
49
+ .uix-lift-hover { transition: transform var(--uix-dur-fast) var(--uix-ease-out); }
32
50
  @media (hover: hover) and (pointer: fine) {
33
51
  .uix-lift-hover:hover { transform: translateY(calc(-1 * var(--uix-lift))); box-shadow: var(--uix-shadow-popover); }
34
52
  }
53
+
54
+ /* Instant surfaces. Keyboard-initiated and 100×-a-day surfaces (the command palette, an overlay opened
55
+ from the keyboard) open and close with no animation — the frequency budget is "none". Overlays set
56
+ [data-uix-instant] themselves (Modal `instant`, CommandPalette, keyboard-opened menus and selects). */
57
+ [data-uix-instant], [data-uix-instant]::backdrop { transition: none !important; animation: none !important; }
35
58
  }
@@ -7,8 +7,8 @@
7
7
 
8
8
  "ease-out": { "$type": "cubicBezier", "$value": "cubic-bezier(.23,1,.32,1)" },
9
9
  "ease-out-strong": { "$type": "cubicBezier", "$value": "cubic-bezier(.2,0,0,1)" },
10
- "ease-in": { "$type": "cubicBezier", "$value": "cubic-bezier(.4,0,1,1)" },
11
- "ease-in-out": { "$type": "cubicBezier", "$value": "cubic-bezier(.77,0,.175,1)" },
10
+ "ease-in": { "$type": "cubicBezier", "$value": "cubic-bezier(.4,0,1,1)", "$description": "Kept for compatibility only. An accelerating curve on something the user watches reads as lag, so exits use --uix-ease-out at a --uix-dur-exit-* duration; check-motion.mjs fails component CSS that uses ease-in." },
11
+ "ease-in-out": { "$type": "cubicBezier", "$value": "cubic-bezier(.77,0,.175,1)", "$description": "Movement already on screen (a strong in-out, easeInOutQuart). The spec's older cubic-bezier(.4,0,.2,1) was never shipped; this value is canonical." },
12
12
  "ease-spring": { "$type": "cubicBezier", "$value": "cubic-bezier(.34,1.56,.64,1)" },
13
13
 
14
14
  "dur-fast": { "$type": "duration", "$value": "120ms" },
@@ -16,6 +16,21 @@
16
16
  "dur-slow": { "$type": "duration", "$value": "240ms" },
17
17
  "dur-slower": { "$type": "duration", "$value": "320ms" },
18
18
 
19
+ "dur-exit-fast": { "$type": "duration", "$value": "80ms", "$description": "Exit paired with --uix-dur-fast (about two-thirds of the enter). Exits are faster than enters and never ease-in." },
20
+ "dur-exit": { "$type": "duration", "$value": "110ms", "$description": "Exit paired with --uix-dur (popovers, menus, select, toasts)." },
21
+ "dur-exit-slow": { "$type": "duration", "$value": "160ms", "$description": "Exit paired with --uix-dur-slow (modal, drawer, side peek)." },
22
+ "dur-highlight": { "$type": "duration", "$value": "2400ms", "$description": "How long an arrival or change tint takes to fade back to the row colour. Not a transition budget: the tint is a held signal, not movement." },
23
+
24
+ "delay-tooltip": { "$type": "duration", "$value": "400ms", "$description": "Hover delay before a tooltip opens. Keyboard focus opens it at once." },
25
+ "delay-tooltip-skip": { "$type": "duration", "$value": "300ms", "$description": "Delay-group window: a neighbouring tooltip hovered within this long after one closed opens at once." },
26
+
27
+ "loop-spin": { "$type": "duration", "$value": "600ms", "$description": "One turn of a spinner (Spinner, Button loading, a running flow node)." },
28
+ "loop-progress": { "$type": "duration", "$value": "1200ms", "$description": "One sweep of indeterminate progress." },
29
+ "loop-shimmer": { "$type": "duration", "$value": "1400ms", "$description": "One pass of the skeleton shimmer." },
30
+ "loop-ping": { "$type": "duration", "$value": "1600ms", "$description": "One heartbeat ping." },
31
+ "loop-blink": { "$type": "duration", "$value": "1100ms", "$description": "One caret blink cycle." },
32
+ "loop-pulse": { "$type": "duration", "$value": "2000ms", "$description": "One cycle of the reduced-motion opacity pulse that replaces spinners, shimmer and indeterminate progress, so a still-working indicator stays visibly alive without movement." },
33
+
19
34
  "lift": { "$type": "dimension", "$value": "4px" },
20
35
 
21
36
  "z-raised": { "$type": "number", "$value": "1", "$description": "z-index ladder (semantic stacking order). raised = locally lifted within a component: a sticky table header & first column, a flow node title over its diamond, a heartbeat dot over its ping." },