@coinbase/cds-mobile 8.61.0 → 8.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -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/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 +6 -4
- package/esm/buttons/ButtonGroup.js +5 -3
- package/esm/buttons/IconButton.js +6 -4
- package/esm/buttons/IconCounterButton.js +6 -4
- package/esm/buttons/SlideButton.js +10 -8
- 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
|
@@ -4,11 +4,13 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
4
4
|
import React, { Children, isValidElement, useMemo } from 'react';
|
|
5
5
|
import { StyleSheet, Text } from 'react-native';
|
|
6
6
|
import { shapeBorderRadius } from '@coinbase/cds-common/tokens/borderRadius';
|
|
7
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
7
8
|
import { useTheme } from '../hooks/useTheme';
|
|
8
9
|
import { Box } from '../layout/Box';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export const RemoteImageGroup =
|
|
11
|
-
|
|
11
|
+
export const RemoteImageGroup = _props => {
|
|
12
|
+
const mergedProps = useComponentConfig('RemoteImageGroup', _props);
|
|
13
|
+
const {
|
|
12
14
|
children,
|
|
13
15
|
size = 'm',
|
|
14
16
|
max = 4,
|
|
@@ -16,8 +18,8 @@ export const RemoteImageGroup = _ref => {
|
|
|
16
18
|
testID,
|
|
17
19
|
borderWidth,
|
|
18
20
|
borderColor = borderWidth ? 'bg' : undefined
|
|
19
|
-
} =
|
|
20
|
-
props = _objectWithoutPropertiesLoose(
|
|
21
|
+
} = mergedProps,
|
|
22
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
21
23
|
const {
|
|
22
24
|
avatarSize,
|
|
23
25
|
fontFamily,
|
|
@@ -2,6 +2,7 @@ const _excluded = ["start", "end", "paddingX", "paddingTop", "paddingBottom", "g
|
|
|
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, { createContext, memo, useContext, useEffect, useState } from 'react';
|
|
5
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
6
|
import { HStack } from '../layout';
|
|
6
7
|
import { NavBarEnd, NavBarStart } from './TopNavBar';
|
|
7
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -21,8 +22,9 @@ export const useBrowserBarContext = () => {
|
|
|
21
22
|
}, [context.isWithinBrowserBar]);
|
|
22
23
|
return context;
|
|
23
24
|
};
|
|
24
|
-
export const BrowserBar = /*#__PURE__*/memo(
|
|
25
|
-
|
|
25
|
+
export const BrowserBar = /*#__PURE__*/memo(_props => {
|
|
26
|
+
const mergedProps = useComponentConfig('BrowserBar', _props);
|
|
27
|
+
const {
|
|
26
28
|
start,
|
|
27
29
|
end,
|
|
28
30
|
paddingX = 3,
|
|
@@ -31,8 +33,8 @@ export const BrowserBar = /*#__PURE__*/memo(_ref => {
|
|
|
31
33
|
gap = 1,
|
|
32
34
|
testID,
|
|
33
35
|
children
|
|
34
|
-
} =
|
|
35
|
-
props = _objectWithoutPropertiesLoose(
|
|
36
|
+
} = mergedProps,
|
|
37
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
36
38
|
const [hideStart, setHideStart] = useState(false);
|
|
37
39
|
const [hideEnd, setHideEnd] = useState(false);
|
|
38
40
|
return /*#__PURE__*/_jsx(BrowserBarContext.Provider, {
|
|
@@ -2,14 +2,16 @@ const _excluded = ["accessibilityRole", "font"];
|
|
|
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 { memo } from 'react';
|
|
5
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
6
|
import { Text } from '../typography/Text';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const NavigationTitle = /*#__PURE__*/memo(
|
|
8
|
-
|
|
8
|
+
export const NavigationTitle = /*#__PURE__*/memo(_props => {
|
|
9
|
+
const mergedProps = useComponentConfig('NavigationTitle', _props);
|
|
10
|
+
const {
|
|
9
11
|
accessibilityRole = 'header',
|
|
10
12
|
font = 'headline'
|
|
11
|
-
} =
|
|
12
|
-
props = _objectWithoutPropertiesLoose(
|
|
13
|
+
} = mergedProps,
|
|
14
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
13
15
|
return /*#__PURE__*/_jsx(Text, _extends({
|
|
14
16
|
accessibilityRole: accessibilityRole,
|
|
15
17
|
font: font
|
|
@@ -5,22 +5,24 @@ import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
|
5
5
|
import { SelectProvider } from '../controls/SelectContext';
|
|
6
6
|
import { SelectOption } from '../controls/SelectOption';
|
|
7
7
|
import { useSelect } from '../controls/useSelect';
|
|
8
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
8
9
|
import { Icon } from '../icons';
|
|
9
10
|
import { HStack } from '../layout/HStack';
|
|
10
11
|
import { Tray } from '../overlays';
|
|
11
12
|
import { Pressable } from '../system';
|
|
12
13
|
import { Text } from '../typography/Text';
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
export const NavigationTitleSelect = /*#__PURE__*/memo(
|
|
15
|
-
|
|
15
|
+
export const NavigationTitleSelect = /*#__PURE__*/memo(_props => {
|
|
16
|
+
const mergedProps = useComponentConfig('NavigationTitleSelect', _props);
|
|
17
|
+
const {
|
|
16
18
|
options,
|
|
17
19
|
value,
|
|
18
20
|
onChange,
|
|
19
21
|
color = 'fg',
|
|
20
22
|
font = 'headline',
|
|
21
23
|
accessibilityRole = 'header'
|
|
22
|
-
} =
|
|
23
|
-
props = _objectWithoutPropertiesLoose(
|
|
24
|
+
} = mergedProps,
|
|
25
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
24
26
|
const [visible, setVisible] = useState(false);
|
|
25
27
|
const trayRef = useRef(null);
|
|
26
28
|
const handleCloseMenu = useCallback(() => {
|
|
@@ -66,11 +68,11 @@ export const NavigationTitleSelect = /*#__PURE__*/memo(_ref => {
|
|
|
66
68
|
onCloseComplete: handleCloseMenu,
|
|
67
69
|
children: /*#__PURE__*/_jsx(SelectProvider, {
|
|
68
70
|
value: selectContextValue,
|
|
69
|
-
children: options.map(
|
|
71
|
+
children: options.map(_ref => {
|
|
70
72
|
let {
|
|
71
73
|
id,
|
|
72
74
|
label
|
|
73
|
-
} =
|
|
75
|
+
} = _ref;
|
|
74
76
|
return /*#__PURE__*/_jsx(SelectOption, {
|
|
75
77
|
onPress: handleOptionPress,
|
|
76
78
|
title: label,
|
|
@@ -6,6 +6,7 @@ import React, { memo } from 'react';
|
|
|
6
6
|
import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
|
|
7
7
|
import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
8
8
|
import { Collapsible } from '../collapsible/Collapsible';
|
|
9
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
9
10
|
import { HStack, VStack } from '../layout';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export const TopNavBarContext = /*#__PURE__*/React.createContext({
|
|
@@ -75,8 +76,9 @@ export const NavBarEnd = /*#__PURE__*/memo(_ref2 => {
|
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
78
|
NavBarEnd.displayName = 'NavBarEnd';
|
|
78
|
-
export const TopNavBar = /*#__PURE__*/memo(
|
|
79
|
-
|
|
79
|
+
export const TopNavBar = /*#__PURE__*/memo(_props => {
|
|
80
|
+
const mergedProps = useComponentConfig('TopNavBar', _props);
|
|
81
|
+
const {
|
|
80
82
|
start,
|
|
81
83
|
end,
|
|
82
84
|
children,
|
|
@@ -87,7 +89,7 @@ export const TopNavBar = /*#__PURE__*/memo(_ref3 => {
|
|
|
87
89
|
paddingX = 3,
|
|
88
90
|
paddingTop = 2,
|
|
89
91
|
paddingBottom = bottom ? undefined : 2
|
|
90
|
-
} =
|
|
92
|
+
} = mergedProps;
|
|
91
93
|
return /*#__PURE__*/_jsx(TopNavBarContext.Provider, {
|
|
92
94
|
value: {
|
|
93
95
|
isWithinTopNavBar: true
|
|
@@ -8,6 +8,7 @@ import { curves, durations } from '@coinbase/cds-common/motion/tokens';
|
|
|
8
8
|
import { IntlNumberFormat } from '@coinbase/cds-common/numbers/IntlNumberFormat';
|
|
9
9
|
import { useValueChangeDirection } from '@coinbase/cds-common/numbers/useValueChangeDirection';
|
|
10
10
|
import { useLocale } from '@coinbase/cds-common/system/LocaleProvider';
|
|
11
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
12
|
import { HStack } from '../../layout/HStack';
|
|
12
13
|
import { Text } from '../../typography/Text';
|
|
13
14
|
import { DefaultRollingNumberAffixSection } from './DefaultRollingNumberAffixSection';
|
|
@@ -68,8 +69,9 @@ export const defaultTransitionConfig = {
|
|
|
68
69
|
|
|
69
70
|
// Subcomponent prop and component type declarations
|
|
70
71
|
|
|
71
|
-
export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
72
|
-
|
|
72
|
+
export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
73
|
+
const mergedProps = useComponentConfig('RollingNumber', _props);
|
|
74
|
+
const {
|
|
73
75
|
value,
|
|
74
76
|
color: colorProp = 'fg',
|
|
75
77
|
colorPulseOnUpdate,
|
|
@@ -102,8 +104,8 @@ export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, re
|
|
|
102
104
|
RollingNumberValueSectionComponent = DefaultRollingNumberValueSection,
|
|
103
105
|
RollingNumberDigitComponent = DefaultRollingNumberDigit,
|
|
104
106
|
RollingNumberSymbolComponent = DefaultRollingNumberSymbol
|
|
105
|
-
} =
|
|
106
|
-
restTextProps = _objectWithoutPropertiesLoose(
|
|
107
|
+
} = mergedProps,
|
|
108
|
+
restTextProps = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
107
109
|
const {
|
|
108
110
|
locale: defaultLocale
|
|
109
111
|
} = useLocale();
|
package/esm/numpad/Numpad.js
CHANGED
|
@@ -3,6 +3,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { forwardRef, memo, useCallback, useMemo } from 'react';
|
|
5
5
|
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
6
7
|
import { useTheme } from '../hooks/useTheme';
|
|
7
8
|
import { Icon } from '../icons';
|
|
8
9
|
import { HStack, VStack } from '../layout';
|
|
@@ -25,8 +26,9 @@ const styles = StyleSheet.create({
|
|
|
25
26
|
width: '33.3333333%'
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
|
-
export const Numpad = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
29
|
-
|
|
29
|
+
export const Numpad = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, forwardedRef) => {
|
|
30
|
+
const mergedProps = useComponentConfig('Numpad', _props);
|
|
31
|
+
const {
|
|
30
32
|
separator = '.',
|
|
31
33
|
disabled,
|
|
32
34
|
onPress,
|
|
@@ -41,8 +43,8 @@ export const Numpad = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Numpad(
|
|
|
41
43
|
flexShrink = 0,
|
|
42
44
|
gap = 2,
|
|
43
45
|
feedback
|
|
44
|
-
} =
|
|
45
|
-
props = _objectWithoutPropertiesLoose(
|
|
46
|
+
} = mergedProps,
|
|
47
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
46
48
|
const buttons = useMemo(() => {
|
|
47
49
|
return buttonValues.map((values, i) => {
|
|
48
50
|
return /*#__PURE__*/_jsx(HStack, {
|
|
@@ -80,7 +82,7 @@ export const Numpad = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Numpad(
|
|
|
80
82
|
}), action]
|
|
81
83
|
}));
|
|
82
84
|
}));
|
|
83
|
-
const NumpadButton = /*#__PURE__*/memo(function NumpadButton(
|
|
85
|
+
const NumpadButton = /*#__PURE__*/memo(function NumpadButton(_ref) {
|
|
84
86
|
let {
|
|
85
87
|
value,
|
|
86
88
|
onPress,
|
|
@@ -90,7 +92,7 @@ const NumpadButton = /*#__PURE__*/memo(function NumpadButton(_ref2) {
|
|
|
90
92
|
separatorAccessibilityLabel,
|
|
91
93
|
deleteAccessibilityLabel,
|
|
92
94
|
feedback
|
|
93
|
-
} =
|
|
95
|
+
} = _ref;
|
|
94
96
|
const theme = useTheme();
|
|
95
97
|
const content = useMemo(() => {
|
|
96
98
|
if (value === 'DELETE') {
|
package/esm/overlays/Alert.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
2
2
|
import { Modal as RNModal } from 'react-native';
|
|
3
3
|
import { Button } from '../buttons';
|
|
4
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
4
5
|
import { Pictogram } from '../illustrations';
|
|
5
6
|
import { Box } from '../layout';
|
|
6
7
|
import { Text } from '../typography/Text';
|
|
7
8
|
import { Overlay } from './overlay/Overlay';
|
|
8
9
|
import { useAlertAnimation } from './useAlertAnimation';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
11
|
-
|
|
11
|
+
export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
12
|
+
const mergedProps = useComponentConfig('Alert', _props);
|
|
13
|
+
const {
|
|
12
14
|
title,
|
|
13
15
|
body,
|
|
14
16
|
pictogram,
|
|
@@ -21,7 +23,7 @@ export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
21
23
|
onDismissActionPress,
|
|
22
24
|
testID,
|
|
23
25
|
actionLayout = 'horizontal'
|
|
24
|
-
} =
|
|
26
|
+
} = mergedProps;
|
|
25
27
|
const [{
|
|
26
28
|
modalOpacity,
|
|
27
29
|
modalScale,
|
|
@@ -33,10 +35,10 @@ export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
33
35
|
}
|
|
34
36
|
}, [visible, animateIn]);
|
|
35
37
|
const handleClose = useCallback(() => {
|
|
36
|
-
animateOut.start(
|
|
38
|
+
animateOut.start(_ref => {
|
|
37
39
|
let {
|
|
38
40
|
finished
|
|
39
|
-
} =
|
|
41
|
+
} = _ref;
|
|
40
42
|
if (finished) {
|
|
41
43
|
onRequestClose == null || onRequestClose();
|
|
42
44
|
}
|
package/esm/overlays/Toast.js
CHANGED
|
@@ -5,6 +5,7 @@ import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle }
|
|
|
5
5
|
import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
6
6
|
import { Button } from '../buttons';
|
|
7
7
|
import { useA11y } from '../hooks/useA11y';
|
|
8
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
8
9
|
import { useTheme } from '../hooks/useTheme';
|
|
9
10
|
import { Box, HStack } from '../layout';
|
|
10
11
|
import { ColorSurge } from '../motion/ColorSurge';
|
|
@@ -12,9 +13,10 @@ import { Text } from '../typography/Text';
|
|
|
12
13
|
import { useToastAnimation } from './useToastAnimation';
|
|
13
14
|
import { useToastPanResponder } from './useToastPanResponder';
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
16
|
+
export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
16
17
|
var _action$testID;
|
|
17
|
-
|
|
18
|
+
const mergedProps = useComponentConfig('Toast', _props);
|
|
19
|
+
const {
|
|
18
20
|
text,
|
|
19
21
|
action,
|
|
20
22
|
onWillHide,
|
|
@@ -22,8 +24,8 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
22
24
|
bottomOffset,
|
|
23
25
|
variant,
|
|
24
26
|
accessibilityLabel
|
|
25
|
-
} =
|
|
26
|
-
props = _objectWithoutPropertiesLoose(
|
|
27
|
+
} = mergedProps,
|
|
28
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
27
29
|
const theme = useTheme();
|
|
28
30
|
const [{
|
|
29
31
|
opacity,
|
|
@@ -34,10 +36,10 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
34
36
|
} = useA11y();
|
|
35
37
|
const defaultA11yLabel = text + (action ? action.label : '');
|
|
36
38
|
useEffect(() => {
|
|
37
|
-
animateIn.start(
|
|
39
|
+
animateIn.start(_ref => {
|
|
38
40
|
let {
|
|
39
41
|
finished
|
|
40
|
-
} =
|
|
42
|
+
} = _ref;
|
|
41
43
|
if (finished) {
|
|
42
44
|
// announce toast copy and action label to screen reader
|
|
43
45
|
announceForA11y(accessibilityLabel != null ? accessibilityLabel : defaultA11yLabel);
|
|
@@ -47,10 +49,10 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
47
49
|
const handleClose = useCallback(async () => {
|
|
48
50
|
onWillHide == null || onWillHide();
|
|
49
51
|
return new Promise(resolve => {
|
|
50
|
-
animateOut.start(
|
|
52
|
+
animateOut.start(_ref2 => {
|
|
51
53
|
let {
|
|
52
54
|
finished
|
|
53
|
-
} =
|
|
55
|
+
} = _ref2;
|
|
54
56
|
if (finished) {
|
|
55
57
|
onDidHide == null || onDidHide();
|
|
56
58
|
resolve(finished);
|
|
@@ -6,6 +6,7 @@ import { Animated, Keyboard, Modal, Platform, useWindowDimensions } from 'react-
|
|
|
6
6
|
import { drawerAnimationDefaultDuration, MAX_OVER_DRAG } from '@coinbase/cds-common/animation/drawer';
|
|
7
7
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
8
8
|
import { horizontalDrawerPercentageOfView, verticalDrawerPercentageOfView as defaultVerticalDrawerPercentageOfView } from '@coinbase/cds-common/tokens/drawer';
|
|
9
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
9
10
|
import { useTheme } from '../../hooks/useTheme';
|
|
10
11
|
import { Box } from '../../layout/Box';
|
|
11
12
|
import { HandleBar } from '../handlebar/HandleBar';
|
|
@@ -19,8 +20,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
20
|
const overlayContentContextValue = {
|
|
20
21
|
isDrawer: true
|
|
21
22
|
};
|
|
22
|
-
export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
23
|
-
|
|
23
|
+
export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
24
|
+
const mergedProps = useComponentConfig('Drawer', _props);
|
|
25
|
+
const {
|
|
24
26
|
children,
|
|
25
27
|
pin = 'bottom',
|
|
26
28
|
onCloseComplete,
|
|
@@ -41,8 +43,8 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
41
43
|
accessibilityRole = 'alert',
|
|
42
44
|
animationType = 'none',
|
|
43
45
|
disableSafeAreaPaddingBottom
|
|
44
|
-
} =
|
|
45
|
-
props = _objectWithoutPropertiesLoose(
|
|
46
|
+
} = mergedProps,
|
|
47
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
46
48
|
const theme = useTheme();
|
|
47
49
|
const {
|
|
48
50
|
width,
|
|
@@ -61,10 +63,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
61
63
|
const paddingStyles = useDrawerSpacing(pin, disableSafeAreaPaddingBottom);
|
|
62
64
|
const isMounted = useRef(false);
|
|
63
65
|
const handleClose = useCallback(() => {
|
|
64
|
-
Animated.parallel([animateDrawerOut, animateOverlayOut]).start(
|
|
66
|
+
Animated.parallel([animateDrawerOut, animateOverlayOut]).start(_ref => {
|
|
65
67
|
let {
|
|
66
68
|
finished
|
|
67
|
-
} =
|
|
69
|
+
} = _ref;
|
|
68
70
|
if (finished) {
|
|
69
71
|
isMounted.current = false;
|
|
70
72
|
onCloseComplete == null || onCloseComplete();
|
|
@@ -74,10 +76,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
74
76
|
const handleRequestClose = useCallback(() => preventHardwareBackBehaviorAndroid && isAndroid ? undefined : handleClose(), [preventHardwareBackBehaviorAndroid, handleClose, isAndroid]);
|
|
75
77
|
const handleSwipeToClose = useCallback(() => {
|
|
76
78
|
if (!preventDismissGestures) {
|
|
77
|
-
Animated.parallel([animateSwipeToClose, animateOverlayOut]).start(
|
|
79
|
+
Animated.parallel([animateSwipeToClose, animateOverlayOut]).start(_ref2 => {
|
|
78
80
|
let {
|
|
79
81
|
finished
|
|
80
|
-
} =
|
|
82
|
+
} = _ref2;
|
|
81
83
|
if (finished) {
|
|
82
84
|
isMounted.current = false;
|
|
83
85
|
onCloseComplete == null || onCloseComplete();
|
|
@@ -87,10 +89,10 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
87
89
|
}, [preventDismissGestures, animateSwipeToClose, animateOverlayOut, onCloseComplete]);
|
|
88
90
|
useEffect(() => {
|
|
89
91
|
if (!isMounted.current) {
|
|
90
|
-
Animated.parallel([animateOverlayIn, animateDrawerIn]).start(
|
|
92
|
+
Animated.parallel([animateOverlayIn, animateDrawerIn]).start(_ref3 => {
|
|
91
93
|
let {
|
|
92
94
|
finished
|
|
93
|
-
} =
|
|
95
|
+
} = _ref3;
|
|
94
96
|
if (finished) {
|
|
95
97
|
isMounted.current = true;
|
|
96
98
|
onOpenComplete == null || onOpenComplete();
|
|
@@ -6,13 +6,16 @@ import { Modal as RNModal, Platform, SafeAreaView, StatusBar, StyleSheet } from
|
|
|
6
6
|
import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
|
|
7
7
|
import { ModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
8
8
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
9
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
9
10
|
import { VStack } from '../../layout';
|
|
10
11
|
import { useModalAnimation } from './useModalAnimation';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
const overlayContentContextValue = {
|
|
13
14
|
isModal: true
|
|
14
15
|
};
|
|
15
|
-
export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
16
|
+
export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
17
|
+
const mergedProps = useComponentConfig('Modal', _props);
|
|
18
|
+
const props = mergedProps;
|
|
16
19
|
const {
|
|
17
20
|
children,
|
|
18
21
|
visible,
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
const _excluded = ["children", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React, { useMemo } from 'react';
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
5
|
import { KeyboardAvoidingView, ScrollView } from 'react-native';
|
|
6
6
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
7
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
7
8
|
import { useContentSize } from '../../hooks/useContentSize';
|
|
8
9
|
import { useLayout } from '../../hooks/useLayout';
|
|
9
10
|
import { Box } from '../../layout/Box';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
export const ModalBody =
|
|
12
|
-
|
|
12
|
+
export const ModalBody = /*#__PURE__*/memo(_props => {
|
|
13
|
+
const mergedProps = useComponentConfig('ModalBody', _props);
|
|
14
|
+
const {
|
|
13
15
|
children,
|
|
14
16
|
padding,
|
|
15
17
|
paddingX = 3,
|
|
@@ -18,8 +20,8 @@ export const ModalBody = _ref => {
|
|
|
18
20
|
paddingBottom,
|
|
19
21
|
paddingStart,
|
|
20
22
|
paddingEnd
|
|
21
|
-
} =
|
|
22
|
-
props = _objectWithoutPropertiesLoose(
|
|
23
|
+
} = mergedProps,
|
|
24
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
23
25
|
const [{
|
|
24
26
|
height: contentHeight
|
|
25
27
|
}, onContentSizeChange] = useContentSize();
|
|
@@ -61,4 +63,4 @@ export const ModalBody = _ref => {
|
|
|
61
63
|
})
|
|
62
64
|
}))
|
|
63
65
|
});
|
|
64
|
-
};
|
|
66
|
+
});
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
const _excluded = ["primaryAction", "secondaryAction", "direction", "paddingX", "paddingY"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React, { Fragment } from 'react';
|
|
4
|
+
import React, { Fragment, memo } from 'react';
|
|
5
5
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
6
6
|
import { ButtonGroup } from '../../buttons/ButtonGroup';
|
|
7
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
7
8
|
import { Box } from '../../layout/Box';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const ModalFooter =
|
|
10
|
-
|
|
10
|
+
export const ModalFooter = /*#__PURE__*/memo(_props => {
|
|
11
|
+
const mergedProps = useComponentConfig('ModalFooter', _props);
|
|
12
|
+
const {
|
|
11
13
|
primaryAction,
|
|
12
14
|
secondaryAction,
|
|
13
15
|
direction = 'horizontal',
|
|
14
16
|
paddingX = 3,
|
|
15
17
|
paddingY = 2
|
|
16
|
-
} =
|
|
17
|
-
props = _objectWithoutPropertiesLoose(
|
|
18
|
+
} = mergedProps,
|
|
19
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
18
20
|
const {
|
|
19
21
|
hideDividers = false
|
|
20
22
|
} = useModalContext();
|
|
@@ -41,4 +43,4 @@ export const ModalFooter = _ref => {
|
|
|
41
43
|
}, i))
|
|
42
44
|
})
|
|
43
45
|
}));
|
|
44
|
-
};
|
|
46
|
+
});
|
|
@@ -4,12 +4,14 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
6
6
|
import { IconButton } from '../../buttons';
|
|
7
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
7
8
|
import { Box } from '../../layout/Box';
|
|
8
9
|
import { HStack } from '../../layout/HStack';
|
|
9
10
|
import { Text } from '../../typography/Text';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export const ModalHeader =
|
|
12
|
-
|
|
12
|
+
export const ModalHeader = _props => {
|
|
13
|
+
const mergedProps = useComponentConfig('ModalHeader', _props);
|
|
14
|
+
const {
|
|
13
15
|
alignItems = 'center',
|
|
14
16
|
paddingX = 3,
|
|
15
17
|
paddingY = 2,
|
|
@@ -19,8 +21,8 @@ export const ModalHeader = _ref => {
|
|
|
19
21
|
backAccessibilityHint,
|
|
20
22
|
closeAccessibilityLabel,
|
|
21
23
|
closeAccessibilityHint
|
|
22
|
-
} =
|
|
23
|
-
props = _objectWithoutPropertiesLoose(
|
|
24
|
+
} = mergedProps,
|
|
25
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
24
26
|
const {
|
|
25
27
|
onRequestClose,
|
|
26
28
|
hideCloseButton,
|
|
@@ -3,18 +3,20 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { memo } from 'react';
|
|
5
5
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
6
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
6
7
|
import { useTheme } from '../../hooks/useTheme';
|
|
7
8
|
import { VStack } from '../../layout/VStack';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
const overlayContentContextValue = {
|
|
10
11
|
isOverlay: true
|
|
11
12
|
};
|
|
12
|
-
export const Overlay = /*#__PURE__*/memo(
|
|
13
|
+
export const Overlay = /*#__PURE__*/memo(_props => {
|
|
13
14
|
var _theme$darkSpectrum;
|
|
14
|
-
|
|
15
|
+
const mergedProps = useComponentConfig('Overlay', _props);
|
|
16
|
+
const {
|
|
15
17
|
opacity
|
|
16
|
-
} =
|
|
17
|
-
props = _objectWithoutPropertiesLoose(
|
|
18
|
+
} = mergedProps,
|
|
19
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
18
20
|
const theme = useTheme();
|
|
19
21
|
return /*#__PURE__*/_jsx(OverlayContentContext.Provider, {
|
|
20
22
|
value: overlayContentContextValue,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { Fragment, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { Modal as RNModal, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
4
5
|
import { InvertedThemeProvider } from '../../system/ThemeProvider';
|
|
5
6
|
import { InternalTooltip } from './InternalTooltip';
|
|
6
7
|
import { useTooltipAnimation } from './useTooltipAnimation';
|
|
7
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
export const Tooltip = /*#__PURE__*/memo(
|
|
9
|
-
|
|
9
|
+
export const Tooltip = /*#__PURE__*/memo(_props => {
|
|
10
|
+
const mergedProps = useComponentConfig('Tooltip', _props);
|
|
11
|
+
const {
|
|
10
12
|
children,
|
|
11
13
|
content,
|
|
12
14
|
placement = 'top',
|
|
@@ -25,7 +27,7 @@ export const Tooltip = /*#__PURE__*/memo(_ref => {
|
|
|
25
27
|
elevation,
|
|
26
28
|
openDelay,
|
|
27
29
|
closeDelay
|
|
28
|
-
} =
|
|
30
|
+
} = mergedProps;
|
|
29
31
|
const subjectRef = useRef(null);
|
|
30
32
|
const [isOpen, setIsOpen] = useState(false);
|
|
31
33
|
const isVisible = visible !== false && isOpen;
|
|
@@ -6,6 +6,7 @@ import React, { createContext, forwardRef, memo, useCallback, useContext, useEff
|
|
|
6
6
|
import { useWindowDimensions } from 'react-native';
|
|
7
7
|
import { MAX_OVER_DRAG } from '@coinbase/cds-common/animation/drawer';
|
|
8
8
|
import { verticalDrawerPercentageOfView as defaultVerticalDrawerPercentageOfView } from '@coinbase/cds-common/tokens/drawer';
|
|
9
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
9
10
|
import { Box, VStack } from '../../layout';
|
|
10
11
|
import { Text } from '../../typography/Text';
|
|
11
12
|
import { Drawer } from '../drawer/Drawer';
|
|
@@ -14,8 +15,9 @@ export const TrayContext = /*#__PURE__*/createContext({
|
|
|
14
15
|
verticalDrawerPercentageOfView: defaultVerticalDrawerPercentageOfView,
|
|
15
16
|
titleHeight: 0
|
|
16
17
|
});
|
|
17
|
-
export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(
|
|
18
|
-
|
|
18
|
+
export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_props, ref) {
|
|
19
|
+
const mergedProps = useComponentConfig('Tray', _props);
|
|
20
|
+
const {
|
|
19
21
|
children,
|
|
20
22
|
title,
|
|
21
23
|
header,
|
|
@@ -25,8 +27,8 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
25
27
|
handleBarVariant = 'outside',
|
|
26
28
|
verticalDrawerPercentageOfView = defaultVerticalDrawerPercentageOfView,
|
|
27
29
|
styles
|
|
28
|
-
} =
|
|
29
|
-
props = _objectWithoutPropertiesLoose(
|
|
30
|
+
} = mergedProps,
|
|
31
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
30
32
|
const [titleHeight, setTitleHeight] = useState(0);
|
|
31
33
|
const isInsideHandleBar = handleBarVariant === 'inside';
|
|
32
34
|
const isTitleString = typeof title === 'string';
|
|
@@ -36,13 +38,13 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
36
38
|
titleStyle,
|
|
37
39
|
drawerStyles
|
|
38
40
|
} = useMemo(() => {
|
|
39
|
-
const
|
|
41
|
+
const _ref = styles != null ? styles : {},
|
|
40
42
|
{
|
|
41
43
|
content: contentStyle,
|
|
42
44
|
header: headerStyle,
|
|
43
45
|
title: titleStyle
|
|
44
|
-
} =
|
|
45
|
-
drawerStyles = _objectWithoutPropertiesLoose(
|
|
46
|
+
} = _ref,
|
|
47
|
+
drawerStyles = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
46
48
|
return {
|
|
47
49
|
contentStyle,
|
|
48
50
|
headerStyle,
|
|
@@ -54,10 +56,10 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
54
56
|
if (!title) return;
|
|
55
57
|
setTitleHeight(event.nativeEvent.layout.height);
|
|
56
58
|
}, [title]);
|
|
57
|
-
const renderChildren = useCallback(
|
|
59
|
+
const renderChildren = useCallback(_ref2 => {
|
|
58
60
|
let {
|
|
59
61
|
handleClose
|
|
60
|
-
} =
|
|
62
|
+
} = _ref2;
|
|
61
63
|
const content = typeof children === 'function' ? children({
|
|
62
64
|
handleClose
|
|
63
65
|
}) : children;
|
|
@@ -125,10 +127,10 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
125
127
|
* @deprecated Redundant component. This will be removed in a future major release.
|
|
126
128
|
* @deprecationExpectedRemoval v9
|
|
127
129
|
*/
|
|
128
|
-
export const TrayStickyFooter =
|
|
130
|
+
export const TrayStickyFooter = _ref3 => {
|
|
129
131
|
let {
|
|
130
132
|
children
|
|
131
|
-
} =
|
|
133
|
+
} = _ref3;
|
|
132
134
|
const {
|
|
133
135
|
verticalDrawerPercentageOfView,
|
|
134
136
|
titleHeight
|