@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.
- package/dist/animation.d.ts +5 -2
- package/dist/index.d.ts +62 -36
- package/dist/index.esm.js +359 -73
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +359 -73
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +62 -36
- package/package.json +1 -1
package/dist/animation.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
25
|
-
* Applied via CSS keyframes — GPU-composited, 60fps safe.
|
|
24
|
+
* Hero entrance animations — all GPU-composited (transform + opacity + filter only).
|
|
26
25
|
*
|
|
27
|
-
* —
|
|
28
|
-
* rise
|
|
29
|
-
* stagger
|
|
30
|
-
* clip
|
|
31
|
-
* pop
|
|
32
|
-
* letters
|
|
33
|
-
* blur
|
|
34
|
-
* flip
|
|
35
|
-
* swipe
|
|
36
|
-
* typewriter
|
|
37
|
-
* 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
|
-
* —
|
|
40
|
-
* velvet
|
|
41
|
-
* curtain
|
|
42
|
-
* morph
|
|
43
|
-
* ground
|
|
44
|
-
* cascade
|
|
45
|
-
* spotlight
|
|
46
|
-
* ink
|
|
47
|
-
* hinge
|
|
48
|
-
* stretch
|
|
49
|
-
* peel
|
|
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
|
|
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
|
|
94
|
+
/** Clamp to N lines */
|
|
66
95
|
maxLines?: number;
|
|
67
96
|
/**
|
|
68
|
-
* Hero entrance animation.
|
|
69
|
-
* "Display" or "H1".
|
|
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,
|
|
75
|
-
*
|
|
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
|
-
*
|
|
81
|
-
*
|
|
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
|
|