@hero-design/rn 8.109.2 → 8.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/CHANGELOG.md +12 -0
  3. package/es/index.js +2142 -1959
  4. package/lib/index.js +2142 -1959
  5. package/package.json +8 -8
  6. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +40 -24
  7. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +60 -36
  8. package/src/components/Accordion/index.tsx +6 -1
  9. package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +121 -97
  10. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +6 -3
  11. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +18 -18
  12. package/src/components/Chip/index.tsx +6 -0
  13. package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +8 -5
  14. package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +20 -12
  15. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +13 -9
  16. package/src/components/PinInput/index.tsx +6 -1
  17. package/src/components/Radio/RadioGroup.tsx +6 -1
  18. package/src/components/Rate/__tests__/__snapshots__/index.spec.tsx.snap +84 -48
  19. package/src/components/RichTextEditor/BaseRichTextEditor.tsx +17 -0
  20. package/src/components/RichTextEditor/EditorToolbar.tsx +18 -59
  21. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +31 -10
  22. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +22 -0
  23. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -0
  24. package/src/components/RichTextEditor/constants.ts +4 -0
  25. package/src/components/RichTextEditor/hooks/useRichTextEditorEvents.ts +22 -3
  26. package/src/components/Search/SearchOneLine.tsx +6 -0
  27. package/src/components/Search/SearchTwoLine.tsx +6 -1
  28. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +6 -3
  29. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +6 -3
  30. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +9 -6
  31. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +210 -138
  32. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +98 -62
  33. package/src/components/Toolbar/ToolbarGroup.tsx +10 -2
  34. package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +34 -1
  35. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +3 -0
  36. package/stats/8.109.2/rn-stats.html +1 -3
  37. package/stats/8.110.0/rn-stats.html +4844 -0
  38. package/stats/8.110.1/rn-stats.html +4844 -0
  39. package/types/components/Accordion/index.d.ts +5 -1
  40. package/types/components/Chip/index.d.ts +5 -1
  41. package/types/components/PinInput/index.d.ts +4 -0
  42. package/types/components/Radio/RadioGroup.d.ts +5 -1
  43. package/types/components/Radio/index.d.ts +1 -1
  44. package/types/components/RichTextEditor/constants.d.ts +6 -2
  45. package/types/components/RichTextEditor/hooks/useRichTextEditorEvents.d.ts +17 -2
  46. package/types/components/RichTextEditor/index.d.ts +54 -2
  47. package/types/components/Search/SearchOneLine.d.ts +4 -0
  48. package/types/components/Search/SearchTwoLine.d.ts +4 -0
  49. package/types/components/Toolbar/ToolbarGroup.d.ts +5 -1
  50. package/types/components/Toolbar/index.d.ts +1 -1
@@ -321,7 +321,7 @@ exports[`Button renders correctly 2`] = `
321
321
  "flexDirection": "row",
322
322
  "justifyContent": "center",
323
323
  },
324
- {},
324
+ undefined,
325
325
  ]
326
326
  }
327
327
  testID="undefined-loading-indicator"
@@ -706,7 +706,7 @@ exports[`Button renders correctly 5`] = `
706
706
  "flexDirection": "row",
707
707
  "justifyContent": "center",
708
708
  },
709
- {},
709
+ undefined,
710
710
  ]
711
711
  }
712
712
  testID="undefined-loading-indicator"
@@ -1095,7 +1095,7 @@ exports[`Button renders correctly 8`] = `
1095
1095
  "flexDirection": "row",
1096
1096
  "justifyContent": "center",
1097
1097
  },
1098
- {},
1098
+ undefined,
1099
1099
  ]
1100
1100
  }
1101
1101
  testID="undefined-loading-indicator"
@@ -1486,7 +1486,7 @@ exports[`Button renders correctly 11`] = `
1486
1486
  "flexDirection": "row",
1487
1487
  "justifyContent": "center",
1488
1488
  },
1489
- {},
1489
+ undefined,
1490
1490
  ]
1491
1491
  }
1492
1492
  testID="undefined-loading-indicator"
@@ -1875,7 +1875,7 @@ exports[`Button renders correctly 14`] = `
1875
1875
  "flexDirection": "row",
1876
1876
  "justifyContent": "center",
1877
1877
  },
1878
- {},
1878
+ undefined,
1879
1879
  ]
1880
1880
  }
1881
1881
  testID="undefined-loading-indicator"
@@ -2264,7 +2264,7 @@ exports[`Button renders correctly 17`] = `
2264
2264
  "flexDirection": "row",
