@pedidopago/ui 1.10.12 → 1.10.13
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/dist/components/Badge/styles.js +1 -1
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts +1 -1
- package/dist/components/ComposeIcon/index.d.ts.map +1 -1
- package/dist/components/ComposeIcon/index.js +1 -1
- package/dist/components/NewSelect/Multiple/index.d.ts +1 -1
- package/dist/components/NewSelect/Multiple/index.d.ts.map +1 -1
- package/dist/components/NewSelect/Multiple/index.js +1 -1
- package/dist/components/NewSelect/Single/Examples/index.d.ts.map +1 -1
- package/dist/components/NewSelect/Single/Examples/index.js +1 -1
- package/dist/components/NewSelect/Single/index.d.ts +1 -1
- package/dist/components/NewSelect/Single/index.d.ts.map +1 -1
- package/dist/components/NewSelect/Single/index.js +1 -1
- package/dist/components/NewSelect/types.d.ts +1 -0
- package/dist/components/NewSelect/types.d.ts.map +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/Pagination/types.d.ts +1 -0
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Tag/types.d.ts +1 -0
- package/dist/components/Tag/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +1 -1
- package/dist/shared/theme/hooks/useTheme.d.ts +6 -452
- package/dist/shared/theme/hooks/useTheme.d.ts.map +1 -1
- package/dist/shared/theme/hooks/useTheme.js +1 -1
- package/dist/shared/theme/theme.test.js +1 -1
- package/dist/shared/theme/theme.types.d.ts +16 -4
- package/dist/shared/theme/theme.types.d.ts.map +1 -1
- package/dist/shared/theme/utils/extendTheme.d.ts.map +1 -1
- package/dist/shared/theme/utils/extendTheme.js +1 -1
- package/dist/shared/theme/utils/tests/extendTheme.test.d.ts +2 -0
- package/dist/shared/theme/utils/tests/extendTheme.test.d.ts.map +1 -0
- package/dist/shared/theme/utils/tests/extendTheme.test.js +1 -0
- package/dist/shared/types/generics.d.ts +9 -0
- package/dist/shared/types/generics.d.ts.map +1 -0
- package/dist/shared/types/generics.js +1 -0
- package/dist/utils/customColorMode.d.ts +4 -0
- package/dist/utils/customColorMode.d.ts.map +1 -1
- package/dist/utils/customColorMode.js +4 -1
- package/dist/utils/findDifferentKeys.d.ts +3 -0
- package/dist/utils/findDifferentKeys.d.ts.map +1 -0
- package/dist/utils/findDifferentKeys.js +1 -0
- package/dist/utils/formatters/strings.d.ts +9 -0
- package/dist/utils/formatters/strings.d.ts.map +1 -1
- package/dist/utils/formatters/strings.js +13 -2
- package/package.json +1 -1
|
@@ -1,456 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ThemeBase } from '..';
|
|
2
|
+
type UseThemeReturn = {
|
|
3
|
+
theme: ThemeBase;
|
|
4
|
+
colorMode: 'dark' | 'light';
|
|
3
5
|
switchColorMode: () => void;
|
|
4
6
|
colorByTheme<L, D>(light: L, dark: D): L | D;
|
|
5
|
-
theme: {
|
|
6
|
-
fontSizes: {
|
|
7
|
-
tiny: string;
|
|
8
|
-
xxxs: string;
|
|
9
|
-
xxs: string;
|
|
10
|
-
xs: string;
|
|
11
|
-
sm: string;
|
|
12
|
-
md: string;
|
|
13
|
-
lg: string;
|
|
14
|
-
xl: string;
|
|
15
|
-
xxl: string;
|
|
16
|
-
xxxl: string;
|
|
17
|
-
display: string;
|
|
18
|
-
giant: string;
|
|
19
|
-
};
|
|
20
|
-
fontWeight: {
|
|
21
|
-
normal: string;
|
|
22
|
-
bold: string;
|
|
23
|
-
'100': string;
|
|
24
|
-
'200': string;
|
|
25
|
-
'300': string;
|
|
26
|
-
'400': string;
|
|
27
|
-
'500': string;
|
|
28
|
-
'600': string;
|
|
29
|
-
'700': string;
|
|
30
|
-
'800': string;
|
|
31
|
-
'900': string;
|
|
32
|
-
};
|
|
33
|
-
breakpoints: {
|
|
34
|
-
base: string;
|
|
35
|
-
sm: string;
|
|
36
|
-
md: string;
|
|
37
|
-
lg: string;
|
|
38
|
-
xl: string;
|
|
39
|
-
xxl: string;
|
|
40
|
-
};
|
|
41
|
-
colors: {
|
|
42
|
-
body: {
|
|
43
|
-
light: string;
|
|
44
|
-
dark: string;
|
|
45
|
-
};
|
|
46
|
-
primary: {
|
|
47
|
-
alert: string;
|
|
48
|
-
disabled: string;
|
|
49
|
-
default: string;
|
|
50
|
-
hover: string;
|
|
51
|
-
focus: string;
|
|
52
|
-
transparent: string;
|
|
53
|
-
};
|
|
54
|
-
secondary: {
|
|
55
|
-
disabled: string;
|
|
56
|
-
default: string;
|
|
57
|
-
hover: string;
|
|
58
|
-
focus: string;
|
|
59
|
-
};
|
|
60
|
-
tertiary: {
|
|
61
|
-
disabled: string;
|
|
62
|
-
default: string;
|
|
63
|
-
hover: string;
|
|
64
|
-
focus: string;
|
|
65
|
-
};
|
|
66
|
-
neutral: {
|
|
67
|
-
white: string;
|
|
68
|
-
neutral1: string;
|
|
69
|
-
neutral2: string;
|
|
70
|
-
neutral3: string;
|
|
71
|
-
neutral4: string;
|
|
72
|
-
neutral5: string;
|
|
73
|
-
neutral6: string;
|
|
74
|
-
black: string;
|
|
75
|
-
};
|
|
76
|
-
background: {
|
|
77
|
-
linear1: string;
|
|
78
|
-
linear2: string;
|
|
79
|
-
linear3: string;
|
|
80
|
-
light: string;
|
|
81
|
-
};
|
|
82
|
-
informative: {
|
|
83
|
-
default: string;
|
|
84
|
-
blurred: string;
|
|
85
|
-
dark: string;
|
|
86
|
-
gradient: string;
|
|
87
|
-
};
|
|
88
|
-
success: {
|
|
89
|
-
default: string;
|
|
90
|
-
blurred: string;
|
|
91
|
-
dark: string;
|
|
92
|
-
gradient: string;
|
|
93
|
-
};
|
|
94
|
-
success_secondary: {
|
|
95
|
-
default: string;
|
|
96
|
-
blurred: string;
|
|
97
|
-
dark: string;
|
|
98
|
-
gradient: string;
|
|
99
|
-
};
|
|
100
|
-
warning: {
|
|
101
|
-
default: string;
|
|
102
|
-
blurred: string;
|
|
103
|
-
dark: string;
|
|
104
|
-
gradient: string;
|
|
105
|
-
};
|
|
106
|
-
warning_secondary: {
|
|
107
|
-
default: string;
|
|
108
|
-
blurred: string;
|
|
109
|
-
dark: string;
|
|
110
|
-
gradient: string;
|
|
111
|
-
};
|
|
112
|
-
error: {
|
|
113
|
-
default: string;
|
|
114
|
-
blurred: string;
|
|
115
|
-
dark: string;
|
|
116
|
-
gradient: string;
|
|
117
|
-
};
|
|
118
|
-
critical: {
|
|
119
|
-
default: string;
|
|
120
|
-
blurred: string;
|
|
121
|
-
dark: string;
|
|
122
|
-
gradient: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
lightColors: {
|
|
126
|
-
body: {
|
|
127
|
-
light: string;
|
|
128
|
-
dark: string;
|
|
129
|
-
};
|
|
130
|
-
primary: {
|
|
131
|
-
alert: string;
|
|
132
|
-
disabled: string;
|
|
133
|
-
default: string;
|
|
134
|
-
hover: string;
|
|
135
|
-
focus: string;
|
|
136
|
-
transparent: string;
|
|
137
|
-
};
|
|
138
|
-
secondary: {
|
|
139
|
-
disabled: string;
|
|
140
|
-
default: string;
|
|
141
|
-
hover: string;
|
|
142
|
-
focus: string;
|
|
143
|
-
};
|
|
144
|
-
tertiary: {
|
|
145
|
-
disabled: string;
|
|
146
|
-
default: string;
|
|
147
|
-
hover: string;
|
|
148
|
-
focus: string;
|
|
149
|
-
};
|
|
150
|
-
neutral: {
|
|
151
|
-
white: string;
|
|
152
|
-
neutral1: string;
|
|
153
|
-
neutral2: string;
|
|
154
|
-
neutral3: string;
|
|
155
|
-
neutral4: string;
|
|
156
|
-
neutral5: string;
|
|
157
|
-
neutral6: string;
|
|
158
|
-
black: string;
|
|
159
|
-
};
|
|
160
|
-
background: {
|
|
161
|
-
linear1: string;
|
|
162
|
-
linear2: string;
|
|
163
|
-
linear3: string;
|
|
164
|
-
light: string;
|
|
165
|
-
};
|
|
166
|
-
informative: {
|
|
167
|
-
default: string;
|
|
168
|
-
blurred: string;
|
|
169
|
-
dark: string;
|
|
170
|
-
gradient: string;
|
|
171
|
-
};
|
|
172
|
-
success: {
|
|
173
|
-
default: string;
|
|
174
|
-
blurred: string;
|
|
175
|
-
dark: string;
|
|
176
|
-
gradient: string;
|
|
177
|
-
};
|
|
178
|
-
success_secondary: {
|
|
179
|
-
default: string;
|
|
180
|
-
blurred: string;
|
|
181
|
-
dark: string;
|
|
182
|
-
gradient: string;
|
|
183
|
-
};
|
|
184
|
-
warning: {
|
|
185
|
-
default: string;
|
|
186
|
-
blurred: string;
|
|
187
|
-
dark: string;
|
|
188
|
-
gradient: string;
|
|
189
|
-
};
|
|
190
|
-
warning_secondary: {
|
|
191
|
-
default: string;
|
|
192
|
-
blurred: string;
|
|
193
|
-
dark: string;
|
|
194
|
-
gradient: string;
|
|
195
|
-
};
|
|
196
|
-
error: {
|
|
197
|
-
default: string;
|
|
198
|
-
blurred: string;
|
|
199
|
-
dark: string;
|
|
200
|
-
gradient: string;
|
|
201
|
-
};
|
|
202
|
-
critical: {
|
|
203
|
-
default: string;
|
|
204
|
-
blurred: string;
|
|
205
|
-
dark: string;
|
|
206
|
-
gradient: string;
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
darkColors: {
|
|
210
|
-
body: {
|
|
211
|
-
light: string;
|
|
212
|
-
dark: string;
|
|
213
|
-
};
|
|
214
|
-
primary: {
|
|
215
|
-
alert: string;
|
|
216
|
-
disabled: string;
|
|
217
|
-
default: string;
|
|
218
|
-
hover: string;
|
|
219
|
-
focus: string;
|
|
220
|
-
transparent: string;
|
|
221
|
-
};
|
|
222
|
-
secondary: {
|
|
223
|
-
disabled: string;
|
|
224
|
-
default: string;
|
|
225
|
-
hover: string;
|
|
226
|
-
focus: string;
|
|
227
|
-
};
|
|
228
|
-
tertiary: {
|
|
229
|
-
disabled: string;
|
|
230
|
-
default: string;
|
|
231
|
-
hover: string;
|
|
232
|
-
focus: string;
|
|
233
|
-
};
|
|
234
|
-
neutral: {
|
|
235
|
-
white: string;
|
|
236
|
-
neutral1: string;
|
|
237
|
-
neutral2: string;
|
|
238
|
-
neutral3: string;
|
|
239
|
-
neutral4: string;
|
|
240
|
-
neutral5: string;
|
|
241
|
-
neutral6: string;
|
|
242
|
-
black: string;
|
|
243
|
-
};
|
|
244
|
-
background: {
|
|
245
|
-
linear1: string;
|
|
246
|
-
linear2: string;
|
|
247
|
-
linear3: string;
|
|
248
|
-
light: string;
|
|
249
|
-
};
|
|
250
|
-
informative: {
|
|
251
|
-
default: string;
|
|
252
|
-
blurred: string;
|
|
253
|
-
dark: string;
|
|
254
|
-
gradient: string;
|
|
255
|
-
};
|
|
256
|
-
success: {
|
|
257
|
-
default: string;
|
|
258
|
-
blurred: string;
|
|
259
|
-
dark: string;
|
|
260
|
-
gradient: string;
|
|
261
|
-
};
|
|
262
|
-
success_secondary: {
|
|
263
|
-
default: string;
|
|
264
|
-
blurred: string;
|
|
265
|
-
dark: string;
|
|
266
|
-
gradient: string;
|
|
267
|
-
};
|
|
268
|
-
warning: {
|
|
269
|
-
default: string;
|
|
270
|
-
blurred: string;
|
|
271
|
-
dark: string;
|
|
272
|
-
gradient: string;
|
|
273
|
-
};
|
|
274
|
-
warning_secondary: {
|
|
275
|
-
default: string;
|
|
276
|
-
blurred: string;
|
|
277
|
-
dark: string;
|
|
278
|
-
gradient: string;
|
|
279
|
-
};
|
|
280
|
-
error: {
|
|
281
|
-
default: string;
|
|
282
|
-
blurred: string;
|
|
283
|
-
dark: string;
|
|
284
|
-
gradient: string;
|
|
285
|
-
};
|
|
286
|
-
critical: {
|
|
287
|
-
default: string;
|
|
288
|
-
blurred: string;
|
|
289
|
-
dark: string;
|
|
290
|
-
gradient: string;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
space: {
|
|
294
|
-
px: string;
|
|
295
|
-
0.5: string;
|
|
296
|
-
1: string;
|
|
297
|
-
1.5: string;
|
|
298
|
-
2: string;
|
|
299
|
-
2.5: string;
|
|
300
|
-
3: string;
|
|
301
|
-
3.5: string;
|
|
302
|
-
4: string;
|
|
303
|
-
5: string;
|
|
304
|
-
6: string;
|
|
305
|
-
7: string;
|
|
306
|
-
8: string;
|
|
307
|
-
9: string;
|
|
308
|
-
10: string;
|
|
309
|
-
12: string;
|
|
310
|
-
14: string;
|
|
311
|
-
16: string;
|
|
312
|
-
20: string;
|
|
313
|
-
24: string;
|
|
314
|
-
28: string;
|
|
315
|
-
32: string;
|
|
316
|
-
36: string;
|
|
317
|
-
40: string;
|
|
318
|
-
44: string;
|
|
319
|
-
48: string;
|
|
320
|
-
52: string;
|
|
321
|
-
56: string;
|
|
322
|
-
60: string;
|
|
323
|
-
64: string;
|
|
324
|
-
72: string;
|
|
325
|
-
80: string;
|
|
326
|
-
96: string;
|
|
327
|
-
112: string;
|
|
328
|
-
128: string;
|
|
329
|
-
};
|
|
330
|
-
spacing: {
|
|
331
|
-
quarck: string;
|
|
332
|
-
nano: string;
|
|
333
|
-
xxxs: string;
|
|
334
|
-
xxs: string;
|
|
335
|
-
xs: string;
|
|
336
|
-
sm: string;
|
|
337
|
-
md: string;
|
|
338
|
-
lg: string;
|
|
339
|
-
xl: string;
|
|
340
|
-
xxl: string;
|
|
341
|
-
xxxl: string;
|
|
342
|
-
huge: string;
|
|
343
|
-
giant: string;
|
|
344
|
-
px: string;
|
|
345
|
-
0.5: string;
|
|
346
|
-
1: string;
|
|
347
|
-
1.5: string;
|
|
348
|
-
2: string;
|
|
349
|
-
2.5: string;
|
|
350
|
-
3: string;
|
|
351
|
-
3.5: string;
|
|
352
|
-
4: string;
|
|
353
|
-
5: string;
|
|
354
|
-
6: string;
|
|
355
|
-
7: string;
|
|
356
|
-
8: string;
|
|
357
|
-
9: string;
|
|
358
|
-
10: string;
|
|
359
|
-
12: string;
|
|
360
|
-
14: string;
|
|
361
|
-
16: string;
|
|
362
|
-
20: string;
|
|
363
|
-
24: string;
|
|
364
|
-
28: string;
|
|
365
|
-
32: string;
|
|
366
|
-
36: string;
|
|
367
|
-
40: string;
|
|
368
|
-
44: string;
|
|
369
|
-
48: string;
|
|
370
|
-
52: string;
|
|
371
|
-
56: string;
|
|
372
|
-
60: string;
|
|
373
|
-
64: string;
|
|
374
|
-
72: string;
|
|
375
|
-
80: string;
|
|
376
|
-
96: string;
|
|
377
|
-
112: string;
|
|
378
|
-
128: string;
|
|
379
|
-
};
|
|
380
|
-
spacingest: {
|
|
381
|
-
quarck: string;
|
|
382
|
-
nano: string;
|
|
383
|
-
xs: string;
|
|
384
|
-
sm: string;
|
|
385
|
-
md: string;
|
|
386
|
-
lg: string;
|
|
387
|
-
px: string;
|
|
388
|
-
0.5: string;
|
|
389
|
-
1: string;
|
|
390
|
-
1.5: string;
|
|
391
|
-
2: string;
|
|
392
|
-
2.5: string;
|
|
393
|
-
3: string;
|
|
394
|
-
3.5: string;
|
|
395
|
-
4: string;
|
|
396
|
-
5: string;
|
|
397
|
-
6: string;
|
|
398
|
-
7: string;
|
|
399
|
-
8: string;
|
|
400
|
-
9: string;
|
|
401
|
-
10: string;
|
|
402
|
-
12: string;
|
|
403
|
-
14: string;
|
|
404
|
-
16: string;
|
|
405
|
-
20: string;
|
|
406
|
-
24: string;
|
|
407
|
-
28: string;
|
|
408
|
-
32: string;
|
|
409
|
-
36: string;
|
|
410
|
-
40: string;
|
|
411
|
-
44: string;
|
|
412
|
-
48: string;
|
|
413
|
-
52: string;
|
|
414
|
-
56: string;
|
|
415
|
-
60: string;
|
|
416
|
-
64: string;
|
|
417
|
-
72: string;
|
|
418
|
-
80: string;
|
|
419
|
-
96: string;
|
|
420
|
-
112: string;
|
|
421
|
-
128: string;
|
|
422
|
-
};
|
|
423
|
-
borderRadius: {
|
|
424
|
-
default: string;
|
|
425
|
-
};
|
|
426
|
-
shadow: {
|
|
427
|
-
level1: string;
|
|
428
|
-
level2: string;
|
|
429
|
-
level3: string;
|
|
430
|
-
};
|
|
431
|
-
buttonSize: {
|
|
432
|
-
xs: string;
|
|
433
|
-
sm: string;
|
|
434
|
-
md: string;
|
|
435
|
-
lg: string;
|
|
436
|
-
xl: string;
|
|
437
|
-
};
|
|
438
|
-
transition: {
|
|
439
|
-
speed: string;
|
|
440
|
-
};
|
|
441
|
-
zIndex: {
|
|
442
|
-
default: string;
|
|
443
|
-
level1: string;
|
|
444
|
-
level2: string;
|
|
445
|
-
level3: string;
|
|
446
|
-
level4: string;
|
|
447
|
-
level6: string;
|
|
448
|
-
level8: string;
|
|
449
|
-
level12: string;
|
|
450
|
-
level16: string;
|
|
451
|
-
level24: string;
|
|
452
|
-
level48: string;
|
|
453
|
-
};
|
|
454
|
-
};
|
|
455
7
|
};
|
|
8
|
+
export declare function useTheme(): UseThemeReturn;
|
|
9
|
+
export {};
|
|
456
10
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/hooks/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/hooks/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgB,MAAM,IAAI,CAAC;AAG7C,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC9C,CAAC;AAEF,wBAAgB,QAAQ,IAAI,cAAc,CAOzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useTheme=
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.useTheme=useTheme;var _react=require("react"),_=require(".."),_ThemeContext=require("../contexts/ThemeContext"),_excluded=["theme"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function useTheme(){var _useContext=(0,_react.useContext)(_ThemeContext.ThemeContext),theme=_useContext.theme,rest=_objectWithoutProperties(_useContext,_excluded);return _objectSpread({theme:theme||_.defaultTheme},rest)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _react=require("@testing-library/react");require("@testing-library/jest-dom");var _=require("."),_jsxRuntime=require("react/jsx-runtime");function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"==state)throw new Error("Generator is already running");if("completed"==state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"==state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(void 0===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var setup=function(props){var utils=(0,_react.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_.PPUIThemeProvider,_objectSpread(_objectSpread({},props),{},{children:props.children})));return utils};describe("Theme",function(){it("should extend the default theme and pass it to pp provider",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var newTheme,TestComponent,utils;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return newTheme=(0,_.extendTheme)({colors:{primary:"#ff0000"}}),TestComponent=function TestComponent(){var _useTheme=(0,_.useTheme)(),theme=_useTheme.theme,color=theme.colors.primary;return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:color})},utils=setup({theme:newTheme,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(TestComponent,{})}),_context.t0=expect,_context.next=6,utils.findByText("#ff0000");case 6:_context.t1=_context.sent,(0,_context.t0)(_context.t1).toBeInTheDocument();case 8:case"end":return _context.stop();}},_callee)}))),it("should to apply the dark mode for child components and switch that to light mode",function(){var ChildComponent=function ChildComponent(){var _useColorMode=(0,_.useColorMode)(),colorMode=_useColorMode.colorMode,switchColorMode=_useColorMode.switchColorMode;return/*#__PURE__*/(0,_jsxRuntime.jsx)("button",{"data-testid":"button-child",onClick:switchColorMode,children:"light"===colorMode?"Light mode":"Dark mode"})},utils=setup({children:/*#__PURE__*/(0,_jsxRuntime.jsx)(ChildComponent,{})});expect(utils.getByTestId("button-child")).toHaveTextContent("Light mode"),_react.fireEvent.click(utils.getByTestId("button-child")),expect(utils.getByTestId("button-child")).toHaveTextContent("Dark mode"),_react.fireEvent.click(utils.getByTestId("button-child"))}),it("should to switch between two colors according to color mode",function(){var ChildComponent=function ChildComponent(){var _useColorMode2=(0,_.useColorMode)(),switchColorMode=_useColorMode2.switchColorMode,color=(0,_.useColorModeValue)("#ff0000","#0000ff");return/*#__PURE__*/(0,_jsxRuntime.jsx)("button",{"data-testid":"button-child",onClick:switchColorMode,children:color})},utils=setup({children:/*#__PURE__*/(0,_jsxRuntime.jsx)(ChildComponent,{})});expect(utils.getByTestId("button-child")).toHaveTextContent("#ff0000"),_react.fireEvent.click(utils.getByTestId("button-child")),expect(utils.getByTestId("button-child")).toHaveTextContent("#0000ff")})});
|
|
1
|
+
"use strict";var _react=require("@testing-library/react");require("@testing-library/jest-dom");var _=require("."),_jsxRuntime=require("react/jsx-runtime");function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"==state)throw new Error("Generator is already running");if("completed"==state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"==state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(void 0===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var setup=function(props){var utils=(0,_react.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_.PPUIThemeProvider,_objectSpread(_objectSpread({},props),{},{children:props.children})));return utils};describe("Theme",function(){it("should extend the default theme and pass it to pp provider",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var newTheme,TestComponent,utils;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return newTheme=(0,_.extendTheme)({colors:{primary:{default:"#ff0000"}}}),TestComponent=function TestComponent(){var _useTheme=(0,_.useTheme)(),theme=_useTheme.theme,color=theme.colors.primary.default;return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:color})},utils=setup({theme:newTheme,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(TestComponent,{})}),_context.t0=expect,_context.next=6,utils.findByText("#ff0000");case 6:_context.t1=_context.sent,(0,_context.t0)(_context.t1).toBeInTheDocument();case 8:case"end":return _context.stop();}},_callee)}))),it("should to apply the dark mode for child components and switch that to light mode",function(){var ChildComponent=function ChildComponent(){var _useColorMode=(0,_.useColorMode)(),colorMode=_useColorMode.colorMode,switchColorMode=_useColorMode.switchColorMode;return/*#__PURE__*/(0,_jsxRuntime.jsx)("button",{"data-testid":"button-child",onClick:switchColorMode,children:"light"===colorMode?"Light mode":"Dark mode"})},utils=setup({children:/*#__PURE__*/(0,_jsxRuntime.jsx)(ChildComponent,{})});expect(utils.getByTestId("button-child")).toHaveTextContent("Light mode"),_react.fireEvent.click(utils.getByTestId("button-child")),expect(utils.getByTestId("button-child")).toHaveTextContent("Dark mode"),_react.fireEvent.click(utils.getByTestId("button-child"))}),it("should to switch between two colors according to color mode",function(){var ChildComponent=function ChildComponent(){var _useColorMode2=(0,_.useColorMode)(),switchColorMode=_useColorMode2.switchColorMode,color=(0,_.useColorModeValue)("#ff0000","#0000ff");return/*#__PURE__*/(0,_jsxRuntime.jsx)("button",{"data-testid":"button-child",onClick:switchColorMode,children:color})},utils=setup({children:/*#__PURE__*/(0,_jsxRuntime.jsx)(ChildComponent,{})});expect(utils.getByTestId("button-child")).toHaveTextContent("#ff0000"),_react.fireEvent.click(utils.getByTestId("button-child")),expect(utils.getByTestId("button-child")).toHaveTextContent("#0000ff")})});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defaultTheme } from '.';
|
|
2
|
+
import { DeepPartial, DeepUnionObject } from '../types/generics';
|
|
2
3
|
export type ThemeBase = typeof defaultTheme;
|
|
3
4
|
export type ExtendThemeProps = ThemeBase;
|
|
4
5
|
export type ThemeBaseColors = ThemeBase['colors'];
|
|
@@ -16,8 +17,19 @@ export type CustomThemeProps = {
|
|
|
16
17
|
[Key2 in keyof ExtendThemeProps[Key]]: Partial<ExtendThemeProps[Key][Key2]> | string;
|
|
17
18
|
}>;
|
|
18
19
|
};
|
|
19
|
-
export type
|
|
20
|
-
[key: string]:
|
|
21
|
-
}
|
|
22
|
-
export type
|
|
20
|
+
export type ExtendedMethodCustomColors = Pick<ThemeBase, 'colors'> & {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
export type CustomTheme = ThemeBase & {
|
|
24
|
+
colors: {
|
|
25
|
+
light?: Partial<ExtendedMethodCustomColors>;
|
|
26
|
+
dark?: Partial<ExtendedMethodCustomColors>;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type ExtendMethodProps = (customTheme: DeepUnionObject<CustomTheme>, oldTheme?: DeepUnionObject<DeepPartial<ThemeBase>>) => DeepUnionObject<ThemeBase>;
|
|
31
|
+
export type ColorKeys = keyof ThemeBase['colors'];
|
|
32
|
+
export type ColorValues<T extends ColorKeys> = keyof ThemeBase['colors'][T];
|
|
33
|
+
export type ThemeColorsByColorKey<T extends ColorKeys> = T extends ColorKeys ? `${T}.${Extract<ColorValues<T>, string>}` : never;
|
|
34
|
+
export type GlobalColorsProps = ThemeColorsByColorKey<ColorKeys>;
|
|
23
35
|
//# sourceMappingURL=theme.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../src/shared/theme/theme.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../src/shared/theme/theme.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,SAAS,GAAG,OAAO,YAAY,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG;IAC5D,MAAM,EACF;QACE,IAAI,EAAE,eAAe,CAAC;QACtB,KAAK,EAAE,eAAe,CAAC;KACxB,GACD,eAAe,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;KAC5B,GAAG,IAAI,MAAM,gBAAgB,CAAC,CAAC,EAAE,OAAO,CACrC,gBAAgB,CAAC,GAAG,CAAC,GACrB;SACG,IAAI,IAAI,MAAM,gBAAgB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM;KACrF,CACJ;CACF,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG;IACnE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,MAAM,EAAE;QACN,KAAK,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC5C,IAAI,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,WAAW,EAAE,eAAe,CAAC,WAAW,CAAC,EACzC,QAAQ,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,KAC/C,eAAe,CAAC,SAAS,CAAC,CAAC;AAEhC,MAAM,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;AAClD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,SAAS,IAAI,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,SAAS,GACxE,GAAG,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GACzC,KAAK,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/utils/extendTheme.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"extendTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/utils/extendTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAElE,eAAO,MAAM,WAAW,EAAE,iBA6BzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendTheme=void 0;var _=require(".."),_excluded=["light","dark"];function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var extendTheme=function(customTheme,recursiveTheme){var theme=recursiveTheme?_objectSpread({},recursiveTheme):_objectSpread({},_.defaultTheme);for(var token in customTheme){var customToken=customTheme[token],hasNoColorMode=!Object.hasOwn(customTheme,"darkColors");if("colors"==token&&hasNoColorMode){var colors=customTheme[token],restTheme=_objectWithoutProperties(customTheme,[token].map(_toPropertyKey)),_ref=colors,light=_ref.light,dark=_ref.dark,restColors=_objectWithoutProperties(_ref,_excluded);return extendTheme(_objectSpread({lightColors:_objectSpread(_objectSpread({},light),restColors),darkColors:_objectSpread(_objectSpread({},dark),restColors),colors:restColors},restTheme))}theme[token]=theme[token]&&"object"===_typeof(customToken)?extendTheme(customToken,theme[token]):customTheme[token]}return theme};exports.extendTheme=extendTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendTheme.test.d.ts","sourceRoot":"","sources":["../../../../../src/shared/theme/utils/tests/extendTheme.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _findDifferentKeys=require("../../../../utils/findDifferentKeys"),_theme=require("../../theme"),_extendTheme=require("../extendTheme");describe("extendTheme",function(){test("Should extend primary colors object",function(){var newTheme={colors:{primary:{new_color:"#3ec1c9"}}},extendedTheme=(0,_extendTheme.extendTheme)(newTheme),differentTokens=(0,_findDifferentKeys.findDifferentKeys)(extendedTheme,_theme.defaultTheme);expect(differentTokens).toEqual(["colors.primary.new_color","lightColors.primary.new_color","darkColors.primary.new_color"]),differentTokens.forEach(function(token){expect(extendedTheme).toHaveProperty(token,newTheme.colors.primary.new_color)})}),test("Should extend the colors object",function(){var newTheme={colors:{messenger_chat:{check:"blue"}}},extendedTheme=(0,_extendTheme.extendTheme)(newTheme);expect(extendedTheme).toHaveProperty("colors.messenger_chat.check",newTheme.colors.messenger_chat.check),expect(extendedTheme).toHaveProperty("colors.primary");var differentTokens=(0,_findDifferentKeys.findDifferentKeys)(extendedTheme,_theme.defaultTheme);expect(differentTokens).toEqual(["colors.messenger_chat.check","lightColors.messenger_chat.check","darkColors.messenger_chat.check"]),differentTokens.forEach(function(token){expect(extendedTheme).toHaveProperty(token,newTheme.colors.messenger_chat.check)})}),test("Should subscribe a theme property",function(){var newTheme={colors:{primary:{default:"#3ec1c9",disabled:"#c9eef0"}}},extendedTheme=(0,_extendTheme.extendTheme)(newTheme),differentTokens=(0,_findDifferentKeys.findDifferentKeys)(extendedTheme,_theme.defaultTheme);expect(differentTokens).toEqual(["colors.primary.disabled","colors.primary.default","lightColors.primary.disabled","lightColors.primary.default","darkColors.primary.disabled","darkColors.primary.default"]),differentTokens.forEach(function(token){var lastVariant=token.split(".").at(-1);expect(extendedTheme).toHaveProperty(token,newTheme.colors.primary[lastVariant])})}),test("Should add colors even light or dark keys not be declared",function(){var newTheme={colors:{primary:{default:"#3ec1c9"}}},extendedTheme=(0,_extendTheme.extendTheme)(newTheme);expect(extendedTheme).toHaveProperty("lightColors.primary.default",newTheme.colors.primary.default),expect(extendedTheme).toHaveProperty("darkColors.primary.default",newTheme.colors.primary.default)}),test("Should add custom token in theme",function(){var extendedTheme=(0,_extendTheme.extendTheme)({messenger_breakpoints:{md:"1366px"}}),differentTokens=(0,_findDifferentKeys.findDifferentKeys)(extendedTheme,_theme.defaultTheme);expect(differentTokens).toEqual(["messenger_breakpoints.md"]),expect(extendedTheme).toHaveProperty("messenger_breakpoints.md","1366px")})});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type DeepUnionObject<T> = {
|
|
2
|
+
[K in keyof T]?: T[K] extends object ? DeepUnionObject<T[K]> : T[K];
|
|
3
|
+
} & {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export type DeepPartial<T> = T extends object ? {
|
|
7
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
8
|
+
} : T;
|
|
9
|
+
//# sourceMappingURL=generics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../../src/shared/types/generics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;KAC9B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACpE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAE3B,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|