@pandacss/studio 0.12.1 → 0.12.2
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 +8 -8
- package/styled-system/css/css.d.ts +1 -1
- package/styled-system/css/css.mjs +1 -6
- package/styled-system/css/cva.mjs +2 -2
- package/styled-system/css/cx.mjs +4 -15
- package/styled-system/css/sva.mjs +12 -5
- package/styled-system/jsx/factory.mjs +1 -1
- package/styled-system/patterns/aspect-ratio.d.ts +1 -1
- package/styled-system/patterns/aspect-ratio.mjs +1 -1
- package/styled-system/patterns/bleed.d.ts +1 -1
- package/styled-system/patterns/bleed.mjs +1 -1
- package/styled-system/patterns/box.d.ts +1 -1
- package/styled-system/patterns/box.mjs +1 -1
- package/styled-system/patterns/center.d.ts +1 -1
- package/styled-system/patterns/center.mjs +1 -1
- package/styled-system/patterns/circle.d.ts +1 -1
- package/styled-system/patterns/circle.mjs +1 -1
- package/styled-system/patterns/container.d.ts +1 -1
- package/styled-system/patterns/container.mjs +1 -1
- package/styled-system/patterns/divider.d.ts +1 -1
- package/styled-system/patterns/divider.mjs +1 -1
- package/styled-system/patterns/flex.d.ts +1 -1
- package/styled-system/patterns/flex.mjs +1 -1
- package/styled-system/patterns/float.d.ts +1 -1
- package/styled-system/patterns/float.mjs +1 -1
- package/styled-system/patterns/grid-item.d.ts +1 -1
- package/styled-system/patterns/grid-item.mjs +1 -1
- package/styled-system/patterns/grid.d.ts +1 -1
- package/styled-system/patterns/grid.mjs +1 -1
- package/styled-system/patterns/hstack.d.ts +1 -1
- package/styled-system/patterns/hstack.mjs +1 -1
- package/styled-system/patterns/link-box.d.ts +1 -1
- package/styled-system/patterns/link-box.mjs +1 -1
- package/styled-system/patterns/link-overlay.d.ts +1 -1
- package/styled-system/patterns/link-overlay.mjs +1 -1
- package/styled-system/patterns/spacer.d.ts +1 -1
- package/styled-system/patterns/spacer.mjs +1 -1
- package/styled-system/patterns/square.d.ts +1 -1
- package/styled-system/patterns/square.mjs +1 -1
- package/styled-system/patterns/stack.d.ts +1 -1
- package/styled-system/patterns/stack.mjs +1 -1
- package/styled-system/patterns/styled-link.d.ts +1 -1
- package/styled-system/patterns/styled-link.mjs +1 -1
- package/styled-system/patterns/visually-hidden.d.ts +1 -1
- package/styled-system/patterns/visually-hidden.mjs +1 -1
- package/styled-system/patterns/vstack.d.ts +1 -1
- package/styled-system/patterns/vstack.mjs +1 -1
- package/styled-system/patterns/wrap.d.ts +1 -1
- package/styled-system/patterns/wrap.mjs +1 -1
- package/styled-system/types/recipe.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/studio",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "The automated token documentation for Panda CSS",
|
|
5
5
|
"main": "dist/studio.js",
|
|
6
6
|
"module": "dist/studio.mjs",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"react": "18.2.0",
|
|
34
34
|
"react-dom": "18.2.0",
|
|
35
35
|
"vite": "4.4.9",
|
|
36
|
-
"@pandacss/types": "0.12.
|
|
37
|
-
"@pandacss/config": "0.12.
|
|
38
|
-
"@pandacss/shared": "0.12.
|
|
39
|
-
"@pandacss/token-dictionary": "0.12.
|
|
40
|
-
"@pandacss/logger": "0.12.
|
|
41
|
-
"@pandacss/node": "0.12.
|
|
36
|
+
"@pandacss/types": "0.12.2",
|
|
37
|
+
"@pandacss/config": "0.12.2",
|
|
38
|
+
"@pandacss/shared": "0.12.2",
|
|
39
|
+
"@pandacss/token-dictionary": "0.12.2",
|
|
40
|
+
"@pandacss/logger": "0.12.2",
|
|
41
|
+
"@pandacss/node": "0.12.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "18.2.18",
|
|
45
45
|
"@types/react-dom": "18.2.7",
|
|
46
46
|
"@vitejs/plugin-react": "4.0.4",
|
|
47
47
|
"execa": "7.2.0",
|
|
48
|
-
"@pandacss/dev": "0.12.
|
|
48
|
+
"@pandacss/dev": "0.12.2"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"codegen": "panda",
|
|
@@ -37,12 +37,7 @@ const context = {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const cssFn = createCss(context)
|
|
40
|
-
export const
|
|
41
|
-
export const css = (styles) => {
|
|
42
|
-
const classNames = cssFn(styles)
|
|
43
|
-
cssCache.set(classNames, styles)
|
|
44
|
-
return classNames
|
|
45
|
-
}
|
|
40
|
+
export const css = (...styles) => cssFn(mergeCss(...styles))
|
|
46
41
|
css.raw = (styles) => styles
|
|
47
42
|
|
|
48
43
|
export const { mergeCss, assignCss } = createMergeCss(context)
|
|
@@ -4,7 +4,7 @@ import { css, mergeCss } from './css.mjs'
|
|
|
4
4
|
export function cva(config) {
|
|
5
5
|
const { base = {}, variants = {}, defaultVariants = {}, compoundVariants = [] } = config
|
|
6
6
|
|
|
7
|
-
function resolve(props) {
|
|
7
|
+
function resolve(props = {}) {
|
|
8
8
|
const computedVariants = { ...defaultVariants, ...compact(props) }
|
|
9
9
|
let variantCss = { ...base }
|
|
10
10
|
for (const [key, value] of Object.entries(computedVariants)) {
|
|
@@ -32,7 +32,7 @@ export function cva(config) {
|
|
|
32
32
|
__cva__: true,
|
|
33
33
|
variantMap,
|
|
34
34
|
variantKeys,
|
|
35
|
-
resolve,
|
|
35
|
+
raw: resolve,
|
|
36
36
|
config,
|
|
37
37
|
splitVariantProps,
|
|
38
38
|
})
|
package/styled-system/css/cx.mjs
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
import { cssCache, css, mergeCss } from './css.mjs'
|
|
2
|
-
|
|
3
1
|
function cx() {
|
|
4
|
-
const objs = []
|
|
5
2
|
let str = '',
|
|
6
3
|
i = 0,
|
|
7
4
|
arg
|
|
8
5
|
|
|
9
6
|
for (; i < arguments.length; ) {
|
|
10
|
-
arg = arguments[i++]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (cssCache.has(arg)) {
|
|
14
|
-
objs.push(cssCache.get(arg))
|
|
15
|
-
continue
|
|
7
|
+
if ((arg = arguments[i++]) && typeof arg === 'string') {
|
|
8
|
+
str && (str += ' ')
|
|
9
|
+
str += arg
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
str && (str += ' ')
|
|
19
|
-
str += arg.toString()
|
|
20
11
|
}
|
|
21
|
-
|
|
22
|
-
const merged = mergeCss(...objs)
|
|
23
|
-
return [css(merged), str].join(' ')
|
|
12
|
+
return str
|
|
24
13
|
}
|
|
25
14
|
|
|
26
15
|
export { cx }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSlotRecipes } from '../helpers.mjs'
|
|
1
|
+
import { getSlotRecipes, splitProps } from '../helpers.mjs'
|
|
2
2
|
import { cva } from './cva.mjs'
|
|
3
3
|
|
|
4
4
|
export function sva(config) {
|
|
@@ -9,12 +9,19 @@ export function sva(config) {
|
|
|
9
9
|
return Object.fromEntries(result)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const variants = config.variants ?? {}
|
|
13
|
+
const variantKeys = Object.keys(variants)
|
|
14
|
+
|
|
15
|
+
function splitVariantProps(props) {
|
|
16
|
+
return splitProps(props, variantKeys)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
|
|
13
20
|
|
|
14
21
|
return Object.assign(svaFn, {
|
|
15
22
|
__cva__: false,
|
|
16
|
-
variantMap
|
|
17
|
-
variantKeys
|
|
18
|
-
splitVariantProps
|
|
23
|
+
variantMap,
|
|
24
|
+
variantKeys,
|
|
25
|
+
splitVariantProps,
|
|
19
26
|
})
|
|
20
27
|
}
|
|
@@ -21,7 +21,7 @@ function styledFn(Dynamic, configOrCva = {}) {
|
|
|
21
21
|
|
|
22
22
|
function cvaClass() {
|
|
23
23
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
24
|
-
const cvaStyles = cvaFn.
|
|
24
|
+
const cvaStyles = cvaFn.raw(variantProps)
|
|
25
25
|
const styles = assignCss(cvaStyles, propStyles, cssStyles)
|
|
26
26
|
return cx(css(styles), elementProps.className)
|
|
27
27
|
}
|
|
@@ -14,7 +14,7 @@ type AspectRatioStyles = AspectRatioProperties & DistributiveOmit<SystemStyleObj
|
|
|
14
14
|
|
|
15
15
|
interface AspectRatioPatternFn {
|
|
16
16
|
(styles?: AspectRatioStyles): string
|
|
17
|
-
raw: (styles: AspectRatioStyles) =>
|
|
17
|
+
raw: (styles: AspectRatioStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -33,4 +33,4 @@ const aspectRatioConfig = {
|
|
|
33
33
|
export const getAspectRatioStyle = (styles = {}) => aspectRatioConfig.transform(styles, { map: mapObject })
|
|
34
34
|
|
|
35
35
|
export const aspectRatio = (styles) => css(getAspectRatioStyle(styles))
|
|
36
|
-
aspectRatio.raw =
|
|
36
|
+
aspectRatio.raw = getAspectRatioStyle
|
|
@@ -14,7 +14,7 @@ type ContainerStyles = ContainerProperties & DistributiveOmit<SystemStyleObject,
|
|
|
14
14
|
|
|
15
15
|
interface ContainerPatternFn {
|
|
16
16
|
(styles?: ContainerStyles): string
|
|
17
|
-
raw: (styles: ContainerStyles) =>
|
|
17
|
+
raw: (styles: ContainerStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -16,4 +16,4 @@ const containerConfig = {
|
|
|
16
16
|
export const getContainerStyle = (styles = {}) => containerConfig.transform(styles, { map: mapObject })
|
|
17
17
|
|
|
18
18
|
export const container = (styles) => css(getContainerStyle(styles))
|
|
19
|
-
container.raw =
|
|
19
|
+
container.raw = getContainerStyle
|
|
@@ -16,7 +16,7 @@ type DividerStyles = DividerProperties & DistributiveOmit<SystemStyleObject, key
|
|
|
16
16
|
|
|
17
17
|
interface DividerPatternFn {
|
|
18
18
|
(styles?: DividerStyles): string
|
|
19
|
-
raw: (styles: DividerStyles) =>
|
|
19
|
+
raw: (styles: DividerStyles) => SystemStyleObject
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
|
|
@@ -19,7 +19,7 @@ type GridItemStyles = GridItemProperties & DistributiveOmit<SystemStyleObject, k
|
|
|
19
19
|
|
|
20
20
|
interface GridItemPatternFn {
|
|
21
21
|
(styles?: GridItemStyles): string
|
|
22
|
-
raw: (styles: GridItemStyles) =>
|
|
22
|
+
raw: (styles: GridItemStyles) => SystemStyleObject
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
@@ -20,4 +20,4 @@ const gridItemConfig = {
|
|
|
20
20
|
export const getGridItemStyle = (styles = {}) => gridItemConfig.transform(styles, { map: mapObject })
|
|
21
21
|
|
|
22
22
|
export const gridItem = (styles) => css(getGridItemStyle(styles))
|
|
23
|
-
gridItem.raw =
|
|
23
|
+
gridItem.raw = getGridItemStyle
|
|
@@ -14,7 +14,7 @@ type LinkBoxStyles = LinkBoxProperties & DistributiveOmit<SystemStyleObject, key
|
|
|
14
14
|
|
|
15
15
|
interface LinkBoxPatternFn {
|
|
16
16
|
(styles?: LinkBoxStyles): string
|
|
17
|
-
raw: (styles: LinkBoxStyles) =>
|
|
17
|
+
raw: (styles: LinkBoxStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ type LinkOverlayStyles = LinkOverlayProperties & DistributiveOmit<SystemStyleObj
|
|
|
14
14
|
|
|
15
15
|
interface LinkOverlayPatternFn {
|
|
16
16
|
(styles?: LinkOverlayStyles): string
|
|
17
|
-
raw: (styles: LinkOverlayStyles) =>
|
|
17
|
+
raw: (styles: LinkOverlayStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -22,4 +22,4 @@ const linkOverlayConfig = {
|
|
|
22
22
|
export const getLinkOverlayStyle = (styles = {}) => linkOverlayConfig.transform(styles, { map: mapObject })
|
|
23
23
|
|
|
24
24
|
export const linkOverlay = (styles) => css(getLinkOverlayStyle(styles))
|
|
25
|
-
linkOverlay.raw =
|
|
25
|
+
linkOverlay.raw = getLinkOverlayStyle
|
|
@@ -14,7 +14,7 @@ type StyledLinkStyles = StyledLinkProperties & DistributiveOmit<SystemStyleObjec
|
|
|
14
14
|
|
|
15
15
|
interface StyledLinkPatternFn {
|
|
16
16
|
(styles?: StyledLinkStyles): string
|
|
17
|
-
raw: (styles: StyledLinkStyles) =>
|
|
17
|
+
raw: (styles: StyledLinkStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -16,4 +16,4 @@ const styledLinkConfig = {
|
|
|
16
16
|
export const getStyledLinkStyle = (styles = {}) => styledLinkConfig.transform(styles, { map: mapObject })
|
|
17
17
|
|
|
18
18
|
export const styledLink = (styles) => css(getStyledLinkStyle(styles))
|
|
19
|
-
styledLink.raw =
|
|
19
|
+
styledLink.raw = getStyledLinkStyle
|
|
@@ -14,7 +14,7 @@ type VisuallyHiddenStyles = VisuallyHiddenProperties & DistributiveOmit<SystemSt
|
|
|
14
14
|
|
|
15
15
|
interface VisuallyHiddenPatternFn {
|
|
16
16
|
(styles?: VisuallyHiddenStyles): string
|
|
17
|
-
raw: (styles: VisuallyHiddenStyles) =>
|
|
17
|
+
raw: (styles: VisuallyHiddenStyles) => SystemStyleObject
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
@@ -13,4 +13,4 @@ const visuallyHiddenConfig = {
|
|
|
13
13
|
export const getVisuallyHiddenStyle = (styles = {}) => visuallyHiddenConfig.transform(styles, { map: mapObject })
|
|
14
14
|
|
|
15
15
|
export const visuallyHidden = (styles) => css(getVisuallyHiddenStyle(styles))
|
|
16
|
-
visuallyHidden.raw =
|
|
16
|
+
visuallyHidden.raw = getVisuallyHiddenStyle
|
|
@@ -31,7 +31,7 @@ export type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T>
|
|
|
31
31
|
__type: RecipeSelection<T>
|
|
32
32
|
variantKeys: (keyof T)[]
|
|
33
33
|
variantMap: RecipeVariantMap<T>
|
|
34
|
-
|
|
34
|
+
raw: (props?: RecipeSelection<T>) => SystemStyleObject
|
|
35
35
|
config: RecipeConfig<T>
|
|
36
36
|
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
37
37
|
props: Props,
|