@edwinvakayil/calligraphy 1.3.0 → 1.4.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.
@@ -1,9 +1,12 @@
1
1
  import { HeroAnimation } from "./types";
2
2
  export declare function injectAnimationStyles(): void;
3
- /** Returns the CSS class for whole-element animations, or "" for split ones. */
4
3
  export declare function getAnimationClass(animation: HeroAnimation): string;
5
- /** True if the animation needs the HTML to be split into word/char spans. */
6
4
  export declare function isSplitAnimation(animation: HeroAnimation): boolean;
5
+ /**
6
+ * Called by Typography after dangerouslySetInnerHTML for "thread" animation.
7
+ * Stamps the sine-wave Y offset as --ty on each character span.
8
+ */
9
+ export declare function applyThreadOffsets(container: HTMLElement): void;
7
10
  export declare function buildSplitHTML(animation: HeroAnimation, html: string): string;
8
11
  export declare const buildStaggerHTML: (html: string) => string;
9
12
  export declare const buildLettersHTML: (html: string) => string;
package/dist/index.d.ts CHANGED
@@ -21,38 +21,67 @@ declare const TypographyProvider: React.FC<TypographyProviderProps>;
21
21
  type TypographyVariant = "Display" | "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "Subheading" | "Overline" | "Body" | "Label" | "Caption";
22
22
  type TextAlign = "left" | "center" | "right" | "justify";
23
23
  /**
24
- * Built-in hero text entrance animations.
25
- * Applied via CSS keyframes — GPU-composited, 60fps safe.
24
+ * Hero entrance animations — all GPU-composited (transform + opacity + filter only).
26
25
  *
27
- * — Original
28
- * risesmooth upward fade-in (universal default)
29
- * stagger each word rises in sequence
30
- * cliptext unmasked left-to-right (editorial)
31
- * popspring scale-in (energetic)
32
- * letterseach letter slides in with a slight rotation
33
- * bluremerges from a blur (cinematic)
34
- * flip3-D perspective rotate on entry (depth)
35
- * swipeslides in from the right
36
- * typewritercharacter-by-character reveal
37
- * bouncedrops from above with a soft bounce
26
+ * ── Batch 1 originals ──────────────────────────────────────────────────
27
+ * rise smooth upward fade (universal)
28
+ * stagger per-word upward rise in sequence
29
+ * clip text unmasked left to right
30
+ * pop spring scale-in
31
+ * letters each letter slides in with rotation
32
+ * blur emerges from blur
33
+ * flip 3-D rotateX on entry
34
+ * swipe slides in from the right
35
+ * typewriter character-by-character reveal
36
+ * bounce drops from above with bounce
38
37
  *
39
- * — Modern
40
- * velvetwords drift in with a soft skew (buttery & modern)
41
- * curtaineach word clips upward like a rising curtain
42
- * morphsquash-and-stretch spring (expressive & bold)
43
- * groundwords emerge from behind the baseline (editorial)
44
- * cascadediagonal character waterfall (dynamic & layered)
45
- * spotlightexpands from compressed letterspace (cinematic)
46
- * inkwords fade in with a gentle scale (calm & precise)
47
- * hingewords rotate in from their left edge (mechanical)
48
- * stretchhorizontal rubber-band expand (playful & punchy)
49
- * peelbottom-to-top clip reveal per word (sharp)
38
+ * ── Batch 2 modern ─────────────────────────────────────────────────────
39
+ * velvet words drift in with skew
40
+ * curtain each word clips upward
41
+ * morph squash-and-stretch spring
42
+ * ground words emerge from baseline
43
+ * cascade diagonal character waterfall
44
+ * spotlight expands from compressed letterspace
45
+ * ink words fade in with gentle scale
46
+ * hinge words rotate from left edge
47
+ * stretch horizontal rubber-band expand
48
+ * peel bottom-to-top clip per word
49
+ * fold words rotate in on Z from a folded angle
50
+ * shear words skewY then settle
51
+ * ripple words scale from compressed point, elastic outward wave
52
+ * cinch chars pinch on scaleX then snap open with skew
53
+ * tiltrise words rise while untilting from a sideways lean
54
+ * cardFlip chars flip up on X from flat
55
+ * converge outer words fly in, meet in center
56
+ * splitRise alternating words from top/bottom
57
+ *
58
+ * ── Batch 3 — new untouched techniques ───────────────────────────────────
59
+ * tectonic words slam from alternating X sides with skew — collision energy
60
+ * stratify per-word Z-depth flight through blur — true depth-of-field
61
+ * unfurl line expands from horizontal center — origami opening
62
+ * gravityWell chars fall from sky with micro-rotation physics overshoot
63
+ * orbit words grow from dot while rotating on Z-axis
64
+ * liquid per-word cross-axis squash then spring — fluid inertia
65
+ * noiseFade 3 random opacity waveforms per word — signal locking in
66
+ * slab words stamp from left with scaleX — print-press energy
67
+ * thread chars float on individual sine-wave Y offsets — musical
68
+ * billboard whole line rotates in on Y-axis — turning sign
69
+ *
70
+ * ── Batch 7 — genuinely new mechanics ────────────────────────────────────
71
+ * glassReveal backdrop-filter blur evaporates as text solidifies
72
+ * wordPop per-word springs from zero scale at its own centre
73
+ * charDrop chars fall under pure gravity — no overshoot or rotation
74
+ * scanline single-pixel horizontal slice expands to full height
75
+ * chromaShift RGB channel offsets collapse to zero (printing-register feel)
76
+ * wordFade per-word cross-dissolve with warmth scale, no Y movement
77
+ * rotateIn full Y-axis card-flip per word (face-up reveal)
78
+ * pressIn presses to 0.92 then springs past 1 (physical button feel)
50
79
  */
