@bamboocss/types 1.26.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 +7 -6
- package/dist/parser.d.ts +15 -2
- package/package.json +2 -2
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
|
-
*
|
|
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
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
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(:
|
|
401
|
+
* @default ':where(:root, :host)'
|
|
401
402
|
*/
|
|
402
403
|
cssVarRoot?: string
|
|
403
404
|
/**
|
package/dist/parser.d.ts
CHANGED
|
@@ -3,8 +3,21 @@ import type { BoxNodeArray, BoxNodeLiteral, BoxNodeMap, Unboxed } from '@bambooc
|
|
|
3
3
|
export interface ResultItem {
|
|
4
4
|
name?: string
|
|
5
5
|
data: Array<Unboxed['raw']>
|
|
6
|
-
|
|
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
|
|
14
|
+
/**
|
|
15
|
+
* For a `cva-call`, the module the recipe was declared in when that is not this one.
|
|
16
|
+
*
|
|
17
|
+
* Absent for a recipe the file declares itself, which is the case the name alone already
|
|
18
|
+
* identifies.
|
|
19
|
+
*/
|
|
20
|
+
origin?: { filePath: string; name: string }
|
|
8
21
|
}
|
|
9
22
|
|
|
10
23
|
export interface ParserResultInterface {
|
|
@@ -25,7 +38,7 @@ export interface ParserResultInterface {
|
|
|
25
38
|
setCss: (result: ResultItem) => void
|
|
26
39
|
setCva: (result: ResultItem) => void
|
|
27
40
|
setSva: (result: ResultItem) => void
|
|
28
|
-
setToken: (result: ResultItem) => void
|
|
41
|
+
setToken: (result: ResultItem, kind?: 'token' | 'tokenVar') => void
|
|
29
42
|
setViewTransition: (result: ResultItem) => void
|
|
30
43
|
setPattern: (name: string, result: ResultItem) => void
|
|
31
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.
|
|
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.
|
|
35
|
+
"@bamboocss/extractor": "1.28.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"dev": "tsx scripts/watch.ts",
|