@oxyhq/bloom 0.45.0 → 0.48.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/bottom-sheet/BottomSheetBase.js +34 -12
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/combobox/Combobox.js +3 -3
- package/lib/commonjs/combobox/Combobox.js.map +1 -1
- package/lib/commonjs/command/Command.js +3 -3
- package/lib/commonjs/command/Command.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +86 -8
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +176 -18
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +84 -29
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +365 -0
- package/lib/commonjs/dialog/DialogHeader.js.map +1 -0
- package/lib/commonjs/dialog/index.js +7 -0
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +7 -0
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/index.js +40 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +84 -48
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/react-native-className.d.js +6 -0
- package/lib/commonjs/react-native-className.d.js.map +1 -0
- package/lib/commonjs/{search-input → search}/index.js +5 -3
- package/lib/commonjs/search/index.js.map +1 -0
- package/lib/commonjs/settings-list/SettingsList.js +5 -1
- package/lib/commonjs/settings-list/SettingsList.js.map +1 -1
- package/lib/commonjs/surfaces/SurfaceHost.js +202 -0
- package/lib/commonjs/surfaces/SurfaceHost.js.map +1 -0
- package/lib/commonjs/surfaces/api.js +83 -0
- package/lib/commonjs/surfaces/api.js.map +1 -0
- package/lib/commonjs/surfaces/index.js +82 -0
- package/lib/commonjs/surfaces/index.js.map +1 -0
- package/lib/commonjs/surfaces/index.web.js +77 -0
- package/lib/commonjs/surfaces/index.web.js.map +1 -0
- package/lib/commonjs/surfaces/prompts.js +154 -0
- package/lib/commonjs/surfaces/prompts.js.map +1 -0
- package/lib/commonjs/surfaces/surfaceStore.js +172 -0
- package/lib/commonjs/surfaces/surfaceStore.js.map +1 -0
- package/lib/commonjs/surfaces/types.js +6 -0
- package/lib/commonjs/surfaces/types.js.map +1 -0
- package/lib/commonjs/surfaces/useSurface.js +36 -0
- package/lib/commonjs/surfaces/useSurface.js.map +1 -0
- package/lib/commonjs/text-field/index.js +22 -6
- package/lib/commonjs/text-field/index.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +34 -12
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/combobox/Combobox.js +3 -3
- package/lib/module/combobox/Combobox.js.map +1 -1
- package/lib/module/command/Command.js +3 -3
- package/lib/module/command/Command.js.map +1 -1
- package/lib/module/dialog/Dialog.js +88 -10
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +179 -21
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +85 -30
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +356 -0
- package/lib/module/dialog/DialogHeader.js.map +1 -0
- package/lib/module/dialog/index.js +1 -0
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +1 -0
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/index.js +7 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +7 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/react-native-className.d.js +20 -0
- package/lib/module/react-native-className.d.js.map +1 -0
- package/lib/module/{search-input → search}/index.js +6 -2
- package/lib/module/search/index.js.map +1 -0
- package/lib/module/settings-list/SettingsList.js +5 -1
- package/lib/module/settings-list/SettingsList.js.map +1 -1
- package/lib/module/surfaces/SurfaceHost.js +197 -0
- package/lib/module/surfaces/SurfaceHost.js.map +1 -0
- package/lib/module/surfaces/api.js +48 -0
- package/lib/module/surfaces/api.js.map +1 -0
- package/lib/module/surfaces/index.js +24 -0
- package/lib/module/surfaces/index.js.map +1 -0
- package/lib/module/surfaces/index.web.js +19 -0
- package/lib/module/surfaces/index.web.js.map +1 -0
- package/lib/module/surfaces/prompts.js +148 -0
- package/lib/module/surfaces/prompts.js.map +1 -0
- package/lib/module/surfaces/surfaceStore.js +159 -0
- package/lib/module/surfaces/surfaceStore.js.map +1 -0
- package/lib/module/surfaces/types.js +4 -0
- package/lib/module/surfaces/types.js.map +1 -0
- package/lib/module/surfaces/useSurface.js +31 -0
- package/lib/module/surfaces/useSurface.js.map +1 -0
- package/lib/module/text-field/index.js +22 -6
- package/lib/module/text-field/index.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts +23 -0
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/combobox/Combobox.d.ts +1 -1
- package/lib/typescript/commonjs/command/Command.d.ts +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts +86 -0
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/index.d.ts +2 -1
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +85 -0
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/common.d.ts +1 -0
- package/lib/typescript/commonjs/icons/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +5 -3
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
- package/lib/typescript/commonjs/{search-input → search}/index.d.ts +1 -1
- package/lib/typescript/commonjs/search/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts +25 -0
- package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/api.d.ts +41 -0
- package/lib/typescript/commonjs/surfaces/api.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/index.d.ts +25 -0
- package/lib/typescript/commonjs/surfaces/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/index.web.d.ts +20 -0
- package/lib/typescript/commonjs/surfaces/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/prompts.d.ts +13 -0
- package/lib/typescript/commonjs/surfaces/prompts.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/surfaceStore.d.ts +51 -0
- package/lib/typescript/commonjs/surfaces/surfaceStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/types.d.ts +161 -0
- package/lib/typescript/commonjs/surfaces/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/useSurface.d.ts +21 -0
- package/lib/typescript/commonjs/surfaces/useSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/text-field/index.d.ts +2 -1
- package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts +23 -0
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/combobox/Combobox.d.ts +1 -1
- package/lib/typescript/module/command/Command.d.ts +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogHeader.d.ts +86 -0
- package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -0
- package/lib/typescript/module/dialog/index.d.ts +2 -1
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +2 -1
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +85 -0
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/icons/common.d.ts +1 -0
- package/lib/typescript/module/icons/common.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +5 -3
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/types.d.ts +1 -1
- package/lib/typescript/module/{search-input → search}/index.d.ts +1 -1
- package/lib/typescript/module/search/index.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/SurfaceHost.d.ts +25 -0
- package/lib/typescript/module/surfaces/SurfaceHost.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/api.d.ts +41 -0
- package/lib/typescript/module/surfaces/api.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/index.d.ts +25 -0
- package/lib/typescript/module/surfaces/index.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/index.web.d.ts +20 -0
- package/lib/typescript/module/surfaces/index.web.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/prompts.d.ts +13 -0
- package/lib/typescript/module/surfaces/prompts.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/surfaceStore.d.ts +51 -0
- package/lib/typescript/module/surfaces/surfaceStore.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/types.d.ts +161 -0
- package/lib/typescript/module/surfaces/types.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/useSurface.d.ts +21 -0
- package/lib/typescript/module/surfaces/useSurface.d.ts.map +1 -0
- package/lib/typescript/module/text-field/index.d.ts +2 -1
- package/lib/typescript/module/text-field/index.d.ts.map +1 -1
- package/package.json +24 -8
- package/src/__tests__/BottomSheet.test.tsx +47 -0
- package/src/__tests__/DialogBottomSheet.test.tsx +30 -5
- package/src/__tests__/surfaceStore.test.ts +219 -0
- package/src/bottom-sheet/BottomSheetBase.tsx +59 -10
- package/src/combobox/Combobox.tsx +3 -3
- package/src/command/Command.tsx +3 -3
- package/src/dialog/Dialog.tsx +88 -7
- package/src/dialog/Dialog.web.tsx +179 -29
- package/src/dialog/DialogBottomSheet.tsx +90 -28
- package/src/dialog/DialogHeader.tsx +420 -0
- package/src/dialog/index.ts +2 -0
- package/src/dialog/index.web.ts +2 -0
- package/src/dialog/types.ts +86 -0
- package/src/index.ts +18 -1
- package/src/index.web.ts +18 -1
- package/src/input-group/types.ts +1 -1
- package/src/react-native-className.d.ts +38 -0
- package/src/{search-input → search}/index.tsx +8 -5
- package/src/settings-list/SettingsList.tsx +5 -1
- package/src/surfaces/SurfaceHost.tsx +222 -0
- package/src/surfaces/api.ts +55 -0
- package/src/surfaces/index.ts +38 -0
- package/src/surfaces/index.web.ts +33 -0
- package/src/surfaces/prompts.tsx +178 -0
- package/src/surfaces/surfaceStore.ts +168 -0
- package/src/surfaces/types.ts +172 -0
- package/src/surfaces/useSurface.ts +33 -0
- package/src/text-field/index.tsx +24 -5
- package/lib/commonjs/search-input/index.js.map +0 -1
- package/lib/module/search-input/index.js.map +0 -1
- package/lib/typescript/commonjs/search-input/index.d.ts.map +0 -1
- package/lib/typescript/module/search-input/index.d.ts.map +0 -1
|
@@ -6,8 +6,9 @@ import { BottomSheet } from '../bottom-sheet';
|
|
|
6
6
|
import { useTheme } from "../theme/use-theme.js";
|
|
7
7
|
import { Context } from "./context.js";
|
|
8
8
|
import { DialogBody } from "./DialogContent.js";
|
|
9
|
+
import { DIALOG_NAV_BAR_HEIGHT, DialogHeaderProvider, DialogLargeTitle, DialogNavHeader, useDialogHeaderController } from "./DialogHeader.js";
|
|
9
10
|
import { DEFAULT_DIALOG_CONTENT_PADDING, DEFAULT_MAX_HEIGHT_RATIO, PANEL_RADIUS, SHEET_BACKDROP_OPACITY } from "./placement.js";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
/**
|
|
12
13
|
* Shared `BottomSheet`-backed surface for the `bottom` placement, used by BOTH
|
|
13
14
|
* `Dialog.tsx` (native) and `Dialog.web.tsx` (web). `BottomSheet` is itself a
|
|
@@ -31,15 +32,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
31
32
|
export function DialogBottomSheet({
|
|
32
33
|
control,
|
|
33
34
|
open: controlledOpen,
|
|
35
|
+
startOpen,
|
|
34
36
|
onClose,
|
|
35
37
|
testID,
|
|
36
38
|
title,
|
|
37
39
|
description,
|
|
38
40
|
actions,
|
|
41
|
+
header,
|
|
39
42
|
maxHeightRatio = DEFAULT_MAX_HEIGHT_RATIO,
|
|
40
43
|
showHandle = true,
|
|
41
44
|
dismissOnBackdrop = true,
|
|
42
45
|
contentPadding = DEFAULT_DIALOG_CONTENT_PADDING,
|
|
46
|
+
scrollable,
|
|
43
47
|
style,
|
|
44
48
|
panelStyle,
|
|
45
49
|
panelClassName,
|
|
@@ -54,6 +58,7 @@ export function DialogBottomSheet({
|
|
|
54
58
|
const closeCallbacks = useRef([]);
|
|
55
59
|
const titleId = useId();
|
|
56
60
|
const descriptionId = useId();
|
|
61
|
+
const headerController = useDialogHeaderController();
|
|
57
62
|
|
|
58
63
|
// Read the latest controlled flag / `onClose` inside stable callbacks without
|
|
59
64
|
// re-binding them (the context + imperative handle depend on `close` staying
|
|
@@ -146,38 +151,92 @@ export function DialogBottomSheet({
|
|
|
146
151
|
}, [theme.colors.background, maxHeightRatio, panelStyle]);
|
|
147
152
|
|
|
148
153
|
// Does this dialog render bloom's declarative chrome (title / description /
|
|
149
|
-
// actions)
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
// viewports. This only changes what `DialogBottomSheet` passes to
|
|
156
|
-
// `BottomSheet`; the standalone `BottomSheet` API and its `scrollable` default
|
|
157
|
-
// are unchanged for direct consumers.
|
|
154
|
+
// actions)? This no longer gates the SCROLL decision (that is now the explicit
|
|
155
|
+
// `scrollable` prop below) — it only opts declarative dialogs into the
|
|
156
|
+
// gorhom-style pan coordination for their internal ScrollView. A declarative
|
|
157
|
+
// dialog overflowing on a small viewport needs the coordinated pan so the body
|
|
158
|
+
// scrolls instead of the drag stealing every vertical gesture; pure-custom
|
|
159
|
+
// children keep the legacy always-active pan.
|
|
158
160
|
const hasDeclarativeChrome = title !== undefined || description !== undefined || actions !== undefined && actions.length > 0;
|
|
161
|
+
const scrollableResolved = scrollable ?? true;
|
|
162
|
+
const dialogBody = /*#__PURE__*/_jsx(DialogBody, {
|
|
163
|
+
titleId: titleId,
|
|
164
|
+
descriptionId: descriptionId,
|
|
165
|
+
title: title,
|
|
166
|
+
description: description,
|
|
167
|
+
actions: actions,
|
|
168
|
+
children: children
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Nav-header mode: the Dialog OWNS a sticky gradient nav bar + a large
|
|
172
|
+
// collapsing title over the sheet's OWN scroll content. The bar floats via the
|
|
173
|
+
// BottomSheet `headerOverlay` slot; the sheet's scroll offset feeds the shared
|
|
174
|
+
// controller (`scrollY`) that drives the small-title cross-fade. `contentPadding`
|
|
175
|
+
// is dropped (the large title + screens own their padding).
|
|
176
|
+
const headerBody = header ? scrollableResolved ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
177
|
+
children: [/*#__PURE__*/_jsx(DialogLargeTitle, {
|
|
178
|
+
controller: headerController,
|
|
179
|
+
header: header
|
|
180
|
+
}), /*#__PURE__*/_jsx(DialogHeaderProvider, {
|
|
181
|
+
controller: headerController,
|
|
182
|
+
children: dialogBody
|
|
183
|
+
})]
|
|
184
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
185
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
186
|
+
style: {
|
|
187
|
+
height: DIALOG_NAV_BAR_HEIGHT
|
|
188
|
+
}
|
|
189
|
+
}), /*#__PURE__*/_jsx(DialogHeaderProvider, {
|
|
190
|
+
controller: headerController,
|
|
191
|
+
children: dialogBody
|
|
192
|
+
})]
|
|
193
|
+
}) : null;
|
|
159
194
|
return /*#__PURE__*/_jsx(BottomSheet, {
|
|
160
|
-
ref: ref
|
|
195
|
+
ref: ref
|
|
196
|
+
// Seed the sheet's open state so a fresh mount that should be open renders
|
|
197
|
+
// visible on its FIRST commit instead of relying on a present()-in-effect
|
|
198
|
+
// that races the mount and flashes blank. In controlled mode that seed is
|
|
199
|
+
// `controlledOpen`; in imperative mode it is the surface's `startOpen`
|
|
200
|
+
// intent — which is what lets a responsive Dialog survive a resize
|
|
201
|
+
// placement swap (centered card → bottom sheet) STILL OPEN.
|
|
202
|
+
,
|
|
203
|
+
open: isControlled ? controlledOpen : startOpen,
|
|
161
204
|
onDismiss: handleDismiss,
|
|
162
205
|
onDismissAttempt: onDismissAttempt,
|
|
163
|
-
enablePanDownToClose: true
|
|
164
|
-
|
|
165
|
-
//
|
|
166
|
-
// ScrollView so there is exactly ONE scroll container (no scroll-in-scroll).
|
|
206
|
+
enablePanDownToClose: true
|
|
207
|
+
// Nav-header mode hides the drag handle (the nav bar sits at the very top);
|
|
208
|
+
// drag-to-dismiss still works via the coordinated body pan.
|
|
167
209
|
,
|
|
168
|
-
|
|
169
|
-
//
|
|
170
|
-
//
|
|
210
|
+
showHandle: header ? false : showHandle
|
|
211
|
+
// Content scrolls inside the sheet's internal ScrollView by default; the
|
|
212
|
+
// Dialog owns the scroll boundary. A surface whose content owns its own
|
|
213
|
+
// scroller (a FlatList / VirtualizedList) passes `scrollable={false}` to
|
|
214
|
+
// opt OUT so there is exactly ONE scroll container (no scroll-in-scroll,
|
|
215
|
+
// no "VirtualizedList inside a plain ScrollView" warning).
|
|
216
|
+
,
|
|
217
|
+
scrollable: scrollableResolved
|
|
218
|
+
// Declarative dialogs (title/description/actions) that overflow — AND every
|
|
219
|
+
// nav-header page (its scroll content overflows by design) — need
|
|
171
220
|
// gorhom-style pan coordination: the drag-to-dismiss pan only activates
|
|
172
221
|
// when the ScrollView is at the top AND the finger moves down >8dp —
|
|
173
222
|
// otherwise the ScrollView owns the touch. Without this the always-active
|
|
174
223
|
// legacy body-pan steals vertical drags and a tall body cannot scroll
|
|
175
224
|
// (dragging up dismisses the sheet / bleeds into the parent instead). The
|
|
176
225
|
// standalone `BottomSheet` API keeps its legacy `manualActivation={false}`
|
|
177
|
-
// default, so direct consumers are unaffected.
|
|
178
|
-
|
|
226
|
+
// default, so direct consumers are unaffected.
|
|
227
|
+
,
|
|
228
|
+
manualActivation: header ? scrollableResolved : hasDeclarativeChrome
|
|
229
|
+
// Feed the sheet's scroll offset into the nav header's collapse controller.
|
|
230
|
+
,
|
|
231
|
+
scrollY: header ? headerController.scrollY : undefined
|
|
232
|
+
// Float the sticky nav bar over the scroll body (clipped to the sheet top).
|
|
179
233
|
,
|
|
180
|
-
|
|
234
|
+
headerOverlay: header ? /*#__PURE__*/_jsx(DialogNavHeader, {
|
|
235
|
+
controller: headerController,
|
|
236
|
+
header: header,
|
|
237
|
+
onDismiss: close,
|
|
238
|
+
collapse: scrollableResolved
|
|
239
|
+
}) : undefined
|
|
181
240
|
// Stronger dim than a lone sheet so an underlying sheet's handle/content
|
|
182
241
|
// doesn't bleed through when a Dialog is stacked over one.
|
|
183
242
|
,
|
|
@@ -196,20 +255,16 @@ export function DialogBottomSheet({
|
|
|
196
255
|
...(panelClassName ? {
|
|
197
256
|
className: panelClassName
|
|
198
257
|
} : {}),
|
|
199
|
-
style: [
|
|
258
|
+
style: [
|
|
259
|
+
// Nav-header mode: the large title + screens own their padding, so the
|
|
260
|
+
// wrapper adds none. Otherwise the Dialog's uniform content padding.
|
|
261
|
+
header ? null : {
|
|
200
262
|
padding: contentPadding
|
|
201
263
|
},
|
|
202
264
|
// `containerStyle` carries the host's CSS-var theme scope; it wraps
|
|
203
265
|
// the content subtree so descendants read the scoped palette.
|
|
204
266
|
containerStyle, style, panelStyle],
|
|
205
|
-
children:
|
|
206
|
-
titleId: titleId,
|
|
207
|
-
descriptionId: descriptionId,
|
|
208
|
-
title: title,
|
|
209
|
-
description: description,
|
|
210
|
-
actions: actions,
|
|
211
|
-
children: children
|
|
212
|
-
})
|
|
267
|
+
children: header ? headerBody : dialogBody
|
|
213
268
|
})
|
|
214
269
|
})
|
|
215
270
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useId","useImperativeHandle","useMemo","useRef","View","BottomSheet","useTheme","Context","DialogBody","DEFAULT_DIALOG_CONTENT_PADDING","DEFAULT_MAX_HEIGHT_RATIO","PANEL_RADIUS","SHEET_BACKDROP_OPACITY","jsx","_jsx","DialogBottomSheet","control","open","controlledOpen","onClose","testID","title","description","actions","maxHeightRatio","showHandle","dismissOnBackdrop","contentPadding","style","panelStyle","panelClassName","containerStyle","containerClassName","label","children","isControlled","undefined","theme","ref","closeCallbacks","titleId","descriptionId","isControlledRef","current","onCloseRef","callQueuedCallbacks","queued","cb","e","console","error","present","close","push","dismiss","handleDismiss","context","isWithinDialog","onDismissAttempt","sheetStyle","maxHeightPercent","Math","round","backgroundColor","colors","background","borderTopLeftRadius","borderTopRightRadius","maxHeight","hasDeclarativeChrome","length","onDismiss","enablePanDownToClose","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useId","useImperativeHandle","useMemo","useRef","View","BottomSheet","useTheme","Context","DialogBody","DIALOG_NAV_BAR_HEIGHT","DialogHeaderProvider","DialogLargeTitle","DialogNavHeader","useDialogHeaderController","DEFAULT_DIALOG_CONTENT_PADDING","DEFAULT_MAX_HEIGHT_RATIO","PANEL_RADIUS","SHEET_BACKDROP_OPACITY","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DialogBottomSheet","control","open","controlledOpen","startOpen","onClose","testID","title","description","actions","header","maxHeightRatio","showHandle","dismissOnBackdrop","contentPadding","scrollable","style","panelStyle","panelClassName","containerStyle","containerClassName","label","children","isControlled","undefined","theme","ref","closeCallbacks","titleId","descriptionId","headerController","isControlledRef","current","onCloseRef","callQueuedCallbacks","queued","cb","e","console","error","present","close","push","dismiss","handleDismiss","context","isWithinDialog","onDismissAttempt","sheetStyle","maxHeightPercent","Math","round","backgroundColor","colors","background","borderTopLeftRadius","borderTopRightRadius","maxHeight","hasDeclarativeChrome","length","scrollableResolved","dialogBody","headerBody","controller","height","onDismiss","enablePanDownToClose","manualActivation","scrollY","headerOverlay","collapse","backdropOpacity","Provider","value","accessibilityLabel","className","padding"],"sourceRoot":"../../../src","sources":["dialog/DialogBottomSheet.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,SAASC,IAAI,QAAwC,cAAc;AAEnE,SAASC,WAAW,QAA6B,iBAAiB;AAClE,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,UAAU,QAAQ,oBAAiB;AAC5C,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,yBAAyB,QACpB,mBAAgB;AACvB,SACEC,8BAA8B,EAC9BC,wBAAwB,EACxBC,YAAY,EACZC,sBAAsB,QACjB,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EA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aAAa,EACX3D,MAAM,gBACJf,IAAA,CAACP,eAAe;MACd2E,UAAU,EAAEjC,gBAAiB;MAC7BpB,MAAM,EAAEA,MAAO;MACfuD,SAAS,EAAExB,KAAM;MACjB6B,QAAQ,EAAEV;IAAmB,CAC9B,CAAC,GACApC;IAEN;IACA;IAAA;IACA+C,eAAe,EAAE9E,sBAAsB,GAAG,GAAI;IAC9CuB,KAAK,EAAEgC,UAAW;IAAA1B,QAAA,eAElB3B,IAAA,CAACZ,OAAO,CAACyF,QAAQ;MAACC,KAAK,EAAE5B,OAAQ;MAAAvB,QAAA,eAC/B3B,IAAA,CAACf,IAAI;QACH0B,MAAM,EAAEA,MAAO;QACfoE,kBAAkB,EAAErD,KAAM;QAC1B,mBAAiBd,KAAK,GAAGqB,OAAO,GAAGJ,SAAU;QAC7C,oBAAkBhB,WAAW,GAAGqB,aAAa,GAAGL,SAAU;QAAA,IACrDJ,kBAAkB,GAAI;UAAEuD,SAAS,EAAEvD;QAAmB,CAAC,GAA8B,CAAC,CAAC;QAAA,IACvFF,cAAc,GAAI;UAAEyD,SAAS,EAAEzD;QAAe,CAAC,GAA8B,CAAC,CAAC;QACpFF,KAAK,EAAE;QACL;QACA;QACAN,MAAM,GAAG,IAAI,GAAG;UAAEkE,OAAO,EAAE9D;QAAe,CAAC;QAC3C;QACA;QACAK,cAAc,EACdH,KAAK,EACLC,UAAU,CACV;QAAAK,QAAA,EAEDZ,MAAM,GAAGoD,UAAU,GAAGD;MAAU,CAC7B;IAAC,CACS;EAAC,CACR,CAAC;AAElB;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { createContext, memo, useContext, useLayoutEffect, useMemo, useSyncExternalStore } from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import Animated, { Extrapolation, interpolate, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
6
|
+
import { ChevronLeft_Stroke2_Corner0_Rounded, TimesLarge_Stroke2_Corner0_Rounded } from "../icons/index.js";
|
|
7
|
+
import { FrostedIconButton } from '../frosted-icon-button';
|
|
8
|
+
import { useTheme } from "../theme/use-theme.js";
|
|
9
|
+
import { H1, Text } from "../typography/index.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Dialog-owned navigation header (iOS large-title collapse).
|
|
13
|
+
//
|
|
14
|
+
// This is a DISTINCT surface mode from the declarative
|
|
15
|
+
// `title`/`description`/`actions` centered-heading path: it turns the Dialog
|
|
16
|
+
// into a scrolling page with a sticky, gradient top bar (left + right slots)
|
|
17
|
+
// and a large collapsing title that lives in the Dialog's OWN scroll content.
|
|
18
|
+
// As the large title scrolls under the bar, a small title cross-fades into the
|
|
19
|
+
// bar center.
|
|
20
|
+
//
|
|
21
|
+
// Screens render NO header of their own — they declare their title/subtitle
|
|
22
|
+
// (via the surface registry) or contribute runtime slots (a Save action, a
|
|
23
|
+
// dynamic title) through {@link useDialogHeader}.
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
/** Interactive nav-bar row height (px). Buttons + collapsed title live here. */
|
|
27
|
+
export const DIALOG_NAV_BAR_HEIGHT = 52;
|
|
28
|
+
|
|
29
|
+
/** Extra gradient tail (px) below the bar, over which scrolled content fades. */
|
|
30
|
+
const GRADIENT_FADE = 20;
|
|
31
|
+
|
|
32
|
+
/** Total gradient overlay height (bar + fade tail). */
|
|
33
|
+
export const DIALOG_HEADER_OVERLAY_HEIGHT = DIALOG_NAV_BAR_HEIGHT + GRADIENT_FADE;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Top inset applied to the Dialog's scroll content so the large title starts
|
|
37
|
+
* BELOW the whole gradient overlay (fully clear at rest, then scrolls under it).
|
|
38
|
+
*/
|
|
39
|
+
export const DIALOG_HEADER_CONTENT_TOP = DIALOG_HEADER_OVERLAY_HEIGHT;
|
|
40
|
+
|
|
41
|
+
/** Horizontal gutter — matches the `screen-margin` (20px) SDK screens use. */
|
|
42
|
+
const HEADER_H_PADDING = 20;
|
|
43
|
+
|
|
44
|
+
/** Circular icon-button diameter for the default back / close affordances. */
|
|
45
|
+
const NAV_BUTTON_SIZE = 36;
|
|
46
|
+
|
|
47
|
+
// --- Runtime override store (child screen → nav bar / large title) ----------
|
|
48
|
+
//
|
|
49
|
+
// The nav bar overlay and the in-content large title live in DIFFERENT subtrees
|
|
50
|
+
// (the bar is a sibling ABOVE the scroller; the large title + the screen are
|
|
51
|
+
// inside it), so a plain React ancestor context cannot bridge a screen's runtime
|
|
52
|
+
// contribution up to the bar. We use a tiny external store instead: the screen
|
|
53
|
+
// writes its override through {@link useDialogHeader}; the bar and large title
|
|
54
|
+
// read it via `useSyncExternalStore`. Only those two re-render — never the
|
|
55
|
+
// screen subtree — and there is no shared-ancestor constraint.
|
|
56
|
+
|
|
57
|
+
function configsEqual(a, b) {
|
|
58
|
+
if (a === b) return true;
|
|
59
|
+
if (!a || !b) return false;
|
|
60
|
+
return a.title === b.title && a.subtitle === b.subtitle && a.largeTitle === b.largeTitle && a.left === b.left && a.right === b.right && a.onBack === b.onBack && a.showClose === b.showClose;
|
|
61
|
+
}
|
|
62
|
+
function createHeaderStore() {
|
|
63
|
+
let override = null;
|
|
64
|
+
const listeners = new Set();
|
|
65
|
+
return {
|
|
66
|
+
getSnapshot: () => override,
|
|
67
|
+
setOverride: next => {
|
|
68
|
+
if (configsEqual(override, next)) return;
|
|
69
|
+
override = next;
|
|
70
|
+
for (const l of listeners) l();
|
|
71
|
+
},
|
|
72
|
+
subscribe: listener => {
|
|
73
|
+
listeners.add(listener);
|
|
74
|
+
return () => listeners.delete(listener);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The per-surface header controller — the scroll offset + measured large-title
|
|
81
|
+
* height shared values plus the runtime-override store. Created once per Dialog
|
|
82
|
+
* (via {@link useDialogHeaderController}) and threaded into the scroller (writes
|
|
83
|
+
* `scrollY`), the nav bar, the large title, and the child provider.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
/** Create the header controller for one Dialog. Stable for the Dialog's life. */
|
|
87
|
+
export function useDialogHeaderController() {
|
|
88
|
+
const scrollY = useSharedValue(0);
|
|
89
|
+
const largeTitleHeight = useSharedValue(0);
|
|
90
|
+
const store = useMemo(() => createHeaderStore(), []);
|
|
91
|
+
return useMemo(() => ({
|
|
92
|
+
scrollY,
|
|
93
|
+
largeTitleHeight,
|
|
94
|
+
store
|
|
95
|
+
}), [scrollY, largeTitleHeight, store]);
|
|
96
|
+
}
|
|
97
|
+
const DialogHeaderContext = /*#__PURE__*/createContext(null);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Wraps the Dialog's scroll content so a mounted screen can contribute header
|
|
101
|
+
* slots via {@link useDialogHeader}. Only the child subtree needs this — the nav
|
|
102
|
+
* bar and large title read the same controller directly.
|
|
103
|
+
*/
|
|
104
|
+
export function DialogHeaderProvider({
|
|
105
|
+
controller,
|
|
106
|
+
children
|
|
107
|
+
}) {
|
|
108
|
+
return /*#__PURE__*/_jsx(DialogHeaderContext.Provider, {
|
|
109
|
+
value: controller,
|
|
110
|
+
children: children
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Contribute header content from within a Dialog surface — a dynamic title, a
|
|
116
|
+
* Save action, custom slots. Merges over the surface's static (registry) header
|
|
117
|
+
* config; unmounting clears the contribution. Slot nodes (`left`/`right`) MUST
|
|
118
|
+
* be referentially stable (memoize them) so the effect does not thrash.
|
|
119
|
+
*
|
|
120
|
+
* No-op outside a header-mode Dialog (e.g. a confirm dialog), so a screen can
|
|
121
|
+
* call it unconditionally.
|
|
122
|
+
*/
|
|
123
|
+
export function useDialogHeader(config) {
|
|
124
|
+
const controller = useContext(DialogHeaderContext);
|
|
125
|
+
const store = controller?.store;
|
|
126
|
+
// Set synchronously in the commit's layout phase so the bar/title fill in
|
|
127
|
+
// BEFORE the browser paints — no first-frame flash of an empty bar.
|
|
128
|
+
useLayoutEffect(() => {
|
|
129
|
+
if (!store) return;
|
|
130
|
+
store.setOverride(config ?? null);
|
|
131
|
+
return () => store.setOverride(null);
|
|
132
|
+
// Slot nodes are compared by identity; callers memoize them.
|
|
133
|
+
}, [store, config?.title, config?.subtitle, config?.largeTitle, config?.left, config?.right, config?.onBack, config?.showClose]);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Read the merged (base + runtime-override) header config, reactively. */
|
|
137
|
+
function useMergedHeaderConfig(base, store) {
|
|
138
|
+
const override = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
139
|
+
return useMemo(() => override ? {
|
|
140
|
+
...base,
|
|
141
|
+
...override
|
|
142
|
+
} : base, [base, override]);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// --- Nav bar overlay --------------------------------------------------------
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The sticky nav bar: gradient background + left / center (collapsing title) /
|
|
149
|
+
* right slots. Absolutely positioned at the top of the Dialog surface, painted
|
|
150
|
+
* ABOVE the scroll content. Reads the scroll offset to cross-fade the small
|
|
151
|
+
* title in as the large title scrolls under it.
|
|
152
|
+
*
|
|
153
|
+
* `onDismiss` is the Dialog's own close (the default right-slot close button
|
|
154
|
+
* calls it) — passed explicitly rather than read from the dialog context because
|
|
155
|
+
* the bar is rendered as a sibling of the scroller, outside that context on the
|
|
156
|
+
* bottom-sheet path.
|
|
157
|
+
*/
|
|
158
|
+
export const DialogNavHeader = /*#__PURE__*/memo(function DialogNavHeader({
|
|
159
|
+
controller,
|
|
160
|
+
header,
|
|
161
|
+
onDismiss,
|
|
162
|
+
collapse = true,
|
|
163
|
+
style
|
|
164
|
+
}) {
|
|
165
|
+
const theme = useTheme();
|
|
166
|
+
const config = useMergedHeaderConfig(header, controller.store);
|
|
167
|
+
const {
|
|
168
|
+
scrollY,
|
|
169
|
+
largeTitleHeight
|
|
170
|
+
} = controller;
|
|
171
|
+
const hasLargeTitle = collapse && (config.largeTitle ?? true) && !!config.title;
|
|
172
|
+
const titleStyle = useAnimatedStyle(() => {
|
|
173
|
+
// When there is no large title to collapse under, the bar title is always
|
|
174
|
+
// shown (a plain, non-collapsing nav bar). Otherwise it cross-fades in as the
|
|
175
|
+
// large title scrolls up under the bar.
|
|
176
|
+
if (!hasLargeTitle) return {
|
|
177
|
+
opacity: 1,
|
|
178
|
+
transform: [{
|
|
179
|
+
translateY: 0
|
|
180
|
+
}]
|
|
181
|
+
};
|
|
182
|
+
const threshold = largeTitleHeight.value > 0 ? largeTitleHeight.value : 44;
|
|
183
|
+
const start = threshold * 0.35;
|
|
184
|
+
const end = threshold * 0.9;
|
|
185
|
+
return {
|
|
186
|
+
opacity: interpolate(scrollY.value, [start, end], [0, 1], Extrapolation.CLAMP),
|
|
187
|
+
transform: [{
|
|
188
|
+
translateY: interpolate(scrollY.value, [start, end], [10, 0], Extrapolation.CLAMP)
|
|
189
|
+
}]
|
|
190
|
+
};
|
|
191
|
+
// Reanimated on RN-Web has no worklets plugin: every shared value the mapper
|
|
192
|
+
// reads MUST be in the deps array or it freezes on the first frame.
|
|
193
|
+
}, [scrollY, largeTitleHeight, hasLargeTitle]);
|
|
194
|
+
const left = config.left ?? (config.onBack ? /*#__PURE__*/_jsx(FrostedIconButton, {
|
|
195
|
+
onPress: config.onBack,
|
|
196
|
+
accessibilityLabel: "Go back",
|
|
197
|
+
icon: /*#__PURE__*/_jsx(ChevronLeft_Stroke2_Corner0_Rounded, {
|
|
198
|
+
size: "md"
|
|
199
|
+
})
|
|
200
|
+
}) : null);
|
|
201
|
+
const right = config.right ?? (config.showClose !== false ? /*#__PURE__*/_jsx(FrostedIconButton, {
|
|
202
|
+
onPress: onDismiss,
|
|
203
|
+
accessibilityLabel: "Close",
|
|
204
|
+
icon: /*#__PURE__*/_jsx(TimesLarge_Stroke2_Corner0_Rounded, {
|
|
205
|
+
size: "md"
|
|
206
|
+
})
|
|
207
|
+
}) : null);
|
|
208
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
209
|
+
pointerEvents: "box-none",
|
|
210
|
+
style: [styles.overlay, style],
|
|
211
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
212
|
+
pointerEvents: "none",
|
|
213
|
+
className: "bg-gradient-to-b from-bg to-transparent",
|
|
214
|
+
style: [StyleSheet.absoluteFill, {
|
|
215
|
+
height: DIALOG_HEADER_OVERLAY_HEIGHT
|
|
216
|
+
}]
|
|
217
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
218
|
+
pointerEvents: "box-none",
|
|
219
|
+
style: styles.navRow,
|
|
220
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
221
|
+
style: styles.side,
|
|
222
|
+
children: left
|
|
223
|
+
}), /*#__PURE__*/_jsxs(Animated.View, {
|
|
224
|
+
pointerEvents: "none",
|
|
225
|
+
testID: "dialog-nav-title",
|
|
226
|
+
style: [styles.centerTitle, titleStyle],
|
|
227
|
+
children: [config.title ? /*#__PURE__*/_jsx(Text, {
|
|
228
|
+
numberOfLines: 1,
|
|
229
|
+
style: [styles.smallTitle, {
|
|
230
|
+
color: theme.colors.text
|
|
231
|
+
}],
|
|
232
|
+
children: config.title
|
|
233
|
+
}) : null, !hasLargeTitle && config.subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
234
|
+
numberOfLines: 1,
|
|
235
|
+
style: [styles.smallSubtitle, {
|
|
236
|
+
color: theme.colors.textSecondary
|
|
237
|
+
}],
|
|
238
|
+
children: config.subtitle
|
|
239
|
+
}) : null]
|
|
240
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
241
|
+
style: [styles.side, styles.sideRight],
|
|
242
|
+
children: right
|
|
243
|
+
})]
|
|
244
|
+
})]
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
// --- In-content large title -------------------------------------------------
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The large collapsing title, rendered at the TOP of the Dialog's scroll content
|
|
252
|
+
* (before the screen body). Owns the content top inset (so the title starts
|
|
253
|
+
* below the gradient overlay) and measures its own text height into the
|
|
254
|
+
* controller so the nav bar knows when to cross-fade the small title in.
|
|
255
|
+
*/
|
|
256
|
+
export const DialogLargeTitle = /*#__PURE__*/memo(function DialogLargeTitle({
|
|
257
|
+
controller,
|
|
258
|
+
header
|
|
259
|
+
}) {
|
|
260
|
+
const theme = useTheme();
|
|
261
|
+
const config = useMergedHeaderConfig(header, controller.store);
|
|
262
|
+
const {
|
|
263
|
+
largeTitleHeight
|
|
264
|
+
} = controller;
|
|
265
|
+
const hasLargeTitle = (config.largeTitle ?? true) && !!config.title;
|
|
266
|
+
const onLayout = e => {
|
|
267
|
+
largeTitleHeight.value = e.nativeEvent.layout.height;
|
|
268
|
+
};
|
|
269
|
+
if (!hasLargeTitle) {
|
|
270
|
+
// No large title: just inset the content below the nav bar.
|
|
271
|
+
return /*#__PURE__*/_jsx(View, {
|
|
272
|
+
style: {
|
|
273
|
+
height: DIALOG_NAV_BAR_HEIGHT
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
278
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
279
|
+
style: {
|
|
280
|
+
height: DIALOG_HEADER_CONTENT_TOP
|
|
281
|
+
}
|
|
282
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
283
|
+
onLayout: onLayout,
|
|
284
|
+
testID: "dialog-large-title",
|
|
285
|
+
style: styles.largeTitleBlock,
|
|
286
|
+
children: [/*#__PURE__*/_jsx(H1, {
|
|
287
|
+
style: [styles.largeTitle, {
|
|
288
|
+
color: theme.colors.text
|
|
289
|
+
}],
|
|
290
|
+
children: config.title
|
|
291
|
+
}), config.subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
292
|
+
style: [styles.largeSubtitle, {
|
|
293
|
+
color: theme.colors.textSecondary
|
|
294
|
+
}],
|
|
295
|
+
children: config.subtitle
|
|
296
|
+
}) : null]
|
|
297
|
+
})]
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
const styles = StyleSheet.create({
|
|
301
|
+
overlay: {
|
|
302
|
+
position: 'absolute',
|
|
303
|
+
top: 0,
|
|
304
|
+
left: 0,
|
|
305
|
+
right: 0,
|
|
306
|
+
height: DIALOG_HEADER_OVERLAY_HEIGHT,
|
|
307
|
+
zIndex: 10
|
|
308
|
+
},
|
|
309
|
+
navRow: {
|
|
310
|
+
height: DIALOG_NAV_BAR_HEIGHT,
|
|
311
|
+
flexDirection: 'row',
|
|
312
|
+
alignItems: 'center',
|
|
313
|
+
paddingHorizontal: HEADER_H_PADDING - 4
|
|
314
|
+
},
|
|
315
|
+
side: {
|
|
316
|
+
minWidth: NAV_BUTTON_SIZE,
|
|
317
|
+
flexDirection: 'row',
|
|
318
|
+
alignItems: 'center'
|
|
319
|
+
},
|
|
320
|
+
sideRight: {
|
|
321
|
+
justifyContent: 'flex-end'
|
|
322
|
+
},
|
|
323
|
+
centerTitle: {
|
|
324
|
+
flex: 1,
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
justifyContent: 'center',
|
|
327
|
+
paddingHorizontal: 8
|
|
328
|
+
},
|
|
329
|
+
smallTitle: {
|
|
330
|
+
fontSize: 16,
|
|
331
|
+
fontWeight: '600',
|
|
332
|
+
letterSpacing: -0.2,
|
|
333
|
+
lineHeight: 20
|
|
334
|
+
},
|
|
335
|
+
smallSubtitle: {
|
|
336
|
+
fontSize: 12,
|
|
337
|
+
fontWeight: '400',
|
|
338
|
+
lineHeight: 14
|
|
339
|
+
},
|
|
340
|
+
largeTitleBlock: {
|
|
341
|
+
paddingHorizontal: HEADER_H_PADDING,
|
|
342
|
+
paddingBottom: 4
|
|
343
|
+
},
|
|
344
|
+
largeTitle: {
|
|
345
|
+
fontSize: 32,
|
|
346
|
+
lineHeight: 38,
|
|
347
|
+
letterSpacing: -0.5,
|
|
348
|
+
fontWeight: '700'
|
|
349
|
+
},
|
|
350
|
+
largeSubtitle: {
|
|
351
|
+
fontSize: 16,
|
|
352
|
+
lineHeight: 22,
|
|
353
|
+
marginTop: 4
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
//# sourceMappingURL=DialogHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","memo","useContext","useLayoutEffect","useMemo","useSyncExternalStore","StyleSheet","View","Animated","Extrapolation","interpolate","useAnimatedStyle","useSharedValue","ChevronLeft_Stroke2_Corner0_Rounded","TimesLarge_Stroke2_Corner0_Rounded","FrostedIconButton","useTheme","H1","Text","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DIALOG_NAV_BAR_HEIGHT","GRADIENT_FADE","DIALOG_HEADER_OVERLAY_HEIGHT","DIALOG_HEADER_CONTENT_TOP","HEADER_H_PADDING","NAV_BUTTON_SIZE","configsEqual","a","b","title","subtitle","largeTitle","left","right","onBack","showClose","createHeaderStore","override","listeners","Set","getSnapshot","setOverride","next","l","subscribe","listener","add","delete","useDialogHeaderController","scrollY","largeTitleHeight","store","DialogHeaderContext","DialogHeaderProvider","controller","children","Provider","value","useDialogHeader","config","useMergedHeaderConfig","base","DialogNavHeader","header","onDismiss","collapse","style","theme","hasLargeTitle","titleStyle","opacity","transform","translateY","threshold","start","end","CLAMP","onPress","accessibilityLabel","icon","size","pointerEvents","styles","overlay","className","absoluteFill","height","navRow","side","testID","centerTitle","numberOfLines","smallTitle","color","colors","text","smallSubtitle","textSecondary","sideRight","DialogLargeTitle","onLayout","e","nativeEvent","layout","largeTitleBlock","largeSubtitle","create","position","top","zIndex","flexDirection","alignItems","paddingHorizontal","minWidth","justifyContent","flex","fontSize","fontWeight","letterSpacing","lineHeight","paddingBottom","marginTop"],"sour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|
|
|
4
4
|
export { BloomDialogProvider } from './BloomDialogProvider';
|
|
5
5
|
export { alert } from "./alert.js";
|
|
6
6
|
export { useDialogContext, useDialogControl } from "./context.js";
|
|
7
|
+
export { useDialogHeader } from "./DialogHeader.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl"],"sourceRoot":"../../../src","sources":["dialog/index.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,4BAA4B,QAAQ,UAAU;AAC/D,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,KAAK,QAAQ,YAAS;AAC/B,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","useDialogHeader"],"sourceRoot":"../../../src","sources":["dialog/index.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,4BAA4B,QAAQ,UAAU;AAC/D,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,KAAK,QAAQ,YAAS;AAC/B,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAW;AAC9D,SAASC,eAAe,QAAQ,mBAAgB","ignoreList":[]}
|
|
@@ -14,4 +14,5 @@ export { Dialog, BLOOM_DIALOG_CSS, DIALOG_SHEET_BACKDROP_TESTID } from "./Dialog
|
|
|
14
14
|
export { BloomDialogProvider } from "./BloomDialogProvider.web.js";
|
|
15
15
|
export { alert } from "./alert.js";
|
|
16
16
|
export { useDialogContext, useDialogControl } from "./context.js";
|
|
17
|
+
export { useDialogHeader } from "./DialogHeader.js";
|
|
17
18
|
//# sourceMappingURL=index.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dialog","BLOOM_DIALOG_CSS","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,gBAAgB,EAAEC,4BAA4B,QAAQ,iBAAc;AACrF,SAASC,mBAAmB,QAAQ,8BAA2B;AAC/D,SAASC,KAAK,QAAQ,YAAS;AAC/B,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Dialog","BLOOM_DIALOG_CSS","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","useDialogHeader"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,gBAAgB,EAAEC,4BAA4B,QAAQ,iBAAc;AACrF,SAASC,mBAAmB,QAAQ,8BAA2B;AAC/D,SAASC,KAAK,QAAQ,YAAS;AAC/B,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAW;AAC9D,SAASC,eAAe,QAAQ,mBAAgB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -26,7 +26,12 @@ export { sizes as iconSizes, useCommonSVGProps } from "./icons/common.js";
|
|
|
26
26
|
|
|
27
27
|
// Core components
|
|
28
28
|
export * from './portal';
|
|
29
|
-
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl } from './dialog';
|
|
29
|
+
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, useDialogHeader } from './dialog';
|
|
30
|
+
// Surface stack — the shared, coordinated overlay system. The imperative API is
|
|
31
|
+
// the `surfaces` object (its members would otherwise clash with alert-dialog's
|
|
32
|
+
// `confirm`); the individual functions are also named exports of
|
|
33
|
+
// `@oxyhq/bloom/surfaces`.
|
|
34
|
+
export { surfaces, SurfaceProvider, SurfaceHost, useSurface } from './surfaces';
|
|
30
35
|
export * from './button';
|
|
31
36
|
export { Fab } from './fab';
|
|
32
37
|
export { FrostedIconButton } from './frosted-icon-button';
|
|
@@ -64,7 +69,7 @@ export { AnimatedCheck } from "./animated-check/index.js";
|
|
|
64
69
|
// Form components
|
|
65
70
|
export * from "./text-field/index.js";
|
|
66
71
|
export * from "./segmented-control/index.js";
|
|
67
|
-
export {
|
|
72
|
+
export { Search } from "./search/index.js";
|
|
68
73
|
export { Label } from "./label/index.js";
|
|
69
74
|
export { Field } from "./field/index.js";
|
|
70
75
|
export { InputGroup } from "./input-group/index.js";
|