@pandacss/studio 0.34.3 → 0.36.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.34.3",
3
+ "version": "0.36.0",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -48,12 +48,12 @@
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
50
  "vite": "5.1.3",
51
- "@pandacss/config": "0.34.3",
52
- "@pandacss/logger": "0.34.3",
53
- "@pandacss/shared": "0.34.3",
54
- "@pandacss/token-dictionary": "0.34.3",
55
- "@pandacss/types": "0.34.3",
56
- "@pandacss/astro-plugin-studio": "0.34.3"
51
+ "@pandacss/config": "0.36.0",
52
+ "@pandacss/logger": "0.36.0",
53
+ "@pandacss/shared": "0.36.0",
54
+ "@pandacss/token-dictionary": "0.36.0",
55
+ "@pandacss/types": "0.36.0",
56
+ "@pandacss/astro-plugin-studio": "0.36.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/react": "18.2.55",
@@ -4,7 +4,7 @@ import { ColorWrapper } from './color-wrapper'
4
4
  import * as context from '../lib/panda-context'
5
5
 
6
6
  const getSemanticColorValue = (variable: string): string => {
7
- const _name = variable.match(/var\(\s*--(.*?)\s*\)/)
7
+ const _name = variable?.match(/var\(\s*--(.*?)\s*\)/)
8
8
  if (!_name) return variable
9
9
 
10
10
  const name = _name[1].replaceAll('-', '.')
@@ -1,11 +1,14 @@
1
1
  import { getSlotRecipes, memo, splitProps } from '../helpers.mjs';
2
2
  import { cva } from './cva.mjs';
3
+ import { cx } from './cx.mjs';
4
+
5
+ const slotClass = (className, slot) => className + '__' + slot
3
6
 
4
7
  export function sva(config) {
5
8
  const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
6
9
 
7
10
  function svaFn(props) {
8
- const result = slots.map(([slot, cvaFn]) => [slot, cvaFn(props)])
11
+ const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))])
9
12
  return Object.fromEntries(result)
10
13
  }
11
14
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface BleedProperties {
9
- inline?: PropertyValue<'marginInline'>
10
- block?: PropertyValue<'marginBlock'>
9
+ inline?: SystemProperties["marginInline"]
10
+ block?: SystemProperties["marginBlock"]
11
11
  }
12
12
 
13
13
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,12 +1,12 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface CircleProperties {
9
- size?: PropertyValue<'width'>
9
+ size?: SystemProperties["width"]
10
10
  }
11
11
 
12
12
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface CqProperties {
9
9
  name?: ConditionalValue<Tokens["containerNames"] | Properties["containerName"]>
10
- type?: PropertyValue<'containerType'>
10
+ type?: SystemProperties["containerType"]
11
11
  }
12
12
 
13
13
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,18 +1,18 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface FlexProperties {
9
- align?: PropertyValue<'alignItems'>
10
- justify?: PropertyValue<'justifyContent'>
11
- direction?: PropertyValue<'flexDirection'>
12
- wrap?: PropertyValue<'flexWrap'>
13
- basis?: PropertyValue<'flexBasis'>
14
- grow?: PropertyValue<'flexGrow'>
15
- shrink?: PropertyValue<'flexShrink'>
9
+ align?: SystemProperties["alignItems"]
10
+ justify?: SystemProperties["justifyContent"]
11
+ direction?: SystemProperties["flexDirection"]
12
+ wrap?: SystemProperties["flexWrap"]
13
+ basis?: SystemProperties["flexBasis"]
14
+ grow?: SystemProperties["flexGrow"]
15
+ shrink?: SystemProperties["flexShrink"]
16
16
  }
17
17
 
18
18
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,14 +1,14 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface GridProperties {
9
- gap?: PropertyValue<'gap'>
10
- columnGap?: PropertyValue<'gap'>
11
- rowGap?: PropertyValue<'gap'>
9
+ gap?: SystemProperties["gap"]
10
+ columnGap?: SystemProperties["gap"]
11
+ rowGap?: SystemProperties["gap"]
12
12
  columns?: ConditionalValue<number>
13
13
  minChildWidth?: ConditionalValue<Tokens["sizes"] | Properties["width"]>
14
14
  }
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface HstackProperties {
9
- justify?: PropertyValue<'justifyContent'>
10
- gap?: PropertyValue<'gap'>
9
+ justify?: SystemProperties["justifyContent"]
10
+ gap?: SystemProperties["gap"]
11
11
  }
12
12
 
13
13
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,12 +1,12 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface SquareProperties {
9
- size?: PropertyValue<'width'>
9
+ size?: SystemProperties["width"]
10
10
  }
11
11
 
12
12
 
@@ -1,15 +1,15 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface StackProperties {
9
- align?: PropertyValue<'alignItems'>
10
- justify?: PropertyValue<'justifyContent'>
11
- direction?: PropertyValue<'flexDirection'>
12
- gap?: PropertyValue<'gap'>
9
+ align?: SystemProperties["alignItems"]
10
+ justify?: SystemProperties["justifyContent"]
11
+ direction?: SystemProperties["flexDirection"]
12
+ gap?: SystemProperties["gap"]
13
13
  }
14
14
 
15
15
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface VstackProperties {
9
- justify?: PropertyValue<'justifyContent'>
10
- gap?: PropertyValue<'gap'>
9
+ justify?: SystemProperties["justifyContent"]
10
+ gap?: SystemProperties["gap"]
11
11
  }
12
12
 
13
13
 
@@ -1,16 +1,16 @@
1
1
  /* eslint-disable */
2
2
  import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
3
  import type { Properties } from '../types/csstype';
4
- import type { PropertyValue } from '../types/prop-type';
4
+ import type { SystemProperties } from '../types/style-props';
5
5
  import type { DistributiveOmit } from '../types/system-types';
6
6
  import type { Tokens } from '../tokens/index';
7
7
 
8
8
  export interface WrapProperties {
9
- gap?: PropertyValue<'gap'>
10
- rowGap?: PropertyValue<'gap'>
11
- columnGap?: PropertyValue<'gap'>
12
- align?: PropertyValue<'alignItems'>
13
- justify?: PropertyValue<'justifyContent'>
9
+ gap?: SystemProperties["gap"]
10
+ rowGap?: SystemProperties["gap"]
11
+ columnGap?: SystemProperties["gap"]
12
+ align?: SystemProperties["alignItems"]
13
+ justify?: SystemProperties["justifyContent"]
14
14
  }
15
15
 
16
16
 
@@ -256,17 +256,13 @@ export interface Conditions {
256
256
  "base": string
257
257
  }
258
258
 
259
- export type Condition = keyof Conditions
260
-
261
- export type Conditional<V> =
259
+ export type ConditionalValue<V> =
262
260
  | V
263
261
  | Array<V | null>
264
262
  | {
265
- [K in keyof Conditions]?: Conditional<V>
263
+ [K in keyof Conditions]?: ConditionalValue<V>
266
264
  }
267
265
 
268
- export type ConditionalValue<T> = Conditional<T>
269
-
270
266
  export type Nested<P> = P & {
271
267
  [K in Selectors]?: Nested<P>
272
268
  } & {