@pandacss/generator 0.0.0-dev-20240206121257 → 0.0.0-dev-20240207210058
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/index.js +62 -42
- package/dist/index.mjs +62 -42
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1903,63 +1903,88 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1903
1903
|
const { componentName, factoryName } = ctx.jsx;
|
|
1904
1904
|
return {
|
|
1905
1905
|
js: import_outdent29.outdent`
|
|
1906
|
-
import { Dynamic } from 'solid-js/web'
|
|
1907
1906
|
import { createMemo, mergeProps, splitProps } from 'solid-js'
|
|
1908
|
-
import { createComponent } from 'solid-js/web'
|
|
1907
|
+
import { Dynamic, createComponent } from 'solid-js/web'
|
|
1908
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1909
|
+
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
1909
1910
|
${ctx.file.import(
|
|
1910
|
-
"
|
|
1911
|
+
"composeCvaFn, composeShouldForwardProps, defaultShouldForwardProp, getDisplayName",
|
|
1911
1912
|
"./factory-helper"
|
|
1912
1913
|
)}
|
|
1913
1914
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1914
|
-
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1915
|
-
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
1916
1915
|
|
|
1917
1916
|
function styledFn(element, configOrCva = {}, options = {}) {
|
|
1918
|
-
const cvaFn =
|
|
1917
|
+
const cvaFn =
|
|
1918
|
+
configOrCva.__cva__ || configOrCva.__recipe__
|
|
1919
|
+
? configOrCva
|
|
1920
|
+
: cva(configOrCva)
|
|
1919
1921
|
|
|
1920
1922
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1921
1923
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1922
1924
|
|
|
1923
1925
|
const defaultProps = Object.assign(
|
|
1924
|
-
options.dataAttr && configOrCva.__name__
|
|
1925
|
-
|
|
1926
|
+
options.dataAttr && configOrCva.__name__
|
|
1927
|
+
? { 'data-recipe': configOrCva.__name__ }
|
|
1928
|
+
: {},
|
|
1929
|
+
options.defaultProps
|
|
1926
1930
|
)
|
|
1927
1931
|
|
|
1928
1932
|
const ${componentName} = (props) => {
|
|
1929
|
-
const mergedProps = mergeProps(
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
const forwardedKeys = createMemo(() =>
|
|
1935
|
-
Object.keys(props).filter((prop) => !normalizeHTMLProps.keys.includes(prop) && shouldForwardProp(prop)),
|
|
1933
|
+
const mergedProps = mergeProps(
|
|
1934
|
+
{ as: element.__base__ || element },
|
|
1935
|
+
defaultProps,
|
|
1936
|
+
props
|
|
1936
1937
|
)
|
|
1937
1938
|
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1939
|
+
const __cvaFn__ = composeCvaFn(element.__cva__, cvaFn)
|
|
1940
|
+
|
|
1941
|
+
const __shouldForwardProps__ = composeShouldForwardProps(
|
|
1942
|
+
element,
|
|
1943
|
+
shouldForwardProp
|
|
1943
1944
|
)
|
|
1944
1945
|
|
|
1945
|
-
const
|
|
1946
|
+
const [localProps, restProps] = splitProps(mergedProps, [
|
|
1947
|
+
'as',
|
|
1948
|
+
'class',
|
|
1949
|
+
'className',
|
|
1950
|
+
])
|
|
1946
1951
|
|
|
1947
|
-
const [
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
+
const [htmlProps, aProps] = splitProps(restProps, normalizeHTMLProps.keys)
|
|
1953
|
+
|
|
1954
|
+
const forwardedKeys = createMemo(() => {
|
|
1955
|
+
const keys = Object.keys(aProps)
|
|
1956
|
+
return keys.filter((prop) => __shouldForwardProps__(prop))
|
|
1957
|
+
})
|
|
1958
|
+
|
|
1959
|
+
const [forwardedProps, variantProps, bProps] = splitProps(aProps, forwardedKeys(), __cvaFn__.variantKeys)
|
|
1960
|
+
|
|
1961
|
+
const cssPropKeys = createMemo(() => {
|
|
1962
|
+
const keys = Object.keys(bProps)
|
|
1963
|
+
return keys.filter((prop) => isCssProperty(prop))
|
|
1964
|
+
})
|
|
1965
|
+
|
|
1966
|
+
const [styleProps, elementProps] = splitProps(bProps, cssPropKeys())
|
|
1952
1967
|
|
|
1953
1968
|
function recipeClass() {
|
|
1954
1969
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1955
|
-
const compoundVariantStyles =
|
|
1956
|
-
|
|
1970
|
+
const compoundVariantStyles =
|
|
1971
|
+
__cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1972
|
+
return cx(
|
|
1973
|
+
__cvaFn__(variantProps, false),
|
|
1974
|
+
css(compoundVariantStyles, propStyles, cssStyles),
|
|
1975
|
+
localProps.class,
|
|
1976
|
+
localProps.className
|
|
1977
|
+
)
|
|
1957
1978
|
}
|
|
1958
|
-
|
|
1979
|
+
|
|
1959
1980
|
function cvaClass() {
|
|
1960
1981
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1961
1982
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1962
|
-
return cx(
|
|
1983
|
+
return cx(
|
|
1984
|
+
css(cvaStyles, propStyles, cssStyles),
|
|
1985
|
+
localProps.class,
|
|
1986
|
+
localProps.className
|
|
1987
|
+
)
|
|
1963
1988
|
}
|
|
1964
1989
|
|
|
1965
1990
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1970,19 +1995,14 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1970
1995
|
|
|
1971
1996
|
return createComponent(
|
|
1972
1997
|
Dynamic,
|
|
1973
|
-
mergeProps(
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
normalizeHTMLProps(htmlProps),
|
|
1977
|
-
{
|
|
1978
|
-
get component() {
|
|
1979
|
-
return localProps.as
|
|
1980
|
-
},
|
|
1981
|
-
get class() {
|
|
1982
|
-
return classes()
|
|
1983
|
-
}
|
|
1998
|
+
mergeProps(forwardedProps, elementProps, normalizeHTMLProps(htmlProps), {
|
|
1999
|
+
get component() {
|
|
2000
|
+
return localProps.as
|
|
1984
2001
|
},
|
|
1985
|
-
|
|
2002
|
+
get class() {
|
|
2003
|
+
return classes()
|
|
2004
|
+
},
|
|
2005
|
+
})
|
|
1986
2006
|
)
|
|
1987
2007
|
}
|
|
1988
2008
|
|
package/dist/index.mjs
CHANGED
|
@@ -1867,63 +1867,88 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1867
1867
|
const { componentName, factoryName } = ctx.jsx;
|
|
1868
1868
|
return {
|
|
1869
1869
|
js: outdent29`
|
|
1870
|
-
import { Dynamic } from 'solid-js/web'
|
|
1871
1870
|
import { createMemo, mergeProps, splitProps } from 'solid-js'
|
|
1872
|
-
import { createComponent } from 'solid-js/web'
|
|
1871
|
+
import { Dynamic, createComponent } from 'solid-js/web'
|
|
1872
|
+
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1873
|
+
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
1873
1874
|
${ctx.file.import(
|
|
1874
|
-
"
|
|
1875
|
+
"composeCvaFn, composeShouldForwardProps, defaultShouldForwardProp, getDisplayName",
|
|
1875
1876
|
"./factory-helper"
|
|
1876
1877
|
)}
|
|
1877
1878
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1878
|
-
${ctx.file.import("css, cx, cva", "../css/index")}
|
|
1879
|
-
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
1880
1879
|
|
|
1881
1880
|
function styledFn(element, configOrCva = {}, options = {}) {
|
|
1882
|
-
const cvaFn =
|
|
1881
|
+
const cvaFn =
|
|
1882
|
+
configOrCva.__cva__ || configOrCva.__recipe__
|
|
1883
|
+
? configOrCva
|
|
1884
|
+
: cva(configOrCva)
|
|
1883
1885
|
|
|
1884
1886
|
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp
|
|
1885
1887
|
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys)
|
|
1886
1888
|
|
|
1887
1889
|
const defaultProps = Object.assign(
|
|
1888
|
-
options.dataAttr && configOrCva.__name__
|
|
1889
|
-
|
|
1890
|
+
options.dataAttr && configOrCva.__name__
|
|
1891
|
+
? { 'data-recipe': configOrCva.__name__ }
|
|
1892
|
+
: {},
|
|
1893
|
+
options.defaultProps
|
|
1890
1894
|
)
|
|
1891
1895
|
|
|
1892
1896
|
const ${componentName} = (props) => {
|
|
1893
|
-
const mergedProps = mergeProps(
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
const forwardedKeys = createMemo(() =>
|
|
1899
|
-
Object.keys(props).filter((prop) => !normalizeHTMLProps.keys.includes(prop) && shouldForwardProp(prop)),
|
|
1897
|
+
const mergedProps = mergeProps(
|
|
1898
|
+
{ as: element.__base__ || element },
|
|
1899
|
+
defaultProps,
|
|
1900
|
+
props
|
|
1900
1901
|
)
|
|
1901
1902
|
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1903
|
+
const __cvaFn__ = composeCvaFn(element.__cva__, cvaFn)
|
|
1904
|
+
|
|
1905
|
+
const __shouldForwardProps__ = composeShouldForwardProps(
|
|
1906
|
+
element,
|
|
1907
|
+
shouldForwardProp
|
|
1907
1908
|
)
|
|
1908
1909
|
|
|
1909
|
-
const
|
|
1910
|
+
const [localProps, restProps] = splitProps(mergedProps, [
|
|
1911
|
+
'as',
|
|
1912
|
+
'class',
|
|
1913
|
+
'className',
|
|
1914
|
+
])
|
|
1910
1915
|
|
|
1911
|
-
const [
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
+
const [htmlProps, aProps] = splitProps(restProps, normalizeHTMLProps.keys)
|
|
1917
|
+
|
|
1918
|
+
const forwardedKeys = createMemo(() => {
|
|
1919
|
+
const keys = Object.keys(aProps)
|
|
1920
|
+
return keys.filter((prop) => __shouldForwardProps__(prop))
|
|
1921
|
+
})
|
|
1922
|
+
|
|
1923
|
+
const [forwardedProps, variantProps, bProps] = splitProps(aProps, forwardedKeys(), __cvaFn__.variantKeys)
|
|
1924
|
+
|
|
1925
|
+
const cssPropKeys = createMemo(() => {
|
|
1926
|
+
const keys = Object.keys(bProps)
|
|
1927
|
+
return keys.filter((prop) => isCssProperty(prop))
|
|
1928
|
+
})
|
|
1929
|
+
|
|
1930
|
+
const [styleProps, elementProps] = splitProps(bProps, cssPropKeys())
|
|
1916
1931
|
|
|
1917
1932
|
function recipeClass() {
|
|
1918
1933
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1919
|
-
const compoundVariantStyles =
|
|
1920
|
-
|
|
1934
|
+
const compoundVariantStyles =
|
|
1935
|
+
__cvaFn__.__getCompoundVariantCss__?.(variantProps)
|
|
1936
|
+
return cx(
|
|
1937
|
+
__cvaFn__(variantProps, false),
|
|
1938
|
+
css(compoundVariantStyles, propStyles, cssStyles),
|
|
1939
|
+
localProps.class,
|
|
1940
|
+
localProps.className
|
|
1941
|
+
)
|
|
1921
1942
|
}
|
|
1922
|
-
|
|
1943
|
+
|
|
1923
1944
|
function cvaClass() {
|
|
1924
1945
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1925
1946
|
const cvaStyles = __cvaFn__.raw(variantProps)
|
|
1926
|
-
return cx(
|
|
1947
|
+
return cx(
|
|
1948
|
+
css(cvaStyles, propStyles, cssStyles),
|
|
1949
|
+
localProps.class,
|
|
1950
|
+
localProps.className
|
|
1951
|
+
)
|
|
1927
1952
|
}
|
|
1928
1953
|
|
|
1929
1954
|
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
@@ -1934,19 +1959,14 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1934
1959
|
|
|
1935
1960
|
return createComponent(
|
|
1936
1961
|
Dynamic,
|
|
1937
|
-
mergeProps(
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
normalizeHTMLProps(htmlProps),
|
|
1941
|
-
{
|
|
1942
|
-
get component() {
|
|
1943
|
-
return localProps.as
|
|
1944
|
-
},
|
|
1945
|
-
get class() {
|
|
1946
|
-
return classes()
|
|
1947
|
-
}
|
|
1962
|
+
mergeProps(forwardedProps, elementProps, normalizeHTMLProps(htmlProps), {
|
|
1963
|
+
get component() {
|
|
1964
|
+
return localProps.as
|
|
1948
1965
|
},
|
|
1949
|
-
|
|
1966
|
+
get class() {
|
|
1967
|
+
return classes()
|
|
1968
|
+
},
|
|
1969
|
+
})
|
|
1950
1970
|
)
|
|
1951
1971
|
}
|
|
1952
1972
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20240207210058",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"postcss": "^8.4.31",
|
|
39
39
|
"ts-pattern": "5.0.5",
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/is-valid-prop": "^0.0.0-dev-
|
|
42
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
43
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
44
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
45
|
-
"@pandacss/types": "0.0.0-dev-
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20240207210058",
|
|
41
|
+
"@pandacss/is-valid-prop": "^0.0.0-dev-20240207210058",
|
|
42
|
+
"@pandacss/logger": "0.0.0-dev-20240207210058",
|
|
43
|
+
"@pandacss/shared": "0.0.0-dev-20240207210058",
|
|
44
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20240207210058",
|
|
45
|
+
"@pandacss/types": "0.0.0-dev-20240207210058"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33"
|