creactive 0.0.54 → 0.0.56

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 (66) hide show
  1. package/build/contexts/media/components/index.d.ts +1 -0
  2. package/build/contexts/media/components/wrapper/index.d.ts +2 -2
  3. package/build/contexts/media/components/wrapper/wrapper.d.ts +3 -0
  4. package/build/contexts/media/components/wrapper/wrapper.types.d.ts +3 -1
  5. package/build/index.js +1656 -2
  6. package/package.json +6 -4
  7. package/source/components/index.ts +2 -0
  8. package/source/components/text/constants/color.ts +26 -0
  9. package/source/components/text/constants/font.ts +32 -0
  10. package/source/components/text/constants/index.ts +5 -0
  11. package/source/components/text/constants/role.ts +12 -0
  12. package/source/components/text/constants/text.ts +22 -0
  13. package/source/components/text/constants/type.ts +27 -0
  14. package/source/components/text/index.ts +2 -0
  15. package/source/components/text/spec/children.spec.tsx +13 -0
  16. package/source/components/text/spec/color.spec.native.tsx +15 -0
  17. package/source/components/text/spec/color.spec.tsx +159 -0
  18. package/source/components/text/spec/color.spec.web.tsx +15 -0
  19. package/source/components/text/spec/font.spec.tsx +196 -0
  20. package/source/components/text/spec/position.spec.tsx +15 -0
  21. package/source/components/text/spec/text.spec.native.tsx +1043 -0
  22. package/source/components/text/spec/text.spec.tsx +39 -0
  23. package/source/components/text/spec/text.spec.web.tsx +1043 -0
  24. package/source/components/text/spec/type.spec.web.tsx +55 -0
  25. package/source/components/text/text.stories.tsx +46 -0
  26. package/source/components/text/text.tsx +262 -0
  27. package/source/components/text/text.types.ts +67 -0
  28. package/source/constants/index.ts +46 -0
  29. package/source/constants/theme/color.ts +27 -0
  30. package/source/constants/theme/font.ts +48 -0
  31. package/source/constants/theme/index.ts +50 -0
  32. package/source/constants/theme/text.ts +12 -0
  33. package/source/contexts/index.ts +15 -0
  34. package/source/contexts/media/components/index.ts +4 -0
  35. package/source/contexts/media/components/media/index.ts +2 -0
  36. package/source/contexts/media/components/media/media.tsx +37 -0
  37. package/source/contexts/media/components/media/media.types.ts +26 -0
  38. package/source/contexts/media/components/wrapper/index.ts +2 -0
  39. package/source/contexts/media/components/wrapper/wrapper.tsx +73 -0
  40. package/source/contexts/media/components/wrapper/wrapper.types.ts +3 -0
  41. package/source/contexts/media/constants/breakpoint.ts +18 -0
  42. package/source/contexts/media/constants/index.ts +6 -0
  43. package/source/contexts/media/hooks/index.ts +1 -0
  44. package/source/contexts/media/hooks/use-breakpoint.ts +18 -0
  45. package/source/contexts/media/index.ts +7 -0
  46. package/source/contexts/media/media.tsx +36 -0
  47. package/source/contexts/media/media.types.ts +38 -0
  48. package/source/contexts/theme/index.ts +8 -0
  49. package/source/contexts/theme/theme.tsx +280 -0
  50. package/source/contexts/theme/theme.types.ts +284 -0
  51. package/source/helpers/index.ts +3 -0
  52. package/source/helpers/storybook/constants/control.ts +25 -0
  53. package/source/helpers/storybook/constants/index.ts +1 -0
  54. package/source/helpers/storybook/control.spec.ts +140 -0
  55. package/source/helpers/storybook/control.ts +115 -0
  56. package/source/helpers/storybook/index.ts +1 -0
  57. package/source/helpers/style/index.ts +2 -0
  58. package/source/helpers/style/style.spec.web.ts +20 -0
  59. package/source/helpers/style/style.ts +14 -0
  60. package/source/helpers/style/style.types.ts +14 -0
  61. package/source/hooks/index.ts +1 -0
  62. package/source/hooks/use-theme-style-sheet.ts +135 -0
  63. package/source/index.ts +24 -0
  64. package/build/contexts/media/components/wrapper/wrapper.native.d.ts +0 -2
  65. package/build/contexts/media/components/wrapper/wrapper.web.d.ts +0 -2
  66. package/build/index.js.LICENSE.txt +0 -9
