@tamagui/helpers 1.0.0-alpha.8 → 1.0.0-beta.187

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 (62) hide show
  1. package/dist/cjs/concatClassName.js +87 -0
  2. package/dist/cjs/concatClassName.js.map +7 -0
  3. package/dist/cjs/index.js +21 -0
  4. package/dist/cjs/index.js.map +7 -0
  5. package/dist/cjs/log.js +28 -0
  6. package/dist/cjs/log.js.map +7 -0
  7. package/dist/cjs/simpleHash.js +33 -0
  8. package/dist/cjs/simpleHash.js.map +7 -0
  9. package/dist/cjs/types.js +16 -0
  10. package/dist/cjs/types.js.map +7 -0
  11. package/dist/{index.cjs → cjs/validStyleProps.js} +50 -94
  12. package/dist/cjs/validStyleProps.js.map +7 -0
  13. package/dist/{concatClassName.js → esm/concatClassName.js} +8 -11
  14. package/dist/esm/concatClassName.js.map +7 -0
  15. package/dist/{index.js → esm/index.js} +1 -1
  16. package/dist/{index.js.map → esm/index.js.map} +2 -2
  17. package/dist/esm/log.js +10 -0
  18. package/dist/esm/log.js.map +7 -0
  19. package/dist/{simpleHash.js → esm/simpleHash.js} +0 -0
  20. package/dist/{simpleHash.js.map → esm/simpleHash.js.map} +2 -2
  21. package/dist/{types.js → esm/types.js} +0 -0
  22. package/dist/{types.js.map → esm/types.js.map} +0 -0
  23. package/dist/{validStyleProps.js → esm/validStyleProps.js} +35 -9
  24. package/dist/esm/validStyleProps.js.map +7 -0
  25. package/dist/jsx/concatClassName.js +68 -0
  26. package/dist/jsx/index.js +4 -0
  27. package/dist/jsx/log.js +9 -0
  28. package/dist/jsx/simpleHash.js +14 -0
  29. package/dist/jsx/types.js +0 -0
  30. package/{src/validStyleProps.ts → dist/jsx/validStyleProps.js} +58 -35
  31. package/package.json +13 -10
  32. package/types/concatClassName.d.ts +2 -0
  33. package/types/concatClassName.d.ts.map +1 -0
  34. package/types/index.d.ts +5 -0
  35. package/types/index.d.ts.map +1 -0
  36. package/types/log.d.ts +2 -0
  37. package/types/log.d.ts.map +1 -0
  38. package/types/simpleHash.d.ts +2 -0
  39. package/types/simpleHash.d.ts.map +1 -0
  40. package/types/types.d.ts +8 -0
  41. package/types/types.d.ts.map +1 -0
  42. package/types/validStyleProps.d.ts +517 -0
  43. package/types/validStyleProps.d.ts.map +1 -0
  44. package/dist/allRules.js +0 -9
  45. package/dist/allRules.js.map +0 -7
  46. package/dist/concatClassName.js.map +0 -7
  47. package/dist/getNiceKey.js +0 -16
  48. package/dist/getNiceKey.js.map +0 -7
  49. package/dist/getStylesAtomic.js +0 -96
  50. package/dist/getStylesAtomic.js.map +0 -7
  51. package/dist/getStylesAtomic.native.js +0 -11
  52. package/dist/getStylesAtomic.native.js.map +0 -7
  53. package/dist/index.cjs.map +0 -7
  54. package/dist/uniqueStyleKeys.js +0 -33
  55. package/dist/uniqueStyleKeys.js.map +0 -7
  56. package/dist/validStyleProps.js.map +0 -7
  57. package/src/allRules.ts +0 -5
  58. package/src/concatClassName.ts +0 -101
  59. package/src/index.ts +0 -4
  60. package/src/simpleHash.ts +0 -9
  61. package/src/types.ts +0 -7
  62. package/types.d.ts +0 -488
