@oxyhq/bloom 0.46.0 → 0.49.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 +36 -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 +103 -8
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +189 -12
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +111 -31
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +371 -0
- package/lib/commonjs/dialog/DialogHeader.js.map +1 -0
- package/lib/commonjs/dialog/DialogMorph.js +458 -0
- package/lib/commonjs/dialog/DialogMorph.js.map +1 -0
- package/lib/commonjs/dialog/index.js +14 -0
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +14 -0
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/index.js +11 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +11 -4
- 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 +6 -2
- package/lib/commonjs/settings-list/SettingsList.js.map +1 -1
- package/lib/commonjs/surfaces/SurfaceHost.js +23 -9
- package/lib/commonjs/surfaces/SurfaceHost.js.map +1 -1
- 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 +36 -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 +104 -9
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +192 -16
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +113 -33
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +362 -0
- package/lib/module/dialog/DialogHeader.js.map +1 -0
- package/lib/module/dialog/DialogMorph.js +451 -0
- package/lib/module/dialog/DialogMorph.js.map +1 -0
- package/lib/module/dialog/index.js +2 -0
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +2 -0
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -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 +6 -2
- package/lib/module/settings-list/SettingsList.js.map +1 -1
- package/lib/module/surfaces/SurfaceHost.js +23 -9
- package/lib/module/surfaces/SurfaceHost.js.map +1 -1
- 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 +31 -1
- 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/DialogMorph.d.ts +150 -0
- package/lib/typescript/commonjs/dialog/DialogMorph.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/index.d.ts +4 -1
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +4 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +105 -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 +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +3 -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.map +1 -1
- package/lib/typescript/commonjs/surfaces/types.d.ts +26 -1
- package/lib/typescript/commonjs/surfaces/types.d.ts.map +1 -1
- 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 +31 -1
- 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/DialogMorph.d.ts +150 -0
- package/lib/typescript/module/dialog/DialogMorph.d.ts.map +1 -0
- package/lib/typescript/module/dialog/index.d.ts +4 -1
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +4 -1
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +105 -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 +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +3 -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.map +1 -1
- package/lib/typescript/module/surfaces/types.d.ts +26 -1
- package/lib/typescript/module/surfaces/types.d.ts.map +1 -1
- 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 +8 -8
- package/src/__tests__/BottomSheet.test.tsx +47 -0
- package/src/__tests__/DialogBottomSheet.test.tsx +30 -5
- package/src/__tests__/DialogMorph.test.tsx +230 -0
- package/src/bottom-sheet/BottomSheetBase.tsx +72 -11
- package/src/combobox/Combobox.tsx +3 -3
- package/src/command/Command.tsx +3 -3
- package/src/dialog/Dialog.tsx +111 -14
- package/src/dialog/Dialog.web.tsx +186 -25
- package/src/dialog/DialogBottomSheet.tsx +122 -30
- package/src/dialog/DialogHeader.tsx +429 -0
- package/src/dialog/DialogMorph.tsx +576 -0
- package/src/dialog/index.ts +4 -0
- package/src/dialog/index.web.ts +4 -0
- package/src/dialog/types.ts +106 -0
- package/src/index.ts +3 -1
- package/src/index.web.ts +3 -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 +6 -2
- package/src/surfaces/SurfaceHost.tsx +17 -1
- package/src/surfaces/types.ts +26 -1
- 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
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
4
|
+
import { useWindowDimensions, View } from 'react-native';
|
|
5
5
|
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";
|
|
10
|
+
import { DialogMorphContent, useDialogMorph } from "./DialogMorph.js";
|
|
9
11
|
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";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
/**
|
|
12
14
|
* Shared `BottomSheet`-backed surface for the `bottom` placement, used by BOTH
|
|
13
15
|
* `Dialog.tsx` (native) and `Dialog.web.tsx` (web). `BottomSheet` is itself a
|
|
@@ -31,15 +33,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
31
33
|
export function DialogBottomSheet({
|
|
32
34
|
control,
|
|
33
35
|
open: controlledOpen,
|
|
36
|
+
startOpen,
|
|
34
37
|
onClose,
|
|
35
38
|
testID,
|
|
36
39
|
title,
|
|
37
40
|
description,
|
|
38
41
|
actions,
|
|
42
|
+
header,
|
|
39
43
|
maxHeightRatio = DEFAULT_MAX_HEIGHT_RATIO,
|
|
40
44
|
showHandle = true,
|
|
41
45
|
dismissOnBackdrop = true,
|
|
42
46
|
contentPadding = DEFAULT_DIALOG_CONTENT_PADDING,
|
|
47
|
+
scrollable,
|
|
48
|
+
morph,
|
|
43
49
|
style,
|
|
44
50
|
panelStyle,
|
|
45
51
|
panelClassName,
|
|
@@ -50,10 +56,14 @@ export function DialogBottomSheet({
|
|
|
50
56
|
}) {
|
|
51
57
|
const isControlled = controlledOpen !== undefined;
|
|
52
58
|
const theme = useTheme();
|
|
59
|
+
const {
|
|
60
|
+
height: viewportHeight
|
|
61
|
+
} = useWindowDimensions();
|
|
53
62
|
const ref = useRef(null);
|
|
54
63
|
const closeCallbacks = useRef([]);
|
|
55
64
|
const titleId = useId();
|
|
56
65
|
const descriptionId = useId();
|
|
66
|
+
const headerController = useDialogHeaderController();
|
|
57
67
|
|
|
58
68
|
// Read the latest controlled flag / `onClose` inside stable callbacks without
|
|
59
69
|
// re-binding them (the context + imperative handle depend on `close` staying
|
|
@@ -131,6 +141,18 @@ export function DialogBottomSheet({
|
|
|
131
141
|
// from `onDismissAttempt` blocks the BottomSheet's own backdrop/pan dismissal,
|
|
132
142
|
// which is how `dismissOnBackdrop: false` maps onto the single sheet API.
|
|
133
143
|
const onDismissAttempt = useCallback(() => dismissOnBackdrop, [dismissOnBackdrop]);
|
|
144
|
+
const scrollableResolved = scrollable ?? true;
|
|
145
|
+
|
|
146
|
+
// Size morphing across an in-place content swap. The sheet is anchored at the
|
|
147
|
+
// bottom, so animating its height makes it grow/shrink from that edge; its
|
|
148
|
+
// width is fixed by the placement. The sheet's own `maxHeight` (the ratio
|
|
149
|
+
// percentage + the safe-area clamp inside `BottomSheet`) does the exact
|
|
150
|
+
// capping — the viewport is just the bound the reshape may not exceed.
|
|
151
|
+
const morphState = useDialogMorph({
|
|
152
|
+
enabled: morph !== false,
|
|
153
|
+
measurable: scrollableResolved,
|
|
154
|
+
maxHeight: viewportHeight
|
|
155
|
+
});
|
|
134
156
|
|
|
135
157
|
// `panelStyle` paints the sheet surface (e.g. a brand background). It composes
|
|
136
158
|
// AFTER the BottomSheet's internal background so a host palette wins; the
|
|
@@ -142,46 +164,105 @@ export function DialogBottomSheet({
|
|
|
142
164
|
borderTopLeftRadius: PANEL_RADIUS + 4,
|
|
143
165
|
borderTopRightRadius: PANEL_RADIUS + 4,
|
|
144
166
|
maxHeight: maxHeightPercent
|
|
145
|
-
}, panelStyle
|
|
146
|
-
|
|
167
|
+
}, panelStyle,
|
|
168
|
+
// Drives the card's `height` only while a morph is in flight; at rest it
|
|
169
|
+
// resolves to `height: 'auto'` — the sheet's normal content sizing.
|
|
170
|
+
morphState.panelStyle];
|
|
171
|
+
}, [theme.colors.background, maxHeightRatio, panelStyle, morphState.panelStyle]);
|
|
147
172
|
|
|
148
173
|
// 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.
|
|
174
|
+
// actions)? This no longer gates the SCROLL decision (that is now the explicit
|
|
175
|
+
// `scrollable` prop below) — it only opts declarative dialogs into the
|
|
176
|
+
// gorhom-style pan coordination for their internal ScrollView. A declarative
|
|
177
|
+
// dialog overflowing on a small viewport needs the coordinated pan so the body
|
|
178
|
+
// scrolls instead of the drag stealing every vertical gesture; pure-custom
|
|
179
|
+
// children keep the legacy always-active pan.
|
|
158
180
|
const hasDeclarativeChrome = title !== undefined || description !== undefined || actions !== undefined && actions.length > 0;
|
|
181
|
+
const dialogBody = /*#__PURE__*/_jsx(DialogBody, {
|
|
182
|
+
titleId: titleId,
|
|
183
|
+
descriptionId: descriptionId,
|
|
184
|
+
title: title,
|
|
185
|
+
description: description,
|
|
186
|
+
actions: actions,
|
|
187
|
+
children: children
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Nav-header mode: the Dialog OWNS a sticky gradient nav bar + a large
|
|
191
|
+
// collapsing title over the sheet's OWN scroll content. The bar floats via the
|
|
192
|
+
// BottomSheet `headerOverlay` slot; the sheet's scroll offset feeds the shared
|
|
193
|
+
// controller (`scrollY`) that drives the small-title cross-fade. `contentPadding`
|
|
194
|
+
// is dropped (the large title + screens own their padding).
|
|
195
|
+
const headerBody = header ? scrollableResolved ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
196
|
+
children: [/*#__PURE__*/_jsx(DialogLargeTitle, {
|
|
197
|
+
controller: headerController,
|
|
198
|
+
header: header
|
|
199
|
+
}), /*#__PURE__*/_jsx(DialogHeaderProvider, {
|
|
200
|
+
controller: headerController,
|
|
201
|
+
children: dialogBody
|
|
202
|
+
})]
|
|
203
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
204
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
205
|
+
style: {
|
|
206
|
+
height: DIALOG_NAV_BAR_HEIGHT
|
|
207
|
+
}
|
|
208
|
+
}), /*#__PURE__*/_jsx(DialogHeaderProvider, {
|
|
209
|
+
controller: headerController,
|
|
210
|
+
children: dialogBody
|
|
211
|
+
})]
|
|
212
|
+
}) : null;
|
|
159
213
|
return /*#__PURE__*/_jsx(BottomSheet, {
|
|
160
|
-
ref: ref
|
|
214
|
+
ref: ref
|
|
215
|
+
// Seed the sheet's open state so a fresh mount that should be open renders
|
|
216
|
+
// visible on its FIRST commit instead of relying on a present()-in-effect
|
|
217
|
+
// that races the mount and flashes blank. In controlled mode that seed is
|
|
218
|
+
// `controlledOpen`; in imperative mode it is the surface's `startOpen`
|
|
219
|
+
// intent — which is what lets a responsive Dialog survive a resize
|
|
220
|
+
// placement swap (centered card → bottom sheet) STILL OPEN.
|
|
221
|
+
,
|
|
222
|
+
open: isControlled ? controlledOpen : startOpen,
|
|
161
223
|
onDismiss: handleDismiss,
|
|
162
224
|
onDismissAttempt: onDismissAttempt,
|
|
163
|
-
enablePanDownToClose: true
|
|
164
|
-
|
|
165
|
-
//
|
|
166
|
-
|
|
225
|
+
enablePanDownToClose: true
|
|
226
|
+
// Nav-header mode hides the drag handle (the nav bar sits at the very top);
|
|
227
|
+
// drag-to-dismiss still works via the coordinated body pan.
|
|
228
|
+
,
|
|
229
|
+
showHandle: header ? false : showHandle
|
|
230
|
+
// Content scrolls inside the sheet's internal ScrollView by default; the
|
|
231
|
+
// Dialog owns the scroll boundary. A surface whose content owns its own
|
|
232
|
+
// scroller (a FlatList / VirtualizedList) passes `scrollable={false}` to
|
|
233
|
+
// opt OUT so there is exactly ONE scroll container (no scroll-in-scroll,
|
|
234
|
+
// no "VirtualizedList inside a plain ScrollView" warning).
|
|
167
235
|
,
|
|
168
|
-
scrollable:
|
|
169
|
-
// Declarative dialogs (title/description/actions) that overflow
|
|
170
|
-
//
|
|
236
|
+
scrollable: scrollableResolved
|
|
237
|
+
// Declarative dialogs (title/description/actions) that overflow — AND every
|
|
238
|
+
// nav-header page (its scroll content overflows by design) — need
|
|
171
239
|
// gorhom-style pan coordination: the drag-to-dismiss pan only activates
|
|
172
240
|
// when the ScrollView is at the top AND the finger moves down >8dp —
|
|
173
241
|
// otherwise the ScrollView owns the touch. Without this the always-active
|
|
174
242
|
// legacy body-pan steals vertical drags and a tall body cannot scroll
|
|
175
243
|
// (dragging up dismisses the sheet / bleeds into the parent instead). The
|
|
176
244
|
// standalone `BottomSheet` API keeps its legacy `manualActivation={false}`
|
|
177
|
-
// default, so direct consumers are unaffected.
|
|
178
|
-
|
|
245
|
+
// default, so direct consumers are unaffected.
|
|
246
|
+
,
|
|
247
|
+
manualActivation: header ? scrollableResolved : hasDeclarativeChrome
|
|
248
|
+
// Feed the sheet's scroll offset into the nav header's collapse controller.
|
|
179
249
|
,
|
|
180
|
-
|
|
250
|
+
scrollY: header ? headerController.scrollY : undefined
|
|
251
|
+
// Float the sticky nav bar over the scroll body (clipped to the sheet top).
|
|
252
|
+
,
|
|
253
|
+
headerOverlay: header ? /*#__PURE__*/_jsx(DialogNavHeader, {
|
|
254
|
+
controller: headerController,
|
|
255
|
+
header: header,
|
|
256
|
+
onDismiss: close,
|
|
257
|
+
collapse: scrollableResolved
|
|
258
|
+
}) : undefined
|
|
181
259
|
// Stronger dim than a lone sheet so an underlying sheet's handle/content
|
|
182
260
|
// doesn't bleed through when a Dialog is stacked over one.
|
|
183
261
|
,
|
|
184
|
-
backdropOpacity: SHEET_BACKDROP_OPACITY + 0.3
|
|
262
|
+
backdropOpacity: SHEET_BACKDROP_OPACITY + 0.3
|
|
263
|
+
// Measures the sheet card — the size a morph starts from.
|
|
264
|
+
,
|
|
265
|
+
onLayout: morphState.onPanelLayout,
|
|
185
266
|
style: sheetStyle,
|
|
186
267
|
children: /*#__PURE__*/_jsx(Context.Provider, {
|
|
187
268
|
value: context,
|
|
@@ -196,19 +277,18 @@ export function DialogBottomSheet({
|
|
|
196
277
|
...(panelClassName ? {
|
|
197
278
|
className: panelClassName
|
|
198
279
|
} : {}),
|
|
199
|
-
style: [
|
|
280
|
+
style: [
|
|
281
|
+
// Nav-header mode: the large title + screens own their padding, so the
|
|
282
|
+
// wrapper adds none. Otherwise the Dialog's uniform content padding.
|
|
283
|
+
header ? null : {
|
|
200
284
|
padding: contentPadding
|
|
201
285
|
},
|
|
202
286
|
// `containerStyle` carries the host's CSS-var theme scope; it wraps
|
|
203
287
|
// the content subtree so descendants read the scoped palette.
|
|
204
288
|
containerStyle, style, panelStyle],
|
|
205
|
-
children: /*#__PURE__*/_jsx(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
title: title,
|
|
209
|
-
description: description,
|
|
210
|
-
actions: actions,
|
|
211
|
-
children: children
|
|
289
|
+
children: /*#__PURE__*/_jsx(DialogMorphContent, {
|
|
290
|
+
morph: morphState,
|
|
291
|
+
children: header ? headerBody : dialogBody
|
|
212
292
|
})
|
|
213
293
|
})
|
|
214
294
|
})
|
|
@@ -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","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useId","useImperativeHandle","useMemo","useRef","useWindowDimensions","View","BottomSheet","useTheme","Context","DialogBody","DIALOG_NAV_BAR_HEIGHT","DialogHeaderProvider","DialogLargeTitle","DialogNavHeader","useDialogHeaderController","DialogMorphContent","useDialogMorph","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","morph","style","panelStyle","panelClassName","containerStyle","containerClassName","label","children","isControlled","undefined","theme","height","viewportHeight","ref","closeCallbacks","titleId","descriptionId","headerController","isControlledRef","current","onCloseRef","callQueuedCallbacks","queued","cb","e","console","error","present","close","push","dismiss","handleDismiss","context","isWithinDialog","onDismissAttempt","scrollableResolved","morphState","enabled","measurable","maxHeight","sheetStyle","maxHeightPercent","Math","round","backgroundColor","colors","background","borderTopLeftRadius","borderTopRightRadius","hasDeclarativeChrome","length","dialogBody","headerBody","controller","onDismiss","enablePanDownToClose","manualActivation","scrollY","headerOverlay","collapse","backdropOpacity","onLayout","onPanelLayout","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,SACEC,mBAAmB,EACnBC,IAAI,QAGC,cAAc;AAErB,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,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,kBAAe;AAClE,SACEC,8BAA8B,EAC9BC,wBAAwB,EACxBC,YAAY,EACZC,sBAAsB,QACjB,gBAAa;AAAC,SAAAC,GAAA,IAAAC,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,EACLC,UAAU,CACV;QAAAK,QAAA,eAKF5B,IAAA,CAACP,kBAAkB;UAAC4B,KAAK,EAAEoC,UAAW;UAAA7B,QAAA,EACnCb,MAAM,GAAG0D,UAAU,GAAGD;QAAU,CACf;MAAC,CACjB;IAAC,CACS;EAAC,CACR,CAAC;AAElB;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,362 @@
|
|
|
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.titleContent === b.titleContent && 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?.titleContent, 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
|
+
|
|
172
|
+
// A branded `titleContent` owns the bar centre outright: it is always visible,
|
|
173
|
+
// so there is nothing to collapse and no large in-content title to collapse under.
|
|
174
|
+
const hasLargeTitle = collapse && !config.titleContent && (config.largeTitle ?? true) && !!config.title;
|
|
175
|
+
const titleStyle = useAnimatedStyle(() => {
|
|
176
|
+
// When there is no large title to collapse under, the bar title is always
|
|
177
|
+
// shown (a plain, non-collapsing nav bar). Otherwise it cross-fades in as the
|
|
178
|
+
// large title scrolls up under the bar.
|
|
179
|
+
if (!hasLargeTitle) return {
|
|
180
|
+
opacity: 1,
|
|
181
|
+
transform: [{
|
|
182
|
+
translateY: 0
|
|
183
|
+
}]
|
|
184
|
+
};
|
|
185
|
+
const threshold = largeTitleHeight.value > 0 ? largeTitleHeight.value : 44;
|
|
186
|
+
const start = threshold * 0.35;
|
|
187
|
+
const end = threshold * 0.9;
|
|
188
|
+
return {
|
|
189
|
+
opacity: interpolate(scrollY.value, [start, end], [0, 1], Extrapolation.CLAMP),
|
|
190
|
+
transform: [{
|
|
191
|
+
translateY: interpolate(scrollY.value, [start, end], [10, 0], Extrapolation.CLAMP)
|
|
192
|
+
}]
|
|
193
|
+
};
|
|
194
|
+
// Reanimated on RN-Web has no worklets plugin: every shared value the mapper
|
|
195
|
+
// reads MUST be in the deps array or it freezes on the first frame.
|
|
196
|
+
}, [scrollY, largeTitleHeight, hasLargeTitle]);
|
|
197
|
+
const left = config.left ?? (config.onBack ? /*#__PURE__*/_jsx(FrostedIconButton, {
|
|
198
|
+
onPress: config.onBack,
|
|
199
|
+
accessibilityLabel: "Go back",
|
|
200
|
+
icon: /*#__PURE__*/_jsx(ChevronLeft_Stroke2_Corner0_Rounded, {
|
|
201
|
+
size: "md"
|
|
202
|
+
})
|
|
203
|
+
}) : null);
|
|
204
|
+
const right = config.right ?? (config.showClose !== false ? /*#__PURE__*/_jsx(FrostedIconButton, {
|
|
205
|
+
onPress: onDismiss,
|
|
206
|
+
accessibilityLabel: "Close",
|
|
207
|
+
icon: /*#__PURE__*/_jsx(TimesLarge_Stroke2_Corner0_Rounded, {
|
|
208
|
+
size: "md"
|
|
209
|
+
})
|
|
210
|
+
}) : null);
|
|
211
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
212
|
+
pointerEvents: "box-none",
|
|
213
|
+
style: [styles.overlay, style],
|
|
214
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
215
|
+
pointerEvents: "none",
|
|
216
|
+
className: "bg-gradient-to-b from-bg to-transparent",
|
|
217
|
+
style: [StyleSheet.absoluteFill, {
|
|
218
|
+
height: DIALOG_HEADER_OVERLAY_HEIGHT
|
|
219
|
+
}]
|
|
220
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
221
|
+
pointerEvents: "box-none",
|
|
222
|
+
style: styles.navRow,
|
|
223
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
224
|
+
style: styles.side,
|
|
225
|
+
children: left
|
|
226
|
+
}), /*#__PURE__*/_jsxs(Animated.View, {
|
|
227
|
+
pointerEvents: "none",
|
|
228
|
+
testID: "dialog-nav-title",
|
|
229
|
+
style: [styles.centerTitle, titleStyle],
|
|
230
|
+
children: [config.titleContent ?? null, !config.titleContent && config.title ? /*#__PURE__*/_jsx(Text, {
|
|
231
|
+
numberOfLines: 1,
|
|
232
|
+
style: [styles.smallTitle, {
|
|
233
|
+
color: theme.colors.text
|
|
234
|
+
}],
|
|
235
|
+
children: config.title
|
|
236
|
+
}) : null, !hasLargeTitle && !config.titleContent && config.subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
237
|
+
numberOfLines: 1,
|
|
238
|
+
style: [styles.smallSubtitle, {
|
|
239
|
+
color: theme.colors.textSecondary
|
|
240
|
+
}],
|
|
241
|
+
children: config.subtitle
|
|
242
|
+
}) : null]
|
|
243
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
244
|
+
style: [styles.side, styles.sideRight],
|
|
245
|
+
children: right
|
|
246
|
+
})]
|
|
247
|
+
})]
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// --- In-content large title -------------------------------------------------
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The large collapsing title, rendered at the TOP of the Dialog's scroll content
|
|
255
|
+
* (before the screen body). Owns the content top inset (so the title starts
|
|
256
|
+
* below the gradient overlay) and measures its own text height into the
|
|
257
|
+
* controller so the nav bar knows when to cross-fade the small title in.
|
|
258
|
+
*/
|
|
259
|
+
export const DialogLargeTitle = /*#__PURE__*/memo(function DialogLargeTitle({
|
|
260
|
+
controller,
|
|
261
|
+
header
|
|
262
|
+
}) {
|
|
263
|
+
const theme = useTheme();
|
|
264
|
+
const config = useMergedHeaderConfig(header, controller.store);
|
|
265
|
+
const {
|
|
266
|
+
largeTitleHeight
|
|
267
|
+
} = controller;
|
|
268
|
+
|
|
269
|
+
// A branded `titleContent` lives in the bar and never collapses, so the
|
|
270
|
+
// surface starts flush under the bar with no large title above it.
|
|
271
|
+
const hasLargeTitle = !config.titleContent && (config.largeTitle ?? true) && !!config.title;
|
|
272
|
+
const onLayout = e => {
|
|
273
|
+
largeTitleHeight.value = e.nativeEvent.layout.height;
|
|
274
|
+
};
|
|
275
|
+
if (!hasLargeTitle) {
|
|
276
|
+
// No large title: just inset the content below the nav bar.
|
|
277
|
+
return /*#__PURE__*/_jsx(View, {
|
|
278
|
+
style: {
|
|
279
|
+
height: DIALOG_NAV_BAR_HEIGHT
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
284
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
285
|
+
style: {
|
|
286
|
+
height: DIALOG_HEADER_CONTENT_TOP
|
|
287
|
+
}
|
|
288
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
289
|
+
onLayout: onLayout,
|
|
290
|
+
testID: "dialog-large-title",
|
|
291
|
+
style: styles.largeTitleBlock,
|
|
292
|
+
children: [/*#__PURE__*/_jsx(H1, {
|
|
293
|
+
style: [styles.largeTitle, {
|
|
294
|
+
color: theme.colors.text
|
|
295
|
+
}],
|
|
296
|
+
children: config.title
|
|
297
|
+
}), config.subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
298
|
+
style: [styles.largeSubtitle, {
|
|
299
|
+
color: theme.colors.textSecondary
|
|
300
|
+
}],
|
|
301
|
+
children: config.subtitle
|
|
302
|
+
}) : null]
|
|
303
|
+
})]
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
const styles = StyleSheet.create({
|
|
307
|
+
overlay: {
|
|
308
|
+
position: 'absolute',
|
|
309
|
+
top: 0,
|
|
310
|
+
left: 0,
|
|
311
|
+
right: 0,
|
|
312
|
+
height: DIALOG_HEADER_OVERLAY_HEIGHT,
|
|
313
|
+
zIndex: 10
|
|
314
|
+
},
|
|
315
|
+
navRow: {
|
|
316
|
+
height: DIALOG_NAV_BAR_HEIGHT,
|
|
317
|
+
flexDirection: 'row',
|
|
318
|
+
alignItems: 'center',
|
|
319
|
+
paddingHorizontal: HEADER_H_PADDING - 4
|
|
320
|
+
},
|
|
321
|
+
side: {
|
|
322
|
+
minWidth: NAV_BUTTON_SIZE,
|
|
323
|
+
flexDirection: 'row',
|
|
324
|
+
alignItems: 'center'
|
|
325
|
+
},
|
|
326
|
+
sideRight: {
|
|
327
|
+
justifyContent: 'flex-end'
|
|
328
|
+
},
|
|
329
|
+
centerTitle: {
|
|
330
|
+
flex: 1,
|
|
331
|
+
alignItems: 'center',
|
|
332
|
+
justifyContent: 'center',
|
|
333
|
+
paddingHorizontal: 8
|
|
334
|
+
},
|
|
335
|
+
smallTitle: {
|
|
336
|
+
fontSize: 16,
|
|
337
|
+
fontWeight: '600',
|
|
338
|
+
letterSpacing: -0.2,
|
|
339
|
+
lineHeight: 20
|
|
340
|
+
},
|
|
341
|
+
smallSubtitle: {
|
|
342
|
+
fontSize: 12,
|
|
343
|
+
fontWeight: '400',
|
|
344
|
+
lineHeight: 14
|
|
345
|
+
},
|
|
346
|
+
largeTitleBlock: {
|
|
347
|
+
paddingHorizontal: HEADER_H_PADDING,
|
|
348
|
+
paddingBottom: 4
|
|
349
|
+
},
|
|
350
|
+
largeTitle: {
|
|
351
|
+
fontSize: 32,
|
|
352
|
+
lineHeight: 38,
|
|
353
|
+
letterSpacing: -0.5,
|
|
354
|
+
fontWeight: '700'
|
|
355
|
+
},
|
|
356
|
+
largeSubtitle: {
|
|
357
|
+
fontSize: 16,
|
|
358
|
+
lineHeight: 22,
|
|
359
|
+
marginTop: 4
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
//# 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","titleContent","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"],"sourceRoot":"../../../src","sources":["dialog/DialogHeader.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,IAAI,EACJC,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,oBAAoB,QACf,OAAO;AACd,SACEC,UAAU,EACVC,IAAI,QAIC,cAAc;AACrB,OAAOC,QAAQ,IACbC,aAAa,EACbC,WAAW,EACXC,gBAAgB,EAChBC,cAAc,QAET,yBAAyB;AAEhC,SACEC,mCAAmC,EACnCC,kCAAkC,QAC7B,mBAAU;AACjB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,EAAE,EAAEC,IAAI,QAAQ,wBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,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