@a4ui/core 0.10.2 → 0.11.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.
@@ -1,4 +1,6 @@
1
+ import { animate, inView, scroll, stagger, spring } from 'motion';
1
2
  import { Accessor } from 'solid-js';
3
+ export { animate, inView, scroll, stagger, spring };
2
4
  /**
3
5
  * Snapshot of the user's reduced-motion preference at call time. Not
4
6
  * reactive to preference changes mid-session (matches theme.ts's one-shot
@@ -46,11 +48,8 @@ export declare function setMotionForced(on: boolean): void;
46
48
  */
47
49
  export declare function motionReduced(): boolean;
48
50
  /**
49
- * Tweens a numeric signal toward `target()` using requestAnimationFrame +
50
- * an ease-out curve (solid-motionone/@motionone don't expose spring easing
51
- * yet, and this needs to interpolate a plain number rather than a DOM
52
- * property, so it's a small hand-rolled WAAPI-adjacent tween for KPI count-up).
53
- * Jumps straight to the target under prefers-reduced-motion.
51
+ * Tweens a numeric signal toward `target()` with Motion's `animate` (ease-out),
52
+ * for KPI count-ups. Jumps straight to the target under reduced motion.
54
53
  *
55
54
  * @example
56
55
  * ```tsx
@@ -59,3 +58,37 @@ export declare function motionReduced(): boolean;
59
58
  * ```
60
59
  */
61
60
  export declare function createCountUp(target: Accessor<number>, durationMs?: number): Accessor<number>;
61
+ /**
62
+ * Fade + slide an element in on mount with Motion (ease-out), respecting
63
+ * reduced motion (a no-op then). Call it from a ref/onMount; use `delay` to
64
+ * stagger a row.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * let el!: HTMLDivElement
69
+ * onMount(() => animateIn(el, { delay: 0.1 }))
70
+ * return <div ref={el}>…</div>
71
+ * ```
72
+ */
73
+ export declare function animateIn(el: Element, opts?: {
74
+ y?: number;
75
+ duration?: number;
76
+ delay?: number;
77
+ }): void;
78
+ /**
79
+ * Reveal an element the first time it scrolls into view (fade + slide up), using
80
+ * Motion's `inView`. Reveals once (won't re-flash on re-entry) and is a no-op
81
+ * under reduced motion (the element stays visible). Returns a stop function.
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * let el!: HTMLDivElement
86
+ * onMount(() => revealOnScroll(el, { amount: 0.3 }))
87
+ * return <section ref={el}>…</section>
88
+ * ```
89
+ */
90
+ export declare function revealOnScroll(el: Element, opts?: {
91
+ y?: number;
92
+ duration?: number;
93
+ amount?: number;
94
+ }): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.10.2",
3
+ "version": "0.11.1",
4
4
  "description": "A4ui — Spatial Glass design system & component library for SolidJS (Kobalte behavior + Tailwind glass tokens + motion).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -106,8 +106,7 @@
106
106
  "@tanstack/solid-virtual": "^3.13.33",
107
107
  "clsx": "^2.1.1",
108
108
  "lucide-solid": "^1.23.0",
109
- "solid-motionone": "^1.0.4",
110
- "solid-transition-group": "^0.3.0",
109
+ "motion": "^12.42.2",
111
110
  "tailwind-merge": "^3.6.0"
112
111
  },
113
112
  "devDependencies": {