@coinbase/cds-mobile 8.61.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 (236) hide show
  1. package/CHANGELOG.md +6 -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/LikeButton.d.ts.map +1 -1
  18. package/dts/carousel/Carousel.d.ts.map +1 -1
  19. package/dts/cells/Cell.d.ts.map +1 -1
  20. package/dts/cells/ListCell.d.ts.map +1 -1
  21. package/dts/cells/ListCellFallback.d.ts.map +1 -1
  22. package/dts/chips/Chip.d.ts.map +1 -1
  23. package/dts/chips/ChipProps.d.ts +10 -8
  24. package/dts/chips/ChipProps.d.ts.map +1 -1
  25. package/dts/chips/InputChip.d.ts.map +1 -1
  26. package/dts/chips/MediaChip.d.ts +3 -2
  27. package/dts/chips/MediaChip.d.ts.map +1 -1
  28. package/dts/chips/TabbedChips.d.ts.map +1 -1
  29. package/dts/coachmark/Coachmark.d.ts.map +1 -1
  30. package/dts/collapsible/Collapsible.d.ts.map +1 -1
  31. package/dts/controls/Checkbox.d.ts.map +1 -1
  32. package/dts/controls/CheckboxCell.d.ts.map +1 -1
  33. package/dts/controls/Control.d.ts.map +1 -1
  34. package/dts/controls/ControlGroup.d.ts +13 -4
  35. package/dts/controls/ControlGroup.d.ts.map +1 -1
  36. package/dts/controls/InputStack.d.ts.map +1 -1
  37. package/dts/controls/Radio.d.ts.map +1 -1
  38. package/dts/controls/RadioCell.d.ts.map +1 -1
  39. package/dts/controls/SearchInput.d.ts.map +1 -1
  40. package/dts/controls/SelectOption.d.ts +3 -1
  41. package/dts/controls/SelectOption.d.ts.map +1 -1
  42. package/dts/controls/Switch.d.ts.map +1 -1
  43. package/dts/controls/TextInput.d.ts.map +1 -1
  44. package/dts/core/componentConfig.d.ts +166 -0
  45. package/dts/core/componentConfig.d.ts.map +1 -0
  46. package/dts/dates/Calendar.d.ts.map +1 -1
  47. package/dts/dates/DateInput.d.ts.map +1 -1
  48. package/dts/dates/DatePicker.d.ts.map +1 -1
  49. package/dts/dots/DotCount.d.ts +1 -11
  50. package/dts/dots/DotCount.d.ts.map +1 -1
  51. package/dts/dots/DotStatusColor.d.ts +1 -8
  52. package/dts/dots/DotStatusColor.d.ts.map +1 -1
  53. package/dts/dots/DotSymbol.d.ts +1 -17
  54. package/dts/dots/DotSymbol.d.ts.map +1 -1
  55. package/dts/hooks/useComponentConfig.d.ts +22 -0
  56. package/dts/hooks/useComponentConfig.d.ts.map +1 -0
  57. package/dts/icons/Icon.d.ts +11 -1
  58. package/dts/icons/Icon.d.ts.map +1 -1
  59. package/dts/index.d.ts +2 -0
  60. package/dts/index.d.ts.map +1 -1
  61. package/dts/layout/Divider.d.ts +3 -1
  62. package/dts/layout/Divider.d.ts.map +1 -1
  63. package/dts/layout/Fallback.d.ts +3 -1
  64. package/dts/layout/Fallback.d.ts.map +1 -1
  65. package/dts/media/Avatar.d.ts +1 -14
  66. package/dts/media/Avatar.d.ts.map +1 -1
  67. package/dts/media/RemoteImage.d.ts.map +1 -1
  68. package/dts/media/RemoteImageGroup.d.ts +3 -10
  69. package/dts/media/RemoteImageGroup.d.ts.map +1 -1
  70. package/dts/navigation/BrowserBar.d.ts +5 -14
  71. package/dts/navigation/BrowserBar.d.ts.map +1 -1
  72. package/dts/navigation/NavigationTitle.d.ts +4 -7
  73. package/dts/navigation/NavigationTitle.d.ts.map +1 -1
  74. package/dts/navigation/NavigationTitleSelect.d.ts +5 -11
  75. package/dts/navigation/NavigationTitleSelect.d.ts.map +1 -1
  76. package/dts/navigation/TopNavBar.d.ts +3 -13
  77. package/dts/navigation/TopNavBar.d.ts.map +1 -1
  78. package/dts/numbers/RollingNumber/RollingNumber.d.ts.map +1 -1
  79. package/dts/numpad/Numpad.d.ts +41 -38
  80. package/dts/numpad/Numpad.d.ts.map +1 -1
  81. package/dts/overlays/Alert.d.ts.map +1 -1
  82. package/dts/overlays/Toast.d.ts.map +1 -1
  83. package/dts/overlays/drawer/Drawer.d.ts.map +1 -1
  84. package/dts/overlays/modal/Modal.d.ts.map +1 -1
  85. package/dts/overlays/modal/ModalBody.d.ts.map +1 -1
  86. package/dts/overlays/modal/ModalFooter.d.ts +3 -8
  87. package/dts/overlays/modal/ModalFooter.d.ts.map +1 -1
  88. package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
  89. package/dts/overlays/overlay/Overlay.d.ts +7 -3
  90. package/dts/overlays/overlay/Overlay.d.ts.map +1 -1
  91. package/dts/overlays/tooltip/Tooltip.d.ts +2 -20
  92. package/dts/overlays/tooltip/Tooltip.d.ts.map +1 -1
  93. package/dts/overlays/tray/Tray.d.ts.map +1 -1
  94. package/dts/page/PageFooter.d.ts.map +1 -1
  95. package/dts/page/PageHeader.d.ts.map +1 -1
  96. package/dts/perf/component-config/Button.component-config.perf-test.d.ts +2 -0
  97. package/dts/perf/component-config/Button.component-config.perf-test.d.ts.map +1 -0
  98. package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts +2 -0
  99. package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts.map +1 -0
  100. package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts +2 -0
  101. package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts.map +1 -0
  102. package/dts/stepper/Stepper.d.ts.map +1 -1
  103. package/dts/system/ComponentConfigProvider.d.ts +26 -0
  104. package/dts/system/ComponentConfigProvider.d.ts.map +1 -0
  105. package/dts/system/index.d.ts +1 -0
  106. package/dts/system/index.d.ts.map +1 -1
  107. package/dts/tabs/SegmentedTab.d.ts +6 -3
  108. package/dts/tabs/SegmentedTab.d.ts.map +1 -1
  109. package/dts/tabs/SegmentedTabs.d.ts +6 -3
  110. package/dts/tabs/SegmentedTabs.d.ts.map +1 -1
  111. package/dts/tabs/Tabs.d.ts +25 -24
  112. package/dts/tabs/Tabs.d.ts.map +1 -1
  113. package/dts/tag/Tag.d.ts.map +1 -1
  114. package/dts/tour/Tour.d.ts +42 -41
  115. package/dts/tour/Tour.d.ts.map +1 -1
  116. package/dts/typography/Link.d.ts +1 -14
  117. package/dts/typography/Link.d.ts.map +1 -1
  118. package/dts/utils/mergeComponentProps.d.ts +34 -0
  119. package/dts/utils/mergeComponentProps.d.ts.map +1 -0
  120. package/dts/visualizations/ProgressBar.d.ts.map +1 -1
  121. package/dts/visualizations/ProgressBarWithFixedLabels.d.ts +5 -3
  122. package/dts/visualizations/ProgressBarWithFixedLabels.d.ts.map +1 -1
  123. package/dts/visualizations/ProgressBarWithFloatLabel.d.ts +3 -1
  124. package/dts/visualizations/ProgressBarWithFloatLabel.d.ts.map +1 -1
  125. package/dts/visualizations/ProgressCircle.d.ts.map +1 -1
  126. package/esm/accordion/Accordion.js +5 -3
  127. package/esm/alpha/combobox/Combobox.js +8 -6
  128. package/esm/alpha/select/Select.js +6 -4
  129. package/esm/alpha/select-chip/SelectChip.js +6 -4
  130. package/esm/alpha/tabbed-chips/TabbedChips.js +6 -4
  131. package/esm/banner/Banner.js +6 -4
  132. package/esm/buttons/AvatarButton.js +6 -4
  133. package/esm/buttons/Button.js +6 -4
  134. package/esm/buttons/ButtonGroup.js +5 -3
  135. package/esm/buttons/IconButton.js +6 -4
  136. package/esm/buttons/IconCounterButton.js +6 -4
  137. package/esm/buttons/SlideButton.js +10 -8
  138. package/esm/cards/LikeButton.js +6 -4
  139. package/esm/carousel/Carousel.js +10 -8
  140. package/esm/cells/Cell.js +6 -4
  141. package/esm/cells/ListCell.js +6 -4
  142. package/esm/cells/ListCellFallback.js +6 -4
  143. package/esm/chips/Chip.js +6 -4
  144. package/esm/chips/InputChip.js +6 -4
  145. package/esm/chips/MediaChip.js +6 -4
  146. package/esm/chips/TabbedChips.js +6 -4
  147. package/esm/coachmark/Coachmark.js +6 -4
  148. package/esm/collapsible/Collapsible.js +10 -8
  149. package/esm/controls/Checkbox.js +6 -4
  150. package/esm/controls/CheckboxCell.js +6 -4
  151. package/esm/controls/Control.js +8 -6
  152. package/esm/controls/ControlGroup.js +6 -4
  153. package/esm/controls/InputStack.js +6 -4
  154. package/esm/controls/Radio.js +6 -4
  155. package/esm/controls/RadioCell.js +6 -4
  156. package/esm/controls/SearchInput.js +6 -4
  157. package/esm/controls/SelectOption.js +6 -4
  158. package/esm/controls/Switch.js +6 -4
  159. package/esm/controls/TextInput.js +6 -4
  160. package/esm/core/componentConfig.js +1 -0
  161. package/esm/dates/Calendar.js +8 -6
  162. package/esm/dates/DateInput.js +6 -4
  163. package/esm/dates/DatePicker.js +9 -6
  164. package/esm/dots/DotCount.js +6 -4
  165. package/esm/dots/DotStatusColor.js +6 -4
  166. package/esm/dots/DotSymbol.js +6 -4
  167. package/esm/hooks/useComponentConfig.js +27 -0
  168. package/esm/icons/Icon.js +10 -8
  169. package/esm/index.js +2 -0
  170. package/esm/layout/Divider.js +6 -4
  171. package/esm/layout/Fallback.js +6 -4
  172. package/esm/media/Avatar.js +6 -4
  173. package/esm/media/RemoteImage.js +6 -4
  174. package/esm/media/RemoteImageGroup.js +6 -4
  175. package/esm/navigation/BrowserBar.js +6 -4
  176. package/esm/navigation/NavigationTitle.js +6 -4
  177. package/esm/navigation/NavigationTitleSelect.js +8 -6
  178. package/esm/navigation/TopNavBar.js +5 -3
  179. package/esm/numbers/RollingNumber/RollingNumber.js +6 -4
  180. package/esm/numpad/Numpad.js +8 -6
  181. package/esm/overlays/Alert.js +7 -5
  182. package/esm/overlays/Toast.js +10 -8
  183. package/esm/overlays/drawer/Drawer.js +12 -10
  184. package/esm/overlays/modal/Modal.js +4 -1
  185. package/esm/overlays/modal/ModalBody.js +8 -6
  186. package/esm/overlays/modal/ModalFooter.js +8 -6
  187. package/esm/overlays/modal/ModalHeader.js +6 -4
  188. package/esm/overlays/overlay/Overlay.js +6 -4
  189. package/esm/overlays/tooltip/Tooltip.js +5 -3
  190. package/esm/overlays/tray/Tray.js +13 -11
  191. package/esm/page/PageFooter.js +6 -4
  192. package/esm/page/PageHeader.js +6 -4
  193. package/esm/perf/component-config/Button.component-config.perf-test.js +35 -0
  194. package/esm/perf/component-config/ComponentConfigProvider.perf-test.js +147 -0
  195. package/esm/perf/component-config/ComponentConfigStickerSheet.perf-test.js +326 -0
  196. package/esm/perf/component-config/README.md +8 -0
  197. package/esm/stepper/Stepper.js +11 -9
  198. package/esm/system/ComponentConfigProvider.js +39 -0
  199. package/esm/system/__stories__/ComponentConfigProvider.stories.js +12 -0
  200. package/esm/system/__stories__/ComponentConfigProviderCustom.stories.js +22 -0
  201. package/esm/system/__stories__/componentConfigStickerSheet/Container.js +27 -0
  202. package/esm/system/__stories__/componentConfigStickerSheet/StickerSheet.js +94 -0
  203. package/esm/system/__stories__/componentConfigStickerSheet/customComponentConfig.js +116 -0
  204. package/esm/system/__stories__/componentConfigStickerSheet/customTheme.js +520 -0
  205. package/esm/system/__stories__/componentConfigStickerSheet/examples/Accordion.js +67 -0
  206. package/esm/system/__stories__/componentConfigStickerSheet/examples/Avatar.js +48 -0
  207. package/esm/system/__stories__/componentConfigStickerSheet/examples/Banner.js +43 -0
  208. package/esm/system/__stories__/componentConfigStickerSheet/examples/Button.js +77 -0
  209. package/esm/system/__stories__/componentConfigStickerSheet/examples/Coachmark.js +15 -0
  210. package/esm/system/__stories__/componentConfigStickerSheet/examples/Controls.js +29 -0
  211. package/esm/system/__stories__/componentConfigStickerSheet/examples/DatePicker.js +15 -0
  212. package/esm/system/__stories__/componentConfigStickerSheet/examples/DotCount.js +28 -0
  213. package/esm/system/__stories__/componentConfigStickerSheet/examples/Icon.js +57 -0
  214. package/esm/system/__stories__/componentConfigStickerSheet/examples/InputChip.js +17 -0
  215. package/esm/system/__stories__/componentConfigStickerSheet/examples/ListCell.js +48 -0
  216. package/esm/system/__stories__/componentConfigStickerSheet/examples/Search.js +20 -0
  217. package/esm/system/__stories__/componentConfigStickerSheet/examples/SegmentedTabs.js +12 -0
  218. package/esm/system/__stories__/componentConfigStickerSheet/examples/Select.js +24 -0
  219. package/esm/system/__stories__/componentConfigStickerSheet/examples/SelectChip.js +22 -0
  220. package/esm/system/__stories__/componentConfigStickerSheet/examples/Tag.js +35 -0
  221. package/esm/system/__stories__/componentConfigStickerSheet/examples/TextInput.js +46 -0
  222. package/esm/system/__stories__/componentConfigStickerSheet/examples/constants.js +33 -0
  223. package/esm/system/__stories__/componentConfigStickerSheet/themeVars.js +2 -0
  224. package/esm/system/index.js +1 -0
  225. package/esm/tabs/SegmentedTab.js +7 -5
  226. package/esm/tabs/SegmentedTabs.js +9 -4
  227. package/esm/tabs/Tabs.js +12 -10
  228. package/esm/tag/Tag.js +6 -4
  229. package/esm/tour/Tour.js +5 -3
  230. package/esm/typography/Link.js +6 -4
  231. package/esm/utils/mergeComponentProps.js +35 -0
  232. package/esm/visualizations/ProgressBar.js +7 -5
  233. package/esm/visualizations/ProgressBarWithFixedLabels.js +5 -3
  234. package/esm/visualizations/ProgressBarWithFloatLabel.js +5 -3
  235. package/esm/visualizations/ProgressCircle.js +7 -5
  236. package/package.json +4 -3
