@coinbase/cds-mobile 8.35.0 → 8.36.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 +10 -0
- package/dts/visualizations/DefaultProgressCircleContent.d.ts +1 -0
- package/dts/visualizations/DefaultProgressCircleContent.d.ts.map +1 -1
- package/dts/visualizations/ProgressBar.d.ts +0 -2
- package/dts/visualizations/ProgressBar.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts +13 -6
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts +2 -2
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts.map +1 -1
- package/dts/visualizations/ProgressCircle.d.ts +4 -1
- package/dts/visualizations/ProgressCircle.d.ts.map +1 -1
- package/dts/visualizations/ProgressTextLabel.d.ts +5 -1
- package/dts/visualizations/ProgressTextLabel.d.ts.map +1 -1
- package/esm/visualizations/DefaultProgressCircleContent.js +2 -0
- package/esm/visualizations/ProgressBar.js +2 -2
- package/esm/visualizations/ProgressBarWithFixedLabels.js +12 -0
- package/esm/visualizations/ProgressBarWithFloatLabel.js +23 -15
- package/esm/visualizations/ProgressCircle.js +8 -3
- package/esm/visualizations/ProgressTextLabel.js +2 -1
- package/esm/visualizations/__stories__/ProgressBar.stories.js +52 -9
- package/esm/visualizations/__stories__/ProgressCircle.stories.js +14 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.36.0 ((1/6/2026, 01:00 PM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.35.1 (1/5/2026 PST)
|
|
16
|
+
|
|
17
|
+
#### 🐞 Fixes
|
|
18
|
+
|
|
19
|
+
- Fix disableAnimateOnMount for progress components. [[#284](https://github.com/coinbase/cds/pull/284)]
|
|
20
|
+
|
|
11
21
|
## 8.35.0 (1/5/2026 PST)
|
|
12
22
|
|
|
13
23
|
#### 🚀 Updates
|
|
@@ -2,6 +2,7 @@ import type { ProgressCircleContentProps } from './ProgressCircle';
|
|
|
2
2
|
export declare const DefaultProgressCircleContent: import('react').MemoExoticComponent<
|
|
3
3
|
({
|
|
4
4
|
progress,
|
|
5
|
+
disableAnimateOnMount,
|
|
5
6
|
disabled,
|
|
6
7
|
color,
|
|
7
8
|
}: ProgressCircleContentProps) => import('react/jsx-runtime').JSX.Element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultProgressCircleContent.d.ts","sourceRoot":"","sources":["../../src/visualizations/DefaultProgressCircleContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAGnE,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"DefaultProgressCircleContent.d.ts","sourceRoot":"","sources":["../../src/visualizations/DefaultProgressCircleContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAGnE,eAAO,MAAM,4BAA4B,8FAMpC,0BAA0B,6CAY9B,CAAC"}
|
|
@@ -14,7 +14,6 @@ export type ProgressBaseProps = SharedProps &
|
|
|
14
14
|
weight?: Weight;
|
|
15
15
|
/**
|
|
16
16
|
* Toggle used to show a disabled progress visualization
|
|
17
|
-
* @default false
|
|
18
17
|
*/
|
|
19
18
|
disabled?: boolean;
|
|
20
19
|
/**
|
|
@@ -63,7 +62,6 @@ export declare const ProgressBar: React.MemoExoticComponent<
|
|
|
63
62
|
weight?: Weight;
|
|
64
63
|
/**
|
|
65
64
|
* Toggle used to show a disabled progress visualization
|
|
66
|
-
* @default false
|
|
67
65
|
*/
|
|
68
66
|
disabled?: boolean;
|
|
69
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AACnG,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAMhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,GAClD,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GAAG;IACrD,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;SAEK;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AACnG,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAMhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,GAClD,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GAAG;IACrD,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;SAEK;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B;;WAEG;QACH,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,WAAW;IA7CpB,8DAA8D;cACpD,MAAM;IAChB;;SAEK;aACI,MAAM;IACf;;OAEG;eACQ,OAAO;IAClB;;;OAGG;YACK,SAAS,CAAC,KAAK;IACvB;;OAEG;qBACc,MAAM,IAAI;IAC3B;;OAEG;uBACgB,MAAM,IAAI;;IAI/B;;OAEG;YACK,SAAS,CAAC,SAAS,CAAC;IAC5B;;OAEG;aACM;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B;;WAEG;QACH,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC;+BAwHF,CAAC"}
|
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { PaddingProps, Placement } from '@coinbase/cds-common/types';
|
|
4
4
|
import { type ProgressBarLabel } from './getProgressBarLabelParts';
|
|
5
|
-
import { type
|
|
6
|
-
export type ProgressBarWithFixedLabelsProps = Pick<
|
|
5
|
+
import { type ProgressBarProps } from './ProgressBar';
|
|
6
|
+
export type ProgressBarWithFixedLabelsProps = Pick<
|
|
7
|
+
ProgressBarProps,
|
|
8
|
+
'disableAnimateOnMount' | 'disabled' | 'testID'
|
|
9
|
+
> & {
|
|
7
10
|
/** Label that is pinned to the start of the container. If a number is used then it will format it as a percentage. */
|
|
8
11
|
startLabel?: ProgressBarLabel;
|
|
9
12
|
/** Label that is pinned to the end of the container. If a number is used then it will format it as a percentage. */
|
|
@@ -39,10 +42,12 @@ export type ProgressBarWithFixedLabelsProps = Pick<ProgressBaseProps, 'disabled'
|
|
|
39
42
|
endLabel?: StyleProp<TextStyle>;
|
|
40
43
|
};
|
|
41
44
|
};
|
|
42
|
-
export type ProgressBarFixedLabelBesideProps =
|
|
45
|
+
export type ProgressBarFixedLabelBesideProps = Pick<
|
|
46
|
+
ProgressBarProps,
|
|
47
|
+
'disableAnimateOnMount' | 'style'
|
|
48
|
+
> & {
|
|
43
49
|
label: ProgressBarLabel;
|
|
44
50
|
visuallyDisabled: boolean;
|
|
45
|
-
style?: StyleProp<ViewStyle>;
|
|
46
51
|
};
|
|
47
52
|
export type ProgressBarFixedLabelContainerProps = Omit<
|
|
48
53
|
ProgressBarWithFixedLabelsProps,
|
|
@@ -51,11 +56,13 @@ export type ProgressBarFixedLabelContainerProps = Omit<
|
|
|
51
56
|
Pick<PaddingProps, 'paddingBottom' | 'paddingTop'> & {
|
|
52
57
|
visuallyDisabled: boolean;
|
|
53
58
|
};
|
|
54
|
-
export type ProgressBarFixedLabelProps =
|
|
59
|
+
export type ProgressBarFixedLabelProps = Pick<
|
|
60
|
+
ProgressBarProps,
|
|
61
|
+
'disableAnimateOnMount' | 'style'
|
|
62
|
+
> & {
|
|
55
63
|
position: 'start' | 'end';
|
|
56
64
|
label: ProgressBarLabel;
|
|
57
65
|
visuallyDisabled: boolean;
|
|
58
|
-
style?: StyleProp<ViewStyle>;
|
|
59
66
|
};
|
|
60
67
|
export declare const ProgressBarWithFixedLabels: React.FC<
|
|
61
68
|
React.PropsWithChildren<ProgressBarWithFixedLabelsProps>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarWithFixedLabels.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBarWithFixedLabels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAI1E,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ProgressBarWithFixedLabels.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBarWithFixedLabels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAI1E,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,gBAAgB,EAChB,uBAAuB,GAAG,UAAU,GAAG,QAAQ,CAChD,GAAG;IACF,sHAAsH;IACtH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oHAAoH;IACpH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;SAGK;IACL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el } from './getProgressBarLabelParts';
|
|
|
5
5
|
import { type ProgressBaseProps } from './ProgressBar';
|
|
6
6
|
export type ProgressBarFloatLabelProps = Pick<
|
|
7
7
|
ProgressBarWithFloatLabelProps,
|
|
8
|
-
'label' | 'progress' | 'disabled' | 'labelPlacement' | 'styles'
|
|
8
|
+
'label' | 'progress' | 'disableAnimateOnMount' | 'disabled' | 'labelPlacement' | 'styles'
|
|
9
9
|
>;
|
|
10
10
|
export type ProgressBarWithFloatLabelProps = Pick<
|
|
11
11
|
ProgressBaseProps,
|
|
12
|
-
'progress' | 'disabled' | 'testID'
|
|
12
|
+
'progress' | 'disableAnimateOnMount' | 'disabled' | 'testID'
|
|
13
13
|
> & {
|
|
14
14
|
/** Label that is floated at the end of the filled in bar. If a number is used then it will format it as a percentage. */
|
|
15
15
|
label: ProgressBarLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarWithFloatLabel.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBarWithFloatLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProgressBarWithFloatLabel.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBarWithFloatLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAM5D,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,8BAA8B,EAC9B,OAAO,GAAG,UAAU,GAAG,uBAAuB,GAAG,UAAU,GAAG,gBAAgB,GAAG,QAAQ,CAC1F,CAAC;AA2GF,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,iBAAiB,EACjB,UAAU,GAAG,uBAAuB,GAAG,UAAU,GAAG,QAAQ,CAC7D,GAAG;IACF,yHAAyH;IACzH,KAAK,EAAE,gBAAgB,CAAC;IACxB;;;SAGK;IACL,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;IACvD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B;;WAEG;QACH,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACtC;;WAEG;QACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC9C,KAAK,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAkCxD,CAAC"}
|
|
@@ -61,7 +61,10 @@ export type ProgressCircleProps = ProgressCircleBaseProps & {
|
|
|
61
61
|
circle?: Partial<CircleProps>;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
export type ProgressCircleContentProps = Pick<
|
|
64
|
+
export type ProgressCircleContentProps = Pick<
|
|
65
|
+
ProgressCircleBaseProps,
|
|
66
|
+
'progress' | 'disableAnimateOnMount' | 'disabled'
|
|
67
|
+
> &
|
|
65
68
|
BoxProps & {
|
|
66
69
|
/**
|
|
67
70
|
* Custom text color.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressCircle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,I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AC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,uBAAuB,EACvB,UAAU,GAAG,uBAAuB,GAAG,UAAU,CAClD,GACC,QAAQ,GAAG;IACT;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;CACzB,CAAC;AAoEJ,eAAO,MAAM,cAAc;;;;;;;;IAxIzB;;OAEG;kBACW,OAAO;IACrB;;;OAGG;eACQ,OAAO;IAClB;;;;;OAKG;WACI,MAAM;IACb;;OAEG;kBACW,KAAK,CAAC,SAAS;;IAI7B;;OAEG;YACK,SAAS,CAAC,SAAS,CAAC;IAC5B;;OAEG;aACM;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B;;WAEG;QACH,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC;;WAEG;QACH,GAAG,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC3B;;WAEG;QACH,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACrC;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QAChC;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;KAC/B;+BAyMF,CAAC"}
|
|
@@ -2,7 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { type StyleProp, type TextStyle } from 'react-native';
|
|
3
3
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
4
4
|
import type { ProgressBaseProps } from './ProgressBar';
|
|
5
|
-
export type ProgressTextLabelProps = Pick<
|
|
5
|
+
export type ProgressTextLabelProps = Pick<
|
|
6
|
+
ProgressBaseProps,
|
|
7
|
+
'disableAnimateOnMount' | 'disabled'
|
|
8
|
+
> & {
|
|
6
9
|
value: number;
|
|
7
10
|
renderLabel?: (num: number, disabled?: boolean) => React.ReactNode;
|
|
8
11
|
color?: ThemeVars.Color;
|
|
@@ -15,6 +18,7 @@ export declare const ProgressTextLabel: React.MemoExoticComponent<
|
|
|
15
18
|
({
|
|
16
19
|
value,
|
|
17
20
|
renderLabel,
|
|
21
|
+
disableAnimateOnMount,
|
|
18
22
|
disabled,
|
|
19
23
|
color,
|
|
20
24
|
style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressTextLabel.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressTextLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ProgressTextLabel.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressTextLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,iBAAiB,EACjB,uBAAuB,GAAG,UAAU,CACrC,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,qGAQzB,sBAAsB,6CA2C1B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
export const DefaultProgressCircleContent = /*#__PURE__*/memo(_ref => {
|
|
6
6
|
let {
|
|
7
7
|
progress,
|
|
8
|
+
disableAnimateOnMount,
|
|
8
9
|
disabled,
|
|
9
10
|
color = 'fgMuted'
|
|
10
11
|
} = _ref;
|
|
@@ -14,6 +15,7 @@ export const DefaultProgressCircleContent = /*#__PURE__*/memo(_ref => {
|
|
|
14
15
|
flexShrink: 0,
|
|
15
16
|
children: /*#__PURE__*/_jsx(ProgressTextLabel, {
|
|
16
17
|
color: color,
|
|
18
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
17
19
|
disabled: disabled,
|
|
18
20
|
value: Math.round(progress * 100)
|
|
19
21
|
})
|
|
@@ -14,8 +14,8 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
14
14
|
weight = 'normal',
|
|
15
15
|
progress,
|
|
16
16
|
color = 'bgPrimary',
|
|
17
|
-
disabled
|
|
18
|
-
disableAnimateOnMount
|
|
17
|
+
disabled,
|
|
18
|
+
disableAnimateOnMount,
|
|
19
19
|
testID,
|
|
20
20
|
accessibilityLabel,
|
|
21
21
|
style,
|
|
@@ -8,6 +8,7 @@ const ProgressBarFixedLabelBeside = /*#__PURE__*/memo(_ref => {
|
|
|
8
8
|
let {
|
|
9
9
|
label,
|
|
10
10
|
visuallyDisabled,
|
|
11
|
+
disableAnimateOnMount,
|
|
11
12
|
style
|
|
12
13
|
} = _ref;
|
|
13
14
|
const {
|
|
@@ -16,6 +17,7 @@ const ProgressBarFixedLabelBeside = /*#__PURE__*/memo(_ref => {
|
|
|
16
17
|
} = getProgressBarLabelParts(label);
|
|
17
18
|
return /*#__PURE__*/_jsx(ProgressTextLabel, {
|
|
18
19
|
color: "fg",
|
|
20
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
19
21
|
disabled: visuallyDisabled,
|
|
20
22
|
renderLabel: renderLabel,
|
|
21
23
|
style: style,
|
|
@@ -27,11 +29,13 @@ const ProgressBarFixedLabel = /*#__PURE__*/memo(_ref2 => {
|
|
|
27
29
|
label,
|
|
28
30
|
position,
|
|
29
31
|
visuallyDisabled,
|
|
32
|
+
disableAnimateOnMount,
|
|
30
33
|
style
|
|
31
34
|
} = _ref2;
|
|
32
35
|
return /*#__PURE__*/_jsx(View, {
|
|
33
36
|
testID: "cds-progress-bar-fixed-label-" + position,
|
|
34
37
|
children: /*#__PURE__*/_jsx(ProgressBarFixedLabelBeside, {
|
|
38
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
35
39
|
label: label,
|
|
36
40
|
style: style,
|
|
37
41
|
visuallyDisabled: visuallyDisabled
|
|
@@ -43,6 +47,7 @@ const ProgressBarFixedLabelContainer = /*#__PURE__*/memo(_ref3 => {
|
|
|
43
47
|
startLabel,
|
|
44
48
|
endLabel,
|
|
45
49
|
visuallyDisabled,
|
|
50
|
+
disableAnimateOnMount,
|
|
46
51
|
paddingBottom,
|
|
47
52
|
paddingTop,
|
|
48
53
|
styles
|
|
@@ -50,6 +55,7 @@ const ProgressBarFixedLabelContainer = /*#__PURE__*/memo(_ref3 => {
|
|
|
50
55
|
const nodes = [];
|
|
51
56
|
if (typeof startLabel !== 'undefined') {
|
|
52
57
|
nodes.push(/*#__PURE__*/_jsx(ProgressBarFixedLabel, {
|
|
58
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
53
59
|
label: startLabel,
|
|
54
60
|
position: "start",
|
|
55
61
|
style: styles == null ? void 0 : styles.startLabel,
|
|
@@ -61,6 +67,7 @@ const ProgressBarFixedLabelContainer = /*#__PURE__*/memo(_ref3 => {
|
|
|
61
67
|
}
|
|
62
68
|
if (typeof endLabel !== 'undefined') {
|
|
63
69
|
nodes.push(/*#__PURE__*/_jsx(ProgressBarFixedLabel, {
|
|
70
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
64
71
|
label: endLabel,
|
|
65
72
|
position: "end",
|
|
66
73
|
style: styles == null ? void 0 : styles.endLabel,
|
|
@@ -90,6 +97,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
90
97
|
startLabel,
|
|
91
98
|
endLabel,
|
|
92
99
|
labelPlacement = 'beside',
|
|
100
|
+
disableAnimateOnMount,
|
|
93
101
|
disabled = false,
|
|
94
102
|
children,
|
|
95
103
|
testID,
|
|
@@ -102,6 +110,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
102
110
|
flexShrink: 0,
|
|
103
111
|
paddingEnd: 1,
|
|
104
112
|
children: /*#__PURE__*/_jsx(ProgressBarFixedLabelBeside, {
|
|
113
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
105
114
|
label: startLabel,
|
|
106
115
|
style: styles == null ? void 0 : styles.startLabel,
|
|
107
116
|
visuallyDisabled: disabled
|
|
@@ -112,6 +121,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
112
121
|
flexShrink: 0,
|
|
113
122
|
paddingStart: 1,
|
|
114
123
|
children: /*#__PURE__*/_jsx(ProgressBarFixedLabelBeside, {
|
|
124
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
115
125
|
label: endLabel,
|
|
116
126
|
style: styles == null ? void 0 : styles.endLabel,
|
|
117
127
|
visuallyDisabled: disabled
|
|
@@ -123,6 +133,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
123
133
|
style: rootStyle,
|
|
124
134
|
testID: testID,
|
|
125
135
|
children: [labelPlacement === 'above' && /*#__PURE__*/_jsx(ProgressBarFixedLabelContainer, {
|
|
136
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
126
137
|
endLabel: endLabel,
|
|
127
138
|
paddingBottom: 1,
|
|
128
139
|
startLabel: startLabel,
|
|
@@ -136,6 +147,7 @@ export const ProgressBarWithFixedLabels = /*#__PURE__*/memo(_ref4 => {
|
|
|
136
147
|
width: "100%",
|
|
137
148
|
children: [labelPlacement === 'beside' && leftEl, children, labelPlacement === 'beside' && rightEl]
|
|
138
149
|
}), labelPlacement === 'below' && /*#__PURE__*/_jsx(ProgressBarFixedLabelContainer, {
|
|
150
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
139
151
|
endLabel: endLabel,
|
|
140
152
|
paddingTop: 1,
|
|
141
153
|
startLabel: startLabel,
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import React, { memo, useCallback, useEffect, useMemo,
|
|
2
|
+
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { Animated, I18nManager } from 'react-native';
|
|
4
4
|
import { animateProgressBaseSpec } from '@coinbase/cds-common/animation/progress';
|
|
5
5
|
import { usePreviousValues } from '@coinbase/cds-common/hooks/usePreviousValues';
|
|
@@ -10,50 +10,55 @@ import { getProgressBarLabelParts } from './getProgressBarLabelParts';
|
|
|
10
10
|
import { ProgressTextLabel } from './ProgressTextLabel';
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const ProgressBarFloatLabel = /*#__PURE__*/memo(_ref => {
|
|
13
|
-
var _getPreviousPercent;
|
|
14
13
|
let {
|
|
15
14
|
label,
|
|
16
15
|
disabled,
|
|
17
16
|
progress,
|
|
17
|
+
disableAnimateOnMount,
|
|
18
18
|
labelPlacement,
|
|
19
19
|
styles
|
|
20
20
|
} = _ref;
|
|
21
21
|
const [textWidth, setTextWidth] = useState(-1);
|
|
22
22
|
const {
|
|
23
|
-
getPreviousValue: getPreviousPercent,
|
|
24
23
|
addPreviousValue: addPreviousPercent
|
|
25
|
-
} = usePreviousValues([0]);
|
|
24
|
+
} = usePreviousValues([disableAnimateOnMount ? progress : 0]);
|
|
26
25
|
const [size, onLayout] = useLayout();
|
|
27
26
|
const containerWidth = size.width;
|
|
27
|
+
const [hasAnimationMounted, setHasAnimationMounted] = useState(!disableAnimateOnMount);
|
|
28
|
+
const animatedProgress = useMemo(() => new Animated.Value(0), []);
|
|
28
29
|
addPreviousPercent(progress);
|
|
29
|
-
const previousPercent = (_getPreviousPercent = getPreviousPercent()) != null ? _getPreviousPercent : 0;
|
|
30
|
-
const animatedProgress = useRef(new Animated.Value(previousPercent));
|
|
31
30
|
const {
|
|
32
31
|
value: labelNum,
|
|
33
32
|
render: renderLabel
|
|
34
33
|
} = getProgressBarLabelParts(label);
|
|
35
34
|
useEffect(() => {
|
|
36
35
|
if (containerWidth > 0 && textWidth > -1) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
if (!hasAnimationMounted && disableAnimateOnMount) {
|
|
37
|
+
animatedProgress.setValue(progress);
|
|
38
|
+
setHasAnimationMounted(true);
|
|
39
|
+
} else {
|
|
40
|
+
var _Animated$timing;
|
|
41
|
+
(_Animated$timing = Animated.timing(animatedProgress, convertMotionConfig(_extends({
|
|
42
|
+
toValue: progress
|
|
43
|
+
}, animateProgressBaseSpec, {
|
|
44
|
+
useNativeDriver: true
|
|
45
|
+
})))) == null || _Animated$timing.start();
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
|
-
}, [progress,
|
|
48
|
+
}, [progress, containerWidth, textWidth, animatedProgress, disableAnimateOnMount, hasAnimationMounted]);
|
|
45
49
|
const handleTextLayout = useCallback(event => {
|
|
46
50
|
setTextWidth(event.nativeEvent.layout.width);
|
|
47
51
|
}, []);
|
|
48
52
|
const containerStyle = useMemo(() => [styles == null ? void 0 : styles.labelContainer], [styles == null ? void 0 : styles.labelContainer]);
|
|
49
53
|
const labelStyle = useMemo(() => [{
|
|
54
|
+
opacity: hasAnimationMounted ? 1 : 0,
|
|
50
55
|
transform: [{
|
|
51
|
-
translateX: animatedProgress.
|
|
56
|
+
translateX: animatedProgress.interpolate({
|
|
52
57
|
inputRange: [0, 1],
|
|
53
58
|
outputRange: [I18nManager.isRTL ? containerWidth - textWidth : 0, I18nManager.isRTL ? 0 : containerWidth - textWidth]
|
|
54
59
|
})
|
|
55
60
|
}]
|
|
56
|
-
}], [containerWidth, textWidth]);
|
|
61
|
+
}], [containerWidth, textWidth, hasAnimationMounted, animatedProgress]);
|
|
57
62
|
return /*#__PURE__*/_jsx(Box, {
|
|
58
63
|
flexWrap: "nowrap",
|
|
59
64
|
onLayout: onLayout,
|
|
@@ -71,6 +76,7 @@ const ProgressBarFloatLabel = /*#__PURE__*/memo(_ref => {
|
|
|
71
76
|
testID: "cds-progress-bar-float-label",
|
|
72
77
|
children: /*#__PURE__*/_jsx(ProgressTextLabel, {
|
|
73
78
|
color: "fgMuted",
|
|
79
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
74
80
|
disabled: disabled,
|
|
75
81
|
renderLabel: renderLabel,
|
|
76
82
|
style: styles == null ? void 0 : styles.label,
|
|
@@ -84,6 +90,7 @@ export const ProgressBarWithFloatLabel = /*#__PURE__*/memo(_ref2 => {
|
|
|
84
90
|
label,
|
|
85
91
|
labelPlacement = 'above',
|
|
86
92
|
progress,
|
|
93
|
+
disableAnimateOnMount,
|
|
87
94
|
disabled,
|
|
88
95
|
children,
|
|
89
96
|
testID,
|
|
@@ -92,6 +99,7 @@ export const ProgressBarWithFloatLabel = /*#__PURE__*/memo(_ref2 => {
|
|
|
92
99
|
} = _ref2;
|
|
93
100
|
const rootStyle = useMemo(() => [style, styles == null ? void 0 : styles.root], [style, styles == null ? void 0 : styles.root]);
|
|
94
101
|
const progressBarFloatLabel = /*#__PURE__*/_jsx(ProgressBarFloatLabel, {
|
|
102
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
95
103
|
disabled: disabled,
|
|
96
104
|
label: label,
|
|
97
105
|
labelPlacement: labelPlacement,
|
|
@@ -23,13 +23,15 @@ const ProgressCircleInner = /*#__PURE__*/memo(_ref => {
|
|
|
23
23
|
visuallyDisabled,
|
|
24
24
|
style,
|
|
25
25
|
onAnimationEnd,
|
|
26
|
-
onAnimationStart
|
|
26
|
+
onAnimationStart,
|
|
27
|
+
disableAnimateOnMount
|
|
27
28
|
} = _ref;
|
|
28
29
|
const strokeWidth = useProgressSize(weight);
|
|
29
30
|
const theme = useTheme();
|
|
30
31
|
const circleRef = useRef(null);
|
|
31
32
|
const circumference = getCircumference(getRadius(size, strokeWidth));
|
|
32
|
-
const
|
|
33
|
+
const initialOffset = disableAnimateOnMount ? circumference - circumference * progress : circumference;
|
|
34
|
+
const animatedStrokeDashOffset = useRef(new Animated.Value(initialOffset));
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
const strokeDashoffset = circumference - circumference * progress;
|
|
35
37
|
onAnimationStart == null || onAnimationStart();
|
|
@@ -65,7 +67,8 @@ export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref3,
|
|
|
65
67
|
// a11y label isn't specified
|
|
66
68
|
accessibilityLabel = '',
|
|
67
69
|
color = 'bgPrimary',
|
|
68
|
-
disabled
|
|
70
|
+
disabled,
|
|
71
|
+
disableAnimateOnMount,
|
|
69
72
|
testID,
|
|
70
73
|
hideContent,
|
|
71
74
|
hideText,
|
|
@@ -128,6 +131,7 @@ export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref3,
|
|
|
128
131
|
stroke: theme.color.bgLine
|
|
129
132
|
}), (styles == null ? void 0 : styles.circle) || {})), /*#__PURE__*/_jsx(ProgressCircleInner, {
|
|
130
133
|
color: color,
|
|
134
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
131
135
|
onAnimationEnd: onAnimationEnd,
|
|
132
136
|
onAnimationStart: onAnimationStart,
|
|
133
137
|
progress: progress,
|
|
@@ -150,6 +154,7 @@ export const ProgressCircle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref3,
|
|
|
150
154
|
overflow: "hidden",
|
|
151
155
|
width: "100%",
|
|
152
156
|
children: contentNode != null ? contentNode : /*#__PURE__*/_jsx(DefaultProgressCircleContent, {
|
|
157
|
+
disableAnimateOnMount: disableAnimateOnMount,
|
|
153
158
|
disabled: disabled,
|
|
154
159
|
progress: progress
|
|
155
160
|
})
|
|
@@ -10,6 +10,7 @@ export const ProgressTextLabel = /*#__PURE__*/memo(_ref => {
|
|
|
10
10
|
let {
|
|
11
11
|
value,
|
|
12
12
|
renderLabel,
|
|
13
|
+
disableAnimateOnMount,
|
|
13
14
|
disabled,
|
|
14
15
|
color,
|
|
15
16
|
style
|
|
@@ -17,7 +18,7 @@ export const ProgressTextLabel = /*#__PURE__*/memo(_ref => {
|
|
|
17
18
|
const {
|
|
18
19
|
getPreviousValue,
|
|
19
20
|
addPreviousValue
|
|
20
|
-
} = usePreviousValues([0]);
|
|
21
|
+
} = usePreviousValues([disableAnimateOnMount ? value : 0]);
|
|
21
22
|
const accessibilityState = useMemo(() => ({
|
|
22
23
|
disabled: !!disabled
|
|
23
24
|
}), [disabled]);
|
|
@@ -375,15 +375,6 @@ const ProgressBarScreen = () => {
|
|
|
375
375
|
})]
|
|
376
376
|
})
|
|
377
377
|
})
|
|
378
|
-
}), /*#__PURE__*/_jsx(Example, {
|
|
379
|
-
title: "Disable Mount Animation",
|
|
380
|
-
children: /*#__PURE__*/_jsx(ProgressContainerWithButtons, {
|
|
381
|
-
hideIncrease: true,
|
|
382
|
-
children: () => /*#__PURE__*/_jsx(ProgressBar, {
|
|
383
|
-
disableAnimateOnMount: true,
|
|
384
|
-
progress: 0.8
|
|
385
|
-
})
|
|
386
|
-
})
|
|
387
378
|
}), /*#__PURE__*/_jsx(Example, {
|
|
388
379
|
title: "Animation Callbacks",
|
|
389
380
|
children: /*#__PURE__*/_jsx(AnimationCallbacksExample, {})
|
|
@@ -472,6 +463,58 @@ const ProgressBarScreen = () => {
|
|
|
472
463
|
});
|
|
473
464
|
}
|
|
474
465
|
})
|
|
466
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
467
|
+
title: "Disable Mount Animation",
|
|
468
|
+
children: /*#__PURE__*/_jsx(ProgressContainerWithButtons, {
|
|
469
|
+
children: _ref10 => {
|
|
470
|
+
let {
|
|
471
|
+
calculateProgress
|
|
472
|
+
} = _ref10;
|
|
473
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
474
|
+
gap: 4,
|
|
475
|
+
children: [/*#__PURE__*/_jsxs(VStack, {
|
|
476
|
+
gap: 1,
|
|
477
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
478
|
+
font: "label1",
|
|
479
|
+
children: "ProgressBar"
|
|
480
|
+
}), /*#__PURE__*/_jsx(ProgressBar, {
|
|
481
|
+
disableAnimateOnMount: true,
|
|
482
|
+
progress: calculateProgress(0.8)
|
|
483
|
+
})]
|
|
484
|
+
}), /*#__PURE__*/_jsxs(VStack, {
|
|
485
|
+
gap: 1,
|
|
486
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
487
|
+
font: "label1",
|
|
488
|
+
children: "ProgressBarWithFixedLabels"
|
|
489
|
+
}), /*#__PURE__*/_jsx(ProgressBarWithFixedLabels, {
|
|
490
|
+
disableAnimateOnMount: true,
|
|
491
|
+
endLabel: Math.round(calculateProgress(0.8) * 100),
|
|
492
|
+
labelPlacement: "above",
|
|
493
|
+
startLabel: 0,
|
|
494
|
+
children: /*#__PURE__*/_jsx(ProgressBar, {
|
|
495
|
+
disableAnimateOnMount: true,
|
|
496
|
+
progress: calculateProgress(0.8)
|
|
497
|
+
})
|
|
498
|
+
})]
|
|
499
|
+
}), /*#__PURE__*/_jsxs(VStack, {
|
|
500
|
+
gap: 1,
|
|
501
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
502
|
+
font: "label1",
|
|
503
|
+
children: "ProgressBarWithFloatLabel"
|
|
504
|
+
}), /*#__PURE__*/_jsx(ProgressBarWithFloatLabel, {
|
|
505
|
+
disableAnimateOnMount: true,
|
|
506
|
+
label: Math.round(calculateProgress(0.8) * 100),
|
|
507
|
+
labelPlacement: "above",
|
|
508
|
+
progress: calculateProgress(0.8),
|
|
509
|
+
children: /*#__PURE__*/_jsx(ProgressBar, {
|
|
510
|
+
disableAnimateOnMount: true,
|
|
511
|
+
progress: calculateProgress(0.8)
|
|
512
|
+
})
|
|
513
|
+
})]
|
|
514
|
+
})]
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
})
|
|
475
518
|
})]
|
|
476
519
|
});
|
|
477
520
|
};
|
|
@@ -447,6 +447,20 @@ const ProgressBarScreen = () => {
|
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
})
|
|
450
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
451
|
+
title: "Disable Mount Animation",
|
|
452
|
+
children: /*#__PURE__*/_jsx(ProgressContainerWithButtons, {
|
|
453
|
+
children: _ref8 => {
|
|
454
|
+
let {
|
|
455
|
+
calculateProgress
|
|
456
|
+
} = _ref8;
|
|
457
|
+
return /*#__PURE__*/_jsx(ProgressCircle, {
|
|
458
|
+
disableAnimateOnMount: true,
|
|
459
|
+
progress: calculateProgress(0.8),
|
|
460
|
+
size: 100
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
})
|
|
450
464
|
})]
|
|
451
465
|
});
|
|
452
466
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.36.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"react-native-svg": "^14.1.0"
|
|
199
199
|
},
|
|
200
200
|
"dependencies": {
|
|
201
|
-
"@coinbase/cds-common": "^8.
|
|
201
|
+
"@coinbase/cds-common": "^8.36.0",
|
|
202
202
|
"@coinbase/cds-icons": "^5.9.0",
|
|
203
203
|
"@coinbase/cds-illustrations": "^4.29.0",
|
|
204
204
|
"@coinbase/cds-lottie-files": "^3.3.4",
|