@udecode/cn
Advanced tools
Comparing version 31.0.0 to 33.0.0
@@ -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
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
21678
249
35105
+ Added@udecode/react-utils@33.0.0(transitive)
- Removed@udecode/react-utils@31.0.0(transitive)
Updated@udecode/react-utils@33.0.0