2265
2265
  "justifyContent": "center",
2266
2266
  },
2267
- {},
2267
+ undefined,
2268
2268
  ]
2269
2269
  }
2270
2270
  testID="undefined-loading-indicator"
@@ -2653,7 +2653,7 @@ exports[`Button renders correctly 20`] = `
2653
2653
  "flexDirection": "row",
2654
2654
  "justifyContent": "center",
2655
2655
  },
2656
- {},
2656
+ undefined,
2657
2657
  ]
2658
2658
  }
2659
2659
  testID="undefined-loading-indicator"
@@ -3042,7 +3042,7 @@ exports[`Button renders correctly 23`] = `
3042
3042
  "flexDirection": "row",
3043
3043
  "justifyContent": "center",
3044
3044
  },
3045
- {},
3045
+ undefined,
3046
3046
  ]
3047
3047
  }
3048
3048
  testID="undefined-loading-indicator"
@@ -3431,7 +3431,7 @@ exports[`Button renders correctly 26`] = `
3431
3431
  "flexDirection": "row",
3432
3432
  "justifyContent": "center",
3433
3433
  },
3434
- {},
3434
+ undefined,
3435
3435
  ]
3436
3436
  }
3437
3437
  testID="undefined-loading-indicator"
@@ -3713,7 +3713,7 @@ exports[`Button renders correctly 28`] = `
3713
3713
  "flexDirection": "row",
3714
3714
  "justifyContent": "center",
3715
3715
  },
3716
- {},
3716
+ undefined,
3717
3717
  ]
3718
3718
  }
3719
3719
  testID="undefined-loading-indicator"
@@ -4107,7 +4107,7 @@ exports[`Button renders correctly 31`] = `
4107
4107
  "flexDirection": "row",
4108
4108
  "justifyContent": "center",
4109
4109
  },
4110
- {},
4110
+ undefined,
4111
4111
  ]
4112
4112
  }
4113
4113
  testID="undefined-loading-indicator"
@@ -4509,7 +4509,7 @@ exports[`Button renders correctly 34`] = `
4509
4509
  "flexDirection": "row",
4510
4510
  "justifyContent": "center",
4511
4511
  },
4512
- {},
4512
+ undefined,
4513
4513
  ]
4514
4514
  }
4515
4515
  testID="undefined-loading-indicator"
@@ -4908,7 +4908,7 @@ exports[`Button renders correctly 37`] = `
4908
4908
  "flexDirection": "row",
4909
4909
  "justifyContent": "center",
4910
4910
  },
4911
- {},
4911
+ undefined,
4912
4912
  ]
4913
4913
  }
4914
4914
  testID="undefined-loading-indicator"
@@ -5303,7 +5303,7 @@ exports[`Button renders correctly 40`] = `
5303
5303
  "flexDirection": "row",
5304
5304
  "justifyContent": "center",
5305
5305
  },
5306
- {},
5306
+ undefined,
5307
5307
  ]
5308
5308
  }
5309
5309
  testID="undefined-loading-indicator"
@@ -5698,7 +5698,7 @@ exports[`Button renders correctly 43`] = `
5698
5698
  "flexDirection": "row",
5699
5699
  "justifyContent": "center",
5700
5700
  },
5701
- {},
5701
+ undefined,
5702
5702
  ]
5703
5703
  }
5704
5704
  testID="undefined-loading-indicator"
@@ -6093,7 +6093,7 @@ exports[`Button renders correctly 46`] = `
6093
6093
  "flexDirection": "row",
6094
6094
  "justifyContent": "center",
6095
6095
  },
6096
- {},
6096
+ undefined,
6097
6097
  ]
6098
6098
  }
6099
6099
  testID="undefined-loading-indicator"
@@ -6379,7 +6379,7 @@ exports[`Button renders correctly 48`] = `
6379
6379
  "flexDirection": "row",
6380
6380
  "justifyContent": "center",
6381
6381
  },
6382
- {},
6382
+ undefined,
6383
6383
  ]
6384
6384
  }
6385
6385
  testID="undefined-loading-indicator"
@@ -6665,7 +6665,7 @@ exports[`Button renders loading icon 1`] = `
6665
6665
  "flexDirection": "row",
