Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.6.0 to 1.7.0-canary.0

9

dist/index.d.ts

@@ -27,3 +27,3 @@ /** Narrowed function. */

}>;
compoundVariants: Record<string, any>[];
compoundVariants?: Record<string, any>[];
dataAttributes?: string[];

@@ -42,3 +42,3 @@ defaultProps?: Record<string, unknown>;

type InferVariantProps<V extends Variants | unknown | undefined = undefined> = V extends Variants ? Partial<{
[K in keyof V]: Widen<keyof V[K]>;
[K in keyof V]: Widen<keyof V[K]> | undefined;
}> : {};

@@ -105,2 +105,5 @@ interface PropsWithClass {

declare const classed: ClassedCoreFunctionType;
declare function getVariantConfig<T extends {
[$$ClassedVariants]: {};
}>(component: T): T[typeof $$ClassedVariants];

@@ -134,2 +137,2 @@ declare const parseClassNames: <TVariants extends Variants>(classNames: any[]) => {

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 };
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, getVariantConfig, getVariantSelector, mapPropsToVariantClass, parseClassNames };

@@ -141,3 +141,27 @@ /**

const classed = createClassed().classed;
/**
* @param component - The component to get the variant configuration for.
* @returns The variant configuration for the given component.
* @example
* const button = classed("button", {
* variants: {
* size: {
* sm: "text-sm",
* md: "text-md",
* },
* },
* });
*
* const { variants } = getVariantConfig(button);
*
* expect(variants).toEqual({
* size: {
* sm: "text-sm",
* md: "text-md",
* },
* });
*/ function getVariantConfig(component) {
return Reflect.get(component, TW_VARS);
}
export { TW_VARS, classed, createClassed, getCompoundVariantClasses, getDataAttributes, getVariantSelector, mapPropsToVariantClass, parseClassNames };
export { TW_VARS, classed, createClassed, getCompoundVariantClasses, getDataAttributes, getVariantConfig, getVariantSelector, mapPropsToVariantClass, parseClassNames };
{
"name": "@tw-classed/core",
"version": "1.6.0",
"version": "1.7.0-canary.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc