@oxyhq/bloom 0.14.0 → 0.16.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/lib/commonjs/alert-dialog/AlertDialog.js +35 -27
- package/lib/commonjs/alert-dialog/AlertDialog.js.map +1 -1
- package/lib/commonjs/alert-dialog/index.js +1 -1
- package/lib/commonjs/alert-dialog/index.js.map +1 -1
- package/lib/commonjs/alert-dialog/index.web.js +1 -1
- package/lib/commonjs/alert-dialog/index.web.js.map +1 -1
- package/lib/commonjs/command/Command.js +27 -16
- package/lib/commonjs/command/Command.js.map +1 -1
- package/lib/commonjs/command/index.js +1 -1
- package/lib/commonjs/command/index.js.map +1 -1
- package/lib/commonjs/command/index.web.js +1 -1
- package/lib/commonjs/command/index.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +336 -43
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +420 -66
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/index.js +2 -9
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +2 -15
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/dialog/placement.js +104 -0
- package/lib/commonjs/dialog/placement.js.map +1 -0
- package/lib/commonjs/index.js +7 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +13 -35
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/module/alert-dialog/AlertDialog.js +35 -27
- package/lib/module/alert-dialog/AlertDialog.js.map +1 -1
- package/lib/module/alert-dialog/index.js +2 -2
- package/lib/module/alert-dialog/index.js.map +1 -1
- package/lib/module/alert-dialog/index.web.js +2 -2
- package/lib/module/alert-dialog/index.web.js.map +1 -1
- package/lib/module/command/Command.js +27 -16
- package/lib/module/command/Command.js.map +1 -1
- package/lib/module/command/index.js +2 -2
- package/lib/module/command/index.js.map +1 -1
- package/lib/module/command/index.web.js +2 -2
- package/lib/module/command/index.web.js.map +1 -1
- package/lib/module/dialog/Dialog.js +335 -46
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +418 -68
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/index.js +1 -2
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +1 -2
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/dialog/placement.js +100 -0
- package/lib/module/dialog/placement.js.map +1 -0
- package/lib/module/index.js +1 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -3
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/commonjs/alert-dialog/AlertDialog.d.ts +13 -12
- package/lib/typescript/commonjs/alert-dialog/AlertDialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/alert-dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/alert-dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/command/Command.d.ts +8 -8
- package/lib/typescript/commonjs/command/Command.d.ts.map +1 -1
- package/lib/typescript/commonjs/command/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/command/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts +17 -15
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +18 -5
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.d.ts +2 -4
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -4
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/placement.d.ts +71 -0
- package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/types.d.ts +66 -3
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -4
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -4
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/module/alert-dialog/AlertDialog.d.ts +13 -12
- package/lib/typescript/module/alert-dialog/AlertDialog.d.ts.map +1 -1
- package/lib/typescript/module/alert-dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/alert-dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/command/Command.d.ts +8 -8
- package/lib/typescript/module/command/Command.d.ts.map +1 -1
- package/lib/typescript/module/command/index.d.ts.map +1 -1
- package/lib/typescript/module/command/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts +17 -15
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts +18 -5
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.d.ts +2 -4
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +2 -4
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/placement.d.ts +71 -0
- package/lib/typescript/module/dialog/placement.d.ts.map +1 -0
- package/lib/typescript/module/dialog/types.d.ts +66 -3
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -4
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -4
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/package.json +1 -18
- package/src/__tests__/AlertDialog.test.tsx +122 -0
- package/src/__tests__/Command.test.tsx +107 -0
- package/src/__tests__/DialogPlacement.test.tsx +144 -0
- package/src/alert-dialog/AlertDialog.tsx +46 -36
- package/src/alert-dialog/index.ts +2 -2
- package/src/alert-dialog/index.web.ts +2 -2
- package/src/command/Command.tsx +30 -19
- package/src/command/index.ts +2 -2
- package/src/command/index.web.ts +2 -2
- package/src/dialog/Dialog.tsx +406 -50
- package/src/dialog/Dialog.web.tsx +496 -78
- package/src/dialog/index.ts +4 -3
- package/src/dialog/index.web.ts +4 -7
- package/src/dialog/placement.ts +113 -0
- package/src/dialog/types.ts +69 -3
- package/src/index.ts +4 -11
- package/src/index.web.ts +4 -11
- package/lib/commonjs/dialog/CenteredDialog.js +0 -250
- package/lib/commonjs/dialog/CenteredDialog.js.map +0 -1
- package/lib/commonjs/dialog/CenteredDialog.web.js +0 -328
- package/lib/commonjs/dialog/CenteredDialog.web.js.map +0 -1
- package/lib/commonjs/dialog/centered-dialog-tokens.js +0 -62
- package/lib/commonjs/dialog/centered-dialog-tokens.js.map +0 -1
- package/lib/commonjs/dialog/centered-dialog-types.js +0 -6
- package/lib/commonjs/dialog/centered-dialog-types.js.map +0 -1
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.js +0 -300
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.js.map +0 -1
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.native.js +0 -226
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.native.js.map +0 -1
- package/lib/commonjs/responsive-sheet/const.js +0 -60
- package/lib/commonjs/responsive-sheet/const.js.map +0 -1
- package/lib/commonjs/responsive-sheet/index.js +0 -19
- package/lib/commonjs/responsive-sheet/index.js.map +0 -1
- package/lib/commonjs/responsive-sheet/index.web.js +0 -19
- package/lib/commonjs/responsive-sheet/index.web.js.map +0 -1
- package/lib/commonjs/responsive-sheet/types.js +0 -6
- package/lib/commonjs/responsive-sheet/types.js.map +0 -1
- package/lib/module/dialog/CenteredDialog.js +0 -244
- package/lib/module/dialog/CenteredDialog.js.map +0 -1
- package/lib/module/dialog/CenteredDialog.web.js +0 -322
- package/lib/module/dialog/CenteredDialog.web.js.map +0 -1
- package/lib/module/dialog/centered-dialog-tokens.js +0 -58
- package/lib/module/dialog/centered-dialog-tokens.js.map +0 -1
- package/lib/module/dialog/centered-dialog-types.js +0 -4
- package/lib/module/dialog/centered-dialog-types.js.map +0 -1
- package/lib/module/responsive-sheet/ResponsiveSheet.js +0 -293
- package/lib/module/responsive-sheet/ResponsiveSheet.js.map +0 -1
- package/lib/module/responsive-sheet/ResponsiveSheet.native.js +0 -219
- package/lib/module/responsive-sheet/ResponsiveSheet.native.js.map +0 -1
- package/lib/module/responsive-sheet/const.js +0 -56
- package/lib/module/responsive-sheet/const.js.map +0 -1
- package/lib/module/responsive-sheet/index.js +0 -4
- package/lib/module/responsive-sheet/index.js.map +0 -1
- package/lib/module/responsive-sheet/index.web.js +0 -14
- package/lib/module/responsive-sheet/index.web.js.map +0 -1
- package/lib/module/responsive-sheet/types.js +0 -4
- package/lib/module/responsive-sheet/types.js.map +0 -1
- package/lib/typescript/commonjs/dialog/CenteredDialog.d.ts +0 -20
- package/lib/typescript/commonjs/dialog/CenteredDialog.d.ts.map +0 -1
- package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts +0 -29
- package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/dialog/centered-dialog-tokens.d.ts +0 -47
- package/lib/typescript/commonjs/dialog/centered-dialog-tokens.d.ts.map +0 -1
- package/lib/typescript/commonjs/dialog/centered-dialog-types.d.ts +0 -70
- package/lib/typescript/commonjs/dialog/centered-dialog-types.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts +0 -26
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.native.d.ts +0 -20
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/const.d.ts +0 -43
- package/lib/typescript/commonjs/responsive-sheet/const.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/index.d.ts +0 -3
- package/lib/typescript/commonjs/responsive-sheet/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/index.web.d.ts +0 -3
- package/lib/typescript/commonjs/responsive-sheet/index.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/types.d.ts +0 -55
- package/lib/typescript/commonjs/responsive-sheet/types.d.ts.map +0 -1
- package/lib/typescript/module/dialog/CenteredDialog.d.ts +0 -20
- package/lib/typescript/module/dialog/CenteredDialog.d.ts.map +0 -1
- package/lib/typescript/module/dialog/CenteredDialog.web.d.ts +0 -29
- package/lib/typescript/module/dialog/CenteredDialog.web.d.ts.map +0 -1
- package/lib/typescript/module/dialog/centered-dialog-tokens.d.ts +0 -47
- package/lib/typescript/module/dialog/centered-dialog-tokens.d.ts.map +0 -1
- package/lib/typescript/module/dialog/centered-dialog-types.d.ts +0 -70
- package/lib/typescript/module/dialog/centered-dialog-types.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts +0 -26
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.native.d.ts +0 -20
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.native.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/const.d.ts +0 -43
- package/lib/typescript/module/responsive-sheet/const.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/index.d.ts +0 -3
- package/lib/typescript/module/responsive-sheet/index.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/index.web.d.ts +0 -3
- package/lib/typescript/module/responsive-sheet/index.web.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/types.d.ts +0 -55
- package/lib/typescript/module/responsive-sheet/types.d.ts.map +0 -1
- package/src/__tests__/CenteredDialog.test.tsx +0 -108
- package/src/__tests__/ResponsiveSheet.test.tsx +0 -104
- package/src/dialog/CenteredDialog.stories.tsx +0 -125
- package/src/dialog/CenteredDialog.tsx +0 -303
- package/src/dialog/CenteredDialog.web.tsx +0 -372
- package/src/dialog/centered-dialog-tokens.ts +0 -68
- package/src/dialog/centered-dialog-types.ts +0 -70
- package/src/responsive-sheet/ResponsiveSheet.native.tsx +0 -257
- package/src/responsive-sheet/ResponsiveSheet.stories.tsx +0 -54
- package/src/responsive-sheet/ResponsiveSheet.tsx +0 -327
- package/src/responsive-sheet/const.ts +0 -53
- package/src/responsive-sheet/index.ts +0 -6
- package/src/responsive-sheet/index.web.ts +0 -16
- package/src/responsive-sheet/types.ts +0 -57
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { borderRadius, space } from "../styles/tokens.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Shared layout constants for `<CenteredDialog>`, kept in one module so the
|
|
7
|
-
* native and web forks render identically. All values are Bloom theme tokens
|
|
8
|
-
* (`styles/tokens`) — no ad-hoc magic numbers.
|
|
9
|
-
*
|
|
10
|
-
* COMPACT is the priority: the `compact` spacing set is the default and is
|
|
11
|
-
* deliberately tight (≈`space.md`), so the card reads snug out of the box.
|
|
12
|
-
* The `cozy` set is the opt-out (`compact={false}`) for roomier dialogs.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** Default max card width — comfortable for a compact dialog. */
|
|
16
|
-
export const DEFAULT_MAX_WIDTH = 440;
|
|
17
|
-
|
|
18
|
-
/** Card height is capped at this fraction of the viewport; body scrolls. */
|
|
19
|
-
export const MAX_HEIGHT_FRACTION = 0.8;
|
|
20
|
-
|
|
21
|
-
/** Card corner radius (token: `borderRadius.lg` = 16). */
|
|
22
|
-
export const CARD_RADIUS = borderRadius.lg;
|
|
23
|
-
|
|
24
|
-
/** Outer gutter between the card edge and the viewport edge (token `space.lg`). */
|
|
25
|
-
export const VIEWPORT_GUTTER = space.lg;
|
|
26
|
-
/**
|
|
27
|
-
* Compact (default) — tight, snug spacing built on `space.md` (12).
|
|
28
|
-
*
|
|
29
|
-
* pad = space.md (12)
|
|
30
|
-
* headerGap = space.sm (8)
|
|
31
|
-
* footerGap = space.md (12)
|
|
32
|
-
* contentGap = space.sm (8)
|
|
33
|
-
*/
|
|
34
|
-
export const COMPACT_SPACING = {
|
|
35
|
-
pad: space.md,
|
|
36
|
-
headerGap: space.sm,
|
|
37
|
-
footerGap: space.md,
|
|
38
|
-
contentGap: space.sm
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Cozy (`compact={false}`) — roomier spacing built on `space.xl` (20).
|
|
43
|
-
*
|
|
44
|
-
* pad = space.xl (20)
|
|
45
|
-
* headerGap = space.md (12)
|
|
46
|
-
* footerGap = space.lg (16)
|
|
47
|
-
* contentGap = space.md (12)
|
|
48
|
-
*/
|
|
49
|
-
export const COZY_SPACING = {
|
|
50
|
-
pad: space.xl,
|
|
51
|
-
headerGap: space.md,
|
|
52
|
-
footerGap: space.lg,
|
|
53
|
-
contentGap: space.md
|
|
54
|
-
};
|
|
55
|
-
export function resolveSpacing(compact) {
|
|
56
|
-
return compact ? COMPACT_SPACING : COZY_SPACING;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=centered-dialog-tokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["borderRadius","space","DEFAULT_MAX_WIDTH","MAX_HEIGHT_FRACTION","CARD_RADIUS","lg","VIEWPORT_GUTTER","COMPACT_SPACING","pad","md","headerGap","sm","footerGap","contentGap","COZY_SPACING","xl","resolveSpacing","compact"],"sourceRoot":"../../../src","sources":["dialog/centered-dialog-tokens.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,KAAK,QAAQ,qBAAkB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,iBAAiB,GAAG,GAAG;;AAEpC;AACA,OAAO,MAAMC,mBAAmB,GAAG,GAAG;;AAEtC;AACA,OAAO,MAAMC,WAAW,GAAGJ,YAAY,CAACK,EAAE;;AAE1C;AACA,OAAO,MAAMC,eAAe,GAAGL,KAAK,CAACI,EAAE;AAavC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,eAA8B,GAAG;EAC5CC,GAAG,EAAEP,KAAK,CAACQ,EAAE;EACbC,SAAS,EAAET,KAAK,CAACU,EAAE;EACnBC,SAAS,EAAEX,KAAK,CAACQ,EAAE;EACnBI,UAAU,EAAEZ,KAAK,CAACU;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,YAA2B,GAAG;EACzCN,GAAG,EAAEP,KAAK,CAACc,EAAE;EACbL,SAAS,EAAET,KAAK,CAACQ,EAAE;EACnBG,SAAS,EAAEX,KAAK,CAACI,EAAE;EACnBQ,UAAU,EAAEZ,KAAK,CAACQ;AACpB,CAAC;AAED,OAAO,SAASO,cAAcA,CAACC,OAAgB,EAAiB;EAC9D,OAAOA,OAAO,GAAGV,eAAe,GAAGO,YAAY;AACjD","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["dialog/centered-dialog-types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
|
-
import { Z_INDEX } from "../styles/z-index.js";
|
|
6
|
-
import { useTheme } from "../theme/use-theme.js";
|
|
7
|
-
import { ANIMATION_DURATION, BACKDROP_OPACITY, DEFAULT_BREAKPOINT, DEFAULT_LABEL, DEFAULT_MAX_HEIGHT_RATIO, DEFAULT_SIDE, DEFAULT_WIDTH, EASE_OUT, HANDLE_HEIGHT, HANDLE_RADIUS, HANDLE_WIDTH, PANEL_RADIUS, SIDE_SHEET_MIN_GUTTER } from "./const.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
/** Stable testID for the dimmed backdrop dismiss button. */
|
|
10
|
-
export const RESPONSIVE_SHEET_BACKDROP_TESTID = 'bloom-responsive-sheet-backdrop';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Default / web variant of `<ResponsiveSheet>`.
|
|
14
|
-
*
|
|
15
|
-
* This file is BOTH the package's default entry (`react-native` export
|
|
16
|
-
* condition resolves it for downstream `tsc`, and non-Metro web bundlers pick
|
|
17
|
-
* it via the `browser` condition through `index.web`) AND the canonical web
|
|
18
|
-
* implementation. It MUST NOT import `react-native-reanimated` — reanimated has
|
|
19
|
-
* no web build and its worklets Babel plugin is native-only, so a static import
|
|
20
|
-
* here would break every web bundler and downstream type-check. The native
|
|
21
|
-
* fork (`ResponsiveSheet.native.tsx`, selected only by Metro) drives the same
|
|
22
|
-
* motion with reanimated.
|
|
23
|
-
*
|
|
24
|
-
* Motion is pure CSS transitions: react-native-web emits `transition-*` style
|
|
25
|
-
* props to the DOM, and the panel/backdrop toggle their transform/opacity by a
|
|
26
|
-
* `shown` flag. Presence is handled with a `mounted` + `shown` pair so both the
|
|
27
|
-
* open AND close directions animate while the node stays mounted through the
|
|
28
|
-
* exit. We deliberately do NOT use reanimated `exiting` on web — concurrent
|
|
29
|
-
* React unmounts there throw `Failed to execute 'removeChild' on 'Node'`, the
|
|
30
|
-
* exact bug this component exists to avoid.
|
|
31
|
-
*/
|
|
32
|
-
export function ResponsiveSheet({
|
|
33
|
-
open,
|
|
34
|
-
onClose,
|
|
35
|
-
side = DEFAULT_SIDE,
|
|
36
|
-
breakpoint = DEFAULT_BREAKPOINT,
|
|
37
|
-
width = DEFAULT_WIDTH,
|
|
38
|
-
maxHeightRatio = DEFAULT_MAX_HEIGHT_RATIO,
|
|
39
|
-
inset,
|
|
40
|
-
showHandle = true,
|
|
41
|
-
dismissOnBackdrop = true,
|
|
42
|
-
panelStyle,
|
|
43
|
-
panelClassName,
|
|
44
|
-
containerStyle,
|
|
45
|
-
containerClassName,
|
|
46
|
-
label = DEFAULT_LABEL,
|
|
47
|
-
children
|
|
48
|
-
}) {
|
|
49
|
-
const theme = useTheme();
|
|
50
|
-
const {
|
|
51
|
-
width: viewportWidth,
|
|
52
|
-
height: viewportHeight
|
|
53
|
-
} = useWindowDimensions();
|
|
54
|
-
|
|
55
|
-
// Presence: `mounted` keeps the node in the tree through the exit transition;
|
|
56
|
-
// `shown` drives the enter/exit transform & opacity. On open we mount first,
|
|
57
|
-
// then flip `shown` on the next frame so the browser registers the start
|
|
58
|
-
// state and animates to the end. On close we flip `shown` off, then unmount
|
|
59
|
-
// after the transition duration.
|
|
60
|
-
const [mounted, setMounted] = useState(open);
|
|
61
|
-
const [shown, setShown] = useState(false);
|
|
62
|
-
const closeTimerRef = useRef(null);
|
|
63
|
-
const frameRef = useRef(null);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (open) {
|
|
66
|
-
if (closeTimerRef.current) {
|
|
67
|
-
clearTimeout(closeTimerRef.current);
|
|
68
|
-
closeTimerRef.current = null;
|
|
69
|
-
}
|
|
70
|
-
setMounted(true);
|
|
71
|
-
// Defer to the next frame so the entry start state paints before we
|
|
72
|
-
// transition to the shown state. Two frames guarantees the start
|
|
73
|
-
// transform has committed before the toggle (a single frame can be
|
|
74
|
-
// coalesced with the mount paint in some browsers).
|
|
75
|
-
frameRef.current = scheduleFrame(() => {
|
|
76
|
-
frameRef.current = scheduleFrame(() => setShown(true));
|
|
77
|
-
});
|
|
78
|
-
return () => {
|
|
79
|
-
if (frameRef.current !== null) {
|
|
80
|
-
cancelFrame(frameRef.current);
|
|
81
|
-
frameRef.current = null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Closing: only run the exit if something is currently mounted.
|
|
87
|
-
setShown(false);
|
|
88
|
-
if (!mounted) return;
|
|
89
|
-
closeTimerRef.current = setTimeout(() => {
|
|
90
|
-
setMounted(false);
|
|
91
|
-
closeTimerRef.current = null;
|
|
92
|
-
}, ANIMATION_DURATION);
|
|
93
|
-
return () => {
|
|
94
|
-
if (closeTimerRef.current) {
|
|
95
|
-
clearTimeout(closeTimerRef.current);
|
|
96
|
-
closeTimerRef.current = null;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}, [open, mounted]);
|
|
100
|
-
|
|
101
|
-
// Escape-to-close while open (web only; document is undefined elsewhere).
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (!open || typeof document === 'undefined') return;
|
|
104
|
-
const handler = e => {
|
|
105
|
-
if (e.key === 'Escape') {
|
|
106
|
-
e.stopPropagation();
|
|
107
|
-
onClose();
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
document.addEventListener('keydown', handler);
|
|
111
|
-
return () => document.removeEventListener('keydown', handler);
|
|
112
|
-
}, [open, onClose]);
|
|
113
|
-
const handleBackdropPress = useCallback(() => {
|
|
114
|
-
if (dismissOnBackdrop) onClose();
|
|
115
|
-
}, [dismissOnBackdrop, onClose]);
|
|
116
|
-
const isBottom = viewportWidth < breakpoint;
|
|
117
|
-
const panelBackground = theme.colors.background;
|
|
118
|
-
const panelTransition = useMemo(() => ({
|
|
119
|
-
transitionProperty: 'transform, opacity',
|
|
120
|
-
transitionDuration: `${ANIMATION_DURATION}ms`,
|
|
121
|
-
transitionTimingFunction: EASE_OUT
|
|
122
|
-
}), []);
|
|
123
|
-
const backdropTransition = useMemo(() => ({
|
|
124
|
-
transitionProperty: 'opacity',
|
|
125
|
-
transitionDuration: `${ANIMATION_DURATION}ms`,
|
|
126
|
-
transitionTimingFunction: EASE_OUT
|
|
127
|
-
}), []);
|
|
128
|
-
const panelGeometry = useMemo(() => {
|
|
129
|
-
if (isBottom) {
|
|
130
|
-
return {
|
|
131
|
-
left: 0,
|
|
132
|
-
right: 0,
|
|
133
|
-
bottom: 0,
|
|
134
|
-
maxHeight: Math.round(viewportHeight * maxHeightRatio),
|
|
135
|
-
borderTopLeftRadius: PANEL_RADIUS,
|
|
136
|
-
borderTopRightRadius: PANEL_RADIUS,
|
|
137
|
-
transform: [{
|
|
138
|
-
translateY: shown ? 0 : '100%'
|
|
139
|
-
}],
|
|
140
|
-
opacity: shown ? 1 : 0
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Side-sheet: full height minus top/bottom inset, anchored to `side`,
|
|
145
|
-
// offset by the matching horizontal inset. Width is capped so the panel
|
|
146
|
-
// always leaves a gutter on the opposite edge.
|
|
147
|
-
const insetTop = inset?.top ?? 0;
|
|
148
|
-
const insetBottom = inset?.bottom ?? 0;
|
|
149
|
-
const insetLeft = inset?.left ?? 0;
|
|
150
|
-
const insetRight = inset?.right ?? 0;
|
|
151
|
-
const anchorInset = side === 'left' ? insetLeft : insetRight;
|
|
152
|
-
const oppositeInset = side === 'left' ? insetRight : insetLeft;
|
|
153
|
-
const available = viewportWidth - anchorInset - oppositeInset - SIDE_SHEET_MIN_GUTTER;
|
|
154
|
-
const cappedWidth = Math.max(0, Math.min(width, available));
|
|
155
|
-
const hiddenSign = side === 'left' ? '-100%' : '100%';
|
|
156
|
-
return {
|
|
157
|
-
top: insetTop,
|
|
158
|
-
bottom: insetBottom,
|
|
159
|
-
[side]: anchorInset,
|
|
160
|
-
width: cappedWidth,
|
|
161
|
-
borderRadius: PANEL_RADIUS,
|
|
162
|
-
transform: [{
|
|
163
|
-
translateX: shown ? 0 : hiddenSign
|
|
164
|
-
}],
|
|
165
|
-
opacity: shown ? 1 : 0
|
|
166
|
-
};
|
|
167
|
-
}, [isBottom, shown, side, width, inset, viewportWidth, viewportHeight, maxHeightRatio]);
|
|
168
|
-
if (!mounted) return null;
|
|
169
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
170
|
-
style: [styles.root, containerStyle]
|
|
171
|
-
// NativeWind reads `className` at runtime; RN core does not type it on
|
|
172
|
-
// View, so spread it conditionally (matching the Button/Fab pattern).
|
|
173
|
-
,
|
|
174
|
-
...(containerClassName ? {
|
|
175
|
-
className: containerClassName
|
|
176
|
-
} : {}),
|
|
177
|
-
pointerEvents: "box-none",
|
|
178
|
-
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
179
|
-
testID: RESPONSIVE_SHEET_BACKDROP_TESTID,
|
|
180
|
-
accessibilityRole: "button",
|
|
181
|
-
accessibilityLabel: `Dismiss ${label}`,
|
|
182
|
-
onPress: handleBackdropPress,
|
|
183
|
-
disabled: !dismissOnBackdrop,
|
|
184
|
-
style: [styles.backdrop, backdropTransition, {
|
|
185
|
-
opacity: shown ? BACKDROP_OPACITY : 0
|
|
186
|
-
}, isWeb ? webBackdropBlur : null]
|
|
187
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
188
|
-
accessibilityViewIsModal: true,
|
|
189
|
-
"aria-label": label,
|
|
190
|
-
...(panelClassName ? {
|
|
191
|
-
className: panelClassName
|
|
192
|
-
} : {}),
|
|
193
|
-
style: [styles.panel, {
|
|
194
|
-
backgroundColor: panelBackground,
|
|
195
|
-
shadowColor: theme.colors.shadow
|
|
196
|
-
}, panelGeometry, panelTransition, panelStyle],
|
|
197
|
-
pointerEvents: "auto",
|
|
198
|
-
children: [isBottom && showHandle ? /*#__PURE__*/_jsx(View, {
|
|
199
|
-
style: styles.handleRow,
|
|
200
|
-
pointerEvents: "none",
|
|
201
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
202
|
-
style: [styles.handle, {
|
|
203
|
-
backgroundColor: theme.colors.border
|
|
204
|
-
}]
|
|
205
|
-
})
|
|
206
|
-
}) : null, children]
|
|
207
|
-
})]
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// This module is the web/default impl, but it is also the fallback resolved by
|
|
212
|
-
// a downstream consumer's `tsc` for the native target, so guard the web-only
|
|
213
|
-
// `backdrop-blur` style behind a runtime check rather than assuming web.
|
|
214
|
-
const isWeb = typeof document !== 'undefined';
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Opaque token returned by `scheduleFrame`. `requestAnimationFrame` returns a
|
|
218
|
-
* number; the `setTimeout` fallback returns a timer handle — both are kept so
|
|
219
|
-
* `cancelFrame` can route to the matching canceller.
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Schedule a callback for the next paint. Uses `requestAnimationFrame` in the
|
|
224
|
-
* browser; degrades to a 0ms timeout when rAF is unavailable (SSR/hydration,
|
|
225
|
-
* non-DOM test envs) so the enter transition's `shown` flip still fires.
|
|
226
|
-
*/
|
|
227
|
-
function scheduleFrame(cb) {
|
|
228
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
229
|
-
return {
|
|
230
|
-
raf: requestAnimationFrame(cb)
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
timer: setTimeout(cb, 0)
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
function cancelFrame(token) {
|
|
238
|
-
if ('raf' in token) {
|
|
239
|
-
if (typeof cancelAnimationFrame === 'function') cancelAnimationFrame(token.raf);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
clearTimeout(token.timer);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// `backdrop-filter` is web-only; react-native-web passes it through to the DOM.
|
|
246
|
-
const webBackdropBlur = {
|
|
247
|
-
backdropFilter: 'blur(2px)'
|
|
248
|
-
};
|
|
249
|
-
const styles = StyleSheet.create({
|
|
250
|
-
root: {
|
|
251
|
-
// `position: fixed` pins the overlay to the viewport on web; react-native
|
|
252
|
-
// does not type `'fixed'`, so cast to the RN-accepted `'absolute'`. On
|
|
253
|
-
// native the `.native` fork uses `StyleSheet.absoluteFill` instead.
|
|
254
|
-
position: 'fixed',
|
|
255
|
-
top: 0,
|
|
256
|
-
left: 0,
|
|
257
|
-
right: 0,
|
|
258
|
-
bottom: 0,
|
|
259
|
-
zIndex: Z_INDEX.fullscreen
|
|
260
|
-
},
|
|
261
|
-
backdrop: {
|
|
262
|
-
position: 'absolute',
|
|
263
|
-
top: 0,
|
|
264
|
-
left: 0,
|
|
265
|
-
right: 0,
|
|
266
|
-
bottom: 0,
|
|
267
|
-
backgroundColor: '#000'
|
|
268
|
-
},
|
|
269
|
-
panel: {
|
|
270
|
-
position: 'absolute',
|
|
271
|
-
overflow: 'hidden',
|
|
272
|
-
shadowOpacity: 0.18,
|
|
273
|
-
shadowRadius: 24,
|
|
274
|
-
shadowOffset: {
|
|
275
|
-
width: 0,
|
|
276
|
-
height: 8
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
handleRow: {
|
|
280
|
-
width: '100%',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
paddingTop: 8,
|
|
283
|
-
paddingBottom: 4
|
|
284
|
-
},
|
|
285
|
-
handle: {
|
|
286
|
-
width: HANDLE_WIDTH,
|
|
287
|
-
height: HANDLE_HEIGHT,
|
|
288
|
-
borderRadius: HANDLE_RADIUS,
|
|
289
|
-
opacity: 0.5
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
export default ResponsiveSheet;
|
|
293
|
-
//# sourceMappingURL=ResponsiveSheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","Pressable","StyleSheet","useWindowDimensions","View","Z_INDEX","useTheme","ANIMATION_DURATION","BACKDROP_OPACITY","DEFAULT_BREAKPOINT","DEFAULT_LABEL","DEFAULT_MAX_HEIGHT_RATIO","DEFAULT_SIDE","DEFAULT_WIDTH","EASE_OUT","HANDLE_HEIGHT","HANDLE_RADIUS","HANDLE_WIDTH","PANEL_RADIUS","SIDE_SHEET_MIN_GUTTER","jsx","_jsx","jsxs","_jsxs","RESPONSIVE_SHEET_BACKDROP_TESTID","ResponsiveSheet","open","onClose","side","breakpoint","width","maxHeightRatio","inset","showHandle","dismissOnBackdrop","panelStyle","panelClassName","containerStyle","containerClassName","label","children","theme","viewportWidth","height","viewportHeight","mounted","setMounted","shown","setShown","closeTimerRef","frameRef","current","clearTimeout","scheduleFrame","cancelFrame","setTimeout","document","handler","e","key","stopPropagation","addEventListener","removeEventListener","handleBackdropPress","isBottom","panelBackground","colors","background","panelTransition","transitionProperty","transitionDuration","transitionTimingFunction","backdropTransition","panelGeometry","left","right","bottom","maxHeight","Math","round","borderTopLeftRadius","borderTopRightRadius","transform","translateY","opacity","insetTop","top","insetBottom","insetLeft","insetRight","anchorInset","oppositeInset","available","cappedWidth","max","min","hiddenSign","borderRadius","translateX","style","styles","root","className","pointerEvents","testID","accessibilityRole","accessibilityLabel","onPress","disabled","backdrop","isWeb","webBackdropBlur","accessibilityViewIsModal","panel","backgroundColor","shadowColor","shadow","handleRow","handle","border","cb","requestAnimationFrame","raf","timer","token","cancelAnimationFrame","backdropFilter","create","position","zIndex","fullscreen","overflow","shadowOpacity","shadowRadius","shadowOffset","alignItems","paddingTop","paddingBottom"],"sourceRoot":"../../../src","sources":["responsive-sheet/ResponsiveSheet.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AAErB,SAASC,OAAO,QAAQ,sBAAmB;AAC3C,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SACEC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,aAAa,EACbC,wBAAwB,EACxBC,YAAY,EACZC,aAAa,EACbC,QAAQ,EACRC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,qBAAqB,QAChB,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGjB;AACA,OAAO,MAAMC,gCAAgC,GAAG,iCAAiC;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAY;IACnB0B,MAAM,EAAE5B,aAAa;IACrBkF,YAAY,EAAEjF,aAAa;IAC3BoE,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAe3D,eAAe","ignoreList":[]}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
|
-
import Animated, { cancelAnimation, Easing, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
|
-
import { Z_INDEX } from "../styles/z-index.js";
|
|
7
|
-
import { useTheme } from "../theme/use-theme.js";
|
|
8
|
-
import { ANIMATION_DURATION, BACKDROP_OPACITY, DEFAULT_BREAKPOINT, DEFAULT_LABEL, DEFAULT_MAX_HEIGHT_RATIO, DEFAULT_SIDE, DEFAULT_WIDTH, HANDLE_HEIGHT, HANDLE_RADIUS, HANDLE_WIDTH, PANEL_RADIUS, SIDE_SHEET_MIN_GUTTER } from "./const.js";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
/** Stable testID for the dimmed backdrop dismiss button. */
|
|
11
|
-
export const RESPONSIVE_SHEET_BACKDROP_TESTID = 'bloom-responsive-sheet-backdrop';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Native variant of `<ResponsiveSheet>` (selected only by Metro).
|
|
15
|
-
*
|
|
16
|
-
* Uses `react-native-reanimated` to drive the same motion as the web/CSS
|
|
17
|
-
* default fork: a shared `progress` value times 0 -> 1 on open and 1 -> 0 on
|
|
18
|
-
* close, mapped to the panel translate/opacity and the backdrop opacity.
|
|
19
|
-
* Native exit animations are safe here — the web-only `removeChild` crash does
|
|
20
|
-
* not apply — so we keep the node mounted through the close timing and unmount
|
|
21
|
-
* from the animation completion callback.
|
|
22
|
-
*
|
|
23
|
-
* The panel itself is measured (not percentage-translated): we offset by the
|
|
24
|
-
* panel's own width/height so the hidden state sits fully off its side, which
|
|
25
|
-
* is the reanimated-friendly equivalent of the web `translate(±100%)`.
|
|
26
|
-
*/
|
|
27
|
-
export function ResponsiveSheet({
|
|
28
|
-
open,
|
|
29
|
-
onClose,
|
|
30
|
-
side = DEFAULT_SIDE,
|
|
31
|
-
breakpoint = DEFAULT_BREAKPOINT,
|
|
32
|
-
width = DEFAULT_WIDTH,
|
|
33
|
-
maxHeightRatio = DEFAULT_MAX_HEIGHT_RATIO,
|
|
34
|
-
inset,
|
|
35
|
-
showHandle = true,
|
|
36
|
-
dismissOnBackdrop = true,
|
|
37
|
-
panelStyle,
|
|
38
|
-
panelClassName,
|
|
39
|
-
containerStyle,
|
|
40
|
-
containerClassName,
|
|
41
|
-
label = DEFAULT_LABEL,
|
|
42
|
-
children
|
|
43
|
-
}) {
|
|
44
|
-
const theme = useTheme();
|
|
45
|
-
const {
|
|
46
|
-
width: viewportWidth,
|
|
47
|
-
height: viewportHeight
|
|
48
|
-
} = useWindowDimensions();
|
|
49
|
-
|
|
50
|
-
// Keep the tree mounted through the exit timing; unmount once it settles.
|
|
51
|
-
const [mounted, setMounted] = useState(open);
|
|
52
|
-
// `progress`: 0 = fully hidden, 1 = fully shown. Drives both transform and
|
|
53
|
-
// opacity so a single timing controls the whole transition.
|
|
54
|
-
const progress = useSharedValue(open ? 1 : 0);
|
|
55
|
-
const isBottom = viewportWidth < breakpoint;
|
|
56
|
-
|
|
57
|
-
// Measured panel extent along the travel axis. Falls back to the geometry
|
|
58
|
-
// target so the very first frame is already off-screen before layout lands.
|
|
59
|
-
const insetTop = inset?.top ?? 0;
|
|
60
|
-
const insetBottom = inset?.bottom ?? 0;
|
|
61
|
-
const insetLeft = inset?.left ?? 0;
|
|
62
|
-
const insetRight = inset?.right ?? 0;
|
|
63
|
-
const anchorInset = side === 'left' ? insetLeft : insetRight;
|
|
64
|
-
const oppositeInset = side === 'left' ? insetRight : insetLeft;
|
|
65
|
-
const sideWidth = useMemo(() => {
|
|
66
|
-
const available = viewportWidth - anchorInset - oppositeInset - SIDE_SHEET_MIN_GUTTER;
|
|
67
|
-
return Math.max(0, Math.min(width, available));
|
|
68
|
-
}, [viewportWidth, anchorInset, oppositeInset, width]);
|
|
69
|
-
const bottomMaxHeight = useMemo(() => Math.round(viewportHeight * maxHeightRatio), [viewportHeight, maxHeightRatio]);
|
|
70
|
-
|
|
71
|
-
// Travel distance for the hidden state: the panel's measured extent (height
|
|
72
|
-
// for the bottom-sheet, width for the side-sheet), with the geometry target
|
|
73
|
-
// as the pre-measurement fallback.
|
|
74
|
-
const travel = useSharedValue(isBottom ? bottomMaxHeight : sideWidth);
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
travel.value = isBottom ? bottomMaxHeight : sideWidth;
|
|
77
|
-
}, [isBottom, bottomMaxHeight, sideWidth, travel]);
|
|
78
|
-
const finishClose = useCallback(() => {
|
|
79
|
-
setMounted(false);
|
|
80
|
-
}, []);
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
cancelAnimation(progress);
|
|
83
|
-
const timing = {
|
|
84
|
-
duration: ANIMATION_DURATION,
|
|
85
|
-
easing: Easing.out(Easing.cubic)
|
|
86
|
-
};
|
|
87
|
-
if (open) {
|
|
88
|
-
setMounted(true);
|
|
89
|
-
progress.value = withTiming(1, timing);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (!mounted) return;
|
|
93
|
-
progress.value = withTiming(0, timing, finished => {
|
|
94
|
-
if (finished) runOnJS(finishClose)();
|
|
95
|
-
});
|
|
96
|
-
}, [open, mounted, progress, finishClose]);
|
|
97
|
-
const handleBackdropPress = useCallback(() => {
|
|
98
|
-
if (dismissOnBackdrop) onClose();
|
|
99
|
-
}, [dismissOnBackdrop, onClose]);
|
|
100
|
-
const backdropAnimatedStyle = useAnimatedStyle(() => ({
|
|
101
|
-
opacity: progress.value * BACKDROP_OPACITY
|
|
102
|
-
}));
|
|
103
|
-
const hiddenSign = side === 'left' ? -1 : 1;
|
|
104
|
-
const panelAnimatedStyle = useAnimatedStyle(() => {
|
|
105
|
-
const hidden = 1 - progress.value;
|
|
106
|
-
if (isBottom) {
|
|
107
|
-
return {
|
|
108
|
-
opacity: progress.value,
|
|
109
|
-
transform: [{
|
|
110
|
-
translateY: hidden * travel.value
|
|
111
|
-
}]
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
opacity: progress.value,
|
|
116
|
-
transform: [{
|
|
117
|
-
translateX: hidden * travel.value * hiddenSign
|
|
118
|
-
}]
|
|
119
|
-
};
|
|
120
|
-
}, [isBottom, hiddenSign]);
|
|
121
|
-
const measurePanel = useCallback(e => {
|
|
122
|
-
const measured = isBottom ? e.nativeEvent.layout.height : e.nativeEvent.layout.width;
|
|
123
|
-
if (measured > 0) travel.value = measured;
|
|
124
|
-
}, [isBottom, travel]);
|
|
125
|
-
const panelGeometry = useMemo(() => {
|
|
126
|
-
if (isBottom) {
|
|
127
|
-
return {
|
|
128
|
-
left: 0,
|
|
129
|
-
right: 0,
|
|
130
|
-
bottom: 0,
|
|
131
|
-
maxHeight: bottomMaxHeight,
|
|
132
|
-
borderTopLeftRadius: PANEL_RADIUS,
|
|
133
|
-
borderTopRightRadius: PANEL_RADIUS
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
top: insetTop,
|
|
138
|
-
bottom: insetBottom,
|
|
139
|
-
[side]: anchorInset,
|
|
140
|
-
width: sideWidth,
|
|
141
|
-
borderRadius: PANEL_RADIUS
|
|
142
|
-
};
|
|
143
|
-
}, [isBottom, bottomMaxHeight, insetTop, insetBottom, side, anchorInset, sideWidth]);
|
|
144
|
-
if (!mounted) return null;
|
|
145
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
146
|
-
style: [styles.root, containerStyle],
|
|
147
|
-
...(containerClassName ? {
|
|
148
|
-
className: containerClassName
|
|
149
|
-
} : {}),
|
|
150
|
-
pointerEvents: "box-none",
|
|
151
|
-
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
152
|
-
style: [styles.backdrop, backdropAnimatedStyle],
|
|
153
|
-
pointerEvents: "auto",
|
|
154
|
-
children: /*#__PURE__*/_jsx(Pressable, {
|
|
155
|
-
testID: RESPONSIVE_SHEET_BACKDROP_TESTID,
|
|
156
|
-
accessibilityRole: "button",
|
|
157
|
-
accessibilityLabel: `Dismiss ${label}`,
|
|
158
|
-
onPress: handleBackdropPress,
|
|
159
|
-
disabled: !dismissOnBackdrop,
|
|
160
|
-
style: StyleSheet.absoluteFill
|
|
161
|
-
})
|
|
162
|
-
}), /*#__PURE__*/_jsxs(Animated.View, {
|
|
163
|
-
accessibilityViewIsModal: true,
|
|
164
|
-
...(panelClassName ? {
|
|
165
|
-
className: panelClassName
|
|
166
|
-
} : {}),
|
|
167
|
-
onLayout: measurePanel,
|
|
168
|
-
style: [styles.panel, {
|
|
169
|
-
backgroundColor: theme.colors.background,
|
|
170
|
-
shadowColor: theme.colors.shadow
|
|
171
|
-
}, panelGeometry, panelAnimatedStyle, panelStyle],
|
|
172
|
-
pointerEvents: "auto",
|
|
173
|
-
children: [isBottom && showHandle ? /*#__PURE__*/_jsx(View, {
|
|
174
|
-
style: styles.handleRow,
|
|
175
|
-
pointerEvents: "none",
|
|
176
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
177
|
-
style: [styles.handle, {
|
|
178
|
-
backgroundColor: theme.colors.border
|
|
179
|
-
}]
|
|
180
|
-
})
|
|
181
|
-
}) : null, children]
|
|
182
|
-
})]
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
const styles = StyleSheet.create({
|
|
186
|
-
root: {
|
|
187
|
-
...StyleSheet.absoluteFill,
|
|
188
|
-
zIndex: Z_INDEX.fullscreen
|
|
189
|
-
},
|
|
190
|
-
backdrop: {
|
|
191
|
-
...StyleSheet.absoluteFill,
|
|
192
|
-
backgroundColor: '#000'
|
|
193
|
-
},
|
|
194
|
-
panel: {
|
|
195
|
-
position: 'absolute',
|
|
196
|
-
overflow: 'hidden',
|
|
197
|
-
shadowOpacity: 0.18,
|
|
198
|
-
shadowRadius: 24,
|
|
199
|
-
shadowOffset: {
|
|
200
|
-
width: 0,
|
|
201
|
-
height: 8
|
|
202
|
-
},
|
|
203
|
-
elevation: 12
|
|
204
|
-
},
|
|
205
|
-
handleRow: {
|
|
206
|
-
width: '100%',
|
|
207
|
-
alignItems: 'center',
|
|
208
|
-
paddingTop: 8,
|
|
209
|
-
paddingBottom: 4
|
|
210
|
-
},
|
|
211
|
-
handle: {
|
|
212
|
-
width: HANDLE_WIDTH,
|
|
213
|
-
height: HANDLE_HEIGHT,
|
|
214
|
-
borderRadius: HANDLE_RADIUS,
|
|
215
|
-
opacity: 0.5
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
export default ResponsiveSheet;
|
|
219
|
-
//# sourceMappingURL=ResponsiveSheet.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","Pressable","StyleSheet","useWindowDimensions","View","Animated","cancelAnimation","Easing","runOnJS","useAnimatedStyle","useSharedValue","withTiming","Z_INDEX","useTheme","ANIMATION_DURATION","BACKDROP_OPACITY","DEFAULT_BREAKPOINT","DEFAULT_LABEL","DEFAULT_MAX_HEIGHT_RATIO","DEFAULT_SIDE","DEFAULT_WIDTH","HANDLE_HEIGHT","HANDLE_RADIUS","HANDLE_WIDTH","PANEL_RADIUS","SIDE_SHEET_MIN_GUTTER","jsx","_jsx","jsxs","_jsxs","RESPONSIVE_SHEET_BACKDROP_TESTID","ResponsiveSheet","open","onClose","side","breakpoint","width","maxHeightRatio","inset","showHandle","dismissOnBackdrop","panelStyle","panelClassName","containerStyle","containerClassName","label","children","theme","viewportWidth","height","viewportHeight","mounted","setMounted","progress","isBottom","insetTop","top","insetBottom","bottom","insetLeft","left","insetRight","right","anchorInset","oppositeInset","sideWidth","available","Math","max","min","bottomMaxHeight","round","travel","value","finishClose","timing","duration","easing","out","cubic","finished","handleBackdropPress","backdropAnimatedStyle","opacity","hiddenSign","panelAnimatedStyle","hidden","transform","translateY","translateX","measurePanel","e","measured","nativeEvent","layout","panelGeometry","maxHeight","borderTopLeftRadius","borderTopRightRadius","borderRadius","style","styles","root","className","pointerEvents","backdrop","testID","accessibilityRole","accessibilityLabel","onPress","disabled","absoluteFill","accessibilityViewIsModal","onLayout","panel","backgroundColor","colors","background","shadowColor","shadow","handleRow","handle","border","create","zIndex","fullscreen","position","overflow","shadowOpacity","shadowRadius","shadowOffset","elevation","alignItems","paddingTop","paddingBottom"],"sourceRoot":"../../../src","sources":["responsive-sheet/ResponsiveSheet.native.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EAEPC,QAAQ,QACH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AACrB,OAAOC,QAAQ,IACbC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAEhC,SAASC,OAAO,QAAQ,sBAAmB;AAC3C,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SACEC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,aAAa,EACbC,wBAAwB,EACxBC,YAAY,EACZC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,qBAAqB,QAChB,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGjB;AACA,OAAO,MAAMC,gCAAgC,GAAG,iCAAiC;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAC;EAC9BC,IAAI;EACJC,OAAO;EACPC,IAAI,GAAGf,YAAY;EACnBgB,UAAU,GAAG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