@a4ui/core 0.20.0 → 0.21.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.
@@ -0,0 +1,25 @@
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
+ class?: string;
8
+ }
9
+ /**
10
+ * Ambient, theme-tinted blurred-blob backdrop that makes glass surfaces read as
11
+ * glass. Fixed behind the page (paints its own base background); keep the page
12
+ * root transparent. Reduced-motion aware when `animated`.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // at the top of your app/layout (root must NOT set its own bg):
17
+ * <div class="relative min-h-screen text-foreground">
18
+ * <Aurora />
19
+ * <YourPage />
20
+ * </div>
21
+ *
22
+ * <Aurora intensity={0.6} animated />
23
+ * ```
24
+ */
25
+ 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.20.0",
3
+ "version": "0.21.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/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
- background: 'hsl(var(--card) / 0.72)',
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.20.0'
11
+ export const A4UI_VERSION = '0.21.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,66 @@
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, type JSX } from 'solid-js'
12
+
13
+ import { cn } from '../lib/cn'
14
+
15
+ export interface AuroraProps {
16
+ /** Blob opacity multiplier, 0..1 — higher = more visible color. @default 0.45 */
17
+ intensity?: number
18
+ /** Slowly drift/scale the blobs. Reduced-motion aware (holds still). @default false */
19
+ animated?: boolean
20
+ class?: string
21
+ }
22
+
23
+ // Static class strings (scanned by Tailwind). token = which theme color; a =
24
+ // per-blob opacity weight, multiplied by `intensity`.
25
+ const BLOBS = [
26
+ { pos: '-left-40 -top-32', size: 'h-[40rem] w-[40rem]', token: '--primary', a: 1 },
27
+ { pos: '-right-32 top-1/4', size: 'h-[38rem] w-[38rem]', token: '--accent', a: 0.9 },
28
+ { pos: 'bottom-[-10%] left-1/3', size: 'h-[36rem] w-[36rem]', token: '--primary', a: 0.75 },
29
+ ] as const
30
+
31
+ /**
32
+ * Ambient, theme-tinted blurred-blob backdrop that makes glass surfaces read as
33
+ * glass. Fixed behind the page (paints its own base background); keep the page
34
+ * root transparent. Reduced-motion aware when `animated`.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * // at the top of your app/layout (root must NOT set its own bg):
39
+ * <div class="relative min-h-screen text-foreground">
40
+ * <Aurora />
41
+ * <YourPage />
42
+ * </div>
43
+ *
44
+ * <Aurora intensity={0.6} animated />
45
+ * ```
46
+ */
47
+ export function Aurora(props: AuroraProps): JSX.Element {
48
+ const intensity = (): number => props.intensity ?? 0.45
49
+ return (
50
+ <div
51
+ aria-hidden="true"
52
+ class={cn('pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-background', props.class)}
53
+ >
54
+ <For each={BLOBS}>
55
+ {(b) => (
56
+ <div
57
+ class={cn('absolute rounded-full blur-3xl', b.pos, b.size, props.animated && 'aurora-drift')}
58
+ style={{
59
+ background: `radial-gradient(circle, hsl(var(${b.token}) / ${(intensity() * b.a).toFixed(2)}), transparent 70%)`,
60
+ }}
61
+ />
62
+ )}
63
+ </For>
64
+ </div>
65
+ )
66
+ }