@pandacss/studio 0.21.0 → 0.22.1

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.
Files changed (64) hide show
  1. package/astro.config.mjs +3 -9
  2. package/dist/studio.d.mts +1 -1
  3. package/dist/studio.d.ts +1 -1
  4. package/dist/studio.js +38 -2050
  5. package/dist/studio.mjs +42 -2080
  6. package/package.json +11 -14
  7. package/src/components/sizes.tsx +4 -3
  8. package/styled-system/helpers.mjs +3 -1
  9. package/styled-system/jsx/aspect-ratio.mjs +2 -5
  10. package/styled-system/jsx/bleed.mjs +2 -5
  11. package/styled-system/jsx/box.mjs +3 -7
  12. package/styled-system/jsx/center.mjs +2 -5
  13. package/styled-system/jsx/circle.mjs +2 -5
  14. package/styled-system/jsx/container.mjs +3 -7
  15. package/styled-system/jsx/divider.mjs +2 -5
  16. package/styled-system/jsx/factory.mjs +1 -2
  17. package/styled-system/jsx/flex.mjs +2 -5
  18. package/styled-system/jsx/float.mjs +2 -5
  19. package/styled-system/jsx/grid-item.mjs +2 -5
  20. package/styled-system/jsx/grid.mjs +2 -5
  21. package/styled-system/jsx/hstack.mjs +2 -5
  22. package/styled-system/jsx/index.d.ts +0 -3
  23. package/styled-system/jsx/link-box.mjs +3 -7
  24. package/styled-system/jsx/link-overlay.mjs +3 -7
  25. package/styled-system/jsx/spacer.mjs +2 -5
  26. package/styled-system/jsx/square.mjs +2 -5
  27. package/styled-system/jsx/stack.mjs +2 -5
  28. package/styled-system/jsx/styled-link.mjs +3 -7
  29. package/styled-system/jsx/visually-hidden.mjs +3 -7
  30. package/styled-system/jsx/vstack.mjs +2 -5
  31. package/styled-system/jsx/wrap.mjs +2 -5
  32. package/styled-system/styles.css +1277 -542
  33. package/styled-system/types/conditions.d.ts +1 -1
  34. package/styled-system/types/csstype.d.ts +1270 -721
  35. package/styled-system/types/recipe.d.ts +9 -0
  36. package/styled-system/types/static-css.d.ts +39 -0
  37. package/styled-system/chunks/src__components__color-constrast.css +0 -106
  38. package/styled-system/chunks/src__components__color-wrapper.css +0 -58
  39. package/styled-system/chunks/src__components__colors.css +0 -106
  40. package/styled-system/chunks/src__components__empty-state.css +0 -46
  41. package/styled-system/chunks/src__components__font-family.css +0 -86
  42. package/styled-system/chunks/src__components__font-tokens.css +0 -62
  43. package/styled-system/chunks/src__components__input.css +0 -58
  44. package/styled-system/chunks/src__components__layer-styles.css +0 -63
  45. package/styled-system/chunks/src__components__nav-item.css +0 -57
  46. package/styled-system/chunks/src__components__overview.css +0 -122
  47. package/styled-system/chunks/src__components__radii.css +0 -50
  48. package/styled-system/chunks/src__components__semantic-color.css +0 -70
  49. package/styled-system/chunks/src__components__side-nav-item.css +0 -30
  50. package/styled-system/chunks/src__components__side-nav.css +0 -50
  51. package/styled-system/chunks/src__components__sizes.css +0 -42
  52. package/styled-system/chunks/src__components__text-styles.css +0 -32
  53. package/styled-system/chunks/src__components__theme-toggle.css +0 -62
  54. package/styled-system/chunks/src__components__token-content.css +0 -14
  55. package/styled-system/chunks/src__components__token-group.css +0 -22
  56. package/styled-system/chunks/src__components__typography-playground.css +0 -62
  57. package/styled-system/chunks/src__layouts__Sidebar.css +0 -114
  58. package/styled-system/global.css +0 -58
  59. package/styled-system/reset.css +0 -214
  60. package/styled-system/static.css +0 -5
  61. package/styled-system/tokens/index.css +0 -437
  62. package/styled-system/tokens/keyframes.css +0 -28
  63. package/styled-system/types/helpers.d.ts +0 -2
  64. package/virtual-panda.ts +0 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -37,23 +37,20 @@
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
39
  "@astrojs/react": "2.3.2",
