@multiplatform.one/components 9.1.0 → 9.2.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/dist/cjs/SheetModal/SheetBodyRegion.cjs +44 -0
- package/dist/cjs/SheetModal/SheetBodyRegion.native.js +48 -0
- package/dist/cjs/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/cjs/SheetModal/SheetHeader.cjs +11 -14
- package/dist/cjs/SheetModal/SheetHeader.native.js +11 -14
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +57 -18
- package/dist/cjs/SheetModal/index.native.js +87 -65
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.cjs +62 -1
- package/dist/cjs/actions/StandardAction.native.js +63 -1
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.native.js +24 -3
- package/dist/cjs/appShell/TabHost.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.cjs +3 -0
- package/dist/cjs/appShell/bottomChrome.native.js +3 -0
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.cjs +2 -1
- package/dist/cjs/appShell/index.native.js +2 -1
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +0 -1
- package/dist/cjs/charts/ChartDataView.native.js +0 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/icons/lucide.cjs +16 -8
- package/dist/cjs/icons/lucide.native.js +16 -8
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.cjs +4 -1
- package/dist/cjs/icons/themed.native.js +4 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +25 -2
- package/dist/cjs/layouts/page.native.js +27 -2
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.cjs +4 -3
- package/dist/cjs/layouts/timeline.native.js +4 -3
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/surfaces.cjs +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/views/FilePreview.cjs +1 -1
- package/dist/cjs/views/FilePreview.native.js +1 -1
- package/dist/cjs/views/FilePreview.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetBodyRegion.mjs +19 -0
- package/dist/esm/SheetModal/SheetBodyRegion.mjs.map +1 -0
- package/dist/esm/SheetModal/SheetBodyRegion.native.js +20 -0
- package/dist/esm/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/esm/SheetModal/SheetHeader.mjs +11 -14
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +11 -14
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +61 -22
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +89 -67
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +63 -2
- package/dist/esm/actions/StandardAction.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.native.js +64 -2
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/appShell/TabHost.native.js +26 -5
- package/dist/esm/appShell/TabHost.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.mjs +2 -1
- package/dist/esm/appShell/bottomChrome.mjs.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js +2 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.mjs +2 -2
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +2 -2
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +0 -1
- package/dist/esm/charts/ChartDataView.mjs.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js +0 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/icons/lucide.mjs +11 -3
- package/dist/esm/icons/lucide.mjs.map +1 -1
- package/dist/esm/icons/lucide.native.js +11 -3
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.mjs +4 -1
- package/dist/esm/icons/themed.mjs.map +1 -1
- package/dist/esm/icons/themed.native.js +4 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +26 -3
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +28 -3
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/timeline.mjs +2 -1
- package/dist/esm/layouts/timeline.mjs.map +1 -1
- package/dist/esm/layouts/timeline.native.js +2 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/surfaces.mjs +1 -1
- package/dist/esm/surfaces.mjs.map +1 -1
- package/dist/esm/surfaces.native.js +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/views/FilePreview.mjs +1 -1
- package/dist/esm/views/FilePreview.mjs.map +1 -1
- package/dist/esm/views/FilePreview.native.js +1 -1
- package/dist/esm/views/FilePreview.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetBodyRegion.mjs +19 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.mjs.map +1 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.native.js +48 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/jsx/SheetModal/SheetHeader.mjs +11 -14
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +11 -14
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +61 -22
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +87 -65
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +63 -2
- package/dist/jsx/actions/StandardAction.mjs.map +1 -1
- package/dist/jsx/actions/StandardAction.native.js +63 -1
- package/dist/jsx/actions/StandardAction.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.native.js +24 -3
- package/dist/jsx/appShell/TabHost.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.mjs +2 -1
- package/dist/jsx/appShell/bottomChrome.mjs.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js +3 -0
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +2 -2
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +2 -1
- package/dist/jsx/charts/ChartDataView.mjs +0 -1
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +0 -1
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/icons/lucide.mjs +11 -3
- package/dist/jsx/icons/lucide.mjs.map +1 -1
- package/dist/jsx/icons/lucide.native.js +16 -8
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.mjs +4 -1
- package/dist/jsx/icons/themed.mjs.map +1 -1
- package/dist/jsx/icons/themed.native.js +4 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +26 -3
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +27 -2
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.mjs +2 -1
- package/dist/jsx/layouts/timeline.mjs.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +4 -3
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/surfaces.mjs +1 -1
- package/dist/jsx/surfaces.mjs.map +1 -1
- package/dist/jsx/surfaces.native.js +1 -1
- package/dist/jsx/views/FilePreview.mjs +1 -1
- package/dist/jsx/views/FilePreview.mjs.map +1 -1
- package/dist/jsx/views/FilePreview.native.js +1 -1
- package/dist/jsx/views/FilePreview.native.js.map +1 -1
- package/package.json +7 -7
- package/src/SheetFrame.stories.tsx +2 -2
- package/src/SheetModal/SheetBodyRegion.tsx +19 -0
- package/src/SheetModal/SheetHeader.tsx +23 -27
- package/src/SheetModal/SheetModal.grabber.spec.tsx +52 -10
- package/src/SheetModal/SheetModal.native.spec.tsx +90 -6
- package/src/SheetModal/SheetModal.noHeaderBar.spec.tsx +103 -0
- package/src/SheetModal/SheetModal.onDismiss.spec.tsx +35 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +11 -13
- package/src/SheetModal/SheetModal.stories.tsx +2 -6
- package/src/SheetModal/SheetModal.titleRow.spec.tsx +203 -0
- package/src/SheetModal/index.native.tsx +83 -54
- package/src/SheetModal/index.tsx +99 -25
- package/src/SheetScrollView/SheetScrollView.stories.tsx +2 -2
- package/src/actions/StandardAction.tsx +72 -4
- package/src/appShell/TabHost.native.tsx +50 -5
- package/src/appShell/TabHost.nestedScroll.spec.tsx +177 -0
- package/src/appShell/bottomChrome.ts +2 -0
- package/src/appShell/index.ts +1 -1
- package/src/charts/ChartDataView.tsx +0 -1
- package/src/charts/Charts.stories.tsx +20 -0
- package/src/icons/lucide.glyphGrid.spec.tsx +41 -0
- package/src/icons/lucide.ts +21 -2
- package/src/icons/themed.tsx +6 -2
- package/src/layouts/page.tsx +35 -2
- package/src/layouts/severityShape.spec.tsx +31 -0
- package/src/layouts/timeline.tsx +1 -1
- package/src/surfaces.spec.tsx +6 -2
- package/src/surfaces.tsx +1 -1
- package/src/views/FilePreview.tsx +1 -8
- package/src/views/filePreview.spec.tsx +3 -4
- package/types/Chip/index.d.ts +1 -1
- package/types/Collapsible.d.ts +1 -1
- package/types/Dialog.d.ts +3 -3
- package/types/SheetModal/SheetBodyRegion.d.ts +9 -0
- package/types/SheetModal/SheetBodyRegion.d.ts.map +1 -0
- package/types/SheetModal/SheetHeader.d.ts +4 -4
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts +12 -4
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts +4 -3
- package/types/actions/StandardAction.d.ts.map +1 -1
- package/types/appShell/TabHost.native.d.ts.map +1 -1
- package/types/appShell/bottomChrome.d.ts +1 -0
- package/types/appShell/bottomChrome.d.ts.map +1 -1
- package/types/appShell/index.d.ts +1 -1
- package/types/appShell/index.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts.map +1 -1
- package/types/icons/lucide.d.ts +7 -3
- package/types/icons/lucide.d.ts.map +1 -1
- package/types/icons/themed.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/timeline.d.ts.map +1 -1
- package/types/views/FilePreview.d.ts.map +1 -1
package/src/SheetModal/index.tsx
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
overlayScrim,
|
|
14
|
-
|
|
14
|
+
sheetHandle,
|
|
15
|
+
sheetHandleTone,
|
|
16
|
+
sheetHandleWidthRatio,
|
|
15
17
|
transitionProps,
|
|
16
18
|
useResolvedKnobs,
|
|
17
19
|
} from "@multiplatform.one/theme";
|
|
@@ -21,11 +23,12 @@ import {
|
|
|
21
23
|
sheetPanelWidth,
|
|
22
24
|
useOverlayZIndex,
|
|
23
25
|
} from "@multiplatform.one/forms";
|
|
24
|
-
import { useEffect, useId, useRef, type ReactNode } from "react";
|
|
25
|
-
import { isWeb, Sheet, View, useWindowDimensions } from "tamagui";
|
|
26
|
+
import { useCallback, useEffect, useId, useRef, type ReactNode } from "react";
|
|
27
|
+
import { isWeb, Sheet, View, useWindowDimensions, YStack } from "tamagui";
|
|
26
28
|
import { OverlayTitleIdContext } from "../actions/StandardAction";
|
|
27
|
-
import {
|
|
29
|
+
import { SheetFrame } from "../surfaces";
|
|
28
30
|
import { largeDetentRatio, resolveWebSnap } from "./detents";
|
|
31
|
+
import { SheetBodyRegion } from "./SheetBodyRegion";
|
|
29
32
|
import { isOverlayHeader, SheetHeader } from "./SheetHeader";
|
|
30
33
|
import { SheetNavigation } from "./SheetNavigation";
|
|
31
34
|
import { useSheetFrameFocus } from "./useSheetFrameFocus";
|
|
@@ -35,9 +38,10 @@ export interface SheetModalProps {
|
|
|
35
38
|
onOpenChange: (open: boolean) => void;
|
|
36
39
|
children?: ReactNode;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* title
|
|
41
|
+
* Content above the body. A sheet that confirms passes `OverlayHeader`:
|
|
42
|
+
* the title leading, the accent ✓ trailing, and no ✕ (FZ-8439, FZ-11418).
|
|
43
|
+
* That title row scrolls with a `scrollable` body. Its body holds no
|
|
44
|
+
* Cancel/confirm row.
|
|
41
45
|
*/
|
|
42
46
|
header?: ReactNode;
|
|
43
47
|
/**
|
|
@@ -80,10 +84,15 @@ export interface SheetModalProps {
|
|
|
80
84
|
* does (Quick Look, Files); the header keeps the panel inset.
|
|
81
85
|
*/
|
|
82
86
|
flush?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Fires once the sheet is gone after a close, so a consumer can present
|
|
89
|
+
* what comes next without guessing at a delay: on iOS when UIKit finishes
|
|
90
|
+
* dismissing the modal, on Android once the close commits, on web when the
|
|
91
|
+
* exit slide completes.
|
|
92
|
+
*/
|
|
93
|
+
onDismiss?: () => void;
|
|
83
94
|
}
|
|
84
95
|
|
|
85
|
-
const IN_DIALOG_REGION = { inDialogRegion: true } as const;
|
|
86
|
-
|
|
87
96
|
/*
|
|
88
97
|
* MPO-299 fill: the web frame already has a definite height from the Sheet's
|
|
89
98
|
* percent snap point, so fill only opens the body chain inside it. A flex
|
|
@@ -194,6 +203,42 @@ function useSheetEscapeDismiss(open: boolean, onDismiss: () => void) {
|
|
|
194
203
|
}, [open]);
|
|
195
204
|
}
|
|
196
205
|
|
|
206
|
+
/**
|
|
207
|
+
* FZ-11084: `onDismiss` fires once per close, when the exit slide completes.
|
|
208
|
+
* Tamagui hides a sheet whose exit callback never arrives after a second
|
|
209
|
+
* without reporting it, so the same second backs this up rather than leaving
|
|
210
|
+
* the consumer waiting forever.
|
|
211
|
+
*/
|
|
212
|
+
const dismissFallbackMs = 1000;
|
|
213
|
+
|
|
214
|
+
function useSheetDismissed(open: boolean, onDismiss: (() => void) | undefined) {
|
|
215
|
+
const onDismissRef = useRef(onDismiss);
|
|
216
|
+
onDismissRef.current = onDismiss;
|
|
217
|
+
const openRef = useRef(open);
|
|
218
|
+
openRef.current = open;
|
|
219
|
+
const shownRef = useRef(false);
|
|
220
|
+
const fire = useCallback(() => {
|
|
221
|
+
if (openRef.current || !shownRef.current) return;
|
|
222
|
+
shownRef.current = false;
|
|
223
|
+
onDismissRef.current?.();
|
|
224
|
+
}, []);
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
if (open) {
|
|
227
|
+
shownRef.current = true;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (!shownRef.current) return;
|
|
231
|
+
const timer = setTimeout(fire, dismissFallbackMs);
|
|
232
|
+
return () => clearTimeout(timer);
|
|
233
|
+
}, [open, fire]);
|
|
234
|
+
return useCallback(
|
|
235
|
+
({ open: opened }: { open: boolean }) => {
|
|
236
|
+
if (!opened) fire();
|
|
237
|
+
},
|
|
238
|
+
[fire],
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
197
242
|
export function SheetModal({
|
|
198
243
|
open,
|
|
199
244
|
onOpenChange,
|
|
@@ -205,6 +250,7 @@ export function SheetModal({
|
|
|
205
250
|
scrollable,
|
|
206
251
|
fill = false,
|
|
207
252
|
flush = false,
|
|
253
|
+
onDismiss,
|
|
208
254
|
}: SheetModalProps) {
|
|
209
255
|
const titleId = useId();
|
|
210
256
|
const overlayHeader = isOverlayHeader(headerContent);
|
|
@@ -223,11 +269,24 @@ export function SheetModal({
|
|
|
223
269
|
const sheetZIndex = useOverlayZIndex("sheet");
|
|
224
270
|
const transition = knobProps.motion.slide.transition;
|
|
225
271
|
const frameRef = useRef<HTMLElement | null>(null);
|
|
272
|
+
const handleAnimationComplete = useSheetDismissed(open, onDismiss);
|
|
226
273
|
|
|
227
274
|
useSheetFrameFocus(open, frameRef);
|
|
228
275
|
useSheetEscapeDismiss(open, () => onOpenChange(false));
|
|
229
276
|
useOutsidePressDismiss(open, frameRef, () => onOpenChange(false));
|
|
230
277
|
const flushHeader = flush ? { paddingHorizontal: knobProps.panelPadding.padding } : null;
|
|
278
|
+
const titleScrolls = overlayHeader && scrollable === true;
|
|
279
|
+
const headerSlot = header ? (
|
|
280
|
+
<View
|
|
281
|
+
id={overlayHeader || headerActions ? undefined : titleId}
|
|
282
|
+
{...(fill && !titleScrolls ? nonShrinking : null)}
|
|
283
|
+
{...flushHeader}
|
|
284
|
+
>
|
|
285
|
+
<OverlayTitleIdContext.Provider value={overlayHeader ? titleId : undefined}>
|
|
286
|
+
{header}
|
|
287
|
+
</OverlayTitleIdContext.Provider>
|
|
288
|
+
</View>
|
|
289
|
+
) : null;
|
|
231
290
|
|
|
232
291
|
return (
|
|
233
292
|
<Sheet
|
|
@@ -235,6 +294,7 @@ export function SheetModal({
|
|
|
235
294
|
open={open}
|
|
236
295
|
onOpenChange={onOpenChange}
|
|
237
296
|
dismissOnSnapToBottom
|
|
297
|
+
onAnimationComplete={handleAnimationComplete}
|
|
238
298
|
{...snap}
|
|
239
299
|
transition={transition}
|
|
240
300
|
zIndex={sheetZIndex}
|
|
@@ -248,7 +308,15 @@ export function SheetModal({
|
|
|
248
308
|
exitStyle={{ opacity: 0 }}
|
|
249
309
|
/>
|
|
250
310
|
{/* VoiceOver resize affordance. */}
|
|
251
|
-
<Sheet.Handle
|
|
311
|
+
<Sheet.Handle
|
|
312
|
+
{...sheetHandle}
|
|
313
|
+
{...sheetHandleTone(knobProps.scheme)}
|
|
314
|
+
{...(regular
|
|
315
|
+
? { width: Math.round(sheetPanelWidth(windowWidth) * sheetHandleWidthRatio) }
|
|
316
|
+
: null)}
|
|
317
|
+
aria-label="Resize"
|
|
318
|
+
data-sheet-grabber=""
|
|
319
|
+
/>
|
|
252
320
|
<SheetFrame
|
|
253
321
|
ref={frameRef as never}
|
|
254
322
|
{...({
|
|
@@ -269,7 +337,7 @@ export function SheetModal({
|
|
|
269
337
|
overflow="hidden"
|
|
270
338
|
{...frameRingReset}
|
|
271
339
|
>
|
|
272
|
-
<
|
|
340
|
+
<SheetBodyRegion>
|
|
273
341
|
<OverlayStackProvider zIndex={sheetZIndex}>
|
|
274
342
|
<SheetNavigation
|
|
275
343
|
open={open}
|
|
@@ -277,29 +345,35 @@ export function SheetModal({
|
|
|
277
345
|
fill={fill}
|
|
278
346
|
root={
|
|
279
347
|
<>
|
|
280
|
-
{
|
|
281
|
-
<View
|
|
282
|
-
id={overlayHeader || headerActions ? undefined : titleId}
|
|
283
|
-
{...(fill ? nonShrinking : null)}
|
|
284
|
-
{...flushHeader}
|
|
285
|
-
>
|
|
286
|
-
<OverlayTitleIdContext.Provider value={overlayHeader ? titleId : undefined}>
|
|
287
|
-
{header}
|
|
288
|
-
</OverlayTitleIdContext.Provider>
|
|
289
|
-
</View>
|
|
290
|
-
) : null}
|
|
348
|
+
{titleScrolls ? null : headerSlot}
|
|
291
349
|
{fill ? (
|
|
292
350
|
<View testID="sheet-modal-body" {...fillSlot}>
|
|
293
351
|
{scrollable ? (
|
|
294
352
|
<Sheet.ScrollView testID="sheet-modal-scroll" {...fillSlot}>
|
|
295
|
-
{
|
|
353
|
+
{titleScrolls ? (
|
|
354
|
+
<YStack gap={knobProps.gap.gap}>
|
|
355
|
+
{headerSlot}
|
|
356
|
+
{children}
|
|
357
|
+
</YStack>
|
|
358
|
+
) : (
|
|
359
|
+
children
|
|
360
|
+
)}
|
|
296
361
|
</Sheet.ScrollView>
|
|
297
362
|
) : (
|
|
298
363
|
children
|
|
299
364
|
)}
|
|
300
365
|
</View>
|
|
301
366
|
) : scrollable ? (
|
|
302
|
-
<Sheet.ScrollView testID="sheet-modal-scroll">
|
|
367
|
+
<Sheet.ScrollView testID="sheet-modal-scroll">
|
|
368
|
+
{titleScrolls ? (
|
|
369
|
+
<YStack gap={knobProps.gap.gap}>
|
|
370
|
+
{headerSlot}
|
|
371
|
+
{children}
|
|
372
|
+
</YStack>
|
|
373
|
+
) : (
|
|
374
|
+
children
|
|
375
|
+
)}
|
|
376
|
+
</Sheet.ScrollView>
|
|
303
377
|
) : (
|
|
304
378
|
children
|
|
305
379
|
)}
|
|
@@ -311,7 +385,7 @@ export function SheetModal({
|
|
|
311
385
|
{...(fill ? nonShrinking : null)}
|
|
312
386
|
/>
|
|
313
387
|
</OverlayStackProvider>
|
|
314
|
-
</
|
|
388
|
+
</SheetBodyRegion>
|
|
315
389
|
</SheetFrame>
|
|
316
390
|
</Sheet>
|
|
317
391
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { sheetHandle } from "@multiplatform.one/theme";
|
|
4
4
|
import { Sheet, YStack } from "tamagui";
|
|
5
5
|
import { SheetFrame } from "../surfaces";
|
|
6
6
|
import { Tabs } from "../Tabs";
|
|
@@ -36,7 +36,7 @@ function DraggableSheet({ tabs = false }: { tabs?: boolean }) {
|
|
|
36
36
|
onPositionChange={setPosition}
|
|
37
37
|
dismissOnSnapToBottom={false}
|
|
38
38
|
>
|
|
39
|
-
<Sheet.Handle {...
|
|
39
|
+
<Sheet.Handle {...sheetHandle} aria-label="Resize" />
|
|
40
40
|
<SheetFrame borderBottomLeftRadius={0} borderBottomRightRadius={0}>
|
|
41
41
|
<SizableText fontWeight="600">Stack</SizableText>
|
|
42
42
|
{tabs ? (
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type IconButtonProps,
|
|
15
15
|
type StandardActionKind,
|
|
16
16
|
} from "@multiplatform.one/forms";
|
|
17
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
17
|
+
import { useIsInSheetBody, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
18
18
|
import { createContext, useContext, useState, type ReactNode } from "react";
|
|
19
19
|
import { XStack, isWeb } from "tamagui";
|
|
20
20
|
import { useTranslation } from "../shared/i18n";
|
|
@@ -105,11 +105,79 @@ export interface OverlayHeaderProps {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
* The house
|
|
108
|
+
* The house dialog header (LC-260): ✕ leading
|
|
109
109
|
* and an accent ✓ trailing around a centred title when the overlay confirms;
|
|
110
|
-
* the title leading and ✕ trailing when it only dismisses.
|
|
110
|
+
* the title leading and ✕ trailing when it only dismisses. Inside a sheet it
|
|
111
|
+
* is content, not a bar (FZ-11418): no ✕, the title leading and the ✓ trailing.
|
|
111
112
|
*/
|
|
112
|
-
export function OverlayHeader({
|
|
113
|
+
export function OverlayHeader(props: OverlayHeaderProps) {
|
|
114
|
+
if (useIsInSheetBody()) return <SheetTitleRow {...props} />;
|
|
115
|
+
return <DialogHeaderBar {...props} />;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* An `OverlayHeader` in a sheet (FZ-11418, tamagui's Sheet): the sheet closes
|
|
120
|
+
* by drag, backdrop, Escape and the screen reader's escape, so it draws no ✕.
|
|
121
|
+
* The title is the body's first line, with the actions and the one confirm
|
|
122
|
+
* trailing it. With none of those it draws nothing.
|
|
123
|
+
*/
|
|
124
|
+
function SheetTitleRow({
|
|
125
|
+
title,
|
|
126
|
+
onConfirm,
|
|
127
|
+
confirmKind = "done",
|
|
128
|
+
confirmLabel,
|
|
129
|
+
confirmDisabled,
|
|
130
|
+
confirmDisabledReason,
|
|
131
|
+
confirmLoading,
|
|
132
|
+
actions,
|
|
133
|
+
testID,
|
|
134
|
+
}: OverlayHeaderProps) {
|
|
135
|
+
const { knobProps } = useResolvedKnobs();
|
|
136
|
+
const titleId = useContext(OverlayTitleIdContext);
|
|
137
|
+
const confirms = onConfirm != null;
|
|
138
|
+
if (title == null && actions == null && !confirms) return null;
|
|
139
|
+
const heading =
|
|
140
|
+
typeof title === "string" ? (
|
|
141
|
+
<SizableText role="heading" numberOfLines={1} flexShrink={1} {...knobProps.heading}>
|
|
142
|
+
{title}
|
|
143
|
+
</SizableText>
|
|
144
|
+
) : (
|
|
145
|
+
title
|
|
146
|
+
);
|
|
147
|
+
return (
|
|
148
|
+
<XStack
|
|
149
|
+
alignItems="center"
|
|
150
|
+
width="100%"
|
|
151
|
+
{...knobProps.gapSm}
|
|
152
|
+
data-mp-overlay-header={confirms ? "confirm" : "dismiss"}
|
|
153
|
+
data-mp-overlay-face="sheet"
|
|
154
|
+
testID={testID}
|
|
155
|
+
>
|
|
156
|
+
<XStack id={titleId} flex={1} minWidth={0} alignItems="center">
|
|
157
|
+
{heading}
|
|
158
|
+
</XStack>
|
|
159
|
+
{actions != null || confirms ? (
|
|
160
|
+
<XStack alignItems="center" {...knobProps.gap}>
|
|
161
|
+
{actions}
|
|
162
|
+
{confirms ? (
|
|
163
|
+
<ActionButton
|
|
164
|
+
kind={confirmKind}
|
|
165
|
+
onPress={onConfirm}
|
|
166
|
+
label={confirmLabel}
|
|
167
|
+
loading={confirmLoading}
|
|
168
|
+
disabled={confirmDisabled}
|
|
169
|
+
disabledReason={confirmDisabledReason}
|
|
170
|
+
disabledReasonPlacement="inline"
|
|
171
|
+
testID={testID ? `${testID}-confirm` : undefined}
|
|
172
|
+
/>
|
|
173
|
+
) : null}
|
|
174
|
+
</XStack>
|
|
175
|
+
) : null}
|
|
176
|
+
</XStack>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function DialogHeaderBar({
|
|
113
181
|
title,
|
|
114
182
|
onClose,
|
|
115
183
|
closeKind = "close",
|
|
@@ -26,12 +26,31 @@
|
|
|
26
26
|
* leaves its scroll view's inset adjustment off: react-native-screens would
|
|
27
27
|
* otherwise flip the first scroll view to `automatic`, and UIKit would add
|
|
28
28
|
* the bar's height a second time (FZ-8640).
|
|
29
|
+
*
|
|
30
|
+
* A tab screen is its own native frame, so a scroll view outside the host
|
|
31
|
+
* cannot carry what is in it. Under another Screen (a Kitchen Sink story
|
|
32
|
+
* page), the tab's Screen still merges into that page's gutter and cap but
|
|
33
|
+
* owns its scroll view; without that, rows past the tab's frame were clipped
|
|
34
|
+
* and could not be reached (FZ-8640). The bar's clearance then travels to
|
|
35
|
+
* that Screen through the nesting record, not the app-wide inset, so the
|
|
36
|
+
* outer page doesn't clear a bar that sits inside its own content.
|
|
29
37
|
*/
|
|
30
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
ScreenNesting,
|
|
40
|
+
useAccentTintedSurface,
|
|
41
|
+
useActiveTabInk,
|
|
42
|
+
useGlyphColor,
|
|
43
|
+
useParentScreen,
|
|
44
|
+
} from "@multiplatform.one/theme";
|
|
31
45
|
import { type ComponentType, type ReactNode, useEffect, useRef, useState } from "react";
|
|
32
46
|
import { type ImageSourcePropType, Platform, UIManager } from "react-native";
|
|
33
47
|
import { XStack, YStack } from "tamagui";
|
|
34
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
setBottomChromeInset,
|
|
50
|
+
setBottomEdgeOwnedByTabHost,
|
|
51
|
+
setFloatingBarMounted,
|
|
52
|
+
useBottomAccessory,
|
|
53
|
+
} from "./bottomChrome";
|
|
35
54
|
import { useBottomInset } from "./bottomInset";
|
|
36
55
|
import { type TabBarItem, tabBarInactiveInk } from "./TabBar";
|
|
37
56
|
import { MpoTabHost, type TabHostProps } from "./MpoTabHost";
|
|
@@ -215,13 +234,28 @@ export function NativeTabHost({
|
|
|
215
234
|
const holdingKey = activeKey ?? hostKey;
|
|
216
235
|
if (holdingKey) lastKey.current = holdingKey;
|
|
217
236
|
const focusedKey = lastKey.current;
|
|
237
|
+
const parent = useParentScreen();
|
|
218
238
|
const hosting = hostsAccessory && Boolean(activeKey);
|
|
219
239
|
const pageAccessory = useBottomAccessory();
|
|
220
240
|
const accessory = hosting ? pageAccessory : null;
|
|
221
241
|
|
|
242
|
+
const bottomInset = nativeTabsBottomInset(activeKey, deviceInset, Boolean(accessory));
|
|
243
|
+
const clearance = bottomInset ?? 0;
|
|
244
|
+
const nested = parent !== null;
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
setBottomChromeInset(id, nested ? null : bottomInset);
|
|
247
|
+
}, [bottomInset, nested, id]);
|
|
248
|
+
const holdBottomEdge = parent?.holdBottomEdge;
|
|
249
|
+
const ownsEdge = nested && bottomInset !== null;
|
|
222
250
|
useEffect(() => {
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
if (!ownsEdge) return undefined;
|
|
252
|
+
holdBottomEdge?.(id, true);
|
|
253
|
+
setBottomEdgeOwnedByTabHost(id, true);
|
|
254
|
+
return () => {
|
|
255
|
+
holdBottomEdge?.(id, false);
|
|
256
|
+
setBottomEdgeOwnedByTabHost(id, false);
|
|
257
|
+
};
|
|
258
|
+
}, [ownsEdge, holdBottomEdge, id]);
|
|
225
259
|
useEffect(() => {
|
|
226
260
|
setFloatingBarMounted(id, hosting);
|
|
227
261
|
}, [hosting, id]);
|
|
@@ -268,7 +302,18 @@ export function NativeTabHost({
|
|
|
268
302
|
>
|
|
269
303
|
{item.key === focusedKey ? (
|
|
270
304
|
<YStack flex={1} backgroundColor="$background" data-testid="native-tab-screen">
|
|
271
|
-
{
|
|
305
|
+
{parent ? (
|
|
306
|
+
<ScreenNesting
|
|
307
|
+
scrolls={false}
|
|
308
|
+
inset={parent.inset}
|
|
309
|
+
capped={parent.capped}
|
|
310
|
+
underChrome={clearance}
|
|
311
|
+
>
|
|
312
|
+
{children}
|
|
313
|
+
</ScreenNesting>
|
|
314
|
+
) : (
|
|
315
|
+
children
|
|
316
|
+
)}
|
|
272
317
|
</YStack>
|
|
273
318
|
) : null}
|
|
274
319
|
</Screen>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-8640: a native tab screen is its own native frame, so a scroll view
|
|
3
|
+
* outside the TabHost cannot carry what is in it. In Kitchen Sink the TabHost
|
|
4
|
+
* story sits inside the story page's scrolling Screen; its own Screen merged
|
|
5
|
+
* into that page (LC-159) and drew no scroll view, so rows past the tab's
|
|
6
|
+
* frame were clipped and could not be reached. Under a native tab the Screen
|
|
7
|
+
* keeps the page's one gutter but owns its scroll view, and that scroll view
|
|
8
|
+
* ends with the tab bar's clearance once.
|
|
9
|
+
*/
|
|
10
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
11
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
12
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
13
|
+
import { Screen } from "../layouts/page";
|
|
14
|
+
import { useBottomEdgeOwnedByTabHost } from "@multiplatform.one/theme";
|
|
15
|
+
import type { TabBarItem } from "./TabBar";
|
|
16
|
+
import { type NativeTabs, NativeTabHost } from "./TabHost.native";
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
vi.restoreAllMocks();
|
|
20
|
+
cleanup();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const Glyph = () => null;
|
|
24
|
+
|
|
25
|
+
const items: TabBarItem[] = [
|
|
26
|
+
{ key: "/", label: "Home", icon: Glyph, nativeIcon: { sfSymbol: "house" } },
|
|
27
|
+
{ key: "/pokemon", label: "Pokemon", icon: Glyph, nativeIcon: { sfSymbol: "sparkles" } },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const fakeTabs: NativeTabs = {
|
|
31
|
+
Host: ({ children }) => <div data-testid="native-host">{children}</div>,
|
|
32
|
+
Screen: ({ children, tabKey }) => <section data-testid={`tab-${tabKey}`}>{children}</section>,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const rows = Array.from({ length: 30 }, (_, i) => `Row ${i + 1}`);
|
|
36
|
+
|
|
37
|
+
function TabPage() {
|
|
38
|
+
return (
|
|
39
|
+
<NativeTabHost tabs={fakeTabs} items={items} activeKey="/pokemon" onTabPress={vi.fn()}>
|
|
40
|
+
<Screen scrollViewProps={{ testID: "tab-scroll" } as never}>
|
|
41
|
+
{rows.map((row) => (
|
|
42
|
+
<span key={row}>{row}</span>
|
|
43
|
+
))}
|
|
44
|
+
</Screen>
|
|
45
|
+
</NativeTabHost>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function bottomPads(el: Element): string[] {
|
|
50
|
+
return String(el.className)
|
|
51
|
+
.split(" ")
|
|
52
|
+
.filter((c) => c.startsWith("_pb-") && c !== "_pb-0px");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function outerColumn(container: HTMLElement): Element {
|
|
56
|
+
return [...container.querySelectorAll('[data-testid="screen"]')].find(
|
|
57
|
+
(el) => !el.hasAttribute("data-screen-nested"),
|
|
58
|
+
)!;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function EdgeProbe() {
|
|
62
|
+
return <span data-testid="edge">{String(useBottomEdgeOwnedByTabHost())}</span>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function clearanceIn(el: HTMLElement): number {
|
|
66
|
+
const spacers = el.querySelectorAll<HTMLElement>('[data-testid="screen-chrome-clearance"]');
|
|
67
|
+
return spacers.length;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
describe("a Screen under a native tab inside another page (FZ-8640)", () => {
|
|
71
|
+
it("owns its scroll view, so every row can scroll into the tab's frame", () => {
|
|
72
|
+
renderWithProviders(
|
|
73
|
+
<Screen scrollViewProps={{ testID: "page-scroll" } as never}>
|
|
74
|
+
<TabPage />
|
|
75
|
+
</Screen>,
|
|
76
|
+
);
|
|
77
|
+
const tabScroll = screen.getByTestId("tab-scroll");
|
|
78
|
+
expect(screen.getByTestId("tab-/pokemon").contains(tabScroll)).toBe(true);
|
|
79
|
+
expect(tabScroll.contains(screen.getByText("Row 30"))).toBe(true);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("ends that scroll view with the tab bar's clearance, once", () => {
|
|
83
|
+
renderWithProviders(
|
|
84
|
+
<Screen scrollViewProps={{ testID: "page-scroll" } as never}>
|
|
85
|
+
<TabPage />
|
|
86
|
+
</Screen>,
|
|
87
|
+
);
|
|
88
|
+
const tabScroll = screen.getByTestId("tab-scroll");
|
|
89
|
+
expect(clearanceIn(tabScroll)).toBe(1);
|
|
90
|
+
const spacer = tabScroll.querySelector<HTMLElement>('[data-testid="screen-chrome-clearance"]')!;
|
|
91
|
+
expect(spacer.compareDocumentPosition(screen.getByText("Row 30"))).toBe(
|
|
92
|
+
Node.DOCUMENT_POSITION_PRECEDING,
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("leaves the outer page unpadded for a bar inside its own content", () => {
|
|
97
|
+
renderWithProviders(
|
|
98
|
+
<Screen scrollViewProps={{ testID: "page-scroll" } as never}>
|
|
99
|
+
<TabPage />
|
|
100
|
+
</Screen>,
|
|
101
|
+
);
|
|
102
|
+
const page = screen.getByTestId("page-scroll");
|
|
103
|
+
const tabScroll = screen.getByTestId("tab-scroll");
|
|
104
|
+
const all = [...page.querySelectorAll('[data-testid="screen-chrome-clearance"]')];
|
|
105
|
+
expect(all.filter((el) => !tabScroll.contains(el))).toEqual([]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("ends the tab's scroll with the page's bottom gutter above the clearance", () => {
|
|
109
|
+
const { container } = renderWithProviders(
|
|
110
|
+
<Screen>
|
|
111
|
+
<TabPage />
|
|
112
|
+
</Screen>,
|
|
113
|
+
);
|
|
114
|
+
const nested = container.querySelector("[data-screen-nested]") as HTMLElement;
|
|
115
|
+
const bottom = String(nested.className)
|
|
116
|
+
.split(" ")
|
|
117
|
+
.filter((c) => c.startsWith("_pb-"));
|
|
118
|
+
expect(bottom.length).toBe(1);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("gives the page's bottom edge to the tab host, so the bar sits on the screen's inset", () => {
|
|
122
|
+
const plain = renderWithProviders(
|
|
123
|
+
<Screen>
|
|
124
|
+
<span>Row</span>
|
|
125
|
+
</Screen>,
|
|
126
|
+
);
|
|
127
|
+
expect(bottomPads(outerColumn(plain.container)).length).toBeGreaterThan(0);
|
|
128
|
+
plain.unmount();
|
|
129
|
+
const { container } = renderWithProviders(
|
|
130
|
+
<Screen>
|
|
131
|
+
<TabPage />
|
|
132
|
+
</Screen>,
|
|
133
|
+
);
|
|
134
|
+
expect(bottomPads(outerColumn(container))).toEqual([]);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("tells a host frame around the page that the tab host owns the bottom edge", () => {
|
|
138
|
+
const { rerender } = renderWithProviders(
|
|
139
|
+
<>
|
|
140
|
+
<EdgeProbe />
|
|
141
|
+
<Screen>
|
|
142
|
+
<TabPage />
|
|
143
|
+
</Screen>
|
|
144
|
+
</>,
|
|
145
|
+
);
|
|
146
|
+
expect(screen.getByTestId("edge").textContent).toBe("true");
|
|
147
|
+
rerender(
|
|
148
|
+
<>
|
|
149
|
+
<EdgeProbe />
|
|
150
|
+
<Screen>
|
|
151
|
+
<span>Row</span>
|
|
152
|
+
</Screen>
|
|
153
|
+
</>,
|
|
154
|
+
);
|
|
155
|
+
expect(screen.getByTestId("edge").textContent).toBe("false");
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("keeps the page's one gutter: the tab's Screen pads no sides of its own", () => {
|
|
159
|
+
const { container } = renderWithProviders(
|
|
160
|
+
<Screen>
|
|
161
|
+
<TabPage />
|
|
162
|
+
</Screen>,
|
|
163
|
+
);
|
|
164
|
+
const nested = container.querySelector("[data-screen-nested]") as HTMLElement;
|
|
165
|
+
expect(nested).not.toBeNull();
|
|
166
|
+
const sides = String(nested.className)
|
|
167
|
+
.split(" ")
|
|
168
|
+
.filter((c) => ["_pl-", "_pr-", "_p-", "_px-"].some((p) => c.startsWith(p)));
|
|
169
|
+
expect(sides).toEqual([]);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("is a page of its own at the top of an app (One's routes), unchanged", () => {
|
|
173
|
+
const { container } = renderWithProviders(<TabPage />);
|
|
174
|
+
expect(container.querySelector("[data-screen-nested]")).toBeNull();
|
|
175
|
+
expect(screen.getByTestId("tab-scroll").contains(screen.getByText("Row 30"))).toBe(true);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
@@ -66,3 +66,5 @@ export function setFloatingBarMounted(id: symbol, mounted: boolean) {
|
|
|
66
66
|
export function useFloatingBarMounted(): boolean {
|
|
67
67
|
return useSyncExternalStore(bars.subscribe, bars.get, bars.empty);
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
export { setBottomEdgeOwnedByTabHost, useBottomEdgeOwnedByTabHost } from "@multiplatform.one/theme";
|
package/src/appShell/index.ts
CHANGED
|
@@ -7,5 +7,5 @@ export * from "./Springboard";
|
|
|
7
7
|
export type { AppEntry } from "./appTile";
|
|
8
8
|
export * from "./SettingsSplit";
|
|
9
9
|
export * from "./AppShell";
|
|
10
|
-
export { useBottomChromeInset } from "./bottomChrome";
|
|
10
|
+
export { useBottomChromeInset, useBottomEdgeOwnedByTabHost } from "./bottomChrome";
|
|
11
11
|
export { BottomChromeClearance } from "./BottomChromeClearance";
|
|
@@ -63,6 +63,26 @@ export const BarCategorical = {
|
|
|
63
63
|
),
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
export const SixCategories = {
|
|
67
|
+
render: () => {
|
|
68
|
+
const six = [
|
|
69
|
+
{ label: "North", value: 42 },
|
|
70
|
+
{ label: "South", value: 35 },
|
|
71
|
+
{ label: "East", value: 28 },
|
|
72
|
+
{ label: "West", value: 24 },
|
|
73
|
+
{ label: "Central", value: 18 },
|
|
74
|
+
{ label: "Online", value: 12 },
|
|
75
|
+
];
|
|
76
|
+
return (
|
|
77
|
+
<YStack maxWidth={560} gap="$4">
|
|
78
|
+
<BarChart data={six} categorical title="Orders by region" />
|
|
79
|
+
<PieChart data={six} title="Orders by region" />
|
|
80
|
+
<LineChart data={six} title="Orders by region" />
|
|
81
|
+
</YStack>
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
66
86
|
export const Line = {
|
|
67
87
|
render: () => (
|
|
68
88
|
<YStack maxWidth={560} gap="$4">
|