@newtonedev/components 0.1.7 → 0.1.9
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/composites/actions/Button/Button.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts.map +1 -1
- package/dist/fonts/GoogleFontLoader.d.ts +5 -4
- package/dist/fonts/GoogleFontLoader.d.ts.map +1 -1
- package/dist/fonts/SelfHostedFontLoader.d.ts +14 -0
- package/dist/fonts/SelfHostedFontLoader.d.ts.map +1 -0
- package/dist/fonts/buildGoogleFontsUrl.d.ts +1 -16
- package/dist/fonts/buildGoogleFontsUrl.d.ts.map +1 -1
- package/dist/fonts/measureFont.d.ts +18 -0
- package/dist/fonts/measureFont.d.ts.map +1 -0
- package/dist/fonts/reportQueue.d.ts +7 -0
- package/dist/fonts/reportQueue.d.ts.map +1 -0
- package/dist/fonts/useLocalCalibration.d.ts +19 -0
- package/dist/fonts/useLocalCalibration.d.ts.map +1 -0
- package/dist/fonts/useTypographyCalibrations.d.ts +11 -0
- package/dist/fonts/useTypographyCalibrations.d.ts.map +1 -0
- package/dist/index.cjs +629 -422
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +568 -376
- package/dist/index.js.map +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -1
- package/dist/primitives/Text/Text.d.ts +33 -8
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.spans.d.ts +22 -0
- package/dist/primitives/Text/Text.spans.d.ts.map +1 -0
- package/dist/primitives/Text/Text.types.d.ts +77 -27
- package/dist/primitives/Text/Text.types.d.ts.map +1 -1
- package/dist/primitives/Text/index.d.ts +23 -2
- package/dist/primitives/Text/index.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/registry/codegen.d.ts.map +1 -1
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/types.d.ts +2 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/theme/NewtoneProvider.d.ts +9 -1
- package/dist/theme/NewtoneProvider.d.ts.map +1 -1
- package/dist/theme/defaults.d.ts +1 -0
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/types.d.ts +48 -32
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/useBreakpoint.d.ts +9 -0
- package/dist/theme/useBreakpoint.d.ts.map +1 -0
- package/dist/tokens/computeTokens.d.ts +9 -22
- package/dist/tokens/computeTokens.d.ts.map +1 -1
- package/dist/tokens/types.d.ts +40 -22
- package/dist/tokens/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/composites/actions/Button/Button.styles.ts +3 -3
- package/src/composites/actions/Button/Button.tsx +3 -2
- package/src/composites/form-controls/Select/Select.styles.ts +8 -8
- package/src/composites/form-controls/Select/Select.tsx +1 -1
- package/src/composites/form-controls/Select/SelectOption.tsx +3 -3
- package/src/composites/form-controls/TextInput/TextInput.styles.ts +5 -5
- package/src/composites/form-controls/Toggle/Toggle.styles.ts +3 -3
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +6 -6
- package/src/composites/range-inputs/HueSlider/HueSlider.styles.ts +9 -9
- package/src/composites/range-inputs/Slider/Slider.styles.ts +9 -9
- package/src/fonts/GoogleFontLoader.tsx +25 -10
- package/src/fonts/SelfHostedFontLoader.tsx +44 -0
- package/src/fonts/buildGoogleFontsUrl.ts +2 -31
- package/src/fonts/measureFont.ts +42 -0
- package/src/fonts/reportQueue.ts +54 -0
- package/src/fonts/useLocalCalibration.ts +97 -0
- package/src/fonts/useTypographyCalibrations.ts +15 -0
- package/src/index.ts +16 -7
- package/src/primitives/Frame/Frame.tsx +3 -3
- package/src/primitives/Icon/Icon.tsx +1 -1
- package/src/primitives/Icon/Icon.types.ts +1 -1
- package/src/primitives/Text/Text.spans.ts +57 -0
- package/src/primitives/Text/Text.tsx +208 -53
- package/src/primitives/Text/Text.types.ts +83 -27
- package/src/primitives/Text/index.ts +27 -3
- package/src/primitives/index.ts +3 -2
- package/src/registry/codegen.ts +1 -0
- package/src/registry/registry.ts +55 -53
- package/src/registry/types.ts +2 -0
- package/src/theme/NewtoneProvider.tsx +18 -2
- package/src/theme/defaults.ts +8 -28
- package/src/theme/types.ts +63 -33
- package/src/theme/useBreakpoint.ts +14 -0
- package/src/tokens/computeTokens.ts +23 -19
- package/src/tokens/types.ts +10 -24
- package/dist/fonts/googleFonts.d.ts +0 -20
- package/dist/fonts/googleFonts.d.ts.map +0 -1
- package/src/fonts/googleFonts.ts +0 -87
package/src/theme/types.ts
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import type { DynamicRange, PaletteConfig } from 'newtone';
|
|
2
2
|
|
|
3
|
+
// Re-export font/typography types from @newtonedev/fonts (canonical source)
|
|
4
|
+
export type {
|
|
5
|
+
FontConfig,
|
|
6
|
+
FontWeights,
|
|
7
|
+
FontSlot,
|
|
8
|
+
FontSizeScale,
|
|
9
|
+
LineHeightScale,
|
|
10
|
+
RoleSizeStep,
|
|
11
|
+
RoleScale,
|
|
12
|
+
RoleScales,
|
|
13
|
+
BreakpointKey,
|
|
14
|
+
Breakpoints,
|
|
15
|
+
BreakpointRoleScales,
|
|
16
|
+
FontRuntimeMetrics,
|
|
17
|
+
} from '@newtonedev/fonts';
|
|
18
|
+
import type { FontSlot, FontSizeScale, LineHeightScale, RoleScales, BreakpointRoleScales, FontRuntimeMetrics, TextRole } from '@newtonedev/fonts';
|
|
19
|
+
|
|
3
20
|
/**
|
|
4
21
|
* Color mode: light or dark
|
|
5
22
|
*/
|
|
6
23
|
export type ColorMode = 'light' | 'dark';
|
|
7
24
|
|
|
8
|
-
/**
|
|
9
|
-
* Font configuration for a single font slot
|
|
10
|
-
*/
|
|
11
|
-
export interface FontConfig {
|
|
12
|
-
readonly type: 'system' | 'google' | 'custom';
|
|
13
|
-
readonly family: string; // 'ui-monospace' | 'Roboto' | custom name
|
|
14
|
-
readonly customUrl?: string; // Supabase Storage URL for custom fonts
|
|
15
|
-
readonly fallback: string; // CSS fallback stack
|
|
16
|
-
}
|
|
17
|
-
|
|
18
25
|
/**
|
|
19
26
|
* Elevation levels for surfaces (internal)
|
|
20
27
|
* 0 = sunken, 1 = default, 2 = elevated
|
|
@@ -118,30 +125,46 @@ export interface NewtoneThemeConfig {
|
|
|
118
125
|
};
|
|
119
126
|
readonly typography: {
|
|
120
127
|
readonly fonts: {
|
|
121
|
-
readonly
|
|
122
|
-
readonly display:
|
|
123
|
-
readonly
|
|
124
|
-
|
|
125
|
-
readonly scale: {
|
|
126
|
-
readonly xs: number; // baseSize / ratio^2
|
|
127
|
-
readonly sm: number; // baseSize / ratio
|
|
128
|
-
readonly base: number; // baseSize
|
|
129
|
-
readonly md: number; // baseSize * ratio
|
|
130
|
-
readonly lg: number; // baseSize * ratio^2
|
|
131
|
-
readonly xl: number; // baseSize * ratio^3
|
|
132
|
-
readonly xxl: number; // baseSize * ratio^4
|
|
133
|
-
};
|
|
134
|
-
readonly lineHeight: {
|
|
135
|
-
readonly tight: number; // 1.25
|
|
136
|
-
readonly normal: number; // 1.5
|
|
137
|
-
readonly relaxed: number; // 1.75
|
|
138
|
-
};
|
|
139
|
-
readonly fontWeight: {
|
|
140
|
-
readonly regular: number; // 400
|
|
141
|
-
readonly medium: number; // 500
|
|
142
|
-
readonly semibold: number; // 600
|
|
143
|
-
readonly bold: number; // 700
|
|
128
|
+
readonly main: FontSlot; // Default/body font (fallback for all scopes)
|
|
129
|
+
readonly display: FontSlot; // Headlines, titles, large display text
|
|
130
|
+
readonly mono: FontSlot; // Code snippets, technical content
|
|
131
|
+
readonly currency: FontSlot; // Monetary amounts, financial data
|
|
144
132
|
};
|
|
133
|
+
/** Primitive font size scale — numbered tokens ('01'-'16'), values in px. */
|
|
134
|
+
readonly fontSizes: FontSizeScale;
|
|
135
|
+
/** Primitive line height scale — numbered tokens ('01'-'16'), values in px. */
|
|
136
|
+
readonly lineHeights: LineHeightScale;
|
|
137
|
+
/** Role mapping — pairs fontSizes and lineHeights for each role x size combination. */
|
|
138
|
+
readonly roles: RoleScales;
|
|
139
|
+
/**
|
|
140
|
+
* Per-font avgCharWidth ratios, keyed by font family name.
|
|
141
|
+
* Measured with canvas at editor publish time (Layer 1 calibration).
|
|
142
|
+
* Used by resolveResponsiveSize to improve line break estimation accuracy.
|
|
143
|
+
* Falls back to 0.55 when absent.
|
|
144
|
+
*/
|
|
145
|
+
readonly calibrations?: Record<string, number>;
|
|
146
|
+
/**
|
|
147
|
+
* Pre-computed role scales for each viewport breakpoint (sm/md/lg).
|
|
148
|
+
* Enables CSS-only consumers to generate @media rules from the theme JSON
|
|
149
|
+
* without importing newtone-fonts. Runtime components use useBreakpoint
|
|
150
|
+
* instead and compute scaling on the fly.
|
|
151
|
+
*/
|
|
152
|
+
readonly breakpointRoles?: BreakpointRoleScales;
|
|
153
|
+
/**
|
|
154
|
+
* Per-font OpenType-derived metrics, keyed by font family name.
|
|
155
|
+
* Extracted from font binaries at upload time, looked up at publish time.
|
|
156
|
+
* Used by Text for line height correction (adjustLineHeight),
|
|
157
|
+
* vertical centering (verticalCenterOffset), and font feature validation.
|
|
158
|
+
* Falls back to Inter-equivalent defaults when absent.
|
|
159
|
+
*/
|
|
160
|
+
readonly fontMetrics?: Readonly<Record<string, FontRuntimeMetrics>>;
|
|
161
|
+
/**
|
|
162
|
+
* Per-role font weight (CSS font-weight 100–900).
|
|
163
|
+
* Primary weight path — the Text component uses these values directly.
|
|
164
|
+
* When populated via toThemeConfig, defaults are merged with user overrides.
|
|
165
|
+
* Per-instance weight prop still takes priority.
|
|
166
|
+
*/
|
|
167
|
+
readonly roleWeights?: Partial<Record<TextRole, number>>;
|
|
145
168
|
};
|
|
146
169
|
readonly icons: {
|
|
147
170
|
readonly variant: 'outlined' | 'rounded' | 'sharp';
|
|
@@ -158,4 +181,11 @@ export interface NewtoneThemeContext {
|
|
|
158
181
|
readonly config: NewtoneThemeConfig;
|
|
159
182
|
readonly mode: ColorMode;
|
|
160
183
|
readonly setMode: (mode: ColorMode) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Optional URL for the typography telemetry reporting endpoint.
|
|
186
|
+
* When set, the Text component (in responsive mode) will batch and POST
|
|
187
|
+
* ObserverPayload observations to this URL for cross-site aggregation.
|
|
188
|
+
* When absent, no telemetry is sent (opt-in).
|
|
189
|
+
*/
|
|
190
|
+
readonly reportingEndpoint?: string;
|
|
161
191
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useWindowDimensions } from 'react-native';
|
|
2
|
+
import { getBreakpointForWidth } from '@newtonedev/fonts';
|
|
3
|
+
import type { BreakpointKey } from '@newtonedev/fonts';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the current viewport breakpoint key ('sm' | 'md' | 'lg').
|
|
7
|
+
*
|
|
8
|
+
* Uses `useWindowDimensions` from react-native (cross-platform — works
|
|
9
|
+
* on web via react-native-web) and re-evaluates on window resize.
|
|
10
|
+
*/
|
|
11
|
+
export function useBreakpoint(): BreakpointKey {
|
|
12
|
+
const { width } = useWindowDimensions();
|
|
13
|
+
return getBreakpointForWidth(width);
|
|
14
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getColor } from 'newtone';
|
|
2
2
|
import type { PaletteConfig } from 'newtone';
|
|
3
|
-
import
|
|
3
|
+
import { fontConfigToFamily } from '@newtonedev/fonts';
|
|
4
|
+
import type { ColorSystemConfig, ColorMode, ElevationLevel, FontSlot, TokenOverrides } from '../theme/types';
|
|
4
5
|
import type { ResolvedTokens, PaletteTokens } from './types';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -115,14 +116,6 @@ export const ERROR_DEFAULTS: PaletteDefaults = {
|
|
|
115
116
|
},
|
|
116
117
|
};
|
|
117
118
|
|
|
118
|
-
/**
|
|
119
|
-
* Convert FontConfig to CSS font-family string
|
|
120
|
-
*/
|
|
121
|
-
function fontConfigToFamily(font: FontConfig): string {
|
|
122
|
-
const family = font.family.includes(' ') ? `"${font.family}"` : font.family;
|
|
123
|
-
return `${family}, ${font.fallback}`;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
119
|
const clamp = (n: number) => Math.max(0, Math.min(1, n));
|
|
127
120
|
|
|
128
121
|
/**
|
|
@@ -262,10 +255,9 @@ export function computeTokens(
|
|
|
262
255
|
spacing: { readonly '00': number; readonly '02': number; readonly '04': number; readonly '06': number; readonly '08': number; readonly '10': number; readonly '12': number; readonly '16': number; readonly '20': number; readonly '24': number; readonly '32': number; readonly '40': number; readonly '48': number },
|
|
263
256
|
radius: { readonly none: number; readonly sm: number; readonly md: number; readonly lg: number; readonly xl: number; readonly pill: 999 },
|
|
264
257
|
typography: {
|
|
265
|
-
readonly fonts: { readonly
|
|
266
|
-
readonly
|
|
267
|
-
readonly
|
|
268
|
-
readonly fontWeight: { readonly regular: number; readonly medium: number; readonly semibold: number; readonly bold: number };
|
|
258
|
+
readonly fonts: { readonly main: FontSlot; readonly display: FontSlot; readonly mono: FontSlot; readonly currency: FontSlot };
|
|
259
|
+
readonly fontSizes: { readonly [key: string]: number };
|
|
260
|
+
readonly lineHeights: { readonly [key: string]: number };
|
|
269
261
|
},
|
|
270
262
|
icons: {
|
|
271
263
|
readonly variant: 'outlined' | 'rounded' | 'sharp';
|
|
@@ -493,13 +485,25 @@ export function computeTokens(
|
|
|
493
485
|
radius,
|
|
494
486
|
typography: {
|
|
495
487
|
fonts: {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
488
|
+
main: {
|
|
489
|
+
family: fontConfigToFamily(typography.fonts.main.config),
|
|
490
|
+
weights: typography.fonts.main.weights,
|
|
491
|
+
},
|
|
492
|
+
display: {
|
|
493
|
+
family: fontConfigToFamily(typography.fonts.display.config),
|
|
494
|
+
weights: typography.fonts.display.weights,
|
|
495
|
+
},
|
|
496
|
+
mono: {
|
|
497
|
+
family: fontConfigToFamily(typography.fonts.mono.config),
|
|
498
|
+
weights: typography.fonts.mono.weights,
|
|
499
|
+
},
|
|
500
|
+
currency: {
|
|
501
|
+
family: fontConfigToFamily(typography.fonts.currency.config),
|
|
502
|
+
weights: typography.fonts.currency.weights,
|
|
503
|
+
},
|
|
499
504
|
},
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
weight: typography.fontWeight,
|
|
505
|
+
fontSizes: typography.fontSizes,
|
|
506
|
+
lineHeights: typography.lineHeights,
|
|
503
507
|
},
|
|
504
508
|
icons: {
|
|
505
509
|
variant: icons.variant,
|
package/src/tokens/types.ts
CHANGED
|
@@ -123,33 +123,19 @@ export interface ResolvedTokens {
|
|
|
123
123
|
readonly xl: number;
|
|
124
124
|
readonly pill: 999;
|
|
125
125
|
};
|
|
126
|
-
/** Typography tokens for fonts
|
|
126
|
+
/** Typography tokens for fonts (per-scope) and primitive size/lineHeight scales */
|
|
127
127
|
readonly typography: {
|
|
128
|
+
/** Per-scope font family + weight mapping */
|
|
128
129
|
readonly fonts: {
|
|
129
|
-
readonly
|
|
130
|
-
readonly display: string;
|
|
131
|
-
readonly
|
|
132
|
-
|
|
133
|
-
readonly size: {
|
|
134
|
-
readonly xs: number;
|
|
135
|
-
readonly sm: number;
|
|
136
|
-
readonly base: number;
|
|
137
|
-
readonly md: number;
|
|
138
|
-
readonly lg: number;
|
|
139
|
-
readonly xl: number;
|
|
140
|
-
readonly xxl: number;
|
|
141
|
-
};
|
|
142
|
-
readonly lineHeight: {
|
|
143
|
-
readonly tight: number;
|
|
144
|
-
readonly normal: number;
|
|
145
|
-
readonly relaxed: number;
|
|
146
|
-
};
|
|
147
|
-
readonly weight: {
|
|
148
|
-
readonly regular: number;
|
|
149
|
-
readonly medium: number;
|
|
150
|
-
readonly semibold: number;
|
|
151
|
-
readonly bold: number;
|
|
130
|
+
readonly main: { readonly family: string; readonly weights: { readonly regular: number; readonly medium: number; readonly bold: number; } };
|
|
131
|
+
readonly display: { readonly family: string; readonly weights: { readonly regular: number; readonly medium: number; readonly bold: number; } };
|
|
132
|
+
readonly mono: { readonly family: string; readonly weights: { readonly regular: number; readonly medium: number; readonly bold: number; } };
|
|
133
|
+
readonly currency: { readonly family: string; readonly weights: { readonly regular: number; readonly medium: number; readonly bold: number; } };
|
|
152
134
|
};
|
|
135
|
+
/** Primitive font size scale — numbered tokens ('01'–'16'), values in px */
|
|
136
|
+
readonly fontSizes: { readonly [key: string]: number };
|
|
137
|
+
/** Primitive line height scale — numbered tokens ('01'–'16'), values in px */
|
|
138
|
+
readonly lineHeights: { readonly [key: string]: number };
|
|
153
139
|
};
|
|
154
140
|
/** Icon tokens for Material Symbols configuration */
|
|
155
141
|
readonly icons: {
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface GoogleFontEntry {
|
|
2
|
-
readonly family: string;
|
|
3
|
-
readonly category: 'sans-serif' | 'serif' | 'monospace' | 'display';
|
|
4
|
-
readonly fallback: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Curated list of popular Google Fonts organized by category.
|
|
8
|
-
* Used by the font picker UI and the GoogleFontLoader.
|
|
9
|
-
*/
|
|
10
|
-
export declare const GOOGLE_FONTS: readonly GoogleFontEntry[];
|
|
11
|
-
export interface SystemFontEntry {
|
|
12
|
-
readonly family: string;
|
|
13
|
-
readonly category: 'sans-serif' | 'serif' | 'monospace';
|
|
14
|
-
readonly fallback: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* System font options that don't require external loading.
|
|
18
|
-
*/
|
|
19
|
-
export declare const SYSTEM_FONTS: readonly SystemFontEntry[];
|
|
20
|
-
//# sourceMappingURL=googleFonts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"googleFonts.d.ts","sourceRoot":"","sources":["../../src/fonts/googleFonts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,eAAe,EAiDlD,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,eAAe,EAgBlD,CAAC"}
|
package/src/fonts/googleFonts.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export interface GoogleFontEntry {
|
|
2
|
-
readonly family: string;
|
|
3
|
-
readonly category: 'sans-serif' | 'serif' | 'monospace' | 'display';
|
|
4
|
-
readonly fallback: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Curated list of popular Google Fonts organized by category.
|
|
9
|
-
* Used by the font picker UI and the GoogleFontLoader.
|
|
10
|
-
*/
|
|
11
|
-
export const GOOGLE_FONTS: readonly GoogleFontEntry[] = [
|
|
12
|
-
// Sans-serif
|
|
13
|
-
{ family: 'Inter', category: 'sans-serif', fallback: 'sans-serif' },
|
|
14
|
-
{ family: 'Roboto', category: 'sans-serif', fallback: 'sans-serif' },
|
|
15
|
-
{ family: 'Open Sans', category: 'sans-serif', fallback: 'sans-serif' },
|
|
16
|
-
{ family: 'Lato', category: 'sans-serif', fallback: 'sans-serif' },
|
|
17
|
-
{ family: 'Montserrat', category: 'sans-serif', fallback: 'sans-serif' },
|
|
18
|
-
{ family: 'Poppins', category: 'sans-serif', fallback: 'sans-serif' },
|
|
19
|
-
{ family: 'Nunito', category: 'sans-serif', fallback: 'sans-serif' },
|
|
20
|
-
{ family: 'Source Sans 3', category: 'sans-serif', fallback: 'sans-serif' },
|
|
21
|
-
{ family: 'Work Sans', category: 'sans-serif', fallback: 'sans-serif' },
|
|
22
|
-
{ family: 'Raleway', category: 'sans-serif', fallback: 'sans-serif' },
|
|
23
|
-
{ family: 'DM Sans', category: 'sans-serif', fallback: 'sans-serif' },
|
|
24
|
-
{ family: 'Plus Jakarta Sans', category: 'sans-serif', fallback: 'sans-serif' },
|
|
25
|
-
{ family: 'Outfit', category: 'sans-serif', fallback: 'sans-serif' },
|
|
26
|
-
{ family: 'Space Grotesk', category: 'sans-serif', fallback: 'sans-serif' },
|
|
27
|
-
{ family: 'Manrope', category: 'sans-serif', fallback: 'sans-serif' },
|
|
28
|
-
|
|
29
|
-
// Serif
|
|
30
|
-
{ family: 'Playfair Display', category: 'serif', fallback: 'serif' },
|
|
31
|
-
{ family: 'Merriweather', category: 'serif', fallback: 'serif' },
|
|
32
|
-
{ family: 'Lora', category: 'serif', fallback: 'serif' },
|
|
33
|
-
{ family: 'Libre Baskerville', category: 'serif', fallback: 'serif' },
|
|
34
|
-
{ family: 'Source Serif 4', category: 'serif', fallback: 'serif' },
|
|
35
|
-
{ family: 'Bitter', category: 'serif', fallback: 'serif' },
|
|
36
|
-
{ family: 'Cormorant Garamond', category: 'serif', fallback: 'serif' },
|
|
37
|
-
{ family: 'EB Garamond', category: 'serif', fallback: 'serif' },
|
|
38
|
-
{ family: 'Crimson Text', category: 'serif', fallback: 'serif' },
|
|
39
|
-
{ family: 'Noto Serif', category: 'serif', fallback: 'serif' },
|
|
40
|
-
|
|
41
|
-
// Monospace
|
|
42
|
-
{ family: 'Fira Code', category: 'monospace', fallback: 'monospace' },
|
|
43
|
-
{ family: 'JetBrains Mono', category: 'monospace', fallback: 'monospace' },
|
|
44
|
-
{ family: 'Source Code Pro', category: 'monospace', fallback: 'monospace' },
|
|
45
|
-
{ family: 'IBM Plex Mono', category: 'monospace', fallback: 'monospace' },
|
|
46
|
-
{ family: 'Roboto Mono', category: 'monospace', fallback: 'monospace' },
|
|
47
|
-
{ family: 'Space Mono', category: 'monospace', fallback: 'monospace' },
|
|
48
|
-
{ family: 'Ubuntu Mono', category: 'monospace', fallback: 'monospace' },
|
|
49
|
-
{ family: 'Inconsolata', category: 'monospace', fallback: 'monospace' },
|
|
50
|
-
|
|
51
|
-
// Display
|
|
52
|
-
{ family: 'Abril Fatface', category: 'display', fallback: 'serif' },
|
|
53
|
-
{ family: 'Bebas Neue', category: 'display', fallback: 'sans-serif' },
|
|
54
|
-
{ family: 'Oswald', category: 'display', fallback: 'sans-serif' },
|
|
55
|
-
{ family: 'Righteous', category: 'display', fallback: 'sans-serif' },
|
|
56
|
-
{ family: 'Lobster', category: 'display', fallback: 'cursive' },
|
|
57
|
-
{ family: 'Pacifico', category: 'display', fallback: 'cursive' },
|
|
58
|
-
{ family: 'Comfortaa', category: 'display', fallback: 'sans-serif' },
|
|
59
|
-
{ family: 'Fredoka', category: 'display', fallback: 'sans-serif' },
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
export interface SystemFontEntry {
|
|
63
|
-
readonly family: string;
|
|
64
|
-
readonly category: 'sans-serif' | 'serif' | 'monospace';
|
|
65
|
-
readonly fallback: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* System font options that don't require external loading.
|
|
70
|
-
*/
|
|
71
|
-
export const SYSTEM_FONTS: readonly SystemFontEntry[] = [
|
|
72
|
-
{
|
|
73
|
-
family: 'system-ui',
|
|
74
|
-
category: 'sans-serif',
|
|
75
|
-
fallback: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
family: 'ui-monospace',
|
|
79
|
-
category: 'monospace',
|
|
80
|
-
fallback: 'SFMono-Regular, Menlo, Monaco, Consolas, monospace',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
family: 'ui-serif',
|
|
84
|
-
category: 'serif',
|
|
85
|
-
fallback: 'Georgia, "Times New Roman", serif',
|
|
86
|
-
},
|
|
87
|
-
];
|