@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.
@@ -0,0 +1,101 @@
1
+ import type { Recursive } from './shared'
2
+
3
+ export type TokenStatus = 'deprecated' | 'experimental' | 'new'
4
+
5
+ export interface Token<Value = any> {
6
+ value: Value
7
+ description?: string
8
+ type?: string
9
+ extensions?: {
10
+ status?: TokenStatus
11
+ [key: string]: any
12
+ }
13
+ }
14
+
15
+ type RecursiveToken<C extends string, V> =
16
+ | V
17
+ | {
18
+ [K in C]: RecursiveToken<C, V>
19
+ }
20
+
21
+ export interface SemanticToken<Value = string, Condition extends string = string>
22
+ extends Token<RecursiveToken<Condition, Value>> {}
23
+
24
+ /* -----------------------------------------------------------------------------
25
+ * Token data types
26
+ * -----------------------------------------------------------------------------*/
27
+
28
+ type BorderStyle =
29
+ | 'dashed'
30
+ | 'dotted'
31
+ | 'double'
32
+ | 'groove'
33
+ | 'hidden'
34
+ | 'inset'
35
+ | 'none'
36
+ | 'outset'
37
+ | 'ridge'
38
+ | 'solid'
39
+
40
+ export interface Border {
41
+ color: string
42
+ width: string | number
43
+ style: BorderStyle
44
+ }
45
+
46
+ export interface Shadow {
47
+ offsetX: number
48
+ offsetY: number
49
+ blur: number
50
+ spread: number
51
+ color: string
52
+ inset?: boolean
53
+ }
54
+
55
+ export interface Gradient {
56
+ type: 'linear' | 'radial'
57
+ placement: string | number
58
+ stops:
59
+ | Array<{
60
+ color: string
61
+ position: number
62
+ }>
63
+ | Array<string>
64
+ }
65
+
66
+ export interface Asset {
67
+ type: 'url' | 'svg'
68
+ value: string
69
+ }
70
+
71
+ export interface TokenDataTypes {
72
+ zIndex: string | number
73
+ opacity: string | number
74
+ colors: string
75
+ fonts: string | string[]
76
+ fontSizes: string
77
+ fontWeights: string | number
78
+ lineHeights: string | number
79
+ letterSpacings: string
80
+ sizes: string
81
+ shadows: Shadow | Shadow[] | string | string[]
82
+ spacing: string | number
83
+ radii: string
84
+ borders: string | Border
85
+ durations: string
86
+ easings: string | number[]
87
+ animations: string
88
+ blurs: string
89
+ gradients: string | Gradient
90
+ assets: string | Asset
91
+ }
92
+
93
+ export type Tokens = {
94
+ [key in keyof TokenDataTypes]?: Recursive<Token<TokenDataTypes[key]>>
95
+ }
96
+
97
+ export type SemanticTokens<ConditionKey extends string = string> = {
98
+ [key in keyof TokenDataTypes]?: Recursive<SemanticToken<TokenDataTypes[key], ConditionKey>>
99
+ }
100
+
101
+ export type TokenCategory = keyof TokenDataTypes
@@ -0,0 +1,64 @@
1
+ import type { LiteralUnion } from './shared'
2
+ import type { CssProperty, NestedCssProperties } from './system-types'
3
+ import type { Token, TokenCategory } from './tokens'
4
+
5
+ interface TokenFn {
6
+ (path: string): string | undefined
7
+ raw: (path: string) => Token | undefined
8
+ }
9
+
10
+ type ThemeFn = (token: (path: string) => any) => Record<string, string>
11
+
12
+ export type PropertyValues =
13
+ | LiteralUnion<TokenCategory>
14
+ | string[]
15
+ | { type: string }
16
+ | Record<string, string>
17
+ | ThemeFn
18
+
19
+ interface TransformArgs {
20
+ token: TokenFn
21
+ raw: any
22
+ }
23
+
24
+ export type PropertyTransform = (value: any, args: TransformArgs) => NestedCssProperties | undefined
25
+
26
+ export interface PropertyConfig {
27
+ /**
28
+ * @internal
29
+ * The cascade layer to which the property belongs
30
+ */
31
+ layer?: string
32
+ /**
33
+ * The classname this property will generate.
34
+ */
35
+ className?: string
36
+ /**
37
+ * The css style object this property will generate.
38
+ */
39
+ transform?: PropertyTransform
40
+ /**
41
+ * The possible values this property can have.
42
+ */
43
+ values?: PropertyValues
44
+ /**
45
+ * The css property this utility maps to.
46
+ */
47
+ property?: CssProperty
48
+ /**
49
+ * The shorthand of the property.
50
+ */
51
+ shorthand?: string | string[]
52
+ }
53
+
54
+ export type UtilityConfig = {
55
+ [property in LiteralUnion<CssProperty>]?: PropertyConfig
56
+ }
57
+
58
+ type UtilityConfigWithExtend = {
59
+ [pattern in LiteralUnion<CssProperty>]?: PropertyConfig | UtilityConfig | undefined
60
+ }
61
+
62
+ export type ExtendableUtilityConfig = UtilityConfigWithExtend & {
63
+ extend?: UtilityConfig | undefined
64
+ }
package/package.json CHANGED
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.17.2",
3
+ "version": "0.17.4",
4
4
  "description": "The types for css panda",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
5
+ "main": "dist/index.d.ts",
8
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
9
7
  "exports": {
10
8
  ".": {
@@ -26,10 +24,10 @@
26
24
  "hookable": "5.5.3",
27
25
  "ncp": "^2.0.0",
28
26
  "pkg-types": "1.0.3",
29
- "@pandacss/extractor": "0.17.2"
27
+ "@pandacss/extractor": "0.17.4"
30
28
  },
31
29
  "scripts": {
32
30
  "dev": "tsx scripts/watch.ts",
33
- "build": "PANDA_BUILD=1 tsx scripts/postbuild.ts"
31
+ "build": "PANDA_BUILD=1 tsx scripts/postbuild.ts && tsx scripts/build.ts"
34
32
  }
35
33
  }