chore(utils): prevent default prop merge for chip and badge

This commit is contained in:
Benjamin Canac
2024-02-21 16:34:30 +01:00
parent 433c09a9f3
commit f83cff7095

View File

@@ -17,6 +17,12 @@ const defuTwMerge = createDefu((obj, key, value, namespace) => {
if (namespace.endsWith('avatar') && key === 'size') {
return false
}
if (namespace.endsWith('chip') && key === 'size') {
return false
}
if (namespace.endsWith('badge') && key === 'size' || key === 'color' || key === 'variant') {
return false
}
if (typeof obj[key] === 'string' && typeof value === 'string' && obj[key] && value) {
// @ts-ignore
obj[key] = customTwMerge(obj[key], value)