@oxyhq/bloom 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +39 -152
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +61 -196
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +205 -0
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -0
- package/lib/commonjs/dialog/DialogContent.js +155 -0
- package/lib/commonjs/dialog/DialogContent.js.map +1 -0
- package/lib/commonjs/dialog/index.js +0 -13
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +0 -19
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/index.js +0 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +6 -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 +42 -155
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +63 -198
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +200 -0
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -0
- package/lib/module/dialog/DialogContent.js +148 -0
- package/lib/module/dialog/DialogContent.js.map +1 -0
- package/lib/module/dialog/index.js +0 -1
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +0 -1
- package/lib/module/dialog/index.web.js.map +1 -1
- 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 +2 -3
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +11 -8
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +29 -0
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/DialogContent.d.ts +32 -0
- package/lib/typescript/commonjs/dialog/DialogContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/index.d.ts +0 -2
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +0 -2
- package/lib/typescript/commonjs/dialog/index.web.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 +2 -3
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts +11 -8
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +29 -0
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -0
- package/lib/typescript/module/dialog/DialogContent.d.ts +32 -0
- package/lib/typescript/module/dialog/DialogContent.d.ts.map +1 -0
- package/lib/typescript/module/dialog/index.d.ts +0 -2
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +0 -2
- package/lib/typescript/module/dialog/index.web.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__/BottomSheetGesture.test.tsx +135 -0
- package/src/__tests__/Command.test.tsx +107 -0
- package/src/__tests__/DialogBottomSheet.test.tsx +130 -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 +35 -168
- package/src/dialog/Dialog.web.tsx +52 -209
- package/src/dialog/DialogBottomSheet.tsx +235 -0
- package/src/dialog/DialogContent.tsx +157 -0
- package/src/dialog/index.ts +0 -2
- package/src/dialog/index.web.ts +0 -6
- package/src/index.ts +0 -11
- package/src/index.web.ts +0 -11
- package/lib/commonjs/dialog/CenteredDialog.js +0 -252
- package/lib/commonjs/dialog/CenteredDialog.js.map +0 -1
- package/lib/commonjs/dialog/CenteredDialog.web.js +0 -330
- 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 -97
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.js.map +0 -1
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.web.js +0 -84
- package/lib/commonjs/responsive-sheet/ResponsiveSheet.web.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 -246
- package/lib/module/dialog/CenteredDialog.js.map +0 -1
- package/lib/module/dialog/CenteredDialog.web.js +0 -324
- 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 -90
- package/lib/module/responsive-sheet/ResponsiveSheet.js.map +0 -1
- package/lib/module/responsive-sheet/ResponsiveSheet.web.js +0 -77
- package/lib/module/responsive-sheet/ResponsiveSheet.web.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 -12
- 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 -22
- package/lib/typescript/commonjs/dialog/CenteredDialog.d.ts.map +0 -1
- package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts +0 -31
- 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 -74
- package/lib/typescript/commonjs/dialog/centered-dialog-types.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts +0 -22
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.web.d.ts +0 -16
- package/lib/typescript/commonjs/responsive-sheet/ResponsiveSheet.web.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 -58
- package/lib/typescript/commonjs/responsive-sheet/types.d.ts.map +0 -1
- package/lib/typescript/module/dialog/CenteredDialog.d.ts +0 -22
- package/lib/typescript/module/dialog/CenteredDialog.d.ts.map +0 -1
- package/lib/typescript/module/dialog/CenteredDialog.web.d.ts +0 -31
- 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 -74
- package/lib/typescript/module/dialog/centered-dialog-types.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts +0 -22
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.d.ts.map +0 -1
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.web.d.ts +0 -16
- package/lib/typescript/module/responsive-sheet/ResponsiveSheet.web.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 -58
- 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 -88
- package/src/dialog/CenteredDialog.stories.tsx +0 -125
- package/src/dialog/CenteredDialog.tsx +0 -305
- package/src/dialog/CenteredDialog.web.tsx +0 -374
- package/src/dialog/centered-dialog-tokens.ts +0 -68
- package/src/dialog/centered-dialog-types.ts +0 -74
- package/src/responsive-sheet/ResponsiveSheet.stories.tsx +0 -54
- package/src/responsive-sheet/ResponsiveSheet.tsx +0 -88
- package/src/responsive-sheet/ResponsiveSheet.web.tsx +0 -76
- package/src/responsive-sheet/index.ts +0 -6
- package/src/responsive-sheet/index.web.ts +0 -14
- package/src/responsive-sheet/types.ts +0 -60
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CENTERED_DIALOG_BACKDROP_TESTID = exports.BLOOM_CENTERED_DIALOG_CSS = void 0;
|
|
7
|
-
exports.CenteredDialog = CenteredDialog;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _reactRemoveScrollBar = require("react-remove-scroll-bar");
|
|
11
|
-
var _useInteractionState = require("../hooks/useInteractionState.js");
|
|
12
|
-
var _Times = require("../icons/Times.js");
|
|
13
|
-
var _indexWeb = require("../portal/index.web.js");
|
|
14
|
-
var _zIndex = require("../styles/z-index.js");
|
|
15
|
-
var _useTheme = require("../theme/use-theme.js");
|
|
16
|
-
var _index = require("../typography/index.js");
|
|
17
|
-
var _centeredDialogTokens = require("./centered-dialog-tokens.js");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
-
const FADE_OUT_DURATION = 150;
|
|
21
|
-
const CLOSE_HIT_SLOP = {
|
|
22
|
-
top: 8,
|
|
23
|
-
bottom: 8,
|
|
24
|
-
left: 8,
|
|
25
|
-
right: 8
|
|
26
|
-
};
|
|
27
|
-
const dialogZIndex = (0, _zIndex.createOverlayZIndex)();
|
|
28
|
-
|
|
29
|
-
/** Stable testID for the dimmed backdrop. Overridden when a `testID` is set. */
|
|
30
|
-
const CENTERED_DIALOG_BACKDROP_TESTID = exports.CENTERED_DIALOG_BACKDROP_TESTID = 'bloom-centered-dialog-backdrop';
|
|
31
|
-
const stopPropagation = e => e.stopPropagation();
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Use `<Dialog placement="center">` instead.
|
|
35
|
-
*
|
|
36
|
-
* Web variant of `<CenteredDialog>`.
|
|
37
|
-
*
|
|
38
|
-
* A centered modal card rendered into the Bloom Portal at the end of
|
|
39
|
-
* `document.body`. Identical prop surface to native — `visible`, `onClose`,
|
|
40
|
-
* `title`, `compact`, etc. — so call sites are platform agnostic.
|
|
41
|
-
*
|
|
42
|
-
* Differences from the native fork (necessary, not behavioural):
|
|
43
|
-
* - Portal + `RemoveScrollBar` lock the underlying page while open.
|
|
44
|
-
* - `Escape` dismisses (when `dismissible`).
|
|
45
|
-
* - A `role="dialog"` panel with `aria-label`/`aria-modal` for a11y.
|
|
46
|
-
* - A CSS fade/zoom keyframe matches the native modal's `fade` animation;
|
|
47
|
-
* the keyframes are injected once (idempotent) into `<head>`.
|
|
48
|
-
*
|
|
49
|
-
* The backdrop is a sibling element BEHIND the card, and the card stops
|
|
50
|
-
* click/press propagation so a tap on the card never dismisses.
|
|
51
|
-
*/
|
|
52
|
-
function CenteredDialog({
|
|
53
|
-
visible,
|
|
54
|
-
onClose,
|
|
55
|
-
title,
|
|
56
|
-
dismissible = true,
|
|
57
|
-
maxWidth = _centeredDialogTokens.DEFAULT_MAX_WIDTH,
|
|
58
|
-
compact = true,
|
|
59
|
-
showClose,
|
|
60
|
-
children,
|
|
61
|
-
footer,
|
|
62
|
-
accessibilityLabel,
|
|
63
|
-
closeAccessibilityLabel = 'Close dialog',
|
|
64
|
-
backdropAccessibilityLabel = 'Dismiss dialog',
|
|
65
|
-
cardStyle,
|
|
66
|
-
contentStyle,
|
|
67
|
-
testID
|
|
68
|
-
}) {
|
|
69
|
-
const theme = (0, _useTheme.useTheme)();
|
|
70
|
-
// `rendered` keeps the dialog mounted through its fade-out so a controlled
|
|
71
|
-
// `visible` flip to `false` still plays an exit animation (matching the
|
|
72
|
-
// native `Modal animationType="fade"`, which animates both directions).
|
|
73
|
-
const [rendered, setRendered] = (0, _react.useState)(visible);
|
|
74
|
-
const isClosing = rendered && !visible;
|
|
75
|
-
useKeyframes();
|
|
76
|
-
|
|
77
|
-
// Mount immediately when opened; defer unmount until the exit animation
|
|
78
|
-
// has played when closed.
|
|
79
|
-
(0, _react.useEffect)(() => {
|
|
80
|
-
if (visible) {
|
|
81
|
-
setRendered(true);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (!rendered) return;
|
|
85
|
-
const timer = setTimeout(() => setRendered(false), FADE_OUT_DURATION);
|
|
86
|
-
return () => clearTimeout(timer);
|
|
87
|
-
}, [visible, rendered]);
|
|
88
|
-
|
|
89
|
-
// Escape-to-close while open. Scoped to the open lifetime so stacked
|
|
90
|
-
// dialogs don't fight for the keydown — the top-most one wins via
|
|
91
|
-
// document-level event order.
|
|
92
|
-
(0, _react.useEffect)(() => {
|
|
93
|
-
if (!visible || !dismissible || typeof document === 'undefined') return;
|
|
94
|
-
const handler = e => {
|
|
95
|
-
if (e.key === 'Escape') {
|
|
96
|
-
e.stopPropagation();
|
|
97
|
-
onClose();
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
document.addEventListener('keydown', handler);
|
|
101
|
-
return () => document.removeEventListener('keydown', handler);
|
|
102
|
-
}, [visible, dismissible, onClose]);
|
|
103
|
-
const spacing = (0, _react.useMemo)(() => (0, _centeredDialogTokens.resolveSpacing)(compact), [compact]);
|
|
104
|
-
const resolvedShowClose = showClose ?? Boolean(title);
|
|
105
|
-
const hasHeader = Boolean(title) || resolvedShowClose;
|
|
106
|
-
if (!rendered) return null;
|
|
107
|
-
|
|
108
|
-
// While closing, the backdrop must not re-trigger onClose (it's mid-exit).
|
|
109
|
-
const handleBackdropPress = dismissible && !isClosing ? onClose : undefined;
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_indexWeb.Portal, {
|
|
111
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRemoveScrollBar.RemoveScrollBar, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
112
|
-
style: [styles.root, {
|
|
113
|
-
padding: _centeredDialogTokens.VIEWPORT_GUTTER
|
|
114
|
-
}],
|
|
115
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
116
|
-
testID: testID ? `${testID}-backdrop` : CENTERED_DIALOG_BACKDROP_TESTID,
|
|
117
|
-
onPress: handleBackdropPress,
|
|
118
|
-
disabled: !dismissible,
|
|
119
|
-
accessibilityRole: "button",
|
|
120
|
-
accessibilityLabel: backdropAccessibilityLabel,
|
|
121
|
-
style: [styles.backdrop, {
|
|
122
|
-
backgroundColor: theme.colors.overlay
|
|
123
|
-
}, backdropAnimation(isClosing)]
|
|
124
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
125
|
-
testID: testID,
|
|
126
|
-
role: "dialog",
|
|
127
|
-
"aria-modal": true,
|
|
128
|
-
"aria-label": accessibilityLabel ?? title,
|
|
129
|
-
onStartShouldSetResponder: returnsTrue,
|
|
130
|
-
onResponderRelease: stopPropagation,
|
|
131
|
-
onClick: stopPropagation,
|
|
132
|
-
style: [styles.card, {
|
|
133
|
-
maxWidth,
|
|
134
|
-
maxHeight: `${_centeredDialogTokens.MAX_HEIGHT_FRACTION * 100}%`,
|
|
135
|
-
backgroundColor: theme.colors.card,
|
|
136
|
-
borderColor: theme.colors.border,
|
|
137
|
-
shadowColor: theme.colors.shadow
|
|
138
|
-
}, cardAnimation(isClosing), cardStyle],
|
|
139
|
-
children: [hasHeader ? /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogHeader, {
|
|
140
|
-
title: title,
|
|
141
|
-
showClose: resolvedShowClose,
|
|
142
|
-
padding: spacing.pad,
|
|
143
|
-
gap: spacing.headerGap,
|
|
144
|
-
closeAccessibilityLabel: closeAccessibilityLabel,
|
|
145
|
-
onClose: onClose
|
|
146
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
147
|
-
style: styles.bodyScroll,
|
|
148
|
-
contentContainerStyle: [{
|
|
149
|
-
padding: spacing.pad,
|
|
150
|
-
paddingTop: hasHeader ? spacing.headerGap : spacing.pad,
|
|
151
|
-
gap: spacing.contentGap
|
|
152
|
-
}, contentStyle],
|
|
153
|
-
showsVerticalScrollIndicator: false,
|
|
154
|
-
keyboardShouldPersistTaps: "handled",
|
|
155
|
-
children: children
|
|
156
|
-
}), footer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
157
|
-
style: [styles.footer, {
|
|
158
|
-
padding: spacing.pad,
|
|
159
|
-
paddingTop: spacing.footerGap,
|
|
160
|
-
borderTopColor: theme.colors.borderLight
|
|
161
|
-
}],
|
|
162
|
-
children: footer
|
|
163
|
-
}) : null]
|
|
164
|
-
})]
|
|
165
|
-
})]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
function DialogHeader({
|
|
169
|
-
title,
|
|
170
|
-
showClose,
|
|
171
|
-
padding,
|
|
172
|
-
gap,
|
|
173
|
-
closeAccessibilityLabel,
|
|
174
|
-
onClose
|
|
175
|
-
}) {
|
|
176
|
-
const theme = (0, _useTheme.useTheme)();
|
|
177
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
178
|
-
style: [styles.header, {
|
|
179
|
-
paddingHorizontal: padding,
|
|
180
|
-
paddingTop: padding,
|
|
181
|
-
gap
|
|
182
|
-
}],
|
|
183
|
-
children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
|
|
184
|
-
accessibilityRole: "header",
|
|
185
|
-
numberOfLines: 2,
|
|
186
|
-
style: [styles.title, {
|
|
187
|
-
color: theme.colors.text
|
|
188
|
-
}],
|
|
189
|
-
children: title
|
|
190
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
191
|
-
style: styles.titleSpacer
|
|
192
|
-
}), showClose ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
193
|
-
accessibilityLabel: closeAccessibilityLabel,
|
|
194
|
-
onPress: onClose
|
|
195
|
-
}) : null]
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function CloseButton({
|
|
199
|
-
accessibilityLabel,
|
|
200
|
-
onPress
|
|
201
|
-
}) {
|
|
202
|
-
const theme = (0, _useTheme.useTheme)();
|
|
203
|
-
const {
|
|
204
|
-
hovered,
|
|
205
|
-
pressed,
|
|
206
|
-
hoverHandlers,
|
|
207
|
-
pressHandlers
|
|
208
|
-
} = (0, _useInteractionState.useInteractionStates)();
|
|
209
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
210
|
-
onPress: onPress,
|
|
211
|
-
...hoverHandlers,
|
|
212
|
-
...pressHandlers,
|
|
213
|
-
hitSlop: CLOSE_HIT_SLOP,
|
|
214
|
-
accessibilityRole: "button",
|
|
215
|
-
accessibilityLabel: accessibilityLabel,
|
|
216
|
-
style: [styles.closeButton, {
|
|
217
|
-
backgroundColor: theme.colors.contrast50
|
|
218
|
-
}, (hovered || pressed) && styles.closeButtonActive],
|
|
219
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Times.TimesLarge_Stroke2_Corner0_Rounded, {
|
|
220
|
-
size: "sm",
|
|
221
|
-
fill: theme.colors.textSecondary
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
const returnsTrue = () => true;
|
|
226
|
-
function backdropAnimation(isClosing) {
|
|
227
|
-
return isClosing ? {
|
|
228
|
-
animation: `bloomCenteredDialogFadeOut ease-in ${FADE_OUT_DURATION}ms forwards`
|
|
229
|
-
} : {
|
|
230
|
-
animation: 'bloomCenteredDialogFadeIn ease-out 150ms'
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function cardAnimation(isClosing) {
|
|
234
|
-
return isClosing ? {
|
|
235
|
-
animation: `bloomCenteredDialogZoomOut ease-in ${FADE_OUT_DURATION}ms forwards`
|
|
236
|
-
} : {
|
|
237
|
-
animation: 'bloomCenteredDialogZoomIn cubic-bezier(0.16, 1, 0.3, 1) 200ms'
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
const KEYFRAMES_ID = 'bloom-centered-dialog-keyframes';
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* CSS keyframes powering the web enter/exit animation. Injected once into
|
|
244
|
-
* `<head>` on first mount (keyed by id so re-mounts and multiple dialogs
|
|
245
|
-
* don't duplicate the rule). Mirrors the native modal's `fade` feel with a
|
|
246
|
-
* subtle zoom on the card.
|
|
247
|
-
*/
|
|
248
|
-
const BLOOM_CENTERED_DIALOG_CSS = exports.BLOOM_CENTERED_DIALOG_CSS = `
|
|
249
|
-
@keyframes bloomCenteredDialogFadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
250
|
-
@keyframes bloomCenteredDialogFadeOut { from { opacity: 1; } to { opacity: 0; } }
|
|
251
|
-
@keyframes bloomCenteredDialogZoomIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
|
|
252
|
-
@keyframes bloomCenteredDialogZoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.96); } }
|
|
253
|
-
`;
|
|
254
|
-
function useKeyframes() {
|
|
255
|
-
(0, _react.useEffect)(() => {
|
|
256
|
-
if (typeof document === 'undefined') return;
|
|
257
|
-
if (document.getElementById(KEYFRAMES_ID)) return;
|
|
258
|
-
const style = document.createElement('style');
|
|
259
|
-
style.id = KEYFRAMES_ID;
|
|
260
|
-
style.textContent = BLOOM_CENTERED_DIALOG_CSS;
|
|
261
|
-
document.head.appendChild(style);
|
|
262
|
-
}, []);
|
|
263
|
-
}
|
|
264
|
-
const styles = _reactNative.StyleSheet.create({
|
|
265
|
-
root: {
|
|
266
|
-
position: 'fixed',
|
|
267
|
-
top: 0,
|
|
268
|
-
left: 0,
|
|
269
|
-
right: 0,
|
|
270
|
-
bottom: 0,
|
|
271
|
-
zIndex: dialogZIndex.backdrop,
|
|
272
|
-
alignItems: 'center',
|
|
273
|
-
justifyContent: 'center',
|
|
274
|
-
pointerEvents: 'auto'
|
|
275
|
-
},
|
|
276
|
-
backdrop: {
|
|
277
|
-
position: 'fixed',
|
|
278
|
-
top: 0,
|
|
279
|
-
left: 0,
|
|
280
|
-
right: 0,
|
|
281
|
-
bottom: 0
|
|
282
|
-
},
|
|
283
|
-
card: {
|
|
284
|
-
position: 'relative',
|
|
285
|
-
width: '100%',
|
|
286
|
-
borderRadius: _centeredDialogTokens.CARD_RADIUS,
|
|
287
|
-
borderWidth: 1,
|
|
288
|
-
overflow: 'hidden',
|
|
289
|
-
shadowOpacity: 0.18,
|
|
290
|
-
shadowRadius: 24,
|
|
291
|
-
shadowOffset: {
|
|
292
|
-
width: 0,
|
|
293
|
-
height: 8
|
|
294
|
-
},
|
|
295
|
-
zIndex: dialogZIndex.surface
|
|
296
|
-
},
|
|
297
|
-
header: {
|
|
298
|
-
flexDirection: 'row',
|
|
299
|
-
alignItems: 'flex-start',
|
|
300
|
-
justifyContent: 'space-between'
|
|
301
|
-
},
|
|
302
|
-
title: {
|
|
303
|
-
flex: 1,
|
|
304
|
-
fontSize: 17,
|
|
305
|
-
fontWeight: '700',
|
|
306
|
-
lineHeight: 22
|
|
307
|
-
},
|
|
308
|
-
titleSpacer: {
|
|
309
|
-
flex: 1
|
|
310
|
-
},
|
|
311
|
-
closeButton: {
|
|
312
|
-
width: 28,
|
|
313
|
-
height: 28,
|
|
314
|
-
borderRadius: 14,
|
|
315
|
-
alignItems: 'center',
|
|
316
|
-
justifyContent: 'center',
|
|
317
|
-
cursor: 'pointer'
|
|
318
|
-
},
|
|
319
|
-
closeButtonActive: {
|
|
320
|
-
opacity: 0.7
|
|
321
|
-
},
|
|
322
|
-
bodyScroll: {
|
|
323
|
-
flexGrow: 0,
|
|
324
|
-
flexShrink: 1
|
|
325
|
-
},
|
|
326
|
-
footer: {
|
|
327
|
-
borderTopWidth: 1
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
//# sourceMappingURL=CenteredDialog.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactRemoveScrollBar","_useInteractionState","_Times","_indexWeb","_zIndex","_useTheme","_index","_centeredDialogTokens","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FADE_OUT_DURATION","CLOSE_HIT_SLOP","top","bottom","left","right","dialogZIndex","createOverlayZIndex","CENTERED_DIALOG_BACKDROP_TESTID","exports","stopPropagation","CenteredDialog","visible","onClose","title","dismissible","maxWidth","DEFAULT_MAX_WIDTH","compact","showClose","children","footer","accessibilityLabel","closeAccessibilityLabel","backdropAccessibilityLabel","cardStyle","contentStyle","testID","theme","useTheme","rendered","setRendered","useState","isClosing","useKeyframes","useEffect","timer","setTimeout","clearTimeout","document","handler","key","addEventListener","removeEventListener","spacing","useMemo","resolveSpacing","resolvedShowClose","Boolean","hasHeader","handleBackdropPress","undefined","jsxs","Portal","jsx","RemoveScrollBar","View","style","styles","root","padding","VIEWPORT_GUTTER","Pressable","onPress","disabled","accessibilityRole","backdrop","backgroundColor","colors","overlay","backdropAnimation","role","onStartShouldSetResponder","returnsTrue","onResponderRelease","onClick","card","maxHeight","MAX_HEIGHT_FRACTION","borderColor","border","shadowColor","shadow","cardAnimation","DialogHeader","pad","gap","headerGap","ScrollView","bodyScroll","contentContainerStyle","paddingTop","contentGap","showsVerticalScrollIndicator","keyboardShouldPersistTaps","footerGap","borderTopColor","borderLight","header","paddingHorizontal","Text","numberOfLines","color","text","titleSpacer","CloseButton","hovered","pressed","hoverHandlers","pressHandlers","useInteractionStates","hitSlop","closeButton","contrast50","closeButtonActive","TimesLarge_Stroke2_Corner0_Rounded","size","fill","textSecondary","animation","KEYFRAMES_ID","BLOOM_CENTERED_DIALOG_CSS","getElementById","createElement","id","textContent","head","appendChild","StyleSheet","create","position","zIndex","alignItems","justifyContent","pointerEvents","width","borderRadius","CARD_RADIUS","borderWidth","overflow","shadowOpacity","shadowRadius","shadowOffset","height","surface","flexDirection","flex","fontSize","fontWeight","lineHeight","cursor","opacity","flexGrow","flexShrink","borderTopWidth"],"sourceRoot":"../../../src","sources":["dialog/CenteredDialog.web.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAEA,IAAAS,qBAAA,GAAAT,OAAA;AAMkC,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAD,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD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4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.VIEWPORT_GUTTER = exports.MAX_HEIGHT_FRACTION = exports.DEFAULT_MAX_WIDTH = exports.COZY_SPACING = exports.COMPACT_SPACING = exports.CARD_RADIUS = void 0;
|
|
7
|
-
exports.resolveSpacing = resolveSpacing;
|
|
8
|
-
var _tokens = require("../styles/tokens.js");
|
|
9
|
-
/**
|
|
10
|
-
* Shared layout constants for `<CenteredDialog>`, kept in one module so the
|
|
11
|
-
* native and web forks render identically. All values are Bloom theme tokens
|
|
12
|
-
* (`styles/tokens`) — no ad-hoc magic numbers.
|
|
13
|
-
*
|
|
14
|
-
* COMPACT is the priority: the `compact` spacing set is the default and is
|
|
15
|
-
* deliberately tight (≈`space.md`), so the card reads snug out of the box.
|
|
16
|
-
* The `cozy` set is the opt-out (`compact={false}`) for roomier dialogs.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/** Default max card width — comfortable for a compact dialog. */
|
|
20
|
-
const DEFAULT_MAX_WIDTH = exports.DEFAULT_MAX_WIDTH = 440;
|
|
21
|
-
|
|
22
|
-
/** Card height is capped at this fraction of the viewport; body scrolls. */
|
|
23
|
-
const MAX_HEIGHT_FRACTION = exports.MAX_HEIGHT_FRACTION = 0.8;
|
|
24
|
-
|
|
25
|
-
/** Card corner radius (token: `borderRadius.lg` = 16). */
|
|
26
|
-
const CARD_RADIUS = exports.CARD_RADIUS = _tokens.borderRadius.lg;
|
|
27
|
-
|
|
28
|
-
/** Outer gutter between the card edge and the viewport edge (token `space.lg`). */
|
|
29
|
-
const VIEWPORT_GUTTER = exports.VIEWPORT_GUTTER = _tokens.space.lg;
|
|
30
|
-
/**
|
|
31
|
-
* Compact (default) — tight, snug spacing built on `space.md` (12).
|
|
32
|
-
*
|
|
33
|
-
* pad = space.md (12)
|
|
34
|
-
* headerGap = space.sm (8)
|
|
35
|
-
* footerGap = space.md (12)
|
|
36
|
-
* contentGap = space.sm (8)
|
|
37
|
-
*/
|
|
38
|
-
const COMPACT_SPACING = exports.COMPACT_SPACING = {
|
|
39
|
-
pad: _tokens.space.md,
|
|
40
|
-
headerGap: _tokens.space.sm,
|
|
41
|
-
footerGap: _tokens.space.md,
|
|
42
|
-
contentGap: _tokens.space.sm
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Cozy (`compact={false}`) — roomier spacing built on `space.xl` (20).
|
|
47
|
-
*
|
|
48
|
-
* pad = space.xl (20)
|
|
49
|
-
* headerGap = space.md (12)
|
|
50
|
-
* footerGap = space.lg (16)
|
|
51
|
-
* contentGap = space.md (12)
|
|
52
|
-
*/
|
|
53
|
-
const COZY_SPACING = exports.COZY_SPACING = {
|
|
54
|
-
pad: _tokens.space.xl,
|
|
55
|
-
headerGap: _tokens.space.md,
|
|
56
|
-
footerGap: _tokens.space.lg,
|
|
57
|
-
contentGap: _tokens.space.md
|
|
58
|
-
};
|
|
59
|
-
function resolveSpacing(compact) {
|
|
60
|
-
return compact ? COMPACT_SPACING : COZY_SPACING;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=centered-dialog-tokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_tokens","require","DEFAULT_MAX_WIDTH","exports","MAX_HEIGHT_FRACTION","CARD_RADIUS","borderRadius","lg","VIEWPORT_GUTTER","space","COMPACT_SPACING","pad","md","headerGap","sm","footerGap","contentGap","COZY_SPACING","xl","resolveSpacing","compact"],"sourceRoot":"../../../src","sources":["dialog/centered-dialog-tokens.ts"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,GAAG;;AAEpC;AACO,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,GAAG;;AAEtC;AACO,MAAMC,WAAW,GAAAF,OAAA,CAAAE,WAAA,GAAGC,oBAAY,CAACC,EAAE;;AAE1C;AACO,MAAMC,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGC,aAAK,CAACF,EAAE;AAavC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAA8B,GAAAP,OAAA,CAAAO,eAAA,GAAG;EAC5CC,GAAG,EAAEF,aAAK,CAACG,EAAE;EACbC,SAAS,EAAEJ,aAAK,CAACK,EAAE;EACnBC,SAAS,EAAEN,aAAK,CAACG,EAAE;EACnBI,UAAU,EAAEP,aAAK,CAACK;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,YAA2B,GAAAd,OAAA,CAAAc,YAAA,GAAG;EACzCN,GAAG,EAAEF,aAAK,CAACS,EAAE;EACbL,SAAS,EAAEJ,aAAK,CAACG,EAAE;EACnBG,SAAS,EAAEN,aAAK,CAACF,EAAE;EACnBS,UAAU,EAAEP,aAAK,CAACG;AACpB,CAAC;AAEM,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,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.RESPONSIVE_SHEET_BACKDROP_TESTID = void 0;
|
|
7
|
-
exports.ResponsiveSheet = ResponsiveSheet;
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _dialog = require("../dialog");
|
|
11
|
-
var _placement = require("../dialog/placement.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use `<Dialog placement={{ base: 'bottom', md: 'left' }}>` instead.
|
|
16
|
-
*
|
|
17
|
-
* `ResponsiveSheet` is now a thin wrapper that configures the canonical
|
|
18
|
-
* `<Dialog>` — an anchored side-sheet on wide screens collapsing to a
|
|
19
|
-
* bottom-sheet below the breakpoint. It holds ZERO motion/layout logic of its
|
|
20
|
-
* own; it maps its props onto a responsive `Dialog` `placement`. The
|
|
21
|
-
* `@oxyhq/bloom/responsive-sheet` subpath is retained for the migration window.
|
|
22
|
-
*
|
|
23
|
-
* This file is BOTH the package default entry (resolved by downstream `tsc`
|
|
24
|
-
* and non-Metro web bundlers via the `browser` condition through `index.web`)
|
|
25
|
-
* AND a clean delegation, so it carries no platform-specific imports.
|
|
26
|
-
*/
|
|
27
|
-
function ResponsiveSheet({
|
|
28
|
-
open,
|
|
29
|
-
onClose,
|
|
30
|
-
side = 'left',
|
|
31
|
-
breakpoint = _placement.BREAKPOINT_MD,
|
|
32
|
-
width,
|
|
33
|
-
maxHeightRatio,
|
|
34
|
-
inset,
|
|
35
|
-
showHandle,
|
|
36
|
-
dismissOnBackdrop,
|
|
37
|
-
panelStyle,
|
|
38
|
-
panelClassName,
|
|
39
|
-
containerStyle,
|
|
40
|
-
containerClassName,
|
|
41
|
-
label,
|
|
42
|
-
children
|
|
43
|
-
}) {
|
|
44
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_dialog.Dialog, {
|
|
45
|
-
open: open,
|
|
46
|
-
onClose: onClose,
|
|
47
|
-
placement: placementForSide(side, breakpoint),
|
|
48
|
-
width: width,
|
|
49
|
-
maxHeightRatio: maxHeightRatio,
|
|
50
|
-
inset: inset,
|
|
51
|
-
showHandle: showHandle,
|
|
52
|
-
dismissOnBackdrop: dismissOnBackdrop,
|
|
53
|
-
panelStyle: panelStyle,
|
|
54
|
-
panelClassName: panelClassName,
|
|
55
|
-
containerStyle: containerStyle,
|
|
56
|
-
containerClassName: containerClassName,
|
|
57
|
-
label: label,
|
|
58
|
-
children: children
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Build the `Dialog` `placement` map for a `ResponsiveSheet`: a bottom-sheet
|
|
64
|
-
* below `breakpoint`, the anchored `side` at and above it. The `breakpoint`
|
|
65
|
-
* (px) is bucketed to the nearest Tailwind key so the side-sheet engages at the
|
|
66
|
-
* matching width.
|
|
67
|
-
*/
|
|
68
|
-
function placementForSide(side, breakpoint) {
|
|
69
|
-
if (breakpoint <= _placement.BREAKPOINT_SM) return {
|
|
70
|
-
base: 'bottom',
|
|
71
|
-
sm: side
|
|
72
|
-
};
|
|
73
|
-
if (breakpoint <= _placement.BREAKPOINT_MD) return {
|
|
74
|
-
base: 'bottom',
|
|
75
|
-
md: side
|
|
76
|
-
};
|
|
77
|
-
if (breakpoint <= _placement.BREAKPOINT_LG) return {
|
|
78
|
-
base: 'bottom',
|
|
79
|
-
lg: side
|
|
80
|
-
};
|
|
81
|
-
if (breakpoint <= _placement.BREAKPOINT_XL) return {
|
|
82
|
-
base: 'bottom',
|
|
83
|
-
xl: side
|
|
84
|
-
};
|
|
85
|
-
return {
|
|
86
|
-
base: 'bottom',
|
|
87
|
-
xl: side
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated Stable testID for the dimmed backdrop dismiss button — now
|
|
93
|
-
* provided by the underlying `<Dialog>`'s side/bottom backdrop.
|
|
94
|
-
*/
|
|
95
|
-
const RESPONSIVE_SHEET_BACKDROP_TESTID = exports.RESPONSIVE_SHEET_BACKDROP_TESTID = _placement.DIALOG_SHEET_BACKDROP_TESTID;
|
|
96
|
-
var _default = exports.default = ResponsiveSheet;
|
|
97
|
-
//# sourceMappingURL=ResponsiveSheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_dialog","_placement","_jsxRuntime","e","__esModule","default","ResponsiveSheet","open","onClose","side","breakpoint","BREAKPOINT_MD","width","maxHeightRatio","inset","showHandle","dismissOnBackdrop","panelStyle","panelClassName","containerStyle","containerClassName","label","children","jsx","Dialog","placement","placementForSide","BREAKPOINT_SM","base","sm","md","BREAKPOINT_LG","lg","BREAKPOINT_XL","xl","RESPONSIVE_SHEET_BACKDROP_TESTID","exports","DIALOG_SHEET_BACKDROP_TESTID","_default"],"sourceRoot":"../../../src","sources":["responsive-sheet/ResponsiveSheet.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAO6B,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,eAAeA,CAAC;EAC9BC,IAAI;EACJC,OAAO;EACPC,IAAI,GAAG,MAAM;EACbC,UAAU,GAAGC,wBAAa;EAC1BC,KAAK;EACLC,cAAc;EACdC,KAAK;EACLC,UAAU;EACVC,iBAAiB;EACjBC,UAAU;EACVC,cAAc;EACdC,cAAc;EACdC,kBAAkB;EAClBC,KAAK;EACLC;AACoB,CAAC,EAAE;EACvB,oBACE,IAAApB,WAAA,CAAAqB,GAAA,EAACvB,OAAA,CAAAwB,MAAM;IACLjB,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEA,OAAQ;IACjBiB,SAAS,EAAEC,gBAAgB,CAACjB,IAAI,EAAEC,UAAU,CAAE;IAC9CE,KAAK,EAAEA,KAAM;IACbC,cAAc,EAAEA,cAAe;IAC/BC,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBC,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBC,cAAc,EAAEA,cAAe;IAC/BC,cAAc,EAAEA,cAAe;IAC/BC,kBAAkB,EAAEA,kBAAmB;IACvCC,KAAK,EAAEA,KAAM;IAAAC,QAAA,EAEZA;EAAQ,CACH,CAAC;AAEb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,gBAAgBA,CACvBjB,IAAsB,EACtBC,UAAkB,EACS;EAC3B,IAAIA,UAAU,IAAIiB,wBAAa,EAAE,OAAO;IAAEC,IAAI,EAAE,QAAQ;IAAEC,EAAE,EAAEpB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIC,wBAAa,EAAE,OAAO;IAAEiB,IAAI,EAAE,QAAQ;IAAEE,EAAE,EAAErB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIqB,wBAAa,EAAE,OAAO;IAAEH,IAAI,EAAE,QAAQ;IAAEI,EAAE,EAAEvB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIuB,wBAAa,EAAE,OAAO;IAAEL,IAAI,EAAE,QAAQ;IAAEM,EAAE,EAAEzB;EAAK,CAAC;EACpE,OAAO;IAAEmB,IAAI,EAAE,QAAQ;IAAEM,EAAE,EAAEzB;EAAK,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACO,MAAM0B,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,GAAGE,uCAA4B;AAAC,IAAAC,QAAA,GAAAF,OAAA,CAAA/B,OAAA,GAE9DC,eAAe","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.RESPONSIVE_SHEET_BACKDROP_TESTID = void 0;
|
|
7
|
-
exports.ResponsiveSheet = ResponsiveSheet;
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _indexWeb = require("../dialog/index.web.js");
|
|
11
|
-
var _placement = require("../dialog/placement.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use `<Dialog placement={{ base: 'bottom', md: 'left' }}>` instead.
|
|
16
|
-
*
|
|
17
|
-
* Web fork of the deprecated `ResponsiveSheet` wrapper. Identical delegation to
|
|
18
|
-
* the default fork, but imports the web `Dialog` explicitly so non-Metro web
|
|
19
|
-
* bundlers never follow the native (reanimated) `Dialog` sibling.
|
|
20
|
-
*/
|
|
21
|
-
function ResponsiveSheet({
|
|
22
|
-
open,
|
|
23
|
-
onClose,
|
|
24
|
-
side = 'left',
|
|
25
|
-
breakpoint = _placement.BREAKPOINT_MD,
|
|
26
|
-
width,
|
|
27
|
-
maxHeightRatio,
|
|
28
|
-
inset,
|
|
29
|
-
showHandle,
|
|
30
|
-
dismissOnBackdrop,
|
|
31
|
-
panelStyle,
|
|
32
|
-
panelClassName,
|
|
33
|
-
containerStyle,
|
|
34
|
-
containerClassName,
|
|
35
|
-
label,
|
|
36
|
-
children
|
|
37
|
-
}) {
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_indexWeb.Dialog, {
|
|
39
|
-
open: open,
|
|
40
|
-
onClose: onClose,
|
|
41
|
-
placement: placementForSide(side, breakpoint),
|
|
42
|
-
width: width,
|
|
43
|
-
maxHeightRatio: maxHeightRatio,
|
|
44
|
-
inset: inset,
|
|
45
|
-
showHandle: showHandle,
|
|
46
|
-
dismissOnBackdrop: dismissOnBackdrop,
|
|
47
|
-
panelStyle: panelStyle,
|
|
48
|
-
panelClassName: panelClassName,
|
|
49
|
-
containerStyle: containerStyle,
|
|
50
|
-
containerClassName: containerClassName,
|
|
51
|
-
label: label,
|
|
52
|
-
children: children
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function placementForSide(side, breakpoint) {
|
|
56
|
-
if (breakpoint <= _placement.BREAKPOINT_SM) return {
|
|
57
|
-
base: 'bottom',
|
|
58
|
-
sm: side
|
|
59
|
-
};
|
|
60
|
-
if (breakpoint <= _placement.BREAKPOINT_MD) return {
|
|
61
|
-
base: 'bottom',
|
|
62
|
-
md: side
|
|
63
|
-
};
|
|
64
|
-
if (breakpoint <= _placement.BREAKPOINT_LG) return {
|
|
65
|
-
base: 'bottom',
|
|
66
|
-
lg: side
|
|
67
|
-
};
|
|
68
|
-
if (breakpoint <= _placement.BREAKPOINT_XL) return {
|
|
69
|
-
base: 'bottom',
|
|
70
|
-
xl: side
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
base: 'bottom',
|
|
74
|
-
xl: side
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated Stable testID for the dimmed backdrop dismiss button — now
|
|
80
|
-
* provided by the underlying `<Dialog>`'s side/bottom backdrop.
|
|
81
|
-
*/
|
|
82
|
-
const RESPONSIVE_SHEET_BACKDROP_TESTID = exports.RESPONSIVE_SHEET_BACKDROP_TESTID = _placement.DIALOG_SHEET_BACKDROP_TESTID;
|
|
83
|
-
var _default = exports.default = ResponsiveSheet;
|
|
84
|
-
//# sourceMappingURL=ResponsiveSheet.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_indexWeb","_placement","_jsxRuntime","e","__esModule","default","ResponsiveSheet","open","onClose","side","breakpoint","BREAKPOINT_MD","width","maxHeightRatio","inset","showHandle","dismissOnBackdrop","panelStyle","panelClassName","containerStyle","containerClassName","label","children","jsx","Dialog","placement","placementForSide","BREAKPOINT_SM","base","sm","md","BREAKPOINT_LG","lg","BREAKPOINT_XL","xl","RESPONSIVE_SHEET_BACKDROP_TESTID","exports","DIALOG_SHEET_BACKDROP_TESTID","_default"],"sourceRoot":"../../../src","sources":["responsive-s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AAEpB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIC,wBAAa,EAAE,OAAO;IAAEiB,IAAI,EAAE,QAAQ;IAAEE,EAAE,EAAErB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIqB,wBAAa,EAAE,OAAO;IAAEH,IAAI,EAAE,QAAQ;IAAEI,EAAE,EAAEvB;EAAK,CAAC;EACpE,IAAIC,UAAU,IAAIuB,wBAAa,EAAE,OAAO;IAAEL,IAAI,EAAE,QAAQ;IAAEM,EAAE,EAAEzB;EAAK,CAAC;EACpE,OAAO;IAAEmB,IAAI,EAAE,QAAQ;IAAEM,EAAE,EAAEzB;EAAK,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACO,MAAM0B,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,GAAGE,uCAA4B;AAAC,IAAAC,QAAA,GAAAF,OAAA,CAAA/B,OAAA,GAE9DC,eAAe","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "RESPONSIVE_SHEET_BACKDROP_TESTID", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ResponsiveSheet.RESPONSIVE_SHEET_BACKDROP_TESTID;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ResponsiveSheet", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ResponsiveSheet.ResponsiveSheet;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _ResponsiveSheet = require("./ResponsiveSheet");
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_ResponsiveSheet","require"],"sourceRoot":"../../../src","sources":["responsive-sheet/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "RESPONSIVE_SHEET_BACKDROP_TESTID", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ResponsiveSheetWeb.RESPONSIVE_SHEET_BACKDROP_TESTID;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ResponsiveSheet", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ResponsiveSheetWeb.ResponsiveSheet;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _ResponsiveSheetWeb = require("./ResponsiveSheet.web.js");
|
|
19
|
-
//# sourceMappingURL=index.web.js.map
|