@@ -0,0 +1,1043 @@
1
+ import { faker } from '@faker-js/faker'
2
+ import { render, screen } from '@testing-library/react'
3
+ import { Text } from '../text'
4
+
5
+ describe('@/components/text', () => {
6
+ describe('line height passing as property', () => {
7
+ it('renders with default line height and font size values', () => {
8
+ const text = faker.lorem.words(2)
9
+ render(<Text>{text}</Text>)
10
+ expect(screen.getByText(text)).toHaveStyle({
11
+ lineHeight: '18px',
12
+ })
13
+ })
14
+
15
+ it('renders with default line height when X2S font size provided', () => {
16
+ const text = faker.lorem.words(2)
17
+ render(<Text fontSize={Text.FontSize.X2S}>{text}</Text>)
18
+ expect(screen.getByText(text)).toHaveStyle({
19
+ lineHeight: '12px',
20
+ })
21
+ })
22
+
23
+ it('renders with default line height when XS font size provided', () => {
24
+ const text = faker.lorem.words(2)
25
+ render(<Text fontSize={Text.FontSize.XS}>{text}</Text>)
26
+ expect(screen.getByText(text)).toHaveStyle({
27
+ lineHeight: '14px',
28
+ })
29
+ })
30
+
31
+ it('renders with default line height when SM font size provided', () => {
32
+ const text = faker.lorem.words(2)
33
+ render(<Text fontSize={Text.FontSize.SM}>{text}</Text>)
34
+ expect(screen.getByText(text)).toHaveStyle({
35
+ lineHeight: '16px',
36
+ })
37
+ })
38
+
39
+ it('renders with default line height when MD font size provided', () => {
40
+ const text = faker.lorem.words(2)
41
+ render(<Text fontSize={Text.FontSize.MD}>{text}</Text>)
42
+ expect(screen.getByText(text)).toHaveStyle({
43
+ lineHeight: '18px',
44
+ })
45
+ })
46
+
47
+ it('renders with default line height when LG font size provided', () => {
48
+ const text = faker.lorem.words(2)
49
+ render(<Text fontSize={Text.FontSize.LG}>{text}</Text>)
50
+ expect(screen.getByText(text)).toHaveStyle({
51
+ lineHeight: '20px',
52
+ })
53
+ })
54
+
55
+ it('renders with default line height when XL font size provided', () => {
56
+ const text = faker.lorem.words(2)
57
+ render(<Text fontSize={Text.FontSize.XL}>{text}</Text>)
58
+ expect(screen.getByText(text)).toHaveStyle({
59
+ lineHeight: '24px',
60
+ })
61
+ })
62
+
63
+ it('renders with default line height when X2L font size provided', () => {
64
+ const text = faker.lorem.words(2)
65
+ render(<Text fontSize={Text.FontSize.X2L}>{text}</Text>)
66
+ expect(screen.getByText(text)).toHaveStyle({
67
+ lineHeight: '30px',
68
+ })
69
+ })
70
+
71
+ it('renders with default line height when X3L font size provided', () => {
72
+ const text = faker.lorem.words(2)
73
+ render(<Text fontSize={Text.FontSize.X3L}>{text}</Text>)
74
+ expect(screen.getByText(text)).toHaveStyle({
75
+ lineHeight: '36px',
76
+ })
77
+ })
78
+
79
+ it('renders with default line height when X4L font size provided', () => {
80
+ const text = faker.lorem.words(2)
81
+ render(<Text fontSize={Text.FontSize.X4L}>{text}</Text>)
82
+ expect(screen.getByText(text)).toHaveStyle({
83
+ lineHeight: '48px',
84
+ })
85
+ })
86
+
87
+ it('renders with default line height when X5L font size provided', () => {
88
+ const text = faker.lorem.words(2)
89
+ render(<Text fontSize={Text.FontSize.X5L}>{text}</Text>)
90
+ expect(screen.getByText(text)).toHaveStyle({
91
+ lineHeight: '60px',
92
+ })
93
+ })
94
+
95
+ it('renders with NONE line height when no font size provided', () => {
96
+ const text = faker.lorem.words(2)
97
+ render(<Text lineHeight={Text.LineHeight.NONE}>{text}</Text>)
98
+ expect(screen.getByText(text)).toHaveStyle({
99
+ lineHeight: '18px',
100
+ })
101
+ })
102
+
103
+ it('renders with TIGHT line height when no font size provided', () => {
104
+ const text = faker.lorem.words(2)
105
+ render(<Text lineHeight={Text.LineHeight.TIGHT}>{text}</Text>)
106
+ expect(screen.getByText(text)).toHaveStyle({
107
+ lineHeight: '22.5px',
108
+ })
109
+ })
110
+
111
+ it('renders with SNUG line height when no font size provided', () => {
112
+ const text = faker.lorem.words(2)
113
+ render(<Text lineHeight={Text.LineHeight.SNUG}>{text}</Text>)
114
+ expect(screen.getByText(text)).toHaveStyle({
115
+ lineHeight: '24.75px',
116
+ })
117
+ })
118
+
119
+ it('renders with NORMAL line height when no font size provided', () => {
120
+ const text = faker.lorem.words(2)
121
+ render(<Text lineHeight={Text.LineHeight.NORMAL}>{text}</Text>)
122
+ expect(screen.getByText(text)).toHaveStyle({
123
+ lineHeight: '27px',
124
+ })
125
+ })
126
+
127
+ it('renders with RELAXED line height when no font size provided', () => {
128
+ const text = faker.lorem.words(2)
129
+ render(<Text lineHeight={Text.LineHeight.RELAXED}>{text}</Text>)
130
+ expect(screen.getByText(text)).toHaveStyle({
131
+ lineHeight: '29.25px',
132
+ })
133
+ })
134
+
135
+ it('renders with LOOSE line height when no font size provided', () => {
136
+ const text = faker.lorem.words(2)
137
+ render(<Text lineHeight={Text.LineHeight.LOOSE}>{text}</Text>)
138
+ expect(screen.getByText(text)).toHaveStyle({
139
+ lineHeight: '36px',
140
+ })
141
+ })
142
+
143
+ it('renders with NONE line height and X2S font size', () => {
144
+ const text = faker.lorem.words(2)
145
+ render(
146
+ <Text
147
+ fontSize={Text.FontSize.X2S}
148
+ lineHeight={Text.LineHeight.NONE}
149
+ >
150
+ {text}
151
+ </Text>
152
+ )
153
+ expect(screen.getByText(text)).toHaveStyle({
154
+ lineHeight: '12px',
155
+ })
156
+ })
157
+
158
+ it('renders with NONE line height and XS font size', () => {
159
+ const text = faker.lorem.words(2)
160
+ render(
161
+ <Text
162
+ fontSize={Text.FontSize.XS}
163
+ lineHeight={Text.LineHeight.NONE}
164
+ >
165
+ {text}
166
+ </Text>
167
+ )
168
+ expect(screen.getByText(text)).toHaveStyle({
169
+ lineHeight: '14px',
170
+ })
171
+ })
172
+
173
+ it('renders with NONE line height and SM font size', () => {
174
+ const text = faker.lorem.words(2)
175
+ render(
176
+ <Text
177
+ fontSize={Text.FontSize.SM}
178
+ lineHeight={Text.LineHeight.NONE}
179
+ >
180
+ {text}
181
+ </Text>
182
+ )
183
+ expect(screen.getByText(text)).toHaveStyle({
184
+ lineHeight: '16px',
185
+ })
186
+ })
187
+
188
+ it('renders with NONE line height and MD font size', () => {
189
+ const text = faker.lorem.words(2)
190
+ render(
191
+ <Text
192
+ fontSize={Text.FontSize.MD}
193
+ lineHeight={Text.LineHeight.NONE}
194
+ >
195
+ {text}
196
+ </Text>
197
+ )
198
+ expect(screen.getByText(text)).toHaveStyle({
199
+ lineHeight: '18px',
200
+ })
201
+ })
202
+
203
+ it('renders with NONE line height and LG font size', () => {
204
+ const text = faker.lorem.words(2)
205
+ render(
206
+ <Text
207
+ fontSize={Text.FontSize.LG}
208
+ lineHeight={Text.LineHeight.NONE}
209
+ >
210
+ {text}
211
+ </Text>
212
+ )
213
+ expect(screen.getByText(text)).toHaveStyle({
214
+ lineHeight: '20px',
215
+ })
216
+ })
217
+
218
+ it('renders with NONE line height and XL font size', () => {
219
+ const text = faker.lorem.words(2)
220
+ render(
221
+ <Text
222
+ fontSize={Text.FontSize.XL}
223
+ lineHeight={Text.LineHeight.NONE}
224
+ >
225
+ {text}
226
+ </Text>
227
+ )
228
+ expect(screen.getByText(text)).toHaveStyle({
229
+ lineHeight: '24px',
230
+ })
231
+ })
232
+
233
+ it('renders with NONE line height and X2L font size', () => {
234
+ const text = faker.lorem.words(2)
235
+ render(
236
+ <Text
237
+ fontSize={Text.FontSize.X2L}
238
+ lineHeight={Text.LineHeight.NONE}
239
+ >
240
+ {text}
241
+ </Text>
242
+ )
243
+ expect(screen.getByText(text)).toHaveStyle({
244
+ lineHeight: '30px',
245
+ })
246
+ })
247
+
248
+ it('renders with NONE line height and X3L font size', () => {
249
+ const text = faker.lorem.words(2)
250
+ render(
251
+ <Text
252
+ fontSize={Text.FontSize.X3L}
253
+ lineHeight={Text.LineHeight.NONE}
254
+ >
255
+ {text}
256
+ </Text>
257
+ )
258
+ expect(screen.getByText(text)).toHaveStyle({
259
+ lineHeight: '36px',
260
+ })
261
+ })
262
+
263
+ it('renders with NONE line height and X4L font size', () => {
264
+ const text = faker.lorem.words(2)
265
+ render(
266
+ <Text
267
+ fontSize={Text.FontSize.X4L}
268
+ lineHeight={Text.LineHeight.NONE}
269
+ >
270
+ {text}
271
+ </Text>
272
+ )
273
+ expect(screen.getByText(text)).toHaveStyle({
274
+ lineHeight: '48px',
275
+ })
276
+ })
277
+
278
+ it('renders with NONE line height and X5L font size', () => {
279
+ const text = faker.lorem.words(2)
280
+ render(
281
+ <Text
282
+ fontSize={Text.FontSize.X5L}
283
+ lineHeight={Text.LineHeight.NONE}
284
+ >
285
+ {text}
286
+ </Text>
287
+ )
288
+ expect(screen.getByText(text)).toHaveStyle({
289
+ lineHeight: '60px',
290
+ })
291
+ })
292
+
293
+ it('renders with TIGHT line height and X2S font size', () => {
294
+ const text = faker.lorem.words(2)
295
+ render(
296
+ <Text
297
+ fontSize={Text.FontSize.X2S}
298
+ lineHeight={Text.LineHeight.TIGHT}
299
+ >
300
+ {text}
301
+ </Text>
302
+ )
303
+ expect(screen.getByText(text)).toHaveStyle({
304
+ lineHeight: '15px',
305
+ })
306
+ })
307
+
308
+ it('renders with TIGHT line height and XS font size', () => {
309
+ const text = faker.lorem.words(2)
310
+ render(
311
+ <Text
312
+ fontSize={Text.FontSize.XS}
313
+ lineHeight={Text.LineHeight.TIGHT}
314
+ >
315
+ {text}
316
+ </Text>
317
+ )
318
+ expect(screen.getByText(text)).toHaveStyle({
319
+ lineHeight: '17.5px',
320
+ })
321
+ })
322
+
323
+ it('renders with TIGHT line height and SM font size', () => {
324
+ const text = faker.lorem.words(2)
325
+ render(
326
+ <Text
327
+ fontSize={Text.FontSize.SM}
328
+ lineHeight={Text.LineHeight.TIGHT}
329
+ >
330
+ {text}
331
+ </Text>
332
+ )
333
+ expect(screen.getByText(text)).toHaveStyle({
334
+ lineHeight: '20px',
335
+ })
336
+ })
337
+
338
+ it('renders with TIGHT line height and MD font size', () => {
339
+ const text = faker.lorem.words(2)
340
+ render(
341
+ <Text
342
+ fontSize={Text.FontSize.MD}
343
+ lineHeight={Text.LineHeight.TIGHT}
344
+ >
345
+ {text}
346
+ </Text>
347
+ )
348
+ expect(screen.getByText(text)).toHaveStyle({
349
+ lineHeight: '22.5px',
350
+ })
351
+ })
352
+
353
+ it('renders with TIGHT line height and LG font size', () => {
354
+ const text = faker.lorem.words(2)
355
+ render(
356
+ <Text
357
+ fontSize={Text.FontSize.LG}
358
+ lineHeight={Text.LineHeight.TIGHT}
359
+ >
360
+ {text}
361
+ </Text>
362
+ )
363
+ expect(screen.getByText(text)).toHaveStyle({
364
+ lineHeight: '25px',
365
+ })
366
+ })
367
+
368
+ it('renders with TIGHT line height and XL font size', () => {
369
+ const text = faker.lorem.words(2)
370
+ render(
371
+ <Text
372
+ fontSize={Text.FontSize.XL}
373
+ lineHeight={Text.LineHeight.TIGHT}
374
+ >
375
+ {text}
376
+ </Text>
377
+ )
378
+ expect(screen.getByText(text)).toHaveStyle({
379
+ lineHeight: '30px',
380
+ })
381
+ })
382
+
383
+ it('renders with TIGHT line height and X2L font size', () => {
384
+ const text = faker.lorem.words(2)
385
+ render(
386
+ <Text
387
+ fontSize={Text.FontSize.X2L}
388
+ lineHeight={Text.LineHeight.TIGHT}
389
+ >
390
+ {text}
391
+ </Text>
392
+ )
393
+ expect(screen.getByText(text)).toHaveStyle({
394
+ lineHeight: '37.5px',
395
+ })
396
+ })
397
+
398
+ it('renders with TIGHT line height and X3L font size', () => {
399
+ const text = faker.lorem.words(2)
400
+ render(
401
+ <Text
402
+ fontSize={Text.FontSize.X3L}
403
+ lineHeight={Text.LineHeight.TIGHT}
404
+ >
405
+ {text}
406
+ </Text>
407
+ )
408
+ expect(screen.getByText(text)).toHaveStyle({
409
+ lineHeight: '45px',
410
+ })
411
+ })
412
+
413
+ it('renders with TIGHT line height and X4L font size', () => {
414
+ const text = faker.lorem.words(2)
415
+ render(
416
+ <Text
417
+ fontSize={Text.FontSize.X4L}
418
+ lineHeight={Text.LineHeight.TIGHT}
419
+ >
420
+ {text}
421
+ </Text>
422
+ )
423
+ expect(screen.getByText(text)).toHaveStyle({
424
+ lineHeight: '60px',
425
+ })
426
+ })
427
+
428
+ it('renders with TIGHT line height and X5L font size', () => {
429
+ const text = faker.lorem.words(2)
430
+ render(
431
+ <Text
432
+ fontSize={Text.FontSize.X5L}
433
+ lineHeight={Text.LineHeight.TIGHT}
434
+ >
435
+ {text}
436
+ </Text>
437
+ )
438
+ expect(screen.getByText(text)).toHaveStyle({
439
+ lineHeight: '75px',
440
+ })
441
+ })
442
+
443
+ it('renders with SNUG line height and X2S font size', () => {
444
+ const text = faker.lorem.words(2)
445
+ render(
446
+ <Text
447
+ fontSize={Text.FontSize.X2S}
448
+ lineHeight={Text.LineHeight.SNUG}
449
+ >
450
+ {text}
451
+ </Text>
452
+ )
453
+ expect(screen.getByText(text)).toHaveStyle({
454
+ lineHeight: '16.5px',
455
+ })
456
+ })
457
+
458
+ it('renders with SNUG line height and XS font size', () => {
459
+ const text = faker.lorem.words(2)
460
+ render(
461
+ <Text
462
+ fontSize={Text.FontSize.XS}
463
+ lineHeight={Text.LineHeight.SNUG}
464
+ >
465
+ {text}
466
+ </Text>
467
+ )
468
+ expect(screen.getByText(text)).toHaveStyle({
469
+ lineHeight: '19.25px',
470
+ })
471
+ })
472
+
473
+ it('renders with SNUG line height and SM font size', () => {
474
+ const text = faker.lorem.words(2)
475
+ render(
476
+ <Text
477
+ fontSize={Text.FontSize.SM}
478
+ lineHeight={Text.LineHeight.SNUG}
479
+ >
480
+ {text}
481
+ </Text>
482
+ )
483
+ expect(screen.getByText(text)).toHaveStyle({
484
+ lineHeight: '22px',
485
+ })
486
+ })
487
+
488
+ it('renders with SNUG line height and MD font size', () => {
489
+ const text = faker.lorem.words(2)
490
+ render(
491
+ <Text
492
+ fontSize={Text.FontSize.MD}
493
+ lineHeight={Text.LineHeight.SNUG}
494
+ >
495
+ {text}
496
+ </Text>
497
+ )
498
+ expect(screen.getByText(text)).toHaveStyle({
499
+ lineHeight: '24.75px',
500
+ })
501
+ })
502
+
503
+ it('renders with SNUG line height and LG font size', () => {
504
+ const text = faker.lorem.words(2)
505
+ render(
506
+ <Text
507
+ fontSize={Text.FontSize.LG}
508
+ lineHeight={Text.LineHeight.SNUG}
509
+ >
510
+ {text}
511
+ </Text>
512
+ )
513
+ expect(screen.getByText(text)).toHaveStyle({
514
+ lineHeight: '27.5px',
515
+ })
516
+ })
517
+
518
+ it('renders with SNUG line height and XL font size', () => {
519
+ const text = faker.lorem.words(2)
520
+ render(
521
+ <Text
522
+ fontSize={Text.FontSize.XL}
523
+ lineHeight={Text.LineHeight.SNUG}
524
+ >
525
+ {text}
526
+ </Text>
527
+ )
528
+ expect(screen.getByText(text)).toHaveStyle({
529
+ lineHeight: '33px',
530
+ })
531
+ })
532
+
533
+ it('renders with SNUG line height and X2L font size', () => {
534
+ const text = faker.lorem.words(2)
535
+ render(
536
+ <Text
537
+ fontSize={Text.FontSize.X2L}
538
+ lineHeight={Text.LineHeight.SNUG}
539
+ >
540
+ {text}
541
+ </Text>
542
+ )
543
+ expect(screen.getByText(text)).toHaveStyle({
544
+ lineHeight: '41.25px',
545
+ })
546
+ })
547
+
548
+ it('renders with SNUG line height and X3L font size', () => {
549
+ const text = faker.lorem.words(2)
550
+ render(
551
+ <Text
552
+ fontSize={Text.FontSize.X3L}
553
+ lineHeight={Text.LineHeight.SNUG}
554
+ >
555
+ {text}
556
+ </Text>
557
+ )
558
+ expect(screen.getByText(text)).toHaveStyle({
559
+ lineHeight: '49.5px',
560
+ })
561
+ })
562
+
563
+ it('renders with SNUG line height and X4L font size', () => {
564
+ const text = faker.lorem.words(2)
565
+ render(
566
+ <Text
567
+ fontSize={Text.FontSize.X4L}
568
+ lineHeight={Text.LineHeight.SNUG}
569
+ >
570
+ {text}
571
+ </Text>
572
+ )
573
+ expect(screen.getByText(text)).toHaveStyle({
574
+ lineHeight: '66px',
575
+ })
576
+ })
577
+
578
+ it('renders with SNUG line height and X5L font size', () => {
579
+ const text = faker.lorem.words(2)
580
+ render(
581
+ <Text
582
+ fontSize={Text.FontSize.X5L}
583
+ lineHeight={Text.LineHeight.SNUG}
584
+ >
585
+ {text}
586
+ </Text>
587
+ )
588
+ expect(screen.getByText(text)).toHaveStyle({
589
+ lineHeight: '82.5px',
590
+ })
591
+ })
592
+
593
+ it('renders with NORMAL line height and X2S font size', () => {
594
+ const text = faker.lorem.words(2)
595
+ render(
596
+ <Text
597
+ fontSize={Text.FontSize.X2S}
598
+ lineHeight={Text.LineHeight.NORMAL}
599
+ >
600
+ {text}
601
+ </Text>
602
+ )
603
+ expect(screen.getByText(text)).toHaveStyle({
604
+ lineHeight: '18px',
605
+ })
606
+ })
607
+
608
+ it('renders with NORMAL line height and XS font size', () => {
609
+ const text = faker.lorem.words(2)
610
+ render(
611
+ <Text
612
+ fontSize={Text.FontSize.XS}
613
+ lineHeight={Text.LineHeight.NORMAL}
614
+ >
615
+ {text}
616
+ </Text>
617
+ )
618
+ expect(screen.getByText(text)).toHaveStyle({
619
+ lineHeight: '21px',
620
+ })
621
+ })
622
+
623
+ it('renders with NORMAL line height and SM font size', () => {
624
+ const text = faker.lorem.words(2)
625
+ render(
626
+ <Text
627
+ fontSize={Text.FontSize.SM}
628
+ lineHeight={Text.LineHeight.NORMAL}
629
+ >
630
+ {text}
631
+ </Text>
632
+ )
633
+ expect(screen.getByText(text)).toHaveStyle({
634
+ lineHeight: '24px',
635
+ })
636
+ })
637
+
638
+ it('renders with NORMAL line height and MD font size', () => {
639
+ const text = faker.lorem.words(2)
640
+ render(
641
+ <Text
642
+ fontSize={Text.FontSize.MD}
643
+ lineHeight={Text.LineHeight.NORMAL}
644
+ >
645
+ {text}
646
+ </Text>
647
+ )
648
+ expect(screen.getByText(text)).toHaveStyle({
649
+ lineHeight: '27px',
650
+ })
651
+ })
652
+
653
+ it('renders with NORMAL line height and LG font size', () => {
654
+ const text = faker.lorem.words(2)
655
+ render(
656
+ <Text
657
+ fontSize={Text.FontSize.LG}
658
+ lineHeight={Text.LineHeight.NORMAL}
659
+ >
660
+ {text}
661
+ </Text>
662
+ )
663
+ expect(screen.getByText(text)).toHaveStyle({
664
+ lineHeight: '30px',
665
+ })
666
+ })
667
+
668
+ it('renders with NORMAL line height and XL font size', () => {
669
+ const text = faker.lorem.words(2)
670
+ render(
671
+ <Text
672
+ fontSize={Text.FontSize.XL}
673
+ lineHeight={Text.LineHeight.NORMAL}
674
+ >
675
+ {text}
676
+ </Text>
677
+ )
678
+ expect(screen.getByText(text)).toHaveStyle({
679
+ lineHeight: '36px',
680
+ })
681
+ })
682
+
683
+ it('renders with NORMAL line height and X2L font size', () => {
684
+ const text = faker.lorem.words(2)
685
+ render(
686
+ <Text
687
+ fontSize={Text.FontSize.X2L}
688
+ lineHeight={Text.LineHeight.NORMAL}
689
+ >
690
+ {text}
691
+ </Text>
692
+ )
693
+ expect(screen.getByText(text)).toHaveStyle({
694
+ lineHeight: '45px',
695
+ })
696
+ })
697
+
698
+ it('renders with NORMAL line height and X3L font size', () => {
699
+ const text = faker.lorem.words(2)
700
+ render(
701
+ <Text
702
+ fontSize={Text.FontSize.X3L}
703
+ lineHeight={Text.LineHeight.NORMAL}
704
+ >
705
+ {text}
706
+ </Text>
707
+ )
708
+ expect(screen.getByText(text)).toHaveStyle({
709
+ lineHeight: '54px',
710
+ })
711
+ })
712
+
713
+ it('renders with NORMAL line height and X4L font size', () => {
714
+ const text = faker.lorem.words(2)
715
+ render(
716
+ <Text
717
+ fontSize={Text.FontSize.X4L}
718
+ lineHeight={Text.LineHeight.NORMAL}
719
+ >
720
+ {text}
721
+ </Text>
722
+ )
723
+ expect(screen.getByText(text)).toHaveStyle({
724
+ lineHeight: '72px',
725
+ })
726
+ })
727
+
728
+ it('renders with NORMAL line height and X5L font size', () => {
729
+ const text = faker.lorem.words(2)
730
+ render(
731
+ <Text
732
+ fontSize={Text.FontSize.X5L}
733
+ lineHeight={Text.LineHeight.NORMAL}
734
+ >
735
+ {text}
736
+ </Text>
737
+ )
738
+ expect(screen.getByText(text)).toHaveStyle({
739
+ lineHeight: '90px',
740
+ })
741
+ })
742
+
743
+ it('renders with RELAXED line height and X2S font size', () => {
744
+ const text = faker.lorem.words(2)
745
+ render(
746
+ <Text
747
+ fontSize={Text.FontSize.X2S}
748
+ lineHeight={Text.LineHeight.RELAXED}
749
+ >
750
+ {text}
751
+ </Text>
752
+ )
753
+ expect(screen.getByText(text)).toHaveStyle({
754
+ lineHeight: '19.5px',
755
+ })
756
+ })
757
+
758
+ it('renders with RELAXED line height and XS font size', () => {
759
+ const text = faker.lorem.words(2)
760
+ render(
761
+ <Text
762
+ fontSize={Text.FontSize.XS}
763
+ lineHeight={Text.LineHeight.RELAXED}
764
+ >
765
+ {text}
766
+ </Text>
767
+ )
768
+ expect(screen.getByText(text)).toHaveStyle({
769
+ lineHeight: '22.75px',
770
+ })
771
+ })
772
+
773
+ it('renders with RELAXED line height and SM font size', () => {
774
+ const text = faker.lorem.words(2)
775
+ render(
776
+ <Text
777
+ fontSize={Text.FontSize.SM}
778
+ lineHeight={Text.LineHeight.RELAXED}
779
+ >
780
+ {text}
781
+ </Text>
782
+ )
783
+ expect(screen.getByText(text)).toHaveStyle({
784
+ lineHeight: '26px',
785
+ })
786
+ })
787
+
788
+ it('renders with RELAXED line height and MD font size', () => {
789
+ const text = faker.lorem.words(2)
790
+ render(
791
+ <Text
792
+ fontSize={Text.FontSize.MD}
793
+ lineHeight={Text.LineHeight.RELAXED}
794
+ >
795
+ {text}
796
+ </Text>
797
+ )
798
+ expect(screen.getByText(text)).toHaveStyle({
799
+ lineHeight: '29.25px',
800
+ })
801
+ })
802
+
803
+ it('renders with RELAXED line height and LG font size', () => {
804
+ const text = faker.lorem.words(2)
805
+ render(
806
+ <Text
807
+ fontSize={Text.FontSize.LG}
808
+ lineHeight={Text.LineHeight.RELAXED}
809
+ >
810
+ {text}
811
+ </Text>
812
+ )
813
+ expect(screen.getByText(text)).toHaveStyle({
814
+ lineHeight: '32.5px',
815
+ })
816
+ })
817
+
818
+ it('renders with RELAXED line height and XL font size', () => {
819
+ const text = faker.lorem.words(2)
820
+ render(
821
+ <Text
822
+ fontSize={Text.FontSize.XL}
823
+ lineHeight={Text.LineHeight.RELAXED}
824
+ >
825
+ {text}
826
+ </Text>
827
+ )
828
+ expect(screen.getByText(text)).toHaveStyle({
829
+ lineHeight: '39px',
830
+ })
831
+ })
832
+
833
+ it('renders with RELAXED line height and X2L font size', () => {
834
+ const text = faker.lorem.words(2)
835
+ render(
836
+ <Text
837
+ fontSize={Text.FontSize.X2L}
838
+ lineHeight={Text.LineHeight.RELAXED}
839
+ >
840
+ {text}
841
+ </Text>
842
+ )
843
+ expect(screen.getByText(text)).toHaveStyle({
844
+ lineHeight: '48.75px',
845
+ })
846
+ })
847
+
848
+ it('renders with RELAXED line height and X3L font size', () => {
849
+ const text = faker.lorem.words(2)
850
+ render(
851
+ <Text
852
+ fontSize={Text.FontSize.X3L}
853
+ lineHeight={Text.LineHeight.RELAXED}
854
+ >
855
+ {text}
856
+ </Text>
857
+ )
858
+ expect(screen.getByText(text)).toHaveStyle({
859
+ lineHeight: '58.5px',
860
+ })
861
+ })
862
+
863
+ it('renders with RELAXED line height and X4L font size', () => {
864
+ const text = faker.lorem.words(2)
865
+ render(
866
+ <Text
867
+ fontSize={Text.FontSize.X4L}
868
+ lineHeight={Text.LineHeight.RELAXED}
869
+ >
870
+ {text}
871
+ </Text>
872
+ )
873
+ expect(screen.getByText(text)).toHaveStyle({
874
+ lineHeight: '78px',
875
+ })
876
+ })
877
+
878
+ it('renders with RELAXED line height and X5L font size', () => {
879
+ const text = faker.lorem.words(2)
880
+ render(
881
+ <Text
882
+ fontSize={Text.FontSize.X5L}
883
+ lineHeight={Text.LineHeight.RELAXED}
884
+ >
885
+ {text}
886
+ </Text>
887
+ )
888
+ expect(screen.getByText(text)).toHaveStyle({
889
+ lineHeight: '97.5px',
890
+ })
891
+ })
892
+
893
+ it('renders with LOOSE line height and X2S font size', () => {
894
+ const text = faker.lorem.words(2)
895
+ render(
896
+ <Text
897
+ fontSize={Text.FontSize.X2S}
898
+ lineHeight={Text.LineHeight.LOOSE}
899
+ >
900
+ {text}
901
+ </Text>
902
+ )
903
+ expect(screen.getByText(text)).toHaveStyle({
904
+ lineHeight: '24px',
905
+ })
906
+ })
907
+
908
+ it('renders with LOOSE line height and XS font size', () => {
909
+ const text = faker.lorem.words(2)
910
+ render(
911
+ <Text
912
+ fontSize={Text.FontSize.XS}
913
+ lineHeight={Text.LineHeight.LOOSE}
914
+ >
915
+ {text}
916
+ </Text>
917
+ )
918
+ expect(screen.getByText(text)).toHaveStyle({
919
+ lineHeight: '28px',
920
+ })
921
+ })
922
+
923
+ it('renders with LOOSE line height and SM font size', () => {
924
+ const text = faker.lorem.words(2)
925
+ render(
926
+ <Text
927
+ fontSize={Text.FontSize.SM}
928
+ lineHeight={Text.LineHeight.LOOSE}
929
+ >
930
+ {text}
931
+ </Text>
932
+ )
933
+ expect(screen.getByText(text)).toHaveStyle({
934
+ lineHeight: '32px',
935
+ })
936
+ })
937
+
938
+ it('renders with LOOSE line height and MD font size', () => {
939
+ const text = faker.lorem.words(2)
940
+ render(
941
+ <Text
942
+ fontSize={Text.FontSize.MD}
943
+ lineHeight={Text.LineHeight.LOOSE}
944
+ >
945
+ {text}
946
+ </Text>
947
+ )
948
+ expect(screen.getByText(text)).toHaveStyle({
949
+ lineHeight: '36px',
950
+ })
951
+ })
952
+
953
+ it('renders with LOOSE line height and LG font size', () => {
954
+ const text = faker.lorem.words(2)
955
+ render(
956
+ <Text
957
+ fontSize={Text.FontSize.LG}
958
+ lineHeight={Text.LineHeight.LOOSE}
959
+ >
960
+ {text}
961
+ </Text>
962
+ )
963
+ expect(screen.getByText(text)).toHaveStyle({
964
+ lineHeight: '40px',
965
+ })
966
+ })
967
+
968
+ it('renders with LOOSE line height and XL font size', () => {
969
+ const text = faker.lorem.words(2)
970
+ render(
971
+ <Text
972
+ fontSize={Text.FontSize.XL}
973
+ lineHeight={Text.LineHeight.LOOSE}
974
+ >
975
+ {text}
976
+ </Text>
977
+ )
978
+ expect(screen.getByText(text)).toHaveStyle({
979
+ lineHeight: '48px',
980
+ })
981
+ })
982
+
983
+ it('renders with LOOSE line height and X2L font size', () => {
984
+ const text = faker.lorem.words(2)
985
+ render(
986
+ <Text
987
+ fontSize={Text.FontSize.X2L}
988
+ lineHeight={Text.LineHeight.LOOSE}
989
+ >
990
+ {text}
991
+ </Text>
992
+ )
993
+ expect(screen.getByText(text)).toHaveStyle({
994
+ lineHeight: '60px',
995
+ })
996
+ })
997
+
998
+ it('renders with LOOSE line height and X3L font size', () => {
999
+ const text = faker.lorem.words(2)
1000
+ render(
1001
+ <Text
1002
+ fontSize={Text.FontSize.X3L}
1003
+ lineHeight={Text.LineHeight.LOOSE}
1004
+ >
1005
+ {text}
1006
+ </Text>
1007
+ )
1008
+ expect(screen.getByText(text)).toHaveStyle({
1009
+ lineHeight: '72px',
1010
+ })
1011
+ })
1012
+
1013
+ it('renders with LOOSE line height and X4L font size', () => {
1014
+ const text = faker.lorem.words(2)
1015
+ render(
1016
+ <Text
1017
+ fontSize={Text.FontSize.X4L}
1018
+ lineHeight={Text.LineHeight.LOOSE}
1019
+ >
1020
+ {text}
1021
+ </Text>
1022
+ )
1023
+ expect(screen.getByText(text)).toHaveStyle({
1024
+ lineHeight: '96px',
1025
+ })
1026
+ })
1027
+
1028
+ it('renders with LOOSE line height and X5L font size', () => {
1029
+ const text = faker.lorem.words(2)
1030
+ render(
1031
+ <Text
1032
+ fontSize={Text.FontSize.X5L}
1033
+ lineHeight={Text.LineHeight.LOOSE}
1034
+ >
1035
+ {text}
1036
+ </Text>
1037
+ )
1038
+ expect(screen.getByText(text)).toHaveStyle({
1039
+ lineHeight: '120px',
1040
+ })
1041
+ })
1042
+ })
1043
+ })