@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.
- package/CHANGELOG.md +20 -0
- package/dts/accordion/Accordion.d.ts +1 -9
- package/dts/accordion/Accordion.d.ts.map +1 -1
- package/dts/alpha/combobox/Combobox.d.ts.map +1 -1
- package/dts/alpha/select/Select.d.ts.map +1 -1
- package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts.map +1 -1
- package/dts/banner/Banner.d.ts.map +1 -1
- package/dts/buttons/AvatarButton.d.ts +6 -3
- package/dts/buttons/AvatarButton.d.ts.map +1 -1
- package/dts/buttons/Button.d.ts.map +1 -1
- package/dts/buttons/ButtonGroup.d.ts +3 -1
- package/dts/buttons/ButtonGroup.d.ts.map +1 -1
- package/dts/buttons/IconButton.d.ts.map +1 -1
- package/dts/buttons/IconCounterButton.d.ts.map +1 -1
- package/dts/buttons/SlideButton.d.ts.map +1 -1
- package/dts/cards/Card.d.ts +4 -0
- package/dts/cards/Card.d.ts.map +1 -1
- package/dts/cards/CardBody.d.ts +4 -0
- package/dts/cards/CardBody.d.ts.map +1 -1
- package/dts/cards/CardFooter.d.ts +4 -0
- package/dts/cards/CardFooter.d.ts.map +1 -1
- package/dts/cards/CardGroup.d.ts +12 -0
- package/dts/cards/CardGroup.d.ts.map +1 -1
- package/dts/cards/CardHeader.d.ts +8 -0
- package/dts/cards/CardHeader.d.ts.map +1 -1
- package/dts/cards/CardMedia.d.ts +8 -0
- package/dts/cards/CardMedia.d.ts.map +1 -1
- package/dts/cards/LikeButton.d.ts.map +1 -1
- package/dts/carousel/Carousel.d.ts.map +1 -1
- package/dts/cells/Cell.d.ts.map +1 -1
- package/dts/cells/ListCell.d.ts.map +1 -1
- package/dts/cells/ListCellFallback.d.ts.map +1 -1
- package/dts/chips/Chip.d.ts.map +1 -1
- package/dts/chips/ChipProps.d.ts +10 -8
- package/dts/chips/ChipProps.d.ts.map +1 -1
- package/dts/chips/InputChip.d.ts.map +1 -1
- package/dts/chips/MediaChip.d.ts +3 -2
- package/dts/chips/MediaChip.d.ts.map +1 -1
- package/dts/chips/TabbedChips.d.ts.map +1 -1
- package/dts/coachmark/Coachmark.d.ts.map +1 -1
- package/dts/collapsible/Collapsible.d.ts.map +1 -1
- package/dts/controls/Checkbox.d.ts.map +1 -1
- package/dts/controls/CheckboxCell.d.ts.map +1 -1
- package/dts/controls/Control.d.ts.map +1 -1
- package/dts/controls/ControlGroup.d.ts +13 -4
- package/dts/controls/ControlGroup.d.ts.map +1 -1
- package/dts/controls/InputStack.d.ts.map +1 -1
- package/dts/controls/Radio.d.ts.map +1 -1
- package/dts/controls/RadioCell.d.ts.map +1 -1
- package/dts/controls/SearchInput.d.ts.map +1 -1
- package/dts/controls/SelectOption.d.ts +3 -1
- package/dts/controls/SelectOption.d.ts.map +1 -1
- package/dts/controls/Switch.d.ts.map +1 -1
- package/dts/controls/TextInput.d.ts.map +1 -1
- package/dts/core/componentConfig.d.ts +166 -0
- package/dts/core/componentConfig.d.ts.map +1 -0
- package/dts/dates/Calendar.d.ts.map +1 -1
- package/dts/dates/DateInput.d.ts.map +1 -1
- package/dts/dates/DatePicker.d.ts.map +1 -1
- package/dts/dots/DotCount.d.ts +1 -11
- package/dts/dots/DotCount.d.ts.map +1 -1
- package/dts/dots/DotStatusColor.d.ts +1 -8
- package/dts/dots/DotStatusColor.d.ts.map +1 -1
- package/dts/dots/DotSymbol.d.ts +1 -17
- package/dts/dots/DotSymbol.d.ts.map +1 -1
- package/dts/hooks/useComponentConfig.d.ts +22 -0
- package/dts/hooks/useComponentConfig.d.ts.map +1 -0
- package/dts/icons/Icon.d.ts +11 -1
- package/dts/icons/Icon.d.ts.map +1 -1
- package/dts/index.d.ts +2 -0
- package/dts/index.d.ts.map +1 -1
- package/dts/layout/Divider.d.ts +3 -1
- package/dts/layout/Divider.d.ts.map +1 -1
- package/dts/layout/Fallback.d.ts +3 -1
- package/dts/layout/Fallback.d.ts.map +1 -1
- package/dts/media/Avatar.d.ts +1 -14
- package/dts/media/Avatar.d.ts.map +1 -1
- package/dts/media/RemoteImage.d.ts.map +1 -1
- package/dts/media/RemoteImageGroup.d.ts +3 -10
- package/dts/media/RemoteImageGroup.d.ts.map +1 -1
- package/dts/navigation/BrowserBar.d.ts +5 -14
- package/dts/navigation/BrowserBar.d.ts.map +1 -1
- package/dts/navigation/NavigationTitle.d.ts +4 -7
- package/dts/navigation/NavigationTitle.d.ts.map +1 -1
- package/dts/navigation/NavigationTitleSelect.d.ts +5 -11
- package/dts/navigation/NavigationTitleSelect.d.ts.map +1 -1
- package/dts/navigation/TopNavBar.d.ts +3 -13
- package/dts/navigation/TopNavBar.d.ts.map +1 -1
- package/dts/numbers/RollingNumber/RollingNumber.d.ts.map +1 -1
- package/dts/numpad/Numpad.d.ts +41 -38
- package/dts/numpad/Numpad.d.ts.map +1 -1
- package/dts/overlays/Alert.d.ts.map +1 -1
- package/dts/overlays/Toast.d.ts.map +1 -1
- package/dts/overlays/drawer/Drawer.d.ts.map +1 -1
- package/dts/overlays/modal/Modal.d.ts.map +1 -1
- package/dts/overlays/modal/ModalBody.d.ts.map +1 -1
- package/dts/overlays/modal/ModalFooter.d.ts +3 -8
- package/dts/overlays/modal/ModalFooter.d.ts.map +1 -1
- package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
- package/dts/overlays/overlay/Overlay.d.ts +7 -3
- package/dts/overlays/overlay/Overlay.d.ts.map +1 -1
- package/dts/overlays/tooltip/Tooltip.d.ts +2 -20
- package/dts/overlays/tooltip/Tooltip.d.ts.map +1 -1
- package/dts/overlays/tray/Tray.d.ts.map +1 -1
- package/dts/page/PageFooter.d.ts.map +1 -1
- package/dts/page/PageHeader.d.ts.map +1 -1
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts +2 -0
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts.map +1 -0
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts +2 -0
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts.map +1 -0
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts +2 -0
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts.map +1 -0
- package/dts/stepper/Stepper.d.ts.map +1 -1
- package/dts/system/ComponentConfigProvider.d.ts +26 -0
- package/dts/system/ComponentConfigProvider.d.ts.map +1 -0
- package/dts/system/index.d.ts +1 -0
- package/dts/system/index.d.ts.map +1 -1
- package/dts/tabs/SegmentedTab.d.ts +6 -3
- package/dts/tabs/SegmentedTab.d.ts.map +1 -1
- package/dts/tabs/SegmentedTabs.d.ts +6 -3
- package/dts/tabs/SegmentedTabs.d.ts.map +1 -1
- package/dts/tabs/Tabs.d.ts +25 -24
- package/dts/tabs/Tabs.d.ts.map +1 -1
- package/dts/tag/Tag.d.ts.map +1 -1
- package/dts/tour/Tour.d.ts +42 -41
- package/dts/tour/Tour.d.ts.map +1 -1
- package/dts/typography/Link.d.ts +1 -14
- package/dts/typography/Link.d.ts.map +1 -1
- package/dts/utils/mergeComponentProps.d.ts +34 -0
- package/dts/utils/mergeComponentProps.d.ts.map +1 -0
- package/dts/visualizations/ProgressBar.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts +5 -3
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts +3 -1
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts.map +1 -1
- package/dts/visualizations/ProgressCircle.d.ts.map +1 -1
- package/esm/accordion/Accordion.js +5 -3
- package/esm/alpha/combobox/Combobox.js +8 -6
- package/esm/alpha/select/Select.js +6 -4
- package/esm/alpha/select-chip/SelectChip.js +6 -4
- package/esm/alpha/tabbed-chips/TabbedChips.js +6 -4
- package/esm/banner/Banner.js +6 -4
- package/esm/buttons/AvatarButton.js +6 -4
- package/esm/buttons/Button.js +25 -10
- package/esm/buttons/ButtonGroup.js +5 -3
- package/esm/buttons/IconButton.js +14 -11
- package/esm/buttons/IconCounterButton.js +6 -4
- package/esm/buttons/SlideButton.js +10 -8
- package/esm/buttons/__stories__/Button.stories.js +32 -0
- package/esm/buttons/__stories__/IconButton.stories.js +32 -0
- package/esm/cards/Card.js +5 -0
- package/esm/cards/CardBody.js +5 -0
- package/esm/cards/CardFooter.js +4 -0
- package/esm/cards/CardGroup.js +14 -0
- package/esm/cards/CardHeader.js +9 -0
- package/esm/cards/CardMedia.js +10 -0
- package/esm/cards/LikeButton.js +6 -4
- package/esm/carousel/Carousel.js +10 -8
- package/esm/cells/Cell.js +6 -4
- package/esm/cells/ListCell.js +6 -4
- package/esm/cells/ListCellFallback.js +6 -4
- package/esm/chips/Chip.js +6 -4
- package/esm/chips/InputChip.js +6 -4
- package/esm/chips/MediaChip.js +6 -4
- package/esm/chips/TabbedChips.js +6 -4
- package/esm/coachmark/Coachmark.js +6 -4
- package/esm/collapsible/Collapsible.js +10 -8
- package/esm/controls/Checkbox.js +6 -4
- package/esm/controls/CheckboxCell.js +6 -4
- package/esm/controls/Control.js +8 -6
- package/esm/controls/ControlGroup.js +6 -4
- package/esm/controls/InputStack.js +6 -4
- package/esm/controls/Radio.js +6 -4
- package/esm/controls/RadioCell.js +6 -4
- package/esm/controls/SearchInput.js +6 -4
- package/esm/controls/SelectOption.js +6 -4
- package/esm/controls/Switch.js +6 -4
- package/esm/controls/TextInput.js +6 -4
- package/esm/core/componentConfig.js +1 -0
- package/esm/dates/Calendar.js +8 -6
- package/esm/dates/DateInput.js +6 -4
- package/esm/dates/DatePicker.js +9 -6
- package/esm/dots/DotCount.js +6 -4
- package/esm/dots/DotStatusColor.js +6 -4
- package/esm/dots/DotSymbol.js +6 -4
- package/esm/hooks/useComponentConfig.js +27 -0
- package/esm/icons/Icon.js +10 -8
- package/esm/index.js +2 -0
- package/esm/layout/Divider.js +6 -4
- package/esm/layout/Fallback.js +6 -4
- package/esm/media/Avatar.js +6 -4
- package/esm/media/RemoteImage.js +6 -4
- package/esm/media/RemoteImageGroup.js +6 -4
- package/esm/navigation/BrowserBar.js +6 -4
- package/esm/navigation/NavigationTitle.js +6 -4
- package/esm/navigation/NavigationTitleSelect.js +8 -6
- package/esm/navigation/TopNavBar.js +5 -3
- package/esm/numbers/RollingNumber/RollingNumber.js +6 -4
- package/esm/numpad/Numpad.js +8 -6
- package/esm/overlays/Alert.js +7 -5
- package/esm/overlays/Toast.js +10 -8
- package/esm/overlays/drawer/Drawer.js +12 -10
- package/esm/overlays/modal/Modal.js +4 -1
- package/esm/overlays/modal/ModalBody.js +8 -6
- package/esm/overlays/modal/ModalFooter.js +8 -6
- package/esm/overlays/modal/ModalHeader.js +6 -4
- package/esm/overlays/overlay/Overlay.js +6 -4
- package/esm/overlays/tooltip/Tooltip.js +5 -3
- package/esm/overlays/tray/Tray.js +13 -11
- package/esm/page/PageFooter.js +6 -4
- package/esm/page/PageHeader.js +6 -4
- package/esm/perf/component-config/Button.component-config.perf-test.js +35 -0
- package/esm/perf/component-config/ComponentConfigProvider.perf-test.js +147 -0
- package/esm/perf/component-config/ComponentConfigStickerSheet.perf-test.js +326 -0
- package/esm/perf/component-config/README.md +8 -0
- package/esm/stepper/Stepper.js +11 -9
- package/esm/system/ComponentConfigProvider.js +39 -0
- package/esm/system/__stories__/ComponentConfigProvider.stories.js +12 -0
- package/esm/system/__stories__/ComponentConfigProviderCustom.stories.js +22 -0
- package/esm/system/__stories__/componentConfigStickerSheet/Container.js +27 -0
- package/esm/system/__stories__/componentConfigStickerSheet/StickerSheet.js +94 -0
- package/esm/system/__stories__/componentConfigStickerSheet/customComponentConfig.js +116 -0
- package/esm/system/__stories__/componentConfigStickerSheet/customTheme.js +520 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Accordion.js +67 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Avatar.js +48 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Banner.js +43 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Button.js +77 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Coachmark.js +15 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Controls.js +29 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/DatePicker.js +15 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/DotCount.js +28 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Icon.js +57 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/InputChip.js +17 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/ListCell.js +48 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Search.js +20 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/SegmentedTabs.js +12 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Select.js +24 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/SelectChip.js +22 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Tag.js +35 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/TextInput.js +46 -0
- package/esm/system/__stories__/componentConfigStickerSheet/examples/constants.js +33 -0
- package/esm/system/__stories__/componentConfigStickerSheet/themeVars.js +2 -0
- package/esm/system/index.js +1 -0
- package/esm/tabs/SegmentedTab.js +7 -5
- package/esm/tabs/SegmentedTabs.js +9 -4
- package/esm/tabs/Tabs.js +12 -10
- package/esm/tag/Tag.js +6 -4
- package/esm/tour/Tour.js +5 -3
- package/esm/typography/Link.js +6 -4
- package/esm/utils/mergeComponentProps.js +35 -0
- package/esm/visualizations/ProgressBar.js +7 -5
- package/esm/visualizations/ProgressBarWithFixedLabels.js +5 -3
- package/esm/visualizations/ProgressBarWithFloatLabel.js +5 -3
- package/esm/visualizations/ProgressCircle.js +7 -5
- package/package.json +4 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { HStack } from '../../../../layout';
|
|
3
|
+
import { Avatar } from '../../../../media/Avatar';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export const AvatarExample = /*#__PURE__*/memo(() => {
|
|
6
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
gap: 1,
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
11
|
+
accessibilityLabel: "",
|
|
12
|
+
colorScheme: "red",
|
|
13
|
+
name: "Avatar",
|
|
14
|
+
shape: "circle",
|
|
15
|
+
size: "m"
|
|
16
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
17
|
+
accessibilityLabel: "",
|
|
18
|
+
colorScheme: "orange",
|
|
19
|
+
name: "Avatar",
|
|
20
|
+
shape: "circle",
|
|
21
|
+
size: "l"
|
|
22
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
23
|
+
accessibilityLabel: "",
|
|
24
|
+
colorScheme: "yellow",
|
|
25
|
+
name: "Avatar",
|
|
26
|
+
shape: "circle",
|
|
27
|
+
size: "xl"
|
|
28
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
29
|
+
accessibilityLabel: "",
|
|
30
|
+
colorScheme: "green",
|
|
31
|
+
name: "Avatar",
|
|
32
|
+
shape: "square",
|
|
33
|
+
size: "m"
|
|
34
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
35
|
+
accessibilityLabel: "",
|
|
36
|
+
colorScheme: "blue",
|
|
37
|
+
name: "Avatar",
|
|
38
|
+
shape: "square",
|
|
39
|
+
size: "l"
|
|
40
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
41
|
+
accessibilityLabel: "",
|
|
42
|
+
colorScheme: "purple",
|
|
43
|
+
name: "Avatar",
|
|
44
|
+
shape: "square",
|
|
45
|
+
size: "xl"
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { Banner } from '../../../../banner/Banner';
|
|
3
|
+
import { VStack } from '../../../../layout/VStack';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export const BannerExample = /*#__PURE__*/memo(() => {
|
|
6
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
7
|
+
gap: 1,
|
|
8
|
+
width: "100%",
|
|
9
|
+
children: [/*#__PURE__*/_jsx(Banner, {
|
|
10
|
+
startIconActive: true,
|
|
11
|
+
closeAccessibilityLabel: "Close",
|
|
12
|
+
startIcon: "info",
|
|
13
|
+
startIconAccessibilityLabel: "Information",
|
|
14
|
+
title: "Informational banner",
|
|
15
|
+
variant: "informational",
|
|
16
|
+
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
17
|
+
}), /*#__PURE__*/_jsx(Banner, {
|
|
18
|
+
startIconActive: true,
|
|
19
|
+
closeAccessibilityLabel: "Close",
|
|
20
|
+
startIcon: "info",
|
|
21
|
+
startIconAccessibilityLabel: "Information",
|
|
22
|
+
title: "Promotional banner",
|
|
23
|
+
variant: "promotional",
|
|
24
|
+
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
25
|
+
}), /*#__PURE__*/_jsx(Banner, {
|
|
26
|
+
startIconActive: true,
|
|
27
|
+
closeAccessibilityLabel: "Close",
|
|
28
|
+
startIcon: "warning",
|
|
29
|
+
startIconAccessibilityLabel: "Warning",
|
|
30
|
+
title: "Warning banner",
|
|
31
|
+
variant: "warning",
|
|
32
|
+
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
33
|
+
}), /*#__PURE__*/_jsx(Banner, {
|
|
34
|
+
startIconActive: true,
|
|
35
|
+
closeAccessibilityLabel: "Close",
|
|
36
|
+
startIcon: "error",
|
|
37
|
+
startIconAccessibilityLabel: "Error",
|
|
38
|
+
title: "Error banner",
|
|
39
|
+
variant: "error",
|
|
40
|
+
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -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
|
+
}];
|
package/esm/system/index.js
CHANGED
package/esm/tabs/SegmentedTab.js
CHANGED
|
@@ -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((
|
|
16
|
-
|
|
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
|
-
} =
|
|
33
|
-
props = _objectWithoutPropertiesLoose(
|
|
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((
|
|
10
|
-
|
|
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
|
-
} =
|
|
17
|
-
props = _objectWithoutPropertiesLoose(
|
|
21
|
+
} = mergedProps,
|
|
22
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
18
23
|
return /*#__PURE__*/_jsx(Tabs, _extends({
|
|
19
24
|
ref: ref,
|
|
20
25
|
TabComponent: TabComponent,
|