@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,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared default constants for `ResponsiveSheet`.
|
|
5
|
-
*
|
|
6
|
-
* Platform-agnostic — imported by both the default/web CSS implementation
|
|
7
|
-
* (`ResponsiveSheet.tsx`) and the native reanimated implementation
|
|
8
|
-
* (`ResponsiveSheet.native.tsx`) so the two variants stay in lockstep.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/** Below this viewport width the sheet renders as a bottom-sheet. */
|
|
12
|
-
export const DEFAULT_BREAKPOINT = 768;
|
|
13
|
-
|
|
14
|
-
/** Side-sheet width (px) on wide screens. Capped to fit the viewport. */
|
|
15
|
-
export const DEFAULT_WIDTH = 460;
|
|
16
|
-
|
|
17
|
-
/** Bottom-sheet maximum height as a fraction of the viewport height. */
|
|
18
|
-
export const DEFAULT_MAX_HEIGHT_RATIO = 0.9;
|
|
19
|
-
|
|
20
|
-
/** Anchored edge of the side-sheet on wide screens. */
|
|
21
|
-
export const DEFAULT_SIDE = 'left';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Open/close transition duration (ms). ~280–300ms ease-out reads as smooth
|
|
25
|
-
* without feeling sluggish; shared by the CSS transition and the native
|
|
26
|
-
* reanimated timing so both platforms match.
|
|
27
|
-
*/
|
|
28
|
-
export const ANIMATION_DURATION = 280;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Standard CSS approximation of reanimated's `Easing.out(Easing.cubic)` so the
|
|
32
|
-
* web transition curve matches the native one.
|
|
33
|
-
*/
|
|
34
|
-
export const EASE_OUT = 'cubic-bezier(0.33, 1, 0.68, 1)';
|
|
35
|
-
|
|
36
|
-
/** Corner radius for the side-sheet panel and the top of the bottom-sheet. */
|
|
37
|
-
export const PANEL_RADIUS = 20;
|
|
38
|
-
|
|
39
|
-
/** Backdrop dim opacity once fully shown (matches `bg-black/40`). */
|
|
40
|
-
export const BACKDROP_OPACITY = 0.4;
|
|
41
|
-
|
|
42
|
-
/** Drag-handle pill geometry for the bottom-sheet. */
|
|
43
|
-
export const HANDLE_WIDTH = 36;
|
|
44
|
-
export const HANDLE_HEIGHT = 5;
|
|
45
|
-
export const HANDLE_RADIUS = 3;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Minimum gutter kept between a wide side-sheet and the opposite viewport edge
|
|
49
|
-
* when capping its width, so the panel never spans the full screen on a narrow
|
|
50
|
-
* desktop window that is still above the breakpoint.
|
|
51
|
-
*/
|
|
52
|
-
export const SIDE_SHEET_MIN_GUTTER = 24;
|
|
53
|
-
|
|
54
|
-
/** A11y label fallback when the host does not provide one. */
|
|
55
|
-
export const DEFAULT_LABEL = 'Sheet';
|
|
56
|
-
//# sourceMappingURL=const.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_BREAKPOINT","DEFAULT_WIDTH","DEFAULT_MAX_HEIGHT_RATIO","DEFAULT_SIDE","ANIMATION_DURATION","EASE_OUT","PANEL_RADIUS","BACKDROP_OPACITY","HANDLE_WIDTH","HANDLE_HEIGHT","HANDLE_RADIUS","SIDE_SHEET_MIN_GUTTER","DEFAULT_LABEL"],"sourceRoot":"../../../src","sources":["responsive-sheet/const.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMA,kBAAkB,GAAG,GAAG;;AAErC;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;;AAEhC;AACA,OAAO,MAAMC,wBAAwB,GAAG,GAAG;;AAE3C;AACA,OAAO,MAAMC,YAAY,GAAG,MAAe;;AAE3C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG,GAAG;;AAErC;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,gCAAgC;;AAExD;AACA,OAAO,MAAMC,YAAY,GAAG,EAAE;;AAE9B;AACA,OAAO,MAAMC,gBAAgB,GAAG,GAAG;;AAEnC;AACA,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,aAAa,GAAG,CAAC;AAC9B,OAAO,MAAMC,aAAa,GAAG,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAG,EAAE;;AAEvC;AACA,OAAO,MAAMC,aAAa,GAAG,OAAO","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ResponsiveSheet","RESPONSIVE_SHEET_BACKDROP_TESTID"],"sourceRoot":"../../../src","sources":["responsive-sheet/index.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,gCAAgC,QAAQ,mBAAmB","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Web variant of the `./responsive-sheet` barrel.
|
|
4
|
-
//
|
|
5
|
-
// The default barrel (`./index.ts`) re-exports from `./ResponsiveSheet`, which
|
|
6
|
-
// is itself the reanimated-free web/CSS implementation — Metro additionally
|
|
7
|
-
// resolves `./ResponsiveSheet.native` for native targets. Web bundlers select
|
|
8
|
-
// THIS file via the `"browser"` export condition in `package.json`'s
|
|
9
|
-
// `exports['./responsive-sheet']`, pointing them explicitly at the CSS
|
|
10
|
-
// implementation so a non-Metro bundler never follows the `.native` sibling
|
|
11
|
-
// (which statically imports `react-native-reanimated`, a native-only module).
|
|
12
|
-
// Types are platform-agnostic, so they come straight from `./types`.
|
|
13
|
-
export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './ResponsiveSheet';
|
|
14
|
-
//# sourceMappingURL=index.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ResponsiveSheet","RESPONSIVE_SHEET_BACKDROP_TESTID"],"sourceRoot":"../../../src","sources":["responsive-sheet/index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,gCAAgC,QAAQ,mBAAmB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["responsive-sheet/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CenteredDialogProps } from './centered-dialog-types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop. Overridden when a `testID` is set. */
|
|
3
|
-
export declare const CENTERED_DIALOG_BACKDROP_TESTID = "bloom-centered-dialog-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Native variant of `<CenteredDialog>`.
|
|
6
|
-
*
|
|
7
|
-
* A controlled, centered modal: a transparent RN `Modal` (fade animation,
|
|
8
|
-
* own native window) hosting a dimmed full-screen backdrop and a centered,
|
|
9
|
-
* rounded card styled entirely from Bloom theme tokens.
|
|
10
|
-
*
|
|
11
|
-
* The backdrop is a sibling `Pressable` rendered BEHIND the card (absolute
|
|
12
|
-
* filled), never a parent of it — so a tap on the card never bubbles to the
|
|
13
|
-
* backdrop's close handler and the card never ends up nested inside the
|
|
14
|
-
* backdrop's pressable on web.
|
|
15
|
-
*
|
|
16
|
-
* Dismissal: backdrop tap (when `dismissible`), the header close button, and
|
|
17
|
-
* the Android hardware back button (`onRequestClose`) all call `onClose`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function CenteredDialog({ visible, onClose, title, dismissible, maxWidth, compact, showClose, children, footer, accessibilityLabel, closeAccessibilityLabel, backdropAccessibilityLabel, cardStyle, contentStyle, testID, }: CenteredDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
//# sourceMappingURL=CenteredDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredDialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/CenteredDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAWnE,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAkB,EAClB,QAA4B,EAC5B,OAAc,EACd,SAAS,EACT,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,uBAAwC,EACxC,0BAA6C,EAC7C,SAAS,EACT,YAAY,EACZ,MAAM,GACP,EAAE,mBAAmB,2CAsGrB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CenteredDialogProps } from './centered-dialog-types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop. Overridden when a `testID` is set. */
|
|
3
|
-
export declare const CENTERED_DIALOG_BACKDROP_TESTID = "bloom-centered-dialog-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Web variant of `<CenteredDialog>`.
|
|
6
|
-
*
|
|
7
|
-
* A centered modal card rendered into the Bloom Portal at the end of
|
|
8
|
-
* `document.body`. Identical prop surface to native — `visible`, `onClose`,
|
|
9
|
-
* `title`, `compact`, etc. — so call sites are platform agnostic.
|
|
10
|
-
*
|
|
11
|
-
* Differences from the native fork (necessary, not behavioural):
|
|
12
|
-
* - Portal + `RemoveScrollBar` lock the underlying page while open.
|
|
13
|
-
* - `Escape` dismisses (when `dismissible`).
|
|
14
|
-
* - A `role="dialog"` panel with `aria-label`/`aria-modal` for a11y.
|
|
15
|
-
* - A CSS fade/zoom keyframe matches the native modal's `fade` animation;
|
|
16
|
-
* the keyframes are injected once (idempotent) into `<head>`.
|
|
17
|
-
*
|
|
18
|
-
* The backdrop is a sibling element BEHIND the card, and the card stops
|
|
19
|
-
* click/press propagation so a tap on the card never dismisses.
|
|
20
|
-
*/
|
|
21
|
-
export declare function CenteredDialog({ visible, onClose, title, dismissible, maxWidth, compact, showClose, children, footer, accessibilityLabel, closeAccessibilityLabel, backdropAccessibilityLabel, cardStyle, contentStyle, testID, }: CenteredDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
-
/**
|
|
23
|
-
* CSS keyframes powering the web enter/exit animation. Injected once into
|
|
24
|
-
* `<head>` on first mount (keyed by id so re-mounts and multiple dialogs
|
|
25
|
-
* don't duplicate the rule). Mirrors the native modal's `fade` feel with a
|
|
26
|
-
* subtle zoom on the card.
|
|
27
|
-
*/
|
|
28
|
-
export declare const BLOOM_CENTERED_DIALOG_CSS = "\n@keyframes bloomCenteredDialogFadeIn { from { opacity: 0; } to { opacity: 1; } }\n@keyframes bloomCenteredDialogFadeOut { from { opacity: 1; } to { opacity: 0; } }\n@keyframes bloomCenteredDialogZoomIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }\n@keyframes bloomCenteredDialogZoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.96); } }\n";
|
|
29
|
-
//# sourceMappingURL=CenteredDialog.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredDialog.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/CenteredDialog.web.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAanE,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAIhF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAkB,EAClB,QAA4B,EAC5B,OAAc,EACd,SAAS,EACT,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,uBAAwC,EACxC,0BAA6C,EAC7C,SAAS,EACT,YAAY,EACZ,MAAM,GACP,EAAE,mBAAmB,kDAoIrB;AA4FD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,2aAKrC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared layout constants for `<CenteredDialog>`, kept in one module so the
|
|
3
|
-
* native and web forks render identically. All values are Bloom theme tokens
|
|
4
|
-
* (`styles/tokens`) — no ad-hoc magic numbers.
|
|
5
|
-
*
|
|
6
|
-
* COMPACT is the priority: the `compact` spacing set is the default and is
|
|
7
|
-
* deliberately tight (≈`space.md`), so the card reads snug out of the box.
|
|
8
|
-
* The `cozy` set is the opt-out (`compact={false}`) for roomier dialogs.
|
|
9
|
-
*/
|
|
10
|
-
/** Default max card width — comfortable for a compact dialog. */
|
|
11
|
-
export declare const DEFAULT_MAX_WIDTH = 440;
|
|
12
|
-
/** Card height is capped at this fraction of the viewport; body scrolls. */
|
|
13
|
-
export declare const MAX_HEIGHT_FRACTION = 0.8;
|
|
14
|
-
/** Card corner radius (token: `borderRadius.lg` = 16). */
|
|
15
|
-
export declare const CARD_RADIUS: 16;
|
|
16
|
-
/** Outer gutter between the card edge and the viewport edge (token `space.lg`). */
|
|
17
|
-
export declare const VIEWPORT_GUTTER: 16;
|
|
18
|
-
export type DialogSpacing = {
|
|
19
|
-
/** Card inner padding (horizontal + vertical). */
|
|
20
|
-
pad: number;
|
|
21
|
-
/** Gap between the header title row and the body. */
|
|
22
|
-
headerGap: number;
|
|
23
|
-
/** Gap between the body and the footer. */
|
|
24
|
-
footerGap: number;
|
|
25
|
-
/** Vertical gap between stacked body items (the content container `gap`). */
|
|
26
|
-
contentGap: number;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Compact (default) — tight, snug spacing built on `space.md` (12).
|
|
30
|
-
*
|
|
31
|
-
* pad = space.md (12)
|
|
32
|
-
* headerGap = space.sm (8)
|
|
33
|
-
* footerGap = space.md (12)
|
|
34
|
-
* contentGap = space.sm (8)
|
|
35
|
-
*/
|
|
36
|
-
export declare const COMPACT_SPACING: DialogSpacing;
|
|
37
|
-
/**
|
|
38
|
-
* Cozy (`compact={false}`) — roomier spacing built on `space.xl` (20).
|
|
39
|
-
*
|
|
40
|
-
* pad = space.xl (20)
|
|
41
|
-
* headerGap = space.md (12)
|
|
42
|
-
* footerGap = space.lg (16)
|
|
43
|
-
* contentGap = space.md (12)
|
|
44
|
-
*/
|
|
45
|
-
export declare const COZY_SPACING: DialogSpacing;
|
|
46
|
-
export declare function resolveSpacing(compact: boolean): DialogSpacing;
|
|
47
|
-
//# sourceMappingURL=centered-dialog-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"centered-dialog-tokens.d.ts","sourceRoot":"","sources":["../../../../src/dialog/centered-dialog-tokens.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,0DAA0D;AAC1D,eAAO,MAAM,WAAW,IAAkB,CAAC;AAE3C,mFAAmF;AACnF,eAAO,MAAM,eAAe,IAAW,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,aAK1B,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAE9D"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
/**
|
|
4
|
-
* Props for the declarative `<CenteredDialog>` primitive.
|
|
5
|
-
*
|
|
6
|
-
* This is the simple, controlled centered-modal surface — distinct from the
|
|
7
|
-
* imperative `useDialogControl()` + `<Dialog control={…}>` API in the same
|
|
8
|
-
* module. Reach for `<CenteredDialog>` when you already own the open/closed
|
|
9
|
-
* boolean (a `useState`, a query flag, a route param) and just want Bloom to
|
|
10
|
-
* render the dimmed backdrop + a snug, theme-styled centered card.
|
|
11
|
-
*
|
|
12
|
-
* All spacing/colour/radius come from Bloom theme tokens — the card reads
|
|
13
|
-
* compact out of the box (`compact` defaults to `true`).
|
|
14
|
-
*/
|
|
15
|
-
export type CenteredDialogProps = {
|
|
16
|
-
/** Whether the dialog is mounted + visible. */
|
|
17
|
-
visible: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Close request — fired on backdrop tap (when `dismissible`), the close
|
|
20
|
-
* button, the hardware back button (Android), and `Escape` (web). The
|
|
21
|
-
* caller owns the visible state, so it must flip `visible` to `false` here.
|
|
22
|
-
*/
|
|
23
|
-
onClose: () => void;
|
|
24
|
-
/**
|
|
25
|
-
* Optional header title. When set (or when `showClose` is `true`) Bloom
|
|
26
|
-
* renders a tight header row above the content.
|
|
27
|
-
*/
|
|
28
|
-
title?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Tap-outside / back-button / Escape dismisses the dialog. Defaults to
|
|
31
|
-
* `true`. Set `false` for blocking flows (e.g. a destructive confirm that
|
|
32
|
-
* must be answered via an explicit action).
|
|
33
|
-
*/
|
|
34
|
-
dismissible?: boolean;
|
|
35
|
-
/** Max card width in px. Defaults to {@link DEFAULT_MAX_WIDTH} (440). */
|
|
36
|
-
maxWidth?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Tight, snug spacing (the Bloom default). Set `false` for a roomier card
|
|
39
|
-
* with larger padding and header/footer gaps. Defaults to `true`.
|
|
40
|
-
*/
|
|
41
|
-
compact?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Render a close (✕) icon button in the header. Defaults to `true` when a
|
|
44
|
-
* `title` is provided, otherwise `false` (a chromeless card owns its own
|
|
45
|
-
* dismissal affordances).
|
|
46
|
-
*/
|
|
47
|
-
showClose?: boolean;
|
|
48
|
-
/** Card body. Scrolls within the height cap when it overflows. */
|
|
49
|
-
children?: ReactNode;
|
|
50
|
-
/**
|
|
51
|
-
* Optional footer slot for actions (e.g. a Bloom `<Button>` row). Rendered
|
|
52
|
-
* below the scrollable body with a hairline separator.
|
|
53
|
-
*/
|
|
54
|
-
footer?: ReactNode;
|
|
55
|
-
/**
|
|
56
|
-
* Accessibility label for the dialog surface. Falls back to `title` when
|
|
57
|
-
* omitted.
|
|
58
|
-
*/
|
|
59
|
-
accessibilityLabel?: string;
|
|
60
|
-
/** Accessibility label for the header close (✕) button. */
|
|
61
|
-
closeAccessibilityLabel?: string;
|
|
62
|
-
/** Accessibility label for the dimmed backdrop's tap-to-dismiss affordance. */
|
|
63
|
-
backdropAccessibilityLabel?: string;
|
|
64
|
-
/** Style overrides merged onto the centered card container. */
|
|
65
|
-
cardStyle?: StyleProp<ViewStyle>;
|
|
66
|
-
/** Style overrides merged onto the scrollable content container. */
|
|
67
|
-
contentStyle?: StyleProp<ViewStyle>;
|
|
68
|
-
testID?: string;
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=centered-dialog-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"centered-dialog-types.d.ts","sourceRoot":"","sources":["../../../../src/dialog/centered-dialog-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,+EAA+E;IAC/E,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,oEAAoE;IACpE,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ResponsiveSheetProps } from './types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop dismiss button. */
|
|
3
|
-
export declare const RESPONSIVE_SHEET_BACKDROP_TESTID = "bloom-responsive-sheet-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Default / web variant of `<ResponsiveSheet>`.
|
|
6
|
-
*
|
|
7
|
-
* This file is BOTH the package's default entry (`react-native` export
|
|
8
|
-
* condition resolves it for downstream `tsc`, and non-Metro web bundlers pick
|
|
9
|
-
* it via the `browser` condition through `index.web`) AND the canonical web
|
|
10
|
-
* implementation. It MUST NOT import `react-native-reanimated` — reanimated has
|
|
11
|
-
* no web build and its worklets Babel plugin is native-only, so a static import
|
|
12
|
-
* here would break every web bundler and downstream type-check. The native
|
|
13
|
-
* fork (`ResponsiveSheet.native.tsx`, selected only by Metro) drives the same
|
|
14
|
-
* motion with reanimated.
|
|
15
|
-
*
|
|
16
|
-
* Motion is pure CSS transitions: react-native-web emits `transition-*` style
|
|
17
|
-
* props to the DOM, and the panel/backdrop toggle their transform/opacity by a
|
|
18
|
-
* `shown` flag. Presence is handled with a `mounted` + `shown` pair so both the
|
|
19
|
-
* open AND close directions animate while the node stays mounted through the
|
|
20
|
-
* exit. We deliberately do NOT use reanimated `exiting` on web — concurrent
|
|
21
|
-
* React unmounts there throw `Failed to execute 'removeChild' on 'Node'`, the
|
|
22
|
-
* exact bug this component exists to avoid.
|
|
23
|
-
*/
|
|
24
|
-
export declare function ResponsiveSheet({ open, onClose, side, breakpoint, width, maxHeightRatio, inset, showHandle, dismissOnBackdrop, panelStyle, panelClassName, containerStyle, containerClassName, label, children, }: ResponsiveSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
-
export default ResponsiveSheet;
|
|
26
|
-
//# sourceMappingURL=ResponsiveSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveSheet.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/ResponsiveSheet.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,4DAA4D;AAC5D,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAElF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAmB,EACnB,UAA+B,EAC/B,KAAqB,EACrB,cAAyC,EACzC,KAAK,EACL,UAAiB,EACjB,iBAAwB,EACxB,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,KAAqB,EACrB,QAAQ,GACT,EAAE,oBAAoB,kDA+KtB;AA8ED,eAAe,eAAe,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ResponsiveSheetProps } from './types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop dismiss button. */
|
|
3
|
-
export declare const RESPONSIVE_SHEET_BACKDROP_TESTID = "bloom-responsive-sheet-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Native variant of `<ResponsiveSheet>` (selected only by Metro).
|
|
6
|
-
*
|
|
7
|
-
* Uses `react-native-reanimated` to drive the same motion as the web/CSS
|
|
8
|
-
* default fork: a shared `progress` value times 0 -> 1 on open and 1 -> 0 on
|
|
9
|
-
* close, mapped to the panel translate/opacity and the backdrop opacity.
|
|
10
|
-
* Native exit animations are safe here — the web-only `removeChild` crash does
|
|
11
|
-
* not apply — so we keep the node mounted through the close timing and unmount
|
|
12
|
-
* from the animation completion callback.
|
|
13
|
-
*
|
|
14
|
-
* The panel itself is measured (not percentage-translated): we offset by the
|
|
15
|
-
* panel's own width/height so the hidden state sits fully off its side, which
|
|
16
|
-
* is the reanimated-friendly equivalent of the web `translate(±100%)`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function ResponsiveSheet({ open, onClose, side, breakpoint, width, maxHeightRatio, inset, showHandle, dismissOnBackdrop, panelStyle, panelClassName, containerStyle, containerClassName, label, children, }: ResponsiveSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
-
export default ResponsiveSheet;
|
|
20
|
-
//# sourceMappingURL=ResponsiveSheet.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveSheet.native.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/ResponsiveSheet.native.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,4DAA4D;AAC5D,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAElF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAmB,EACnB,UAA+B,EAC/B,KAAqB,EACrB,cAAyC,EACzC,KAAK,EACL,UAAiB,EACjB,iBAAwB,EACxB,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,KAAqB,EACrB,QAAQ,GACT,EAAE,oBAAoB,kDAqJtB;AAiCD,eAAe,eAAe,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared default constants for `ResponsiveSheet`.
|
|
3
|
-
*
|
|
4
|
-
* Platform-agnostic — imported by both the default/web CSS implementation
|
|
5
|
-
* (`ResponsiveSheet.tsx`) and the native reanimated implementation
|
|
6
|
-
* (`ResponsiveSheet.native.tsx`) so the two variants stay in lockstep.
|
|
7
|
-
*/
|
|
8
|
-
/** Below this viewport width the sheet renders as a bottom-sheet. */
|
|
9
|
-
export declare const DEFAULT_BREAKPOINT = 768;
|
|
10
|
-
/** Side-sheet width (px) on wide screens. Capped to fit the viewport. */
|
|
11
|
-
export declare const DEFAULT_WIDTH = 460;
|
|
12
|
-
/** Bottom-sheet maximum height as a fraction of the viewport height. */
|
|
13
|
-
export declare const DEFAULT_MAX_HEIGHT_RATIO = 0.9;
|
|
14
|
-
/** Anchored edge of the side-sheet on wide screens. */
|
|
15
|
-
export declare const DEFAULT_SIDE: "left";
|
|
16
|
-
/**
|
|
17
|
-
* Open/close transition duration (ms). ~280–300ms ease-out reads as smooth
|
|
18
|
-
* without feeling sluggish; shared by the CSS transition and the native
|
|
19
|
-
* reanimated timing so both platforms match.
|
|
20
|
-
*/
|
|
21
|
-
export declare const ANIMATION_DURATION = 280;
|
|
22
|
-
/**
|
|
23
|
-
* Standard CSS approximation of reanimated's `Easing.out(Easing.cubic)` so the
|
|
24
|
-
* web transition curve matches the native one.
|
|
25
|
-
*/
|
|
26
|
-
export declare const EASE_OUT = "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
27
|
-
/** Corner radius for the side-sheet panel and the top of the bottom-sheet. */
|
|
28
|
-
export declare const PANEL_RADIUS = 20;
|
|
29
|
-
/** Backdrop dim opacity once fully shown (matches `bg-black/40`). */
|
|
30
|
-
export declare const BACKDROP_OPACITY = 0.4;
|
|
31
|
-
/** Drag-handle pill geometry for the bottom-sheet. */
|
|
32
|
-
export declare const HANDLE_WIDTH = 36;
|
|
33
|
-
export declare const HANDLE_HEIGHT = 5;
|
|
34
|
-
export declare const HANDLE_RADIUS = 3;
|
|
35
|
-
/**
|
|
36
|
-
* Minimum gutter kept between a wide side-sheet and the opposite viewport edge
|
|
37
|
-
* when capping its width, so the panel never spans the full screen on a narrow
|
|
38
|
-
* desktop window that is still above the breakpoint.
|
|
39
|
-
*/
|
|
40
|
-
export declare const SIDE_SHEET_MIN_GUTTER = 24;
|
|
41
|
-
/** A11y label fallback when the host does not provide one. */
|
|
42
|
-
export declare const DEFAULT_LABEL = "Sheet";
|
|
43
|
-
//# sourceMappingURL=const.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/const.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,yEAAyE;AACzE,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AAEzD,8EAA8E;AAC9E,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,sDAAsD;AACtD,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,8DAA8D;AAC9D,eAAO,MAAM,aAAa,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AACtF,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/index.web.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AACtF,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
/** Edge a wide-screen side-sheet anchors to. */
|
|
4
|
-
export type ResponsiveSheetSide = 'left' | 'right';
|
|
5
|
-
/**
|
|
6
|
-
* Inset (px) of the wide-screen side-sheet from its container edges. Lets a
|
|
7
|
-
* host place the sheet "inside its own shell" — e.g. offset from the top by a
|
|
8
|
-
* header, or from the left by a nav rail — with margins on every side.
|
|
9
|
-
*/
|
|
10
|
-
export interface ResponsiveSheetInset {
|
|
11
|
-
top?: number;
|
|
12
|
-
bottom?: number;
|
|
13
|
-
left?: number;
|
|
14
|
-
right?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A responsive overlay sheet: an anchored side-sheet on wide screens and a
|
|
18
|
-
* bottom-sheet (with drag handle) on small screens, switching by viewport
|
|
19
|
-
* width. It is a plain controlled component — the host drives `open`/`onClose`
|
|
20
|
-
* from its own state. It renders in place (no portal) so the host can scope it
|
|
21
|
-
* inside a themed/positioned subtree.
|
|
22
|
-
*/
|
|
23
|
-
export interface ResponsiveSheetProps {
|
|
24
|
-
/** Whether the sheet is open. Controlled by the host. */
|
|
25
|
-
open: boolean;
|
|
26
|
-
/** Fired when the sheet requests to close (backdrop tap, Escape on web). */
|
|
27
|
-
onClose: () => void;
|
|
28
|
-
/** Anchor edge on wide screens. Defaults to `'left'`. */
|
|
29
|
-
side?: ResponsiveSheetSide;
|
|
30
|
-
/** Viewport width (px) below which the sheet renders as a bottom-sheet. Defaults to `768`. */
|
|
31
|
-
breakpoint?: number;
|
|
32
|
-
/** Side-sheet width (px) on wide screens. Capped to fit. Defaults to `460`. */
|
|
33
|
-
width?: number;
|
|
34
|
-
/** Bottom-sheet max height as a fraction of the viewport height. Defaults to `0.9`. */
|
|
35
|
-
maxHeightRatio?: number;
|
|
36
|
-
/** Side-sheet inset (px) from the container edges. Defaults to `0` on all sides. */
|
|
37
|
-
inset?: ResponsiveSheetInset;
|
|
38
|
-
/** Whether to render the drag handle in bottom-sheet mode. Defaults to `true`. */
|
|
39
|
-
showHandle?: boolean;
|
|
40
|
-
/** Whether tapping the backdrop closes the sheet. Defaults to `true`. */
|
|
41
|
-
dismissOnBackdrop?: boolean;
|
|
42
|
-
/** Style for the panel surface (e.g. brand color). Composed after defaults. */
|
|
43
|
-
panelStyle?: StyleProp<ViewStyle>;
|
|
44
|
-
/** NativeWind classes for the panel surface. */
|
|
45
|
-
panelClassName?: string;
|
|
46
|
-
/** Style for the root overlay (theme-var scope, rail offset, etc.). */
|
|
47
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
48
|
-
/** NativeWind classes for the root overlay (e.g. `"md:left-[4.75rem]"`). */
|
|
49
|
-
containerClassName?: string;
|
|
50
|
-
/** Accessibility label for the sheet panel and the backdrop dismiss button. */
|
|
51
|
-
label?: string;
|
|
52
|
-
/** Sheet content. */
|
|
53
|
-
children: ReactNode;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/responsive-sheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,IAAI,EAAE,OAAO,CAAC;IACd,4EAA4E;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CenteredDialogProps } from './centered-dialog-types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop. Overridden when a `testID` is set. */
|
|
3
|
-
export declare const CENTERED_DIALOG_BACKDROP_TESTID = "bloom-centered-dialog-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Native variant of `<CenteredDialog>`.
|
|
6
|
-
*
|
|
7
|
-
* A controlled, centered modal: a transparent RN `Modal` (fade animation,
|
|
8
|
-
* own native window) hosting a dimmed full-screen backdrop and a centered,
|
|
9
|
-
* rounded card styled entirely from Bloom theme tokens.
|
|
10
|
-
*
|
|
11
|
-
* The backdrop is a sibling `Pressable` rendered BEHIND the card (absolute
|
|
12
|
-
* filled), never a parent of it — so a tap on the card never bubbles to the
|
|
13
|
-
* backdrop's close handler and the card never ends up nested inside the
|
|
14
|
-
* backdrop's pressable on web.
|
|
15
|
-
*
|
|
16
|
-
* Dismissal: backdrop tap (when `dismissible`), the header close button, and
|
|
17
|
-
* the Android hardware back button (`onRequestClose`) all call `onClose`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function CenteredDialog({ visible, onClose, title, dismissible, maxWidth, compact, showClose, children, footer, accessibilityLabel, closeAccessibilityLabel, backdropAccessibilityLabel, cardStyle, contentStyle, testID, }: CenteredDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
//# sourceMappingURL=CenteredDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredDialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/CenteredDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAWnE,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAkB,EAClB,QAA4B,EAC5B,OAAc,EACd,SAAS,EACT,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,uBAAwC,EACxC,0BAA6C,EAC7C,SAAS,EACT,YAAY,EACZ,MAAM,GACP,EAAE,mBAAmB,2CAsGrB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CenteredDialogProps } from './centered-dialog-types';
|
|
2
|
-
/** Stable testID for the dimmed backdrop. Overridden when a `testID` is set. */
|
|
3
|
-
export declare const CENTERED_DIALOG_BACKDROP_TESTID = "bloom-centered-dialog-backdrop";
|
|
4
|
-
/**
|
|
5
|
-
* Web variant of `<CenteredDialog>`.
|
|
6
|
-
*
|
|
7
|
-
* A centered modal card rendered into the Bloom Portal at the end of
|
|
8
|
-
* `document.body`. Identical prop surface to native — `visible`, `onClose`,
|
|
9
|
-
* `title`, `compact`, etc. — so call sites are platform agnostic.
|
|
10
|
-
*
|
|
11
|
-
* Differences from the native fork (necessary, not behavioural):
|
|
12
|
-
* - Portal + `RemoveScrollBar` lock the underlying page while open.
|
|
13
|
-
* - `Escape` dismisses (when `dismissible`).
|
|
14
|
-
* - A `role="dialog"` panel with `aria-label`/`aria-modal` for a11y.
|
|
15
|
-
* - A CSS fade/zoom keyframe matches the native modal's `fade` animation;
|
|
16
|
-
* the keyframes are injected once (idempotent) into `<head>`.
|
|
17
|
-
*
|
|
18
|
-
* The backdrop is a sibling element BEHIND the card, and the card stops
|
|
19
|
-
* click/press propagation so a tap on the card never dismisses.
|
|
20
|
-
*/
|
|
21
|
-
export declare function CenteredDialog({ visible, onClose, title, dismissible, maxWidth, compact, showClose, children, footer, accessibilityLabel, closeAccessibilityLabel, backdropAccessibilityLabel, cardStyle, contentStyle, testID, }: CenteredDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
-
/**
|
|
23
|
-
* CSS keyframes powering the web enter/exit animation. Injected once into
|
|
24
|
-
* `<head>` on first mount (keyed by id so re-mounts and multiple dialogs
|
|
25
|
-
* don't duplicate the rule). Mirrors the native modal's `fade` feel with a
|
|
26
|
-
* subtle zoom on the card.
|
|
27
|
-
*/
|
|
28
|
-
export declare const BLOOM_CENTERED_DIALOG_CSS = "\n@keyframes bloomCenteredDialogFadeIn { from { opacity: 0; } to { opacity: 1; } }\n@keyframes bloomCenteredDialogFadeOut { from { opacity: 1; } to { opacity: 0; } }\n@keyframes bloomCenteredDialogZoomIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }\n@keyframes bloomCenteredDialogZoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.96); } }\n";
|
|
29
|
-
//# sourceMappingURL=CenteredDialog.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredDialog.web.d.ts","sourceRoot":"","sources":["../../../../src/dialog/CenteredDialog.web.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAanE,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAIhF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAkB,EAClB,QAA4B,EAC5B,OAAc,EACd,SAAS,EACT,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,uBAAwC,EACxC,0BAA6C,EAC7C,SAAS,EACT,YAAY,EACZ,MAAM,GACP,EAAE,mBAAmB,kDAoIrB;AA4FD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,2aAKrC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared layout constants for `<CenteredDialog>`, kept in one module so the
|
|
3
|
-
* native and web forks render identically. All values are Bloom theme tokens
|
|
4
|
-
* (`styles/tokens`) — no ad-hoc magic numbers.
|
|
5
|
-
*
|
|
6
|
-
* COMPACT is the priority: the `compact` spacing set is the default and is
|
|
7
|
-
* deliberately tight (≈`space.md`), so the card reads snug out of the box.
|
|
8
|
-
* The `cozy` set is the opt-out (`compact={false}`) for roomier dialogs.
|
|
9
|
-
*/
|
|
10
|
-
/** Default max card width — comfortable for a compact dialog. */
|
|
11
|
-
export declare const DEFAULT_MAX_WIDTH = 440;
|
|
12
|
-
/** Card height is capped at this fraction of the viewport; body scrolls. */
|
|
13
|
-
export declare const MAX_HEIGHT_FRACTION = 0.8;
|
|
14
|
-
/** Card corner radius (token: `borderRadius.lg` = 16). */
|
|
15
|
-
export declare const CARD_RADIUS: 16;
|
|
16
|
-
/** Outer gutter between the card edge and the viewport edge (token `space.lg`). */
|
|
17
|
-
export declare const VIEWPORT_GUTTER: 16;
|
|
18
|
-
export type DialogSpacing = {
|
|
19
|
-
/** Card inner padding (horizontal + vertical). */
|
|
20
|
-
pad: number;
|
|
21
|
-
/** Gap between the header title row and the body. */
|
|
22
|
-
headerGap: number;
|
|
23
|
-
/** Gap between the body and the footer. */
|
|
24
|
-
footerGap: number;
|
|
25
|
-
/** Vertical gap between stacked body items (the content container `gap`). */
|
|
26
|
-
contentGap: number;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Compact (default) — tight, snug spacing built on `space.md` (12).
|
|
30
|
-
*
|
|
31
|
-
* pad = space.md (12)
|
|
32
|
-
* headerGap = space.sm (8)
|
|
33
|
-
* footerGap = space.md (12)
|
|
34
|
-
* contentGap = space.sm (8)
|
|
35
|
-
*/
|
|
36
|
-
export declare const COMPACT_SPACING: DialogSpacing;
|
|
37
|
-
/**
|
|
38
|
-
* Cozy (`compact={false}`) — roomier spacing built on `space.xl` (20).
|
|
39
|
-
*
|
|
40
|
-
* pad = space.xl (20)
|
|
41
|
-
* headerGap = space.md (12)
|
|
42
|
-
* footerGap = space.lg (16)
|
|
43
|
-
* contentGap = space.md (12)
|
|
44
|
-
*/
|
|
45
|
-
export declare const COZY_SPACING: DialogSpacing;
|
|
46
|
-
export declare function resolveSpacing(compact: boolean): DialogSpacing;
|
|
47
|
-
//# sourceMappingURL=centered-dialog-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"centered-dialog-tokens.d.ts","sourceRoot":"","sources":["../../../../src/dialog/centered-dialog-tokens.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,0DAA0D;AAC1D,eAAO,MAAM,WAAW,IAAkB,CAAC;AAE3C,mFAAmF;AACnF,eAAO,MAAM,eAAe,IAAW,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,aAK1B,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAE9D"}
|