@coinbase/cds-mobile 9.22.1 → 9.24.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 -5
- package/README.md +1 -1
- package/dts/carousel/Carousel.d.ts +6 -0
- package/dts/carousel/Carousel.d.ts.map +1 -1
- package/dts/visualizations/chart/line/ReferenceLine.d.ts +28 -1
- package/dts/visualizations/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/DefaultScrubberBeacon.d.ts +1 -0
- package/dts/visualizations/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/Scrubber.d.ts +51 -1
- package/dts/visualizations/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/ScrubberBeaconGroup.d.ts +5 -0
- package/dts/visualizations/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +4 -0
- package/dts/visualizations/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -1
- package/esm/carousel/Carousel.js +27 -8
- package/esm/carousel/__stories__/Carousel.stories.js +25 -1
- package/esm/visualizations/chart/line/ReferenceLine.js +27 -15
- package/esm/visualizations/chart/scrubber/DefaultScrubberBeacon.js +7 -4
- package/esm/visualizations/chart/scrubber/DefaultScrubberBeaconLabel.js +4 -3
- package/esm/visualizations/chart/scrubber/Scrubber.js +30 -6
- package/esm/visualizations/chart/scrubber/ScrubberBeaconGroup.js +6 -2
- package/esm/visualizations/chart/scrubber/ScrubberBeaconLabelGroup.js +6 -2
- package/esm/visualizations/chart/scrubber/__stories__/Scrubber.stories.js +76 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
## 9.24.0 (2026-08-31)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### 🚀 Features
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Added a styles prop to the mobile Scrubber
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 9.23.0 (8/27/2026 PST)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
#### 🚀 Updates
|
|
10
|
+
|
|
11
|
+
- Add uncontrolled initialPage prop to Carousel. [[#864](https://github.com/coinbase/cds/pull/864)]
|
|
10
12
|
|
|
11
13
|
## 9.22.1 (8/25/2026 PST)
|
|
12
14
|
|
|
@@ -1342,3 +1344,7 @@ This is an artificial version bump with no new change.
|
|
|
1342
1344
|
## 8.12.0 (9/18/2025 PST)
|
|
1343
1345
|
|
|
1344
1346
|
- Prepare for open source release.
|
|
1347
|
+
|
|
1348
|
+
---
|
|
1349
|
+
|
|
1350
|
+
<sub>Release entries above are generated by `nx release` from version plans. See the [NPM registry](https://www.npmjs.com/package/@coinbase/cds-mobile) for published versions. `@coinbase/cds-mobile` adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).</sub>
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Add the relative path to the CDS icon font to your react-native.config.js. If yo
|
|
|
8
8
|
|
|
9
9
|
In this monorepo, run the `expo-app` targets from the repo root:
|
|
10
10
|
|
|
11
|
-
- `yarn nx run expo-app:
|
|
11
|
+
- `yarn nx run expo-app:ios` or `yarn nx run expo-app:android` for local development
|
|
12
12
|
|
|
13
13
|
### Outside monorepo
|
|
14
14
|
|
|
@@ -141,6 +141,12 @@ export type CarouselBaseProps = SharedProps &
|
|
|
141
141
|
* @default 'page'
|
|
142
142
|
*/
|
|
143
143
|
snapMode?: 'item' | 'page';
|
|
144
|
+
/**
|
|
145
|
+
* Zero-based page index to show on first layout, with no animation. Uncontrolled —
|
|
146
|
+
* updating it later does not move the carousel. Out-of-range values are clamped.
|
|
147
|
+
* @default 0
|
|
148
|
+
*/
|
|
149
|
+
initialPage?: number;
|
|
144
150
|
/**
|
|
145
151
|
* Hides the navigation arrows (previous/next buttons).
|
|
146
152
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKjE,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,eAAe,EACf,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAiB3B,MAAM,MAAM,0BAA0B,GAAG,CAAC,IAAI,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,KAAK,KAAK,CAAC,SAAS,CAAC;AAE3F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,GAChE,wBAAwB,GAAG;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,QAAQ,CAAC,EAAE,0BAA0B,GAAG,KAAK,CAAC,SAAS,CAAC;CACzD,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG,qBAAqB,CAAC;AAEnF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,EAAE,CAAC,iBAAi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AC3C,6CAopBF,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
TextVerticalAlignment,
|
|
7
7
|
} from '../text/ChartText';
|
|
8
8
|
import type { ChartInset } from '../utils/chart';
|
|
9
|
-
import type { LineComponent } from './Line';
|
|
9
|
+
import type { LineComponent, LineComponentProps } from './Line';
|
|
10
10
|
export type ReferenceLineLabelComponentProps = Pick<
|
|
11
11
|
ChartTextProps,
|
|
12
12
|
| 'x'
|
|
@@ -37,6 +37,31 @@ export type ReferenceLineLabelComponentProps = Pick<
|
|
|
37
37
|
boundsInset?: number | ChartInset;
|
|
38
38
|
};
|
|
39
39
|
export type ReferenceLineLabelComponent = React.FC<ReferenceLineLabelComponentProps>;
|
|
40
|
+
/**
|
|
41
|
+
* Cosmetic style props for a chart text label (reference line or scrubber label).
|
|
42
|
+
* Positioning, sizing, and animated opacity remain owned by the component; only
|
|
43
|
+
* visual styling is exposed.
|
|
44
|
+
*/
|
|
45
|
+
export type ChartLabelStyle = Pick<
|
|
46
|
+
ReferenceLineLabelComponentProps,
|
|
47
|
+
| 'color'
|
|
48
|
+
| 'background'
|
|
49
|
+
| 'borderRadius'
|
|
50
|
+
| 'fontWeight'
|
|
51
|
+
| 'fontFamilies'
|
|
52
|
+
| 'inset'
|
|
53
|
+
| 'paragraphAlignment'
|
|
54
|
+
>;
|
|
55
|
+
/** Custom styles for the individual elements of a reference line. */
|
|
56
|
+
export type ReferenceLineStyles = {
|
|
57
|
+
/**
|
|
58
|
+
* Style props applied to the line, forwarded to its `LineComponent`.
|
|
59
|
+
* @note `d` and the animated `strokeOpacity` remain owned by the component.
|
|
60
|
+
*/
|
|
61
|
+
line?: Omit<LineComponentProps, 'd' | 'animate' | 'strokeOpacity' | 'xAxisId' | 'yAxisId'>;
|
|
62
|
+
/** Style props applied to the label, forwarded to its `LabelComponent`. */
|
|
63
|
+
label?: ChartLabelStyle;
|
|
64
|
+
};
|
|
40
65
|
export type ReferenceLineBaseProps = {
|
|
41
66
|
/**
|
|
42
67
|
* Label content to display near the reference line.
|
|
@@ -108,6 +133,8 @@ export type ReferenceLineBaseProps = {
|
|
|
108
133
|
* @default 1
|
|
109
134
|
*/
|
|
110
135
|
opacity?: AnimatedProp<number>;
|
|
136
|
+
/** Custom styles for the individual elements of the reference line. */
|
|
137
|
+
styles?: ReferenceLineStyles;
|
|
111
138
|
};
|
|
112
139
|
type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
113
140
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEhE,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,cAAc,EACZ,GAAG,GACH,GAAG,GACH,UAAU,GACV,OAAO,GACP,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,g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,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/B,uEAAuE;IACvE,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,KAAK,4BAA4B,GAAG,sBAAsB,GAAG;IAC3D;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG,0BAA0B,CAAC;AAE3F,eAAO,MAAM,aAAa,0DAyJzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBzE,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC7D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBzE,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC7D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,qBAAqB,8LAgB7B,0BAA0B,GAAG;IAC9B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC,6CAgLF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/DefaultScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAK3D,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GACpE,IAAI,CACF,cAAc,EACd,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAChG,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/DefaultScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAK3D,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GACpE,IAAI,CACF,cAAc,EACd,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAChG,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,0BAA0B,uEAoCtC,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AnimatedProp, type SkParagraph } from '@shopify/react-native-skia';
|
|
3
2
|
import {
|
|
3
|
+
type AnimatedProp,
|
|
4
|
+
type GroupProps,
|
|
5
|
+
type RectProps,
|
|
6
|
+
type SkParagraph,
|
|
7
|
+
} from '@shopify/react-native-skia';
|
|
8
|
+
import {
|
|
9
|
+
type ChartLabelStyle,
|
|
4
10
|
type ReferenceLineBaseProps,
|
|
5
11
|
type ReferenceLineLabelComponentProps,
|
|
12
|
+
type ReferenceLineStyles,
|
|
6
13
|
} from '../line/ReferenceLine';
|
|
7
14
|
import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
|
|
8
15
|
import { type ChartInset, type Series } from '../utils/chart';
|
|
@@ -71,7 +78,16 @@ export type ScrubberBeaconBaseProps = {
|
|
|
71
78
|
*/
|
|
72
79
|
stroke?: string;
|
|
73
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Style props applied to the beacon's Skia group. Positioning and the animated
|
|
83
|
+
* visibility opacity remain owned by the component.
|
|
84
|
+
*/
|
|
85
|
+
export type ScrubberBeaconStyle = Omit<GroupProps, 'children' | 'opacity'>;
|
|
74
86
|
export type ScrubberBeaconProps = ScrubberBeaconBaseProps & {
|
|
87
|
+
/**
|
|
88
|
+
* Custom styles applied to the beacon group.
|
|
89
|
+
*/
|
|
90
|
+
style?: ScrubberBeaconStyle;
|
|
75
91
|
/**
|
|
76
92
|
* Transition configuration for beacon animations.
|
|
77
93
|
*/
|
|
@@ -117,6 +133,10 @@ export type ScrubberBeaconLabelProps = Pick<Series, 'color'> &
|
|
|
117
133
|
* Id of the series.
|
|
118
134
|
*/
|
|
119
135
|
seriesId: Series['id'];
|
|
136
|
+
/**
|
|
137
|
+
* Custom styles applied to the beacon label.
|
|
138
|
+
*/
|
|
139
|
+
style?: ChartLabelStyle;
|
|
120
140
|
};
|
|
121
141
|
export type ScrubberBeaconLabelComponent = React.FC<ScrubberBeaconLabelProps>;
|
|
122
142
|
export type ScrubberLabelProps = ReferenceLineLabelComponentProps;
|
|
@@ -207,6 +227,35 @@ export type ScrubberProps = ScrubberBaseProps & {
|
|
|
207
227
|
* @deprecationExpectedRemoval v4
|
|
208
228
|
*/
|
|
209
229
|
beaconTransitions?: ScrubberBeaconProps['transitions'];
|
|
230
|
+
/** Custom styles for individual elements of the Scrubber component */
|
|
231
|
+
styles?: {
|
|
232
|
+
/**
|
|
233
|
+
* Style props applied to the overlay rect which obscures data beyond the
|
|
234
|
+
* scrubber position. Accepts any Skia `Rect` paint prop (e.g. `color`,
|
|
235
|
+
* `blendMode`).
|
|
236
|
+
* @note `color` defaults to `theme.color.bg` and `opacity` defaults to `0.8`
|
|
237
|
+
* while scrubbing. `opacity` is used as the target for the show/hide
|
|
238
|
+
* transition rather than a static value.
|
|
239
|
+
*/
|
|
240
|
+
overlay?: Omit<RectProps, 'x' | 'y' | 'width' | 'height' | 'rect'>;
|
|
241
|
+
/**
|
|
242
|
+
* Style props applied to the beacon's Skia group.
|
|
243
|
+
* @note The animated visibility opacity remains owned by the component.
|
|
244
|
+
*/
|
|
245
|
+
beacon?: ScrubberBeaconStyle;
|
|
246
|
+
/**
|
|
247
|
+
* Style props applied to the scrubber line, forwarded to its `LineComponent`.
|
|
248
|
+
*/
|
|
249
|
+
line?: ReferenceLineStyles['line'];
|
|
250
|
+
/**
|
|
251
|
+
* Style props applied to the scrubber line label.
|
|
252
|
+
*/
|
|
253
|
+
label?: ReferenceLineStyles['label'];
|
|
254
|
+
/**
|
|
255
|
+
* Style props applied to the beacon labels.
|
|
256
|
+
*/
|
|
257
|
+
beaconLabel?: ChartLabelStyle;
|
|
258
|
+
};
|
|
210
259
|
};
|
|
211
260
|
export type ScrubberRef = ScrubberBeaconGroupRef;
|
|
212
261
|
/**
|
|
@@ -237,6 +286,7 @@ export declare const Scrubber: React.MemoExoticComponent<
|
|
|
237
286
|
beaconTransitions,
|
|
238
287
|
transitions,
|
|
239
288
|
beaconStroke,
|
|
289
|
+
styles,
|
|
240
290
|
}: ScrubberProps & {
|
|
241
291
|
ref?: React.Ref<ScrubberRef>;
|
|
242
292
|
}) => import('react/jsx-runtime').JSX.Element | undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAC;AAO1F,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAC;AAO1F,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,UAAU,EAGf,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAStD,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM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,OAAO,CAAC,CAAC;QACrC;;WAEG;QACH,WAAW,CAAC,EAAE,eAAe,CAAC;KAC/B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,QAAQ,2YA0BhB,aAAa,GAAG;IACjB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B,yDAmNF,CAAC"}
|
|
@@ -30,6 +30,10 @@ export type ScrubberBeaconGroupProps = ScrubberBeaconGroupBaseProps & {
|
|
|
30
30
|
* @default theme.color.bg
|
|
31
31
|
*/
|
|
32
32
|
stroke?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom styles applied to each beacon group.
|
|
35
|
+
*/
|
|
36
|
+
style?: ScrubberBeaconProps['style'];
|
|
33
37
|
};
|
|
34
38
|
export declare const ScrubberBeaconGroup: import('react').MemoExoticComponent<
|
|
35
39
|
({
|
|
@@ -39,6 +43,7 @@ export declare const ScrubberBeaconGroup: import('react').MemoExoticComponent<
|
|
|
39
43
|
transitions,
|
|
40
44
|
BeaconComponent,
|
|
41
45
|
stroke,
|
|
46
|
+
style,
|
|
42
47
|
}: ScrubberBeaconGroupProps & {
|
|
43
48
|
ref?: React.Ref<ScrubberBeaconGroupRef>;
|
|
44
49
|
}) => import('react/jsx-runtime').JSX.Element[]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberBeaconGroup.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberBeaconGroup.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrubberBeaconGroup.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberBeaconGroup.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;AA8HlG,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAAG;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD;;;OAGG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oHAS3B,wBAAwB,GAAG;IAC5B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;CACzC,+CAyEF,CAAC"}
|
|
@@ -41,6 +41,10 @@ export type ScrubberBeaconLabelGroupProps = ScrubberBeaconLabelGroupBaseProps &
|
|
|
41
41
|
* Transition configuration for beacon label animations.
|
|
42
42
|
*/
|
|
43
43
|
transitions?: ScrubberBeaconProps['transitions'];
|
|
44
|
+
/**
|
|
45
|
+
* Custom styles applied to each beacon label.
|
|
46
|
+
*/
|
|
47
|
+
style?: ScrubberBeaconLabelProps['style'];
|
|
44
48
|
};
|
|
45
49
|
export declare const ScrubberBeaconLabelGroup: import('react').NamedExoticComponent<ScrubberBeaconLabelGroupProps>;
|
|
46
50
|
//# sourceMappingURL=ScrubberBeaconLabelGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberBeaconLabelGroup.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberBeaconLabelGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAI3E,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrubberBeaconLabelGroup.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberBeaconLabelGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAI3E,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAyGpB,MAAM,MAAM,iCAAiC,GAAG;IAC9C;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAC9E;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,iCAAiC,GAAG;IAC9E;;;OAGG;IACH,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,qEAuNpC,CAAC"}
|
package/esm/carousel/Carousel.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const _excluded = ["ref"],
|
|
2
|
-
_excluded2 = ["children", "title", "hideNavigation", "hidePagination", "paginationVariant", "drag", "snapMode", "NavigationComponent", "PaginationComponent", "style", "styles", "nextPageAccessibilityLabel", "previousPageAccessibilityLabel", "startAutoplayAccessibilityLabel", "stopAutoplayAccessibilityLabel", "paginationAccessibilityLabel", "onChangePage", "onDragStart", "onDragEnd", "loop", "autoplay", "autoplayInterval"];
|
|
2
|
+
_excluded2 = ["children", "title", "hideNavigation", "hidePagination", "paginationVariant", "drag", "snapMode", "initialPage", "NavigationComponent", "PaginationComponent", "style", "styles", "nextPageAccessibilityLabel", "previousPageAccessibilityLabel", "startAutoplayAccessibilityLabel", "stopAutoplayAccessibilityLabel", "paginationAccessibilityLabel", "onChangePage", "onDragStart", "onDragEnd", "loop", "autoplay", "autoplayInterval"];
|
|
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
|
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); }
|
|
5
|
-
import React, { memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import React, { memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import { View } from 'react-native';
|
|
7
7
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
8
8
|
import { useCarouselAutoplay } from '@coinbase/cds-common/carousel/useCarouselAutoplay';
|
|
@@ -270,6 +270,7 @@ export const Carousel = /*#__PURE__*/memo(_ref4 => {
|
|
|
270
270
|
paginationVariant,
|
|
271
271
|
drag = 'snap',
|
|
272
272
|
snapMode = 'page',
|
|
273
|
+
initialPage,
|
|
273
274
|
NavigationComponent = DefaultCarouselNavigation,
|
|
274
275
|
PaginationComponent = DefaultCarouselPagination,
|
|
275
276
|
style,
|
|
@@ -288,11 +289,12 @@ export const Carousel = /*#__PURE__*/memo(_ref4 => {
|
|
|
288
289
|
} = mergedProps,
|
|
289
290
|
props = _objectWithoutPropertiesLoose(mergedProps, _excluded2);
|
|
290
291
|
const carouselScrollX = useRef(0);
|
|
292
|
+
const hasAppliedInitialPageRef = useRef(false);
|
|
291
293
|
const animationApi = useSpring({
|
|
292
294
|
x: carouselScrollX.current,
|
|
293
295
|
config: animationConfig
|
|
294
296
|
});
|
|
295
|
-
const [activePageIndex, setActivePageIndex] = useState(0);
|
|
297
|
+
const [activePageIndex, setActivePageIndex] = useState(() => Math.max(0, initialPage != null ? initialPage : 0));
|
|
296
298
|
const [containerSize, onLayout] = useLayout();
|
|
297
299
|
const [carouselItemRects, setCarouselItemRects] = useState({});
|
|
298
300
|
const [visibleCarouselItems, setVisibleCarouselItems] = useState(new Set());
|
|
@@ -424,18 +426,35 @@ export const Carousel = /*#__PURE__*/memo(_ref4 => {
|
|
|
424
426
|
enabled: autoplay != null ? autoplay : false,
|
|
425
427
|
interval: autoplayInterval
|
|
426
428
|
});
|
|
427
|
-
const goToPage = useCallback(page
|
|
429
|
+
const goToPage = useCallback(function (page, _temp) {
|
|
430
|
+
let {
|
|
431
|
+
animate: shouldAnimate = true
|
|
432
|
+
} = _temp === void 0 ? {} : _temp;
|
|
428
433
|
const newPage = Math.max(0, Math.min(totalPages - 1, page));
|
|
429
434
|
updateActivePageIndex(newPage);
|
|
430
435
|
updateVisibleCarouselItems(pageOffsets[newPage]);
|
|
431
436
|
const targetOffset = isLoopingActive ? findNearestLoopOffset(carouselScrollX.current, [pageOffsets[newPage]], loopLength).offset : pageOffsets[newPage];
|
|
432
437
|
carouselScrollX.current = targetOffset;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
438
|
+
if (shouldAnimate) {
|
|
439
|
+
animationApi.x.start({
|
|
440
|
+
to: targetOffset,
|
|
441
|
+
config: animationConfig
|
|
442
|
+
});
|
|
443
|
+
} else {
|
|
444
|
+
animationApi.x.set(targetOffset);
|
|
445
|
+
}
|
|
437
446
|
reset();
|
|
438
447
|
}, [totalPages, updateActivePageIndex, updateVisibleCarouselItems, pageOffsets, isLoopingActive, loopLength, animationApi.x, reset]);
|
|
448
|
+
useLayoutEffect(() => {
|
|
449
|
+
if (hasAppliedInitialPageRef.current || totalPages === 0) return;
|
|
450
|
+
hasAppliedInitialPageRef.current = true;
|
|
451
|
+
const targetPage = initialPage != null ? initialPage : 0;
|
|
452
|
+
if (targetPage > 0) {
|
|
453
|
+
goToPage(targetPage, {
|
|
454
|
+
animate: false
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}, [totalPages, initialPage, goToPage]);
|
|
439
458
|
useImperativeHandle(ref, () => ({
|
|
440
459
|
activePageIndex,
|
|
441
460
|
totalPages,
|
|
@@ -650,6 +650,30 @@ const ImperativeApiExample = () => {
|
|
|
650
650
|
})
|
|
651
651
|
});
|
|
652
652
|
};
|
|
653
|
+
const InitialPageExample = () => {
|
|
654
|
+
const theme = useTheme();
|
|
655
|
+
return /*#__PURE__*/_jsx(Example, {
|
|
656
|
+
paddingX: 0,
|
|
657
|
+
children: /*#__PURE__*/_jsx(Carousel, {
|
|
658
|
+
initialPage: 2,
|
|
659
|
+
snapMode: "page",
|
|
660
|
+
styles: {
|
|
661
|
+
root: {
|
|
662
|
+
paddingHorizontal: theme.space[2]
|
|
663
|
+
},
|
|
664
|
+
carousel: {
|
|
665
|
+
gap: theme.space[2]
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
title: "Initial Page (opens on page 3)",
|
|
669
|
+
children: sampleItems.slice(0, 5).map((item, index) => /*#__PURE__*/_jsx(CarouselItem, {
|
|
670
|
+
id: "initial-page-" + index,
|
|
671
|
+
width: "100%",
|
|
672
|
+
children: item
|
|
673
|
+
}, "initial-page-" + index))
|
|
674
|
+
})
|
|
675
|
+
});
|
|
676
|
+
};
|
|
653
677
|
const LoopingExamples = () => {
|
|
654
678
|
const theme = useTheme();
|
|
655
679
|
const horizontalPadding = theme.space[2];
|
|
@@ -846,6 +870,6 @@ const AnimatedPaginationExample = () => {
|
|
|
846
870
|
export default function CarouselScreen() {
|
|
847
871
|
return /*#__PURE__*/_jsxs(ExampleScreen, {
|
|
848
872
|
paddingX: 0,
|
|
849
|
-
children: [/*#__PURE__*/_jsx(BasicExamples, {}), /*#__PURE__*/_jsx(CustomComponentsExample, {}), /*#__PURE__*/_jsx(DynamicContentExample, {}), /*#__PURE__*/_jsx(AnimatedExample, {}), /*#__PURE__*/_jsx(ImperativeApiExample, {}), /*#__PURE__*/_jsx(AnimatedPaginationExample, {}), /*#__PURE__*/_jsx(LoopingExamples, {}), /*#__PURE__*/_jsx(AutoplayExample, {})]
|
|
873
|
+
children: [/*#__PURE__*/_jsx(BasicExamples, {}), /*#__PURE__*/_jsx(CustomComponentsExample, {}), /*#__PURE__*/_jsx(DynamicContentExample, {}), /*#__PURE__*/_jsx(AnimatedExample, {}), /*#__PURE__*/_jsx(ImperativeApiExample, {}), /*#__PURE__*/_jsx(AnimatedPaginationExample, {}), /*#__PURE__*/_jsx(LoopingExamples, {}), /*#__PURE__*/_jsx(AutoplayExample, {}), /*#__PURE__*/_jsx(InitialPageExample, {})]
|
|
850
874
|
});
|
|
851
875
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1
2
|
import { memo } from 'react';
|
|
2
3
|
import { useDerivedValue } from 'react-native-reanimated';
|
|
3
4
|
import { useTheme } from '../../../hooks/useTheme';
|
|
@@ -6,6 +7,14 @@ import { unwrapAnimatedValue } from '../utils/chart';
|
|
|
6
7
|
import { getPointOnSerializableScale } from '../utils/point';
|
|
7
8
|
import { DefaultReferenceLineLabel } from './DefaultReferenceLineLabel';
|
|
8
9
|
import { DottedLine } from './DottedLine';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Cosmetic style props for a chart text label (reference line or scrubber label).
|
|
13
|
+
* Positioning, sizing, and animated opacity remain owned by the component; only
|
|
14
|
+
* visual styling is exposed.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Custom styles for the individual elements of a reference line. */
|
|
9
18
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
19
|
export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
11
20
|
let {
|
|
@@ -25,7 +34,8 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
25
34
|
labelBoundsInset,
|
|
26
35
|
stroke,
|
|
27
36
|
strokeWidth,
|
|
28
|
-
opacity = 1
|
|
37
|
+
opacity = 1,
|
|
38
|
+
styles
|
|
29
39
|
} = _ref;
|
|
30
40
|
const theme = useTheme();
|
|
31
41
|
const {
|
|
@@ -78,13 +88,13 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
78
88
|
labelX = drawingArea.x + drawingArea.width;
|
|
79
89
|
}
|
|
80
90
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
|
-
children: [/*#__PURE__*/_jsx(LineComponent, {
|
|
91
|
+
children: [/*#__PURE__*/_jsx(LineComponent, _extends({
|
|
82
92
|
animate: false,
|
|
83
|
-
d: horizontalLine,
|
|
84
93
|
stroke: effectiveLineStroke,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
strokeWidth: strokeWidth,
|
|
95
|
+
d: horizontalLine,
|
|
96
|
+
strokeOpacity: opacity
|
|
97
|
+
}, styles == null ? void 0 : styles.line)), label && /*#__PURE__*/_jsx(LabelComponent, _extends({
|
|
88
98
|
boundsInset: labelBoundsInset,
|
|
89
99
|
dx: labelDx,
|
|
90
100
|
dy: labelDy,
|
|
@@ -94,9 +104,10 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
94
104
|
opacity: labelOpacity,
|
|
95
105
|
verticalAlignment: labelVerticalAlignment != null ? labelVerticalAlignment : isHorizontal ? 'middle' : undefined,
|
|
96
106
|
x: labelX,
|
|
97
|
-
y: labelYPixel
|
|
107
|
+
y: labelYPixel
|
|
108
|
+
}, styles == null ? void 0 : styles.label, {
|
|
98
109
|
children: label
|
|
99
|
-
})]
|
|
110
|
+
}))]
|
|
100
111
|
});
|
|
101
112
|
}
|
|
102
113
|
|
|
@@ -111,13 +122,13 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
111
122
|
labelY = drawingArea.y + drawingArea.height;
|
|
112
123
|
}
|
|
113
124
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
114
|
-
children: [/*#__PURE__*/_jsx(LineComponent, {
|
|
125
|
+
children: [/*#__PURE__*/_jsx(LineComponent, _extends({
|
|
115
126
|
animate: false,
|
|
116
|
-
d: verticalLine,
|
|
117
127
|
stroke: effectiveLineStroke,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
128
|
+
strokeWidth: strokeWidth,
|
|
129
|
+
d: verticalLine,
|
|
130
|
+
strokeOpacity: opacity
|
|
131
|
+
}, styles == null ? void 0 : styles.line)), label && /*#__PURE__*/_jsx(LabelComponent, _extends({
|
|
121
132
|
boundsInset: labelBoundsInset,
|
|
122
133
|
dx: labelDx,
|
|
123
134
|
dy: labelDy,
|
|
@@ -127,9 +138,10 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
127
138
|
opacity: labelOpacity,
|
|
128
139
|
verticalAlignment: labelVerticalAlignment,
|
|
129
140
|
x: labelXPixel,
|
|
130
|
-
y: labelY
|
|
141
|
+
y: labelY
|
|
142
|
+
}, styles == null ? void 0 : styles.label, {
|
|
131
143
|
children: label
|
|
132
|
-
})]
|
|
144
|
+
}))]
|
|
133
145
|
});
|
|
134
146
|
}
|
|
135
147
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1
2
|
import { memo, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
2
3
|
import { cancelAnimation, Easing, useAnimatedReaction, useDerivedValue, useSharedValue, withDelay, withRepeat, withSequence, withTiming } from 'react-native-reanimated';
|
|
3
4
|
import { Circle, Group } from '@shopify/react-native-skia';
|
|
@@ -33,7 +34,8 @@ export const DefaultScrubberBeacon = /*#__PURE__*/memo(_ref => {
|
|
|
33
34
|
opacity: opacityProp = 1,
|
|
34
35
|
radius = defaultRadius,
|
|
35
36
|
stroke,
|
|
36
|
-
strokeWidth = defaultStrokeWidth
|
|
37
|
+
strokeWidth = defaultStrokeWidth,
|
|
38
|
+
style
|
|
37
39
|
} = _ref;
|
|
38
40
|
const theme = useTheme();
|
|
39
41
|
const {
|
|
@@ -163,8 +165,9 @@ export const DefaultScrubberBeacon = /*#__PURE__*/memo(_ref => {
|
|
|
163
165
|
const userOpacity = unwrapAnimatedValue(opacityProp);
|
|
164
166
|
return isWithinDrawingArea ? userOpacity : 0;
|
|
165
167
|
}, [targetPoint, drawingArea, opacityProp]);
|
|
166
|
-
return /*#__PURE__*/_jsxs(Group, {
|
|
167
|
-
opacity: beaconOpacity
|
|
168
|
+
return /*#__PURE__*/_jsxs(Group, _extends({
|
|
169
|
+
opacity: beaconOpacity
|
|
170
|
+
}, style, {
|
|
168
171
|
children: [/*#__PURE__*/_jsx(Circle, {
|
|
169
172
|
c: animatedPoint,
|
|
170
173
|
color: color,
|
|
@@ -179,5 +182,5 @@ export const DefaultScrubberBeacon = /*#__PURE__*/memo(_ref => {
|
|
|
179
182
|
color: color,
|
|
180
183
|
r: radius - strokeWidth / 2
|
|
181
184
|
})]
|
|
182
|
-
});
|
|
185
|
+
}));
|
|
183
186
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["background", "color", "elevated", "borderRadius", "font", "verticalAlignment", "inset", "label"];
|
|
1
|
+
const _excluded = ["background", "color", "elevated", "borderRadius", "font", "verticalAlignment", "inset", "label", "style"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import { memo } from 'react';
|
|
@@ -24,7 +24,8 @@ export const DefaultScrubberBeaconLabel = /*#__PURE__*/memo(_ref => {
|
|
|
24
24
|
top: labelVerticalInset,
|
|
25
25
|
bottom: labelVerticalInset
|
|
26
26
|
},
|
|
27
|
-
label
|
|
27
|
+
label,
|
|
28
|
+
style
|
|
28
29
|
} = _ref,
|
|
29
30
|
chartTextProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
30
31
|
const theme = useTheme();
|
|
@@ -37,7 +38,7 @@ export const DefaultScrubberBeaconLabel = /*#__PURE__*/memo(_ref => {
|
|
|
37
38
|
inset: inset,
|
|
38
39
|
repositionAxes: "none",
|
|
39
40
|
verticalAlignment: verticalAlignment
|
|
40
|
-
}, chartTextProps, {
|
|
41
|
+
}, chartTextProps, style, {
|
|
41
42
|
children: label
|
|
42
43
|
}));
|
|
43
44
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
const _excluded = ["opacity"];
|
|
1
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; }
|
|
2
4
|
import React, { memo, useCallback, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
3
5
|
import { runOnJS, useAnimatedReaction, useDerivedValue, useSharedValue } from 'react-native-reanimated';
|
|
4
6
|
import { Group, Paint, Rect } from '@shopify/react-native-skia';
|
|
@@ -12,11 +14,17 @@ import { DefaultScrubberBeacon } from './DefaultScrubberBeacon';
|
|
|
12
14
|
import { DefaultScrubberLabel } from './DefaultScrubberLabel';
|
|
13
15
|
import { ScrubberBeaconGroup } from './ScrubberBeaconGroup';
|
|
14
16
|
import { ScrubberBeaconLabelGroup } from './ScrubberBeaconLabelGroup';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Style props applied to the beacon's Skia group. Positioning and the animated
|
|
20
|
+
* visibility opacity remain owned by the component.
|
|
21
|
+
*/
|
|
15
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
23
|
/**
|
|
17
24
|
* Unified component that manages all scrubber elements (beacons, line, labels).
|
|
18
25
|
*/
|
|
19
26
|
export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
27
|
+
var _styles$overlay;
|
|
20
28
|
let {
|
|
21
29
|
ref,
|
|
22
30
|
seriesIds,
|
|
@@ -40,7 +48,8 @@ export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
|
40
48
|
idlePulse,
|
|
41
49
|
beaconTransitions,
|
|
42
50
|
transitions = beaconTransitions,
|
|
43
|
-
beaconStroke
|
|
51
|
+
beaconStroke,
|
|
52
|
+
styles
|
|
44
53
|
} = _ref;
|
|
45
54
|
const theme = useTheme();
|
|
46
55
|
const beaconGroupRef = React.useRef(null);
|
|
@@ -93,9 +102,18 @@ export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
|
93
102
|
const lineOpacity = useDerivedValue(() => {
|
|
94
103
|
return scrubberPosition.value !== undefined ? 1 : 0;
|
|
95
104
|
}, [scrubberPosition]);
|
|
105
|
+
|
|
106
|
+
// Pull `opacity` out of the overlay style so it can drive the animated
|
|
107
|
+
// show/hide transition rather than being applied as a static value.
|
|
108
|
+
const _ref2 = (_styles$overlay = styles == null ? void 0 : styles.overlay) != null ? _styles$overlay : {},
|
|
109
|
+
{
|
|
110
|
+
opacity: overlayStyleOpacity
|
|
111
|
+
} = _ref2,
|
|
112
|
+
overlayStyle = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
113
|
+
const overlayActiveOpacity = overlayStyleOpacity != null ? overlayStyleOpacity : 0.8;
|
|
96
114
|
const overlayOpacity = useDerivedValue(() => {
|
|
97
|
-
return scrubberPosition.value !== undefined ?
|
|
98
|
-
}, [scrubberPosition]);
|
|
115
|
+
return scrubberPosition.value !== undefined ? overlayActiveOpacity : 0;
|
|
116
|
+
}, [scrubberPosition, overlayActiveOpacity]);
|
|
99
117
|
const pixelPosition = useDerivedValue(() => {
|
|
100
118
|
if (dataValue.value === undefined || !indexScale) return undefined;
|
|
101
119
|
return getPointOnSerializableScale(dataValue.value, indexScale);
|
|
@@ -161,14 +179,14 @@ export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
|
161
179
|
layer: /*#__PURE__*/_jsx(Paint, {
|
|
162
180
|
opacity: scrubberOpacity
|
|
163
181
|
}),
|
|
164
|
-
children: [!hideOverlay && /*#__PURE__*/_jsx(Rect, {
|
|
182
|
+
children: [!hideOverlay && /*#__PURE__*/_jsx(Rect, _extends({
|
|
165
183
|
color: theme.color.bg,
|
|
166
184
|
height: overlayHeight,
|
|
167
185
|
opacity: overlayOpacity,
|
|
168
186
|
width: overlayWidth,
|
|
169
187
|
x: overlayX,
|
|
170
188
|
y: overlayY
|
|
171
|
-
}), !hideLine && /*#__PURE__*/_jsx(ReferenceLine, _extends({
|
|
189
|
+
}, overlayStyle)), !hideLine && /*#__PURE__*/_jsx(ReferenceLine, _extends({
|
|
172
190
|
LabelComponent: LabelComponent,
|
|
173
191
|
LineComponent: LineComponent
|
|
174
192
|
}, categoryAxisIsX ? {
|
|
@@ -181,13 +199,18 @@ export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
|
181
199
|
labelElevated: labelElevated,
|
|
182
200
|
labelFont: labelFont,
|
|
183
201
|
opacity: lineOpacity,
|
|
184
|
-
stroke: lineStroke
|
|
202
|
+
stroke: lineStroke,
|
|
203
|
+
styles: {
|
|
204
|
+
line: styles == null ? void 0 : styles.line,
|
|
205
|
+
label: styles == null ? void 0 : styles.label
|
|
206
|
+
}
|
|
185
207
|
})), /*#__PURE__*/_jsx(ScrubberBeaconGroup, {
|
|
186
208
|
ref: beaconGroupRef,
|
|
187
209
|
BeaconComponent: BeaconComponent,
|
|
188
210
|
idlePulse: idlePulse,
|
|
189
211
|
seriesIds: filteredSeriesIds,
|
|
190
212
|
stroke: beaconStroke,
|
|
213
|
+
style: styles == null ? void 0 : styles.beacon,
|
|
191
214
|
transitions: transitions
|
|
192
215
|
}), showBeaconLabels && /*#__PURE__*/_jsx(ScrubberBeaconLabelGroup, {
|
|
193
216
|
BeaconLabelComponent: BeaconLabelComponent,
|
|
@@ -196,6 +219,7 @@ export const Scrubber = /*#__PURE__*/memo(_ref => {
|
|
|
196
219
|
labelMinGap: beaconLabelMinGap,
|
|
197
220
|
labelPreferredSide: beaconLabelPreferredSide,
|
|
198
221
|
labels: beaconLabels,
|
|
222
|
+
style: styles == null ? void 0 : styles.beaconLabel,
|
|
199
223
|
transitions: transitions
|
|
200
224
|
})]
|
|
201
225
|
});
|
|
@@ -20,7 +20,8 @@ const BeaconWithData = /*#__PURE__*/memo(_ref => {
|
|
|
20
20
|
animate,
|
|
21
21
|
transitions,
|
|
22
22
|
beaconRef,
|
|
23
|
-
stroke
|
|
23
|
+
stroke,
|
|
24
|
+
style
|
|
24
25
|
} = _ref;
|
|
25
26
|
const {
|
|
26
27
|
layout,
|
|
@@ -95,6 +96,7 @@ const BeaconWithData = /*#__PURE__*/memo(_ref => {
|
|
|
95
96
|
isIdle: isIdle,
|
|
96
97
|
seriesId: seriesId,
|
|
97
98
|
stroke: stroke,
|
|
99
|
+
style: style,
|
|
98
100
|
transitions: transitions
|
|
99
101
|
});
|
|
100
102
|
});
|
|
@@ -105,7 +107,8 @@ export const ScrubberBeaconGroup = /*#__PURE__*/memo(_ref2 => {
|
|
|
105
107
|
idlePulse,
|
|
106
108
|
transitions,
|
|
107
109
|
BeaconComponent = DefaultScrubberBeacon,
|
|
108
|
-
stroke
|
|
110
|
+
stroke,
|
|
111
|
+
style
|
|
109
112
|
} = _ref2;
|
|
110
113
|
const ScrubberBeaconRefs = useRefMap();
|
|
111
114
|
const {
|
|
@@ -166,6 +169,7 @@ export const ScrubberBeaconGroup = /*#__PURE__*/memo(_ref2 => {
|
|
|
166
169
|
isIdle: isIdle,
|
|
167
170
|
seriesId: s.id,
|
|
168
171
|
stroke: stroke,
|
|
172
|
+
style: style,
|
|
169
173
|
transitions: transitions
|
|
170
174
|
}, s.id));
|
|
171
175
|
});
|
|
@@ -22,7 +22,8 @@ const PositionedLabel = /*#__PURE__*/memo(_ref => {
|
|
|
22
22
|
onDimensionsChange,
|
|
23
23
|
BeaconLabelComponent,
|
|
24
24
|
labelHorizontalOffset,
|
|
25
|
-
labelFont
|
|
25
|
+
labelFont,
|
|
26
|
+
style
|
|
26
27
|
} = _ref;
|
|
27
28
|
const opacity = useDerivedValue(() => positions.value[index] !== null ? 1 : 0, [positions, index]);
|
|
28
29
|
const x = useDerivedValue(() => {
|
|
@@ -74,6 +75,7 @@ const PositionedLabel = /*#__PURE__*/memo(_ref => {
|
|
|
74
75
|
onDimensionsChange: d => onDimensionsChange(seriesId, d),
|
|
75
76
|
opacity: opacity,
|
|
76
77
|
seriesId: seriesId,
|
|
78
|
+
style: style,
|
|
77
79
|
x: x,
|
|
78
80
|
y: y
|
|
79
81
|
});
|
|
@@ -86,7 +88,8 @@ export const ScrubberBeaconLabelGroup = /*#__PURE__*/memo(_ref2 => {
|
|
|
86
88
|
labelFont,
|
|
87
89
|
labelPreferredSide = 'right',
|
|
88
90
|
BeaconLabelComponent = DefaultScrubberBeaconLabel,
|
|
89
|
-
transitions
|
|
91
|
+
transitions,
|
|
92
|
+
style
|
|
90
93
|
} = _ref2;
|
|
91
94
|
const {
|
|
92
95
|
getSeries,
|
|
@@ -227,6 +230,7 @@ export const ScrubberBeaconLabelGroup = /*#__PURE__*/memo(_ref2 => {
|
|
|
227
230
|
position: currentPosition,
|
|
228
231
|
positions: allLabelPositions,
|
|
229
232
|
seriesId: info.seriesId,
|
|
233
|
+
style: style,
|
|
230
234
|
updateTransition: updateTransition
|
|
231
235
|
}, info.seriesId);
|
|
232
236
|
});
|
|
@@ -704,6 +704,76 @@ const HideOverlay = () => {
|
|
|
704
704
|
})
|
|
705
705
|
});
|
|
706
706
|
};
|
|
707
|
+
const CustomOverlay = () => {
|
|
708
|
+
const theme = useTheme();
|
|
709
|
+
return /*#__PURE__*/_jsx(LineChart, {
|
|
710
|
+
enableScrubbing: true,
|
|
711
|
+
showArea: true,
|
|
712
|
+
accessibilityLabel: chartAccessibilityLabel,
|
|
713
|
+
getScrubberAccessibilityLabel: getScrubberAccessibilityLabel,
|
|
714
|
+
height: 150,
|
|
715
|
+
series: [{
|
|
716
|
+
id: 'prices',
|
|
717
|
+
data: sampleData
|
|
718
|
+
}],
|
|
719
|
+
children: /*#__PURE__*/_jsx(Scrubber, {
|
|
720
|
+
styles: {
|
|
721
|
+
overlay: {
|
|
722
|
+
color: theme.color.bgAlternate,
|
|
723
|
+
opacity: 0.6
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
})
|
|
727
|
+
});
|
|
728
|
+
};
|
|
729
|
+
const CustomStyles = () => {
|
|
730
|
+
const theme = useTheme();
|
|
731
|
+
return /*#__PURE__*/_jsx(LineChart, {
|
|
732
|
+
enableScrubbing: true,
|
|
733
|
+
showArea: true,
|
|
734
|
+
showYAxis: true,
|
|
735
|
+
accessibilityLabel: chartAccessibilityLabel,
|
|
736
|
+
getScrubberAccessibilityLabel: getScrubberAccessibilityLabel,
|
|
737
|
+
height: 200,
|
|
738
|
+
inset: {
|
|
739
|
+
top: 40
|
|
740
|
+
},
|
|
741
|
+
series: [{
|
|
742
|
+
id: 'prices',
|
|
743
|
+
data: sampleData,
|
|
744
|
+
label: 'Price'
|
|
745
|
+
}],
|
|
746
|
+
yAxis: {
|
|
747
|
+
showGrid: true
|
|
748
|
+
},
|
|
749
|
+
children: /*#__PURE__*/_jsx(Scrubber, {
|
|
750
|
+
hideBeaconLabels: false,
|
|
751
|
+
label: dataIndex => "Day " + (dataIndex + 1),
|
|
752
|
+
labelElevated: true,
|
|
753
|
+
styles: {
|
|
754
|
+
overlay: {
|
|
755
|
+
color: theme.color.bgAlternate,
|
|
756
|
+
opacity: 0.6
|
|
757
|
+
},
|
|
758
|
+
beacon: {
|
|
759
|
+
blendMode: 'multiply'
|
|
760
|
+
},
|
|
761
|
+
line: {
|
|
762
|
+
stroke: theme.color.fgPrimary,
|
|
763
|
+
strokeWidth: 2
|
|
764
|
+
},
|
|
765
|
+
label: {
|
|
766
|
+
color: theme.color.fgInverse,
|
|
767
|
+
background: theme.color.fgPrimary
|
|
768
|
+
},
|
|
769
|
+
beaconLabel: {
|
|
770
|
+
color: theme.color.fgInverse,
|
|
771
|
+
background: theme.color.fgPrimary
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
});
|
|
776
|
+
};
|
|
707
777
|
const matchupBlueData = [47, 50, 51, 52, 53, 53, 53, 53, 52, 51, 51, 52, 53, 55, 57, 58, 59, 61, 63, 65, 64, 64, 64, 64, 64, 63, 63, 63, 64, 66, 68, 70, 71, 72, 74, 76, 76, 75, 74, 73, 74, 75, 75, 78];
|
|
708
778
|
const matchupRedData = matchupBlueData.map(value => 100 - value);
|
|
709
779
|
const matchupTeamLabels = {
|
|
@@ -890,6 +960,12 @@ const ExampleNavigator = () => {
|
|
|
890
960
|
}, {
|
|
891
961
|
title: 'Hide Overlay',
|
|
892
962
|
component: /*#__PURE__*/_jsx(HideOverlay, {})
|
|
963
|
+
}, {
|
|
964
|
+
title: 'Custom Overlay',
|
|
965
|
+
component: /*#__PURE__*/_jsx(CustomOverlay, {})
|
|
966
|
+
}, {
|
|
967
|
+
title: 'Custom Styles',
|
|
968
|
+
component: /*#__PURE__*/_jsx(CustomStyles, {})
|
|
893
969
|
}, {
|
|
894
970
|
title: 'Matchup Beacon Labels',
|
|
895
971
|
component: /*#__PURE__*/_jsx(MatchupBeaconLabels, {})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.24.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"react-native-worklets": "0.5.2"
|
|
219
219
|
},
|
|
220
220
|
"dependencies": {
|
|
221
|
-
"@coinbase/cds-common": "^9.
|
|
221
|
+
"@coinbase/cds-common": "^9.24.0",
|
|
222
222
|
"@coinbase/cds-icons": "^5.22.0",
|
|
223
223
|
"@coinbase/cds-illustrations": "^4.48.0",
|
|
224
224
|
"@coinbase/cds-lottie-files": "^3.3.4",
|