@coinbase/cds-mobile 9.1.2 → 9.2.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 +13 -0
- package/dts/alpha/select/DefaultSelectControl.d.ts +9 -9
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/alpha/select/Select.d.ts.map +1 -1
- package/dts/alpha/select/types.d.ts +25 -8
- package/dts/alpha/select/types.d.ts.map +1 -1
- package/dts/sticky-footer/StickyFooter.d.ts +8 -0
- package/dts/sticky-footer/StickyFooter.d.ts.map +1 -1
- package/dts/visualizations/chart/bar/PercentageBarChart.d.ts +2 -2
- package/esm/alpha/select/DefaultSelectControl.js +34 -17
- package/esm/alpha/select/Select.js +59 -47
- package/esm/dates/DatePicker.js +0 -2
- package/esm/overlays/__stories__/TrayAction.stories.js +0 -1
- package/esm/overlays/__stories__/TrayInformational.stories.js +0 -2
- package/esm/overlays/__stories__/TrayMessaging.stories.js +0 -1
- package/esm/overlays/__stories__/TrayPromotional.stories.js +0 -1
- package/esm/overlays/__stories__/TrayRedesign.stories.js +0 -7
- package/esm/sticky-footer/StickyFooter.js +6 -3
- package/esm/system/__stories__/componentConfigStickerSheet/customComponentConfig.js +17 -11
- package/esm/system/__stories__/componentConfigStickerSheet/examples/Select.js +7 -0
- package/package.json +3 -3
- package/dts/accordion/__figma__/Accordion.figma.d.ts +0 -2
- package/dts/accordion/__figma__/Accordion.figma.d.ts.map +0 -1
- package/dts/alpha/__figma__/Select.figma.d.ts +0 -2
- package/dts/alpha/__figma__/Select.figma.d.ts.map +0 -1
- package/dts/alpha/data-card/__figma__/DataCard.figma.d.ts +0 -2
- package/dts/alpha/data-card/__figma__/DataCard.figma.d.ts.map +0 -1
- package/dts/buttons/__figma__/AvatarButton.figma.d.ts +0 -2
- package/dts/buttons/__figma__/AvatarButton.figma.d.ts.map +0 -1
- package/dts/buttons/__figma__/Button.figma.d.ts +0 -2
- package/dts/buttons/__figma__/Button.figma.d.ts.map +0 -1
- package/dts/buttons/__figma__/ButtonGroup.figma.d.ts +0 -2
- package/dts/buttons/__figma__/ButtonGroup.figma.d.ts.map +0 -1
- package/dts/buttons/__figma__/IconButton.figma.d.ts +0 -2
- package/dts/buttons/__figma__/IconButton.figma.d.ts.map +0 -1
- package/dts/buttons/__figma__/SlideButton.figma.d.ts +0 -2
- package/dts/buttons/__figma__/SlideButton.figma.d.ts.map +0 -1
- package/dts/cards/ContentCard/__figma__/ContentCard.figma.d.ts +0 -2
- package/dts/cards/ContentCard/__figma__/ContentCard.figma.d.ts.map +0 -1
- package/dts/cards/MediaCard/__figma__/MediaCard.figma.d.ts +0 -2
- package/dts/cards/MediaCard/__figma__/MediaCard.figma.d.ts.map +0 -1
- package/dts/cards/MessagingCard/__figma__/MessagingCard.figma.d.ts +0 -2
- package/dts/cards/MessagingCard/__figma__/MessagingCard.figma.d.ts.map +0 -1
- package/dts/cards/__figma__/AnnouncementCard.figma.d.ts +0 -2
- package/dts/cards/__figma__/AnnouncementCard.figma.d.ts.map +0 -1
- package/dts/cards/__figma__/ContainedAssetCard.figma.d.ts +0 -2
- package/dts/cards/__figma__/ContainedAssetCard.figma.d.ts.map +0 -1
- package/dts/cards/__figma__/FloatingAssetCard.figma.d.ts +0 -2
- package/dts/cards/__figma__/FloatingAssetCard.figma.d.ts.map +0 -1
- package/dts/cards/__figma__/NudgeCard.figma.d.ts +0 -2
- package/dts/cards/__figma__/NudgeCard.figma.d.ts.map +0 -1
- package/dts/cards/__figma__/UpsellCard.figma.d.ts +0 -2
- package/dts/cards/__figma__/UpsellCard.figma.d.ts.map +0 -1
- package/dts/carousel/__figma__/Carousel.figma.d.ts +0 -2
- package/dts/carousel/__figma__/Carousel.figma.d.ts.map +0 -1
- package/dts/cells/__figma__/ContentCell.figma.d.ts +0 -2
- package/dts/cells/__figma__/ContentCell.figma.d.ts.map +0 -1
- package/dts/cells/__figma__/ListCell.figma.d.ts +0 -2
- package/dts/cells/__figma__/ListCell.figma.d.ts.map +0 -1
- package/dts/chips/__figma__/InputChip.figma.d.ts +0 -2
- package/dts/chips/__figma__/InputChip.figma.d.ts.map +0 -1
- package/dts/chips/__figma__/SelectChip.figma.d.ts +0 -2
- package/dts/chips/__figma__/SelectChip.figma.d.ts.map +0 -1
- package/dts/chips/__figma__/TabbedChips.figma.d.ts +0 -2
- package/dts/chips/__figma__/TabbedChips.figma.d.ts.map +0 -1
- package/dts/coachmark/__figma__/Coachmark.figma.d.ts +0 -2
- package/dts/coachmark/__figma__/Coachmark.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/Checkbox.figma.d.ts +0 -2
- package/dts/controls/__figma__/Checkbox.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/CheckboxCell.figma.d.ts +0 -2
- package/dts/controls/__figma__/CheckboxCell.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/CheckboxGroup.figma.d.ts +0 -2
- package/dts/controls/__figma__/CheckboxGroup.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/RadioCell.figma.d.ts +0 -2
- package/dts/controls/__figma__/RadioCell.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/RadioGroup.figma.d.ts +0 -2
- package/dts/controls/__figma__/RadioGroup.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/SearchInput.figma.d.ts +0 -2
- package/dts/controls/__figma__/SearchInput.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/SelectOption.figma.d.ts +0 -2
- package/dts/controls/__figma__/SelectOption.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/Switch.figma.d.ts +0 -2
- package/dts/controls/__figma__/Switch.figma.d.ts.map +0 -1
- package/dts/controls/__figma__/TextInput.figma.d.ts +0 -2
- package/dts/controls/__figma__/TextInput.figma.d.ts.map +0 -1
- package/dts/dates/__figma__/DatePicker.figma.d.ts +0 -2
- package/dts/dates/__figma__/DatePicker.figma.d.ts.map +0 -1
- package/dts/dots/__figma__/DotCount.figma.d.ts +0 -2
- package/dts/dots/__figma__/DotCount.figma.d.ts.map +0 -1
- package/dts/dots/__figma__/DotStatusColor.figma.d.ts +0 -2
- package/dts/dots/__figma__/DotStatusColor.figma.d.ts.map +0 -1
- package/dts/dots/__figma__/DotSymbol.figma.d.ts +0 -2
- package/dts/dots/__figma__/DotSymbol.figma.d.ts.map +0 -1
- package/dts/icons/__figma__/Icon.figma.d.ts +0 -2
- package/dts/icons/__figma__/Icon.figma.d.ts.map +0 -1
- package/dts/icons/__figma__/LogoMark.figma.d.ts +0 -2
- package/dts/icons/__figma__/LogoMark.figma.d.ts.map +0 -1
- package/dts/icons/__figma__/LogoWordmark.figma.d.ts +0 -2
- package/dts/icons/__figma__/LogoWordmark.figma.d.ts.map +0 -1
- package/dts/icons/__figma__/SubBrandLogoMark.figma.d.ts +0 -2
- package/dts/icons/__figma__/SubBrandLogoMark.figma.d.ts.map +0 -1
- package/dts/icons/__figma__/SubBrandLogoWordmark.figma.d.ts +0 -2
- package/dts/icons/__figma__/SubBrandLogoWordmark.figma.d.ts.map +0 -1
- package/dts/illustrations/__figma__/HeroSquare.figma.d.ts +0 -2
- package/dts/illustrations/__figma__/HeroSquare.figma.d.ts.map +0 -1
- package/dts/illustrations/__figma__/Pictogram.figma.d.ts +0 -2
- package/dts/illustrations/__figma__/Pictogram.figma.d.ts.map +0 -1
- package/dts/illustrations/__figma__/SpotIcon.figma.d.ts +0 -2
- package/dts/illustrations/__figma__/SpotIcon.figma.d.ts.map +0 -1
- package/dts/illustrations/__figma__/SpotRectangle.figma.d.ts +0 -2
- package/dts/illustrations/__figma__/SpotRectangle.figma.d.ts.map +0 -1
- package/dts/illustrations/__figma__/SpotSquare.figma.d.ts +0 -2
- package/dts/illustrations/__figma__/SpotSquare.figma.d.ts.map +0 -1
- package/dts/layout/__figma__/Divider.figma.d.ts +0 -2
- package/dts/layout/__figma__/Divider.figma.d.ts.map +0 -1
- package/dts/layout/__figma__/Fallback.figma.d.ts +0 -2
- package/dts/layout/__figma__/Fallback.figma.d.ts.map +0 -1
- package/dts/media/__figma__/Avatar.figma.d.ts +0 -2
- package/dts/media/__figma__/Avatar.figma.d.ts.map +0 -1
- package/dts/multi-content-module/__figma__/MultiContentModule.figma.d.ts +0 -2
- package/dts/multi-content-module/__figma__/MultiContentModule.figma.d.ts.map +0 -1
- package/dts/navigation/__figma__/BrowserBar.figma.d.ts +0 -2
- package/dts/navigation/__figma__/BrowserBar.figma.d.ts.map +0 -1
- package/dts/navigation/__figma__/TopNavBar.figma.d.ts +0 -2
- package/dts/navigation/__figma__/TopNavBar.figma.d.ts.map +0 -1
- package/dts/numpad/__figma__/Numpad.figma.d.ts +0 -2
- package/dts/numpad/__figma__/Numpad.figma.d.ts.map +0 -1
- package/dts/overlays/__figma__/Alert.figma.d.ts +0 -2
- package/dts/overlays/__figma__/Alert.figma.d.ts.map +0 -1
- package/dts/overlays/__figma__/Toast.figma.d.ts +0 -2
- package/dts/overlays/__figma__/Toast.figma.d.ts.map +0 -1
- package/dts/overlays/modal/__figma__/Modal.figma.d.ts +0 -2
- package/dts/overlays/modal/__figma__/Modal.figma.d.ts.map +0 -1
- package/dts/overlays/tooltip/__figma__/Tooltip.figma.d.ts +0 -2
- package/dts/overlays/tooltip/__figma__/Tooltip.figma.d.ts.map +0 -1
- package/dts/overlays/tray/__figma__/Tray.figma.d.ts +0 -2
- package/dts/overlays/tray/__figma__/Tray.figma.d.ts.map +0 -1
- package/dts/page/__figma__/PageFooter.figma.d.ts +0 -2
- package/dts/page/__figma__/PageFooter.figma.d.ts.map +0 -1
- package/dts/page/__figma__/PageHeader.figma.d.ts +0 -2
- package/dts/page/__figma__/PageHeader.figma.d.ts.map +0 -1
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts +0 -2
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts.map +0 -1
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts +0 -2
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts.map +0 -1
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts +0 -2
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts.map +0 -1
- package/dts/section-header/__figma__/SectionHeader.figma.d.ts +0 -2
- package/dts/section-header/__figma__/SectionHeader.figma.d.ts.map +0 -1
- package/dts/sticky-footer/__figma__/StickyFooter.figma.d.ts +0 -2
- package/dts/sticky-footer/__figma__/StickyFooter.figma.d.ts.map +0 -1
- package/dts/tabs/__figma__/SegmentedTabs.figma.d.ts +0 -2
- package/dts/tabs/__figma__/SegmentedTabs.figma.d.ts.map +0 -1
- package/dts/tabs/__figma__/TabNavigation.figma.d.ts +0 -2
- package/dts/tabs/__figma__/TabNavigation.figma.d.ts.map +0 -1
- package/dts/tag/__figma__/Tag.figma.d.ts +0 -2
- package/dts/tag/__figma__/Tag.figma.d.ts.map +0 -1
- package/dts/typography/__figma__/Link.figma.d.ts +0 -2
- package/dts/typography/__figma__/Link.figma.d.ts.map +0 -1
- package/dts/visualizations/__figma__/ProgressBar.figma.d.ts +0 -2
- package/dts/visualizations/__figma__/ProgressBar.figma.d.ts.map +0 -1
- package/dts/visualizations/__figma__/ProgressCircle.figma.d.ts +0 -2
- package/dts/visualizations/__figma__/ProgressCircle.figma.d.ts.map +0 -1
- package/dts/visualizations/sparkline/__figma__/Sparkline.figma.d.ts +0 -2
- package/dts/visualizations/sparkline/__figma__/Sparkline.figma.d.ts.map +0 -1
- package/dts/visualizations/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +0 -2
- package/dts/visualizations/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts.map +0 -1
- package/dts/visualizations/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +0 -2
- package/dts/visualizations/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts.map +0 -1
- package/esm/accordion/__figma__/Accordion.figma.js +0 -42
- package/esm/alpha/__figma__/Select.figma.js +0 -63
- package/esm/alpha/data-card/__figma__/DataCard.figma.js +0 -29
- package/esm/buttons/__figma__/AvatarButton.figma.js +0 -25
- package/esm/buttons/__figma__/Button.figma.js +0 -65
- package/esm/buttons/__figma__/ButtonGroup.figma.js +0 -48
- package/esm/buttons/__figma__/IconButton.figma.js +0 -29
- package/esm/buttons/__figma__/SlideButton.figma.js +0 -27
- package/esm/cards/ContentCard/__figma__/ContentCard.figma.js +0 -35
- package/esm/cards/MediaCard/__figma__/MediaCard.figma.js +0 -46
- package/esm/cards/MessagingCard/__figma__/MessagingCard.figma.js +0 -38
- package/esm/cards/__figma__/AnnouncementCard.figma.js +0 -19
- package/esm/cards/__figma__/ContainedAssetCard.figma.js +0 -39
- package/esm/cards/__figma__/FloatingAssetCard.figma.js +0 -30
- package/esm/cards/__figma__/NudgeCard.figma.js +0 -54
- package/esm/cards/__figma__/UpsellCard.figma.js +0 -48
- package/esm/carousel/__figma__/Carousel.figma.js +0 -36
- package/esm/cells/__figma__/ContentCell.figma.js +0 -35
- package/esm/cells/__figma__/ListCell.figma.js +0 -74
- package/esm/chips/__figma__/InputChip.figma.js +0 -27
- package/esm/chips/__figma__/SelectChip.figma.js +0 -38
- package/esm/chips/__figma__/TabbedChips.figma.js +0 -55
- package/esm/coachmark/__figma__/Coachmark.figma.js +0 -41
- package/esm/controls/__figma__/Checkbox.figma.js +0 -27
- package/esm/controls/__figma__/CheckboxCell.figma.js +0 -38
- package/esm/controls/__figma__/CheckboxGroup.figma.js +0 -23
- package/esm/controls/__figma__/RadioCell.figma.js +0 -78
- package/esm/controls/__figma__/RadioGroup.figma.js +0 -47
- package/esm/controls/__figma__/SearchInput.figma.js +0 -35
- package/esm/controls/__figma__/SelectOption.figma.js +0 -35
- package/esm/controls/__figma__/Switch.figma.js +0 -16
- package/esm/controls/__figma__/TextInput.figma.js +0 -125
- package/esm/dates/__figma__/DatePicker.figma.js +0 -43
- package/esm/dots/__figma__/DotCount.figma.js +0 -16
- package/esm/dots/__figma__/DotStatusColor.figma.js +0 -23
- package/esm/dots/__figma__/DotSymbol.figma.js +0 -45
- package/esm/icons/__figma__/Icon.figma.js +0 -3906
- package/esm/icons/__figma__/LogoMark.figma.js +0 -20
- package/esm/icons/__figma__/LogoWordmark.figma.js +0 -32
- package/esm/icons/__figma__/SubBrandLogoMark.figma.js +0 -47
- package/esm/icons/__figma__/SubBrandLogoWordmark.figma.js +0 -48
- package/esm/illustrations/__figma__/HeroSquare.figma.js +0 -2104
- package/esm/illustrations/__figma__/Pictogram.figma.js +0 -1774
- package/esm/illustrations/__figma__/SpotIcon.figma.js +0 -340
- package/esm/illustrations/__figma__/SpotRectangle.figma.js +0 -1102
- package/esm/illustrations/__figma__/SpotSquare.figma.js +0 -1192
- package/esm/jest.d.js +0 -12
- package/esm/layout/__figma__/Divider.figma.js +0 -27
- package/esm/layout/__figma__/Fallback.figma.js +0 -21
- package/esm/media/__figma__/Avatar.figma.js +0 -56
- package/esm/multi-content-module/__figma__/MultiContentModule.figma.js +0 -31
- package/esm/navigation/__figma__/BrowserBar.figma.js +0 -58
- package/esm/navigation/__figma__/TopNavBar.figma.js +0 -319
- package/esm/numpad/__figma__/Numpad.figma.js +0 -63
- package/esm/overlays/__figma__/Alert.figma.js +0 -32
- package/esm/overlays/__figma__/Toast.figma.js +0 -51
- package/esm/overlays/modal/__figma__/Modal.figma.js +0 -74
- package/esm/overlays/tooltip/__figma__/Tooltip.figma.js +0 -92
- package/esm/overlays/tray/__figma__/Tray.figma.js +0 -223
- package/esm/page/__figma__/PageFooter.figma.js +0 -61
- package/esm/page/__figma__/PageHeader.figma.js +0 -58
- package/esm/perf/component-config/Button.component-config.perf-test.js +0 -35
- package/esm/perf/component-config/ComponentConfigProvider.perf-test.js +0 -147
- package/esm/perf/component-config/ComponentConfigStickerSheet.perf-test.js +0 -326
- package/esm/perf/component-config/README.md +0 -8
- package/esm/section-header/__figma__/SectionHeader.figma.js +0 -50
- package/esm/sticky-footer/__figma__/StickyFooter.figma.js +0 -25
- package/esm/tabs/__figma__/SegmentedTabs.figma.js +0 -79
- package/esm/tabs/__figma__/TabNavigation.figma.js +0 -83
- package/esm/tag/__figma__/Tag.figma.js +0 -86
- package/esm/typography/__figma__/Link.figma.js +0 -28
- package/esm/visualizations/__figma__/ProgressBar.figma.js +0 -99
- package/esm/visualizations/__figma__/ProgressCircle.figma.js +0 -26
- package/esm/visualizations/sparkline/__figma__/Sparkline.figma.js +0 -22
- package/esm/visualizations/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +0 -85
- package/esm/visualizations/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +0 -104
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const _excluded = ["modalHeader", "modalFooter", "children"];
|
|
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
|
-
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
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { useToggler } from '@coinbase/cds-common/hooks/useToggler';
|
|
7
|
-
import { figma } from '@figma/code-connect';
|
|
8
|
-
import { Button } from '../../../buttons';
|
|
9
|
-
import { Modal } from '../Modal';
|
|
10
|
-
import { ModalBody } from '../ModalBody';
|
|
11
|
-
import { ModalFooter } from '../ModalFooter';
|
|
12
|
-
import { ModalHeader } from '../ModalHeader';
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
figma.connect(Modal, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=68-1065&m=dev', {
|
|
15
|
-
imports: ["import { Modal } from '@coinbase/cds-mobile/overlays/Modal/Modal'", "import { ModalHeader } from '@coinbase/cds-mobile/overlays/Modal/ModalHeader'", "import { ModalFooter } from '@coinbase/cds-mobile/overlays/Modal/ModalFooter'", "import { ModalBody } from '@coinbase/cds-mobile/overlays/Modal/ModalBody'", "import { useToggler } from '@coinbase/cds-common/hooks/useToggler'"],
|
|
16
|
-
props: {
|
|
17
|
-
modalHeader: figma.nestedProps('.Modal Header', {
|
|
18
|
-
// onBackButtonPress: figma.boolean('show back button', {
|
|
19
|
-
// true: () => {},
|
|
20
|
-
// false: undefined,
|
|
21
|
-
// }),
|
|
22
|
-
title: figma.boolean('show title', {
|
|
23
|
-
true: figma.string('title'),
|
|
24
|
-
false: undefined
|
|
25
|
-
})
|
|
26
|
-
}),
|
|
27
|
-
modalFooter: figma.nestedProps('.Modal Footer', {
|
|
28
|
-
secondaryAction: figma.boolean('show secondary', {
|
|
29
|
-
true: /*#__PURE__*/_jsx(Button, {
|
|
30
|
-
variant: "secondary",
|
|
31
|
-
children: "Button"
|
|
32
|
-
}),
|
|
33
|
-
false: undefined
|
|
34
|
-
})
|
|
35
|
-
}),
|
|
36
|
-
children: figma.instance('🔄 replace me'),
|
|
37
|
-
hideDividers: figma.enum('height defined by', {
|
|
38
|
-
content: true,
|
|
39
|
-
container: undefined
|
|
40
|
-
})
|
|
41
|
-
},
|
|
42
|
-
example: _ref => {
|
|
43
|
-
let {
|
|
44
|
-
modalHeader,
|
|
45
|
-
modalFooter,
|
|
46
|
-
children
|
|
47
|
-
} = _ref,
|
|
48
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
49
|
-
const [visible, {
|
|
50
|
-
toggleOn,
|
|
51
|
-
toggleOff
|
|
52
|
-
}] = useToggler(true);
|
|
53
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
54
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
55
|
-
onPress: toggleOn,
|
|
56
|
-
children: "Open Modal"
|
|
57
|
-
}), /*#__PURE__*/_jsxs(Modal, _extends({
|
|
58
|
-
onRequestClose: toggleOff,
|
|
59
|
-
visible: visible
|
|
60
|
-
}, props, {
|
|
61
|
-
children: [/*#__PURE__*/_jsx(ModalHeader, {
|
|
62
|
-
title: modalHeader.title
|
|
63
|
-
}), /*#__PURE__*/_jsx(ModalBody, {
|
|
64
|
-
children: children
|
|
65
|
-
}), /*#__PURE__*/_jsx(ModalFooter, {
|
|
66
|
-
primaryAction: /*#__PURE__*/_jsx(Button, {
|
|
67
|
-
children: "Button"
|
|
68
|
-
}),
|
|
69
|
-
secondaryAction: modalFooter.secondaryAction
|
|
70
|
-
})]
|
|
71
|
-
}))]
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { figma } from '@figma/code-connect';
|
|
3
|
-
import { Button } from '../../../buttons';
|
|
4
|
-
import { Text } from '../../../typography';
|
|
5
|
-
import { Tooltip } from '../Tooltip';
|
|
6
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
figma.connect(Tooltip, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=715%3A14162', {
|
|
8
|
-
imports: ["import { Tooltip } from '@coinbase/cds-mobile/overlays'", "import { Button } from '@coinbase/cds-mobile/buttons/Button'"],
|
|
9
|
-
variant: {
|
|
10
|
-
type: 'body'
|
|
11
|
-
},
|
|
12
|
-
props: {
|
|
13
|
-
content: figma.nestedProps('string.tooltip', {
|
|
14
|
-
description: figma.enum('Ready-made', {
|
|
15
|
-
Custom: figma.string('description'),
|
|
16
|
-
Congestion: figma.textContent('body-option'),
|
|
17
|
-
'Crypto prices': figma.textContent('body-option'),
|
|
18
|
-
'Exchange rate': figma.textContent('body-option'),
|
|
19
|
-
'Gain/loss': figma.textContent('body-option'),
|
|
20
|
-
'Max slippage': figma.textContent('body-option'),
|
|
21
|
-
Network: figma.textContent('body-option'),
|
|
22
|
-
'Network fee': figma.textContent('body-option'),
|
|
23
|
-
'Trading activity': figma.textContent('body-option'),
|
|
24
|
-
'Transaction estimate': figma.textContent('body-option')
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
},
|
|
28
|
-
example: _ref => {
|
|
29
|
-
let {
|
|
30
|
-
content
|
|
31
|
-
} = _ref;
|
|
32
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
33
|
-
content: content.description,
|
|
34
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
35
|
-
children: "Default"
|
|
36
|
-
})
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
figma.connect(Tooltip, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=715%3A14162', {
|
|
41
|
-
imports: ["import { Tooltip } from '@coinbase/cds-mobile/overlays'", "import { Button } from '@coinbase/cds-mobile/buttons/Button'"],
|
|
42
|
-
variant: {
|
|
43
|
-
type: 'title + body'
|
|
44
|
-
},
|
|
45
|
-
props: {
|
|
46
|
-
content: figma.nestedProps('string.tooltip', {
|
|
47
|
-
title: figma.enum('Ready-made', {
|
|
48
|
-
Custom: figma.string('title'),
|
|
49
|
-
Congestion: figma.textContent('title-option'),
|
|
50
|
-
'Crypto prices': figma.textContent('title-option'),
|
|
51
|
-
'Exchange rate': figma.textContent('title-option'),
|
|
52
|
-
'Gain/loss': figma.textContent('title-option'),
|
|
53
|
-
'Max slippage': figma.textContent('title-option'),
|
|
54
|
-
Network: figma.textContent('title-option'),
|
|
55
|
-
'Network fee': figma.textContent('title-option'),
|
|
56
|
-
'Trading activity': figma.textContent('title-option'),
|
|
57
|
-
'Transaction estimate': figma.textContent('title-option')
|
|
58
|
-
}),
|
|
59
|
-
description: figma.enum('Ready-made', {
|
|
60
|
-
Custom: figma.string('description'),
|
|
61
|
-
Congestion: figma.textContent('body-option'),
|
|
62
|
-
'Crypto prices': figma.textContent('body-option'),
|
|
63
|
-
'Exchange rate': figma.textContent('body-option'),
|
|
64
|
-
'Gain/loss': figma.textContent('body-option'),
|
|
65
|
-
'Max slippage': figma.textContent('body-option'),
|
|
66
|
-
Network: figma.textContent('body-option'),
|
|
67
|
-
'Network fee': figma.textContent('body-option'),
|
|
68
|
-
'Trading activity': figma.textContent('body-option'),
|
|
69
|
-
'Transaction estimate': figma.textContent('body-option')
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
example: _ref2 => {
|
|
74
|
-
let {
|
|
75
|
-
content
|
|
76
|
-
} = _ref2;
|
|
77
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
78
|
-
content: /*#__PURE__*/_jsxs(_Fragment, {
|
|
79
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
80
|
-
font: "headline",
|
|
81
|
-
children: content.title
|
|
82
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
83
|
-
font: "body",
|
|
84
|
-
children: content.description
|
|
85
|
-
})]
|
|
86
|
-
}),
|
|
87
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
88
|
-
children: "Default"
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
});
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { figma } from '@figma/code-connect';
|
|
3
|
-
import { Button } from '../../../buttons/Button';
|
|
4
|
-
import { Box, VStack } from '../../../layout';
|
|
5
|
-
import { StickyFooter } from '../../../sticky-footer/StickyFooter';
|
|
6
|
-
import { Text } from '../../../typography/Text';
|
|
7
|
-
import { Tray } from '../Tray';
|
|
8
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
figma.connect(Tray, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=14729-33327&m=dev', {
|
|
10
|
-
imports: ["import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'", "import { StickyFooter } from '@coinbase/cds-mobile/sticky-footer/StickyFooter'"],
|
|
11
|
-
props: {
|
|
12
|
-
title: figma.boolean('show section header', {
|
|
13
|
-
true: figma.textContent('SectionHeader'),
|
|
14
|
-
false: undefined
|
|
15
|
-
}),
|
|
16
|
-
content: figma.children('.Select Option*')
|
|
17
|
-
},
|
|
18
|
-
example: function TrayExample(_ref) {
|
|
19
|
-
let {
|
|
20
|
-
content,
|
|
21
|
-
title
|
|
22
|
-
} = _ref;
|
|
23
|
-
const [isTrayVisible, setIsTrayVisible] = useState(false);
|
|
24
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
25
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
26
|
-
onPress: () => setIsTrayVisible(true),
|
|
27
|
-
children: "Open Tray"
|
|
28
|
-
}), isTrayVisible && /*#__PURE__*/_jsx(Tray, {
|
|
29
|
-
footer: _ref2 => {
|
|
30
|
-
let {
|
|
31
|
-
handleClose
|
|
32
|
-
} = _ref2;
|
|
33
|
-
return /*#__PURE__*/_jsx(StickyFooter, {
|
|
34
|
-
background: "bgElevation2",
|
|
35
|
-
paddingX: 3,
|
|
36
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
37
|
-
block: true,
|
|
38
|
-
onPress: handleClose,
|
|
39
|
-
children: "Close"
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
handleBarVariant: "inside",
|
|
44
|
-
onCloseComplete: () => setIsTrayVisible(false),
|
|
45
|
-
title: title,
|
|
46
|
-
children: /*#__PURE__*/_jsx(VStack, {
|
|
47
|
-
paddingX: 3,
|
|
48
|
-
children: content
|
|
49
|
-
})
|
|
50
|
-
})]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
figma.connect(Tray, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=14729-33472&m=dev', {
|
|
55
|
-
imports: ["import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'"],
|
|
56
|
-
props: {
|
|
57
|
-
pictogram: figma.boolean('show pictogram', {
|
|
58
|
-
true: figma.children('Spot Square/blockchain'),
|
|
59
|
-
false: undefined
|
|
60
|
-
}),
|
|
61
|
-
sectionTitle: figma.textContent('SectionHeader')
|
|
62
|
-
},
|
|
63
|
-
example: function TrayExample(_ref3) {
|
|
64
|
-
let {
|
|
65
|
-
pictogram,
|
|
66
|
-
sectionTitle
|
|
67
|
-
} = _ref3;
|
|
68
|
-
const [isTrayVisible, setIsTrayVisible] = useState(false);
|
|
69
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
70
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
71
|
-
onPress: () => setIsTrayVisible(true),
|
|
72
|
-
children: "Open Tray"
|
|
73
|
-
}), isTrayVisible && /*#__PURE__*/_jsx(Tray, {
|
|
74
|
-
accessibilityLabel: sectionTitle,
|
|
75
|
-
handleBarVariant: "inside",
|
|
76
|
-
onCloseComplete: () => setIsTrayVisible(false),
|
|
77
|
-
title: /*#__PURE__*/_jsxs(VStack, {
|
|
78
|
-
gap: 1.5,
|
|
79
|
-
children: [pictogram, /*#__PURE__*/_jsx(Text, {
|
|
80
|
-
font: "title3",
|
|
81
|
-
children: sectionTitle
|
|
82
|
-
})]
|
|
83
|
-
}),
|
|
84
|
-
children: /*#__PURE__*/_jsx(VStack, {
|
|
85
|
-
paddingX: 3,
|
|
86
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
87
|
-
color: "fgMuted",
|
|
88
|
-
font: "body",
|
|
89
|
-
paddingBottom: 2,
|
|
90
|
-
children: "Content goes here."
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
})]
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
figma.connect(Tray, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=14729-33505&m=dev', {
|
|
98
|
-
imports: ["import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'", "import { StickyFooter } from '@coinbase/cds-mobile/sticky-footer/StickyFooter'"],
|
|
99
|
-
props: {
|
|
100
|
-
spotRectangle: figma.instance('spot rectangle'),
|
|
101
|
-
title: figma.string('title'),
|
|
102
|
-
body: figma.string('body')
|
|
103
|
-
},
|
|
104
|
-
example: function TrayExample(_ref4) {
|
|
105
|
-
let {
|
|
106
|
-
spotRectangle,
|
|
107
|
-
title,
|
|
108
|
-
body
|
|
109
|
-
} = _ref4;
|
|
110
|
-
const [isTrayVisible, setIsTrayVisible] = useState(false);
|
|
111
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
112
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
113
|
-
onPress: () => setIsTrayVisible(true),
|
|
114
|
-
children: "Open Tray"
|
|
115
|
-
}), isTrayVisible && /*#__PURE__*/_jsx(Tray, {
|
|
116
|
-
accessibilityLabel: title,
|
|
117
|
-
footer: _ref5 => {
|
|
118
|
-
let {
|
|
119
|
-
handleClose
|
|
120
|
-
} = _ref5;
|
|
121
|
-
return /*#__PURE__*/_jsx(StickyFooter, {
|
|
122
|
-
background: "bgElevation2",
|
|
123
|
-
paddingX: 3,
|
|
124
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
125
|
-
block: true,
|
|
126
|
-
onPress: handleClose,
|
|
127
|
-
children: "Close"
|
|
128
|
-
})
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
handleBarVariant: "inside",
|
|
132
|
-
onCloseComplete: () => setIsTrayVisible(false),
|
|
133
|
-
children: /*#__PURE__*/_jsxs(VStack, {
|
|
134
|
-
paddingX: 3,
|
|
135
|
-
children: [/*#__PURE__*/_jsx(Box, {
|
|
136
|
-
alignItems: "center",
|
|
137
|
-
paddingBottom: 3,
|
|
138
|
-
children: spotRectangle
|
|
139
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
140
|
-
align: "center",
|
|
141
|
-
font: "title1",
|
|
142
|
-
paddingBottom: 2,
|
|
143
|
-
children: title
|
|
144
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
145
|
-
align: "center",
|
|
146
|
-
color: "fgMuted",
|
|
147
|
-
font: "body",
|
|
148
|
-
paddingBottom: 2,
|
|
149
|
-
children: body
|
|
150
|
-
})]
|
|
151
|
-
})
|
|
152
|
-
})]
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
figma.connect(Tray, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=14729-33538&m=dev', {
|
|
157
|
-
imports: ["import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'"],
|
|
158
|
-
props: {
|
|
159
|
-
children: figma.children('*')
|
|
160
|
-
},
|
|
161
|
-
example: function TrayExample(_ref6) {
|
|
162
|
-
let {
|
|
163
|
-
children
|
|
164
|
-
} = _ref6;
|
|
165
|
-
const [isTrayVisible, setIsTrayVisible] = useState(false);
|
|
166
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
167
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
168
|
-
onPress: () => setIsTrayVisible(true),
|
|
169
|
-
children: "Open Tray"
|
|
170
|
-
}), isTrayVisible && /*#__PURE__*/_jsx(Tray, {
|
|
171
|
-
handleBarVariant: "inside",
|
|
172
|
-
onCloseComplete: () => setIsTrayVisible(false),
|
|
173
|
-
title: "Title",
|
|
174
|
-
children: children
|
|
175
|
-
})]
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
figma.connect(Tray, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=14729-77780&m=dev', {
|
|
180
|
-
imports: ["import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'", "import { StickyFooter } from '@coinbase/cds-mobile/sticky-footer/StickyFooter'"],
|
|
181
|
-
props: {
|
|
182
|
-
content: figma.instance('content'),
|
|
183
|
-
title: figma.boolean('show section header', {
|
|
184
|
-
true: figma.textContent('SectionHeader'),
|
|
185
|
-
false: undefined
|
|
186
|
-
})
|
|
187
|
-
},
|
|
188
|
-
example: function TrayExample(_ref7) {
|
|
189
|
-
let {
|
|
190
|
-
content,
|
|
191
|
-
title
|
|
192
|
-
} = _ref7;
|
|
193
|
-
const [isTrayVisible, setIsTrayVisible] = useState(false);
|
|
194
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
195
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
196
|
-
onPress: () => setIsTrayVisible(true),
|
|
197
|
-
children: "Open Tray"
|
|
198
|
-
}), isTrayVisible && /*#__PURE__*/_jsx(Tray, {
|
|
199
|
-
footer: _ref8 => {
|
|
200
|
-
let {
|
|
201
|
-
handleClose
|
|
202
|
-
} = _ref8;
|
|
203
|
-
return /*#__PURE__*/_jsx(StickyFooter, {
|
|
204
|
-
background: "bgElevation2",
|
|
205
|
-
paddingX: 3,
|
|
206
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
207
|
-
block: true,
|
|
208
|
-
onPress: handleClose,
|
|
209
|
-
children: "Close"
|
|
210
|
-
})
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
handleBarVariant: "inside",
|
|
214
|
-
onCloseComplete: () => setIsTrayVisible(false),
|
|
215
|
-
title: title,
|
|
216
|
-
children: /*#__PURE__*/_jsx(VStack, {
|
|
217
|
-
paddingX: 3,
|
|
218
|
-
children: content
|
|
219
|
-
})
|
|
220
|
-
})]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { figma } from '@figma/code-connect';
|
|
3
|
-
import { Button } from '../../buttons/Button';
|
|
4
|
-
import { ButtonGroup } from '../../buttons/ButtonGroup';
|
|
5
|
-
import { PageFooter } from '../PageFooter';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const url = 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=17685%3A3266';
|
|
8
|
-
figma.connect(PageFooter, url, {
|
|
9
|
-
imports: ["import { PageFooter } from '@coinbase/cds-mobile/page/PageFooter'", "import { Button } from '@coinbase/cds-mobile/buttons/Button'"],
|
|
10
|
-
variant: {
|
|
11
|
-
'# of actions': '1'
|
|
12
|
-
},
|
|
13
|
-
props: {
|
|
14
|
-
legalText: figma.boolean('show legal text', {
|
|
15
|
-
true: 'Your legal text here.',
|
|
16
|
-
false: undefined
|
|
17
|
-
})
|
|
18
|
-
},
|
|
19
|
-
example: _ref => {
|
|
20
|
-
let {
|
|
21
|
-
legalText
|
|
22
|
-
} = _ref;
|
|
23
|
-
return /*#__PURE__*/_jsx(PageFooter, {
|
|
24
|
-
action: /*#__PURE__*/_jsx(Button, {
|
|
25
|
-
variant: "primary",
|
|
26
|
-
children: "Next"
|
|
27
|
-
}),
|
|
28
|
-
legalText: legalText
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
figma.connect(PageFooter, url, {
|
|
33
|
-
imports: ["import { PageFooter } from '@coinbase/cds-mobile/page/PageFooter'", "import { Button } from '@coinbase/cds-mobile/buttons/Button'", "import { ButtonGroup } from '@coinbase/cds-mobile/buttons/ButtonGroup'"],
|
|
34
|
-
variant: {
|
|
35
|
-
'# of actions': '2'
|
|
36
|
-
},
|
|
37
|
-
props: {
|
|
38
|
-
legalText: figma.boolean('show legal text', {
|
|
39
|
-
true: 'Your legal text here.',
|
|
40
|
-
false: undefined
|
|
41
|
-
})
|
|
42
|
-
},
|
|
43
|
-
example: _ref2 => {
|
|
44
|
-
let {
|
|
45
|
-
legalText
|
|
46
|
-
} = _ref2;
|
|
47
|
-
return /*#__PURE__*/_jsx(PageFooter, {
|
|
48
|
-
action: /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
49
|
-
block: true,
|
|
50
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
51
|
-
variant: "secondary",
|
|
52
|
-
children: "Back"
|
|
53
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
54
|
-
variant: "primary",
|
|
55
|
-
children: "Next"
|
|
56
|
-
})]
|
|
57
|
-
}),
|
|
58
|
-
legalText: legalText
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { figma } from '@figma/code-connect';
|
|
3
|
-
import { Button, IconButton } from '../../buttons';
|
|
4
|
-
import { HStack } from '../../layout';
|
|
5
|
-
import { PageHeader } from '../PageHeader';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
figma.connect(PageHeader, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=17685%3A3171', {
|
|
8
|
-
imports: ["import { PageHeader } from '@coinbase/cds-mobile/page/PageHeader'", "import { HStack } from '@coinbase/cds-mobile/layout/HStack'"],
|
|
9
|
-
props: {
|
|
10
|
-
start: figma.boolean('show start', {
|
|
11
|
-
true: figma.enum('type', {
|
|
12
|
-
L1: figma.children('Logo*'),
|
|
13
|
-
L2: /*#__PURE__*/_jsx(IconButton, {
|
|
14
|
-
compact: true,
|
|
15
|
-
name: "backArrow",
|
|
16
|
-
variant: "secondary"
|
|
17
|
-
})
|
|
18
|
-
}),
|
|
19
|
-
false: undefined
|
|
20
|
-
}),
|
|
21
|
-
title: figma.boolean('stepper', {
|
|
22
|
-
true: 'Stepper',
|
|
23
|
-
false: figma.boolean('show page title', {
|
|
24
|
-
true: 'Page title',
|
|
25
|
-
false: undefined
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
},
|
|
29
|
-
example: _ref => {
|
|
30
|
-
let {
|
|
31
|
-
title,
|
|
32
|
-
start
|
|
33
|
-
} = _ref;
|
|
34
|
-
return /*#__PURE__*/_jsx(PageHeader, {
|
|
35
|
-
end: /*#__PURE__*/_jsxs(HStack, {
|
|
36
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
37
|
-
compact: true,
|
|
38
|
-
transparent: true,
|
|
39
|
-
flush: "start",
|
|
40
|
-
variant: "primary",
|
|
41
|
-
children: "Button"
|
|
42
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
43
|
-
compact: true,
|
|
44
|
-
transparent: true,
|
|
45
|
-
name: "externalLink",
|
|
46
|
-
variant: "secondary"
|
|
47
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
48
|
-
compact: true,
|
|
49
|
-
transparent: true,
|
|
50
|
-
name: "close",
|
|
51
|
-
variant: "secondary"
|
|
52
|
-
})]
|
|
53
|
-
}),
|
|
54
|
-
start: start,
|
|
55
|
-
title: title
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,147 +0,0 @@
|
|
|
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
|
-
});
|