51
- type HeroAnimation = "rise" | "stagger" | "clip" | "pop" | "letters" | "blur" | "flip" | "swipe" | "typewriter" | "bounce" | "velvet" | "curtain" | "morph" | "ground" | "cascade" | "spotlight" | "ink" | "hinge" | "stretch" | "peel";
80
+ type HeroAnimation = "rise" | "stagger" | "clip" | "pop" | "letters" | "blur" | "flip" | "swipe" | "typewriter" | "bounce" | "velvet" | "curtain" | "morph" | "ground" | "cascade" | "spotlight" | "ink" | "hinge" | "stretch" | "peel" | "fold" | "shear" | "ripple" | "cinch" | "tiltrise" | "cardFlip" | "converge" | "splitRise" | "tectonic" | "stratify" | "unfurl" | "gravityWell" | "orbit" | "liquid" | "noiseFade" | "slab" | "thread" | "billboard" | "glassReveal" | "wordPop" | "charDrop" | "scanline" | "chromaShift" | "wordFade" | "rotateIn" | "pressIn";
52
81
  interface TypographyProps extends HTMLAttributes<HTMLElement> {
53
82
  /** Typography scale variant */
54
83
  variant?: TypographyVariant;
55
- /** Google Font name e.g. "Bricolage Grotesque", "Playfair Display" */
84
+ /** Google Font name auto-injects the Google Fonts <link> */
56
85
  font?: string;
57
86
  /** Text color — any valid CSS color */
58
87
  color?: string;
@@ -62,28 +91,25 @@ interface TypographyProps extends HTMLAttributes<HTMLElement> {
62
91
  as?: ElementType;
63
92
  /** Truncate to single line with ellipsis */
64
93
  truncate?: boolean;
65
- /** Clamp to N lines with ellipsis */
94
+ /** Clamp to N lines */
66
95
  maxLines?: number;
67
96
  /**
68
- * Hero entrance animation. Only applies when variant is
69
- * "Display" or "H1". Injects a CSS class and keyframe stylesheet once.
97
+ * Hero entrance animation.
98
+ * Only applied on variant="Display" or variant="H1".
70
99
  */
71
100
  animation?: HeroAnimation;
72
101
  /**
73
102
  * Italic accent for Display / H1 heroes.
74
- * When true, any <em> child renders in Instrument Serif italic
75
- * with an accent color. Defaults to false — everything renders
76
- * in the heading font/weight with no serif or italics.
103
+ * When true, <em> children render in Instrument Serif italic + accentColor.
104
+ * Default: false.
77
105
  */
78
106
  italic?: boolean;
79
107
  /**
80
- * Accent color for the <em> italic span inside Display / H1.
81
- * Defaults to a warm sand tone (#c8b89a).
108
+ * Color for the <em> italic accent span.
109
+ * Default: "#c8b89a" (warm sand).
82
110
  */
83
111
  accentColor?: string;
84
- /** Inline style overrides */
85
112
  style?: CSSProperties;
86
- /** Additional class names */
87
113
  className?: string;
88
114
  }
89
115