@mlola-ui/motion 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlola-ui/motion",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Reduced-motion-aware kinetic primitives for Mlola UI",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,16 +17,15 @@ export function AnimatedCounter({
17
17
  value,
18
18
  className,
19
19
  stagger = 35,
20
+ "aria-label": spoken,
20
21
  ...props
21
22
  }: AnimatedCounterProps) {
22
23
  const reducedMotion = useReducedMotion();
23
24
  const text = String(value);
24
25
  return (
25
- <span
26
- {...props}
27
- className={joinClasses("ml-motion-counter", className)}
28
- aria-label={props["aria-label"] ?? text}
29
- >
26
+ <span {...props} className={joinClasses("ml-motion-counter", className)}>
27
+ {/* A span cannot carry a label, so the value is read as text and the flipping digits are hidden. */}
28
+ <span className="ml-visually-hidden">{spoken ?? text}</span>
30
29
  {Array.from(text).map((character, index) => (
31
30
  <span
32
31
  aria-hidden="true"