@@ -0,0 +1,77 @@
1
+ import React, { memo } from 'react';
2
+ import { Button } from '../../../../buttons/Button';
3
+ import { IconButton } from '../../../../buttons/IconButton';
4
+ import { HStack } from '../../../../layout/HStack';
5
+ import { VStack } from '../../../../layout/VStack';
6
+ import { Text } from '../../../../typography/Text';
7
+ import { buttonVariants } from '../themeVars';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const ButtonExample = /*#__PURE__*/memo(() => {
10
+ return /*#__PURE__*/_jsxs(VStack, {
11
+ gap: 1,
12
+ width: "100%",
13
+ children: [/*#__PURE__*/_jsx(Text, {
14
+ font: "caption",
15
+ children: "Regular"
16
+ }), buttonVariants.map(variant => /*#__PURE__*/_jsxs(HStack, {
17
+ alignItems: "center",
18
+ gap: 1,
19
+ children: [/*#__PURE__*/_jsx(Button, {
20
+ variant: variant,
21
+ width: 180,
22
+ children: "Button"
23
+ }), /*#__PURE__*/_jsx(IconButton, {
24
+ accessibilityLabel: "add-" + variant,
25
+ compact: false,
26
+ name: "add",
27
+ variant: variant
28
+ })]
29
+ }, "regular-" + variant)), /*#__PURE__*/_jsxs(HStack, {
30
+ alignItems: "center",
31
+ gap: 1,
32
+ children: [/*#__PURE__*/_jsx(Button, {
33
+ loading: true,
34
+ width: 180,
35
+ children: "Button"
36
+ }), /*#__PURE__*/_jsx(IconButton, {
37
+ loading: true,
38
+ accessibilityLabel: "add-loading",
39
+ compact: false,
40
+ name: "add",
41
+ variant: "primary"
42
+ })]
43
+ }), /*#__PURE__*/_jsx(Text, {
44
+ font: "caption",
45
+ children: "Compact"
46
+ }), buttonVariants.map(variant => /*#__PURE__*/_jsxs(HStack, {
47
+ alignItems: "center",
48
+ gap: 1,
49
+ children: [/*#__PURE__*/_jsx(Button, {
50
+ compact: true,
51
+ variant: variant,
52
+ width: 180,
53
+ children: "Button"
54
+ }), /*#__PURE__*/_jsx(IconButton, {
55
+ compact: true,
56
+ accessibilityLabel: "add-compact-" + variant,
57
+ name: "add",
58
+ variant: variant
59
+ })]
60
+ }, "compact-" + variant)), /*#__PURE__*/_jsxs(HStack, {
61
+ alignItems: "center",
62
+ gap: 1,
63
+ children: [/*#__PURE__*/_jsx(Button, {
64
+ compact: true,
65
+ loading: true,
66
+ width: 180,
67
+ children: "Button"
68
+ }), /*#__PURE__*/_jsx(IconButton, {
69
+ compact: true,
70
+ loading: true,
71
+ accessibilityLabel: "add-compact-loading",
72
+ name: "add",
73
+ variant: "primary"
74
+ })]
75
+ })]
76
+ });
77
+ });
@@ -0,0 +1,15 @@
1
+ import React, { memo } from 'react';
2
+ import { Button } from '../../../../buttons/Button';
3
+ import { Coachmark } from '../../../../coachmark/Coachmark';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export const CoachmarkExample = /*#__PURE__*/memo(() => {
6
+ return /*#__PURE__*/_jsx(Coachmark, {
7
+ action: /*#__PURE__*/_jsx(Button, {
8
+ compact: true,
9
+ children: "Got it"
10
+ }),
11
+ content: "You can now trade directly from your portfolio page.",
12
+ onClose: () => undefined,
13
+ title: "New feature"
14
+ });
15
+ });
@@ -0,0 +1,29 @@
1
+ import { memo, useState } from 'react';
2
+ import { Checkbox } from '../../../../controls/Checkbox';
3
+ import { Radio } from '../../../../controls/Radio';
4
+ import { Switch } from '../../../../controls/Switch';
5
+ import { HStack } from '../../../../layout';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export const ControlsExample = /*#__PURE__*/memo(() => {
8
+ const [isSwitchChecked, setIsSwitchChecked] = useState(false);
9
+ const [isCheckboxChecked, setIsCheckboxChecked] = useState(false);
10
+ const [isRadioChecked, setIsRadioChecked] = useState(true);
11
+ return /*#__PURE__*/_jsxs(HStack, {
12
+ alignItems: "center",
13
+ gap: 1,
14
+ justifyContent: "center",
15
+ children: [/*#__PURE__*/_jsx(Switch, {
16
+ checked: isSwitchChecked,
17
+ onChange: () => setIsSwitchChecked(v => !v),
18
+ children: "Switch"
19
+ }), /*#__PURE__*/_jsx(Checkbox, {
20
+ checked: isCheckboxChecked,
21
+ onChange: () => setIsCheckboxChecked(v => !v),
22
+ children: "Checkbox"
23
+ }), /*#__PURE__*/_jsx(Radio, {
24
+ checked: isRadioChecked,
25
+ onChange: () => setIsRadioChecked(v => !v),
26
+ children: "Radio"
27
+ })]
28
+ });
29
+ });
@@ -0,0 +1,15 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { DatePicker } from '../../../../dates/DatePicker';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export const DatePickerExample = /*#__PURE__*/memo(() => {
5
+ const [date, setDate] = useState(null);
6
+ const [error, setError] = useState(null);
7
+ return /*#__PURE__*/_jsx(DatePicker, {
8
+ date: date,
9
+ error: error,
10
+ label: "Date",
11
+ onChangeDate: setDate,
12
+ onErrorDate: setError,
13
+ openCalendarAccessibilityLabel: "Date calendar"
14
+ });
15
+ });
@@ -0,0 +1,28 @@
1
+ import React, { memo } from 'react';
2
+ import { DotCount } from '../../../../dots/DotCount';
3
+ import { Icon } from '../../../../icons/Icon';
4
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const DotCountExample = /*#__PURE__*/memo(() => {
6
+ return /*#__PURE__*/_jsxs(_Fragment, {
7
+ children: [/*#__PURE__*/_jsx(DotCount, {
8
+ count: 3,
9
+ children: /*#__PURE__*/_jsx(Icon, {
10
+ name: "bell",
11
+ size: "m"
12
+ })
13
+ }), /*#__PURE__*/_jsx(DotCount, {
14
+ count: 12,
15
+ children: /*#__PURE__*/_jsx(Icon, {
16
+ name: "bell",
17
+ size: "m"
18
+ })
19
+ }), /*#__PURE__*/_jsx(DotCount, {
20
+ count: 100,
21
+ max: 99,
22
+ children: /*#__PURE__*/_jsx(Icon, {
23
+ name: "bell",
24
+ size: "m"
25
+ })
26
+ })]
27
+ });
28
+ });
@@ -0,0 +1,57 @@
1
+ import React, { memo } from 'react';
2
+ import { Icon } from '../../../../icons/Icon';
3
+ import { HStack } from '../../../../layout/HStack';
4
+ import { VStack } from '../../../../layout/VStack';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export const IconExample = /*#__PURE__*/memo(() => {
7
+ return /*#__PURE__*/_jsxs(VStack, {
8
+ gap: 1,
9
+ width: "100%",
10
+ children: [/*#__PURE__*/_jsxs(HStack, {
11
+ gap: 1,
12
+ children: [/*#__PURE__*/_jsx(Icon, {
13
+ name: "search",
14
+ size: "l"
15
+ }), /*#__PURE__*/_jsx(Icon, {
16
+ name: "search",
17
+ size: "m"
18
+ }), /*#__PURE__*/_jsx(Icon, {
19
+ name: "search",
20
+ size: "s"
21
+ }), /*#__PURE__*/_jsx(Icon, {
22
+ name: "search",
23
+ size: "xs"
24
+ })]
25
+ }), /*#__PURE__*/_jsxs(HStack, {
26
+ gap: 1,
27
+ children: [/*#__PURE__*/_jsx(Icon, {
28
+ name: "add",
29
+ size: "l"
30
+ }), /*#__PURE__*/_jsx(Icon, {
31
+ name: "add",
32
+ size: "m"
33
+ }), /*#__PURE__*/_jsx(Icon, {
34
+ name: "add",
35
+ size: "s"
36
+ }), /*#__PURE__*/_jsx(Icon, {
37
+ name: "add",
38
+ size: "xs"
39
+ })]
40
+ }), /*#__PURE__*/_jsxs(HStack, {
41
+ gap: 1,
42
+ children: [/*#__PURE__*/_jsx(Icon, {
43
+ name: "account",
44
+ size: "l"
45
+ }), /*#__PURE__*/_jsx(Icon, {
46
+ name: "account",
47
+ size: "m"
48
+ }), /*#__PURE__*/_jsx(Icon, {
49
+ name: "account",
50
+ size: "s"
51
+ }), /*#__PURE__*/_jsx(Icon, {
52
+ name: "account",
53
+ size: "xs"
54
+ })]
55
+ })]
56
+ });
57
+ });
@@ -0,0 +1,17 @@
1
+ import React, { memo } from 'react';
2
+ import { assets } from '@coinbase/cds-common/internal/data/assets';
3
+ import { InputChip } from '../../../../chips/InputChip';
4
+ import { RemoteImage } from '../../../../media/RemoteImage';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export const InputChipExample = /*#__PURE__*/memo(() => {
7
+ return /*#__PURE__*/_jsx(InputChip, {
8
+ onPress: () => undefined,
9
+ start: /*#__PURE__*/_jsx(RemoteImage, {
10
+ height: 16,
11
+ shape: "circle",
12
+ source: assets.eth.imageUrl,
13
+ width: 16
14
+ }),
15
+ children: "ETH"
16
+ });
17
+ });
@@ -0,0 +1,48 @@
1
+ import React, { memo } from 'react';
2
+ import { assets } from '@coinbase/cds-common/internal/data/assets';
3
+ import { ListCell } from '../../../../cells/ListCell';
4
+ import { VStack } from '../../../../layout/VStack';
5
+ import { RemoteImage } from '../../../../media/RemoteImage';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export const ListCellExample = /*#__PURE__*/memo(() => {
8
+ return /*#__PURE__*/_jsxs(VStack, {
9
+ width: "100%",
10
+ children: [/*#__PURE__*/_jsx(ListCell, {
11
+ accessibilityLabel: "Bitcoin asset row",
12
+ description: "$64,231.00",
13
+ media: /*#__PURE__*/_jsx(RemoteImage, {
14
+ height: 36,
15
+ shape: "circle",
16
+ source: assets.btc.imageUrl,
17
+ width: 36
18
+ }),
19
+ onPress: () => undefined,
20
+ subtitle: "BTC",
21
+ title: "Bitcoin"
22
+ }), /*#__PURE__*/_jsx(ListCell, {
23
+ accessibilityLabel: "Ethereum asset row",
24
+ description: "$3,421.50",
25
+ media: /*#__PURE__*/_jsx(RemoteImage, {
26
+ height: 36,
27
+ shape: "circle",
28
+ source: assets.eth.imageUrl,
29
+ width: 36
30
+ }),
31
+ onPress: () => undefined,
32
+ subtitle: "ETH",
33
+ title: "Ethereum"
34
+ }), /*#__PURE__*/_jsx(ListCell, {
35
+ accessibilityLabel: "XRP asset row",
36
+ description: "$2.15",
37
+ media: /*#__PURE__*/_jsx(RemoteImage, {
38
+ height: 36,
39
+ shape: "circle",
40
+ source: assets.xrp.imageUrl,
41
+ width: 36
42
+ }),
43
+ onPress: () => undefined,
44
+ subtitle: "XRP",
45
+ title: "XRP"
46
+ })]
47
+ });
48
+ });
@@ -0,0 +1,20 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { SearchInput } from '../../../../controls/SearchInput';
3
+ import { VStack } from '../../../../layout/VStack';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const SearchExample = /*#__PURE__*/memo(() => {
6
+ const [value, setValue] = useState('');
7
+ const [compactValue, setCompactValue] = useState('');
8
+ return /*#__PURE__*/_jsxs(VStack, {
9
+ gap: 1,
10
+ width: "100%",
11
+ children: [/*#__PURE__*/_jsx(SearchInput, {
12
+ onChangeText: setValue,
13
+ value: value
14
+ }), /*#__PURE__*/_jsx(SearchInput, {
15
+ compact: true,
16
+ onChangeText: setCompactValue,
17
+ value: compactValue
18
+ })]
19
+ });
20
+ });
@@ -0,0 +1,12 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { SegmentedTabs } from '../../../../tabs/SegmentedTabs';
3
+ import { segmentedTabs } from './constants';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export const SegmentedTabsExample = /*#__PURE__*/memo(() => {
6
+ const [activeTab, setActiveTab] = useState(segmentedTabs[0]);
7
+ return /*#__PURE__*/_jsx(SegmentedTabs, {
8
+ activeTab: activeTab,
9
+ onChange: setActiveTab,
10
+ tabs: segmentedTabs
11
+ });
12
+ });
@@ -0,0 +1,24 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { Select } from '../../../../alpha/select/Select';
3
+ import { VStack } from '../../../../layout/VStack';
4
+ import { stickerSheetSelectOptions } from './constants';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export const SelectExample = /*#__PURE__*/memo(() => {
7
+ const [value, setValue] = useState('btc');
8
+ const [secondaryValue, setSecondaryValue] = useState(null);
9
+ return /*#__PURE__*/_jsxs(VStack, {
10
+ gap: 1,
11
+ width: "100%",
12
+ children: [/*#__PURE__*/_jsx(Select, {
13
+ label: "Asset",
14
+ onChange: setValue,
15
+ options: stickerSheetSelectOptions,
16
+ value: value
17
+ }), /*#__PURE__*/_jsx(Select, {
18
+ label: "Asset (empty)",
19
+ onChange: setSecondaryValue,
20
+ options: stickerSheetSelectOptions,
21
+ value: secondaryValue
22
+ })]
23
+ });
24
+ });
@@ -0,0 +1,22 @@
1
+ import React, { memo, useState } from 'react';
2
+ import { SelectChip } from '../../../../chips/SelectChip';
3
+ import { SelectOption } from '../../../../controls/SelectOption';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const SelectChipExample = /*#__PURE__*/memo(() => {
6
+ const [value, setValue] = useState('Balance');
7
+ return /*#__PURE__*/_jsxs(SelectChip, {
8
+ onChange: setValue,
9
+ placeholder: "Sort",
10
+ value: value,
11
+ children: [/*#__PURE__*/_jsx(SelectOption, {
12
+ title: "Balance",
13
+ value: "Balance"
14
+ }), /*#__PURE__*/_jsx(SelectOption, {
15
+ title: "Name",
16
+ value: "Name"
17
+ }), /*#__PURE__*/_jsx(SelectOption, {
18
+ title: "Asset Value",
19
+ value: "Asset Value"
20
+ })]
21
+ });
22
+ });
@@ -0,0 +1,35 @@
1
+ import React, { memo } from 'react';
2
+ import { HStack } from '../../../../layout/HStack';
3
+ import { VStack } from '../../../../layout/VStack';
4
+ import { Tag } from '../../../../tag/Tag';
5
+ import { tagColorSchemes } from '../themeVars';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export const TagExample = /*#__PURE__*/memo(() => {
8
+ return /*#__PURE__*/_jsxs(VStack, {
9
+ gap: 1,
10
+ width: "100%",
11
+ children: [/*#__PURE__*/_jsxs(HStack, {
12
+ flexWrap: "wrap",
13
+ gap: 1,
14
+ children: [/*#__PURE__*/_jsx(Tag, {
15
+ intent: "informational",
16
+ children: "primary"
17
+ }), /*#__PURE__*/_jsx(Tag, {
18
+ intent: "promotional",
19
+ children: "primary"
20
+ })]
21
+ }), tagColorSchemes.map(colorScheme => /*#__PURE__*/_jsxs(HStack, {
22
+ flexWrap: "wrap",
23
+ gap: 1,
24
+ children: [/*#__PURE__*/_jsx(Tag, {
25
+ colorScheme: colorScheme,
26
+ intent: "informational",
27
+ children: colorScheme
28
+ }), /*#__PURE__*/_jsx(Tag, {
29
+ colorScheme: colorScheme,
30
+ intent: "promotional",
31
+ children: colorScheme
32
+ })]
33
+ }, colorScheme))]
34
+ });
35
+ });
@@ -0,0 +1,46 @@
1
+ import { memo, useState } from 'react';
2
+ import { TextInput } from '@coinbase/cds-mobile/controls/TextInput';
3
+ import { InputIconButton } from '../../../../controls';
4
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const TextInputExample = /*#__PURE__*/memo(() => {
6
+ const [value, setValue] = useState('');
7
+ return /*#__PURE__*/_jsxs(_Fragment, {
8
+ children: [/*#__PURE__*/_jsx(TextInput, {
9
+ label: "Label",
10
+ onChangeText: setValue,
11
+ placeholder: "Outside label",
12
+ style: {
13
+ flexGrow: 1
14
+ },
15
+ value: value
16
+ }), /*#__PURE__*/_jsx(TextInput, {
17
+ label: "Label",
18
+ labelVariant: "inside",
19
+ onChangeText: setValue,
20
+ placeholder: "Default input",
21
+ style: {
22
+ flexGrow: 1
23
+ },
24
+ value: value
25
+ }), /*#__PURE__*/_jsx(TextInput, {
26
+ compact: true,
27
+ label: "Label",
28
+ onChangeText: setValue,
29
+ placeholder: "Compact input",
30
+ style: {
31
+ flexGrow: 1
32
+ },
33
+ value: value
34
+ }), /*#__PURE__*/_jsx(TextInput, {
35
+ end: /*#__PURE__*/_jsx(InputIconButton, {
36
+ accessibilityLabel: "Clear input",
37
+ name: "close"
38
+ }),
39
+ label: "Label",
40
+ labelVariant: "inside",
41
+ onChangeText: setValue,
42
+ placeholder: "Input with icon button",
43
+ value: value
44
+ })]
45
+ });
46
+ });
@@ -0,0 +1,33 @@
1
+ export const stickerSheetSelectOptions = [{
2
+ value: null,
3
+ label: 'Clear'
4
+ }, {
5
+ value: 'btc',
6
+ label: 'Bitcoin'
7
+ }, {
8
+ value: 'eth',
9
+ label: 'Ethereum'
10
+ }, {
11
+ value: 'sol',
12
+ label: 'Solana'
13
+ }];
14
+ export const segmentedTabs = [{
15
+ id: 'buy',
16
+ label: 'Buy'
17
+ }, {
18
+ id: 'sell',
19
+ label: 'Sell'
20
+ }, {
21
+ id: 'convert',
22
+ label: 'Convert'
23
+ }];
24
+ export const tabNavigationTabs = [{
25
+ id: 'overview',
26
+ label: 'Overview'
27
+ }, {
28
+ id: 'activity',
29
+ label: 'Activity'
30
+ }, {
31
+ id: 'details',
32
+ label: 'Details'
33
+ }];
@@ -0,0 +1,2 @@
1
+ export const buttonVariants = ['primary', 'secondary', 'tertiary', 'positive', 'negative', 'foregroundMuted'];
2
+ export const tagColorSchemes = ['blue', 'green', 'yellow', 'purple', 'red', 'gray'];
@@ -1,4 +1,5 @@
1
1
  export * from './AndroidNavigationBar';
