@pandacss/types 2.0.0-beta.8 → 2.0.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.
package/dist/config.d.ts CHANGED
@@ -2,23 +2,24 @@ import type { TSConfig } from 'pkg-types'
2
2
  import type { Conditions, ExtendableConditions } from './conditions'
3
3
  import type { HookRegistry } from './hooks'
4
4
  import type { PatternConfig } from './pattern'
5
- import type { Keys, LiteralUnion, PathIn, RequiredBy } from './shared'
5
+ import type { Keys, PathIn, RequiredBy } from './shared'
6
6
  import type { StaticCssOptions } from './static-css'
7
7
  import type {
8
8
  ExtendableGlobalFontface,
9
9
  ExtendableGlobalStyleObject,
10
10
  GlobalFontface,
11
11
  GlobalStyleObject,
12
- SystemStyleObject,
13
12
  } from './system-types'
14
13
  import type { ExtendableTheme, Theme } from './theme'
14
+ import type { CssPropertyDefinition, GlobalVarsDefinition } from './global-vars'
15
15
  import type { ExtendableUtilityConfig, UtilityConfig } from './utility'
16
16
 
17
17
  export type { TSConfig }
18
18
 
19
- export type CascadeLayer = 'reset' | 'base' | 'tokens' | 'recipes' | 'utilities'
19
+ /** The five cascade layers, in emit order. */
20
+ export type StylesheetLayerName = 'reset' | 'base' | 'tokens' | 'recipes' | 'utilities'
20
21
 
21
- export type CascadeLayers = Record<CascadeLayer, string>
22
+ export type StylesheetLayers = Record<StylesheetLayerName, string>
22
23
 
