@kuma-ui/compiler
Advanced tools
Comparing version 0.0.0-dev-20230901140051 to 0.0.0-dev-20230905131756
@@ -172,9 +172,11 @@ "use strict"; | ||
const variant = import_sheet.theme.getVariants(componentName); | ||
const componentVariantProps = { | ||
const baseStyleProps = { | ||
...variant?.baseStyle | ||
}; | ||
const defaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const systemDefaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const userDefaultProps = variant?.defaultProps; | ||
let isDefault = false; | ||
for (const [propName, propValue] of Object.entries({ | ||
...defaultProps, | ||
...systemDefaultProps, | ||
...userDefaultProps, | ||
...propsMap | ||
@@ -190,3 +192,3 @@ })) { | ||
Object.assign( | ||
componentVariantProps, | ||
baseStyleProps, | ||
variant?.variants?.[propValue] | ||
@@ -204,5 +206,5 @@ ); | ||
if (componentName === "Box" && isDefault) { | ||
for (const prop in componentVariantProps) { | ||
if (Object.hasOwn(componentVariantProps, prop)) { | ||
delete componentVariantProps[prop]; | ||
for (const prop in baseStyleProps) { | ||
if (Object.hasOwn(baseStyleProps, prop)) { | ||
delete baseStyleProps[prop]; | ||
} | ||
@@ -212,3 +214,3 @@ } | ||
const combinedProps = { | ||
...componentVariantProps, | ||
...baseStyleProps, | ||
...specificProps, | ||
@@ -215,0 +217,0 @@ ...styledProps, |
@@ -35,9 +35,11 @@ "use strict"; | ||
const variant = import_sheet.theme.getVariants(componentName); | ||
const componentVariantProps = { | ||
const baseStyleProps = { | ||
...variant?.baseStyle | ||
}; | ||
const defaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const systemDefaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const userDefaultProps = variant?.defaultProps; | ||
let isDefault = false; | ||
for (const [propName, propValue] of Object.entries({ | ||
...defaultProps, | ||
...systemDefaultProps, | ||
...userDefaultProps, | ||
...propsMap | ||
@@ -53,3 +55,3 @@ })) { | ||
Object.assign( | ||
componentVariantProps, | ||
baseStyleProps, | ||
variant?.variants?.[propValue] | ||
@@ -67,5 +69,5 @@ ); | ||
if (componentName === "Box" && isDefault) { | ||
for (const prop in componentVariantProps) { | ||
if (Object.hasOwn(componentVariantProps, prop)) { | ||
delete componentVariantProps[prop]; | ||
for (const prop in baseStyleProps) { | ||
if (Object.hasOwn(baseStyleProps, prop)) { | ||
delete baseStyleProps[prop]; | ||
} | ||
@@ -75,3 +77,3 @@ } | ||
const combinedProps = { | ||
...componentVariantProps, | ||
...baseStyleProps, | ||
...specificProps, | ||
@@ -78,0 +80,0 @@ ...styledProps, |
@@ -37,9 +37,11 @@ "use strict"; | ||
const variant = import_sheet.theme.getVariants(componentName); | ||
const componentVariantProps = { | ||
const baseStyleProps = { | ||
...variant?.baseStyle | ||
}; | ||
const defaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const systemDefaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const userDefaultProps = variant?.defaultProps; | ||
let isDefault = false; | ||
for (const [propName, propValue] of Object.entries({ | ||
...defaultProps, | ||
...systemDefaultProps, | ||
...userDefaultProps, | ||
...propsMap | ||
@@ -55,3 +57,3 @@ })) { | ||
Object.assign( | ||
componentVariantProps, | ||
baseStyleProps, | ||
variant?.variants?.[propValue] | ||
@@ -69,5 +71,5 @@ ); | ||
if (componentName === "Box" && isDefault) { | ||
for (const prop in componentVariantProps) { | ||
if (Object.hasOwn(componentVariantProps, prop)) { | ||
delete componentVariantProps[prop]; | ||
for (const prop in baseStyleProps) { | ||
if (Object.hasOwn(baseStyleProps, prop)) { | ||
delete baseStyleProps[prop]; | ||
} | ||
@@ -77,3 +79,3 @@ } | ||
const combinedProps = { | ||
...componentVariantProps, | ||
...baseStyleProps, | ||
...specificProps, | ||
@@ -80,0 +82,0 @@ ...styledProps, |
@@ -174,9 +174,11 @@ "use strict"; | ||
const variant = import_sheet.theme.getVariants(componentName); | ||
const componentVariantProps = { | ||
const baseStyleProps = { | ||
...variant?.baseStyle | ||
}; | ||
const defaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const systemDefaultProps = (0, import_componentList.componentDefaultProps)(componentName); | ||
const userDefaultProps = variant?.defaultProps; | ||
let isDefault = false; | ||
for (const [propName, propValue] of Object.entries({ | ||
...defaultProps, | ||
...systemDefaultProps, | ||
...userDefaultProps, | ||
...propsMap | ||
@@ -192,3 +194,3 @@ })) { | ||
Object.assign( | ||
componentVariantProps, | ||
baseStyleProps, | ||
variant?.variants?.[propValue] | ||
@@ -206,5 +208,5 @@ ); | ||
if (componentName === "Box" && isDefault) { | ||
for (const prop in componentVariantProps) { | ||
if (Object.hasOwn(componentVariantProps, prop)) { | ||
delete componentVariantProps[prop]; | ||
for (const prop in baseStyleProps) { | ||
if (Object.hasOwn(baseStyleProps, prop)) { | ||
delete baseStyleProps[prop]; | ||
} | ||
@@ -214,3 +216,3 @@ } | ||
const combinedProps = { | ||
...componentVariantProps, | ||
...baseStyleProps, | ||
...specificProps, | ||
@@ -217,0 +219,0 @@ ...styledProps, |
{ | ||
"name": "@kuma-ui/compiler", | ||
"version": "0.0.0-dev-20230901140051", | ||
"version": "0.0.0-dev-20230905131756", | ||
"description": "🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.", | ||
@@ -34,5 +34,5 @@ "repository": { | ||
"ts-pattern": "^5.0.1", | ||
"@kuma-ui/core": "^0.0.0-dev-20230901140051", | ||
"@kuma-ui/sheet": "^0.0.0-dev-20230901140051", | ||
"@kuma-ui/system": "^0.0.0-dev-20230901140051" | ||
"@kuma-ui/core": "^0.0.0-dev-20230905131756", | ||
"@kuma-ui/sheet": "^0.0.0-dev-20230905131756", | ||
"@kuma-ui/system": "^0.0.0-dev-20230905131756" | ||
}, | ||
@@ -39,0 +39,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78412
1960