@tw-classed/core
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -129,2 +129,2 @@ /** Narrowed function. */ | ||
export { $$ClassedProps, $$ClassedVariants, BooleanVariant, ClassNamesAndVariant, ClassedCoreConfig, ClassedCoreFunctionType, ClassedProducer, ClassedProps, ClassedType, ClassedVariants, CreateClassedCoreType, InferVariantProps, TW_VARS, Variant, VariantConfig, VariantProps, Variants, classed, createClassed, getCompoundVariantClasses, getDataAttributes, getVariantSelector, mapPropsToVariantClass, parseClassNames }; | ||
export { $$ClassedProps, $$ClassedVariants, type BooleanVariant, type ClassNamesAndVariant, type ClassedCoreConfig, type ClassedCoreFunctionType, type ClassedProducer, type ClassedProps, type ClassedType, type ClassedVariants, type CreateClassedCoreType, type InferVariantProps, TW_VARS, type Variant, type VariantConfig, type VariantProps, type Variants, classed, createClassed, getCompoundVariantClasses, getDataAttributes, getVariantSelector, mapPropsToVariantClass, parseClassNames }; |
@@ -52,3 +52,3 @@ /** | ||
* Gets the variant selector from the variant props | ||
*/ const getVariantSelector = (variantKey, props, { defaultVariants })=>{ | ||
*/ const getVariantSelector = (variantKey, props, { defaultVariants })=>{ | ||
var _defaultVariants_variantKey; | ||
@@ -59,3 +59,3 @@ const variantValue = props[variantKey]; | ||
}; | ||
const mapPropsToVariantClass = ({ variants , defaultVariants , compoundVariants }, props = {}, shouldDeleteProps = false)=>{ | ||
const mapPropsToVariantClass = ({ variants, defaultVariants, compoundVariants }, props = {}, shouldDeleteProps = false)=>{ | ||
const matchedKeys = new Set(); | ||
@@ -80,4 +80,4 @@ const producedClassName = Object.keys(variants).reduce((acc, variantKey)=>{ | ||
}; | ||
function getCompoundVariantClasses({ props , defaultVariants }, compoundVariants = []) { | ||
return compoundVariants.reduce((acc, { class: cvClass , className: cvClassName , ...cvo })=>{ | ||
function getCompoundVariantClasses({ props, defaultVariants }, compoundVariants = []) { | ||
return compoundVariants.reduce((acc, { class: cvClass, className: cvClassName, ...cvo })=>{ | ||
const notMatched = Object.entries(cvo).some(([key, value])=>{ | ||
@@ -95,3 +95,3 @@ const propValue = props[key]; | ||
} | ||
function getDataAttributes({ props , dataAttributes , variants , defaultVariants }) { | ||
function getDataAttributes({ props, dataAttributes, variants, defaultVariants }) { | ||
if (dataAttributes.length === 0) return {}; | ||
@@ -110,5 +110,5 @@ return dataAttributes.reduce((acc, name)=>{ | ||
const internalClassed = (classes, { merger =cn } = {})=>{ | ||
const internalClassed = (classes, { merger = cn } = {})=>{ | ||
// Parse classNames and variants | ||
const { className , variants , defaultVariants , compoundVariants } = parseClassNames(classes); | ||
const { className, variants, defaultVariants, compoundVariants } = parseClassNames(classes); | ||
const producer = (variantProps)=>{ | ||
@@ -115,0 +115,0 @@ // Map variant props to className |
{ | ||
"name": "@tw-classed/core", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "A Stitches & Styled-Components inspired library to create reusable Tailwind react components", | ||
@@ -27,9 +27,9 @@ "sideEffects": false, | ||
"devDependencies": { | ||
"@vitest/ui": "^0.27.2", | ||
"bunchee": "^2.2.0", | ||
"c8": "^7.12.0", | ||
"typescript": "^4.9.4", | ||
"vite": "^4.0.4", | ||
"vite-plugin-dts": "^1.7.0", | ||
"vitest": "^0.27.2" | ||
"@vitest/ui": "^0.34.4", | ||
"bunchee": "^3.8.0", | ||
"c8": "^8.0.1", | ||
"typescript": "^5.2.2", | ||
"vite": "^4.4.9", | ||
"vite-plugin-dts": "^3.5.3", | ||
"vitest": "^0.34.4" | ||
}, | ||
@@ -36,0 +36,0 @@ "scripts": { |
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
39613
9