@alea-design/motion 0.7.2 → 0.8.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/patterns.css +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alea-design/motion",
3
- "version": "0.7.2",
3
+ "version": "0.8.1",
4
4
  "description": "Alea Motion: a motion system for interfaces. Tokens, named patterns, microinteractions and effects in CSS for any stack, plus small React helpers. Reduced motion built in.",
5
5
  "keywords": [
6
6
  "motion",
package/src/patterns.css CHANGED
@@ -62,11 +62,21 @@
62
62
  @keyframes alea-ripple { from { transform: scale(0.1); opacity: 0.24; } to { transform: scale(1); opacity: 0.01; } }
63
63
 
64
64
  /* ------------------------------------------------------------------ hold */
65
- .alea-hold { position: relative; overflow: hidden; isolation: isolate; }
66
- .alea-hold::before { content: ''; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, currentColor 22%, transparent); transform-origin: left; transform: scaleX(var(--alea-hold)); }
65
+ .alea-hold { position: relative; overflow: hidden; isolation: isolate; --alea-hold-bar: var(--alea-space-1); }
66
+ @media (pointer: coarse) { .alea-hold { --alea-hold-bar: var(--alea-space-2); } } /* a thicker bar for a thumb-sized target */
67
+ /* One layer carries the whole progress: a tint over the full height and a solid bar along the bottom edge (a finger covers the middle of the button, never the
68
+ edge), both scaling from the start with --alea-hold. The button glow (button.css) skips .alea-hold so nothing else paints on this pseudo-element. */
69
+ .alea-hold::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; background: linear-gradient(currentColor, currentColor) 0 100% / 100% var(--alea-hold-bar) no-repeat, var(--alea-hold-fill, color-mix(in srgb, currentColor 20%, transparent)); transform-origin: left; transform: scaleX(var(--alea-hold)); }
70
+ .alea-hold:dir(rtl)::before { transform-origin: right; }
67
71
  .alea-hold[data-holding] { animation: alea-hold var(--alea-hold-duration, 1200ms) linear forwards; }
68
72
  .alea-hold:not([data-holding]) { transition: --alea-hold var(--alea-motion-duration-base) var(--alea-motion-ease-out); }
69
73
  @keyframes alea-hold { from { --alea-hold: 0; } to { --alea-hold: 1; } }
74
+ /* forced colors remove background images, so the bar is redrawn in the system highlight (the tint is dropped: it is only a wash) */
75
+ @media (forced-colors: active) { .alea-hold::before { forced-color-adjust: none; background: linear-gradient(Highlight, Highlight) 0 100% / 100% var(--alea-hold-bar) no-repeat; } }
76
+ /* With reduced motion (or motion off) nothing sweeps: while it is held a still dashed bar spans the bottom edge, and the label says to keep holding. The press still
77
+ counts the full duration (a timer in HoldButton, not this animation), so the action works exactly the same. */
78
+ @media (prefers-reduced-motion: reduce) { :root:not([data-alea-reduced='never']) .alea-hold[data-holding]::before { transform: none; transition: none; background: repeating-linear-gradient(90deg, currentColor 0 var(--alea-space-2), transparent var(--alea-space-2) var(--alea-space-3)) 0 100% / 100% var(--alea-hold-bar) no-repeat; } }
79
+ :is([data-alea-motion='reduced'], [data-alea-motion='off'], [data-alea-reduced='always']) .alea-hold[data-holding]::before { transform: none; transition: none; background: repeating-linear-gradient(90deg, currentColor 0 var(--alea-space-2), transparent var(--alea-space-2) var(--alea-space-3)) 0 100% / 100% var(--alea-hold-bar) no-repeat; }
70
80
 
71
81
  /* ------------------------------------------------------------------ hint */
72
82
  .alea-hint-icon, .alea-hint > svg:last-child, .alea-link[data-variant='standalone'] > svg:last-child { transition: transform var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized); }