@pandacss/types 0.17.2 → 0.17.4
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/analyze-report.d.ts +179 -0
- package/dist/composition.d.ts +106 -0
- package/dist/conditions.d.ts +47 -0
- package/dist/config.d.ts +355 -0
- package/dist/csstype.d.ts +20748 -0
- package/dist/hooks.d.ts +44 -0
- package/dist/index.d.ts +16 -0
- package/dist/parser.d.ts +36 -0
- package/dist/parts.d.ts +7 -0
- package/dist/pattern.d.ts +62 -0
- package/dist/prop-type.d.ts +14 -0
- package/dist/recipe.d.ts +147 -0
- package/dist/runtime.d.ts +41 -0
- package/dist/selectors.d.ts +58 -0
- package/dist/shared.d.ts +25 -0
- package/dist/static-css.d.ts +38 -0
- package/dist/style-props.d.ts +20 -0
- package/dist/system-types.d.ts +90 -0
- package/dist/theme.d.ts +56 -0
- package/dist/tokens.d.ts +101 -0
- package/dist/utility.d.ts +64 -0
- package/package.json +4 -6
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { BoxNodeEmptyInitializer, BoxNodeLiteral, BoxNodeMap } from '@pandacss/extractor'
|
|
2
|
+
import type { Config } from './config'
|
|
3
|
+
|
|
4
|
+
export type ReportItemType = 'object' | 'cva' | 'pattern' | 'recipe' | 'jsx' | 'jsx-factory'
|
|
5
|
+
export interface ReportItem {
|
|
6
|
+
id: number
|
|
7
|
+
from: string
|
|
8
|
+
type: ReportItemType
|
|
9
|
+
filepath: string
|
|
10
|
+
kind: 'function' | 'component'
|
|
11
|
+
path: string[]
|
|
12
|
+
propName: string
|
|
13
|
+
conditionName?: string | undefined
|
|
14
|
+
value: string | number | true
|
|
15
|
+
category: string
|
|
16
|
+
isKnown: boolean
|
|
17
|
+
box: BoxNodeLiteral | BoxNodeEmptyInitializer
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An instance is either a component usage or a function usage
|
|
22
|
+
* @example an instance name could be 'Button', 'css', 'panda.div', 'vstack', ...
|
|
23
|
+
*/
|
|
24
|
+
export interface ReportInstanceItem extends Pick<ReportItem, 'from' | 'type' | 'kind' | 'filepath'> {
|
|
25
|
+
instanceId: number
|
|
26
|
+
contains: Array<ReportItem['id']>
|
|
27
|
+
value: Record<string, any>
|
|
28
|
+
box: BoxNodeMap
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ReportMaps {
|
|
32
|
+
byInstanceOfKind: Map<'function' | 'component', Set<ReportInstanceItem['instanceId']>>
|
|
33
|
+
byPropertyName: Map<string, Set<ReportItem['id']>>
|
|
34
|
+
byCategory: Map<string, Set<ReportItem['id']>>
|
|
35
|
+
byConditionName: Map<string, Set<ReportItem['id']>>
|
|
36
|
+
byShorthand: Map<string, Set<ReportItem['id']>>
|
|
37
|
+
byTokenName: Map<string, Set<ReportItem['id']>>
|
|
38
|
+
byPropertyPath: Map<string, Set<ReportItem['id']>>
|
|
39
|
+
fromKind: Map<'function' | 'component', Set<ReportItem['id']>>
|
|
40
|
+
byType: Map<string, Set<ReportItem['id']>>
|
|
41
|
+
byInstanceName: Map<string, Set<ReportItem['id']>>
|
|
42
|
+
colorsUsed: Map<string, Set<ReportItem['id']>>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ReportCounts {
|
|
46
|
+
filesWithTokens: number
|
|
47
|
+
propNameUsed: number
|
|
48
|
+
tokenUsed: number
|
|
49
|
+
shorthandUsed: number
|
|
50
|
+
propertyPathUsed: number
|
|
51
|
+
typeUsed: number
|
|
52
|
+
instanceNameUsed: number
|
|
53
|
+
kindUsed: number
|
|
54
|
+
instanceOfKindUsed: number
|
|
55
|
+
colorsUsed: number
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface MostUsedItem {
|
|
59
|
+
key: string
|
|
60
|
+
count: number
|
|
61
|
+
}
|
|
62
|
+
export interface ReportStats {
|
|
63
|
+
filesWithMostInstance: Record<string, number>
|
|
64
|
+
filesWithMostPropValueCombinations: Record<string, number>
|
|
65
|
+
mostUseds: {
|
|
66
|
+
propNames: Array<MostUsedItem>
|
|
67
|
+
tokens: Array<MostUsedItem>
|
|
68
|
+
shorthands: Array<MostUsedItem>
|
|
69
|
+
categories: Array<MostUsedItem>
|
|
70
|
+
conditions: Array<MostUsedItem>
|
|
71
|
+
propertyPaths: Array<MostUsedItem>
|
|
72
|
+
types: Array<MostUsedItem>
|
|
73
|
+
instanceNames: Array<MostUsedItem>
|
|
74
|
+
fromKinds: Array<MostUsedItem>
|
|
75
|
+
instanceOfKinds: Array<MostUsedItem>
|
|
76
|
+
colors: Array<MostUsedItem>
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ReportDetails {
|
|
81
|
+
counts: ReportCounts
|
|
82
|
+
stats: ReportStats
|
|
83
|
+
details: {
|
|
84
|
+
byId: Map<ReportItem['id'], ReportItem>
|
|
85
|
+
byInstanceId: Map<ReportInstanceItem['instanceId'], ReportInstanceItem>
|
|
86
|
+
byFilepath: Map<string, Set<ReportItem['id']>>
|
|
87
|
+
byInstanceInFilepath: Map<string, Set<ReportInstanceItem['instanceId']>>
|
|
88
|
+
globalMaps: ReportMaps
|
|
89
|
+
byFilePathMaps: Map<string, ReportMaps>
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface FileSizes {
|
|
94
|
+
normal: string
|
|
95
|
+
minified: string
|
|
96
|
+
gzip: {
|
|
97
|
+
normal: string
|
|
98
|
+
minified: string
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface AnalysisReport extends ReportDetails {
|
|
103
|
+
fileSizes: FileSizes
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface ReportMapsJSON {
|
|
107
|
+
byInstanceOfKind: Record<'function' | 'component', Array<ReportInstanceItem['instanceId']>>
|
|
108
|
+
byPropertyName: Record<string, Array<ReportItem['id']>>
|
|
109
|
+
byCategory: Record<string, Array<ReportItem['id']>>
|
|
110
|
+
byConditionName: Record<string, Array<ReportItem['id']>>
|
|
111
|
+
byShorthand: Record<string, Array<ReportItem['id']>>
|
|
112
|
+
byTokenName: Record<string, Array<ReportItem['id']>>
|
|
113
|
+
byPropertyPath: Record<string, Array<ReportItem['id']>>
|
|
114
|
+
fromKind: Record<'function' | 'component', Array<ReportItem['id']>>
|
|
115
|
+
byType: Record<string, Array<ReportItem['id']>>
|
|
116
|
+
byInstanceName: Record<string, Array<ReportItem['id']>>
|
|
117
|
+
colorsUsed: Record<string, Array<ReportItem['id']>>
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface ReportItemJSON {
|
|
121
|
+
id: number
|
|
122
|
+
from: string
|
|
123
|
+
type: ReportItemType
|
|
124
|
+
filepath: string
|
|
125
|
+
kind: 'function' | 'component'
|
|
126
|
+
path: string[]
|
|
127
|
+
propName: string
|
|
128
|
+
conditionName?: string | undefined
|
|
129
|
+
value: string | number | true
|
|
130
|
+
category: string
|
|
131
|
+
isKnown: boolean
|
|
132
|
+
box: {
|
|
133
|
+
type: 'literal' | 'empty-initializer'
|
|
134
|
+
value: string | number | boolean | undefined | null
|
|
135
|
+
node: string
|
|
136
|
+
stack: string[]
|
|
137
|
+
line: number
|
|
138
|
+
column: number
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface ReportInstanceItemJSON extends Pick<ReportItem, 'from' | 'type' | 'kind' | 'filepath'> {
|
|
143
|
+
instanceId: number
|
|
144
|
+
contains: Array<ReportItem['id']>
|
|
145
|
+
value: Record<string, any>
|
|
146
|
+
box: { type: 'map'; value: Record<string, any>; node: string; stack: string[]; line: number; column: number }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface AnalysisReportJSON {
|
|
150
|
+
counts: ReportCounts
|
|
151
|
+
stats: ReportStats
|
|
152
|
+
details: {
|
|
153
|
+
byId: Record<ReportItemJSON['id'], ReportItemJSON>
|
|
154
|
+
byInstanceId: Record<ReportInstanceItemJSON['instanceId'], ReportInstanceItemJSON>
|
|
155
|
+
byFilepath: Record<string, Array<ReportItemJSON['id']>>
|
|
156
|
+
byInstanceInFilepath: Record<string, Array<ReportInstanceItemJSON['instanceId']>>
|
|
157
|
+
globalMaps: ReportMapsJSON
|
|
158
|
+
byFilePathMaps: Record<string, ReportMapsJSON>
|
|
159
|
+
}
|
|
160
|
+
fileSizes: FileSizes
|
|
161
|
+
cwd: Config['cwd']
|
|
162
|
+
theme: Config['theme']
|
|
163
|
+
utilities: Config['utilities']
|
|
164
|
+
conditions: Config['conditions']
|
|
165
|
+
shorthands: Record<string, string>
|
|
166
|
+
// Generator["parserOptions""]
|
|
167
|
+
parserOptions: {
|
|
168
|
+
importMap: {
|
|
169
|
+
css: string
|
|
170
|
+
recipe: string
|
|
171
|
+
pattern: string
|
|
172
|
+
jsx: string
|
|
173
|
+
}
|
|
174
|
+
jsx: {
|
|
175
|
+
factory: string
|
|
176
|
+
nodes: Array<{ type: 'string'; name: string; props: string[]; baseName: string }>
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { CompositionStyleObject } from './system-types'
|
|
2
|
+
import type { Token } from './tokens'
|
|
3
|
+
|
|
4
|
+
interface Recursive<T> {
|
|
5
|
+
[key: string]: Recursive<T> | T
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* -----------------------------------------------------------------------------
|
|
9
|
+
* Text styles
|
|
10
|
+
* -----------------------------------------------------------------------------*/
|
|
11
|
+
|
|
12
|
+
type TextStyleProperty =
|
|
13
|
+
| 'fontSize'
|
|
14
|
+
| 'fontSizeAdjust'
|
|
15
|
+
| 'fontVariationSettings'
|
|
16
|
+
| 'fontVariantPosition'
|
|
17
|
+
| 'fontVariantCaps'
|
|
18
|
+
| 'fontVariantNumeric'
|
|
19
|
+
| 'fontVariantAlternates'
|
|
20
|
+
| 'fontVariantLigatures'
|
|
21
|
+
| 'fontFamily'
|
|
22
|
+
| 'fontWeight'
|
|
23
|
+
| 'fontSynthesis'
|
|
24
|
+
| 'fontStyle'
|
|
25
|
+
| 'fontVariant'
|
|
26
|
+
| 'lineHeight'
|
|
27
|
+
| 'letterSpacing'
|
|
28
|
+
| 'textDecoration'
|
|
29
|
+
| 'textTransform'
|
|
30
|
+
| 'textIndent'
|
|
31
|
+
| 'textDecorationColor'
|
|
32
|
+
| 'textDecorationLine'
|
|
33
|
+
| 'textDecorationStyle'
|
|
34
|
+
| 'textEmphasisColor'
|
|
35
|
+
| 'textEmphasisPosition'
|
|
36
|
+
| 'textEmphasisStyle'
|
|
37
|
+
| 'hyphenateCharacter'
|
|
38
|
+
| 'textOrientation'
|
|
39
|
+
| 'textOverflow'
|
|
40
|
+
| 'textRendering'
|
|
41
|
+
|
|
42
|
+
export type TextStyle = CompositionStyleObject<TextStyleProperty>
|
|
43
|
+
|
|
44
|
+
export type TextStyles = Recursive<Token<TextStyle>>
|
|
45
|
+
|
|
46
|
+
/* -----------------------------------------------------------------------------
|
|
47
|
+
* Layer styles
|
|
48
|
+
* -----------------------------------------------------------------------------*/
|
|
49
|
+
|
|
50
|
+
type Placement =
|
|
51
|
+
| 'Top'
|
|
52
|
+
| 'Right'
|
|
53
|
+
| 'Bottom'
|
|
54
|
+
| 'Left'
|
|
55
|
+
| 'Inline'
|
|
56
|
+
| 'Block'
|
|
57
|
+
| 'InlineStart'
|
|
58
|
+
| 'InlineEnd'
|
|
59
|
+
| 'BlockStart'
|
|
60
|
+
| 'BlockEnd'
|
|
61
|
+
|
|
62
|
+
type Radius =
|
|
63
|
+
| `Top${'Right' | 'Left'}`
|
|
64
|
+
| `Bottom${'Right' | 'Left'}`
|
|
65
|
+
| `Start${'Start' | 'End'}`
|
|
66
|
+
| `End${'Start' | 'End'}`
|
|
67
|
+
|
|
68
|
+
type LayerStyleProperty =
|
|
69
|
+
| 'background'
|
|
70
|
+
| 'backgroundColor'
|
|
71
|
+
| 'backgroundImage'
|
|
72
|
+
| 'borderRadius'
|
|
73
|
+
| 'border'
|
|
74
|
+
| 'borderWidth'
|
|
75
|
+
| 'borderColor'
|
|
76
|
+
| 'borderStyle'
|
|
77
|
+
| 'boxShadow'
|
|
78
|
+
| 'filter'
|
|
79
|
+
| 'backdropFilter'
|
|
80
|
+
| 'transform'
|
|
81
|
+
| 'color'
|
|
82
|
+
| 'opacity'
|
|
83
|
+
| 'backgroundBlendMode'
|
|
84
|
+
| 'backgroundAttachment'
|
|
85
|
+
| 'backgroundClip'
|
|
86
|
+
| 'backgroundOrigin'
|
|
87
|
+
| 'backgroundPosition'
|
|
88
|
+
| 'backgroundRepeat'
|
|
89
|
+
| 'backgroundSize'
|
|
90
|
+
| `border${Placement}`
|
|
91
|
+
| `border${Placement}Width`
|
|
92
|
+
| 'borderRadius'
|
|
93
|
+
| `border${Radius}Radius`
|
|
94
|
+
| `border${Placement}Color`
|
|
95
|
+
| `border${Placement}Style`
|
|
96
|
+
| 'padding'
|
|
97
|
+
| `padding${Placement}`
|
|
98
|
+
|
|
99
|
+
export type LayerStyle = CompositionStyleObject<LayerStyleProperty>
|
|
100
|
+
|
|
101
|
+
export type LayerStyles = Recursive<Token<LayerStyle>>
|
|
102
|
+
|
|
103
|
+
export interface CompositionStyles {
|
|
104
|
+
textStyles: TextStyles
|
|
105
|
+
layerStyles: LayerStyles
|
|
106
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AnySelector, Selectors } from './selectors'
|
|
2
|
+
|
|
3
|
+
export type ConditionType = 'at-rule' | 'parent-nesting' | 'self-nesting' | 'combinator-nesting'
|
|
4
|
+
|
|
5
|
+
export interface ConditionDetails {
|
|
6
|
+
type: ConditionType
|
|
7
|
+
value: string
|
|
8
|
+
name?: string
|
|
9
|
+
rawValue?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RawCondition extends ConditionDetails {
|
|
13
|
+
raw: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* -----------------------------------------------------------------------------
|
|
17
|
+
* Shadowed export (in CLI): DO NOT REMOVE
|
|
18
|
+
* -----------------------------------------------------------------------------*/
|
|
19
|
+
|
|
20
|
+
export interface Conditions {
|
|
21
|
+
[condition: string]: string
|
|
22
|
+
}
|
|
23
|
+
export interface ExtendableConditions {
|
|
24
|
+
[condition: string]: string | Conditions | undefined
|
|
25
|
+
extend?: Conditions | undefined
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type Condition = string
|
|
29
|
+
|
|
30
|
+
export type Conditional<V> =
|
|
31
|
+
| V
|
|
32
|
+
| Array<V | null>
|
|
33
|
+
| {
|
|
34
|
+
[K in keyof Conditions]?: Conditional<V>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type ConditionalValue<T> = Conditional<T>
|
|
38
|
+
|
|
39
|
+
export type Nested<P> =
|
|
40
|
+
| (P & {
|
|
41
|
+
[K in Selectors]?: Nested<P>
|
|
42
|
+
} & {
|
|
43
|
+
[K in AnySelector]?: Nested<P>
|
|
44
|
+
})
|
|
45
|
+
| {
|
|
46
|
+
[K in Condition]?: Nested<P>
|
|
47
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import type { TSConfig } from 'pkg-types'
|
|
2
|
+
import type { Conditions, ExtendableConditions } from './conditions'
|
|
3
|
+
import type { PandaHooks } from './hooks'
|
|
4
|
+
import type { PatternConfig } from './pattern'
|
|
5
|
+
import type { RequiredBy } from './shared'
|
|
6
|
+
import type { StaticCssOptions } from './static-css'
|
|
7
|
+
import type { ExtendableGlobalStyleObject, GlobalStyleObject } from './system-types'
|
|
8
|
+
import type { ExtendableTheme, Theme } from './theme'
|
|
9
|
+
import type { ExtendableUtilityConfig, UtilityConfig } from './utility'
|
|
10
|
+
|
|
11
|
+
export type { TSConfig }
|
|
12
|
+
|
|
13
|
+
export type CascadeLayer = 'reset' | 'base' | 'tokens' | 'recipes' | 'utilities'
|
|
14
|
+
|
|
15
|
+
export type CascadeLayers = Record<CascadeLayer, string>
|
|
16
|
+
|
|
17
|
+
interface StudioOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Used to customize the design system studio
|
|
20
|
+
* @default { title: 'Panda', logo: '🐼' }
|
|
21
|
+
*/
|
|
22
|
+
studio?: {
|
|
23
|
+
/**
|
|
24
|
+
* The output directory for the design system studio when the build command is run.
|
|
25
|
+
*/
|
|
26
|
+
outdir?: string
|
|
27
|
+
/**
|
|
28
|
+
* The logo url for the design system studio.
|
|
29
|
+
*/
|
|
30
|
+
logo?: string
|
|
31
|
+
/**
|
|
32
|
+
* Used to inject custom html into the head or body of the studio
|
|
33
|
+
*/
|
|
34
|
+
inject?: {
|
|
35
|
+
head?: string
|
|
36
|
+
body?: string
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface Patterns {
|
|
42
|
+
[pattern: string]: PatternConfig
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PresetCore {
|
|
46
|
+
/**
|
|
47
|
+
* The css selectors or media queries shortcuts.
|
|
48
|
+
* @example `{ hover: "&:hover" }`
|
|
49
|
+
*/
|
|
50
|
+
conditions: Conditions
|
|
51
|
+
/**
|
|
52
|
+
* The global styles for your project.
|
|
53
|
+
*/
|
|
54
|
+
globalCss: GlobalStyleObject
|
|
55
|
+
/**
|
|
56
|
+
* The theme configuration for your project.
|
|
57
|
+
*/
|
|
58
|
+
theme: Theme
|
|
59
|
+
/**
|
|
60
|
+
* The css utility definitions.
|
|
61
|
+
*/
|
|
62
|
+
utilities: UtilityConfig
|
|
63
|
+
/**
|
|
64
|
+
* Common styling or layout patterns for your project.
|
|
65
|
+
*/
|
|
66
|
+
patterns: Record<string, PatternConfig>
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ExtendablePatterns {
|
|
70
|
+
[pattern: string]: PatternConfig | Patterns | undefined
|
|
71
|
+
extend?: Patterns | undefined
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ExtendableOptions {
|
|
75
|
+
/**
|
|
76
|
+
* The css selectors or media queries shortcuts.
|
|
77
|
+
* @example `{ hover: "&:hover" }`
|
|
78
|
+
*/
|
|
79
|
+
conditions?: ExtendableConditions
|
|
80
|
+
/**
|
|
81
|
+
* The global styles for your project.
|
|
82
|
+
*/
|
|
83
|
+
globalCss?: ExtendableGlobalStyleObject
|
|
84
|
+
/**
|
|
85
|
+
* The theme configuration for your project.
|
|
86
|
+
*/
|
|
87
|
+
theme?: ExtendableTheme
|
|
88
|
+
/**
|
|
89
|
+
* The css utility definitions.
|
|
90
|
+
*/
|
|
91
|
+
utilities?: ExtendableUtilityConfig
|
|
92
|
+
/**
|
|
93
|
+
* Common styling or layout patterns for your project.
|
|
94
|
+
*/
|
|
95
|
+
patterns?: ExtendablePatterns
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface OutdirImportMap {
|
|
99
|
+
css: string
|
|
100
|
+
recipes: string
|
|
101
|
+
patterns: string
|
|
102
|
+
jsx?: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface FileSystemOptions {
|
|
106
|
+
/**
|
|
107
|
+
* Whether to clean the output directory before generating the css.
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
clean?: boolean
|
|
111
|
+
/**
|
|
112
|
+
* The output directory.
|
|
113
|
+
* @default 'styled-system'
|
|
114
|
+
*/
|
|
115
|
+
outdir?: string
|
|
116
|
+
/**
|
|
117
|
+
* Allows you to customize the import paths for the generated outdir.
|
|
118
|
+
* @default
|
|
119
|
+
* ```js
|
|
120
|
+
* {
|
|
121
|
+
* css: 'styled-system/css',
|
|
122
|
+
* recipes: 'styled-system/recipes',
|
|
123
|
+
* patterns: 'styled-system/patterns',
|
|
124
|
+
* jsx: 'styled-system/jsx',
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
importMap?: OutdirImportMap
|
|
129
|
+
/**
|
|
130
|
+
* List of files glob to watch for changes.
|
|
131
|
+
* @default []
|
|
132
|
+
*/
|
|
133
|
+
include?: string[]
|
|
134
|
+
/**
|
|
135
|
+
* List of files glob to ignore.
|
|
136
|
+
* @default []
|
|
137
|
+
*/
|
|
138
|
+
exclude?: string[]
|
|
139
|
+
/**
|
|
140
|
+
* Whether to watch for changes and regenerate the css.
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
watch?: boolean
|
|
144
|
+
/**
|
|
145
|
+
* Whether to use polling instead of filesystem events when watching.
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
148
|
+
poll?: boolean
|
|
149
|
+
/**
|
|
150
|
+
* The current working directory.
|
|
151
|
+
* @default 'process.cwd()'
|
|
152
|
+
*/
|
|
153
|
+
cwd?: string
|
|
154
|
+
/**
|
|
155
|
+
* The log level for the built-in logger.
|
|
156
|
+
* @default 'info'
|
|
157
|
+
*/
|
|
158
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent'
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
type JsxFramework = 'react' | 'solid' | 'preact' | 'vue' | 'qwik'
|
|
162
|
+
|
|
163
|
+
interface JsxOptions {
|
|
164
|
+
/**
|
|
165
|
+
* The framework to use for generating supercharged elements.
|
|
166
|
+
*/
|
|
167
|
+
jsxFramework?: JsxFramework
|
|
168
|
+
/**
|
|
169
|
+
* The factory name of the element
|
|
170
|
+
* @default 'styled'
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```jsx
|
|
174
|
+
* <styled.button marginTop="40px">Click me</styled.button>
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
jsxFactory?: string
|
|
178
|
+
/**
|
|
179
|
+
* The style props allowed on generated JSX components
|
|
180
|
+
* - When set to 'all', all style props are allowed.
|
|
181
|
+
* - When set to 'minimal', only the `css` prop is allowed.
|
|
182
|
+
* - When set to 'none', no style props are allowed and therefore the jsxFactory will not be importable.
|
|
183
|
+
*
|
|
184
|
+
* @default 'all'
|
|
185
|
+
*
|
|
186
|
+
* @example with 'all':
|
|
187
|
+
* ```jsx
|
|
188
|
+
* <styled.button marginTop="40px">Click me</styled.button>
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @example with 'minimal':
|
|
192
|
+
* ```jsx
|
|
193
|
+
* <styled.button css={{ marginTop: "40px" }}>Click me</styled.button>
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @example with 'none':
|
|
197
|
+
* ```jsx
|
|
198
|
+
* <button className={css({ marginTop: "40px" })}>Click me</button>
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
jsxStyleProps?: 'all' | 'minimal' | 'none'
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
interface CssgenOptions {
|
|
205
|
+
/**
|
|
206
|
+
* Whether to include css reset styles in the generated css.
|
|
207
|
+
* @default true
|
|
208
|
+
*/
|
|
209
|
+
preflight?: boolean | { scope: string }
|
|
210
|
+
/**
|
|
211
|
+
* The namespace prefix for the generated css classes and css variables.
|
|
212
|
+
* @default ''
|
|
213
|
+
*/
|
|
214
|
+
prefix?: string | { cssVar?: string; className?: string }
|
|
215
|
+
/**
|
|
216
|
+
* The value separator used in the generated class names.
|
|
217
|
+
* @default '_'
|
|
218
|
+
*/
|
|
219
|
+
separator?: '_' | '=' | '-'
|
|
220
|
+
/**
|
|
221
|
+
* Whether to optimize the generated css.
|
|
222
|
+
* @default true
|
|
223
|
+
*/
|
|
224
|
+
optimize?: boolean
|
|
225
|
+
/**
|
|
226
|
+
* Whether to minify the generated css.
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
minify?: boolean
|
|
230
|
+
/**
|
|
231
|
+
* The root selector for the css variables.
|
|
232
|
+
* @default ':where(:host, :root)'
|
|
233
|
+
*/
|
|
234
|
+
cssVarRoot?: string
|
|
235
|
+
/**
|
|
236
|
+
* @experimental
|
|
237
|
+
* Used to generate css utility classes for your project.
|
|
238
|
+
*/
|
|
239
|
+
staticCss?: StaticCssOptions
|
|
240
|
+
/**
|
|
241
|
+
* The css syntax kind to use
|
|
242
|
+
* @default 'object-literal'
|
|
243
|
+
*/
|
|
244
|
+
syntax?: 'template-literal' | 'object-literal'
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
interface CodegenOptions {
|
|
248
|
+
/**
|
|
249
|
+
* Whether to emit the artifacts to `node_modules` as a package.
|
|
250
|
+
* @default false
|
|
251
|
+
*/
|
|
252
|
+
emitPackage?: boolean
|
|
253
|
+
/**
|
|
254
|
+
* Whether to only emit the `tokens` directory
|
|
255
|
+
* @default false
|
|
256
|
+
*/
|
|
257
|
+
emitTokensOnly?: boolean
|
|
258
|
+
/**
|
|
259
|
+
* Whether to hash the generated class names / css variables.
|
|
260
|
+
* This is useful if want to shorten the class names or css variables.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
hash?: boolean | { cssVar: boolean; className: boolean }
|
|
264
|
+
/**
|
|
265
|
+
* Options for the generated typescript definitions.
|
|
266
|
+
*/
|
|
267
|
+
strictTokens?: boolean
|
|
268
|
+
/**
|
|
269
|
+
* Whether to update the .gitignore file.
|
|
270
|
+
* @default 'true'
|
|
271
|
+
*/
|
|
272
|
+
gitignore?: boolean
|
|
273
|
+
/**
|
|
274
|
+
* Whether to allow shorthand properties
|
|
275
|
+
* @default 'true'
|
|
276
|
+
*/
|
|
277
|
+
shorthands?: boolean
|
|
278
|
+
/**
|
|
279
|
+
* Layer mappings used in the generated css.
|
|
280
|
+
* @default 'true'
|
|
281
|
+
*/
|
|
282
|
+
layers?: Partial<CascadeLayers>
|
|
283
|
+
/**
|
|
284
|
+
* File extension for generated javascript files.
|
|
285
|
+
* @default 'mjs'
|
|
286
|
+
*/
|
|
287
|
+
outExtension?: 'mjs' | 'js'
|
|
288
|
+
/**
|
|
289
|
+
* Whether to force consistent type extensions for generated typescript .d.ts files.
|
|
290
|
+
* If set to `true` and `outExtension` is set to `mjs`, the generated typescript .d.ts files will have the extension `.d.mts`.
|
|
291
|
+
* @default false
|
|
292
|
+
*/
|
|
293
|
+
forceConsistentTypeExtension?: boolean
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
interface PresetOptions {
|
|
297
|
+
/**
|
|
298
|
+
* Used to create reusable config presets for your project or team.
|
|
299
|
+
*/
|
|
300
|
+
presets?: (string | Preset | Promise<Preset>)[]
|
|
301
|
+
/**
|
|
302
|
+
* Whether to opt-out of the defaults config presets: [`@pandacss/preset-base`, `@pandacss/preset-panda`]
|
|
303
|
+
* @default 'false'
|
|
304
|
+
*/
|
|
305
|
+
eject?: boolean
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
interface HooksOptions {
|
|
309
|
+
hooks?: Partial<PandaHooks>
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface Config
|
|
313
|
+
extends StudioOptions,
|
|
314
|
+
ExtendableOptions,
|
|
315
|
+
CssgenOptions,
|
|
316
|
+
CodegenOptions,
|
|
317
|
+
FileSystemOptions,
|
|
318
|
+
JsxOptions,
|
|
319
|
+
PresetOptions,
|
|
320
|
+
HooksOptions {}
|
|
321
|
+
|
|
322
|
+
export interface Preset extends ExtendableOptions, PresetOptions {}
|
|
323
|
+
|
|
324
|
+
export interface UserConfig
|
|
325
|
+
extends Partial<PresetCore>,
|
|
326
|
+
RequiredBy<Omit<Config, keyof PresetCore>, 'outdir' | 'cwd' | 'include'> {}
|
|
327
|
+
|
|
328
|
+
export interface PathMapping {
|
|
329
|
+
pattern: RegExp
|
|
330
|
+
paths: string[]
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface ConfigTsOptions {
|
|
334
|
+
baseUrl?: string | undefined
|
|
335
|
+
pathMappings: PathMapping[]
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface LoadConfigResult {
|
|
339
|
+
path: string
|
|
340
|
+
config: UserConfig
|
|
341
|
+
tsconfig?: TSConfig
|
|
342
|
+
tsOptions?: ConfigTsOptions
|
|
343
|
+
tsconfigFile?: string
|
|
344
|
+
dependencies: string[]
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface HashOptions {
|
|
348
|
+
tokens: boolean | undefined
|
|
349
|
+
className: boolean | undefined
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export interface PrefixOptions {
|
|
353
|
+
tokens: string | undefined
|
|
354
|
+
className: string | undefined
|
|
355
|
+
}
|