@dloizides/logo-kit 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,8 +8,14 @@ declare const enum MotionPreset {
8
8
  MorphFromCircle = "morph-from-circle",
9
9
  Sweep = "sweep",
10
10
  Pulse = "pulse",
11
- Spread = "spread"
12
- }
11
+ Spread = "spread",
12
+ FlyIn = "fly-in",
13
+ SpinAssemble = "spin-assemble",
14
+ DropBounce = "drop-bounce",
15
+ Flip = "flip",
16
+ SlamShake = "slam-shake"
17
+ }
18
+ declare const BOLD_PRESETS: readonly MotionPreset[];
13
19
  declare const INTRO_PRESETS: readonly MotionPreset[];
14
20
  declare const MICRO_PRESETS: readonly MotionPreset[];
15
21
 
@@ -61,10 +67,19 @@ interface MotionBeat {
61
67
  width?: number;
62
68
  colour?: string;
63
69
  }
70
+ interface WordmarkMotionConfig {
71
+ recipe: string;
72
+ startMs: number;
73
+ }
64
74
  interface MotionConfig {
65
75
  intro: MotionBeat[];
66
76
  micro: MotionBeat[];
77
+ wordmark?: WordmarkMotionConfig;
78
+ idle?: {
79
+ recipe: string;
80
+ };
67
81
  allowLongIntro?: string;
82
+ recipeErrors?: string[];
68
83
  }
