Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@udecode/cn

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@udecode/cn - npm Package Compare versions

Comparing version 31.0.0 to 33.0.0

17

dist/index.d.ts

@@ -5,5 +5,3 @@ import { CxOptions, cva, VariantProps } from 'class-variance-authority';

/**
* Tailwind CSS classnames merge.
*/
/** Tailwind CSS classnames merge. */
declare function cn(...inputs: CxOptions): string;

@@ -13,2 +11,3 @@

* Set default `className` with `cn`.
*
* - IntelliSense: add `withCn` to `classAttributes`

@@ -21,14 +20,18 @@ * - ESLint: add `withCn` to `settings.tailwindcss.callees`

* Set default props with `React.forwardRef`.
*
* - Use `withCn` if only setting `className`
*/
declare function withProps<T extends keyof HTMLElementTagNameMap | React.ComponentType<any>>(Component: T, defaultProps: Partial<React.ComponentPropsWithoutRef<T>>): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithoutRef<React.ComponentProps<T>>> & React.RefAttributes<React.ElementRef<T>>>;
declare function withProps<T extends React.ComponentType<any> | keyof HTMLElementTagNameMap>(Component: T, defaultProps: Partial<React.ComponentPropsWithoutRef<T>>): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithoutRef<React.ComponentProps<T>>> & React.RefAttributes<React.ElementRef<T>>>;
/**
* Set default `className` with `cn` and `variants`.
*
* @param Component - The component to which props will be added.
* @param variants - Variants from `cva`. `Component` props will be extended with `variants` props.
* @param onlyVariantsProps - Props to exclude from `Component`. Set the props that are only used for variants.
* @param variants - Variants from `cva`. `Component` props will be extended
* with `variants` props.
* @param onlyVariantsProps - Props to exclude from `Component`. Set the props
* that are only used for variants.
*/
declare function withVariants<T extends keyof HTMLElementTagNameMap | React.ComponentType<any>, V extends ReturnType<typeof cva>>(Component: T, variants: V, onlyVariantsProps?: (keyof VariantProps<V>)[]): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithoutRef<React.ComponentProps<T>> & VariantProps<V>> & React.RefAttributes<React.ElementRef<T>>>;
declare function withVariants<T extends React.ComponentType<any> | keyof HTMLElementTagNameMap, V extends ReturnType<typeof cva>>(Component: T, variants: V, onlyVariantsProps?: (keyof VariantProps<V>)[]): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithoutRef<React.ComponentProps<T>> & VariantProps<V>> & React.RefAttributes<React.ElementRef<T>>>;
export { cn, withCn, withProps, withVariants };

@@ -118,4 +118,4 @@ "use strict";

__spreadValues({
ref,
className: cn(variants(props), className)
className: cn(variants(props), className),
ref
}, rest)

@@ -122,0 +122,0 @@ );

{
"name": "@udecode/cn",
"version": "31.0.0",
"version": "33.0.0",
"description": "cn utils",

@@ -41,3 +41,3 @@ "license": "MIT",

"dependencies": {
"@udecode/react-utils": "31.0.0"
"@udecode/react-utils": "33.0.0"
},

@@ -44,0 +44,0 @@ "peerDependencies": {

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