40
- "astro": "2.10.15",
41
- "javascript-stringify": "2.1.0",
40
+ "astro": "4.0.3",
42
41
  "react": "18.2.0",
43
42
  "react-dom": "18.2.0",
44
- "vite": "4.0.5",
45
- "@pandacss/config": "0.21.0",
46
- "@pandacss/logger": "0.21.0",
47
- "@pandacss/node": "0.21.0",
48
- "@pandacss/shared": "0.21.0",
49
- "@pandacss/token-dictionary": "0.21.0",
50
- "@pandacss/types": "0.21.0"
43
+ "vite": "5.0.7",
44
+ "@pandacss/config": "0.22.1",
45
+ "@pandacss/logger": "0.22.1",
46
+ "@pandacss/shared": "0.22.1",
47
+ "@pandacss/token-dictionary": "0.22.1",
48
+ "@pandacss/types": "0.22.1",
49
+ "@pandacss/astro-plugin-studio": "0.22.1"
51
50
  },
52
51
  "devDependencies": {
53
- "@types/react": "18.2.37",
54
- "@types/react-dom": "18.2.15",
55
- "@vitejs/plugin-react": "4.0.4",
56
- "execa": "7.2.0"
52
+ "@types/react": "18.2.42",
53
+ "@types/react-dom": "18.2.17"
57
54
  },
