@bamboocss/types 1.34.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -407,34 +407,6 @@ interface CodegenOptions {
407
407
  * @default 'true'
408
408
  */
409
409
  shorthands?: boolean
410
- /**
411
- * Whether a lowered style leaf falls back to `css()` for a value that is not a scalar.
412
- *
413
- * Only the build-time fold calls the helper this governs. `css({ color: tone })` lowers to
414
- * `cssLeaf('c_', 'color', tone)`, which builds the class by concatenation — and hands the
415
- * value to `css()` when it turns out to be a condition object or a responsive array, which
416
- * no concatenation describes.
417
- *
418
- * That fallback is the single edge keeping the css engine in a bundle. It is reachable only
419
- * for a value the fold could not see the shape of, and it costs the whole prize: on
420
- * `sandbox/runtime-perf`, one dynamic leaf takes a module from **923 B to 7,542 B gzipped**,
421
- * because the reference pulls in `createCss`, the merge, the utility and shorthand tables
422
- * and the conditions. Turned off, the same module keeps 10 top-level bindings instead of 39.
423
- *
424
- * Turning it off asserts something about your source: **a style value that varies at runtime
425
- * is a scalar** — a string, a number, a boolean, or nothing. Write conditions and responsive
426
- * values as literals at the call site, where the fold reads them and resolves each branch,
427
- * rather than assembling them into a variable. A value that breaks the assertion throws,
428
- * naming the property, instead of silently producing a class with no rule behind it.
429
- *
430
- * Pairs with `failOnUnfolded` in `@bamboocss/vite`: with the fallback off a lowered leaf no
431
- * longer keeps the engine, so that option stops reporting one as a survivor. Together they
432
- * are what makes zero runtime reachable for an app that has any dynamic styling at all —
433
- * before this, it required an app with none.
434
- *
435
- * @default true
436
- */
437
- leafFallback?: boolean
438
410
  /**
439
411
  * File extension for generated javascript files.
440
412
  * @default 'mjs'
package/dist/parser.d.ts CHANGED
@@ -11,7 +11,17 @@ export interface ResultItem {
11
11
  * Both live in `ParserResult.token`, since every consumer that reads a token *path* out of
12
12
  * a result wants both.
13
13
  */
14
- type?: 'css' | 'cva' | 'sva' | 'token' | 'tokenValue' | 'pattern' | 'recipe' | 'jsx-recipe' | 'cva-call'
14
+ type?:
15
+ | 'css'
16
+ | 'cva'
17
+ | 'sva'
18
+ | 'token'
19
+ | 'tokenValue'
20
+ | 'viewTransition'
21
+ | 'pattern'
22
+ | 'recipe'
23
+ | 'jsx-recipe'
24
+ | 'cva-call'
15
25
  box?: BoxNodeMap | BoxNodeLiteral | BoxNodeArray
16
26
  /**
17
27
  * For a `cva-call`, the module the recipe was declared in when that is not this one.
package/dist/recipe.d.ts CHANGED
@@ -64,17 +64,13 @@ export interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantR
64
64
  */
65
65
  base?: SystemStyleObject
66
66
  /**
67
- * The prefix every class this recipe emits is built from — `button` gives `button` for
68
- * the base styles and `button--size_sm` for a variant.
67
+ * Semantic recipe name used by extraction-only integrations.
69
68
  *
70
69
  * Required for a recipe declared in `theme.recipes`, where it is the key it is declared
71
- * under. Optional for an inline `cva`, which is otherwise named by hashing its own
72
- * config: `cva_a1b2c3--size_sm`. Setting it buys readable class names and nothing else —
73
- * the CSS is identical either way.
70
+ * under. Optional for an inline `cva`.
74
71
  *
75
- * It has to be unique across every recipe in the build. Two recipes sharing a name emit
76
- * rules under the same selectors, and the later one wins for any variant they both
77
- * declare.
72
+ * The Vite compiler ignores this field when allocating declaration atoms: recipe identity
73
+ * is not style identity, so identical declarations share one class across recipes.
78
74
  */
79
75
  className?: string
80
76
  /**
@@ -117,7 +113,10 @@ interface RecipeConfigMeta {
117
113
 
118
114
  export interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>
119
115
  extends RecipeDefinition<T>, RecipeConfigMeta {
120
- /** Optional on `RecipeDefinition`, where an inline `cva` falls back to hashing its config. A recipe declared in `theme.recipes` always has one — the key it is declared under. */
116
+ /**
117
+ * Required extraction metadata for a configured recipe: the key under which it is
118
+ * declared in `theme.recipes`. The Vite compiler does not use it as style identity.
119
+ */
121
120
  className: string
122
121
  }
123
122
 
@@ -169,16 +168,13 @@ export interface SlotRecipeDefinition<
169
168
  T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
170
169
  > {
171
170
  /**
172
- * The prefix every class this recipe emits is built from, and the name to target its
173
- * slots in the DOM by — `checkbox` gives `checkbox__control` for a slot and
174
- * `checkbox__control--size_md` for that slot under a variant.
171
+ * Semantic recipe name used by extraction-only integrations.
175
172
  *
176
173
  * Required for a recipe declared in `theme.slotRecipes`, where it is the key it is
177
- * declared under. Optional for an inline `sva`, which is otherwise named by hashing its
178
- * own config. Setting it buys readable class names and nothing else — the CSS is
179
- * identical either way.
174
+ * declared under. Optional for an inline `sva`.
180
175
  *
181
- * It has to be unique across every recipe in the build.
176
+ * The Vite compiler ignores this field when allocating declaration atoms: recipe and slot
177
+ * identity do not enter generated class names.
182
178
  */
183
179
  className?: string
184
180
  /**
@@ -190,9 +186,10 @@ export interface SlotRecipeDefinition<
190
186
  */
191
187
  slots: S[] | Readonly<S[]>
192
188
  /**
193
- * The slots that enclose other slots, used to scope their variant styles.
189
+ * The slots that enclose other slots in extraction-only named-rule output.
194
190
  *
195
- * A slot recipe's variants are chosen once, at the top, but the slots that react to them
191
+ * The Vite compiler returns selected atoms directly for every slot and ignores this field.
192
+ * In extraction-only output, a slot recipe's variants are chosen once at the top, but the slots that react to them
196
193
  * are authored by the consumer somewhere below. Naming the enclosing slots lets the build
197
194
  * emit their variant styles as rules scoped by a class those slots already carry, so
198
195
  * nothing has to be delivered to a slot at runtime and every other slot's class is a
@@ -247,6 +244,9 @@ export type SlotRecipeConfig<
247
244
  T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
248
245
  > = SlotRecipeDefinition<S, T> &
249
246
  RecipeConfigMeta & {
250
- /** Optional on `SlotRecipeDefinition`, where an inline `sva` falls back to hashing its config. A recipe declared in `theme.slotRecipes` always has one — the key it is declared under. */
247
+ /**
248
+ * Required extraction metadata for a configured recipe: the key under which it is
249
+ * declared in `theme.slotRecipes`. The Vite compiler does not use it as style identity.
250
+ */
251
251
  className: string
252
252
  }
@@ -1,6 +1,6 @@
1
1
  import type { ParserResultInterface } from './parser'
2
2
 
3
- export type ReportItemType = 'css' | 'cva' | 'sva' | 'token' | 'pattern' | 'recipe' | 'jsx-recipe'
3
+ export type ReportItemType = 'css' | 'cva' | 'sva' | 'token' | 'viewTransition' | 'pattern' | 'recipe' | 'jsx-recipe'
4
4
 
5
5
  type ComponentKind = 'component' | 'function'
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/types",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "description": "The types for css bamboo",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "ncp": "2.0.0",
33
33
  "pkg-types": "2.3.0",
34
34
  "ts-morph": "28.0.0",
35
- "@bamboocss/extractor": "1.34.0"
35
+ "@bamboocss/extractor": "1.35.0"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",