@pandacss/types 0.0.0-dev-20240126232947 → 0.0.0-dev-20240128182812

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
@@ -38,7 +38,7 @@ export interface StudioOptions {
38
38
  }
39
39
  }
40
40
 
41
- interface Patterns {
41
+ export interface Patterns {
42
42
  [pattern: string]: PatternConfig
43
43
  }
44
44
 
@@ -346,6 +346,15 @@ export interface Config
346
346
  * @default 'false'
347
347
  */
348
348
  eject?: boolean
349
+ /**
350
+ * The validation strcictnesss to use when validating the config.
351
+ * - When set to 'none', no validation will be performed.
352
+ * - When set to 'warn', warnings will be logged when validation fails.
353
+ * - When set to 'error', errors will be thrown when validation fails.
354
+ *
355
+ * @default 'error'
356
+ */
357
+ validation?: 'none' | 'warn' | 'error'
349
358
  }
350
359
 
351
360
  export interface Preset extends ExtendableOptions, PresetOptions {}
package/dist/pattern.d.ts CHANGED
@@ -12,13 +12,20 @@ export type PatternProperty =
12
12
 
13
13
  export interface PatternHelpers {
14
14
  map: (value: any, fn: (value: string) => string | undefined) => any
15
+ isCssUnit: (value: any) => boolean
16
+ isCssVar: (value: any) => boolean
17
+ isCssFunction: (value: any) => boolean
15
18
  }
16
19
 
17
20
  export interface PatternProperties {
18
21
  [key: string]: PatternProperty
19
22
  }
20
23
 
21
- type Props<T> = Record<LiteralUnion<keyof T>, any>
24
+ type InferProps<T> = Record<LiteralUnion<keyof T>, any>
25
+
26
+ export type PatternDefaultValue<T> = Partial<InferProps<T>>
27
+
28
+ export type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>
22
29
 
23
30
  export interface PatternConfig<T extends PatternProperties = PatternProperties> {
24
31
  /**
@@ -34,10 +41,14 @@ export interface PatternConfig<T extends PatternProperties = PatternProperties>
34
41
  * The properties of the pattern.
35
42
  */
36
43
  properties?: T
44
+ /**
45
+ * The default values of the pattern.
46
+ */
47
+ defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>
37
48
  /**
38
49
  * The css object this pattern will generate.
39
50
  */
40
- transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject
51
+ transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject
41
52
  /**
42
53
  * The jsx element name this pattern will generate.
43
54
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.0.0-dev-20240126232947",
3
+ "version": "0.0.0-dev-20240128182812",
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-20240126232947"
33
+ "@pandacss/extractor": "0.0.0-dev-20240128182812"
34
34
  },
35
35
  "scripts": {
36
36
  "dev": "tsx scripts/watch.ts",