58
55
  "scripts": {
59
56
  "panda": "node ../cli/bin.js",
@@ -1,4 +1,5 @@
1
1
  import { toPx } from '@pandacss/shared'
2
+ import { Fragment } from 'react'
2
3
  import { Grid, panda } from '../../styled-system/jsx'
3
4
  import { getSortedSizes } from '../lib/sizes-sort'
4
5
  import { TokenGroup } from './token-group'
@@ -36,8 +37,8 @@ export function Sizes(props: SizesProps) {
36
37
  <panda.hr gridColumn="span 5 / span 5" />
37
38
  {sizes
38
39
  .sort((a, b) => a.extensions.prop - b.extensions.prop)
39
- .map((size) => (
40
- <>
40
+ .map((size, index) => (
41
+ <Fragment key={index}>
41
42
  <b>{size.extensions.prop}</b>
42
43
  <span>{size.value}</span>
43
44
  <span>{toPx(size.value as string)}</span>
@@ -47,7 +48,7 @@ export function Sizes(props: SizesProps) {
47
48
  gridColumn="span 2 / span 2"
48
49
  style={{ width: size.value }}
49
50
  />
50
- </>
51
+ </Fragment>
51
52
  ))}
52
53
  </Grid>
53
54
  </TokenGroup>
@@ -15,7 +15,7 @@ function filterBaseConditions(c) {
15
15
  }
16
16
 
17
17
  // src/css-important.ts
18
- var importantRegex = /!(important)?$/;
18
+ var importantRegex = /!(important)?/;
19
19
  function isImportant(value) {
20
20
  return typeof value === "string" ? importantRegex.test(value) : false;
21
21
  }
@@ -89,6 +89,8 @@ function walkObject(target, predicate, options = {}) {
89
89
  return inner(target);
90
90
  }
91
91
  function mapObject(obj, fn) {
92
+ if (Array.isArray(obj))
93
+ return obj.map((value) => fn(value));
92
94
  if (!isObject(obj))
93
95
  return fn(obj);
94
96
  return walkObject(obj, (value) => fn(value));
@@ -5,8 +5,5 @@ import { getAspectRatioStyle } from '../patterns/aspect-ratio.mjs';
5
5
  export const AspectRatio = /* @__PURE__ */ forwardRef(function AspectRatio(props, ref) {
6
6
  const { ratio, ...restProps } = props
7
7
  const styleProps = getAspectRatioStyle({ratio})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getBleedStyle } from '../patterns/bleed.mjs';
5
5
  export const Bleed = /* @__PURE__ */ forwardRef(function Bleed(props, ref) {
6
6
  const { inline, block, ...restProps } = props
7
7
  const styleProps = getBleedStyle({inline, block})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getBoxStyle } from '../patterns/box.mjs';
4
4
 
5
5
  export const Box = /* @__PURE__ */ forwardRef(function Box(props, ref) {
6
- const restProps = props
7
- const styleProps = getBoxStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
6
+ const styleProps = getBoxStyle()
7
+ return createElement(panda.div, { ref, ...styleProps, ...props })
8
+ })
@@ -5,8 +5,5 @@ import { getCenterStyle } from '../patterns/center.mjs';
5
5
  export const Center = /* @__PURE__ */ forwardRef(function Center(props, ref) {
6
6
  const { inline, ...restProps } = props
7
7
  const styleProps = getCenterStyle({inline})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getCircleStyle } from '../patterns/circle.mjs';
5
5
  export const Circle = /* @__PURE__ */ forwardRef(function Circle(props, ref) {
6
6
  const { size, ...restProps } = props
7
7
  const styleProps = getCircleStyle({size})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getContainerStyle } from '../patterns/container.mjs';
4
4
 
5
5
  export const Container = /* @__PURE__ */ forwardRef(function Container(props, ref) {
6
- const restProps = props
7
- const styleProps = getContainerStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
6
+ const styleProps = getContainerStyle()
7
+ return createElement(panda.div, { ref, ...styleProps, ...props })
8
+ })
@@ -5,8 +5,5 @@ import { getDividerStyle } from '../patterns/divider.mjs';
5
5
  export const Divider = /* @__PURE__ */ forwardRef(function Divider(props, ref) {
6
6
  const { orientation, thickness, color, ...restProps } = props
7
7
  const styleProps = getDividerStyle({orientation, thickness, color})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -46,9 +46,8 @@ function styledFn(Dynamic, configOrCva = {}, options = {}) {
46
46
  ...forwardedProps,
47
47
  ...elementProps,
48
48
  ...normalizeHTMLProps(htmlProps),
49
- children,
50
49
  className: classes(),
51
- })
50
+ }, combinedProps.children ?? children)
52
51
  })
53
52
 
54
53
  const name = getDisplayName(Dynamic)
@@ -5,8 +5,5 @@ import { getFlexStyle } from '../patterns/flex.mjs';
5
5
  export const Flex = /* @__PURE__ */ forwardRef(function Flex(props, ref) {
6
6
  const { align, justify, direction, wrap, basis, grow, shrink, ...restProps } = props
7
7
  const styleProps = getFlexStyle({align, justify, direction, wrap, basis, grow, shrink})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getFloatStyle } from '../patterns/float.mjs';
5
5
  export const Float = /* @__PURE__ */ forwardRef(function Float(props, ref) {
6
6
  const { offsetX, offsetY, offset, placement, ...restProps } = props
7
7
  const styleProps = getFloatStyle({offsetX, offsetY, offset, placement})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getGridItemStyle } from '../patterns/grid-item.mjs';
5
5
  export const GridItem = /* @__PURE__ */ forwardRef(function GridItem(props, ref) {
6
6
  const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...restProps } = props
7
7
  const styleProps = getGridItemStyle({colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getGridStyle } from '../patterns/grid.mjs';
5
5
  export const Grid = /* @__PURE__ */ forwardRef(function Grid(props, ref) {
6
6
  const { gap, columnGap, rowGap, columns, minChildWidth, ...restProps } = props
7
7
  const styleProps = getGridStyle({gap, columnGap, rowGap, columns, minChildWidth})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getHstackStyle } from '../patterns/hstack.mjs';
5
5
  export const HStack = /* @__PURE__ */ forwardRef(function HStack(props, ref) {
6
6
  const { justify, gap, ...restProps } = props
7
7
  const styleProps = getHstackStyle({justify, gap})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -1,8 +1,6 @@
1
1
  /* eslint-disable */
2
2
  export * from './factory';
3
-
4
3
  export * from './is-valid-prop';
5
-
6
4
  export * from './box';
7
5
  export * from './flex';
8
6
  export * from './stack';
@@ -24,5 +22,4 @@ export * from './float';
24
22
  export * from './bleed';
25
23
  export * from './visually-hidden';
26
24
  export * from './styled-link';
27
-
28
25
  export type { HTMLPandaProps, PandaComponent } from '../types/jsx';
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getLinkBoxStyle } from '../patterns/link-box.mjs';
4
4
 
5
5
  export const LinkBox = /* @__PURE__ */ forwardRef(function LinkBox(props, ref) {
6
- const restProps = props
7
- const styleProps = getLinkBoxStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
6
+ const styleProps = getLinkBoxStyle()
7
+ return createElement(panda.div, { ref, ...styleProps, ...props })
8
+ })
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getLinkOverlayStyle } from '../patterns/link-overlay.mjs';
4
4
 
5
5
  export const LinkOverlay = /* @__PURE__ */ forwardRef(function LinkOverlay(props, ref) {
6
- const restProps = props
7
- const styleProps = getLinkOverlayStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.a, mergedProps)
12
- })
6
+ const styleProps = getLinkOverlayStyle()
7
+ return createElement(panda.a, { ref, ...styleProps, ...props })
8
+ })
@@ -5,8 +5,5 @@ import { getSpacerStyle } from '../patterns/spacer.mjs';
5
5
  export const Spacer = /* @__PURE__ */ forwardRef(function Spacer(props, ref) {
6
6
  const { size, ...restProps } = props
7
7
  const styleProps = getSpacerStyle({size})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getSquareStyle } from '../patterns/square.mjs';
5
5
  export const Square = /* @__PURE__ */ forwardRef(function Square(props, ref) {
6
6
  const { size, ...restProps } = props
7
7
  const styleProps = getSquareStyle({size})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getStackStyle } from '../patterns/stack.mjs';
5
5
  export const Stack = /* @__PURE__ */ forwardRef(function Stack(props, ref) {
6
6
  const { align, justify, direction, gap, ...restProps } = props
7
7
  const styleProps = getStackStyle({align, justify, direction, gap})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getStyledLinkStyle } from '../patterns/styled-link.mjs';
4
4
 
5
5
  export const StyledLink = /* @__PURE__ */ forwardRef(function StyledLink(props, ref) {
6
- const restProps = props
7
- const styleProps = getStyledLinkStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
6
+ const styleProps = getStyledLinkStyle()
7
+ return createElement(panda.div, { ref, ...styleProps, ...props })
8
+ })
@@ -3,10 +3,6 @@ import { panda } from './factory.mjs';
3
3
  import { getVisuallyHiddenStyle } from '../patterns/visually-hidden.mjs';
4
4
 
5
5
  export const VisuallyHidden = /* @__PURE__ */ forwardRef(function VisuallyHidden(props, ref) {
6
- const restProps = props
7
- const styleProps = getVisuallyHiddenStyle()
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
6
+ const styleProps = getVisuallyHiddenStyle()
7
+ return createElement(panda.div, { ref, ...styleProps, ...props })
8
+ })
@@ -5,8 +5,5 @@ import { getVstackStyle } from '../patterns/vstack.mjs';
5
5
  export const VStack = /* @__PURE__ */ forwardRef(function VStack(props, ref) {
6
6
  const { justify, gap, ...restProps } = props
7
7
  const styleProps = getVstackStyle({justify, gap})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })
@@ -5,8 +5,5 @@ import { getWrapStyle } from '../patterns/wrap.mjs';
5
5
  export const Wrap = /* @__PURE__ */ forwardRef(function Wrap(props, ref) {
6
6
  const { gap, rowGap, columnGap, align, justify, ...restProps } = props
7
7
  const styleProps = getWrapStyle({gap, rowGap, columnGap, align, justify})
8
- const cssProps = styleProps
9
- const mergedProps = { ref, ...cssProps, ...restProps }
10
-
11
- return createElement(panda.div, mergedProps)
12
- })
8
+ return createElement(panda.div, { ref, ...styleProps, ...restProps })
9
+ })