@coinbase/cds-mobile 8.60.0 → 8.62.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 (256) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dts/accordion/Accordion.d.ts +1 -9
  3. package/dts/accordion/Accordion.d.ts.map +1 -1
  4. package/dts/alpha/combobox/Combobox.d.ts.map +1 -1
  5. package/dts/alpha/select/Select.d.ts.map +1 -1
  6. package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -1
  7. package/dts/alpha/tabbed-chips/TabbedChips.d.ts.map +1 -1
  8. package/dts/banner/Banner.d.ts.map +1 -1
  9. package/dts/buttons/AvatarButton.d.ts +6 -3
  10. package/dts/buttons/AvatarButton.d.ts.map +1 -1
  11. package/dts/buttons/Button.d.ts.map +1 -1
  12. package/dts/buttons/ButtonGroup.d.ts +3 -1
  13. package/dts/buttons/ButtonGroup.d.ts.map +1 -1
  14. package/dts/buttons/IconButton.d.ts.map +1 -1
  15. package/dts/buttons/IconCounterButton.d.ts.map +1 -1
  16. package/dts/buttons/SlideButton.d.ts.map +1 -1
  17. package/dts/cards/Card.d.ts +4 -0
  18. package/dts/cards/Card.d.ts.map +1 -1
  19. package/dts/cards/CardBody.d.ts +4 -0
  20. package/dts/cards/CardBody.d.ts.map +1 -1
  21. package/dts/cards/CardFooter.d.ts +4 -0
  22. package/dts/cards/CardFooter.d.ts.map +1 -1
  23. package/dts/cards/CardGroup.d.ts +12 -0
  24. package/dts/cards/CardGroup.d.ts.map +1 -1
  25. package/dts/cards/CardHeader.d.ts +8 -0
  26. package/dts/cards/CardHeader.d.ts.map +1 -1
  27. package/dts/cards/CardMedia.d.ts +8 -0
  28. package/dts/cards/CardMedia.d.ts.map +1 -1
  29. package/dts/cards/LikeButton.d.ts.map +1 -1
  30. package/dts/carousel/Carousel.d.ts.map +1 -1
  31. package/dts/cells/Cell.d.ts.map +1 -1
  32. package/dts/cells/ListCell.d.ts.map +1 -1
  33. package/dts/cells/ListCellFallback.d.ts.map +1 -1
  34. package/dts/chips/Chip.d.ts.map +1 -1
  35. package/dts/chips/ChipProps.d.ts +10 -8
  36. package/dts/chips/ChipProps.d.ts.map +1 -1
  37. package/dts/chips/InputChip.d.ts.map +1 -1
  38. package/dts/chips/MediaChip.d.ts +3 -2
  39. package/dts/chips/MediaChip.d.ts.map +1 -1
  40. package/dts/chips/TabbedChips.d.ts.map +1 -1
  41. package/dts/coachmark/Coachmark.d.ts.map +1 -1
  42. package/dts/collapsible/Collapsible.d.ts.map +1 -1
  43. package/dts/controls/Checkbox.d.ts.map +1 -1
  44. package/dts/controls/CheckboxCell.d.ts.map +1 -1
  45. package/dts/controls/Control.d.ts.map +1 -1
  46. package/dts/controls/ControlGroup.d.ts +13 -4
  47. package/dts/controls/ControlGroup.d.ts.map +1 -1
  48. package/dts/controls/InputStack.d.ts.map +1 -1
  49. package/dts/controls/Radio.d.ts.map +1 -1
  50. package/dts/controls/RadioCell.d.ts.map +1 -1
  51. package/dts/controls/SearchInput.d.ts.map +1 -1
  52. package/dts/controls/SelectOption.d.ts +3 -1
  53. package/dts/controls/SelectOption.d.ts.map +1 -1
  54. package/dts/controls/Switch.d.ts.map +1 -1
  55. package/dts/controls/TextInput.d.ts.map +1 -1
  56. package/dts/core/componentConfig.d.ts +166 -0
  57. package/dts/core/componentConfig.d.ts.map +1 -0
  58. package/dts/dates/Calendar.d.ts.map +1 -1
  59. package/dts/dates/DateInput.d.ts.map +1 -1
  60. package/dts/dates/DatePicker.d.ts.map +1 -1
  61. package/dts/dots/DotCount.d.ts +1 -11
  62. package/dts/dots/DotCount.d.ts.map +1 -1
  63. package/dts/dots/DotStatusColor.d.ts +1 -8
  64. package/dts/dots/DotStatusColor.d.ts.map +1 -1
  65. package/dts/dots/DotSymbol.d.ts +1 -17
  66. package/dts/dots/DotSymbol.d.ts.map +1 -1
  67. package/dts/hooks/useComponentConfig.d.ts +22 -0
  68. package/dts/hooks/useComponentConfig.d.ts.map +1 -0
  69. package/dts/icons/Icon.d.ts +11 -1
  70. package/dts/icons/Icon.d.ts.map +1 -1
  71. package/dts/index.d.ts +2 -0
  72. package/dts/index.d.ts.map +1 -1
  73. package/dts/layout/Divider.d.ts +3 -1
  74. package/dts/layout/Divider.d.ts.map +1 -1
  75. package/dts/layout/Fallback.d.ts +3 -1
  76. package/dts/layout/Fallback.d.ts.map +1 -1
  77. package/dts/media/Avatar.d.ts +1 -14
  78. package/dts/media/Avatar.d.ts.map +1 -1
  79. package/dts/media/RemoteImage.d.ts.map +1 -1
  80. package/dts/media/RemoteImageGroup.d.ts +3 -10
  81. package/dts/media/RemoteImageGroup.d.ts.map +1 -1
  82. package/dts/navigation/BrowserBar.d.ts +5 -14
  83. package/dts/navigation/BrowserBar.d.ts.map +1 -1
  84. package/dts/navigation/NavigationTitle.d.ts +4 -7
  85. package/dts/navigation/NavigationTitle.d.ts.map +1 -1
  86. package/dts/navigation/NavigationTitleSelect.d.ts +5 -11
  87. package/dts/navigation/NavigationTitleSelect.d.ts.map +1 -1
  88. package/dts/navigation/TopNavBar.d.ts +3 -13
  89. package/dts/navigation/TopNavBar.d.ts.map +1 -1
  90. package/dts/numbers/RollingNumber/RollingNumber.d.ts.map +1 -1
  91. package/dts/numpad/Numpad.d.ts +41 -38
  92. package/dts/numpad/Numpad.d.ts.map +1 -1
  93. package/dts/overlays/Alert.d.ts.map +1 -1
  94. package/dts/overlays/Toast.d.ts.map +1 -1
  95. package/dts/overlays/drawer/Drawer.d.ts.map +1 -1
  96. package/dts/overlays/modal/Modal.d.ts.map +1 -1
  97. package/dts/overlays/modal/ModalBody.d.ts.map +1 -1
  98. package/dts/overlays/modal/ModalFooter.d.ts +3 -8
  99. package/dts/overlays/modal/ModalFooter.d.ts.map +1 -1
  100. package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
  101. package/dts/overlays/overlay/Overlay.d.ts +7 -3
  102. package/dts/overlays/overlay/Overlay.d.ts.map +1 -1
  103. package/dts/overlays/tooltip/Tooltip.d.ts +2 -20
  104. package/dts/overlays/tooltip/Tooltip.d.ts.map +1 -1
  105. package/dts/overlays/tray/Tray.d.ts.map +1 -1
  106. package/dts/page/PageFooter.d.ts.map +1 -1
  107. package/dts/page/PageHeader.d.ts.map +1 -1
  108. package/dts/perf/component-config/Button.component-config.perf-test.d.ts +2 -0
  109. package/dts/perf/component-config/Button.component-config.perf-test.d.ts.map +1 -0
  110. package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts +2 -0
  111. package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts.map +1 -0
  112. package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts +2 -0
  113. package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts.map +1 -0
  114. package/dts/stepper/Stepper.d.ts.map +1 -1
  115. package/dts/system/ComponentConfigProvider.d.ts +26 -0
  116. package/dts/system/ComponentConfigProvider.d.ts.map +1 -0
  117. package/dts/system/index.d.ts +1 -0
  118. package/dts/system/index.d.ts.map +1 -1
  119. package/dts/tabs/SegmentedTab.d.ts +6 -3
  120. package/dts/tabs/SegmentedTab.d.ts.map +1 -1
  121. package/dts/tabs/SegmentedTabs.d.ts +6 -3
  122. package/dts/tabs/SegmentedTabs.d.ts.map +1 -1
  123. package/dts/tabs/Tabs.d.ts +25 -24
  124. package/dts/tabs/Tabs.d.ts.map +1 -1
  125. package/dts/tag/Tag.d.ts.map +1 -1
  126. package/dts/tour/Tour.d.ts +42 -41
  127. package/dts/tour/Tour.d.ts.map +1 -1
  128. package/dts/typography/Link.d.ts +1 -14
  129. package/dts/typography/Link.d.ts.map +1 -1
  130. package/dts/utils/mergeComponentProps.d.ts +34 -0
  131. package/dts/utils/mergeComponentProps.d.ts.map +1 -0
  132. package/dts/visualizations/ProgressBar.d.ts.map +1 -1
  133. package/dts/visualizations/ProgressBarWithFixedLabels.d.ts +5 -3
  134. package/dts/visualizations/ProgressBarWithFixedLabels.d.ts.map +1 -1
  135. package/dts/visualizations/ProgressBarWithFloatLabel.d.ts +3 -1
  136. package/dts/visualizations/ProgressBarWithFloatLabel.d.ts.map +1 -1
  137. package/dts/visualizations/ProgressCircle.d.ts.map +1 -1
  138. package/esm/accordion/Accordion.js +5 -3
  139. package/esm/alpha/combobox/Combobox.js +8 -6
  140. package/esm/alpha/select/Select.js +6 -4
  141. package/esm/alpha/select-chip/SelectChip.js +6 -4
  142. package/esm/alpha/tabbed-chips/TabbedChips.js +6 -4
  143. package/esm/banner/Banner.js +6 -4
  144. package/esm/buttons/AvatarButton.js +6 -4
  145. package/esm/buttons/Button.js +25 -10
  146. package/esm/buttons/ButtonGroup.js +5 -3
  147. package/esm/buttons/IconButton.js +14 -11
  148. package/esm/buttons/IconCounterButton.js +6 -4
  149. package/esm/buttons/SlideButton.js +10 -8
  150. package/esm/buttons/__stories__/Button.stories.js +32 -0
  151. package/esm/buttons/__stories__/IconButton.stories.js +32 -0
  152. package/esm/cards/Card.js +5 -0
  153. package/esm/cards/CardBody.js +5 -0
  154. package/esm/cards/CardFooter.js +4 -0
  155. package/esm/cards/CardGroup.js +14 -0
  156. package/esm/cards/CardHeader.js +9 -0
  157. package/esm/cards/CardMedia.js +10 -0
  158. package/esm/cards/LikeButton.js +6 -4
  159. package/esm/carousel/Carousel.js +10 -8
  160. package/esm/cells/Cell.js +6 -4
  161. package/esm/cells/ListCell.js +6 -4
  162. package/esm/cells/ListCellFallback.js +6 -4
  163. package/esm/chips/Chip.js +6 -4
  164. package/esm/chips/InputChip.js +6 -4
  165. package/esm/chips/MediaChip.js +6 -4
  166. package/esm/chips/TabbedChips.js +6 -4
  167. package/esm/coachmark/Coachmark.js +6 -4
  168. package/esm/collapsible/Collapsible.js +10 -8
  169. package/esm/controls/Checkbox.js +6 -4
  170. package/esm/controls/CheckboxCell.js +6 -4
  171. package/esm/controls/Control.js +8 -6
  172. package/esm/controls/ControlGroup.js +6 -4
  173. package/esm/controls/InputStack.js +6 -4
  174. package/esm/controls/Radio.js +6 -4
  175. package/esm/controls/RadioCell.js +6 -4
  176. package/esm/controls/SearchInput.js +6 -4
  177. package/esm/controls/SelectOption.js +6 -4
  178. package/esm/controls/Switch.js +6 -4
  179. package/esm/controls/TextInput.js +6 -4
  180. package/esm/core/componentConfig.js +1 -0
  181. package/esm/dates/Calendar.js +8 -6
  182. package/esm/dates/DateInput.js +6 -4
  183. package/esm/dates/DatePicker.js +9 -6
  184. package/esm/dots/DotCount.js +6 -4
  185. package/esm/dots/DotStatusColor.js +6 -4
  186. package/esm/dots/DotSymbol.js +6 -4
  187. package/esm/hooks/useComponentConfig.js +27 -0
  188. package/esm/icons/Icon.js +10 -8
  189. package/esm/index.js +2 -0
  190. package/esm/layout/Divider.js +6 -4
  191. package/esm/layout/Fallback.js +6 -4
  192. package/esm/media/Avatar.js +6 -4
  193. package/esm/media/RemoteImage.js +6 -4
  194. package/esm/media/RemoteImageGroup.js +6 -4
  195. package/esm/navigation/BrowserBar.js +6 -4
  196. package/esm/navigation/NavigationTitle.js +6 -4
  197. package/esm/navigation/NavigationTitleSelect.js +8 -6
  198. package/esm/navigation/TopNavBar.js +5 -3
  199. package/esm/numbers/RollingNumber/RollingNumber.js +6 -4
  200. package/esm/numpad/Numpad.js +8 -6
  201. package/esm/overlays/Alert.js +7 -5
  202. package/esm/overlays/Toast.js +10 -8
  203. package/esm/overlays/drawer/Drawer.js +12 -10
  204. package/esm/overlays/modal/Modal.js +4 -1
  205. package/esm/overlays/modal/ModalBody.js +8 -6
  206. package/esm/overlays/modal/ModalFooter.js +8 -6
  207. package/esm/overlays/modal/ModalHeader.js +6 -4
  208. package/esm/overlays/overlay/Overlay.js +6 -4
  209. package/esm/overlays/tooltip/Tooltip.js +5 -3
  210. package/esm/overlays/tray/Tray.js +13 -11
  211. package/esm/page/PageFooter.js +6 -4
  212. package/esm/page/PageHeader.js +6 -4
  213. package/esm/perf/component-config/Button.component-config.perf-test.js +35 -0
  214. package/esm/perf/component-config/ComponentConfigProvider.perf-test.js +147 -0
  215. package/esm/perf/component-config/ComponentConfigStickerSheet.perf-test.js +326 -0
  216. package/esm/perf/component-config/README.md +8 -0
  217. package/esm/stepper/Stepper.js +11 -9
  218. package/esm/system/ComponentConfigProvider.js +39 -0
  219. package/esm/system/__stories__/ComponentConfigProvider.stories.js +12 -0
  220. package/esm/system/__stories__/ComponentConfigProviderCustom.stories.js +22 -0
  221. package/esm/system/__stories__/componentConfigStickerSheet/Container.js +27 -0
  222. package/esm/system/__stories__/componentConfigStickerSheet/StickerSheet.js +94 -0
  223. package/esm/system/__stories__/componentConfigStickerSheet/customComponentConfig.js +116 -0
  224. package/esm/system/__stories__/componentConfigStickerSheet/customTheme.js +520 -0
  225. package/esm/system/__stories__/componentConfigStickerSheet/examples/Accordion.js +67 -0
  226. package/esm/system/__stories__/componentConfigStickerSheet/examples/Avatar.js +48 -0
  227. package/esm/system/__stories__/componentConfigStickerSheet/examples/Banner.js +43 -0
  228. package/esm/system/__stories__/componentConfigStickerSheet/examples/Button.js +77 -0
  229. package/esm/system/__stories__/componentConfigStickerSheet/examples/Coachmark.js +15 -0
  230. package/esm/system/__stories__/componentConfigStickerSheet/examples/Controls.js +29 -0
  231. package/esm/system/__stories__/componentConfigStickerSheet/examples/DatePicker.js +15 -0
  232. package/esm/system/__stories__/componentConfigStickerSheet/examples/DotCount.js +28 -0
  233. package/esm/system/__stories__/componentConfigStickerSheet/examples/Icon.js +57 -0
  234. package/esm/system/__stories__/componentConfigStickerSheet/examples/InputChip.js +17 -0
  235. package/esm/system/__stories__/componentConfigStickerSheet/examples/ListCell.js +48 -0
  236. package/esm/system/__stories__/componentConfigStickerSheet/examples/Search.js +20 -0
  237. package/esm/system/__stories__/componentConfigStickerSheet/examples/SegmentedTabs.js +12 -0
  238. package/esm/system/__stories__/componentConfigStickerSheet/examples/Select.js +24 -0
  239. package/esm/system/__stories__/componentConfigStickerSheet/examples/SelectChip.js +22 -0
  240. package/esm/system/__stories__/componentConfigStickerSheet/examples/Tag.js +35 -0
  241. package/esm/system/__stories__/componentConfigStickerSheet/examples/TextInput.js +46 -0
  242. package/esm/system/__stories__/componentConfigStickerSheet/examples/constants.js +33 -0
  243. package/esm/system/__stories__/componentConfigStickerSheet/themeVars.js +2 -0
  244. package/esm/system/index.js +1 -0
  245. package/esm/tabs/SegmentedTab.js +7 -5
  246. package/esm/tabs/SegmentedTabs.js +9 -4
  247. package/esm/tabs/Tabs.js +12 -10
  248. package/esm/tag/Tag.js +6 -4
  249. package/esm/tour/Tour.js +5 -3
  250. package/esm/typography/Link.js +6 -4
  251. package/esm/utils/mergeComponentProps.js +35 -0
  252. package/esm/visualizations/ProgressBar.js +7 -5
  253. package/esm/visualizations/ProgressBarWithFixedLabels.js +5 -3
  254. package/esm/visualizations/ProgressBarWithFloatLabel.js +5 -3
  255. package/esm/visualizations/ProgressCircle.js +7 -5
  256. package/package.json +4 -3