6666
6666
  "justifyContent": "center",
6667
6667
  },
6668
- {},
6668
+ undefined,
6669
6669
  ]
6670
6670
  }
6671
6671
  testID="button-loading-indicator"
@@ -40,6 +40,10 @@ export interface ChipProps extends ViewProps {
40
40
  * Whether to show the selected icon when using outlined variant.
41
41
  */
42
42
  showSelectedIcon?: boolean;
43
+ /**
44
+ * If true, indicates that the Chip is accessible to screen readers.
45
+ */
46
+ accessible?: boolean;
43
47
  }
44
48
 
45
49
  const getChipLabel = (label: string | ReactNode) => {
@@ -71,6 +75,7 @@ const Chip = ({
71
75
  icon,
72
76
  onPress,
73
77
  showSelectedIcon = true,
78
+ accessible,
74
79
  ...otherProps
75
80
  }: ChipProps) => {
76
81
  useDeprecation(
@@ -91,6 +96,7 @@ const Chip = ({
91
96
  onPress={onPress}
92
97
  themeVariant={renamedVariant}
93
98
  themeSelected={selected}
99
+ accessible={accessible}
94
100
  {...otherProps}
95
101
  >
96
102
  {icon && (
@@ -57,11 +57,14 @@ exports[`StyledWrapper renders correct style 1`] = `
57
57
  <View
58
58
  collapsable={false}
59
59
  style={
60
- {
61
- "margin": 0,
62
- "overflow": "hidden",
63
- "padding": 0,
64
- }
60
+ [
61
+ {
62
+ "margin": 0,
63
+ "overflow": "hidden",
64
+ "padding": 0,
65
+ },
66
+ undefined,
67
+ ]
65
68
  }
66
69
  >
67
70
  <Text>
@@ -12,12 +12,16 @@ exports[`Collapse renders correctly 1`] = `
12
12
  collapsable={false}
13
13
  onLayout={[Function]}
14
14
  style={
15
- {
16
- "height": 0,
17
- "margin": 0,
18
- "overflow": "hidden",
19
- "padding": 0,
20
- }
15
+ [
16
+ {
17
+ "margin": 0,
18
+ "overflow": "hidden",
19
+ "padding": 0,
20
+ },
21
+ {
22
+ "height": 0,
23
+ },
24
+ ]
21
25
  }
22
26
  testID="collapse"
23
27
  >
@@ -84,12 +88,16 @@ exports[`Collapse should render Sample Text but not visible 1`] = `
84
88
  collapsable={false}
85
89
  onLayout={[Function]}
86
90
  style={
87
- {
88
- "height": 0,
89
- "margin": 0,
90
- "overflow": "hidden",
91
- "padding": 0,
92
- }
91
+ [
92
+ {
93
+ "margin": 0,
94
+ "overflow": "hidden",
95
+ "padding": 0,
96
+ },
97
+ {
98
+ "height": 0,
99
+ },
100
+ ]
93
101
  }
94
102
  testID="collapse"
95
103
  >
@@ -316,15 +316,19 @@ exports[`Drawer renders correctly with no backdrop 1`] = `
316
316
  onStartShouldSetResponder={[Function]}
317
317
  pointerEvents="box-none"
318
318
  style={
319
- {
320
- "backgroundColor": "#000000",
321
- "bottom": 0,
322
- "left": 0,
323
- "opacity": 0,
324
- "position": "absolute",
325
- "right": 0,
326
- "top": 0,
327
- }
319
+ [
320
+ {
321
+ "backgroundColor": "#000000",
322
+ "bottom": 0,
323
+ "left": 0,
324
+ "position": "absolute",
325
+ "right": 0,
326
+ "top": 0,
327
+ },
328
+ {
329
+ "opacity": 0,
330
+ },
331
+ ]
328
332
  }
329
333
  testID="undefined-backdrop"
330
334
  />
@@ -72,6 +72,10 @@ interface PinInputProps {
72
72
  * The autofill type of the input.
73
73
  */
74
74
  autoComplete?: ComponentProps<typeof TextInput>['autoComplete'];
75
+ /**
76
+ * If true, indicates that the PinInput is accessible to screen readers.
77
+ */
78
+ accessible?: boolean;
75
79
  }
76
80
 
77
81
  export function getState({
@@ -120,6 +124,7 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
120
124
  testID,
121
125
  textContentType,
122
126
  autoComplete,
127
+ accessible,
123
128
  },
124
129
  ref
125
130
  ) => {
@@ -191,7 +196,7 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
191
196
  );
192
197
 
193
198
  return (
194
- <StyledWrapper style={style} testID={testID}>
199
+ <StyledWrapper style={style} testID={testID} accessible={accessible}>
195
200
  <StyledPinWrapper
196
201
  onPress={focus}
197
202
  disabled={disabled}
@@ -32,6 +32,10 @@ export interface RadioGroupProps<T> {
32
32
  * Testing id of the component.
33
33
  */
34
34
  testID?: string;
35
+ /**
36
+ * Overrides the text that's read by the screen reader when the user interacts with the element.
37
+ */
38
+ accessible?: boolean;
35
39
  /**
36
40
  * Idle background color of the Radio.
37
41
  */
@@ -62,9 +66,10 @@ const RadioGroup = <T,>({
62
66
  keyExtractor,
63
67
  style,
64
68
  testID,
69
+ accessible,
65
70
  inactiveIntent = 'light',
66
71
  }: RadioGroupProps<T>): ReactElement => (
67
- <View style={style} testID={testID}>
72
+ <View style={style} testID={testID} accessible={accessible}>
68
73
  {options.map((option, index) => (
69
74
  <React.Fragment key={getKey(option, index, keyExtractor)}>
70
75
  {index !== 0 && <Spacer themeIntent={inactiveIntent} />}
@@ -56,10 +56,13 @@ exports[`Rate renders correctly 1`] = `
56
56
  <View
57
57
  collapsable={false}
58
58
  style={
59
- {
60
- "marginRight": 4,
61
- "padding": 8,
62
- }
59
+ [
60
+ {
61
+ "marginRight": 4,
62
+ "padding": 8,
63
+ },
64
+ false,
65
+ ]
63
66
  }
64
67
  >
65
68
  <HeroIcon
@@ -113,10 +116,13 @@ exports[`Rate renders correctly 1`] = `
113
116
  <View
114
117
  collapsable={false}
115
118
  style={
116
- {
117
- "marginRight": 4,
118
- "padding": 8,
119
- }
119
+ [
120
+ {
121
+ "marginRight": 4,
122
+ "padding": 8,
123
+ },
124
+ false,
125
+ ]
120
126
  }
121
127
  >
122
128
  <HeroIcon
@@ -232,10 +238,13 @@ exports[`Rate renders correctly 1`] = `
232
238
  <View
233
239
  collapsable={false}
234
240
  style={
235
- {
236
- "marginRight": 4,
237
- "padding": 8,
238
- }
241
+ [
242
+ {
243
+ "marginRight": 4,
244
+ "padding": 8,
245
+ },
246
+ false,
247
+ ]
239
248
  }
240
249
  >
241
250
  <HeroIcon
@@ -289,10 +298,13 @@ exports[`Rate renders correctly 1`] = `
289
298
  <View
290
299
  collapsable={false}
291
300
  style={
292
- {
293
- "marginRight": 4,
294
- "padding": 8,
295
- }
301
+ [
302
+ {
303
+ "marginRight": 4,
304
+ "padding": 8,
305
+ },
306
+ false,
307
+ ]
296
308
  }
297
309
  >
298
310
  <HeroIcon
@@ -391,10 +403,13 @@ exports[`Rate renders correctly it is readonly 1`] = `
391
403
  <View
392
404
  collapsable={false}
393
405
  style={
394
- {
395
- "marginRight": 4,
396
- "padding": 8,
397
- }
406
+ [
407
+ {
408
+ "marginRight": 4,
409
+ "padding": 8,
410
+ },
411
+ false,
412
+ ]
398
413
  }
399
414
  >
400
415
  <HeroIcon
@@ -448,10 +463,13 @@ exports[`Rate renders correctly it is readonly 1`] = `
448
463
  <View
449
464
  collapsable={false}
450
465
  style={
451
- {
452
- "marginRight": 4,
453
- "padding": 8,
454
- }
466
+ [
467
+ {
468
+ "marginRight": 4,
469
+ "padding": 8,
470
+ },
471
+ false,
472
+ ]
455
473
  }
456
474
  >
457
475
  <HeroIcon
@@ -567,10 +585,13 @@ exports[`Rate renders correctly it is readonly 1`] = `
567
585
  <View
568
586
  collapsable={false}
569
587
  style={
570
- {
571
- "marginRight": 4,
572
- "padding": 8,
573
- }
588
+ [
589
+ {
590
+ "marginRight": 4,
591
+ "padding": 8,
592
+ },
593
+ false,
594
+ ]
574
595
  }
575
596
  >
576
597
  <HeroIcon
@@ -624,10 +645,13 @@ exports[`Rate renders correctly it is readonly 1`] = `
624
645
  <View
625
646
  collapsable={false}
626
647
  style={
627
- {
628
- "marginRight": 4,
629
- "padding": 8,
630
- }
648
+ [
649
+ {
650
+ "marginRight": 4,
651
+ "padding": 8,
652
+ },
653
+ false,
654
+ ]
631
655
  }
632
656
  >
633
657
  <HeroIcon
@@ -726,10 +750,13 @@ exports[`Rate renders correctly when disabled 1`] = `
726
750
  <View
727
751
  collapsable={false}
728
752
  style={
729
- {
730
- "marginRight": 4,
731
- "padding": 8,
732
- }
753
+ [
754
+ {
755
+ "marginRight": 4,
756
+ "padding": 8,
757
+ },
758
+ false,
759
+ ]
733
760
  }
734
761
  >
735
762
  <HeroIcon
@@ -783,10 +810,13 @@ exports[`Rate renders correctly when disabled 1`] = `
783
810
  <View
784
811
  collapsable={false}
785
812
  style={
786
- {
787
- "marginRight": 4,
788
- "padding": 8,
789
- }
813
+ [
814
+ {
815
+ "marginRight": 4,
816
+ "padding": 8,
817
+ },
818
+ false,
819
+ ]
790
820
  }
791
821
  >
792
822
  <HeroIcon
@@ -902,10 +932,13 @@ exports[`Rate renders correctly when disabled 1`] = `
902
932
  <View
903
933
  collapsable={false}
904
934
  style={
905
- {
906
- "marginRight": 4,
907
- "padding": 8,
908
- }
935
+ [
936
+ {
937
+ "marginRight": 4,
938
+ "padding": 8,
939
+ },
940
+ false,
941
+ ]
909
942
  }
910
943
  >
911
944
  <HeroIcon
@@ -959,10 +992,13 @@ exports[`Rate renders correctly when disabled 1`] = `
959
992
  <View
960
993
  collapsable={false}
961
994
  style={
962
- {
963
- "marginRight": 4,
964
- "padding": 8,
965
- }
995
+ [
996
+ {
997
+ "marginRight": 4,
998
+ "padding": 8,
999
+ },
1000
+ false,
1001
+ ]
966
1002
  }
967
1003
  >
968
1004
  <HeroIcon
@@ -132,6 +132,9 @@ const BaseRichTextEditor = ({
132
132
  body {
133
133
  margin: 0;
134
134
  }
135
+ a {
136
+ color: ${theme.__hd__.typography.colors.primary};
137
+ }
135
138
  </style>
136
139
  </head>
137
140
  <body>
@@ -263,6 +266,11 @@ const BaseRichTextEditor = ({
263
266
  case '@hero-editor/webview/editor-change':
264
267
  if (messageData) {
265
268
  onChange(messageData.value);
269
+ Events.emit(
270
+ emitter,
271
+ normalizeEventName('editor-change'),
272
+ messageData
273
+ );
266
274
  }
267
275
 
268
276
  break;
@@ -274,6 +282,14 @@ const BaseRichTextEditor = ({
274
282
  handleEditorLayoutEvent(messageData);
275
283
  break;
276
284
 
285
+ case '@hero-editor/webview/request-upsert-link':
286
+ Events.emit(
287
+ emitter,
288
+ normalizeEventName('request-upsert-link'),
289
+ messageData
290
+ );
291
+ break;
292
+
277
293
  default:
278
294
  break;
279
295
  }
@@ -291,6 +307,7 @@ const BaseRichTextEditor = ({
291
307
  hideKeyboardAccessoryView
292
308
  ref={webview}
293
309
  style={style}
310
+ bounces={false}
294
311
  testID={testID}
295
312
  source={{ html }}
296
313
  onMessage={onMessage}