69
84
  interface GenerateConfig {
70
85
  seed: number;
@@ -153,6 +168,33 @@ interface MarkSvgOptions {
153
168
  /** Returns a standalone SVG of the mark in one mode, with optional motion style and overlay. */
154
169
  declare function markSvg(mark: Mark, palette: Palette, mode: Mode, opts: MarkSvgOptions): string;
155
170
 
171
+ interface MotionRoles {
172
+ base: string[];
173
+ parts: string[];
174
+ }
175
+ interface RecipeContext {
176
+ roles: MotionRoles;
177
+ size: number;
178
+ }
179
+ /** Returns the intro beats of a named recipe on the brand's layer roles, or null for an unknown name. */
180
+ declare function introRecipe(name: string, ctx: RecipeContext): MotionBeat[] | null;
181
+ /** Returns the hover beats of a named recipe on the brand's layer roles, or null for an unknown name. */
182
+ declare function microRecipe(name: string, ctx: RecipeContext): MotionBeat[] | null;
183
+
184
+ interface RawMotion {
185
+ intro?: MotionBeat[] | string;
186
+ micro?: MotionBeat[] | string;
187
+ wordmark?: string | {
188
+ recipe: string;
189
+ startMs?: number;
190
+ };
191
+ idle?: string;
192
+ roles?: Partial<MotionRoles>;
193
+ allowLongIntro?: string;
194
+ }
195
+ /** Returns the motion config with recipe names turned into beats on the brand's layer roles. */
196
+ declare function resolveMotion(raw: RawMotion | undefined, layerNames: readonly string[], size: number): MotionConfig;
197
+
156
198
  interface RawLayer {
157
199
  name: string;
158
200
  d: string;
@@ -178,7 +220,7 @@ interface RawBrand {
178
220
  dark: Record<string, string>;
179
221
  mono?: string;
180
222
  };
181
- motion?: Partial<MotionConfig>;
223
+ motion?: RawMotion;
182
224
  generate?: {
183
225
  seed: number;
184
226
  count: number;
@@ -258,6 +300,8 @@ declare const INTRO_CAP_MS = 1200;
258
300
  declare const MICRO_CAP_MS = 300;
259
301
  /** Default beat for each preset, timed so a four-layer mark stays inside the intro and micro caps. */
260
302
  declare const PRESET_DEFAULTS: Readonly<Partial<Record<MotionPreset, MotionBeat>>>;
303
+ /** Default hover beat for each micro preset, timed inside the 300 ms micro cap. */
304
+ declare const MICRO_DEFAULTS: Readonly<Partial<Record<MotionPreset, MotionBeat>>>;
261
305
 
262
306
  interface Slot {
263
307
  target: string;
@@ -279,6 +323,79 @@ interface MotionReport {
279
323
  /** Checks a motion config: known presets, intro <= 1200 ms (or a named reason), micro <= 300 ms, no morph clash. */
280
324
  declare function validateMotion(config: MotionConfig, layerNames: readonly string[]): MotionReport;
281
325
 
326
+ declare const enum IntroRecipe {
327
+ RimThenInk = "rim-then-ink",
328
+ PhaseWipe = "phase-wipe",
329
+ FacesSettle = "faces-settle",
330
+ TurnIntoPlace = "turn-into-place",
331
+ GrowFromCircles = "grow-from-circles",
332
+ FlyIn = "fly-in",
333
+ SpinAssemble = "spin-assemble",
334
+ DropBounce = "drop-bounce",
335
+ FlipFaces = "flip-faces",
336
+ SlamShake = "slam-shake",
337
+ GrowSettle = "grow-settle"
338
+ }
339
+ declare const INTRO_RECIPES: readonly IntroRecipe[];
340
+
341
+ declare const enum MicroRecipe {
342
+ FacesPart = "faces-part",
343
+ Breath = "breath",
344
+ RimGlint = "rim-glint",
345
+ PartAndGlint = "part-and-glint"
346
+ }
347
+ declare const MICRO_RECIPES: readonly MicroRecipe[];
348
+
349
+ declare const enum WordmarkRecipe {
350
+ LetterStagger = "letter-stagger",
351
+ SlideFromMark = "slide-from-mark",
352
+ Typewriter = "typewriter",
353
+ MaskWipe = "mask-wipe",
354
+ TrackingSettle = "tracking-settle"
355
+ }
356
+ declare const WORDMARK_RECIPES: readonly WordmarkRecipe[];
357
+
358
+ interface WordmarkOptions {
359
+ advances: readonly number[];
360
+ startMs?: number;
361
+ prefix?: string;
362
+ fontSize?: number;
363
+ }
364
+ interface WordmarkMotion {
365
+ recipe: WordmarkRecipe;
366
+ startMs: number;
367
+ durationMs: number;
368
+ classes: string[];
369
+ css: string;
370
+ }
371
+ /** Returns the reveal CSS for letters classed `<prefix>-l<i>`, or null for an unknown recipe. */
372
+ declare function wordmarkReveal(name: string, options: WordmarkOptions): WordmarkMotion | null;
373
+
374
+ declare const enum IdleRecipe {
375
+ RimGlint = "rim-glint",
376
+ FacesPart = "faces-part",
377
+ Breath = "breath",
378
+ OrbitSpark = "orbit-spark"
379
+ }
380
+ declare const IDLE_RECIPES: readonly IdleRecipe[];
381
+ declare const IDLE_CAP_MS = 600;
382
+
383
+ interface IdleContext {
384
+ mark: Mark;
385
+ roles?: Partial<MotionRoles>;
386
+ prefix?: string;
387
+ trigger?: string;
388
+ colour?: string;
389
+ }
390
+ interface IdleMotion {
391
+ recipe: IdleRecipe;
392
+ durationMs: number;
393
+ css: string;
394
+ overlay: string;
395
+ }
396
+ /** Returns the CSS and SVG overlay of an idle recipe, played while the trigger class is on, or null for an unknown name. */
397
+ declare function idleRecipe(name: string, ctx: IdleContext): IdleMotion | null;
398
+
282
399
  interface MotionSvgOptions {
283
400
  label: string;
284
401
  size?: number;
@@ -361,4 +478,4 @@ type Out = (line: string) => void;
361
478
  /** Runs the logo-kit command line and returns its exit code. */
362
479
  declare function runCli(args: readonly string[], out?: Out): number;
363
480
 
364
- export { type AnimationTiming, type Bitmap, type Brand, CVD_KINDS, type CheckResult, type ChecksReport, CvdKind, type ExportedFile, INTRO_CAP_MS, INTRO_PRESETS, LOOKALIKE_THRESHOLD, type LayerPaint, MICRO_CAP_MS, MICRO_PRESETS, MODES, type Mark, type MarkLayer, Mode, type MotionBeat, type MotionConfig, MotionPreset, PRESET_DEFAULTS, PRIMITIVES, type PaintItem, type Palette, type PickSpec, type Pt, SYMBOLS, type TimingMap, type Variant, alphaMask, animatedSvg, buildPickPage, buildPickSpec, checkVariants, contrast, deltaE, exportBrand, fitBeat, flattenPath, generateVariants, generatorPalette, geometryModule, introSvg, loadBrand, markSvg, microSvg, paletteVariants, parseBrand, parseTiming, pixelDiff, pngSize, primitiveMark, renderPng, renderSvg, resolveToken, runChecks, runCli, schedule, simulateCvd, symbolMatches, symbolScores, totalMs, validateMotion };
481
+ export { type AnimationTiming, BOLD_PRESETS, type Bitmap, type Brand, 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, IdleRecipe, IntroRecipe, LOOKALIKE_THRESHOLD, type LayerPaint, MICRO_CAP_MS, MICRO_DEFAULTS, MICRO_PRESETS, MICRO_RECIPES, MODES, 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, buildPickPage, buildPickSpec, checkVariants, contrast, deltaE, exportBrand, fitBeat, flattenPath, generateVariants, generatorPalette, geometryModule, idleRecipe, introRecipe, introSvg, loadBrand, markSvg, microRecipe, microSvg, paletteVariants, parseBrand, parseTiming, pixelDiff, pngSize, primitiveMark, renderPng, renderSvg, resolveMotion, resolveToken, runChecks, runCli, schedule, simulateCvd, symbolMatches, symbolScores, totalMs, validateMotion, wordmarkReveal };