tailwind-to-style 2.12.4 → 2.12.5

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.12.4
2
+ * tailwind-to-style v2.12.5
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
@@ -9688,8 +9688,11 @@ function styled(component) {
9688
9688
  const variantPrefix = getVariantPrefix(namingOptions);
9689
9689
  const sep = namingOptions.separator || styledConfig.separator || "-";
9690
9690
  const variantSelector = `&.${variantPrefix}${variantKey}${sep}${variantValue}`;
9691
- if (variantClasses && variantClasses.trim()) {
9692
- nestedVariants[variantSelector] = variantClasses;
9691
+
9692
+ // Handle both string and array of classes
9693
+ const normalizedClasses = Array.isArray(variantClasses) ? variantClasses.join(" ") : variantClasses;
9694
+ if (normalizedClasses && normalizedClasses.trim()) {
9695
+ nestedVariants[variantSelector] = normalizedClasses;
9693
9696
  }
9694
9697
  });
9695
9698
  });
@@ -9709,16 +9712,22 @@ function styled(component) {
9709
9712
  return `${variantPrefix}${key}${sep}${value}`;
9710
9713
  }).join(".");
9711
9714
  const compoundSelector = `&.${conditionClasses}`;
9712
- if (compoundClass && compoundClass.trim()) {
9713
- nestedVariants[compoundSelector] = compoundClass;
9715
+
9716
+ // Handle both string and array of classes
9717
+ const normalizedClass = Array.isArray(compoundClass) ? compoundClass.join(" ") : compoundClass;
9718
+ if (normalizedClass && normalizedClass.trim()) {
9719
+ nestedVariants[compoundSelector] = normalizedClass;
9714
9720
  }
9715
9721
  });
9716
9722
 
9717
9723
  // 3. Build final structure: [base, { nested variants }]
9718
9724
  // This matches the twsx() format exactly
9719
9725
  const styleArray = [];
9720
- if (base.trim()) {
9721
- styleArray.push(base);
9726
+
9727
+ // Handle both string and array of classes for base
9728
+ const normalizedBase = Array.isArray(base) ? base.join(" ") : base;
9729
+ if (normalizedBase && normalizedBase.trim()) {
9730
+ styleArray.push(normalizedBase);
9722
9731
  }
9723
9732
  if (Object.keys(nestedVariants).length > 0) {
9724
9733
  styleArray.push(nestedVariants);
@@ -9821,8 +9830,11 @@ function styled(component) {
9821
9830
  const variantPrefix = getVariantPrefix(namingOptions);
9822
9831
  const sep = namingOptions.separator || styledConfig.separator || "-";
9823
9832
  const variantSelector = `&.${variantPrefix}${variantKey}${sep}${variantValue}`;
9824
- if (variantClasses && variantClasses.trim()) {
9825
- nestedVariants[variantSelector] = variantClasses;
9833
+
9834
+ // Handle both string and array of classes
9835
+ const normalizedClasses = Array.isArray(variantClasses) ? variantClasses.join(" ") : variantClasses;
9836
+ if (normalizedClasses && normalizedClasses.trim()) {
9837
+ nestedVariants[variantSelector] = normalizedClasses;
9826
9838
  }
9827
9839
  });
9828
9840
  });
@@ -9830,7 +9842,7 @@ function styled(component) {
9830
9842
  // Generate compound variant selectors
9831
9843
  compoundVariants.forEach(compound => {
9832
9844
  const {
9833
- className: compoundClass,
9845
+ class: compoundClass,
9834
9846
  ...conditions
9835
9847
  } = compound;
9836
9848
 
@@ -9858,15 +9870,21 @@ function styled(component) {
9858
9870
  compoundSelector += `:not(.${negClass})`;
9859
9871
  });
9860
9872
  }
9861
- if (compoundClass && compoundClass.trim()) {
9862
- nestedVariants[compoundSelector] = compoundClass;
9873
+
9874
+ // Handle both string and array of classes
9875
+ const normalizedClass = Array.isArray(compoundClass) ? compoundClass.join(" ") : compoundClass;
9876
+ if (normalizedClass && normalizedClass.trim()) {
9877
+ nestedVariants[compoundSelector] = normalizedClass;
9863
9878
  }
9864
9879
  });
9865
9880
 
9866
9881
  // Build final nested structure: [base, { nested variants }]
9867
9882
  const styleArray = [];
9868
- if (base.trim()) {
9869
- styleArray.push(base);
9883
+
9884
+ // Handle both string and array of classes for base
9885
+ const normalizedBase = Array.isArray(base) ? base.join(" ") : base;
9886
+ if (normalizedBase && normalizedBase.trim()) {
9887
+ styleArray.push(normalizedBase);
9870
9888
  }
9871
9889
 
9872
9890
  // Add pseudo-state classes to nested
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.12.4
2
+ * tailwind-to-style v2.12.5
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tailwind-to-style v2.12.4
2
+ * tailwind-to-style v2.12.5
3
3
  * Convert tailwind classes to inline style
4
4
  *
5
5
  * @author Bigetion