@pandacss/types 0.18.3 → 0.20.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/artifact.d.ts +49 -0
- package/dist/config.d.ts +28 -7
- package/dist/index.d.ts +1 -0
- package/dist/recipe.d.ts +2 -2
- package/dist/shared.d.ts +23 -11
- package/dist/system-types.d.ts +5 -3
- package/package.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Nullable } from './shared'
|
|
2
|
+
|
|
3
|
+
export interface ArtifactContent {
|
|
4
|
+
file: string
|
|
5
|
+
code: string | undefined
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ArtifactId =
|
|
9
|
+
| 'helpers'
|
|
10
|
+
| 'keyframes'
|
|
11
|
+
| 'design-tokens'
|
|
12
|
+
| 'types'
|
|
13
|
+
| 'css-fn'
|
|
14
|
+
| 'cva'
|
|
15
|
+
| 'sva'
|
|
16
|
+
| 'cx'
|
|
17
|
+
| 'create-recipe'
|
|
18
|
+
| 'recipes'
|
|
19
|
+
| 'recipes-index'
|
|
20
|
+
| 'patterns'
|
|
21
|
+
| 'patterns-index'
|
|
22
|
+
| 'jsx-is-valid-prop'
|
|
23
|
+
| 'jsx-helpers'
|
|
24
|
+
| 'jsx-factory'
|
|
25
|
+
| 'jsx-patterns'
|
|
26
|
+
| 'jsx-patterns-index'
|
|
27
|
+
| 'css-index'
|
|
28
|
+
| 'reset.css'
|
|
29
|
+
| 'global.css'
|
|
30
|
+
| 'static.css'
|
|
31
|
+
| 'package.json'
|
|
32
|
+
| 'styles.css'
|
|
33
|
+
| (string & {})
|
|
34
|
+
|
|
35
|
+
export type Artifact = Nullable<{
|
|
36
|
+
id: ArtifactId
|
|
37
|
+
dir?: string[]
|
|
38
|
+
files: ArtifactContent[]
|
|
39
|
+
}>
|
|
40
|
+
|
|
41
|
+
export interface AffectedArtifacts {
|
|
42
|
+
recipes: string[]
|
|
43
|
+
patterns: string[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ArtifactFilters {
|
|
47
|
+
ids?: ArtifactId[]
|
|
48
|
+
affecteds?: AffectedArtifacts
|
|
49
|
+
}
|
package/dist/config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TSConfig } from 'pkg-types'
|
|
|
2
2
|
import type { Conditions, ExtendableConditions } from './conditions'
|
|
3
3
|
import type { PandaHooks } from './hooks'
|
|
4
4
|
import type { PatternConfig } from './pattern'
|
|
5
|
-
import type { RequiredBy } from './shared'
|
|
5
|
+
import type { Keys, PathIn, RequiredBy } from './shared'
|
|
6
6
|
import type { StaticCssOptions } from './static-css'
|
|
7
7
|
import type { ExtendableGlobalStyleObject, GlobalStyleObject } from './system-types'
|
|
8
8
|
import type { ExtendableTheme, Theme } from './theme'
|
|
@@ -14,7 +14,7 @@ export type CascadeLayer = 'reset' | 'base' | 'tokens' | 'recipes' | 'utilities'
|
|
|
14
14
|
|
|
15
15
|
export type CascadeLayers = Record<CascadeLayer, string>
|
|
16
16
|
|
|
17
|
-
interface StudioOptions {
|
|
17
|
+
export interface StudioOptions {
|
|
18
18
|
/**
|
|
19
19
|
* Used to customize the design system studio
|
|
20
20
|
* @default { title: 'Panda', logo: '🐼' }
|
|
@@ -52,6 +52,10 @@ interface PresetCore {
|
|
|
52
52
|
* The global styles for your project.
|
|
53
53
|
*/
|
|
54
54
|
globalCss: GlobalStyleObject
|
|
55
|
+
/**
|
|
56
|
+
* Used to generate css utility classes for your project.
|
|
57
|
+
*/
|
|
58
|
+
staticCss: StaticCssOptions
|
|
55
59
|
/**
|
|
56
60
|
* The theme configuration for your project.
|
|
57
61
|
*/
|
|
@@ -71,6 +75,10 @@ interface ExtendablePatterns {
|
|
|
71
75
|
extend?: Patterns | undefined
|
|
72
76
|
}
|
|
73
77
|
|
|
78
|
+
interface ExtendableStaticCssOptions extends StaticCssOptions {
|
|
79
|
+
extend?: StaticCssOptions | undefined
|
|
80
|
+
}
|
|
81
|
+
|
|
74
82
|
export interface ExtendableOptions {
|
|
75
83
|
/**
|
|
76
84
|
* The css selectors or media queries shortcuts.
|
|
@@ -81,6 +89,10 @@ export interface ExtendableOptions {
|
|
|
81
89
|
* The global styles for your project.
|
|
82
90
|
*/
|
|
83
91
|
globalCss?: ExtendableGlobalStyleObject
|
|
92
|
+
/**
|
|
93
|
+
* Used to generate css utility classes for your project.
|
|
94
|
+
*/
|
|
95
|
+
staticCss?: ExtendableStaticCssOptions
|
|
84
96
|
/**
|
|
85
97
|
* The theme configuration for your project.
|
|
86
98
|
*/
|
|
@@ -232,11 +244,6 @@ interface CssgenOptions {
|
|
|
232
244
|
* @default ':where(:host, :root)'
|
|
233
245
|
*/
|
|
234
246
|
cssVarRoot?: string
|
|
235
|
-
/**
|
|
236
|
-
* @experimental
|
|
237
|
-
* Used to generate css utility classes for your project.
|
|
238
|
-
*/
|
|
239
|
-
staticCss?: StaticCssOptions
|
|
240
247
|
/**
|
|
241
248
|
* The css syntax kind to use
|
|
242
249
|
* @default 'object-literal'
|
|
@@ -336,8 +343,11 @@ export interface ConfigTsOptions {
|
|
|
336
343
|
}
|
|
337
344
|
|
|
338
345
|
export interface LoadConfigResult {
|
|
346
|
+
/** Config path */
|
|
339
347
|
path: string
|
|
340
348
|
config: UserConfig
|
|
349
|
+
serialized: string
|
|
350
|
+
deserialize: () => Config
|
|
341
351
|
tsconfig?: TSConfig
|
|
342
352
|
tsOptions?: ConfigTsOptions
|
|
343
353
|
tsconfigFile?: string
|
|
@@ -353,3 +363,14 @@ export interface PrefixOptions {
|
|
|
353
363
|
tokens: string | undefined
|
|
354
364
|
className: string | undefined
|
|
355
365
|
}
|
|
366
|
+
|
|
367
|
+
type ReqConf = Required<UserConfig>
|
|
368
|
+
|
|
369
|
+
export type ConfigPath = Exclude<
|
|
370
|
+
| Exclude<NonNullable<Keys<ReqConf>>, 'theme'>
|
|
371
|
+
| PathIn<ReqConf, 'theme'>
|
|
372
|
+
| PathIn<ReqConf, 'patterns'>
|
|
373
|
+
| PathIn<ReqConf, 'staticCss'>
|
|
374
|
+
| (string & {}),
|
|
375
|
+
undefined
|
|
376
|
+
>
|
package/dist/index.d.ts
CHANGED
package/dist/recipe.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>
|
|
|
7
7
|
export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T
|
|
8
8
|
? {}
|
|
9
9
|
: {
|
|
10
|
-
[K in keyof T]?: StringToBoolean<keyof T[K]>
|
|
10
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | undefined
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
|
|
@@ -38,7 +38,7 @@ export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVa
|
|
|
38
38
|
type OneOrMore<T> = T | Array<T>
|
|
39
39
|
|
|
40
40
|
export type RecipeCompoundSelection<T> = {
|
|
41
|
-
[K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>>
|
|
41
|
+
[K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export type RecipeCompoundVariant<T> = T & {
|
package/dist/shared.d.ts
CHANGED
|
@@ -12,14 +12,26 @@ export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pi
|
|
|
12
12
|
|
|
13
13
|
export type AnyFunction<T = any> = (...args: T[]) => any
|
|
14
14
|
|
|
15
|
-
type Nullable<T> = T | null | undefined
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
export type Nullable<T> = T | null | undefined
|
|
16
|
+
|
|
17
|
+
export type Keys<T> = keyof NonNullable<T>
|
|
18
|
+
|
|
19
|
+
type Subtract<T extends number, D extends number> = T extends D ? 0 : T extends D | any ? Exclude<T, D> : never
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get all the (nested) paths of an object until a certain depth
|
|
23
|
+
* e.g. Paths<{a: {b: {c: 1}}}, '', 2> => 'a' | 'a.b' | 'a.b.c'
|
|
24
|
+
*/
|
|
25
|
+
type Paths<T, Prefix extends string = '', Depth extends number = 0> = {
|
|
26
|
+
[K in keyof T]: Depth extends 0
|
|
27
|
+
? never
|
|
28
|
+
: T[K] extends object
|
|
29
|
+
? K extends string
|
|
30
|
+
? `${Prefix}${K}` | Paths<T[K], `${Prefix}${K}.`, Depth extends 1 ? 0 : Subtract<Depth, 1>>
|
|
31
|
+
: never
|
|
32
|
+
: K extends string | number
|
|
33
|
+
? `${Prefix}${K}`
|
|
34
|
+
: never
|
|
35
|
+
}[keyof T]
|
|
36
|
+
|
|
37
|
+
export type PathIn<T, Key extends keyof T> = Key extends string ? Paths<T[Key], `${Key}.`, 1> : never
|
package/dist/system-types.d.ts
CHANGED
|
@@ -59,9 +59,11 @@ export interface ExtendableGlobalStyleObject {
|
|
|
59
59
|
extend?: GlobalStyleObject | undefined
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
[K in
|
|
64
|
-
}
|
|
62
|
+
type FilterStyleObject<P extends string> = {
|
|
63
|
+
[K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>
|
|
65
67
|
|
|
66
68
|
/* -----------------------------------------------------------------------------
|
|
67
69
|
* Jsx style props
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "The types for css panda",
|
|
5
5
|
"main": "dist/index.d.ts",
|
|
6
6
|
"author": "Segun Adebayo <joseshegs@gmail.com>",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"hookable": "5.5.3",
|
|
25
25
|
"ncp": "^2.0.0",
|
|
26
26
|
"pkg-types": "1.0.3",
|
|
27
|
-
"@pandacss/extractor": "0.
|
|
27
|
+
"@pandacss/extractor": "0.20.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"dev": "tsx scripts/watch.ts",
|