@nebutra/ui 0.1.0 → 0.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/dist/components/index.d.ts +380 -0
- package/dist/components/index.js +2398 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +106 -0
- package/dist/hooks/index.js +182 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +296 -0
- package/dist/layout/index.js +1303 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layouts/index.d.ts +161 -0
- package/dist/layouts/index.js +611 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/patterns/index.d.ts +363 -0
- package/dist/patterns/index.js +3004 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/primitives/index.d.ts +9588 -0
- package/dist/primitives/index.js +26779 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/styles/brand-override.css +61 -0
- package/dist/tailwind.preset.d.ts +251 -0
- package/dist/tailwind.preset.js +273 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/theme/index.d.ts +150 -0
- package/dist/theme/index.js +28 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/typography/fonts.css +110 -0
- package/dist/typography/index.d.ts +425 -0
- package/dist/typography/index.js +374 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/utils/index.d.ts +61 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +16 -6
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font Configuration and Loading Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles web font loading, preloading, and performance optimization.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Font configuration object
|
|
8
|
+
*/
|
|
9
|
+
interface FontConfig {
|
|
10
|
+
/** Font family name */
|
|
11
|
+
family: string;
|
|
12
|
+
/** Font weights to load */
|
|
13
|
+
weights: number[];
|
|
14
|
+
/** Include italic variants */
|
|
15
|
+
italic?: boolean;
|
|
16
|
+
/** Font display strategy */
|
|
17
|
+
display?: "auto" | "block" | "swap" | "fallback" | "optional";
|
|
18
|
+
/** Is this a variable font */
|
|
19
|
+
variable?: boolean;
|
|
20
|
+
/** Google Fonts URL parameter name */
|
|
21
|
+
googleFontsParam?: string;
|
|
22
|
+
/** Self-hosted font URL */
|
|
23
|
+
selfHostUrl?: string;
|
|
24
|
+
/** Font license */
|
|
25
|
+
license: "OFL" | "Apache-2.0" | "Ubuntu" | "MIT" | "Other";
|
|
26
|
+
/** Source URL for license */
|
|
27
|
+
licenseUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Registered fonts for the design system
|
|
31
|
+
*/
|
|
32
|
+
declare const fonts: Record<string, FontConfig>;
|
|
33
|
+
/**
|
|
34
|
+
* Generate Google Fonts URL for specified fonts
|
|
35
|
+
*/
|
|
36
|
+
declare function getGoogleFontsUrl(fontKeys: (keyof typeof fonts)[]): string;
|
|
37
|
+
/**
|
|
38
|
+
* Default fonts to load
|
|
39
|
+
*/
|
|
40
|
+
declare const defaultFonts: (keyof typeof fonts)[];
|
|
41
|
+
/**
|
|
42
|
+
* Fonts for CJK (Chinese) support
|
|
43
|
+
*/
|
|
44
|
+
declare const cjkFonts: (keyof typeof fonts)[];
|
|
45
|
+
/**
|
|
46
|
+
* All fonts including CJK
|
|
47
|
+
*/
|
|
48
|
+
declare const allFonts: (keyof typeof fonts)[];
|
|
49
|
+
/**
|
|
50
|
+
* Generate preload link elements for critical fonts
|
|
51
|
+
*/
|
|
52
|
+
declare function getFontPreloadLinks(fontKeys: (keyof typeof fonts)[]): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Generate link element for Google Fonts
|
|
55
|
+
*/
|
|
56
|
+
declare function getGoogleFontsLink(fontKeys: (keyof typeof fonts)[]): string;
|
|
57
|
+
/**
|
|
58
|
+
* Check if fonts are loaded
|
|
59
|
+
*/
|
|
60
|
+
declare function areFontsLoaded(fontFamilies: string[]): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Wait for fonts to load with timeout
|
|
63
|
+
*/
|
|
64
|
+
declare function waitForFonts(fontFamilies: string[], timeout?: number): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Font smoothing CSS for crisp text rendering
|
|
67
|
+
*/
|
|
68
|
+
declare const fontSmoothing: {
|
|
69
|
+
readonly WebkitFontSmoothing: "antialiased";
|
|
70
|
+
readonly MozOsxFontSmoothing: "grayscale";
|
|
71
|
+
readonly textRendering: "optimizeLegibility";
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Font feature settings for Inter
|
|
75
|
+
*/
|
|
76
|
+
declare const fontFeatureSettings: {
|
|
77
|
+
/** Enable common ligatures and contextual alternates */
|
|
78
|
+
readonly normal: "\"calt\" 1, \"liga\" 1";
|
|
79
|
+
/** Enable tabular figures for aligned numbers */
|
|
80
|
+
readonly tabular: "\"tnum\" 1, \"calt\" 1";
|
|
81
|
+
/** Enable case-sensitive forms */
|
|
82
|
+
readonly case: "\"case\" 1";
|
|
83
|
+
/** Enable stylistic set 01 (alternate digits) */
|
|
84
|
+
readonly ss01: "\"ss01\" 1";
|
|
85
|
+
/** Enable stylistic set 02 (alternate a) */
|
|
86
|
+
readonly ss02: "\"ss02\" 1";
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Get license information for all used fonts
|
|
90
|
+
*/
|
|
91
|
+
declare function getFontLicenses(): Array<{
|
|
92
|
+
family: string;
|
|
93
|
+
license: string;
|
|
94
|
+
url?: string | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Font license compliance notice
|
|
98
|
+
*/
|
|
99
|
+
declare const fontLicenseNotice: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Typography Tokens
|
|
103
|
+
*
|
|
104
|
+
* Centralized typography configuration for the entire design system.
|
|
105
|
+
* All font-related values should come from here.
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* Primary font stack - Used for body text and UI
|
|
109
|
+
*
|
|
110
|
+
* Poppins is the primary font for English text. vivo Sans is for Chinese.
|
|
111
|
+
* Falls back through system fonts for maximum compatibility.
|
|
112
|
+
*/
|
|
113
|
+
declare const FONT_FAMILY_PRIMARY = "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
114
|
+
/**
|
|
115
|
+
* Heading font stack - Used for titles and emphasis
|
|
116
|
+
*
|
|
117
|
+
* Geist Sans is the primary display typeface.
|
|
118
|
+
*/
|
|
119
|
+
declare const FONT_FAMILY_HEADING = "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
120
|
+
/**
|
|
121
|
+
* Monospace font stack - Used for code and technical content
|
|
122
|
+
*/
|
|
123
|
+
declare const FONT_FAMILY_MONO = "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace";
|
|
124
|
+
/**
|
|
125
|
+
* CJK (Chinese/Japanese/Korean) fallback stack
|
|
126
|
+
*
|
|
127
|
+
* vivo Sans is the primary Chinese font.
|
|
128
|
+
* Provides consistent rendering for Chinese, Japanese, and Korean text.
|
|
129
|
+
*/
|
|
130
|
+
declare const FONT_FAMILY_CJK = "\"vivo Sans\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"Noto Sans SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
131
|
+
/**
|
|
132
|
+
* Complete font stacks with CJK fallback
|
|
133
|
+
*/
|
|
134
|
+
declare const fontFamilies: {
|
|
135
|
+
/** Primary UI and body text */
|
|
136
|
+
readonly primary: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
137
|
+
/** Headings and titles */
|
|
138
|
+
readonly heading: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
139
|
+
/** Code and monospace */
|
|
140
|
+
readonly mono: "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace";
|
|
141
|
+
/** CJK-specific fallback */
|
|
142
|
+
readonly cjk: "\"vivo Sans\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"Noto Sans SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
143
|
+
/** Primary with CJK fallback for multilingual content */
|
|
144
|
+
readonly primaryCJK: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"vivo Sans\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"Noto Sans SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
145
|
+
/** System font stack (fast fallback, no web fonts) */
|
|
146
|
+
readonly system: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Font size scale using rem units for accessibility
|
|
150
|
+
*
|
|
151
|
+
* Base: 16px = 1rem
|
|
152
|
+
* Each step follows a modular scale (~1.25 ratio)
|
|
153
|
+
*/
|
|
154
|
+
declare const fontSizes: {
|
|
155
|
+
/** 12px - Micro text, badges */
|
|
156
|
+
readonly xs: "0.75rem";
|
|
157
|
+
/** 14px - Small text, captions, labels */
|
|
158
|
+
readonly sm: "0.875rem";
|
|
159
|
+
/** 16px - Base body text */
|
|
160
|
+
readonly base: "1rem";
|
|
161
|
+
/** 18px - Lead text, larger body */
|
|
162
|
+
readonly lg: "1.125rem";
|
|
163
|
+
/** 20px - Small headings, subtitles */
|
|
164
|
+
readonly xl: "1.25rem";
|
|
165
|
+
/** 24px - H4 equivalent */
|
|
166
|
+
readonly "2xl": "1.5rem";
|
|
167
|
+
/** 30px - H3 equivalent */
|
|
168
|
+
readonly "3xl": "1.875rem";
|
|
169
|
+
/** 36px - H2 equivalent */
|
|
170
|
+
readonly "4xl": "2.25rem";
|
|
171
|
+
/** 48px - H1 equivalent */
|
|
172
|
+
readonly "5xl": "3rem";
|
|
173
|
+
/** 60px - Display/Hero text */
|
|
174
|
+
readonly "6xl": "3.75rem";
|
|
175
|
+
/** 72px - Large display */
|
|
176
|
+
readonly "7xl": "4.5rem";
|
|
177
|
+
/** 96px - Extra large display */
|
|
178
|
+
readonly "8xl": "6rem";
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Font size in pixels (for cases where rem isn't suitable)
|
|
182
|
+
*/
|
|
183
|
+
declare const fontSizesPx: {
|
|
184
|
+
readonly xs: 12;
|
|
185
|
+
readonly sm: 14;
|
|
186
|
+
readonly base: 16;
|
|
187
|
+
readonly lg: 18;
|
|
188
|
+
readonly xl: 20;
|
|
189
|
+
readonly "2xl": 24;
|
|
190
|
+
readonly "3xl": 30;
|
|
191
|
+
readonly "4xl": 36;
|
|
192
|
+
readonly "5xl": 48;
|
|
193
|
+
readonly "6xl": 60;
|
|
194
|
+
readonly "7xl": 72;
|
|
195
|
+
readonly "8xl": 96;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Line height scale
|
|
199
|
+
*
|
|
200
|
+
* Using unitless values for better inheritance.
|
|
201
|
+
*/
|
|
202
|
+
declare const lineHeights: {
|
|
203
|
+
/** 1 - Single line, icons */
|
|
204
|
+
readonly none: 1;
|
|
205
|
+
/** 1.25 - Tight, for large headings */
|
|
206
|
+
readonly tight: 1.25;
|
|
207
|
+
/** 1.375 - Slightly snug */
|
|
208
|
+
readonly snug: 1.375;
|
|
209
|
+
/** 1.5 - Normal body text */
|
|
210
|
+
readonly normal: 1.5;
|
|
211
|
+
/** 1.625 - Relaxed reading */
|
|
212
|
+
readonly relaxed: 1.625;
|
|
213
|
+
/** 1.75 - Loose, for small text */
|
|
214
|
+
readonly loose: 1.75;
|
|
215
|
+
/** 2 - Double spaced */
|
|
216
|
+
readonly double: 2;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Font weight scale
|
|
220
|
+
*
|
|
221
|
+
* Inter and Public Sans support all these weights.
|
|
222
|
+
* Variable fonts can use any value 100-900.
|
|
223
|
+
*/
|
|
224
|
+
declare const fontWeights: {
|
|
225
|
+
/** 100 - Thin (if available) */
|
|
226
|
+
readonly thin: 100;
|
|
227
|
+
/** 200 - Extra light */
|
|
228
|
+
readonly extralight: 200;
|
|
229
|
+
/** 300 - Light */
|
|
230
|
+
readonly light: 300;
|
|
231
|
+
/** 400 - Regular/Normal */
|
|
232
|
+
readonly normal: 400;
|
|
233
|
+
/** 500 - Medium */
|
|
234
|
+
readonly medium: 500;
|
|
235
|
+
/** 600 - Semibold */
|
|
236
|
+
readonly semibold: 600;
|
|
237
|
+
/** 700 - Bold */
|
|
238
|
+
readonly bold: 700;
|
|
239
|
+
/** 800 - Extra bold */
|
|
240
|
+
readonly extrabold: 800;
|
|
241
|
+
/** 900 - Black */
|
|
242
|
+
readonly black: 900;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Letter spacing scale
|
|
246
|
+
*
|
|
247
|
+
* Negative values for tight headlines, positive for small caps.
|
|
248
|
+
*/
|
|
249
|
+
declare const letterSpacing: {
|
|
250
|
+
/** -0.05em - Very tight, large display only */
|
|
251
|
+
readonly tighter: "-0.05em";
|
|
252
|
+
/** -0.025em - Slightly tight, headings */
|
|
253
|
+
readonly tight: "-0.025em";
|
|
254
|
+
/** 0 - Normal */
|
|
255
|
+
readonly normal: "0";
|
|
256
|
+
/** 0.025em - Slightly wide */
|
|
257
|
+
readonly wide: "0.025em";
|
|
258
|
+
/** 0.05em - Wide, for small caps */
|
|
259
|
+
readonly wider: "0.05em";
|
|
260
|
+
/** 0.1em - Very wide, all caps */
|
|
261
|
+
readonly widest: "0.1em";
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Pre-defined typography presets
|
|
265
|
+
*
|
|
266
|
+
* These combine font-family, size, weight, and line-height
|
|
267
|
+
* for common use cases.
|
|
268
|
+
*/
|
|
269
|
+
declare const typeStyles: {
|
|
270
|
+
/** Hero/Display - Large marketing headlines */
|
|
271
|
+
readonly display: {
|
|
272
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
273
|
+
readonly fontSize: "3.75rem";
|
|
274
|
+
readonly fontWeight: 700;
|
|
275
|
+
readonly lineHeight: 1.25;
|
|
276
|
+
readonly letterSpacing: "-0.025em";
|
|
277
|
+
};
|
|
278
|
+
/** H1 - Page titles */
|
|
279
|
+
readonly h1: {
|
|
280
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
281
|
+
readonly fontSize: "3rem";
|
|
282
|
+
readonly fontWeight: 700;
|
|
283
|
+
readonly lineHeight: 1.25;
|
|
284
|
+
readonly letterSpacing: "-0.025em";
|
|
285
|
+
};
|
|
286
|
+
/** H2 - Section titles */
|
|
287
|
+
readonly h2: {
|
|
288
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
289
|
+
readonly fontSize: "2.25rem";
|
|
290
|
+
readonly fontWeight: 700;
|
|
291
|
+
readonly lineHeight: 1.25;
|
|
292
|
+
readonly letterSpacing: "-0.025em";
|
|
293
|
+
};
|
|
294
|
+
/** H3 - Subsection titles */
|
|
295
|
+
readonly h3: {
|
|
296
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
297
|
+
readonly fontSize: "1.875rem";
|
|
298
|
+
readonly fontWeight: 600;
|
|
299
|
+
readonly lineHeight: 1.375;
|
|
300
|
+
readonly letterSpacing: "0";
|
|
301
|
+
};
|
|
302
|
+
/** H4 - Card titles, small sections */
|
|
303
|
+
readonly h4: {
|
|
304
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
305
|
+
readonly fontSize: "1.5rem";
|
|
306
|
+
readonly fontWeight: 600;
|
|
307
|
+
readonly lineHeight: 1.375;
|
|
308
|
+
readonly letterSpacing: "0";
|
|
309
|
+
};
|
|
310
|
+
/** H5 - Widget titles */
|
|
311
|
+
readonly h5: {
|
|
312
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
313
|
+
readonly fontSize: "1.25rem";
|
|
314
|
+
readonly fontWeight: 600;
|
|
315
|
+
readonly lineHeight: 1.5;
|
|
316
|
+
readonly letterSpacing: "0";
|
|
317
|
+
};
|
|
318
|
+
/** H6 - Smallest heading */
|
|
319
|
+
readonly h6: {
|
|
320
|
+
readonly fontFamily: "\"Geist\", \"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
321
|
+
readonly fontSize: "1.125rem";
|
|
322
|
+
readonly fontWeight: 600;
|
|
323
|
+
readonly lineHeight: 1.5;
|
|
324
|
+
readonly letterSpacing: "0";
|
|
325
|
+
};
|
|
326
|
+
/** Body - Default paragraph text */
|
|
327
|
+
readonly body: {
|
|
328
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
329
|
+
readonly fontSize: "1rem";
|
|
330
|
+
readonly fontWeight: 400;
|
|
331
|
+
readonly lineHeight: 1.5;
|
|
332
|
+
readonly letterSpacing: "0";
|
|
333
|
+
};
|
|
334
|
+
/** Body Large - Lead paragraphs */
|
|
335
|
+
readonly bodyLarge: {
|
|
336
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
337
|
+
readonly fontSize: "1.125rem";
|
|
338
|
+
readonly fontWeight: 400;
|
|
339
|
+
readonly lineHeight: 1.625;
|
|
340
|
+
readonly letterSpacing: "0";
|
|
341
|
+
};
|
|
342
|
+
/** Body Small - Secondary text */
|
|
343
|
+
readonly bodySmall: {
|
|
344
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
345
|
+
readonly fontSize: "0.875rem";
|
|
346
|
+
readonly fontWeight: 400;
|
|
347
|
+
readonly lineHeight: 1.5;
|
|
348
|
+
readonly letterSpacing: "0";
|
|
349
|
+
};
|
|
350
|
+
/** Caption - Image captions, timestamps */
|
|
351
|
+
readonly caption: {
|
|
352
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
353
|
+
readonly fontSize: "0.75rem";
|
|
354
|
+
readonly fontWeight: 400;
|
|
355
|
+
readonly lineHeight: 1.5;
|
|
356
|
+
readonly letterSpacing: "0.025em";
|
|
357
|
+
};
|
|
358
|
+
/** Label - Form labels, UI labels */
|
|
359
|
+
readonly label: {
|
|
360
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
361
|
+
readonly fontSize: "0.875rem";
|
|
362
|
+
readonly fontWeight: 500;
|
|
363
|
+
readonly lineHeight: 1.25;
|
|
364
|
+
readonly letterSpacing: "0";
|
|
365
|
+
};
|
|
366
|
+
/** Button - Button text */
|
|
367
|
+
readonly button: {
|
|
368
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
369
|
+
readonly fontSize: "0.875rem";
|
|
370
|
+
readonly fontWeight: 500;
|
|
371
|
+
readonly lineHeight: 1.25;
|
|
372
|
+
readonly letterSpacing: "0.025em";
|
|
373
|
+
};
|
|
374
|
+
/** Code - Inline code */
|
|
375
|
+
readonly code: {
|
|
376
|
+
readonly fontFamily: "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace";
|
|
377
|
+
readonly fontSize: "0.875rem";
|
|
378
|
+
readonly fontWeight: 400;
|
|
379
|
+
readonly lineHeight: 1.5;
|
|
380
|
+
readonly letterSpacing: "0";
|
|
381
|
+
};
|
|
382
|
+
/** Code Block - Code blocks */
|
|
383
|
+
readonly codeBlock: {
|
|
384
|
+
readonly fontFamily: "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace";
|
|
385
|
+
readonly fontSize: "0.875rem";
|
|
386
|
+
readonly fontWeight: 400;
|
|
387
|
+
readonly lineHeight: 1.625;
|
|
388
|
+
readonly letterSpacing: "0";
|
|
389
|
+
};
|
|
390
|
+
/** Overline - Small caps labels */
|
|
391
|
+
readonly overline: {
|
|
392
|
+
readonly fontFamily: "\"Poppins\", \"vivo Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans SC\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
393
|
+
readonly fontSize: "0.75rem";
|
|
394
|
+
readonly fontWeight: 600;
|
|
395
|
+
readonly lineHeight: 1.5;
|
|
396
|
+
readonly letterSpacing: "0.1em";
|
|
397
|
+
readonly textTransform: "uppercase";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
type TypeStyle = keyof typeof typeStyles;
|
|
401
|
+
/**
|
|
402
|
+
* Fluid typography clamp values
|
|
403
|
+
*
|
|
404
|
+
* Format: clamp(min, preferred, max)
|
|
405
|
+
* Uses viewport width for smooth scaling.
|
|
406
|
+
*/
|
|
407
|
+
declare const fluidFontSizes: {
|
|
408
|
+
/** Display: 36px to 72px */
|
|
409
|
+
readonly display: "clamp(2.25rem, 5vw + 1rem, 4.5rem)";
|
|
410
|
+
/** H1: 30px to 48px */
|
|
411
|
+
readonly h1: "clamp(1.875rem, 4vw + 0.5rem, 3rem)";
|
|
412
|
+
/** H2: 24px to 36px */
|
|
413
|
+
readonly h2: "clamp(1.5rem, 3vw + 0.5rem, 2.25rem)";
|
|
414
|
+
/** H3: 20px to 30px */
|
|
415
|
+
readonly h3: "clamp(1.25rem, 2vw + 0.5rem, 1.875rem)";
|
|
416
|
+
/** Body: 14px to 18px */
|
|
417
|
+
readonly body: "clamp(0.875rem, 1vw + 0.5rem, 1.125rem)";
|
|
418
|
+
};
|
|
419
|
+
type FontFamily = keyof typeof fontFamilies;
|
|
420
|
+
type FontSize = keyof typeof fontSizes;
|
|
421
|
+
type LineHeight = keyof typeof lineHeights;
|
|
422
|
+
type FontWeight = keyof typeof fontWeights;
|
|
423
|
+
type LetterSpacing = keyof typeof letterSpacing;
|
|
424
|
+
|
|
425
|
+
export { FONT_FAMILY_CJK, FONT_FAMILY_HEADING, FONT_FAMILY_MONO, FONT_FAMILY_PRIMARY, type FontConfig, type FontFamily, type FontSize, type FontWeight, type LetterSpacing, type LineHeight, type TypeStyle, allFonts, areFontsLoaded, cjkFonts, defaultFonts, fluidFontSizes, fontFamilies, fontFeatureSettings, fontLicenseNotice, fontSizes, fontSizesPx, fontSmoothing, fontWeights, fonts, getFontLicenses, getFontPreloadLinks, getGoogleFontsLink, getGoogleFontsUrl, letterSpacing, lineHeights, typeStyles, waitForFonts };
|