@pandacss/types 0.22.1 → 0.24.0

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.
@@ -32,6 +32,8 @@ export type ArtifactId =
32
32
  | 'styles.css'
33
33
  | (string & {})
34
34
 
35
+ export type CssArtifactType = 'preflight' | 'tokens' | 'static' | 'global' | 'keyframes'
36
+
35
37
  export type Artifact = Nullable<{
36
38
  id: ArtifactId
37
39
  dir?: string[]
package/dist/config.d.ts CHANGED
@@ -42,7 +42,7 @@ interface Patterns {
42
42
  [pattern: string]: PatternConfig
43
43
  }
44
44
 
45
- interface PresetCore {
45
+ export interface PresetCore {
46
46
  /**
47
47
  * The css selectors or media queries shortcuts.
48
48
  * @example `{ hover: "&:hover" }`
package/dist/hooks.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { HookKeys, Hookable } from 'hookable'
2
2
  import type { LoadConfigResult, UserConfig } from './config'
3
- import type { ParserResultType } from './parser'
3
+ import type { ParserResultInterface } from './parser'
4
4
 
5
5
  type MaybeAsyncReturn = Promise<void> | void
6
6
 
@@ -20,7 +20,7 @@ export interface PandaHooks {
20
20
  /**
21
21
  * Called after the file styles are extracted and processed into the resulting ParserResult object.
22
22
  */
23
- 'parser:after': (file: string, result: ParserResultType | undefined) => void
23
+ 'parser:after': (file: string, result: ParserResultInterface | undefined) => void
24
24
  /**
25
25
  * Called after the extracted ParserResult has been transformed to a CSS string
26
26
  */
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export type * from './recipe'
11
11
  export type * from './runtime'
12
12
  export type * from './shared'
13
13
  export type * from './static-css'
14
+ export type * from './style-rules'
14
15
  export type * from './system-types'
15
16
  export type * from './theme'
16
17
  export type * from './tokens'
package/dist/parser.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- import type { BoxNodeMap, BoxNodeLiteral, Unboxed, BoxNodeArray } from '@pandacss/extractor'
1
+ import type { BoxNodeArray, BoxNodeLiteral, BoxNodeMap, Unboxed } from '@pandacss/extractor'
2
2
 
3
3
  export interface ResultItem {
4
4
  name?: string
5
5
  data: Array<Unboxed['raw']>
6
6
  type?: 'object' | 'cva' | 'sva' | 'pattern' | 'recipe' | 'jsx-factory' | 'jsx-pattern' | 'jsx-recipe' | 'jsx'
7
- box: BoxNodeMap | BoxNodeLiteral | BoxNodeArray
7
+ box?: BoxNodeMap | BoxNodeLiteral | BoxNodeArray
8
8
  }
9
9
 
10
- export interface ParserResultType {
10
+ export interface ParserResultInterface {
11
+ all: Array<ResultItem>
11
12
  jsx: Set<ResultItem>
12
13
  css: Set<ResultItem>
13
14
  cva: Set<ResultItem>
@@ -15,22 +16,16 @@ export interface ParserResultType {
15
16
  recipe: Map<string, Set<ResultItem>>
16
17
  pattern: Map<string, Set<ResultItem>>
17
18
  filePath: string | undefined
18
- set: (name: 'cva' | 'css', result: ResultItem) => void
19
- setSva: (result: ResultItem) => void
20
- setCva: (result: ResultItem) => void
21
- setJsx: (result: ResultItem) => void
22
- setRecipe: (name: string, result: ResultItem) => void
23
- setPattern: (name: string, result: ResultItem) => void
24
19
  isEmpty: () => boolean
25
- setFilePath: (filePath: string) => ParserResultType
26
20
  toArray: () => Array<ResultItem>
27
- toJSON: () => {
28
- sva: Array<ResultItem>
29
- css: Array<ResultItem>
30
- cva: Array<ResultItem>
31
- recipe: Record<string, ResultItem[]>
32
- pattern: Record<string, ResultItem[]>
33
- jsx: Array<ResultItem>
21
+ }
22
+
23
+ export interface ShipJson {
24
+ schemaVersion: string
25
+ styles: {
26
+ atomic: string[]
27
+ recipes: {
28
+ [name: string]: string[]
29
+ }
34
30
  }
35
- merge: (result: ParserResultType) => ParserResultType
36
31
  }
package/dist/runtime.d.ts CHANGED
@@ -10,6 +10,12 @@ interface InputOptions {
10
10
  cwd?: string
11
11
  }
12
12
 
13
+ export type WatcherEventType = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
14
+
15
+ export interface WatchOptions extends InputOptions {
16
+ poll?: boolean
17
+ }
18
+
13
19
  interface FileSystem {
14
20
  readDirSync(dir: string): string[]
15
21
  existsSync(fileLike: string): boolean
@@ -20,12 +26,13 @@ interface FileSystem {
20
26
  rmFileSync(file: string): void
21
27
  ensureDirSync(dirPath: string): void
22
28
  writeFileSync(filePath: string, content: string): void
23
- watch(options: InputOptions & { poll?: boolean }): Watcher
29
+ watch(options: WatchOptions): Watcher
24
30
  }
25
31
 
26
32
  interface Path {
27
33
  join(...paths: string[]): string
28
34
  dirname(path: string): string
35
+ resolve(...paths: string[]): string
29
36
  extname(path: string): string
30
37
  relative(from: string, to: string): string
31
38
  isAbsolute(path: string): boolean
@@ -1,28 +1,28 @@
1
- interface CssRule {
1
+ interface WithConditions {
2
2
  /**
3
- * The css properties to generate utilities for.
4
- * @example ['margin', 'padding']
5
- */
6
- properties: {
7
- [property: string]: string[]
8
- }
9
- /**
10
- * The css conditions to generate utilities for.
3
+ * The css conditions to generate for the rule.
11
4
  * @example ['hover', 'focus']
12
5
  */
13
6
  conditions?: string[]
7
+ responsive?: boolean
8
+ }
9
+
10
+ export interface CssRule extends WithConditions {
14
11
  /**
15
- * Whether to generate responsive utilities.
12
+ * The css properties to generate utilities for.
13
+ * @example ['margin', 'padding']
16
14
  */
17
- responsive?: boolean
15
+ properties: {
16
+ [property: string]: Array<string | number>
17
+ }
18
18
  }
19
19
 
20
- export type RecipeRule =
21
- | '*'
22
- | ({
23
- conditions?: string[]
24
- responsive?: boolean
25
- } & { [variant: string]: boolean | string[] })
20
+ interface RecipeRuleVariants {
21
+ [variant: string]: boolean | string[]
22
+ }
23
+
24
+ export type RecipeRule = '*' | (RecipeRuleVariants & WithConditions)
25
+ export type PatternRule = '*' | CssRule
26
26
 
27
27
  export interface StaticCssOptions {
28
28
  /**
@@ -35,4 +35,10 @@ export interface StaticCssOptions {
35
35
  recipes?: {
36
36
  [recipe: string]: RecipeRule[]
37
37
  }
38
+ /**
39
+ * The css patterns to generate.
40
+ */
41
+ patterns?: {
42
+ [pattern: string]: PatternRule[]
43
+ }
38
44
  }
@@ -0,0 +1,59 @@
1
+ import type { RawCondition } from './conditions'
2
+
3
+ export interface StyleResultObject {
4
+ [key: string]: any
5
+ }
6
+ export interface StyleProps extends StyleResultObject {
7
+ css?: StyleResultObject
8
+ }
9
+
10
+ export interface StyleEntry {
11
+ prop: string
12
+ value: string
13
+ cond: string
14
+ recipe?: string
15
+ slot?: string
16
+ layer?: string
17
+ variants?: boolean
18
+ }
19
+
20
+ interface ExpandedCondition extends RawCondition {
21
+ params?: string
22
+ }
23
+
24
+ export interface AtomicStyleResult {
25
+ result: StyleResultObject
26
+ entry: StyleEntry
27
+ hash: string
28
+ className: string
29
+ conditions?: ExpandedCondition[]
30
+ layer?: string
31
+ }
32
+
33
+ export interface GroupedResult extends Pick<AtomicStyleResult, 'result' | 'className'> {
34
+ hashSet: Set<string>
35
+ details: GroupedStyleResultDetails[]
36
+ }
37
+
38
+ export interface RecipeBaseResult extends GroupedResult {
39
+ recipe: string
40
+ slot?: string
41
+ }
42
+
43
+ export interface GroupedStyleResultDetails extends Pick<AtomicStyleResult, 'hash' | 'entry' | 'conditions'> {
44
+ result: StyleResultObject
45
+ }
46
+
47
+ export interface StyleDecoderInterface {
48
+ classNames: Map<string, AtomicStyleResult | RecipeBaseResult>
49
+ //
50
+ results: {
51
+ atomic: Set<AtomicStyleResult>
52
+ recipes: Map<string, Set<AtomicStyleResult>>
53
+ recipes_base: Map<string, Set<RecipeBaseResult>>
54
+ }
55
+ atomic: Set<AtomicStyleResult>
56
+ //
57
+ recipes: Map<string, Set<AtomicStyleResult>>
58
+ recipes_base: Map<string, Set<RecipeBaseResult>>
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.22.1",
3
+ "version": "0.24.0",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -13,6 +13,12 @@
13
13
  "./package.json": "./package.json"
14
14
  },
15
15
  "sideEffects": false,
16
+ "homepage": "https://panda-css.com",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/chakra-ui/panda.git",
20
+ "directory": "packages/types"
21
+ },
16
22
  "publishConfig": {
17
23
  "access": "public"
18
24
  },
@@ -24,7 +30,7 @@
24
30
  "hookable": "5.5.3",
25
31
  "ncp": "^2.0.0",
26
32
  "pkg-types": "1.0.3",
27
- "@pandacss/extractor": "0.22.1"
33
+ "@pandacss/extractor": "0.24.0"
28
34
  },
29
35
  "scripts": {
30
36
  "dev": "tsx scripts/watch.ts",