@coinbase/cds-mobile 8.61.0 → 8.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -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
package/esm/tag/Tag.js
CHANGED
|
@@ -3,13 +3,15 @@ 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 } from 'react';
|
|
5
5
|
import { tagBorderRadiusMap, tagEmphasisColorMap, tagFontMap, tagHorizontalSpacing } from '@coinbase/cds-common/tokens/tags';
|
|
6
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
6
7
|
import { useTheme } from '../hooks/useTheme';
|
|
7
8
|
import { Icon } from '../icons/Icon';
|
|
8
9
|
import { Box } from '../layout';
|
|
9
10
|
import { Text } from '../typography/Text';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
12
|
-
|
|
12
|
+
export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, forwardedRef) => {
|
|
13
|
+
const mergedProps = useComponentConfig('Tag', _props);
|
|
14
|
+
const {
|
|
13
15
|
children,
|
|
14
16
|
intent = 'informational',
|
|
15
17
|
emphasis = intent === 'informational' ? 'low' : 'high',
|
|
@@ -28,8 +30,8 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwardedRef
|
|
|
28
30
|
justifyContent = 'center',
|
|
29
31
|
paddingY = 0.25,
|
|
30
32
|
testID = 'cds-tag'
|
|
31
|
-
} =
|
|
32
|
-
props = _objectWithoutPropertiesLoose(
|
|
33
|
+
} = mergedProps,
|
|
34
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
33
35
|
const theme = useTheme();
|
|
34
36
|
const {
|
|
35
37
|
background,
|
package/esm/tour/Tour.js
CHANGED
|
@@ -6,6 +6,7 @@ import { TourContext } from '@coinbase/cds-common/tour/TourContext';
|
|
|
6
6
|
import { useTour } from '@coinbase/cds-common/tour/useTour';
|
|
7
7
|
import { arrow as arrowMiddleware, autoPlacement, offset, shift, useFloating } from '@floating-ui/react-native';
|
|
8
8
|
import { animated, config as springConfig, useSpring } from '@react-spring/native';
|
|
9
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
9
10
|
import { useTheme } from '../hooks/useTheme';
|
|
10
11
|
import { DefaultTourMask } from './DefaultTourMask';
|
|
11
12
|
import { DefaultTourStepArrow } from './DefaultTourStepArrow';
|
|
@@ -13,9 +14,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
14
|
const overlayContentContextValue = {
|
|
14
15
|
isTour: true
|
|
15
16
|
};
|
|
16
|
-
const TourComponent =
|
|
17
|
+
const TourComponent = _props => {
|
|
17
18
|
var _activeTourStep$Arrow, _activeTourStep$hideO, _activeTourStep$tourM, _activeTourStep$tourM2;
|
|
18
|
-
|
|
19
|
+
const mergedProps = useComponentConfig('Tour', _props);
|
|
20
|
+
const {
|
|
19
21
|
steps,
|
|
20
22
|
activeTourStep,
|
|
21
23
|
tourStepOffset = 24,
|
|
@@ -31,7 +33,7 @@ const TourComponent = _ref => {
|
|
|
31
33
|
accessibilityLabelledBy,
|
|
32
34
|
id,
|
|
33
35
|
testID
|
|
34
|
-
} =
|
|
36
|
+
} = mergedProps;
|
|
35
37
|
const theme = useTheme();
|
|
36
38
|
const defaultTourStepOffset = theme.space[3];
|
|
37
39
|
const defaultTourStepShiftPadding = theme.space[4];
|
package/esm/typography/Link.js
CHANGED
|
@@ -2,11 +2,13 @@ const _excluded = ["children", "to", "color", "font", "onPress", "forceOpenOutsi
|
|
|
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, { memo, useCallback } from 'react';
|
|
5
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
6
|
import { useWebBrowserOpener } from '../hooks/useWebBrowserOpener';
|
|
6
7
|
import { Text } from './Text';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
export const Link = /*#__PURE__*/memo(
|
|
9
|
-
|
|
9
|
+
export const Link = /*#__PURE__*/memo(_props => {
|
|
10
|
+
const mergedProps = useComponentConfig('Link', _props);
|
|
11
|
+
const {
|
|
10
12
|
children,
|
|
11
13
|
to,
|
|
12
14
|
color = 'fgPrimary',
|
|
@@ -18,8 +20,8 @@ export const Link = /*#__PURE__*/memo(_ref => {
|
|
|
18
20
|
underline,
|
|
19
21
|
accessibilityLabel,
|
|
20
22
|
testID
|
|
21
|
-
} =
|
|
22
|
-
props = _objectWithoutPropertiesLoose(
|
|
23
|
+
} = mergedProps,
|
|
24
|
+
props = _objectWithoutPropertiesLoose(mergedProps, _excluded);
|
|
23
25
|
const openUrl = useWebBrowserOpener();
|
|
24
26
|
const openUrlOnPress = useCallback(event => {
|
|
25
27
|
onPress == null || onPress(event);
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
/**
|
|
3
|
+
* The result of merging two sets of props
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Merges two sets of component props where source overrides target.
|
|
8
|
+
*
|
|
9
|
+
* This merge is shallow by design and applies to any BaseProps keys, not only
|
|
10
|
+
* style-like props. This allows component config defaults such as `compact`,
|
|
11
|
+
* `variant`, `height`, and `font` to flow through alongside style props.
|
|
12
|
+
*
|
|
13
|
+
* @param target - Base set of props (e.g., from component config defaults)
|
|
14
|
+
* @param source - Overriding set of props (e.g., from local component props)
|
|
15
|
+
* @returns Merged props with source values taking precedence
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const merged = mergeComponentProps(
|
|
20
|
+
* { compact: false, variant: 'secondary', height: 32, font: 'headline' },
|
|
21
|
+
* { compact: true, variant: 'primary' }
|
|
22
|
+
* );
|
|
23
|
+
* // Result: {
|
|
24
|
+
* // compact: true, // local override
|
|
25
|
+
* // variant: 'primary', // local override
|
|
26
|
+
* // height: 32, // preserved from defaults
|
|
27
|
+
* // font: 'headline' // preserved from defaults
|
|
28
|
+
* // }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function mergeComponentProps(target, source) {
|
|
32
|
+
if (!target) return source;
|
|
33
|
+
if (!source) return target;
|
|
34
|
+
return _extends({}, target, source);
|
|
35
|
+
}
|
|
@@ -4,11 +4,13 @@ import { Animated, I18nManager } from 'react-native';
|
|
|
4
4
|
import { animateProgressBaseSpec } from '@coinbase/cds-common/animation/progress';
|
|
5
5
|
import { getProgressSize } from '@coinbase/cds-common/visualizations/getProgressSize';
|
|
6
6
|
import { convertMotionConfig } from '../animation/convertMotionConfig';
|
|
7
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
7
8
|
import { useTheme } from '../hooks/useTheme';
|
|
8
9
|
import { Box, HStack } from '../layout';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
11
|
-
|
|
11
|
+
export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, forwardedRef) => {
|
|
12
|
+
const mergedProps = useComponentConfig('ProgressBar', _props);
|
|
13
|
+
const {
|
|
12
14
|
weight = 'normal',
|
|
13
15
|
progress = 0,
|
|
14
16
|
color = 'bgPrimary',
|
|
@@ -20,7 +22,7 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
20
22
|
styles,
|
|
21
23
|
onAnimationEnd,
|
|
22
24
|
onAnimationStart
|
|
23
|
-
} =
|
|
25
|
+
} = mergedProps;
|
|
24
26
|
const theme = useTheme();
|
|
25
27
|
const height = getProgressSize(weight);
|
|
26
28
|
const animatedProgress = useRef(new Animated.Value(disableAnimateOnMount ? progress : 0));
|
|
@@ -33,10 +35,10 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
33
35
|
toValue: progress
|
|
34
36
|
}, animateProgressBaseSpec, {
|
|
35
37
|
useNativeDriver: true
|
|
36
|
-
})))) == null || _Animated$timing.start(
|
|
38
|
+
})))) == null || _Animated$timing.start(_ref => {
|
|
37
39
|
let {
|
|
38
40
|
finished
|
|
39
|
-
} =
|
|
41
|
+
} = _ref;
|
|
40
42
|
if (finished) onAnimationEnd == null || onAnimationEnd();
|
|
41
43
|
});
|
|
42
44
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { I18nManager, View } from 'react-native';
|
|
3
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
3
4
|
import { Box, VStack } from '../layout';
|
|
4
5
|
import { getProgressBarLabelParts } from './getProgressBarLabelParts';
|
|
5
6
|
import { ProgressTextLabel } from './ProgressTextLabel';
|
|
@@ -92,8 +93,9 @@ const ProgressBarFixedLabelContainer = /*#__PURE__*/memo(_ref3 => {
|
|
|
92
93
|
children: nodes
|
|
93
94
|
});
|
|
94
95
|
});
|
|
95
|
-
export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(
|
|
96
|
-
|
|
96
|
+
export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_props => {
|
|
97
|
+
const mergedProps = useComponentConfig('ProgressBarWithFixedLabels', _props);
|
|
98
|
+
const {
|
|
97
99
|
startLabel,
|
|
98
100
|
endLabel,
|
|
99
101
|
labelPlacement = 'beside',
|
|
@@ -103,7 +105,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
103
105
|
testID,
|
|
104
106
|
style,
|
|
105
107
|
styles
|
|
106
|
-
} =
|
|
108
|
+
} = mergedProps;
|
|
107
109
|
const rootStyle = useMemo(() => [style, styles == null ? void 0 : styles.root], [style, styles == null ? void 0 : styles.root]);
|
|
108
110
|
const startLabelEl = typeof startLabel !== 'undefined' && /*#__PURE__*/_jsx(Box, {
|
|
109
111
|
flexGrow: 0,
|
|
@@ -3,6 +3,7 @@ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from '
|
|
|
3
3
|
import { Animated, I18nManager } from 'react-native';
|
|
4
4
|
import { animateProgressBaseSpec } from '@coinbase/cds-common/animation/progress';
|
|
5
5
|
import { convertMotionConfig } from '../animation/convertMotionConfig';
|
|
6
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
6
7
|
import { useLayout } from '../hooks/useLayout';
|
|
7
8
|
import { Box, VStack } from '../layout';
|
|
8
9
|
import { getProgressBarLabelParts } from './getProgressBarLabelParts';
|
|
@@ -76,8 +77,9 @@ const ProgressBarFloatLabel = /*#__PURE__*/memo(_ref => {
|
|
|
76
77
|
})
|
|
77
78
|
});
|
|
78
79
|
});
|
|
79
|
-
export const ProgressBarWithFloatLabel = /*#__PURE__*/memo(
|
|
80
|
-
|
|
80
|
+
export const ProgressBarWithFloatLabel = /*#__PURE__*/memo(_props => {
|
|
81
|
+
const mergedProps = useComponentConfig('ProgressBarWithFloatLabel', _props);
|
|
82
|
+
const {
|
|
81
83
|
label,
|
|
82
84
|
labelPlacement = 'above',
|
|
83
85
|
progress,
|
|
@@ -87,7 +89,7 @@ export const ProgressBarWithFloatLabel = /*#__PURE__*/memo(_ref2 => {
|
|
|
87
89
|
testID,
|
|
88
90
|
style,
|
|
89
91
|
styles
|
|
90
|
-
} =
|
|
92
|
+
} = mergedProps;
|
|
91
93
|
const rootStyle = useMemo(() => [style, styles == null ? void 0 : styles.root], [style, styles == null ? void 0 : styles.root]);
|
|
92
94
|
const progressBarFloatLabel = /*#__PURE__*/_jsx(ProgressBarFloatLabel, {
|
|
93
95
|
disableAnimateOnMount: disableAnimateOnMount,
|
|
@@ -8,6 +8,7 @@ import { getProgressCircleParams } from '@coinbase/cds-common/visualizations/get
|
|
|
8
8
|
import { getProgressSize } from '@coinbase/cds-common/visualizations/getProgressSize';
|
|
9
9
|
import { isTest } from '@coinbase/cds-utils';
|
|
10
10
|
import { convertMotionConfig } from '../animation/convertMotionConfig';
|
|
11
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
11
12
|
import { useTheme } from '../hooks/useTheme';
|
|
12
13
|
import { Box } from '../layout';
|
|
13
14
|
import { DefaultProgressCircleContent } from './DefaultProgressCircleContent';
|
|
@@ -58,8 +59,9 @@ const ProgressCircleInner = /*#__PURE__*/memo(_ref => {
|
|
|
58
59
|
stroke: !visuallyDisabled ? theme.color[color] : theme.color.bgLineHeavy
|
|
59
60
|
}), style || {}));
|
|
60
61
|
});
|
|
61
|
-
export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
62
|
-
|
|
62
|
+
export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, forwardedRef) => {
|
|
63
|
+
const mergedProps = useComponentConfig('ProgressCircle', _props);
|
|
64
|
+
const {
|
|
63
65
|
indeterminate,
|
|
64
66
|
weight = 'normal',
|
|
65
67
|
progress = indeterminate ? 0.75 : 0,
|
|
@@ -78,7 +80,7 @@ export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref3,
|
|
|
78
80
|
styles,
|
|
79
81
|
onAnimationEnd,
|
|
80
82
|
onAnimationStart
|
|
81
|
-
} =
|
|
83
|
+
} = mergedProps;
|
|
82
84
|
const theme = useTheme();
|
|
83
85
|
const strokeWidth = getProgressSize(weight);
|
|
84
86
|
const visSize = size != null ? size : '100%';
|
|
@@ -102,12 +104,12 @@ export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref3,
|
|
|
102
104
|
return /*#__PURE__*/_jsx(VisualizationContainer, {
|
|
103
105
|
height: visSize,
|
|
104
106
|
width: visSize,
|
|
105
|
-
children:
|
|
107
|
+
children: _ref3 => {
|
|
106
108
|
let {
|
|
107
109
|
width,
|
|
108
110
|
height,
|
|
109
111
|
circleSize
|
|
110
|
-
} =
|
|
112
|
+
} = _ref3;
|
|
111
113
|
return /*#__PURE__*/_jsxs(Box, {
|
|
112
114
|
ref: forwardedRef,
|
|
113
115
|
accessible: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.62.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"react-native-svg": "^14.1.0"
|
|
198
198
|
},
|
|
199
199
|
"dependencies": {
|
|
200
|
-
"@coinbase/cds-common": "^8.
|
|
200
|
+
"@coinbase/cds-common": "^8.62.0",
|
|
201
201
|
"@coinbase/cds-icons": "^5.13.0",
|
|
202
202
|
"@coinbase/cds-illustrations": "^4.36.0",
|
|
203
203
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
@@ -206,7 +206,8 @@
|
|
|
206
206
|
"@react-spring/native": "^9.7.4",
|
|
207
207
|
"fuse.js": "^7.1.0",
|
|
208
208
|
"lodash": "^4.17.21",
|
|
209
|
-
"type-fest": "^2.19.0"
|
|
209
|
+
"type-fest": "^2.19.0",
|
|
210
|
+
"zustand": "^5.0.12"
|
|
210
211
|
},
|
|
211
212
|
"devDependencies": {
|
|
212
213
|
"@babel/core": "^7.28.0",
|