tailwind-styled-v4 5.1.24 → 5.1.26
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 +236 -0
- package/dist/index.browser.mjs +13 -4
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +7 -29
- package/dist/index.d.ts +7 -29
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -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
|
}
|
|
@@ -1178,6 +1178,9 @@ function makeTag(tag) {
|
|
|
1178
1178
|
});
|
|
1179
1179
|
}
|
|
1180
1180
|
var HTML_TAGS = [
|
|
1181
|
+
"html",
|
|
1182
|
+
"head",
|
|
1183
|
+
"body",
|
|
1181
1184
|
"div",
|
|
1182
1185
|
"section",
|
|
1183
1186
|
"article",
|
|
@@ -1430,14 +1433,20 @@ function cv(config, componentId) {
|
|
|
1430
1433
|
}
|
|
1431
1434
|
}
|
|
1432
1435
|
}
|
|
1433
|
-
|
|
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 = {}) => {
|
|
1434
1443
|
let result;
|
|
1435
1444
|
const variantKeys = Object.keys(config.variants ?? {});
|
|
1436
1445
|
if (componentId) {
|
|
1437
1446
|
const generated = lookupGenerated(
|
|
1438
1447
|
componentId,
|
|
1439
1448
|
props,
|
|
1440
|
-
|
|
1449
|
+
stringifiedDefaults,
|
|
1441
1450
|
variantKeys
|
|
1442
1451
|
);
|
|
1443
1452
|
result = generated ?? resolveVariantsNative(config, props);
|
|
@@ -1445,7 +1454,7 @@ function cv(config, componentId) {
|
|
|
1445
1454
|
result = resolveVariantsNative(config, props);
|
|
1446
1455
|
}
|
|
1447
1456
|
return props.className ? twMerge(result, props.className) : result;
|
|
1448
|
-
};
|
|
1457
|
+
});
|
|
1449
1458
|
}
|
|
1450
1459
|
|
|
1451
1460
|
// packages/domain/core/src/cx.ts
|