@dloizides/logo-kit 0.4.1 → 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 +11 -0
- package/README.md +9 -0
- package/dist/BrandRuntime-ClVG95wc.d.ts +84 -0
- package/dist/index.d.ts +36 -3
- package/dist/index.js +366 -115
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +21 -0
- package/dist/react.js +296 -0
- package/dist/react.js.map +1 -0
- package/dist/runtime.d.ts +23 -3
- package/dist/runtime.js +237 -1
- package/dist/runtime.js.map +1 -1
- package/package.json +28 -4
- package/dist/BrandRuntime-vxA8ddzp.d.ts +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
8
|
+
## 0.5.0
|
|
9
|
+
|
|
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).
|
|
11
|
+
- `rasterMarkup(src, alt)` writes the layered HTML; `rasterMotion({ intro, micro, idle }, { glowColour, bandColour })` writes one stylesheet (the idle loop starts when the intro ends) and lists unknown names; `rasterIntro` / `rasterMicro` / `rasterIdle` give one preset with its timing.
|
|
12
|
+
- Runtime `startRasterMotion(host, { idle: true })` plays the intro and idle, pauses them while the tab is hidden, returns `micro()` (capped at 300 ms) and `stop()`. Under `prefers-reduced-motion: reduce` it sets nothing and the CSS holds the finished still.
|
|
13
|
+
|
|
3
14
|
## 0.4.1
|
|
4
15
|
|
|
5
16
|
- `MountOptions.mode` is typed as the `Mode` const enum.
|
package/README.md
CHANGED
|
@@ -13,6 +13,15 @@ Motion presets: draw, flood, stagger-rise, scale-pop, orbit, wipe, morph-from-ci
|
|
|
13
13
|
|
|
14
14
|
Examples (made-up brands): `examples/quillo/brand.json`, `examples/tarn/brand.json`.
|
|
15
15
|
|
|
16
|
+
## Raster logos
|
|
17
|
+
|
|
18
|
+
For a logo that exists only as an image (PNG, WebP), motion acts on the whole image. Colours come in as options (pass design-token values); nothing brand-specific is in the package.
|
|
19
|
+
|
|
20
|
+
- `rasterMarkup(src, alt, { width })` returns the layered HTML; `rasterMotion({ intro, micro, idle }, { glowColour, bandColour })` returns `{ css, introMs, microMs, periodMs, unknown }`.
|
|
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
|
+
- 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.
|
|
24
|
+
|
|
16
25
|
## Brand runtime
|
|
17
26
|
|
|
18
27
|
A brand's `brand.json` lives in its owner's private repo; this package holds only generic code.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
declare const enum Mode {
|
|
2
|
+
Light = "light",
|
|
3
|
+
Dark = "dark"
|
|
4
|
+
}
|
|
5
|
+
declare const MODES: readonly Mode[];
|
|
6
|
+
|
|
7
|
+
declare const enum RasterPhase {
|
|
8
|
+
Intro = "intro",
|
|
9
|
+
Micro = "micro",
|
|
10
|
+
Idle = "idle"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface RasterOptions {
|
|
14
|
+
prefix?: string;
|
|
15
|
+
glowColour?: string;
|
|
16
|
+
bandColour?: string;
|
|
17
|
+
shadowColour?: string;
|
|
18
|
+
idleStartMs?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const RASTER_PREFIX = "lkr";
|
|
21
|
+
/** Returns the still layout of the raster logo layers, the hidden-tab pause and the reduced-motion rule. */
|
|
22
|
+
declare function rasterBaseCss(options?: RasterOptions): string;
|
|
23
|
+
|
|
24
|
+
interface RasterPreset {
|
|
25
|
+
name: string;
|
|
26
|
+
phase: RasterPhase;
|
|
27
|
+
durationMs: number;
|
|
28
|
+
periodMs?: number;
|
|
29
|
+
css: string;
|
|
30
|
+
}
|
|
31
|
+
interface RasterSelection {
|
|
32
|
+
intro?: string;
|
|
33
|
+
micro?: string;
|
|
34
|
+
idle?: string;
|
|
35
|
+
}
|
|
36
|
+
interface RasterMotion {
|
|
37
|
+
css: string;
|
|
38
|
+
introMs: number;
|
|
39
|
+
microMs: number;
|
|
40
|
+
periodMs: number;
|
|
41
|
+
unknown: string[];
|
|
42
|
+
}
|
|
43
|
+
/** Returns the CSS of a raster intro, played while the host has `<prefix>-play-intro`, or null for an unknown name. */
|
|
44
|
+
declare function rasterIntro(name: string, options?: RasterOptions): RasterPreset | null;
|
|
45
|
+
/** Returns the CSS of a raster micro, played while the host has `<prefix>-play-micro`, or null for an unknown name. */
|
|
46
|
+
declare function rasterMicro(name: string, options?: RasterOptions): RasterPreset | null;
|
|
47
|
+
/** Returns the CSS of a raster idle loop, run while the host has `<prefix>-play-idle`, or null for an unknown name. */
|
|
48
|
+
declare function rasterIdle(name: string, options?: RasterOptions): RasterPreset | null;
|
|
49
|
+
/** Returns one stylesheet for the chosen presets; the idle loop starts when the intro ends unless idleStartMs is set. */
|
|
50
|
+
declare function rasterMotion(selection: RasterSelection, options?: RasterOptions): RasterMotion;
|
|
51
|
+
|
|
52
|
+
interface RasterMarkupOptions {
|
|
53
|
+
prefix?: string;
|
|
54
|
+
width?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Returns the HTML of a raster logo with every motion layer; all overlays stay hidden until a play class is set. */
|
|
57
|
+
declare function rasterMarkup(src: string, alt: string, options?: RasterMarkupOptions): string;
|
|
58
|
+
|
|
59
|
+
interface BrandModeRuntime {
|
|
60
|
+
intro: string;
|
|
61
|
+
still: string;
|
|
62
|
+
}
|
|
63
|
+
interface BrandWordmarkRuntime {
|
|
64
|
+
recipe: string;
|
|
65
|
+
html: string;
|
|
66
|
+
css: string;
|
|
67
|
+
}
|
|
68
|
+
interface BrandIdleRuntime {
|
|
69
|
+
className: string;
|
|
70
|
+
durationMs: number;
|
|
71
|
+
css: string;
|
|
72
|
+
}
|
|
73
|
+
/** A brand's resolved logo markup, passed to mountBrand. */
|
|
74
|
+
interface BrandRuntime {
|
|
75
|
+
name: string;
|
|
76
|
+
slug: string;
|
|
77
|
+
light: BrandModeRuntime;
|
|
78
|
+
dark: BrandModeRuntime;
|
|
79
|
+
wordmark: BrandWordmarkRuntime | null;
|
|
80
|
+
idle: BrandIdleRuntime | null;
|
|
81
|
+
limits: string[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { type BrandRuntime as B, Mode as M, RASTER_PREFIX as R, type BrandIdleRuntime as a, type BrandModeRuntime as b, type BrandWordmarkRuntime as c, MODES as d, type RasterMarkupOptions as e, type RasterMotion as f, type RasterOptions as g, RasterPhase as h, type RasterPreset as i, type RasterSelection as j, rasterIdle as k, rasterIntro as l, rasterMarkup as m, rasterMicro as n, rasterMotion as o, rasterBaseCss as r };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Mode, B as BrandRuntime } from './BrandRuntime-
|
|
2
|
-
export { a as BrandIdleRuntime, b as BrandModeRuntime, c as BrandWordmarkRuntime, d as MODES } from './BrandRuntime-
|
|
1
|
+
import { M as Mode, B as BrandRuntime } from './BrandRuntime-ClVG95wc.js';
|
|
2
|
+
export { a as BrandIdleRuntime, b as BrandModeRuntime, c as BrandWordmarkRuntime, d as MODES, R as RASTER_PREFIX, e as RasterMarkupOptions, f as RasterMotion, g as RasterOptions, h as RasterPhase, i as RasterPreset, j as RasterSelection, r as rasterBaseCss, k as rasterIdle, l as rasterIntro, m as rasterMarkup, n as rasterMicro, o as rasterMotion } from './BrandRuntime-ClVG95wc.js';
|
|
3
3
|
|
|
4
4
|
declare const enum MotionPreset {
|
|
5
5
|
Draw = "draw",
|
|
@@ -394,6 +394,39 @@ interface IdleMotion {
|
|
|
394
394
|
/** Returns the CSS and SVG overlay of an idle recipe, played while the trigger class is on, or null for an unknown name. */
|
|
395
395
|
declare function idleRecipe(name: string, ctx: IdleContext): IdleMotion | null;
|
|
396
396
|
|
|
397
|
+
declare const enum RasterIntro {
|
|
398
|
+
FadeUp = "fade-up",
|
|
399
|
+
ScaleSettle = "scale-settle",
|
|
400
|
+
MaskWipe = "mask-wipe",
|
|
401
|
+
LightSweep = "light-sweep",
|
|
402
|
+
FocusIn = "focus-in",
|
|
403
|
+
GlowSweep = "glow-sweep",
|
|
404
|
+
PunchSweep = "punch-sweep",
|
|
405
|
+
DoubleSweep = "double-sweep",
|
|
406
|
+
BurstSettle = "burst-settle",
|
|
407
|
+
TiltSweep = "tilt-sweep"
|
|
408
|
+
}
|
|
409
|
+
declare const RASTER_INTROS: readonly RasterIntro[];
|
|
410
|
+
|
|
411
|
+
declare const enum RasterMicro {
|
|
412
|
+
Pulse = "pulse",
|
|
413
|
+
Glint = "glint",
|
|
414
|
+
Nudge = "nudge",
|
|
415
|
+
UnderlineDraw = "underline-draw"
|
|
416
|
+
}
|
|
417
|
+
declare const RASTER_MICROS: readonly RasterMicro[];
|
|
418
|
+
|
|
419
|
+
declare const enum RasterIdle {
|
|
420
|
+
SlowGlint = "slow-glint",
|
|
421
|
+
GlowBreathe = "glow-breathe",
|
|
422
|
+
SheenDrift = "sheen-drift",
|
|
423
|
+
SoftLift = "soft-lift",
|
|
424
|
+
TwinShimmer = "twin-shimmer"
|
|
425
|
+
}
|
|
426
|
+
declare const RASTER_IDLES: readonly RasterIdle[];
|
|
427
|
+
declare const RASTER_LOOP_MIN_MS = 6000;
|
|
428
|
+
declare const RASTER_LOOP_MAX_MS = 8000;
|
|
429
|
+
|
|
397
430
|
interface MotionSvgOptions {
|
|
398
431
|
label: string;
|
|
399
432
|
size?: number;
|
|
@@ -489,4 +522,4 @@ declare function pullBrand(source: string, dest: string): string;
|
|
|
489
522
|
/** Returns why a pulled brand copy no longer matches its source (line endings ignored), or null when it matches. */
|
|
490
523
|
declare function brandCopyDrift(copy: string, source: string): BrandDrift | null;
|
|
491
524
|
|
|
492
|
-
export { type AnimationTiming, BOLD_PRESETS, type Bitmap, type Brand, type BrandDrift, BrandRuntime, CVD_KINDS, type CheckResult, type ChecksReport, CvdKind, type ExportedFile, IDLE_CAP_MS, IDLE_RECIPES, INTRO_CAP_MS, INTRO_PRESETS, INTRO_RECIPES, type IdleContext, type IdleMotion, type IdleMotionConfig, IdleRecipe, IntroRecipe, LOOKALIKE_THRESHOLD, type LayerPaint, MICRO_CAP_MS, MICRO_DEFAULTS, MICRO_PRESETS, MICRO_RECIPES, type Mark, type MarkLayer, MicroRecipe, Mode, type MotionBeat, type MotionConfig, MotionPreset, type MotionRoles, PRESET_DEFAULTS, PRIMITIVES, type PaintItem, type Palette, type PickSpec, type Pt, type RawMotion, type RecipeContext, SYMBOLS, type TimingMap, type Variant, WORDMARK_RECIPES, type WordmarkMotion, type WordmarkMotionConfig, type WordmarkOptions, WordmarkRecipe, alphaMask, animatedSvg, brandCopyDrift, buildPickPage, buildPickSpec, checkVariants, contrast, deltaE, exportBrand, fitBeat, flattenPath, generateVariants, generatorPalette, geometryModule, idleRecipe, introRecipe, introSvg, loadBrand, markSvg, microRecipe, microSvg, paletteVariants, parseBrand, parseTiming, pixelDiff, pngSize, primitiveMark, pullBrand, renderPng, renderSvg, resolveMotion, resolveRuntime, resolveToken, runChecks, runCli, schedule, simulateCvd, symbolMatches, symbolScores, totalMs, validateMotion, wordmarkReveal };
|
|
525
|
+
export { type AnimationTiming, BOLD_PRESETS, type Bitmap, type Brand, type BrandDrift, BrandRuntime, CVD_KINDS, type CheckResult, type ChecksReport, CvdKind, type ExportedFile, IDLE_CAP_MS, IDLE_RECIPES, INTRO_CAP_MS, INTRO_PRESETS, INTRO_RECIPES, type IdleContext, type IdleMotion, type IdleMotionConfig, IdleRecipe, IntroRecipe, LOOKALIKE_THRESHOLD, type LayerPaint, MICRO_CAP_MS, MICRO_DEFAULTS, MICRO_PRESETS, MICRO_RECIPES, type Mark, type MarkLayer, MicroRecipe, Mode, type MotionBeat, type MotionConfig, MotionPreset, type MotionRoles, PRESET_DEFAULTS, PRIMITIVES, type PaintItem, type Palette, type PickSpec, type Pt, RASTER_IDLES, RASTER_INTROS, RASTER_LOOP_MAX_MS, RASTER_LOOP_MIN_MS, RASTER_MICROS, RasterIdle, RasterIntro, RasterMicro, type RawMotion, type RecipeContext, SYMBOLS, type TimingMap, type Variant, WORDMARK_RECIPES, type WordmarkMotion, type WordmarkMotionConfig, type WordmarkOptions, WordmarkRecipe, alphaMask, animatedSvg, brandCopyDrift, buildPickPage, buildPickSpec, checkVariants, contrast, deltaE, exportBrand, fitBeat, flattenPath, generateVariants, generatorPalette, geometryModule, idleRecipe, introRecipe, introSvg, loadBrand, markSvg, microRecipe, microSvg, paletteVariants, parseBrand, parseTiming, pixelDiff, pngSize, primitiveMark, pullBrand, renderPng, renderSvg, resolveMotion, resolveRuntime, resolveToken, runChecks, runCli, schedule, simulateCvd, symbolMatches, symbolScores, totalMs, validateMotion, wordmarkReveal };
|