@colimuca123/nativewind 4.2.2-rc.1
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/LICENSE +21 -0
- package/README.OpenSource +11 -0
- package/babel.js +1 -0
- package/dist/doctor.d.ts +1 -0
- package/dist/doctor.js +21 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/metro/common.d.ts +4 -0
- package/dist/metro/common.js +8 -0
- package/dist/metro/common.js.map +1 -0
- package/dist/metro/index.d.ts +15 -0
- package/dist/metro/index.js +47 -0
- package/dist/metro/index.js.map +1 -0
- package/dist/metro/picocolors.d.ts +26 -0
- package/dist/metro/picocolors.js +53 -0
- package/dist/metro/picocolors.js.map +1 -0
- package/dist/metro/tailwind/index.d.ts +5 -0
- package/dist/metro/tailwind/index.js +25 -0
- package/dist/metro/tailwind/index.js.map +1 -0
- package/dist/metro/tailwind/types.d.ts +8 -0
- package/dist/metro/tailwind/types.js +3 -0
- package/dist/metro/tailwind/types.js.map +1 -0
- package/dist/metro/tailwind/v3/child.d.ts +0 -0
- package/dist/metro/tailwind/v3/child.js +45 -0
- package/dist/metro/tailwind/v3/child.js.map +1 -0
- package/dist/metro/tailwind/v3/index.d.ts +6 -0
- package/dist/metro/tailwind/v3/index.js +81 -0
- package/dist/metro/tailwind/v3/index.js.map +1 -0
- package/dist/metro/typescript.d.ts +1 -0
- package/dist/metro/typescript.js +46 -0
- package/dist/metro/typescript.js.map +1 -0
- package/dist/stylesheet.d.ts +5 -0
- package/dist/stylesheet.js +25 -0
- package/dist/stylesheet.js.map +1 -0
- package/dist/tailwind/color.d.ts +4 -0
- package/dist/tailwind/color.js +25 -0
- package/dist/tailwind/color.js.map +1 -0
- package/dist/tailwind/common.d.ts +2 -0
- package/dist/tailwind/common.js +24 -0
- package/dist/tailwind/common.js.map +1 -0
- package/dist/tailwind/dark-mode.d.ts +4 -0
- package/dist/tailwind/dark-mode.js +48 -0
- package/dist/tailwind/dark-mode.js.map +1 -0
- package/dist/tailwind/index.d.ts +0 -0
- package/dist/tailwind/index.js +13 -0
- package/dist/tailwind/index.js.map +1 -0
- package/dist/tailwind/native.d.ts +3 -0
- package/dist/tailwind/native.js +265 -0
- package/dist/tailwind/native.js.map +1 -0
- package/dist/tailwind/prop-modifier.d.ts +4 -0
- package/dist/tailwind/prop-modifier.js +13 -0
- package/dist/tailwind/prop-modifier.js.map +1 -0
- package/dist/tailwind/safe-area.d.ts +4 -0
- package/dist/tailwind/safe-area.js +216 -0
- package/dist/tailwind/safe-area.js.map +1 -0
- package/dist/tailwind/shadows.d.ts +4 -0
- package/dist/tailwind/shadows.js +79 -0
- package/dist/tailwind/shadows.js.map +1 -0
- package/dist/tailwind/switch.d.ts +8 -0
- package/dist/tailwind/switch.js +51 -0
- package/dist/tailwind/switch.js.map +1 -0
- package/dist/tailwind/translate.d.ts +2 -0
- package/dist/tailwind/translate.js +40 -0
- package/dist/tailwind/translate.js.map +1 -0
- package/dist/tailwind/verify.d.ts +4 -0
- package/dist/tailwind/verify.js +22 -0
- package/dist/tailwind/verify.js.map +1 -0
- package/dist/tailwind/web.d.ts +3 -0
- package/dist/tailwind/web.js +40 -0
- package/dist/tailwind/web.js.map +1 -0
- package/dist/test.d.ts +373 -0
- package/dist/test.js +161 -0
- package/dist/test.js.map +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +9 -0
- package/dist/theme.js.map +1 -0
- package/expo-snack.js +71 -0
- package/jsx-dev-runtime/index.d.ts +1 -0
- package/jsx-dev-runtime/index.js +1 -0
- package/jsx-runtime/index.d.ts +1 -0
- package/jsx-runtime/index.js +1 -0
- package/metro/package.json +1 -0
- package/package.json +75 -0
- package/preset/package.json +3 -0
- package/src/__tests__/README.md +3 -0
- package/src/__tests__/accessibility.tsx +41 -0
- package/src/__tests__/backgrounds.tsx +239 -0
- package/src/__tests__/borders.tsx +355 -0
- package/src/__tests__/container-queries.tsx +59 -0
- package/src/__tests__/custom-theme.tsx +45 -0
- package/src/__tests__/custom.tsx +17 -0
- package/src/__tests__/dark-mode.ios.tsx +251 -0
- package/src/__tests__/doctor.tsx +13 -0
- package/src/__tests__/effects.ios.tsx +230 -0
- package/src/__tests__/elevation.tsx +22 -0
- package/src/__tests__/filters.tsx +201 -0
- package/src/__tests__/flexbox-grid.tsx +670 -0
- package/src/__tests__/groups.tsx +134 -0
- package/src/__tests__/interactivity.tsx +547 -0
- package/src/__tests__/layout.tsx +854 -0
- package/src/__tests__/modifier-{}.tsx +71 -0
- package/src/__tests__/platform-modifiers-test.ios.tsx +34 -0
- package/src/__tests__/preset.tsx +9 -0
- package/src/__tests__/reusing-styles.tsx +44 -0
- package/src/__tests__/safe-area.test.ios.tsx +427 -0
- package/src/__tests__/sizing.tsx +241 -0
- package/src/__tests__/spacing.tsx +106 -0
- package/src/__tests__/states.tsx +145 -0
- package/src/__tests__/svg.tsx +25 -0
- package/src/__tests__/tables.tsx +103 -0
- package/src/__tests__/theme.tsx +245 -0
- package/src/__tests__/transforms.tsx +509 -0
- package/src/__tests__/transition-animations.tsx +254 -0
- package/src/__tests__/typography.tsx +657 -0
- package/src/__tests__/unofficial-plugins.test.ios.tsx +171 -0
- package/src/doctor.ts +28 -0
- package/src/index.tsx +16 -0
- package/src/metro/common.ts +11 -0
- package/src/metro/index.ts +77 -0
- package/src/metro/picocolors.ts +76 -0
- package/src/metro/tailwind/index.ts +22 -0
- package/src/metro/tailwind/types.ts +9 -0
- package/src/metro/tailwind/v3/child.ts +61 -0
- package/src/metro/tailwind/v3/index.ts +103 -0
- package/src/metro/typescript.ts +69 -0
- package/src/stylesheet.ts +31 -0
- package/src/tailwind/color.ts +23 -0
- package/src/tailwind/common.ts +26 -0
- package/src/tailwind/dark-mode.ts +46 -0
- package/src/tailwind/index.ts +15 -0
- package/src/tailwind/native.ts +374 -0
- package/src/tailwind/prop-modifier.ts +7 -0
- package/src/tailwind/safe-area.ts +262 -0
- package/src/tailwind/shadows.ts +100 -0
- package/src/tailwind/switch.ts +59 -0
- package/src/tailwind/translate.ts +51 -0
- package/src/tailwind/verify.ts +16 -0
- package/src/tailwind/web.ts +38 -0
- package/src/tailwindcss-internals.d.ts +7 -0
- package/src/test.tsx +224 -0
- package/src/theme.ts +15 -0
- package/test/package.json +4 -0
- package/theme/package.json +3 -0
- package/types.d.ts +1 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { Dimensions } from "react-native";
|
|
2
|
+
|
|
3
|
+
import { renderCurrentTest } from "../test";
|
|
4
|
+
|
|
5
|
+
describe("Sizing - Width", () => {
|
|
6
|
+
test("w-0", async () => {
|
|
7
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
8
|
+
props: { style: { width: 0 } },
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
test("w-px", async () => {
|
|
12
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
13
|
+
props: { style: { width: 1 } },
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
test("w-1", async () => {
|
|
17
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
18
|
+
props: { style: { width: 3.5 } },
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
test("w-1/2", async () => {
|
|
22
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
23
|
+
props: { style: { width: "50%" } },
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
test("w-full", async () => {
|
|
27
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
28
|
+
props: { style: { width: "100%" } },
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
test("w-auto", async () => {
|
|
32
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
33
|
+
props: {},
|
|
34
|
+
invalid: { style: { width: "auto" } },
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
test("w-min", async () => {
|
|
38
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
39
|
+
props: {},
|
|
40
|
+
invalid: { style: { width: "min-content" } },
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
test("w-max", async () => {
|
|
44
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
45
|
+
props: {},
|
|
46
|
+
invalid: { style: { width: "max-content" } },
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
test("w-fit", async () => {
|
|
50
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
51
|
+
props: {},
|
|
52
|
+
invalid: { style: { width: "fit-content" } },
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
test("w-screen", async () => {
|
|
56
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
57
|
+
props: { style: { width: Dimensions.get("window").width } },
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe("Sizing - Min Width", () => {
|
|
63
|
+
test("min-w-0", async () => {
|
|
64
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
65
|
+
props: { style: { minWidth: 0 } },
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
test("min-w-full", async () => {
|
|
69
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
70
|
+
props: { style: { minWidth: "100%" } },
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
test("min-w-min", async () => {
|
|
74
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
75
|
+
props: {},
|
|
76
|
+
invalid: { style: { "min-width": "min-content" } },
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
test("min-w-max", async () => {
|
|
80
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
81
|
+
props: {},
|
|
82
|
+
invalid: { style: { "min-width": "max-content" } },
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
test("min-w-fit", async () => {
|
|
86
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
87
|
+
props: {},
|
|
88
|
+
invalid: { style: { "min-width": "fit-content" } },
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe("Sizing - Max Width", () => {
|
|
94
|
+
test("max-w-0", async () => {
|
|
95
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
96
|
+
props: { style: { maxWidth: 0 } },
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
test("max-w-full", async () => {
|
|
100
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
101
|
+
props: { style: { maxWidth: "100%" } },
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
test("max-w-min", async () => {
|
|
105
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
106
|
+
props: {},
|
|
107
|
+
invalid: { style: { "max-width": "min-content" } },
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
test("max-w-max", async () => {
|
|
111
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
112
|
+
props: {},
|
|
113
|
+
invalid: { style: { "max-width": "max-content" } },
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
test("max-w-fit", async () => {
|
|
117
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
118
|
+
props: {},
|
|
119
|
+
invalid: { style: { "max-width": "fit-content" } },
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
describe("Sizing - Height", () => {
|
|
125
|
+
test("h-0", async () => {
|
|
126
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
127
|
+
props: { style: { height: 0 } },
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
test("h-px", async () => {
|
|
131
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
132
|
+
props: { style: { height: 1 } },
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
test("h-1", async () => {
|
|
136
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
137
|
+
props: { style: { height: 3.5 } },
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
test("h-1/2", async () => {
|
|
141
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
142
|
+
props: { style: { height: "50%" } },
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
test("h-full", async () => {
|
|
146
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
147
|
+
props: { style: { height: "100%" } },
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
test("h-auto", async () => {
|
|
151
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
152
|
+
props: {},
|
|
153
|
+
invalid: { style: { height: "auto" } },
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
test("h-min", async () => {
|
|
157
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
158
|
+
props: {},
|
|
159
|
+
invalid: { style: { height: "min-content" } },
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
test("h-max", async () => {
|
|
163
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
164
|
+
props: {},
|
|
165
|
+
invalid: { style: { height: "max-content" } },
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
test("h-fit", async () => {
|
|
169
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
170
|
+
props: {},
|
|
171
|
+
invalid: { style: { height: "fit-content" } },
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
test("h-screen", async () => {
|
|
175
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
176
|
+
props: { style: { height: Dimensions.get("window").height } },
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe("Sizing - Min Height", () => {
|
|
182
|
+
test("min-h-0", async () => {
|
|
183
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
184
|
+
props: { style: { minHeight: 0 } },
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
test("min-h-full", async () => {
|
|
188
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
189
|
+
props: { style: { minHeight: "100%" } },
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
test("min-h-min", async () => {
|
|
193
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
194
|
+
props: {},
|
|
195
|
+
invalid: { style: { "min-height": "min-content" } },
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
test("min-h-max", async () => {
|
|
199
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
200
|
+
props: {},
|
|
201
|
+
invalid: { style: { "min-height": "max-content" } },
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
test("min-h-fit", async () => {
|
|
205
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
206
|
+
props: {},
|
|
207
|
+
invalid: { style: { "min-height": "fit-content" } },
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
describe("Sizing - Max Height", () => {
|
|
213
|
+
test("max-h-0", async () => {
|
|
214
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
215
|
+
props: { style: { maxHeight: 0 } },
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
test("max-h-full", async () => {
|
|
219
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
220
|
+
props: { style: { maxHeight: "100%" } },
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
test("max-h-min", async () => {
|
|
224
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
225
|
+
props: {},
|
|
226
|
+
invalid: { style: { "max-height": "min-content" } },
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
test("max-h-max", async () => {
|
|
230
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
231
|
+
props: {},
|
|
232
|
+
invalid: { style: { "max-height": "max-content" } },
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
test("max-h-fit", async () => {
|
|
236
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
237
|
+
props: {},
|
|
238
|
+
invalid: { style: { "max-height": "fit-content" } },
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { renderCurrentTest } from "../test";
|
|
2
|
+
|
|
3
|
+
describe("Spacing - Padding", () => {
|
|
4
|
+
test("p-0", async () => {
|
|
5
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
6
|
+
props: { style: { padding: 0 } },
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
test("px-0", async () => {
|
|
10
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
11
|
+
props: { style: { paddingLeft: 0, paddingRight: 0 } },
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test("py-0", async () => {
|
|
15
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
16
|
+
props: { style: { paddingTop: 0, paddingBottom: 0 } },
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
test("pt-0", async () => {
|
|
20
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
21
|
+
props: { style: { paddingTop: 0 } },
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
test("pr-0", async () => {
|
|
25
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
26
|
+
props: { style: { paddingRight: 0 } },
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
test("pb-0", async () => {
|
|
30
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
31
|
+
props: { style: { paddingBottom: 0 } },
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
test("pl-0", async () => {
|
|
35
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
36
|
+
props: { style: { paddingLeft: 0 } },
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
test("ps-0", async () => {
|
|
40
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
41
|
+
props: { style: { paddingStart: 0 } },
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
test("pe-0", async () => {
|
|
45
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
46
|
+
props: { style: { paddingEnd: 0 } },
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("Spacing - Margin", () => {
|
|
52
|
+
test("m-0", async () => {
|
|
53
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
54
|
+
props: { style: { margin: 0 } },
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
test("mx-0", async () => {
|
|
58
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
59
|
+
props: { style: { marginLeft: 0, marginRight: 0 } },
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
test("my-0", async () => {
|
|
63
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
64
|
+
props: { style: { marginTop: 0, marginBottom: 0 } },
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
test("mt-0", async () => {
|
|
68
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
69
|
+
props: { style: { marginTop: 0 } },
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
test("mr-0", async () => {
|
|
73
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
74
|
+
props: { style: { marginRight: 0 } },
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
test("mb-0", async () => {
|
|
78
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
79
|
+
props: { style: { marginBottom: 0 } },
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
test("ml-0", async () => {
|
|
83
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
84
|
+
props: { style: { marginLeft: 0 } },
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
test("ms-0", async () => {
|
|
88
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
89
|
+
props: { style: { marginStart: 0 } },
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
test("me-0", async () => {
|
|
93
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
94
|
+
props: { style: { marginEnd: 0 } },
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
test("m-auto", async () => {
|
|
98
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
99
|
+
props: { style: { margin: "auto" } },
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe.skip("Spacing - Space Between", () => {
|
|
105
|
+
// TODO
|
|
106
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/** @jsxImportSource nativewind */
|
|
2
|
+
import { Switch, TextInput, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { fireEvent, render, screen } from "../test";
|
|
5
|
+
|
|
6
|
+
const testID = "component";
|
|
7
|
+
|
|
8
|
+
test("hover", async () => {
|
|
9
|
+
await render(<TextInput testID={testID} className="hover:text-white" />);
|
|
10
|
+
|
|
11
|
+
const component = screen.getByTestId(testID);
|
|
12
|
+
|
|
13
|
+
expect(component).toHaveStyle(undefined);
|
|
14
|
+
|
|
15
|
+
fireEvent(component, "hoverIn");
|
|
16
|
+
expect(component).toHaveStyle({ color: "#ffffff" });
|
|
17
|
+
|
|
18
|
+
fireEvent(component, "hoverOut");
|
|
19
|
+
expect(component).toHaveStyle(undefined);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("focus", async () => {
|
|
23
|
+
await render(<TextInput testID={testID} className="focus:text-white" />);
|
|
24
|
+
|
|
25
|
+
const component = screen.getByTestId(testID);
|
|
26
|
+
|
|
27
|
+
expect(component).toHaveStyle(undefined);
|
|
28
|
+
|
|
29
|
+
fireEvent(component, "focus");
|
|
30
|
+
expect(component).toHaveStyle({ color: "#ffffff" });
|
|
31
|
+
|
|
32
|
+
fireEvent(component, "blur");
|
|
33
|
+
expect(component).toHaveStyle(undefined);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("active", async () => {
|
|
37
|
+
await render(<TextInput testID={testID} className="active:text-white" />);
|
|
38
|
+
|
|
39
|
+
const component = screen.getByTestId(testID);
|
|
40
|
+
|
|
41
|
+
expect(component).toHaveStyle(undefined);
|
|
42
|
+
|
|
43
|
+
fireEvent(component, "pressIn");
|
|
44
|
+
expect(component).toHaveStyle({ color: "#ffffff" });
|
|
45
|
+
|
|
46
|
+
fireEvent(component, "pressOut");
|
|
47
|
+
expect(component).toHaveStyle(undefined);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("mixed", async () => {
|
|
51
|
+
await render(
|
|
52
|
+
<TextInput testID={testID} className="active:hover:focus:text-white" />,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const component = screen.getByTestId(testID);
|
|
56
|
+
expect(component).toHaveStyle(undefined);
|
|
57
|
+
|
|
58
|
+
fireEvent(component, "pressIn");
|
|
59
|
+
expect(component).toHaveStyle(undefined);
|
|
60
|
+
|
|
61
|
+
fireEvent(component, "hoverIn");
|
|
62
|
+
expect(component).toHaveStyle(undefined);
|
|
63
|
+
|
|
64
|
+
fireEvent(component, "focus");
|
|
65
|
+
expect(component).toHaveStyle({ color: "#ffffff" });
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("selection", async () => {
|
|
69
|
+
await render(<TextInput testID={testID} className="selection:text-black" />);
|
|
70
|
+
|
|
71
|
+
const component = screen.getByTestId(testID);
|
|
72
|
+
expect(component.props).toEqual({
|
|
73
|
+
testID,
|
|
74
|
+
selectionColor: "#000000",
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test("ltr:", async () => {
|
|
79
|
+
await render(<View testID={testID} className="ltr:text-black" />);
|
|
80
|
+
|
|
81
|
+
const component = screen.getByTestId(testID);
|
|
82
|
+
expect(component).toHaveStyle({
|
|
83
|
+
color: "#000000",
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("placeholder", async () => {
|
|
88
|
+
await render(
|
|
89
|
+
<TextInput testID={testID} className="placeholder:text-black" />,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const component = screen.getByTestId(testID);
|
|
93
|
+
expect(component.props).toEqual({
|
|
94
|
+
testID,
|
|
95
|
+
placeholderTextColor: "#000000",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("disabled", async () => {
|
|
100
|
+
const { rerender } = await render(
|
|
101
|
+
<Switch testID={testID} className="disabled:bg-black" />,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const component = screen.getByTestId(testID);
|
|
105
|
+
expect(component.props).toEqual(
|
|
106
|
+
expect.objectContaining({
|
|
107
|
+
testID,
|
|
108
|
+
style: {
|
|
109
|
+
height: 31,
|
|
110
|
+
width: 51,
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
rerender(<Switch testID={testID} disabled className="disabled:bg-black" />);
|
|
116
|
+
|
|
117
|
+
expect(component.props).toEqual(
|
|
118
|
+
expect.objectContaining({
|
|
119
|
+
testID,
|
|
120
|
+
style: [
|
|
121
|
+
{
|
|
122
|
+
height: 31,
|
|
123
|
+
width: 51,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
backgroundColor: "#000000",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
}),
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
rerender(
|
|
133
|
+
<Switch testID={testID} disabled={false} className="disabled:bg-black" />,
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
expect(component.props).toEqual(
|
|
137
|
+
expect.objectContaining({
|
|
138
|
+
testID,
|
|
139
|
+
style: {
|
|
140
|
+
height: 31,
|
|
141
|
+
width: 51,
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { renderCurrentTest } from "../test";
|
|
2
|
+
|
|
3
|
+
describe("SVG - Fill", () => {
|
|
4
|
+
test("fill-black", async () => {
|
|
5
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
6
|
+
props: { fill: "#000000" },
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
describe("SVG - Stroke", () => {
|
|
12
|
+
test("stroke-black", async () => {
|
|
13
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
14
|
+
props: { stroke: "#000000" },
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe("SVG - Stroke Width", () => {
|
|
20
|
+
test("stroke-1", async () => {
|
|
21
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
22
|
+
props: { strokeWidth: 1 },
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { renderCurrentTest } from "../test";
|
|
2
|
+
|
|
3
|
+
describe("Tables - Border Collapse", () => {
|
|
4
|
+
test("border-collapse", async () => {
|
|
5
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
6
|
+
props: {},
|
|
7
|
+
invalid: { properties: ["border-collapse"] },
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
test("border-separate", async () => {
|
|
11
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
12
|
+
props: {},
|
|
13
|
+
invalid: { properties: ["border-collapse"] },
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe("Tables - Border Spacing", () => {
|
|
19
|
+
test("border-spacing-0", async () => {
|
|
20
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
21
|
+
props: {},
|
|
22
|
+
invalid: { properties: ["border-spacing"] },
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
test("border-spacing-x-0", async () => {
|
|
26
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
27
|
+
props: {},
|
|
28
|
+
invalid: { properties: ["border-spacing"] },
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
test("border-spacing-y-0", async () => {
|
|
32
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
33
|
+
props: {},
|
|
34
|
+
invalid: { properties: ["border-spacing"] },
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
test("border-spacing-px", async () => {
|
|
38
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
39
|
+
props: {},
|
|
40
|
+
invalid: { properties: ["border-spacing"] },
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
test("border-spacing-x-px", async () => {
|
|
44
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
45
|
+
props: {},
|
|
46
|
+
invalid: { properties: ["border-spacing"] },
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
test("border-spacing-y-px", async () => {
|
|
50
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
51
|
+
props: {},
|
|
52
|
+
invalid: { properties: ["border-spacing"] },
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
test("border-spacing-1", async () => {
|
|
56
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
57
|
+
props: {},
|
|
58
|
+
invalid: { properties: ["border-spacing"] },
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
test("border-spacing-x-1", async () => {
|
|
62
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
63
|
+
props: {},
|
|
64
|
+
invalid: { properties: ["border-spacing"] },
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
test("border-spacing-y-1", async () => {
|
|
68
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
69
|
+
props: {},
|
|
70
|
+
invalid: { properties: ["border-spacing"] },
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("Tables - Table Layout", () => {
|
|
76
|
+
test("table-auto", async () => {
|
|
77
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
78
|
+
props: {},
|
|
79
|
+
invalid: { properties: ["table-layout"] },
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
test("table-fixed", async () => {
|
|
83
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
84
|
+
props: {},
|
|
85
|
+
invalid: { properties: ["table-layout"] },
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe("Tables - Caption Side", () => {
|
|
91
|
+
test("caption-top", async () => {
|
|
92
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
93
|
+
props: {},
|
|
94
|
+
invalid: { properties: ["caption-side"] },
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
test("caption-bottom", async () => {
|
|
98
|
+
expect(await renderCurrentTest()).toStrictEqual({
|
|
99
|
+
props: {},
|
|
100
|
+
invalid: { properties: ["caption-side"] },
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|