@cdx-ui/styles 0.0.1-beta.5 → 0.0.1-beta.51
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 +50 -19
- package/css/theme.css +104 -45
- package/css/vanilla.css +61 -29
- package/lib/commonjs/index.js +80 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/useCdxFonts.js +7 -231
- package/lib/commonjs/useCdxFonts.js.map +1 -1
- package/lib/commonjs/useForgeFonts.js +237 -0
- package/lib/commonjs/useForgeFonts.js.map +1 -0
- package/lib/module/index.js +50 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/useCdxFonts.js +2 -220
- package/lib/module/useCdxFonts.js.map +1 -1
- package/lib/module/useForgeFonts.js +223 -0
- package/lib/module/useForgeFonts.js.map +1 -0
- package/lib/typescript/index.d.ts +47 -14
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/useCdxFonts.d.ts +2 -11
- package/lib/typescript/useCdxFonts.d.ts.map +1 -1
- package/lib/typescript/useForgeFonts.d.ts +12 -0
- package/lib/typescript/useForgeFonts.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +60 -14
- package/src/useCdxFonts.ts +2 -230
- package/src/useForgeFonts.ts +230 -0
- package/tokens/presets/.manifest.json +3 -3
- package/tokens/presets/poise.json +158 -30
- package/tokens/presets/prestige.json +1 -1
- package/tokens/presets/pulse.json +1 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { useFonts } from 'expo-font';
|
|
5
|
+
// Crimson Pro
|
|
6
|
+
import { CrimsonPro_400Regular } from '@expo-google-fonts/crimson-pro/400Regular';
|
|
7
|
+
import { CrimsonPro_500Medium } from '@expo-google-fonts/crimson-pro/500Medium';
|
|
8
|
+
import { CrimsonPro_600SemiBold } from '@expo-google-fonts/crimson-pro/600SemiBold';
|
|
9
|
+
import { CrimsonPro_700Bold } from '@expo-google-fonts/crimson-pro/700Bold';
|
|
10
|
+
import { CrimsonPro_400Regular_Italic } from '@expo-google-fonts/crimson-pro/400Regular_Italic';
|
|
11
|
+
import { CrimsonPro_500Medium_Italic } from '@expo-google-fonts/crimson-pro/500Medium_Italic';
|
|
12
|
+
import { CrimsonPro_600SemiBold_Italic } from '@expo-google-fonts/crimson-pro/600SemiBold_Italic';
|
|
13
|
+
import { CrimsonPro_700Bold_Italic } from '@expo-google-fonts/crimson-pro/700Bold_Italic';
|
|
14
|
+
// Bitter
|
|
15
|
+
import { Bitter_400Regular } from '@expo-google-fonts/bitter/400Regular';
|
|
16
|
+
import { Bitter_500Medium } from '@expo-google-fonts/bitter/500Medium';
|
|
17
|
+
import { Bitter_600SemiBold } from '@expo-google-fonts/bitter/600SemiBold';
|
|
18
|
+
import { Bitter_700Bold } from '@expo-google-fonts/bitter/700Bold';
|
|
19
|
+
import { Bitter_400Regular_Italic } from '@expo-google-fonts/bitter/400Regular_Italic';
|
|
20
|
+
import { Bitter_500Medium_Italic } from '@expo-google-fonts/bitter/500Medium_Italic';
|
|
21
|
+
import { Bitter_600SemiBold_Italic } from '@expo-google-fonts/bitter/600SemiBold_Italic';
|
|
22
|
+
import { Bitter_700Bold_Italic } from '@expo-google-fonts/bitter/700Bold_Italic';
|
|
23
|
+
// DM Sans
|
|
24
|
+
import { DMSans_400Regular } from '@expo-google-fonts/dm-sans/400Regular';
|
|
25
|
+
import { DMSans_500Medium } from '@expo-google-fonts/dm-sans/500Medium';
|
|
26
|
+
import { DMSans_600SemiBold } from '@expo-google-fonts/dm-sans/600SemiBold';
|
|
27
|
+
import { DMSans_700Bold } from '@expo-google-fonts/dm-sans/700Bold';
|
|
28
|
+
import { DMSans_400Regular_Italic } from '@expo-google-fonts/dm-sans/400Regular_Italic';
|
|
29
|
+
import { DMSans_500Medium_Italic } from '@expo-google-fonts/dm-sans/500Medium_Italic';
|
|
30
|
+
import { DMSans_600SemiBold_Italic } from '@expo-google-fonts/dm-sans/600SemiBold_Italic';
|
|
31
|
+
import { DMSans_700Bold_Italic } from '@expo-google-fonts/dm-sans/700Bold_Italic';
|
|
32
|
+
// Libre Caslon Text — weights 400 + 700 only; italic at 400 only
|
|
33
|
+
import { LibreCaslonText_400Regular } from '@expo-google-fonts/libre-caslon-text/400Regular';
|
|
34
|
+
import { LibreCaslonText_700Bold } from '@expo-google-fonts/libre-caslon-text/700Bold';
|
|
35
|
+
import { LibreCaslonText_400Regular_Italic } from '@expo-google-fonts/libre-caslon-text/400Regular_Italic';
|
|
36
|
+
// Cormorant
|
|
37
|
+
import { Cormorant_400Regular } from '@expo-google-fonts/cormorant/400Regular';
|
|
38
|
+
import { Cormorant_500Medium } from '@expo-google-fonts/cormorant/500Medium';
|
|
39
|
+
import { Cormorant_600SemiBold } from '@expo-google-fonts/cormorant/600SemiBold';
|
|
40
|
+
import { Cormorant_700Bold } from '@expo-google-fonts/cormorant/700Bold';
|
|
41
|
+
import { Cormorant_400Regular_Italic } from '@expo-google-fonts/cormorant/400Regular_Italic';
|
|
42
|
+
import { Cormorant_500Medium_Italic } from '@expo-google-fonts/cormorant/500Medium_Italic';
|
|
43
|
+
import { Cormorant_600SemiBold_Italic } from '@expo-google-fonts/cormorant/600SemiBold_Italic';
|
|
44
|
+
import { Cormorant_700Bold_Italic } from '@expo-google-fonts/cormorant/700Bold_Italic';
|
|
45
|
+
// Libre Franklin
|
|
46
|
+
import { LibreFranklin_400Regular } from '@expo-google-fonts/libre-franklin/400Regular';
|
|
47
|
+
import { LibreFranklin_500Medium } from '@expo-google-fonts/libre-franklin/500Medium';
|
|
48
|
+
import { LibreFranklin_600SemiBold } from '@expo-google-fonts/libre-franklin/600SemiBold';
|
|
49
|
+
import { LibreFranklin_700Bold } from '@expo-google-fonts/libre-franklin/700Bold';
|
|
50
|
+
import { LibreFranklin_400Regular_Italic } from '@expo-google-fonts/libre-franklin/400Regular_Italic';
|
|
51
|
+
import { LibreFranklin_500Medium_Italic } from '@expo-google-fonts/libre-franklin/500Medium_Italic';
|
|
52
|
+
import { LibreFranklin_600SemiBold_Italic } from '@expo-google-fonts/libre-franklin/600SemiBold_Italic';
|
|
53
|
+
import { LibreFranklin_700Bold_Italic } from '@expo-google-fonts/libre-franklin/700Bold_Italic';
|
|
54
|
+
// Outfit — no italic files available
|
|
55
|
+
import { Outfit_400Regular } from '@expo-google-fonts/outfit/400Regular';
|
|
56
|
+
import { Outfit_500Medium } from '@expo-google-fonts/outfit/500Medium';
|
|
57
|
+
import { Outfit_600SemiBold } from '@expo-google-fonts/outfit/600SemiBold';
|
|
58
|
+
import { Outfit_700Bold } from '@expo-google-fonts/outfit/700Bold';
|
|
59
|
+
// Manrope — no italic files available
|
|
60
|
+
import { Manrope_400Regular } from '@expo-google-fonts/manrope/400Regular';
|
|
61
|
+
import { Manrope_500Medium } from '@expo-google-fonts/manrope/500Medium';
|
|
62
|
+
import { Manrope_600SemiBold } from '@expo-google-fonts/manrope/600SemiBold';
|
|
63
|
+
import { Manrope_700Bold } from '@expo-google-fonts/manrope/700Bold';
|
|
64
|
+
// Public Sans
|
|
65
|
+
import { PublicSans_400Regular } from '@expo-google-fonts/public-sans/400Regular';
|
|
66
|
+
import { PublicSans_500Medium } from '@expo-google-fonts/public-sans/500Medium';
|
|
67
|
+
import { PublicSans_600SemiBold } from '@expo-google-fonts/public-sans/600SemiBold';
|
|
68
|
+
import { PublicSans_700Bold } from '@expo-google-fonts/public-sans/700Bold';
|
|
69
|
+
import { PublicSans_400Regular_Italic } from '@expo-google-fonts/public-sans/400Regular_Italic';
|
|
70
|
+
import { PublicSans_500Medium_Italic } from '@expo-google-fonts/public-sans/500Medium_Italic';
|
|
71
|
+
import { PublicSans_600SemiBold_Italic } from '@expo-google-fonts/public-sans/600SemiBold_Italic';
|
|
72
|
+
import { PublicSans_700Bold_Italic } from '@expo-google-fonts/public-sans/700Bold_Italic';
|
|
73
|
+
// Inter (web platform font)
|
|
74
|
+
import { Inter_400Regular } from '@expo-google-fonts/inter/400Regular';
|
|
75
|
+
import { Inter_500Medium } from '@expo-google-fonts/inter/500Medium';
|
|
76
|
+
import { Inter_600SemiBold } from '@expo-google-fonts/inter/600SemiBold';
|
|
77
|
+
import { Inter_700Bold } from '@expo-google-fonts/inter/700Bold';
|
|
78
|
+
import { Inter_400Regular_Italic } from '@expo-google-fonts/inter/400Regular_Italic';
|
|
79
|
+
import { Inter_500Medium_Italic } from '@expo-google-fonts/inter/500Medium_Italic';
|
|
80
|
+
import { Inter_600SemiBold_Italic } from '@expo-google-fonts/inter/600SemiBold_Italic';
|
|
81
|
+
import { Inter_700Bold_Italic } from '@expo-google-fonts/inter/700Bold_Italic';
|
|
82
|
+
// IBM Plex Mono (web platform font)
|
|
83
|
+
import { IBMPlexMono_400Regular } from '@expo-google-fonts/ibm-plex-mono/400Regular';
|
|
84
|
+
import { IBMPlexMono_500Medium } from '@expo-google-fonts/ibm-plex-mono/500Medium';
|
|
85
|
+
import { IBMPlexMono_600SemiBold } from '@expo-google-fonts/ibm-plex-mono/600SemiBold';
|
|
86
|
+
import { IBMPlexMono_700Bold } from '@expo-google-fonts/ibm-plex-mono/700Bold';
|
|
87
|
+
import { IBMPlexMono_400Regular_Italic } from '@expo-google-fonts/ibm-plex-mono/400Regular_Italic';
|
|
88
|
+
import { IBMPlexMono_500Medium_Italic } from '@expo-google-fonts/ibm-plex-mono/500Medium_Italic';
|
|
89
|
+
import { IBMPlexMono_600SemiBold_Italic } from '@expo-google-fonts/ibm-plex-mono/600SemiBold_Italic';
|
|
90
|
+
import { IBMPlexMono_700Bold_Italic } from '@expo-google-fonts/ibm-plex-mono/700Bold_Italic';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* All 9 display fonts (3 per preset) with weight and italic variants.
|
|
94
|
+
* Keys are token-matching registered names so CSS variable values resolve
|
|
95
|
+
* to loaded font files on all platforms.
|
|
96
|
+
*/
|
|
97
|
+
const displayFonts = {
|
|
98
|
+
// Crimson Pro (Poise)
|
|
99
|
+
'Crimson Pro': CrimsonPro_400Regular,
|
|
100
|
+
'Crimson Pro Medium': CrimsonPro_500Medium,
|
|
101
|
+
'Crimson Pro SemiBold': CrimsonPro_600SemiBold,
|
|
102
|
+
'Crimson Pro Bold': CrimsonPro_700Bold,
|
|
103
|
+
'Crimson Pro Italic': CrimsonPro_400Regular_Italic,
|
|
104
|
+
'Crimson Pro Medium Italic': CrimsonPro_500Medium_Italic,
|
|
105
|
+
'Crimson Pro SemiBold Italic': CrimsonPro_600SemiBold_Italic,
|
|
106
|
+
'Crimson Pro Bold Italic': CrimsonPro_700Bold_Italic,
|
|
107
|
+
// Bitter (Poise)
|
|
108
|
+
Bitter: Bitter_400Regular,
|
|
109
|
+
'Bitter Medium': Bitter_500Medium,
|
|
110
|
+
'Bitter SemiBold': Bitter_600SemiBold,
|
|
111
|
+
'Bitter Bold': Bitter_700Bold,
|
|
112
|
+
'Bitter Italic': Bitter_400Regular_Italic,
|
|
113
|
+
'Bitter Medium Italic': Bitter_500Medium_Italic,
|
|
114
|
+
'Bitter SemiBold Italic': Bitter_600SemiBold_Italic,
|
|
115
|
+
'Bitter Bold Italic': Bitter_700Bold_Italic,
|
|
116
|
+
// DM Sans (Poise)
|
|
117
|
+
'DM Sans': DMSans_400Regular,
|
|
118
|
+
'DM Sans Medium': DMSans_500Medium,
|
|
119
|
+
'DM Sans SemiBold': DMSans_600SemiBold,
|
|
120
|
+
'DM Sans Bold': DMSans_700Bold,
|
|
121
|
+
'DM Sans Italic': DMSans_400Regular_Italic,
|
|
122
|
+
'DM Sans Medium Italic': DMSans_500Medium_Italic,
|
|
123
|
+
'DM Sans SemiBold Italic': DMSans_600SemiBold_Italic,
|
|
124
|
+
'DM Sans Bold Italic': DMSans_700Bold_Italic,
|
|
125
|
+
// Libre Caslon Text (Prestige) — 500/600 unavailable, mapped to 400;
|
|
126
|
+
// italic only at 400, all other italic keys map to 400 italic
|
|
127
|
+
'Libre Caslon Text': LibreCaslonText_400Regular,
|
|
128
|
+
'Libre Caslon Text Medium': LibreCaslonText_400Regular,
|
|
129
|
+
'Libre Caslon Text SemiBold': LibreCaslonText_400Regular,
|
|
130
|
+
'Libre Caslon Text Bold': LibreCaslonText_700Bold,
|
|
131
|
+
'Libre Caslon Text Italic': LibreCaslonText_400Regular_Italic,
|
|
132
|
+
'Libre Caslon Text Medium Italic': LibreCaslonText_400Regular_Italic,
|
|
133
|
+
'Libre Caslon Text SemiBold Italic': LibreCaslonText_400Regular_Italic,
|
|
134
|
+
'Libre Caslon Text Bold Italic': LibreCaslonText_400Regular_Italic,
|
|
135
|
+
// Cormorant (Prestige)
|
|
136
|
+
Cormorant: Cormorant_400Regular,
|
|
137
|
+
'Cormorant Medium': Cormorant_500Medium,
|
|
138
|
+
'Cormorant SemiBold': Cormorant_600SemiBold,
|
|
139
|
+
'Cormorant Bold': Cormorant_700Bold,
|
|
140
|
+
'Cormorant Italic': Cormorant_400Regular_Italic,
|
|
141
|
+
'Cormorant Medium Italic': Cormorant_500Medium_Italic,
|
|
142
|
+
'Cormorant SemiBold Italic': Cormorant_600SemiBold_Italic,
|
|
143
|
+
'Cormorant Bold Italic': Cormorant_700Bold_Italic,
|
|
144
|
+
// Libre Franklin (Prestige)
|
|
145
|
+
'Libre Franklin': LibreFranklin_400Regular,
|
|
146
|
+
'Libre Franklin Medium': LibreFranklin_500Medium,
|
|
147
|
+
'Libre Franklin SemiBold': LibreFranklin_600SemiBold,
|
|
148
|
+
'Libre Franklin Bold': LibreFranklin_700Bold,
|
|
149
|
+
'Libre Franklin Italic': LibreFranklin_400Regular_Italic,
|
|
150
|
+
'Libre Franklin Medium Italic': LibreFranklin_500Medium_Italic,
|
|
151
|
+
'Libre Franklin SemiBold Italic': LibreFranklin_600SemiBold_Italic,
|
|
152
|
+
'Libre Franklin Bold Italic': LibreFranklin_700Bold_Italic,
|
|
153
|
+
// Outfit (Pulse) — no italic files; italic keys map to regular variants
|
|
154
|
+
Outfit: Outfit_400Regular,
|
|
155
|
+
'Outfit Medium': Outfit_500Medium,
|
|
156
|
+
'Outfit SemiBold': Outfit_600SemiBold,
|
|
157
|
+
'Outfit Bold': Outfit_700Bold,
|
|
158
|
+
'Outfit Italic': Outfit_400Regular,
|
|
159
|
+
'Outfit Medium Italic': Outfit_500Medium,
|
|
160
|
+
'Outfit SemiBold Italic': Outfit_600SemiBold,
|
|
161
|
+
'Outfit Bold Italic': Outfit_700Bold,
|
|
162
|
+
// Manrope (Pulse) — no italic files; italic keys map to regular variants
|
|
163
|
+
Manrope: Manrope_400Regular,
|
|
164
|
+
'Manrope Medium': Manrope_500Medium,
|
|
165
|
+
'Manrope SemiBold': Manrope_600SemiBold,
|
|
166
|
+
'Manrope Bold': Manrope_700Bold,
|
|
167
|
+
'Manrope Italic': Manrope_400Regular,
|
|
168
|
+
'Manrope Medium Italic': Manrope_500Medium,
|
|
169
|
+
'Manrope SemiBold Italic': Manrope_600SemiBold,
|
|
170
|
+
'Manrope Bold Italic': Manrope_700Bold,
|
|
171
|
+
// Public Sans (Pulse)
|
|
172
|
+
'Public Sans': PublicSans_400Regular,
|
|
173
|
+
'Public Sans Medium': PublicSans_500Medium,
|
|
174
|
+
'Public Sans SemiBold': PublicSans_600SemiBold,
|
|
175
|
+
'Public Sans Bold': PublicSans_700Bold,
|
|
176
|
+
'Public Sans Italic': PublicSans_400Regular_Italic,
|
|
177
|
+
'Public Sans Medium Italic': PublicSans_500Medium_Italic,
|
|
178
|
+
'Public Sans SemiBold Italic': PublicSans_600SemiBold_Italic,
|
|
179
|
+
'Public Sans Bold Italic': PublicSans_700Bold_Italic
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Web platform fonts — only included when running on web.
|
|
184
|
+
* Imports remain top-level so Metro statically bundles the font files;
|
|
185
|
+
* the conditional controls whether useFonts receives them.
|
|
186
|
+
*/
|
|
187
|
+
const webFonts = Platform.OS === 'web' ? {
|
|
188
|
+
Inter: Inter_400Regular,
|
|
189
|
+
'Inter Medium': Inter_500Medium,
|
|
190
|
+
'Inter SemiBold': Inter_600SemiBold,
|
|
191
|
+
'Inter Bold': Inter_700Bold,
|
|
192
|
+
'Inter Italic': Inter_400Regular_Italic,
|
|
193
|
+
'Inter Medium Italic': Inter_500Medium_Italic,
|
|
194
|
+
'Inter SemiBold Italic': Inter_600SemiBold_Italic,
|
|
195
|
+
'Inter Bold Italic': Inter_700Bold_Italic,
|
|
196
|
+
'IBM Plex Mono': IBMPlexMono_400Regular,
|
|
197
|
+
'IBM Plex Mono Medium': IBMPlexMono_500Medium,
|
|
198
|
+
'IBM Plex Mono SemiBold': IBMPlexMono_600SemiBold,
|
|
199
|
+
'IBM Plex Mono Bold': IBMPlexMono_700Bold,
|
|
200
|
+
'IBM Plex Mono Italic': IBMPlexMono_400Regular_Italic,
|
|
201
|
+
'IBM Plex Mono Medium Italic': IBMPlexMono_500Medium_Italic,
|
|
202
|
+
'IBM Plex Mono SemiBold Italic': IBMPlexMono_600SemiBold_Italic,
|
|
203
|
+
'IBM Plex Mono Bold Italic': IBMPlexMono_700Bold_Italic
|
|
204
|
+
} : {};
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Loads all Forge UI fonts — 9 display fonts (3 per preset) with weight/italic
|
|
208
|
+
* variants, plus web platform fonts (Inter, IBM Plex Mono) on web.
|
|
209
|
+
*
|
|
210
|
+
* This is a pure font loader with no preset or FI config awareness. Font
|
|
211
|
+
* selection is handled by the CSS variable layer via theme tokens.
|
|
212
|
+
*/
|
|
213
|
+
export function useForgeFonts() {
|
|
214
|
+
const [loaded, error] = useFonts({
|
|
215
|
+
...displayFonts,
|
|
216
|
+
...webFonts
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
loaded,
|
|
220
|
+
error
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=useForgeFonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","useFonts","CrimsonPro_400Regular","CrimsonPro_500Medium","CrimsonPro_600SemiBold","CrimsonPro_700Bold","CrimsonPro_400Regular_Italic","CrimsonPro_500Medium_Italic","CrimsonPro_600SemiBold_Italic","CrimsonPro_700Bold_Italic","Bitter_400Regular","Bitter_500Medium","Bitter_600SemiBold","Bitter_700Bold","Bitter_400Regular_Italic","Bitter_500Medium_Italic","Bitter_600SemiBold_Italic","Bitter_700Bold_Italic","DMSans_400Regular","DMSans_500Medium","DMSans_600SemiBold","DMSans_700Bold","DMSans_400Regular_Italic","DMSans_500Medium_Italic","DMSans_600SemiBold_Italic","DMSans_700Bold_Italic","LibreCaslonText_400Regular","LibreCaslonText_700Bold","LibreCaslonText_400Regular_Italic","Cormorant_400Regular","Cormorant_500Medium","Cormorant_600SemiBold","Cormorant_700Bold","Cormorant_400Regular_Italic","Cormorant_500Medium_Italic","Cormorant_600SemiBold_Italic","Cormorant_700Bold_Italic","LibreFranklin_400Regular","LibreFranklin_500Medium","LibreFranklin_600SemiBold","LibreFranklin_700Bold","LibreFranklin_400Regular_Italic","LibreFranklin_500Medium_Italic","LibreFranklin_600SemiBold_Italic","LibreFranklin_700Bold_Italic","Outfit_400Regular","Outfit_500Medium","Outfit_600SemiBold","Outfit_700Bold","Manrope_400Regular","Manrope_500Medium","Manrope_600SemiBold","Manrope_700Bold","PublicSans_400Regular","PublicSans_500Medium","PublicSans_600SemiBold","PublicSans_700Bold","PublicSans_400Regular_Italic","PublicSans_500Medium_Italic","PublicSans_600SemiBold_Italic","PublicSans_700Bold_Italic","Inter_400Regular","Inter_500Medium","Inter_600SemiBold","Inter_700Bold","Inter_400Regular_Italic","Inter_500Medium_Italic","Inter_600SemiBold_Italic","Inter_700Bold_Italic","IBMPlexMono_400Regular","IBMPlexMono_500Medium","IBMPlexMono_600SemiBold","IBMPlexMono_700Bold","IBMPlexMono_400Regular_Italic","IBMPlexMono_500Medium_Italic","IBMPlexMono_600SemiBold_Italic","IBMPlexMono_700Bold_Italic","displayFonts","Bitter","Cormorant","Outfit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B,EAAEC,eAAe;EAEtC;EACA,aAAa,EAAEC,qBAAqB;EACpC,oBAAoB,EAAEC,oBAAoB;EAC1C,sBAAsB,EAAEC,sBAAsB;EAC9C,kBAAkB,EAAEC,kBAAkB;EACtC,oBAAoB,EAAEC,4BAA4B;EAClD,2BAA2B,EAAEC,2BAA2B;EACxD,6BAA6B,EAAEC,6BAA6B;EAC5D,yBAAyB,EAAEC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMsB,QAAoC,GACxClF,QAAQ,CAACmF,EAAE,KAAK,KAAK,GACjB;EACEC,KAAK,EAAEvB,gBAAgB;EACvB,cAAc,EAAEC,eAAe;EAC/B,gBAAgB,EAAEC,iBAAiB;EACnC,YAAY,EAAEC,aAAa;EAC3B,cAAc,EAAEC,uBAAuB;EACvC,qBAAqB,EAAEC,sBAAsB;EAC7C,uBAAuB,EAAEC,wBAAwB;EACjD,mBAAmB,EAAEC,oBAAoB;EAEzC,eAAe,EAAEC,sBAAsB;EACvC,sBAAsB,EAAEC,qBAAqB;EAC7C,wBAAwB,EAAEC,uBAAuB;EACjD,oBAAoB,EAAEC,mBAAmB;EACzC,sBAAsB,EAAEC,6BAA6B;EACrD,6BAA6B,EAAEC,4BAA4B;EAC3D,+BAA+B,EAAEC,8BAA8B;EAC/D,2BAA2B,EAAEC;AAC/B,CAAC,GACD,CAAC,CAAC;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,aAAaA,CAAA,EAA6C;EACxE,MAAM,CAACC,MAAM,EAAEC,KAAK,CAAC,GAAGtF,QAAQ,CAAC;IAC/B,GAAG4E,YAAY;IACf,GAAGK;EACL,CAAC,CAAC;EAEF,OAAO;IAAEI,MAAM;IAAEC;EAAM,CAAC;AAC1B","ignoreList":[]}
|
|
@@ -8,21 +8,21 @@ export interface TokenValue {
|
|
|
8
8
|
export interface TokenGroup {
|
|
9
9
|
[key: string]: TokenValue | TokenGroup;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/** The three built-in Forge UI theme presets. */
|
|
12
|
+
export type Preset = 'poise' | 'prestige' | 'pulse';
|
|
13
|
+
/** Theme metadata stored under `$extensions.com.forge.ui.theme`. */
|
|
12
14
|
export interface ThemeMetadata {
|
|
13
15
|
name: string;
|
|
14
|
-
preset:
|
|
16
|
+
preset: Preset;
|
|
15
17
|
schemaVersion: string;
|
|
16
18
|
}
|
|
17
|
-
/** Override metadata stored under `$extensions.com.
|
|
19
|
+
/** Override metadata stored under `$extensions.com.forge.ui.themeOverride`. */
|
|
18
20
|
export interface ThemeOverrideMetadata {
|
|
19
|
-
basePreset:
|
|
20
|
-
fiId: string;
|
|
21
|
-
fiName: string;
|
|
21
|
+
basePreset: Preset;
|
|
22
22
|
schemaVersion: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* A complete
|
|
25
|
+
* A complete Forge UI theme object (DTCG-compatible).
|
|
26
26
|
*
|
|
27
27
|
* Presets (Poise, Prestige, Pulse) are full theme objects. At runtime the
|
|
28
28
|
* build-time default preset is augmented by FI overrides via
|
|
@@ -30,7 +30,7 @@ export interface ThemeOverrideMetadata {
|
|
|
30
30
|
*/
|
|
31
31
|
export type ThemeObject = TokenGroup & {
|
|
32
32
|
$extensions: {
|
|
33
|
-
'com.
|
|
33
|
+
'com.forge.ui.theme': ThemeMetadata;
|
|
34
34
|
[key: string]: unknown;
|
|
35
35
|
};
|
|
36
36
|
modes: {
|
|
@@ -44,16 +44,49 @@ export type ThemeObject = TokenGroup & {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
|
-
* A theme override
|
|
48
|
-
*
|
|
47
|
+
* A theme override using the hybrid input + semantic structure.
|
|
48
|
+
*
|
|
49
|
+
* - `inputs` — flat map of abstract FI-selected brand values (e.g.
|
|
50
|
+
* `brandPrimary`, `displayFont`). Palette generation expands these into
|
|
51
|
+
* full token scales at runtime.
|
|
52
|
+
* - `overrides` — per-mode flat maps of token dot-paths to resolved values
|
|
53
|
+
* for direct semantic token overrides beyond what inputs generate.
|
|
54
|
+
* - `$extensions` — required metadata including base preset and schema version.
|
|
49
55
|
*/
|
|
50
|
-
export
|
|
51
|
-
$extensions
|
|
52
|
-
'com.
|
|
56
|
+
export interface ThemeOverride {
|
|
57
|
+
$extensions: {
|
|
58
|
+
'com.forge.ui.themeOverride': ThemeOverrideMetadata;
|
|
53
59
|
[key: string]: unknown;
|
|
54
60
|
};
|
|
55
|
-
|
|
61
|
+
inputs?: Record<string, string | number>;
|
|
62
|
+
overrides?: Partial<Record<Mode, Record<string, string | number>>>;
|
|
63
|
+
}
|
|
56
64
|
export type Mode = 'light' | 'dark';
|
|
57
65
|
export type Platform = 'web' | 'ios' | 'android';
|
|
66
|
+
/** Current override schema version. Consuming apps gate compatibility on this. */
|
|
67
|
+
export declare const OVERRIDE_SCHEMA_VERSION: "1.0.0";
|
|
68
|
+
/**
|
|
69
|
+
* Schema versions that consuming apps accept. Includes the current version and
|
|
70
|
+
* may include the immediately prior version during transition windows.
|
|
71
|
+
* @see docs/internal/token-architecture/16-override-structure.md § 4
|
|
72
|
+
*/
|
|
73
|
+
export declare const SUPPORTED_OVERRIDE_SCHEMA_VERSIONS: readonly string[];
|
|
74
|
+
/**
|
|
75
|
+
* Schema-level mapping from known input keys to the token path pattern each
|
|
76
|
+
* affects. Used by override application (S5) to route inputs to the correct
|
|
77
|
+
* palette/token namespace. Distinct from the full runtime map (S3).
|
|
78
|
+
*/
|
|
79
|
+
export declare const INPUT_TOKEN_MAP: {
|
|
80
|
+
readonly brandPrimary: "color.brand";
|
|
81
|
+
readonly accentPrimary: "color.accent";
|
|
82
|
+
readonly basePrimary: "color.base";
|
|
83
|
+
readonly displayFont: "font.display";
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Allowed display font families per preset, consumed by the theme editor for
|
|
87
|
+
* font selection and by consuming apps for validation.
|
|
88
|
+
*/
|
|
89
|
+
export declare const presetFonts: Record<Preset, readonly string[]>;
|
|
90
|
+
export { useForgeFonts } from './useForgeFonts';
|
|
58
91
|
export { useCdxFonts } from './useCdxFonts';
|
|
59
92
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;CACxC;AAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;CACxC;AAED,iDAAiD;AACjD,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;AAEpD,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,U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3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* variants, plus web platform fonts (Inter, IBM Plex Mono) on web.
|
|
4
|
-
*
|
|
5
|
-
* This is a pure font loader with no preset or FI config awareness. Font
|
|
6
|
-
* selection is handled by the CSS variable layer via theme tokens.
|
|
7
|
-
*/
|
|
8
|
-
export declare function useCdxFonts(): {
|
|
9
|
-
loaded: boolean;
|
|
10
|
-
error: Error | null;
|
|
11
|
-
};
|
|
1
|
+
/** @deprecated Use `useForgeFonts` instead. Will be removed in a future major release. */
|
|
2
|
+
export { useForgeFonts as useCdxFonts } from './useForgeFonts';
|
|
12
3
|
//# sourceMappingURL=useCdxFonts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCdxFonts.d.ts","sourceRoot":"","sources":["../../src/useCdxFonts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCdxFonts.d.ts","sourceRoot":"","sources":["../../src/useCdxFonts.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads all Forge UI fonts — 9 display fonts (3 per preset) with weight/italic
|
|
3
|
+
* variants, plus web platform fonts (Inter, IBM Plex Mono) on web.
|
|
4
|
+
*
|
|
5
|
+
* This is a pure font loader with no preset or FI config awareness. Font
|
|
6
|
+
* selection is handled by the CSS variable layer via theme tokens.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useForgeFonts(): {
|
|
9
|
+
loaded: boolean;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useForgeFonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForgeFonts.d.ts","sourceRoot":"","sources":["../../src/useForgeFonts.ts"],"names":[],"mappings":"AAuNA;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAOxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/styles",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.51",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@expo-google-fonts/manrope": "0.4.2",
|
|
54
54
|
"@expo-google-fonts/outfit": "0.4.3",
|
|
55
55
|
"@expo-google-fonts/public-sans": "0.4.2",
|
|
56
|
-
"@cdx-ui/utils": "0.0.1-beta.
|
|
56
|
+
"@cdx-ui/utils": "0.0.1-beta.51"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^18.2.0 || ^19.0.0",
|
package/src/index.ts
CHANGED
|
@@ -14,23 +14,24 @@ export interface TokenGroup {
|
|
|
14
14
|
[key: string]: TokenValue | TokenGroup;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/** The three built-in Forge UI theme presets. */
|
|
18
|
+
export type Preset = 'poise' | 'prestige' | 'pulse';
|
|
19
|
+
|
|
20
|
+
/** Theme metadata stored under `$extensions.com.forge.ui.theme`. */
|
|
18
21
|
export interface ThemeMetadata {
|
|
19
22
|
name: string;
|
|
20
|
-
preset:
|
|
23
|
+
preset: Preset;
|
|
21
24
|
schemaVersion: string;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
/** Override metadata stored under `$extensions.com.
|
|
27
|
+
/** Override metadata stored under `$extensions.com.forge.ui.themeOverride`. */
|
|
25
28
|
export interface ThemeOverrideMetadata {
|
|
26
|
-
basePreset:
|
|
27
|
-
fiId: string;
|
|
28
|
-
fiName: string;
|
|
29
|
+
basePreset: Preset;
|
|
29
30
|
schemaVersion: string;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
* A complete
|
|
34
|
+
* A complete Forge UI theme object (DTCG-compatible).
|
|
34
35
|
*
|
|
35
36
|
* Presets (Poise, Prestige, Pulse) are full theme objects. At runtime the
|
|
36
37
|
* build-time default preset is augmented by FI overrides via
|
|
@@ -38,7 +39,7 @@ export interface ThemeOverrideMetadata {
|
|
|
38
39
|
*/
|
|
39
40
|
export type ThemeObject = TokenGroup & {
|
|
40
41
|
$extensions: {
|
|
41
|
-
'com.
|
|
42
|
+
'com.forge.ui.theme': ThemeMetadata;
|
|
42
43
|
[key: string]: unknown;
|
|
43
44
|
};
|
|
44
45
|
modes: {
|
|
@@ -53,21 +54,66 @@ export type ThemeObject = TokenGroup & {
|
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
|
-
* A theme override
|
|
57
|
-
*
|
|
57
|
+
* A theme override using the hybrid input + semantic structure.
|
|
58
|
+
*
|
|
59
|
+
* - `inputs` — flat map of abstract FI-selected brand values (e.g.
|
|
60
|
+
* `brandPrimary`, `displayFont`). Palette generation expands these into
|
|
61
|
+
* full token scales at runtime.
|
|
62
|
+
* - `overrides` — per-mode flat maps of token dot-paths to resolved values
|
|
63
|
+
* for direct semantic token overrides beyond what inputs generate.
|
|
64
|
+
* - `$extensions` — required metadata including base preset and schema version.
|
|
58
65
|
*/
|
|
59
|
-
export
|
|
60
|
-
$extensions
|
|
61
|
-
'com.
|
|
66
|
+
export interface ThemeOverride {
|
|
67
|
+
$extensions: {
|
|
68
|
+
'com.forge.ui.themeOverride': ThemeOverrideMetadata;
|
|
62
69
|
[key: string]: unknown;
|
|
63
70
|
};
|
|
64
|
-
|
|
71
|
+
inputs?: Record<string, string | number>;
|
|
72
|
+
overrides?: Partial<Record<Mode, Record<string, string | number>>>;
|
|
73
|
+
}
|
|
65
74
|
|
|
66
75
|
export type Mode = 'light' | 'dark';
|
|
67
76
|
export type Platform = 'web' | 'ios' | 'android';
|
|
68
77
|
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// Constants
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
/** Current override schema version. Consuming apps gate compatibility on this. */
|
|
83
|
+
export const OVERRIDE_SCHEMA_VERSION = '1.0.0' as const;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Schema versions that consuming apps accept. Includes the current version and
|
|
87
|
+
* may include the immediately prior version during transition windows.
|
|
88
|
+
* @see docs/internal/token-architecture/16-override-structure.md § 4
|
|
89
|
+
*/
|
|
90
|
+
export const SUPPORTED_OVERRIDE_SCHEMA_VERSIONS: readonly string[] = ['1.0.0'] as const;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Schema-level mapping from known input keys to the token path pattern each
|
|
94
|
+
* affects. Used by override application (S5) to route inputs to the correct
|
|
95
|
+
* palette/token namespace. Distinct from the full runtime map (S3).
|
|
96
|
+
*/
|
|
97
|
+
export const INPUT_TOKEN_MAP = {
|
|
98
|
+
brandPrimary: 'color.brand',
|
|
99
|
+
accentPrimary: 'color.accent',
|
|
100
|
+
basePrimary: 'color.base',
|
|
101
|
+
displayFont: 'font.display',
|
|
102
|
+
} as const satisfies Record<string, string>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Allowed display font families per preset, consumed by the theme editor for
|
|
106
|
+
* font selection and by consuming apps for validation.
|
|
107
|
+
*/
|
|
108
|
+
export const presetFonts: Record<Preset, readonly string[]> = {
|
|
109
|
+
poise: ['Crimson Pro', 'Bitter', 'DM Sans'],
|
|
110
|
+
prestige: ['Libre Caslon Text', 'Cormorant', 'Libre Franklin'],
|
|
111
|
+
pulse: ['Outfit', 'Manrope', 'Public Sans'],
|
|
112
|
+
} as const;
|
|
113
|
+
|
|
69
114
|
// ---------------------------------------------------------------------------
|
|
70
115
|
// Hooks
|
|
71
116
|
// ---------------------------------------------------------------------------
|
|
72
117
|
|
|
118
|
+
export { useForgeFonts } from './useForgeFonts';
|
|
73
119
|
export { useCdxFonts } from './useCdxFonts';
|