@alfadocs/ui-kit 0.0.13 → 0.0.16

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,237 @@
1
+ import { jsx as G } from "react/jsx-runtime";
2
+ import { forwardRef as Z, useRef as q, useMemo as ee, useEffect as te } from "react";
3
+ import { c as ne } from "./index-D2ZczOXr.js";
4
+ const ae = 'ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワ0123456789:・."=*+-<>¦|', re = "0123456789ABCDEF{}[]<>/\\;:=$#@!*+-", oe = "01", ie = "!@#$%^&*()_+-=[]{}|;:,.<>?/", I = {
5
+ katakana: ae,
6
+ hex: re,
7
+ binary: oe,
8
+ symbols: ie
9
+ }, se = ne(
10
+ // Wrapper holds the canvas plus optional overlay pseudo-elements.
11
+ // pointer-events-none so the overlay never blocks underlying UI.
12
+ "pointer-events-none relative overflow-hidden",
13
+ {
14
+ variants: {
15
+ // Built-in surface so the rain has somewhere to read against
16
+ // without the consumer wrapping it themselves.
17
+ // `transparent` (default) lets the parent provide the background.
18
+ // `solid` paints a near-black surface using the brand `blue-900`
19
+ // step from the palette — the rain's brightest glyphs read clean
20
+ // against it in either light or dark theme.
21
+ background: {
22
+ transparent: "",
23
+ solid: "bg-[var(--color-blue-900)]"
24
+ },
25
+ vibe: {
26
+ // No overlay, no canvas filter — just the rain.
27
+ clean: "",
28
+ // Fallout-CRT stack: vignette + dense scanlines + bloom +
29
+ // per-glyph phosphor glow (canvas-side shadowBlur, applied in
30
+ // the draw loop).
31
+ terminal: [
32
+ "before:pointer-events-none before:absolute before:inset-0 before:z-[2] before:content-['']",
33
+ "before:bg-[radial-gradient(closest-side,transparent_55%,rgb(0_0_0/0.55)_100%)]",
34
+ "after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']",
35
+ "after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_2px,rgb(0_0_0/0.32)_2px,rgb(0_0_0/0.32)_3px)]",
36
+ "after:mix-blend-multiply",
37
+ "[&>canvas]:[filter:blur(0.55px)_brightness(1.25)_contrast(1.1)_saturate(1.3)]"
38
+ ].join(" "),
39
+ // Sci-fi HUD: light scanlines, soft bloom, slow opacity pulse,
40
+ // per-glyph glow. No vignette.
41
+ hologram: [
42
+ "after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']",
43
+ "after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_3px,rgb(0_0_0/0.18)_3px,rgb(0_0_0/0.18)_4px)]",
44
+ "after:mix-blend-multiply",
45
+ "[&>canvas]:[filter:blur(0.4px)_brightness(1.15)_contrast(1.05)]",
46
+ "[&>canvas]:[animation:matrix-rain-hologram-pulse_3s_ease-in-out_infinite]"
47
+ ].join(" "),
48
+ // Synthwave neon: heavy bloom, no scanlines, indigo horizon
49
+ // glow at the bottom. Glyph colour is computed per-column in
50
+ // the draw loop (accent → info gradient).
51
+ synthwave: [
52
+ "after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-[30%] after:z-[1] after:content-['']",
53
+ "after:bg-[linear-gradient(to_top,var(--color-indigo-800),transparent)]",
54
+ "after:opacity-50",
55
+ "[&>canvas]:[filter:blur(0.7px)_brightness(1.3)_contrast(1.15)_saturate(1.5)]"
56
+ ].join(" "),
57
+ // Vintage scope monitor: dense thin scanlines, sharp edges
58
+ // (no canvas filter), animated horizontal sweep beam.
59
+ oscilloscope: [
60
+ // Scanlines (denser, alpha-heavier than terminal)
61
+ "after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']",
62
+ "after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_1px,rgb(0_0_0/0.4)_1px,rgb(0_0_0/0.4)_2px)]",
63
+ "after:mix-blend-multiply",
64
+ // Sweep beam — thin highlight bar scrolling top → bottom
65
+ "before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-[2] before:h-[4px] before:content-['']",
66
+ "before:bg-[linear-gradient(to_bottom,transparent,var(--foreground),transparent)]",
67
+ "before:opacity-50",
68
+ "before:[animation:matrix-rain-osc-sweep_4s_linear_infinite]",
69
+ "before:mix-blend-screen"
70
+ ].join(" "),
71
+ // Production-friendly: low opacity, no overlay. Pairs with
72
+ // `decay="slow"` (the default) for a faint background-noise
73
+ // feel that doesn't dominate foreground content.
74
+ ghost: "[&>canvas]:opacity-30"
75
+ },
76
+ // Radial mask that fades the canvas to transparent in the middle
77
+ // so foreground content stays readable. `closest-side` adapts to
78
+ // non-square containers. The `--mr` custom property comes from
79
+ // the `maskRadius` variant below.
80
+ mask: {
81
+ none: "",
82
+ center: [
83
+ "[&>canvas]:[mask-image:radial-gradient(closest-side,transparent_0%,transparent_var(--mr,30%),black_calc(var(--mr,30%)+45%))]",
84
+ "[&>canvas]:[-webkit-mask-image:radial-gradient(closest-side,transparent_0%,transparent_var(--mr,30%),black_calc(var(--mr,30%)+45%))]"
85
+ ].join(" ")
86
+ },
87
+ // Mask radius — t-shirt sizes drive the inner clear-zone radius.
88
+ // Only applied when mask="center". md (30%) is the default.
89
+ maskRadius: {
90
+ xs: "[--mr:15%]",
91
+ sm: "[--mr:22%]",
92
+ md: "[--mr:30%]",
93
+ lg: "[--mr:42%]",
94
+ xl: "[--mr:55%]"
95
+ }
96
+ },
97
+ defaultVariants: {
98
+ background: "transparent",
99
+ vibe: "clean",
100
+ mask: "none",
101
+ maskRadius: "md"
102
+ }
103
+ }
104
+ ), le = {
105
+ primary: "--primary",
106
+ accent: "--accent",
107
+ success: "--success",
108
+ error: "--error",
109
+ info: "--info"
110
+ }, ce = {
111
+ low: 18,
112
+ medium: 14,
113
+ high: 11
114
+ }, fe = {
115
+ gentle: 100,
116
+ normal: 60,
117
+ fast: 33
118
+ }, me = {
119
+ none: null,
120
+ slow: 3e-3,
121
+ normal: 0.02,
122
+ fast: 0.08
123
+ }, de = Z(
124
+ function({
125
+ glyphs: p = "katakana",
126
+ tone: P = "primary",
127
+ color: v,
128
+ density: $ = "medium",
129
+ pace: M = "normal",
130
+ decay: O = "slow",
131
+ vibe: i = "clean",
132
+ storm: u = !1,
133
+ mask: D = "none",
134
+ maskRadius: K = "md",
135
+ background: X = "transparent",
136
+ className: W
137
+ }, J) {
138
+ const V = q(null), x = ee(() => p in I ? I[p] : p, [p]), l = ce[$], z = fe[M], y = me[O];
139
+ return te(() => {
140
+ var H;
141
+ const o = V.current;
142
+ if (!o) return;
143
+ const e = o.getContext("2d");
144
+ if (!e) return;
145
+ const t = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
146
+ if (t != null && t.matches) return;
147
+ const A = v || (typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(le[P]).trim() || getComputedStyle(o).color), Q = typeof window > "u" ? "monospace" : getComputedStyle(document.documentElement).getPropertyValue("--font-mono").trim() || "monospace", h = window.devicePixelRatio || 1;
148
+ let c = 0, b = [], d = [], E = [];
149
+ const R = () => {
150
+ const n = o.getBoundingClientRect();
151
+ if (o.width = Math.max(1, Math.floor(n.width * h)), o.height = Math.max(1, Math.floor(n.height * h)), e.setTransform(h, 0, 0, h, 0, 0), c = Math.max(1, Math.floor(n.width / l)), b = new Array(c).fill(0).map(
152
+ () => (
153
+ // Random initial offset so columns never start in sync.
154
+ Math.floor(Math.random() * (n.height / l))
155
+ )
156
+ ), i === "synthwave") {
157
+ const r = document.createElement("span");
158
+ r.style.display = "none", document.documentElement.appendChild(r), d = new Array(c).fill("").map((L, a) => {
159
+ const w = a / Math.max(1, c - 1) * 100;
160
+ return r.style.color = `color-mix(in oklch, var(--accent) ${100 - w}%, var(--info) ${w}%)`, getComputedStyle(r).color || A;
161
+ }), document.documentElement.removeChild(r);
162
+ } else
163
+ d = [];
164
+ u ? E = new Array(c).fill(0).map(() => 0.6 + Math.random() * 0.8) : E = [];
165
+ };
166
+ let C = 0, f = 0, S = !0, k = !0;
167
+ const B = (n) => {
168
+ if (n - C >= z) {
169
+ C = n;
170
+ const r = o.getBoundingClientRect();
171
+ y !== null && (e.globalCompositeOperation = "destination-out", e.globalAlpha = y, e.fillStyle = "black", e.fillRect(0, 0, r.width, r.height), e.globalAlpha = 1), e.globalCompositeOperation = "source-over", e.font = `${l}px ${Q}`, e.textBaseline = "top";
172
+ const L = i === "terminal" || i === "hologram" || i === "synthwave";
173
+ L ? (e.shadowColor = A, e.shadowBlur = Math.max(4, l * 0.6)) : e.shadowBlur = 0, i !== "synthwave" && (e.fillStyle = A);
174
+ for (let a = 0; a < c; a += 1) {
175
+ const w = x.charAt(
176
+ Math.floor(Math.random() * x.length)
177
+ ), N = u ? (Math.random() - 0.5) * 2 : 0, U = a * l + N, T = b[a] * l;
178
+ i === "synthwave" && d[a] && (e.fillStyle = d[a], L && (e.shadowColor = d[a])), e.fillText(w, U, T), T > r.height && Math.random() > 0.97 && (b[a] = 0), b[a] += u && E[a] || 1;
179
+ }
180
+ }
181
+ f = window.requestAnimationFrame(B);
182
+ }, g = () => {
183
+ f || !S || !k || (C = window.performance ? window.performance.now() : 0, f = window.requestAnimationFrame(B));
184
+ }, _ = () => {
185
+ f && (window.cancelAnimationFrame(f), f = 0);
186
+ };
187
+ R(), g();
188
+ const s = typeof ResizeObserver < "u" ? new ResizeObserver(R) : null;
189
+ s == null || s.observe(o);
190
+ const Y = () => R();
191
+ s || window.addEventListener("resize", Y);
192
+ const j = () => {
193
+ S = !document.hidden, S ? g() : _();
194
+ };
195
+ document.addEventListener("visibilitychange", j);
196
+ const m = typeof IntersectionObserver < "u" ? new IntersectionObserver(
197
+ (n) => {
198
+ k = n.some((r) => r.isIntersecting), k ? g() : _();
199
+ },
200
+ { threshold: 0 }
201
+ ) : null;
202
+ m == null || m.observe(o);
203
+ const F = () => {
204
+ t != null && t.matches ? _() : g();
205
+ };
206
+ return (H = t == null ? void 0 : t.addEventListener) == null || H.call(t, "change", F), () => {
207
+ var n;
208
+ _(), s == null || s.disconnect(), m == null || m.disconnect(), s || window.removeEventListener("resize", Y), document.removeEventListener("visibilitychange", j), (n = t == null ? void 0 : t.removeEventListener) == null || n.call(t, "change", F);
209
+ };
210
+ }, [
211
+ x,
212
+ P,
213
+ v,
214
+ l,
215
+ z,
216
+ y,
217
+ i,
218
+ u
219
+ ]), /* @__PURE__ */ G(
220
+ "div",
221
+ {
222
+ ref: J,
223
+ "aria-hidden": "true",
224
+ className: [
225
+ se({ background: X, vibe: i, mask: D, maskRadius: K }),
226
+ W
227
+ ].filter(Boolean).join(" "),
228
+ children: /* @__PURE__ */ G("canvas", { ref: V, className: "absolute inset-0 block size-full" })
229
+ }
230
+ );
231
+ }
232
+ );
233
+ de.displayName = "MatrixRain";
234
+ export {
235
+ de as M
236
+ };
237
+ //# sourceMappingURL=matrix-rain-Q7xTEpKu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix-rain-Q7xTEpKu.js","sources":["../../src/components/matrix-rain/matrix-rain.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* MatrixRain — decorative canvas overlay. */\n/* */\n/* Falling-glyph \"digital rain\" with a CRT terminal vibe. Designed for */\n/* easter-egg / dev-flavoured surfaces: place inside a relatively- */\n/* positioned container with an `inset-0` className. */\n/* */\n/* Behaviour: */\n/* - Honours `prefers-reduced-motion` (renders nothing, animation off). */\n/* - Pauses while the tab is hidden (visibility API). */\n/* - Pauses when scrolled off-screen (IntersectionObserver). */\n/* - DPR-aware so glyphs stay sharp on HiDPI. */\n/* - Resizes with the container (ResizeObserver). */\n/* - \"Density-by-use\" trail: the per-frame decay alpha is small, so */\n/* columns that fire often accumulate a denser background residue */\n/* than rarely-firing ones — well-trodden paths stay luminous. */\n/* */\n/* The canvas is purely decorative — `aria-hidden=\"true\"`, no focus, no */\n/* visible text. Consumers must own the parent's positioning + stacking. */\n/* -------------------------------------------------------------------- */\n\nimport { forwardRef, useEffect, useMemo, useRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\n/* ------------------------------------------------------------------ */\n/* Glyph presets */\n/* ------------------------------------------------------------------ */\n\n/**\n * Half-width katakana + Latin digits + a few symbols. The canonical\n * Matrix used reverse-mirrored half-width katakana from a custom font;\n * plain half-width katakana is the closest open approximation.\n */\nconst KATAKANA_GLYPHS =\n 'ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワ' +\n '0123456789:・.\"=*+-<>¦|';\n\nconst HEX_GLYPHS = '0123456789ABCDEF{}[]<>/\\\\;:=$#@!*+-';\nconst BINARY_GLYPHS = '01';\nconst SYMBOL_GLYPHS = '!@#$%^&*()_+-=[]{}|;:,.<>?/';\n\nconst GLYPH_PRESETS = {\n katakana: KATAKANA_GLYPHS,\n hex: HEX_GLYPHS,\n binary: BINARY_GLYPHS,\n symbols: SYMBOL_GLYPHS,\n} as const;\n\ntype GlyphPreset = keyof typeof GLYPH_PRESETS;\n\n/* ------------------------------------------------------------------ */\n/* CVA variants */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva(\n // Wrapper holds the canvas plus optional overlay pseudo-elements.\n // pointer-events-none so the overlay never blocks underlying UI.\n 'pointer-events-none relative overflow-hidden',\n {\n variants: {\n // Built-in surface so the rain has somewhere to read against\n // without the consumer wrapping it themselves.\n // `transparent` (default) lets the parent provide the background.\n // `solid` paints a near-black surface using the brand `blue-900`\n // step from the palette — the rain's brightest glyphs read clean\n // against it in either light or dark theme.\n background: {\n transparent: '',\n solid: 'bg-[var(--color-blue-900)]',\n },\n vibe: {\n // No overlay, no canvas filter — just the rain.\n clean: '',\n // Fallout-CRT stack: vignette + dense scanlines + bloom +\n // per-glyph phosphor glow (canvas-side shadowBlur, applied in\n // the draw loop).\n terminal: [\n \"before:pointer-events-none before:absolute before:inset-0 before:z-[2] before:content-['']\",\n 'before:bg-[radial-gradient(closest-side,transparent_55%,rgb(0_0_0/0.55)_100%)]',\n \"after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']\",\n 'after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_2px,rgb(0_0_0/0.32)_2px,rgb(0_0_0/0.32)_3px)]',\n 'after:mix-blend-multiply',\n '[&>canvas]:[filter:blur(0.55px)_brightness(1.25)_contrast(1.1)_saturate(1.3)]',\n ].join(' '),\n // Sci-fi HUD: light scanlines, soft bloom, slow opacity pulse,\n // per-glyph glow. No vignette.\n hologram: [\n \"after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']\",\n 'after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_3px,rgb(0_0_0/0.18)_3px,rgb(0_0_0/0.18)_4px)]',\n 'after:mix-blend-multiply',\n '[&>canvas]:[filter:blur(0.4px)_brightness(1.15)_contrast(1.05)]',\n '[&>canvas]:[animation:matrix-rain-hologram-pulse_3s_ease-in-out_infinite]',\n ].join(' '),\n // Synthwave neon: heavy bloom, no scanlines, indigo horizon\n // glow at the bottom. Glyph colour is computed per-column in\n // the draw loop (accent → info gradient).\n synthwave: [\n \"after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-[30%] after:z-[1] after:content-['']\",\n 'after:bg-[linear-gradient(to_top,var(--color-indigo-800),transparent)]',\n 'after:opacity-50',\n '[&>canvas]:[filter:blur(0.7px)_brightness(1.3)_contrast(1.15)_saturate(1.5)]',\n ].join(' '),\n // Vintage scope monitor: dense thin scanlines, sharp edges\n // (no canvas filter), animated horizontal sweep beam.\n oscilloscope: [\n // Scanlines (denser, alpha-heavier than terminal)\n \"after:pointer-events-none after:absolute after:inset-0 after:z-[1] after:content-['']\",\n 'after:bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_1px,rgb(0_0_0/0.4)_1px,rgb(0_0_0/0.4)_2px)]',\n 'after:mix-blend-multiply',\n // Sweep beam — thin highlight bar scrolling top → bottom\n \"before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-[2] before:h-[4px] before:content-['']\",\n 'before:bg-[linear-gradient(to_bottom,transparent,var(--foreground),transparent)]',\n 'before:opacity-50',\n 'before:[animation:matrix-rain-osc-sweep_4s_linear_infinite]',\n 'before:mix-blend-screen',\n ].join(' '),\n // Production-friendly: low opacity, no overlay. Pairs with\n // `decay=\"slow\"` (the default) for a faint background-noise\n // feel that doesn't dominate foreground content.\n ghost: '[&>canvas]:opacity-30',\n },\n // Radial mask that fades the canvas to transparent in the middle\n // so foreground content stays readable. `closest-side` adapts to\n // non-square containers. The `--mr` custom property comes from\n // the `maskRadius` variant below.\n mask: {\n none: '',\n center: [\n '[&>canvas]:[mask-image:radial-gradient(closest-side,transparent_0%,transparent_var(--mr,30%),black_calc(var(--mr,30%)+45%))]',\n '[&>canvas]:[-webkit-mask-image:radial-gradient(closest-side,transparent_0%,transparent_var(--mr,30%),black_calc(var(--mr,30%)+45%))]',\n ].join(' '),\n },\n // Mask radius — t-shirt sizes drive the inner clear-zone radius.\n // Only applied when mask=\"center\". md (30%) is the default.\n maskRadius: {\n xs: '[--mr:15%]',\n sm: '[--mr:22%]',\n md: '[--mr:30%]',\n lg: '[--mr:42%]',\n xl: '[--mr:55%]',\n },\n },\n defaultVariants: {\n background: 'transparent',\n vibe: 'clean',\n mask: 'none',\n maskRadius: 'md',\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Tone → semantic token resolution */\n/* ------------------------------------------------------------------ */\n\ntype Tone = 'primary' | 'accent' | 'success' | 'error' | 'info';\ntype Density = 'low' | 'medium' | 'high';\ntype Pace = 'gentle' | 'normal' | 'fast';\ntype Decay = 'none' | 'slow' | 'normal' | 'fast';\n\nconst TONE_VAR: Record<Tone, string> = {\n primary: '--primary',\n accent: '--accent',\n success: '--success',\n error: '--error',\n info: '--info',\n};\n\nconst DENSITY_FONT_PX: Record<Density, number> = {\n low: 18,\n medium: 14,\n high: 11,\n};\n\nconst PACE_FRAME_MS: Record<Pace, number> = {\n gentle: 100,\n normal: 60,\n fast: 33,\n};\n\n// Per-frame trail decay alpha. Smaller = trails persist longer = more\n// \"density by use\". `none` skips the decay step entirely; over long\n// uptimes the canvas approaches a saturated noise field. `slow` is the\n// new default that produces the \"well-trodden paths stay bright\" feel.\nconst DECAY_ALPHA: Record<Decay, number | null> = {\n none: null,\n slow: 0.003,\n normal: 0.02,\n fast: 0.08,\n};\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface MatrixRainProps extends VariantProps<typeof wrapperVariants> {\n /** Glyph preset name or a literal string of glyphs. Default `katakana`. */\n glyphs?: GlyphPreset | string;\n /** Brand tone for the rain. Resolved against the active theme. */\n tone?: Tone;\n /** Optional explicit colour — any CSS colour value. Overrides `tone` when set. */\n color?: string;\n /** Glyph density — controls font-size. */\n density?: Density;\n /** Animation pace — controls frame interval. */\n pace?: Pace;\n /** Trail persistence — smaller decay = denser cumulative background. */\n decay?: Decay;\n /**\n * Built-in surface beneath the rain. `transparent` (default) lets the\n * parent provide its own background; `solid` paints a near-black\n * surface so the rain reads cleanly without the consumer wrapping it\n * themselves — useful for standalone demos or full-bleed easter eggs.\n */\n background?: 'transparent' | 'solid';\n /**\n * Visual treatment.\n * - `clean` — just the rain.\n * - `terminal` — Fallout-CRT: vignette + scanlines + bloom + glow.\n * - `hologram` — sci-fi HUD: soft scanlines + slow opacity pulse.\n * - `synthwave` — 80s neon: heavy bloom + indigo horizon + accent→\n * info gradient across columns (overrides `tone`).\n * - `oscilloscope` — vintage scope: sharp edges + dense scanlines +\n * animated horizontal beam sweep.\n * - `ghost` — production-friendly faint background variant.\n */\n vibe?: 'clean' | 'terminal' | 'hologram' | 'synthwave' | 'oscilloscope' | 'ghost';\n /**\n * When `true`, gives each column a stable random speed multiplier\n * (0.6×–1.4× of the base pace) and adds a small horizontal jitter to\n * each glyph. Pairs with any vibe — makes the rain feel alive vs.\n * metronomic.\n */\n storm?: boolean;\n /**\n * Radial mask. `center` fades the canvas to fully transparent in the\n * middle so foreground content sitting over the rain stays readable\n * (e.g. code-block easter egg with copy in the middle).\n */\n mask?: 'none' | 'center';\n /**\n * Inner clear-zone radius for `mask=\"center\"`. Ignored when `mask`\n * is `none`. T-shirt sizes map to: xs 15%, sm 22%, md 30% (default),\n * lg 42%, xl 55%.\n */\n maskRadius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Class merged onto the wrapper. */\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const MatrixRain = forwardRef<HTMLDivElement, MatrixRainProps>(\n function MatrixRain(\n {\n glyphs = 'katakana',\n tone = 'primary',\n color,\n density = 'medium',\n pace = 'normal',\n decay = 'slow',\n vibe = 'clean',\n storm = false,\n mask = 'none',\n maskRadius = 'md',\n background = 'transparent',\n className,\n },\n ref,\n ) {\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n // Resolve the glyph string from a preset key or literal pass-through.\n const glyphString = useMemo<string>(() => {\n if (glyphs in GLYPH_PRESETS) {\n return GLYPH_PRESETS[glyphs as GlyphPreset];\n }\n return glyphs;\n }, [glyphs]);\n\n const fontSize = DENSITY_FONT_PX[density];\n const frameInterval = PACE_FRAME_MS[pace];\n const decayAlpha = DECAY_ALPHA[decay];\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n // Bail entirely under reduced-motion. The CSS overlay is also\n // suppressed by media-query in the consumer's stylesheet if needed\n // — defence in depth, but the JS is the authoritative gate here.\n const reduceMotionMql =\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-reduced-motion: reduce)')\n : null;\n if (reduceMotionMql?.matches) return;\n\n // Resolve colour: explicit prop wins; otherwise read the theme\n // token. Final fallback is the canvas's inherited `color` (cascade\n // of the host `<div>`), which the browser always resolves to a\n // usable value — keeps a literal hex out of component code.\n const resolvedColor = (() => {\n if (color) return color;\n if (typeof window === 'undefined') return '';\n const fromVar = getComputedStyle(document.documentElement)\n .getPropertyValue(TONE_VAR[tone])\n .trim();\n return fromVar || getComputedStyle(canvas).color;\n })();\n\n // Resolve --font-mono at runtime so the kit's font fallback chain\n // (incl. Noto Sans JP for katakana) flows through to canvas.\n const fontFamily = (() => {\n if (typeof window === 'undefined') return 'monospace';\n const fromVar = getComputedStyle(document.documentElement)\n .getPropertyValue('--font-mono')\n .trim();\n return fromVar || 'monospace';\n })();\n\n const dpr = window.devicePixelRatio || 1;\n let columns = 0;\n let drops: number[] = [];\n // Synthwave: per-column accent → info gradient. Resolved through\n // a temporary probe element so we get back fully-resolved rgb()\n // strings the canvas API accepts. Empty when not in synthwave.\n let columnColors: string[] = [];\n // Storm: per-column random speed factor (0.6×–1.4× base pace) +\n // glyph horizontal jitter. Stable across frames, recomputed on\n // each fit() so columns stay coherent.\n let columnSpeeds: number[] = [];\n\n const fit = () => {\n const rect = canvas.getBoundingClientRect();\n canvas.width = Math.max(1, Math.floor(rect.width * dpr));\n canvas.height = Math.max(1, Math.floor(rect.height * dpr));\n // Render in CSS pixels so font metrics stay sharp on HiDPI.\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n columns = Math.max(1, Math.floor(rect.width / fontSize));\n drops = new Array(columns).fill(0).map(() =>\n // Random initial offset so columns never start in sync.\n Math.floor(Math.random() * (rect.height / fontSize)),\n );\n\n if (vibe === 'synthwave') {\n // Build the per-column gradient by resolving color-mix()\n // through a probe span. Browser handles the OKLCH math; we\n // just store the resulting rgb() string per column.\n const probe = document.createElement('span');\n probe.style.display = 'none';\n document.documentElement.appendChild(probe);\n columnColors = new Array(columns).fill('').map((_, i) => {\n const t = (i / Math.max(1, columns - 1)) * 100;\n probe.style.color = `color-mix(in oklch, var(--accent) ${\n 100 - t\n }%, var(--info) ${t}%)`;\n const computed = getComputedStyle(probe).color;\n return computed || resolvedColor;\n });\n document.documentElement.removeChild(probe);\n } else {\n columnColors = [];\n }\n\n if (storm) {\n columnSpeeds = new Array(columns)\n .fill(0)\n .map(() => 0.6 + Math.random() * 0.8);\n } else {\n columnSpeeds = [];\n }\n };\n\n let lastFrame = 0;\n let rafHandle = 0;\n let isVisible = true;\n let isOnscreen = true;\n\n const draw = (now: number) => {\n if (now - lastFrame >= frameInterval) {\n lastFrame = now;\n const rect = canvas.getBoundingClientRect();\n\n // Trail decay — `destination-out` fades existing pixels by\n // `decayAlpha` each frame. Skip when `decay === 'none'` so\n // trails are permanent (eventually saturate; intended).\n // Under `destination-out` only the alpha channel matters, so\n // we drive the fade via `globalAlpha` and any opaque CSS-keyword\n // fillStyle — no rgba literal needed.\n if (decayAlpha !== null) {\n ctx.globalCompositeOperation = 'destination-out';\n ctx.globalAlpha = decayAlpha;\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, rect.width, rect.height);\n ctx.globalAlpha = 1;\n }\n\n ctx.globalCompositeOperation = 'source-over';\n ctx.font = `${fontSize}px ${fontFamily}`;\n ctx.textBaseline = 'top';\n // Per-glyph phosphor glow (canvas shadowBlur). On for vibes\n // that need an emission envelope; off for sharp variants.\n const wantsGlow =\n vibe === 'terminal' || vibe === 'hologram' || vibe === 'synthwave';\n if (wantsGlow) {\n ctx.shadowColor = resolvedColor;\n ctx.shadowBlur = Math.max(4, fontSize * 0.6);\n } else {\n ctx.shadowBlur = 0;\n }\n\n // Default fill (overridden per-column for synthwave).\n if (vibe !== 'synthwave') ctx.fillStyle = resolvedColor;\n\n for (let i = 0; i < columns; i += 1) {\n const ch = glyphString.charAt(\n Math.floor(Math.random() * glyphString.length),\n );\n // Storm: small horizontal jitter so rows feel alive.\n const jitter = storm ? (Math.random() - 0.5) * 2 : 0;\n const x = i * fontSize + jitter;\n const y = drops[i] * fontSize;\n\n // Synthwave: gradient colour per column.\n if (vibe === 'synthwave' && columnColors[i]) {\n ctx.fillStyle = columnColors[i];\n if (wantsGlow) ctx.shadowColor = columnColors[i];\n }\n\n ctx.fillText(ch, x, y);\n\n // Reset randomly once past the bottom so columns restart\n // staggered rather than all at once.\n if (y > rect.height && Math.random() > 0.97) {\n drops[i] = 0;\n }\n // Storm: per-column variable advance speed.\n drops[i] += storm ? columnSpeeds[i] || 1 : 1;\n }\n }\n rafHandle = window.requestAnimationFrame(draw);\n };\n\n const start = () => {\n if (rafHandle) return;\n if (!isVisible || !isOnscreen) return;\n lastFrame = window.performance ? window.performance.now() : 0;\n rafHandle = window.requestAnimationFrame(draw);\n };\n const stop = () => {\n if (rafHandle) {\n window.cancelAnimationFrame(rafHandle);\n rafHandle = 0;\n }\n };\n\n fit();\n start();\n\n // Resize with the container.\n const resizeObserver =\n typeof ResizeObserver !== 'undefined' ? new ResizeObserver(fit) : null;\n resizeObserver?.observe(canvas);\n const onWindowResize = () => fit();\n if (!resizeObserver) window.addEventListener('resize', onWindowResize);\n\n // Pause when tab is hidden.\n const onVisibility = () => {\n isVisible = !document.hidden;\n if (isVisible) start();\n else stop();\n };\n document.addEventListener('visibilitychange', onVisibility);\n\n // Pause when scrolled off-screen.\n const intersectionObserver =\n typeof IntersectionObserver !== 'undefined'\n ? new IntersectionObserver(\n (entries) => {\n isOnscreen = entries.some((e) => e.isIntersecting);\n if (isOnscreen) start();\n else stop();\n },\n { threshold: 0 },\n )\n : null;\n intersectionObserver?.observe(canvas);\n\n // Pause if reduced-motion gets toggled at runtime.\n const onReduceMotionChange = () => {\n if (reduceMotionMql?.matches) stop();\n else start();\n };\n reduceMotionMql?.addEventListener?.('change', onReduceMotionChange);\n\n return () => {\n stop();\n resizeObserver?.disconnect();\n intersectionObserver?.disconnect();\n if (!resizeObserver) window.removeEventListener('resize', onWindowResize);\n document.removeEventListener('visibilitychange', onVisibility);\n reduceMotionMql?.removeEventListener?.('change', onReduceMotionChange);\n };\n }, [\n glyphString,\n tone,\n color,\n fontSize,\n frameInterval,\n decayAlpha,\n vibe,\n storm,\n ]);\n\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={[\n wrapperVariants({ background, vibe, mask, maskRadius }),\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <canvas ref={canvasRef} className=\"absolute inset-0 block size-full\" />\n </div>\n );\n },\n);\n\nMatrixRain.displayName = 'MatrixRain';\n"],"names":["KATAKANA_GLYPHS","HEX_GLYPHS","BINARY_GLYPHS","SYMBOL_GLYPHS","GLYPH_PRESETS","wrapperVariants","cva","TONE_VAR","DENSITY_FONT_PX","PACE_FRAME_MS","DECAY_ALPHA","MatrixRain","forwardRef","glyphs","tone","color","density","pace","decay","vibe","storm","mask","maskRadius","background","className","ref","canvasRef","useRef","glyphString","useMemo","fontSize","frameInterval","decayAlpha","useEffect","canvas","ctx","reduceMotionMql","resolvedColor","fontFamily","dpr","columns","drops","columnColors","columnSpeeds","fit","rect","probe","_","i","t","lastFrame","rafHandle","isVisible","isOnscreen","draw","now","wantsGlow","ch","jitter","x","y","start","stop","resizeObserver","onWindowResize","onVisibility","intersectionObserver","entries","e","onReduceMotionChange","_a","jsx"],"mappings":";;;AAiCA,MAAMA,KACJ,iFAGIC,KAAa,uCACbC,KAAgB,MAChBC,KAAgB,+BAEhBC,IAAgB;AAAA,EACpB,UAAUJ;AAAA,EACV,KAAKC;AAAA,EACL,QAAQC;AAAA,EACR,SAASC;AACX,GAQME,KAAkBC;AAAA;AAAA;AAAA,EAGtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOR,YAAY;AAAA,QACV,aAAa;AAAA,QACb,OAAO;AAAA,MAAA;AAAA,MAET,MAAM;AAAA;AAAA,QAEJ,OAAO;AAAA;AAAA;AAAA;AAAA,QAIP,UAAU;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA;AAAA;AAAA,QAGV,UAAU;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA;AAAA;AAAA;AAAA,QAIV,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GA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AA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,QAEX,UAAA,gBAAA+C,EAAC,UAAA,EAAO,KAAK7C,GAAW,WAAU,mCAAA,CAAmC;AAAA,MAAA;AAAA,IAAA;AAAA,EAG3E;AACF;AAEAf,GAAW,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.0.13",
3
+ "packageVersion": "0.0.16",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -65,6 +65,7 @@ export * from './agenda-tray';
65
65
  export * from './alert';
