tailwind-styled-v4 5.1.25 → 5.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +254 -0
- package/dist/index.browser.mjs +10 -4
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -907,7 +907,7 @@ function resolveVariants(variants, props, defaults) {
|
|
|
907
907
|
if (!binding?.resolveSimpleVariants) {
|
|
908
908
|
const classes = [];
|
|
909
909
|
for (const key of Object.keys(variants)) {
|
|
910
|
-
const propValue = cleanProps[key] ?? defaults[key];
|
|
910
|
+
const propValue = cleanProps[key] ?? String(defaults[key]);
|
|
911
911
|
if (propValue !== void 0 && variants[key]?.[propValue]) {
|
|
912
912
|
classes.push(variants[key][propValue]);
|
|
913
913
|
}
|
|
@@ -1433,14 +1433,20 @@ function cv(config, componentId) {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
|
|
1436
|
+
const stringifiedDefaults = {};
|
|
1437
|
+
if (config.defaultVariants) {
|
|
1438
|
+
for (const [k, v] of Object.entries(config.defaultVariants)) {
|
|
1439
|
+
stringifiedDefaults[k] = String(v);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return ((props = {}) => {
|
|
1437
1443
|
let result;
|
|
1438
1444
|
const variantKeys = Object.keys(config.variants ?? {});
|
|
1439
1445
|
if (componentId) {
|
|
1440
1446
|
const generated = lookupGenerated(
|
|
1441
1447
|
componentId,
|
|
1442
1448
|
props,
|
|
1443
|
-
|
|
1449
|
+
stringifiedDefaults,
|
|
1444
1450
|
variantKeys
|
|
1445
1451
|
);
|
|
1446
1452
|
result = generated ?? resolveVariantsNative(config, props);
|
|
@@ -1448,7 +1454,7 @@ function cv(config, componentId) {
|
|
|
1448
1454
|
result = resolveVariantsNative(config, props);
|
|
1449
1455
|
}
|
|
1450
1456
|
return props.className ? twMerge(result, props.className) : result;
|
|
1451
|
-
};
|
|
1457
|
+
});
|
|
1452
1458
|
}
|
|
1453
1459
|
|
|
1454
1460
|
// packages/domain/core/src/cx.ts
|