@dloizides/logo-kit 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - React entry `@dloizides/logo-kit/react`: `MotionLogo` hosts a raster logo, injects the markup and preset CSS, plays intro and idle, exposes `micro()` through its ref and stops on unmount. `react` and `react-native` are optional peers.
6
+ - Native renders a still `Image`; reduced motion keeps the still; a changed `label` or preset re-renders the markup.
7
+
3
8
  ## 0.5.0
4
9
 
5
10
  - Raster motion presets: whole-image motion for a logo that has no SVG layers (a PNG or WebP). Intros `fade-up`, `scale-settle`, `mask-wipe`, `light-sweep`, `focus-in`, `glow-sweep`, `punch-sweep`, `double-sweep`, `burst-settle`, `tilt-sweep` (600-1140 ms, cap 1200 ms); micros `pulse`, `glint`, `nudge`, `underline-draw` (200-280 ms, cap 300 ms); idle loops `slow-glint` (7 s), `glow-breathe` (6 s), `sheen-drift` (8 s), `soft-lift` (6.5 s), `twin-shimmer` (8 s).
package/README.md CHANGED
@@ -20,6 +20,7 @@ For a logo that exists only as an image (PNG, WebP), motion acts on the whole im
20
20
  - `rasterMarkup(src, alt, { width })` returns the layered HTML; `rasterMotion({ intro, micro, idle }, { glowColour, bandColour })` returns `{ css, introMs, microMs, periodMs, unknown }`.
21
21
  - Intros: fade-up, scale-settle, mask-wipe, light-sweep, focus-in, glow-sweep, punch-sweep, double-sweep, burst-settle, tilt-sweep (<= 1200 ms). Micros: pulse, glint, nudge, underline-draw (<= 300 ms). Idle loops: slow-glint, glow-breathe, sheen-drift, soft-lift, twin-shimmer (6-8 s, starting when the intro ends).
22
22
  - Browser: `startRasterMotion(host, { idle: true })` from `@dloizides/logo-kit/runtime` returns `{ micro, stop }`, pauses while the tab is hidden and does nothing under reduced motion, where the CSS shows the still.
23
+ - React / React Native: `import { MotionLogo } from '@dloizides/logo-kit/react'` (`react` and `react-native` are optional peers). Props `src`, `label` (re-read on change), `hint`, `intro` / `micro` / `idle` preset names, `glowColour`, `bandColour`, `width`, `aspectRatio`, `testID`; the ref exposes `micro()`. On native it renders a still `Image`; under reduced motion the still stays.
23
24
 
24
25
  ## Brand runtime
25
26
 
