@edwinvakayil/calligraphy 1.0.0 → 1.2.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/README.md +100 -45
- package/dist/animation.d.ts +15 -0
- package/dist/index.d.ts +36 -3
- package/dist/index.esm.js +198 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +198 -9
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +35 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# react-type-scale
|
|
2
2
|
|
|
3
|
-
A lightweight **React + TypeScript** typography component with automatic **Google Fonts** support
|
|
4
|
-
Define your text style with two props: `variant` for scale, `font` for the typeface.
|
|
3
|
+
A lightweight **React + TypeScript** typography component with automatic **Google Fonts** support, **hero entrance animations**, and an **italic accent toggle**.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
## Install
|
|
9
8
|
|
|
10
9
|
```bash
|
|
11
|
-
npm install
|
|
10
|
+
npm install @edwinvakayil/calligraphy
|
|
12
11
|
# or
|
|
13
|
-
yarn add
|
|
12
|
+
yarn add @edwinvakayil/calligraphy
|
|
14
13
|
```
|
|
15
14
|
|
|
16
15
|
---
|
|
@@ -18,20 +17,20 @@ yarn add react-type-scale
|
|
|
18
17
|
## Quick Start
|
|
19
18
|
|
|
20
19
|
```tsx
|
|
21
|
-
import { Typography } from "
|
|
20
|
+
import { Typography } from "@edwinvakayil/calligraphy";
|
|
22
21
|
|
|
23
22
|
export default function App() {
|
|
24
23
|
return (
|
|
25
24
|
<div>
|
|
26
|
-
<Typography variant="Display" font="
|
|
27
|
-
|
|
25
|
+
<Typography variant="Display" font="Bricolage Grotesque" animation="rise">
|
|
26
|
+
Design with <em>intention</em>
|
|
28
27
|
</Typography>
|
|
29
28
|
|
|
30
29
|
<Typography variant="H1" font="Syne">
|
|
31
30
|
Page Title
|
|
32
31
|
</Typography>
|
|
33
32
|
|
|
34
|
-
<Typography variant="Body" font="
|
|
33
|
+
<Typography variant="Body" font="DM Sans">
|
|
35
34
|
Regular body copy goes here.
|
|
36
35
|
</Typography>
|
|
37
36
|
</div>
|
|
@@ -39,7 +38,7 @@ export default function App() {
|
|
|
39
38
|
}
|
|
40
39
|
```
|
|
41
40
|
|
|
42
|
-
The `font` prop auto-injects the matching Google Font `<link>` tag —
|
|
41
|
+
The `font` prop auto-injects the matching Google Font `<link>` tag — no manual imports needed.
|
|
43
42
|
|
|
44
43
|
---
|
|
45
44
|
|
|
@@ -54,7 +53,7 @@ The `font` prop auto-injects the matching Google Font `<link>` tag — **no manu
|
|
|
54
53
|
| `H4` | `h4` | Card / panel heading |
|
|
55
54
|
| `H5` | `h5` | Small heading |
|
|
56
55
|
| `H6` | `h6` | Micro heading |
|
|
57
|
-
| `Subheading` | `h6` | Supporting
|
|
56
|
+
| `Subheading` | `h6` | Supporting subtitle |
|
|
58
57
|
| `Overline` | `span` | ALL CAPS label above a heading |
|
|
59
58
|
| `Body` | `p` | Main body copy |
|
|
60
59
|
| `Label` | `label` | Form labels, tags |
|
|
@@ -66,42 +65,99 @@ The `font` prop auto-injects the matching Google Font `<link>` tag — **no manu
|
|
|
66
65
|
|
|
67
66
|
```ts
|
|
68
67
|
interface TypographyProps {
|
|
69
|
-
variant?:
|
|
70
|
-
font?:
|
|
71
|
-
color?:
|
|
72
|
-
align?:
|
|
73
|
-
as?:
|
|
74
|
-
truncate?:
|
|
75
|
-
maxLines?:
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
variant?: TypographyVariant // default: "Body"
|
|
69
|
+
font?: string // Google Font name e.g. "Bricolage Grotesque"
|
|
70
|
+
color?: string // Any CSS color value
|
|
71
|
+
align?: "left" | "center" | "right" | "justify"
|
|
72
|
+
as?: ElementType // Override rendered HTML tag
|
|
73
|
+
truncate?: boolean // Single-line ellipsis
|
|
74
|
+
maxLines?: number // Multi-line line-clamp
|
|
75
|
+
animation?: HeroAnimation // Entrance animation (Display / H1 only)
|
|
76
|
+
italic?: boolean // default: true — show serif italic accent on <em>
|
|
77
|
+
accentColor?: string // default: "#c8b89a" — color for <em> italic text
|
|
78
|
+
className?: string
|
|
79
|
+
style?: CSSProperties
|
|
78
80
|
}
|
|
79
81
|
```
|
|
80
82
|
|
|
81
83
|
---
|
|
82
84
|
|
|
83
|
-
##
|
|
85
|
+
## Hero Animations
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
The `animation` prop works on `Display` and `H1` variants only. It injects a tiny stylesheet once (no external dependency) and applies a CSS keyframe entrance.
|
|
86
88
|
|
|
87
89
|
```tsx
|
|
88
|
-
<Typography variant="
|
|
89
|
-
|
|
90
|
+
<Typography variant="Display" font="Bricolage Grotesque" animation="rise">
|
|
91
|
+
The future of design
|
|
92
|
+
</Typography>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Available animations
|
|
96
|
+
|
|
97
|
+
| Value | Description |
|
|
98
|
+
|---------------|-------------------------------------------------------|
|
|
99
|
+
| `rise` | Smooth upward fade-in — clean, universal |
|
|
100
|
+
| `stagger` | Each word rises in sequence |
|
|
101
|
+
| `clip` | Text unmasked left to right — editorial feel |
|
|
102
|
+
| `pop` | Spring scale-in — energetic and confident |
|
|
103
|
+
| `letters` | Each letter slides in with a slight rotation |
|
|
104
|
+
| `blur` | Emerges from a blur — cinematic and dreamy |
|
|
105
|
+
| `flip` | 3-D perspective rotate on entry — depth and gravitas |
|
|
106
|
+
| `swipe` | Slides in from the right — directional flow |
|
|
107
|
+
| `typewriter` | Character-by-character reveal — focused |
|
|
108
|
+
| `bounce` | Drops from above with a soft bounce |
|
|
109
|
+
|
|
110
|
+
All animations use only `transform`, `opacity`, and `filter` — GPU-composited, no layout thrashing, 60fps safe.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Italic Accent
|
|
115
|
+
|
|
116
|
+
When `italic={true}` (the default), any `<em>` tag inside a `Display` or `H1` hero renders in **Instrument Serif italic** with an accent color. This creates a classic editorial contrast between a bold sans-serif header and a refined serif word.
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
// With italic accent (default)
|
|
120
|
+
<Typography variant="Display" font="Bricolage Grotesque">
|
|
121
|
+
Build with <em>intention</em>
|
|
122
|
+
</Typography>
|
|
123
|
+
|
|
124
|
+
// Turn off — everything renders in the heading font
|
|
125
|
+
<Typography variant="Display" font="Bricolage Grotesque" italic={false}>
|
|
126
|
+
Build with <em>intention</em>
|
|
90
127
|
</Typography>
|
|
128
|
+
```
|
|
91
129
|
|
|
92
|
-
|
|
93
|
-
|
|
130
|
+
### Custom accent color
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
<Typography
|
|
134
|
+
variant="Display"
|
|
135
|
+
font="Bricolage Grotesque"
|
|
136
|
+
accentColor="#7F77DD"
|
|
137
|
+
>
|
|
138
|
+
Crafted with <em>precision</em>
|
|
94
139
|
</Typography>
|
|
95
140
|
```
|
|
96
141
|
|
|
142
|
+
The `accentColor` prop only affects the `<em>` italic span. It has no effect when `italic={false}`.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Examples
|
|
147
|
+
|
|
97
148
|
### Overline + Display combo
|
|
98
149
|
|
|
99
150
|
```tsx
|
|
100
151
|
<Typography variant="Overline" color="#6366f1">
|
|
101
152
|
New Feature
|
|
102
153
|
</Typography>
|
|
103
|
-
<Typography
|
|
104
|
-
|
|
154
|
+
<Typography
|
|
155
|
+
variant="Display"
|
|
156
|
+
font="Bricolage Grotesque"
|
|
157
|
+
animation="clip"
|
|
158
|
+
accentColor="#6366f1"
|
|
159
|
+
>
|
|
160
|
+
Build faster with <em>types</em>
|
|
105
161
|
</Typography>
|
|
106
162
|
```
|
|
107
163
|
|
|
@@ -109,10 +165,10 @@ interface TypographyProps {
|
|
|
109
165
|
|
|
110
166
|
```tsx
|
|
111
167
|
<Typography variant="Body" font="Lora">
|
|
112
|
-
A well-set paragraph in a refined serif font.
|
|
168
|
+
A well-set paragraph in a refined serif font brings reading pleasure.
|
|
113
169
|
</Typography>
|
|
114
170
|
<Typography variant="Caption" color="#888">
|
|
115
|
-
Fig. 1 —
|
|
171
|
+
Fig. 1 — System architecture overview
|
|
116
172
|
</Typography>
|
|
117
173
|
```
|
|
118
174
|
|
|
@@ -126,11 +182,11 @@ interface TypographyProps {
|
|
|
126
182
|
|
|
127
183
|
{/* Multi-line clamp */}
|
|
128
184
|
<Typography variant="Body" maxLines={3}>
|
|
129
|
-
This paragraph will show at most three lines
|
|
185
|
+
This paragraph will show at most three lines...
|
|
130
186
|
</Typography>
|
|
131
187
|
```
|
|
132
188
|
|
|
133
|
-
### Override tag
|
|
189
|
+
### Override HTML tag
|
|
134
190
|
|
|
135
191
|
```tsx
|
|
136
192
|
<Typography variant="H2" as="div">
|
|
@@ -140,7 +196,7 @@ interface TypographyProps {
|
|
|
140
196
|
|
|
141
197
|
---
|
|
142
198
|
|
|
143
|
-
## Pre-loading fonts
|
|
199
|
+
## Pre-loading fonts
|
|
144
200
|
|
|
145
201
|
To avoid FOUT (flash of unstyled text), pre-load fonts at the top of your app:
|
|
146
202
|
|
|
@@ -148,25 +204,24 @@ To avoid FOUT (flash of unstyled text), pre-load fonts at the top of your app:
|
|
|
148
204
|
import { preloadFonts } from "react-type-scale";
|
|
149
205
|
|
|
150
206
|
// In your _app.tsx / main.tsx / layout.tsx
|
|
151
|
-
preloadFonts(["
|
|
207
|
+
preloadFonts(["Bricolage Grotesque", "Instrument Serif", "DM Sans"]);
|
|
152
208
|
```
|
|
153
209
|
|
|
154
210
|
---
|
|
155
211
|
|
|
156
|
-
##
|
|
157
|
-
|
|
158
|
-
The package ships with a curated list of ~40 popular Google Fonts that are auto-injected.
|
|
159
|
-
For any font not in the list, either add it to your local fork of `fonts.ts` or import it manually:
|
|
212
|
+
## Recommended hero font pairings
|
|
160
213
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
214
|
+
| Heading font | Style | Works well for |
|
|
215
|
+
|------------------------|------------|------------------------------|
|
|
216
|
+
| `Bricolage Grotesque` | Bold sans | Startups, SaaS, modern brand |
|
|
217
|
+
| `Syne` | Geometric | Creative, portfolio, agency |
|
|
218
|
+
| `Fraunces` | Serif | Editorial, luxury, fashion |
|
|
219
|
+
| `Bebas Neue` | Condensed | Sports, bold campaigns |
|
|
220
|
+
| `Playfair Display` | Serif | Journalism, books, culture |
|
|
221
|
+
| `Outfit` | Clean sans | Apps, dashboards, fintech |
|
|
167
222
|
|
|
168
|
-
|
|
223
|
+
All are on Google Fonts and auto-injected when passed to the `font` prop.
|
|
169
224
|
|
|
170
225
|
## License
|
|
171
226
|
|
|
172
|
-
MIT
|
|
227
|
+
MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeroAnimation } from "./types";
|
|
2
|
+
export declare function injectAnimationStyles(): void;
|
|
3
|
+
export declare function getAnimationClass(animation: HeroAnimation): string;
|
|
4
|
+
/**
|
|
5
|
+
* Wraps each word in an animated span.
|
|
6
|
+
* <em> tokens are preserved as-is in the HTML — Typography's useEffect
|
|
7
|
+
* will apply inline styles to them after mount.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildStaggerHTML(html: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Wraps each character in an animated span.
|
|
12
|
+
* <em> tags are preserved in the output — Typography's useEffect applies
|
|
13
|
+
* the actual italic/non-italic inline styles after the DOM is ready.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildLettersHTML(html: string): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,28 @@ import React, { HTMLAttributes, ElementType, CSSProperties } from 'react';
|
|
|
2
2
|
|
|
3
3
|
type TypographyVariant = "Display" | "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "Subheading" | "Overline" | "Body" | "Label" | "Caption";
|
|
4
4
|
type TextAlign = "left" | "center" | "right" | "justify";
|
|
5
|
+
/**
|
|
6
|
+
* Built-in hero text entrance animations.
|
|
7
|
+
* Applied via CSS keyframes — GPU-composited, 60fps safe.
|
|
8
|
+
*
|
|
9
|
+
* rise — smooth upward fade-in (universal default)
|
|
10
|
+
* stagger — each word rises in sequence
|
|
11
|
+
* clip — text unmasked left-to-right (editorial)
|
|
12
|
+
* pop — spring scale-in (energetic)
|
|
13
|
+
* letters — each letter slides in with a slight rotation
|
|
14
|
+
* blur — emerges from a blur (cinematic)
|
|
15
|
+
* flip — 3-D perspective rotate on entry (depth)
|
|
16
|
+
* swipe — slides in from the right
|
|
17
|
+
* typewriter — character-by-character reveal
|
|
18
|
+
* bounce — drops from above with a soft bounce
|
|
19
|
+
*/
|
|
20
|
+
type HeroAnimation = "rise" | "stagger" | "clip" | "pop" | "letters" | "blur" | "flip" | "swipe" | "typewriter" | "bounce";
|
|
5
21
|
interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
6
22
|
/** Typography scale variant */
|
|
7
23
|
variant?: TypographyVariant;
|
|
8
|
-
/** Google Font name e.g. "
|
|
24
|
+
/** Google Font name e.g. "Bricolage Grotesque", "Playfair Display" */
|
|
9
25
|
font?: string;
|
|
10
|
-
/** Text color — any valid CSS color
|
|
26
|
+
/** Text color — any valid CSS color */
|
|
11
27
|
color?: string;
|
|
12
28
|
/** Text alignment */
|
|
13
29
|
align?: TextAlign;
|
|
@@ -17,6 +33,23 @@ interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
|
17
33
|
truncate?: boolean;
|
|
18
34
|
/** Clamp to N lines with ellipsis */
|
|
19
35
|
maxLines?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Hero entrance animation. Only applies when variant is
|
|
38
|
+
* "Display" or "H1". Injects a CSS class and keyframe stylesheet once.
|
|
39
|
+
*/
|
|
40
|
+
animation?: HeroAnimation;
|
|
41
|
+
/**
|
|
42
|
+
* Italic accent for Display / H1 heroes.
|
|
43
|
+
* When true (default) any <em> child renders in Instrument Serif italic
|
|
44
|
+
* with an accent color. Set to false to render everything in the heading
|
|
45
|
+
* font/weight — no serif, no italics.
|
|
46
|
+
*/
|
|
47
|
+
italic?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Accent color for the <em> italic span inside Display / H1.
|
|
50
|
+
* Defaults to a warm sand tone (#c8b89a).
|
|
51
|
+
*/
|
|
52
|
+
accentColor?: string;
|
|
20
53
|
/** Inline style overrides */
|
|
21
54
|
style?: CSSProperties;
|
|
22
55
|
/** Additional class names */
|
|
@@ -48,4 +81,4 @@ declare function injectFont(url: string): void;
|
|
|
48
81
|
*/
|
|
49
82
|
declare function preloadFonts(families: string[]): void;
|
|
50
83
|
|
|
51
|
-
export { GOOGLE_FONTS, TextAlign, Typography, TypographyProps, TypographyVariant, buildFontUrl, Typography as default, injectFont, preloadFonts };
|
|
84
|
+
export { GOOGLE_FONTS, HeroAnimation, TextAlign, Typography, TypographyProps, TypographyVariant, buildFontUrl, Typography as default, injectFont, preloadFonts };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useEffect, Children, isValidElement } from 'react';
|
|
2
3
|
|
|
3
4
|
/******************************************************************************
|
|
4
5
|
Copyright (c) Microsoft Corporation.
|
|
@@ -124,6 +125,115 @@ function preloadFonts(families) {
|
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
const STYLE_ID = "rts-hero-animations";
|
|
129
|
+
const CSS = `
|
|
130
|
+
@keyframes rts-rise{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translateY(0)}}
|
|
131
|
+
@keyframes rts-clip{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0% 0 0)}}
|
|
132
|
+
@keyframes rts-pop{0%{opacity:0;transform:scale(0.75)}60%{opacity:1;transform:scale(1.04)}100%{transform:scale(1)}}
|
|
133
|
+
@keyframes rts-blur{from{opacity:0;filter:blur(14px);transform:scale(1.04)}to{opacity:1;filter:blur(0);transform:scale(1)}}
|
|
134
|
+
@keyframes rts-flip{from{opacity:0;transform:perspective(600px) rotateX(30deg) translateY(20px)}to{opacity:1;transform:perspective(600px) rotateX(0) translateY(0)}}
|
|
135
|
+
@keyframes rts-swipe{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:translateX(0)}}
|
|
136
|
+
@keyframes rts-bounce{0%{opacity:0;transform:translateY(-60px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}100%{transform:translateY(0)}}
|
|
137
|
+
@keyframes rts-type{from{width:0}to{width:100%}}
|
|
138
|
+
@keyframes rts-blink{50%{border-color:transparent}}
|
|
139
|
+
@keyframes rts-word-rise{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
|
|
140
|
+
@keyframes rts-letter-in{from{opacity:0;transform:translateX(-16px) rotate(-4deg)}to{opacity:1;transform:none}}
|
|
141
|
+
|
|
142
|
+
.rts-rise { animation: rts-rise 0.9s cubic-bezier(0.16,1,0.3,1) both }
|
|
143
|
+
.rts-clip { animation: rts-clip 1.1s cubic-bezier(0.77,0,0.18,1) both }
|
|
144
|
+
.rts-pop { animation: rts-pop 0.7s cubic-bezier(0.34,1.56,0.64,1) both }
|
|
145
|
+
.rts-blur { animation: rts-blur 1s cubic-bezier(0.16,1,0.3,1) both }
|
|
146
|
+
.rts-flip { animation: rts-flip 0.9s cubic-bezier(0.16,1,0.3,1) both; transform-origin: center bottom }
|
|
147
|
+
.rts-swipe { animation: rts-swipe 0.8s cubic-bezier(0.16,1,0.3,1) both }
|
|
148
|
+
.rts-bounce { animation: rts-bounce 0.9s cubic-bezier(0.36,0.07,0.19,0.97) both }
|
|
149
|
+
.rts-typewriter{ overflow: hidden; white-space: nowrap; border-right: 2px solid currentColor; width: 0; animation: rts-type 1.6s steps(22,end) both, rts-blink 0.7s step-end 1.6s 3 }
|
|
150
|
+
.rts-word { display: inline-block; opacity: 0; transform: translateY(24px); animation: rts-word-rise 0.7s cubic-bezier(0.16,1,0.3,1) both }
|
|
151
|
+
.rts-letter { display: inline-block; opacity: 0; transform: translateX(-16px) rotate(-4deg); animation: rts-letter-in 0.5s cubic-bezier(0.16,1,0.3,1) both }
|
|
152
|
+
`;
|
|
153
|
+
function injectAnimationStyles() {
|
|
154
|
+
if (typeof document === "undefined")
|
|
155
|
+
return;
|
|
156
|
+
if (document.getElementById(STYLE_ID))
|
|
157
|
+
return;
|
|
158
|
+
const style = document.createElement("style");
|
|
159
|
+
style.id = STYLE_ID;
|
|
160
|
+
style.textContent = CSS;
|
|
161
|
+
document.head.appendChild(style);
|
|
162
|
+
}
|
|
163
|
+
function getAnimationClass(animation) {
|
|
164
|
+
var _a;
|
|
165
|
+
const map = {
|
|
166
|
+
rise: "rts-rise",
|
|
167
|
+
clip: "rts-clip",
|
|
168
|
+
pop: "rts-pop",
|
|
169
|
+
blur: "rts-blur",
|
|
170
|
+
flip: "rts-flip",
|
|
171
|
+
swipe: "rts-swipe",
|
|
172
|
+
bounce: "rts-bounce",
|
|
173
|
+
typewriter: "rts-typewriter",
|
|
174
|
+
stagger: "",
|
|
175
|
+
letters: "",
|
|
176
|
+
};
|
|
177
|
+
return (_a = map[animation]) !== null && _a !== void 0 ? _a : "";
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Wraps each word in an animated span.
|
|
181
|
+
* <em> tokens are preserved as-is in the HTML — Typography's useEffect
|
|
182
|
+
* will apply inline styles to them after mount.
|
|
183
|
+
*/
|
|
184
|
+
function buildStaggerHTML(html) {
|
|
185
|
+
var _a;
|
|
186
|
+
const tokens = (_a = html.match(/(<em>[\s\S]*?<\/em>|[^\s]+)/g)) !== null && _a !== void 0 ? _a : [];
|
|
187
|
+
return tokens
|
|
188
|
+
.map((tok, i) => {
|
|
189
|
+
const delay = (i * 0.07).toFixed(2);
|
|
190
|
+
if (tok.startsWith("<em>")) {
|
|
191
|
+
// Wrap the inner text in the animated span, keep <em> outside
|
|
192
|
+
const inner = tok.slice(4, -5);
|
|
193
|
+
return `<em><span class="rts-word" style="animation-delay:${delay}s">${inner}</span></em>`;
|
|
194
|
+
}
|
|
195
|
+
return `<span class="rts-word" style="animation-delay:${delay}s">${tok}</span>`;
|
|
196
|
+
})
|
|
197
|
+
.join(" ");
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Wraps each character in an animated span.
|
|
201
|
+
* <em> tags are preserved in the output — Typography's useEffect applies
|
|
202
|
+
* the actual italic/non-italic inline styles after the DOM is ready.
|
|
203
|
+
*/
|
|
204
|
+
function buildLettersHTML(html) {
|
|
205
|
+
const result = [];
|
|
206
|
+
let inEm = false;
|
|
207
|
+
let delay = 0;
|
|
208
|
+
const step = 0.04;
|
|
209
|
+
let i = 0;
|
|
210
|
+
while (i < html.length) {
|
|
211
|
+
if (html.startsWith("<em>", i)) {
|
|
212
|
+
inEm = true;
|
|
213
|
+
i += 4;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (html.startsWith("</em>", i)) {
|
|
217
|
+
inEm = false;
|
|
218
|
+
i += 5;
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const ch = html[i];
|
|
222
|
+
if (ch === " ") {
|
|
223
|
+
result.push(" ");
|
|
224
|
+
i++;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const span = `<span class="rts-letter" style="animation-delay:${delay.toFixed(2)}s">${ch}</span>`;
|
|
228
|
+
// Preserve <em> wrapper in DOM — styles applied by useEffect
|
|
229
|
+
result.push(inEm ? `<em>${span}</em>` : span);
|
|
230
|
+
delay += step;
|
|
231
|
+
i++;
|
|
232
|
+
}
|
|
233
|
+
return result.join("");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ─── Static maps ─────────────────────────────────────────────────────────────
|
|
127
237
|
const variantTagMap = {
|
|
128
238
|
Display: "h1",
|
|
129
239
|
H1: "h1",
|
|
@@ -213,20 +323,92 @@ const variantStyleMap = {
|
|
|
213
323
|
letterSpacing: "0.03em",
|
|
214
324
|
},
|
|
215
325
|
};
|
|
326
|
+
// ─── Instrument Serif font URL ───────────────────────────────────────────────
|
|
327
|
+
const INSTRUMENT_SERIF_URL = "https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap";
|
|
328
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
329
|
+
/**
|
|
330
|
+
* Serialise React children to a plain HTML string.
|
|
331
|
+
* Handles: strings, <em>text</em> elements.
|
|
332
|
+
*/
|
|
333
|
+
function childrenToHTML(children) {
|
|
334
|
+
var _a, _b;
|
|
335
|
+
return ((_b = (_a = Children.map(children, (child) => {
|
|
336
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
337
|
+
return String(child);
|
|
338
|
+
}
|
|
339
|
+
if (isValidElement(child) && child.type === "em") {
|
|
340
|
+
const inner = typeof child.props.children === "string" ? child.props.children : "";
|
|
341
|
+
return `<em>${inner}</em>`;
|
|
342
|
+
}
|
|
343
|
+
return "";
|
|
344
|
+
})) === null || _a === void 0 ? void 0 : _a.join("")) !== null && _b !== void 0 ? _b : "");
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Walk the serialised HTML and inject inline styles on every <em> span
|
|
348
|
+
* so italic rendering is driven 100% by inline styles — no CSS specificity
|
|
349
|
+
* battles, works regardless of injection order.
|
|
350
|
+
*/
|
|
351
|
+
function applyEmStyles(container, italic, accentColor, headingFont) {
|
|
352
|
+
const ems = container.querySelectorAll("em, em span");
|
|
353
|
+
ems.forEach((el) => {
|
|
354
|
+
if (italic) {
|
|
355
|
+
el.style.fontFamily = "'Instrument Serif', serif";
|
|
356
|
+
el.style.fontStyle = "italic";
|
|
357
|
+
el.style.fontWeight = "400";
|
|
358
|
+
el.style.color = accentColor;
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
el.style.fontFamily = headingFont ? `'${headingFont}', sans-serif` : "inherit";
|
|
362
|
+
el.style.fontStyle = "normal";
|
|
363
|
+
el.style.fontWeight = "inherit";
|
|
364
|
+
el.style.color = "inherit";
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
// ─── Component ───────────────────────────────────────────────────────────────
|
|
216
369
|
const Typography = (_a) => {
|
|
217
|
-
var { variant = "Body", font, color, align, className, style, children, as, truncate, maxLines } = _a, rest = __rest(_a, ["variant", "font", "color", "align", "className", "style", "children", "as", "truncate", "maxLines"]);
|
|
218
|
-
|
|
370
|
+
var { variant = "Body", font, color, align, className, style, children, as, truncate, maxLines, animation, italic = true, accentColor = "#c8b89a" } = _a, rest = __rest(_a, ["variant", "font", "color", "align", "className", "style", "children", "as", "truncate", "maxLines", "animation", "italic", "accentColor"]);
|
|
371
|
+
const isHero = variant === "Display" || variant === "H1";
|
|
372
|
+
const ref = useRef(null);
|
|
373
|
+
// Inject Google Font
|
|
219
374
|
if (font && GOOGLE_FONTS.includes(font)) {
|
|
220
375
|
injectFont(buildFontUrl(font));
|
|
221
376
|
}
|
|
377
|
+
// Inject Instrument Serif for italic accent
|
|
378
|
+
if (isHero && italic) {
|
|
379
|
+
injectFont(INSTRUMENT_SERIF_URL);
|
|
380
|
+
}
|
|
381
|
+
// Inject animation keyframe stylesheet once
|
|
382
|
+
if (animation && isHero) {
|
|
383
|
+
injectAnimationStyles();
|
|
384
|
+
}
|
|
385
|
+
// After every render, re-apply inline styles on <em> elements.
|
|
386
|
+
// This is the fix for italic toggle: no CSS class needed, just DOM walk.
|
|
387
|
+
useEffect(() => {
|
|
388
|
+
if (!isHero || !ref.current)
|
|
389
|
+
return;
|
|
390
|
+
applyEmStyles(ref.current, italic, accentColor, font);
|
|
391
|
+
});
|
|
222
392
|
const Tag = (as !== null && as !== void 0 ? as : variantTagMap[variant]);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
393
|
+
// ── Compute animation class + inner HTML ──────────────────────────────────
|
|
394
|
+
let animClass = "";
|
|
395
|
+
let heroHTML = null;
|
|
396
|
+
if (animation && isHero) {
|
|
397
|
+
const rawHTML = childrenToHTML(children);
|
|
398
|
+
if (animation === "stagger") {
|
|
399
|
+
heroHTML = buildStaggerHTML(rawHTML);
|
|
229
400
|
}
|
|
401
|
+
else if (animation === "letters") {
|
|
402
|
+
heroHTML = buildLettersHTML(rawHTML);
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
heroHTML = rawHTML;
|
|
406
|
+
animClass = getAnimationClass(animation);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
// ── Computed styles ───────────────────────────────────────────────────────
|
|
410
|
+
const computedStyle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, variantStyleMap[variant]), (font ? { fontFamily: `'${font}', sans-serif` } : {})), (color ? { color } : {})), (align ? { textAlign: align } : {})), (truncate
|
|
411
|
+
? { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
230
412
|
: {})), (maxLines && !truncate
|
|
231
413
|
? {
|
|
232
414
|
display: "-webkit-box",
|
|
@@ -235,7 +417,14 @@ const Typography = (_a) => {
|
|
|
235
417
|
overflow: "hidden",
|
|
236
418
|
}
|
|
237
419
|
: {})), { margin: 0, padding: 0 }), style);
|
|
238
|
-
|
|
420
|
+
// ── Render with dangerouslySetInnerHTML (animation variants) ──────────────
|
|
421
|
+
if (heroHTML !== null) {
|
|
422
|
+
return (jsx(Tag
|
|
423
|
+
// key forces a fresh DOM node when animation changes → keyframe re-fires
|
|
424
|
+
, Object.assign({ ref: ref, className: [animClass, className].filter(Boolean).join(" "), style: computedStyle, dangerouslySetInnerHTML: { __html: heroHTML } }, rest), animation));
|
|
425
|
+
}
|
|
426
|
+
// ── Render children normally ──────────────────────────────────────────────
|
|
427
|
+
return (jsx(Tag, Object.assign({ ref: ref, className: className, style: computedStyle }, rest, { children: children })));
|
|
239
428
|
};
|
|
240
429
|
|
|
241
430
|
export { GOOGLE_FONTS, Typography, buildFontUrl, Typography as default, injectFont, preloadFonts };
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../../fonts.ts","../../Typography.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * A curated list of popular Google Fonts.\n * Pass any valid Google Font name to the `font` prop — if it's in this list,\n * it will be auto-injected via a <link> tag. For unlisted fonts, add them here\n * or import them manually in your project.\n */\nexport const GOOGLE_FONTS: string[] = [\n // Serif\n \"Playfair Display\",\n \"Merriweather\",\n \"Lora\",\n \"EB Garamond\",\n \"Libre Baskerville\",\n \"Cormorant Garamond\",\n \"DM Serif Display\",\n \"Crimson Text\",\n \"Source Serif 4\",\n \"Fraunces\",\n\n // Sans-serif\n \"Inter\",\n \"Roboto\",\n \"Open Sans\",\n \"Nunito\",\n \"Poppins\",\n \"Raleway\",\n \"Outfit\",\n \"DM Sans\",\n \"Manrope\",\n \"Plus Jakarta Sans\",\n \"Figtree\",\n \"Syne\",\n \"Albert Sans\",\n\n // Display / Expressive\n \"Bebas Neue\",\n \"Oswald\",\n \"Anton\",\n \"Barlow Condensed\",\n \"Righteous\",\n \"Abril Fatface\",\n \"Dela Gothic One\",\n \"Space Grotesk\",\n \"Unbounded\",\n \"Big Shoulders Display\",\n\n // Mono\n \"JetBrains Mono\",\n \"Fira Code\",\n \"Source Code Pro\",\n \"Space Mono\",\n \"IBM Plex Mono\",\n];\n\nconst injectedFonts = new Set<string>();\n\n/**\n * Builds a Google Fonts URL for a given font family.\n * Requests weights 300, 400, 500, 600, 700, 800 — italic variants included.\n */\nexport function buildFontUrl(fontFamily: string): string {\n const encoded = fontFamily.replace(/ /g, \"+\");\n return `https://fonts.googleapis.com/css2?family=${encoded}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,700&display=swap`;\n}\n\n/**\n * Injects a Google Fonts <link> into <head> once per unique URL.\n * Safe to call multiple times — deduped via a Set.\n */\nexport function injectFont(url: string): void {\n if (typeof document === \"undefined\") return; // SSR guard\n if (injectedFonts.has(url)) return;\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n document.head.appendChild(link);\n injectedFonts.add(url);\n}\n\n/**\n * Pre-load a set of fonts eagerly (e.g. at app root).\n * Usage: preloadFonts([\"Playfair Display\", \"Inter\"])\n */\nexport function preloadFonts(families: string[]): void {\n families.forEach((f) => {\n if (GOOGLE_FONTS.includes(f)) {\n injectFont(buildFontUrl(f));\n } else {\n console.warn(\n `[react-type-scale] \"${f}\" is not in the bundled GOOGLE_FONTS list. ` +\n `Add it to the list or import it manually.`\n );\n }\n });\n}\n","import React, { CSSProperties } from \"react\";\nimport { TypographyProps, VariantTagMap, VariantStyleMap } from \"./types\";\nimport { GOOGLE_FONTS, buildFontUrl, injectFont } from \"./fonts\";\n\nconst variantTagMap: VariantTagMap = {\n Display: \"h1\",\n H1: \"h1\",\n H2: \"h2\",\n H3: \"h3\",\n H4: \"h4\",\n H5: \"h5\",\n H6: \"h6\",\n Subheading: \"h6\",\n Overline: \"span\",\n Body: \"p\",\n Label: \"label\",\n Caption: \"span\",\n};\n\nconst variantStyleMap: VariantStyleMap = {\n Display: {\n fontSize: \"clamp(2.5rem, 6vw, 5rem)\",\n fontWeight: 800,\n lineHeight: 1.05,\n letterSpacing: \"-0.03em\",\n },\n H1: {\n fontSize: \"clamp(2rem, 4vw, 3rem)\",\n fontWeight: 700,\n lineHeight: 1.1,\n letterSpacing: \"-0.02em\",\n },\n H2: {\n fontSize: \"clamp(1.5rem, 3vw, 2.25rem)\",\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: \"-0.015em\",\n },\n H3: {\n fontSize: \"clamp(1.25rem, 2.5vw, 1.75rem)\",\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n },\n H4: {\n fontSize: \"clamp(1.1rem, 2vw, 1.375rem)\",\n fontWeight: 600,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n },\n H5: {\n fontSize: \"clamp(1rem, 1.5vw, 1.125rem)\",\n fontWeight: 600,\n lineHeight: 1.35,\n letterSpacing: \"0em\",\n },\n H6: {\n fontSize: \"1rem\",\n fontWeight: 600,\n lineHeight: 1.4,\n letterSpacing: \"0em\",\n },\n Subheading: {\n fontSize: \"1.125rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.005em\",\n },\n Overline: {\n fontSize: \"0.6875rem\",\n fontWeight: 700,\n lineHeight: 1.6,\n letterSpacing: \"0.12em\",\n textTransform: \"uppercase\" as CSSProperties[\"textTransform\"],\n },\n Body: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: 1.7,\n letterSpacing: \"0.01em\",\n },\n Label: {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.02em\",\n },\n Caption: {\n fontSize: \"0.75rem\",\n fontWeight: 400,\n lineHeight: 1.6,\n letterSpacing: \"0.03em\",\n },\n};\n\nexport const Typography: React.FC<TypographyProps> = ({\n variant = \"Body\",\n font,\n color,\n align,\n className,\n style,\n children,\n as,\n truncate,\n maxLines,\n ...rest\n}) => {\n // Inject Google Font if provided and it's a known Google Font\n if (font && GOOGLE_FONTS.includes(font)) {\n injectFont(buildFontUrl(font));\n }\n\n const Tag = (as ?? variantTagMap[variant]) as React.ElementType;\n const baseStyle = variantStyleMap[variant];\n\n const computedStyle: CSSProperties = {\n ...baseStyle,\n ...(font ? { fontFamily: `'${font}', sans-serif` } : {}),\n ...(color ? { color } : {}),\n ...(align ? { textAlign: align } : {}),\n ...(truncate\n ? {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }\n : {}),\n ...(maxLines && !truncate\n ? {\n display: \"-webkit-box\",\n WebkitLineClamp: maxLines,\n WebkitBoxOrient: \"vertical\" as CSSProperties[\"WebkitBoxOrient\"],\n overflow: \"hidden\",\n }\n : {}),\n margin: 0,\n padding: 0,\n ...style,\n };\n\n return (\n <Tag className={className} style={computedStyle} {...rest}>\n {children}\n </Tag>\n );\n};\n\nexport default Typography;\n"],"names":["_jsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,IAAI,GAAG,EAAE,UAAU,EAAE,IAAI,IAAI,CAAA,aAAA,CAAe,EAAE,GAAG,EAAE,EAAC,GACpD,KAAK,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAC,GACvB,KAAK,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAClC,GAAC,QAAQ;AACV,UAAE;AACE,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AACxB,YAAA,UAAU,EAAE,QAAQ;AACrB,SAAA;UACD,EAAE,EAAC,GACH,QAAQ,IAAI,CAAC,QAAQ;AACvB,UAAE;AACE,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,eAAe,EAAE,QAAQ;AACzB,YAAA,eAAe,EAAE,UAA8C;AAC/D,YAAA,QAAQ,EAAE,QAAQ;AACnB,SAAA;AACH,UAAE,EAAE,EAAC,EAAA,EACP,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,EACP,CAAA,EAAA,KAAK,CACT,CAAC;AAEF,IAAA,QACEA,GAAC,CAAA,GAAG,EAAC,MAAA,CAAA,MAAA,CAAA,EAAA,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAM,EAAA,IAAI,cACtD,QAAQ,EAAA,CAAA,CACL,EACN;AACJ;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../../fonts.ts","../../animation.ts","../../Typography.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * A curated list of popular Google Fonts.\n * Pass any valid Google Font name to the `font` prop — if it's in this list,\n * it will be auto-injected via a <link> tag. For unlisted fonts, add them here\n * or import them manually in your project.\n */\nexport const GOOGLE_FONTS: string[] = [\n // Serif\n \"Playfair Display\",\n \"Merriweather\",\n \"Lora\",\n \"EB Garamond\",\n \"Libre Baskerville\",\n \"Cormorant Garamond\",\n \"DM Serif Display\",\n \"Crimson Text\",\n \"Source Serif 4\",\n \"Fraunces\",\n\n // Sans-serif\n \"Inter\",\n \"Roboto\",\n \"Open Sans\",\n \"Nunito\",\n \"Poppins\",\n \"Raleway\",\n \"Outfit\",\n \"DM Sans\",\n \"Manrope\",\n \"Plus Jakarta Sans\",\n \"Figtree\",\n \"Syne\",\n \"Albert Sans\",\n\n // Display / Expressive\n \"Bebas Neue\",\n \"Oswald\",\n \"Anton\",\n \"Barlow Condensed\",\n \"Righteous\",\n \"Abril Fatface\",\n \"Dela Gothic One\",\n \"Space Grotesk\",\n \"Unbounded\",\n \"Big Shoulders Display\",\n\n // Mono\n \"JetBrains Mono\",\n \"Fira Code\",\n \"Source Code Pro\",\n \"Space Mono\",\n \"IBM Plex Mono\",\n];\n\nconst injectedFonts = new Set<string>();\n\n/**\n * Builds a Google Fonts URL for a given font family.\n * Requests weights 300, 400, 500, 600, 700, 800 — italic variants included.\n */\nexport function buildFontUrl(fontFamily: string): string {\n const encoded = fontFamily.replace(/ /g, \"+\");\n return `https://fonts.googleapis.com/css2?family=${encoded}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,700&display=swap`;\n}\n\n/**\n * Injects a Google Fonts <link> into <head> once per unique URL.\n * Safe to call multiple times — deduped via a Set.\n */\nexport function injectFont(url: string): void {\n if (typeof document === \"undefined\") return; // SSR guard\n if (injectedFonts.has(url)) return;\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n document.head.appendChild(link);\n injectedFonts.add(url);\n}\n\n/**\n * Pre-load a set of fonts eagerly (e.g. at app root).\n * Usage: preloadFonts([\"Playfair Display\", \"Inter\"])\n */\nexport function preloadFonts(families: string[]): void {\n families.forEach((f) => {\n if (GOOGLE_FONTS.includes(f)) {\n injectFont(buildFontUrl(f));\n } else {\n console.warn(\n `[react-type-scale] \"${f}\" is not in the bundled GOOGLE_FONTS list. ` +\n `Add it to the list or import it manually.`\n );\n }\n });\n}","import { HeroAnimation } from \"./types\";\n\nconst STYLE_ID = \"rts-hero-animations\";\n\nconst CSS = `\n@keyframes rts-rise{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translateY(0)}}\n@keyframes rts-clip{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0% 0 0)}}\n@keyframes rts-pop{0%{opacity:0;transform:scale(0.75)}60%{opacity:1;transform:scale(1.04)}100%{transform:scale(1)}}\n@keyframes rts-blur{from{opacity:0;filter:blur(14px);transform:scale(1.04)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n@keyframes rts-flip{from{opacity:0;transform:perspective(600px) rotateX(30deg) translateY(20px)}to{opacity:1;transform:perspective(600px) rotateX(0) translateY(0)}}\n@keyframes rts-swipe{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:translateX(0)}}\n@keyframes rts-bounce{0%{opacity:0;transform:translateY(-60px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}100%{transform:translateY(0)}}\n@keyframes rts-type{from{width:0}to{width:100%}}\n@keyframes rts-blink{50%{border-color:transparent}}\n@keyframes rts-word-rise{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}\n@keyframes rts-letter-in{from{opacity:0;transform:translateX(-16px) rotate(-4deg)}to{opacity:1;transform:none}}\n\n.rts-rise { animation: rts-rise 0.9s cubic-bezier(0.16,1,0.3,1) both }\n.rts-clip { animation: rts-clip 1.1s cubic-bezier(0.77,0,0.18,1) both }\n.rts-pop { animation: rts-pop 0.7s cubic-bezier(0.34,1.56,0.64,1) both }\n.rts-blur { animation: rts-blur 1s cubic-bezier(0.16,1,0.3,1) both }\n.rts-flip { animation: rts-flip 0.9s cubic-bezier(0.16,1,0.3,1) both; transform-origin: center bottom }\n.rts-swipe { animation: rts-swipe 0.8s cubic-bezier(0.16,1,0.3,1) both }\n.rts-bounce { animation: rts-bounce 0.9s cubic-bezier(0.36,0.07,0.19,0.97) both }\n.rts-typewriter{ overflow: hidden; white-space: nowrap; border-right: 2px solid currentColor; width: 0; animation: rts-type 1.6s steps(22,end) both, rts-blink 0.7s step-end 1.6s 3 }\n.rts-word { display: inline-block; opacity: 0; transform: translateY(24px); animation: rts-word-rise 0.7s cubic-bezier(0.16,1,0.3,1) both }\n.rts-letter { display: inline-block; opacity: 0; transform: translateX(-16px) rotate(-4deg); animation: rts-letter-in 0.5s cubic-bezier(0.16,1,0.3,1) both }\n`;\n\nexport function injectAnimationStyles(): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(STYLE_ID)) return;\n const style = document.createElement(\"style\");\n style.id = STYLE_ID;\n style.textContent = CSS;\n document.head.appendChild(style);\n}\n\nexport function getAnimationClass(animation: HeroAnimation): string {\n const map: Record<HeroAnimation, string> = {\n rise: \"rts-rise\",\n clip: \"rts-clip\",\n pop: \"rts-pop\",\n blur: \"rts-blur\",\n flip: \"rts-flip\",\n swipe: \"rts-swipe\",\n bounce: \"rts-bounce\",\n typewriter: \"rts-typewriter\",\n stagger: \"\",\n letters: \"\",\n };\n return map[animation] ?? \"\";\n}\n\n/**\n * Wraps each word in an animated span.\n * <em> tokens are preserved as-is in the HTML — Typography's useEffect\n * will apply inline styles to them after mount.\n */\nexport function buildStaggerHTML(html: string): string {\n const tokens = html.match(/(<em>[\\s\\S]*?<\\/em>|[^\\s]+)/g) ?? [];\n return tokens\n .map((tok, i) => {\n const delay = (i * 0.07).toFixed(2);\n if (tok.startsWith(\"<em>\")) {\n // Wrap the inner text in the animated span, keep <em> outside\n const inner = tok.slice(4, -5);\n return `<em><span class=\"rts-word\" style=\"animation-delay:${delay}s\">${inner}</span></em>`;\n }\n return `<span class=\"rts-word\" style=\"animation-delay:${delay}s\">${tok}</span>`;\n })\n .join(\" \");\n}\n\n/**\n * Wraps each character in an animated span.\n * <em> tags are preserved in the output — Typography's useEffect applies\n * the actual italic/non-italic inline styles after the DOM is ready.\n */\nexport function buildLettersHTML(html: string): string {\n const result: string[] = [];\n let inEm = false;\n let delay = 0;\n const step = 0.04;\n let i = 0;\n\n while (i < html.length) {\n if (html.startsWith(\"<em>\", i)) { inEm = true; i += 4; continue; }\n if (html.startsWith(\"</em>\", i)) { inEm = false; i += 5; continue; }\n\n const ch = html[i];\n if (ch === \" \") { result.push(\" \"); i++; continue; }\n\n const span = `<span class=\"rts-letter\" style=\"animation-delay:${delay.toFixed(2)}s\">${ch}</span>`;\n // Preserve <em> wrapper in DOM — styles applied by useEffect\n result.push(inEm ? `<em>${span}</em>` : span);\n delay += step;\n i++;\n }\n\n return result.join(\"\");\n}","import React, { CSSProperties, Children, isValidElement, useRef, useEffect } from \"react\";\nimport { TypographyProps, VariantTagMap, VariantStyleMap } from \"./types\";\nimport { GOOGLE_FONTS, buildFontUrl, injectFont } from \"./fonts\";\nimport {\n injectAnimationStyles,\n getAnimationClass,\n buildStaggerHTML,\n buildLettersHTML,\n} from \"./animation\";\n\n// ─── Static maps ─────────────────────────────────────────────────────────────\n\nconst variantTagMap: VariantTagMap = {\n Display: \"h1\",\n H1: \"h1\",\n H2: \"h2\",\n H3: \"h3\",\n H4: \"h4\",\n H5: \"h5\",\n H6: \"h6\",\n Subheading: \"h6\",\n Overline: \"span\",\n Body: \"p\",\n Label: \"label\",\n Caption: \"span\",\n};\n\nconst variantStyleMap: VariantStyleMap = {\n Display: {\n fontSize: \"clamp(2.5rem, 6vw, 5rem)\",\n fontWeight: 800,\n lineHeight: 1.05,\n letterSpacing: \"-0.03em\",\n },\n H1: {\n fontSize: \"clamp(2rem, 4vw, 3rem)\",\n fontWeight: 700,\n lineHeight: 1.1,\n letterSpacing: \"-0.02em\",\n },\n H2: {\n fontSize: \"clamp(1.5rem, 3vw, 2.25rem)\",\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: \"-0.015em\",\n },\n H3: {\n fontSize: \"clamp(1.25rem, 2.5vw, 1.75rem)\",\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n },\n H4: {\n fontSize: \"clamp(1.1rem, 2vw, 1.375rem)\",\n fontWeight: 600,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n },\n H5: {\n fontSize: \"clamp(1rem, 1.5vw, 1.125rem)\",\n fontWeight: 600,\n lineHeight: 1.35,\n letterSpacing: \"0em\",\n },\n H6: {\n fontSize: \"1rem\",\n fontWeight: 600,\n lineHeight: 1.4,\n letterSpacing: \"0em\",\n },\n Subheading: {\n fontSize: \"1.125rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.005em\",\n },\n Overline: {\n fontSize: \"0.6875rem\",\n fontWeight: 700,\n lineHeight: 1.6,\n letterSpacing: \"0.12em\",\n textTransform: \"uppercase\" as CSSProperties[\"textTransform\"],\n },\n Body: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: 1.7,\n letterSpacing: \"0.01em\",\n },\n Label: {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.02em\",\n },\n Caption: {\n fontSize: \"0.75rem\",\n fontWeight: 400,\n lineHeight: 1.6,\n letterSpacing: \"0.03em\",\n },\n};\n\n// ─── Instrument Serif font URL ───────────────────────────────────────────────\n\nconst INSTRUMENT_SERIF_URL =\n \"https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap\";\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/**\n * Serialise React children to a plain HTML string.\n * Handles: strings, <em>text</em> elements.\n */\nfunction childrenToHTML(children: React.ReactNode): string {\n return (\n Children.map(children, (child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return String(child);\n }\n if (isValidElement(child) && child.type === \"em\") {\n const inner =\n typeof child.props.children === \"string\" ? child.props.children : \"\";\n return `<em>${inner}</em>`;\n }\n return \"\";\n })?.join(\"\") ?? \"\"\n );\n}\n\n/**\n * Walk the serialised HTML and inject inline styles on every <em> span\n * so italic rendering is driven 100% by inline styles — no CSS specificity\n * battles, works regardless of injection order.\n */\nfunction applyEmStyles(\n container: HTMLElement,\n italic: boolean,\n accentColor: string,\n headingFont?: string\n): void {\n const ems = container.querySelectorAll<HTMLElement>(\"em, em span\");\n ems.forEach((el) => {\n if (italic) {\n el.style.fontFamily = \"'Instrument Serif', serif\";\n el.style.fontStyle = \"italic\";\n el.style.fontWeight = \"400\";\n el.style.color = accentColor;\n } else {\n el.style.fontFamily = headingFont ? `'${headingFont}', sans-serif` : \"inherit\";\n el.style.fontStyle = \"normal\";\n el.style.fontWeight = \"inherit\";\n el.style.color = \"inherit\";\n }\n });\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const Typography: React.FC<TypographyProps> = ({\n variant = \"Body\",\n font,\n color,\n align,\n className,\n style,\n children,\n as,\n truncate,\n maxLines,\n animation,\n italic = true,\n accentColor = \"#c8b89a\",\n ...rest\n}) => {\n const isHero = variant === \"Display\" || variant === \"H1\";\n const ref = useRef<HTMLElement>(null);\n\n // Inject Google Font\n if (font && GOOGLE_FONTS.includes(font)) {\n injectFont(buildFontUrl(font));\n }\n\n // Inject Instrument Serif for italic accent\n if (isHero && italic) {\n injectFont(INSTRUMENT_SERIF_URL);\n }\n\n // Inject animation keyframe stylesheet once\n if (animation && isHero) {\n injectAnimationStyles();\n }\n\n // After every render, re-apply inline styles on <em> elements.\n // This is the fix for italic toggle: no CSS class needed, just DOM walk.\n useEffect(() => {\n if (!isHero || !ref.current) return;\n applyEmStyles(ref.current, italic, accentColor, font);\n });\n\n const Tag = (as ?? variantTagMap[variant]) as React.ElementType;\n\n // ── Compute animation class + inner HTML ──────────────────────────────────\n\n let animClass = \"\";\n let heroHTML: string | null = null;\n\n if (animation && isHero) {\n const rawHTML = childrenToHTML(children);\n\n if (animation === \"stagger\") {\n heroHTML = buildStaggerHTML(rawHTML);\n } else if (animation === \"letters\") {\n heroHTML = buildLettersHTML(rawHTML);\n } else {\n heroHTML = rawHTML;\n animClass = getAnimationClass(animation);\n }\n }\n\n // ── Computed styles ───────────────────────────────────────────────────────\n\n const computedStyle: CSSProperties = {\n ...variantStyleMap[variant],\n ...(font ? { fontFamily: `'${font}', sans-serif` } : {}),\n ...(color ? { color } : {}),\n ...(align ? { textAlign: align } : {}),\n ...(truncate\n ? { overflow: \"hidden\", textOverflow: \"ellipsis\", whiteSpace: \"nowrap\" }\n : {}),\n ...(maxLines && !truncate\n ? {\n display: \"-webkit-box\",\n WebkitLineClamp: maxLines,\n WebkitBoxOrient: \"vertical\" as CSSProperties[\"WebkitBoxOrient\"],\n overflow: \"hidden\",\n }\n : {}),\n margin: 0,\n padding: 0,\n ...style,\n };\n\n // ── Render with dangerouslySetInnerHTML (animation variants) ──────────────\n\n if (heroHTML !== null) {\n return (\n <Tag\n // key forces a fresh DOM node when animation changes → keyframe re-fires\n key={animation}\n ref={ref}\n className={[animClass, className].filter(Boolean).join(\" \")}\n style={computedStyle}\n dangerouslySetInnerHTML={{ __html: heroHTML }}\n {...rest}\n />\n );\n }\n\n // ── Render children normally ──────────────────────────────────────────────\n\n return (\n <Tag\n ref={ref}\n className={className}\n style={computedStyle}\n {...rest}\n >\n {children}\n </Tag>\n );\n};\n\nexport default Typography;\n"],"names":["_jsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BA;AACO,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE;AAC7B,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACvF,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;AACvE,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChF,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,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
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var react = require('react');
|
|
6
7
|
|
|
7
8
|
/******************************************************************************
|
|
8
9
|
Copyright (c) Microsoft Corporation.
|
|
@@ -128,6 +129,115 @@ function preloadFonts(families) {
|
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
131
|
|
|
132
|
+
const STYLE_ID = "rts-hero-animations";
|
|
133
|
+
const CSS = `
|
|
134
|
+
@keyframes rts-rise{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translateY(0)}}
|
|
135
|
+
@keyframes rts-clip{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0% 0 0)}}
|
|
136
|
+
@keyframes rts-pop{0%{opacity:0;transform:scale(0.75)}60%{opacity:1;transform:scale(1.04)}100%{transform:scale(1)}}
|
|
137
|
+
@keyframes rts-blur{from{opacity:0;filter:blur(14px);transform:scale(1.04)}to{opacity:1;filter:blur(0);transform:scale(1)}}
|
|
138
|
+
@keyframes rts-flip{from{opacity:0;transform:perspective(600px) rotateX(30deg) translateY(20px)}to{opacity:1;transform:perspective(600px) rotateX(0) translateY(0)}}
|
|
139
|
+
@keyframes rts-swipe{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:translateX(0)}}
|
|
140
|
+
@keyframes rts-bounce{0%{opacity:0;transform:translateY(-60px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}100%{transform:translateY(0)}}
|
|
141
|
+
@keyframes rts-type{from{width:0}to{width:100%}}
|
|
142
|
+
@keyframes rts-blink{50%{border-color:transparent}}
|
|
143
|
+
@keyframes rts-word-rise{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
|
|
144
|
+
@keyframes rts-letter-in{from{opacity:0;transform:translateX(-16px) rotate(-4deg)}to{opacity:1;transform:none}}
|
|
145
|
+
|
|
146
|
+
.rts-rise { animation: rts-rise 0.9s cubic-bezier(0.16,1,0.3,1) both }
|
|
147
|
+
.rts-clip { animation: rts-clip 1.1s cubic-bezier(0.77,0,0.18,1) both }
|
|
148
|
+
.rts-pop { animation: rts-pop 0.7s cubic-bezier(0.34,1.56,0.64,1) both }
|
|
149
|
+
.rts-blur { animation: rts-blur 1s cubic-bezier(0.16,1,0.3,1) both }
|
|
150
|
+
.rts-flip { animation: rts-flip 0.9s cubic-bezier(0.16,1,0.3,1) both; transform-origin: center bottom }
|
|
151
|
+
.rts-swipe { animation: rts-swipe 0.8s cubic-bezier(0.16,1,0.3,1) both }
|
|
152
|
+
.rts-bounce { animation: rts-bounce 0.9s cubic-bezier(0.36,0.07,0.19,0.97) both }
|
|
153
|
+
.rts-typewriter{ overflow: hidden; white-space: nowrap; border-right: 2px solid currentColor; width: 0; animation: rts-type 1.6s steps(22,end) both, rts-blink 0.7s step-end 1.6s 3 }
|
|
154
|
+
.rts-word { display: inline-block; opacity: 0; transform: translateY(24px); animation: rts-word-rise 0.7s cubic-bezier(0.16,1,0.3,1) both }
|
|
155
|
+
.rts-letter { display: inline-block; opacity: 0; transform: translateX(-16px) rotate(-4deg); animation: rts-letter-in 0.5s cubic-bezier(0.16,1,0.3,1) both }
|
|
156
|
+
`;
|
|
157
|
+
function injectAnimationStyles() {
|
|
158
|
+
if (typeof document === "undefined")
|
|
159
|
+
return;
|
|
160
|
+
if (document.getElementById(STYLE_ID))
|
|
161
|
+
return;
|
|
162
|
+
const style = document.createElement("style");
|
|
163
|
+
style.id = STYLE_ID;
|
|
164
|
+
style.textContent = CSS;
|
|
165
|
+
document.head.appendChild(style);
|
|
166
|
+
}
|
|
167
|
+
function getAnimationClass(animation) {
|
|
168
|
+
var _a;
|
|
169
|
+
const map = {
|
|
170
|
+
rise: "rts-rise",
|
|
171
|
+
clip: "rts-clip",
|
|
172
|
+
pop: "rts-pop",
|
|
173
|
+
blur: "rts-blur",
|
|
174
|
+
flip: "rts-flip",
|
|
175
|
+
swipe: "rts-swipe",
|
|
176
|
+
bounce: "rts-bounce",
|
|
177
|
+
typewriter: "rts-typewriter",
|
|
178
|
+
stagger: "",
|
|
179
|
+
letters: "",
|
|
180
|
+
};
|
|
181
|
+
return (_a = map[animation]) !== null && _a !== void 0 ? _a : "";
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Wraps each word in an animated span.
|
|
185
|
+
* <em> tokens are preserved as-is in the HTML — Typography's useEffect
|
|
186
|
+
* will apply inline styles to them after mount.
|
|
187
|
+
*/
|
|
188
|
+
function buildStaggerHTML(html) {
|
|
189
|
+
var _a;
|
|
190
|
+
const tokens = (_a = html.match(/(<em>[\s\S]*?<\/em>|[^\s]+)/g)) !== null && _a !== void 0 ? _a : [];
|
|
191
|
+
return tokens
|
|
192
|
+
.map((tok, i) => {
|
|
193
|
+
const delay = (i * 0.07).toFixed(2);
|
|
194
|
+
if (tok.startsWith("<em>")) {
|
|
195
|
+
// Wrap the inner text in the animated span, keep <em> outside
|
|
196
|
+
const inner = tok.slice(4, -5);
|
|
197
|
+
return `<em><span class="rts-word" style="animation-delay:${delay}s">${inner}</span></em>`;
|
|
198
|
+
}
|
|
199
|
+
return `<span class="rts-word" style="animation-delay:${delay}s">${tok}</span>`;
|
|
200
|
+
})
|
|
201
|
+
.join(" ");
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Wraps each character in an animated span.
|
|
205
|
+
* <em> tags are preserved in the output — Typography's useEffect applies
|
|
206
|
+
* the actual italic/non-italic inline styles after the DOM is ready.
|
|
207
|
+
*/
|
|
208
|
+
function buildLettersHTML(html) {
|
|
209
|
+
const result = [];
|
|
210
|
+
let inEm = false;
|
|
211
|
+
let delay = 0;
|
|
212
|
+
const step = 0.04;
|
|
213
|
+
let i = 0;
|
|
214
|
+
while (i < html.length) {
|
|
215
|
+
if (html.startsWith("<em>", i)) {
|
|
216
|
+
inEm = true;
|
|
217
|
+
i += 4;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (html.startsWith("</em>", i)) {
|
|
221
|
+
inEm = false;
|
|
222
|
+
i += 5;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
const ch = html[i];
|
|
226
|
+
if (ch === " ") {
|
|
227
|
+
result.push(" ");
|
|
228
|
+
i++;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const span = `<span class="rts-letter" style="animation-delay:${delay.toFixed(2)}s">${ch}</span>`;
|
|
232
|
+
// Preserve <em> wrapper in DOM — styles applied by useEffect
|
|
233
|
+
result.push(inEm ? `<em>${span}</em>` : span);
|
|
234
|
+
delay += step;
|
|
235
|
+
i++;
|
|
236
|
+
}
|
|
237
|
+
return result.join("");
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// ─── Static maps ─────────────────────────────────────────────────────────────
|
|
131
241
|
const variantTagMap = {
|
|
132
242
|
Display: "h1",
|
|
133
243
|
H1: "h1",
|
|
@@ -217,20 +327,92 @@ const variantStyleMap = {
|
|
|
217
327
|
letterSpacing: "0.03em",
|
|
218
328
|
},
|
|
219
329
|
};
|
|
330
|
+
// ─── Instrument Serif font URL ───────────────────────────────────────────────
|
|
331
|
+
const INSTRUMENT_SERIF_URL = "https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap";
|
|
332
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
333
|
+
/**
|
|
334
|
+
* Serialise React children to a plain HTML string.
|
|
335
|
+
* Handles: strings, <em>text</em> elements.
|
|
336
|
+
*/
|
|
337
|
+
function childrenToHTML(children) {
|
|
338
|
+
var _a, _b;
|
|
339
|
+
return ((_b = (_a = react.Children.map(children, (child) => {
|
|
340
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
341
|
+
return String(child);
|
|
342
|
+
}
|
|
343
|
+
if (react.isValidElement(child) && child.type === "em") {
|
|
344
|
+
const inner = typeof child.props.children === "string" ? child.props.children : "";
|
|
345
|
+
return `<em>${inner}</em>`;
|
|
346
|
+
}
|
|
347
|
+
return "";
|
|
348
|
+
})) === null || _a === void 0 ? void 0 : _a.join("")) !== null && _b !== void 0 ? _b : "");
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Walk the serialised HTML and inject inline styles on every <em> span
|
|
352
|
+
* so italic rendering is driven 100% by inline styles — no CSS specificity
|
|
353
|
+
* battles, works regardless of injection order.
|
|
354
|
+
*/
|
|
355
|
+
function applyEmStyles(container, italic, accentColor, headingFont) {
|
|
356
|
+
const ems = container.querySelectorAll("em, em span");
|
|
357
|
+
ems.forEach((el) => {
|
|
358
|
+
if (italic) {
|
|
359
|
+
el.style.fontFamily = "'Instrument Serif', serif";
|
|
360
|
+
el.style.fontStyle = "italic";
|
|
361
|
+
el.style.fontWeight = "400";
|
|
362
|
+
el.style.color = accentColor;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
el.style.fontFamily = headingFont ? `'${headingFont}', sans-serif` : "inherit";
|
|
366
|
+
el.style.fontStyle = "normal";
|
|
367
|
+
el.style.fontWeight = "inherit";
|
|
368
|
+
el.style.color = "inherit";
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
// ─── Component ───────────────────────────────────────────────────────────────
|
|
220
373
|
const Typography = (_a) => {
|
|
221
|
-
var { variant = "Body", font, color, align, className, style, children, as, truncate, maxLines } = _a, rest = __rest(_a, ["variant", "font", "color", "align", "className", "style", "children", "as", "truncate", "maxLines"]);
|
|
222
|
-
|
|
374
|
+
var { variant = "Body", font, color, align, className, style, children, as, truncate, maxLines, animation, italic = true, accentColor = "#c8b89a" } = _a, rest = __rest(_a, ["variant", "font", "color", "align", "className", "style", "children", "as", "truncate", "maxLines", "animation", "italic", "accentColor"]);
|
|
375
|
+
const isHero = variant === "Display" || variant === "H1";
|
|
376
|
+
const ref = react.useRef(null);
|
|
377
|
+
// Inject Google Font
|
|
223
378
|
if (font && GOOGLE_FONTS.includes(font)) {
|
|
224
379
|
injectFont(buildFontUrl(font));
|
|
225
380
|
}
|
|
381
|
+
// Inject Instrument Serif for italic accent
|
|
382
|
+
if (isHero && italic) {
|
|
383
|
+
injectFont(INSTRUMENT_SERIF_URL);
|
|
384
|
+
}
|
|
385
|
+
// Inject animation keyframe stylesheet once
|
|
386
|
+
if (animation && isHero) {
|
|
387
|
+
injectAnimationStyles();
|
|
388
|
+
}
|
|
389
|
+
// After every render, re-apply inline styles on <em> elements.
|
|
390
|
+
// This is the fix for italic toggle: no CSS class needed, just DOM walk.
|
|
391
|
+
react.useEffect(() => {
|
|
392
|
+
if (!isHero || !ref.current)
|
|
393
|
+
return;
|
|
394
|
+
applyEmStyles(ref.current, italic, accentColor, font);
|
|
395
|
+
});
|
|
226
396
|
const Tag = (as !== null && as !== void 0 ? as : variantTagMap[variant]);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
397
|
+
// ── Compute animation class + inner HTML ──────────────────────────────────
|
|
398
|
+
let animClass = "";
|
|
399
|
+
let heroHTML = null;
|
|
400
|
+
if (animation && isHero) {
|
|
401
|
+
const rawHTML = childrenToHTML(children);
|
|
402
|
+
if (animation === "stagger") {
|
|
403
|
+
heroHTML = buildStaggerHTML(rawHTML);
|
|
233
404
|
}
|
|
405
|
+
else if (animation === "letters") {
|
|
406
|
+
heroHTML = buildLettersHTML(rawHTML);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
heroHTML = rawHTML;
|
|
410
|
+
animClass = getAnimationClass(animation);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
// ── Computed styles ───────────────────────────────────────────────────────
|
|
414
|
+
const computedStyle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, variantStyleMap[variant]), (font ? { fontFamily: `'${font}', sans-serif` } : {})), (color ? { color } : {})), (align ? { textAlign: align } : {})), (truncate
|
|
415
|
+
? { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
234
416
|
: {})), (maxLines && !truncate
|
|
235
417
|
? {
|
|
236
418
|
display: "-webkit-box",
|
|
@@ -239,7 +421,14 @@ const Typography = (_a) => {
|
|
|
239
421
|
overflow: "hidden",
|
|
240
422
|
}
|
|
241
423
|
: {})), { margin: 0, padding: 0 }), style);
|
|
242
|
-
|
|
424
|
+
// ── Render with dangerouslySetInnerHTML (animation variants) ──────────────
|
|
425
|
+
if (heroHTML !== null) {
|
|
426
|
+
return (jsxRuntime.jsx(Tag
|
|
427
|
+
// key forces a fresh DOM node when animation changes → keyframe re-fires
|
|
428
|
+
, Object.assign({ ref: ref, className: [animClass, className].filter(Boolean).join(" "), style: computedStyle, dangerouslySetInnerHTML: { __html: heroHTML } }, rest), animation));
|
|
429
|
+
}
|
|
430
|
+
// ── Render children normally ──────────────────────────────────────────────
|
|
431
|
+
return (jsxRuntime.jsx(Tag, Object.assign({ ref: ref, className: className, style: computedStyle }, rest, { children: children })));
|
|
243
432
|
};
|
|
244
433
|
|
|
245
434
|
exports.GOOGLE_FONTS = GOOGLE_FONTS;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../../fonts.ts","../../Typography.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * A curated list of popular Google Fonts.\n * Pass any valid Google Font name to the `font` prop — if it's in this list,\n * it will be auto-injected via a <link> tag. For unlisted fonts, add them here\n * or import them manually in your project.\n */\nexport const GOOGLE_FONTS: string[] = [\n // Serif\n \"Playfair Display\",\n \"Merriweather\",\n \"Lora\",\n \"EB Garamond\",\n \"Libre Baskerville\",\n \"Cormorant Garamond\",\n \"DM Serif Display\",\n \"Crimson Text\",\n \"Source Serif 4\",\n \"Fraunces\",\n\n // Sans-serif\n \"Inter\",\n \"Roboto\",\n \"Open Sans\",\n \"Nunito\",\n \"Poppins\",\n \"Raleway\",\n \"Outfit\",\n \"DM Sans\",\n \"Manrope\",\n \"Plus Jakarta Sans\",\n \"Figtree\",\n \"Syne\",\n \"Albert Sans\",\n\n // Display / Expressive\n \"Bebas Neue\",\n \"Oswald\",\n \"Anton\",\n \"Barlow Condensed\",\n \"Righteous\",\n \"Abril Fatface\",\n \"Dela Gothic One\",\n \"Space Grotesk\",\n \"Unbounded\",\n \"Big Shoulders Display\",\n\n // Mono\n \"JetBrains Mono\",\n \"Fira Code\",\n \"Source Code Pro\",\n \"Space Mono\",\n \"IBM Plex Mono\",\n];\n\nconst injectedFonts = new Set<string>();\n\n/**\n * Builds a Google Fonts URL for a given font family.\n * Requests weights 300, 400, 500, 600, 700, 800 — italic variants included.\n */\nexport function buildFontUrl(fontFamily: string): string {\n const encoded = fontFamily.replace(/ /g, \"+\");\n return `https://fonts.googleapis.com/css2?family=${encoded}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,700&display=swap`;\n}\n\n/**\n * Injects a Google Fonts <link> into <head> once per unique URL.\n * Safe to call multiple times — deduped via a Set.\n */\nexport function injectFont(url: string): void {\n if (typeof document === \"undefined\") return; // SSR guard\n if (injectedFonts.has(url)) return;\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n document.head.appendChild(link);\n injectedFonts.add(url);\n}\n\n/**\n * Pre-load a set of fonts eagerly (e.g. at app root).\n * Usage: preloadFonts([\"Playfair Display\", \"Inter\"])\n */\nexport function preloadFonts(families: string[]): void {\n families.forEach((f) => {\n if (GOOGLE_FONTS.includes(f)) {\n injectFont(buildFontUrl(f));\n } else {\n console.warn(\n `[react-type-scale] \"${f}\" is not in the bundled GOOGLE_FONTS list. ` +\n `Add it to the list or import it manually.`\n );\n }\n });\n}\n","import React, { CSSProperties } from \"react\";\nimport { TypographyProps, VariantTagMap, VariantStyleMap } from \"./types\";\nimport { GOOGLE_FONTS, buildFontUrl, injectFont } from \"./fonts\";\n\nconst variantTagMap: VariantTagMap = {\n Display: \"h1\",\n H1: \"h1\",\n H2: \"h2\",\n H3: \"h3\",\n H4: \"h4\",\n H5: \"h5\",\n H6: \"h6\",\n Subheading: \"h6\",\n Overline: \"span\",\n Body: \"p\",\n Label: \"label\",\n Caption: \"span\",\n};\n\nconst variantStyleMap: VariantStyleMap = {\n Display: {\n fontSize: \"clamp(2.5rem, 6vw, 5rem)\",\n fontWeight: 800,\n lineHeight: 1.05,\n letterSpacing: \"-0.03em\",\n },\n H1: {\n fontSize: \"clamp(2rem, 4vw, 3rem)\",\n fontWeight: 700,\n lineHeight: 1.1,\n letterSpacing: \"-0.02em\",\n },\n H2: {\n fontSize: \"clamp(1.5rem, 3vw, 2.25rem)\",\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: \"-0.015em\",\n },\n H3: {\n fontSize: \"clamp(1.25rem, 2.5vw, 1.75rem)\",\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n },\n H4: {\n fontSize: \"clamp(1.1rem, 2vw, 1.375rem)\",\n fontWeight: 600,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n },\n H5: {\n fontSize: \"clamp(1rem, 1.5vw, 1.125rem)\",\n fontWeight: 600,\n lineHeight: 1.35,\n letterSpacing: \"0em\",\n },\n H6: {\n fontSize: \"1rem\",\n fontWeight: 600,\n lineHeight: 1.4,\n letterSpacing: \"0em\",\n },\n Subheading: {\n fontSize: \"1.125rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.005em\",\n },\n Overline: {\n fontSize: \"0.6875rem\",\n fontWeight: 700,\n lineHeight: 1.6,\n letterSpacing: \"0.12em\",\n textTransform: \"uppercase\" as CSSProperties[\"textTransform\"],\n },\n Body: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: 1.7,\n letterSpacing: \"0.01em\",\n },\n Label: {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.02em\",\n },\n Caption: {\n fontSize: \"0.75rem\",\n fontWeight: 400,\n lineHeight: 1.6,\n letterSpacing: \"0.03em\",\n },\n};\n\nexport const Typography: React.FC<TypographyProps> = ({\n variant = \"Body\",\n font,\n color,\n align,\n className,\n style,\n children,\n as,\n truncate,\n maxLines,\n ...rest\n}) => {\n // Inject Google Font if provided and it's a known Google Font\n if (font && GOOGLE_FONTS.includes(font)) {\n injectFont(buildFontUrl(font));\n }\n\n const Tag = (as ?? variantTagMap[variant]) as React.ElementType;\n const baseStyle = variantStyleMap[variant];\n\n const computedStyle: CSSProperties = {\n ...baseStyle,\n ...(font ? { fontFamily: `'${font}', sans-serif` } : {}),\n ...(color ? { color } : {}),\n ...(align ? { textAlign: align } : {}),\n ...(truncate\n ? {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }\n : {}),\n ...(maxLines && !truncate\n ? {\n display: \"-webkit-box\",\n WebkitLineClamp: maxLines,\n WebkitBoxOrient: \"vertical\" as CSSProperties[\"WebkitBoxOrient\"],\n overflow: \"hidden\",\n }\n : {}),\n margin: 0,\n padding: 0,\n ...style,\n };\n\n return (\n <Tag className={className} style={computedStyle} {...rest}>\n {children}\n </Tag>\n );\n};\n\nexport default Typography;\n"],"names":["_jsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BA;AACO,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE;AAC7B,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACvF,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;AACvE,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChF,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC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F,IAAA,QACEA,cAAC,CAAA,GAAG,EAAC,MAAA,CAAA,MAAA,CAAA,EAAA,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAM,EAAA,IAAI,cACtD,QAAQ,EAAA,CAAA,CACL,EACN;AACJ;;;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../../fonts.ts","../../animation.ts","../../Typography.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * A curated list of popular Google Fonts.\n * Pass any valid Google Font name to the `font` prop — if it's in this list,\n * it will be auto-injected via a <link> tag. For unlisted fonts, add them here\n * or import them manually in your project.\n */\nexport const GOOGLE_FONTS: string[] = [\n // Serif\n \"Playfair Display\",\n \"Merriweather\",\n \"Lora\",\n \"EB Garamond\",\n \"Libre Baskerville\",\n \"Cormorant Garamond\",\n \"DM Serif Display\",\n \"Crimson Text\",\n \"Source Serif 4\",\n \"Fraunces\",\n\n // Sans-serif\n \"Inter\",\n \"Roboto\",\n \"Open Sans\",\n \"Nunito\",\n \"Poppins\",\n \"Raleway\",\n \"Outfit\",\n \"DM Sans\",\n \"Manrope\",\n \"Plus Jakarta Sans\",\n \"Figtree\",\n \"Syne\",\n \"Albert Sans\",\n\n // Display / Expressive\n \"Bebas Neue\",\n \"Oswald\",\n \"Anton\",\n \"Barlow Condensed\",\n \"Righteous\",\n \"Abril Fatface\",\n \"Dela Gothic One\",\n \"Space Grotesk\",\n \"Unbounded\",\n \"Big Shoulders Display\",\n\n // Mono\n \"JetBrains Mono\",\n \"Fira Code\",\n \"Source Code Pro\",\n \"Space Mono\",\n \"IBM Plex Mono\",\n];\n\nconst injectedFonts = new Set<string>();\n\n/**\n * Builds a Google Fonts URL for a given font family.\n * Requests weights 300, 400, 500, 600, 700, 800 — italic variants included.\n */\nexport function buildFontUrl(fontFamily: string): string {\n const encoded = fontFamily.replace(/ /g, \"+\");\n return `https://fonts.googleapis.com/css2?family=${encoded}:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,700&display=swap`;\n}\n\n/**\n * Injects a Google Fonts <link> into <head> once per unique URL.\n * Safe to call multiple times — deduped via a Set.\n */\nexport function injectFont(url: string): void {\n if (typeof document === \"undefined\") return; // SSR guard\n if (injectedFonts.has(url)) return;\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n document.head.appendChild(link);\n injectedFonts.add(url);\n}\n\n/**\n * Pre-load a set of fonts eagerly (e.g. at app root).\n * Usage: preloadFonts([\"Playfair Display\", \"Inter\"])\n */\nexport function preloadFonts(families: string[]): void {\n families.forEach((f) => {\n if (GOOGLE_FONTS.includes(f)) {\n injectFont(buildFontUrl(f));\n } else {\n console.warn(\n `[react-type-scale] \"${f}\" is not in the bundled GOOGLE_FONTS list. ` +\n `Add it to the list or import it manually.`\n );\n }\n });\n}","import { HeroAnimation } from \"./types\";\n\nconst STYLE_ID = \"rts-hero-animations\";\n\nconst CSS = `\n@keyframes rts-rise{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translateY(0)}}\n@keyframes rts-clip{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0% 0 0)}}\n@keyframes rts-pop{0%{opacity:0;transform:scale(0.75)}60%{opacity:1;transform:scale(1.04)}100%{transform:scale(1)}}\n@keyframes rts-blur{from{opacity:0;filter:blur(14px);transform:scale(1.04)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n@keyframes rts-flip{from{opacity:0;transform:perspective(600px) rotateX(30deg) translateY(20px)}to{opacity:1;transform:perspective(600px) rotateX(0) translateY(0)}}\n@keyframes rts-swipe{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:translateX(0)}}\n@keyframes rts-bounce{0%{opacity:0;transform:translateY(-60px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}100%{transform:translateY(0)}}\n@keyframes rts-type{from{width:0}to{width:100%}}\n@keyframes rts-blink{50%{border-color:transparent}}\n@keyframes rts-word-rise{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}\n@keyframes rts-letter-in{from{opacity:0;transform:translateX(-16px) rotate(-4deg)}to{opacity:1;transform:none}}\n\n.rts-rise { animation: rts-rise 0.9s cubic-bezier(0.16,1,0.3,1) both }\n.rts-clip { animation: rts-clip 1.1s cubic-bezier(0.77,0,0.18,1) both }\n.rts-pop { animation: rts-pop 0.7s cubic-bezier(0.34,1.56,0.64,1) both }\n.rts-blur { animation: rts-blur 1s cubic-bezier(0.16,1,0.3,1) both }\n.rts-flip { animation: rts-flip 0.9s cubic-bezier(0.16,1,0.3,1) both; transform-origin: center bottom }\n.rts-swipe { animation: rts-swipe 0.8s cubic-bezier(0.16,1,0.3,1) both }\n.rts-bounce { animation: rts-bounce 0.9s cubic-bezier(0.36,0.07,0.19,0.97) both }\n.rts-typewriter{ overflow: hidden; white-space: nowrap; border-right: 2px solid currentColor; width: 0; animation: rts-type 1.6s steps(22,end) both, rts-blink 0.7s step-end 1.6s 3 }\n.rts-word { display: inline-block; opacity: 0; transform: translateY(24px); animation: rts-word-rise 0.7s cubic-bezier(0.16,1,0.3,1) both }\n.rts-letter { display: inline-block; opacity: 0; transform: translateX(-16px) rotate(-4deg); animation: rts-letter-in 0.5s cubic-bezier(0.16,1,0.3,1) both }\n`;\n\nexport function injectAnimationStyles(): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(STYLE_ID)) return;\n const style = document.createElement(\"style\");\n style.id = STYLE_ID;\n style.textContent = CSS;\n document.head.appendChild(style);\n}\n\nexport function getAnimationClass(animation: HeroAnimation): string {\n const map: Record<HeroAnimation, string> = {\n rise: \"rts-rise\",\n clip: \"rts-clip\",\n pop: \"rts-pop\",\n blur: \"rts-blur\",\n flip: \"rts-flip\",\n swipe: \"rts-swipe\",\n bounce: \"rts-bounce\",\n typewriter: \"rts-typewriter\",\n stagger: \"\",\n letters: \"\",\n };\n return map[animation] ?? \"\";\n}\n\n/**\n * Wraps each word in an animated span.\n * <em> tokens are preserved as-is in the HTML — Typography's useEffect\n * will apply inline styles to them after mount.\n */\nexport function buildStaggerHTML(html: string): string {\n const tokens = html.match(/(<em>[\\s\\S]*?<\\/em>|[^\\s]+)/g) ?? [];\n return tokens\n .map((tok, i) => {\n const delay = (i * 0.07).toFixed(2);\n if (tok.startsWith(\"<em>\")) {\n // Wrap the inner text in the animated span, keep <em> outside\n const inner = tok.slice(4, -5);\n return `<em><span class=\"rts-word\" style=\"animation-delay:${delay}s\">${inner}</span></em>`;\n }\n return `<span class=\"rts-word\" style=\"animation-delay:${delay}s\">${tok}</span>`;\n })\n .join(\" \");\n}\n\n/**\n * Wraps each character in an animated span.\n * <em> tags are preserved in the output — Typography's useEffect applies\n * the actual italic/non-italic inline styles after the DOM is ready.\n */\nexport function buildLettersHTML(html: string): string {\n const result: string[] = [];\n let inEm = false;\n let delay = 0;\n const step = 0.04;\n let i = 0;\n\n while (i < html.length) {\n if (html.startsWith(\"<em>\", i)) { inEm = true; i += 4; continue; }\n if (html.startsWith(\"</em>\", i)) { inEm = false; i += 5; continue; }\n\n const ch = html[i];\n if (ch === \" \") { result.push(\" \"); i++; continue; }\n\n const span = `<span class=\"rts-letter\" style=\"animation-delay:${delay.toFixed(2)}s\">${ch}</span>`;\n // Preserve <em> wrapper in DOM — styles applied by useEffect\n result.push(inEm ? `<em>${span}</em>` : span);\n delay += step;\n i++;\n }\n\n return result.join(\"\");\n}","import React, { CSSProperties, Children, isValidElement, useRef, useEffect } from \"react\";\nimport { TypographyProps, VariantTagMap, VariantStyleMap } from \"./types\";\nimport { GOOGLE_FONTS, buildFontUrl, injectFont } from \"./fonts\";\nimport {\n injectAnimationStyles,\n getAnimationClass,\n buildStaggerHTML,\n buildLettersHTML,\n} from \"./animation\";\n\n// ─── Static maps ─────────────────────────────────────────────────────────────\n\nconst variantTagMap: VariantTagMap = {\n Display: \"h1\",\n H1: \"h1\",\n H2: \"h2\",\n H3: \"h3\",\n H4: \"h4\",\n H5: \"h5\",\n H6: \"h6\",\n Subheading: \"h6\",\n Overline: \"span\",\n Body: \"p\",\n Label: \"label\",\n Caption: \"span\",\n};\n\nconst variantStyleMap: VariantStyleMap = {\n Display: {\n fontSize: \"clamp(2.5rem, 6vw, 5rem)\",\n fontWeight: 800,\n lineHeight: 1.05,\n letterSpacing: \"-0.03em\",\n },\n H1: {\n fontSize: \"clamp(2rem, 4vw, 3rem)\",\n fontWeight: 700,\n lineHeight: 1.1,\n letterSpacing: \"-0.02em\",\n },\n H2: {\n fontSize: \"clamp(1.5rem, 3vw, 2.25rem)\",\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: \"-0.015em\",\n },\n H3: {\n fontSize: \"clamp(1.25rem, 2.5vw, 1.75rem)\",\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n },\n H4: {\n fontSize: \"clamp(1.1rem, 2vw, 1.375rem)\",\n fontWeight: 600,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n },\n H5: {\n fontSize: \"clamp(1rem, 1.5vw, 1.125rem)\",\n fontWeight: 600,\n lineHeight: 1.35,\n letterSpacing: \"0em\",\n },\n H6: {\n fontSize: \"1rem\",\n fontWeight: 600,\n lineHeight: 1.4,\n letterSpacing: \"0em\",\n },\n Subheading: {\n fontSize: \"1.125rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.005em\",\n },\n Overline: {\n fontSize: \"0.6875rem\",\n fontWeight: 700,\n lineHeight: 1.6,\n letterSpacing: \"0.12em\",\n textTransform: \"uppercase\" as CSSProperties[\"textTransform\"],\n },\n Body: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: 1.7,\n letterSpacing: \"0.01em\",\n },\n Label: {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n lineHeight: 1.5,\n letterSpacing: \"0.02em\",\n },\n Caption: {\n fontSize: \"0.75rem\",\n fontWeight: 400,\n lineHeight: 1.6,\n letterSpacing: \"0.03em\",\n },\n};\n\n// ─── Instrument Serif font URL ───────────────────────────────────────────────\n\nconst INSTRUMENT_SERIF_URL =\n \"https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap\";\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/**\n * Serialise React children to a plain HTML string.\n * Handles: strings, <em>text</em> elements.\n */\nfunction childrenToHTML(children: React.ReactNode): string {\n return (\n Children.map(children, (child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return String(child);\n }\n if (isValidElement(child) && child.type === \"em\") {\n const inner =\n typeof child.props.children === \"string\" ? child.props.children : \"\";\n return `<em>${inner}</em>`;\n }\n return \"\";\n })?.join(\"\") ?? \"\"\n );\n}\n\n/**\n * Walk the serialised HTML and inject inline styles on every <em> span\n * so italic rendering is driven 100% by inline styles — no CSS specificity\n * battles, works regardless of injection order.\n */\nfunction applyEmStyles(\n container: HTMLElement,\n italic: boolean,\n accentColor: string,\n headingFont?: string\n): void {\n const ems = container.querySelectorAll<HTMLElement>(\"em, em span\");\n ems.forEach((el) => {\n if (italic) {\n el.style.fontFamily = \"'Instrument Serif', serif\";\n el.style.fontStyle = \"italic\";\n el.style.fontWeight = \"400\";\n el.style.color = accentColor;\n } else {\n el.style.fontFamily = headingFont ? `'${headingFont}', sans-serif` : \"inherit\";\n el.style.fontStyle = \"normal\";\n el.style.fontWeight = \"inherit\";\n el.style.color = \"inherit\";\n }\n });\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const Typography: React.FC<TypographyProps> = ({\n variant = \"Body\",\n font,\n color,\n align,\n className,\n style,\n children,\n as,\n truncate,\n maxLines,\n animation,\n italic = true,\n accentColor = \"#c8b89a\",\n ...rest\n}) => {\n const isHero = variant === \"Display\" || variant === \"H1\";\n const ref = useRef<HTMLElement>(null);\n\n // Inject Google Font\n if (font && GOOGLE_FONTS.includes(font)) {\n injectFont(buildFontUrl(font));\n }\n\n // Inject Instrument Serif for italic accent\n if (isHero && italic) {\n injectFont(INSTRUMENT_SERIF_URL);\n }\n\n // Inject animation keyframe stylesheet once\n if (animation && isHero) {\n injectAnimationStyles();\n }\n\n // After every render, re-apply inline styles on <em> elements.\n // This is the fix for italic toggle: no CSS class needed, just DOM walk.\n useEffect(() => {\n if (!isHero || !ref.current) return;\n applyEmStyles(ref.current, italic, accentColor, font);\n });\n\n const Tag = (as ?? variantTagMap[variant]) as React.ElementType;\n\n // ── Compute animation class + inner HTML ──────────────────────────────────\n\n let animClass = \"\";\n let heroHTML: string | null = null;\n\n if (animation && isHero) {\n const rawHTML = childrenToHTML(children);\n\n if (animation === \"stagger\") {\n heroHTML = buildStaggerHTML(rawHTML);\n } else if (animation === \"letters\") {\n heroHTML = buildLettersHTML(rawHTML);\n } else {\n heroHTML = rawHTML;\n animClass = getAnimationClass(animation);\n }\n }\n\n // ── Computed styles ───────────────────────────────────────────────────────\n\n const computedStyle: CSSProperties = {\n ...variantStyleMap[variant],\n ...(font ? { fontFamily: `'${font}', sans-serif` } : {}),\n ...(color ? { color } : {}),\n ...(align ? { textAlign: align } : {}),\n ...(truncate\n ? { overflow: \"hidden\", textOverflow: \"ellipsis\", whiteSpace: \"nowrap\" }\n : {}),\n ...(maxLines && !truncate\n ? {\n display: \"-webkit-box\",\n WebkitLineClamp: maxLines,\n WebkitBoxOrient: \"vertical\" as CSSProperties[\"WebkitBoxOrient\"],\n overflow: \"hidden\",\n }\n : {}),\n margin: 0,\n padding: 0,\n ...style,\n };\n\n // ── Render with dangerouslySetInnerHTML (animation variants) ──────────────\n\n if (heroHTML !== null) {\n return (\n <Tag\n // key forces a fresh DOM node when animation changes → keyframe re-fires\n key={animation}\n ref={ref}\n className={[animClass, className].filter(Boolean).join(\" \")}\n style={computedStyle}\n dangerouslySetInnerHTML={{ __html: heroHTML }}\n {...rest}\n />\n );\n }\n\n // ── Render children normally ──────────────────────────────────────────────\n\n return (\n <Tag\n ref={ref}\n className={className}\n style={computedStyle}\n {...rest}\n >\n {children}\n </Tag>\n );\n};\n\nexport default Typography;\n"],"names":["Children","isValidElement","useRef","useEffect","_jsx"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BA;AACO,SAAS,MAAM,CAAC,CAAC,EAA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AC,GAAG;;AAGF,UAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3D,KAAK,EAAE,aAAa,EACpB,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EACzC,EAAA,IAAI,GALH,SAAS,CAMd,EACF;KACH;;IAID,QACEA,eAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACF,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,aAAa,EAAA,EAChB,IAAI,EAEP,EAAA,QAAA,EAAA,QAAQ,EACL,CAAA,CAAA,EACN;AACJ;;;;;;;;;","x_google_ignoreList":[0]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import { CSSProperties, ElementType, HTMLAttributes } from "react";
|
|
2
2
|
export type TypographyVariant = "Display" | "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "Subheading" | "Overline" | "Body" | "Label" | "Caption";
|
|
3
3
|
export type TextAlign = "left" | "center" | "right" | "justify";
|
|
4
|
+
/**
|
|
5
|
+
* Built-in hero text entrance animations.
|
|
6
|
+
* Applied via CSS keyframes — GPU-composited, 60fps safe.
|
|
7
|
+
*
|
|
8
|
+
* rise — smooth upward fade-in (universal default)
|
|
9
|
+
* stagger — each word rises in sequence
|
|
10
|
+
* clip — text unmasked left-to-right (editorial)
|
|
11
|
+
* pop — spring scale-in (energetic)
|
|
12
|
+
* letters — each letter slides in with a slight rotation
|
|
13
|
+
* blur — emerges from a blur (cinematic)
|
|
14
|
+
* flip — 3-D perspective rotate on entry (depth)
|
|
15
|
+
* swipe — slides in from the right
|
|
16
|
+
* typewriter — character-by-character reveal
|
|
17
|
+
* bounce — drops from above with a soft bounce
|
|
18
|
+
*/
|
|
19
|
+
export type HeroAnimation = "rise" | "stagger" | "clip" | "pop" | "letters" | "blur" | "flip" | "swipe" | "typewriter" | "bounce";
|
|
4
20
|
export interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
5
21
|
/** Typography scale variant */
|
|
6
22
|
variant?: TypographyVariant;
|
|
7
|
-
/** Google Font name e.g. "
|
|
23
|
+
/** Google Font name e.g. "Bricolage Grotesque", "Playfair Display" */
|
|
8
24
|
font?: string;
|
|
9
|
-
/** Text color — any valid CSS color
|
|
25
|
+
/** Text color — any valid CSS color */
|
|
10
26
|
color?: string;
|
|
11
27
|
/** Text alignment */
|
|
12
28
|
align?: TextAlign;
|
|
@@ -16,6 +32,23 @@ export interface TypographyProps extends HTMLAttributes<HTMLElement> {
|
|
|
16
32
|
truncate?: boolean;
|
|
17
33
|
/** Clamp to N lines with ellipsis */
|
|
18
34
|
maxLines?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Hero entrance animation. Only applies when variant is
|
|
37
|
+
* "Display" or "H1". Injects a CSS class and keyframe stylesheet once.
|
|
38
|
+
*/
|
|
39
|
+
animation?: HeroAnimation;
|
|
40
|
+
/**
|
|
41
|
+
* Italic accent for Display / H1 heroes.
|
|
42
|
+
* When true (default) any <em> child renders in Instrument Serif italic
|
|
43
|
+
* with an accent color. Set to false to render everything in the heading
|
|
44
|
+
* font/weight — no serif, no italics.
|
|
45
|
+
*/
|
|
46
|
+
italic?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Accent color for the <em> italic span inside Display / H1.
|
|
49
|
+
* Defaults to a warm sand tone (#c8b89a).
|
|
50
|
+
*/
|
|
51
|
+
accentColor?: string;
|
|
19
52
|
/** Inline style overrides */
|
|
20
53
|
style?: CSSProperties;
|
|
21
54
|
/** Additional class names */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edwinvakayil/calligraphy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A lightweight React + TypeScript typography component with Google Fonts support. Scale from Display to Caption with a single prop.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|