@pandacss/studio 1.3.0 → 1.4.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": "1.3.0",
3
+ "version": "1.4.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": "19.1.1",
49
49
  "react-dom": "19.1.1",
50
50
  "vite": "7.0.6",
51
- "@pandacss/config": "1.3.0",
52
- "@pandacss/logger": "1.3.0",
53
- "@pandacss/shared": "1.3.0",
54
- "@pandacss/token-dictionary": "1.3.0",
55
- "@pandacss/types": "1.3.0",
56
- "@pandacss/astro-plugin-studio": "1.3.0"
51
+ "@pandacss/config": "1.4.0",
52
+ "@pandacss/logger": "1.4.0",
53
+ "@pandacss/shared": "1.4.0",
54
+ "@pandacss/token-dictionary": "1.4.0",
55
+ "@pandacss/types": "1.4.0",
56
+ "@pandacss/astro-plugin-studio": "1.4.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/react": "18.2.55",
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable */
2
2
  import type { SlotRecipeRuntimeFn, RecipeVariantProps } from '../types/recipe';
3
3
  import type { JsxHTMLProps, JsxStyleProps, Assign } from '../types/system-types';
4
- import type { JsxFactoryOptions } from '../types/jsx';
5
- import type { ComponentType, ElementType, ComponentPropsWithoutRef, ElementRef, Ref } from 'react'
4
+ import type { JsxFactoryOptions, ComponentProps } from '../types/jsx';
5
+ import type { ComponentType, ElementType } from 'react'
6
6
 
7
7
  interface UnstyledProps {
8
- unstyled?: boolean
8
+ unstyled?: boolean | undefined
9
9
  }
10
10
 
11
11
  type SvaFn<S extends string = any> = SlotRecipeRuntimeFn<S, any>
@@ -18,29 +18,36 @@ type SlotRecipe = SvaFn | SlotRecipeFn
18
18
 
19
19
  type InferSlot<R extends SlotRecipe> = R extends SlotRecipeFn ? R['__slot'] : R extends SvaFn<infer S> ? S : never
20
20
 
21
- type ComponentProps<T extends ElementType> = Omit<ComponentPropsWithoutRef<T>, 'ref'> & {
22
- ref?: Ref<ElementRef<T>>
21
+ interface WithProviderOptions<P = {}> {
22
+ defaultProps?: Partial<P> | undefined
23
23
  }
24
24
 
25
25
  type StyleContextProvider<T extends ElementType, R extends SlotRecipe> = ComponentType<
26
26
  JsxHTMLProps<ComponentProps<T> & UnstyledProps, Assign<RecipeVariantProps<R>, JsxStyleProps>>
27
27
  >
28
28
 
29
+ type StyleContextRootProvider<T extends ElementType, R extends SlotRecipe> = ComponentType<
30
+ ComponentProps<T> & UnstyledProps & RecipeVariantProps<R>
31
+ >
32
+
29
33
  type StyleContextConsumer<T extends ElementType> = ComponentType<
30
34
  JsxHTMLProps<ComponentProps<T> & UnstyledProps, JsxStyleProps>
31
35
  >
32
36
 
33
37
  export interface StyleContext<R extends SlotRecipe> {
34
- withRootProvider: <T extends ElementType>(Component: T) => StyleContextProvider<T, R>
38
+ withRootProvider: <T extends ElementType>(
39
+ Component: T,
40
+ options?: WithProviderOptions<ComponentProps<T>> | undefined
41
+ ) => StyleContextRootProvider<T, R>
35
42
  withProvider: <T extends ElementType>(
36
43
  Component: T,
37
44
  slot: InferSlot<R>,
38
- options?: JsxFactoryOptions<ComponentProps<T>>
45
+ options?: JsxFactoryOptions<ComponentProps<T>> | undefined
39
46
  ) => StyleContextProvider<T, R>
40
47
  withContext: <T extends ElementType>(
41
48
  Component: T,
42
49
  slot: InferSlot<R>,
43
- options?: JsxFactoryOptions<ComponentProps<T>>
50
+ options?: JsxFactoryOptions<ComponentProps<T>> | undefined
44
51
  ) => StyleContextConsumer<T>
45
52
  }
46
53
 
@@ -19,16 +19,20 @@ export function createStyleContext(recipe) {
19
19
  return { ...slotStyles, ...restProps }
20
20
  }
21
21
 
22
- const withRootProvider = (Component) => {
22
+ const withRootProvider = (Component, options) => {
23
23
  const WithRootProvider = (props) => {
24
24
  const [variantProps, otherProps] = svaFn.splitVariantProps(props)
25
25
 
26
26
  const slotStyles = isConfigRecipe ? svaFn(variantProps) : svaFn.raw(variantProps)
27
27
  slotStyles._classNameMap = svaFn.classNameMap
28
28
 
29
+ const mergedProps = options?.defaultProps
30
+ ? { ...options.defaultProps, ...otherProps }
31
+ : otherProps
32
+
29
33
  return createElement(StyleContext.Provider, {
30
34
  value: slotStyles,
31
- children: createElement(Component, otherProps)
35
+ children: createElement(Component, mergedProps)
32
36
  })
33
37
  }
34
38
 
@@ -15,7 +15,7 @@ transform(props, { map, isCssUnit }) {
15
15
  };
16
16
  },
17
17
  defaultValues(props) {
18
- return { gap: props.columnGap || props.rowGap ? void 0 : "10px" };
18
+ return { gap: props.columnGap || props.rowGap ? void 0 : "8px" };
19
19
  }}
20
20
 
21
21
  export const getGridStyle = (styles = {}) => {
@@ -13,7 +13,7 @@ transform(props) {
13
13
  ...rest
14
14
  };
15
15
  },
16
- defaultValues:{gap:'10px'}}
16
+ defaultValues:{gap:'8px'}}
17
17
 
