inai-react-components 0.1.3 → 0.1.4
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/commands/init.d.ts +224 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +114 -4
- package/dist/commands/theme.d.ts.map +1 -1
- package/dist/commands/theme.js +16 -1
- package/package.json +1 -1
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,9 +1,226 @@
|
|
|
1
1
|
declare const AVAILABLE_THEMES: readonly ["monday", "linear", "notion", "vercel", "inai", "anthropic", "shadcn-default", "shadcn-blue", "shadcn-green", "shadcn-orange", "shadcn-red", "shadcn-rose", "shadcn-violet", "shadcn-yellow"];
|
|
2
2
|
type Theme = (typeof AVAILABLE_THEMES)[number];
|
|
3
|
+
declare const FONT_PRESETS: readonly [{
|
|
4
|
+
readonly name: "outfit";
|
|
5
|
+
readonly label: "Outfit";
|
|
6
|
+
readonly family: "'Outfit', system-ui, sans-serif";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "inter";
|
|
9
|
+
readonly label: "Inter";
|
|
10
|
+
readonly family: "'Inter', system-ui, sans-serif";
|
|
11
|
+
}, {
|
|
12
|
+
readonly name: "geist";
|
|
13
|
+
readonly label: "Geist";
|
|
14
|
+
readonly family: "'Geist', system-ui, sans-serif";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "plus-jakarta-sans";
|
|
17
|
+
readonly label: "Plus Jakarta Sans";
|
|
18
|
+
readonly family: "'Plus Jakarta Sans', system-ui, sans-serif";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "dm-sans";
|
|
21
|
+
readonly label: "DM Sans";
|
|
22
|
+
readonly family: "'DM Sans', system-ui, sans-serif";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "albert-sans";
|
|
25
|
+
readonly label: "Albert Sans";
|
|
26
|
+
readonly family: "'Albert Sans', system-ui, sans-serif";
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "general-sans";
|
|
29
|
+
readonly label: "General Sans";
|
|
30
|
+
readonly family: "'General Sans', system-ui, sans-serif";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "cabinet-grotesk";
|
|
33
|
+
readonly label: "Cabinet Grotesk";
|
|
34
|
+
readonly family: "'Cabinet Grotesk', system-ui, sans-serif";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "satoshi";
|
|
37
|
+
readonly label: "Satoshi";
|
|
38
|
+
readonly family: "'Satoshi', system-ui, sans-serif";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "clash-display";
|
|
41
|
+
readonly label: "Clash Display";
|
|
42
|
+
readonly family: "'Clash Display', system-ui, sans-serif";
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "nunito";
|
|
45
|
+
readonly label: "Nunito";
|
|
46
|
+
readonly family: "'Nunito', system-ui, sans-serif";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "nunito-sans";
|
|
49
|
+
readonly label: "Nunito Sans";
|
|
50
|
+
readonly family: "'Nunito Sans', system-ui, sans-serif";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "rubik";
|
|
53
|
+
readonly label: "Rubik";
|
|
54
|
+
readonly family: "'Rubik', system-ui, sans-serif";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "poppins";
|
|
57
|
+
readonly label: "Poppins";
|
|
58
|
+
readonly family: "'Poppins', system-ui, sans-serif";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "manrope";
|
|
61
|
+
readonly label: "Manrope";
|
|
62
|
+
readonly family: "'Manrope', system-ui, sans-serif";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "sora";
|
|
65
|
+
readonly label: "Sora";
|
|
66
|
+
readonly family: "'Sora', system-ui, sans-serif";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "figtree";
|
|
69
|
+
readonly label: "Figtree";
|
|
70
|
+
readonly family: "'Figtree', system-ui, sans-serif";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "be-vietnam-pro";
|
|
73
|
+
readonly label: "Be Vietnam Pro";
|
|
74
|
+
readonly family: "'Be Vietnam Pro', system-ui, sans-serif";
|
|
75
|
+
}, {
|
|
76
|
+
readonly name: "open-sans";
|
|
77
|
+
readonly label: "Open Sans";
|
|
78
|
+
readonly family: "'Open Sans', system-ui, sans-serif";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "roboto";
|
|
81
|
+
readonly label: "Roboto";
|
|
82
|
+
readonly family: "'Roboto', system-ui, sans-serif";
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "lato";
|
|
85
|
+
readonly label: "Lato";
|
|
86
|
+
readonly family: "'Lato', system-ui, sans-serif";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "montserrat";
|
|
89
|
+
readonly label: "Montserrat";
|
|
90
|
+
readonly family: "'Montserrat', system-ui, sans-serif";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "raleway";
|
|
93
|
+
readonly label: "Raleway";
|
|
94
|
+
readonly family: "'Raleway', system-ui, sans-serif";
|
|
95
|
+
}, {
|
|
96
|
+
readonly name: "work-sans";
|
|
97
|
+
readonly label: "Work Sans";
|
|
98
|
+
readonly family: "'Work Sans', system-ui, sans-serif";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "source-sans-3";
|
|
101
|
+
readonly label: "Source Sans 3";
|
|
102
|
+
readonly family: "'Source Sans 3', system-ui, sans-serif";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "barlow";
|
|
105
|
+
readonly label: "Barlow";
|
|
106
|
+
readonly family: "'Barlow', system-ui, sans-serif";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "red-hat-display";
|
|
109
|
+
readonly label: "Red Hat Display";
|
|
110
|
+
readonly family: "'Red Hat Display', system-ui, sans-serif";
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "red-hat-text";
|
|
113
|
+
readonly label: "Red Hat Text";
|
|
114
|
+
readonly family: "'Red Hat Text', system-ui, sans-serif";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "space-grotesk";
|
|
117
|
+
readonly label: "Space Grotesk";
|
|
118
|
+
readonly family: "'Space Grotesk', system-ui, sans-serif";
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "archivo";
|
|
121
|
+
readonly label: "Archivo";
|
|
122
|
+
readonly family: "'Archivo', system-ui, sans-serif";
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "overpass";
|
|
125
|
+
readonly label: "Overpass";
|
|
126
|
+
readonly family: "'Overpass', system-ui, sans-serif";
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "urbanist";
|
|
129
|
+
readonly label: "Urbanist";
|
|
130
|
+
readonly family: "'Urbanist', system-ui, sans-serif";
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "lexend";
|
|
133
|
+
readonly label: "Lexend";
|
|
134
|
+
readonly family: "'Lexend', system-ui, sans-serif";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "playfair-display";
|
|
137
|
+
readonly label: "Playfair Display";
|
|
138
|
+
readonly family: "'Playfair Display', Georgia, serif";
|
|
139
|
+
}, {
|
|
140
|
+
readonly name: "lora";
|
|
141
|
+
readonly label: "Lora";
|
|
142
|
+
readonly family: "'Lora', Georgia, serif";
|
|
143
|
+
}, {
|
|
144
|
+
readonly name: "merriweather";
|
|
145
|
+
readonly label: "Merriweather";
|
|
146
|
+
readonly family: "'Merriweather', Georgia, serif";
|
|
147
|
+
}, {
|
|
148
|
+
readonly name: "dm-serif-display";
|
|
149
|
+
readonly label: "DM Serif Display";
|
|
150
|
+
readonly family: "'DM Serif Display', Georgia, serif";
|
|
151
|
+
}, {
|
|
152
|
+
readonly name: "dm-serif-text";
|
|
153
|
+
readonly label: "DM Serif Text";
|
|
154
|
+
readonly family: "'DM Serif Text', Georgia, serif";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "fraunces";
|
|
157
|
+
readonly label: "Fraunces";
|
|
158
|
+
readonly family: "'Fraunces', Georgia, serif";
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "source-serif-4";
|
|
161
|
+
readonly label: "Source Serif 4";
|
|
162
|
+
readonly family: "'Source Serif 4', Georgia, serif";
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "bitter";
|
|
165
|
+
readonly label: "Bitter";
|
|
166
|
+
readonly family: "'Bitter', Georgia, serif";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "crimson-pro";
|
|
169
|
+
readonly label: "Crimson Pro";
|
|
170
|
+
readonly family: "'Crimson Pro', Georgia, serif";
|
|
171
|
+
}, {
|
|
172
|
+
readonly name: "libre-baskerville";
|
|
173
|
+
readonly label: "Libre Baskerville";
|
|
174
|
+
readonly family: "'Libre Baskerville', Georgia, serif";
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "eb-garamond";
|
|
177
|
+
readonly label: "EB Garamond";
|
|
178
|
+
readonly family: "'EB Garamond', Georgia, serif";
|
|
179
|
+
}, {
|
|
180
|
+
readonly name: "cormorant";
|
|
181
|
+
readonly label: "Cormorant";
|
|
182
|
+
readonly family: "'Cormorant', Georgia, serif";
|
|
183
|
+
}, {
|
|
184
|
+
readonly name: "instrument-serif";
|
|
185
|
+
readonly label: "Instrument Serif";
|
|
186
|
+
readonly family: "'Instrument Serif', Georgia, serif";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "young-serif";
|
|
189
|
+
readonly label: "Young Serif";
|
|
190
|
+
readonly family: "'Young Serif', Georgia, serif";
|
|
191
|
+
}, {
|
|
192
|
+
readonly name: "jetbrains-mono";
|
|
193
|
+
readonly label: "JetBrains Mono";
|
|
194
|
+
readonly family: "'JetBrains Mono', ui-monospace, monospace";
|
|
195
|
+
}, {
|
|
196
|
+
readonly name: "fira-code";
|
|
197
|
+
readonly label: "Fira Code";
|
|
198
|
+
readonly family: "'Fira Code', ui-monospace, monospace";
|
|
199
|
+
}, {
|
|
200
|
+
readonly name: "source-code-pro";
|
|
201
|
+
readonly label: "Source Code Pro";
|
|
202
|
+
readonly family: "'Source Code Pro', ui-monospace, monospace";
|
|
203
|
+
}, {
|
|
204
|
+
readonly name: "ibm-plex-mono";
|
|
205
|
+
readonly label: "IBM Plex Mono";
|
|
206
|
+
readonly family: "'IBM Plex Mono', ui-monospace, monospace";
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "space-mono";
|
|
209
|
+
readonly label: "Space Mono";
|
|
210
|
+
readonly family: "'Space Mono', ui-monospace, monospace";
|
|
211
|
+
}, {
|
|
212
|
+
readonly name: "system";
|
|
213
|
+
readonly label: "System Default";
|
|
214
|
+
readonly family: "system-ui, -apple-system, sans-serif";
|
|
215
|
+
}];
|
|
216
|
+
type FontPreset = (typeof FONT_PRESETS)[number]["name"];
|
|
3
217
|
export interface InitConfig {
|
|
4
218
|
componentPath: string;
|
|
5
219
|
blockPath: string;
|
|
6
220
|
theme: Theme;
|
|
221
|
+
fontBody: FontPreset;
|
|
222
|
+
fontHeading: FontPreset;
|
|
223
|
+
radius: number;
|
|
7
224
|
importAlias: string;
|
|
8
225
|
utilsAlias: string;
|
|
9
226
|
tanstackRouter: boolean;
|
|
@@ -25,6 +242,11 @@ export interface ComponentsJson {
|
|
|
25
242
|
utils: string;
|
|
26
243
|
};
|
|
27
244
|
theme: Theme;
|
|
245
|
+
font: {
|
|
246
|
+
body: FontPreset;
|
|
247
|
+
heading: FontPreset;
|
|
248
|
+
};
|
|
249
|
+
radius: number;
|
|
28
250
|
tanstack: {
|
|
29
251
|
router: boolean;
|
|
30
252
|
query: boolean;
|
|
@@ -35,8 +257,8 @@ export interface ComponentsJson {
|
|
|
35
257
|
export declare function promptInitConfig(registryDir?: string): Promise<InitConfig | null>;
|
|
36
258
|
export declare function buildComponentsJson(config: InitConfig, repoUrl?: string): ComponentsJson;
|
|
37
259
|
export declare function getCnTemplate(): string;
|
|
38
|
-
export declare function getLocalTailwindCssTemplate(theme: Theme): string;
|
|
39
|
-
export declare function getLegacyTailwindCssTemplate(theme: Theme): string;
|
|
260
|
+
export declare function getLocalTailwindCssTemplate(theme: Theme, fontBody: FontPreset, fontHeading: FontPreset, radius: number): string;
|
|
261
|
+
export declare function getLegacyTailwindCssTemplate(theme: Theme, fontBody: FontPreset, fontHeading: FontPreset, radius: number): string;
|
|
40
262
|
export declare function runInit(config: InitConfig, targetDir: string, repoUrl?: string): Promise<{
|
|
41
263
|
success: boolean;
|
|
42
264
|
filesCreated: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB,yMAeZ,CAAC;AACX,KAAK,KAAK,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE;QACR,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC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W,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DjE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -20,6 +20,74 @@ const AVAILABLE_THEMES = [
|
|
|
20
20
|
"shadcn-violet",
|
|
21
21
|
"shadcn-yellow",
|
|
22
22
|
];
|
|
23
|
+
const FONT_PRESETS = [
|
|
24
|
+
// Sans-serif — geometric & modern
|
|
25
|
+
{ name: "outfit", label: "Outfit", family: "'Outfit', system-ui, sans-serif" },
|
|
26
|
+
{ name: "inter", label: "Inter", family: "'Inter', system-ui, sans-serif" },
|
|
27
|
+
{ name: "geist", label: "Geist", family: "'Geist', system-ui, sans-serif" },
|
|
28
|
+
{ name: "plus-jakarta-sans", label: "Plus Jakarta Sans", family: "'Plus Jakarta Sans', system-ui, sans-serif" },
|
|
29
|
+
{ name: "dm-sans", label: "DM Sans", family: "'DM Sans', system-ui, sans-serif" },
|
|
30
|
+
{ name: "albert-sans", label: "Albert Sans", family: "'Albert Sans', system-ui, sans-serif" },
|
|
31
|
+
{ name: "general-sans", label: "General Sans", family: "'General Sans', system-ui, sans-serif" },
|
|
32
|
+
{ name: "cabinet-grotesk", label: "Cabinet Grotesk", family: "'Cabinet Grotesk', system-ui, sans-serif" },
|
|
33
|
+
{ name: "satoshi", label: "Satoshi", family: "'Satoshi', system-ui, sans-serif" },
|
|
34
|
+
{ name: "clash-display", label: "Clash Display", family: "'Clash Display', system-ui, sans-serif" },
|
|
35
|
+
// Sans-serif — humanist & rounded
|
|
36
|
+
{ name: "nunito", label: "Nunito", family: "'Nunito', system-ui, sans-serif" },
|
|
37
|
+
{ name: "nunito-sans", label: "Nunito Sans", family: "'Nunito Sans', system-ui, sans-serif" },
|
|
38
|
+
{ name: "rubik", label: "Rubik", family: "'Rubik', system-ui, sans-serif" },
|
|
39
|
+
{ name: "poppins", label: "Poppins", family: "'Poppins', system-ui, sans-serif" },
|
|
40
|
+
{ name: "manrope", label: "Manrope", family: "'Manrope', system-ui, sans-serif" },
|
|
41
|
+
{ name: "sora", label: "Sora", family: "'Sora', system-ui, sans-serif" },
|
|
42
|
+
{ name: "figtree", label: "Figtree", family: "'Figtree', system-ui, sans-serif" },
|
|
43
|
+
{ name: "be-vietnam-pro", label: "Be Vietnam Pro", family: "'Be Vietnam Pro', system-ui, sans-serif" },
|
|
44
|
+
// Sans-serif — neo-grotesque & neutral
|
|
45
|
+
{ name: "open-sans", label: "Open Sans", family: "'Open Sans', system-ui, sans-serif" },
|
|
46
|
+
{ name: "roboto", label: "Roboto", family: "'Roboto', system-ui, sans-serif" },
|
|
47
|
+
{ name: "lato", label: "Lato", family: "'Lato', system-ui, sans-serif" },
|
|
48
|
+
{ name: "montserrat", label: "Montserrat", family: "'Montserrat', system-ui, sans-serif" },
|
|
49
|
+
{ name: "raleway", label: "Raleway", family: "'Raleway', system-ui, sans-serif" },
|
|
50
|
+
{ name: "work-sans", label: "Work Sans", family: "'Work Sans', system-ui, sans-serif" },
|
|
51
|
+
{ name: "source-sans-3", label: "Source Sans 3", family: "'Source Sans 3', system-ui, sans-serif" },
|
|
52
|
+
{ name: "barlow", label: "Barlow", family: "'Barlow', system-ui, sans-serif" },
|
|
53
|
+
{ name: "red-hat-display", label: "Red Hat Display", family: "'Red Hat Display', system-ui, sans-serif" },
|
|
54
|
+
{ name: "red-hat-text", label: "Red Hat Text", family: "'Red Hat Text', system-ui, sans-serif" },
|
|
55
|
+
{ name: "space-grotesk", label: "Space Grotesk", family: "'Space Grotesk', system-ui, sans-serif" },
|
|
56
|
+
{ name: "archivo", label: "Archivo", family: "'Archivo', system-ui, sans-serif" },
|
|
57
|
+
{ name: "overpass", label: "Overpass", family: "'Overpass', system-ui, sans-serif" },
|
|
58
|
+
{ name: "urbanist", label: "Urbanist", family: "'Urbanist', system-ui, sans-serif" },
|
|
59
|
+
{ name: "lexend", label: "Lexend", family: "'Lexend', system-ui, sans-serif" },
|
|
60
|
+
// Serif — editorial & elegant
|
|
61
|
+
{ name: "playfair-display", label: "Playfair Display", family: "'Playfair Display', Georgia, serif" },
|
|
62
|
+
{ name: "lora", label: "Lora", family: "'Lora', Georgia, serif" },
|
|
63
|
+
{ name: "merriweather", label: "Merriweather", family: "'Merriweather', Georgia, serif" },
|
|
64
|
+
{ name: "dm-serif-display", label: "DM Serif Display", family: "'DM Serif Display', Georgia, serif" },
|
|
65
|
+
{ name: "dm-serif-text", label: "DM Serif Text", family: "'DM Serif Text', Georgia, serif" },
|
|
66
|
+
{ name: "fraunces", label: "Fraunces", family: "'Fraunces', Georgia, serif" },
|
|
67
|
+
{ name: "source-serif-4", label: "Source Serif 4", family: "'Source Serif 4', Georgia, serif" },
|
|
68
|
+
{ name: "bitter", label: "Bitter", family: "'Bitter', Georgia, serif" },
|
|
69
|
+
{ name: "crimson-pro", label: "Crimson Pro", family: "'Crimson Pro', Georgia, serif" },
|
|
70
|
+
{ name: "libre-baskerville", label: "Libre Baskerville", family: "'Libre Baskerville', Georgia, serif" },
|
|
71
|
+
{ name: "eb-garamond", label: "EB Garamond", family: "'EB Garamond', Georgia, serif" },
|
|
72
|
+
{ name: "cormorant", label: "Cormorant", family: "'Cormorant', Georgia, serif" },
|
|
73
|
+
{ name: "instrument-serif", label: "Instrument Serif", family: "'Instrument Serif', Georgia, serif" },
|
|
74
|
+
{ name: "young-serif", label: "Young Serif", family: "'Young Serif', Georgia, serif" },
|
|
75
|
+
// Monospace
|
|
76
|
+
{ name: "jetbrains-mono", label: "JetBrains Mono", family: "'JetBrains Mono', ui-monospace, monospace" },
|
|
77
|
+
{ name: "fira-code", label: "Fira Code", family: "'Fira Code', ui-monospace, monospace" },
|
|
78
|
+
{ name: "source-code-pro", label: "Source Code Pro", family: "'Source Code Pro', ui-monospace, monospace" },
|
|
79
|
+
{ name: "ibm-plex-mono", label: "IBM Plex Mono", family: "'IBM Plex Mono', ui-monospace, monospace" },
|
|
80
|
+
{ name: "space-mono", label: "Space Mono", family: "'Space Mono', ui-monospace, monospace" },
|
|
81
|
+
// System
|
|
82
|
+
{ name: "system", label: "System Default", family: "system-ui, -apple-system, sans-serif" },
|
|
83
|
+
];
|
|
84
|
+
const RADIUS_OPTIONS = [
|
|
85
|
+
{ label: "None (0)", value: 0 },
|
|
86
|
+
{ label: "Small (0.25rem)", value: 0.25 },
|
|
87
|
+
{ label: "Medium (0.5rem)", value: 0.5 },
|
|
88
|
+
{ label: "Large (0.75rem)", value: 0.75 },
|
|
89
|
+
{ label: "Full (1rem)", value: 1.0 },
|
|
90
|
+
];
|
|
23
91
|
function discoverThemes(registryDir) {
|
|
24
92
|
if (registryDir) {
|
|
25
93
|
const themesDir = path.join(registryDir, "packages", "tokens", "src", "themes");
|
|
@@ -55,6 +123,27 @@ export async function promptInitConfig(registryDir) {
|
|
|
55
123
|
choices: themes.map((t) => ({ title: t, value: t })),
|
|
56
124
|
initial: 0,
|
|
57
125
|
},
|
|
126
|
+
{
|
|
127
|
+
type: "autocomplete",
|
|
128
|
+
name: "fontBody",
|
|
129
|
+
message: "Which font for body text?",
|
|
130
|
+
choices: FONT_PRESETS.map((f) => ({ title: f.label, value: f.name })),
|
|
131
|
+
initial: 0,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "autocomplete",
|
|
135
|
+
name: "fontHeading",
|
|
136
|
+
message: "Which font for headings?",
|
|
137
|
+
choices: FONT_PRESETS.map((f) => ({ title: f.label, value: f.name })),
|
|
138
|
+
initial: 0,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: "select",
|
|
142
|
+
name: "radius",
|
|
143
|
+
message: "Which border radius would you like to use?",
|
|
144
|
+
choices: RADIUS_OPTIONS.map((r) => ({ title: r.label, value: r.value })),
|
|
145
|
+
initial: 2,
|
|
146
|
+
},
|
|
58
147
|
{
|
|
59
148
|
type: "text",
|
|
60
149
|
name: "importAlias",
|
|
@@ -117,6 +206,11 @@ export function buildComponentsJson(config, repoUrl) {
|
|
|
117
206
|
utils: config.utilsAlias,
|
|
118
207
|
},
|
|
119
208
|
theme: config.theme,
|
|
209
|
+
font: {
|
|
210
|
+
body: config.fontBody,
|
|
211
|
+
heading: config.fontHeading,
|
|
212
|
+
},
|
|
213
|
+
radius: config.radius,
|
|
120
214
|
tanstack: {
|
|
121
215
|
router: config.tanstackRouter,
|
|
122
216
|
query: config.tanstackQuery,
|
|
@@ -138,20 +232,36 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
138
232
|
}
|
|
139
233
|
`;
|
|
140
234
|
}
|
|
141
|
-
|
|
235
|
+
function getFontFamily(font) {
|
|
236
|
+
const preset = FONT_PRESETS.find((f) => f.name === font);
|
|
237
|
+
return preset?.family ?? "'Outfit', system-ui, sans-serif";
|
|
238
|
+
}
|
|
239
|
+
export function getLocalTailwindCssTemplate(theme, fontBody, fontHeading, radius) {
|
|
142
240
|
return `@import "tailwindcss";
|
|
143
241
|
@import "./styles/tokens/index.css";
|
|
144
242
|
@import "./styles/tokens/themes/${theme}.css";
|
|
145
243
|
@import "./styles/tokens/presets/typography.css";
|
|
146
244
|
@import "./styles/tokens/presets/animations.css";
|
|
245
|
+
|
|
246
|
+
:root {
|
|
247
|
+
--radius: ${radius}rem;
|
|
248
|
+
--font-body: ${getFontFamily(fontBody)};
|
|
249
|
+
--font-heading: ${getFontFamily(fontHeading)};
|
|
250
|
+
}
|
|
147
251
|
`;
|
|
148
252
|
}
|
|
149
|
-
export function getLegacyTailwindCssTemplate(theme) {
|
|
253
|
+
export function getLegacyTailwindCssTemplate(theme, fontBody, fontHeading, radius) {
|
|
150
254
|
return `@import "tailwindcss";
|
|
151
255
|
@import "@company/tokens";
|
|
152
256
|
@import "@company/tokens/themes/${theme}.css";
|
|
153
257
|
@import "@company/tokens/presets/typography.css";
|
|
154
258
|
@import "@company/tokens/presets/animations.css";
|
|
259
|
+
|
|
260
|
+
:root {
|
|
261
|
+
--radius: ${radius}rem;
|
|
262
|
+
--font-body: ${getFontFamily(fontBody)};
|
|
263
|
+
--font-heading: ${getFontFamily(fontHeading)};
|
|
264
|
+
}
|
|
155
265
|
`;
|
|
156
266
|
}
|
|
157
267
|
function copyDirRecursive(src, dest) {
|
|
@@ -241,11 +351,11 @@ export async function runInit(config, targetDir, repoUrl) {
|
|
|
241
351
|
const registryDir = getCacheDir();
|
|
242
352
|
const tokenFiles = copyTokensToProject(registryDir, targetDir, config.theme);
|
|
243
353
|
filesCreated.push(...tokenFiles);
|
|
244
|
-
fs.writeFileSync(cssPath, getLocalTailwindCssTemplate(config.theme));
|
|
354
|
+
fs.writeFileSync(cssPath, getLocalTailwindCssTemplate(config.theme, config.fontBody, config.fontHeading, config.radius));
|
|
245
355
|
}
|
|
246
356
|
else {
|
|
247
357
|
// Local mode: reference @company/tokens package
|
|
248
|
-
fs.writeFileSync(cssPath, getLegacyTailwindCssTemplate(config.theme));
|
|
358
|
+
fs.writeFileSync(cssPath, getLegacyTailwindCssTemplate(config.theme, config.fontBody, config.fontHeading, config.radius));
|
|
249
359
|
}
|
|
250
360
|
filesCreated.push("src/index.css");
|
|
251
361
|
return { success: true, filesCreated };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgB3F;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAoDlE;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBnF"}
|
package/dist/commands/theme.js
CHANGED
|
@@ -2,7 +2,22 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import ora from "ora";
|
|
5
|
-
const AVAILABLE_THEMES = [
|
|
5
|
+
const AVAILABLE_THEMES = [
|
|
6
|
+
"monday",
|
|
7
|
+
"linear",
|
|
8
|
+
"notion",
|
|
9
|
+
"vercel",
|
|
10
|
+
"inai",
|
|
11
|
+
"anthropic",
|
|
12
|
+
"shadcn-default",
|
|
13
|
+
"shadcn-blue",
|
|
14
|
+
"shadcn-green",
|
|
15
|
+
"shadcn-orange",
|
|
16
|
+
"shadcn-red",
|
|
17
|
+
"shadcn-rose",
|
|
18
|
+
"shadcn-violet",
|
|
19
|
+
"shadcn-yellow",
|
|
20
|
+
];
|
|
6
21
|
export function resolveThemesDir(rootDir) {
|
|
7
22
|
return path.join(rootDir, "packages", "tokens", "src", "themes");
|
|
8
23
|
}
|
package/package.json
CHANGED