@@ -0,0 +1,517 @@
1
+ import { ViewStyle } from 'react-native';
2
+ export declare const stylePropsTransform: Readonly<{
3
+ x: boolean;
4
+ y: boolean;
5
+ scale: boolean;
6
+ perspective: boolean;
7
+ scaleX: boolean;
8
+ scaleY: boolean;
9
+ skewX: boolean;
10
+ skewY: boolean;
11
+ matrix: boolean;
12
+ rotate: boolean;
13
+ rotateY: boolean;
14
+ rotateX: boolean;
15
+ rotateZ: boolean;
16
+ }>;
17
+ export declare const stylePropsView: Readonly<{
18
+ overflowX?: boolean | undefined;
19
+ overflowY?: boolean | undefined;
20
+ userSelect?: boolean | undefined;
21
+ cursor?: boolean | undefined;
22
+ contain?: boolean | undefined;
23
+ pointerEvents?: boolean | undefined;
24
+ boxSizing?: boolean | undefined;
25
+ boxShadow?: boolean | undefined;
26
+ x: boolean;
27
+ y: boolean;
28
+ scale: boolean;
29
+ perspective: boolean;
30
+ scaleX: boolean;
31
+ scaleY: boolean;
32
+ skewX: boolean;
33
+ skewY: boolean;
34
+ matrix: boolean;
35
+ rotate: boolean;
36
+ rotateY: boolean;
37
+ rotateX: boolean;
38
+ rotateZ: boolean;
39
+ backfaceVisibility: boolean;
40
+ backgroundColor: boolean;
41
+ borderBottomColor: boolean;
42
+ borderBottomStyle: boolean;
43
+ borderTopStyle: boolean;
44
+ borderLeftStyle: boolean;
45
+ borderRightStyle: boolean;
46
+ borderBottomEndRadius: boolean;
47
+ borderBottomLeftRadius: boolean;
48
+ borderBottomRightRadius: boolean;
49
+ borderBottomStartRadius: boolean;
50
+ borderBottomWidth: boolean;
51
+ borderColor: boolean;
52
+ borderEndColor: boolean;
53
+ borderLeftColor: boolean;
54
+ borderLeftWidth: boolean;
55
+ borderRadius: boolean;
56
+ borderRightColor: boolean;
57
+ borderRightWidth: boolean;
58
+ borderStartColor: boolean;
59
+ borderStyle: boolean;
60
+ borderTopColor: boolean;
61
+ borderTopEndRadius: boolean;
62
+ borderTopLeftRadius: boolean;
63
+ borderTopRightRadius: boolean;
64
+ borderTopStartRadius: boolean;
65
+ borderTopWidth: boolean;
66
+ borderWidth: boolean;
67
+ opacity: boolean;
68
+ transform: boolean;
69
+ alignContent: boolean;
70
+ alignItems: boolean;
71
+ alignSelf: boolean;
72
+ aspectRatio: boolean;
73
+ borderEndWidth: boolean;
74
+ borderStartWidth: boolean;
75
+ bottom: boolean;
76
+ display: boolean;
77
+ end: boolean;
78
+ flex: boolean;
79
+ flexBasis: boolean;
80
+ flexDirection: boolean;
81
+ flexGrow: boolean;
82
+ flexShrink: boolean;
83
+ flexWrap: boolean;
84
+ height: boolean;
85
+ justifyContent: boolean;
86
+ left: boolean;
87
+ margin: boolean;
88
+ marginBottom: boolean;
89
+ marginEnd: boolean;
90
+ marginHorizontal: boolean;
91
+ marginLeft: boolean;
92
+ marginRight: boolean;
93
+ marginStart: boolean;
94
+ marginTop: boolean;
95
+ marginVertical: boolean;
96
+ maxHeight: boolean;
97
+ maxWidth: boolean;
98
+ minHeight: boolean;
99
+ minWidth: boolean;
100
+ overflow: boolean;
101
+ padding: boolean;
102
+ paddingBottom: boolean;
103
+ paddingEnd: boolean;
104
+ paddingHorizontal: boolean;
105
+ paddingLeft: boolean;
106
+ paddingRight: boolean;
107
+ paddingStart: boolean;
108
+ paddingTop: boolean;
109
+ paddingVertical: boolean;
110
+ position: boolean;
111
+ right: boolean;
112
+ start: boolean;
113
+ top: boolean;
114
+ width: boolean;
115
+ zIndex: boolean;
116
+ direction: boolean;
117
+ shadowColor: boolean;
118
+ shadowOffset: boolean;
119
+ shadowOpacity: boolean;
120
+ shadowRadius: boolean;
121
+ }>;
122
+ export declare const stylePropsTextOnly: Readonly<{
123
+ whiteSpace?: boolean | undefined;
124
+ wordWrap?: boolean | undefined;
125
+ textOverflow?: boolean | undefined;
126
+ textDecorationDistance?: boolean | undefined;
127
+ color: boolean;
128
+ fontFamily: boolean;
129
+ fontSize: boolean;
130
+ fontStyle: boolean;
131
+ fontWeight: boolean;
132
+ letterSpacing: boolean;
133
+ lineHeight: boolean;
134
+ textAlign: boolean;
135
+ textDecorationLine: boolean;
136
+ textDecorationStyle: boolean;
137
+ textDecorationColor: boolean;
138
+ textShadowColor: boolean;
139
+ textShadowOffset: boolean;
140
+ textShadowRadius: boolean;
141
+ textTransform: boolean;
142
+ }>;
143
+ export declare const stylePropsText: Readonly<{
144
+ whiteSpace?: boolean | undefined;
145
+ wordWrap?: boolean | undefined;
146
+ textOverflow?: boolean | undefined;
147
+ textDecorationDistance?: boolean | undefined;
148
+ color: boolean;
149
+ fontFamily: boolean;
150
+ fontSize: boolean;
151
+ fontStyle: boolean;
152
+ fontWeight: boolean;
153
+ letterSpacing: boolean;
154
+ lineHeight: boolean;
155
+ textAlign: boolean;
156
+ textDecorationLine: boolean;
157
+ textDecorationStyle: boolean;
158
+ textDecorationColor: boolean;
159
+ textShadowColor: boolean;
160
+ textShadowOffset: boolean;
161
+ textShadowRadius: boolean;
162
+ textTransform: boolean;
163
+ overflowX?: boolean | undefined;
164
+ overflowY?: boolean | undefined;
165
+ userSelect?: boolean | undefined;
166
+ cursor?: boolean | undefined;
167
+ contain?: boolean | undefined;
168
+ pointerEvents?: boolean | undefined;
169
+ boxSizing?: boolean | undefined;
170
+ boxShadow?: boolean | undefined;
171
+ x: boolean;
172
+ y: boolean;
173
+ scale: boolean;
174
+ perspective: boolean;
175
+ scaleX: boolean;
176
+ scaleY: boolean;
177
+ skewX: boolean;
178
+ skewY: boolean;
179
+ matrix: boolean;
180
+ rotate: boolean;
181
+ rotateY: boolean;
182
+ rotateX: boolean;
183
+ rotateZ: boolean;
184
+ backfaceVisibility: boolean;
185
+ backgroundColor: boolean;
186
+ borderBottomColor: boolean;
187
+ borderBottomStyle: boolean;
188
+ borderTopStyle: boolean;
189
+ borderLeftStyle: boolean;
190
+ borderRightStyle: boolean;
191
+ borderBottomEndRadius: boolean;
192
+ borderBottomLeftRadius: boolean;
193
+ borderBottomRightRadius: boolean;
194
+ borderBottomStartRadius: boolean;
195
+ borderBottomWidth: boolean;
196
+ borderColor: boolean;
197
+ borderEndColor: boolean;
198
+ borderLeftColor: boolean;
199
+ borderLeftWidth: boolean;
200
+ borderRadius: boolean;
201
+ borderRightColor: boolean;
202
+ borderRightWidth: boolean;
203
+ borderStartColor: boolean;
204
+ borderStyle: boolean;
205
+ borderTopColor: boolean;
206
+ borderTopEndRadius: boolean;
207
+ borderTopLeftRadius: boolean;
208
+ borderTopRightRadius: boolean;
209
+ borderTopStartRadius: boolean;
210
+ borderTopWidth: boolean;
211
+ borderWidth: boolean;
212
+ opacity: boolean;
213
+ transform: boolean;
214
+ alignContent: boolean;
215
+ alignItems: boolean;
216
+ alignSelf: boolean;
217
+ aspectRatio: boolean;
218
+ borderEndWidth: boolean;
219
+ borderStartWidth: boolean;
220
+ bottom: boolean;
221
+ display: boolean;
222
+ end: boolean;
223
+ flex: boolean;
224
+ flexBasis: boolean;
225
+ flexDirection: boolean;
226
+ flexGrow: boolean;
227
+ flexShrink: boolean;
228
+ flexWrap: boolean;
229
+ height: boolean;
230
+ justifyContent: boolean;
231
+ left: boolean;
232
+ margin: boolean;
233
+ marginBottom: boolean;
234
+ marginEnd: boolean;
235
+ marginHorizontal: boolean;
236
+ marginLeft: boolean;
237
+ marginRight: boolean;
238
+ marginStart: boolean;
239
+ marginTop: boolean;
240
+ marginVertical: boolean;
241
+ maxHeight: boolean;
242
+ maxWidth: boolean;
243
+ minHeight: boolean;
244
+ minWidth: boolean;
245
+ overflow: boolean;
246
+ padding: boolean;
247
+ paddingBottom: boolean;
248
+ paddingEnd: boolean;
249
+ paddingHorizontal: boolean;
250
+ paddingLeft: boolean;
251
+ paddingRight: boolean;
252
+ paddingStart: boolean;
253
+ paddingTop: boolean;
254
+ paddingVertical: boolean;
255
+ position: boolean;
256
+ right: boolean;
257
+ start: boolean;
258
+ top: boolean;
259
+ width: boolean;
260
+ zIndex: boolean;
261
+ direction: boolean;
262
+ shadowColor: boolean;
263
+ shadowOffset: boolean;
264
+ shadowOpacity: boolean;
265
+ shadowRadius: boolean;
266
+ }>;
267
+ export declare const stylePropsAll: Readonly<{
268
+ whiteSpace?: boolean | undefined;
269
+ wordWrap?: boolean | undefined;
270
+ textOverflow?: boolean | undefined;
271
+ textDecorationDistance?: boolean | undefined;
272
+ color: boolean;
273
+ fontFamily: boolean;
274
+ fontSize: boolean;
275
+ fontStyle: boolean;
276
+ fontWeight: boolean;
277
+ letterSpacing: boolean;
278
+ lineHeight: boolean;
279
+ textAlign: boolean;
280
+ textDecorationLine: boolean;
281
+ textDecorationStyle: boolean;
282
+ textDecorationColor: boolean;
283
+ textShadowColor: boolean;
284
+ textShadowOffset: boolean;
285
+ textShadowRadius: boolean;
286
+ textTransform: boolean;
287
+ overflowX?: boolean | undefined;
288
+ overflowY?: boolean | undefined;
289
+ userSelect?: boolean | undefined;
290
+ cursor?: boolean | undefined;
291
+ contain?: boolean | undefined;
292
+ pointerEvents?: boolean | undefined;
293
+ boxSizing?: boolean | undefined;
294
+ boxShadow?: boolean | undefined;
295
+ x: boolean;
296
+ y: boolean;
297
+ scale: boolean;
298
+ perspective: boolean;
299
+ scaleX: boolean;
300
+ scaleY: boolean;
301
+ skewX: boolean;
302
+ skewY: boolean;
303
+ matrix: boolean;
304
+ rotate: boolean;
305
+ rotateY: boolean;
306
+ rotateX: boolean;
307
+ rotateZ: boolean;
308
+ backfaceVisibility: boolean;
309
+ backgroundColor: boolean;
310
+ borderBottomColor: boolean;
311
+ borderBottomStyle: boolean;
312
+ borderTopStyle: boolean;
313
+ borderLeftStyle: boolean;
314
+ borderRightStyle: boolean;
315
+ borderBottomEndRadius: boolean;
316
+ borderBottomLeftRadius: boolean;
317
+ borderBottomRightRadius: boolean;
318
+ borderBottomStartRadius: boolean;
319
+ borderBottomWidth: boolean;
320
+ borderColor: boolean;
321
+ borderEndColor: boolean;
322
+ borderLeftColor: boolean;
323
+ borderLeftWidth: boolean;
324
+ borderRadius: boolean;
325
+ borderRightColor: boolean;
326
+ borderRightWidth: boolean;
327
+ borderStartColor: boolean;
328
+ borderStyle: boolean;
329
+ borderTopColor: boolean;
330
+ borderTopEndRadius: boolean;
331
+ borderTopLeftRadius: boolean;
332
+ borderTopRightRadius: boolean;
333
+ borderTopStartRadius: boolean;
334
+ borderTopWidth: boolean;
335
+ borderWidth: boolean;
336
+ opacity: boolean;
337
+ transform: boolean;
338
+ alignContent: boolean;
339
+ alignItems: boolean;
340
+ alignSelf: boolean;
341
+ aspectRatio: boolean;
342
+ borderEndWidth: boolean;
343
+ borderStartWidth: boolean;
344
+ bottom: boolean;
345
+ display: boolean;
346
+ end: boolean;
347
+ flex: boolean;
348
+ flexBasis: boolean;
349
+ flexDirection: boolean;
350
+ flexGrow: boolean;
351
+ flexShrink: boolean;
352
+ flexWrap: boolean;
353
+ height: boolean;
354
+ justifyContent: boolean;
355
+ left: boolean;
356
+ margin: boolean;
357
+ marginBottom: boolean;
358
+ marginEnd: boolean;
359
+ marginHorizontal: boolean;
360
+ marginLeft: boolean;
361
+ marginRight: boolean;
362
+ marginStart: boolean;
363
+ marginTop: boolean;
364
+ marginVertical: boolean;
365
+ maxHeight: boolean;
366
+ maxWidth: boolean;
367
+ minHeight: boolean;
368
+ minWidth: boolean;
369
+ overflow: boolean;
370
+ padding: boolean;
371
+ paddingBottom: boolean;
372
+ paddingEnd: boolean;
373
+ paddingHorizontal: boolean;
374
+ paddingLeft: boolean;
375
+ paddingRight: boolean;
376
+ paddingStart: boolean;
377
+ paddingTop: boolean;
378
+ paddingVertical: boolean;
379
+ position: boolean;
380
+ right: boolean;
381
+ start: boolean;
382
+ top: boolean;
383
+ width: boolean;
384
+ zIndex: boolean;
385
+ direction: boolean;
386
+ shadowColor: boolean;
387
+ shadowOffset: boolean;
388
+ shadowOpacity: boolean;
389
+ shadowRadius: boolean;
390
+ }>;
391
+ export declare const validPseudoKeys: Readonly<{
392
+ enterStyle: boolean;
393
+ exitStyle: boolean;
394
+ hoverStyle: boolean;
395
+ pressStyle: boolean;
396
+ focusStyle: boolean;
397
+ }>;
398
+ export declare const validStyles: Readonly<{
399
+ overflowX?: boolean | undefined;
400
+ overflowY?: boolean | undefined;
401
+ userSelect?: boolean | undefined;
402
+ cursor?: boolean | undefined;
403
+ contain?: boolean | undefined;
404
+ pointerEvents?: boolean | undefined;
405
+ boxSizing?: boolean | undefined;
406
+ boxShadow?: boolean | undefined;
407
+ x: boolean;
408
+ y: boolean;
409
+ scale: boolean;
410
+ perspective: boolean;
411
+ scaleX: boolean;
412
+ scaleY: boolean;
413
+ skewX: boolean;
414
+ skewY: boolean;
415
+ matrix: boolean;
416
+ rotate: boolean;
417
+ rotateY: boolean;
418
+ rotateX: boolean;
419
+ rotateZ: boolean;
420
+ backfaceVisibility: boolean;
421
+ backgroundColor: boolean;
422
+ borderBottomColor: boolean;
423
+ borderBottomStyle: boolean;
424
+ borderTopStyle: boolean;
425
+ borderLeftStyle: boolean;
426
+ borderRightStyle: boolean;
427
+ borderBottomEndRadius: boolean;
428
+ borderBottomLeftRadius: boolean;
429
+ borderBottomRightRadius: boolean;
430
+ borderBottomStartRadius: boolean;
431
+ borderBottomWidth: boolean;
432
+ borderColor: boolean;
433
+ borderEndColor: boolean;
434
+ borderLeftColor: boolean;
435
+ borderLeftWidth: boolean;
436
+ borderRadius: boolean;
437
+ borderRightColor: boolean;
438
+ borderRightWidth: boolean;
439
+ borderStartColor: boolean;
440
+ borderStyle: boolean;
441
+ borderTopColor: boolean;
442
+ borderTopEndRadius: boolean;
443
+ borderTopLeftRadius: boolean;
444
+ borderTopRightRadius: boolean;
445
+ borderTopStartRadius: boolean;
446
+ borderTopWidth: boolean;
447
+ borderWidth: boolean;
448
+ opacity: boolean;
449
+ transform: boolean;
450
+ alignContent: boolean;
451
+ alignItems: boolean;
452
+ alignSelf: boolean;
453
+ aspectRatio: boolean;
454
+ borderEndWidth: boolean;
455
+ borderStartWidth: boolean;
456
+ bottom: boolean;
457
+ display: boolean;
458
+ end: boolean;
459
+ flex: boolean;
460
+ flexBasis: boolean;
461
+ flexDirection: boolean;
462
+ flexGrow: boolean;
463
+ flexShrink: boolean;
464
+ flexWrap: boolean;
465
+ height: boolean;
466
+ justifyContent: boolean;
467
+ left: boolean;
468
+ margin: boolean;
469
+ marginBottom: boolean;
470
+ marginEnd: boolean;
471
+ marginHorizontal: boolean;
472
+ marginLeft: boolean;
473
+ marginRight: boolean;
474
+ marginStart: boolean;
475
+ marginTop: boolean;
476
+ marginVertical: boolean;
477
+ maxHeight: boolean;
478
+ maxWidth: boolean;
479
+ minHeight: boolean;
480
+ minWidth: boolean;
481
+ overflow: boolean;
482
+ padding: boolean;
483
+ paddingBottom: boolean;
484
+ paddingEnd: boolean;
485
+ paddingHorizontal: boolean;
486
+ paddingLeft: boolean;
487
+ paddingRight: boolean;
488
+ paddingStart: boolean;
489
+ paddingTop: boolean;
490
+ paddingVertical: boolean;
491
+ position: boolean;
492
+ right: boolean;
493
+ start: boolean;
494
+ top: boolean;
495
+ width: boolean;
496
+ zIndex: boolean;
497
+ direction: boolean;
498
+ shadowColor: boolean;
499
+ shadowOffset: boolean;
500
+ shadowOpacity: boolean;
501
+ shadowRadius: boolean;
502
+ enterStyle: boolean;
503
+ exitStyle: boolean;
504
+ hoverStyle: boolean;
505
+ pressStyle: boolean;
506
+ focusStyle: boolean;
507
+ }>;
508
+ export declare const mapTransformKeys: {
509
+ x: string;
510
+ y: string;
511
+ };
512
+ export declare const invertMapTransformKeys: {
513
+ translateX: string;
514
+ translateY: string;
515
+ };
516
+ export declare const mergeTransform: (obj: ViewStyle, key: string, val: any) => void;
517
+ //# sourceMappingURL=validStyleProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validStyleProps.d.ts","sourceRoot":"","sources":["../src/validStyleProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;EAc9B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGzB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EAyB7B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiB,CAAA;AAE3C,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;CAG5B,CAAA;AAED,eAAO,MAAM,sBAAsB;;;CAGlC,CAAA;AAED,eAAO,MAAM,cAAc,QAAS,SAAS,OAAO,MAAM,OAAO,GAAG,SAInE,CAAA"}
package/dist/allRules.js DELETED
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const AllRules = new Set();
4
- const getStyleRules = /* @__PURE__ */ __name(() => AllRules, "getStyleRules");
5
- export {
6
- AllRules,
7
- getStyleRules
8
- };
9
- //# sourceMappingURL=allRules.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/allRules.ts"],
4
- "sourcesContent": ["// ssr only\n\nexport const AllRules = new Set()\n\nexport const getStyleRules = () => AllRules\n"],
5
- "mappings": ";;AAEO,MAAM,WAAW,IAAI;AAErB,MAAM,gBAAgB,6BAAM,UAAN;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/concatClassName.ts"],
4
- "sourcesContent": ["// perf sensitive so doing some weird stuff\n\n// testing caching\n// because we can hit these recent ones a ton of times in common cases\n// we're caching the simple case, this shouldn't be bad on memory either\n// const recently = new Map()\n// setInterval(() => {\n// recently.clear()\n// }, 1000)\n\nexport function concatClassName(_cn: any) {\n // if (arguments.length === 1) {\n // if (recently.has(arguments[0])) {\n // return recently.get(arguments[0])\n // }\n // }\n\n const classNamesOrPropObjects = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = classNamesOrPropObjects.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = classNamesOrPropObjects[x]\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n const splitIndex = name.indexOf('-')\n\n if (splitIndex < 1) {\n final = name + ' ' + final\n continue\n }\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n const isPsuedoQuery = nextChar === '-'\n\n const styleKey = name.slice(1, splitIndex)\n const mediaKey =\n isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n\n if (!isMediaQuery && !isPsuedoQuery) {\n if (usedPrefixes.indexOf(uid) > -1) {\n continue\n }\n usedPrefixes.push(uid)\n }\n\n // overrides for full safety\n const propName = styleKey\n if (propName && propObjects) {\n if (\n propObjects.some((po) => {\n if (mediaKey) {\n const propKey = pseudoInvert[mediaKey]\n return po && po[propKey] && propName in po[propKey] && po[propKey] !== null\n }\n const res = po && propName in po && po[propName] !== null\n return res\n })\n ) {\n continue\n }\n }\n\n final = name + ' ' + final\n }\n }\n\n // if (arguments.length === 1) {\n // recently.set(arguments[0], final)\n // }\n\n return final\n}\n\nconst pseudoInvert = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n"],
5
- "mappings": ";;AAUO,yBAAyB,KAAU;AAOxC,QAAM,0BAA0B;AAChC,QAAM,eAAyB;AAC/B,MAAI,QAAQ;AAEZ,QAAM,MAAM,wBAAwB;AACpC,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK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AM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- function getNiceKey(name, len = 2) {
4
- let key = "";
5
- for (const [index, char] of name.split("").entries()) {
6
- if (index === 0 || char.toUpperCase() === char) {
7
- key += name.slice(index, index + len);
8
- }
9
- }
10
- return key;
11
- }
12
- __name(getNiceKey, "getNiceKey");
13
- export {
14
- getNiceKey
15
- };
16
- //# sourceMappingURL=getNiceKey.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/getNiceKey.ts"],
4
- "sourcesContent": ["export function getNiceKey(name: string, len = 2) {\n let key = ''\n for (const [index, char] of name.split('').entries()) {\n if (index === 0 || char.toUpperCase() === char) {\n key += name.slice(index, index + len)\n }\n }\n return key\n}\n"],
5
- "mappings": ";;AAAO,oBAAoB,MAAc,MAAM,GAAG;AAChD,MAAI,MAAM;AACV,aAAW,CAAC,OAAO,SAAS,KAAK,MAAM,IAAI,WAAW;AACpD,QAAI,UAAU,KAAK,KAAK,kBAAkB,MAAM;AAC9C,aAAO,KAAK,MAAM,OAAO,QAAQ;AAAA;AAAA;AAGrC,SAAO;AAAA;AAPO;",
6
- "names": []
7
- }
@@ -1,96 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { atomic } from "react-native-web/dist/cjs/exports/StyleSheet/compile";
4
- import createCompileableStyle from "react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle";
5
- import createReactDOMStyle from "react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle";
6
- import i18Style from "react-native-web/dist/cjs/exports/StyleSheet/i18nStyle";
7
- import { AllRules } from "./AllRules";
8
- const pseudos = {
9
- focusStyle: {
10
- name: "focus",
11
- priority: 3
12
- },
13
- pressStyle: {
14
- name: "active",
15
- priority: 2
16
- },
17
- hoverStyle: {
18
- name: "hover",
19
- priority: 1
20
- }
21
- };
22
- const borderDefaults = {
23
- borderWidth: "borderStyle",
24
- borderBottomWidth: "borderBottomStyle",
25
- borderTopWidth: "borderTopStyle",
26
- borderLeftWidth: "borderLeftStyle",
27
- borderRightWidth: "borderRightStyle"
28
- };
29
- function getStylesAtomic(style, avoidCollection = false) {
30
- const styles = {
31
- base: {}
32
- };
33
- for (const key in style) {
34
- if (!!pseudos[key]) {
35
- styles[key] = style[key];
36
- } else {
37
- styles.base[key] = style[key];
38
- }
39
- }
40
- return Object.keys(styles).map((key) => {
41
- return getAtomicStyle(styles[key], pseudos[key], avoidCollection);
42
- }).flat();
43
- }
44
- __name(getStylesAtomic, "getStylesAtomic");
45
- const importantRegex = /\!important*/g;
46
- function getAtomicStyle(style, pseudo, avoidCollection) {
47
- if (style == null || typeof style !== "object") {
48
- throw new Error(`Wrong style type: "${typeof style}": ${style}`);
49
- }
50
- for (const key in borderDefaults) {
51
- if (key in style) {
52
- style[borderDefaults[key]] = style[borderDefaults[key]] ?? "solid";
53
- }
54
- }
55
- const all = {
56
- ...atomic(createCompileableStyle(createReactDOMStyle(i18Style(style))))
57
- };
58
- return Object.keys(all).map((key) => {
59
- const val = all[key];
60
- const hash = val.identifier.slice(`${val.identifier}`.lastIndexOf("-") + 1);
61
- const psuedoPrefix = pseudo ? `-${pseudo.name}-` : "";
62
- const identifier = `_${val.property}-${psuedoPrefix}${hash}`;
63
- const className = `.${identifier}`;
64
- const rules = val.rules.map((rule) => {
65
- if (pseudo) {
66
- const psuedoPrefixSelect = [...Array(pseudo.priority)].map(() => ":root").join("") + " ";
67
- let res = rule.replace(`.${val.identifier}`, `${psuedoPrefixSelect} ${className}`).replace("{", `:${pseudo.name}{`);
68
- if (pseudo.name === "hover") {
69
- res = `@media not all and (hover: none) { ${res} }`;
70
- }
71
- return res;
72
- }
73
- return rule.replace(`.${val.identifier}`, className).replace(importantRegex, "");
74
- });
75
- if (!avoidCollection) {
76
- if (rules.length > 1) {
77
- console.warn("have never seen more than one, verifying");
78
- }
79
- AllRules.add(rules[0]);
80
- }
81
- const result = {
82
- property: val.property,
83
- value: val.value,
84
- identifier,
85
- className,
86
- rules
87
- };
88
- return result;
89
- });
90
- }
91
- __name(getAtomicStyle, "getAtomicStyle");
92
- export {
93
- getStylesAtomic,
94
- pseudos
95
- };
96
- //# sourceMappingURL=getStylesAtomic.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/getStylesAtomic.ts"],
4
- "sourcesContent": ["import type { ViewStyle } from 'react-native'\nimport { atomic } from 'react-native-web/dist/cjs/exports/StyleSheet/compile'\nimport createCompileableStyle from 'react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle'\nimport createReactDOMStyle from 'react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle'\nimport i18Style from 'react-native-web/dist/cjs/exports/StyleSheet/i18nStyle'\n\nimport { AllRules } from './AllRules'\nimport { StyleObject } from './types'\n\nexport const pseudos = {\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nexport function getStylesAtomic(style: any, avoidCollection = false) {\n const styles: { [key: string]: ViewStyle } = {\n base: {},\n }\n // split pseudos\n for (const key in style) {\n if (!!pseudos[key]) {\n styles[key] = style[key]\n } else {\n styles.base[key] = style[key]\n }\n }\n return Object.keys(styles)\n .map((key) => {\n return getAtomicStyle(styles[key], pseudos[key], avoidCollection)\n })\n .flat()\n}\n\nconst importantRegex = /\\!important*/g\n\nfunction getAtomicStyle(\n style: ViewStyle,\n pseudo?: { name: string; priority: number },\n avoidCollection?: boolean\n): StyleObject[] {\n if (style == null || typeof style !== 'object') {\n throw new Error(`Wrong style type: \"${typeof style}\": ${style}`)\n }\n\n // why is this diff from react-native-web!? need to figure out\n for (const key in borderDefaults) {\n if (key in style) {\n style[borderDefaults[key]] = style[borderDefaults[key]] ?? 'solid'\n }\n }\n\n const all = {\n // TODO man, rnw has a ton of function calls etc here\n ...atomic(createCompileableStyle(createReactDOMStyle(i18Style(style)))),\n }\n\n return Object.keys(all).map((key) => {\n const val = all[key]\n const hash = val.identifier.slice(`${val.identifier}`.lastIndexOf('-') + 1)\n // pseudos have a `--` to be easier to find with concatClassNames\n const psuedoPrefix = pseudo ? `-${pseudo.name}-` : ''\n const identifier = `_${val.property}-${psuedoPrefix}${hash}`\n const className = `.${identifier}`\n const rules = val.rules.map((rule) => {\n if (pseudo) {\n const psuedoPrefixSelect = [...Array(pseudo.priority)].map(() => ':root').join('') + ' '\n let res = rule\n .replace(`.${val.identifier}`, `${psuedoPrefixSelect} ${className}`)\n .replace('{', `:${pseudo.name}{`)\n\n if (pseudo.name === 'hover') {\n // hover styles need to be conditional\n // perhaps this can be generalized but for now lets just shortcut\n // and hardcode for hover styles, if we need to later we can\n // WEIRD SYNTAX, SEE:\n // https://stackoverflow.com/questions/40532204/media-query-for-devices-supporting-hover\n res = `@media not all and (hover: none) { ${res} }`\n }\n return res\n }\n return rule.replace(`.${val.identifier}`, className).replace(importantRegex, '')\n })\n\n if (!avoidCollection) {\n if (rules.length > 1) {\n console.warn('have never seen more than one, verifying')\n }\n AllRules.add(rules[0])\n }\n\n const result: StyleObject = {\n property: val.property,\n value: val.value,\n identifier,\n className,\n rules,\n }\n return result\n })\n}\n"],
5
- "mappings": ";;AACA;AACA;AACA;AACA;AAEA;AAGO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAA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