@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.
Files changed (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.OpenSource +11 -0
  3. package/babel.js +1 -0
  4. package/dist/doctor.d.ts +1 -0
  5. package/dist/doctor.js +21 -0
  6. package/dist/doctor.js.map +1 -0
  7. package/dist/index.d.ts +4 -0
  8. package/dist/index.js +20 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/metro/common.d.ts +4 -0
  11. package/dist/metro/common.js +8 -0
  12. package/dist/metro/common.js.map +1 -0
  13. package/dist/metro/index.d.ts +15 -0
  14. package/dist/metro/index.js +47 -0
  15. package/dist/metro/index.js.map +1 -0
  16. package/dist/metro/picocolors.d.ts +26 -0
  17. package/dist/metro/picocolors.js +53 -0
  18. package/dist/metro/picocolors.js.map +1 -0
  19. package/dist/metro/tailwind/index.d.ts +5 -0
  20. package/dist/metro/tailwind/index.js +25 -0
  21. package/dist/metro/tailwind/index.js.map +1 -0
  22. package/dist/metro/tailwind/types.d.ts +8 -0
  23. package/dist/metro/tailwind/types.js +3 -0
  24. package/dist/metro/tailwind/types.js.map +1 -0
  25. package/dist/metro/tailwind/v3/child.d.ts +0 -0
  26. package/dist/metro/tailwind/v3/child.js +45 -0
  27. package/dist/metro/tailwind/v3/child.js.map +1 -0
  28. package/dist/metro/tailwind/v3/index.d.ts +6 -0
  29. package/dist/metro/tailwind/v3/index.js +81 -0
  30. package/dist/metro/tailwind/v3/index.js.map +1 -0
  31. package/dist/metro/typescript.d.ts +1 -0
  32. package/dist/metro/typescript.js +46 -0
  33. package/dist/metro/typescript.js.map +1 -0
  34. package/dist/stylesheet.d.ts +5 -0
  35. package/dist/stylesheet.js +25 -0
  36. package/dist/stylesheet.js.map +1 -0
  37. package/dist/tailwind/color.d.ts +4 -0
  38. package/dist/tailwind/color.js +25 -0
  39. package/dist/tailwind/color.js.map +1 -0
  40. package/dist/tailwind/common.d.ts +2 -0
  41. package/dist/tailwind/common.js +24 -0
  42. package/dist/tailwind/common.js.map +1 -0
  43. package/dist/tailwind/dark-mode.d.ts +4 -0
  44. package/dist/tailwind/dark-mode.js +48 -0
  45. package/dist/tailwind/dark-mode.js.map +1 -0
  46. package/dist/tailwind/index.d.ts +0 -0
  47. package/dist/tailwind/index.js +13 -0
  48. package/dist/tailwind/index.js.map +1 -0
  49. package/dist/tailwind/native.d.ts +3 -0
  50. package/dist/tailwind/native.js +265 -0
  51. package/dist/tailwind/native.js.map +1 -0
  52. package/dist/tailwind/prop-modifier.d.ts +4 -0
  53. package/dist/tailwind/prop-modifier.js +13 -0
  54. package/dist/tailwind/prop-modifier.js.map +1 -0
  55. package/dist/tailwind/safe-area.d.ts +4 -0
  56. package/dist/tailwind/safe-area.js +216 -0
  57. package/dist/tailwind/safe-area.js.map +1 -0
  58. package/dist/tailwind/shadows.d.ts +4 -0
  59. package/dist/tailwind/shadows.js +79 -0
  60. package/dist/tailwind/shadows.js.map +1 -0
  61. package/dist/tailwind/switch.d.ts +8 -0
  62. package/dist/tailwind/switch.js +51 -0
  63. package/dist/tailwind/switch.js.map +1 -0
  64. package/dist/tailwind/translate.d.ts +2 -0
  65. package/dist/tailwind/translate.js +40 -0
  66. package/dist/tailwind/translate.js.map +1 -0
  67. package/dist/tailwind/verify.d.ts +4 -0
  68. package/dist/tailwind/verify.js +22 -0
  69. package/dist/tailwind/verify.js.map +1 -0
  70. package/dist/tailwind/web.d.ts +3 -0
  71. package/dist/tailwind/web.js +40 -0
  72. package/dist/tailwind/web.js.map +1 -0
  73. package/dist/test.d.ts +373 -0
  74. package/dist/test.js +161 -0
  75. package/dist/test.js.map +1 -0
  76. package/dist/theme.d.ts +1 -0
  77. package/dist/theme.js +9 -0
  78. package/dist/theme.js.map +1 -0
  79. package/expo-snack.js +71 -0
  80. package/jsx-dev-runtime/index.d.ts +1 -0
  81. package/jsx-dev-runtime/index.js +1 -0
  82. package/jsx-runtime/index.d.ts +1 -0
  83. package/jsx-runtime/index.js +1 -0
  84. package/metro/package.json +1 -0
  85. package/package.json +75 -0
  86. package/preset/package.json +3 -0
  87. package/src/__tests__/README.md +3 -0
  88. package/src/__tests__/accessibility.tsx +41 -0
  89. package/src/__tests__/backgrounds.tsx +239 -0
  90. package/src/__tests__/borders.tsx +355 -0
  91. package/src/__tests__/container-queries.tsx +59 -0
  92. package/src/__tests__/custom-theme.tsx +45 -0
  93. package/src/__tests__/custom.tsx +17 -0
  94. package/src/__tests__/dark-mode.ios.tsx +251 -0
  95. package/src/__tests__/doctor.tsx +13 -0
  96. package/src/__tests__/effects.ios.tsx +230 -0
  97. package/src/__tests__/elevation.tsx +22 -0
  98. package/src/__tests__/filters.tsx +201 -0
  99. package/src/__tests__/flexbox-grid.tsx +670 -0
  100. package/src/__tests__/groups.tsx +134 -0
  101. package/src/__tests__/interactivity.tsx +547 -0
  102. package/src/__tests__/layout.tsx +854 -0
  103. package/src/__tests__/modifier-{}.tsx +71 -0
  104. package/src/__tests__/platform-modifiers-test.ios.tsx +34 -0
  105. package/src/__tests__/preset.tsx +9 -0
  106. package/src/__tests__/reusing-styles.tsx +44 -0
  107. package/src/__tests__/safe-area.test.ios.tsx +427 -0
  108. package/src/__tests__/sizing.tsx +241 -0
  109. package/src/__tests__/spacing.tsx +106 -0
  110. package/src/__tests__/states.tsx +145 -0
  111. package/src/__tests__/svg.tsx +25 -0
  112. package/src/__tests__/tables.tsx +103 -0
  113. package/src/__tests__/theme.tsx +245 -0
  114. package/src/__tests__/transforms.tsx +509 -0
  115. package/src/__tests__/transition-animations.tsx +254 -0
  116. package/src/__tests__/typography.tsx +657 -0
  117. package/src/__tests__/unofficial-plugins.test.ios.tsx +171 -0
  118. package/src/doctor.ts +28 -0
  119. package/src/index.tsx +16 -0
  120. package/src/metro/common.ts +11 -0
  121. package/src/metro/index.ts +77 -0
  122. package/src/metro/picocolors.ts +76 -0
  123. package/src/metro/tailwind/index.ts +22 -0
  124. package/src/metro/tailwind/types.ts +9 -0
  125. package/src/metro/tailwind/v3/child.ts +61 -0
  126. package/src/metro/tailwind/v3/index.ts +103 -0
  127. package/src/metro/typescript.ts +69 -0
  128. package/src/stylesheet.ts +31 -0
  129. package/src/tailwind/color.ts +23 -0
  130. package/src/tailwind/common.ts +26 -0
  131. package/src/tailwind/dark-mode.ts +46 -0
  132. package/src/tailwind/index.ts +15 -0
  133. package/src/tailwind/native.ts +374 -0
  134. package/src/tailwind/prop-modifier.ts +7 -0
  135. package/src/tailwind/safe-area.ts +262 -0
  136. package/src/tailwind/shadows.ts +100 -0
  137. package/src/tailwind/switch.ts +59 -0
  138. package/src/tailwind/translate.ts +51 -0
  139. package/src/tailwind/verify.ts +16 -0
  140. package/src/tailwind/web.ts +38 -0
  141. package/src/tailwindcss-internals.d.ts +7 -0
  142. package/src/test.tsx +224 -0
  143. package/src/theme.ts +15 -0
  144. package/test/package.json +4 -0
  145. package/theme/package.json +3 -0
  146. package/types.d.ts +1 -0
@@ -0,0 +1,71 @@
1
+ import { renderCurrentTest } from "../test";
2
+
3
+ describe("{}/<props>:", () => {
4
+ test("{}/test:color-black", async () => {
5
+ expect(await renderCurrentTest()).toStrictEqual({
6
+ props: { test: "#000000" },
7
+ });
8
+ });
9
+ test("{}/test.nested:color-black", async () => {
10
+ expect(await renderCurrentTest()).toStrictEqual({
11
+ props: { test: { nested: "#000000" } },
12
+ });
13
+ });
14
+ test("{}/&test:color-black", async () => {
15
+ expect(await renderCurrentTest()).toStrictEqual({
16
+ props: { style: { test: "#000000" } },
17
+ });
18
+ });
19
+ test("{}/&test.nested:color-black", async () => {
20
+ expect(await renderCurrentTest()).toStrictEqual({
21
+ props: { style: { test: { nested: "#000000" } } },
22
+ });
23
+ });
24
+ });
25
+
26
+ // {}-[prop] is an alias for {}/<prop>:
27
+ describe("{}-[prop]:", () => {
28
+ test("{}-[test]:color-black", async () => {
29
+ expect(await renderCurrentTest()).toStrictEqual({
30
+ props: { test: "#000000" },
31
+ });
32
+ });
33
+ test("{}-[test.nested]:color-black", async () => {
34
+ expect(await renderCurrentTest()).toStrictEqual({
35
+ props: { test: { nested: "#000000" } },
36
+ });
37
+ });
38
+ test("{}-[&test]:color-black", async () => {
39
+ expect(await renderCurrentTest()).toStrictEqual({
40
+ props: { style: { test: "#000000" } },
41
+ });
42
+ });
43
+ test("{}-[&test.nested]:color-black", async () => {
44
+ expect(await renderCurrentTest()).toStrictEqual({
45
+ props: { style: { test: { nested: "#000000" } } },
46
+ });
47
+ });
48
+ });
49
+
50
+ describe("{}-[props]/<attributes>:", () => {
51
+ test("{}-[test]/fontSize:text-base", async () => {
52
+ expect(await renderCurrentTest()).toStrictEqual({
53
+ props: { test: 14, style: { lineHeight: 21 } },
54
+ });
55
+ });
56
+ test("{}-[test.nested]/fontSize:text-base", async () => {
57
+ expect(await renderCurrentTest()).toStrictEqual({
58
+ props: { test: { nested: 14 }, style: { lineHeight: 21 } },
59
+ });
60
+ });
61
+ test("{}-[&test]/fontSize:text-base", async () => {
62
+ expect(await renderCurrentTest()).toStrictEqual({
63
+ props: { style: { lineHeight: 21, test: 14 } },
64
+ });
65
+ });
66
+ test("{}-[&test.nested]/fontSize:text-base", async () => {
67
+ expect(await renderCurrentTest()).toStrictEqual({
68
+ props: { style: { lineHeight: 21, test: { nested: 14 } } },
69
+ });
70
+ });
71
+ });
@@ -0,0 +1,34 @@
1
+ /** @jsxImportSource nativewind */
2
+ import { View } from "react-native";
3
+
4
+ import { screen } from "@testing-library/react-native";
5
+
6
+ import { render } from "../test";
7
+
8
+ const testID = "react-native-css-interop";
9
+
10
+ test("platformModifiers: ios", async () => {
11
+ await render(
12
+ <View
13
+ testID={testID}
14
+ className="ios:text-white android:text-black web:text-red-500"
15
+ />,
16
+ );
17
+
18
+ const component = screen.getByTestId(testID);
19
+
20
+ expect(component).toHaveStyle({ color: "#ffffff" });
21
+ });
22
+
23
+ test("platformModifiers: ios native", async () => {
24
+ await render(
25
+ <View
26
+ testID={testID}
27
+ className="ios:text-white native:text-black web:text-red-500"
28
+ />,
29
+ );
30
+
31
+ const component = screen.getByTestId(testID);
32
+
33
+ expect(component).toHaveStyle({ color: "#000000" });
34
+ });
@@ -0,0 +1,9 @@
1
+ import { renderCurrentTest } from "../test";
2
+
3
+ describe("Preset - color-*", () => {
4
+ test("color-black", async () => {
5
+ expect(await renderCurrentTest()).toStrictEqual({
6
+ props: { style: { color: "#000000" } },
7
+ });
8
+ });
9
+ });
@@ -0,0 +1,44 @@
1
+ /** @jsxImportSource nativewind */
2
+ import { View } from "react-native";
3
+
4
+ import { screen } from "@testing-library/react-native";
5
+
6
+ import { render } from "../test";
7
+
8
+ const testID = "react-native-css-interop";
9
+
10
+ test("@apply", async () => {
11
+ await render(<View testID={testID} className="btn-primary" />, {
12
+ css: `
13
+ @tailwind base;
14
+ @tailwind components;
15
+ @tailwind utilities;
16
+
17
+ @layer components {
18
+ .btn-primary {
19
+ @apply py-2 px-4 bg-blue-500 text-white font-semibold rounded-lg shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400;
20
+ }
21
+ }
22
+ `,
23
+ });
24
+
25
+ const component = screen.getByTestId(testID);
26
+
27
+ expect(component).toHaveStyle({
28
+ backgroundColor: "#3b82f6",
29
+ borderRadius: 7,
30
+ color: "#ffffff",
31
+ fontWeight: "600",
32
+ paddingBottom: 7,
33
+ paddingLeft: 14,
34
+ paddingRight: 14,
35
+ paddingTop: 7,
36
+ shadowColor: "#00000059",
37
+ shadowOpacity: 1,
38
+ shadowOffset: {
39
+ width: 0,
40
+ height: 3,
41
+ },
42
+ shadowRadius: 10,
43
+ });
44
+ });
@@ -0,0 +1,427 @@
1
+ /** @jsxImportSource nativewind */
2
+ import { ViewProps } from "react-native";
3
+
4
+ import { Metrics, SafeAreaProvider } from "react-native-safe-area-context";
5
+
6
+ import { INTERNAL_SET, native, renderCurrentTest } from "../test";
7
+
8
+ const { vh } = native;
9
+
10
+ const initialMetrics: Metrics = {
11
+ insets: {
12
+ top: 10,
13
+ bottom: 10,
14
+ left: 10,
15
+ right: 10,
16
+ },
17
+ frame: {
18
+ x: 0,
19
+ y: 0,
20
+ height: 100,
21
+ width: 100,
22
+ },
23
+ };
24
+
25
+ const cssOptions = {
26
+ inlineRem: 14,
27
+ };
28
+
29
+ function Wrapper({ children }: ViewProps) {
30
+ return (
31
+ <SafeAreaProvider initialMetrics={initialMetrics}>
32
+ {children}
33
+ </SafeAreaProvider>
34
+ );
35
+ }
36
+
37
+ test("works without the wrapper", async () => {
38
+ expect(await renderCurrentTest({ cssOptions })).toStrictEqual({
39
+ props: {},
40
+ });
41
+ });
42
+
43
+ test("m-safe", async () => {
44
+ expect(
45
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
46
+ ).toStrictEqual({
47
+ props: {
48
+ style: {
49
+ marginBottom: 10,
50
+ marginLeft: 10,
51
+ marginRight: 10,
52
+ marginTop: 10,
53
+ },
54
+ },
55
+ });
56
+ });
57
+
58
+ test("mx-safe", async () => {
59
+ expect(
60
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
61
+ ).toStrictEqual({
62
+ props: {
63
+ style: {
64
+ marginLeft: 10,
65
+ marginRight: 10,
66
+ },
67
+ },
68
+ });
69
+ });
70
+ test("my-safe", async () => {
71
+ expect(
72
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
73
+ ).toStrictEqual({
74
+ props: {
75
+ style: {
76
+ marginBottom: 10,
77
+ marginTop: 10,
78
+ },
79
+ },
80
+ });
81
+ });
82
+ test("ms-safe", async () => {
83
+ expect(
84
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
85
+ ).toStrictEqual({
86
+ props: {
87
+ style: {
88
+ marginStart: 10,
89
+ },
90
+ },
91
+ });
92
+ });
93
+ test("me-safe", async () => {
94
+ expect(
95
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
96
+ ).toStrictEqual({
97
+ props: {
98
+ style: {
99
+ marginEnd: 10,
100
+ },
101
+ },
102
+ });
103
+ });
104
+ test("mt-safe", async () => {
105
+ expect(
106
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
107
+ ).toStrictEqual({
108
+ props: {
109
+ style: {
110
+ marginTop: 10,
111
+ },
112
+ },
113
+ });
114
+ });
115
+ test("mr-safe", async () => {
116
+ expect(
117
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
118
+ ).toStrictEqual({
119
+ props: {
120
+ style: {
121
+ marginRight: 10,
122
+ },
123
+ },
124
+ });
125
+ });
126
+ test("mb-safe", async () => {
127
+ expect(
128
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
129
+ ).toStrictEqual({
130
+ props: {
131
+ style: {
132
+ marginBottom: 10,
133
+ },
134
+ },
135
+ });
136
+ });
137
+
138
+ test("ml-safe", async () => {
139
+ expect(
140
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
141
+ ).toStrictEqual({
142
+ props: {
143
+ style: {
144
+ marginLeft: 10,
145
+ },
146
+ },
147
+ });
148
+ });
149
+
150
+ test("p-safe", async () => {
151
+ expect(
152
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
153
+ ).toStrictEqual({
154
+ props: {
155
+ style: {
156
+ paddingBottom: 10,
157
+ paddingLeft: 10,
158
+ paddingRight: 10,
159
+ paddingTop: 10,
160
+ },
161
+ },
162
+ });
163
+ });
164
+
165
+ test("px-safe", async () => {
166
+ expect(
167
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
168
+ ).toStrictEqual({
169
+ props: {
170
+ style: {
171
+ paddingLeft: 10,
172
+ paddingRight: 10,
173
+ },
174
+ },
175
+ });
176
+ });
177
+ test("py-safe", async () => {
178
+ expect(
179
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
180
+ ).toStrictEqual({
181
+ props: {
182
+ style: {
183
+ paddingBottom: 10,
184
+ paddingTop: 10,
185
+ },
186
+ },
187
+ });
188
+ });
189
+ test("ps-safe", async () => {
190
+ expect(
191
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
192
+ ).toStrictEqual({
193
+ props: {
194
+ style: {
195
+ paddingStart: 10,
196
+ },
197
+ },
198
+ });
199
+ });
200
+ test("pe-safe", async () => {
201
+ expect(
202
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
203
+ ).toStrictEqual({
204
+ props: {
205
+ style: {
206
+ paddingEnd: 10,
207
+ },
208
+ },
209
+ });
210
+ });
211
+ test("pt-safe", async () => {
212
+ expect(
213
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
214
+ ).toStrictEqual({
215
+ props: {
216
+ style: {
217
+ paddingTop: 10,
218
+ },
219
+ },
220
+ });
221
+ });
222
+ test("pr-safe", async () => {
223
+ expect(
224
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
225
+ ).toStrictEqual({
226
+ props: {
227
+ style: {
228
+ paddingRight: 10,
229
+ },
230
+ },
231
+ });
232
+ });
233
+ test("pb-safe", async () => {
234
+ expect(
235
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
236
+ ).toStrictEqual({
237
+ props: {
238
+ style: {
239
+ paddingBottom: 10,
240
+ },
241
+ },
242
+ });
243
+ });
244
+ test("pl-safe", async () => {
245
+ expect(
246
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
247
+ ).toStrictEqual({
248
+ props: {
249
+ style: {
250
+ paddingLeft: 10,
251
+ },
252
+ },
253
+ });
254
+ });
255
+
256
+ test("min-h-screen-safe", async () => {
257
+ vh[INTERNAL_SET](100);
258
+
259
+ // calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
260
+ expect(
261
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
262
+ ).toStrictEqual({
263
+ props: {
264
+ style: {
265
+ minHeight: 80,
266
+ },
267
+ },
268
+ });
269
+ });
270
+
271
+ test("max-h-screen-safe", async () => {
272
+ vh[INTERNAL_SET](100);
273
+
274
+ // calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
275
+ expect(
276
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
277
+ ).toStrictEqual({
278
+ props: {
279
+ style: {
280
+ maxHeight: 80,
281
+ },
282
+ },
283
+ });
284
+ });
285
+
286
+ test("h-screen-safe", async () => {
287
+ vh[INTERNAL_SET](100);
288
+
289
+ // calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
290
+ expect(
291
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
292
+ ).toStrictEqual({
293
+ props: {
294
+ style: {
295
+ height: 80,
296
+ },
297
+ },
298
+ });
299
+ });
300
+
301
+ test("inset-safe", async () =>
302
+ expect(
303
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
304
+ ).toStrictEqual({
305
+ props: {
306
+ style: {
307
+ bottom: 10,
308
+ left: 10,
309
+ right: 10,
310
+ top: 10,
311
+ },
312
+ },
313
+ }));
314
+ test("inset-x-safe", async () =>
315
+ expect(
316
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
317
+ ).toStrictEqual({
318
+ props: {
319
+ style: {
320
+ left: 10,
321
+ right: 10,
322
+ },
323
+ },
324
+ }));
325
+ test("inset-y-safe", async () =>
326
+ expect(
327
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
328
+ ).toStrictEqual({
329
+ props: {
330
+ style: {
331
+ bottom: 10,
332
+ top: 10,
333
+ },
334
+ },
335
+ }));
336
+ test("start-safe", async () =>
337
+ expect(
338
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
339
+ ).toStrictEqual({
340
+ props: {
341
+ style: {
342
+ insetInlineStart: 10,
343
+ },
344
+ },
345
+ }));
346
+ test("end-safe", async () =>
347
+ expect(
348
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
349
+ ).toStrictEqual({
350
+ props: {
351
+ style: {
352
+ insetInlineEnd: 10,
353
+ },
354
+ },
355
+ }));
356
+ test("top-safe", async () =>
357
+ expect(
358
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
359
+ ).toStrictEqual({
360
+ props: {
361
+ style: {
362
+ top: 10,
363
+ },
364
+ },
365
+ }));
366
+ test("right-safe", async () =>
367
+ expect(
368
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
369
+ ).toStrictEqual({
370
+ props: {
371
+ style: {
372
+ right: 10,
373
+ },
374
+ },
375
+ }));
376
+ test("bottom-safe", async () =>
377
+ expect(
378
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
379
+ ).toStrictEqual({
380
+ props: {
381
+ style: {
382
+ bottom: 10,
383
+ },
384
+ },
385
+ }));
386
+ test("left-safe", async () =>
387
+ expect(
388
+ await renderCurrentTest({ wrapper: Wrapper, cssOptions }),
389
+ ).toStrictEqual({
390
+ props: {
391
+ style: {
392
+ left: 10,
393
+ },
394
+ },
395
+ }));
396
+
397
+ test("pb-safe-offset-4", async () => {
398
+ // calc(env(safe-area-inset-right) + 2rem);
399
+ expect(
400
+ await renderCurrentTest({
401
+ wrapper: Wrapper,
402
+ cssOptions,
403
+ }),
404
+ ).toStrictEqual({
405
+ props: {
406
+ style: {
407
+ paddingBottom: 24, // 10 + 14
408
+ },
409
+ },
410
+ });
411
+ });
412
+
413
+ test("pb-safe-or-20", async () => {
414
+ // max(env(safe-area-inset-right), 5rem);
415
+ expect(
416
+ await renderCurrentTest({
417
+ wrapper: Wrapper,
418
+ cssOptions,
419
+ }),
420
+ ).toStrictEqual({
421
+ props: {
422
+ style: {
423
+ paddingBottom: cssOptions.inlineRem * 5,
424
+ },
425
+ },
426
+ });
427
+ });