@tamagui/static 3.0.0-beta.1187.1 → 3.0.0-beta.1202.1

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.
@@ -0,0 +1,610 @@
1
+ export interface GenerateConfigMarkdownOptions {
2
+ styleValueSyntax?: 'string' | 'object' | 'both'
3
+ }
4
+
5
+ export function generateConfigMarkdown(
6
+ config: any,
7
+ options?: GenerateConfigMarkdownOptions
8
+ ): string {
9
+ const sections: string[] = []
10
+
11
+ // header
12
+ sections.push('# Tamagui Configuration\n\n')
13
+ sections.push(
14
+ 'This document provides an overview of the Tamagui configuration for this project.\n\n'
15
+ )
16
+
17
+ // get shorthands for use throughout the document
18
+ const shorthands = config.tamaguiConfig?.shorthands || {}
19
+ const reverseShorthands: Record<string, string> = {}
20
+ for (const [short, full] of Object.entries(shorthands)) {
21
+ reverseShorthands[full as string] = short
22
+ }
23
+
24
+ // helper function to get the correct property name based on settings
25
+ const getPropName = (fullProp: string): string => {
26
+ const settings = config.tamaguiConfig?.settings || {}
27
+ if (settings.onlyAllowShorthands) {
28
+ if (reverseShorthands[fullProp]) return reverseShorthands[fullProp]
29
+ if (fullProp === 'backgroundColor' && reverseShorthands['background']) {
30
+ return reverseShorthands['background']
31
+ }
32
+ }
33
+ return fullProp
34
+ }
35
+
36
+ const settings = config.tamaguiConfig?.settings || {}
37
+ const syntaxChoice = options?.styleValueSyntax || settings.styleValueSyntax || 'both'
38
+
39
+ // configuration settings
40
+ sections.push('## Configuration Settings\n\n')
41
+ sections.push(
42
+ '**IMPORTANT:** These settings affect how you write Tamagui code in this project.\n\n'
43
+ )
44
+
45
+ if (settings.defaultFont) {
46
+ sections.push(`### Default Font: \`${settings.defaultFont}\`\n\n`)
47
+ sections.push(
48
+ `All text components will use the "${settings.defaultFont}" font family by default.\n\n`
49
+ )
50
+ }
51
+
52
+ if (settings.onlyAllowShorthands !== undefined) {
53
+ sections.push(`### Only Allow Shorthands: \`${settings.onlyAllowShorthands}\`\n\n`)
54
+ if (settings.onlyAllowShorthands) {
55
+ sections.push('**You MUST use shorthand properties in this project.**\n\n')
56
+ sections.push('Full property names are not allowed. For example:\n')
57
+ sections.push('- ✅ `<View w="10" />` (correct)\n')
58
+ sections.push('- ❌ `<View width="10" />` (will error)\n\n')
59
+ sections.push(
60
+ 'See the Shorthand Properties section below for all available shorthands.\n\n'
61
+ )
62
+ } else {
63
+ sections.push('You can use either shorthand or full property names.\n\n')
64
+ }
65
+ }
66
+
67
+ // style value syntax section
68
+ if (syntaxChoice === 'string') {
69
+ sections.push('### Style value syntax: `string`\n\n')
70
+ sections.push(
71
+ 'Only the string form is allowed in this project (e.g. `bg="red hover:blue"`).\n\n'
72
+ )
73
+ } else if (syntaxChoice === 'object') {
74
+ sections.push('### Style value syntax: `object`\n\n')
75
+ sections.push(
76
+ "Only the object form is allowed in this project (e.g. `bg={{ default: 'red', hover: 'blue' }}`).\n\n"
77
+ )
78
+ } else {
79
+ sections.push('### Style value syntax\n\n')
80
+ sections.push('Both string and object style value syntax are allowed.\n\n')
81
+ }
82
+
83
+ if (settings.addThemeClassName !== undefined) {
84
+ sections.push(`### Theme Class Name: \`${settings.addThemeClassName}\`\n\n`)
85
+ if (settings.addThemeClassName === 'html') {
86
+ sections.push('Theme classes are applied to the root HTML element.\n\n')
87
+ }
88
+ }
89
+
90
+ if (settings.allowedStyleValues) {
91
+ sections.push('### Allowed Style Values\n\n')
92
+ sections.push(
93
+ `Type validation: \`${JSON.stringify(settings.allowedStyleValues)}\`.\n\n`
94
+ )
95
+ sections.push(
96
+ 'Single-token values are type-checked. Run `tamagui check --strict` to also validate conditional payloads.\n\n'
97
+ )
98
+ }
99
+
100
+ // flat value grammar section
101
+ sections.push('## Flat Value Grammar\n\n')
102
+ sections.push('Conditional style values follow this grammar:\n\n')
103
+ sections.push('```txt\n')
104
+ sections.push('value := base? clause*\n')
105
+ sections.push('clause := modifier(:modifier)*:payload\n')
106
+ sections.push('```\n\n')
107
+ sections.push(
108
+ '- No `$` sigils: bare token names (`bg="background"`, not `bg="$background"`).\n'
109
+ )
110
+ sections.push(
111
+ '- Kebab-case theme names: `background-hover`, `border-color`, `shadow-color`.\n'
112
+ )
113
+ sections.push('- Numbers are px: `p={4}` is 4px, while `p="4"` is space token 4.\n')
114
+ sections.push(
115
+ '- Specificity precedence: platform (`ios:` > `native:` > bare) > condition count > category (media < container < theme < group < state).\n\n'
116
+ )
117
+
118
+ const bgProp = getPropName('background')
119
+ const pProp = getPropName('padding')
120
+
121
+ if (syntaxChoice === 'string') {
122
+ sections.push('**String form:**\n\n')
123
+ sections.push('```tsx\n')
124
+ sections.push(
125
+ `<View ${bgProp}="background hover:background-hover dark:blue-500" ${pProp}="4 sm:6 max-sm:2" />\n`
126
+ )
127
+ sections.push('```\n\n')
128
+ } else if (syntaxChoice === 'object') {
129
+ sections.push('**Object form:**\n\n')
130
+ sections.push('```tsx\n')
131
+ sections.push(
132
+ `<View ${bgProp}={{ default: 'background', hover: 'background-hover', dark: 'blue-500' }} ${pProp}={{ default: '4', sm: '6', 'max-sm': '2' }} />\n`
133
+ )
134
+ sections.push('```\n\n')
135
+ } else {
136
+ sections.push('Both forms are allowed:\n\n')
137
+ sections.push('```tsx\n')
138
+ sections.push('// string form\n')
139
+ sections.push(
140
+ `<View ${bgProp}="background hover:background-hover dark:blue-500" ${pProp}="4 sm:6 max-sm:2" />\n\n`
141
+ )
142
+ sections.push('// object form\n')
143
+ sections.push(
144
+ `<View ${bgProp}={{ default: 'background', hover: 'background-hover', dark: 'blue-500' }} ${pProp}={{ default: '4', sm: '6', 'max-sm': '2' }} />\n`
145
+ )
146
+ sections.push('```\n\n')
147
+ }
148
+
149
+ // shorthands
150
+ sections.push('## Shorthand Properties\n\n')
151
+ sections.push('These shorthand properties are available for styling:\n\n')
152
+ const shorthandEntries = Object.entries(shorthands).sort(([a], [b]) =>
153
+ a.localeCompare(b)
154
+ )
155
+ sections.push(
156
+ shorthandEntries.map(([short, full]) => `- \`${short}\` → \`${full}\``).join('\n')
157
+ )
158
+ sections.push('\n\n')
159
+
160
+ // named control sizes table
161
+ const sizes = config.tamaguiConfig?.sizes
162
+ if (sizes && typeof sizes === 'object') {
163
+ sections.push('## Named Control Sizes\n\n')
164
+ sections.push(
165
+ `Control components (Button, Input, etc.) use the configured names below. Default is \`${sizes.default ?? 'md'}\`.\n\n`
166
+ )
167
+ sections.push('| Size | Configuration |\n')
168
+ sections.push('|---|---|\n')
169
+ for (const [sizeKey, val] of Object.entries(sizes)) {
170
+ if (sizeKey === 'default') continue
171
+ const valStr =
172
+ typeof val === 'object' && val !== null ? JSON.stringify(val) : String(val)
173
+ const isDefault = sizes.default === sizeKey ? ' (default)' : ''
174
+ sections.push(`| \`${sizeKey}\`${isDefault} | ${valStr} |\n`)
175
+ }
176
+ sections.push('\n')
177
+ }
178
+
179
+ // themes
180
+ sections.push('## Themes\n\n')
181
+ const themes = config.tamaguiConfig?.themes || {}
182
+ const themeNames = Object.keys(themes).sort()
183
+
184
+ sections.push(themeNames.map((name) => `- \`${name}\``).join('\n'))
185
+ sections.push(
186
+ '\n\nTheme names above are exact configured names. Nested themes resolve relative to their parent. Use an explicit theme boundary in a component skin.\n\n'
187
+ )
188
+ if (themeNames.length) {
189
+ sections.push('### Theme Usage\n\n')
190
+ sections.push(
191
+ `\`\`\`tsx\n<Theme name=${JSON.stringify(themeNames[0])}>\n <Button>Uses this theme</Button>\n</Theme>\n\`\`\`\n\n`
192
+ )
193
+ }
194
+
195
+ sections.push('**Accessing theme values:**\n\n')
196
+ sections.push('Components access theme values by their bare names:\n\n')
197
+ const colorProp = getPropName('color')
198
+ if (syntaxChoice === 'string') {
199
+ sections.push('```tsx\n')
200
+ sections.push(
201
+ `<View ${bgProp}="background hover:background-hover" ${colorProp}="color" />\n`
202
+ )
203
+ sections.push('```\n\n')
204
+ } else if (syntaxChoice === 'object') {
205
+ sections.push('```tsx\n')
206
+ sections.push(
207
+ `<View ${bgProp}={{ default: 'background', hover: 'background-hover' }} ${colorProp}={{ default: 'color' }} />\n`
208
+ )
209
+ sections.push('```\n\n')
210
+ } else {
211
+ sections.push('```tsx\n')
212
+ sections.push('// string form\n')
213
+ sections.push(
214
+ `<View ${bgProp}="background hover:background-hover" ${colorProp}="color" />\n\n`
215
+ )
216
+ sections.push('// object form\n')
217
+ sections.push(
218
+ `<View ${bgProp}={{ default: 'background', hover: 'background-hover' }} ${colorProp}={{ default: 'color' }} />\n`
219
+ )
220
+ sections.push('```\n\n')
221
+ }
222
+
223
+ sections.push('**Special props:**\n\n')
224
+ sections.push('- `theme="inverse"`: Uses the opposite light or dark sub-theme\n')
225
+
226
+ // tokens
227
+ sections.push('## Tokens\n\n')
228
+ sections.push('Tokens are design system values referenced by their bare names.\n\n')
229
+
230
+ const tokens = config.tamaguiConfig?.tokens || {}
231
+
232
+ // space tokens (only if present and non-empty)
233
+ if (tokens.space && Object.keys(tokens.space).length > 0) {
234
+ sections.push('### Space Tokens\n\n')
235
+ const spaceTokens = Object.entries(tokens.space).sort(([a], [b]) => {
236
+ const numA = parseFloat(a)
237
+ const numB = parseFloat(b)
238
+ if (!isNaN(numA) && !isNaN(numB)) {
239
+ return numA - numB
240
+ }
241
+ return a.localeCompare(b)
242
+ })
243
+ sections.push(
244
+ spaceTokens
245
+ .map(([key, value]) => `- \`${key}\`: ${formatTokenValue(value)}`)
246
+ .join('\n')
247
+ )
248
+ sections.push('\n\n')
249
+ }
250
+
251
+ // size tokens (only if present and non-empty)
252
+ if (tokens.size && Object.keys(tokens.size).length > 0) {
253
+ sections.push('### Size Tokens\n\n')
254
+ const sizeTokens = Object.entries(tokens.size).sort(([a], [b]) => {
255
+ const numA = parseFloat(a)
256
+ const numB = parseFloat(b)
257
+ if (!isNaN(numA) && !isNaN(numB)) {
258
+ return numA - numB
259
+ }
260
+ return a.localeCompare(b)
261
+ })
262
+ sections.push(
263
+ sizeTokens
264
+ .map(([key, value]) => `- \`${key}\`: ${formatTokenValue(value)}`)
265
+ .join('\n')
266
+ )
267
+ sections.push('\n\n')
268
+ }
269
+
270
+ // radius tokens (only if present and non-empty)
271
+ if (tokens.radius && Object.keys(tokens.radius).length > 0) {
272
+ sections.push('### Radius Tokens\n\n')
273
+ const radiusTokens = Object.entries(tokens.radius).sort(([a], [b]) => {
274
+ const numA = parseFloat(a)
275
+ const numB = parseFloat(b)
276
+ if (!isNaN(numA) && !isNaN(numB)) {
277
+ return numA - numB
278
+ }
279
+ return a.localeCompare(b)
280
+ })
281
+ sections.push(
282
+ radiusTokens
283
+ .map(([key, value]) => `- \`${key}\`: ${formatTokenValue(value)}`)
284
+ .join('\n')
285
+ )
286
+ sections.push('\n\n')
287
+ }
288
+
289
+ // zIndex tokens (only if present and non-empty)
290
+ if (tokens.zIndex && Object.keys(tokens.zIndex).length > 0) {
291
+ sections.push('### Z-Index Tokens\n\n')
292
+ const zIndexTokens = Object.entries(tokens.zIndex).sort(([a], [b]) => {
293
+ const numA = parseFloat(a)
294
+ const numB = parseFloat(b)
295
+ if (!isNaN(numA) && !isNaN(numB)) {
296
+ return numA - numB
297
+ }
298
+ return a.localeCompare(b)
299
+ })
300
+ sections.push(
301
+ zIndexTokens
302
+ .map(([key, value]) => `- \`${key}\`: ${formatTokenValue(value)}`)
303
+ .join('\n')
304
+ )
305
+ sections.push('\n\n')
306
+ }
307
+
308
+ // color tokens (only if present and non-empty; summarized if large palette set)
309
+ let sampleColorBg = 'blue-500'
310
+ let sampleColorText = 'color'
311
+ if (tokens.color && Object.keys(tokens.color).length > 0) {
312
+ sections.push('### Color Tokens\n\n')
313
+ const colorKeys = Object.keys(tokens.color).sort()
314
+
315
+ // detect tailwind style palette keys: <palette>-<step>
316
+ const paletteMap = new Map<string, Set<string>>()
317
+ const standaloneColors: Array<[string, any]> = []
318
+
319
+ for (const key of colorKeys) {
320
+ const match = key.match(/^([a-z]+)-(\d+)$/)
321
+ if (match) {
322
+ const [, palette, step] = match
323
+ if (!paletteMap.has(palette)) {
324
+ paletteMap.set(palette, new Set())
325
+ }
326
+ paletteMap.get(palette)!.add(step)
327
+ } else {
328
+ standaloneColors.push([key, tokens.color[key]])
329
+ }
330
+ }
331
+
332
+ if (paletteMap.size >= 4) {
333
+ // summarize palettes compactly instead of 300+ line dump
334
+ const palettes = Array.from(paletteMap.keys()).sort().join(', ')
335
+ sections.push(`**Tailwind Palettes (\`<name>-<50..950>\`):** ${palettes}\n\n`)
336
+ if (standaloneColors.length > 0) {
337
+ sections.push('**Named Colors:**\n\n')
338
+ sections.push(
339
+ standaloneColors
340
+ .map(([k, v]) => `- \`${k}\`: ${formatTokenValue(v)}`)
341
+ .join('\n')
342
+ )
343
+ sections.push('\n\n')
344
+ }
345
+ sampleColorBg = colorKeys.find((k) => k.startsWith('blue-')) || colorKeys[0]
346
+ sampleColorText =
347
+ colorKeys.find((k) => k.startsWith('gray-') || k.startsWith('zinc-')) ||
348
+ colorKeys[1] ||
349
+ 'color'
350
+ } else {
351
+ sections.push(
352
+ colorKeys
353
+ .map((key) => `- \`${key}\`: ${formatTokenValue(tokens.color[key])}`)
354
+ .join('\n')
355
+ )
356
+ sections.push('\n\n')
357
+ sampleColorBg = colorKeys[0] || 'background'
358
+ sampleColorText = colorKeys[1] || 'color'
359
+ }
360
+ } else {
361
+ sampleColorBg = 'background'
362
+ sampleColorText = 'color'
363
+ }
364
+
365
+ // token usage examples
366
+ sections.push('### Token Usage\n\n')
367
+ sections.push('Tokens can be used in component props by their bare names:\n\n')
368
+
369
+ const paddingProp = getPropName('padding')
370
+ const gapProp = getPropName('gap')
371
+ const marginProp = getPropName('margin')
372
+ const widthProp = getPropName('width')
373
+ const heightProp = getPropName('height')
374
+ const radiusProp = getPropName('borderRadius')
375
+ const sampleRadius = tokens.radius?.md
376
+ ? 'md'
377
+ : Object.keys(tokens.radius || {})[0] || '0px'
378
+
379
+ if (syntaxChoice === 'string') {
380
+ sections.push('```tsx\n')
381
+ sections.push(
382
+ `// Space tokens - for margin, padding, gap\n<View ${paddingProp}="4 sm:6" ${gapProp}="2" ${marginProp}="3" />\n\n`
383
+ )
384
+ sections.push(
385
+ `// Size tokens - for width, height, dimensions\n<View ${widthProp}="10 sm:12" ${heightProp}="6" />\n\n`
386
+ )
387
+ sections.push(
388
+ `// Color tokens - for colors and backgrounds\n<View ${bgProp}="${sampleColorBg} hover:${sampleColorBg}" ${colorProp}="${sampleColorText}" />\n\n`
389
+ )
390
+ sections.push(
391
+ `// Radius tokens - for border-radius\n<View ${radiusProp}="${sampleRadius}" />\n`
392
+ )
393
+ sections.push('```\n\n')
394
+ } else if (syntaxChoice === 'object') {
395
+ sections.push('```tsx\n')
396
+ sections.push(
397
+ `// Space tokens - for margin, padding, gap\n<View ${paddingProp}={{ default: '4', sm: '6' }} ${gapProp}="2" ${marginProp}="3" />\n\n`
398
+ )
399
+ sections.push(
400
+ `// Size tokens - for width, height, dimensions\n<View ${widthProp}={{ default: '10', sm: '12' }} ${heightProp}="6" />\n\n`
401
+ )
402
+ sections.push(
403
+ `// Color tokens - for colors and backgrounds\n<View ${bgProp}={{ default: '${sampleColorBg}', hover: '${sampleColorBg}' }} ${colorProp}={{ default: '${sampleColorText}' }} />\n\n`
404
+ )
405
+ sections.push(
406
+ `// Radius tokens - for border-radius\n<View ${radiusProp}="${sampleRadius}" />\n`
407
+ )
408
+ sections.push('```\n\n')
409
+ } else {
410
+ sections.push('```tsx\n')
411
+ sections.push('// String form\n')
412
+ sections.push(
413
+ `<View ${paddingProp}="4 sm:6" ${widthProp}="10 sm:12" ${bgProp}="${sampleColorBg}" />\n\n`
414
+ )
415
+ sections.push('// Object form\n')
416
+ sections.push(
417
+ `<View ${paddingProp}={{ default: '4', sm: '6' }} ${widthProp}={{ default: '10', sm: '12' }} ${bgProp}={{ default: '${sampleColorBg}' }} />\n\n`
418
+ )
419
+ sections.push(
420
+ `// Space and radius tokens\n<View ${gapProp}="2" ${marginProp}="3" ${heightProp}="6" ${radiusProp}="${sampleRadius}" />\n`
421
+ )
422
+ sections.push('```\n\n')
423
+ }
424
+
425
+ // media queries
426
+ if (config.tamaguiConfig?.media) {
427
+ sections.push('## Media Queries\n\n')
428
+ sections.push('Available responsive breakpoints:\n\n')
429
+
430
+ const media = config.tamaguiConfig.media
431
+ const mediaEntries = Object.entries(media).sort(([a], [b]) => a.localeCompare(b))
432
+
433
+ for (const [name, query] of mediaEntries) {
434
+ sections.push(`- **${name}**: ${formatMediaQuery(query)}\n`)
435
+ }
436
+ sections.push('\n')
437
+
438
+ sections.push('### Media Query Usage\n\n')
439
+ sections.push(
440
+ 'Media queries can be used as style props or with the `useMedia` hook:\n\n'
441
+ )
442
+
443
+ // pick a representative media query (prefer sm or md over height-*)
444
+ const representative =
445
+ mediaEntries.find(([n]) => n === 'sm' || n === 'md')?.[0] ||
446
+ mediaEntries.find(([n]) => !n.includes('-'))?.[0] ||
447
+ mediaEntries[0]?.[0]
448
+
449
+ if (representative) {
450
+ const isIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(representative)
451
+ const mediaAccess = isIdentifier
452
+ ? `media.${representative}`
453
+ : `media['${representative}']`
454
+
455
+ sections.push('```tsx\n')
456
+ if (syntaxChoice === 'string') {
457
+ sections.push('// As a clause in the same style value\n')
458
+ sections.push(`<View ${widthProp}="100% ${representative}:50%" />\n\n`)
459
+ } else if (syntaxChoice === 'object') {
460
+ sections.push('// Using the object form\n')
461
+ sections.push(
462
+ `<View ${widthProp}={{ default: '100%', '${representative}': '50%' }} />\n\n`
463
+ )
464
+ } else {
465
+ sections.push('// String form and object form\n')
466
+ sections.push(`<View ${widthProp}="100% ${representative}:50%" />\n`)
467
+ sections.push(
468
+ `<View ${widthProp}={{ default: '100%', '${representative}': '50%' }} />\n\n`
469
+ )
470
+ }
471
+
472
+ sections.push('// Using the useMedia hook\n')
473
+ sections.push('const media = useMedia()\n')
474
+ sections.push(`if (${mediaAccess}) {\n`)
475
+ sections.push(' // Render for this breakpoint\n')
476
+ sections.push('}\n')
477
+ sections.push('```\n\n')
478
+ }
479
+ }
480
+
481
+ // fonts
482
+ if (config.tamaguiConfig?.fonts) {
483
+ sections.push('## Fonts\n\n')
484
+ sections.push('Available font families:\n\n')
485
+ const fonts = config.tamaguiConfig.fonts
486
+ const fontNames = Object.keys(fonts).sort()
487
+ sections.push(fontNames.map((name) => `- ${name}`).join('\n'))
488
+ sections.push('\n\n')
489
+ }
490
+
491
+ // animations
492
+ if (config.tamaguiConfig?.animations) {
493
+ sections.push('## Animations\n\n')
494
+ sections.push('Available animation presets:\n\n')
495
+ const animations = config.tamaguiConfig.animations
496
+ if (animations.animations) {
497
+ const animationNames = Object.keys(animations.animations).sort()
498
+ sections.push(animationNames.map((name) => `- ${name}`).join('\n'))
499
+ sections.push('\n\n')
500
+ }
501
+ }
502
+
503
+ // components section: emit barrel's public import surface
504
+ const componentsSection: string[] = []
505
+ const componentSet = new Set<string>()
506
+
507
+ // try loading public exports from tamagui or candidate modules
508
+ let barrelExported = false
509
+ const candidateModules = [
510
+ 'tamagui',
511
+ ...(config.components || []).map((c: any) => c.moduleName),
512
+ ]
513
+ for (const modName of candidateModules) {
514
+ if (!modName) continue
515
+ try {
516
+ const mod = require(modName)
517
+ for (const [key, val] of Object.entries(mod)) {
518
+ if (
519
+ /^[A-Z]/.test(key) &&
520
+ (typeof val === 'function' || (typeof val === 'object' && val !== null))
521
+ ) {
522
+ if (
523
+ !key.endsWith('Context') &&
524
+ !key.endsWith('Provider') &&
525
+ key !== 'Fragment'
526
+ ) {
527
+ componentSet.add(key)
528
+ barrelExported = true
529
+ }
530
+ }
531
+ }
532
+ if (barrelExported) break
533
+ } catch {
534
+ // fallback to config.components below
535
+ }
536
+ }
537
+
538
+ if (!barrelExported && config.components) {
539
+ for (const componentModule of config.components) {
540
+ for (const name of Object.keys(componentModule.nameToInfo || {})) {
541
+ componentSet.add(name)
542
+ }
543
+ }
544
+ }
545
+
546
+ // filter internal frames ending with Frame when parent or part exists
547
+ const allComponents = Array.from(componentSet).filter((name) => {
548
+ if (name.endsWith('Frame')) {
549
+ const base = name.replace(/Frame$/, '')
550
+ if (
551
+ componentSet.has(base) ||
552
+ name.startsWith('Popper') ||
553
+ name.startsWith('DialogPortal') ||
554
+ name.startsWith('SelectScrollButton')
555
+ ) {
556
+ return false
557
+ }
558
+ }
559
+ return true
560
+ })
561
+
562
+ componentsSection.push('## Components\n\n')
563
+ componentsSection.push('Available named exports (import these names directly):\n\n')
564
+ for (const name of allComponents.sort()) {
565
+ componentsSection.push(`- ${name}\n`)
566
+ }
567
+ componentsSection.push('\n')
568
+
569
+ sections.push(...componentsSection)
570
+ return sections.join('')
571
+ }
572
+
573
+ function formatTokenValue(value: any): string {
574
+ if (typeof value === 'object' && value !== null && 'val' in value) {
575
+ return String(value.val)
576
+ }
577
+ return String(value)
578
+ }
579
+
580
+ function formatMediaQuery(query: any): string {
581
+ if (typeof query !== 'object' || query === null) {
582
+ return String(query)
583
+ }
584
+ const parts: string[] = []
585
+ if (query.minWidth !== undefined) {
586
+ parts.push(`min-width: ${query.minWidth}px (screens >= ${query.minWidth}px wide)`)
587
+ }
588
+ if (query.maxWidth !== undefined) {
589
+ parts.push(`max-width: ${query.maxWidth}px (screens <= ${query.maxWidth}px wide)`)
590
+ }
591
+ if (query.minHeight !== undefined) {
592
+ parts.push(`min-height: ${query.minHeight}px (screens >= ${query.minHeight}px tall)`)
593
+ }
594
+ if (query.maxHeight !== undefined) {
595
+ parts.push(`max-height: ${query.maxHeight}px (screens <= ${query.maxHeight}px tall)`)
596
+ }
597
+ if (query.hover !== undefined) {
598
+ parts.push(`pointer: hover (${query.hover})`)
599
+ }
600
+ if (query.pointer !== undefined) {
601
+ parts.push(`pointer: ${query.pointer}`)
602
+ }
603
+ if (query.prefersReducedMotion !== undefined) {
604
+ parts.push(`prefers-reduced-motion: ${query.prefersReducedMotion}`)
605
+ }
606
+ if (parts.length === 0) {
607
+ return JSON.stringify(query)
608
+ }
609
+ return parts.join(', ')
610
+ }
@@ -158,6 +158,8 @@ export async function loadTamaguiFromModules(
158
158
  await writeTamaguiCSS(props.outputCSS, projectInfo.tamaguiConfig)
159
159
  }
160
160
 
161
+ await regenerateConfig(props, projectInfo)
162
+
161
163
  return projectInfo
162
164
  }
163
165