@@ -5,6 +5,7 @@ import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle }
5
5
  import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
6
6
  import { Button } from '../buttons';
7
7
  import { useA11y } from '../hooks/useA11y';
8
+ import { useComponentConfig } from '../hooks/useComponentConfig';
8
9
  import { useTheme } from '../hooks/useTheme';
9
10
  import { Box, HStack } from '../layout';
10
11
  import { ColorSurge } from '../motion/ColorSurge';
@@ -12,9 +13,10 @@ import { Text } from '../typography/Text';
12
13
  import { useToastAnimation } from './useToastAnimation';
13
14
  import { useToastPanResponder } from './useToastPanResponder';
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
16
+ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
16
17
  var _action$testID;
17
- let {
18
+ const mergedProps = useComponentConfig('Toast', _props);
19
+ const {
18
20
  text,
19
21
  action,
20
22
  onWillHide,
@@ -22,8 +24,8 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
22
24
  bottomOffset,
23
25
  variant,
24
26
  accessibilityLabel
25
- } = _ref,
26
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
27
+ } = mergedProps,
28
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
27
29
  const theme = useTheme();
28
30
  const [{
29
31
  opacity,
@@ -34,10 +36,10 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
34
36
  } = useA11y();
35
37
  const defaultA11yLabel = text + (action ? action.label : '');
36
38
  useEffect(() => {
37
- animateIn.start(_ref2 => {
39
+ animateIn.start(_ref => {
38
40
  let {
39
41
  finished
40
- } = _ref2;
42
+ } = _ref;
41
43
  if (finished) {
42
44
  // announce toast copy and action label to screen reader
43
45
  announceForA11y(accessibilityLabel != null ? accessibilityLabel : defaultA11yLabel);
@@ -47,10 +49,10 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
47
49
  const handleClose = useCallback(async () => {
48
50
  onWillHide == null || onWillHide();
49
51
  return new Promise(resolve => {
50
- animateOut.start(_ref3 => {
52
+ animateOut.start(_ref2 => {
51
53
  let {
52
54
  finished
53
- } = _ref3;
55
+ } = _ref2;
54
56
  if (finished) {
55
57
  onDidHide == null || onDidHide();
56
58
  resolve(finished);
@@ -6,6 +6,7 @@ import { Animated, Keyboard, Modal, Platform, useWindowDimensions } from 'react-
6
6
  import { drawerAnimationDefaultDuration, MAX_OVER_DRAG } from '@coinbase/cds-common/animation/drawer';
7
7
  import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
8
8
  import { horizontalDrawerPercentageOfView, verticalDrawerPercentageOfView as defaultVerticalDrawerPercentageOfView } from '@coinbase/cds-common/tokens/drawer';
9
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
9
10
  import { useTheme } from '../../hooks/useTheme';
10
11
  import { Box } from '../../layout/Box';
11
12
  import { HandleBar } from '../handlebar/HandleBar';
@@ -19,8 +20,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
20
  const overlayContentContextValue = {
20
21
  isDrawer: true
21
22
  };
22
- export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(_ref, ref) {
23
- let {
23
+ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
24
+ const mergedProps = useComponentConfig('Drawer', _props);
25
+ const {
24
26
  children,
25
27
  pin = 'bottom',
26
28
  onCloseComplete,
@@ -41,8 +43,8 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
41
43
  accessibilityRole = 'alert',
42
44
  animationType = 'none',
43
45
  disableSafeAreaPaddingBottom
44
- } = _ref,
45
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
46
+ } = mergedProps,
47
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
46
48
  const theme = useTheme();
47
49
  const {
48
50
  width,
@@ -61,10 +63,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
61
63
  const paddingStyles = useDrawerSpacing(pin, disableSafeAreaPaddingBottom);
62
64
  const isMounted = useRef(false);
63
65
  const handleClose = useCallback(() => {
64
- Animated.parallel([animateDrawerOut, animateOverlayOut]).start(_ref2 => {
66
+ Animated.parallel([animateDrawerOut, animateOverlayOut]).start(_ref => {
65
67
  let {
66
68
  finished
67
- } = _ref2;
69
+ } = _ref;
68
70
  if (finished) {
69
71
  isMounted.current = false;
70
72
  onCloseComplete == null || onCloseComplete();
@@ -74,10 +76,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
74
76
  const handleRequestClose = useCallback(() => preventHardwareBackBehaviorAndroid && isAndroid ? undefined : handleClose(), [preventHardwareBackBehaviorAndroid, handleClose, isAndroid]);
75
77
  const handleSwipeToClose = useCallback(() => {
76
78
  if (!preventDismissGestures) {
77
- Animated.parallel([animateSwipeToClose, animateOverlayOut]).start(_ref3 => {
79
+ Animated.parallel([animateSwipeToClose, animateOverlayOut]).start(_ref2 => {
78
80
  let {
79
81
  finished
80
- } = _ref3;
82
+ } = _ref2;
81
83
  if (finished) {
82
84
  isMounted.current = false;
83
85
  onCloseComplete == null || onCloseComplete();
@@ -87,10 +89,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
87
89
  }, [preventDismissGestures, animateSwipeToClose, animateOverlayOut, onCloseComplete]);
88
90
  useEffect(() => {
89
91
  if (!isMounted.current) {
90
- Animated.parallel([animateOverlayIn, animateDrawerIn]).start(_ref4 => {
92
+ Animated.parallel([animateOverlayIn, animateDrawerIn]).start(_ref3 => {
91
93
  let {
92
94
  finished
93
- } = _ref4;
95
+ } = _ref3;
94
96
  if (finished) {
95
97
  isMounted.current = true;
96
98
  onOpenComplete == null || onOpenComplete();
@@ -6,13 +6,16 @@ import { Modal as RNModal, Platform, SafeAreaView, StatusBar, StyleSheet } from
6
6
  import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
7
7
  import { ModalContext } from '@coinbase/cds-common/overlays/ModalContext';
8
8
  import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
9
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
9
10
  import { VStack } from '../../layout';
10
11
  import { useModalAnimation } from './useModalAnimation';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const overlayContentContextValue = {
13
14
  isModal: true
14
15
  };
15
- export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((props, ref) => {
16
+ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
17
+ const mergedProps = useComponentConfig('Modal', _props);
18
+ const props = mergedProps;
16
19
  const {
17
20
  children,
18
21
  visible,
@@ -1,15 +1,17 @@
1
1
  const _excluded = ["children", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useMemo } from 'react';
4
+ import React, { memo, useMemo } from 'react';
5
5
  import { KeyboardAvoidingView, ScrollView } from 'react-native';
6
6
  import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
7
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
7
8
  import { useContentSize } from '../../hooks/useContentSize';
8
9
  import { useLayout } from '../../hooks/useLayout';
9
10
  import { Box } from '../../layout/Box';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
- export const ModalBody = _ref => {
12
- let {
12
+ export const ModalBody = /*#__PURE__*/memo(_props => {
13
+ const mergedProps = useComponentConfig('ModalBody', _props);
14
+ const {
13
15
  children,
14
16
  padding,
15
17
  paddingX = 3,
@@ -18,8 +20,8 @@ export const ModalBody = _ref => {
18
20
  paddingBottom,
19
21
  paddingStart,
20
22
  paddingEnd
21
- } = _ref,
22
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
+ } = mergedProps,
24
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
23
25
  const [{
24
26
  height: contentHeight
25
27
  }, onContentSizeChange] = useContentSize();
@@ -61,4 +63,4 @@ export const ModalBody = _ref => {
61
63
  })
62
64
  }))
63
65
  });
64
- };
66
+ });
@@ -1,20 +1,22 @@
1
1
  const _excluded = ["primaryAction", "secondaryAction", "direction", "paddingX", "paddingY"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { Fragment } from 'react';
4
+ import React, { Fragment, memo } from 'react';
5
5
  import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
6
6
  import { ButtonGroup } from '../../buttons/ButtonGroup';
7
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
7
8
  import { Box } from '../../layout/Box';
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
- export const ModalFooter = _ref => {
10
- let {
10
+ export const ModalFooter = /*#__PURE__*/memo(_props => {
11
+ const mergedProps = useComponentConfig('ModalFooter', _props);
12
+ const {
11
13
  primaryAction,
12
14
  secondaryAction,
13
15
  direction = 'horizontal',
14
16
  paddingX = 3,
15
17
  paddingY = 2
16
- } = _ref,
17
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
18
+ } = mergedProps,
19
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
18
20
  const {
19
21
  hideDividers = false
20
22
  } = useModalContext();
@@ -41,4 +43,4 @@ export const ModalFooter = _ref => {
41
43
  }, i))
42
44
  })
43
45
  }));
44
- };
46
+ });
@@ -4,12 +4,14 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
4
4
  import React from 'react';
5
5
  import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
6
6
  import { IconButton } from '../../buttons';
7
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
7
8
  import { Box } from '../../layout/Box';
8
9
  import { HStack } from '../../layout/HStack';
9
10
  import { Text } from '../../typography/Text';
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- export const ModalHeader = _ref => {
12
- let {
12
+ export const ModalHeader = _props => {
13
+ const mergedProps = useComponentConfig('ModalHeader', _props);
14
+ const {
13
15
  alignItems = 'center',
14
16
  paddingX = 3,
15
17
  paddingY = 2,
@@ -19,8 +21,8 @@ export const ModalHeader = _ref => {
19
21
  backAccessibilityHint,
20
22
  closeAccessibilityLabel,
21
23
  closeAccessibilityHint
22
- } = _ref,
23
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
24
+ } = mergedProps,
25
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
24
26
  const {
25
27
  onRequestClose,
26
28
  hideCloseButton,
@@ -3,18 +3,20 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React, { memo } from 'react';
5
5
  import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
6
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
6
7
  import { useTheme } from '../../hooks/useTheme';
7
8
  import { VStack } from '../../layout/VStack';
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  const overlayContentContextValue = {
10
11
  isOverlay: true
11
12
  };
12
- export const Overlay = /*#__PURE__*/memo(function Overlay(_ref) {
13
+ export const Overlay = /*#__PURE__*/memo(_props => {
13
14
  var _theme$darkSpectrum;
14
- let {
15
+ const mergedProps = useComponentConfig('Overlay', _props);
16
+ const {
15
17
  opacity
16
- } = _ref,
17
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
18
+ } = mergedProps,
19
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
18
20
  const theme = useTheme();
19
21
  return /*#__PURE__*/_jsx(OverlayContentContext.Provider, {
20
22
  value: overlayContentContextValue,
@@ -1,12 +1,14 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { Fragment, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { Modal as RNModal, TouchableOpacity, View } from 'react-native';
4
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
4
5
  import { InvertedThemeProvider } from '../../system/ThemeProvider';
5
6
  import { InternalTooltip } from './InternalTooltip';
6
7
  import { useTooltipAnimation } from './useTooltipAnimation';
7
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- export const Tooltip = /*#__PURE__*/memo(_ref => {
9
- let {
9
+ export const Tooltip = /*#__PURE__*/memo(_props => {
10
+ const mergedProps = useComponentConfig('Tooltip', _props);
11
+ const {
10
12
  children,
11
13
  content,
12
14
  placement = 'top',
@@ -25,7 +27,7 @@ export const Tooltip = /*#__PURE__*/memo(_ref => {
25
27
  elevation,
26
28
  openDelay,
27
29
  closeDelay
28
- } = _ref;
30
+ } = mergedProps;
29
31
  const subjectRef = useRef(null);
30
32
  const [isOpen, setIsOpen] = useState(false);
31
33
  const isVisible = visible !== false && isOpen;
@@ -6,6 +6,7 @@ import React, { createContext, forwardRef, memo, useCallback, useContext, useEff
6
6
  import { useWindowDimensions } from 'react-native';
7
7
  import { MAX_OVER_DRAG } from '@coinbase/cds-common/animation/drawer';
8
8
  import { verticalDrawerPercentageOfView as defaultVerticalDrawerPercentageOfView } from '@coinbase/cds-common/tokens/drawer';
9
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
9
10
  import { Box, VStack } from '../../layout';
10
11
  import { Text } from '../../typography/Text';
11
12
  import { Drawer } from '../drawer/Drawer';
@@ -14,8 +15,9 @@ export const TrayContext = /*#__PURE__*/createContext({
14
15
  verticalDrawerPercentageOfView: defaultVerticalDrawerPercentageOfView,
15
16
  titleHeight: 0
16
17
  });
17
- export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref, ref) {
18
- let {
18
+ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_props, ref) {
19
+ const mergedProps = useComponentConfig('Tray', _props);
20
+ const {
19
21
  children,
20
22
  title,
21
23
  header,
@@ -25,8 +27,8 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
25
27
  handleBarVariant = 'outside',
26
28
  verticalDrawerPercentageOfView = defaultVerticalDrawerPercentageOfView,
27
29
  styles
28
- } = _ref,
29
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
30
+ } = mergedProps,
31
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
30
32
  const [titleHeight, setTitleHeight] = useState(0);
31
33
  const isInsideHandleBar = handleBarVariant === 'inside';
32
34
  const isTitleString = typeof title === 'string';
@@ -36,13 +38,13 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
36
38
  titleStyle,
37
39
  drawerStyles
38
40
  } = useMemo(() => {
39
- const _ref2 = styles != null ? styles : {},
41
+ const _ref = styles != null ? styles : {},
40
42
  {
41
43
  content: contentStyle,
42
44
  header: headerStyle,
43
45
  title: titleStyle
44
- } = _ref2,
45
- drawerStyles = _objectWithoutPropertiesLoose(_ref2, _excluded2);
46
+ } = _ref,
47
+ drawerStyles = _objectWithoutPropertiesLoose(_ref, _excluded2);
46
48
  return {
47
49
  contentStyle,
48
50
  headerStyle,
@@ -54,10 +56,10 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
54
56
  if (!title) return;
55
57
  setTitleHeight(event.nativeEvent.layout.height);
56
58
  }, [title]);
57
- const renderChildren = useCallback(_ref3 => {
59
+ const renderChildren = useCallback(_ref2 => {
58
60
  let {
59
61
  handleClose
60
- } = _ref3;
62
+ } = _ref2;
61
63
  const content = typeof children === 'function' ? children({
62
64
  handleClose
63
65
  }) : children;
@@ -125,10 +127,10 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
125
127
  * @deprecated Redundant component. This will be removed in a future major release.
126
128
  * @deprecationExpectedRemoval v9
127
129
  */
128
- export const TrayStickyFooter = _ref4 => {
130
+ export const TrayStickyFooter = _ref3 => {
129
131
  let {
130
132
  children
131
- } = _ref4;
133
+ } = _ref3;
132
134
  const {
133
135
  verticalDrawerPercentageOfView,
134
136
  titleHeight
@@ -3,13 +3,15 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React, { forwardRef, memo } from 'react';
5
5
  import { pageFooterHeight } from '@coinbase/cds-common/tokens/page';
6
+ import { useComponentConfig } from '../hooks/useComponentConfig';
6
7
  import { Box } from '../layout/Box';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
- export const PageFooter = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function PageFooter(_ref, ref) {
9
- let {
9
+ export const PageFooter = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
10
+ const mergedProps = useComponentConfig('PageFooter', _props);
11
+ const {
10
12
  action
11
- } = _ref,
12
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
13
+ } = mergedProps,
14
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
13
15
  return /*#__PURE__*/_jsx(Box, _extends({
14
16
  ref: ref,
15
17
  accessibilityRole: "toolbar",
@@ -3,20 +3,22 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React, { forwardRef, memo, useMemo } from 'react';
5
5
  import { pageHeaderHeight } from '@coinbase/cds-common/tokens/page';
6
+ import { useComponentConfig } from '../hooks/useComponentConfig';
6
7
  import { Box } from '../layout/Box';
7
8
  import { HStack } from '../layout/HStack';
8
9
  import { VStack } from '../layout/VStack';
9
10
  import { Text } from '../typography/Text';
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- export const PageHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function PageHeader(_ref, ref) {
12
- let {
12
+ export const PageHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
13
+ const mergedProps = useComponentConfig('PageHeader', _props);
14
+ const {
13
15
  start,
14
16
  title,
15
17
  end,
16
18
  styles,
17
19
  style
18
- } = _ref,
19
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
+ } = mergedProps,
21
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
20
22
  const isMultiRow = useMemo(() => Boolean(start && title && end), [start, end, title]);
21
23
  return /*#__PURE__*/_jsxs(VStack, _extends({
22
24
  ref: ref,
@@ -0,0 +1,35 @@
1
+ import { measurePerformance } from 'reassure';
2
+ import { Button } from '../../buttons/Button';
3
+ import { ComponentConfigProvider } from '../../system/ComponentConfigProvider';
4
+ import { DefaultThemeProvider } from '../../utils/testHelpers';
5
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
6
+ const buttonCount = 1000;
7
+ const ButtonList = () => {
8
+ return /*#__PURE__*/_jsx(_Fragment, {
9
+ children: Array.from({
10
+ length: buttonCount
11
+ }, (_, index) => /*#__PURE__*/_jsx(Button, {
12
+ children: "Child"
13
+ }, index))
14
+ });
15
+ };
16
+ describe('Button component-config performance (mobile)', () => {
17
+ jest.setTimeout(20000);
18
+ it('no provider', async () => {
19
+ await measurePerformance(/*#__PURE__*/_jsx(DefaultThemeProvider, {
20
+ children: /*#__PURE__*/_jsx(ButtonList, {})
21
+ }));
22
+ });
23
+ it('provider customization', async () => {
24
+ await measurePerformance(/*#__PURE__*/_jsx(DefaultThemeProvider, {
25
+ children: /*#__PURE__*/_jsx(ComponentConfigProvider, {
26
+ value: {
27
+ Button: {
28
+ compact: true
29
+ }
30
+ },
31
+ children: /*#__PURE__*/_jsx(ButtonList, {})
32
+ })
33
+ }));
34
+ });
35
+ });
@@ -0,0 +1,147 @@
1
+ import React, { useMemo, useState } from 'react';
2
+ import { Pressable, Text } from 'react-native';
3
+ import { fireEvent, screen } from '@testing-library/react-native';
4
+ import { measurePerformance } from 'reassure';
5
+ import { useComponentConfig } from '../../hooks/useComponentConfig';
6
+ import { ComponentConfigProvider } from '../../system/ComponentConfigProvider';
7
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const consumerCount = 1000;
9
+ const updateIterations = 50;
10
+ const testTimeoutMs = 20000;
11
+ const stableButtonConfig = () => ({
12
+ compact: true
13
+ });
14
+ const stableAvatarConfig = () => ({});
15
+ const ButtonConfigConsumer = _ref => {
16
+ let {
17
+ index
18
+ } = _ref;
19
+ const mergedProps = useComponentConfig('Button', {
20
+ compact: false,
21
+ variant: 'primary'
22
+ });
23
+ return /*#__PURE__*/_jsx(Text, {
24
+ testID: "consumer-" + index,
25
+ children: mergedProps.compact ? 'compact' : 'default'
26
+ });
27
+ };
28
+ const ButtonConfigConsumerList = _ref2 => {
29
+ let {
30
+ count
31
+ } = _ref2;
32
+ return /*#__PURE__*/_jsx(_Fragment, {
33
+ children: Array.from({
34
+ length: count
35
+ }, (_, index) => /*#__PURE__*/_jsx(ButtonConfigConsumer, {
36
+ index: index
37
+ }, index))
38
+ });
39
+ };
40
+ const UnrelatedKeyUpdateHarness = _ref3 => {
41
+ let {
42
+ count
43
+ } = _ref3;
44
+ const [unrelatedUpdates, setUnrelatedUpdates] = useState(0);
45
+ const value = useMemo(() => ({
46
+ Avatar: () => unrelatedUpdates % 2 === 0 ? {} : {},
47
+ Button: stableButtonConfig
48
+ }), [unrelatedUpdates]);
49
+ return /*#__PURE__*/_jsxs(_Fragment, {
50
+ children: [/*#__PURE__*/_jsx(Pressable, {
51
+ onPress: () => setUnrelatedUpdates(v => v + 1),
52
+ testID: "update-unrelated-key",
53
+ children: /*#__PURE__*/_jsx(Text, {
54
+ children: "Update unrelated key"
55
+ })
56
+ }), /*#__PURE__*/_jsx(ComponentConfigProvider, {
57
+ value: value,
58
+ children: /*#__PURE__*/_jsx(ButtonConfigConsumerList, {
59
+ count: count
60
+ })
61
+ })]
62
+ });
63
+ };
64
+ const TargetKeyUpdateHarness = _ref4 => {
65
+ let {
66
+ count
67
+ } = _ref4;
68
+ const [targetUpdates, setTargetUpdates] = useState(0);
69
+ const value = useMemo(() => ({
70
+ Avatar: stableAvatarConfig,
71
+ Button: () => ({
72
+ compact: targetUpdates % 2 === 0
73
+ })
74
+ }), [targetUpdates]);
75
+ return /*#__PURE__*/_jsxs(_Fragment, {
76
+ children: [/*#__PURE__*/_jsx(Pressable, {
77
+ onPress: () => setTargetUpdates(v => v + 1),
78
+ testID: "update-target-key",
79
+ children: /*#__PURE__*/_jsx(Text, {
80
+ children: "Update target key"
81
+ })
82
+ }), /*#__PURE__*/_jsx(ComponentConfigProvider, {
83
+ value: value,
84
+ children: /*#__PURE__*/_jsx(ButtonConfigConsumerList, {
85
+ count: count
86
+ })
87
+ })]
88
+ });
89
+ };
90
+ describe('ComponentConfigProvider performance tests (mobile)', () => {
91
+ jest.setTimeout(testTimeoutMs);
92
+ beforeAll(() => {
93
+ jest.spyOn(console, 'error').mockImplementation(() => {});
94
+ });
95
+ afterAll(() => {
96
+ jest.restoreAllMocks();
97
+ });
98
+ it('Scenario A: renders 1000 consumers under one provider', async () => {
99
+ await measurePerformance(/*#__PURE__*/_jsx(ComponentConfigProvider, {
100
+ value: {
101
+ Button: stableButtonConfig
102
+ },
103
+ children: /*#__PURE__*/_jsx(ButtonConfigConsumerList, {
104
+ count: consumerCount
105
+ })
106
+ }));
107
+ });
108
+ it('Scenario B: updates unrelated component key 50 times', async () => {
109
+ const scenario = async () => {
110
+ for (let i = 0; i < updateIterations; i += 1) {
111
+ fireEvent.press(screen.getByTestId('update-unrelated-key'));
112
+ }
113
+ };
114
+ await measurePerformance(/*#__PURE__*/_jsx(UnrelatedKeyUpdateHarness, {
115
+ count: consumerCount
116
+ }), {
117
+ scenario
118
+ });
119
+ });
120
+ it('Scenario C: updates target component key 50 times', async () => {
121
+ const scenario = async () => {
122
+ for (let i = 0; i < updateIterations; i += 1) {
123
+ fireEvent.press(screen.getByTestId('update-target-key'));
124
+ }
125
+ };
126
+ await measurePerformance(/*#__PURE__*/_jsx(TargetKeyUpdateHarness, {
127
+ count: consumerCount
128
+ }), {
129
+ scenario
130
+ });
131
+ });
132
+ it('Scenario D (baseline): no provider with 1000 consumers', async () => {
133
+ await measurePerformance(/*#__PURE__*/_jsx(ButtonConfigConsumerList, {
134
+ count: consumerCount
135
+ }));
136
+ });
137
+ it('Scenario D (provider): provider enabled with 1000 consumers', async () => {
138
+ await measurePerformance(/*#__PURE__*/_jsx(ComponentConfigProvider, {
139
+ value: {
140
+ Button: stableButtonConfig
141
+ },
142
+ children: /*#__PURE__*/_jsx(ButtonConfigConsumerList, {
143
+ count: consumerCount
144
+ })
145
+ }));
146
+ });
147
+ });