@vvedantb/native-ui 0.24.1 → 0.24.2
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/dist/DropdownMenu.jsx +245 -116
- package/dist/ai/message-action-sheet.jsx +182 -202
- package/dist/motion.js +31 -0
- package/dist/primitives/overlay.jsx +162 -101
- package/package.json +1 -1
- package/src/DropdownMenu.tsx +71 -16
- package/src/ai/message-action-sheet.tsx +90 -97
- package/src/motion.ts +15 -0
- package/src/primitives/overlay.tsx +48 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { cn } from "../cn";
|
|
6
6
|
import { MIN_TOUCH_TARGET, sizeStyle, textStyle, touchSlop, typeStyle } from "../controlStyles";
|
|
@@ -8,8 +8,9 @@ import { selectionHaptic } from "../haptics";
|
|
|
8
8
|
import { palette } from "../palette";
|
|
9
9
|
import { useLargerText } from "../theme";
|
|
10
10
|
import { tokens } from "../tokens";
|
|
11
|
-
import { useReduceMotion } from "../useReduceMotion";
|
|
12
11
|
import { useScheme } from "../useScheme";
|
|
12
|
+
import { OverlayModal, OverlayRoot } from "../primitives/overlay";
|
|
13
|
+
import { SheetDragView } from "../primitives/sheet-drag";
|
|
13
14
|
import { chatTextSize } from "./chat-text";
|
|
14
15
|
|
|
15
16
|
/** One row of `MessageActionSheet`. */
|
|
@@ -18,13 +19,14 @@ import { chatTextSize } from "./chat-text";
|
|
|
18
19
|
export const MESSAGE_ACTIONS_TITLE = "Message actions";
|
|
19
20
|
/**
|
|
20
21
|
* The sheet that opens on a long press of a chat message: a bottom sheet in
|
|
21
|
-
* an RN `Modal
|
|
22
|
-
* and a Cancel row. It
|
|
22
|
+
* the kit's `OverlayModal` (an RN `Modal`, no bottom-sheet library) with one row per action
|
|
23
|
+
* and a Cancel row. It slides up and down as `Sheet` does (a drag down closes it too; with
|
|
24
|
+
* Reduce Motion on it appears and leaves in place). It closes on the backdrop, Cancel, Android back and after
|
|
23
25
|
* an action. A `selectionHaptic()` fires when it opens (`expo-haptics` is an
|
|
24
26
|
* optional peer). Row testIDs are `{testID}-action-{key}`.
|
|
25
27
|
*/
|
|
26
28
|
export function MessageActionSheet(t0) {
|
|
27
|
-
const $ = _c(
|
|
29
|
+
const $ = _c(106);
|
|
28
30
|
const {
|
|
29
31
|
open,
|
|
30
32
|
onClose,
|
|
@@ -39,7 +41,6 @@ export function MessageActionSheet(t0) {
|
|
|
39
41
|
const scheme = useScheme();
|
|
40
42
|
const largerText = useLargerText();
|
|
41
43
|
const insets = useSafeAreaInsets();
|
|
42
|
-
const reduceMotion = useReduceMotion();
|
|
43
44
|
let t4;
|
|
44
45
|
let t5;
|
|
45
46
|
if ($[0] !== open) {
|
|
@@ -62,6 +63,7 @@ export function MessageActionSheet(t0) {
|
|
|
62
63
|
let T2;
|
|
63
64
|
let T3;
|
|
64
65
|
let T4;
|
|
66
|
+
let T5;
|
|
65
67
|
let t10;
|
|
66
68
|
let t11;
|
|
67
69
|
let t12;
|
|
@@ -80,119 +82,99 @@ export function MessageActionSheet(t0) {
|
|
|
80
82
|
let t25;
|
|
81
83
|
let t26;
|
|
82
84
|
let t27;
|
|
83
|
-
let t28;
|
|
84
|
-
let t29;
|
|
85
85
|
let t6;
|
|
86
86
|
let t7;
|
|
87
87
|
let t8;
|
|
88
88
|
let t9;
|
|
89
|
-
if ($[3] !== actions || $[4] !== cancelLabel || $[5] !== insets.bottom || $[6] !== largerText || $[7] !== onClose || $[8] !== open || $[9] !==
|
|
89
|
+
if ($[3] !== actions || $[4] !== cancelLabel || $[5] !== insets.bottom || $[6] !== largerText || $[7] !== onClose || $[8] !== open || $[9] !== scheme || $[10] !== testID || $[11] !== title) {
|
|
90
90
|
const caption = chatTextSize("caption", largerText);
|
|
91
91
|
const body = chatTextSize("body", largerText);
|
|
92
92
|
const minHeight = largerText ? 56 : MIN_TOUCH_TARGET + 4;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
$[42] = t31;
|
|
104
|
-
} else {
|
|
105
|
-
t31 = $[42];
|
|
106
|
-
}
|
|
107
|
-
const t32 = palette.backdrop[scheme];
|
|
108
|
-
let t33;
|
|
109
|
-
if ($[43] !== t32) {
|
|
110
|
-
t33 = [StyleSheet.absoluteFill, {
|
|
111
|
-
backgroundColor: t32
|
|
112
|
-
}];
|
|
113
|
-
$[43] = t32;
|
|
114
|
-
$[44] = t33;
|
|
115
|
-
} else {
|
|
116
|
-
t33 = $[44];
|
|
117
|
-
}
|
|
118
|
-
if ($[45] !== onClose || $[46] !== t30 || $[47] !== t33) {
|
|
119
|
-
t29 = <Pressable testID={t30} accessibilityRole="button" accessibilityLabel="Close" onPress={onClose} hitSlop={t31} style={t33} />;
|
|
120
|
-
$[45] = onClose;
|
|
121
|
-
$[46] = t30;
|
|
122
|
-
$[47] = t33;
|
|
123
|
-
$[48] = t29;
|
|
93
|
+
T5 = OverlayRoot;
|
|
94
|
+
t26 = open;
|
|
95
|
+
if ($[40] !== onClose) {
|
|
96
|
+
t27 = next => {
|
|
97
|
+
if (!next) {
|
|
98
|
+
onClose();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
$[40] = onClose;
|
|
102
|
+
$[41] = t27;
|
|
124
103
|
} else {
|
|
125
|
-
|
|
104
|
+
t27 = $[41];
|
|
126
105
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
T4 = OverlayModal;
|
|
107
|
+
t23 = testID;
|
|
108
|
+
t24 = "bottom";
|
|
109
|
+
t25 = true;
|
|
110
|
+
T3 = SheetDragView;
|
|
111
|
+
t22 = true;
|
|
130
112
|
T2 = View;
|
|
131
113
|
t15 = testID;
|
|
132
114
|
t16 = true;
|
|
133
115
|
t17 = title;
|
|
134
116
|
t18 = onClose;
|
|
135
117
|
t19 = "w-full self-center px-2";
|
|
136
|
-
const
|
|
137
|
-
if ($[
|
|
118
|
+
const t28 = insets.bottom + 8;
|
|
119
|
+
if ($[42] !== t28) {
|
|
138
120
|
t20 = {
|
|
139
121
|
maxWidth: 480,
|
|
140
|
-
paddingBottom:
|
|
122
|
+
paddingBottom: t28
|
|
141
123
|
};
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
124
|
+
$[42] = t28;
|
|
125
|
+
$[43] = t20;
|
|
144
126
|
} else {
|
|
145
|
-
t20 = $[
|
|
127
|
+
t20 = $[43];
|
|
146
128
|
}
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
if ($[
|
|
150
|
-
|
|
151
|
-
backgroundColor:
|
|
129
|
+
const t29 = tokens.color.surface[scheme];
|
|
130
|
+
let t30;
|
|
131
|
+
if ($[44] !== t29) {
|
|
132
|
+
t30 = {
|
|
133
|
+
backgroundColor: t29,
|
|
152
134
|
borderRadius: tokens.radius.card
|
|
153
135
|
};
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
136
|
+
$[44] = t29;
|
|
137
|
+
$[45] = t30;
|
|
156
138
|
} else {
|
|
157
|
-
|
|
139
|
+
t30 = $[45];
|
|
158
140
|
}
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
if ($[
|
|
163
|
-
|
|
164
|
-
$[
|
|
141
|
+
const t31 = cn(caption, "px-4 pb-1 pt-3 font-instrument-sans-medium");
|
|
142
|
+
const t32 = sizeStyle(caption);
|
|
143
|
+
let t33;
|
|
144
|
+
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
145
|
+
t33 = typeStyle("medium");
|
|
146
|
+
$[46] = t33;
|
|
165
147
|
} else {
|
|
166
|
-
|
|
148
|
+
t33 = $[46];
|
|
167
149
|
}
|
|
168
|
-
let
|
|
169
|
-
if ($[
|
|
170
|
-
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
150
|
+
let t34;
|
|
151
|
+
if ($[47] !== scheme) {
|
|
152
|
+
t34 = textStyle("muted", scheme);
|
|
153
|
+
$[47] = scheme;
|
|
154
|
+
$[48] = t34;
|
|
173
155
|
} else {
|
|
174
|
-
|
|
156
|
+
t34 = $[48];
|
|
175
157
|
}
|
|
176
|
-
let
|
|
177
|
-
if ($[
|
|
178
|
-
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
158
|
+
let t35;
|
|
159
|
+
if ($[49] !== t32 || $[50] !== t34) {
|
|
160
|
+
t35 = [t32, t33, t34];
|
|
161
|
+
$[49] = t32;
|
|
162
|
+
$[50] = t34;
|
|
163
|
+
$[51] = t35;
|
|
182
164
|
} else {
|
|
183
|
-
|
|
165
|
+
t35 = $[51];
|
|
184
166
|
}
|
|
185
|
-
let
|
|
186
|
-
if ($[
|
|
187
|
-
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
167
|
+
let t36;
|
|
168
|
+
if ($[52] !== t31 || $[53] !== t35 || $[54] !== title) {
|
|
169
|
+
t36 = <Text accessibilityRole="header" numberOfLines={1} className={t31} style={t35}>{title}</Text>;
|
|
170
|
+
$[52] = t31;
|
|
171
|
+
$[53] = t35;
|
|
172
|
+
$[54] = title;
|
|
173
|
+
$[55] = t36;
|
|
192
174
|
} else {
|
|
193
|
-
|
|
175
|
+
t36 = $[55];
|
|
194
176
|
}
|
|
195
|
-
t21 = <View className="overflow-hidden" style={
|
|
177
|
+
t21 = <View className="overflow-hidden" style={t30}>{t36}{actions.map((action, index) => {
|
|
196
178
|
const Icon = action.icon;
|
|
197
179
|
const color = action.destructive ? palette.danger[scheme] : tokens.color.foreground[scheme];
|
|
198
180
|
return <Pressable key={action.key} testID={`${testID}-action-${action.key}`} accessibilityRole="button" accessibilityLabel={action.label} hitSlop={touchSlop(MIN_TOUCH_TARGET)} onPress={() => {
|
|
@@ -212,25 +194,25 @@ export function MessageActionSheet(t0) {
|
|
|
212
194
|
t9 = "button";
|
|
213
195
|
t10 = cancelLabel;
|
|
214
196
|
t11 = onClose;
|
|
215
|
-
if ($[
|
|
197
|
+
if ($[56] === Symbol.for("react.memo_cache_sentinel")) {
|
|
216
198
|
t12 = touchSlop(MIN_TOUCH_TARGET);
|
|
217
|
-
$[
|
|
199
|
+
$[56] = t12;
|
|
218
200
|
} else {
|
|
219
|
-
t12 = $[
|
|
201
|
+
t12 = $[56];
|
|
220
202
|
}
|
|
221
203
|
t13 = "mt-2 items-center justify-center";
|
|
222
|
-
const
|
|
223
|
-
if ($[
|
|
204
|
+
const t37 = tokens.color.surface[scheme];
|
|
205
|
+
if ($[57] !== minHeight || $[58] !== t37) {
|
|
224
206
|
t14 = {
|
|
225
207
|
minHeight,
|
|
226
|
-
backgroundColor:
|
|
208
|
+
backgroundColor: t37,
|
|
227
209
|
borderRadius: tokens.radius.card
|
|
228
210
|
};
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
211
|
+
$[57] = minHeight;
|
|
212
|
+
$[58] = t37;
|
|
213
|
+
$[59] = t14;
|
|
232
214
|
} else {
|
|
233
|
-
t14 = $[
|
|
215
|
+
t14 = $[59];
|
|
234
216
|
}
|
|
235
217
|
T0 = Text;
|
|
236
218
|
t7 = cn(body, "font-instrument-sans-semibold");
|
|
@@ -241,15 +223,15 @@ export function MessageActionSheet(t0) {
|
|
|
241
223
|
$[6] = largerText;
|
|
242
224
|
$[7] = onClose;
|
|
243
225
|
$[8] = open;
|
|
244
|
-
$[9] =
|
|
245
|
-
$[10] =
|
|
246
|
-
$[11] =
|
|
247
|
-
$[12] =
|
|
248
|
-
$[13] =
|
|
249
|
-
$[14] =
|
|
250
|
-
$[15] =
|
|
251
|
-
$[16] =
|
|
252
|
-
$[17] =
|
|
226
|
+
$[9] = scheme;
|
|
227
|
+
$[10] = testID;
|
|
228
|
+
$[11] = title;
|
|
229
|
+
$[12] = T0;
|
|
230
|
+
$[13] = T1;
|
|
231
|
+
$[14] = T2;
|
|
232
|
+
$[15] = T3;
|
|
233
|
+
$[16] = T4;
|
|
234
|
+
$[17] = T5;
|
|
253
235
|
$[18] = t10;
|
|
254
236
|
$[19] = t11;
|
|
255
237
|
$[20] = t12;
|
|
@@ -268,18 +250,17 @@ export function MessageActionSheet(t0) {
|
|
|
268
250
|
$[33] = t25;
|
|
269
251
|
$[34] = t26;
|
|
270
252
|
$[35] = t27;
|
|
271
|
-
$[36] =
|
|
272
|
-
$[37] =
|
|
273
|
-
$[38] =
|
|
274
|
-
$[39] =
|
|
275
|
-
$[40] = t8;
|
|
276
|
-
$[41] = t9;
|
|
253
|
+
$[36] = t6;
|
|
254
|
+
$[37] = t7;
|
|
255
|
+
$[38] = t8;
|
|
256
|
+
$[39] = t9;
|
|
277
257
|
} else {
|
|
278
|
-
T0 = $[
|
|
279
|
-
T1 = $[
|
|
280
|
-
T2 = $[
|
|
281
|
-
T3 = $[
|
|
282
|
-
T4 = $[
|
|
258
|
+
T0 = $[12];
|
|
259
|
+
T1 = $[13];
|
|
260
|
+
T2 = $[14];
|
|
261
|
+
T3 = $[15];
|
|
262
|
+
T4 = $[16];
|
|
263
|
+
T5 = $[17];
|
|
283
264
|
t10 = $[18];
|
|
284
265
|
t11 = $[19];
|
|
285
266
|
t12 = $[20];
|
|
@@ -298,111 +279,110 @@ export function MessageActionSheet(t0) {
|
|
|
298
279
|
t25 = $[33];
|
|
299
280
|
t26 = $[34];
|
|
300
281
|
t27 = $[35];
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
282
|
+
t6 = $[36];
|
|
283
|
+
t7 = $[37];
|
|
284
|
+
t8 = $[38];
|
|
285
|
+
t9 = $[39];
|
|
286
|
+
}
|
|
287
|
+
let t28;
|
|
288
|
+
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
289
|
+
t28 = typeStyle("semibold");
|
|
290
|
+
$[60] = t28;
|
|
291
|
+
} else {
|
|
292
|
+
t28 = $[60];
|
|
293
|
+
}
|
|
294
|
+
let t29;
|
|
295
|
+
if ($[61] !== scheme) {
|
|
296
|
+
t29 = textStyle("foreground", scheme);
|
|
297
|
+
$[61] = scheme;
|
|
298
|
+
$[62] = t29;
|
|
299
|
+
} else {
|
|
300
|
+
t29 = $[62];
|
|
307
301
|
}
|
|
308
302
|
let t30;
|
|
309
|
-
if ($[
|
|
310
|
-
t30 =
|
|
311
|
-
$[
|
|
303
|
+
if ($[63] !== t29 || $[64] !== t6) {
|
|
304
|
+
t30 = [t6, t28, t29];
|
|
305
|
+
$[63] = t29;
|
|
306
|
+
$[64] = t6;
|
|
307
|
+
$[65] = t30;
|
|
312
308
|
} else {
|
|
313
|
-
t30 = $[
|
|
309
|
+
t30 = $[65];
|
|
314
310
|
}
|
|
315
311
|
let t31;
|
|
316
|
-
if ($[68] !==
|
|
317
|
-
t31 =
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
312
|
+
if ($[66] !== T0 || $[67] !== cancelLabel || $[68] !== t30 || $[69] !== t7) {
|
|
313
|
+
t31 = <T0 className={t7} style={t30}>{cancelLabel}</T0>;
|
|
314
|
+
$[66] = T0;
|
|
315
|
+
$[67] = cancelLabel;
|
|
316
|
+
$[68] = t30;
|
|
317
|
+
$[69] = t7;
|
|
318
|
+
$[70] = t31;
|
|
320
319
|
} else {
|
|
321
|
-
t31 = $[
|
|
320
|
+
t31 = $[70];
|
|
322
321
|
}
|
|
323
322
|
let t32;
|
|
324
|
-
if ($[
|
|
325
|
-
t32 =
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
323
|
+
if ($[71] !== T1 || $[72] !== t10 || $[73] !== t11 || $[74] !== t12 || $[75] !== t13 || $[76] !== t14 || $[77] !== t31 || $[78] !== t8 || $[79] !== t9) {
|
|
324
|
+
t32 = <T1 testID={t8} accessibilityRole={t9} accessibilityLabel={t10} onPress={t11} hitSlop={t12} className={t13} style={t14}>{t31}</T1>;
|
|
325
|
+
$[71] = T1;
|
|
326
|
+
$[72] = t10;
|
|
327
|
+
$[73] = t11;
|
|
328
|
+
$[74] = t12;
|
|
329
|
+
$[75] = t13;
|
|
330
|
+
$[76] = t14;
|
|
331
|
+
$[77] = t31;
|
|
332
|
+
$[78] = t8;
|
|
333
|
+
$[79] = t9;
|
|
334
|
+
$[80] = t32;
|
|
329
335
|
} else {
|
|
330
|
-
t32 = $[
|
|
336
|
+
t32 = $[80];
|
|
331
337
|
}
|
|
332
338
|
let t33;
|
|
333
|
-
if ($[
|
|
334
|
-
t33 = <
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
339
|
+
if ($[81] !== T2 || $[82] !== t15 || $[83] !== t16 || $[84] !== t17 || $[85] !== t18 || $[86] !== t19 || $[87] !== t20 || $[88] !== t21 || $[89] !== t32) {
|
|
340
|
+
t33 = <T2 testID={t15} accessibilityViewIsModal={t16} accessibilityLabel={t17} onAccessibilityEscape={t18} className={t19} style={t20}>{t21}{t32}</T2>;
|
|
341
|
+
$[81] = T2;
|
|
342
|
+
$[82] = t15;
|
|
343
|
+
$[83] = t16;
|
|
344
|
+
$[84] = t17;
|
|
345
|
+
$[85] = t18;
|
|
346
|
+
$[86] = t19;
|
|
347
|
+
$[87] = t20;
|
|
348
|
+
$[88] = t21;
|
|
349
|
+
$[89] = t32;
|
|
350
|
+
$[90] = t33;
|
|
340
351
|
} else {
|
|
341
|
-
t33 = $[
|
|
352
|
+
t33 = $[90];
|
|
342
353
|
}
|
|
343
354
|
let t34;
|
|
344
|
-
if ($[
|
|
345
|
-
t34 = <
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[82] = t13;
|
|
351
|
-
$[83] = t14;
|
|
352
|
-
$[84] = t33;
|
|
353
|
-
$[85] = t8;
|
|
354
|
-
$[86] = t9;
|
|
355
|
-
$[87] = t34;
|
|
355
|
+
if ($[91] !== T3 || $[92] !== t22 || $[93] !== t33) {
|
|
356
|
+
t34 = <T3 enabled={t22}>{t33}</T3>;
|
|
357
|
+
$[91] = T3;
|
|
358
|
+
$[92] = t22;
|
|
359
|
+
$[93] = t33;
|
|
360
|
+
$[94] = t34;
|
|
356
361
|
} else {
|
|
357
|
-
t34 = $[
|
|
362
|
+
t34 = $[94];
|
|
358
363
|
}
|
|
359
364
|
let t35;
|
|
360
|
-
if ($[
|
|
361
|
-
t35 = <
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[94] = t20;
|
|
369
|
-
$[95] = t21;
|
|
370
|
-
$[96] = t34;
|
|
371
|
-
$[97] = t35;
|
|
365
|
+
if ($[95] !== T4 || $[96] !== t23 || $[97] !== t24 || $[98] !== t25 || $[99] !== t34) {
|
|
366
|
+
t35 = <T4 part={t23} placement={t24} dismissible={t25}>{t34}</T4>;
|
|
367
|
+
$[95] = T4;
|
|
368
|
+
$[96] = t23;
|
|
369
|
+
$[97] = t24;
|
|
370
|
+
$[98] = t25;
|
|
371
|
+
$[99] = t34;
|
|
372
|
+
$[100] = t35;
|
|
372
373
|
} else {
|
|
373
|
-
t35 = $[
|
|
374
|
+
t35 = $[100];
|
|
374
375
|
}
|
|
375
376
|
let t36;
|
|
376
|
-
if ($[
|
|
377
|
-
t36 = <
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
377
|
+
if ($[101] !== T5 || $[102] !== t26 || $[103] !== t27 || $[104] !== t35) {
|
|
378
|
+
t36 = <T5 open={t26} onOpenChange={t27}>{t35}</T5>;
|
|
379
|
+
$[101] = T5;
|
|
380
|
+
$[102] = t26;
|
|
381
|
+
$[103] = t27;
|
|
382
|
+
$[104] = t35;
|
|
383
|
+
$[105] = t36;
|
|
383
384
|
} else {
|
|
384
|
-
t36 = $[
|
|
385
|
+
t36 = $[105];
|
|
385
386
|
}
|
|
386
|
-
|
|
387
|
-
if ($[103] !== T4 || $[104] !== t24 || $[105] !== t25 || $[106] !== t26 || $[107] !== t27 || $[108] !== t28 || $[109] !== t29 || $[110] !== t36) {
|
|
388
|
-
t37 = <T4 visible={t24} transparent={t25} animationType={t26} statusBarTranslucent={t27} onRequestClose={t28}>{t29}{t36}</T4>;
|
|
389
|
-
$[103] = T4;
|
|
390
|
-
$[104] = t24;
|
|
391
|
-
$[105] = t25;
|
|
392
|
-
$[106] = t26;
|
|
393
|
-
$[107] = t27;
|
|
394
|
-
$[108] = t28;
|
|
395
|
-
$[109] = t29;
|
|
396
|
-
$[110] = t36;
|
|
397
|
-
$[111] = t37;
|
|
398
|
-
} else {
|
|
399
|
-
t37 = $[111];
|
|
400
|
-
}
|
|
401
|
-
return t37;
|
|
387
|
+
return t36;
|
|
402
388
|
}
|
|
403
|
-
const styles = StyleSheet.create({
|
|
404
|
-
anchor: {
|
|
405
|
-
flex: 1,
|
|
406
|
-
justifyContent: "flex-end"
|
|
407
|
-
}
|
|
408
|
-
});
|
package/dist/motion.js
CHANGED
|
@@ -31,3 +31,34 @@ export const SHEET_SNAP_SPRING = {
|
|
|
31
31
|
export function usePressFeedback() {
|
|
32
32
|
return useReduceMotion() ? "active:opacity-80" : "active:scale-[0.97]";
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
/** Start scale of a popover or dialog panel as it opens: never from 0, as the `animate-expo` rules say. */
|
|
36
|
+
export const PANEL_SCALE_FROM = 0.96;
|
|
37
|
+
|
|
38
|
+
/** A menu panel opening from its trigger: opacity and scale together. */
|
|
39
|
+
export const POPOVER_ENTER = {
|
|
40
|
+
duration: 150,
|
|
41
|
+
easing: EASE_OUT,
|
|
42
|
+
reduceMotion: ReduceMotion.System
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** A menu panel leaving: a quick fade only. */
|
|
46
|
+
export const POPOVER_EXIT = {
|
|
47
|
+
duration: 100,
|
|
48
|
+
easing: EASE_OUT,
|
|
49
|
+
reduceMotion: ReduceMotion.System
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** A centred dialog opening: the backdrop fades while the panel scales and fades in. */
|
|
53
|
+
export const DIALOG_ENTER = {
|
|
54
|
+
duration: 200,
|
|
55
|
+
easing: EASE_OUT,
|
|
56
|
+
reduceMotion: ReduceMotion.System
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** A centred dialog closing. */
|
|
60
|
+
export const DIALOG_EXIT = {
|
|
61
|
+
duration: 150,
|
|
62
|
+
easing: EASE_OUT,
|
|
63
|
+
reduceMotion: ReduceMotion.System
|
|
64
|
+
};
|