@mgcrea/react-native-tailwind 0.9.0 → 0.10.0

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.
Files changed (73) hide show
  1. package/README.md +356 -30
  2. package/dist/babel/config-loader.test.ts +152 -0
  3. package/dist/babel/index.cjs +575 -60
  4. package/dist/babel/plugin.d.ts +23 -1
  5. package/dist/babel/plugin.test.ts +417 -0
  6. package/dist/babel/plugin.ts +265 -32
  7. package/dist/babel/utils/colorSchemeModifierProcessing.d.ts +34 -0
  8. package/dist/babel/utils/colorSchemeModifierProcessing.ts +89 -0
  9. package/dist/babel/utils/dynamicProcessing.d.ts +33 -2
  10. package/dist/babel/utils/dynamicProcessing.ts +352 -33
  11. package/dist/babel/utils/styleInjection.d.ts +14 -1
  12. package/dist/babel/utils/styleInjection.ts +125 -7
  13. package/dist/babel/utils/styleTransforms.test.ts +56 -0
  14. package/dist/babel/utils/twProcessing.d.ts +2 -0
  15. package/dist/babel/utils/twProcessing.ts +22 -1
  16. package/dist/parser/aspectRatio.js +1 -1
  17. package/dist/parser/aspectRatio.test.js +1 -1
  18. package/dist/parser/index.d.ts +2 -2
  19. package/dist/parser/index.js +1 -1
  20. package/dist/parser/modifiers.d.ts +48 -2
  21. package/dist/parser/modifiers.js +1 -1
  22. package/dist/parser/modifiers.test.js +1 -1
  23. package/dist/parser/spacing.d.ts +1 -1
  24. package/dist/parser/spacing.js +1 -1
  25. package/dist/parser/spacing.test.js +1 -1
  26. package/dist/runtime.cjs +1 -1
  27. package/dist/runtime.cjs.map +3 -3
  28. package/dist/runtime.js +1 -1
  29. package/dist/runtime.js.map +3 -3
  30. package/dist/runtime.test.js +1 -1
  31. package/dist/types/config.d.ts +7 -0
  32. package/dist/types/config.js +0 -0
  33. package/package.json +4 -4
  34. package/src/babel/config-loader.test.ts +152 -0
  35. package/src/babel/plugin.test.ts +417 -0
  36. package/src/babel/plugin.ts +265 -32
  37. package/src/babel/utils/colorSchemeModifierProcessing.ts +89 -0
  38. package/src/babel/utils/dynamicProcessing.ts +352 -33
  39. package/src/babel/utils/styleInjection.ts +125 -7
  40. package/src/babel/utils/styleTransforms.test.ts +56 -0
  41. package/src/babel/utils/twProcessing.ts +22 -1
  42. package/src/parser/aspectRatio.test.ts +25 -2
  43. package/src/parser/aspectRatio.ts +3 -3
  44. package/src/parser/index.ts +12 -1
  45. package/src/parser/modifiers.test.ts +151 -1
  46. package/src/parser/modifiers.ts +139 -4
  47. package/src/parser/spacing.test.ts +63 -0
  48. package/src/parser/spacing.ts +10 -6
  49. package/src/runtime.test.ts +27 -0
  50. package/src/runtime.ts +2 -1
  51. package/src/types/config.ts +7 -0
  52. package/dist/babel/index.test.ts +0 -481
  53. package/dist/config/palettes.d.ts +0 -302
  54. package/dist/config/palettes.js +0 -1
  55. package/dist/parser/__snapshots__/aspectRatio.test.js.snap +0 -9
  56. package/dist/parser/__snapshots__/borders.test.js.snap +0 -23
  57. package/dist/parser/__snapshots__/colors.test.js.snap +0 -251
  58. package/dist/parser/__snapshots__/shadows.test.js.snap +0 -76
  59. package/dist/parser/__snapshots__/sizing.test.js.snap +0 -61
  60. package/dist/parser/__snapshots__/spacing.test.js.snap +0 -40
  61. package/dist/parser/__snapshots__/transforms.test.js.snap +0 -58
  62. package/dist/parser/__snapshots__/typography.test.js.snap +0 -30
  63. package/dist/parser/aspectRatio.test.d.ts +0 -1
  64. package/dist/parser/borders.test.d.ts +0 -1
  65. package/dist/parser/colors.test.d.ts +0 -1
  66. package/dist/parser/layout.test.d.ts +0 -1
  67. package/dist/parser/modifiers.test.d.ts +0 -1
  68. package/dist/parser/shadows.test.d.ts +0 -1
  69. package/dist/parser/sizing.test.d.ts +0 -1
  70. package/dist/parser/spacing.test.d.ts +0 -1
  71. package/dist/parser/typography.test.d.ts +0 -1
  72. package/dist/types.d.ts +0 -42
  73. package/dist/types.js +0 -1
