tailwind-variants 0.0.18 → 0.0.21

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.
@@ -0,0 +1,33 @@
1
+ import {transformer} from "../transformer";
2
+
3
+ describe("Responsive Variants", () => {
4
+ test("should return a transformed content", () => {
5
+ const tvImport = 'import {tv} from "tailwind-variants";';
6
+ const tvComponent = 'const button = tv({ variants: { color: { primary: "bg-blue-600" } } });';
7
+ const sourceCode = tvImport.concat(tvComponent);
8
+
9
+ const result = transformer(sourceCode);
10
+
11
+ const transformedContent = [
12
+ {
13
+ color: {
14
+ primary: {
15
+ original: "bg-blue-600",
16
+ xs: "xs:bg-blue-600",
17
+ sm: "sm:bg-blue-600",
18
+ md: "md:bg-blue-600",
19
+ lg: "lg:bg-blue-600",
20
+ xl: "xl:bg-blue-600",
21
+ "2xl": "2xl:bg-blue-600",
22
+ },
23
+ },
24
+ },
25
+ ];
26
+
27
+ const expectedResult = sourceCode.concat(
28
+ `\n/*\n\n${JSON.stringify(transformedContent, undefined, 2)}\n\n*/\n`,
29
+ );
30
+
31
+ expect(result).toBe(expectedResult);
32
+ });
33
+ });