@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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/dist/autocomplete/index.js +39 -0
- package/dist/autocomplete/index.js.map +1 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +35 -2
- package/dist/button/index.js.map +1 -1
- package/dist/button/pending.js +1 -1
- package/dist/button/slots.d.ts +2 -0
- package/dist/button/slots.js.map +1 -1
- package/dist/chip/index.js +1 -1
- package/dist/components/autocomplete/index.d.ts +49 -0
- package/dist/components/autocomplete/index.js +87 -0
- package/dist/components/autocomplete/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +196 -150
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +106 -193
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip-group/index.d.ts +1 -1
- package/dist/components/chip-group/index.js +1 -1
- package/dist/components/copy-field/index.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/currency/index.d.ts +1 -1
- package/dist/components/currency/index.js +1 -1
- package/dist/components/dialog/index.d.ts +3 -2
- package/dist/components/dialog/index.js +105 -242
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/icon-button/index.js +205 -159
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.d.ts +216 -0
- package/dist/components/list/index.js +1118 -0
- package/dist/components/list/index.js.map +1 -0
- package/dist/components/list-item/index.d.ts +63 -0
- package/dist/components/list-item/index.js +275 -0
- package/dist/components/list-item/index.js.map +1 -0
- package/dist/components/menu/index.d.ts +309 -0
- package/dist/components/menu/index.js +1283 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/meter/index.d.ts +1 -1
- package/dist/components/meter/index.js +1 -1
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/number-field/index.js +2 -2
- package/dist/components/popover/index.d.ts +140 -0
- package/dist/components/popover/index.js +704 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/product-icon/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/search-field/index.d.ts +12 -4
- package/dist/components/search-field/index.js +64 -58
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +1 -1
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.d.ts +137 -0
- package/dist/components/sheet/index.js +1091 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/snackbar/index.d.ts +1 -1
- package/dist/components/snackbar/index.js +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-field/index.js +1 -1
- package/dist/control/checkbox-box.js +137 -0
- package/dist/control/checkbox-box.js.map +1 -0
- package/dist/control/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/glyphs/index.js +21 -2
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +16 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +374 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +8 -2
- package/dist/indicator/index.d.ts +1 -1
- package/dist/indicator/index.js +2 -2
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js +1 -1
- package/dist/modal/index.d.ts +16 -0
- package/dist/modal/index.js +277 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/overlay/anchored.d.ts +2 -0
- package/dist/overlay/anchored.js +182 -0
- package/dist/overlay/anchored.js.map +1 -0
- package/dist/overlay/host.d.ts +2 -0
- package/dist/overlay/host.js +1 -1
- package/dist/overlay/index.d.ts +4 -0
- package/dist/overlay/panel.js +215 -0
- package/dist/overlay/panel.js.map +1 -0
- package/dist/overlay/placement.d.ts +8 -0
- package/dist/overlay/placement.js +87 -0
- package/dist/overlay/placement.js.map +1 -0
- package/dist/press/index.js +1 -1
- package/dist/ref/index.js +15 -0
- package/dist/ref/index.js.map +1 -0
- package/dist/router/index.js +1 -1
- package/dist/row/index.js +158 -0
- package/dist/row/index.js.map +1 -0
- package/dist/row/styles.js +51 -0
- package/dist/row/styles.js.map +1 -0
- package/dist/theme/scope.js +1 -1
- package/dist/theme-scope.d.ts +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/typography/fonts.js +1 -1
- package/package.json +6 -6
|
@@ -1,37 +1,21 @@
|
|
|
1
1
|
import { useTheme } from "../../theme/scope.js";
|
|
2
2
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
3
|
import { useTypeRole } from "../../typography/roles.js";
|
|
4
|
+
import { refsOf } from "../../ref/index.js";
|
|
4
5
|
import { ButtonSlotContext } from "../../button/slots.js";
|
|
5
|
-
import { AnimatedPressable } from "../../button/index.js";
|
|
6
|
-
import { withOpacity } from "../../theme/color.js";
|
|
7
6
|
import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
|
|
8
|
-
import {
|
|
7
|
+
import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, registerOf, useModalState, useModalTrigger } from "../../modal/index.js";
|
|
9
8
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { createContext, use, useEffect, useId, useLayoutEffect, useState } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
import { ScrollView, StyleSheet, Text, View, useWindowDimensions } from "react-native";
|
|
13
12
|
import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
|
|
14
13
|
import { SafeAreaInsetsContext } from "react-native-safe-area-context";
|
|
15
|
-
import { useOverlayTriggerState } from "react-stately/useOverlayTriggerState";
|
|
16
14
|
//#region src/components/dialog/index.tsx
|
|
17
15
|
const MIN_WIDTH = 280;
|
|
18
16
|
const MAX_WIDTH = 560;
|
|
19
17
|
const SCALE_FROM = .9;
|
|
20
18
|
const RISE_FROM = .03;
|
|
21
|
-
const SCRIM_OPACITY = .32;
|
|
22
|
-
const NO_INSETS = {
|
|
23
|
-
bottom: 0,
|
|
24
|
-
left: 0,
|
|
25
|
-
right: 0,
|
|
26
|
-
top: 0
|
|
27
|
-
};
|
|
28
|
-
const ORIENTATIONS = [
|
|
29
|
-
"portrait",
|
|
30
|
-
"portrait-upside-down",
|
|
31
|
-
"landscape",
|
|
32
|
-
"landscape-left",
|
|
33
|
-
"landscape-right"
|
|
34
|
-
];
|
|
35
19
|
const NO_PARTS = {
|
|
36
20
|
footer: 0,
|
|
37
21
|
header: 0,
|
|
@@ -99,14 +83,6 @@ const stylesOf = themedStyles(({ colors, radii, shadows, sizing, spacing }) => S
|
|
|
99
83
|
alignItems: "stretch",
|
|
100
84
|
padding: 0
|
|
101
85
|
},
|
|
102
|
-
scrim: {
|
|
103
|
-
backgroundColor: withOpacity(colors.scrim, SCRIM_OPACITY),
|
|
104
|
-
bottom: 0,
|
|
105
|
-
left: 0,
|
|
106
|
-
position: "absolute",
|
|
107
|
-
right: 0,
|
|
108
|
-
top: 0
|
|
109
|
-
},
|
|
110
86
|
title: {
|
|
111
87
|
color: colors.onSurface,
|
|
112
88
|
flexShrink: 1
|
|
@@ -152,7 +128,7 @@ function bodyPaddingOf({ basic, parts }, spacing) {
|
|
|
152
128
|
* `onOpenChange` to `Dialog.Content` instead.
|
|
153
129
|
*/
|
|
154
130
|
function Dialog(t0) {
|
|
155
|
-
const $ = c(
|
|
131
|
+
const $ = c(10);
|
|
156
132
|
const { children, defaultOpen, isOpen, onOpenChange } = t0;
|
|
157
133
|
let t1;
|
|
158
134
|
if ($[0] !== defaultOpen || $[1] !== isOpen || $[2] !== onOpenChange) {
|
|
@@ -166,51 +142,28 @@ function Dialog(t0) {
|
|
|
166
142
|
$[2] = onOpenChange;
|
|
167
143
|
$[3] = t1;
|
|
168
144
|
} else t1 = $[3];
|
|
169
|
-
const
|
|
170
|
-
const [trigger, setTrigger] = useState(null);
|
|
145
|
+
const { context, slots } = useModalTrigger(t1);
|
|
171
146
|
let t2;
|
|
172
|
-
if ($[4] !==
|
|
173
|
-
t2 = {
|
|
174
|
-
state,
|
|
175
|
-
trigger
|
|
176
|
-
};
|
|
177
|
-
$[4] = state;
|
|
178
|
-
$[5] = trigger;
|
|
179
|
-
$[6] = t2;
|
|
180
|
-
} else t2 = $[6];
|
|
181
|
-
const context = t2;
|
|
182
|
-
let t3;
|
|
183
|
-
if ($[7] !== state) {
|
|
184
|
-
t3 = { default: (event) => {
|
|
185
|
-
const target = event.currentTarget;
|
|
186
|
-
setTrigger(typeof target === "number" ? null : target);
|
|
187
|
-
state.open();
|
|
188
|
-
} };
|
|
189
|
-
$[7] = state;
|
|
190
|
-
$[8] = t3;
|
|
191
|
-
} else t3 = $[8];
|
|
192
|
-
const slots = t3;
|
|
193
|
-
let t4;
|
|
194
|
-
if ($[9] !== children || $[10] !== slots) {
|
|
195
|
-
t4 = /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
147
|
+
if ($[4] !== children || $[5] !== slots) {
|
|
148
|
+
t2 = /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
196
149
|
value: slots,
|
|
197
150
|
children
|
|
198
151
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
} else
|
|
203
|
-
let
|
|
204
|
-
if ($[
|
|
205
|
-
|
|
152
|
+
$[4] = children;
|
|
153
|
+
$[5] = slots;
|
|
154
|
+
$[6] = t2;
|
|
155
|
+
} else t2 = $[6];
|
|
156
|
+
let t3;
|
|
157
|
+
if ($[7] !== context || $[8] !== t2) {
|
|
158
|
+
t3 = /* @__PURE__ */ jsx(DialogTriggerContext, {
|
|
206
159
|
value: context,
|
|
207
|
-
children:
|
|
160
|
+
children: t2
|
|
208
161
|
});
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
} else
|
|
213
|
-
return
|
|
162
|
+
$[7] = context;
|
|
163
|
+
$[8] = t2;
|
|
164
|
+
$[9] = t3;
|
|
165
|
+
} else t3 = $[9];
|
|
166
|
+
return t3;
|
|
214
167
|
}
|
|
215
168
|
/**
|
|
216
169
|
* What the dialog shows, as a body that scrolls when its content runs past
|
|
@@ -316,7 +269,7 @@ function DialogBody(t0) {
|
|
|
316
269
|
* `style`, `ref` and `testID` land on the container.
|
|
317
270
|
*/
|
|
318
271
|
function DialogContent(t0) {
|
|
319
|
-
const $ = c(
|
|
272
|
+
const $ = c(49);
|
|
320
273
|
let children;
|
|
321
274
|
let defaultOpen;
|
|
322
275
|
let isOpen;
|
|
@@ -365,8 +318,7 @@ function DialogContent(t0) {
|
|
|
365
318
|
$[12] = onOpenChange;
|
|
366
319
|
$[13] = t4;
|
|
367
320
|
} else t4 = $[13];
|
|
368
|
-
const
|
|
369
|
-
const state = outer?.state ?? own;
|
|
321
|
+
const { close, present, setPresent, slots, state } = useModalState(outer, t4);
|
|
370
322
|
const theme = useTheme();
|
|
371
323
|
const styles = stylesOf(theme);
|
|
372
324
|
const insets = use(SafeAreaInsetsContext) ?? NO_INSETS;
|
|
@@ -381,133 +333,110 @@ function DialogContent(t0) {
|
|
|
381
333
|
} else t5 = $[14];
|
|
382
334
|
const [register] = useState(t5);
|
|
383
335
|
const [title, setTitle] = useState(null);
|
|
384
|
-
const [present, setPresent] = useState(state.isOpen);
|
|
385
336
|
const motion = useDialogMotion(state.isOpen, present, setPresent, basic);
|
|
386
337
|
let t6;
|
|
387
|
-
if ($[15] !==
|
|
388
|
-
t6 =
|
|
389
|
-
state.close();
|
|
390
|
-
};
|
|
391
|
-
$[15] = state;
|
|
392
|
-
$[16] = t6;
|
|
393
|
-
} else t6 = $[16];
|
|
394
|
-
const close = t6;
|
|
395
|
-
let t7;
|
|
396
|
-
if ($[17] !== close) {
|
|
397
|
-
t7 = { close };
|
|
398
|
-
$[17] = close;
|
|
399
|
-
$[18] = t7;
|
|
400
|
-
} else t7 = $[18];
|
|
401
|
-
const slots = t7;
|
|
402
|
-
let t8;
|
|
403
|
-
if ($[19] !== basic || $[20] !== parts || $[21] !== register || $[22] !== titleId) {
|
|
404
|
-
t8 = {
|
|
338
|
+
if ($[15] !== basic || $[16] !== parts || $[17] !== register || $[18] !== titleId) {
|
|
339
|
+
t6 = {
|
|
405
340
|
basic,
|
|
406
341
|
parts,
|
|
407
342
|
register,
|
|
408
343
|
setTitle,
|
|
409
344
|
titleId
|
|
410
345
|
};
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
} else
|
|
417
|
-
const layout =
|
|
418
|
-
if (state.isOpen && !present) setPresent(true);
|
|
419
|
-
useReturnFocus(present, outer);
|
|
346
|
+
$[15] = basic;
|
|
347
|
+
$[16] = parts;
|
|
348
|
+
$[17] = register;
|
|
349
|
+
$[18] = titleId;
|
|
350
|
+
$[19] = t6;
|
|
351
|
+
} else t6 = $[19];
|
|
352
|
+
const layout = t6;
|
|
420
353
|
if (!present) return null;
|
|
421
354
|
const labelledBy = parts.title > 0 ? titleId : void 0;
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const t14 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 : insetsOf(insets), motion.panel, style);
|
|
441
|
-
let t15;
|
|
442
|
-
if ($[29] !== children || $[30] !== slots) {
|
|
443
|
-
t15 = /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
355
|
+
const T0 = ModalWindow;
|
|
356
|
+
const t7 = isDismissable && state.isOpen ? close : void 0;
|
|
357
|
+
const t8 = motion.scrim;
|
|
358
|
+
const T1 = View;
|
|
359
|
+
const t9 = composeStyles(styles.layout, basic ? void 0 : styles.layoutFull);
|
|
360
|
+
const t10 = Animated;
|
|
361
|
+
let t11;
|
|
362
|
+
if ($[20] !== labelledBy || $[21] !== role) {
|
|
363
|
+
t11 = panelRoleOf(role, labelledBy);
|
|
364
|
+
$[20] = labelledBy;
|
|
365
|
+
$[21] = role;
|
|
366
|
+
$[22] = t11;
|
|
367
|
+
} else t11 = $[22];
|
|
368
|
+
const t12 = isKeyboardDismissDisabled ? void 0 : close;
|
|
369
|
+
const t13 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 : insetsOf(insets), motion.panel, style);
|
|
370
|
+
let t14;
|
|
371
|
+
if ($[23] !== children || $[24] !== slots) {
|
|
372
|
+
t14 = /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
444
373
|
value: slots,
|
|
445
374
|
children
|
|
446
375
|
});
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
} else
|
|
451
|
-
let
|
|
452
|
-
if ($[
|
|
453
|
-
|
|
376
|
+
$[23] = children;
|
|
377
|
+
$[24] = slots;
|
|
378
|
+
$[25] = t14;
|
|
379
|
+
} else t14 = $[25];
|
|
380
|
+
let t15;
|
|
381
|
+
if ($[26] !== layout || $[27] !== t14) {
|
|
382
|
+
t15 = /* @__PURE__ */ jsx(DialogLayoutContext, {
|
|
454
383
|
value: layout,
|
|
384
|
+
children: t14
|
|
385
|
+
});
|
|
386
|
+
$[26] = layout;
|
|
387
|
+
$[27] = t14;
|
|
388
|
+
$[28] = t15;
|
|
389
|
+
} else t15 = $[28];
|
|
390
|
+
let t16;
|
|
391
|
+
if ($[29] !== props || $[30] !== t10.View || $[31] !== t11 || $[32] !== t12 || $[33] !== t13 || $[34] !== t15) {
|
|
392
|
+
t16 = /* @__PURE__ */ jsx(t10.View, {
|
|
393
|
+
...t11,
|
|
394
|
+
onAccessibilityEscape: t12,
|
|
395
|
+
...props,
|
|
396
|
+
style: t13,
|
|
455
397
|
children: t15
|
|
456
398
|
});
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
|
|
399
|
+
$[29] = props;
|
|
400
|
+
$[30] = t10.View;
|
|
401
|
+
$[31] = t11;
|
|
402
|
+
$[32] = t12;
|
|
403
|
+
$[33] = t13;
|
|
404
|
+
$[34] = t15;
|
|
405
|
+
$[35] = t16;
|
|
406
|
+
} else t16 = $[35];
|
|
461
407
|
let t17;
|
|
462
|
-
if ($[
|
|
463
|
-
t17 = /* @__PURE__ */ jsx(
|
|
464
|
-
|
|
465
|
-
onAccessibilityEscape: t13,
|
|
466
|
-
...props,
|
|
467
|
-
style: t14,
|
|
408
|
+
if ($[36] !== T1 || $[37] !== t16 || $[38] !== t9) {
|
|
409
|
+
t17 = /* @__PURE__ */ jsx(T1, {
|
|
410
|
+
style: t9,
|
|
468
411
|
children: t16
|
|
469
412
|
});
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
|
|
475
|
-
$[40] = t16;
|
|
476
|
-
$[41] = t17;
|
|
477
|
-
} else t17 = $[41];
|
|
413
|
+
$[36] = T1;
|
|
414
|
+
$[37] = t16;
|
|
415
|
+
$[38] = t9;
|
|
416
|
+
$[39] = t17;
|
|
417
|
+
} else t17 = $[39];
|
|
478
418
|
let t18;
|
|
479
|
-
if ($[
|
|
419
|
+
if ($[40] !== T0 || $[41] !== close || $[42] !== isKeyboardDismissDisabled || $[43] !== labelledBy || $[44] !== motion.scrim || $[45] !== t17 || $[46] !== t7 || $[47] !== title) {
|
|
480
420
|
t18 = /* @__PURE__ */ jsx(T0, {
|
|
481
|
-
|
|
421
|
+
isKeyboardDismissDisabled,
|
|
422
|
+
labelledBy,
|
|
423
|
+
onClose: close,
|
|
424
|
+
onScrimPress: t7,
|
|
425
|
+
scrim: t8,
|
|
426
|
+
title,
|
|
482
427
|
children: t17
|
|
483
428
|
});
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
statusBarTranslucent: true,
|
|
496
|
-
supportedOrientations: ORIENTATIONS,
|
|
497
|
-
transparent: true,
|
|
498
|
-
visible: true,
|
|
499
|
-
children: /* @__PURE__ */ jsx(ButtonSlotContext, {
|
|
500
|
-
value: null,
|
|
501
|
-
children: /* @__PURE__ */ jsxs(OverlayHost, { children: [/* @__PURE__ */ jsx(AnimatedPressable, {
|
|
502
|
-
accessible: false,
|
|
503
|
-
"aria-hidden": true,
|
|
504
|
-
focusable: false,
|
|
505
|
-
onPress: isDismissable && state.isOpen ? close : void 0,
|
|
506
|
-
style: composeStyles(styles.scrim, motion.scrim),
|
|
507
|
-
tabIndex: -1
|
|
508
|
-
}), t18] })
|
|
509
|
-
})
|
|
510
|
-
});
|
|
429
|
+
$[40] = T0;
|
|
430
|
+
$[41] = close;
|
|
431
|
+
$[42] = isKeyboardDismissDisabled;
|
|
432
|
+
$[43] = labelledBy;
|
|
433
|
+
$[44] = motion.scrim;
|
|
434
|
+
$[45] = t17;
|
|
435
|
+
$[46] = t7;
|
|
436
|
+
$[47] = title;
|
|
437
|
+
$[48] = t18;
|
|
438
|
+
} else t18 = $[48];
|
|
439
|
+
return t18;
|
|
511
440
|
}
|
|
512
441
|
/**
|
|
513
442
|
* The dialog's actions, at the trailing edge and wrapping onto another row
|
|
@@ -675,48 +604,6 @@ function DialogTitle(t0) {
|
|
|
675
604
|
} else t7 = $[15];
|
|
676
605
|
return t7;
|
|
677
606
|
}
|
|
678
|
-
function focusOf(title) {
|
|
679
|
-
return () => {
|
|
680
|
-
if (title !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(title, "focus");
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
function ignore() {}
|
|
684
|
-
function insetsOf(insets) {
|
|
685
|
-
return {
|
|
686
|
-
paddingBottom: insets.bottom,
|
|
687
|
-
paddingLeft: insets.left,
|
|
688
|
-
paddingRight: insets.right,
|
|
689
|
-
paddingTop: insets.top
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
function panelRoleOf(role, labelledBy) {
|
|
693
|
-
return {
|
|
694
|
-
"aria-labelledby": labelledBy,
|
|
695
|
-
"aria-modal": true,
|
|
696
|
-
role
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
function refsOf(own, other) {
|
|
700
|
-
return (node) => {
|
|
701
|
-
own(node);
|
|
702
|
-
if (typeof other === "function") other(node);
|
|
703
|
-
else if (other !== null && other !== void 0) other.current = node;
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
function registerOf(setParts) {
|
|
707
|
-
return (part) => {
|
|
708
|
-
setParts((parts) => ({
|
|
709
|
-
...parts,
|
|
710
|
-
[part]: parts[part] + 1
|
|
711
|
-
}));
|
|
712
|
-
return () => {
|
|
713
|
-
setParts((parts) => ({
|
|
714
|
-
...parts,
|
|
715
|
-
[part]: parts[part] - 1
|
|
716
|
-
}));
|
|
717
|
-
};
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
607
|
/**
|
|
721
608
|
* The scrim's and the panel's motion, and the timer that unmounts the dialog
|
|
722
609
|
* once its exit has run. The panel arrives over the medium duration on the
|
|
@@ -826,30 +713,6 @@ function useLayout(part) {
|
|
|
826
713
|
if (layout === null) throw new Error(`${part} is drawn inside Dialog.Content.`);
|
|
827
714
|
return layout;
|
|
828
715
|
}
|
|
829
|
-
function useReturnFocus(present, outer) {
|
|
830
|
-
const $ = c(6);
|
|
831
|
-
const shown = useRef(present);
|
|
832
|
-
let t0;
|
|
833
|
-
if ($[0] !== outer?.trigger || $[1] !== present) {
|
|
834
|
-
t0 = () => {
|
|
835
|
-
const trigger = outer?.trigger ?? null;
|
|
836
|
-
const gone = shown.current && !present;
|
|
837
|
-
shown.current = present;
|
|
838
|
-
if (gone && trigger !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(trigger, "focus");
|
|
839
|
-
};
|
|
840
|
-
$[0] = outer?.trigger;
|
|
841
|
-
$[1] = present;
|
|
842
|
-
$[2] = t0;
|
|
843
|
-
} else t0 = $[2];
|
|
844
|
-
let t1;
|
|
845
|
-
if ($[3] !== outer || $[4] !== present) {
|
|
846
|
-
t1 = [outer, present];
|
|
847
|
-
$[3] = outer;
|
|
848
|
-
$[4] = present;
|
|
849
|
-
$[5] = t1;
|
|
850
|
-
} else t1 = $[5];
|
|
851
|
-
useEffect(t0, t1);
|
|
852
|
-
}
|
|
853
716
|
Dialog.Body = DialogBody;
|
|
854
717
|
Dialog.Content = DialogContent;
|
|
855
718
|
Dialog.Footer = DialogFooter;
|