@coinbase/cds-web 8.51.0 → 8.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dts/animation/Lottie.d.ts +3 -12
- package/dts/animation/Lottie.d.ts.map +1 -1
- package/dts/animation/LottieStatusAnimation.d.ts +23 -3
- package/dts/animation/LottieStatusAnimation.d.ts.map +1 -1
- package/dts/animation/types.d.ts +3 -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 +2 -0
- package/dts/cells/ListCellFallback.d.ts.map +1 -1
- package/dts/cells/MediaFallback.d.ts +2 -2
- package/dts/cells/MediaFallback.d.ts.map +1 -1
- package/dts/layout/Fallback.d.ts +5 -13
- package/dts/layout/Fallback.d.ts.map +1 -1
- package/dts/media/RemoteImage.d.ts.map +1 -1
- package/dts/media/RemoteImageGroup.d.ts.map +1 -1
- package/dts/overlays/FocusTrap.d.ts +10 -4
- package/dts/overlays/FocusTrap.d.ts.map +1 -1
- package/dts/overlays/modal/Modal.d.ts +6 -13
- package/dts/overlays/modal/Modal.d.ts.map +1 -1
- package/dts/overlays/tray/Tray.d.ts +12 -22
- package/dts/overlays/tray/Tray.d.ts.map +1 -1
- package/dts/tables/TableCellFallback.d.ts +4 -2
- package/dts/tables/TableCellFallback.d.ts.map +1 -1
- package/dts/visualizations/ProgressBar.d.ts.map +1 -1
- package/esm/animation/Lottie.js +2 -2
- package/esm/animation/LottieStatusAnimation.js +9 -3
- package/esm/cells/ContentCellFallback.css +1 -0
- package/esm/cells/ContentCellFallback.js +14 -3
- package/esm/cells/ListCellFallback.css +1 -0
- package/esm/cells/ListCellFallback.js +20 -6
- package/esm/cells/MediaFallback.js +15 -9
- package/esm/layout/Fallback.css +2 -1
- package/esm/layout/Fallback.js +16 -35
- package/esm/media/RemoteImage.css +3 -3
- package/esm/media/RemoteImage.js +1 -0
- package/esm/media/RemoteImageGroup.css +2 -2
- package/esm/media/RemoteImageGroup.js +1 -0
- package/esm/overlays/FocusTrap.js +4 -5
- package/esm/overlays/modal/Modal.js +3 -1
- package/esm/overlays/tray/Tray.js +2 -0
- package/esm/tables/TableCellFallback.css +2 -1
- package/esm/tables/TableCellFallback.js +15 -5
- package/esm/visualizations/ProgressBar.js +8 -14
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,21 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.52.1 (3/11/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Add keyboard scroll support to FocusTrap, Tray, and Modal. [[#481](https://github.com/coinbase/cds/pull/481)]
|
|
16
|
+
|
|
17
|
+
## 8.52.0 (3/10/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🚀 Updates
|
|
20
|
+
|
|
21
|
+
- A11y improvements to Fallback, Spinner, and LottieStatusAnimation. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
22
|
+
- Simplify the ProgressBar component implementation. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
23
|
+
- Use shapeBorderRadius tokens in RemoteImage/RemoteImageGroup. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
24
|
+
- Removed useFallbackShape implementation from web and reuse the same hook defined in common. [[#388](https://github.com/coinbase/cds/pull/388)]
|
|
25
|
+
|
|
11
26
|
## 8.51.0 (3/9/2026 PST)
|
|
12
27
|
|
|
13
28
|
#### 🚀 Updates
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LottiePlayer } from '@coinbase/cds-common/types/LottiePlayer';
|
|
3
3
|
import type { LottieSource } from '@coinbase/cds-common/types/LottieSource';
|
|
4
|
+
import type { LottieProps } from './types';
|
|
4
5
|
export declare const Lottie: React.MemoExoticComponent<
|
|
5
6
|
React.ForwardRefExoticComponent<
|
|
6
|
-
Omit<
|
|
7
|
-
|
|
8
|
-
'justifyContent' | 'alignContent' | 'flexDirection' | 'flexWrap'
|
|
9
|
-
> & {
|
|
10
|
-
autoplay?: boolean;
|
|
11
|
-
loop?: boolean;
|
|
12
|
-
onAnimationFinish?: () => void;
|
|
13
|
-
resizeMode?: 'cover' | 'contain' | 'center';
|
|
14
|
-
source: LottieSource<string>;
|
|
15
|
-
handlers?: import('./types').LottieEventHandlersMap;
|
|
16
|
-
filterSize?: import('lottie-web').SVGRendererConfig['filterSize'];
|
|
17
|
-
} & React.RefAttributes<LottiePlayer<LottieSource<any>>>
|
|
7
|
+
Omit<LottieProps<string, LottieSource<string>>, 'ref'> &
|
|
8
|
+
React.RefAttributes<LottiePlayer<LottieSource<any>>>
|
|
18
9
|
>
|
|
19
10
|
>;
|
|
20
11
|
//# sourceMappingURL=Lottie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lottie.d.ts","sourceRoot":"","sources":["../../src/animation/Lottie.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAsB,YAAY,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"Lottie.d.ts","sourceRoot":"","sources":["../../src/animation/Lottie.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAsB,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgL3C,eAAO,MAAM,MAAM,2KAyElB,CAAC"}
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
|
|
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<
|
|
4
22
|
({
|
|
5
23
|
status,
|
|
6
24
|
onFinish,
|
|
7
25
|
testID,
|
|
26
|
+
accessibilityLabel,
|
|
8
27
|
...otherProps
|
|
9
28
|
}: LottieStatusAnimationProps) => import('react/jsx-runtime').JSX.Element
|
|
10
29
|
>;
|
|
30
|
+
export {};
|
|
11
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;AAEjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAM3E,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;AAC3B,eAAO,MAAM,qBAAqB,wGAO7B,0BAA0B,6CAmC9B,CAAC"}
|
package/dts/animation/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LottieSource } from '@coinbase/cds-common/types/LottieSource';
|
|
2
2
|
import type { AnimationEventName, AnimationItem, SVGRendererConfig } from 'lottie-web';
|
|
3
|
-
import type { BoxBaseProps } from '../layout';
|
|
3
|
+
import type { BoxBaseProps, BoxDefaultElement, BoxProps } from '../layout';
|
|
4
4
|
export type LottieEventHandlersMap = {
|
|
5
5
|
[key in LottieListener['name']]?: LottieListener['handler'];
|
|
6
6
|
};
|
|
@@ -15,12 +15,10 @@ export type LottieBaseProps<T extends string, Source extends LottieSource<T>> =
|
|
|
15
15
|
/**
|
|
16
16
|
* A boolean flag indicating whether or not the animation should start automatically when
|
|
17
17
|
* mounted. This only affects the imperative API.
|
|
18
|
-
* @default false
|
|
19
18
|
*/
|
|
20
19
|
autoplay?: boolean;
|
|
21
20
|
/**
|
|
22
21
|
* A boolean flag indicating whether or not the animation should loop.
|
|
23
|
-
* @default false
|
|
24
22
|
*/
|
|
25
23
|
loop?: boolean;
|
|
26
24
|
/**
|
|
@@ -50,6 +48,7 @@ export type LottieBaseProps<T extends string, Source extends LottieSource<T>> =
|
|
|
50
48
|
export type LottieProps<T extends string, Source extends LottieSource<T>> = LottieBaseProps<
|
|
51
49
|
T,
|
|
52
50
|
Source
|
|
53
|
-
|
|
51
|
+
> &
|
|
52
|
+
BoxProps<BoxDefaultElement>;
|
|
54
53
|
export type LottieAnimationRef = React.MutableRefObject<AnimationItem | undefined>;
|
|
55
54
|
//# 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,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvF,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,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG;KAClC,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAClF,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,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,CAAC,CAAC,CAAC,IAAI,eAAe,CACzF,CAAC,EACD,MAAM,CACP,GACC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAE9B,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,gBAAgB,CAAC,aAAa,GAAG,SAAS,CAAC,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 CellAccessoryType } from './CellAccessory';
|
|
4
5
|
import type { CellMediaType } from './CellMedia';
|
|
5
6
|
import type { ContentCellBaseProps } from './ContentCell';
|
|
@@ -8,7 +9,8 @@ type ContentCellFallbackSpacingProps = Pick<
|
|
|
8
9
|
'innerSpacing' | 'outerSpacing' | 'spacingVariant'
|
|
9
10
|
>;
|
|
10
11
|
export type ContentCellFallbackProps = FallbackRectWidthProps &
|
|
11
|
-
ContentCellFallbackSpacingProps &
|
|
12
|
+
ContentCellFallbackSpacingProps &
|
|
13
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel'> & {
|
|
12
14
|
/** Accessory to display at the end of the cell. */
|
|
13
15
|
accessory?: CellAccessoryType;
|
|
14
16
|
/** 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,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ContentCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,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,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAgB1D,KAAK,+BAA+B,GAAG,IAAI,CACzC,oBAAoB,EACpB,cAAc,GAAG,cAAc,GAAG,gBAAgB,CACnD,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;AAMJ,eAAO,MAAM,mBAAmB,sDAmG9B,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { FallbackRectWidthProps, SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
3
4
|
import { type CellAccessoryType } from './CellAccessory';
|
|
4
5
|
import type { CellMediaType } from './CellMedia';
|
|
5
6
|
import { type ListCellBaseProps } from './ListCell';
|
|
6
7
|
export type ListCellFallbackBaseProps = SharedProps &
|
|
7
8
|
FallbackRectWidthProps &
|
|
9
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel'> &
|
|
8
10
|
Pick<ListCellBaseProps, 'innerSpacing' | 'outerSpacing' | 'spacingVariant'> & {
|
|
9
11
|
/** Accessory to display at the end of the cell. */
|
|
10
12
|
accessory?: CellAccessoryType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAoBpG,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,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAC,GAAG;IAC5E,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,0DAA0D;IAC1D,UAAU,CAAC,EAAE;QACX,uDAAuD;QACvD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,yCAAyC;QACzC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,4CAA4C;QAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,8CAA8C;QAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,2CAA2C;QAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,wCAAwC;QACxC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,8CAA8C;QAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,qDAAqD;IACrD,MAAM,CAAC,EAAE;QACP,kEAAkE;QAClE,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,4CAA4C;QAC5C,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,+CAA+C;QAC/C,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,iDAAiD;QACjD,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,8CAA8C;QAC9C,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,2CAA2C;QAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,iDAAiD;QACjD,WAAW,CAAC,EAAE,aAAa,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gBAAgB,6DAsM3B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type fallbackDefaultElement, type FallbackProps } from '../layout/Fallback';
|
|
3
3
|
import type { CellMediaType } from './CellMedia';
|
|
4
4
|
export type MediaFallbackProps = {
|
|
5
5
|
type: CellMediaType;
|
|
6
|
-
} &
|
|
6
|
+
} & Omit<FallbackProps<typeof fallbackDefaultElement>, 'width' | 'height' | 'shape'>;
|
|
7
7
|
export declare const MediaFallback: React.NamedExoticComponent<MediaFallbackProps>;
|
|
8
8
|
//# sourceMappingURL=MediaFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFallback.d.ts","sourceRoot":"","sources":["../../src/cells/MediaFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaFallback.d.ts","sourceRoot":"","sources":["../../src/cells/MediaFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAY,KAAK,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,aAAa,CAAC;CACrB,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,sBAAsB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;AAErF,eAAO,MAAM,aAAa,gDASxB,CAAC"}
|
package/dts/layout/Fallback.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
useFallbackShape,
|
|
4
|
+
type UseFallbackShapeOptions,
|
|
5
|
+
} from '@coinbase/cds-common/hooks/useFallbackShape';
|
|
2
6
|
import type { Shape } from '@coinbase/cds-common/types';
|
|
3
7
|
import type { Polymorphic } from '../core/polymorphism';
|
|
4
8
|
import { type BoxBaseProps } from './Box';
|
|
5
|
-
export type UseFallbackShapeOptions = {
|
|
6
|
-
disableRandomRectWidth?: boolean;
|
|
7
|
-
rectWidthVariant?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function useFallbackShape(
|
|
10
|
-
shape: Shape,
|
|
11
|
-
baseWidth: number | string,
|
|
12
|
-
options?: UseFallbackShapeOptions,
|
|
13
|
-
): {
|
|
14
|
-
borderRadius: number;
|
|
15
|
-
width: string | number;
|
|
16
|
-
};
|
|
17
9
|
export declare const fallbackDefaultElement = 'div';
|
|
18
10
|
export type FallbackDefaultElement = typeof fallbackDefaultElement;
|
|
19
11
|
export type FallbackBaseProps = Polymorphic.ExtendableProps<
|
|
@@ -45,5 +37,5 @@ type FallbackComponent = (<AsComponent extends React.ElementType = FallbackDefau
|
|
|
45
37
|
) => Polymorphic.ReactReturn) &
|
|
46
38
|
Polymorphic.ReactNamed;
|
|
47
39
|
export declare const Fallback: FallbackComponent;
|
|
48
|
-
export {};
|
|
40
|
+
export { useFallbackShape, type UseFallbackShapeOptions };
|
|
49
41
|
//# sourceMappingURL=Fallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fallback.d.ts","sourceRoot":"","sources":["../../src/layout/Fallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"Fallback.d.ts","sourceRoot":"","sources":["../../src/layout/Fallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC7B,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AA+C/C,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,eAAe,CACzD,YAAY,EACZ;IACE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CACF,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,WAAW,SAAS,KAAK,CAAC,WAAW,IAAI,WAAW,CAAC,KAAK,CAClF,WAAW,EACX,iBAAiB,CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG,CAAC,CAAC,WAAW,SAAS,KAAK,CAAC,WAAW,GAAG,sBAAsB,EACvF,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAC9B,WAAW,CAAC,WAAW,CAAC,GAC3B,WAAW,CAAC,UAAU,CAAC;AAEzB,eAAO,MAAM,QAAQ,EAAE,iBAqDtB,CAAC;AAIF,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteImage.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RemoteImage.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQnD,QAAA,MAAM,SAAS;;;CAOd,CAAC;AAsCF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,GAAG;IACxE,yIAAyI;IACzI,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IACpC;;;SAGK;IACL,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;SAKK;IACL,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAEpD,eAAO,MAAM,WAAW,yJAenB,gBAAgB,6CA2CpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EACV,UAAU,EAEV,KAAK,EACL,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAO,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK3E,MAAM,MAAM,yBAAyB,GAAG,WAAW,GACjD,wBAAwB,GACxB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC,GAAG;IACjE;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AA4B9D,eAAO,MAAM,gBAAgB,GAAI,4EAS9B,qBAAqB,4CAwFvB,CAAC"}
|
|
@@ -13,21 +13,27 @@ export type FocusTrapProps = {
|
|
|
13
13
|
* Disables the focus trap to allow normal keyboard navigation.
|
|
14
14
|
*/
|
|
15
15
|
disableFocusTrap?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* If `true`, the focus trap will include the trigger in the focus trap.
|
|
18
|
-
*/
|
|
19
|
-
includeTriggerInFocusTrap?: boolean;
|
|
20
16
|
/**
|
|
21
17
|
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
22
18
|
* replace it to the last focused element when it closes.
|
|
23
19
|
* @default false
|
|
24
20
|
*/
|
|
25
21
|
disableAutoFocus?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the focus trap will not allow arrow key navigation.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableArrowKeyNavigation?: boolean;
|
|
26
27
|
/**
|
|
27
28
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
28
29
|
* @default false
|
|
29
30
|
*/
|
|
30
31
|
restoreFocusOnUnmount?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* If `true`, the focus trap will include the trigger in the focus trap.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
includeTriggerInFocusTrap?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* If `true`, the focus trap will respect negative `tabIndex` values, removing them from the list of focusable elements.
|
|
33
39
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusTrap.d.ts","sourceRoot":"","sources":["../../src/overlays/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAOrD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"FocusTrap.d.ts","sourceRoot":"","sources":["../../src/overlays/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAOrD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF,eAAO,MAAM,eAAe,UAAiD,CAAC;AA+B9E,eAAO,MAAM,SAAS,4CA8SpB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type ModalContextValue } from '@coinbase/cds-common/overlays/ModalContext';
|
|
3
3
|
import type { PositionStyles, SharedProps } from '@coinbase/cds-common/types';
|
|
4
4
|
import type { Position } from '@coinbase/cds-common/types/Position';
|
|
5
|
+
import { type FocusTrapProps } from '../FocusTrap';
|
|
5
6
|
import type { ModalWrapperProps } from './ModalWrapper';
|
|
6
7
|
type ModalChildrenRenderProps = {
|
|
7
8
|
closeModal: () => void;
|
|
@@ -9,7 +10,11 @@ type ModalChildrenRenderProps = {
|
|
|
9
10
|
export type ModalBaseProps = SharedProps &
|
|
10
11
|
ModalContextValue &
|
|
11
12
|
Pick<PositionStyles, 'zIndex'> &
|
|
12
|
-
Omit<ModalWrapperProps, 'onOverlayPress'> &
|
|
13
|
+
Omit<ModalWrapperProps, 'onOverlayPress'> &
|
|
14
|
+
Pick<
|
|
15
|
+
FocusTrapProps,
|
|
16
|
+
'disableFocusTrap' | 'focusTabIndexElements' | 'disableArrowKeyNavigation'
|
|
17
|
+
> & {
|
|
13
18
|
/** Component to render as the Modal content */
|
|
14
19
|
children?: React.ReactNode | React.FC<ModalChildrenRenderProps>;
|
|
15
20
|
/**
|
|
@@ -26,18 +31,6 @@ export type ModalBaseProps = SharedProps &
|
|
|
26
31
|
* @danger This is a migration escape hatch. It is not intended to be used normally.
|
|
27
32
|
*/
|
|
28
33
|
dangerouslySetPosition?: Position;
|
|
29
|
-
/**
|
|
30
|
-
* Set disableFocusTrap to disable keyboard listeners responsible for focus trap behavior
|
|
31
|
-
* This can be useful for scenarios like Yubikey 2fa
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
disableFocusTrap?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Allow any element with `tabIndex` attribute to be focusable in FocusTrap, rather than only focusing specific interactive element types like button.
|
|
37
|
-
* This can be useful when having long content in a Modal.
|
|
38
|
-
* @default false
|
|
39
|
-
*/
|
|
40
|
-
focusTabIndexElements?: boolean;
|
|
41
34
|
/**
|
|
42
35
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
43
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/overlays/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAMlG,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/overlays/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAMlG,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAUpE,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAiDxD,KAAK,wBAAwB,GAAG;IAAE,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,WAAW,GACtC,iBAAiB,GACjB,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAC9B,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,GACzC,IAAI,CACF,cAAc,EACd,kBAAkB,GAAG,uBAAuB,GAAG,2BAA2B,CAC3E,GAAG;IACF,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC;IAChE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,QAAQ,CAAC;IAClC;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEJ,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAEvE,eAAO,MAAM,KAAK,kIAmHjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PinningDirection, SharedAccessibilityProps } from '@coinbase/cds-common';
|
|
3
3
|
import type { StylesAndClassNames } from '../../types';
|
|
4
|
+
import { type FocusTrapProps } from '../FocusTrap';
|
|
4
5
|
/**
|
|
5
6
|
* Static class names for Tray component parts.
|
|
6
7
|
* Use these selectors to target specific elements with CSS.
|
|
@@ -28,7 +29,10 @@ export declare const trayClassNames: {
|
|
|
28
29
|
export type TrayRenderChildren = React.FC<{
|
|
29
30
|
handleClose: () => void;
|
|
30
31
|
}>;
|
|
31
|
-
export type TrayBaseProps =
|
|
32
|
+
export type TrayBaseProps = Pick<
|
|
33
|
+
FocusTrapProps,
|
|
34
|
+
'focusTabIndexElements' | 'disableArrowKeyNavigation'
|
|
35
|
+
> & {
|
|
32
36
|
children?: React.ReactNode | TrayRenderChildren;
|
|
33
37
|
/** ReactNode to render as the Drawer header. Can be a ReactNode or a function that receives { handleClose }. */
|
|
34
38
|
header?: React.ReactNode | TrayRenderChildren;
|
|
@@ -80,22 +84,15 @@ export type TrayBaseProps = {
|
|
|
80
84
|
/** z-index for the tray overlay */
|
|
81
85
|
zIndex?: number;
|
|
82
86
|
/**
|
|
83
|
-
*
|
|
84
|
-
* This
|
|
87
|
+
* When true, the tray will use opacity animation instead of transform animation.
|
|
88
|
+
* This is useful for supporting reduced motion for accessibility.
|
|
85
89
|
*/
|
|
86
|
-
|
|
90
|
+
reduceMotion?: boolean;
|
|
87
91
|
/**
|
|
88
92
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
89
|
-
*
|
|
90
|
-
* WARNING: If you disable this, you need to ensure that focus is restored properly so it doesn't end up on the body
|
|
91
93
|
* @default true
|
|
92
94
|
*/
|
|
93
95
|
restoreFocusOnUnmount?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* When true, the tray will use opacity animation instead of transform animation.
|
|
96
|
-
* This is useful for supporting reduced motion for accessibility.
|
|
97
|
-
*/
|
|
98
|
-
reduceMotion?: boolean;
|
|
99
96
|
/**
|
|
100
97
|
* Sets an accessible label for the close button.
|
|
101
98
|
* On web, maps to `aria-label` and defines a string value that labels an interactive element.
|
|
@@ -130,7 +127,7 @@ export type TrayRefProps = {
|
|
|
130
127
|
};
|
|
131
128
|
export declare const Tray: React.MemoExoticComponent<
|
|
132
129
|
React.ForwardRefExoticComponent<
|
|
133
|
-
{
|
|
130
|
+
Pick<FocusTrapProps, 'disableArrowKeyNavigation' | 'focusTabIndexElements'> & {
|
|
134
131
|
children?: React.ReactNode | TrayRenderChildren;
|
|
135
132
|
/** ReactNode to render as the Drawer header. Can be a ReactNode or a function that receives { handleClose }. */
|
|
136
133
|
header?: React.ReactNode | TrayRenderChildren;
|
|
@@ -182,22 +179,15 @@ export declare const Tray: React.MemoExoticComponent<
|
|
|
182
179
|
/** z-index for the tray overlay */
|
|
183
180
|
zIndex?: number;
|
|
184
181
|
/**
|
|
185
|
-
*
|
|
186
|
-
* This
|
|
182
|
+
* When true, the tray will use opacity animation instead of transform animation.
|
|
183
|
+
* This is useful for supporting reduced motion for accessibility.
|
|
187
184
|
*/
|
|
188
|
-
|
|
185
|
+
reduceMotion?: boolean;
|
|
189
186
|
/**
|
|
190
187
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
191
|
-
*
|
|
192
|
-
* WARNING: If you disable this, you need to ensure that focus is restored properly so it doesn't end up on the body
|
|
193
188
|
* @default true
|
|
194
189
|
*/
|
|
195
190
|
restoreFocusOnUnmount?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* When true, the tray will use opacity animation instead of transform animation.
|
|
198
|
-
* This is useful for supporting reduced motion for accessibility.
|
|
199
|
-
*/
|
|
200
|
-
reduceMotion?: boolean;
|
|
201
191
|
/**
|
|
202
192
|
* Sets an accessible label for the close button.
|
|
203
193
|
* On web, maps to `aria-label` and defines a string value that labels an interactive element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAa,MAAM,sBAAsB,CAAC;AA2BlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAa,MAAM,sBAAsB,CAAC;AA2BlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAkE9D;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB,6BAA6B;;IAE7B,+BAA+B;;IAE/B,yCAAyC;;IAEzC,6BAA6B;;IAE7B,yBAAyB;;IAEzB,2BAA2B;;IAE3B,iGAAiG;;IAEjG,iGAAiG;;IAEjG,2BAA2B;;CAEnB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,cAAc,EACd,uBAAuB,GAAG,2BAA2B,CACtD,GAAG;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAChD,gHAAgH;IAChH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAC9C,gHAAgH;IAChH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAC9C,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,gBAAgB,CAAC;IACvB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qDAAqD;IACrD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI,CAAC;IAC7D;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa,CAAC,CAAC;IACzD,gDAAgD;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;;;;OAKG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;IACzE;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;IACvE;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,GAAG,yBAAyB,CAAC,CAAC;AAErF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,mBAAmB,CAAC,OAAO,cAAc,CAAC,CAAC;AAGnF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAeF,eAAO,MAAM,IAAI;eA7GJ,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC/C,gHAAgH;aACvG,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC7C,gHAAgH;aACvG,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC7C,2BAA2B;SACtB,MAAM;IACX;;;OAGG;UACG,gBAAgB;IACtB,oEAAoE;aAC3D,MAAM,IAAI;IACnB,qDAAqD;cAC3C,MAAM,IAAI;IACpB,qDAAqD;qBACpC,MAAM,IAAI;IAC3B;;;;OAIG;yBACkB,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI;IAC5D;;;OAGG;qBACc,OAAO;IACxB;;;OAGG;sBACe,OAAO;IACzB;;;OAGG;WACI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa,CAAC;IACxD,gDAAgD;YACxC,KAAK,CAAC,SAAS;IACvB;;;;;OAKG;qCAC8B,MAAM;IACvC,mCAAmC;aAC1B,MAAM;IACf;;;OAGG;mBACY,OAAO;IACtB;;;OAGG;4BACqB,OAAO;IAC/B;;;;;;OAMG;8BACuB,wBAAwB,CAAC,oBAAoB,CAAC;IACxE;;;;;;;OAOG;6BACsB,wBAAwB,CAAC,mBAAmB,CAAC;IACtE;;;;;;;;OAQG;oBACa,OAAO;;IAhHvB,6BAA6B;;IAE7B,+BAA+B;;IAE/B,yCAAyC;;IAEzC,6BAA6B;;IAE7B,yBAAyB;;IAEzB,2BAA2B;;IAE3B,iGAAiG;;IAEjG,iGAAiG;;IAEjG,2BAA2B;;wCAue5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { FallbackRectWidthProps } from '@coinbase/cds-common/types/FallbackBaseProps';
|
|
2
|
+
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
3
3
|
import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
|
|
4
4
|
import type { CellMediaType } from '../cells/CellMedia';
|
|
5
5
|
import type { TableCellProps } from './TableCell';
|
|
@@ -14,8 +14,9 @@ export type TableCellFallbackProps = {
|
|
|
14
14
|
end?: CellMediaType;
|
|
15
15
|
} & SharedProps &
|
|
16
16
|
FallbackRectWidthProps &
|
|
17
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel'> &
|
|
17
18
|
Pick<TableCellProps, 'width' | 'outerSpacing' | 'innerSpacing' | 'as'>;
|
|
18
|
-
export declare const TableCellFallback:
|
|
19
|
+
export declare const TableCellFallback: import('react').MemoExoticComponent<
|
|
19
20
|
({
|
|
20
21
|
title,
|
|
21
22
|
start,
|
|
@@ -27,6 +28,7 @@ export declare const TableCellFallback: React.MemoExoticComponent<
|
|
|
27
28
|
innerSpacing,
|
|
28
29
|
disableRandomRectWidth,
|
|
29
30
|
rectWidthVariant,
|
|
31
|
+
accessibilityLabel,
|
|
30
32
|
...props
|
|
31
33
|
}: TableCellFallbackProps) => import('react/jsx-runtime').JSX.Element
|
|
32
34
|
>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCellFallback.d.ts","sourceRoot":"","sources":["../../src/tables/TableCellFallback.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableCellFallback.d.ts","sourceRoot":"","sources":["../../src/tables/TableCellFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAclD,MAAM,MAAM,sBAAsB,GAAG;IACnC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,GAAG,WAAW,GACb,sBAAsB,GACtB,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GACpD,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC;AASzE,eAAO,MAAM,iBAAiB,wLAczB,sBAAsB,6CAsD1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/visualizations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAOhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAI3D,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,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAChC,CAAC;IACF,8EAA8E;IAC9E,UAAU,CAAC,EAAE;QACX,mBAAmB;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAQF,eAAO,MAAM,WAAW;IAlDpB,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,KAAK,CAAC,aAAa;gBACf,MAAM;IAClB,yEAAyE;aAChE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAChC;IACD,8EAA8E;iBACjE;QACX,mBAAmB;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;yCA2FF,CAAC"}
|
package/esm/animation/Lottie.js
CHANGED
|
@@ -31,7 +31,7 @@ export const Lottie = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwarded
|
|
|
31
31
|
resizeMode = 'contain',
|
|
32
32
|
filterSize = defaultFilterSize
|
|
33
33
|
} = _ref,
|
|
34
|
-
|
|
34
|
+
boxProps = _objectWithoutProperties(_ref, _excluded);
|
|
35
35
|
const {
|
|
36
36
|
containerRef,
|
|
37
37
|
animationRef
|
|
@@ -77,7 +77,7 @@ export const Lottie = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwarded
|
|
|
77
77
|
ref: containerRef,
|
|
78
78
|
as: "div",
|
|
79
79
|
className: lottieCss
|
|
80
|
-
},
|
|
80
|
+
}, boxProps));
|
|
81
81
|
}));
|
|
82
82
|
Lottie.displayName = 'Lottie';
|
|
83
83
|
import "./Lottie.css";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["status", "onFinish", "testID"];
|
|
1
|
+
const _excluded = ["status", "onFinish", "testID", "accessibilityLabel"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -6,7 +6,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
8
|
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; }
|
|
9
|
-
import
|
|
9
|
+
import { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
10
|
+
import { lottieStatusToAccessibilityLabel } from '@coinbase/cds-common/lottie/statusToAccessibilityLabel';
|
|
10
11
|
import { useStatusAnimationPoller } from '@coinbase/cds-common/lottie/useStatusAnimationPoller';
|
|
11
12
|
import { tradeStatus } from '@coinbase/cds-lottie-files/tradeStatus';
|
|
12
13
|
import { Lottie } from './Lottie';
|
|
@@ -16,7 +17,8 @@ export const LottieStatusAnimation = /*#__PURE__*/memo(_ref => {
|
|
|
16
17
|
let {
|
|
17
18
|
status = 'loading',
|
|
18
19
|
onFinish,
|
|
19
|
-
testID
|
|
20
|
+
testID,
|
|
21
|
+
accessibilityLabel
|
|
20
22
|
} = _ref,
|
|
21
23
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
24
|
const [, forceUpdate] = useState(0);
|
|
@@ -32,9 +34,13 @@ export const LottieStatusAnimation = /*#__PURE__*/memo(_ref => {
|
|
|
32
34
|
forceUpdate(prev => prev + 1);
|
|
33
35
|
}
|
|
34
36
|
}, []);
|
|
37
|
+
const label = useMemo(() => accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : lottieStatusToAccessibilityLabel[status], [accessibilityLabel, status]);
|
|
35
38
|
return /*#__PURE__*/_jsx(Lottie, _objectSpread({
|
|
36
39
|
ref: handleRef,
|
|
40
|
+
accessibilityLabel: label,
|
|
41
|
+
"aria-live": "polite",
|
|
37
42
|
onAnimationFinish: handlePolling,
|
|
43
|
+
role: "status",
|
|
38
44
|
source: tradeStatus,
|
|
39
45
|
testID: testID
|
|
40
46
|
}, otherProps));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cds{.visuallyHiddenCss-vcqrmp1{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border:0;}}
|
|
@@ -8,6 +8,7 @@ import { CellAccessory } from './CellAccessory';
|
|
|
8
8
|
import { condensedInnerSpacing, condensedOuterSpacing } from './ListCell';
|
|
9
9
|
import { MediaFallback } from './MediaFallback';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const visuallyHiddenCss = "visuallyHiddenCss-vcqrmp1";
|
|
11
12
|
const fullWidthStyle = {
|
|
12
13
|
width: '100%',
|
|
13
14
|
display: 'block'
|
|
@@ -29,7 +30,8 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
29
30
|
rectWidthVariant,
|
|
30
31
|
spacingVariant = 'normal',
|
|
31
32
|
innerSpacing,
|
|
32
|
-
outerSpacing
|
|
33
|
+
outerSpacing,
|
|
34
|
+
accessibilityLabel = 'Loading'
|
|
33
35
|
} = _ref;
|
|
34
36
|
// We can't use ContentCell here as we need to account for percentage based widths.
|
|
35
37
|
// Flexbox collides with percentages also, so we need to wrap in normal divs.
|
|
@@ -44,6 +46,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
44
46
|
borderRadius: spacingVariant === 'condensed' ? 0 : undefined,
|
|
45
47
|
innerSpacing: innerSpacing !== null && innerSpacing !== void 0 ? innerSpacing : spacingVariant === 'condensed' ? condensedInnerSpacing : undefined,
|
|
46
48
|
media: media && /*#__PURE__*/_jsx(MediaFallback, {
|
|
49
|
+
"aria-hidden": true,
|
|
47
50
|
type: media
|
|
48
51
|
}),
|
|
49
52
|
minHeight: minHeight,
|
|
@@ -59,12 +62,16 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
59
62
|
children: /*#__PURE__*/_jsxs(Box, {
|
|
60
63
|
paddingTop: spacingVariant === 'condensed' ? 0.5 : 0,
|
|
61
64
|
style: fullWidthStyle,
|
|
62
|
-
children: [
|
|
65
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx("span", {
|
|
66
|
+
className: visuallyHiddenCss,
|
|
67
|
+
children: accessibilityLabel
|
|
68
|
+
}), meta && /*#__PURE__*/_jsx("div", {
|
|
63
69
|
style: floatStyle,
|
|
64
70
|
children: /*#__PURE__*/_jsx(Box, {
|
|
65
71
|
flexShrink: 0,
|
|
66
72
|
justifyContent: "flex-end",
|
|
67
73
|
children: /*#__PURE__*/_jsx(Fallback, {
|
|
74
|
+
"aria-hidden": true,
|
|
68
75
|
percentage: true,
|
|
69
76
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
70
77
|
height: 18,
|
|
@@ -73,12 +80,14 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
73
80
|
})
|
|
74
81
|
})
|
|
75
82
|
}), title && /*#__PURE__*/_jsx(Fallback, {
|
|
83
|
+
"aria-hidden": true,
|
|
76
84
|
percentage: true,
|
|
77
85
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
78
86
|
height: 18,
|
|
79
87
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 1),
|
|
80
88
|
width: 45
|
|
81
89
|
}), subtitle && /*#__PURE__*/_jsx(Fallback, {
|
|
90
|
+
"aria-hidden": true,
|
|
82
91
|
percentage: true,
|
|
83
92
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
84
93
|
height: subtitleHeight,
|
|
@@ -86,6 +95,7 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
86
95
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 2),
|
|
87
96
|
width: 35
|
|
88
97
|
}), description && /*#__PURE__*/_jsx(Fallback, {
|
|
98
|
+
"aria-hidden": true,
|
|
89
99
|
percentage: true,
|
|
90
100
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
91
101
|
height: 24,
|
|
@@ -95,4 +105,5 @@ export const ContentCellFallback = /*#__PURE__*/memo(function ContentCellFallbac
|
|
|
95
105
|
})]
|
|
96
106
|
})
|
|
97
107
|
});
|
|
98
|
-
});
|
|
108
|
+
});
|
|
109
|
+
import "./ContentCellFallback.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cds{.visuallyHiddenCss-vzen5l{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border:0;}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["accessory", "accessoryNode", "classNames", "styles", "title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "subtitle", "spacingVariant", "innerSpacing", "outerSpacing"];
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "classNames", "styles", "title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "subtitle", "spacingVariant", "innerSpacing", "outerSpacing", "accessibilityLabel"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -10,6 +10,7 @@ import { memo, useMemo } from 'react';
|
|
|
10
10
|
import { getRectWidthVariant } from '@coinbase/cds-common/utils/getRectWidthVariant';
|
|
11
11
|
import { VStack } from '../layout';
|
|
12
12
|
import { Fallback } from '../layout/Fallback';
|
|
13
|
+
const visuallyHiddenCss = "visuallyHiddenCss-vzen5l";
|
|
13
14
|
import { Cell } from './Cell';
|
|
14
15
|
import { CellAccessory } from './CellAccessory';
|
|
15
16
|
import { condensedInnerSpacing, condensedOuterSpacing } from './ListCell';
|
|
@@ -32,7 +33,8 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
32
33
|
subtitle,
|
|
33
34
|
spacingVariant,
|
|
34
35
|
innerSpacing,
|
|
35
|
-
outerSpacing
|
|
36
|
+
outerSpacing,
|
|
37
|
+
accessibilityLabel = 'Loading'
|
|
36
38
|
} = _ref,
|
|
37
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
40
|
// We cant use ListCell here as we need to account for percentage based widths.
|
|
@@ -43,6 +45,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
43
45
|
return null;
|
|
44
46
|
}
|
|
45
47
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
48
|
+
"aria-hidden": true,
|
|
46
49
|
percentage: true,
|
|
47
50
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.helperText,
|
|
48
51
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -65,6 +68,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
65
68
|
style: styles === null || styles === void 0 ? void 0 : styles.detail,
|
|
66
69
|
testID: "list-cell-fallback-detail",
|
|
67
70
|
children: [/*#__PURE__*/_jsx(Fallback, {
|
|
71
|
+
"aria-hidden": true,
|
|
68
72
|
percentage: true,
|
|
69
73
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.detail,
|
|
70
74
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -73,6 +77,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
73
77
|
style: styles === null || styles === void 0 ? void 0 : styles.detail,
|
|
74
78
|
width: 60
|
|
75
79
|
}), /*#__PURE__*/_jsx(Fallback, {
|
|
80
|
+
"aria-hidden": true,
|
|
76
81
|
percentage: true,
|
|
77
82
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.subdetail,
|
|
78
83
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -88,6 +93,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
88
93
|
return null;
|
|
89
94
|
}
|
|
90
95
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
96
|
+
"aria-hidden": true,
|
|
91
97
|
percentage: true,
|
|
92
98
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.title,
|
|
93
99
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -103,6 +109,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
103
109
|
return null;
|
|
104
110
|
}
|
|
105
111
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
112
|
+
"aria-hidden": true,
|
|
106
113
|
percentage: true,
|
|
107
114
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.subtitle,
|
|
108
115
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -118,6 +125,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
118
125
|
return null;
|
|
119
126
|
}
|
|
120
127
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
128
|
+
"aria-hidden": true,
|
|
121
129
|
percentage: true,
|
|
122
130
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.description,
|
|
123
131
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
@@ -133,11 +141,12 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
133
141
|
return undefined;
|
|
134
142
|
}
|
|
135
143
|
return /*#__PURE__*/_jsx(MediaFallback, {
|
|
144
|
+
"aria-hidden": true,
|
|
136
145
|
testID: "list-cell-fallback-media",
|
|
137
146
|
type: media
|
|
138
147
|
});
|
|
139
148
|
}, [media]);
|
|
140
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/_jsxs(Cell, _objectSpread(_objectSpread({
|
|
141
150
|
accessory: accessory ? /*#__PURE__*/_jsx(CellAccessory, {
|
|
142
151
|
type: accessory
|
|
143
152
|
}) : undefined,
|
|
@@ -150,13 +159,18 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
150
159
|
innerSpacing: innerSpacing !== null && innerSpacing !== void 0 ? innerSpacing : spacingVariant === 'condensed' ? condensedInnerSpacing : undefined,
|
|
151
160
|
media: mediaFallback,
|
|
152
161
|
outerSpacing: outerSpacing !== null && outerSpacing !== void 0 ? outerSpacing : spacingVariant === 'condensed' ? condensedOuterSpacing : undefined,
|
|
162
|
+
position: "relative",
|
|
153
163
|
styles: {
|
|
154
164
|
accessory: styles === null || styles === void 0 ? void 0 : styles.accessory
|
|
155
165
|
}
|
|
156
166
|
}, props), {}, {
|
|
157
|
-
children: /*#__PURE__*/
|
|
167
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx("span", {
|
|
168
|
+
className: visuallyHiddenCss,
|
|
169
|
+
children: accessibilityLabel
|
|
170
|
+
}), /*#__PURE__*/_jsxs(VStack, {
|
|
158
171
|
gap: 0.5,
|
|
159
172
|
children: [titleFallback, subtitleFallback, descriptionFallback]
|
|
160
|
-
})
|
|
173
|
+
})]
|
|
161
174
|
}));
|
|
162
|
-
});
|
|
175
|
+
});
|
|
176
|
+
import "./ListCellFallback.css";
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
+
const _excluded = ["type"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
+
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; }
|
|
1
9
|
import React, { memo } from 'react';
|
|
2
10
|
import { imageSize, mediaSize } from '@coinbase/cds-common/tokens/cell';
|
|
3
11
|
import { Fallback } from '../layout/Fallback';
|
|
4
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
13
|
export const MediaFallback = /*#__PURE__*/memo(function MediaFallback(_ref) {
|
|
6
14
|
let {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
type
|
|
16
|
+
} = _ref,
|
|
17
|
+
fallbackProps = _objectWithoutProperties(_ref, _excluded);
|
|
10
18
|
if (type === 'image') {
|
|
11
|
-
return /*#__PURE__*/_jsx(Fallback, {
|
|
19
|
+
return /*#__PURE__*/_jsx(Fallback, _objectSpread(_objectSpread({}, fallbackProps), {}, {
|
|
12
20
|
height: imageSize,
|
|
13
21
|
shape: "squircle",
|
|
14
|
-
testID: testID,
|
|
15
22
|
width: imageSize
|
|
16
|
-
});
|
|
23
|
+
}));
|
|
17
24
|
}
|
|
18
|
-
return /*#__PURE__*/_jsx(Fallback, {
|
|
25
|
+
return /*#__PURE__*/_jsx(Fallback, _objectSpread(_objectSpread({}, fallbackProps), {}, {
|
|
19
26
|
height: mediaSize,
|
|
20
27
|
shape: "circle",
|
|
21
|
-
testID: testID,
|
|
22
28
|
width: mediaSize
|
|
23
|
-
});
|
|
29
|
+
}));
|
|
24
30
|
});
|
package/esm/layout/Fallback.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
@layer cds{.fallbackCss-f1n296p1{display:inline-block;position:relative;overflow:hidden;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:shimmer-fallbackCss-f1n296p1;animation-name:shimmer-fallbackCss-f1n296p1;-webkit-animation-timing-function:linear;animation-timing-function:linear;background-color:rgba(var(--gray60),0.05);background-repeat:no-repeat;background-image:linear-gradient( to right, rgb(var(--gray60),0.05) 0%, rgb(var(--gray60),0) 25%, rgb(var(--gray60),0.1) 50%, rgb(var(--gray60),0) 75%, rgb(var(--gray60),0.05) 100% );}@-webkit-keyframes shimmer-fallbackCss-f1n296p1{0%{background-position:-600px 0;}100%{background-position:600px 0;}}@keyframes shimmer-fallbackCss-f1n296p1{0%{background-position:-600px 0;}100%{background-position:600px 0;}}
|
|
1
|
+
@layer cds{.fallbackCss-f1n296p1{display:inline-block;position:relative;overflow:hidden;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:shimmer-fallbackCss-f1n296p1;animation-name:shimmer-fallbackCss-f1n296p1;-webkit-animation-timing-function:linear;animation-timing-function:linear;background-color:rgba(var(--gray60),0.05);background-repeat:no-repeat;background-image:linear-gradient( to right, rgb(var(--gray60),0.05) 0%, rgb(var(--gray60),0) 25%, rgb(var(--gray60),0.1) 50%, rgb(var(--gray60),0) 75%, rgb(var(--gray60),0.05) 100% );}@-webkit-keyframes shimmer-fallbackCss-f1n296p1{0%{background-position:-600px 0;}100%{background-position:600px 0;}}@keyframes shimmer-fallbackCss-f1n296p1{0%{background-position:-600px 0;}100%{background-position:600px 0;}}
|
|
2
|
+
.visuallyHiddenCss-v1e56i3u{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border:0;}}
|
package/esm/layout/Fallback.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["as", "height", "shape", "width", "percentage", "disableRandomRectWidth", "rectWidthVariant"];
|
|
1
|
+
const _excluded = ["as", "height", "shape", "width", "percentage", "disableRandomRectWidth", "rectWidthVariant", "accessibilityLabel"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -7,36 +7,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
7
7
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
8
|
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; }
|
|
9
9
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
10
|
+
import { useFallbackShape } from '@coinbase/cds-common/hooks/useFallbackShape';
|
|
10
11
|
import { Box } from './Box';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const WIDTH_MODIFIERS = [0.5, 0, 0.6, 0.8, 0.1, 0.9, 0.4, 0.2, 0.7, 0.3];
|
|
13
|
-
export function useFallbackShape(shape, baseWidth, options) {
|
|
14
|
-
const width = useMemo(() => {
|
|
15
|
-
// When rectangle, lets vary the width a bit so things are
|
|
16
|
-
// a little less... uniform. Variety is nice.
|
|
17
|
-
if (shape === 'rectangle' && typeof baseWidth === 'number' && (!(options !== null && options !== void 0 && options.disableRandomRectWidth) || (options === null || options === void 0 ? void 0 : options.rectWidthVariant) !== undefined)) {
|
|
18
|
-
const modifier = (options === null || options === void 0 ? void 0 : options.rectWidthVariant) !== undefined ? WIDTH_MODIFIERS[options.rectWidthVariant % WIDTH_MODIFIERS.length] : Math.random();
|
|
19
|
-
const quarter = Math.round(baseWidth / 4);
|
|
20
|
-
const min = Math.max(baseWidth - quarter, 1);
|
|
21
|
-
const max = baseWidth + quarter;
|
|
22
|
-
return Math.floor(modifier * (max - min + 1)) + min;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// All other shapes need a fixed aspect ratio
|
|
26
|
-
return baseWidth;
|
|
27
|
-
}, [baseWidth, options, shape]);
|
|
28
|
-
const borderRadius = useMemo(() => {
|
|
29
|
-
if (shape === 'circle' && Number.isInteger(width)) {
|
|
30
|
-
return Number(width) / 2;
|
|
31
|
-
}
|
|
32
|
-
return shape === 'squircle' ? 8 : 0;
|
|
33
|
-
}, [shape, width]);
|
|
34
|
-
return useMemo(() => ({
|
|
35
|
-
borderRadius,
|
|
36
|
-
width
|
|
37
|
-
}), [borderRadius, width]);
|
|
38
|
-
}
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
13
|
const fallbackCss = "fallbackCss-f1n296p1";
|
|
14
|
+
const visuallyHiddenCss = "visuallyHiddenCss-v1e56i3u";
|
|
40
15
|
export const fallbackDefaultElement = 'div';
|
|
41
16
|
export const Fallback = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
42
17
|
let {
|
|
@@ -46,7 +21,8 @@ export const Fallback = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =>
|
|
|
46
21
|
width: baseWidth,
|
|
47
22
|
percentage,
|
|
48
23
|
disableRandomRectWidth,
|
|
49
|
-
rectWidthVariant
|
|
24
|
+
rectWidthVariant,
|
|
25
|
+
accessibilityLabel = 'Loading'
|
|
50
26
|
} = _ref,
|
|
51
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
52
28
|
const Component = as !== null && as !== void 0 ? as : fallbackDefaultElement;
|
|
@@ -65,19 +41,24 @@ export const Fallback = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =>
|
|
|
65
41
|
height,
|
|
66
42
|
borderRadius
|
|
67
43
|
}), [percentage, width, backgroundSizeHeight, height, borderRadius]);
|
|
68
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({
|
|
69
45
|
ref: ref,
|
|
70
46
|
as: Component,
|
|
71
47
|
flexGrow: 0,
|
|
72
48
|
flexShrink: 0,
|
|
49
|
+
position: "relative",
|
|
73
50
|
width: percentage && typeof width === 'number' ? "".concat(Math.min(width, 100), "%") : width
|
|
74
51
|
}, props), {}, {
|
|
75
|
-
children: /*#__PURE__*/_jsx(
|
|
52
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx("span", {
|
|
53
|
+
className: visuallyHiddenCss,
|
|
54
|
+
children: accessibilityLabel
|
|
55
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
56
|
+
"aria-hidden": "true",
|
|
76
57
|
className: fallbackCss,
|
|
77
|
-
style: style
|
|
78
|
-
|
|
79
|
-
})
|
|
58
|
+
style: style
|
|
59
|
+
})]
|
|
80
60
|
}));
|
|
81
61
|
}));
|
|
82
62
|
Fallback.displayName = 'Fallback';
|
|
63
|
+
export { useFallbackShape };
|
|
83
64
|
import "./Fallback.css";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
.contain-ct639h6{object-fit:contain;}
|
|
4
4
|
.hexagonOverflowCss-h106avb5{overflow:visible;}
|
|
5
5
|
.fallbackCss-fmd7ixe{background-repeat:no-repeat;background-size:cover;background-position:center;}.light .fallbackCss-fmd7ixe{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IiM1QjYxNkUiLz4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNSIgcj0iMyIgZmlsbD0id2hpdGUiLz4KPHJlY3QgeD0iMTEiIHk9IjYiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik01IDE1TDguNSA5TDEyIDE1SDVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K);}.dark .fallbackCss-fmd7ixe{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IiM4QTkxOUUiLz4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNSIgcj0iMyIgZmlsbD0iIzBBMEIwRCIvPgo8cmVjdCB4PSIxMSIgeT0iNiIgd2lkdGg9IjUiIGhlaWdodD0iNSIgZmlsbD0iIzBBMEIwRCIvPgo8cGF0aCBkPSJNNSAxNUw4LjUgOUwxMiAxNUg1WiIgZmlsbD0iIzBBMEIwRCIvPgo8L3N2Zz4K);}
|
|
6
|
-
.circle-c1oh4yoq{border-radius:
|
|
6
|
+
.circle-c1oh4yoq{border-radius:100000px;}
|
|
7
7
|
.squircle-s1exwfs9{border-radius:8px;}
|
|
8
8
|
.square-s117wpuw{border-radius:4px;}
|
|
9
|
-
.rectangle-r18cj7oi{border-radius:
|
|
10
|
-
.hexagon-h4bc24o{border-radius:
|
|
9
|
+
.rectangle-r18cj7oi{border-radius:0px;}
|
|
10
|
+
.hexagon-h4bc24o{border-radius:0px;}}
|
package/esm/media/RemoteImage.js
CHANGED
|
@@ -8,6 +8,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
8
8
|
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; }
|
|
9
9
|
import React, { memo, useMemo } from 'react';
|
|
10
10
|
import { remoteImageDarkFallbackSrc, remoteImageLightFallbackSrc } from '@coinbase/cds-common/media/remoteImageFallbackSrc';
|
|
11
|
+
import { shapeBorderRadius } from '@coinbase/cds-common/tokens/borderRadius';
|
|
11
12
|
import { cx } from '../cx';
|
|
12
13
|
import { Box } from '../layout/Box';
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@layer cds{.circle-cat65m8{border-radius:100%;}
|
|
2
2
|
.square-s4x9tgq{border-radius:4px;}
|
|
3
|
-
.hexagon-h112niag{border-radius:
|
|
3
|
+
.hexagon-h112niag{border-radius:0px;}
|
|
4
4
|
.squircle-s8clfq8{border-radius:8px;}
|
|
5
|
-
.rectangle-ra2rof2{border-radius:
|
|
5
|
+
.rectangle-ra2rof2{border-radius:0px;}
|
|
6
6
|
.isolateCss-i1shf7o1{isolation:isolate;}
|
|
7
7
|
.excessContainerCss-e1lnj2ws{box-sizing:content-box;}}
|
|
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
7
7
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
8
|
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; }
|
|
9
9
|
import React, { Children, isValidElement, useMemo } from 'react';
|
|
10
|
+
import { shapeBorderRadius } from '@coinbase/cds-common/tokens/borderRadius';
|
|
10
11
|
import { cx } from '../cx';
|
|
11
12
|
import { useTheme } from '../hooks/useTheme';
|
|
12
13
|
import { Box } from '../layout/Box';
|
|
@@ -15,8 +15,9 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
15
15
|
onEscPress,
|
|
16
16
|
disableTypeFocus,
|
|
17
17
|
disableFocusTrap,
|
|
18
|
-
includeTriggerInFocusTrap,
|
|
19
18
|
disableAutoFocus,
|
|
19
|
+
disableArrowKeyNavigation,
|
|
20
|
+
includeTriggerInFocusTrap,
|
|
20
21
|
respectNegativeTabIndex,
|
|
21
22
|
focusTabIndexElements,
|
|
22
23
|
autoFocusDelay,
|
|
@@ -57,9 +58,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
57
58
|
const document = (_getBrowserGlobals2 = getBrowserGlobals()) === null || _getBrowserGlobals2 === void 0 ? void 0 : _getBrowserGlobals2.document;
|
|
58
59
|
const activeElement = document === null || document === void 0 ? void 0 : document.activeElement;
|
|
59
60
|
if (!element || !document) return;
|
|
60
|
-
|
|
61
|
-
const activeElementIsTextArea = activeElement && Array.from(textAreas).includes(activeElement);
|
|
62
|
-
if (activeElementIsTextArea && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
61
|
+
if (disableArrowKeyNavigation && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
63
62
|
return;
|
|
64
63
|
}
|
|
65
64
|
let focusableElements = Array.from(element.querySelectorAll(focusTabIndexElements ? FOCUSABLE_ELEMENTS_INCLUDING_TABINDEX : FOCUSABLE_ELEMENTS));
|
|
@@ -163,7 +162,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
163
162
|
if ((event.key === 'ArrowUp' && activeElementIsMenuItemOrOption || event.key === 'Tab' && event.shiftKey) && activeElementIndex) {
|
|
164
163
|
focusPrevElement();
|
|
165
164
|
}
|
|
166
|
-
}, [focusTabIndexElements, disableTypeFocus, respectNegativeTabIndex, includeTriggerInFocusTrap]);
|
|
165
|
+
}, [focusTabIndexElements, disableTypeFocus, disableArrowKeyNavigation, respectNegativeTabIndex, includeTriggerInFocusTrap]);
|
|
167
166
|
const handleKeyDown = useCallback(event => {
|
|
168
167
|
// Update the keystroke history
|
|
169
168
|
updateKeystrokeHistory(event.key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "visible", "onRequestClose", "disableOverlayPress", "disablePortal", "disableFocusTrap", "accessibilityLabelledBy", "accessibilityLabel", "focusTabIndexElements", "restoreFocusOnUnmount", "width", "dangerouslyDisableResponsiveness", "dangerouslySetPosition", "shouldCloseOnEscPress", "hideCloseButton", "hideDividers", "maxWidth"];
|
|
1
|
+
const _excluded = ["children", "visible", "onRequestClose", "disableOverlayPress", "disablePortal", "disableFocusTrap", "accessibilityLabelledBy", "accessibilityLabel", "focusTabIndexElements", "restoreFocusOnUnmount", "disableArrowKeyNavigation", "width", "dangerouslyDisableResponsiveness", "dangerouslySetPosition", "shouldCloseOnEscPress", "hideCloseButton", "hideDividers", "maxWidth"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -48,6 +48,7 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
48
48
|
accessibilityLabel,
|
|
49
49
|
focusTabIndexElements = false,
|
|
50
50
|
restoreFocusOnUnmount = true,
|
|
51
|
+
disableArrowKeyNavigation,
|
|
51
52
|
width,
|
|
52
53
|
dangerouslyDisableResponsiveness = false,
|
|
53
54
|
dangerouslySetPosition,
|
|
@@ -111,6 +112,7 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
111
112
|
testID: "modal-dialog-motion",
|
|
112
113
|
width: width !== null && width !== void 0 ? width : defaultWidth,
|
|
113
114
|
children: /*#__PURE__*/_jsx(FocusTrap, {
|
|
115
|
+
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
114
116
|
disableFocusTrap: disableFocusTrap,
|
|
115
117
|
focusTabIndexElements: focusTabIndexElements,
|
|
116
118
|
onEscPress: shouldCloseOnEscPress ? handleClose : undefined,
|
|
@@ -108,6 +108,7 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
108
108
|
accessibilityLabelledBy,
|
|
109
109
|
focusTabIndexElements,
|
|
110
110
|
restoreFocusOnUnmount = true,
|
|
111
|
+
disableArrowKeyNavigation,
|
|
111
112
|
reduceMotion,
|
|
112
113
|
closeAccessibilityLabel = 'Close',
|
|
113
114
|
closeAccessibilityHint,
|
|
@@ -291,6 +292,7 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
291
292
|
children: /*#__PURE__*/_jsx(DragMotionProvider, {
|
|
292
293
|
enabled: !preventDismiss,
|
|
293
294
|
children: /*#__PURE__*/_jsx(FocusTrap, {
|
|
295
|
+
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
294
296
|
focusTabIndexElements: focusTabIndexElements,
|
|
295
297
|
onEscPress: preventDismiss ? undefined : handleClose,
|
|
296
298
|
restoreFocusOnUnmount: restoreFocusOnUnmount,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
@layer cds{.
|
|
1
|
+
@layer cds{.visuallyHiddenCss-v1l01hi5{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border:0;}
|
|
2
|
+
.tableCellCss-t189mbuy{padding:0;margin:0;vertical-align:middle;border:none;}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["title", "start", "end", "subtitle", "testID", "as", "outerSpacing", "innerSpacing", "disableRandomRectWidth", "rectWidthVariant"];
|
|
1
|
+
const _excluded = ["title", "start", "end", "subtitle", "testID", "as", "outerSpacing", "innerSpacing", "disableRandomRectWidth", "rectWidthVariant", "accessibilityLabel"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -6,14 +6,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
8
|
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; }
|
|
9
|
-
import
|
|
9
|
+
import { memo } from 'react';
|
|
10
10
|
import { getRectWidthVariant } from '@coinbase/cds-common/utils/getRectWidthVariant';
|
|
11
11
|
import { Cell } from '../cells/Cell';
|
|
12
12
|
import { MediaFallback } from '../cells/MediaFallback';
|
|
13
13
|
import { Fallback } from '../layout';
|
|
14
14
|
import { useTableCellSpacing, useTableCellTag, useTableContext } from './hooks/useTable';
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
const
|
|
16
|
+
const visuallyHiddenCss = "visuallyHiddenCss-v1l01hi5";
|
|
17
|
+
const tableCellCss = "tableCellCss-t189mbuy";
|
|
17
18
|
export const TableCellFallback = /*#__PURE__*/memo(_ref => {
|
|
18
19
|
let {
|
|
19
20
|
title,
|
|
@@ -25,7 +26,8 @@ export const TableCellFallback = /*#__PURE__*/memo(_ref => {
|
|
|
25
26
|
outerSpacing,
|
|
26
27
|
innerSpacing,
|
|
27
28
|
disableRandomRectWidth,
|
|
28
|
-
rectWidthVariant
|
|
29
|
+
rectWidthVariant,
|
|
30
|
+
accessibilityLabel = 'Loading Cell'
|
|
29
31
|
} = _ref,
|
|
30
32
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
33
|
const TableCellComponent = useTableCellTag(as);
|
|
@@ -46,17 +48,24 @@ export const TableCellFallback = /*#__PURE__*/memo(_ref => {
|
|
|
46
48
|
}, props), {}, {
|
|
47
49
|
children: /*#__PURE__*/_jsxs(Cell, {
|
|
48
50
|
accessory: end && /*#__PURE__*/_jsx(MediaFallback, {
|
|
51
|
+
"aria-hidden": true,
|
|
49
52
|
testID: "table-cell-fallback-accessory",
|
|
50
53
|
type: end
|
|
51
54
|
}),
|
|
52
55
|
gap: cellGap,
|
|
53
56
|
innerSpacing: cellInnerSpacing,
|
|
54
57
|
media: start && /*#__PURE__*/_jsx(MediaFallback, {
|
|
58
|
+
"aria-hidden": true,
|
|
55
59
|
testID: "table-cell-fallback-media",
|
|
56
60
|
type: start
|
|
57
61
|
}),
|
|
58
62
|
outerSpacing: cellOuterSpacing,
|
|
59
|
-
|
|
63
|
+
position: "relative",
|
|
64
|
+
children: [accessibilityLabel && /*#__PURE__*/_jsx("span", {
|
|
65
|
+
className: visuallyHiddenCss,
|
|
66
|
+
children: accessibilityLabel
|
|
67
|
+
}), title && /*#__PURE__*/_jsx(Fallback, {
|
|
68
|
+
"aria-hidden": true,
|
|
60
69
|
percentage: true,
|
|
61
70
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
62
71
|
height: 24,
|
|
@@ -64,6 +73,7 @@ export const TableCellFallback = /*#__PURE__*/memo(_ref => {
|
|
|
64
73
|
testID: "table-cell-fallback-title",
|
|
65
74
|
width: 45
|
|
66
75
|
}), subtitle && /*#__PURE__*/_jsx(Fallback, {
|
|
76
|
+
"aria-hidden": true,
|
|
67
77
|
percentage: true,
|
|
68
78
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
69
79
|
height: 16,
|
|
@@ -5,7 +5,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import React, { forwardRef, memo } from 'react';
|
|
7
7
|
import { animateProgressBaseSpec } from '@coinbase/cds-common/animation/progress';
|
|
8
|
-
import { usePreviousValues } from '@coinbase/cds-common/hooks/usePreviousValues';
|
|
9
8
|
import { useProgressSize } from '@coinbase/cds-common/visualizations/useProgressSize';
|
|
10
9
|
import { m as motion } from 'framer-motion';
|
|
11
10
|
import { cx } from '../cx';
|
|
@@ -16,7 +15,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
16
15
|
const MotionBox = motion(Box);
|
|
17
16
|
const boxCss = "boxCss-bnvjmt8";
|
|
18
17
|
export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
19
|
-
var _getPreviousPercent;
|
|
20
18
|
let {
|
|
21
19
|
weight = 'normal',
|
|
22
20
|
progress,
|
|
@@ -33,26 +31,22 @@ export const ProgressBar = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forw
|
|
|
33
31
|
onAnimationStart
|
|
34
32
|
} = _ref;
|
|
35
33
|
const height = useProgressSize(weight);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
addPreviousPercent(progress);
|
|
41
|
-
const previousPercent = (_getPreviousPercent = getPreviousPercent()) !== null && _getPreviousPercent !== void 0 ? _getPreviousPercent : 0;
|
|
42
|
-
const translateXStart = isRtl() ? 100 - previousPercent * 100 : -100 + previousPercent * 100;
|
|
43
|
-
const translateXEnd = isRtl() ? 100 - progress * 100 : -100 + progress * 100;
|
|
34
|
+
|
|
35
|
+
// start position of the progress bar on mount
|
|
36
|
+
const initialTranslateX = isRtl() ? 100 : -100;
|
|
37
|
+
const translateX = isRtl() ? 100 - progress * 100 : -100 + progress * 100;
|
|
44
38
|
const motionProps = useMotionProps({
|
|
45
39
|
style: {
|
|
46
40
|
originX: isRtl() ? 'right' : 'left'
|
|
47
41
|
},
|
|
48
42
|
animate: {
|
|
49
|
-
x:
|
|
43
|
+
x: "".concat(translateX, "%"),
|
|
50
44
|
opacity: 1
|
|
51
45
|
},
|
|
52
46
|
transition: animateProgressBaseSpec,
|
|
53
|
-
initial: !progress ? false : {
|
|
54
|
-
x: "".concat(
|
|
55
|
-
} // skip initial animation if no progress
|
|
47
|
+
initial: !progress || disableAnimateOnMount ? false : {
|
|
48
|
+
x: "".concat(initialTranslateX, "%")
|
|
49
|
+
} // skip initial animation if no progress or disableAnimateOnMount is true
|
|
56
50
|
});
|
|
57
51
|
return /*#__PURE__*/_jsx(HStack, {
|
|
58
52
|
ref: forwardedRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.52.1",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"react-dom": "^18.3.1"
|
|
208
208
|
},
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@coinbase/cds-common": "^8.
|
|
210
|
+
"@coinbase/cds-common": "^8.52.1",
|
|
211
211
|
"@coinbase/cds-icons": "^5.12.0",
|
|
212
212
|
"@coinbase/cds-illustrations": "^4.32.0",
|
|
213
213
|
"@coinbase/cds-lottie-files": "^3.3.4",
|