66
66
  export * from './dialog';
67
67
  export * from './dropdown-menu';
68
+ export * from './matrix-rain';
68
69
  export * from './message-card';
69
70
  export * from './message-tray';
70
71
  export * from './notification-card';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,UAAU,CAAC;AAGlB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAO/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAM1E,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;A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CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAO3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { MatrixRain, type MatrixRainProps } from './matrix-rain';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/matrix-rain/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { M as i } from "../../_chunks/matrix-rain-Q7xTEpKu.js";
2
+ export {
3
+ i as MatrixRain
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,75 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ declare const GLYPH_PRESETS: {
3
+ readonly katakana: string;
4
+ readonly hex: "0123456789ABCDEF{}[]<>/\\;:=$#@!*+-";
5
+ readonly binary: "01";
6
+ readonly symbols: "!@#$%^&*()_+-=[]{}|;:,.<>?/";
7
+ };
8
+ type GlyphPreset = keyof typeof GLYPH_PRESETS;
9
+ declare const wrapperVariants: (props?: ({
10
+ background?: "solid" | "transparent" | null | undefined;
11
+ vibe?: "ghost" | "terminal" | "clean" | "hologram" | "synthwave" | "oscilloscope" | null | undefined;
12
+ mask?: "none" | "center" | null | undefined;
13
+ maskRadius?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ type Tone = 'primary' | 'accent' | 'success' | 'error' | 'info';
16
+ type Density = 'low' | 'medium' | 'high';
17
+ type Pace = 'gentle' | 'normal' | 'fast';
18
+ type Decay = 'none' | 'slow' | 'normal' | 'fast';
19
+ export interface MatrixRainProps extends VariantProps<typeof wrapperVariants> {
20
+ /** Glyph preset name or a literal string of glyphs. Default `katakana`. */
21
+ glyphs?: GlyphPreset | string;
22
+ /** Brand tone for the rain. Resolved against the active theme. */
23
+ tone?: Tone;
24
+ /** Optional explicit colour — any CSS colour value. Overrides `tone` when set. */
25
+ color?: string;
26
+ /** Glyph density — controls font-size. */
27
+ density?: Density;
28
+ /** Animation pace — controls frame interval. */
29
+ pace?: Pace;
30
+ /** Trail persistence — smaller decay = denser cumulative background. */
31
+ decay?: Decay;
32
+ /**
33
+ * Built-in surface beneath the rain. `transparent` (default) lets the
34
+ * parent provide its own background; `solid` paints a near-black
35
+ * surface so the rain reads cleanly without the consumer wrapping it
36
+ * themselves — useful for standalone demos or full-bleed easter eggs.
37
+ */
38
+ background?: 'transparent' | 'solid';
39
+ /**
40
+ * Visual treatment.
41
+ * - `clean` — just the rain.
42
+ * - `terminal` — Fallout-CRT: vignette + scanlines + bloom + glow.
43
+ * - `hologram` — sci-fi HUD: soft scanlines + slow opacity pulse.
44
+ * - `synthwave` — 80s neon: heavy bloom + indigo horizon + accent→
45
+ * info gradient across columns (overrides `tone`).
46
+ * - `oscilloscope` — vintage scope: sharp edges + dense scanlines +
47
+ * animated horizontal beam sweep.
48
+ * - `ghost` — production-friendly faint background variant.
49
+ */
50
+ vibe?: 'clean' | 'terminal' | 'hologram' | 'synthwave' | 'oscilloscope' | 'ghost';
51
+ /**
52
+ * When `true`, gives each column a stable random speed multiplier
53
+ * (0.6×–1.4× of the base pace) and adds a small horizontal jitter to
54
+ * each glyph. Pairs with any vibe — makes the rain feel alive vs.
55
+ * metronomic.
56
+ */
57
+ storm?: boolean;
58
+ /**
59
+ * Radial mask. `center` fades the canvas to fully transparent in the
60
+ * middle so foreground content sitting over the rain stays readable
61
+ * (e.g. code-block easter egg with copy in the middle).
62
+ */
63
+ mask?: 'none' | 'center';
64
+ /**
65
+ * Inner clear-zone radius for `mask="center"`. Ignored when `mask`
66
+ * is `none`. T-shirt sizes map to: xs 15%, sm 22%, md 30% (default),
67
+ * lg 42%, xl 55%.
68
+ */
69
+ maskRadius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
70
+ /** Class merged onto the wrapper. */
71
+ className?: string;
72
+ }
73
+ export declare const MatrixRain: import("react").ForwardRefExoticComponent<MatrixRainProps & import("react").RefAttributes<HTMLDivElement>>;
74
+ export {};
75
+ //# sourceMappingURL=matrix-rain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix-rain.d.ts","sourceRoot":"","sources":["../../../src/components/matrix-rain/matrix-rain.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmBlE,QAAA,MAAM,aAAa;;;;;CAKT,CAAC;AAEX,KAAK,WAAW,GAAG,MAAM,OAAO,aAAa,CAAC;AAM9C,QAAA,MAAM,eAAe;;;;;8EA+FpB,CAAC;AAMF,KAAK,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAChE,KAAK,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