@a4ui/core 0.20.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.
- package/dist/elements.css +65 -1
- package/dist/full.css +65 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1283 -1241
- package/dist/layout/Aurora.d.ts +30 -0
- package/dist/styles.css +15 -0
- package/package.json +1 -1
- package/preset.js +3 -1
- package/src/index.ts +2 -1
- package/src/layout/Aurora.tsx +94 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface AuroraProps {
|
|
3
|
+
/** Blob opacity multiplier, 0..1 — higher = more visible color. @default 0.45 */
|
|
4
|
+
intensity?: number;
|
|
5
|
+
/** Slowly drift/scale the blobs. Reduced-motion aware (holds still). @default false */
|
|
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;
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Ambient, theme-tinted blurred-blob backdrop that makes glass surfaces read as
|
|
16
|
+
* glass. Fixed behind the page (paints its own base background); keep the page
|
|
17
|
+
* root transparent. Reduced-motion aware when `animated`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // at the top of your app/layout (root must NOT set its own bg):
|
|
22
|
+
* <div class="relative min-h-screen text-foreground">
|
|
23
|
+
* <Aurora />
|
|
24
|
+
* <YourPage />
|
|
25
|
+
* </div>
|
|
26
|
+
*
|
|
27
|
+
* <Aurora intensity={0.6} animated />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function Aurora(props: AuroraProps): JSX.Element;
|
package/dist/styles.css
CHANGED
|
@@ -228,6 +228,21 @@ body {
|
|
|
228
228
|
animation: list-row-in 0.35s both ease-out;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/* Aurora — slow ambient drift for the blurred backdrop blobs (opt-in via
|
|
232
|
+
<Aurora animated>). Held still under reduced motion by the global rule below. */
|
|
233
|
+
@keyframes aurora-drift {
|
|
234
|
+
0%,
|
|
235
|
+
100% {
|
|
236
|
+
transform: translate3d(0, 0, 0) scale(1);
|
|
237
|
+
}
|
|
238
|
+
50% {
|
|
239
|
+
transform: translate3d(3%, -3%, 0) scale(1.08);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
.aurora-drift {
|
|
243
|
+
animation: aurora-drift 18s ease-in-out infinite;
|
|
244
|
+
}
|
|
245
|
+
|
|
231
246
|
/* Table row enter/exit fade. */
|
|
232
247
|
.row-enter-active,
|
|
233
248
|
.row-exit-active {
|
package/package.json
CHANGED
package/preset.js
CHANGED
|
@@ -35,7 +35,9 @@ const glass = plugin(({ addComponents }) => {
|
|
|
35
35
|
transition: 'transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, border-color .2s ease',
|
|
36
36
|
},
|
|
37
37
|
"[data-theme='light'] .card": {
|
|
38
|
-
|
|
38
|
+
// A touch more transparent than fully opaque so the frosted blur reads on
|
|
39
|
+
// light themes (over an Aurora/scenery backdrop) — text stays legible.
|
|
40
|
+
background: 'hsl(var(--card) / 0.6)',
|
|
39
41
|
border: '1px solid hsl(var(--border))',
|
|
40
42
|
},
|
|
41
43
|
|
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.
|
|
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'
|
|
@@ -172,6 +172,7 @@ export { flyToCart, type FlyToCartOptions } from './lib/flyToCart'
|
|
|
172
172
|
// (Sidebar, Topbar, CompanySwitcher, DemoBanner, CommandPalette) stay in the app.
|
|
173
173
|
export { AppShell } from './layout/AppShell'
|
|
174
174
|
export { SpaceBackground } from './layout/SpaceBackground'
|
|
175
|
+
export { Aurora, type AuroraProps } from './layout/Aurora'
|
|
175
176
|
export { ThemedScenery, type ThemedSceneryProps } from './layout/ThemedScenery'
|
|
176
177
|
export { SnowScenery } from './layout/SnowScenery'
|
|
177
178
|
export { ChristmasBackground } from './layout/ChristmasBackground'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Aurora — an ambient backdrop of soft, blurred color blobs tinted with the
|
|
2
|
+
// theme tokens (`--primary` / `--accent`). Fixed behind the page so glass
|
|
3
|
+
// surfaces read as glass: as glassy cards scroll over the fixed blobs, their
|
|
4
|
+
// backdrop-blur samples the color behind them. Every theme tints it differently
|
|
5
|
+
// for free. This is the lightweight, no-starfield alternative to
|
|
6
|
+
// `SpaceBackground` / `ThemedScenery`.
|
|
7
|
+
//
|
|
8
|
+
// Usage: render it once at the top of your layout and keep the page root's
|
|
9
|
+
// background transparent (don't put `bg-background` on the root) so the Aurora
|
|
10
|
+
// shows through — the component paints the base background itself.
|
|
11
|
+
import { For, onCleanup, onMount, type JSX } from 'solid-js'
|
|
12
|
+
|
|
13
|
+
import { cn } from '../lib/cn'
|
|
14
|
+
import { motionReduced } from '../lib/motion'
|
|
15
|
+
import { bindPointerFx } from './sceneEffects'
|
|
16
|
+
|
|
17
|
+
export interface AuroraProps {
|
|
18
|
+
/** Blob opacity multiplier, 0..1 — higher = more visible color. @default 0.45 */
|
|
19
|
+
intensity?: number
|
|
20
|
+
/** Slowly drift/scale the blobs. Reduced-motion aware (holds still). @default false */
|
|
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
|
|
27
|
+
class?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Static class strings (scanned by Tailwind). token = which theme color; a =
|
|
31
|
+
// per-blob opacity weight, multiplied by `intensity`.
|
|
32
|
+
const BLOBS = [
|
|
33
|
+
{ pos: '-left-40 -top-32', size: 'h-[40rem] w-[40rem]', token: '--primary', a: 1 },
|
|
34
|
+
{ pos: '-right-32 top-1/4', size: 'h-[38rem] w-[38rem]', token: '--accent', a: 0.9 },
|
|
35
|
+
{ pos: 'bottom-[-10%] left-1/3', size: 'h-[36rem] w-[36rem]', token: '--primary', a: 0.75 },
|
|
36
|
+
] as const
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Ambient, theme-tinted blurred-blob backdrop that makes glass surfaces read as
|
|
40
|
+
* glass. Fixed behind the page (paints its own base background); keep the page
|
|
41
|
+
* root transparent. Reduced-motion aware when `animated`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // at the top of your app/layout (root must NOT set its own bg):
|
|
46
|
+
* <div class="relative min-h-screen text-foreground">
|
|
47
|
+
* <Aurora />
|
|
48
|
+
* <YourPage />
|
|
49
|
+
* </div>
|
|
50
|
+
*
|
|
51
|
+
* <Aurora intensity={0.6} animated />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export function Aurora(props: AuroraProps): JSX.Element {
|
|
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
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
ref={root}
|
|
69
|
+
aria-hidden="true"
|
|
70
|
+
class={cn('pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-background', props.class)}
|
|
71
|
+
>
|
|
72
|
+
<For each={BLOBS}>
|
|
73
|
+
{(b) => (
|
|
74
|
+
<div
|
|
75
|
+
class={cn('absolute rounded-full blur-3xl', b.pos, b.size, props.animated && 'aurora-drift')}
|
|
76
|
+
style={{
|
|
77
|
+
background: `radial-gradient(circle, hsl(var(${b.token}) / ${(intensity() * b.a).toFixed(2)}), transparent 70%)`,
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
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
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
)
|
|
94
|
+
}
|