@coinbase/cds-mobile 8.50.0 → 8.52.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 +11 -0
- package/dts/animation/Lottie.d.ts +20 -1
- package/dts/animation/Lottie.d.ts.map +1 -1
- package/dts/animation/LottieStatusAnimation.d.ts +30 -7
- package/dts/animation/LottieStatusAnimation.d.ts.map +1 -1
- package/dts/animation/types.d.ts +2 -4
- package/dts/animation/types.d.ts.map +1 -1
- package/dts/cells/ContentCellFallback.d.ts +3 -1
- package/dts/cells/ContentCellFallback.d.ts.map +1 -1
- package/dts/cells/ListCellFallback.d.ts +3 -1
- package/dts/cells/ListCellFallback.d.ts.map +1 -1
- package/dts/cells/MediaFallback.d.ts +3 -4
- package/dts/cells/MediaFallback.d.ts.map +1 -1
- package/dts/layout/Fallback.d.ts.map +1 -1
- package/dts/loaders/Spinner.d.ts.map +1 -1
- package/dts/visualizations/ProgressBar.d.ts.map +1 -1
- package/esm/animation/LottieStatusAnimation.js +12 -6
- package/esm/cells/ContentCellFallback.js +38 -16
- package/esm/cells/ListCellFallback.js +27 -5
- package/esm/cells/MediaFallback.js +11 -9
- package/esm/layout/Fallback.js +20 -7
- package/esm/layout/__stories__/Fallback.stories.js +146 -0
- package/esm/loaders/Spinner.js +6 -2
- package/esm/visualizations/ProgressBar.js +11 -19
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,17 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.52.0 (3/10/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- A11y improvements to Fallback, Spinner, and LottieStatusAnimation. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
16
|
+
- Simplify the ProgressBar component implementation. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
17
|
+
|
|
18
|
+
## 8.51.0 ((3/9/2026, 06:39 AM PST))
|
|
19
|
+
|
|
20
|
+
This is an artificial version bump with no new change.
|
|
21
|
+
|
|
11
22
|
## 8.50.0 (3/6/2026 PST)
|
|
12
23
|
|
|
13
24
|
#### 🚀 Updates
|
|
@@ -22,7 +22,26 @@ export declare const Lottie: React.MemoExoticComponent<
|
|
|
22
22
|
style?: Animated.WithAnimatedValue<
|
|
23
23
|
import('react-native').StyleProp<import('react-native').ViewStyle>
|
|
24
24
|
>;
|
|
25
|
-
} &
|
|
25
|
+
} & import('../styles/styleProps').StyleProps & {
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
style?: Animated.WithAnimatedValue<
|
|
28
|
+
import('react-native').StyleProp<import('react-native').ViewStyle>
|
|
29
|
+
>;
|
|
30
|
+
animated?: boolean;
|
|
31
|
+
elevation?: import('@coinbase/cds-common').ElevationLevels;
|
|
32
|
+
font?: import('@coinbase/cds-common').ThemeVars.FontFamily | 'inherit';
|
|
33
|
+
pin?: import('@coinbase/cds-common').PinningDirection;
|
|
34
|
+
bordered?: boolean;
|
|
35
|
+
borderedTop?: boolean;
|
|
36
|
+
borderedBottom?: boolean;
|
|
37
|
+
borderedStart?: boolean;
|
|
38
|
+
borderedEnd?: boolean;
|
|
39
|
+
borderedHorizontal?: boolean;
|
|
40
|
+
borderedVertical?: boolean;
|
|
41
|
+
dangerouslySetBackground?: string;
|
|
42
|
+
testID?: string;
|
|
43
|
+
} & Omit<import('react-native').ViewProps, 'style'> &
|
|
44
|
+
React.RefAttributes<LottieView>
|
|
26
45
|
>
|
|
27
46
|
>;
|
|
28
47
|
//# sourceMappingURL=Lottie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lottie.d.ts","sourceRoot":"","sources":["../../src/animation/Lottie.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAO7C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;AAiD7D,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"Lottie.d.ts","sourceRoot":"","sources":["../../src/animation/Lottie.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAO7C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;AAiD7D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFAKlB,CAAC"}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { DimensionValue } from '@coinbase/cds-common/types/DimensionStyles';
|
|
2
|
+
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
3
|
+
import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
|
|
4
|
+
import type { LottieStatus } from 'packages/common/dts/types/LottieStatus';
|
|
5
|
+
type LottieStatusAnimationBaseProps = {
|
|
6
|
+
status?: LottieStatus;
|
|
7
|
+
onFinish?: () => void;
|
|
8
|
+
};
|
|
9
|
+
type LottieStatusAnimationPropsWithWidth = {
|
|
10
|
+
width: DimensionValue;
|
|
11
|
+
} & LottieStatusAnimationBaseProps;
|
|
12
|
+
type LottieStatusAnimationPropsWithHeight = {
|
|
13
|
+
height: DimensionValue;
|
|
14
|
+
} & LottieStatusAnimationBaseProps;
|
|
15
|
+
export type LottieStatusAnimationProps = (
|
|
16
|
+
| LottieStatusAnimationPropsWithWidth
|
|
17
|
+
| LottieStatusAnimationPropsWithHeight
|
|
18
|
+
) &
|
|
19
|
+
SharedProps &
|
|
20
|
+
SharedAccessibilityProps;
|
|
21
|
+
export declare const LottieStatusAnimation: import('react').MemoExoticComponent<
|
|
22
|
+
({
|
|
23
|
+
status,
|
|
24
|
+
onFinish,
|
|
25
|
+
testID,
|
|
26
|
+
accessibilityLabel,
|
|
27
|
+
...otherProps
|
|
28
|
+
}: LottieStatusAnimationProps) => import('react/jsx-runtime').JSX.Element
|
|
29
|
+
>;
|
|
30
|
+
export {};
|
|
8
31
|
//# sourceMappingURL=LottieStatusAnimation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LottieStatusAnimation.d.ts","sourceRoot":"","sources":["../../src/animation/LottieStatusAnimation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LottieStatusAnimation.d.ts","sourceRoot":"","sources":["../../src/animation/LottieStatusAnimation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAI3E,KAAK,8BAA8B,GAAG;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,KAAK,EAAE,cAAc,CAAC;CACvB,GAAG,8BAA8B,CAAC;AAEnC,KAAK,oCAAoC,GAAG;IAC1C,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,8BAA8B,CAAC;AAEnC,MAAM,MAAM,0BAA0B,GAAG,CACrC,mCAAmC,GACnC,oCAAoC,CACvC,GACC,WAAW,GACX,wBAAwB,CAAC;AAE3B,eAAO,MAAM,qBAAqB,wGAO7B,0BAA0B,6CAoB9B,CAAC"}
|
package/dts/animation/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Animated, StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import type { LottieSource } from '@coinbase/cds-common/types';
|
|
3
|
-
import type { BoxBaseProps } from '../layout';
|
|
3
|
+
import type { BoxBaseProps, BoxProps } from '../layout';
|
|
4
4
|
export type LottieBaseProps<T extends LottieSource = LottieSource> = Omit<
|
|
5
5
|
BoxBaseProps,
|
|
6
6
|
'alignContent' | 'justifyContent' | 'flexWrap' | 'flexDirection'
|
|
@@ -8,12 +8,10 @@ export type LottieBaseProps<T extends LottieSource = LottieSource> = Omit<
|
|
|
8
8
|
/**
|
|
9
9
|
* A boolean flag indicating whether or not the animation should start automatically when
|
|
10
10
|
* mounted. This only affects the imperative API.
|
|
11
|
-
* @default false
|
|
12
11
|
*/
|
|
13
12
|
autoplay?: boolean;
|
|
14
13
|
/**
|
|
15
14
|
* A boolean flag indicating whether or not the animation should loop.
|
|
16
|
-
* @default false
|
|
17
15
|
*/
|
|
18
16
|
loop?: boolean;
|
|
19
17
|
/**
|
|
@@ -50,5 +48,5 @@ export type LottieBaseProps<T extends LottieSource = LottieSource> = Omit<
|
|
|
50
48
|
animated?: boolean;
|
|
51
49
|
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
|
52
50
|
};
|
|
53
|
-
export type LottieProps<T extends LottieSource = LottieSource> = LottieBaseProps<T
|
|
51
|
+
export type LottieProps<T extends LottieSource = LottieSource> = LottieBaseProps<T> & BoxProps;
|
|
54
52
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/animation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/animation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CACvE,YAAY,EACZ,cAAc,GAAG,gBAAgB,GAAG,UAAU,GAAG,eAAe,CACjE,GAAG;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC5C;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC;IACV;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC5E;;OAEG;IACH,YAAY,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FallbackRectWidthProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
3
4
|
import type { CellSpacing } from './Cell';
|
|
4
5
|
import type { CellAccessoryType } from './CellAccessory';
|
|
5
6
|
import type { CellMediaType } from './CellMedia';
|
|
@@ -9,7 +10,8 @@ type ContentCellFallbackSpacingProps = {
|
|
|
9
10
|
spacingVariant?: 'normal' | 'compact' | 'condensed';
|
|
10
11
|
};
|
|
11
12
|
export type ContentCellFallbackProps = FallbackRectWidthProps &
|
|
12
|
-
ContentCellFallbackSpacingProps &
|
|
13
|
+
ContentCellFallbackSpacingProps &
|
|
14
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel'> & {
|
|
13
15
|
/** Accessory to display at the end of the cell. */
|
|
14
16
|
accessory?: CellAccessoryType;
|
|
15
17
|
/** Custom accessory rendered at the end of the cell. Takes precedence over `accessory`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ContentCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ContentCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAMpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,+BAA+B,GAAG;IACrC,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,GAC3D,+BAA+B,GAC/B,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GAAG;IACrD,mDAAmD;IACnD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,2FAA2F;IAC3F,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,mCAAmC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,eAAO,MAAM,mBAAmB,sDA+G9B,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { FallbackRectWidthProps, SharedProps } from '@coinbase/cds-common/types';
|
|
4
|
+
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
4
5
|
import { type CellAccessoryType } from './CellAccessory';
|
|
5
6
|
import type { CellMediaType } from './CellMedia';
|
|
6
7
|
import { type ListCellBaseProps } from './ListCell';
|
|
7
8
|
export type ListCellFallbackBaseProps = SharedProps &
|
|
8
9
|
FallbackRectWidthProps &
|
|
10
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel'> &
|
|
9
11
|
Pick<ListCellBaseProps, 'compact' | 'innerSpacing' | 'outerSpacing' | 'spacingVariant'> & {
|
|
10
12
|
/** Accessory to display at the end of the cell. */
|
|
11
13
|
accessory?: CellAccessoryType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAQpG,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAgD,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGlG,MAAM,MAAM,yBAAyB,GAAG,WAAW,GACjD,sBAAsB,GACtB,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GACpD,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAC,GAAG;IACxF,mDAAmD;IACnD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,2FAA2F;IAC3F,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mCAAmC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC9D,+DAA+D;IAC/D,MAAM,CAAC,EAAE;QACP,kEAAkE;QAClE,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAClC,4CAA4C;QAC5C,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9B,+CAA+C;QAC/C,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,2CAA2C;QAC3C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,iDAAiD;QACjD,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACnC,8CAA8C;QAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAChC,iDAAiD;QACjD,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAClC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gBAAgB,6DAgM3B,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { SharedProps } from '@coinbase/cds-common';
|
|
1
|
+
import { type FallbackProps } from '../layout/Fallback';
|
|
3
2
|
import type { CellMediaType } from './CellMedia';
|
|
4
3
|
export type MediaFallbackProps = {
|
|
5
4
|
type: CellMediaType;
|
|
6
|
-
} &
|
|
7
|
-
export declare const MediaFallback:
|
|
5
|
+
} & Omit<FallbackProps, 'width' | 'height' | 'shape'>;
|
|
6
|
+
export declare const MediaFallback: import('react').NamedExoticComponent<MediaFallbackProps>;
|
|
8
7
|
//# sourceMappingURL=MediaFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFallback.d.ts","sourceRoot":"","sources":["../../src/cells/MediaFallback.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFallback.d.ts","sourceRoot":"","sources":["../../src/cells/MediaFallback.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,aAAa,CAAC;CACrB,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;AAEtD,eAAO,MAAM,aAAa,0DASxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fallback.d.ts","sourceRoot":"","sources":["../../src/layout/Fallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAKhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAM9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,iBAAiB,CAAC;AAEpG,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Fallback.d.ts","sourceRoot":"","sources":["../../src/layout/Fallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAKhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAM9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,iBAAiB,CAAC;AAEpG,eAAO,MAAM,QAAQ,2CA6FnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/loaders/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAI3D,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/loaders/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAI3D,eAAO,MAAM,OAAO,oDAoBlB,CAAC"}
|
|
@@ -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;;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,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,yEAAyE;IACzE,MAAM,CAAC,EAAE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,WAAW;IApCpB,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;;YAIvB,SAAS,CAAC,SAAS,CAAC;IAC5B,yEAAyE;aAChE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC;+
|
|
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,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,yEAAyE;IACzE,MAAM,CAAC,EAAE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,WAAW;IApCpB,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;;YAIvB,SAAS,CAAC,SAAS,CAAC;IAC5B,yEAAyE;aAChE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC;+BAiHF,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
const _excluded = ["status", "onFinish", "testID"];
|
|
1
|
+
const _excluded = ["status", "onFinish", "testID", "accessibilityLabel"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { memo, useMemo } from 'react';
|
|
5
|
+
import { lottieStatusToAccessibilityLabel } from '@coinbase/cds-common/lottie/statusToAccessibilityLabel';
|
|
6
|
+
import { useStatusAnimationPoller } from '@coinbase/cds-common/lottie/useStatusAnimationPoller';
|
|
6
7
|
import { tradeStatus } from '@coinbase/cds-lottie-files/tradeStatus';
|
|
7
8
|
import { useLottie } from './useLottie';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const LottieStatusAnimation = _ref => {
|
|
10
|
+
export const LottieStatusAnimation = /*#__PURE__*/memo(_ref => {
|
|
10
11
|
let {
|
|
11
12
|
status = 'loading',
|
|
12
13
|
onFinish,
|
|
13
|
-
testID
|
|
14
|
+
testID,
|
|
15
|
+
accessibilityLabel
|
|
14
16
|
} = _ref,
|
|
15
17
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
18
|
const {
|
|
@@ -22,8 +24,12 @@ export const LottieStatusAnimation = _ref => {
|
|
|
22
24
|
playMarkers,
|
|
23
25
|
onFinish
|
|
24
26
|
});
|
|
27
|
+
const label = useMemo(() => accessibilityLabel != null ? accessibilityLabel : lottieStatusToAccessibilityLabel[status], [accessibilityLabel, status]);
|
|
25
28
|
return /*#__PURE__*/_jsx(Lottie, _extends({}, otherProps, {
|
|
29
|
+
accessible: true,
|
|
30
|
+
accessibilityLabel: label,
|
|
31
|
+
accessibilityLiveRegion: "polite",
|
|
26
32
|
onAnimationFinish: handlePolling,
|
|
27
33
|
testID: testID
|
|
28
34
|
}));
|
|
29
|
-
};
|
|
35
|
+
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, Text } from 'react-native';
|
|
2
3
|
import { getRectWidthVariant } from '@coinbase/cds-common/utils/getRectWidthVariant';
|
|
3
4
|
import { useTheme } from '../hooks/useTheme';
|
|
4
|
-
import { Fallback } from '../layout';
|
|
5
|
+
import { Box, Fallback } from '../layout';
|
|
5
6
|
import { ContentCell } from './ContentCell';
|
|
6
7
|
import { condensedInnerSpacing, condensedOuterSpacing } from './ListCell';
|
|
7
8
|
import { MediaFallback } from './MediaFallback';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallback(_ref) {
|
|
10
11
|
let {
|
|
11
12
|
accessory,
|
|
@@ -19,7 +20,8 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
19
20
|
rectWidthVariant,
|
|
20
21
|
spacingVariant = 'normal',
|
|
21
22
|
innerSpacing,
|
|
22
|
-
outerSpacing
|
|
23
|
+
outerSpacing,
|
|
24
|
+
accessibilityLabel = 'Loading'
|
|
23
25
|
} = _ref;
|
|
24
26
|
const theme = useTheme();
|
|
25
27
|
const descriptionHeight = spacingVariant === 'condensed' ? theme.lineHeight.label2 : theme.lineHeight.body;
|
|
@@ -30,6 +32,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
30
32
|
return undefined;
|
|
31
33
|
}
|
|
32
34
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
35
|
+
"aria-hidden": true,
|
|
33
36
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
34
37
|
height: theme.lineHeight.label2,
|
|
35
38
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 0),
|
|
@@ -41,6 +44,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
41
44
|
return undefined;
|
|
42
45
|
}
|
|
43
46
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
47
|
+
"aria-hidden": true,
|
|
44
48
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
45
49
|
height: titleHeight,
|
|
46
50
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 1),
|
|
@@ -52,6 +56,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
52
56
|
return undefined;
|
|
53
57
|
}
|
|
54
58
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
59
|
+
"aria-hidden": true,
|
|
55
60
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
56
61
|
height: subtitleHeight,
|
|
57
62
|
paddingBottom: description ? 0.5 : undefined,
|
|
@@ -65,6 +70,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
65
70
|
return undefined;
|
|
66
71
|
}
|
|
67
72
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
73
|
+
"aria-hidden": true,
|
|
68
74
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
69
75
|
height: descriptionHeight,
|
|
70
76
|
paddingTop: 0.5,
|
|
@@ -72,18 +78,34 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
72
78
|
width: 110
|
|
73
79
|
});
|
|
74
80
|
}, [description, disableRandomRectWidth, rectWidthVariant, descriptionHeight]);
|
|
75
|
-
return /*#__PURE__*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
82
|
+
position: "relative",
|
|
83
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx(Text, {
|
|
84
|
+
style: localStyles.visuallyHidden,
|
|
85
|
+
children: accessibilityLabel
|
|
86
|
+
}), /*#__PURE__*/_jsx(ContentCell, {
|
|
87
|
+
accessory: accessory,
|
|
88
|
+
accessoryNode: accessoryNode,
|
|
89
|
+
descriptionNode: descriptionNode,
|
|
90
|
+
innerSpacing: innerSpacing != null ? innerSpacing : spacingVariant === 'condensed' ? condensedInnerSpacing : undefined,
|
|
91
|
+
media: media ? /*#__PURE__*/_jsx(MediaFallback, {
|
|
92
|
+
"aria-hidden": true,
|
|
93
|
+
type: media
|
|
94
|
+
}) : undefined,
|
|
95
|
+
metaNode: metaNode,
|
|
96
|
+
outerSpacing: outerSpacing != null ? outerSpacing : spacingVariant === 'condensed' ? condensedOuterSpacing : undefined,
|
|
97
|
+
spacingVariant: spacingVariant,
|
|
98
|
+
subtitleNode: subtitleNode,
|
|
99
|
+
titleNode: titleNode
|
|
100
|
+
})]
|
|
88
101
|
});
|
|
102
|
+
});
|
|
103
|
+
const localStyles = StyleSheet.create({
|
|
104
|
+
visuallyHidden: {
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
width: 1,
|
|
107
|
+
height: 1,
|
|
108
|
+
margin: -1,
|
|
109
|
+
overflow: 'hidden'
|
|
110
|
+
}
|
|
89
111
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const _excluded = ["accessory", "accessoryNode", "title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "subtitle", "styles", "compact", "spacingVariant", "innerSpacing", "outerSpacing"];
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "subtitle", "styles", "compact", "spacingVariant", "innerSpacing", "outerSpacing", "accessibilityLabel"];
|
|
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, useMemo } from 'react';
|
|
5
|
+
import { StyleSheet, Text } from 'react-native';
|
|
5
6
|
import { getRectWidthVariant } from '@coinbase/cds-common/utils/getRectWidthVariant';
|
|
6
7
|
import { useTheme } from '../hooks/useTheme';
|
|
7
8
|
import { VStack } from '../layout';
|
|
@@ -28,7 +29,8 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
28
29
|
compact,
|
|
29
30
|
spacingVariant = compact ? 'compact' : 'normal',
|
|
30
31
|
innerSpacing,
|
|
31
|
-
outerSpacing
|
|
32
|
+
outerSpacing,
|
|
33
|
+
accessibilityLabel = 'Loading'
|
|
32
34
|
} = _ref,
|
|
33
35
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
36
|
const theme = useTheme();
|
|
@@ -37,6 +39,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
37
39
|
return null;
|
|
38
40
|
}
|
|
39
41
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
42
|
+
"aria-hidden": true,
|
|
40
43
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
41
44
|
height: spacingVariant === 'condensed' ? theme.lineHeight.label2 : theme.lineHeight.body,
|
|
42
45
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 0),
|
|
@@ -55,6 +58,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
55
58
|
gap: 0.5,
|
|
56
59
|
justifyContent: "center",
|
|
57
60
|
children: [!!detail && /*#__PURE__*/_jsx(Fallback, {
|
|
61
|
+
"aria-hidden": true,
|
|
58
62
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
59
63
|
height: theme.lineHeight.body,
|
|
60
64
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 1),
|
|
@@ -62,6 +66,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
62
66
|
testID: "list-cell-fallback-detail",
|
|
63
67
|
width: 60
|
|
64
68
|
}), !!subdetail && /*#__PURE__*/_jsx(Fallback, {
|
|
69
|
+
"aria-hidden": true,
|
|
65
70
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
66
71
|
height: spacingVariant === 'condensed' ? theme.lineHeight.label2 : theme.lineHeight.body,
|
|
67
72
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 1),
|
|
@@ -76,6 +81,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
76
81
|
return null;
|
|
77
82
|
}
|
|
78
83
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
84
|
+
"aria-hidden": true,
|
|
79
85
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
80
86
|
height: theme.lineHeight.body,
|
|
81
87
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 4),
|
|
@@ -89,6 +95,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
89
95
|
return null;
|
|
90
96
|
}
|
|
91
97
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
98
|
+
"aria-hidden": true,
|
|
92
99
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
93
100
|
height: theme.lineHeight.label1,
|
|
94
101
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 2),
|
|
@@ -102,6 +109,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
102
109
|
return;
|
|
103
110
|
}
|
|
104
111
|
return /*#__PURE__*/_jsx(MediaFallback, {
|
|
112
|
+
"aria-hidden": true,
|
|
105
113
|
testID: "list-cell-fallback-media",
|
|
106
114
|
type: media
|
|
107
115
|
});
|
|
@@ -111,6 +119,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
111
119
|
return null;
|
|
112
120
|
}
|
|
113
121
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
122
|
+
"aria-hidden": true,
|
|
114
123
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
115
124
|
height: theme.lineHeight.headline,
|
|
116
125
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 3),
|
|
@@ -119,7 +128,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
119
128
|
width: 90
|
|
120
129
|
});
|
|
121
130
|
}, [disableRandomRectWidth, rectWidthVariant, styles == null ? void 0 : styles.title, theme.lineHeight.headline, title]);
|
|
122
|
-
return /*#__PURE__*/
|
|
131
|
+
return /*#__PURE__*/_jsxs(Cell, _extends({
|
|
123
132
|
accessory: accessory ? /*#__PURE__*/_jsx(CellAccessory, {
|
|
124
133
|
type: accessory
|
|
125
134
|
}) : undefined,
|
|
@@ -129,13 +138,26 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
129
138
|
innerSpacing: innerSpacing != null ? innerSpacing : spacingVariant === 'condensed' ? condensedInnerSpacing : undefined,
|
|
130
139
|
media: mediaFallback,
|
|
131
140
|
outerSpacing: outerSpacing != null ? outerSpacing : spacingVariant === 'condensed' ? condensedOuterSpacing : undefined,
|
|
141
|
+
position: "relative",
|
|
132
142
|
styles: {
|
|
133
143
|
accessory: styles == null ? void 0 : styles.accessory
|
|
134
144
|
}
|
|
135
145
|
}, props, {
|
|
136
|
-
children: /*#__PURE__*/
|
|
146
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx(Text, {
|
|
147
|
+
style: localStyles.visuallyHidden,
|
|
148
|
+
children: accessibilityLabel
|
|
149
|
+
}), /*#__PURE__*/_jsxs(VStack, {
|
|
137
150
|
gap: 0.5,
|
|
138
151
|
children: [titleFallback, subtitleFallback, descriptionFallback]
|
|
139
|
-
})
|
|
152
|
+
})]
|
|
140
153
|
}));
|
|
154
|
+
});
|
|
155
|
+
const localStyles = StyleSheet.create({
|
|
156
|
+
visuallyHidden: {
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
width: 1,
|
|
159
|
+
height: 1,
|
|
160
|
+
margin: -1,
|
|
161
|
+
overflow: 'hidden'
|
|
162
|
+
}
|
|
141
163
|
});
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
const _excluded = ["type"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
+
import { memo } from 'react';
|
|
2
5
|
import { imageSize, mediaSize } from '@coinbase/cds-common/tokens/cell';
|
|
3
6
|
import { Fallback } from '../layout/Fallback';
|
|
4
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
8
|
export const MediaFallback = /*#__PURE__*/memo(function MediaFallback(_ref) {
|
|
6
9
|
let {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
type
|
|
11
|
+
} = _ref,
|
|
12
|
+
fallbackProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
10
13
|
if (type === 'image') {
|
|
11
|
-
return /*#__PURE__*/_jsx(Fallback, {
|
|
14
|
+
return /*#__PURE__*/_jsx(Fallback, _extends({}, fallbackProps, {
|
|
12
15
|
height: imageSize,
|
|
13
16
|
shape: "squircle",
|
|
14
17
|
width: imageSize
|
|
15
|
-
});
|
|
18
|
+
}));
|
|
16
19
|
}
|
|
17
|
-
return /*#__PURE__*/_jsx(Fallback, {
|
|
20
|
+
return /*#__PURE__*/_jsx(Fallback, _extends({}, fallbackProps, {
|
|
18
21
|
height: mediaSize,
|
|
19
22
|
shape: "circle",
|
|
20
|
-
testID: testID,
|
|
21
23
|
width: mediaSize
|
|
22
|
-
});
|
|
24
|
+
}));
|
|
23
25
|
});
|
package/esm/layout/Fallback.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
const _excluded = ["height", "shape", "width", "disableRandomRectWidth", "rectWidthVariant"];
|
|
1
|
+
const _excluded = ["height", "shape", "width", "disableRandomRectWidth", "rectWidthVariant", "accessibilityLabel"];
|
|
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
|
// Simplified version of https://github.com/tomzaku/react-native-shimmer-placeholder/blob/master/lib/ShimmerPlaceholder.js
|
|
5
5
|
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
|
6
|
-
import { Animated, StyleSheet, View } from 'react-native';
|
|
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
9
|
import { useTheme } from '../hooks/useTheme';
|
|
10
10
|
import { fallbackShimmer } from '../styles/fallbackShimmer';
|
|
11
11
|
import { Box } from './Box';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
export const Fallback = /*#__PURE__*/memo(function Fallback(_ref) {
|
|
14
14
|
let {
|
|
15
15
|
height,
|
|
16
16
|
shape = 'rectangle',
|
|
17
17
|
width: baseWidth,
|
|
18
18
|
disableRandomRectWidth,
|
|
19
|
-
rectWidthVariant
|
|
19
|
+
rectWidthVariant,
|
|
20
|
+
accessibilityLabel = 'Loading'
|
|
20
21
|
} = _ref,
|
|
21
22
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
23
|
const fallbackShapeOptions = useMemo(() => ({
|
|
@@ -57,10 +58,15 @@ export const Fallback = /*#__PURE__*/memo(function Fallback(_ref) {
|
|
|
57
58
|
borderRadius
|
|
58
59
|
}), [width, height, shimmerColor, borderRadius]);
|
|
59
60
|
const outputRange = useMemo(() => typeof width === 'number' ? [-width, width] : [-400, 400], [width]);
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/_jsxs(Box, _extends({
|
|
62
|
+
position: "relative",
|
|
61
63
|
width: width
|
|
62
64
|
}, props, {
|
|
63
|
-
children: /*#__PURE__*/_jsx(
|
|
65
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx(Text, {
|
|
66
|
+
style: styles.visuallyHidden,
|
|
67
|
+
children: accessibilityLabel
|
|
68
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
69
|
+
"aria-hidden": true,
|
|
64
70
|
style: containerStyle,
|
|
65
71
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
66
72
|
style: [styles.child, {
|
|
@@ -79,7 +85,7 @@ export const Fallback = /*#__PURE__*/memo(function Fallback(_ref) {
|
|
|
79
85
|
style: styles.child
|
|
80
86
|
})
|
|
81
87
|
})
|
|
82
|
-
})
|
|
88
|
+
})]
|
|
83
89
|
}));
|
|
84
90
|
});
|
|
85
91
|
const gradStart = {
|
|
@@ -94,5 +100,12 @@ const gradLocations = [0.3, 0.5, 0.7];
|
|
|
94
100
|
const styles = StyleSheet.create({
|
|
95
101
|
child: {
|
|
96
102
|
flex: 1
|
|
103
|
+
},
|
|
104
|
+
visuallyHidden: {
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
width: 1,
|
|
107
|
+
height: 1,
|
|
108
|
+
margin: -1,
|
|
109
|
+
overflow: 'hidden'
|
|
97
110
|
}
|
|
98
111
|
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Example, ExampleScreen } from '../../examples/ExampleScreen';
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
import { Fallback } from '../Fallback';
|
|
5
|
+
import { HStack } from '../HStack';
|
|
6
|
+
import { VStack } from '../VStack';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const FallbackScreen = () => {
|
|
9
|
+
return /*#__PURE__*/_jsxs(ExampleScreen, {
|
|
10
|
+
children: [/*#__PURE__*/_jsx(Example, {
|
|
11
|
+
title: "Basic",
|
|
12
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
13
|
+
gap: 1,
|
|
14
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
15
|
+
height: 45,
|
|
16
|
+
width: 150
|
|
17
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
18
|
+
height: 45,
|
|
19
|
+
width: 65
|
|
20
|
+
})]
|
|
21
|
+
})
|
|
22
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
23
|
+
title: "Shapes",
|
|
24
|
+
children: /*#__PURE__*/_jsxs(HStack, {
|
|
25
|
+
gap: 1,
|
|
26
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
27
|
+
height: 50,
|
|
28
|
+
shape: "square",
|
|
29
|
+
width: 50
|
|
30
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
31
|
+
height: 50,
|
|
32
|
+
shape: "squircle",
|
|
33
|
+
width: 50
|
|
34
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
35
|
+
height: 50,
|
|
36
|
+
shape: "circle",
|
|
37
|
+
width: 50
|
|
38
|
+
})]
|
|
39
|
+
})
|
|
40
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
41
|
+
title: "Random Rectangle Width",
|
|
42
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
43
|
+
gap: 1,
|
|
44
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
45
|
+
height: 20,
|
|
46
|
+
width: 150
|
|
47
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
48
|
+
height: 20,
|
|
49
|
+
width: 150
|
|
50
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
51
|
+
height: 20,
|
|
52
|
+
width: 150
|
|
53
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
54
|
+
height: 20,
|
|
55
|
+
width: 150
|
|
56
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
57
|
+
height: 20,
|
|
58
|
+
width: 150
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
62
|
+
title: "Disabled Random Width",
|
|
63
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
64
|
+
gap: 1,
|
|
65
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
66
|
+
disableRandomRectWidth: true,
|
|
67
|
+
height: 20,
|
|
68
|
+
width: 150
|
|
69
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
70
|
+
disableRandomRectWidth: true,
|
|
71
|
+
height: 20,
|
|
72
|
+
width: 150
|
|
73
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
74
|
+
disableRandomRectWidth: true,
|
|
75
|
+
height: 20,
|
|
76
|
+
width: 150
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
80
|
+
title: "Width Variants (Deterministic)",
|
|
81
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
82
|
+
gap: 1,
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
84
|
+
height: 20,
|
|
85
|
+
rectWidthVariant: 0,
|
|
86
|
+
width: 150
|
|
87
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
88
|
+
height: 20,
|
|
89
|
+
rectWidthVariant: 1,
|
|
90
|
+
width: 150
|
|
91
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
92
|
+
height: 20,
|
|
93
|
+
rectWidthVariant: 2,
|
|
94
|
+
width: 150
|
|
95
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
96
|
+
height: 20,
|
|
97
|
+
rectWidthVariant: 3,
|
|
98
|
+
width: 150
|
|
99
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
100
|
+
height: 20,
|
|
101
|
+
rectWidthVariant: 4,
|
|
102
|
+
width: 150
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
106
|
+
title: "Custom Accessibility Label",
|
|
107
|
+
children: /*#__PURE__*/_jsx(Fallback, {
|
|
108
|
+
accessibilityLabel: "Loading user profile",
|
|
109
|
+
height: 45,
|
|
110
|
+
width: 150
|
|
111
|
+
})
|
|
112
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
113
|
+
title: "Grouped Fallbacks (Accessible Container)",
|
|
114
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
115
|
+
accessible: true,
|
|
116
|
+
accessibilityLabel: "Loading table data",
|
|
117
|
+
accessibilityState: {
|
|
118
|
+
busy: true
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
121
|
+
gap: 1,
|
|
122
|
+
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
123
|
+
accessibilityElementsHidden: true,
|
|
124
|
+
accessible: false,
|
|
125
|
+
height: 20,
|
|
126
|
+
importantForAccessibility: "no-hide-descendants",
|
|
127
|
+
width: 150
|
|
128
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
129
|
+
accessibilityElementsHidden: true,
|
|
130
|
+
accessible: false,
|
|
131
|
+
height: 20,
|
|
132
|
+
importantForAccessibility: "no-hide-descendants",
|
|
133
|
+
width: 150
|
|
134
|
+
}), /*#__PURE__*/_jsx(Fallback, {
|
|
135
|
+
accessibilityElementsHidden: true,
|
|
136
|
+
accessible: false,
|
|
137
|
+
height: 20,
|
|
138
|
+
importantForAccessibility: "no-hide-descendants",
|
|
139
|
+
width: 150
|
|
140
|
+
})]
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
export default FallbackScreen;
|
package/esm/loaders/Spinner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["size", "animating"];
|
|
1
|
+
const _excluded = ["size", "animating", "accessibilityLabel"];
|
|
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 } from 'react';
|
|
@@ -8,12 +8,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
export const Spinner = /*#__PURE__*/memo(function Spinner(_ref) {
|
|
9
9
|
let {
|
|
10
10
|
size = 'small',
|
|
11
|
-
animating
|
|
11
|
+
animating,
|
|
12
|
+
accessibilityLabel = 'Loading'
|
|
12
13
|
} = _ref,
|
|
13
14
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14
15
|
const theme = useTheme();
|
|
15
16
|
const color = theme.color.bgPrimary;
|
|
16
17
|
return /*#__PURE__*/_jsx(ActivityIndicator, _extends({
|
|
18
|
+
accessible: true,
|
|
19
|
+
accessibilityLabel: accessibilityLabel,
|
|
20
|
+
accessibilityLiveRegion: "polite",
|
|
17
21
|
animating: animating,
|
|
18
22
|
color: color,
|
|
19
23
|
size: size
|
|
@@ -2,14 +2,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { Animated, I18nManager } from 'react-native';
|
|
4
4
|
import { animateProgressBaseSpec } from '@coinbase/cds-common/animation/progress';
|
|
5
|
-
import { usePreviousValues } from '@coinbase/cds-common/hooks/usePreviousValues';
|
|
6
5
|
import { useProgressSize } from '@coinbase/cds-common/visualizations/useProgressSize';
|
|
7
6
|
import { convertMotionConfig } from '../animation/convertMotionConfig';
|
|
8
7
|
import { useTheme } from '../hooks/useTheme';
|
|
9
8
|
import { Box, HStack } from '../layout';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
12
|
-
var _getPreviousPercent;
|
|
13
11
|
let {
|
|
14
12
|
weight = 'normal',
|
|
15
13
|
progress,
|
|
@@ -25,16 +23,10 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
25
23
|
} = _ref;
|
|
26
24
|
const theme = useTheme();
|
|
27
25
|
const height = useProgressSize(weight);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
addPreviousValue: addPreviousPercent
|
|
31
|
-
} = usePreviousValues([disableAnimateOnMount ? progress : 0]);
|
|
32
|
-
addPreviousPercent(progress);
|
|
33
|
-
const previousPercent = (_getPreviousPercent = getPreviousPercent()) != null ? _getPreviousPercent : 0;
|
|
34
|
-
const animatedProgress = useRef(new Animated.Value(previousPercent));
|
|
35
|
-
const [innerWidth, setInnerWidth] = useState(-1);
|
|
26
|
+
const animatedProgress = useRef(new Animated.Value(disableAnimateOnMount ? progress : 0));
|
|
27
|
+
const [trackWidth, setTrackWidth] = useState(-1);
|
|
36
28
|
useEffect(() => {
|
|
37
|
-
if (
|
|
29
|
+
if (trackWidth > -1) {
|
|
38
30
|
var _Animated$timing;
|
|
39
31
|
onAnimationStart == null || onAnimationStart();
|
|
40
32
|
(_Animated$timing = Animated.timing(animatedProgress.current, convertMotionConfig(_extends({
|
|
@@ -48,11 +40,11 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
48
40
|
if (finished) onAnimationEnd == null || onAnimationEnd();
|
|
49
41
|
});
|
|
50
42
|
}
|
|
51
|
-
}, [progress,
|
|
43
|
+
}, [progress, trackWidth, onAnimationEnd, onAnimationStart]);
|
|
52
44
|
const handleLayout = useCallback(event => {
|
|
53
|
-
|
|
45
|
+
setTrackWidth(event.nativeEvent.layout.width);
|
|
54
46
|
}, []);
|
|
55
|
-
const
|
|
47
|
+
const trackStyle = useMemo(() => {
|
|
56
48
|
const justifyContent = I18nManager.isRTL ? 'flex-end' : 'flex-start';
|
|
57
49
|
return [{
|
|
58
50
|
borderRadius: 200,
|
|
@@ -64,14 +56,14 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
64
56
|
}, style, styles == null ? void 0 : styles.root];
|
|
65
57
|
}, [style, styles == null ? void 0 : styles.root, theme.color.bgLine, height]);
|
|
66
58
|
const progressStyle = useMemo(() => [{
|
|
67
|
-
opacity:
|
|
59
|
+
opacity: trackWidth > -1 ? 1 : 0,
|
|
68
60
|
transform: [{
|
|
69
61
|
translateX: animatedProgress.current.interpolate({
|
|
70
62
|
inputRange: [0, 1],
|
|
71
|
-
outputRange: I18nManager.isRTL ? [
|
|
63
|
+
outputRange: I18nManager.isRTL ? [trackWidth, 0] : [-trackWidth, 0]
|
|
72
64
|
})
|
|
73
65
|
}]
|
|
74
|
-
}, styles == null ? void 0 : styles.progress], [
|
|
66
|
+
}, styles == null ? void 0 : styles.progress], [trackWidth, styles == null ? void 0 : styles.progress]);
|
|
75
67
|
return /*#__PURE__*/_jsx(HStack, {
|
|
76
68
|
ref: forwardedRef,
|
|
77
69
|
accessible: true,
|
|
@@ -86,13 +78,13 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
86
78
|
flexGrow: 1,
|
|
87
79
|
flexShrink: 0,
|
|
88
80
|
onLayout: handleLayout,
|
|
89
|
-
style:
|
|
81
|
+
style: trackStyle,
|
|
90
82
|
testID: testID,
|
|
91
83
|
children: /*#__PURE__*/_jsx(Box, {
|
|
92
84
|
animated: true,
|
|
93
85
|
alignItems: "flex-start",
|
|
86
|
+
background: !disabled ? color : 'bgLineHeavy',
|
|
94
87
|
borderRadius: 200,
|
|
95
|
-
dangerouslySetBackground: !disabled ? theme.color[color] : theme.color.bgLineHeavy,
|
|
96
88
|
flexGrow: 0,
|
|
97
89
|
flexShrink: 0,
|
|
98
90
|
height: "100%",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.52.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.52.0",
|
|
202
202
|
"@coinbase/cds-icons": "^5.12.0",
|
|
203
203
|
"@coinbase/cds-illustrations": "^4.32.0",
|
|
204
204
|
"@coinbase/cds-lottie-files": "^3.3.4",
|