@@ -1,61 +0,0 @@
1
- // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
-
3
- exports[`SIZE_SCALE should export complete size scale 1`] = `
4
- {
5
- "0": 0,
6
- "0.5": 2,
7
- "1": 4,
8
- "1.5": 6,
9
- "10": 40,
10
- "11": 44,
11
- "12": 48,
12
- "14": 56,
13
- "16": 64,
14
- "2": 8,
15
- "2.5": 10,
16
- "20": 80,
17
- "24": 96,
18
- "28": 112,
19
- "3": 12,
20
- "3.5": 14,
21
- "32": 128,
22
- "36": 144,
23
- "4": 16,
24
- "40": 160,
25
- "44": 176,
26
- "48": 192,
27
- "5": 20,
28
- "52": 208,
29
- "56": 224,
30
- "6": 24,
31
- "60": 240,
32
- "64": 256,
33
- "7": 28,
34
- "72": 288,
35
- "8": 32,
36
- "80": 320,
37
- "9": 36,
38
- "96": 384,
39
- }
40
- `;
41
-
42
- exports[`SIZE_PERCENTAGES should export complete percentage sizes 1`] = `
43
- {
44
- "1/2": "50%",
45
- "1/3": "33.333333%",
46
- "1/4": "25%",
47
- "1/5": "20%",
48
- "1/6": "16.666667%",
49
- "2/3": "66.666667%",
50
- "2/4": "50%",
51
- "2/5": "40%",
52
- "2/6": "33.333333%",
53
- "3/4": "75%",
54
- "3/5": "60%",
55
- "3/6": "50%",
56
- "4/5": "80%",
57
- "4/6": "66.666667%",
58
- "5/6": "83.333333%",
59
- "full": "100%",
60
- }
61
- `;
@@ -1,40 +0,0 @@
1
- // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
-
3
- exports[`SPACING_SCALE should export complete spacing scale 1`] = `
4
- {
5
- "0": 0,
6
- "0.5": 2,
7
- "1": 4,
8
- "1.5": 6,
9
- "10": 40,
10
- "11": 44,
11
- "12": 48,
12
- "14": 56,
13
- "16": 64,
14
- "2": 8,
15
- "2.5": 10,
16
- "20": 80,
17
- "24": 96,
18
- "28": 112,
19
- "3": 12,
20
- "3.5": 14,
21
- "32": 128,
22
- "36": 144,
23
- "4": 16,
24
- "40": 160,
25
- "44": 176,
26
- "48": 192,
27
- "5": 20,
28
- "52": 208,
29
- "56": 224,
30
- "6": 24,
31
- "60": 240,
32
- "64": 256,
33
- "7": 28,
34
- "72": 288,
35
- "8": 32,
36
- "80": 320,
37
- "9": 36,
38
- "96": 384,
39
- }
40
- `;
@@ -1,58 +0,0 @@
1
- // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
-
3
- exports[`SCALE_MAP should export complete scale map 1`] = `
4
- {
5
- "0": 0,
6
- "100": 1,
7
- "105": 1.05,
8
- "110": 1.1,
9
- "125": 1.25,
10
- "150": 1.5,
11
- "200": 2,
12
- "50": 0.5,
13
- "75": 0.75,
14
- "90": 0.9,
15
- "95": 0.95,
16
- }
17
- `;
18
-
19
- exports[`ROTATE_MAP should export complete rotate map 1`] = `
20
- {
21
- "0": 0,
22
- "1": 1,
23
- "12": 12,
24
- "180": 180,
25
- "2": 2,
26
- "3": 3,
27
- "45": 45,
28
- "6": 6,
29
- "90": 90,
30
- }
31
- `;
32
-
33
- exports[`SKEW_MAP should export complete skew map 1`] = `
34
- {
35
- "0": 0,
36
- "1": 1,
37
- "12": 12,
38
- "2": 2,
39
- "3": 3,
40
- "6": 6,
41
- }
42
- `;
43
-
44
- exports[`PERSPECTIVE_SCALE should export complete perspective scale 1`] = `
45
- {
46
- "0": 0,
47
- "100": 100,
48
- "1000": 1000,
49
- "200": 200,
50
- "300": 300,
51
- "400": 400,
52
- "500": 500,
53
- "600": 600,
54
- "700": 700,
55
- "800": 800,
56
- "900": 900,
57
- }
58
- `;
@@ -1,30 +0,0 @@
1
- // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
-
3
- exports[`FONT_SIZES should export complete font size scale 1`] = `
4
- {
5
- "2xl": 24,
6
- "3xl": 30,
7
- "4xl": 36,
8
- "5xl": 48,
9
- "6xl": 60,
10
- "7xl": 72,
11
- "8xl": 96,
12
- "9xl": 128,
13
- "base": 16,
14
- "lg": 18,
15
- "sm": 14,
16
- "xl": 20,
17
- "xs": 12,
18
- }
19
- `;
20
-
21
- exports[`LETTER_SPACING_SCALE should export complete letter spacing scale 1`] = `
22
- {
23
- "normal": 0,
24
- "tight": -0.4,
25
- "tighter": -0.8,
26
- "wide": 0.4,
27
- "wider": 0.8,
28
- "widest": 1.6,
29
- }
30
- `;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
package/dist/types.d.ts DELETED
@@ -1,42 +0,0 @@
1
- /**
2
- * Core type definitions
3
- */
4
- import type { ImageStyle, TextStyle, ViewStyle } from "react-native";
5
- export type RNStyle = ViewStyle | TextStyle | ImageStyle;
6
- export type TransformStyle = {
7
- scale?: number;
8
- } | {
9
- scaleX?: number;
10
- } | {
11
- scaleY?: number;
12
- } | {
13
- rotate?: string;
14
- } | {
15
- rotateX?: string;
16
- } | {
17
- rotateY?: string;
18
- } | {
19
- rotateZ?: string;
20
- } | {
21
- translateX?: number | string;
22
- } | {
23
- translateY?: number | string;
24
- } | {
25
- skewX?: string;
26
- } | {
27
- skewY?: string;
28
- } | {
29
- perspective?: number;
30
- };
31
- export type ShadowOffsetStyle = {
32
- width: number;
33
- height: number;
34
- };
35
- export type StyleObject = {
36
- [key: string]: string | number | ShadowOffsetStyle | TransformStyle[] | undefined;
37
- shadowOffset?: ShadowOffsetStyle;
38
- transform?: TransformStyle[];
39
- };
40
- export type SpacingValue = number;
41
- export type ColorValue = string;
42
- export type Parser = (className: string) => StyleObject | null;
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});