@a4ui/core 0.21.0 → 0.22.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.
@@ -4,6 +4,11 @@ export interface AuroraProps {
4
4
  intensity?: number;
5
5
  /** Slowly drift/scale the blobs. Reduced-motion aware (holds still). @default false */
6
6
  animated?: boolean;
7
+ /**
8
+ * A soft glow that follows the cursor across the backdrop (plus cursor-tracking
9
+ * on any `.glow-edge` cards). Reduced-motion aware (off when reduced). @default true
10
+ */
11
+ pointerGlow?: boolean;
7
12
  class?: string;
8
13
  }
9
14
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
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",
package/src/index.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  // import '@a4ui/core/styles.css'
9
9
  // import { Button, Card, Modal } from '@a4ui/core'
10
10
 
11
- export const A4UI_VERSION = '0.21.0'
11
+ export const A4UI_VERSION = '0.22.0'
12
12
 
13
13
  // Helpers (src/lib) — generic, framework-level utilities.
14
14
  export { cn } from './lib/cn'
@@ -8,15 +8,22 @@
8
8
  // Usage: render it once at the top of your layout and keep the page root's
9
9
  // background transparent (don't put `bg-background` on the root) so the Aurora
10
10
  // shows through — the component paints the base background itself.
11
- import { For, type JSX } from 'solid-js'
11
+ import { For, onCleanup, onMount, type JSX } from 'solid-js'
12
12
 
13
13
  import { cn } from '../lib/cn'
14
+ import { motionReduced } from '../lib/motion'
15
+ import { bindPointerFx } from './sceneEffects'
14
16
 
15
17
  export interface AuroraProps {
16
18
  /** Blob opacity multiplier, 0..1 — higher = more visible color. @default 0.45 */
17
19
  intensity?: number
18
20
  /** Slowly drift/scale the blobs. Reduced-motion aware (holds still). @default false */
19
21
  animated?: boolean
22
+ /**
23
+ * A soft glow that follows the cursor across the backdrop (plus cursor-tracking
24
+ * on any `.glow-edge` cards). Reduced-motion aware (off when reduced). @default true
25
+ */
26
+ pointerGlow?: boolean
20
27
  class?: string
21
28
  }
22
29
 
@@ -46,8 +53,19 @@ const BLOBS = [
46
53
  */
47
54
  export function Aurora(props: AuroraProps): JSX.Element {
48
55
  const intensity = (): number => props.intensity ?? 0.45
56
+ let root: HTMLDivElement | undefined
57
+
58
+ onMount(() => {
59
+ // The pointer glow (`#cursorGlow`) + `.glow-edge` cursor tracking come from
60
+ // the shared pointer-fx binder — only when motion is allowed.
61
+ if (props.pointerGlow === false || motionReduced() || !root) return
62
+ const cleanup = bindPointerFx(root)
63
+ onCleanup(cleanup)
64
+ })
65
+
49
66
  return (
50
67
  <div
68
+ ref={root}
51
69
  aria-hidden="true"
52
70
  class={cn('pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-background', props.class)}
53
71
  >
@@ -61,6 +79,16 @@ export function Aurora(props: AuroraProps): JSX.Element {
61
79
  />
62
80
  )}
63
81
  </For>
82
+ {/* Soft glow that follows the cursor across the backdrop (positioned by
83
+ bindPointerFx via left/top on pointermove). */}
84
+ <div
85
+ id="cursorGlow"
86
+ class="absolute h-[520px] w-[520px] rounded-full opacity-0 transition-opacity duration-300"
87
+ style={{
88
+ background: 'radial-gradient(circle, hsl(var(--primary) / 0.1), transparent 70%)',
89
+ transform: 'translate(-50%,-50%)',
90
+ }}
91
+ />
64
92
  </div>
65
93
  )
66
94
  }