@udecode/cn
Advanced tools
Comparing version
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __objRest = (source, exclude) => { | ||
var target = {}; | ||
for (var prop in source) | ||
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) | ||
target[prop] = source[prop]; | ||
if (source != null && __getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(source)) { | ||
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) | ||
target[prop] = source[prop]; | ||
} | ||
return target; | ||
}; | ||
var __export = (target, all) => { | ||
@@ -61,4 +32,4 @@ for (var name in all) | ||
// src/index.tsx | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
var index_exports = {}; | ||
__export(index_exports, { | ||
cn: () => cn, | ||
@@ -69,3 +40,3 @@ withCn: () => withCn, | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
module.exports = __toCommonJS(index_exports); | ||
@@ -86,5 +57,6 @@ // src/cn.ts | ||
ComponentWithClassName, | ||
__spreadProps(__spreadValues(__spreadValues({ | ||
ref | ||
}, defaultProps), props), { | ||
{ | ||
ref, | ||
...defaultProps, | ||
...props, | ||
className: cn( | ||
@@ -94,3 +66,3 @@ defaultProps.className, | ||
) | ||
}) | ||
} | ||
); | ||
@@ -110,4 +82,4 @@ }); | ||
return import_react2.default.forwardRef(function ExtendComponent(allProps, ref) { | ||
const _a = allProps, { className } = _a, props = __objRest(_a, ["className"]); | ||
const rest = __spreadValues({}, props); | ||
const { className, ...props } = allProps; | ||
const rest = { ...props }; | ||
if (onlyVariantsProps) { | ||
@@ -122,6 +94,7 @@ onlyVariantsProps.forEach((key) => { | ||
ComponentWithClassName, | ||
__spreadValues({ | ||
{ | ||
ref, | ||
className: cn(variants(props), className) | ||
}, rest) | ||
className: cn(variants(props), className), | ||
...rest | ||
} | ||
); | ||
@@ -132,3 +105,3 @@ }); | ||
// src/index.tsx | ||
__reExport(src_exports, require("@udecode/react-utils"), module.exports); | ||
__reExport(index_exports, require("@udecode/react-utils"), module.exports); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -135,0 +108,0 @@ 0 && (module.exports = { |
{ | ||
"name": "@udecode/cn", | ||
"version": "40.2.8", | ||
"version": "42.0.0", | ||
"description": "React cn utils", | ||
@@ -44,8 +44,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@udecode/react-utils": "40.2.8" | ||
"@udecode/react-utils": "42.0.0" | ||
}, | ||
"peerDependencies": { | ||
"class-variance-authority": ">=0.7.0", | ||
"react": ">=16.8.0", | ||
"react-dom": ">=16.8.0", | ||
"react": ">=18.0.0", | ||
"react-dom": ">=18.0.0", | ||
"tailwind-merge": ">=2.2.0" | ||
@@ -52,0 +52,0 @@ }, |
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
19013
-12.29%193
-22.49%+ Added
+ Added
- Removed
- Removed
Updated