@hero-design/rn 8.73.1 → 8.74.0

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 (35) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +6 -0
  3. package/es/index.js +6 -3
  4. package/lib/index.js +6 -3
  5. package/package.json +1 -1
  6. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  7. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +405 -0
  8. package/src/components/Icon/__tests__/index.spec.tsx +14 -2
  9. package/src/components/Icon/index.tsx +2 -1
  10. package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +51 -0
  11. package/src/components/Typography/Body/__tests__/index.spec.tsx +1 -0
  12. package/src/components/Typography/Body/index.tsx +2 -1
  13. package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +50 -0
  14. package/src/components/Typography/Caption/__tests__/index.spec.tsx +1 -0
  15. package/src/components/Typography/Caption/index.tsx +2 -1
  16. package/src/components/Typography/Label/__tests__/__snapshots__/index.spec.tsx.snap +48 -0
  17. package/src/components/Typography/Label/__tests__/index.spec.tsx +1 -0
  18. package/src/components/Typography/Label/index.tsx +2 -1
  19. package/src/components/Typography/Title/__tests__/__snapshots__/index.spec.tsx.snap +51 -0
  20. package/src/components/Typography/Title/__tests__/index.spec.tsx +1 -0
  21. package/src/components/Typography/Title/index.tsx +2 -1
  22. package/src/components/Typography/types.ts +2 -1
  23. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -0
  24. package/src/theme/components/icon.ts +1 -0
  25. package/src/theme/components/typography.ts +1 -0
  26. package/stats/8.74.0/rn-stats.html +4842 -0
  27. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  28. package/types/components/Icon/index.d.ts +1 -1
  29. package/types/components/Typography/Body/index.d.ts +1 -1
  30. package/types/components/Typography/Caption/index.d.ts +1 -1
  31. package/types/components/Typography/Label/index.d.ts +1 -1
  32. package/types/components/Typography/Title/index.d.ts +1 -1
  33. package/types/components/Typography/types.d.ts +1 -1
  34. package/types/theme/components/icon.d.ts +1 -0
  35. package/types/theme/components/typography.d.ts +1 -0
@@ -1,8 +1,8 @@
1
- (node:2943) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
1
+ (node:3037) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
- (node:2943) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
3
+ (node:3037) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
4
4
  
5
5
  src/index.ts → lib/index.js, es/index.js...
6
6
  (!) [plugin replace] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
