You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@tw-classed/core

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tw-classed/core - npm Package Compare versions

Comparing version

to
1.6.0

2

dist/index.d.ts

@@ -29,2 +29,3 @@ /** Narrowed function. */

dataAttributes?: string[];
defaultProps?: Record<string, unknown>;
};

@@ -110,2 +111,3 @@ type ClassNamesAndVariant<V extends Variants> = string | VariantConfig<V>;

dataAttributes: string[];
defaultProps: Record<string, unknown>;
};

@@ -112,0 +114,0 @@ declare const getVariantSelector: <TVariants extends Variants>(variantKey: string, props: Partial<InferVariantProps<TVariants>>, { defaultVariants }: Pick<VariantConfig<TVariants>, "defaultVariants">) => string | undefined;

17

dist/index.esm.js

@@ -24,2 +24,3 @@ /**

let dataAttributes = new Set();
let defaultProps = {};
for (const className of classNames){

@@ -33,10 +34,11 @@ if (!className) continue;

const record = Reflect.has(className, TW_VARS) ? Reflect.get(className, TW_VARS) : className;
record.variants && Object.assign(variantObj, record.variants);
record.defaultVariants && Object.assign(defaultVariants, record.defaultVariants);
record.compoundVariants && record.compoundVariants.forEach((cv)=>compoundVariants.push(cv));
record.className && stringClassNames.push(record.className);
record.base && stringClassNames.push(record.base);
record.dataAttributes && record.dataAttributes.forEach((name)=>{
if (record.variants) Object.assign(variantObj, record.variants);
if (record.defaultVariants) Object.assign(defaultVariants, record.defaultVariants);
if (record.compoundVariants) record.compoundVariants.forEach((cv)=>compoundVariants.push(cv));
if (record.className) stringClassNames.push(record.className);
if (record.base) stringClassNames.push(record.base);
if (record.dataAttributes) record.dataAttributes.forEach((name)=>{
dataAttributes.add(name);
});
if (record.defaultProps) Object.assign(defaultProps, record.defaultProps);
}

@@ -49,3 +51,4 @@ }

compoundVariants,
dataAttributes: Array.from(dataAttributes)
dataAttributes: Array.from(dataAttributes),
defaultProps
};

@@ -52,0 +55,0 @@ };

{
"name": "@tw-classed/core",
"version": "1.5.2",
"version": "1.6.0",
"description": "A Stitches & Styled-Components inspired library to create reusable Tailwind react components",

@@ -5,0 +5,0 @@ "sideEffects": false,

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