23
24
  export interface Patterns {
24
25
  [pattern: string]: PatternConfig
@@ -38,10 +39,6 @@ export interface PresetCore {
38
39
  * The global fontface for your project.
39
40
  */
40
41
  globalFontface?: GlobalFontface
41
- /**
42
- * The global custom position try fallback option
43
- */
44
- globalPositionTry?: GlobalPositionTry
45
42
  /**
46
43
  * Used to generate css utility classes for your project.
47
44
  */
@@ -73,58 +70,13 @@ interface ExtendableStaticCssOptions extends StaticCssOptions {
73
70
  extend?: StaticCssOptions | undefined
74
71
  }
75
72
 
76
- export type CssPropertySyntax =
77
- | '*'
78
- | '<length>'
79
- | '<number>'
80
- | '<percentage>'
81
- | '<length-percentage>'
82
- | '<color>'
83
- | '<image>'
84
- | '<url>'
85
- | '<integer>'
86
- | '<angle>'
87
- | '<time>'
88
- | '<resolution>'
89
- | '<transform-function>'
90
- | '<length> | <percentage>'
91
-
92
- export interface CssPropertyDefinition {
93
- /**
94
- * Controls whether the custom property registration specified by @property inherits by default.
95
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/inherits
96
- */
97
- inherits: boolean
98
- /**
99
- * Sets the initial value for the property.
100
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/initial-value
101
- */
102
- initialValue?: string
103
- /**
104
- * Describes the allowable syntax for the property.
105
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
106
- */
107
- syntax: LiteralUnion<CssPropertySyntax>
108
- }
109
-
110
- export interface GlobalVarsDefinition {
111
- [key: string]: string | CssPropertyDefinition
112
- }
73
+ export type { CssPropertyDefinition, CssPropertySyntax, GlobalVarsDefinition } from './global-vars'
113
74
 
114
75
  interface ExtendableGlobalVars {
115
76
  [key: string]: string | CssPropertyDefinition | GlobalVarsDefinition | undefined
116
77
  extend?: GlobalVarsDefinition
117
78
  }
118
79
 
119
- export interface GlobalPositionTry {
120
- [key: string]: SystemStyleObject
121
- }
122
-
123
- interface ExtendableGlobalPositionTry {
124
- [key: string]: SystemStyleObject | GlobalPositionTry | undefined
125
- extend?: GlobalPositionTry | undefined
126
- }
127
-
128
80
  export interface ThemeVariant extends Pick<Theme, 'tokens' | 'semanticTokens'> {}
129
81
 
130
82
  export interface ThemeVariantsMap {
@@ -153,7 +105,6 @@ export interface ExtendableOptions {
153
105
  /**
154
106
  * The global custom position try fallback option
155
107
  */
156
- globalPositionTry?: ExtendableGlobalPositionTry
157
108
  /**
158
109
  * Used to generate css utility classes for your project.
159
110
  */
@@ -198,7 +149,7 @@ export interface ImportMapOutput<T = string> {
198
149
  tokens: T[]
199
150
  }
200
151
 
201
- type ImportMapOption = string | ImportMapInput
152
+ export type ImportMapOption = string | ImportMapInput
202
153
 
203
154
  interface FileSystemOptions {
204
155
  /**
@@ -215,6 +166,7 @@ interface FileSystemOptions {
215
166
  * recipes: 'styled-system/recipes',
216
167
  * patterns: 'styled-system/patterns',
217
168
  * jsx: 'styled-system/jsx',
169
+ * tokens: 'styled-system/tokens',
218
170
  * }
219
171
  * ```
220
172
  */
@@ -249,7 +201,7 @@ interface FileSystemOptions {
249
201
  logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent'
250
202
  }
251
203
 
252
- export type JsxFramework = 'react' | 'solid' | 'preact' | 'vue' | 'qwik'
204
+ export type JsxFramework = 'react' | 'solid' | 'preact' | 'vue'
253
205
 
254
206
  interface JsxOptions {
255
207
  /**
@@ -313,16 +265,21 @@ interface CssgenOptions {
313
265
  * @default ':where(:host, :root)'
314
266
  */
315
267
  cssVarRoot?: string
316
- /**
317
- * The css syntax kind to use
318
- * @default 'object-literal'
319
- */
320
- syntax?: 'template-literal' | 'object-literal'
321
268
  /**
322
269
  * Layer mappings used in the generated css.
323
270
  * @default 'true'
324
271
  */
325
- layers?: Partial<CascadeLayers>
272
+ layers?: Partial<StylesheetLayers>
273
+ /**
274
+ * Whether to minify the emitted css. The `--minify` CLI flag overrides this.
275
+ * @default false
276
+ */
277
+ minify?: boolean
278
+ /**
279
+ * Polyfill cascade layers for older browsers. `--polyfill` overrides this.
280
+ * @default false
281
+ */
282
+ polyfill?: boolean
326
283
  }
327
284
 
328
285
  export interface OptimizeOptions {
@@ -338,6 +295,17 @@ export interface OptimizeOptions {
338
295
  * Narrow compound variant CSS to statically selected variant combinations.
339
296
  */
340
297
  smartCompoundVariants?: boolean
298
+ /**
299
+ * Hydrate only build-info modules for design-system exports the app imports.
300
+ * Off by default. Namespace / side-effect imports still hydrate everything.
301
+ */
302
+ treeshakeDesignSystem?: boolean
303
+ /**
304
+ * Also seed `@property` registrations as plain declarations, for engines that ignore
305
+ * `@property` (Safari < 16.4, Firefox < 128) and would otherwise drop any declaration
306
+ * reading an unregistered variable. Off by default — modern engines don't need it.
307
+ */
308
+ propertyFallback?: boolean
341
309
  }
342
310
 
343
311
  interface CodegenOptions {
@@ -369,6 +337,7 @@ interface CodegenOptions {
369
337
  outExtension?: 'ts' | 'js' | 'mjs'
370
338
  /**
371
339
  * Whether generated import specifiers include runtime file extensions.
340
+ * When `outExtension` is `mjs`, this also emits `.d.mts` instead of `.d.ts`.
372
341
  * @default false
373
342
  */
374
343
  forceImportExtension?: boolean
@@ -0,0 +1,39 @@
1
+ import type { LiteralUnion } from './shared'
2
+
3
+ export type CssPropertySyntax =
4
+ | '*'
5
+ | '<length>'
6
+ | '<number>'
7
+ | '<percentage>'
8
+ | '<length-percentage>'
9
+ | '<color>'
10
+ | '<image>'
11
+ | '<url>'
12
+ | '<integer>'
13
+ | '<angle>'
14
+ | '<time>'
15
+ | '<resolution>'
16
+ | '<transform-function>'
17
+ | '<length> | <percentage>'
18
+
19
+ export interface CssPropertyDefinition {
20
+ /**
21
+ * Controls whether the custom property registration specified by @property inherits by default.
22
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/inherits
23
+ */
24
+ inherits: boolean
25
+ /**
26
+ * Sets the initial value for the property.
27
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/initial-value
28
+ */
29
+ initialValue?: string
30
+ /**
31
+ * Describes the allowable syntax for the property.
32
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
33
+ */
34
+ syntax: LiteralUnion<CssPropertySyntax>
35
+ }
36
+
37
+ export interface GlobalVarsDefinition {
38
+ [key: string]: string | CssPropertyDefinition
39
+ }
package/dist/hooks.d.ts CHANGED
@@ -62,19 +62,21 @@ export interface ConfigResolvedHookArgs {
62
62
  utils: ConfigResolvedHookUtils
63
63
  }
64
64
 
65
- export interface CodegenFile {
65
+ /** Hook-facing codegen file — `dependencies` stay plain strings for plugin authors. */
66
+ export interface CodegenPrepareFile {
66
67
  path: string
67
68
  code: string
68
69
  dependencies: string[]
69
70
  }
70
71
 
71
- export interface CodegenArtifact {
72
+ /** Hook-facing codegen artifact — distinct from the compiler `CodegenArtifact` API. */
73
+ export interface CodegenPrepareArtifact {
72
74
  id: string
73
- files: CodegenFile[]
75
+ files: CodegenPrepareFile[]
74
76
  }
75
77
 
76
78
  export interface CodegenPrepareHookArgs {
77
- artifacts: CodegenArtifact[]
79
+ artifacts: CodegenPrepareArtifact[]
78
80
  outdir: string
79
81
  cwd?: string | undefined
80
82
  }
@@ -85,6 +87,43 @@ export interface CodegenDoneHookArgs {
85
87
  cwd?: string | undefined
86
88
  }
87
89
 
90
+ export type CssgenArtifact = 'styles.css' | 'styles.layer' | 'styles.split'
91
+
92
+ export interface CssgenDoneManifestFile {
93
+ path: string
94
+ hash: string
95
+ }
96
+
97
+ export interface CssgenDoneManifest {
98
+ files: CssgenDoneManifestFile[]
99
+ tokens: string[]
100
+ }
101
+
102
+ export interface CssgenDoneLayerRange {
103
+ start: number
104
+ end: number
105
+ }
106
+
107
+ export interface CssgenDoneLayerRanges {
108
+ reset?: CssgenDoneLayerRange
109
+ base?: CssgenDoneLayerRange
110
+ tokens?: CssgenDoneLayerRange
111
+ recipes?: CssgenDoneLayerRange
112
+ utilities?: CssgenDoneLayerRange
113
+ }
114
+
115
+ export interface CssgenDoneHookArgs {
116
+ artifact: CssgenArtifact
117
+ content: string
118
+ /** Absolute path when written to disk; omitted for string sinks (Vite/PostCSS). */
119
+ path?: string | undefined
120
+ outfile?: string | undefined
121
+ outdir?: string | undefined
122
+ cwd?: string | undefined
123
+ manifest?: CssgenDoneManifest | undefined
124
+ layerRanges?: CssgenDoneLayerRanges | undefined
125
+ }
126
+
88
127
  export interface PandaHooks {
89
128
  /**
90
129
  * Called after authored presets are merged, before defaults and serialization.
@@ -102,11 +141,16 @@ export interface PandaHooks {
102
141
  /**
103
142
  * Called before generated files are written by a JS host.
104
143
  */
105
- 'codegen:prepare': (args: CodegenPrepareHookArgs) => void | CodegenArtifact[]
144
+ 'codegen:prepare': (args: CodegenPrepareHookArgs) => void | CodegenPrepareArtifact[]
106
145
  /**
107
146
  * Called after generated files are written by a JS host.
108
147
  */
109
148
  'codegen:done': (args: CodegenDoneHookArgs) => void
149
+ /**
150
+ * Called after final CSS is produced by a JS host (observe-only; no rewrite).
151
+ * Fires for CLI, Vite, and PostCSS string sinks. Use `optimize` or PostCSS to mutate CSS.
152
+ */
153
+ 'cssgen:done': (args: CssgenDoneHookArgs) => void
110
154
  }
111
155
 
112
156
  export type HookRegistry = {
package/dist/index.d.ts CHANGED
@@ -1,18 +1,12 @@
1
- export type * from './artifact'
2
1
  export type * from './composition'
3
2
  export type * from './conditions'
4
3
  export type * from './config'
4
+ export type * from './global-vars'
5
5
  export type * from './hooks'
6
- export type * from './hooks-api'
7
- export type * from './logger'
8
- export type * from './parts'
9
6
  export type * from './pattern'
10
7
  export type * from './recipe'
11
- export type * from './runtime'
12
8
  export type * from './shared'
13
- export type * from './spec'
14
9
  export type * from './static-css'
15
- export type * from './style-rules'
16
10
  export type * from './system-types'
17
11
  export type * from './theme'
18
12
  export type * from './tokens'
package/dist/pattern.d.ts CHANGED
@@ -11,7 +11,7 @@ export type PatternProperty =
11
11
  | { type: 'string' | 'boolean' | 'number'; description?: string }
12
12
 
13
13
  export interface PatternHelpers {
14
- map: (value: any, fn: (value: string) => string | undefined) => any
14
+ map: (value: any, fn: (value: any) => any) => any
15
15
  isCssUnit: (value: any) => boolean
16
16
  isCssVar: (value: any) => boolean
17
17
  isCssFunction: (value: any) => boolean
@@ -87,8 +87,29 @@ interface GenericProperties {
87
87
 
88
88
  export type NestedCssProperties = Nested<CssProperties>
89
89
 
90
+ export type FirstThatWorksMember = String | Number
91
+
90
92
  export type SystemStyleObject = Nested<(SystemProperties | GenericProperties) & CssVarProperties>
91
93
 
94
+ export interface ViewTransitionStyleObject {
95
+ group?: SystemStyleObject
96
+ imagePair?: SystemStyleObject
97
+ old?: SystemStyleObject
98
+ new?: SystemStyleObject
99
+ }
100
+
101
+ export type ViewTransitions = Record<string, ViewTransitionStyleObject>
102
+
103
+ export type ViewTransitionFn = (options: ViewTransitionStyleObject | string) => string
104
+
105
+ /** Named `@position-try` fallback bags. Referenced by `positionTry('name')`. */
106
+ export type PositionTry = Record<string, SystemStyleObject>
107
+
108
+ export type PositionTryFn = (options: SystemStyleObject | string) => string
109
+
110
+ /** Inline `@keyframes` factory: `keyframes({...})` returns the animation name. Object form only. */
111
+ export type KeyframesFn = (keyframe: CssKeyframes[string]) => string
112
+
92
113
  export interface GlobalStyleObject {
93
114
  [selector: string]: SystemStyleObject
94
115
  }
package/dist/theme.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { AnimationStyles, LayerStyles, TextStyles } from './composition'
2
2
  import type { RecipeConfig, SlotRecipeConfig } from './recipe'
3
- import type { CssKeyframes } from './system-types'
3
+ import type { CssKeyframes, PositionTry, ViewTransitions } from './system-types'
4
4
  import type { SemanticTokens, Tokens } from './tokens'
5
5
 
6
6
  export interface ColorPaletteOptions {
@@ -50,6 +50,17 @@ export interface Theme {
50
50
  * The animation styles for your project.
51
51
  */
52
52
  animationStyles?: AnimationStyles
53
+ /**
54
+ * Named View Transition bags. Call `viewTransition('slide')` to use one.
55
+ * Panda emits the shared `::view-transition-*` CSS; you still set unique
56
+ * `view-transition-name` values at runtime.
57
+ */
58
+ viewTransitions?: ViewTransitions
59
+ /**
60
+ * Named `@position-try` anchor-positioning fallbacks. Call `positionTry('bottom')`
61
+ * to get the dashed-ident for `positionTryFallbacks`. Emitted only when used.
62
+ */
63
+ positionTry?: PositionTry
53
64
  /**
54
65
  * Multi-variant style definitions for your project.
55
66
  * Useful for defining component styles.
package/dist/tokens.d.ts CHANGED
@@ -52,10 +52,12 @@ export interface Shadow {
52
52
 
53
53
  export interface Gradient {
54
54
  type: 'linear' | 'radial'
55
+ /** A keyword (`to right`, `circle at center`) or an angle in degrees. */
55
56
  placement: string | number
56
57
  stops:
57
58
  | Array<{
58
59
  color: string
60
+ /** Distance along the gradient, as a percentage (`0` to `100`). */
59
61
  position: number
60
62
  }>
61
63
  | Array<string>
package/dist/utility.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { GlobalVarsDefinition } from './global-vars'
1
2
  import type { LiteralUnion } from './shared'
2
3
  import type { CssProperty, NestedCssProperties } from './system-types'
3
4
  import type { Token, TokenCategory } from './tokens'
@@ -68,6 +69,11 @@ export interface PropertyConfig {
68
69
  * Whether this utility is deprecated or not.
69
70
  */
70
71
  deprecated?: boolean
72
+ /**
73
+ * `@property` registrations for the CSS variables this utility writes. Merged into the
74
+ * config-level `globalVars`, and pruned when the stylesheet never references them.
75
+ */
76
+ globalVars?: GlobalVarsDefinition
71
77
  }
72
78
 
73
79
  export type CssSemanticGroup =
@@ -88,6 +94,7 @@ export type CssSemanticGroup =
88
94
  | 'Layout'
89
95
  | 'List'
90
96
  | 'Margin'
97
+ | 'Mask'
91
98
  | 'Other'
92
99
  | 'Padding'
93
100
  | 'Position'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "2.0.0-beta.8",
3
+ "version": "2.0.0",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -27,11 +27,10 @@
27
27
  "dist"
28
28
  ],
29
29
  "devDependencies": {
30
+ "@parcel/watcher": "2.5.6",
30
31
  "csstype": "3.2.3",
31
- "microdiff": "1.5.0",
32
32
  "ncp": "2.0.0",
33
- "pkg-types": "2.3.0",
34
- "ts-morph": "28.0.0"
33
+ "pkg-types": "2.3.0"
35
34
  },
36
35
  "engines": {
37
36
  "node": ">=22"
@@ -1,65 +0,0 @@
1
- import { type Difference } from 'microdiff'
2
-
3
- export interface ArtifactContent {
4
- file: string
5
- code: string | undefined
6
- }
7
-
8
- export type ArtifactId =
9
- | 'helpers'
10
- | 'keyframes'
11
- | 'design-tokens'
12
- | 'types'
13
- | 'css-fn'
14
- | 'cva'
15
- | 'sva'
16
- | 'cx'
17
- | 'create-recipe'
18
- | 'recipes'
19
- | 'recipes-index'
20
- | 'patterns'
21
- | 'patterns-index'
22
- | 'jsx-is-valid-prop'
23
- | 'jsx-helpers'
24
- | 'jsx-factory'
25
- | 'jsx-patterns'
26
- | 'jsx-create-style-context'
27
- | 'jsx-patterns-index'
28
- | 'css-index'
29
- | 'themes'
30
- | 'package.json'
31
- | 'types-jsx'
32
- | 'types-entry'
33
- | 'types-styles'
34
- | 'types-conditions'
35
- | 'types-gen'
36
- | 'types-gen-system'
37
- | 'static-css'
38
- | 'styles.css'
39
- | 'styles'
40
- | `recipes.${string}`
41
- | `patterns.${string}`
42
-
43
- export type CssArtifactType = 'preflight' | 'tokens' | 'static' | 'global' | 'keyframes'
44
-
45
- export type Artifact = {
46
- id: ArtifactId
47
- dir?: string[]
48
- files: ArtifactContent[]
49
- }
50
-
51
- export interface AffectedArtifacts {
52
- recipes: string[]
53
- patterns: string[]
54
- }
55
-
56
- export interface ArtifactFilters {
57
- ids?: ArtifactId[]
58
- affecteds?: AffectedArtifacts
59
- }
60
-
61
- export interface DiffConfigResult {
62
- hasConfigChanged: boolean
63
- artifacts: Set<ArtifactId>
64
- diffs: Difference[]
65
- }
@@ -1,56 +0,0 @@
1
- import type { UserConfig } from './config'
2
- import type { RecipeDefinition, RecipeVariantRecord, SlotRecipeDefinition, SlotRecipeVariantRecord } from './recipe'
3
- import type { AtomicStyleResult, RecipeBaseResult } from './style-rules'
4
- import type { SystemStyleObject } from './system-types'
5
-
6
- export interface BaseRule {
7
- getClassNames: () => string[]
8
- toCss: () => string
9
- }
10
-
11
- export interface AtomicRule extends BaseRule {
12
- styles: SystemStyleObject
13
- }
14
-
15
- export interface AtomicRecipeRule extends BaseRule {
16
- config: RecipeDefinition<any> | SlotRecipeDefinition<string, any>
17
- }
18
-
19
- export interface RecipeVariantsRule extends BaseRule {
20
- variants: RecipeVariantRecord
21
- }
22
-
23
- export interface ProcessorInterface {
24
- css(styles: SystemStyleObject): AtomicRule
25
- cva(recipeConfig: RecipeDefinition<RecipeVariantRecord>): AtomicRecipeRule
26
- sva(recipeConfig: SlotRecipeDefinition<string, SlotRecipeVariantRecord<string>>): AtomicRecipeRule
27
- recipe(name: string, variants?: RecipeVariantRecord): RecipeVariantsRule | undefined
28
- }
29
-
30
- export interface HooksApiInterface {
31
- /**
32
- * The resolved config (after all the presets are loaded and merged)
33
- */
34
- config: UserConfig
35
- /**
36
- * The path to the config file
37
- */
38
- configPath: string
39
- /**
40
- * The list of all the config dependencies (direct/transitive imports) filepaths
41
- */
42
- configDependencies: string[]
43
- //
44
- /**
45
- * The processor can be used to generate atomic or recipe classes
46
- */
47
- processor: ProcessorInterface
48
- /**
49
- * Map that contains all the utility classNames
50
- */
51
- classNames: Map<string, string>
52
- /**
53
- * Map that contains all the classNames found (and therefore generated) in the app code
54
- */
55
- generatedClassNames: Map<string, AtomicStyleResult | RecipeBaseResult>
56
- }
package/dist/logger.d.ts DELETED
@@ -1,28 +0,0 @@
1
- export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'
2
-
3
- export interface LogEntry {
4
- level: LogLevel | null
5
- msg: string
6
- [key: string]: any
7
- }
8
-
9
- export interface LoggerInterface {
10
- level: 'debug' | 'info' | 'warn' | 'error' | 'silent'
11
- print(data: any): void
12
- onLog?: (entry: LogEntry) => void
13
- warn: (type: string, data: any) => void
14
- info: (type: string, data: any) => void
15
- debug: (type: string, data: any) => void
16
- error: (type: string, data: any) => void
17
- /**
18
- * Log a caught error with context. Extracts the message for the error level,
19
- * and logs the full stack at debug level.
20
- */
21
- caughtError: (type: string, context: string, error: unknown) => void
22
- log: (data: string) => void
23
- time: {
24
- info: (msg: string) => (_msg?: string) => void
25
- debug: (msg: string) => (_msg?: string) => void
26
- }
27
- isDebug: boolean
28
- }
package/dist/parts.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface Part {
2
- selector: string
3
- }
4
-
5
- export interface Parts {
6
- [key: string]: Part
7
- }
package/dist/runtime.d.ts DELETED
@@ -1,48 +0,0 @@
1
- interface Watcher {
2
- on(event: 'add' | 'addDir' | 'change', listener: (path: string) => void): this
3
- on(event: 'all', listener: (evt: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string) => void): this
4
- close(): Promise<void>
5
- }
6
-
7
- interface InputOptions {
8
- include: string[]
9
- exclude?: string[]
10
- cwd?: string
11
- }
12
-
13
- export type WatcherEventType = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
14
-
15
- export interface WatchOptions extends InputOptions {
16
- poll?: boolean
17
- }
18
-
19
- interface FileSystem {
20
- readDirSync(dir: string): string[]
21
- existsSync(fileLike: string): boolean
22
- glob(opts: InputOptions): string[]
23
- readFileSync(filePath: string): string
24
- rmDirSync(dirPath: string): void
25
- writeFile(file: string, content: string): Promise<void>
26
- rmFileSync(file: string): void
27
- ensureDirSync(dirPath: string): void
28
- writeFileSync(filePath: string, content: string): void
29
- watch(options: WatchOptions): Watcher
30
- }
31
-
32
- interface Path {
33
- join(...paths: string[]): string
34
- dirname(path: string): string
35
- resolve(...paths: string[]): string
36
- extname(path: string): string
37
- relative(from: string, to: string): string
38
- isAbsolute(path: string): boolean
39
- sep: string
40
- abs(cwd: string, path: string): string
41
- }
42
-
43
- export interface Runtime {
44
- fs: FileSystem
45
- path: Path
46
- cwd(): string
47
- env(name: string): string | undefined
48
- }
package/dist/spec.d.ts DELETED
@@ -1,197 +0,0 @@
1
- export type SpecType =
2
- | 'tokens'
3
- | 'recipes'
4
- | 'patterns'
5
- | 'conditions'
6
- | 'keyframes'
7
- | 'semantic-tokens'
8
- | 'text-styles'
9
- | 'layer-styles'
10
- | 'animation-styles'
11
- | 'color-palette'
12
- | 'themes'
13
-
14
- interface Examples {
15
- functionExamples: string[]
16
- jsxExamples: string[]
17
- }
18
-
19
- export interface TokenValue {
20
- name: string
21
- value: any
22
- description?: string
23
- deprecated?: boolean | string
24
- cssVar?: string
25
- }
26
-
27
- export interface TokenGroupDefinition extends Examples {
28
- type: string
29
- values: TokenValue[]
30
- tokenFunctionExamples: string[]
31
- }
32
-
33
- export interface TokenSpec {
34
- type: 'tokens'
35
- data: TokenGroupDefinition[]
36
- }
37
-
38
- export interface SemanticTokenValue {
39
- name: string
40
- values: Array<{ value: string; condition?: string }>
41
- description?: string
42
- deprecated?: boolean | string
43
- cssVar?: string
44
- }
45
-
46
- export interface SemanticTokenGroupDefinition extends Examples {
47
- type: string
48
- values: SemanticTokenValue[]
49
- tokenFunctionExamples: string[]
50
- }
51
-
52
- export interface SemanticTokenSpec {
53
- type: 'semantic-tokens'
54
- data: SemanticTokenGroupDefinition[]
55
- }
56
-
57
- export interface RecipeSpecDefinition extends Examples {
58
- name: string
59
- description?: string
60
- variants: Record<string, string[]>
61
- defaultVariants: Record<string, any>
62
- }
63
-
64
- export interface RecipeSpec {
65
- type: 'recipes'
66
- data: RecipeSpecDefinition[]
67
- }
68
-
69
- export interface PatternSpecProperty {
70
- name: string
71
- type: string
72
- description?: string
73
- required?: boolean
74
- defaultValue?: any
75
- }
76
-
77
- export interface PatternSpecDefinition extends Examples {
78
- name: string
79
- description?: string
80
- properties: PatternSpecProperty[]
81
- jsx?: string
82
- }
83
-
84
- export interface PatternSpec {
85
- type: 'patterns'
86
- data: PatternSpecDefinition[]
87
- }
88
-
89
- export interface ConditionSpecDefinition extends Examples {
90
- name: string
91
- value: string
92
- }
93
-
94
- export interface ConditionSpec {
95
- type: 'conditions'
96
- data: ConditionSpecDefinition[]
97
- }
98
-
99
- export interface KeyframeSpecDefinition extends Examples {
100
- name: string
101
- }
102
-
103
- export interface KeyframeSpec {
104
- type: 'keyframes'
105
- data: KeyframeSpecDefinition[]
106
- }
107
-
108
- export interface TextStyleSpecDefinition extends Examples {
109
- name: string
110
- description?: string
111
- }
112
-
113
- export interface TextStyleSpec {
114
- type: 'text-styles'
115
- data: TextStyleSpecDefinition[]
116
- }
117
-
118
- export interface LayerStyleSpecDefinition extends Examples {
119
- name: string
120
- description?: string
121
- }
122
-
123
- export interface LayerStyleSpec {
124
- type: 'layer-styles'
125
- data: LayerStyleSpecDefinition[]
126
- }
127
-
128
- export interface AnimationStyleSpecDefinition extends Examples {
129
- name: string
130
- description?: string
131
- }
132
-
133
- export interface AnimationStyleSpec {
134
- type: 'animation-styles'
135
- data: AnimationStyleSpecDefinition[]
136
- }
137
-
138
- export interface ColorPaletteSpec {
139
- type: 'color-palette'
140
- data: {
141
- values: string[]
142
- functionExamples: string[]
143
- jsxExamples: string[]
144
- }
145
- }
146
-
147
- export interface ThemeTokenValue {
148
- name: string
149
- values: Array<{ value: string; condition?: string }>
150
- description?: string
151
- deprecated?: boolean | string
152
- cssVar?: string
153
- }
154
-
155
- export interface ThemeTokenGroupDefinition extends Examples {
156
- type: string
157
- values: ThemeTokenValue[]
158
- tokenFunctionExamples: string[]
159
- }
160
-
161
- export interface ThemeSpecDefinition {
162
- name: string
163
- tokens: ThemeTokenGroupDefinition[]
164
- semanticTokens: ThemeTokenGroupDefinition[]
165
- }
166
-
167
- export interface ThemesSpec {
168
- type: 'themes'
169
- data: ThemeSpecDefinition[]
170
- }
171
-
172
- export type SpecFile =
173
- | TokenSpec
174
- | SemanticTokenSpec
175
- | RecipeSpec
176
- | PatternSpec
177
- | ConditionSpec
178
- | KeyframeSpec
179
- | TextStyleSpec
180
- | LayerStyleSpec
181
- | AnimationStyleSpec
182
- | ColorPaletteSpec
183
- | ThemesSpec
184
-
185
- export interface SpecTypeMap {
186
- tokens: TokenSpec
187
- 'semantic-tokens': SemanticTokenSpec
188
- recipes: RecipeSpec
189
- patterns: PatternSpec
190
- conditions: ConditionSpec
191
- keyframes: KeyframeSpec
192
- 'text-styles': TextStyleSpec
193
- 'layer-styles': LayerStyleSpec
194
- 'animation-styles': AnimationStyleSpec
195
- 'color-palette': ColorPaletteSpec
196
- themes: ThemesSpec
197
- }
@@ -1,41 +0,0 @@
1
- import type { ConditionDetails } 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 | number | boolean
13
- cond: string
14
- recipe?: string
15
- slot?: string
16
- layer?: string
17
- variants?: boolean
18
- }
19
-
20
- export interface AtomicStyleResult {
21
- result: StyleResultObject
22
- entry: StyleEntry
23
- hash: string
24
- className: string
25
- conditions?: ConditionDetails[]
26
- layer?: string
27
- }
28
-
29
- export interface GroupedResult extends Pick<AtomicStyleResult, 'result' | 'className'> {
30
- hashSet: Set<string>
31
- details: GroupedStyleResultDetails[]
32
- }
33
-
34
- export interface RecipeBaseResult extends GroupedResult {
35
- recipe: string
36
- slot?: string
37
- }
38
-
39
- export interface GroupedStyleResultDetails extends Pick<AtomicStyleResult, 'hash' | 'entry' | 'conditions'> {
40
- result: StyleResultObject
41
- }