@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
package/esm/dates/DatePicker.js
CHANGED
|
@@ -4,14 +4,16 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
4
4
|
import { forwardRef, memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { Button } from '../buttons/Button';
|
|
6
6
|
import { InputIconButton } from '../controls/InputIconButton';
|
|
7
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
7
8
|
import { Box, VStack } from '../layout';
|
|
8
9
|
import { Tray } from '../overlays/tray/Tray';
|
|
9
10
|
import { StickyFooter } from '../sticky-footer/StickyFooter';
|
|
10
11
|
import { Calendar } from './Calendar';
|
|
11
12
|
import { DateInput } from './DateInput';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
export const DatePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
14
|
-
|
|
14
|
+
export const DatePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
15
|
+
const mergedProps = useComponentConfig('DatePicker', _props);
|
|
16
|
+
const {
|
|
15
17
|
date,
|
|
16
18
|
styles,
|
|
17
19
|
highlightedDates,
|
|
@@ -49,14 +51,15 @@ export const DatePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref)
|
|
|
49
51
|
onConfirm,
|
|
50
52
|
onCancel,
|
|
51
53
|
onChange
|
|
52
|
-
} =
|
|
53
|
-
props = _objectWithoutPropertiesLoose(
|
|
54
|
+
} = mergedProps,
|
|
55
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
54
56
|
const [showPicker, setShowPicker] = useState(false);
|
|
55
57
|
const [calendarSelectedDate, setCalendarSelectedDate] = useState(null);
|
|
56
58
|
const dateInputRef = useRef(null);
|
|
57
59
|
const calendarButtonRef = useRef(null);
|
|
58
60
|
const calendarRef = useRef(null);
|
|
59
61
|
const closedByConfirmRef = useRef(false);
|
|
62
|
+
|
|
60
63
|
/**
|
|
61
64
|
* Be careful to preserve the correct event orders
|
|
62
65
|
* 1. Selecting a date with the picker: onOpen -> onConfirm -> onChangeDate -> onErrorDate -> onClose
|
|
@@ -139,10 +142,10 @@ export const DatePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref)
|
|
|
139
142
|
variant: variant
|
|
140
143
|
})), showPicker && /*#__PURE__*/_jsx(Tray, {
|
|
141
144
|
accessibilityRole: "none",
|
|
142
|
-
footer:
|
|
145
|
+
footer: _ref => {
|
|
143
146
|
let {
|
|
144
147
|
handleClose
|
|
145
|
-
} =
|
|
148
|
+
} = _ref;
|
|
146
149
|
return /*#__PURE__*/_jsx(StickyFooter, {
|
|
147
150
|
paddingTop: 3,
|
|
148
151
|
paddingX: 3,
|
package/esm/dots/DotCount.js
CHANGED
|
@@ -7,6 +7,7 @@ import Animated, { runOnJS, useAnimatedReaction, useAnimatedStyle, useSharedValu
|
|
|
7
7
|
import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
|
|
8
8
|
import { dotOpacityEnterConfig, dotOpacityExitConfig, dotScaleEnterConfig, dotScaleExitConfig } from '@coinbase/cds-common/motion/dot';
|
|
9
9
|
import { dotCountSize } from '@coinbase/cds-common/tokens/dot';
|
|
10
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
10
11
|
import { useDotPinStyles } from '../hooks/useDotPinStyles';
|
|
11
12
|
import { useTheme } from '../hooks/useTheme';
|
|
12
13
|
import { convertMotionConfigs } from '../motion/convertMotionConfig';
|
|
@@ -30,8 +31,9 @@ const dotTextPaddingHorizontal = 6;
|
|
|
30
31
|
const variantColorMap = {
|
|
31
32
|
negative: 'bgNegative'
|
|
32
33
|
};
|
|
33
|
-
export const DotCount = /*#__PURE__*/memo(
|
|
34
|
-
|
|
34
|
+
export const DotCount = /*#__PURE__*/memo(_props => {
|
|
35
|
+
const mergedProps = useComponentConfig('DotCount', _props);
|
|
36
|
+
const {
|
|
35
37
|
children,
|
|
36
38
|
pin,
|
|
37
39
|
variant = 'negative',
|
|
@@ -40,8 +42,8 @@ export const DotCount = /*#__PURE__*/memo(_ref => {
|
|
|
40
42
|
overlap,
|
|
41
43
|
style,
|
|
42
44
|
styles
|
|
43
|
-
} =
|
|
44
|
-
props = _objectWithoutPropertiesLoose(
|
|
45
|
+
} = mergedProps,
|
|
46
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
45
47
|
const theme = useTheme();
|
|
46
48
|
const [childrenSize, onChildrenLayout] = useDotsLayout();
|
|
47
49
|
const transforms = useDotPinStyles(childrenSize, {
|
|
@@ -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, { memo, useMemo } from 'react';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
6
7
|
import { useDotPinStyles } from '../hooks/useDotPinStyles';
|
|
7
8
|
import { useTheme } from '../hooks/useTheme';
|
|
8
9
|
import { getTransform } from './dotStyles';
|
|
@@ -15,15 +16,16 @@ const variantColorMap = {
|
|
|
15
16
|
warning: 'bgWarning',
|
|
16
17
|
negative: 'bgNegative'
|
|
17
18
|
};
|
|
18
|
-
export const DotStatusColor = /*#__PURE__*/memo(
|
|
19
|
-
|
|
19
|
+
export const DotStatusColor = /*#__PURE__*/memo(_props => {
|
|
20
|
+
const mergedProps = useComponentConfig('DotStatusColor', _props);
|
|
21
|
+
const {
|
|
20
22
|
variant,
|
|
21
23
|
pin,
|
|
22
24
|
size = 's',
|
|
23
25
|
children,
|
|
24
26
|
overlap
|
|
25
|
-
} =
|
|
26
|
-
props = _objectWithoutPropertiesLoose(
|
|
27
|
+
} = mergedProps,
|
|
28
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
27
29
|
const theme = useTheme();
|
|
28
30
|
const iconSize = theme.iconSize[size];
|
|
29
31
|
const [childrenSize, onLayout] = useDotsLayout();
|
package/esm/dots/DotSymbol.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, { memo, useMemo } from 'react';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
6
7
|
import { useDotPinStyles } from '../hooks/useDotPinStyles';
|
|
7
8
|
import { useTheme } from '../hooks/useTheme';
|
|
8
9
|
import { Icon } from '../icons/Icon';
|
|
@@ -11,8 +12,9 @@ import { RemoteImage } from '../media/RemoteImage';
|
|
|
11
12
|
import { getTransform } from './dotStyles';
|
|
12
13
|
import { useDotsLayout } from './useDotsLayout';
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
export const DotSymbol = /*#__PURE__*/memo(
|
|
15
|
-
|
|
15
|
+
export const DotSymbol = /*#__PURE__*/memo(_props => {
|
|
16
|
+
const mergedProps = useComponentConfig('DotSymbol', _props);
|
|
17
|
+
const {
|
|
16
18
|
children,
|
|
17
19
|
symbol,
|
|
18
20
|
pin,
|
|
@@ -27,8 +29,8 @@ export const DotSymbol = /*#__PURE__*/memo(_ref => {
|
|
|
27
29
|
style,
|
|
28
30
|
iconStyle,
|
|
29
31
|
imageStyle
|
|
30
|
-
} =
|
|
31
|
-
props = _objectWithoutPropertiesLoose(
|
|
32
|
+
} = mergedProps,
|
|
33
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
32
34
|
const theme = useTheme();
|
|
33
35
|
const iconSize = theme.iconSize[size];
|
|
34
36
|
const [childrenSize, onChildrenLayout] = useDotsLayout();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useStore } from 'zustand';
|
|
2
|
+
import { useComponentConfigStore } from '../system/ComponentConfigProvider';
|
|
3
|
+
import { mergeComponentProps } from '../utils/mergeComponentProps';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Subscribes to the component config for a specific component via zustand selectors.
|
|
7
|
+
* Only triggers re-renders when the config for THIS component changes - other
|
|
8
|
+
* components' config changes are ignored.
|
|
9
|
+
*
|
|
10
|
+
* Raw config values are stored in the zustand store (not normalized to functions)
|
|
11
|
+
* so that Object.is reference comparisons work correctly and unchanged entries
|
|
12
|
+
* never cause re-renders.
|
|
13
|
+
*
|
|
14
|
+
* @param componentName - The component key in ComponentConfig (e.g., 'Button')
|
|
15
|
+
* @param localProps - The props passed directly to the component instance
|
|
16
|
+
* @returns Merged props with config defaults applied (local props take precedence)
|
|
17
|
+
*/
|
|
18
|
+
export const useComponentConfig = (componentName, localProps) => {
|
|
19
|
+
const store = useComponentConfigStore();
|
|
20
|
+
const rawConfig = useStore(store, state => {
|
|
21
|
+
var _state$components;
|
|
22
|
+
return (_state$components = state.components) == null ? void 0 : _state$components[componentName];
|
|
23
|
+
});
|
|
24
|
+
if (!rawConfig) return localProps;
|
|
25
|
+
const resolvedConfig = typeof rawConfig === 'function' ? rawConfig(localProps) : rawConfig;
|
|
26
|
+
return mergeComponentProps(resolvedConfig, localProps);
|
|
27
|
+
};
|
package/esm/icons/Icon.js
CHANGED
|
@@ -2,6 +2,7 @@ import React, { memo, useMemo } from 'react';
|
|
|
2
2
|
import { Animated, Text, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { glyphMap } from '@coinbase/cds-icons/glyphMap';
|
|
4
4
|
import { isDevelopment } from '@coinbase/cds-utils';
|
|
5
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
6
|
import { useTheme } from '../hooks/useTheme';
|
|
6
7
|
import { Box } from '../layout/Box';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -10,8 +11,9 @@ const getIconSourceSize = iconSize => {
|
|
|
10
11
|
if (iconSize <= 16) return 16;
|
|
11
12
|
return 24;
|
|
12
13
|
};
|
|
13
|
-
export const Icon = /*#__PURE__*/memo(
|
|
14
|
-
|
|
14
|
+
export const Icon = /*#__PURE__*/memo(_props => {
|
|
15
|
+
const mergedProps = useComponentConfig('Icon', _props);
|
|
16
|
+
const {
|
|
15
17
|
accessibilityLabel,
|
|
16
18
|
accessibilityHint,
|
|
17
19
|
animated = false,
|
|
@@ -31,7 +33,7 @@ export const Icon = /*#__PURE__*/memo(function Icon(_ref) {
|
|
|
31
33
|
paddingBottom,
|
|
32
34
|
paddingStart,
|
|
33
35
|
active
|
|
34
|
-
} =
|
|
36
|
+
} = mergedProps;
|
|
35
37
|
const TextComponent = animated ? Animated.Text : Text;
|
|
36
38
|
const theme = useTheme();
|
|
37
39
|
const {
|
|
@@ -44,12 +46,12 @@ export const Icon = /*#__PURE__*/memo(function Icon(_ref) {
|
|
|
44
46
|
const iconColor = theme.color[color];
|
|
45
47
|
const finalColor = dangerouslySetColor != null ? dangerouslySetColor : iconColor;
|
|
46
48
|
const rootStyle = useMemo(() => {
|
|
47
|
-
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8
|
|
49
|
+
var _ref, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
|
|
48
50
|
return [{
|
|
49
|
-
paddingTop: theme.space[(
|
|
50
|
-
paddingEnd: theme.space[(
|
|
51
|
-
paddingBottom: theme.space[(
|
|
52
|
-
paddingStart: theme.space[(
|
|
51
|
+
paddingTop: theme.space[(_ref = (_ref2 = paddingTop != null ? paddingTop : paddingY) != null ? _ref2 : padding) != null ? _ref : 0],
|
|
52
|
+
paddingEnd: theme.space[(_ref3 = (_ref4 = paddingEnd != null ? paddingEnd : paddingX) != null ? _ref4 : padding) != null ? _ref3 : 0],
|
|
53
|
+
paddingBottom: theme.space[(_ref5 = (_ref6 = paddingBottom != null ? paddingBottom : paddingY) != null ? _ref6 : padding) != null ? _ref5 : 0],
|
|
54
|
+
paddingStart: theme.space[(_ref7 = (_ref8 = paddingStart != null ? paddingStart : paddingX) != null ? _ref8 : padding) != null ? _ref7 : 0]
|
|
53
55
|
}, style, styles == null ? void 0 : styles.root];
|
|
54
56
|
}, [style, theme.space, padding, paddingX, paddingY, paddingTop, paddingEnd, paddingBottom, paddingStart, styles == null ? void 0 : styles.root]);
|
|
55
57
|
const iconStyle = useMemo(() => [{
|
package/esm/index.js
CHANGED
package/esm/layout/Divider.js
CHANGED
|
@@ -3,15 +3,17 @@ 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 { memo, 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 { Box } from './Box';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const Divider = /*#__PURE__*/memo(
|
|
10
|
-
|
|
10
|
+
export const Divider = /*#__PURE__*/memo(_props => {
|
|
11
|
+
const mergedProps = useComponentConfig('Divider', _props);
|
|
12
|
+
const {
|
|
11
13
|
color = 'bgLine',
|
|
12
14
|
direction = 'horizontal'
|
|
13
|
-
} =
|
|
14
|
-
boxProps = _objectWithoutPropertiesLoose(
|
|
15
|
+
} = mergedProps,
|
|
16
|
+
boxProps = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
15
17
|
const theme = useTheme();
|
|
16
18
|
const style = useMemo(() => [styles[direction], {
|
|
17
19
|
backgroundColor: theme.color[color]
|
package/esm/layout/Fallback.js
CHANGED
|
@@ -6,20 +6,22 @@ import React, { memo, useEffect, useMemo, useRef } from 'react';
|
|
|
6
6
|
import { Animated, StyleSheet, Text, View } from 'react-native';
|
|
7
7
|
import { useFallbackShape } from '@coinbase/cds-common/hooks/useFallbackShape';
|
|
8
8
|
import { LinearGradient } from '../gradients/LinearGradient';
|
|
9
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
9
10
|
import { useTheme } from '../hooks/useTheme';
|
|
10
11
|
import { fallbackShimmer } from '../styles/fallbackShimmer';
|
|
11
12
|
import { Box } from './Box';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
export const Fallback = /*#__PURE__*/memo(
|
|
14
|
-
|
|
14
|
+
export const Fallback = /*#__PURE__*/memo(_props => {
|
|
15
|
+
const mergedProps = useComponentConfig('Fallback', _props);
|
|
16
|
+
const {
|
|
15
17
|
height,
|
|
16
18
|
shape = 'rectangle',
|
|
17
19
|
width: baseWidth,
|
|
18
20
|
disableRandomRectWidth,
|
|
19
21
|
rectWidthVariant,
|
|
20
22
|
accessibilityLabel = 'Loading'
|
|
21
|
-
} =
|
|
22
|
-
props = _objectWithoutPropertiesLoose(
|
|
23
|
+
} = mergedProps,
|
|
24
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
23
25
|
const fallbackShapeOptions = useMemo(() => ({
|
|
24
26
|
disableRandomRectWidth,
|
|
25
27
|
rectWidthVariant
|
package/esm/media/Avatar.js
CHANGED
|
@@ -5,6 +5,7 @@ import React, { memo, useMemo } from 'react';
|
|
|
5
5
|
import { StyleSheet } from 'react-native';
|
|
6
6
|
import { colorSchemeMap } from '@coinbase/cds-common/tokens/avatar';
|
|
7
7
|
import { getAccessibleColor } from '@coinbase/cds-common/utils/getAccessibleColor';
|
|
8
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
8
9
|
import { useTheme } from '../hooks/useTheme';
|
|
9
10
|
import { Box } from '../layout/Box';
|
|
10
11
|
import { Text } from '../typography/Text';
|
|
@@ -14,8 +15,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
15
|
const smallAvatarSize = 44;
|
|
15
16
|
export const coloredFallbackTestID = 'cds-avatar-colored-fallback';
|
|
16
17
|
export const fallbackImageSrc = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAOAA4AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+t80Zo4o4oAM0ZrsPBvw7m8Sxi7uZDa2GcKwHzyeu30HvXdf8Kp0Dytnlz7v+ennHP8Ah+lAHiuaM12XjL4dTeG4jd2sjXViDhiR88f1x1HvXG8UAGaKOKKADI9Kkt4vtFxFEOC7Bc/U4qPJ9KVXZGDLwwOQaAPpS0tY7G1ht4VCRRKEVcdABipc1meG9eh8RaRBeRMNzACRB1R+4/z2rU/OgCK5t47y3lgmUPFKpR1I6gjBr5uu4fst1NCefLdkz64OK+g/EWuQ+HtJnvJmHyjCIerv2Ar55klaWRnblmJJPqaAG5HpRRk+lFABzVnTtOutWvY7W0iMs8hwqj+Z9BVbB9a9o+GXhlNI0VL2VR9rvFD5PVY/4R+PX8vSgCfwX4EXwsDNJdSTXTrh1RisQ/Dv9T+QrrP89aT8qPyoA5Txr4FHilRNHdSQ3Ua4RHYtEfw7fUfrXjOo6dc6Tey2t3EYp4zgqf5j1FfSP5VxvxN8Mpq+jPfRKPtlmpfI6tH/ABD8Ov5+tAHi/NFGDRQBY060+3aja22f9dKsf5kD+tfSKIsaKigKqjAAHAFFFAC/j+lL+P6UUUAH4/pTXRZEZGG5WGCCOooooA+btRtPsOoXVtn/AFMrR/kSKKKKAP/Z';
|
|
17
|
-
export const Avatar = /*#__PURE__*/memo(
|
|
18
|
-
|
|
18
|
+
export const Avatar = /*#__PURE__*/memo(_props => {
|
|
19
|
+
const mergedProps = useComponentConfig('Avatar', _props);
|
|
20
|
+
const {
|
|
19
21
|
alt,
|
|
20
22
|
src,
|
|
21
23
|
shape = 'circle',
|
|
@@ -27,8 +29,8 @@ export const Avatar = /*#__PURE__*/memo(_ref => {
|
|
|
27
29
|
name,
|
|
28
30
|
accessibilityLabel,
|
|
29
31
|
style
|
|
30
|
-
} =
|
|
31
|
-
props = _objectWithoutPropertiesLoose(
|
|
32
|
+
} = mergedProps,
|
|
33
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
32
34
|
const imgSrc = src != null ? src : fallbackImageSrc;
|
|
33
35
|
const shapeStyle = shapeStyles[shape];
|
|
34
36
|
const theme = useTheme();
|
package/esm/media/RemoteImage.js
CHANGED
|
@@ -6,6 +6,7 @@ import React, { memo, useMemo } from 'react';
|
|
|
6
6
|
import { Image } from 'react-native';
|
|
7
7
|
import { ClipPath, Defs, Image as SvgImage, Path, Svg, SvgXml } from 'react-native-svg';
|
|
8
8
|
import { SvgCssUri } from 'react-native-svg/css';
|
|
9
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
9
10
|
import { useTheme } from '../hooks/useTheme';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
function getSource(source, cachePolicy) {
|
|
@@ -57,9 +58,10 @@ const shapeBorderRadius = {
|
|
|
57
58
|
rectangle: 0,
|
|
58
59
|
hexagon: 0
|
|
59
60
|
};
|
|
60
|
-
export const RemoteImage = /*#__PURE__*/memo(function RemoteImage(
|
|
61
|
+
export const RemoteImage = /*#__PURE__*/memo(function RemoteImage(_props) {
|
|
61
62
|
var _props$accessible;
|
|
62
|
-
|
|
63
|
+
const mergedProps = useComponentConfig('RemoteImage', _props);
|
|
64
|
+
const {
|
|
63
65
|
width,
|
|
64
66
|
height,
|
|
65
67
|
aspectRatio,
|
|
@@ -75,8 +77,8 @@ export const RemoteImage = /*#__PURE__*/memo(function RemoteImage(_ref2) {
|
|
|
75
77
|
onLoad,
|
|
76
78
|
fallbackAccessibilityLabel,
|
|
77
79
|
fallbackAccessibilityHint
|
|
78
|
-
} =
|
|
79
|
-
props = _objectWithoutPropertiesLoose(
|
|
80
|
+
} = mergedProps,
|
|
81
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded2);
|
|
80
82
|
const shapeRadius = shapeBorderRadius[shape];
|
|
81
83
|
const {
|
|
82
84
|
activeColorScheme,
|
|
@@ -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
|
}
|