@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
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { BottomSheet } from "../bottom-sheet/index.js";
|
|
6
|
+
import { useTheme } from "../theme/use-theme.js";
|
|
7
|
+
import { Context } from "./context.js";
|
|
8
|
+
import { DialogBody } from "./DialogContent.js";
|
|
9
|
+
import { DEFAULT_MAX_HEIGHT_RATIO, PANEL_RADIUS, SHEET_BACKDROP_OPACITY } from "./placement.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* Padding of the bottom-sheet content container (px). Matches the side-sheet
|
|
13
|
+
* and centered-panel body padding so every placement reads identically.
|
|
14
|
+
*/
|
|
15
|
+
const SHEET_CONTENT_PADDING = 20;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Shared `BottomSheet`-backed surface for the `bottom` placement, used by BOTH
|
|
19
|
+
* `Dialog.tsx` (native) and `Dialog.web.tsx` (web). `BottomSheet` is itself a
|
|
20
|
+
* single cross-platform implementation (react-native-gesture-handler +
|
|
21
|
+
* reanimated, drag-to-dismiss on web and native alike), so routing the bottom
|
|
22
|
+
* placement through here gives ONE code path with drag working everywhere — no
|
|
23
|
+
* duplicated CSS slide-up sheet.
|
|
24
|
+
*
|
|
25
|
+
* This component owns the entire open↔present/dismiss bridge and the Dialog →
|
|
26
|
+
* BottomSheet prop mapping in one place:
|
|
27
|
+
*
|
|
28
|
+
* - `open` (controlled) / `control` (imperative) → `present()` / `dismiss()`
|
|
29
|
+
* - `onClose` → fired once the sheet settles
|
|
30
|
+
* - `maxHeightRatio` → sheet `maxHeight`
|
|
31
|
+
* - `showHandle` / `dismissOnBackdrop` / `label` → forwarded to the surface
|
|
32
|
+
* - `panelStyle` → paints the sheet surface
|
|
33
|
+
* - `containerStyle` → wraps the content subtree
|
|
34
|
+
* so a host's CSS-var theme scope (`vars()`) still applies to descendants
|
|
35
|
+
* - `title` / `description` / `actions` / `children` → declarative body
|
|
36
|
+
*/
|
|
37
|
+
export function DialogBottomSheet({
|
|
38
|
+
control,
|
|
39
|
+
open: controlledOpen,
|
|
40
|
+
onClose,
|
|
41
|
+
testID,
|
|
42
|
+
title,
|
|
43
|
+
description,
|
|
44
|
+
actions,
|
|
45
|
+
maxHeightRatio = DEFAULT_MAX_HEIGHT_RATIO,
|
|
46
|
+
showHandle = true,
|
|
47
|
+
dismissOnBackdrop = true,
|
|
48
|
+
style,
|
|
49
|
+
panelStyle,
|
|
50
|
+
panelClassName,
|
|
51
|
+
containerStyle,
|
|
52
|
+
containerClassName,
|
|
53
|
+
label,
|
|
54
|
+
children
|
|
55
|
+
}) {
|
|
56
|
+
const isControlled = controlledOpen !== undefined;
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
const ref = useRef(null);
|
|
59
|
+
const closeCallbacks = useRef([]);
|
|
60
|
+
const titleId = useId();
|
|
61
|
+
const descriptionId = useId();
|
|
62
|
+
|
|
63
|
+
// Read the latest controlled flag / `onClose` inside stable callbacks without
|
|
64
|
+
// re-binding them (the context + imperative handle depend on `close` staying
|
|
65
|
+
// referentially stable).
|
|
66
|
+
const isControlledRef = useRef(isControlled);
|
|
67
|
+
isControlledRef.current = isControlled;
|
|
68
|
+
const onCloseRef = useRef(onClose);
|
|
69
|
+
onCloseRef.current = onClose;
|
|
70
|
+
|
|
71
|
+
// Drain queued close callbacks atomically — capturing the list and resetting
|
|
72
|
+
// it before invocation ensures a callback that synchronously re-opens the
|
|
73
|
+
// dialog (and queues fresh callbacks) does not see the old ones replayed
|
|
74
|
+
// against the new session.
|
|
75
|
+
const callQueuedCallbacks = useCallback(() => {
|
|
76
|
+
const queued = closeCallbacks.current;
|
|
77
|
+
closeCallbacks.current = [];
|
|
78
|
+
for (const cb of queued) {
|
|
79
|
+
try {
|
|
80
|
+
cb();
|
|
81
|
+
} catch (e) {
|
|
82
|
+
if (typeof console !== 'undefined' && console.error) {
|
|
83
|
+
console.error('Dialog close callback error:', e);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
const open = useCallback(() => {
|
|
89
|
+
ref.current?.present();
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
// A dismissal request (backdrop, pan-to-close, action button). In controlled
|
|
93
|
+
// mode it asks the host to close via `onClose` (the host flips `open`); in
|
|
94
|
+
// imperative mode it dismisses the surface directly. The optional callback
|
|
95
|
+
// runs once the dialog has finished closing.
|
|
96
|
+
const close = useCallback(cb => {
|
|
97
|
+
if (typeof cb === 'function') {
|
|
98
|
+
closeCallbacks.current.push(cb);
|
|
99
|
+
}
|
|
100
|
+
if (isControlledRef.current) {
|
|
101
|
+
onCloseRef.current?.();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
ref.current?.dismiss();
|
|
105
|
+
}, []);
|
|
106
|
+
|
|
107
|
+
// Fired when the sheet has finished closing. Drains queued callbacks, then
|
|
108
|
+
// fires `onClose` ONLY in imperative mode — controlled mode already requested
|
|
109
|
+
// the close through `onClose` (the host then flipped `open`), so firing it
|
|
110
|
+
// again here would double-call it.
|
|
111
|
+
const handleDismiss = useCallback(() => {
|
|
112
|
+
callQueuedCallbacks();
|
|
113
|
+
if (!isControlledRef.current) onCloseRef.current?.();
|
|
114
|
+
}, [callQueuedCallbacks]);
|
|
115
|
+
|
|
116
|
+
// In controlled mode, mirror the `open` prop onto the underlying sheet so both
|
|
117
|
+
// modes share one lifecycle.
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!isControlled) return;
|
|
120
|
+
if (controlledOpen) {
|
|
121
|
+
ref.current?.present();
|
|
122
|
+
} else {
|
|
123
|
+
ref.current?.dismiss();
|
|
124
|
+
}
|
|
125
|
+
}, [isControlled, controlledOpen]);
|
|
126
|
+
useImperativeHandle(control?.ref, () => ({
|
|
127
|
+
open,
|
|
128
|
+
close
|
|
129
|
+
}), [open, close]);
|
|
130
|
+
const context = useMemo(() => ({
|
|
131
|
+
close,
|
|
132
|
+
isWithinDialog: true
|
|
133
|
+
}), [close]);
|
|
134
|
+
|
|
135
|
+
// Backdrop press → dismiss, unless the host disabled it. Returning `false`
|
|
136
|
+
// from `onDismissAttempt` blocks the BottomSheet's own backdrop/pan dismissal,
|
|
137
|
+
// which is how `dismissOnBackdrop: false` maps onto the single sheet API.
|
|
138
|
+
const onDismissAttempt = useCallback(() => dismissOnBackdrop, [dismissOnBackdrop]);
|
|
139
|
+
|
|
140
|
+
// `panelStyle` paints the sheet surface (e.g. a brand background). It composes
|
|
141
|
+
// AFTER the BottomSheet's internal background so a host palette wins; the
|
|
142
|
+
// shape (radius, max height) is supplied here and remains overridable.
|
|
143
|
+
const sheetStyle = useMemo(() => {
|
|
144
|
+
const maxHeightPercent = `${Math.round(maxHeightRatio * 100)}%`;
|
|
145
|
+
return [{
|
|
146
|
+
backgroundColor: theme.colors.background,
|
|
147
|
+
borderTopLeftRadius: PANEL_RADIUS + 4,
|
|
148
|
+
borderTopRightRadius: PANEL_RADIUS + 4,
|
|
149
|
+
maxHeight: maxHeightPercent
|
|
150
|
+
}, panelStyle];
|
|
151
|
+
}, [theme.colors.background, maxHeightRatio, panelStyle]);
|
|
152
|
+
return /*#__PURE__*/_jsx(BottomSheet, {
|
|
153
|
+
ref: ref,
|
|
154
|
+
onDismiss: handleDismiss,
|
|
155
|
+
onDismissAttempt: onDismissAttempt,
|
|
156
|
+
enablePanDownToClose: true,
|
|
157
|
+
showHandle: showHandle
|
|
158
|
+
// Stronger dim than a lone sheet so an underlying sheet's handle/content
|
|
159
|
+
// doesn't bleed through when a Dialog is stacked over one.
|
|
160
|
+
,
|
|
161
|
+
backdropOpacity: SHEET_BACKDROP_OPACITY + 0.3,
|
|
162
|
+
style: sheetStyle,
|
|
163
|
+
children: /*#__PURE__*/_jsx(Context.Provider, {
|
|
164
|
+
value: context,
|
|
165
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
166
|
+
testID: testID,
|
|
167
|
+
accessibilityLabel: label,
|
|
168
|
+
"aria-labelledby": title ? titleId : undefined,
|
|
169
|
+
"aria-describedby": description ? descriptionId : undefined,
|
|
170
|
+
...(containerClassName ? {
|
|
171
|
+
className: containerClassName
|
|
172
|
+
} : {}),
|
|
173
|
+
...(panelClassName ? {
|
|
174
|
+
className: panelClassName
|
|
175
|
+
} : {}),
|
|
176
|
+
style: [{
|
|
177
|
+
padding: SHEET_CONTENT_PADDING
|
|
178
|
+
},
|
|
179
|
+
// `containerStyle` carries the host's CSS-var theme scope; it wraps
|
|
180
|
+
// the content subtree so descendants read the scoped palette.
|
|
181
|
+
containerStyle, style, panelStyle],
|
|
182
|
+
children: /*#__PURE__*/_jsx(DialogBody, {
|
|
183
|
+
titleId: titleId,
|
|
184
|
+
descriptionId: descriptionId,
|
|
185
|
+
title: title,
|
|
186
|
+
description: description,
|
|
187
|
+
actions: actions,
|
|
188
|
+
children: children
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Props the shared bottom-sheet surface consumes — the `bottom`-relevant subset
|
|
197
|
+
* of `DialogProps`. `width`, `maxWidth`, and `inset` are placement-specific to
|
|
198
|
+
* the side/centered surfaces and intentionally excluded.
|
|
199
|
+
*/
|
|
200
|
+
//# sourceMappingURL=DialogBottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useId","useImperativeHandle","useMemo","useRef","View","BottomSheet","useTheme","Context","DialogBody","DEFAULT_MAX_HEIGHT_RATIO","PANEL_RADIUS","SHEET_BACKDROP_OPACITY","jsx","_jsx","SHEET_CONTENT_PADDING","DialogBottomSheet","control","open","controlledOpen","onClose","testID","title","description","actions","maxHeightRatio","showHandle","dismissOnBackdrop","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","onDismiss","enablePanDownToClose","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,0BAAiB;AAClE,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,UAAU,QAAQ,oBAAiB;AAC5C,SACEC,wBAAwB,EACxBC,YAAY,EACZC,sBAAsB,QACjB,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGrB;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,OAAO;EACPC,IAAI,EAAEC,cAAc;EACpBC,O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CACL;UAAEgD,OAAO,EAAE7D;QAAsB,CAAC;QAClC;QACA;QACAgB,cAAc,EACdH,KAAK,EACLC,UAAU,CACV;QAAAK,QAAA,eAEFpB,IAAA,CAACL,UAAU;UACT+B,OAAO,EAAEA,OAAQ;UACjBC,aAAa,EAAEA,aAAc;UAC7BnB,KAAK,EAAEA,KAAM;UACbC,WAAW,EAAEA,WAAY;UACzBC,OAAO,EAAEA,OAAQ;UAAAU,QAAA,EAEhBA;QAAQ,CACC;MAAC,CACT;IAAC,CACS;EAAC,CACR,CAAC;AAElB;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { useTheme } from "../theme/use-theme.js";
|
|
6
|
+
import { useDialogContext } from "./context.js";
|
|
7
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Shared dialog content primitives used by every `<Dialog>` placement on both
|
|
10
|
+
* platforms — the centered panel, the side-sheets, and the `BottomSheet`-backed
|
|
11
|
+
* bottom placement. Keeping them here is the single source of truth for the
|
|
12
|
+
* declarative `title` / `description` / `actions` chrome, so the surfaces never
|
|
13
|
+
* drift in spacing, typography, or action-button behaviour.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Renders the dialog's body: optional declarative title + description, any
|
|
18
|
+
* `children`, then the action row. The `titleId`/`descriptionId` are wired by
|
|
19
|
+
* the caller onto the dialog role element for `aria-labelledby` /
|
|
20
|
+
* `aria-describedby`.
|
|
21
|
+
*/
|
|
22
|
+
export function DialogBody({
|
|
23
|
+
titleId,
|
|
24
|
+
descriptionId,
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
actions,
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
+
children: [title ? /*#__PURE__*/_jsx(Text, {
|
|
33
|
+
nativeID: titleId,
|
|
34
|
+
style: {
|
|
35
|
+
fontSize: 22,
|
|
36
|
+
fontWeight: '600',
|
|
37
|
+
color: theme.colors.text,
|
|
38
|
+
paddingBottom: description ? 4 : 16,
|
|
39
|
+
lineHeight: 30
|
|
40
|
+
},
|
|
41
|
+
children: title
|
|
42
|
+
}) : null, description ? /*#__PURE__*/_jsx(Text, {
|
|
43
|
+
nativeID: descriptionId,
|
|
44
|
+
style: {
|
|
45
|
+
fontSize: 16,
|
|
46
|
+
color: theme.colors.textSecondary,
|
|
47
|
+
paddingBottom: 16,
|
|
48
|
+
lineHeight: 22
|
|
49
|
+
},
|
|
50
|
+
children: description
|
|
51
|
+
}) : null, children, actions && actions.length > 0 ? /*#__PURE__*/_jsx(ActionRow, {
|
|
52
|
+
actions: actions
|
|
53
|
+
}) : null]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function ActionRow({
|
|
57
|
+
actions
|
|
58
|
+
}) {
|
|
59
|
+
return /*#__PURE__*/_jsx(View, {
|
|
60
|
+
style: {
|
|
61
|
+
width: '100%',
|
|
62
|
+
gap: 8,
|
|
63
|
+
justifyContent: 'flex-end'
|
|
64
|
+
},
|
|
65
|
+
children: actions.map((action, idx) => /*#__PURE__*/_jsx(ActionButton, {
|
|
66
|
+
action: action
|
|
67
|
+
}, `${action.label}-${idx}`))
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function ActionButton({
|
|
71
|
+
action
|
|
72
|
+
}) {
|
|
73
|
+
const {
|
|
74
|
+
close
|
|
75
|
+
} = useDialogContext();
|
|
76
|
+
const theme = useTheme();
|
|
77
|
+
const color = action.color ?? 'default';
|
|
78
|
+
const shouldCloseOnPress = action.shouldCloseOnPress ?? true;
|
|
79
|
+
const {
|
|
80
|
+
background,
|
|
81
|
+
foreground
|
|
82
|
+
} = getActionPalette(color, theme.colors);
|
|
83
|
+
const handlePress = useCallback(e => {
|
|
84
|
+
const onPress = action.onPress;
|
|
85
|
+
if (color === 'cancel') {
|
|
86
|
+
// Cancel always dismisses; consumer's onPress (rare) runs after.
|
|
87
|
+
close(onPress ? () => onPress(e) : undefined);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (shouldCloseOnPress) {
|
|
91
|
+
close(onPress ? () => onPress(e) : undefined);
|
|
92
|
+
} else {
|
|
93
|
+
onPress?.(e);
|
|
94
|
+
}
|
|
95
|
+
}, [action.onPress, close, color, shouldCloseOnPress]);
|
|
96
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
97
|
+
style: {
|
|
98
|
+
borderRadius: 9999,
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
backgroundColor: background,
|
|
102
|
+
opacity: action.disabled ? 0.5 : 1,
|
|
103
|
+
paddingVertical: 12,
|
|
104
|
+
paddingHorizontal: 24
|
|
105
|
+
},
|
|
106
|
+
onPress: handlePress,
|
|
107
|
+
disabled: action.disabled,
|
|
108
|
+
activeOpacity: 0.7,
|
|
109
|
+
testID: action.testID,
|
|
110
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
111
|
+
style: {
|
|
112
|
+
fontSize: 16,
|
|
113
|
+
fontWeight: '500',
|
|
114
|
+
color: foreground
|
|
115
|
+
},
|
|
116
|
+
children: action.label
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export function getActionPalette(color, colors) {
|
|
121
|
+
switch (color) {
|
|
122
|
+
case 'destructive':
|
|
123
|
+
return {
|
|
124
|
+
background: colors.negative,
|
|
125
|
+
foreground: colors.negativeForeground
|
|
126
|
+
};
|
|
127
|
+
case 'cancel':
|
|
128
|
+
return {
|
|
129
|
+
background: colors.contrast50,
|
|
130
|
+
foreground: colors.text
|
|
131
|
+
};
|
|
132
|
+
case 'default':
|
|
133
|
+
return {
|
|
134
|
+
background: colors.primary,
|
|
135
|
+
foreground: colors.primaryForeground
|
|
136
|
+
};
|
|
137
|
+
/* c8 ignore next 3 -- TS exhaustiveness check guards this branch */
|
|
138
|
+
default:
|
|
139
|
+
{
|
|
140
|
+
const _exhaustive = color;
|
|
141
|
+
return {
|
|
142
|
+
background: colors.primary,
|
|
143
|
+
foreground: colors.primaryForeground
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=DialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","Text","TouchableOpacity","View","useTheme","useDialogContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DialogBody","titleId","descriptionId","title","description","actions","children","theme","nativeID","style","fontSize","fontWeight","color","colors","text","paddingBottom","lineHeight","textSecondary","length","ActionRow","width","gap","justifyContent","map","action","idx","ActionButton","label","close","shouldCloseOnPress","background","foreground","getActionPalette","handlePress","e","onPress","undefined","borderRadius","alignItems","backgroundColor","opacity","disabled","paddingVertical","paddingHorizontal","activeOpacity","testID","negative","negativeForeground","contrast50","primary","primaryForeground","_exhaustive"],"sourceRoot":"../../../src","sources":["dialog/DialogContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SACEC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QAEC,cAAc;AAGrB,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAG7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAC;EACzBC,OAAO;EACPC,aAAa;EACbC,KAAK;EACLC,WAAW;EACXC,OA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;IACrBQ,QAAQ,EAAEjB,MAAM,CAACiB,QAAS;IAC1BG,aAAa,EAAE,GAAI;IACnBC,MAAM,EAAErB,MAAM,CAACqB,MAAO;IAAAvC,QAAA,eAEtBX,IAAA,CAACN,IAAI;MAACoB,KAAK,EAAE;QAAEC,QAAQ,EAAE,EAAE;QAAEC,UAAU,EAAE,KAAK;QAAEC,KAAK,EAAEmB;MAAW,CAAE;MAAAzB,QAAA,EACjEkB,MAAM,CAACG;IAAK,CACT;EAAC,CACS,CAAC;AAEvB;AAEA,OAAO,SAASK,gBAAgBA,CAC9BpB,KAAwB,EACxBC,MAAmB,EACyB;EAC5C,QAAQD,KAAK;IACX,KAAK,aAAa;MAChB,OAAO;QACLkB,UAAU,EAAEjB,MAAM,CAACiC,QAAQ;QAC3Bf,UAAU,EAAElB,MAAM,CAACkC;MACrB,CAAC;IACH,KAAK,QAAQ;MACX,OAAO;QAAEjB,UAAU,EAAEjB,MAAM,CAACmC,UAAU;QAAEjB,UAAU,EAAElB,MAAM,CAACC;MAAK,CAAC;IACnE,KAAK,SAAS;MACZ,OAAO;QAAEgB,UAAU,EAAEjB,MAAM,CAACoC,OAAO;QAAElB,UAAU,EAAElB,MAAM,CAACqC;MAAkB,CAAC;IAC7E;IACA;MAAS;QACP,MAAMC,WAAkB,GAAGvC,KAAK;QAChC,OAAO;UAAEkB,UAAU,EAAEjB,MAAM,CAACoC,OAAO;UAAElB,UAAU,EAAElB,MAAM,CAACqC;QAAkB,CAAC;MAC7E;EACF;AACF","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID } from './Dialog';
|
|
4
|
-
export { CenteredDialog, CENTERED_DIALOG_BACKDROP_TESTID } from './CenteredDialog';
|
|
5
4
|
export { BloomDialogProvider } from './BloomDialogProvider';
|
|
6
5
|
export { alert } from "./alert.js";
|
|
7
6
|
export { useDialogContext, useDialogControl } from "./context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dialog","DIALOG_SHEET_BACKDROP_TESTID","
|
|
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":[]}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
// `package.json`'s `exports['./dialog']`; native bundlers fall through to
|
|
12
12
|
// the React Native build above.
|
|
13
13
|
export { Dialog, BLOOM_DIALOG_CSS, DIALOG_SHEET_BACKDROP_TESTID } from "./Dialog.web.js";
|
|
14
|
-
export { CenteredDialog, BLOOM_CENTERED_DIALOG_CSS, CENTERED_DIALOG_BACKDROP_TESTID } from "./CenteredDialog.web.js";
|
|
15
14
|
export { BloomDialogProvider } from "./BloomDialogProvider.web.js";
|
|
16
15
|
export { alert } from "./alert.js";
|
|
17
16
|
export { useDialogContext, useDialogControl } from "./context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dialog","BLOOM_DIALOG_CSS","DIALOG_SHEET_BACKDROP_TESTID","
|
|
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":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { sizes as iconSizes, useCommonSVGProps } from "./icons/common.js";
|
|
|
19
19
|
|
|
20
20
|
// Core components
|
|
21
21
|
export * from './portal';
|
|
22
|
-
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID,
|
|
22
|
+
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl } from './dialog';
|
|
23
23
|
export * from './button';
|
|
24
24
|
export { Fab } from './fab';
|
|
25
25
|
export * from "./grouped-buttons/index.js";
|
|
@@ -55,8 +55,6 @@ export { Slider } from "./slider/index.js";
|
|
|
55
55
|
export { Combobox } from './combobox';
|
|
56
56
|
// Bottom sheet
|
|
57
57
|
export { BottomSheet } from "./bottom-sheet/index.js";
|
|
58
|
-
// Responsive sheet — side-sheet on wide screens, bottom-sheet on narrow.
|
|
59
|
-
export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from './responsive-sheet';
|
|
60
58
|
// Data display
|
|
61
59
|
export * from "./card/index.js";
|
|
62
60
|
export * from "./badge/index.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","useInteractionState","useDelayedLoading","useThrottledValue","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","
|
|
1
|
+
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","useInteractionState","useDelayedLoading","useThrottledValue","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","Fab","ErrorBoundary","AvatarGroup","UserHoverCard","PromptInput","toast","Typography","Skeleton","Grid","Fill","IconCircle","TextField","SegmentedControl","SearchInput","Label","Field","InputGroup","Slider","Combobox","BottomSheet","Tabs","Accordion","Item","Kbd","Admonition","Menu","Tooltip","Select","ContextMenu","Popover","AlertDialog","AlertDialogHost","confirm","Command","Code","Fonts"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,cAAc,kBAAS;;AAEvB;AACA,SAASA,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,QAAQ,mBAAU;AAE1D,OAAO,KAAKC,MAAM,MAAM,oBAAiB;AACzC,SAASC,GAAG,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,sBAAmB;;AAE/E;AACA,SAASC,mBAAmB,QAAQ,gCAA6B;AACjE,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,iBAAiB,QAAQ,8BAA2B;;AAE7D;AACA,OAAO,KAAKC,KAAK,MAAM,kBAAS;AAChC,SAAkCC,KAAK,IAAIC,SAAS,EAAEC,iBAAiB,QAAQ,mBAAgB;;AAE/F;AACA,cAAc,UAAU;AACxB,SACEC,MAAM,EACNC,4BAA4B,EAC5BC,mBAAmB,EACnBC,KAAK,EACLC,gBAAgB,EAChBC,gBAAgB,QACX,UAAU;AAajB,cAAc,UAAU;AACxB,SAASC,GAAG,QAAQ,OAAO;AAE3B,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,4BAAmB;AACjC,cAAc,wBAAe;AAC7B,SAASC,aAAa,QAAQ,2BAAkB;AAMhD,cAAc,mBAAU;AACxB,SAASC,WAAW,QAAQ,yBAAgB;AAE5C,SAASC,aAAa,QAAQ,4BAAmB;AAEjD,cAAc,WAAW;AACzB,OAAO,KAAKC,WAAW,MAAM,yBAAgB;AAC7C,cAAc,mBAAU;AACxB,SAASC,KAAK,QAAoB,SAAS;;AAE3C;AACA,OAAO,KAAKC,UAAU,MAAM,uBAAc;;AAE1C;AACA,OAAO,KAAKC,QAA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js";
|
|
|
24
24
|
|
|
25
25
|
// Core components
|
|
26
26
|
export * from "./portal/index.web.js";
|
|
27
|
-
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID,
|
|
27
|
+
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl } from "./dialog/index.web.js";
|
|
28
28
|
export * from "./button/index.web.js";
|
|
29
29
|
export { Fab } from "./fab/index.web.js";
|
|
30
30
|
export * from "./grouped-buttons/index.js";
|
|
@@ -60,8 +60,6 @@ export { Slider } from "./slider/index.js";
|
|
|
60
60
|
export { Combobox } from "./combobox/index.web.js";
|
|
61
61
|
// Bottom sheet
|
|
62
62
|
export { BottomSheet } from "./bottom-sheet/index.js";
|
|
63
|
-
// Responsive sheet — side-sheet on wide screens, bottom-sheet on narrow.
|
|
64
|
-
export { ResponsiveSheet, RESPONSIVE_SHEET_BACKDROP_TESTID } from "./responsive-sheet/index.web.js";
|
|
65
63
|
// Data display
|
|
66
64
|
export * from "./card/index.js";
|
|
67
65
|
export * from "./badge/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","useInteractionState","useDelayedLoading","useThrottledValue","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","
|
|
1
|
+
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","useInteractionState","useDelayedLoading","useThrottledValue","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","Fab","ErrorBoundary","AvatarGroup","UserHoverCard","PromptInput","toast","Typography","Skeleton","Grid","Fill","IconCircle","TextField","SegmentedControl","SearchInput","Label","Field","InputGroup","Slider","Combobox","BottomSheet","Tabs","Accordion","Item","Kbd","Admonition","Menu","Tooltip","Select","ContextMenu","Popover","Al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,iBAAQ;AAC7B,SAASC,UAAU,QAAQ,wBAAe;;AAE1C;AACA,OAAO,KAAKC,SAAS,MAAM,uBAAc;AACzC,OAAO,KAAKC,gBAAgB,MAAM,8BAAqB;AACvD,SAASC,WAAW,QAAQ,yBAAgB;AAC5C,SAASC,KAAK,QAAQ,kBAAS;AAE/B,SAASC,KAAK,QAAQ,kBAAS;AAE/B,SAASC,UAAU,QAAQ,wBAAe;AAE1C,SAASC,MAAM,QAAQ,mBAAU;AAEjC,SAASC,QAAQ,QAAQ,yBAAsB;AAG/C;AACA,SAASC,WAAW,QAAQ,yBAAgB;AAG5C;AACA,cAAc,iBAAQ;AACtB,cAAc,kBAAS;AACvB,cAAc,iBAAQ;AACtB,OAAO,KAAKC,IAAI,MAAM,iBAAQ;AAC9B,cAAc,qBAAY;AAC1B,OAAO,KAAKC,SAAS,MAAM,sBAAa;;AAExC;AACA,cAAc,0BAAiB;AAC/B,SAASC,IAAI,QAAQ,iBAAQ;AAE7B,SAASC,GAAG,QAAQ,gBAAO;AAG3B;AACA,OAAO,KAAKC,UAAU,MAAM,uBAAc;AAC1C,OAAO,KAAKC,IAAI,MAAM,qBAAkB;AACxC,OAAO,KAAKC,OAAO,MAAM,wBAAqB;AAC9C,OAAO,KAAKC,MAAM,MAAM,uBAAoB;AAC5C,OAAO,KAAKC,WAAW,MAAM,6BAA0B;AACvD,OAAO,KAAKC,OAAO,MAAM,wBAAqB;AAC9C,SAASC,WAAW,EAAEC,eAAe,EAAEC,OAAO,QAAQ,6BAA0B;AAMhF,SAASC,OAAO,QAAQ,wBAAqB;AAG7C;AACA,OAAO,KAAKC,IAAI,MAAM,iBAAQ;;AAE9B;AACA,OAAO,KAAKC,KAAK,MAAM,sBAAmB","ignoreList":[]}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DialogProps } from '../dialog';
|
|
3
3
|
import type { AlertDialogProps } from './types';
|
|
4
|
-
type
|
|
4
|
+
type DialogComponent = React.ComponentType<DialogProps>;
|
|
5
5
|
/**
|
|
6
|
-
* Build the `AlertDialog` component bound to a platform `
|
|
6
|
+
* Build the `AlertDialog` component bound to a platform `Dialog`.
|
|
7
7
|
*
|
|
8
|
-
* `
|
|
9
|
-
* overlay), and this repo never
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
8
|
+
* `Dialog` is platform-forked (native `BottomSheet`-backed surface vs pure-DOM
|
|
9
|
+
* web overlay) through its `./dialog` export conditions, and this repo never
|
|
10
|
+
* relies on implicit `.web` resolution — the platform entry files
|
|
11
|
+
* (`index.ts` / `index.web.ts`) inject the correct `Dialog` here. The body
|
|
12
|
+
* below is single-source, no duplication.
|
|
12
13
|
*
|
|
13
|
-
* `AlertDialog` is a thin wrapper over
|
|
14
|
-
* description and a confirm/cancel action row. Reach for the
|
|
15
|
-
* `confirm()` helper + `<AlertDialogHost />` to trigger a confirm
|
|
16
|
-
* event handler without owning visible state.
|
|
14
|
+
* `AlertDialog` is a thin wrapper over `<Dialog placement="center">` that lays
|
|
15
|
+
* out a title, description and a confirm/cancel action row. Reach for the
|
|
16
|
+
* imperative `confirm()` helper + `<AlertDialogHost />` to trigger a confirm
|
|
17
|
+
* from an event handler without owning visible state.
|
|
17
18
|
*/
|
|
18
|
-
export declare function createAlertDialog(
|
|
19
|
+
export declare function createAlertDialog(Dialog: DialogComponent): React.MemoExoticComponent<({ visible, onClose, title, description, confirmLabel, cancelLabel, onConfirm, onCancel, destructive, hideCancel, dismissible, cardStyle, testID, }: AlertDialogProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
20
|
export type AlertDialogType = ReturnType<typeof createAlertDialog>;
|
|
20
21
|
export {};
|
|
21
22
|
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AAKxD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,kLAepD,gBAAgB,8CAwEpB;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,0QAA4B,CAAC;AACrD,eAAO,MAAM,eAAe;;;CAAqC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/index.web.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/alert-dialog/index.web.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,0QAA4B,CAAC;AACrD,eAAO,MAAM,eAAe;;;CAAqC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DialogProps } from '../dialog';
|
|
3
3
|
import type { CommandProps } from './types';
|
|
4
|
-
type
|
|
4
|
+
type DialogComponent = React.ComponentType<DialogProps>;
|
|
5
5
|
/**
|
|
6
|
-
* Build the `Command` palette bound to a platform `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* implicit `.web` resolution. The body is single-source.
|
|
6
|
+
* Build the `Command` palette bound to a platform `Dialog`. The platform entry
|
|
7
|
+
* files (`index.ts` / `index.web.ts`) inject the correct one (native
|
|
8
|
+
* `BottomSheet`-backed surface vs pure-DOM web overlay) — this repo never
|
|
9
|
+
* relies on implicit `.web` resolution. The body is single-source.
|
|
10
10
|
*
|
|
11
|
-
* `Command` is a ⌘K command palette built on
|
|
11
|
+
* `Command` is a ⌘K command palette built on `<Dialog placement="center">`,
|
|
12
12
|
* `SearchInput`, an `Item` results list and `Kbd` shortcut hints. Items group
|
|
13
13
|
* by their `group` field (ungrouped first). On web the list is
|
|
14
14
|
* keyboard-navigable (Up/Down/Enter); on native, tap to select.
|
|
15
15
|
*/
|
|
16
|
-
export declare function createCommand(
|
|
16
|
+
export declare function createCommand(Dialog: DialogComponent): {
|
|
17
17
|
({ visible, onClose, items, placeholder, emptyText, query: queryProp, onQueryChange, filter, maxListHeight, style, testID, }: CommandProps): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../../src/command/Command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAgBtE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../../src/command/Command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAgBtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AAqBxD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe;kIAahD,YAAY;;EA2LhB;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/command/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/command/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;CAAwB,CAAC;AAE7C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/command/index.web.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/command/index.web.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;CAAwB,CAAC;AAE7C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -14,8 +14,7 @@ export { DIALOG_SHEET_BACKDROP_TESTID };
|
|
|
14
14
|
* centered card via the 500px cap; flush for bottom: a full-width sheet
|
|
15
15
|
* with a drag handle). Default behavior is unchanged.
|
|
16
16
|
* - `'left'` / `'right'` — an anchored side-sheet/drawer driven by
|
|
17
|
-
* reanimated
|
|
18
|
-
* are safe on native.
|
|
17
|
+
* reanimated. Exit animations are safe on native.
|
|
19
18
|
*
|
|
20
19
|
* The component accepts three rendering modes simultaneously:
|
|
21
20
|
*
|
|
@@ -23,7 +22,7 @@ export { DIALOG_SHEET_BACKDROP_TESTID };
|
|
|
23
22
|
* 2. Custom children — caller passes JSX, bloom renders the chrome.
|
|
24
23
|
* 3. Pure children — no `title`/`description`/`actions`.
|
|
25
24
|
*/
|
|
26
|
-
export declare function Dialog({
|
|
25
|
+
export declare function Dialog({ placement, ...rest }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
27
26
|
/**
|
|
28
27
|
* Helper used by the imperative `alert()` API. Mounts a `<Dialog>` against
|
|
29
28
|
* a fresh control and presents it immediately. `onResolve` is invoked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/dialog/Dialog.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAGL,4BAA4B,EAK7B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,YAAY,EAGZ,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,GAAG,IAAI,EACR,EAAE,WAAW,2CAab;AAoZD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,GACV,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,2CAoBA"}
|