7
  (!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.
8
- created lib/index.js, es/index.js in 50.4s
8
+ created lib/index.js, es/index.js in 52.2s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.74.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3449](https://github.com/Thinkei/hero-design/pull/3449) [`b3029bb02497703734c5fab90aff67d20b94940b`](https://github.com/Thinkei/hero-design/commit/b3029bb02497703734c5fab90aff67d20b94940b) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Icon][typography] Add muted intent
8
+
3
9
  ## 8.73.1
4
10
 
5
11
  ### Patch Changes
package/es/index.js CHANGED
@@ -2902,7 +2902,8 @@ var getIconTheme = function getIconTheme(theme) {
2902
2902
  success: theme.colors.success,
2903
2903
  warning: theme.colors.warning,
2904
2904
  disabledText: theme.colors.disabledOnDefaultGlobalSurface,
2905
- invertedText: theme.colors.onDarkGlobalSurface
2905
+ invertedText: theme.colors.onDarkGlobalSurface,
2906
+ muted: theme.colors.mutedOnDefaultGlobalSurface
2906
2907
  };
2907
2908
  var sizes = {
2908
2909
  xsmall: theme.fontSizes.large,
@@ -3679,7 +3680,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
3679
3680
  success: theme.colors.success,
3680
3681
  inverted: theme.colors.onDarkGlobalSurface,
3681
3682
  archived: theme.colors.onArchivedSurface,
3682
- disabled: theme.colors.disabledOnDefaultGlobalSurface
3683
+ disabled: theme.colors.disabledOnDefaultGlobalSurface,
3684
+ muted: theme.colors.mutedOnDefaultGlobalSurface
3683
3685
  };
3684
3686
  var fontSizes = {
3685
3687
  xsmall: theme.fontSizes.xsmall,
@@ -7792,7 +7794,8 @@ var COLOR_INTENTS = {
7792
7794
  success: 'success',
7793
7795
  warning: 'warning',
7794
7796
  'disabled-text': 'disabledText',
7795
- 'text-inverted': 'invertedText'
7797
+ 'text-inverted': 'invertedText',
7798
+ muted: 'muted'
7796
7799
  };
7797
7800
  var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
7798
7801
  var themeIntent = _ref.themeIntent,
package/lib/index.js CHANGED
@@ -2929,7 +2929,8 @@ var getIconTheme = function getIconTheme(theme) {
2929
2929
  success: theme.colors.success,
2930
2930
  warning: theme.colors.warning,
2931
2931
  disabledText: theme.colors.disabledOnDefaultGlobalSurface,
2932
- invertedText: theme.colors.onDarkGlobalSurface
2932
+ invertedText: theme.colors.onDarkGlobalSurface,
2933
+ muted: theme.colors.mutedOnDefaultGlobalSurface
2933
2934
  };
2934
2935
  var sizes = {
2935
2936
  xsmall: theme.fontSizes.large,
@@ -3706,7 +3707,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
3706
3707
  success: theme.colors.success,
3707
3708
  inverted: theme.colors.onDarkGlobalSurface,
3708
3709
  archived: theme.colors.onArchivedSurface,
3709
- disabled: theme.colors.disabledOnDefaultGlobalSurface
3710
+ disabled: theme.colors.disabledOnDefaultGlobalSurface,
3711
+ muted: theme.colors.mutedOnDefaultGlobalSurface
3710
3712
  };
3711
3713
  var fontSizes = {
3712
3714
  xsmall: theme.fontSizes.xsmall,
@@ -7819,7 +7821,8 @@ var COLOR_INTENTS = {
7819
7821
  success: 'success',
7820
7822
  warning: 'warning',
7821
7823
  'disabled-text': 'disabledText',
7822
- 'text-inverted': 'invertedText'
7824
+ 'text-inverted': 'invertedText',
7825
+ muted: 'muted'
7823
7826
  };
7824
7827
  var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
7825
7828
  var themeIntent = _ref.themeIntent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.73.1",
3
+ "version": "8.74.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -12,7 +12,8 @@ type ThemeIntent =
12
12
  | 'success'
13
13
  | 'warning'
14
14
  | 'disabled-text'
15
- | 'text-inverted';
15
+ | 'text-inverted'
16
+ | 'muted';
16
17
 
17
18
  const HeroIcon = createIconSet(
18
19
  glyphMap,
@@ -30,6 +31,7 @@ const COLOR_INTENTS = {
30
31
  warning: 'warning',
31
32
  'disabled-text': 'disabledText',
32
33
  'text-inverted': 'invertedText',
34
+ muted: 'muted',
33
35
  } as const;
34
36
 
35
37
  const StyledHeroIcon = styled(HeroIcon)<{
@@ -149,6 +149,51 @@ exports[`Icon renders correctly with color and size 1`] = `
149
149
  `;
150
150
 
151
151
  exports[`Icon renders correctly with intent 1`] = `
152
+ <View
153
+ style={
154
+ {
155
+ "flex": 1,
156
+ }
157
+ }
158
+ >
159
+ <HeroIcon
160
+ name="home"
161
+ style={
162
+ [
163
+ {
164
+ "color": "#001f23",
165
+ "fontSize": 24,
166
+ },
167
+ undefined,
168
+ ]
169
+ }
170
+ themeIntent="text"
171
+ themeSize="medium"
172
+ />
173
+ <View
174
+ pointerEvents="box-none"
175
+ position="bottom"
176
+ style={
177
+ [
178
+ {
179
+ "bottom": 0,
180
+ "elevation": 9999,
181
+ "flexDirection": "column-reverse",
182
+ "left": 0,
183
+ "paddingHorizontal": 24,
184
+ "paddingVertical": 16,
185
+ "position": "absolute",
186
+ "right": 0,
187
+ "top": 0,
188
+ },
189
+ undefined,
190
+ ]
191
+ }
192
+ />
193
+ </View>
194
+ `;
195
+
196
+ exports[`Icon renders correctly with intent 2`] = `
152
197
  <View
153
198
  style={
154
199
  {
@@ -192,3 +237,363 @@ exports[`Icon renders correctly with intent 1`] = `
192
237
  />
193
238
  </View>
194
239
  `;
240
+
241
+ exports[`Icon renders correctly with intent 3`] = `
242
+ <View
243
+ style={
244
+ {
245
+ "flex": 1,
246
+ }
247
+ }
248
+ >
249
+ <HeroIcon
250
+ name="home"
251
+ style={
252
+ [
253
+ {
254
+ "color": "#795e90",
255
+ "fontSize": 24,
256
+ },
257
+ undefined,
258
+ ]
259
+ }
260
+ themeIntent="secondary"
261
+ themeSize="medium"
262
+ />
263
+ <View
264
+ pointerEvents="box-none"
265
+ position="bottom"
266
+ style={
267
+ [
268
+ {
269
+ "bottom": 0,
270
+ "elevation": 9999,
271
+ "flexDirection": "column-reverse",
272
+ "left": 0,
273
+ "paddingHorizontal": 24,
274
+ "paddingVertical": 16,
275
+ "position": "absolute",
276
+ "right": 0,
277
+ "top": 0,
278
+ },
279
+ undefined,
280
+ ]
281
+ }
282
+ />
283
+ </View>
284
+ `;
285
+
286
+ exports[`Icon renders correctly with intent 4`] = `
287
+ <View
288
+ style={
289
+ {
290
+ "flex": 1,
291
+ }
292
+ }
293
+ >
294
+ <HeroIcon
295
+ name="home"
296
+ style={
297
+ [
298
+ {
299
+ "color": "#b5c3fd",
300
+ "fontSize": 24,
301
+ },
302
+ undefined,
303
+ ]
304
+ }
305
+ themeIntent="info"
306
+ themeSize="medium"
307
+ />
308
+ <View
309
+ pointerEvents="box-none"
310
+ position="bottom"
311
+ style={
312
+ [
313
+ {
314
+ "bottom": 0,
315
+ "elevation": 9999,
316
+ "flexDirection": "column-reverse",
317
+ "left": 0,
318
+ "paddingHorizontal": 24,
319
+ "paddingVertical": 16,
320
+ "position": "absolute",
321
+ "right": 0,
322
+ "top": 0,
323
+ },
324
+ undefined,
325
+ ]
326
+ }
327
+ />
328
+ </View>
329
+ `;
330
+
331
+ exports[`Icon renders correctly with intent 5`] = `
332
+ <View
333
+ style={
334
+ {
335
+ "flex": 1,
336
+ }
337
+ }
338
+ >
339
+ <HeroIcon
340
+ name="home"
341
+ style={
342
+ [
343
+ {
344
+ "color": "#cb300a",
345
+ "fontSize": 24,
346
+ },
347
+ undefined,
348
+ ]
349
+ }
350
+ themeIntent="danger"
351
+ themeSize="medium"
352
+ />
353
+ <View
354
+ pointerEvents="box-none"
355
+ position="bottom"
356
+ style={
357
+ [
358
+ {
359
+ "bottom": 0,
360
+ "elevation": 9999,
361
+ "flexDirection": "column-reverse",
362
+ "left": 0,
363
+ "paddingHorizontal": 24,
364
+ "paddingVertical": 16,
365
+ "position": "absolute",
366
+ "right": 0,
367
+ "top": 0,
368
+ },
369
+ undefined,
370
+ ]
371
+ }
372
+ />
373
+ </View>
374
+ `;
375
+
376
+ exports[`Icon renders correctly with intent 6`] = `
377
+ <View
378
+ style={
379
+ {
380
+ "flex": 1,
381
+ }
382
+ }
383
+ >
384
+ <HeroIcon
385
+ name="home"
386
+ style={
387
+ [
388
+ {
389
+ "color": "#5ace7d",
390
+ "fontSize": 24,
391
+ },
392
+ undefined,
393
+ ]
394
+ }
395
+ themeIntent="success"
396
+ themeSize="medium"
397
+ />
398
+ <View
399
+ pointerEvents="box-none"
400
+ position="bottom"
401
+ style={
402
+ [
403
+ {
404
+ "bottom": 0,
405
+ "elevation": 9999,
406
+ "flexDirection": "column-reverse",
407
+ "left": 0,
408
+ "paddingHorizontal": 24,
409
+ "paddingVertical": 16,
410
+ "position": "absolute",
411
+ "right": 0,
412
+ "top": 0,
413
+ },
414
+ undefined,
415
+ ]
416
+ }
417
+ />
418
+ </View>
419
+ `;
420
+
421
+ exports[`Icon renders correctly with intent 7`] = `
422
+ <View
423
+ style={
424
+ {
425
+ "flex": 1,
426
+ }
427
+ }
428
+ >
429
+ <HeroIcon
430
+ name="home"
431
+ style={
432
+ [
433
+ {
434
+ "color": "#ffbe71",
435
+ "fontSize": 24,
436
+ },
437
+ undefined,
438
+ ]
439
+ }
440
+ themeIntent="warning"
441
+ themeSize="medium"
442
+ />
443
+ <View
444
+ pointerEvents="box-none"
445
+ position="bottom"
446
+ style={
447
+ [
448
+ {
449
+ "bottom": 0,
450
+ "elevation": 9999,
451
+ "flexDirection": "column-reverse",
452
+ "left": 0,
453
+ "paddingHorizontal": 24,
454
+ "paddingVertical": 16,
455
+ "position": "absolute",
456
+ "right": 0,
457
+ "top": 0,
458
+ },
459
+ undefined,
460
+ ]
461
+ }
462
+ />
463
+ </View>
464
+ `;
465
+
466
+ exports[`Icon renders correctly with intent 8`] = `
467
+ <View
468
+ style={
469
+ {
470
+ "flex": 1,
471
+ }
472
+ }
473
+ >
474
+ <HeroIcon
475
+ name="home"
476
+ style={
477
+ [
478
+ {
479
+ "color": "#bfc1c5",
480
+ "fontSize": 24,
481
+ },
482
+ undefined,
483
+ ]
484
+ }
485
+ themeIntent="disabled-text"
486
+ themeSize="medium"
487
+ />
488
+ <View
489
+ pointerEvents="box-none"
490
+ position="bottom"
491
+ style={
492
+ [
493
+ {
494
+ "bottom": 0,
495
+ "elevation": 9999,
496
+ "flexDirection": "column-reverse",
497
+ "left": 0,
498
+ "paddingHorizontal": 24,
499
+ "paddingVertical": 16,
500
+ "position": "absolute",
501
+ "right": 0,
502
+ "top": 0,
503
+ },
504
+ undefined,
505
+ ]
506
+ }
507
+ />
508
+ </View>
509
+ `;
510
+
511
+ exports[`Icon renders correctly with intent 9`] = `
512
+ <View
513
+ style={
514
+ {
515
+ "flex": 1,
516
+ }
517
+ }
518
+ >
519
+ <HeroIcon
520
+ name="home"
521
+ style={
522
+ [
523
+ {
524
+ "color": "#ffffff",
525
+ "fontSize": 24,
526
+ },
527
+ undefined,
528
+ ]
529
+ }
530
+ themeIntent="text-inverted"
531
+ themeSize="medium"
532
+ />
533
+ <View
534
+ pointerEvents="box-none"
535
+ position="bottom"
536
+ style={
537
+ [
538
+ {
539
+ "bottom": 0,
540
+ "elevation": 9999,
541
+ "flexDirection": "column-reverse",
542
+ "left": 0,
543
+ "paddingHorizontal": 24,
544
+ "paddingVertical": 16,
545
+ "position": "absolute",
546
+ "right": 0,
547
+ "top": 0,
548
+ },
549
+ undefined,
550
+ ]
551
+ }
552
+ />
553
+ </View>
554
+ `;
555
+
556
+ exports[`Icon renders correctly with intent 10`] = `
557
+ <View
558
+ style={
559
+ {
560
+ "flex": 1,
561
+ }
562
+ }
563
+ >
564
+ <HeroIcon
565
+ name="home"
566
+ style={
567
+ [
568
+ {
569
+ "color": "#4d6265",
570
+ "fontSize": 24,
571
+ },
572
+ undefined,
573
+ ]
574
+ }
575
+ themeIntent="muted"
576
+ themeSize="medium"
577
+ />
578
+ <View
579
+ pointerEvents="box-none"
580
+ position="bottom"
581
+ style={
582
+ [
583
+ {
584
+ "bottom": 0,
585
+ "elevation": 9999,
586
+ "flexDirection": "column-reverse",
587
+ "left": 0,
588
+ "paddingHorizontal": 24,
589
+ "paddingVertical": 16,
590
+ "position": "absolute",
591
+ "right": 0,
592
+ "top": 0,
593
+ },
594
+ undefined,
595
+ ]
596
+ }
597
+ />
598
+ </View>
599
+ `;
@@ -9,8 +9,20 @@ describe('Icon', () => {
9
9
  expect(toJSON()).toMatchSnapshot();
10
10
  });
11
11
 
12
- it('renders correctly with intent', () => {
13
- const { toJSON } = renderWithTheme(<Icon icon="home" intent="primary" />);
12
+ it.each`
13
+ intent
14
+ ${'text'}
15
+ ${'primary'}
16
+ ${'secondary'}
17
+ ${'info'}
18
+ ${'danger'}
19
+ ${'success'}
20
+ ${'warning'}
21
+ ${'disabled-text'}
22
+ ${'text-inverted'}
23
+ ${'muted'}
24
+ `('renders correctly with intent', ({ intent }) => {
25
+ const { toJSON } = renderWithTheme(<Icon icon="home" intent={intent} />);
14
26
 
15
27
  expect(toJSON()).toMatchSnapshot();
16
28
  });
@@ -24,7 +24,8 @@ export interface IconProps extends AccessibilityProps {
24
24
  | 'success'
25
25
  | 'warning'
26
26
  | 'disabled-text'
27
- | 'text-inverted';
27
+ | 'text-inverted'
28
+ | 'muted';
28
29
  /**
29
30
  * Size of the Icon.
30
31
  */
@@ -306,6 +306,57 @@ exports[`Body has inverted intent style 1`] = `
306
306
  </View>
307
307
  `;
308
308
 
309
+ exports[`Body has muted intent style 1`] = `
310
+ <View
311
+ style={
312
+ {
313
+ "flex": 1,
314
+ }
315
+ }
316
+ >
317
+ <Text
318
+ allowFontScaling={false}
319
+ style={
320
+ [
321
+ {
322
+ "color": "#4d6265",
323
+ "fontFamily": "BeVietnamPro-Regular",
324
+ "fontSize": 16,
325
+ "letterSpacing": 0.48,
326
+ "lineHeight": 24,
327
+ },
328
+ undefined,
329
+ ]
330
+ }
331
+ themeIntent="muted"
332
+ themeTypeface="neutral"
333
+ themeVariant="regular"
334
+ >
335
+ This is a test
336
+ </Text>
337
+ <View
338
+ pointerEvents="box-none"
339
+ position="bottom"
340
+ style={
341
+ [
342
+ {
343
+ "bottom": 0,
344
+ "elevation": 9999,
345
+ "flexDirection": "column-reverse",
346
+ "left": 0,
347
+ "paddingHorizontal": 24,
348
+ "paddingVertical": 16,
349
+ "position": "absolute",
350
+ "right": 0,
351
+ "top": 0,
352
+ },
353
+ undefined,
354
+ ]
355
+ }
356
+ />
357
+ </View>
358
+ `;
359
+
309
360
  exports[`Body has primary intent style 1`] = `
310
361
  <View
311
362
  style={
@@ -22,6 +22,7 @@ describe('Body', () => {
22
22
  ${'inverted'}
23
23
  ${'archived'}
24
24
  ${'disabled'}
25
+ ${'muted'}
25
26
  `('has $intent intent style', ({ intent }) => {
26
27
  const { toJSON } = renderWithTheme(
27
28
  <Body intent={intent}>This is a test</Body>
@@ -26,7 +26,8 @@ export interface BodyProps extends NativeTextProps {
26
26
  | 'danger'
27
27
  | 'inverted'
28
28
  | 'archived'
29
- | 'disabled';
29
+ | 'disabled'
30
+ | 'muted';
30
31
  /**
31
32
  * Additional style.
32
33
  */
@@ -300,6 +300,56 @@ exports[`Caption has inverted intent style 1`] = `
300
300
  </View>
301
301
  `;
302
302
 
303
+ exports[`Caption has muted intent style 1`] = `
304
+ <View
305
+ style={
306
+ {
307
+ "flex": 1,
308
+ }
309
+ }
310
+ >
311
+ <Text
312
+ allowFontScaling={false}
313
+ style={
314
+ [
315
+ {
316
+ "color": "#4d6265",
317
+ "fontFamily": "BeVietnamPro-Regular",
318
+ "fontSize": 12,
319
+ "letterSpacing": 0.36,
320
+ "lineHeight": 16,
321
+ },
322
+ undefined,
323
+ ]
324
+ }
325
+ themeFontWeight="regular"
326
+ themeIntent="muted"
327
+ >
328
+ This is a test
329
+ </Text>
330
+ <View
331
+ pointerEvents="box-none"
332
+ position="bottom"
333
+ style={
334
+ [
335
+ {
336
+ "bottom": 0,
337
+ "elevation": 9999,
338
+ "flexDirection": "column-reverse",
339
+ "left": 0,
340
+ "paddingHorizontal": 24,
341
+ "paddingVertical": 16,
342
+ "position": "absolute",
343
+ "right": 0,
344
+ "top": 0,
345
+ },
346
+ undefined,
347
+ ]
348
+ }
349
+ />
350
+ </View>
351
+ `;
352
+
303
353
  exports[`Caption has primary intent style 1`] = `
304
354
  <View
305
355
  style={
@@ -36,6 +36,7 @@ describe('Caption', () => {
36
36
  ${'inverted'}
37
37
  ${'archived'}
38
38
  ${'disabled'}
39
+ ${'muted'}
39
40
  `('has $intent intent style', ({ intent }) => {
40
41
  const { toJSON } = renderWithTheme(
41
42
  <Caption intent={intent}>This is a test</Caption>