@pandacss/types 0.0.0-dev-20240313103423 → 0.0.0-dev-20240315003802

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
@@ -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 { Keys, PathIn, RequiredBy } from './shared'
5
+ import type { Keys, LiteralUnion, 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'
@@ -68,6 +68,10 @@ export interface PresetCore {
68
68
  * Common styling or layout patterns for your project.
69
69
  */
70
70
  patterns: Record<string, PatternConfig>
71
+ /**
72
+ * The css variables for your project.
73
+ */
74
+ globalVars: GlobalVarsDefinition
71
75
  }
72
76
 
73
77
  interface ExtendablePatterns {
@@ -79,6 +83,48 @@ interface ExtendableStaticCssOptions extends StaticCssOptions {
79
83
  extend?: StaticCssOptions | undefined
80
84
  }
81
85
 
86
+ export type CssPropertySyntax =
87
+ | '<length>'
88
+ | '<number>'
89
+ | '<percentage>'
90
+ | '<length-percentage>'
91
+ | '<color>'
92
+ | '<image>'
93
+ | '<url>'
94
+ | '<integer>'
95
+ | '<angle>'
96
+ | '<time>'
97
+ | '<resolution>'
98
+ | '<transform-function>'
99
+ | '<length> | <percentage>'
100
+
101
+ export interface CssPropertyDefinition {
102
+ /**
103
+ * Controls whether the custom property registration specified by @property inherits by default.
104
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/inherits
105
+ */
106
+ inherits: boolean
107
+ /**
108
+ * Sets the initial value for the property.
109
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/initial-value
110
+ */
111
+ initialValue: string
112
+ /**
113
+ * Describes the allowable syntax for the property.
114
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
115
+ */
116
+ syntax: LiteralUnion<CssPropertySyntax>
117
+ }
118
+
119
+ export interface GlobalVarsDefinition {
120
+ [key: string]: string | CssPropertyDefinition
121
+ }
122
+
123
+ interface ExtendableGlobalVars {
124
+ [key: string]: string | CssPropertyDefinition | ExtendableGlobalVars | undefined
125
+ extend?: ExtendableGlobalVars
126
+ }
127
+
82
128
  export interface ExtendableOptions {
83
129
  /**
84
130
  * The css selectors or media queries shortcuts.
@@ -105,6 +151,10 @@ export interface ExtendableOptions {
105
151
  * Common styling or layout patterns for your project.
106
152
  */
107
153
  patterns?: ExtendablePatterns
154
+ /**
155
+ * The css variables for your project.
156
+ */
157
+ globalVars?: ExtendableGlobalVars
108
158
  }
109
159
 
110
160
  export interface ImportMapInput {
@@ -1,4 +1,4 @@
1
- import type { ConditionalValue, Conditions, Nested } from './conditions'
1
+ import type { ConditionalValue, Nested } from './conditions'
2
2
  import type { PropertiesFallback } from './csstype'
3
3
  import type { SystemProperties, CssVarProperties } from './style-props'
4
4
 
@@ -35,10 +35,6 @@ export interface CssKeyframes {
35
35
  * Conditional css properties
36
36
  * -----------------------------------------------------------------------------*/
37
37
 
38
- type MinimalNested<P> = {
39
- [K in keyof Conditions]?: Nested<P>
40
- }
41
-
42
38
  interface GenericProperties {
43
39
  [key: string]: ConditionalValue<String | Number | boolean>
44
40
  }
@@ -71,7 +67,7 @@ export type CompositionStyleObject<Property extends string> = Nested<FilterStyle
71
67
  interface WithCss {
72
68
  css?: SystemStyleObject
73
69
  }
74
- type StyleProps = SystemProperties & MinimalNested<SystemStyleObject>
70
+ type StyleProps = SystemStyleObject & WithCss
75
71
 
76
72
  export type JsxStyleProps = StyleProps & WithCss
77
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.0.0-dev-20240313103423",
3
+ "version": "0.0.0-dev-20240315003802",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -30,7 +30,7 @@
30
30
  "microdiff": "1.3.2",
31
31
  "ncp": "2.0.0",
32
32
  "pkg-types": "1.0.3",
33
- "@pandacss/extractor": "0.0.0-dev-20240313103423"
33
+ "@pandacss/extractor": "0.0.0-dev-20240315003802"
34
34
  },
35
35
  "scripts": {
36
36
  "dev": "tsx scripts/watch.ts",