@@ -0,0 +1,21 @@
1
+ import * as react from 'react';
2
+
3
+ interface MotionLogoProps {
4
+ src: string;
5
+ label: string;
6
+ hint?: string;
7
+ intro?: string;
8
+ micro?: string;
9
+ idle?: string;
10
+ glowColour?: string;
11
+ bandColour?: string;
12
+ width?: number;
13
+ aspectRatio?: number;
14
+ testID?: string;
15
+ }
16
+ interface MotionLogoHandle {
17
+ micro: () => void;
18
+ }
19
+ declare const MotionLogo: react.ForwardRefExoticComponent<MotionLogoProps & react.RefAttributes<MotionLogoHandle>>;
20
+
21
+ export { MotionLogo, type MotionLogoHandle, type MotionLogoProps };
package/dist/react.js ADDED
@@ -0,0 +1,296 @@
1
+ import { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
2
+ import { StyleSheet, Platform, View, Image } from 'react-native';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/react/MotionLogo.tsx
6
+
7
+ // src/motion/raster/rasterBaseCss.ts
8
+ var RASTER_PREFIX = "lkr";
9
+ var MASK = (p) => `-webkit-mask:var(--${p}-src) center/100% 100% no-repeat;mask:var(--${p}-src) center/100% 100% no-repeat`;
10
+ function layoutCss(p) {
11
+ return `.${p}{position:relative;display:inline-block;line-height:0;vertical-align:middle}.${p}-img{display:block;max-width:100%;height:auto}.${p}-lift,.${p}-nod,.${p}-in{position:relative;display:block;transform-origin:center}.${p}-fx{position:absolute;inset:0;pointer-events:none}.${p}-glow,.${p}-haze{opacity:0;filter:blur(7px)}.${p}-tint{position:absolute;inset:0;background:var(--${p}-glow);${MASK(p)}}.${p}-sheen{overflow:hidden;${MASK(p)}}.${p}-band{position:absolute;top:0;bottom:0;left:-100%;width:0;background:linear-gradient(90deg,transparent,var(--${p}-band) 50%,transparent)}`;
12
+ }
13
+ function burstCss(p) {
14
+ const centred = "position:absolute;left:50%;top:50%;aspect-ratio:1;border-radius:50%;opacity:0;transform:translate(-50%,-50%)";
15
+ const ring = "radial-gradient(closest-side,transparent 52%,black 54%,black 96%,transparent 100%)";
16
+ return `.${p}-ring{${centred};height:140%;box-sizing:border-box;border:3px solid var(--${p}-glow)}.${p}-rays{${centred};height:230%;background:repeating-conic-gradient(var(--${p}-glow) 0 3deg,transparent 3deg 22.5deg);-webkit-mask:${ring};mask:${ring}}.${p}-spark{position:absolute;inset:0;opacity:0}.${p}-spark::after{content:"";position:absolute;left:50%;top:50%;width:6px;height:6px;margin:-3px;border-radius:50%;background:var(--${p}-glow)}.${p}-shadow{position:absolute;left:8%;width:84%;top:calc(100% + 5px);height:10px;border-radius:50%;background:var(--${p}-shadow);opacity:0}.${p}-line{position:absolute;left:0;width:100%;top:calc(100% + 6px);height:3px;border-radius:1.5px;background:var(--${p}-glow);transform:scaleX(0);transform-origin:left center}`;
17
+ }
18
+ function rasterBaseCss(options = {}) {
19
+ const p = options.prefix ?? RASTER_PREFIX;
20
+ const vars = `.${p}{--${p}-glow:${options.glowColour ?? "currentColor"};--${p}-band:${options.bandColour ?? "white"};--${p}-shadow:${options.shadowColour ?? "currentColor"}}`;
21
+ const paused = `.${p}-paused,.${p}-paused *,.${p}-paused *::after{animation-play-state:paused!important}`;
22
+ const reduced = `@media (prefers-reduced-motion:reduce){.${p},.${p} *,.${p} *::after{animation:none!important}}`;
23
+ return vars + layoutCss(p) + burstCss(p) + paused + reduced;
24
+ }
25
+
26
+ // src/motion/raster/rasterSpec.ts
27
+ var RASTER_EASE = {
28
+ out: "cubic-bezier(.2,.8,.2,1)",
29
+ spring: "cubic-bezier(.34,1.4,.64,1)",
30
+ inOut: "cubic-bezier(.65,0,.35,1)",
31
+ linear: "linear"
32
+ };
33
+ var SPARK_COUNT = 12;
34
+ var SPARK_GROUPS = 4;
35
+ var FADE_IN = "from{opacity:0}to{opacity:1}";
36
+ var PERCENT = 100;
37
+ var n = (v) => String(Number(v.toFixed(2)));
38
+ var travel = (width) => `translateX(${n((1 + 2 * width) / width * PERCENT)}%)`;
39
+ var bandRest = (width, opacity) => `left:${n(-1.5 * width * PERCENT)}%;width:${n(width * PERCENT)}%;opacity:${n(opacity)}`;
40
+ function sweep(layer, band, ms, delayMs) {
41
+ const frames = `from{transform:translateX(0)}to{transform:${travel(band.width)}}`;
42
+ return { layer, frames, ms, delayMs, ease: RASTER_EASE.inOut, rest: bandRest(band.width, band.opacity) };
43
+ }
44
+ function drift(layer, band, periodMs, stops) {
45
+ const to = travel(band.width);
46
+ const frames = `0%{transform:translateX(0)}${stops[0]}%{transform:translateX(0);animation-timing-function:${RASTER_EASE.inOut}}${stops[1]}%{transform:${to}}100%{transform:${to}}`;
47
+ return { layer, frames, ms: periodMs, ease: RASTER_EASE.linear, loop: true, rest: bandRest(band.width, band.opacity) };
48
+ }
49
+ function swell(layer, rest, peak, periodMs) {
50
+ const ease = `animation-timing-function:${RASTER_EASE.inOut}`;
51
+ return { layer, frames: `0%,100%{${rest};${ease}}50%{${peak};${ease}}`, ms: periodMs, ease: RASTER_EASE.linear, loop: true };
52
+ }
53
+ function animEndMs(anim) {
54
+ return (anim.delayMs ?? 0) + (anim.stepMs ?? 0) * (SPARK_GROUPS - 1) + anim.ms;
55
+ }
56
+
57
+ // src/motion/raster/rasterMarkup.ts
58
+ var PERCENT2 = 100;
59
+ var HEX = 16;
60
+ var SPARK_TURN = 0.3;
61
+ var SPARK_NEAR = 0.48;
62
+ var SPARK_FAR = 0.62;
63
+ var SPARK_HEIGHT = 1.25;
64
+ var BANDS = ["s0" /* S0 */, "s1" /* S1 */, "i0" /* I0 */, "i1" /* I1 */, "m0" /* M0 */];
65
+ var attr = (v) => v.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
66
+ var cssUrl = (v) => v.replace(/["'()\\\s]/g, (c) => `%${c.charCodeAt(0).toString(HEX).toUpperCase().padStart(2, "0")}`);
67
+ var n2 = (v) => String(Number(v.toFixed(1)));
68
+ function sparks(p) {
69
+ return Array.from({ length: SPARK_COUNT }, (_, i) => {
70
+ const a = i / SPARK_COUNT * Math.PI * 2 + SPARK_TURN;
71
+ const r = i % 2 ? SPARK_FAR : SPARK_NEAR;
72
+ const style = `--dx:${n2(Math.cos(a) * r * PERCENT2)}%;--dy:${n2(Math.sin(a) * SPARK_HEIGHT * PERCENT2)}%;--k:${i % SPARK_GROUPS}`;
73
+ return `<span class="${p}-${"spark" /* Spark */}" style="${style}"></span>`;
74
+ }).join("");
75
+ }
76
+ function rasterMarkup(src, alt, options = {}) {
77
+ const p = options.prefix ?? RASTER_PREFIX;
78
+ const size = options.width !== void 0 ? `;width:${options.width}` : "";
79
+ const band = (k) => `<span class="${p}-band ${p}-${k}"></span>`;
80
+ const glow = (k) => `<span class="${p}-fx ${p}-${k}"><span class="${p}-tint"></span></span>`;
81
+ const img = `<span class="${p}-${"lift" /* Lift */}"><span class="${p}-${"nod" /* Nod */}"><span class="${p}-${"in" /* In */}"><img class="${p}-${"img" /* Img */}" src="${attr(src)}" alt="${attr(alt)}"></span></span></span>`;
82
+ const burst = `<span class="${p}-fx"><span class="${p}-${"ring" /* Ring */}"></span><span class="${p}-${"rays" /* Rays */}"></span>${sparks(p)}</span>`;
83
+ const sheen = `<span class="${p}-fx ${p}-sheen">${BANDS.map(band).join("")}</span>`;
84
+ const host = attr(`--${p}-src:url("${cssUrl(src)}")${size}`);
85
+ return `<span class="${p}" style="${host}">${glow("glow" /* Glow */)}${glow("haze" /* Haze */)}${burst}<span class="${p}-${"shadow" /* Shadow */}"></span>${img}${sheen}<span class="${p}-${"line" /* Line */}"></span></span>`;
86
+ }
87
+
88
+ // src/motion/raster/rasterIntros.ts
89
+ var { out, spring, inOut } = RASTER_EASE;
90
+ var CENTRED = "translate(-50%,-50%)";
91
+ var SPARK = "0%{opacity:0;transform:translate(0,0) scale(.4)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1)}";
92
+ var RASTER_INTRO_SPECS = {
93
+ ["fade-up" /* FadeUp */]: { anims: [{ layer: "img" /* Img */, frames: "from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}", ms: 600, ease: out }] },
94
+ ["scale-settle" /* ScaleSettle */]: { anims: [{ layer: "img" /* Img */, frames: "from{opacity:0;transform:scale(.9)}to{opacity:1;transform:none}", ms: 700, ease: spring }] },
95
+ ["mask-wipe" /* MaskWipe */]: { anims: [{ layer: "img" /* Img */, frames: "from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}", ms: 800, ease: inOut }] },
96
+ ["light-sweep" /* LightSweep */]: {
97
+ anims: [{ layer: "img" /* Img */, frames: FADE_IN, ms: 350, ease: out }, sweep("s0" /* S0 */, { width: 0.35, opacity: 0.9 }, 750, 350)]
98
+ },
99
+ ["focus-in" /* FocusIn */]: { anims: [{ layer: "img" /* Img */, frames: "from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}", ms: 700, ease: out }] },
100
+ ["glow-sweep" /* GlowSweep */]: {
101
+ anims: [
102
+ { layer: "img" /* Img */, frames: FADE_IN, ms: 300, ease: out },
103
+ { layer: "glow" /* Glow */, frames: "0%,100%{opacity:0}55%{opacity:.85}", ms: 800, delayMs: 300, ease: inOut },
104
+ { layer: "in" /* In */, frames: "0%,100%{transform:none}55%{transform:scale(1.025)}", ms: 800, delayMs: 300, ease: inOut },
105
+ sweep("s0" /* S0 */, { width: 0.55, opacity: 1 }, 700, 300)
106
+ ]
107
+ },
108
+ ["punch-sweep" /* PunchSweep */]: {
109
+ anims: [
110
+ { layer: "in" /* In */, frames: "0%{opacity:0;transform:scale(.6)}55%{opacity:1;transform:scale(1.08)}78%{transform:scale(.98)}100%{opacity:1;transform:none}", ms: 600, ease: out },
111
+ sweep("s0" /* S0 */, { width: 0.4, opacity: 0.95 }, 520, 600)
112
+ ]
113
+ },
114
+ ["double-sweep" /* DoubleSweep */]: {
115
+ anims: [
116
+ { layer: "img" /* Img */, frames: FADE_IN, ms: 260, ease: out },
117
+ sweep("s0" /* S0 */, { width: 0.13, opacity: 1 }, 330, 220),
118
+ sweep("s1" /* S1 */, { width: 0.6, opacity: 0.95 }, 580, 560)
119
+ ]
120
+ },
121
+ ["burst-settle" /* BurstSettle */]: {
122
+ anims: [
123
+ { layer: "in" /* In */, frames: "0%{opacity:0;transform:scale(1.25)}100%{opacity:1;transform:none}", ms: 650, ease: spring },
124
+ { layer: "ring" /* Ring */, frames: `0%{opacity:.9;transform:${CENTRED} scale(.3)}100%{opacity:0;transform:${CENTRED} scale(2.1)}`, ms: 650, delayMs: 60, ease: out },
125
+ { layer: "rays" /* Rays */, frames: `0%{opacity:0;transform:${CENTRED} scale(.4)}25%{opacity:.75}100%{opacity:0;transform:${CENTRED} scale(1.25)}`, ms: 600, delayMs: 40, ease: out },
126
+ { layer: "spark" /* Spark */, frames: SPARK, ms: 720, delayMs: 120, stepMs: 40, ease: out },
127
+ sweep("s0" /* S0 */, { width: 0.4, opacity: 0.95 }, 480, 660)
128
+ ]
129
+ },
130
+ ["tilt-sweep" /* TiltSweep */]: {
131
+ anims: [
132
+ { layer: "in" /* In */, frames: "0%{opacity:0;transform:translateY(10px) scaleX(.2) skewY(-16deg)}45%{opacity:1}65%{transform:scaleX(1.05) skewY(2deg)}100%{opacity:1;transform:none}", ms: 620, ease: out },
133
+ { layer: "shadow" /* Shadow */, frames: "0%{opacity:0;transform:scaleX(.3)}60%{opacity:.22;transform:scaleX(1.1)}100%{opacity:0;transform:none}", ms: 900, ease: out },
134
+ sweep("s0" /* S0 */, { width: 0.45, opacity: 0.95 }, 520, 620)
135
+ ]
136
+ }
137
+ };
138
+
139
+ // src/motion/raster/rasterLoops.ts
140
+ var { out: out2 } = RASTER_EASE;
141
+ var RASTER_MICRO_SPECS = {
142
+ ["pulse" /* Pulse */]: { anims: [{ layer: "nod" /* Nod */, frames: "0%,100%{transform:none}45%{transform:scale(1.04)}", ms: 240, ease: out2 }] },
143
+ ["glint" /* Glint */]: { anims: [sweep("m0" /* M0 */, { width: 0.35, opacity: 0.9 }, 280, 0)] },
144
+ ["nudge" /* Nudge */]: { anims: [{ layer: "nod" /* Nod */, frames: "0%,100%{transform:none}45%{transform:translateY(-4px)}", ms: 200, ease: out2 }] },
145
+ ["underline-draw" /* UnderlineDraw */]: { anims: [{ layer: "line" /* Line */, frames: "from{transform:scaleX(0)}to{transform:scaleX(1)}", ms: 260, ease: out2 }] }
146
+ };
147
+ var RASTER_IDLE_SPECS = {
148
+ ["slow-glint" /* SlowGlint */]: { periodMs: 7e3, anims: [drift("i0" /* I0 */, { width: 0.17, opacity: 0.85 }, 7e3, [0, 11])] },
149
+ ["glow-breathe" /* GlowBreathe */]: { periodMs: 6e3, anims: [swell("haze" /* Haze */, "opacity:0", "opacity:.3", 6e3)] },
150
+ ["sheen-drift" /* SheenDrift */]: { periodMs: 8e3, anims: [drift("i0" /* I0 */, { width: 0.8, opacity: 0.35 }, 8e3, [0, 45])] },
151
+ ["soft-lift" /* SoftLift */]: {
152
+ periodMs: 6500,
153
+ anims: [swell("lift" /* Lift */, "transform:none", "transform:scale(1.018)", 6500), swell("haze" /* Haze */, "opacity:0", "opacity:.14", 6500)]
154
+ },
155
+ ["twin-shimmer" /* TwinShimmer */]: {
156
+ periodMs: 8e3,
157
+ anims: [drift("i0" /* I0 */, { width: 0.11, opacity: 0.7 }, 8e3, [0, 8]), drift("i1" /* I1 */, { width: 0.11, opacity: 0.7 }, 8e3, [4, 12])]
158
+ }
159
+ };
160
+
161
+ // src/motion/raster/rasterPresets.ts
162
+ function animCss(a, i, s) {
163
+ const name = `${s.p}-${s.id}-${i}`;
164
+ const delay = a.loop ? s.idleStartMs : a.delayMs ?? 0;
165
+ const stagger = a.stepMs ? `;animation-delay:calc(${delay}ms + var(--k) * ${a.stepMs}ms)` : "";
166
+ const play = `.${s.p}.${s.p}-play-${s.phase} .${s.p}-${a.layer}{animation:${name} ${a.ms}ms ${a.ease} ${delay}ms ${a.loop ? "infinite" : "1"} both${stagger}}`;
167
+ const rest = a.rest ? `.${s.p} .${s.p}-${a.layer}{${a.rest}}` : "";
168
+ return `@keyframes ${name}{${a.frames}}${play}${rest}`;
169
+ }
170
+ function build(spec, name, phase, options) {
171
+ const scope = { p: options.prefix ?? RASTER_PREFIX, id: `${phase}-${name}`, phase, idleStartMs: options.idleStartMs ?? 0 };
172
+ const css = spec.anims.map((a, i) => animCss(a, i, scope)).join("");
173
+ const durationMs = spec.periodMs ?? Math.max(...spec.anims.map(animEndMs));
174
+ return { name, phase, durationMs, periodMs: spec.periodMs, css };
175
+ }
176
+ var pick = (table, name, phase, options) => {
177
+ const spec = table[name];
178
+ return spec ? build(spec, name, phase, options) : null;
179
+ };
180
+ function rasterIntro(name, options = {}) {
181
+ return pick(RASTER_INTRO_SPECS, name, "intro" /* Intro */, options);
182
+ }
183
+ function rasterMicro(name, options = {}) {
184
+ return pick(RASTER_MICRO_SPECS, name, "micro" /* Micro */, options);
185
+ }
186
+ function rasterIdle(name, options = {}) {
187
+ return pick(RASTER_IDLE_SPECS, name, "idle" /* Idle */, options);
188
+ }
189
+ var unknownNames = (pairs) => pairs.flatMap(([asked, found]) => asked !== void 0 && found === null ? [asked] : []);
190
+ function rasterMotion(selection, options = {}) {
191
+ const intro = selection.intro !== void 0 ? rasterIntro(selection.intro, options) : null;
192
+ const micro = selection.micro !== void 0 ? rasterMicro(selection.micro, options) : null;
193
+ const idleStartMs = options.idleStartMs ?? intro?.durationMs ?? 0;
194
+ const idle = selection.idle !== void 0 ? rasterIdle(selection.idle, { ...options, idleStartMs }) : null;
195
+ const unknown = unknownNames([[selection.intro, intro], [selection.micro, micro], [selection.idle, idle]]);
196
+ const css = rasterBaseCss(options) + [intro, micro, idle].map((x) => x?.css ?? "").join("");
197
+ return { css, introMs: intro?.durationMs ?? 0, microMs: micro?.durationMs ?? 0, periodMs: idle?.periodMs ?? 0, unknown };
198
+ }
199
+
200
+ // src/motion/defaults.ts
201
+ var MICRO_CAP_MS = 300;
202
+
203
+ // src/runtime/startRasterMotion.ts
204
+ var REDUCED_QUERY = "(prefers-reduced-motion: reduce)";
205
+ var VISIBILITY = "visibilitychange";
206
+ var NOOP = { micro: () => void 0, stop: () => void 0 };
207
+ var browser = () => globalThis;
208
+ var restart = (host) => host.offsetWidth ?? 0;
209
+ function startRasterMotion(host, options = {}) {
210
+ if (browser().matchMedia?.(REDUCED_QUERY).matches === true) {
211
+ return NOOP;
212
+ }
213
+ const p = options.prefix ?? RASTER_PREFIX;
214
+ const microClass = `${p}-play-micro`;
215
+ const microMs = Math.min(options.microMs ?? MICRO_CAP_MS, MICRO_CAP_MS);
216
+ const played = [options.intro !== false ? `${p}-play-intro` : "", options.idle === true ? `${p}-play-idle` : ""].filter((c) => c !== "");
217
+ let timer;
218
+ const sync = () => {
219
+ if (browser().document?.hidden === true) {
220
+ host.classList.add(`${p}-paused`);
221
+ } else {
222
+ host.classList.remove(`${p}-paused`);
223
+ }
224
+ };
225
+ played.forEach((c) => host.classList.add(c));
226
+ sync();
227
+ browser().document?.addEventListener?.(VISIBILITY, sync);
228
+ const micro = () => {
229
+ clearTimeout(timer);
230
+ host.classList.remove(microClass);
231
+ restart(host);
232
+ host.classList.add(microClass);
233
+ timer = setTimeout(() => host.classList.remove(microClass), microMs);
234
+ };
235
+ const stop = () => {
236
+ clearTimeout(timer);
237
+ browser().document?.removeEventListener?.(VISIBILITY, sync);
238
+ [...played, microClass, `${p}-paused`].forEach((c) => host.classList.remove(c));
239
+ };
240
+ return { micro, stop };
241
+ }
242
+ var WEB = "web";
243
+ var STILL_SUFFIX = "-still";
244
+ var FULL_WIDTH = "100%";
245
+ var styles = StyleSheet.create({
246
+ frame: { alignSelf: "center" },
247
+ still: { height: FULL_WIDTH, width: FULL_WIDTH }
248
+ });
249
+ var isElement = (node) => typeof HTMLElement !== "undefined" && node instanceof HTMLElement;
250
+ function useRasterMotion(hostRef, props, isWeb) {
251
+ const controls = useRef(null);
252
+ const { src, label, intro, micro, idle, glowColour, bandColour } = props;
253
+ useEffect(() => {
254
+ const node = hostRef.current;
255
+ if (!isWeb || !isElement(node)) {
256
+ return void 0;
257
+ }
258
+ const motion = rasterMotion({ intro, micro, idle }, { glowColour, bandColour });
259
+ node.innerHTML = `<style>${motion.css}</style>${rasterMarkup(src, label, { width: FULL_WIDTH })}`;
260
+ const host = node.lastElementChild;
261
+ if (host === null) {
262
+ return void 0;
263
+ }
264
+ controls.current = startRasterMotion(host, { intro: intro !== void 0, idle: idle !== void 0, microMs: motion.microMs });
265
+ return () => {
266
+ controls.current?.stop();
267
+ controls.current = null;
268
+ };
269
+ }, [hostRef, isWeb, src, label, intro, micro, idle, glowColour, bandColour]);
270
+ return controls;
271
+ }
272
+ var MotionLogo = forwardRef((props, ref) => {
273
+ const hostRef = useRef(null);
274
+ const isWeb = Platform.OS === WEB;
275
+ const controls = useRasterMotion(hostRef, props, isWeb);
276
+ useImperativeHandle(ref, () => ({ micro: () => controls.current?.micro() }), [controls]);
277
+ const size = { aspectRatio: props.aspectRatio, width: props.width };
278
+ const stillTestID = props.testID !== void 0 ? `${props.testID}${STILL_SUFFIX}` : void 0;
279
+ return /* @__PURE__ */ jsx(
280
+ View,
281
+ {
282
+ ref: hostRef,
283
+ accessibilityHint: props.hint,
284
+ accessibilityLabel: props.label,
285
+ accessibilityRole: "image",
286
+ style: [styles.frame, size],
287
+ testID: props.testID,
288
+ children: isWeb ? null : /* @__PURE__ */ jsx(Image, { accessibilityIgnoresInvertColors: true, resizeMode: "contain", source: { uri: props.src }, style: styles.still, testID: stillTestID })
289
+ }
290
+ );
291
+ });
292
+ MotionLogo.displayName = "MotionLogo";
293
+
294
+ export { MotionLogo };
295
+ //# sourceMappingURL=react.js.map
296
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/motion/raster/rasterBaseCss.ts","../src/motion/raster/rasterSpec.ts","../src/motion/raster/rasterMarkup.ts","../src/motion/raster/rasterIntros.ts","../src/motion/raster/rasterLoops.ts","../src/motion/raster/rasterPresets.ts","../src/motion/defaults.ts","../src/runtime/startRasterMotion.ts","../src/react/MotionLogo.tsx"],"names":["PERCENT","n","out"],"mappings":";;;;;;;AAQO,IAAM,aAAA,GAAgB,KAAA;AAE7B,IAAM,OAAO,CAAC,CAAA,KAAsB,CAAA,mBAAA,EAAsB,CAAC,+CAA+C,CAAC,CAAA,gCAAA,CAAA;AAE3G,SAAS,UAAU,CAAA,EAAmB;AACpC,EAAA,OAAO,CAAA,CAAA,EAAI,CAAC,CAAA,6EAAA,EACJ,CAAC,kDACD,CAAC,CAAA,OAAA,EAAU,CAAC,CAAA,MAAA,EAAS,CAAC,CAAA,6DAAA,EACtB,CAAC,CAAA,mDAAA,EACD,CAAC,CAAA,OAAA,EAAU,CAAC,CAAA,kCAAA,EACZ,CAAC,CAAA,iDAAA,EAAoD,CAAC,CAAA,OAAA,EAAU,IAAA,CAAK,CAAC,CAAC,CAAA,EAAA,EACvE,CAAC,CAAA,uBAAA,EAA0B,KAAK,CAAC,CAAC,CAAA,EAAA,EAClC,CAAC,gHAAgH,CAAC,CAAA,wBAAA,CAAA;AAC5H;AAEA,SAAS,SAAS,CAAA,EAAmB;AACnC,EAAA,MAAM,OAAA,GAAU,8GAAA;AAChB,EAAA,MAAM,IAAA,GAAO,oFAAA;AACb,EAAA,OAAO,CAAA,CAAA,EAAI,CAAC,CAAA,MAAA,EAAS,OAAO,CAAA,0DAAA,EAA6D,CAAC,CAAA,QAAA,EAClF,CAAC,CAAA,MAAA,EAAS,OAAO,CAAA,uDAAA,EAA0D,CAAC,CAAA,qDAAA,EAAwD,IAAI,CAAA,MAAA,EAAS,IAAI,CAAA,EAAA,EACrJ,CAAC,CAAA,4CAAA,EACD,CAAC,CAAA,gIAAA,EAAmI,CAAC,CAAA,QAAA,EACrI,CAAC,CAAA,gHAAA,EAAmH,CAAC,CAAA,o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O,EAAE,WAAA,EAAa,MAAM,WAAA,EAAa,KAAA,EAAO,MAAM,KAAA,EAAM;AAClE,EAAA,MAAM,WAAA,GAAc,MAAM,MAAA,KAAW,MAAA,GAAY,GAAG,KAAA,CAAM,MAAM,CAAA,EAAG,YAAY,CAAA,CAAA,GAAK,MAAA;AAEpF,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA,EAAK,OAAA;AAAA,MACL,mBAAmB,KAAA,CAAM,IAAA;AAAA,MACzB,oBAAoB,KAAA,CAAM,KAAA;AAAA,MAC1B,iBAAA,EAAkB,OAAA;AAAA,MAClB,KAAA,EAAO,CAAC,MAAA,CAAO,KAAA,EAAO,IAAI,CAAA;AAAA,MAC1B,QAAQ,KAAA,CAAM,MAAA;AAAA,MAEb,kBAAQ,IAAA,mBACP,GAAA,CAAC,SAAM,gCAAA,EAAgC,IAAA,EAAC,YAAW,SAAA,EAAU,MAAA,EAAQ,EAAE,GAAA,EAAK,MAAM,GAAA,EAAI,EAAG,OAAO,MAAA,CAAO,KAAA,EAAO,QAAQ,WAAA,EAAa;AAAA;AAAA,GAEvI;AAEJ,CAAC;AAED,UAAA,CAAW,WAAA,GAAc,YAAA","file":"react.js","sourcesContent":["export interface RasterOptions {\n prefix?: string;\n glowColour?: string;\n bandColour?: string;\n shadowColour?: string;\n idleStartMs?: number;\n}\n\nexport const RASTER_PREFIX = 'lkr';\n\nconst MASK = (p: string): string => `-webkit-mask:var(--${p}-src) center/100% 100% no-repeat;mask:var(--${p}-src) center/100% 100% no-repeat`;\n\nfunction layoutCss(p: string): string {\n return `.${p}{position:relative;display:inline-block;line-height:0;vertical-align:middle}`\n + `.${p}-img{display:block;max-width:100%;height:auto}`\n + `.${p}-lift,.${p}-nod,.${p}-in{position:relative;display:block;transform-origin:center}`\n + `.${p}-fx{position:absolute;inset:0;pointer-events:none}`\n + `.${p}-glow,.${p}-haze{opacity:0;filter:blur(7px)}`\n + `.${p}-tint{position:absolute;inset:0;background:var(--${p}-glow);${MASK(p)}}`\n + `.${p}-sheen{overflow:hidden;${MASK(p)}}`\n + `.${p}-band{position:absolute;top:0;bottom:0;left:-100%;width:0;background:linear-gradient(90deg,transparent,var(--${p}-band) 50%,transparent)}`;\n}\n\nfunction burstCss(p: string): string {\n const centred = 'position:absolute;left:50%;top:50%;aspect-ratio:1;border-radius:50%;opacity:0;transform:translate(-50%,-50%)';\n const ring = 'radial-gradient(closest-side,transparent 52%,black 54%,black 96%,transparent 100%)';\n return `.${p}-ring{${centred};height:140%;box-sizing:border-box;border:3px solid var(--${p}-glow)}`\n + `.${p}-rays{${centred};height:230%;background:repeating-conic-gradient(var(--${p}-glow) 0 3deg,transparent 3deg 22.5deg);-webkit-mask:${ring};mask:${ring}}`\n + `.${p}-spark{position:absolute;inset:0;opacity:0}`\n + `.${p}-spark::after{content:\"\";position:absolute;left:50%;top:50%;width:6px;height:6px;margin:-3px;border-radius:50%;background:var(--${p}-glow)}`\n + `.${p}-shadow{position:absolute;left:8%;width:84%;top:calc(100% + 5px);height:10px;border-radius:50%;background:var(--${p}-shadow);opacity:0}`\n + `.${p}-line{position:absolute;left:0;width:100%;top:calc(100% + 6px);height:3px;border-radius:1.5px;background:var(--${p}-glow);transform:scaleX(0);transform-origin:left center}`;\n}\n\n/** Returns the still layout of the raster logo layers, the hidden-tab pause and the reduced-motion rule. */\nexport function rasterBaseCss(options: RasterOptions = {}): string {\n const p = options.prefix ?? RASTER_PREFIX;\n const vars = `.${p}{--${p}-glow:${options.glowColour ?? 'currentColor'};--${p}-band:${options.bandColour ?? 'white'};--${p}-shadow:${options.shadowColour ?? 'currentColor'}}`;\n const paused = `.${p}-paused,.${p}-paused *,.${p}-paused *::after{animation-play-state:paused!important}`;\n const reduced = `@media (prefers-reduced-motion:reduce){.${p},.${p} *,.${p} *::after{animation:none!important}}`;\n return vars + layoutCss(p) + burstCss(p) + paused + reduced;\n}\n","import { RasterLayer } from './RasterLayer';\n\nexport interface RasterAnim {\n layer: RasterLayer;\n frames: string;\n ms: number;\n ease: string;\n delayMs?: number;\n stepMs?: number;\n loop?: boolean;\n rest?: string;\n}\n\nexport interface RasterSpec {\n anims: RasterAnim[];\n periodMs?: number;\n}\n\nexport const RASTER_EASE = {\n out: 'cubic-bezier(.2,.8,.2,1)',\n spring: 'cubic-bezier(.34,1.4,.64,1)',\n inOut: 'cubic-bezier(.65,0,.35,1)',\n linear: 'linear',\n} as const;\n\nexport const SPARK_COUNT = 12;\nexport const SPARK_GROUPS = 4;\nexport const FADE_IN = 'from{opacity:0}to{opacity:1}';\n\nconst PERCENT = 100;\nconst START_SHARE = 1.5;\nconst n = (v: number): string => String(Number(v.toFixed(2)));\n\nconst travel = (width: number): string => `translateX(${n(((1 + 2 * width) / width) * PERCENT)}%)`;\nconst bandRest = (width: number, opacity: number): string => `left:${n(-START_SHARE * width * PERCENT)}%;width:${n(width * PERCENT)}%;opacity:${n(opacity)}`;\n\n/** Returns a band of light that crosses the logo once; width is a share of the logo width. */\nexport function sweep(layer: RasterLayer, band: { width: number; opacity: number }, ms: number, delayMs: number): RasterAnim {\n const frames = `from{transform:translateX(0)}to{transform:${travel(band.width)}}`;\n return { layer, frames, ms, delayMs, ease: RASTER_EASE.inOut, rest: bandRest(band.width, band.opacity) };\n}\n\n/** Returns a looping band that rests, crosses the logo between two percent stops of the period, then rests again. */\nexport function drift(layer: RasterLayer, band: { width: number; opacity: number }, periodMs: number, stops: readonly [number, number]): RasterAnim {\n const to = travel(band.width);\n const frames = `0%{transform:translateX(0)}${stops[0]}%{transform:translateX(0);animation-timing-function:${RASTER_EASE.inOut}}${stops[1]}%{transform:${to}}100%{transform:${to}}`;\n return { layer, frames, ms: periodMs, ease: RASTER_EASE.linear, loop: true, rest: bandRest(band.width, band.opacity) };\n}\n\n/** Returns a looping swell: the declaration at rest at both ends, the peak at half the period. */\nexport function swell(layer: RasterLayer, rest: string, peak: string, periodMs: number): RasterAnim {\n const ease = `animation-timing-function:${RASTER_EASE.inOut}`;\n return { layer, frames: `0%,100%{${rest};${ease}}50%{${peak};${ease}}`, ms: periodMs, ease: RASTER_EASE.linear, loop: true };\n}\n\n/** Returns when the animation's last run ends, in ms, counting the spark stagger. */\nexport function animEndMs(anim: RasterAnim): number {\n return (anim.delayMs ?? 0) + (anim.stepMs ?? 0) * (SPARK_GROUPS - 1) + anim.ms;\n}\n","import { RASTER_PREFIX } from './rasterBaseCss';\r\nimport { RasterLayer } from './RasterLayer';\r\nimport { SPARK_COUNT, SPARK_GROUPS } from './rasterSpec';\r\n\r\nexport interface RasterMarkupOptions {\r\n prefix?: string;\r\n width?: string;\r\n}\r\n\r\nconst PERCENT = 100;\r\nconst HEX = 16;\r\nconst SPARK_TURN = 0.3;\r\nconst SPARK_NEAR = 0.48;\r\nconst SPARK_FAR = 0.62;\r\nconst SPARK_HEIGHT = 1.25;\r\nconst BANDS = [RasterLayer.S0, RasterLayer.S1, RasterLayer.I0, RasterLayer.I1, RasterLayer.M0];\r\n\r\nconst attr = (v: string): string => v.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\r\nconst cssUrl = (v: string): string => v.replace(/[\"'()\\\\\\s]/g, (c) => `%${c.charCodeAt(0).toString(HEX).toUpperCase().padStart(2, '0')}`);\r\nconst n = (v: number): string => String(Number(v.toFixed(1)));\r\n\r\nfunction sparks(p: string): string {\r\n return Array.from({ length: SPARK_COUNT }, (_, i) => {\r\n const a = (i / SPARK_COUNT) * Math.PI * 2 + SPARK_TURN;\r\n const r = i % 2 ? SPARK_FAR : SPARK_NEAR;\r\n const style = `--dx:${n(Math.cos(a) * r * PERCENT)}%;--dy:${n(Math.sin(a) * SPARK_HEIGHT * PERCENT)}%;--k:${i % SPARK_GROUPS}`;\r\n return `<span class=\"${p}-${RasterLayer.Spark}\" style=\"${style}\"></span>`;\r\n }).join('');\r\n}\r\n\r\n/** Returns the HTML of a raster logo with every motion layer; all overlays stay hidden until a play class is set. */\r\nexport function rasterMarkup(src: string, alt: string, options: RasterMarkupOptions = {}): string {\r\n const p = options.prefix ?? RASTER_PREFIX;\r\n const size = options.width !== undefined ? `;width:${options.width}` : '';\r\n const band = (k: RasterLayer): string => `<span class=\"${p}-band ${p}-${k}\"></span>`;\r\n const glow = (k: RasterLayer): string => `<span class=\"${p}-fx ${p}-${k}\"><span class=\"${p}-tint\"></span></span>`;\r\n const img = `<span class=\"${p}-${RasterLayer.Lift}\"><span class=\"${p}-${RasterLayer.Nod}\"><span class=\"${p}-${RasterLayer.In}\"><img class=\"${p}-${RasterLayer.Img}\" src=\"${attr(src)}\" alt=\"${attr(alt)}\"></span></span></span>`;\r\n const burst = `<span class=\"${p}-fx\"><span class=\"${p}-${RasterLayer.Ring}\"></span><span class=\"${p}-${RasterLayer.Rays}\"></span>${sparks(p)}</span>`;\r\n const sheen = `<span class=\"${p}-fx ${p}-sheen\">${BANDS.map(band).join('')}</span>`;\r\n const host = attr(`--${p}-src:url(\"${cssUrl(src)}\")${size}`);\r\n return `<span class=\"${p}\" style=\"${host}\">${glow(RasterLayer.Glow)}${glow(RasterLayer.Haze)}${burst}<span class=\"${p}-${RasterLayer.Shadow}\"></span>${img}${sheen}<span class=\"${p}-${RasterLayer.Line}\"></span></span>`;\r\n}\r\n","import { RasterIntro } from './RasterIntro';\nimport { RasterLayer } from './RasterLayer';\nimport { FADE_IN, RASTER_EASE, sweep } from './rasterSpec';\nimport type { RasterSpec } from './rasterSpec';\n\nconst { out, spring, inOut } = RASTER_EASE;\nconst CENTRED = 'translate(-50%,-50%)';\nconst SPARK = '0%{opacity:0;transform:translate(0,0) scale(.4)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1)}';\n\nexport const RASTER_INTRO_SPECS: Readonly<Record<string, RasterSpec>> = {\n [RasterIntro.FadeUp]: { anims: [{ layer: RasterLayer.Img, frames: 'from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}', ms: 600, ease: out }] },\n [RasterIntro.ScaleSettle]: { anims: [{ layer: RasterLayer.Img, frames: 'from{opacity:0;transform:scale(.9)}to{opacity:1;transform:none}', ms: 700, ease: spring }] },\n [RasterIntro.MaskWipe]: { anims: [{ layer: RasterLayer.Img, frames: 'from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}', ms: 800, ease: inOut }] },\n [RasterIntro.LightSweep]: {\n anims: [{ layer: RasterLayer.Img, frames: FADE_IN, ms: 350, ease: out }, sweep(RasterLayer.S0, { width: 0.35, opacity: 0.9 }, 750, 350)],\n },\n [RasterIntro.FocusIn]: { anims: [{ layer: RasterLayer.Img, frames: 'from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}', ms: 700, ease: out }] },\n [RasterIntro.GlowSweep]: {\n anims: [\n { layer: RasterLayer.Img, frames: FADE_IN, ms: 300, ease: out },\n { layer: RasterLayer.Glow, frames: '0%,100%{opacity:0}55%{opacity:.85}', ms: 800, delayMs: 300, ease: inOut },\n { layer: RasterLayer.In, frames: '0%,100%{transform:none}55%{transform:scale(1.025)}', ms: 800, delayMs: 300, ease: inOut },\n sweep(RasterLayer.S0, { width: 0.55, opacity: 1 }, 700, 300),\n ],\n },\n [RasterIntro.PunchSweep]: {\n anims: [\n { layer: RasterLayer.In, frames: '0%{opacity:0;transform:scale(.6)}55%{opacity:1;transform:scale(1.08)}78%{transform:scale(.98)}100%{opacity:1;transform:none}', ms: 600, ease: out },\n sweep(RasterLayer.S0, { width: 0.4, opacity: 0.95 }, 520, 600),\n ],\n },\n [RasterIntro.DoubleSweep]: {\n anims: [\n { layer: RasterLayer.Img, frames: FADE_IN, ms: 260, ease: out },\n sweep(RasterLayer.S0, { width: 0.13, opacity: 1 }, 330, 220),\n sweep(RasterLayer.S1, { width: 0.6, opacity: 0.95 }, 580, 560),\n ],\n },\n [RasterIntro.BurstSettle]: {\n anims: [\n { layer: RasterLayer.In, frames: '0%{opacity:0;transform:scale(1.25)}100%{opacity:1;transform:none}', ms: 650, ease: spring },\n { layer: RasterLayer.Ring, frames: `0%{opacity:.9;transform:${CENTRED} scale(.3)}100%{opacity:0;transform:${CENTRED} scale(2.1)}`, ms: 650, delayMs: 60, ease: out },\n { layer: RasterLayer.Rays, frames: `0%{opacity:0;transform:${CENTRED} scale(.4)}25%{opacity:.75}100%{opacity:0;transform:${CENTRED} scale(1.25)}`, ms: 600, delayMs: 40, ease: out },\n { layer: RasterLayer.Spark, frames: SPARK, ms: 720, delayMs: 120, stepMs: 40, ease: out },\n sweep(RasterLayer.S0, { width: 0.4, opacity: 0.95 }, 480, 660),\n ],\n },\n [RasterIntro.TiltSweep]: {\n anims: [\n { layer: RasterLayer.In, frames: '0%{opacity:0;transform:translateY(10px) scaleX(.2) skewY(-16deg)}45%{opacity:1}65%{transform:scaleX(1.05) skewY(2deg)}100%{opacity:1;transform:none}', ms: 620, ease: out },\n { layer: RasterLayer.Shadow, frames: '0%{opacity:0;transform:scaleX(.3)}60%{opacity:.22;transform:scaleX(1.1)}100%{opacity:0;transform:none}', ms: 900, ease: out },\n sweep(RasterLayer.S0, { width: 0.45, opacity: 0.95 }, 520, 620),\n ],\n },\n};\n","import { RasterIdle } from './RasterIdle';\nimport { RasterLayer } from './RasterLayer';\nimport { RasterMicro } from './RasterMicro';\nimport { drift, RASTER_EASE, sweep, swell } from './rasterSpec';\nimport type { RasterSpec } from './rasterSpec';\n\nconst { out } = RASTER_EASE;\n\nexport const RASTER_MICRO_SPECS: Readonly<Record<string, RasterSpec>> = {\n [RasterMicro.Pulse]: { anims: [{ layer: RasterLayer.Nod, frames: '0%,100%{transform:none}45%{transform:scale(1.04)}', ms: 240, ease: out }] },\n [RasterMicro.Glint]: { anims: [sweep(RasterLayer.M0, { width: 0.35, opacity: 0.9 }, 280, 0)] },\n [RasterMicro.Nudge]: { anims: [{ layer: RasterLayer.Nod, frames: '0%,100%{transform:none}45%{transform:translateY(-4px)}', ms: 200, ease: out }] },\n [RasterMicro.UnderlineDraw]: { anims: [{ layer: RasterLayer.Line, frames: 'from{transform:scaleX(0)}to{transform:scaleX(1)}', ms: 260, ease: out }] },\n};\n\nexport const RASTER_IDLE_SPECS: Readonly<Record<string, RasterSpec>> = {\n [RasterIdle.SlowGlint]: { periodMs: 7000, anims: [drift(RasterLayer.I0, { width: 0.17, opacity: 0.85 }, 7000, [0, 11])] },\n [RasterIdle.GlowBreathe]: { periodMs: 6000, anims: [swell(RasterLayer.Haze, 'opacity:0', 'opacity:.3', 6000)] },\n [RasterIdle.SheenDrift]: { periodMs: 8000, anims: [drift(RasterLayer.I0, { width: 0.8, opacity: 0.35 }, 8000, [0, 45])] },\n [RasterIdle.SoftLift]: {\n periodMs: 6500,\n anims: [swell(RasterLayer.Lift, 'transform:none', 'transform:scale(1.018)', 6500), swell(RasterLayer.Haze, 'opacity:0', 'opacity:.14', 6500)],\n },\n [RasterIdle.TwinShimmer]: {\n periodMs: 8000,\n anims: [drift(RasterLayer.I0, { width: 0.11, opacity: 0.7 }, 8000, [0, 8]), drift(RasterLayer.I1, { width: 0.11, opacity: 0.7 }, 8000, [4, 12])],\n },\n};\n","import { RasterPhase } from './RasterPhase';\nimport { RASTER_PREFIX, rasterBaseCss } from './rasterBaseCss';\nimport type { RasterOptions } from './rasterBaseCss';\nimport { RASTER_INTRO_SPECS } from './rasterIntros';\nimport { RASTER_IDLE_SPECS, RASTER_MICRO_SPECS } from './rasterLoops';\nimport { animEndMs } from './rasterSpec';\nimport type { RasterAnim, RasterSpec } from './rasterSpec';\n\nexport interface RasterPreset {\n name: string;\n phase: RasterPhase;\n durationMs: number;\n periodMs?: number;\n css: string;\n}\n\nexport interface RasterSelection {\n intro?: string;\n micro?: string;\n idle?: string;\n}\n\nexport interface RasterMotion {\n css: string;\n introMs: number;\n microMs: number;\n periodMs: number;\n unknown: string[];\n}\n\ninterface Scope {\n p: string;\n id: string;\n phase: RasterPhase;\n idleStartMs: number;\n}\n\nfunction animCss(a: RasterAnim, i: number, s: Scope): string {\n const name = `${s.p}-${s.id}-${i}`;\n const delay = a.loop ? s.idleStartMs : a.delayMs ?? 0;\n const stagger = a.stepMs ? `;animation-delay:calc(${delay}ms + var(--k) * ${a.stepMs}ms)` : '';\n const play = `.${s.p}.${s.p}-play-${s.phase} .${s.p}-${a.layer}{animation:${name} ${a.ms}ms ${a.ease} ${delay}ms ${a.loop ? 'infinite' : '1'} both${stagger}}`;\n const rest = a.rest ? `.${s.p} .${s.p}-${a.layer}{${a.rest}}` : '';\n return `@keyframes ${name}{${a.frames}}${play}${rest}`;\n}\n\nfunction build(spec: RasterSpec, name: string, phase: RasterPhase, options: RasterOptions): RasterPreset {\n const scope: Scope = { p: options.prefix ?? RASTER_PREFIX, id: `${phase}-${name}`, phase, idleStartMs: options.idleStartMs ?? 0 };\n const css = spec.anims.map((a, i) => animCss(a, i, scope)).join('');\n const durationMs = spec.periodMs ?? Math.max(...spec.anims.map(animEndMs));\n return { name, phase, durationMs, periodMs: spec.periodMs, css };\n}\n\nconst pick = (table: Readonly<Record<string, RasterSpec>>, name: string, phase: RasterPhase, options: RasterOptions): RasterPreset | null => {\n const spec = table[name];\n return spec ? build(spec, name, phase, options) : null;\n};\n\n/** Returns the CSS of a raster intro, played while the host has `<prefix>-play-intro`, or null for an unknown name. */\nexport function rasterIntro(name: string, options: RasterOptions = {}): RasterPreset | null {\n return pick(RASTER_INTRO_SPECS, name, RasterPhase.Intro, options);\n}\n\n/** Returns the CSS of a raster micro, played while the host has `<prefix>-play-micro`, or null for an unknown name. */\nexport function rasterMicro(name: string, options: RasterOptions = {}): RasterPreset | null {\n return pick(RASTER_MICRO_SPECS, name, RasterPhase.Micro, options);\n}\n\n/** Returns the CSS of a raster idle loop, run while the host has `<prefix>-play-idle`, or null for an unknown name. */\nexport function rasterIdle(name: string, options: RasterOptions = {}): RasterPreset | null {\n return pick(RASTER_IDLE_SPECS, name, RasterPhase.Idle, options);\n}\n\nconst unknownNames = (pairs: readonly [string | undefined, RasterPreset | null][]): string[] =>\n pairs.flatMap(([asked, found]) => (asked !== undefined && found === null ? [asked] : []));\n\n/** Returns one stylesheet for the chosen presets; the idle loop starts when the intro ends unless idleStartMs is set. */\nexport function rasterMotion(selection: RasterSelection, options: RasterOptions = {}): RasterMotion {\n const intro = selection.intro !== undefined ? rasterIntro(selection.intro, options) : null;\n const micro = selection.micro !== undefined ? rasterMicro(selection.micro, options) : null;\n const idleStartMs = options.idleStartMs ?? intro?.durationMs ?? 0;\n const idle = selection.idle !== undefined ? rasterIdle(selection.idle, { ...options, idleStartMs }) : null;\n const unknown = unknownNames([[selection.intro, intro], [selection.micro, micro], [selection.idle, idle]]);\n const css = rasterBaseCss(options) + [intro, micro, idle].map((x) => x?.css ?? '').join('');\n return { css, introMs: intro?.durationMs ?? 0, microMs: micro?.durationMs ?? 0, periodMs: idle?.periodMs ?? 0, unknown };\n}\n","import type { MotionBeat, MotionConfig } from '../core/types';\nimport { MotionPreset } from './MotionPreset';\n\nexport const INTRO_CAP_MS = 1200;\nexport const MICRO_CAP_MS = 300;\nexport const EASE = 'cubic-bezier(0.2,0,0,1)';\nexport const EASE_IN_FIRST = 'cubic-bezier(0,0,0,1)';\nexport const MARK_TARGET = '@mark';\n\nconst SPREAD_BEAT: MotionBeat = { preset: MotionPreset.Spread, durationMs: 300, distance: 1.6 };\n\n/** Default beat for each preset, timed so a four-layer mark stays inside the intro and micro caps. */\nexport const PRESET_DEFAULTS: Readonly<Partial<Record<MotionPreset, MotionBeat>>> = {\n [MotionPreset.Draw]: { preset: MotionPreset.Draw, durationMs: 700, stepMs: 120 },\n [MotionPreset.Flood]: { preset: MotionPreset.Flood, durationMs: 500, delayMs: 300, stepMs: 80 },\n [MotionPreset.StaggerRise]: { preset: MotionPreset.StaggerRise, durationMs: 600, stepMs: 150, distance: 4 },\n [MotionPreset.ScalePop]: { preset: MotionPreset.ScalePop, durationMs: 500, stepMs: 120 },\n [MotionPreset.Orbit]: { preset: MotionPreset.Orbit, durationMs: 800, stepMs: 100 },\n [MotionPreset.Wipe]: { preset: MotionPreset.Wipe, durationMs: 700, stepMs: 120 },\n [MotionPreset.MorphFromCircle]: { preset: MotionPreset.MorphFromCircle, durationMs: 1200, stops: [0, 40, 100] },\n [MotionPreset.Sweep]: { preset: MotionPreset.Sweep, durationMs: 600, delayMs: 400, stepMs: 60, share: 0.12, width: 2 },\n [MotionPreset.Pulse]: { preset: MotionPreset.Pulse, durationMs: 400, delayMs: 700, layers: [MARK_TARGET], scale: 1.07 },\n [MotionPreset.Spread]: SPREAD_BEAT,\n [MotionPreset.FlyIn]: { preset: MotionPreset.FlyIn, durationMs: 700, stepMs: 120 },\n [MotionPreset.SpinAssemble]: { preset: MotionPreset.SpinAssemble, durationMs: 800, stepMs: 100 },\n [MotionPreset.DropBounce]: { preset: MotionPreset.DropBounce, durationMs: 800, stepMs: 100 },\n [MotionPreset.Flip]: { preset: MotionPreset.Flip, durationMs: 700, stepMs: 120 },\n [MotionPreset.SlamShake]: { preset: MotionPreset.SlamShake, durationMs: 800, layers: [MARK_TARGET] },\n};\n\n/** Default hover beat for each micro preset, timed inside the 300 ms micro cap. */\nexport const MICRO_DEFAULTS: Readonly<Partial<Record<MotionPreset, MotionBeat>>> = {\n [MotionPreset.Spread]: SPREAD_BEAT,\n [MotionPreset.Pulse]: { preset: MotionPreset.Pulse, durationMs: 300, layers: [MARK_TARGET], scale: 1.04 },\n [MotionPreset.Sweep]: { preset: MotionPreset.Sweep, durationMs: 300, share: 0.2, width: 1.5, colour: 'text' },\n};\n\nexport const DEFAULT_MOTION_CONFIG: MotionConfig = {\n intro: [{ preset: MotionPreset.StaggerRise, durationMs: 600, stepMs: 150, distance: 4 }],\n micro: [{ preset: MotionPreset.Spread, durationMs: 300, distance: 1.6, easing: EASE }],\n};\n","import { MICRO_CAP_MS } from '../motion/defaults';\nimport { RASTER_PREFIX } from '../motion/raster/rasterBaseCss';\n\nexport interface RasterHost {\n classList: { add(name: string): void; remove(name: string): void };\n offsetWidth?: number;\n}\n\nexport interface RasterRunOptions {\n prefix?: string;\n intro?: boolean;\n idle?: boolean;\n microMs?: number;\n}\n\nexport interface RasterControls {\n micro(): void;\n stop(): void;\n}\n\ninterface BrowserGlobals {\n document?: {\n hidden?: boolean;\n addEventListener?(type: string, fn: () => void): void;\n removeEventListener?(type: string, fn: () => void): void;\n };\n matchMedia?: (query: string) => { matches: boolean };\n}\n\nconst REDUCED_QUERY = '(prefers-reduced-motion: reduce)';\nconst VISIBILITY = 'visibilitychange';\nconst NOOP: RasterControls = { micro: (): void => undefined, stop: (): void => undefined };\n\nconst browser = (): BrowserGlobals => globalThis as BrowserGlobals;\nconst restart = (host: RasterHost): number => host.offsetWidth ?? 0;\n\n/** Plays the raster intro and idle on the host, pauses them while the tab is hidden, and returns micro() and stop(). */\nexport function startRasterMotion(host: RasterHost, options: RasterRunOptions = {}): RasterControls {\n if (browser().matchMedia?.(REDUCED_QUERY).matches === true) {\n return NOOP;\n }\n const p = options.prefix ?? RASTER_PREFIX;\n const microClass = `${p}-play-micro`;\n const microMs = Math.min(options.microMs ?? MICRO_CAP_MS, MICRO_CAP_MS);\n const played = [options.intro !== false ? `${p}-play-intro` : '', options.idle === true ? `${p}-play-idle` : ''].filter((c) => c !== '');\n let timer: ReturnType<typeof setTimeout> | undefined;\n const sync = (): void => {\n if (browser().document?.hidden === true) {\n host.classList.add(`${p}-paused`);\n } else {\n host.classList.remove(`${p}-paused`);\n }\n };\n played.forEach((c) => host.classList.add(c));\n sync();\n browser().document?.addEventListener?.(VISIBILITY, sync);\n const micro = (): void => {\n clearTimeout(timer);\n host.classList.remove(microClass);\n restart(host);\n host.classList.add(microClass);\n timer = setTimeout(() => host.classList.remove(microClass), microMs);\n };\n const stop = (): void => {\n clearTimeout(timer);\n browser().document?.removeEventListener?.(VISIBILITY, sync);\n [...played, microClass, `${p}-paused`].forEach((c) => host.classList.remove(c));\n };\n return { micro, stop };\n}\n","import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\nimport type { ReactElement, RefObject } from 'react';\nimport { Image, Platform, StyleSheet, View } from 'react-native';\n\nimport { rasterMarkup } from '../motion/raster/rasterMarkup';\nimport { rasterMotion } from '../motion/raster/rasterPresets';\nimport { startRasterMotion } from '../runtime/startRasterMotion';\nimport type { RasterControls } from '../runtime/startRasterMotion';\n\nexport interface MotionLogoProps {\n src: string;\n label: string;\n hint?: string;\n intro?: string;\n micro?: string;\n idle?: string;\n glowColour?: string;\n bandColour?: string;\n width?: number;\n aspectRatio?: number;\n testID?: string;\n}\n\nexport interface MotionLogoHandle {\n micro: () => void;\n}\n\nconst WEB = 'web';\nconst STILL_SUFFIX = '-still';\nconst FULL_WIDTH = '100%';\n\nconst styles = StyleSheet.create({\n frame: { alignSelf: 'center' },\n still: { height: FULL_WIDTH, width: FULL_WIDTH },\n});\n\nconst isElement = (node: unknown): node is HTMLElement => typeof HTMLElement !== 'undefined' && node instanceof HTMLElement;\n\nfunction useRasterMotion(hostRef: RefObject<unknown>, props: MotionLogoProps, isWeb: boolean): RefObject<RasterControls | null> {\n const controls = useRef<RasterControls | null>(null);\n const { src, label, intro, micro, idle, glowColour, bandColour } = props;\n useEffect(() => {\n const node = hostRef.current;\n if (!isWeb || !isElement(node)) {\n return undefined;\n }\n const motion = rasterMotion({ intro, micro, idle }, { glowColour, bandColour });\n node.innerHTML = `<style>${motion.css}</style>${rasterMarkup(src, label, { width: FULL_WIDTH })}`;\n const host = node.lastElementChild;\n if (host === null) {\n return undefined;\n }\n controls.current = startRasterMotion(host, { intro: intro !== undefined, idle: idle !== undefined, microMs: motion.microMs });\n return (): void => {\n controls.current?.stop();\n controls.current = null;\n };\n }, [hostRef, isWeb, src, label, intro, micro, idle, glowColour, bandColour]);\n return controls;\n}\n\nexport const MotionLogo = forwardRef<MotionLogoHandle, MotionLogoProps>((props, ref): ReactElement => {\n const hostRef = useRef<unknown>(null);\n const isWeb = Platform.OS === WEB;\n const controls = useRasterMotion(hostRef, props, isWeb);\n useImperativeHandle(ref, () => ({ micro: (): void => controls.current?.micro() }), [controls]);\n const size = { aspectRatio: props.aspectRatio, width: props.width };\n const stillTestID = props.testID !== undefined ? `${props.testID}${STILL_SUFFIX}` : undefined;\n\n return (\n <View\n ref={hostRef}\n accessibilityHint={props.hint}\n accessibilityLabel={props.label}\n accessibilityRole=\"image\"\n style={[styles.frame, size]}\n testID={props.testID}\n >\n {isWeb ? null : (\n <Image accessibilityIgnoresInvertColors resizeMode=\"contain\" source={{ uri: props.src }} style={styles.still} testID={stillTestID} />\n )}\n </View>\n );\n});\n\nMotionLogo.displayName = 'MotionLogo';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dloizides/logo-kit",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Logo generator for every brand: seeded mark variants, small-size, contrast, CVD and sensitive-symbol checks, motion presets by layer name, palette variants from design tokens, and the full export set from one brand.json. No network, no LLM.",
5
5
  "keywords": [
6
6
  "brand",
@@ -8,7 +8,8 @@
8
8
  "svg",
9
9
  "motion",
10
10
  "favicon",
11
- "generator"
11
+ "generator",
12
+ "react"
12
13
  ],
13
14
  "author": "dloizides",
14
15
  "license": "MIT",
@@ -34,6 +35,10 @@
34
35
  "./runtime": {
35
36
  "types": "./dist/runtime.d.ts",
36
37
  "default": "./dist/runtime.js"
38
+ },
39
+ "./react": {
40
+ "types": "./dist/react.d.ts",
41
+ "default": "./dist/react.js"
37
42
  }
38
43
  },
39
44
  "files": [
@@ -48,8 +53,8 @@
48
53
  "scripts": {
49
54
  "build": "rimraf dist && tsup",
50
55
  "test": "vitest run",
51
- "lint": "eslint src --ext .ts --max-warnings 0",
52
- "lint:fix": "eslint src --ext .ts --fix",
56
+ "lint": "eslint src --ext .ts,.tsx --max-warnings 0",
57
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
53
58
  "typecheck": "tsc --noEmit",
54
59
  "clean": "rimraf dist",
55
60
  "security:audit": "npm audit --audit-level=high",
@@ -61,14 +66,33 @@
61
66
  "@resvg/resvg-js": "^2.6.2"
62
67
  },
63
68
  "devDependencies": {
69
+ "@testing-library/dom": "^10.4.0",
70
+ "@testing-library/react": "^16.3.0",
64
71
  "@types/node": "^20.19.43",
72
+ "@types/react": "^19.1.0",
65
73
  "@typescript-eslint/eslint-plugin": "^7.18.0",
66
74
  "@typescript-eslint/parser": "^7.18.0",
67
75
  "eslint": "^8.57.1",
68
76
  "eslint-plugin-sonarjs": "^3.0.7",
77
+ "jsdom": "^25.0.1",
78
+ "react": "^19.1.0",
79
+ "react-dom": "^19.1.0",
80
+ "react-native-web": "^0.21.0",
69
81
  "rimraf": "^5.0.10",
70
82
  "tsup": "^8.5.1",
71
83
  "typescript": "^5.9.3",
72
84
  "vitest": "^2.1.9"
85
+ },
86
+ "peerDependencies": {
87
+ "react": ">=18.0.0",
88
+ "react-native": ">=0.72.0"
89
+ },
90
+ "peerDependenciesMeta": {
91
+ "react": {
92
+ "optional": true
93
+ },
94
+ "react-native": {
95
+ "optional": true
96
+ }
73
97
  }
74
98
  }