18
18
  export const getHstackStyle = (styles = {}) => {
19
19
  const _styles = getPatternStyles(hstackConfig, styles)
@@ -13,7 +13,7 @@ transform(props) {
13
13
  ...rest
14
14
  };
15
15
  },
16
- defaultValues:{direction:'column',gap:'10px'}}
16
+ defaultValues:{direction:'column',gap:'8px'}}
17
17
 
18
18
  export const getStackStyle = (styles = {}) => {
19
19
  const _styles = getPatternStyles(stackConfig, styles)
@@ -13,7 +13,7 @@ transform(props) {
13
13
  ...rest
14
14
  };
15
15
  },
16
- defaultValues:{gap:'10px'}}
16
+ defaultValues:{gap:'8px'}}
17
17
 
18
18
  export const getVstackStyle = (styles = {}) => {
19
19
  const _styles = getPatternStyles(vstackConfig, styles)
@@ -3,7 +3,7 @@ import { css } from '../css/index.mjs';
3
3
 
4
4
  const wrapConfig = {
5
5
  transform(props) {
6
- const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props;
6
+ const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "8px", align, justify, ...rest } = props;
7
7
  return {
8
8
  display: "flex",
9
9
  flexWrap: "wrap",
@@ -355,6 +355,7 @@
355
355
  --spacing-2\.5: 0.625rem;
356
356
  --spacing-3\.5: 0.875rem;
357
357
  --spacing-4\.5: 1.125rem;
358
+ --spacing-5\.5: 1.375rem;
358
359
  --sizes-0: 0rem;
359
360
  --sizes-1: 0.25rem;
360
361
  --sizes-2: 0.5rem;
@@ -390,6 +391,7 @@
390
391
  --sizes-2\.5: 0.625rem;
391
392
  --sizes-3\.5: 0.875rem;
392
393
  --sizes-4\.5: 1.125rem;
394
+ --sizes-5\.5: 1.375rem;
393
395
  --sizes-xs: 20rem;
394
396
  --sizes-sm: 24rem;
395
397
  --sizes-md: 28rem;
@@ -742,8 +744,8 @@
742
744
  background: var(--colors-neutral-800);
743
745
  }
744
746
 
745
- .gap_10px {
746
- gap: 10px;
747
+ .gap_8px {
748
+ gap: 8px;
747
749
  }
748
750
 
749
751
  .flex_1 {
@@ -471,6 +471,10 @@ const tokens = {
471
471
  "value": "1.125rem",
472
472
  "variable": "var(--spacing-4\\.5)"
473
473
  },
474
+ "spacing.5.5": {
475
+ "value": "1.375rem",
476
+ "variable": "var(--spacing-5\\.5)"
477
+ },
474
478
  "sizes.0": {
475
479
  "value": "0rem",
476
480
  "variable": "var(--sizes-0)"
@@ -611,6 +615,10 @@ const tokens = {
611
615
  "value": "1.125rem",
612
616
  "variable": "var(--sizes-4\\.5)"
613
617
  },
618
+ "sizes.5.5": {
619
+ "value": "1.375rem",
620
+ "variable": "var(--sizes-5\\.5)"
621
+ },
614
622
  "sizes.xs": {
615
623
  "value": "20rem",
616
624
  "variable": "var(--sizes-xs)"
@@ -1883,6 +1891,10 @@ const tokens = {
1883
1891
  "value": "calc(var(--spacing-4\\.5) * -1)",
1884
1892
  "variable": "var(--spacing-4\\.5)"
1885
1893
  },
1894
+ "spacing.-5.5": {
1895
+ "value": "calc(var(--spacing-5\\.5) * -1)",
1896
+ "variable": "var(--spacing-5\\.5)"
1897
+ },
1886
1898
  "colors.colorPalette": {
1887
1899
  "value": "var(--colors-color-palette)",
1888
1900
  "variable": "var(--colors-color-palette)"
@@ -27,9 +27,9 @@ export type ShadowToken = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "in
27
27
 
28
28
  export type BlurToken = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl"
29
29
 
30
- export type SpacingToken = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9" | "-10" | "-11" | "-12" | "-14" | "-16" | "-20" | "-24" | "-28" | "-32" | "-36" | "-40" | "-44" | "-48" | "-52" | "-56" | "-60" | "-64" | "-72" | "-80" | "-96" | "-0.5" | "-1.5" | "-2.5" | "-3.5" | "-4.5"
30
+ export type SpacingToken = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9" | "-10" | "-11" | "-12" | "-14" | "-16" | "-20" | "-24" | "-28" | "-32" | "-36" | "-40" | "-44" | "-48" | "-52" | "-56" | "-60" | "-64" | "-72" | "-80" | "-96" | "-0.5" | "-1.5" | "-2.5" | "-3.5" | "-4.5" | "-5.5"
31
31
 
32
- export type SizeToken = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "prose" | "full" | "min" | "max" | "fit" | "breakpoint-sm" | "breakpoint-md" | "breakpoint-lg" | "breakpoint-xl" | "breakpoint-2xl"
32
+ export type SizeToken = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "prose" | "full" | "min" | "max" | "fit" | "breakpoint-sm" | "breakpoint-md" | "breakpoint-lg" | "breakpoint-xl" | "breakpoint-2xl"
33
33
 
34
34
  export type AnimationToken = "spin" | "ping" | "pulse" | "bounce"
35
35
 
@@ -46,7 +46,7 @@ export interface Conditions {
46
46
  "_firstLetter": string
47
47
  /** `&::first-line` */
48
48
  "_firstLine": string
49
- /** `&:is(::marker, ::-webkit-details-marker)` */
49
+ /** `&::marker, &::-webkit-details-marker` */
50
50
  "_marker": string
51
51
  /** `&::selection` */
52
52
  "_selection": string
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- import type { ComponentPropsWithoutRef, ElementType, ElementRef, JSX, Ref } from 'react'
2
+ import type { ElementType, JSX, ComponentPropsWithRef, ComponentType, Component } from 'react'
3
3
  import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe';
4
4
  import type { Assign, DistributiveOmit, DistributiveUnion, JsxHTMLProps, JsxStyleProps, Pretty } from './system-types';
5
5
 
@@ -21,9 +21,9 @@ export interface AsProps {
21
21
  as?: ElementType | undefined
22
22
  }
23
23
 
24
- export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
25
- ref?: Ref<ElementRef<T>>
26
- }
24
+ export type ComponentProps<T extends ElementType> = T extends ComponentType<infer P> | Component<infer P>
25
+ ? JSX.LibraryManagedAttributes<T, P>
26
+ : ComponentPropsWithRef<T>
27
27
 
28
28
  export interface PandaComponent<T extends ElementType, P extends Dict = {}> {
29
29
  (props: JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<JsxStyleProps, P>>): JSX.Element
@@ -34,7 +34,7 @@ interface RecipeFn {
34
34
  __type: any
35
35
  }
36
36
 
37
- interface JsxFactoryOptions<TProps extends Dict> {
37
+ export interface JsxFactoryOptions<TProps extends Dict> {
38
38
  dataAttr?: boolean
39
39
  defaultProps?: Partial<TProps>
40
40
  shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean