@bamboocss/types 1.28.0 → 1.28.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.
package/dist/config.d.ts CHANGED
@@ -215,7 +215,7 @@ interface FileSystemOptions {
215
215
  * css: 'styled-system/css',
216
216
  * recipes: 'styled-system/recipes',
217
217
  * patterns: 'styled-system/patterns',
218
- * jsx: 'styled-system/jsx',
218
+ * tokens: 'styled-system/tokens',
219
219
  * }
220
220
  * ```
221
221
  */
@@ -303,10 +303,11 @@ interface CssgenOptions {
303
303
  *
304
304
  * It is opt-in because reachability cannot be proven for every reference. `token()` and
305
305
  * `token.var()` calls are read out of the source, as is any literal `var(--x)` written
306
- * by hand. Three things stay invisible: a token named by a path the source does not
307
- * spell out as a string literal, one referenced only from a stylesheet outside
308
- * `include`, and one used by a separate package consuming the output as design tokens.
309
- * Use `staticCss` to keep those.
306
+ * by hand and both forms are resolved through a constant or a template literal the
307
+ * extractor can follow, not only through a path spelled out at the call. Three things
308
+ * stay invisible: a token named by a path assembled from a value that only exists at
309
+ * runtime, one referenced only from a stylesheet outside `include`, and one used by a
310
+ * separate package consuming the output as design tokens. Use `staticCss` to keep those.
310
311
  *
311
312
  * Only the *second* form of the first case is a risk. `token(key)` is safe for any path,
312
313
  * because javascript receives a literal for a plain token rather than a reference. It is
@@ -397,7 +398,7 @@ interface CssgenOptions {
397
398
  prunePreflight?: boolean
398
399
  /**
399
400
  * The root selector for the css variables.
400
- * @default ':where(:host, :root)'
401
+ * @default ':where(:root, :host)'
401
402
  */
402
403
  cssVarRoot?: string
403
404
  /**
package/dist/parser.d.ts CHANGED
@@ -3,7 +3,13 @@ import type { BoxNodeArray, BoxNodeLiteral, BoxNodeMap, Unboxed } from '@bambooc
3
3
  export interface ResultItem {
4
4
  name?: string
5
5
  data: Array<Unboxed['raw']>
6
- type?: 'css' | 'cva' | 'sva' | 'token' | 'pattern' | 'recipe' | 'jsx-recipe' | 'cva-call'
6
+ /**
7
+ * `tokenVar` is `token.var(path)`, kept distinct from `token` because the two resolve to
8
+ * different halves of the same entry — the variable reference against the resolved value.
9
+ * Both live in `ParserResult.token`, since every consumer that reads a token *path* out of
10
+ * a result wants both.
11
+ */
12
+ type?: 'css' | 'cva' | 'sva' | 'token' | 'tokenVar' | 'pattern' | 'recipe' | 'jsx-recipe' | 'cva-call'
7
13
  box?: BoxNodeMap | BoxNodeLiteral | BoxNodeArray
8
14
  /**
9
15
  * For a `cva-call`, the module the recipe was declared in when that is not this one.
@@ -32,7 +38,7 @@ export interface ParserResultInterface {
32
38
  setCss: (result: ResultItem) => void
33
39
  setCva: (result: ResultItem) => void
34
40
  setSva: (result: ResultItem) => void
35
- setToken: (result: ResultItem) => void
41
+ setToken: (result: ResultItem, kind?: 'token' | 'tokenVar') => void
36
42
  setViewTransition: (result: ResultItem) => void
37
43
  setPattern: (name: string, result: ResultItem) => void
38
44
  setRecipe: (name: string, result: ResultItem) => void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/types",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
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.28.0"
35
+ "@bamboocss/extractor": "1.28.1"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",