2
+ export * from './ComponentConfigProvider';
2
3
  export * from './EventHandlerProvider';
3
4
  export * from './Interactable';
4
5
  export * from './Pressable';
@@ -2,18 +2,20 @@ const _excluded = ["id", "label", "disabled", "onPress", "color", "activeColor",
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
4
  import React, { forwardRef, memo, useCallback, useMemo } from 'react';
5
- import { Pressable } from 'react-native';
6
5
  import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
7
6
  import { useTabsContext } from '@coinbase/cds-common/tabs/TabsContext';
8
7
  import { accessibleOpacityDisabled } from '@coinbase/cds-common/tokens/interactable';
8
+ import { useComponentConfig } from '../hooks/useComponentConfig';
9
9
  import { useTheme } from '../hooks/useTheme';
10
10
  import { Box } from '../layout';
11
+ import { Pressable } from '../system/Pressable';
11
12
  import { Text } from '../typography/Text';
12
13
  import { tabsSpringConfig } from './Tabs';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  const AnimatedTextHeadline = Animated.createAnimatedComponent(Text);
15
- const SegmentedTabComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
16
- let {
16
+ const SegmentedTabComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
17
+ const mergedProps = useComponentConfig('SegmentedTab', _props);
18
+ const {
17
19
  id,
18
20
  label,
19
21
  disabled: disabledProp,
@@ -29,8 +31,8 @@ const SegmentedTabComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, r
29
31
  fontSize,
30
32
  fontWeight,
31
33
  lineHeight
32
- } = _ref,
33
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
34
+ } = mergedProps,
35
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
34
36
  const {
35
37
  activeTab,
36
38
  updateActiveTab,
@@ -2,19 +2,24 @@ const _excluded = ["TabComponent", "TabsActiveIndicatorComponent", "activeBackgr
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
4
  import React, { forwardRef, memo } from 'react';
5
+ import { useComponentConfig } from '../hooks/useComponentConfig';
5
6
  import { SegmentedTab } from './SegmentedTab';
6
7
  import { SegmentedTabsActiveIndicator } from './SegmentedTabsActiveIndicator';
7
8
  import { Tabs } from './Tabs';
9
+
10
+ // We do Partial/Pick to allow TabComponent and TabsActiveIndicatorComponent to be optional
11
+ // We grab 'tabs' from the Omit allowing it to stay required
8
12
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const SegmentedTabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
10
- let {
13
+ const SegmentedTabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
14
+ const mergedProps = useComponentConfig('SegmentedTabs', _props);
15
+ const {
11
16
  TabComponent = SegmentedTab,
12
17
  TabsActiveIndicatorComponent = SegmentedTabsActiveIndicator,
13
18
  activeBackground = 'bgInverse',
14
19
  background = 'bgSecondary',
15
20
  borderRadius = 700
16
- } = _ref,
17
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
21
+ } = mergedProps,
22
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
18
23
  return /*#__PURE__*/_jsx(Tabs, _extends({
19
24
  ref: ref,
20
25
  TabComponent: TabComponent,
package/esm/tabs/Tabs.js CHANGED
@@ -12,6 +12,7 @@ import { TabsContext } from '@coinbase/cds-common/tabs/TabsContext';
12
12
  import { useTabs } from '@coinbase/cds-common/tabs/useTabs';
13
13
  import { accessibleOpacityDisabled } from '@coinbase/cds-common/tokens/interactable';
14
14
  import { defaultRect } from '@coinbase/cds-common/types/Rect';
15
+ import { useComponentConfig } from '../hooks/useComponentConfig';
15
16
  import { Box, HStack } from '../layout';
16
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const AnimatedBox = Animated.createAnimatedComponent(Box);
@@ -32,8 +33,9 @@ export const tabsSpringConfig = {
32
33
  damping: 10,
33
34
  overshootClamping: true
34
35
  };
35
- const TabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) => {
36
- let {
36
+ const TabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
37
+ const mergedProps = useComponentConfig('Tabs', _props);
38
+ const {
37
39
  tabs,
38
40
  TabComponent,
39
41
  TabsActiveIndicatorComponent,
@@ -53,8 +55,8 @@ const TabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) =>
53
55
  borderTopRightRadius,
54
56
  borderBottomLeftRadius,
55
57
  borderBottomRightRadius
56
- } = _ref2,
57
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
58
+ } = mergedProps,
59
+ props = _objectWithoutPropertiesLoose(mergedProps, _excluded2);
58
60
  const tabsContainerRef = useRef(null);
59
61
  useImperativeHandle(ref, () => tabsContainerRef.current, []); // merge internal ref to forwarded ref
60
62
 
@@ -112,13 +114,13 @@ const TabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) =>
112
114
  borderTopLeftRadius: borderTopLeftRadius,
113
115
  borderTopRightRadius: borderTopRightRadius,
114
116
  style: styles == null ? void 0 : styles.activeIndicator
115
- }), tabs.map(_ref3 => {
117
+ }), tabs.map(_ref2 => {
116
118
  let {
117
119
  id,
118
120
  Component: CustomTabComponent,
119
121
  disabled: tabDisabled
120
- } = _ref3,
121
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
122
+ } = _ref2,
123
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded3);
122
124
  const RenderedTab = CustomTabComponent != null ? CustomTabComponent : TabComponent;
123
125
  return /*#__PURE__*/_jsx(TabContainer, {
124
126
  id: id,
@@ -135,13 +137,13 @@ const TabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) =>
135
137
  }));
136
138
  TabsComponent.displayName = 'Tabs';
137
139
  export const Tabs = TabsComponent;
138
- export const TabsActiveIndicator = _ref4 => {
140
+ export const TabsActiveIndicator = _ref3 => {
139
141
  let {
140
142
  activeTabRect,
141
143
  position = 'absolute',
142
144
  style
143
- } = _ref4,
144
- props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
145
+ } = _ref3,
146
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded4);
145
147
  const previousActiveTabRect = useRef(activeTabRect);
146
148
  const newActiveTabRect = {
147
149
  x: activeTabRect.x,