@dloizides/ui-layout 1.42.0 → 1.44.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/CHANGELOG.md +8 -0
- package/dist/index.d.mts +73 -8
- package/dist/index.d.ts +73 -8
- package/dist/index.js +434 -253
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +328 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleSheet, Platform, View, Text, useWindowDimensions, Modal as Modal$1, Animated,
|
|
1
|
+
import React16, { createContext, useMemo, useState, useRef, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
|
|
2
|
+
import { StyleSheet, Platform, View, Text, useWindowDimensions, Modal as Modal$1, Animated, ScrollView, TouchableOpacity, Pressable, FlatList, Easing } from 'react-native';
|
|
3
3
|
import { MODAL_OVERLAY_COLOR, useUi } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { Z_INDEX, UI_MAIN_STEP, UI_DEEP_STEP, isHexColor, canCarryAccessibleInk, resolveOnBrand } from '@dloizides/design-tokens';
|
|
5
6
|
import { IconButton, Button } from '@dloizides/ui-buttons';
|
|
6
7
|
import { SvgIcon } from '@dloizides/ui-icons';
|
|
7
8
|
import { useEnterExit, Collapse } from '@dloizides/ui-motion';
|
|
8
9
|
import { MIN_TOUCH_TARGET_PX, useA11y } from '@dloizides/a11y';
|
|
9
10
|
import { createPortal } from 'react-dom';
|
|
10
|
-
import { Z_INDEX } from '@dloizides/design-tokens';
|
|
11
11
|
import { useReducedMotion } from '@dloizides/rn-web-hooks';
|
|
12
12
|
|
|
13
13
|
// src/Section/Section.tsx
|
|
@@ -38,7 +38,7 @@ var Section = ({
|
|
|
38
38
|
const { theme } = useUi();
|
|
39
39
|
const isCard = variant === "card" /* Card */;
|
|
40
40
|
const fill = isCard ? theme.colors.background : theme.colors.surface;
|
|
41
|
-
const containerStyle =
|
|
41
|
+
const containerStyle = React16.useMemo(
|
|
42
42
|
() => [styles.card, isCard ? styles.raised : null, { borderColor: theme.colors.border, backgroundColor: fill }, style],
|
|
43
43
|
[theme.colors.border, fill, isCard, style]
|
|
44
44
|
);
|
|
@@ -90,6 +90,8 @@ var AppText = ({
|
|
|
90
90
|
var LAYOUT_TEST_IDS = {
|
|
91
91
|
headingText: "heading-text",
|
|
92
92
|
statusLabel: "status-label",
|
|
93
|
+
countBadge: "count-badge",
|
|
94
|
+
splitPanes: "split-panes",
|
|
93
95
|
stickyPreview: "sticky-preview",
|
|
94
96
|
pageFrame: "page-frame",
|
|
95
97
|
upgradePrompt: "upgrade-prompt",
|
|
@@ -128,6 +130,7 @@ var LAYOUT_I18N = {
|
|
|
128
130
|
accordionToggleHint: "common.accordionToggleHint",
|
|
129
131
|
/** Default accessible hint on a `StatusBadge` when the caller supplies none. */
|
|
130
132
|
statusBadgeHint: "common.statusBadgeHint",
|
|
133
|
+
countBadgeLabel: "common.countBadgeLabel",
|
|
131
134
|
/** `ModalShell`: accessible name of the dialog when its title is not a plain string. */
|
|
132
135
|
dialog: "common.dialog",
|
|
133
136
|
/** `ModalShell`: accessible hint on the close button. */
|
|
@@ -215,7 +218,7 @@ var Heading = ({
|
|
|
215
218
|
testID
|
|
216
219
|
}) => {
|
|
217
220
|
const { theme } = useUi();
|
|
218
|
-
const headingStyle =
|
|
221
|
+
const headingStyle = React16.useMemo(
|
|
219
222
|
() => [styles3.heading, { color: theme.colors.text }, style],
|
|
220
223
|
[theme.colors.text, style]
|
|
221
224
|
);
|
|
@@ -230,6 +233,40 @@ var Heading = ({
|
|
|
230
233
|
}
|
|
231
234
|
);
|
|
232
235
|
};
|
|
236
|
+
|
|
237
|
+
// src/StatusBadge/BadgeTone.ts
|
|
238
|
+
var BadgeTone = /* @__PURE__ */ ((BadgeTone2) => {
|
|
239
|
+
BadgeTone2["Neutral"] = "neutral";
|
|
240
|
+
BadgeTone2["Info"] = "info";
|
|
241
|
+
BadgeTone2["Success"] = "success";
|
|
242
|
+
BadgeTone2["Warning"] = "warning";
|
|
243
|
+
BadgeTone2["Danger"] = "danger";
|
|
244
|
+
return BadgeTone2;
|
|
245
|
+
})(BadgeTone || {});
|
|
246
|
+
function scaleFor(theme, tone) {
|
|
247
|
+
const semantic = theme.semantic;
|
|
248
|
+
if (tone === "danger" /* Danger */) return theme.semantic.error;
|
|
249
|
+
if (tone === "success" /* Success */) return semantic.success;
|
|
250
|
+
if (tone === "warning" /* Warning */) return semantic.warning;
|
|
251
|
+
if (tone === "info" /* Info */) return semantic.info ?? theme.palette.primary;
|
|
252
|
+
return void 0;
|
|
253
|
+
}
|
|
254
|
+
function readableInk(fill) {
|
|
255
|
+
if (fill === void 0 || !isHexColor(fill) || !canCarryAccessibleInk(fill)) return null;
|
|
256
|
+
return resolveOnBrand(fill);
|
|
257
|
+
}
|
|
258
|
+
function neutralColors(colors) {
|
|
259
|
+
return { color: colors.text, backgroundColor: colors.surfaceElevated };
|
|
260
|
+
}
|
|
261
|
+
function resolveToneColors(theme, tone) {
|
|
262
|
+
const scale = scaleFor(theme, tone);
|
|
263
|
+
if (scale === void 0) return neutralColors(theme.colors);
|
|
264
|
+
for (const fill of [scale[UI_MAIN_STEP], scale[UI_DEEP_STEP]]) {
|
|
265
|
+
const ink = readableInk(fill);
|
|
266
|
+
if (ink !== null && fill !== void 0) return { color: ink, backgroundColor: fill };
|
|
267
|
+
}
|
|
268
|
+
return neutralColors(theme.colors);
|
|
269
|
+
}
|
|
233
270
|
var DEFAULT_PADDING_H = 10;
|
|
234
271
|
var DEFAULT_PADDING_V = 4;
|
|
235
272
|
var DEFAULT_BORDER_RADIUS = 12;
|
|
@@ -261,15 +298,19 @@ var styles4 = StyleSheet.create({
|
|
|
261
298
|
});
|
|
262
299
|
var StatusBadge = ({
|
|
263
300
|
label,
|
|
264
|
-
|
|
265
|
-
|
|
301
|
+
tone = "neutral" /* Neutral */,
|
|
302
|
+
color: rawColor,
|
|
303
|
+
backgroundColor: rawBackground,
|
|
266
304
|
icon,
|
|
267
305
|
dashed = false,
|
|
268
306
|
testID = LAYOUT_TEST_IDS.statusLabel,
|
|
269
307
|
accessibilityLabel,
|
|
270
308
|
accessibilityHint
|
|
271
309
|
}) => {
|
|
272
|
-
const { t } = useUi();
|
|
310
|
+
const { t, theme } = useUi();
|
|
311
|
+
const toned = useMemo(() => resolveToneColors(theme, tone), [theme, tone]);
|
|
312
|
+
const color = rawColor ?? toned.color;
|
|
313
|
+
const backgroundColor = rawBackground ?? toned.backgroundColor;
|
|
273
314
|
const dynamicBadge = useMemo(() => ({ backgroundColor }), [backgroundColor]);
|
|
274
315
|
const dashedColor = useMemo(() => ({ borderColor: color }), [color]);
|
|
275
316
|
const dynamicText = useMemo(() => ({ color }), [color]);
|
|
@@ -288,6 +329,98 @@ var StatusBadge = ({
|
|
|
288
329
|
}
|
|
289
330
|
);
|
|
290
331
|
};
|
|
332
|
+
|
|
333
|
+
// src/CountBadge/formatCount.ts
|
|
334
|
+
var OVERFLOW_SUFFIX = "+";
|
|
335
|
+
function formatCount(count, max) {
|
|
336
|
+
const whole = Math.max(0, Math.floor(count));
|
|
337
|
+
if (whole > max) return `${String(max)}${OVERFLOW_SUFFIX}`;
|
|
338
|
+
return String(whole);
|
|
339
|
+
}
|
|
340
|
+
var DEFAULT_MAX = 99;
|
|
341
|
+
var BADGE_SIZE = 20;
|
|
342
|
+
var BADGE_PADDING_H = 6;
|
|
343
|
+
var BADGE_FONT_SIZE = 12;
|
|
344
|
+
var styles5 = StyleSheet.create({
|
|
345
|
+
badge: {
|
|
346
|
+
minWidth: BADGE_SIZE,
|
|
347
|
+
height: BADGE_SIZE,
|
|
348
|
+
borderRadius: BADGE_SIZE / 2,
|
|
349
|
+
paddingHorizontal: BADGE_PADDING_H,
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
justifyContent: "center",
|
|
352
|
+
alignSelf: "flex-start"
|
|
353
|
+
},
|
|
354
|
+
text: { fontSize: BADGE_FONT_SIZE, fontWeight: "700" }
|
|
355
|
+
});
|
|
356
|
+
var CountBadge = ({
|
|
357
|
+
count,
|
|
358
|
+
max = DEFAULT_MAX,
|
|
359
|
+
tone = "neutral" /* Neutral */,
|
|
360
|
+
showZero = false,
|
|
361
|
+
testID = LAYOUT_TEST_IDS.countBadge,
|
|
362
|
+
accessibilityLabel
|
|
363
|
+
}) => {
|
|
364
|
+
const { theme, t } = useUi();
|
|
365
|
+
const toned = useMemo(() => resolveToneColors(theme, tone), [theme, tone]);
|
|
366
|
+
const badgeStyle = useMemo(() => [styles5.badge, { backgroundColor: toned.backgroundColor }], [toned.backgroundColor]);
|
|
367
|
+
const textStyle = useMemo(() => [styles5.text, { color: toned.color }], [toned.color]);
|
|
368
|
+
const text = formatCount(count, max);
|
|
369
|
+
const isHidden = text === "0" && !showZero;
|
|
370
|
+
if (isHidden) return null;
|
|
371
|
+
return /* @__PURE__ */ jsx(
|
|
372
|
+
View,
|
|
373
|
+
{
|
|
374
|
+
accessibilityLabel: accessibilityLabel ?? t(LAYOUT_I18N.countBadgeLabel, text),
|
|
375
|
+
style: badgeStyle,
|
|
376
|
+
testID,
|
|
377
|
+
children: /* @__PURE__ */ jsx(Text, { style: textStyle, children: text })
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
// src/SplitPanes/SplitLayout.ts
|
|
383
|
+
var SplitLayout = /* @__PURE__ */ ((SplitLayout2) => {
|
|
384
|
+
SplitLayout2["Auto"] = "auto";
|
|
385
|
+
SplitLayout2["Stack"] = "stack";
|
|
386
|
+
SplitLayout2["Side"] = "side";
|
|
387
|
+
return SplitLayout2;
|
|
388
|
+
})(SplitLayout || {});
|
|
389
|
+
|
|
390
|
+
// src/SplitPanes/isSplitSideBySide.ts
|
|
391
|
+
function isSplitSideBySide(layout, width, breakpoint) {
|
|
392
|
+
if (layout === "side" /* Side */) return true;
|
|
393
|
+
if (layout === "stack" /* Stack */) return false;
|
|
394
|
+
return width >= breakpoint;
|
|
395
|
+
}
|
|
396
|
+
var DEFAULT_GAP = 12;
|
|
397
|
+
var DEFAULT_WEIGHT = 1;
|
|
398
|
+
var styles6 = StyleSheet.create({
|
|
399
|
+
row: { flexDirection: "row", alignItems: "flex-start", width: "100%" },
|
|
400
|
+
column: { flexDirection: "column", width: "100%" },
|
|
401
|
+
sidePane: { flexBasis: 0, flexShrink: 1, minWidth: 0 },
|
|
402
|
+
stackPane: { width: "100%", minWidth: 0 }
|
|
403
|
+
});
|
|
404
|
+
var SplitPanes = ({
|
|
405
|
+
start,
|
|
406
|
+
end,
|
|
407
|
+
layout = "auto" /* Auto */,
|
|
408
|
+
startWeight = DEFAULT_WEIGHT,
|
|
409
|
+
endWeight = DEFAULT_WEIGHT,
|
|
410
|
+
gap = DEFAULT_GAP,
|
|
411
|
+
breakpoint = LAYOUT_COLLAPSE_BREAKPOINT,
|
|
412
|
+
testID = LAYOUT_TEST_IDS.splitPanes
|
|
413
|
+
}) => {
|
|
414
|
+
const { width } = useWindowDimensions();
|
|
415
|
+
const isSide = isSplitSideBySide(layout, width, breakpoint);
|
|
416
|
+
const container = useMemo(() => [isSide ? styles6.row : styles6.column, { gap }], [isSide, gap]);
|
|
417
|
+
const startStyle = isSide ? [styles6.sidePane, { flexGrow: startWeight }] : styles6.stackPane;
|
|
418
|
+
const endStyle = isSide ? [styles6.sidePane, { flexGrow: endWeight }] : styles6.stackPane;
|
|
419
|
+
return /* @__PURE__ */ jsxs(View, { style: container, testID, children: [
|
|
420
|
+
/* @__PURE__ */ jsx(View, { style: startStyle, testID: `${testID}-start`, children: start }),
|
|
421
|
+
/* @__PURE__ */ jsx(View, { style: endStyle, testID: `${testID}-end`, children: end })
|
|
422
|
+
] });
|
|
423
|
+
};
|
|
291
424
|
function isPastStickyLine(sentinelTop, isIntersecting, topOffset) {
|
|
292
425
|
return !isIntersecting && sentinelTop < topOffset;
|
|
293
426
|
}
|
|
@@ -343,7 +476,7 @@ function useVisibleViewport() {
|
|
|
343
476
|
return state;
|
|
344
477
|
}
|
|
345
478
|
var STICKY_Z_INDEX = 5;
|
|
346
|
-
var
|
|
479
|
+
var styles7 = StyleSheet.create({
|
|
347
480
|
sentinel: { height: 1, marginBottom: -1 },
|
|
348
481
|
compact: { borderBottomWidth: 1 }
|
|
349
482
|
});
|
|
@@ -365,7 +498,7 @@ var StickyPreview = ({
|
|
|
365
498
|
return Platform.OS === WEB_PLATFORM ? web : {};
|
|
366
499
|
}, [offsetTop, topOffset]);
|
|
367
500
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
368
|
-
/* @__PURE__ */ jsx(View, { "aria-hidden": true, ref: sentinelRef, style:
|
|
501
|
+
/* @__PURE__ */ jsx(View, { "aria-hidden": true, ref: sentinelRef, style: styles7.sentinel }),
|
|
369
502
|
/* @__PURE__ */ jsx(
|
|
370
503
|
View,
|
|
371
504
|
{
|
|
@@ -375,7 +508,7 @@ var StickyPreview = ({
|
|
|
375
508
|
style: [
|
|
376
509
|
pinned,
|
|
377
510
|
{ backgroundColor: theme.colors.background, borderColor: theme.colors.border },
|
|
378
|
-
isCompact &&
|
|
511
|
+
isCompact && styles7.compact
|
|
379
512
|
],
|
|
380
513
|
testID,
|
|
381
514
|
children: /* @__PURE__ */ jsx(View, { testID: `${testID}-${isCompact ? "compact" : "full"}`, children: isCompact ? compact : full })
|
|
@@ -420,8 +553,14 @@ function getFocusableElements(container) {
|
|
|
420
553
|
function savePreviousFocus() {
|
|
421
554
|
return document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
422
555
|
}
|
|
556
|
+
var MAX_ATTACH_FRAMES = 10;
|
|
557
|
+
function findNamed(domNode, initialFocusTestID) {
|
|
558
|
+
if (initialFocusTestID === void 0) return null;
|
|
559
|
+
const selector = `[data-testid="${initialFocusTestID}"]`;
|
|
560
|
+
return domNode.matches(selector) ? domNode : domNode.querySelector(selector);
|
|
561
|
+
}
|
|
423
562
|
function focusInitial(domNode, initialFocusTestID) {
|
|
424
|
-
const named =
|
|
563
|
+
const named = findNamed(domNode, initialFocusTestID);
|
|
425
564
|
if (named) {
|
|
426
565
|
named.focus();
|
|
427
566
|
return;
|
|
@@ -455,15 +594,29 @@ function useFocusTrap(containerRef, enabled, initialFocusTestID) {
|
|
|
455
594
|
const previousFocusRef = useRef(null);
|
|
456
595
|
useEffect(() => {
|
|
457
596
|
if (Platform.OS !== "web" || !enabled) return;
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
597
|
+
let domNode = null;
|
|
598
|
+
let frame = 0;
|
|
599
|
+
let attempts = 0;
|
|
600
|
+
const listener = (e) => {
|
|
601
|
+
if (domNode) handleKeyDown(domNode, e);
|
|
602
|
+
};
|
|
603
|
+
const attach = () => {
|
|
604
|
+
const node = containerRef.current;
|
|
605
|
+
if (!node) {
|
|
606
|
+
attempts += 1;
|
|
607
|
+
if (attempts <= MAX_ATTACH_FRAMES) frame = requestAnimationFrame(attach);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
domNode = node;
|
|
611
|
+
const previous = savePreviousFocus();
|
|
612
|
+
previousFocusRef.current = previous !== null && node.contains(previous) ? null : previous;
|
|
613
|
+
queueMicrotask(() => focusInitial(node, initialFocusTestID));
|
|
614
|
+
node.addEventListener("keydown", listener);
|
|
615
|
+
};
|
|
616
|
+
attach();
|
|
465
617
|
return () => {
|
|
466
|
-
|
|
618
|
+
cancelAnimationFrame(frame);
|
|
619
|
+
domNode?.removeEventListener("keydown", listener);
|
|
467
620
|
previousFocusRef.current?.focus();
|
|
468
621
|
previousFocusRef.current = null;
|
|
469
622
|
};
|
|
@@ -490,7 +643,7 @@ var HEADER_MARGIN = 12;
|
|
|
490
643
|
var DIALOG_MAX_HEIGHT = "90%";
|
|
491
644
|
var PANEL_ENTER_SCALE = 0.96;
|
|
492
645
|
var SIZE_MAX_WIDTH = { sm: 360, md: 480, lg: 640, xl: 880 };
|
|
493
|
-
var
|
|
646
|
+
var styles8 = StyleSheet.create({
|
|
494
647
|
overlay: {
|
|
495
648
|
flex: 1,
|
|
496
649
|
justifyContent: "center",
|
|
@@ -502,7 +655,9 @@ var styles6 = StyleSheet.create({
|
|
|
502
655
|
// react-native-web, which is why the fade is driven by `Animated` instead. `pointerEvents` lives
|
|
503
656
|
// in style (not the deprecated prop) so taps fall through to the sibling tap-catcher below.
|
|
504
657
|
scrim: { backgroundColor: MODAL_OVERLAY_COLOR, pointerEvents: "none" },
|
|
658
|
+
backdrop: { zIndex: 0 },
|
|
505
659
|
dialog: {
|
|
660
|
+
zIndex: 1,
|
|
506
661
|
width: "100%",
|
|
507
662
|
borderRadius: DIALOG_RADIUS,
|
|
508
663
|
padding: DIALOG_PADDING,
|
|
@@ -535,7 +690,7 @@ var styles6 = StyleSheet.create({
|
|
|
535
690
|
});
|
|
536
691
|
var ModalFooter = ({ children, testID }) => {
|
|
537
692
|
const { width } = useWindowDimensions();
|
|
538
|
-
const style = isModalFooterStacked(width) ?
|
|
693
|
+
const style = isModalFooterStacked(width) ? styles8.footerStack : styles8.footerRow;
|
|
539
694
|
return /* @__PURE__ */ jsx(View, { style, testID, children });
|
|
540
695
|
};
|
|
541
696
|
var Modal = ({
|
|
@@ -561,29 +716,17 @@ var Modal = ({
|
|
|
561
716
|
const accessibleName = accessibilityLabel ?? title ?? t(LAYOUT_I18N.dialog);
|
|
562
717
|
const closeLabel = t(LAYOUT_I18N.dialogClose);
|
|
563
718
|
const dialogStyle = useMemo(
|
|
564
|
-
() => [
|
|
719
|
+
() => [styles8.dialog, { backgroundColor: theme.colors.surface, maxWidth: SIZE_MAX_WIDTH[size] }],
|
|
565
720
|
[theme.colors.surface, size]
|
|
566
721
|
);
|
|
567
722
|
const hasHeader = title !== void 0 || showClose;
|
|
723
|
+
const focusesDialog = initialFocusTestID === testID;
|
|
568
724
|
const hardwareBackClose = Platform.OS === "web" ? void 0 : onClose;
|
|
569
|
-
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style:
|
|
725
|
+
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style: styles8.overlay, children: [
|
|
570
726
|
/* @__PURE__ */ jsx(
|
|
571
727
|
Animated.View,
|
|
572
728
|
{
|
|
573
|
-
style: [StyleSheet.absoluteFill,
|
|
574
|
-
}
|
|
575
|
-
),
|
|
576
|
-
/* @__PURE__ */ jsx(
|
|
577
|
-
TouchableOpacity,
|
|
578
|
-
{
|
|
579
|
-
accessible: true,
|
|
580
|
-
accessibilityHint: t(LAYOUT_I18N.dismissDropdownHint),
|
|
581
|
-
accessibilityLabel: t(LAYOUT_I18N.dismissDropdown),
|
|
582
|
-
accessibilityRole: "button",
|
|
583
|
-
activeOpacity: 1,
|
|
584
|
-
style: StyleSheet.absoluteFill,
|
|
585
|
-
testID: `${testID}-backdrop`,
|
|
586
|
-
onPress: onClose
|
|
729
|
+
style: [StyleSheet.absoluteFill, styles8.scrim, { opacity: backdrop.style.opacity }]
|
|
587
730
|
}
|
|
588
731
|
),
|
|
589
732
|
/* @__PURE__ */ jsxs(
|
|
@@ -594,10 +737,11 @@ var Modal = ({
|
|
|
594
737
|
"aria-label": accessibleName,
|
|
595
738
|
role: "dialog",
|
|
596
739
|
style: [dialogStyle, panel.style],
|
|
740
|
+
tabIndex: focusesDialog ? -1 : void 0,
|
|
597
741
|
testID,
|
|
598
742
|
children: [
|
|
599
|
-
hasHeader ? /* @__PURE__ */ jsxs(View, { style:
|
|
600
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
743
|
+
hasHeader ? /* @__PURE__ */ jsxs(View, { style: styles8.headerRow, children: [
|
|
744
|
+
/* @__PURE__ */ jsx(View, { style: styles8.titleWrap, children: title !== void 0 ? /* @__PURE__ */ jsx(Heading, { children: title }) : null }),
|
|
601
745
|
showClose ? /* @__PURE__ */ jsx(
|
|
602
746
|
IconButton,
|
|
603
747
|
{
|
|
@@ -617,6 +761,20 @@ var Modal = ({
|
|
|
617
761
|
footer !== void 0 ? /* @__PURE__ */ jsx(ModalFooter, { testID: `${testID}-footer`, children: footer }) : null
|
|
618
762
|
]
|
|
619
763
|
}
|
|
764
|
+
),
|
|
765
|
+
/* @__PURE__ */ jsx(
|
|
766
|
+
TouchableOpacity,
|
|
767
|
+
{
|
|
768
|
+
accessible: true,
|
|
769
|
+
accessibilityHint: t(LAYOUT_I18N.dismissDropdownHint),
|
|
770
|
+
accessibilityLabel: t(LAYOUT_I18N.dismissDropdown),
|
|
771
|
+
accessibilityRole: "button",
|
|
772
|
+
activeOpacity: 1,
|
|
773
|
+
style: [StyleSheet.absoluteFill, styles8.backdrop],
|
|
774
|
+
focusable: false,
|
|
775
|
+
testID: `${testID}-backdrop`,
|
|
776
|
+
onPress: onClose
|
|
777
|
+
}
|
|
620
778
|
)
|
|
621
779
|
] }) });
|
|
622
780
|
};
|
|
@@ -649,7 +807,7 @@ var scaledFrame = (containerWidth, page) => {
|
|
|
649
807
|
offsetY: (scale - 1) * page.height / HALF
|
|
650
808
|
};
|
|
651
809
|
};
|
|
652
|
-
var
|
|
810
|
+
var styles9 = StyleSheet.create({
|
|
653
811
|
outer: { width: "100%", overflow: "hidden" },
|
|
654
812
|
page: { position: "absolute", top: 0, left: 0 },
|
|
655
813
|
trigger: { width: "100%", cursor: "pointer" }
|
|
@@ -669,11 +827,11 @@ var PageFrame = ({
|
|
|
669
827
|
const open = useCallback(() => setEnlarged(true), []);
|
|
670
828
|
const close = useCallback(() => setEnlarged(false), []);
|
|
671
829
|
const frame = scaledFrame(containerWidth, pageSize);
|
|
672
|
-
const preview = /* @__PURE__ */ jsx(View, { style: [
|
|
830
|
+
const preview = /* @__PURE__ */ jsx(View, { style: [styles9.outer, { height: frame.height }], testID, onLayout, children: /* @__PURE__ */ jsx(
|
|
673
831
|
View,
|
|
674
832
|
{
|
|
675
833
|
style: [
|
|
676
|
-
|
|
834
|
+
styles9.page,
|
|
677
835
|
{
|
|
678
836
|
width: pageSize.width,
|
|
679
837
|
height: pageSize.height,
|
|
@@ -691,7 +849,7 @@ var PageFrame = ({
|
|
|
691
849
|
accessibilityHint: t(LAYOUT_I18N.pageEnlargeHint),
|
|
692
850
|
accessibilityLabel: t(LAYOUT_I18N.pageEnlarge),
|
|
693
851
|
accessibilityRole: "button",
|
|
694
|
-
style:
|
|
852
|
+
style: styles9.trigger,
|
|
695
853
|
testID: `${testID}-enlarge`,
|
|
696
854
|
onPress: open,
|
|
697
855
|
children: preview
|
|
@@ -711,7 +869,7 @@ var BORDER_WIDTH = 1;
|
|
|
711
869
|
var SEGMENT_BOX_SHADOW = "0px 1px 3px rgba(20, 30, 50, 0.1)";
|
|
712
870
|
var SHADOW_ELEVATION = 2;
|
|
713
871
|
var TRANSPARENT = "transparent";
|
|
714
|
-
var
|
|
872
|
+
var styles10 = StyleSheet.create({
|
|
715
873
|
track: {
|
|
716
874
|
flexDirection: "row",
|
|
717
875
|
alignSelf: "flex-start",
|
|
@@ -756,7 +914,7 @@ function SegmentedControl({
|
|
|
756
914
|
{
|
|
757
915
|
accessibilityRole: "tablist",
|
|
758
916
|
"aria-label": accessibilityLabel,
|
|
759
|
-
style: [
|
|
917
|
+
style: [styles10.track, { backgroundColor: colors.background, borderColor: colors.border }, style],
|
|
760
918
|
testID,
|
|
761
919
|
children: options.map((opt) => {
|
|
762
920
|
const selected = opt.value === value;
|
|
@@ -769,13 +927,13 @@ function SegmentedControl({
|
|
|
769
927
|
accessibilityHint: opt.accessibilityHint,
|
|
770
928
|
onPress: () => onChange(opt.value),
|
|
771
929
|
style: [
|
|
772
|
-
|
|
773
|
-
selected ?
|
|
930
|
+
styles10.segment,
|
|
931
|
+
selected ? styles10.segmentSelected : null,
|
|
774
932
|
{ backgroundColor: selected ? colors.surface : TRANSPARENT }
|
|
775
933
|
],
|
|
776
934
|
testID: opt.testID,
|
|
777
935
|
...ariaSelectedProps(selected),
|
|
778
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
936
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.label, { color: selected ? colors.text : colors.textSecondary }], children: opt.label })
|
|
779
937
|
},
|
|
780
938
|
opt.value
|
|
781
939
|
);
|
|
@@ -867,7 +1025,7 @@ var HEADING_PADDING_H = 16;
|
|
|
867
1025
|
var HEADING_PADDING_TOP = 8;
|
|
868
1026
|
var HEADING_PADDING_BOTTOM = 4;
|
|
869
1027
|
var HEADING_LETTER_SPACING = 0.5;
|
|
870
|
-
var
|
|
1028
|
+
var styles11 = StyleSheet.create({
|
|
871
1029
|
heading: {
|
|
872
1030
|
fontSize: HEADING_FONT_SIZE,
|
|
873
1031
|
fontWeight: HEADING_FONT_WEIGHT,
|
|
@@ -883,7 +1041,7 @@ var MenuHeading = ({ testID, text }) => {
|
|
|
883
1041
|
Text,
|
|
884
1042
|
{
|
|
885
1043
|
accessibilityRole: "header",
|
|
886
|
-
style: [
|
|
1044
|
+
style: [styles11.heading, { color: theme.colors.textSecondary }],
|
|
887
1045
|
testID: `${testID}-menu-heading`,
|
|
888
1046
|
children: text
|
|
889
1047
|
}
|
|
@@ -904,7 +1062,7 @@ var OPTION_PADDING_V = 12;
|
|
|
904
1062
|
var ACCENT_BAR_WIDTH = 3;
|
|
905
1063
|
var CHECK_GAP = 8;
|
|
906
1064
|
var CHECK_GLYPH = "\u2713";
|
|
907
|
-
var
|
|
1065
|
+
var styles12 = StyleSheet.create({
|
|
908
1066
|
option: {
|
|
909
1067
|
paddingHorizontal: OPTION_PADDING_H,
|
|
910
1068
|
paddingVertical: OPTION_PADDING_V,
|
|
@@ -943,16 +1101,16 @@ var OptionRow = ({
|
|
|
943
1101
|
const isMarked = selectedMarker === "accent-check" /* AccentCheck */;
|
|
944
1102
|
const isActive = isSelected || isHighlighted;
|
|
945
1103
|
const rowStyle = [
|
|
946
|
-
|
|
947
|
-
isMarked ?
|
|
1104
|
+
styles12.option,
|
|
1105
|
+
isMarked ? styles12.markedRow : null,
|
|
948
1106
|
isActive ? { backgroundColor: colors.surfaceElevated } : null,
|
|
949
1107
|
isMarked && isSelected ? { borderLeftColor: accentColor } : null
|
|
950
1108
|
];
|
|
951
1109
|
const textStyle = [
|
|
952
|
-
|
|
1110
|
+
styles12.optionText,
|
|
953
1111
|
{ color: colors.text },
|
|
954
|
-
isSelected ?
|
|
955
|
-
isMarked ?
|
|
1112
|
+
isSelected ? styles12.selectedText : null,
|
|
1113
|
+
isMarked ? styles12.markedText : null
|
|
956
1114
|
];
|
|
957
1115
|
const selectionProps = asMenuItem ? { "aria-current": isSelected ? "true" : void 0 } : { "aria-selected": isSelected };
|
|
958
1116
|
return /* @__PURE__ */ jsxs(
|
|
@@ -968,7 +1126,7 @@ var OptionRow = ({
|
|
|
968
1126
|
onPress: handlePress,
|
|
969
1127
|
children: [
|
|
970
1128
|
/* @__PURE__ */ jsx(Text, { style: textStyle, children: label }),
|
|
971
|
-
isMarked && isSelected ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, testID: `${testID}-check`, children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1129
|
+
isMarked && isSelected ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, testID: `${testID}-check`, children: /* @__PURE__ */ jsx(Text, { style: [styles12.selectedText, { color: accentColor }], children: CHECK_GLYPH }) }) : null
|
|
972
1130
|
]
|
|
973
1131
|
}
|
|
974
1132
|
);
|
|
@@ -1149,7 +1307,7 @@ var IS_WEB3 = Platform.OS === "web";
|
|
|
1149
1307
|
var BORDER_RADIUS2 = 8;
|
|
1150
1308
|
var BORDER_WIDTH3 = 1;
|
|
1151
1309
|
var MENU_PADDING2 = 4;
|
|
1152
|
-
var
|
|
1310
|
+
var styles13 = StyleSheet.create({
|
|
1153
1311
|
/** Native (in-tree) popover — anchored absolutely just under the trigger. */
|
|
1154
1312
|
popover: {
|
|
1155
1313
|
position: "absolute",
|
|
@@ -1239,9 +1397,9 @@ var InlineMenu = ({
|
|
|
1239
1397
|
themed
|
|
1240
1398
|
];
|
|
1241
1399
|
}
|
|
1242
|
-
return [
|
|
1400
|
+
return [styles13.popover, { minWidth: menuMinWidth }, themed];
|
|
1243
1401
|
}, [colors.border, colors.surface, menuMinWidth, placement, rect]);
|
|
1244
|
-
const scrollStyle = IS_WEB3 ? { maxHeight: menuScrollMaxHeight(placement.maxHeight) } :
|
|
1402
|
+
const scrollStyle = IS_WEB3 ? { maxHeight: menuScrollMaxHeight(placement.maxHeight) } : styles13.scroll;
|
|
1245
1403
|
const menu = /* @__PURE__ */ jsx(
|
|
1246
1404
|
View,
|
|
1247
1405
|
{
|
|
@@ -1255,7 +1413,7 @@ var InlineMenu = ({
|
|
|
1255
1413
|
Animated.View,
|
|
1256
1414
|
{
|
|
1257
1415
|
pointerEvents: isOpen ? "auto" : "none",
|
|
1258
|
-
style: [
|
|
1416
|
+
style: [styles13.animated, opensAbove ? styles13.animatedAbove : null, animatedStyle, isOpen ? null : styles13.inert],
|
|
1259
1417
|
children: [
|
|
1260
1418
|
menuHeading !== void 0 ? /* @__PURE__ */ jsx(MenuHeading, { testID, text: menuHeading }) : null,
|
|
1261
1419
|
/* @__PURE__ */ jsx(ScrollView, { style: scrollStyle, keyboardShouldPersistTaps: "handled", children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
@@ -1306,7 +1464,7 @@ var CARET_OPEN_ROTATION = "180deg";
|
|
|
1306
1464
|
var CARET_CLOSED_ROTATION = "0deg";
|
|
1307
1465
|
var POPOVER_ENTER_SCALE = 0.96;
|
|
1308
1466
|
var POPOVER_MOTION_MS = 120;
|
|
1309
|
-
var
|
|
1467
|
+
var styles14 = StyleSheet.create({
|
|
1310
1468
|
anchor: { position: "relative" },
|
|
1311
1469
|
container: {
|
|
1312
1470
|
borderWidth: BORDER_WIDTH4,
|
|
@@ -1421,19 +1579,19 @@ var ModalDropdown = ({
|
|
|
1421
1579
|
const isCaret = showCaret && !isHamburger;
|
|
1422
1580
|
const containerStyle = useMemo(
|
|
1423
1581
|
() => renderTrigger !== void 0 ? void 0 : [
|
|
1424
|
-
|
|
1425
|
-
isHamburger ?
|
|
1582
|
+
styles14.container,
|
|
1583
|
+
isHamburger ? styles14.containerHamburger : isCaret ? styles14.containerMenu : null,
|
|
1426
1584
|
{ borderColor: colors.border, backgroundColor: colors.surface }
|
|
1427
1585
|
],
|
|
1428
1586
|
[colors.border, colors.surface, renderTrigger, isHamburger, isCaret]
|
|
1429
1587
|
);
|
|
1430
1588
|
const hamburgerStyle = useMemo(
|
|
1431
|
-
() => [
|
|
1589
|
+
() => [styles14.hamburger, { color: colors.textSecondary }],
|
|
1432
1590
|
[colors.textSecondary]
|
|
1433
1591
|
);
|
|
1434
1592
|
const caretStyle = useMemo(
|
|
1435
1593
|
() => [
|
|
1436
|
-
|
|
1594
|
+
styles14.caret,
|
|
1437
1595
|
{ color: colors.textSecondary, transform: [{ rotate: isOpen ? CARET_OPEN_ROTATION : CARET_CLOSED_ROTATION }] }
|
|
1438
1596
|
],
|
|
1439
1597
|
[colors.textSecondary, isOpen]
|
|
@@ -1443,11 +1601,11 @@ var ModalDropdown = ({
|
|
|
1443
1601
|
[optionTestID, testID]
|
|
1444
1602
|
);
|
|
1445
1603
|
const anchorStyle = useMemo(
|
|
1446
|
-
() => [
|
|
1604
|
+
() => [styles14.anchor, buildAnchorStackStyle(isMenu && isOpen)],
|
|
1447
1605
|
[isMenu, isOpen]
|
|
1448
1606
|
);
|
|
1449
1607
|
const modalContentStyle = useMemo(
|
|
1450
|
-
() => [
|
|
1608
|
+
() => [styles14.modalContent, { backgroundColor: colors.surface }],
|
|
1451
1609
|
[colors.surface]
|
|
1452
1610
|
);
|
|
1453
1611
|
const renderModalOption = useCallback(
|
|
@@ -1468,11 +1626,11 @@ var ModalDropdown = ({
|
|
|
1468
1626
|
/* @__PURE__ */ jsxs(TouchableOpacity, { ...a11yProps, ...popupProps, ref: triggerRef, style: containerStyle, onPress: handleToggle, children: [
|
|
1469
1627
|
renderTrigger !== void 0 ? renderTrigger({ label: selectedLabel, isOpen }) : isHamburger ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1470
1628
|
/* @__PURE__ */ jsx(Text, { style: hamburgerStyle, children: HAMBURGER_GLYPH }),
|
|
1471
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [
|
|
1629
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles14.selectedText, styles14.selectedTextMenu, { color: colors.text }], children: selectedLabel })
|
|
1472
1630
|
] }) : isCaret ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1473
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [
|
|
1631
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles14.selectedText, styles14.selectedTextMenu, { color: colors.text }], children: selectedLabel }),
|
|
1474
1632
|
/* @__PURE__ */ jsx(Text, { style: caretStyle, children: CARET_GLYPH })
|
|
1475
|
-
] }) : /* @__PURE__ */ jsx(Text, { style: [
|
|
1633
|
+
] }) : /* @__PURE__ */ jsx(Text, { style: [styles14.selectedText, { color: colors.text }], children: selectedLabel }),
|
|
1476
1634
|
hintNode
|
|
1477
1635
|
] }),
|
|
1478
1636
|
isMenu && menuAnim.mounted ? /* @__PURE__ */ jsx(
|
|
@@ -1493,7 +1651,7 @@ var ModalDropdown = ({
|
|
|
1493
1651
|
onSelect: handleSelect
|
|
1494
1652
|
}
|
|
1495
1653
|
) : null,
|
|
1496
|
-
!isMenu ? /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: modalAnim.mounted, onRequestClose: handleClose, children: /* @__PURE__ */ jsxs(View, { style:
|
|
1654
|
+
!isMenu ? /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: modalAnim.mounted, onRequestClose: handleClose, children: /* @__PURE__ */ jsxs(View, { style: styles14.modalOverlay, children: [
|
|
1497
1655
|
/* @__PURE__ */ jsx(
|
|
1498
1656
|
TouchableOpacity,
|
|
1499
1657
|
{
|
|
@@ -1586,7 +1744,7 @@ var ROW_PAD_V = 8;
|
|
|
1586
1744
|
var PANEL_PAD_TOP = 16;
|
|
1587
1745
|
var BORDER_WIDTH5 = 1;
|
|
1588
1746
|
var TEXT_ON_PRIMARY = "#ffffff";
|
|
1589
|
-
var
|
|
1747
|
+
var styles15 = StyleSheet.create({
|
|
1590
1748
|
root: {
|
|
1591
1749
|
width: "100%"
|
|
1592
1750
|
},
|
|
@@ -1640,7 +1798,7 @@ var WideTabStrip = ({
|
|
|
1640
1798
|
textSecondary,
|
|
1641
1799
|
surfaceElevated,
|
|
1642
1800
|
stripStyle
|
|
1643
|
-
}) => /* @__PURE__ */ jsx(View, { style: [
|
|
1801
|
+
}) => /* @__PURE__ */ jsx(View, { style: [styles15.stripOuter, { borderBottomColor: borderColor }], children: /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", "aria-label": accessibilityLabel, style: [styles15.strip, stripStyle], children: tabs.map((tab) => {
|
|
1644
1802
|
const selected = tab.key === activeKey;
|
|
1645
1803
|
const textColor = selected ? TEXT_ON_PRIMARY : textSecondary;
|
|
1646
1804
|
const pillColor = selected ? primaryColor : surfaceElevated;
|
|
@@ -1654,10 +1812,10 @@ var WideTabStrip = ({
|
|
|
1654
1812
|
accessibilityLabel: tab.accessibilityLabel ?? tab.label,
|
|
1655
1813
|
accessibilityHint: tab.accessibilityHint,
|
|
1656
1814
|
onPress: () => onChange(tab.key),
|
|
1657
|
-
style: [
|
|
1815
|
+
style: [styles15.pill, { backgroundColor: pillColor }],
|
|
1658
1816
|
testID: tab.testID,
|
|
1659
1817
|
...ariaTabProps(selected, panelId, tabId),
|
|
1660
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1818
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles15.pillText, { color: textColor }], children: tab.label })
|
|
1661
1819
|
},
|
|
1662
1820
|
tab.key
|
|
1663
1821
|
);
|
|
@@ -1682,7 +1840,7 @@ var Tabs = ({
|
|
|
1682
1840
|
const activePanelId = `${idPrefix}-panel-${activeKey}`;
|
|
1683
1841
|
const activeTabId = `${idPrefix}-tab-${activeKey}`;
|
|
1684
1842
|
const panelAria = { "aria-labelledby": activeTabId, id: activePanelId };
|
|
1685
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1843
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles15.root, style], testID, children: [
|
|
1686
1844
|
collapsed ? /* @__PURE__ */ jsx(
|
|
1687
1845
|
TabsMenu,
|
|
1688
1846
|
{
|
|
@@ -1709,7 +1867,7 @@ var Tabs = ({
|
|
|
1709
1867
|
onChange
|
|
1710
1868
|
}
|
|
1711
1869
|
),
|
|
1712
|
-
/* @__PURE__ */ jsx(View, { accessibilityRole: "none", style: [
|
|
1870
|
+
/* @__PURE__ */ jsx(View, { accessibilityRole: "none", style: [styles15.panel, panelStyle], ...panelAria, children })
|
|
1713
1871
|
] });
|
|
1714
1872
|
};
|
|
1715
1873
|
var PROMPT_PADDING = 20;
|
|
@@ -1724,7 +1882,7 @@ var DISMISS_FONT_SIZE = 13;
|
|
|
1724
1882
|
var TITLE_MARGIN_BOTTOM = 8;
|
|
1725
1883
|
var MESSAGE_MARGIN_BOTTOM = 16;
|
|
1726
1884
|
var CTA_MARGIN_BOTTOM = 8;
|
|
1727
|
-
var
|
|
1885
|
+
var styles16 = StyleSheet.create({
|
|
1728
1886
|
container: {
|
|
1729
1887
|
padding: PROMPT_PADDING,
|
|
1730
1888
|
borderRadius: PROMPT_BORDER_RADIUS,
|
|
@@ -1759,21 +1917,21 @@ var UpgradePrompt = ({
|
|
|
1759
1917
|
return /* @__PURE__ */ jsxs(
|
|
1760
1918
|
View,
|
|
1761
1919
|
{
|
|
1762
|
-
style: [
|
|
1920
|
+
style: [styles16.container, { borderColor: primary, backgroundColor: colors.surface }],
|
|
1763
1921
|
testID: LAYOUT_TEST_IDS.upgradePrompt,
|
|
1764
1922
|
children: [
|
|
1765
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1766
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1923
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.title, { color: colors.text }], children: t(LAYOUT_I18N.upgradePromptTitle) }),
|
|
1924
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.message, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptMessage, requiredTier, currentTier) }),
|
|
1767
1925
|
/* @__PURE__ */ jsx(
|
|
1768
1926
|
TouchableOpacity,
|
|
1769
1927
|
{
|
|
1770
1928
|
accessibilityHint: t(LAYOUT_I18N.upgradePromptCtaHint),
|
|
1771
1929
|
accessibilityLabel: t(LAYOUT_I18N.upgradePromptCta),
|
|
1772
1930
|
accessibilityRole: "button",
|
|
1773
|
-
style: [
|
|
1931
|
+
style: [styles16.cta, { backgroundColor: primary }],
|
|
1774
1932
|
testID: LAYOUT_TEST_IDS.upgradePromptCta,
|
|
1775
1933
|
onPress: handleUpgradePress,
|
|
1776
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1934
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles16.ctaText, { color: colors.surface }], children: t(LAYOUT_I18N.upgradePromptCta) })
|
|
1777
1935
|
}
|
|
1778
1936
|
),
|
|
1779
1937
|
onDismiss ? /* @__PURE__ */ jsx(
|
|
@@ -1782,10 +1940,10 @@ var UpgradePrompt = ({
|
|
|
1782
1940
|
accessibilityHint: t(LAYOUT_I18N.upgradePromptDismissHint),
|
|
1783
1941
|
accessibilityLabel: t(LAYOUT_I18N.upgradePromptDismiss),
|
|
1784
1942
|
accessibilityRole: "button",
|
|
1785
|
-
style:
|
|
1943
|
+
style: styles16.dismiss,
|
|
1786
1944
|
testID: LAYOUT_TEST_IDS.upgradePromptDismiss,
|
|
1787
1945
|
onPress: onDismiss,
|
|
1788
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1946
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles16.dismissText, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptDismiss) })
|
|
1789
1947
|
}
|
|
1790
1948
|
) : null
|
|
1791
1949
|
]
|
|
@@ -1794,7 +1952,7 @@ var UpgradePrompt = ({
|
|
|
1794
1952
|
};
|
|
1795
1953
|
var CLOSE_ICON_SIZE = 18;
|
|
1796
1954
|
var PANEL_ENTER_SCALE2 = 0.96;
|
|
1797
|
-
var
|
|
1955
|
+
var styles17 = StyleSheet.create({
|
|
1798
1956
|
animatedFill: { flex: 1 },
|
|
1799
1957
|
container: {
|
|
1800
1958
|
flex: 1,
|
|
@@ -1823,8 +1981,8 @@ var ModalShell = ({
|
|
|
1823
1981
|
}) => {
|
|
1824
1982
|
const { theme, t } = useUi();
|
|
1825
1983
|
const { style: sheetStyle, mounted } = useEnterExit({ visible, fromScale: PANEL_ENTER_SCALE2 });
|
|
1826
|
-
const containerStyle =
|
|
1827
|
-
() => [
|
|
1984
|
+
const containerStyle = React16.useMemo(
|
|
1985
|
+
() => [styles17.container, { backgroundColor: theme.colors.background }, contentStyle],
|
|
1828
1986
|
[theme.colors.background, contentStyle]
|
|
1829
1987
|
);
|
|
1830
1988
|
const closeA11yLabel = t(LAYOUT_I18N.close);
|
|
@@ -1836,7 +1994,7 @@ var ModalShell = ({
|
|
|
1836
1994
|
testID: LAYOUT_TEST_IDS.modalShell,
|
|
1837
1995
|
visible: mounted,
|
|
1838
1996
|
onRequestClose: onCancel,
|
|
1839
|
-
children: /* @__PURE__ */ jsx(Animated.View, { style: [
|
|
1997
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles17.animatedFill, sheetStyle], children: /* @__PURE__ */ jsxs(
|
|
1840
1998
|
ScrollView,
|
|
1841
1999
|
{
|
|
1842
2000
|
accessibilityViewIsModal: true,
|
|
@@ -1844,7 +2002,7 @@ var ModalShell = ({
|
|
|
1844
2002
|
role: "dialog",
|
|
1845
2003
|
style: containerStyle,
|
|
1846
2004
|
children: [
|
|
1847
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2005
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.headerRow, children: [
|
|
1848
2006
|
/* @__PURE__ */ jsx(Heading, { children: title ?? t(LAYOUT_I18N.closeHeading) }),
|
|
1849
2007
|
showClose ? /* @__PURE__ */ jsx(
|
|
1850
2008
|
TouchableOpacity,
|
|
@@ -1852,7 +2010,7 @@ var ModalShell = ({
|
|
|
1852
2010
|
accessibilityHint: t(LAYOUT_I18N.closeDialogHint),
|
|
1853
2011
|
accessibilityLabel: closeA11yLabel,
|
|
1854
2012
|
accessibilityRole: "button",
|
|
1855
|
-
style:
|
|
2013
|
+
style: styles17.closeButton,
|
|
1856
2014
|
testID: LAYOUT_TEST_IDS.modalShellClose,
|
|
1857
2015
|
onPress: onCancel,
|
|
1858
2016
|
children: /* @__PURE__ */ jsx(SvgIcon, { color: theme.colors.textSecondary, name: "close", size: CLOSE_ICON_SIZE })
|
|
@@ -1869,7 +2027,7 @@ var ModalShell = ({
|
|
|
1869
2027
|
var SHEET_WIDTH = 560;
|
|
1870
2028
|
var PHONE_CORNER = 16;
|
|
1871
2029
|
var PHONE_ENTER_OFFSET = 24;
|
|
1872
|
-
var
|
|
2030
|
+
var styles18 = StyleSheet.create({
|
|
1873
2031
|
root: { flex: 1 },
|
|
1874
2032
|
scrim: { backgroundColor: MODAL_OVERLAY_COLOR, pointerEvents: "none" },
|
|
1875
2033
|
sheet: { position: "absolute", bottom: 0, overflow: "hidden" },
|
|
@@ -1906,8 +2064,8 @@ var SideSheet = ({
|
|
|
1906
2064
|
useEscapeKey(visible, onClose);
|
|
1907
2065
|
useScrollLock(visible);
|
|
1908
2066
|
const hardwareBackClose = Platform.OS === "web" ? void 0 : onClose;
|
|
1909
|
-
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: panel.mounted || backdrop.mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style:
|
|
1910
|
-
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill,
|
|
2067
|
+
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: panel.mounted || backdrop.mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style: styles18.root, children: [
|
|
2068
|
+
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill, styles18.scrim, { opacity: backdrop.style.opacity }] }),
|
|
1911
2069
|
/* @__PURE__ */ jsx(
|
|
1912
2070
|
Pressable,
|
|
1913
2071
|
{
|
|
@@ -1928,17 +2086,17 @@ var SideSheet = ({
|
|
|
1928
2086
|
"aria-label": accessibilityLabel ?? title,
|
|
1929
2087
|
role: "dialog",
|
|
1930
2088
|
style: [
|
|
1931
|
-
|
|
1932
|
-
isWide ?
|
|
2089
|
+
styles18.sheet,
|
|
2090
|
+
isWide ? styles18.wide : styles18.phone,
|
|
1933
2091
|
edges,
|
|
1934
2092
|
{ backgroundColor: theme.colors.surface },
|
|
1935
2093
|
panel.style
|
|
1936
2094
|
],
|
|
1937
2095
|
testID,
|
|
1938
2096
|
children: [
|
|
1939
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
1940
|
-
/* @__PURE__ */ jsx(ScrollView, { contentContainerStyle:
|
|
1941
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
2097
|
+
/* @__PURE__ */ jsx(View, { style: styles18.title, children: /* @__PURE__ */ jsx(AppText, { kind: "title" /* Title */, children: title }) }),
|
|
2098
|
+
/* @__PURE__ */ jsx(ScrollView, { contentContainerStyle: styles18.content, style: styles18.scroll, children }),
|
|
2099
|
+
/* @__PURE__ */ jsx(View, { style: [styles18.bar, edges], children: footer })
|
|
1942
2100
|
]
|
|
1943
2101
|
}
|
|
1944
2102
|
)
|
|
@@ -1950,7 +2108,7 @@ var WIDE_MAX_WIDTH = 560;
|
|
|
1950
2108
|
var TOP_CORNER = 16;
|
|
1951
2109
|
var ENTER_OFFSET = 24;
|
|
1952
2110
|
var CLOSE_ICON_SIZE2 = 18;
|
|
1953
|
-
var
|
|
2111
|
+
var styles19 = StyleSheet.create({
|
|
1954
2112
|
root: { flex: 1 },
|
|
1955
2113
|
backdrop: { backgroundColor: MODAL_OVERLAY_COLOR, pointerEvents: "none" },
|
|
1956
2114
|
panel: {
|
|
@@ -1992,8 +2150,8 @@ var BottomSheet = ({
|
|
|
1992
2150
|
useEscapeKey(visible, onClose);
|
|
1993
2151
|
useScrollLock(visible);
|
|
1994
2152
|
const hardwareBackClose = Platform.OS === "web" ? void 0 : onClose;
|
|
1995
|
-
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: panel.mounted || backdrop.mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style:
|
|
1996
|
-
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill,
|
|
2153
|
+
return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: panel.mounted || backdrop.mounted, onRequestClose: hardwareBackClose, children: /* @__PURE__ */ jsxs(View, { style: styles19.root, children: [
|
|
2154
|
+
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill, styles19.backdrop, { opacity: backdrop.style.opacity }] }),
|
|
1997
2155
|
/* @__PURE__ */ jsx(
|
|
1998
2156
|
Pressable,
|
|
1999
2157
|
{
|
|
@@ -2014,39 +2172,47 @@ var BottomSheet = ({
|
|
|
2014
2172
|
"aria-label": accessibilityLabel ?? title,
|
|
2015
2173
|
role: "dialog",
|
|
2016
2174
|
style: [
|
|
2017
|
-
|
|
2018
|
-
isWide ?
|
|
2175
|
+
styles19.panel,
|
|
2176
|
+
isWide ? styles19.wide : null,
|
|
2019
2177
|
panelSize,
|
|
2020
2178
|
{ backgroundColor: theme.colors.surface },
|
|
2021
2179
|
panel.style
|
|
2022
2180
|
],
|
|
2023
2181
|
testID,
|
|
2024
2182
|
children: [
|
|
2025
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2026
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2183
|
+
/* @__PURE__ */ jsxs(View, { style: styles19.header, children: [
|
|
2184
|
+
/* @__PURE__ */ jsx(View, { style: styles19.title, children: /* @__PURE__ */ jsx(AppText, { kind: "title" /* Title */, children: title }) }),
|
|
2027
2185
|
/* @__PURE__ */ jsx(
|
|
2028
2186
|
TouchableOpacity,
|
|
2029
2187
|
{
|
|
2030
2188
|
accessibilityHint: t(LAYOUT_I18N.closeDialogHint),
|
|
2031
2189
|
accessibilityLabel: t(LAYOUT_I18N.dialogClose),
|
|
2032
2190
|
accessibilityRole: "button",
|
|
2033
|
-
style:
|
|
2191
|
+
style: styles19.close,
|
|
2034
2192
|
testID: `${testID}-close`,
|
|
2035
2193
|
onPress: onClose,
|
|
2036
2194
|
children: /* @__PURE__ */ jsx(SvgIcon, { color: theme.colors.textSecondary, name: "close", size: CLOSE_ICON_SIZE2 })
|
|
2037
2195
|
}
|
|
2038
2196
|
)
|
|
2039
2197
|
] }),
|
|
2040
|
-
/* @__PURE__ */ jsx(ScrollView, { contentContainerStyle:
|
|
2041
|
-
hasFooter ? /* @__PURE__ */ jsx(View, { style: [
|
|
2198
|
+
/* @__PURE__ */ jsx(ScrollView, { contentContainerStyle: styles19.content, style: styles19.body, children }),
|
|
2199
|
+
hasFooter ? /* @__PURE__ */ jsx(View, { style: [styles19.footer, { borderColor: theme.colors.border }], testID: `${testID}-footer`, children: footer }) : null
|
|
2042
2200
|
]
|
|
2043
2201
|
}
|
|
2044
2202
|
)
|
|
2045
2203
|
] }) });
|
|
2046
2204
|
};
|
|
2205
|
+
|
|
2206
|
+
// src/Modal/ConfirmDialogFocus.ts
|
|
2207
|
+
var ConfirmDialogFocus = /* @__PURE__ */ ((ConfirmDialogFocus2) => {
|
|
2208
|
+
ConfirmDialogFocus2["Cancel"] = "cancel";
|
|
2209
|
+
ConfirmDialogFocus2["Confirm"] = "confirm";
|
|
2210
|
+
ConfirmDialogFocus2["None"] = "none";
|
|
2211
|
+
return ConfirmDialogFocus2;
|
|
2212
|
+
})(ConfirmDialogFocus || {});
|
|
2047
2213
|
var MESSAGE_FONT_SIZE2 = 14;
|
|
2048
2214
|
var MESSAGE_LINE_HEIGHT = 20;
|
|
2049
|
-
var
|
|
2215
|
+
var styles20 = StyleSheet.create({
|
|
2050
2216
|
message: { fontSize: MESSAGE_FONT_SIZE2, lineHeight: MESSAGE_LINE_HEIGHT }
|
|
2051
2217
|
});
|
|
2052
2218
|
var ConfirmDialog = ({
|
|
@@ -2059,11 +2225,17 @@ var ConfirmDialog = ({
|
|
|
2059
2225
|
onConfirm,
|
|
2060
2226
|
onCancel,
|
|
2061
2227
|
busy = false,
|
|
2228
|
+
initialFocus = "cancel" /* Cancel */,
|
|
2062
2229
|
testID = LAYOUT_TEST_IDS.confirmDialog
|
|
2063
2230
|
}) => {
|
|
2064
2231
|
const { theme, t } = useUi();
|
|
2065
2232
|
const resolvedConfirm = confirmLabel ?? t(LAYOUT_I18N.confirm);
|
|
2066
2233
|
const resolvedCancel = cancelLabel ?? t(LAYOUT_I18N.cancel);
|
|
2234
|
+
const focusTestID = {
|
|
2235
|
+
["cancel" /* Cancel */]: `${testID}-cancel`,
|
|
2236
|
+
["confirm" /* Confirm */]: `${testID}-confirm`,
|
|
2237
|
+
["none" /* None */]: testID
|
|
2238
|
+
};
|
|
2067
2239
|
const footer = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2068
2240
|
/* @__PURE__ */ jsx(
|
|
2069
2241
|
Button,
|
|
@@ -2094,13 +2266,14 @@ var ConfirmDialog = ({
|
|
|
2094
2266
|
Modal,
|
|
2095
2267
|
{
|
|
2096
2268
|
footer,
|
|
2269
|
+
initialFocusTestID: focusTestID[initialFocus],
|
|
2097
2270
|
showClose: false,
|
|
2098
2271
|
size: "sm",
|
|
2099
2272
|
testID,
|
|
2100
2273
|
title,
|
|
2101
2274
|
visible,
|
|
2102
2275
|
onClose: onCancel,
|
|
2103
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2276
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles20.message, { color: theme.colors.text }], testID: `${testID}-message`, children: message })
|
|
2104
2277
|
}
|
|
2105
2278
|
);
|
|
2106
2279
|
};
|
|
@@ -2120,11 +2293,11 @@ var WebFormBody = ({ children, visible, onSubmit }) => {
|
|
|
2120
2293
|
[onSubmit]
|
|
2121
2294
|
);
|
|
2122
2295
|
if (Platform.OS !== "web") return /* @__PURE__ */ jsx(Fragment, { children });
|
|
2123
|
-
return
|
|
2296
|
+
return React16.createElement(
|
|
2124
2297
|
"form",
|
|
2125
2298
|
{ ref: formRef, noValidate: true, style: FORM_STYLE, onSubmit: handleSubmit },
|
|
2126
2299
|
children,
|
|
2127
|
-
|
|
2300
|
+
React16.createElement("button", { type: "submit", hidden: true, tabIndex: -1, "aria-hidden": true })
|
|
2128
2301
|
);
|
|
2129
2302
|
};
|
|
2130
2303
|
var FormDialogActions = (props) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2194,14 +2367,14 @@ function useAccordionContext() {
|
|
|
2194
2367
|
return value;
|
|
2195
2368
|
}
|
|
2196
2369
|
var BOXED_GAP = 12;
|
|
2197
|
-
var
|
|
2370
|
+
var styles21 = StyleSheet.create({
|
|
2198
2371
|
container: { alignSelf: "stretch" },
|
|
2199
2372
|
boxed: { gap: BOXED_GAP }
|
|
2200
2373
|
});
|
|
2201
2374
|
function computeInitialOpen(children, defaultOpenIds, allowMultiple) {
|
|
2202
2375
|
const ids = new Set(defaultOpenIds ?? []);
|
|
2203
|
-
|
|
2204
|
-
if (!
|
|
2376
|
+
React16.Children.forEach(children, (child) => {
|
|
2377
|
+
if (!React16.isValidElement(child)) return;
|
|
2205
2378
|
const props = child.props;
|
|
2206
2379
|
if (props.defaultOpen === true && typeof props.id === "string") {
|
|
2207
2380
|
ids.add(props.id);
|
|
@@ -2251,7 +2424,7 @@ var Accordion = ({
|
|
|
2251
2424
|
[openSet, toggle, allowMultiple, variant]
|
|
2252
2425
|
);
|
|
2253
2426
|
const containerStyle = useMemo(() => {
|
|
2254
|
-
const base = variant === "boxed" ? [
|
|
2427
|
+
const base = variant === "boxed" ? [styles21.container, styles21.boxed] : [styles21.container];
|
|
2255
2428
|
if (style === void 0) return base;
|
|
2256
2429
|
return [...base, ...Array.isArray(style) ? style : [style]];
|
|
2257
2430
|
}, [style, variant]);
|
|
@@ -2283,7 +2456,7 @@ var BOX_TITLE_FONT_SIZE = 14;
|
|
|
2283
2456
|
var BOX_MARKER_FONT_SIZE = 13;
|
|
2284
2457
|
var BOX_MARKER_GAP = 6;
|
|
2285
2458
|
var BOX_MARKER = "\u25B8";
|
|
2286
|
-
var
|
|
2459
|
+
var styles22 = StyleSheet.create({
|
|
2287
2460
|
item: { borderTopWidth: StyleSheet.hairlineWidth },
|
|
2288
2461
|
boxItem: { borderWidth: 1, borderRadius: BOX_BORDER_RADIUS, paddingHorizontal: BOX_PADDING_H },
|
|
2289
2462
|
header: {
|
|
@@ -2359,19 +2532,19 @@ var AccordionItem = ({
|
|
|
2359
2532
|
);
|
|
2360
2533
|
const keyboardProps = Platform.OS === "web" ? { onKeyDown: handleKeyDown2 } : {};
|
|
2361
2534
|
const itemStyle = useMemo(
|
|
2362
|
-
() => boxed ? [
|
|
2535
|
+
() => boxed ? [styles22.boxItem, { borderColor: colors.border }] : [styles22.item, { borderTopColor: colors.border }],
|
|
2363
2536
|
[boxed, colors.border]
|
|
2364
2537
|
);
|
|
2365
2538
|
const headerStyle = useMemo(
|
|
2366
2539
|
() => [
|
|
2367
|
-
|
|
2368
|
-
...boxed ? [
|
|
2540
|
+
styles22.header,
|
|
2541
|
+
...boxed ? [styles22.boxHeader] : [],
|
|
2369
2542
|
{ opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY }
|
|
2370
2543
|
],
|
|
2371
2544
|
[boxed, disabled]
|
|
2372
2545
|
);
|
|
2373
2546
|
const resolvedLabel = accessibilityLabel ?? (typeof title === "string" ? title : void 0);
|
|
2374
|
-
const titleNode = typeof title === "string" ? /* @__PURE__ */ jsx(Text, { style: [boxed ?
|
|
2547
|
+
const titleNode = typeof title === "string" ? /* @__PURE__ */ jsx(Text, { style: [boxed ? styles22.boxTitle : styles22.title, { color: boxed ? colors.textSecondary : colors.text }], children: title }) : title;
|
|
2375
2548
|
return /* @__PURE__ */ jsxs(View, { style: itemStyle, children: [
|
|
2376
2549
|
/* @__PURE__ */ jsxs(
|
|
2377
2550
|
Pressable,
|
|
@@ -2388,7 +2561,7 @@ var AccordionItem = ({
|
|
|
2388
2561
|
onPress: handlePress,
|
|
2389
2562
|
...keyboardProps,
|
|
2390
2563
|
children: [
|
|
2391
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
2564
|
+
/* @__PURE__ */ jsxs(View, { style: [styles22.headerLeft, boxed ? styles22.headerLeftRow : null], children: [
|
|
2392
2565
|
boxed ? (
|
|
2393
2566
|
// Decorative — the open/closed state is already conveyed by aria-expanded on the header.
|
|
2394
2567
|
/* @__PURE__ */ jsx(
|
|
@@ -2397,15 +2570,15 @@ var AccordionItem = ({
|
|
|
2397
2570
|
accessibilityElementsHidden: true,
|
|
2398
2571
|
"aria-hidden": true,
|
|
2399
2572
|
importantForAccessibility: "no-hide-descendants",
|
|
2400
|
-
style: [
|
|
2573
|
+
style: [styles22.marker, { transform: [{ rotate }] }],
|
|
2401
2574
|
testID: chevronTestID,
|
|
2402
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2575
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles22.markerText, { color: colors.textSecondary }], children: BOX_MARKER })
|
|
2403
2576
|
}
|
|
2404
2577
|
)
|
|
2405
2578
|
) : null,
|
|
2406
2579
|
titleNode
|
|
2407
2580
|
] }),
|
|
2408
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2581
|
+
/* @__PURE__ */ jsxs(View, { style: styles22.headerRight, children: [
|
|
2409
2582
|
right,
|
|
2410
2583
|
boxed ? null : /* @__PURE__ */ jsx(
|
|
2411
2584
|
Animated.View,
|
|
@@ -2413,7 +2586,7 @@ var AccordionItem = ({
|
|
|
2413
2586
|
accessibilityElementsHidden: true,
|
|
2414
2587
|
"aria-hidden": true,
|
|
2415
2588
|
importantForAccessibility: "no-hide-descendants",
|
|
2416
|
-
style: [
|
|
2589
|
+
style: [styles22.chevron, { transform: [{ rotate }] }],
|
|
2417
2590
|
children: /* @__PURE__ */ jsx(SvgIcon, { color: colors.textSecondary, name: "chevronDown", size: CHEVRON_SIZE, testID: chevronTestID })
|
|
2418
2591
|
}
|
|
2419
2592
|
)
|
|
@@ -2427,7 +2600,7 @@ var AccordionItem = ({
|
|
|
2427
2600
|
accessibilityLabel: resolvedLabel,
|
|
2428
2601
|
nativeID: bodyTestID,
|
|
2429
2602
|
role: ROLE_REGION,
|
|
2430
|
-
style: boxed ?
|
|
2603
|
+
style: boxed ? styles22.boxBody : styles22.body,
|
|
2431
2604
|
testID: bodyTestID,
|
|
2432
2605
|
children
|
|
2433
2606
|
}
|
|
@@ -2490,7 +2663,7 @@ function useAvailableWidth() {
|
|
|
2490
2663
|
var AVG_CHAR_WIDTH_RATIO = 0.58;
|
|
2491
2664
|
var DEFAULT_FONT_SIZE2 = 13;
|
|
2492
2665
|
var UNMEASURED2 = 0;
|
|
2493
|
-
var
|
|
2666
|
+
var styles23 = StyleSheet.create({
|
|
2494
2667
|
base: { fontSize: DEFAULT_FONT_SIZE2 },
|
|
2495
2668
|
/** `minWidth: 0` lets the text shrink inside a flex row instead of forcing the row wider. */
|
|
2496
2669
|
fill: { flexShrink: 1, minWidth: 0 }
|
|
@@ -2521,7 +2694,7 @@ var TruncatedText = ({
|
|
|
2521
2694
|
[value, measureRef]
|
|
2522
2695
|
);
|
|
2523
2696
|
const flatStyle = useMemo(
|
|
2524
|
-
() => StyleSheet.flatten([
|
|
2697
|
+
() => StyleSheet.flatten([styles23.base, style]),
|
|
2525
2698
|
[style]
|
|
2526
2699
|
);
|
|
2527
2700
|
const fontSize = flatStyle.fontSize ?? DEFAULT_FONT_SIZE2;
|
|
@@ -2536,7 +2709,7 @@ var TruncatedText = ({
|
|
|
2536
2709
|
ref: attachRef,
|
|
2537
2710
|
onLayout,
|
|
2538
2711
|
numberOfLines: 1,
|
|
2539
|
-
style: [
|
|
2712
|
+
style: [styles23.base, styles23.fill, style],
|
|
2540
2713
|
testID,
|
|
2541
2714
|
accessibilityRole: onPress !== void 0 || href !== void 0 ? "link" : "text",
|
|
2542
2715
|
accessibilityLabel,
|
|
@@ -2639,7 +2812,7 @@ var LABEL_LETTER_SPACING = 0.4;
|
|
|
2639
2812
|
var ACTION_PADDING_H = 6;
|
|
2640
2813
|
var ACTION_PADDING_V = 2;
|
|
2641
2814
|
var ACTION_RADIUS = 6;
|
|
2642
|
-
var
|
|
2815
|
+
var styles24 = StyleSheet.create({
|
|
2643
2816
|
cell: { gap: CELL_GAP },
|
|
2644
2817
|
label: {
|
|
2645
2818
|
fontSize: LABEL_FONT_SIZE,
|
|
@@ -2704,14 +2877,14 @@ var CopyableId = ({
|
|
|
2704
2877
|
const { colors } = theme;
|
|
2705
2878
|
const { status, copy } = useCopyToClipboard(value, writer);
|
|
2706
2879
|
const action = useActionState(status);
|
|
2707
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
2708
|
-
label !== void 0 && /* @__PURE__ */ jsx(Text, { style: [
|
|
2709
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2710
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2880
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles24.cell, style], testID, children: [
|
|
2881
|
+
label !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles24.label, { color: colors.textSecondary }], children: label }),
|
|
2882
|
+
/* @__PURE__ */ jsxs(View, { style: styles24.row, children: [
|
|
2883
|
+
/* @__PURE__ */ jsx(View, { style: styles24.valueWrap, children: /* @__PURE__ */ jsx(
|
|
2711
2884
|
TruncatedText,
|
|
2712
2885
|
{
|
|
2713
2886
|
value,
|
|
2714
|
-
style: [
|
|
2887
|
+
style: [styles24.value, { color: colors.text }],
|
|
2715
2888
|
testID: `${testID}-value`,
|
|
2716
2889
|
accessibilityLabel: accessibilityLabel ?? value,
|
|
2717
2890
|
accessibilityHint: t(LAYOUT_I18N.copyableIdHint)
|
|
@@ -2725,7 +2898,7 @@ var CopyableId = ({
|
|
|
2725
2898
|
accessibilityLabel: t(action.key),
|
|
2726
2899
|
accessibilityHint: t(LAYOUT_I18N.copyHint),
|
|
2727
2900
|
testID: `${testID}-copy`,
|
|
2728
|
-
style: [
|
|
2901
|
+
style: [styles24.action, { color: action.color }],
|
|
2729
2902
|
children: t(action.key)
|
|
2730
2903
|
}
|
|
2731
2904
|
)
|
|
@@ -2780,7 +2953,7 @@ var FOOTER_PADDING_V = 6;
|
|
|
2780
2953
|
var FOOTER_PADDING_H = 12;
|
|
2781
2954
|
var FOOTER_FONT_SIZE = 11;
|
|
2782
2955
|
var FOOTER_OPACITY = 0.75;
|
|
2783
|
-
var
|
|
2956
|
+
var styles25 = StyleSheet.create({
|
|
2784
2957
|
footer: {
|
|
2785
2958
|
paddingVertical: FOOTER_PADDING_V,
|
|
2786
2959
|
paddingHorizontal: FOOTER_PADDING_H,
|
|
@@ -2806,7 +2979,7 @@ var BuildInfoFooter = ({
|
|
|
2806
2979
|
const commit = apiCommit ?? fetchedCommit;
|
|
2807
2980
|
const label = formatBuildInfo(buildVersion, commit);
|
|
2808
2981
|
const textStyle = useMemo(
|
|
2809
|
-
() => [
|
|
2982
|
+
() => [styles25.text, { color: theme.colors.textSecondary }],
|
|
2810
2983
|
[theme.colors.textSecondary]
|
|
2811
2984
|
);
|
|
2812
2985
|
return /* @__PURE__ */ jsx(
|
|
@@ -2814,7 +2987,7 @@ var BuildInfoFooter = ({
|
|
|
2814
2987
|
{
|
|
2815
2988
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
2816
2989
|
accessibilityHint: accessibilityHint ?? t(LAYOUT_I18N.buildInfoHint),
|
|
2817
|
-
style: [
|
|
2990
|
+
style: [styles25.footer, style],
|
|
2818
2991
|
testID,
|
|
2819
2992
|
children: /* @__PURE__ */ jsx(Text, { style: textStyle, children: label })
|
|
2820
2993
|
}
|
|
@@ -2825,7 +2998,7 @@ var BORDER = 2;
|
|
|
2825
2998
|
var GLYPH_SIZE = 14;
|
|
2826
2999
|
var GLYPH_LINE = 16;
|
|
2827
3000
|
var TICK = "\u2713";
|
|
2828
|
-
var
|
|
3001
|
+
var styles26 = StyleSheet.create({
|
|
2829
3002
|
circle: {
|
|
2830
3003
|
width: SIZE,
|
|
2831
3004
|
height: SIZE,
|
|
@@ -2842,9 +3015,9 @@ var CheckMark = ({ filled, accent, ring, glyphColor, testID }) => /* @__PURE__ *
|
|
|
2842
3015
|
"aria-hidden": true,
|
|
2843
3016
|
accessibilityElementsHidden: true,
|
|
2844
3017
|
importantForAccessibility: "no-hide-descendants",
|
|
2845
|
-
style: [
|
|
3018
|
+
style: [styles26.circle, { borderColor: filled ? accent : ring, backgroundColor: filled ? accent : void 0 }],
|
|
2846
3019
|
testID,
|
|
2847
|
-
children: filled ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3020
|
+
children: filled ? /* @__PURE__ */ jsx(Text, { style: [styles26.glyph, { color: glyphColor }], children: TICK }) : null
|
|
2848
3021
|
}
|
|
2849
3022
|
);
|
|
2850
3023
|
var ListRowToneContext = createContext(null);
|
|
@@ -2967,7 +3140,7 @@ var PAD_V = 12;
|
|
|
2967
3140
|
var GAP = 4;
|
|
2968
3141
|
var MARK_GAP = 12;
|
|
2969
3142
|
var LINE_GAP = 8;
|
|
2970
|
-
var
|
|
3143
|
+
var styles27 = StyleSheet.create({
|
|
2971
3144
|
row: {
|
|
2972
3145
|
flexDirection: "row",
|
|
2973
3146
|
alignItems: "center",
|
|
@@ -2991,7 +3164,7 @@ function focusTarget(event) {
|
|
|
2991
3164
|
}
|
|
2992
3165
|
function slot(node, color, strong) {
|
|
2993
3166
|
if (typeof node !== "string") return node;
|
|
2994
|
-
return /* @__PURE__ */ jsx(Text, { style: [
|
|
3167
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles27.shrink, strong ? styles27.strong : null, { color }], children: node });
|
|
2995
3168
|
}
|
|
2996
3169
|
var ListRow = ({
|
|
2997
3170
|
title,
|
|
@@ -3023,7 +3196,7 @@ var ListRow = ({
|
|
|
3023
3196
|
style: (state) => {
|
|
3024
3197
|
const { pressed, hovered } = state;
|
|
3025
3198
|
const look = resolveRowLook(selectedStyle, { selected, pressed, focused, hovered: hovered === true }, palette);
|
|
3026
|
-
return [
|
|
3199
|
+
return [styles27.row, { borderTopColor: colors.border }, look.container];
|
|
3027
3200
|
},
|
|
3028
3201
|
testID,
|
|
3029
3202
|
onBlur: () => {
|
|
@@ -3036,14 +3209,14 @@ var ListRow = ({
|
|
|
3036
3209
|
...pressedProps(selected),
|
|
3037
3210
|
children: [
|
|
3038
3211
|
rest.showCheck ? /* @__PURE__ */ jsx(CheckMark, { accent: palette.accent, filled: rest.checkFilled, glyphColor: palette.background, ring: palette.border, testID: checkTestId }) : null,
|
|
3039
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3040
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3212
|
+
/* @__PURE__ */ jsxs(View, { style: styles27.body, children: [
|
|
3213
|
+
/* @__PURE__ */ jsxs(View, { style: styles27.line, children: [
|
|
3041
3214
|
slot(title, rest.titleColor, true),
|
|
3042
3215
|
slot(trailing, rest.textColor, true)
|
|
3043
3216
|
] }),
|
|
3044
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3045
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3046
|
-
badges === void 0 ? null : /* @__PURE__ */ jsx(View, { style:
|
|
3217
|
+
/* @__PURE__ */ jsxs(View, { style: styles27.line, children: [
|
|
3218
|
+
/* @__PURE__ */ jsx(View, { style: styles27.shrink, children: slot(meta, rest.textColor, false) }),
|
|
3219
|
+
badges === void 0 ? null : /* @__PURE__ */ jsx(View, { style: styles27.badges, children: badges })
|
|
3047
3220
|
] })
|
|
3048
3221
|
] })
|
|
3049
3222
|
]
|
|
@@ -3053,6 +3226,6 @@ var ListRow = ({
|
|
|
3053
3226
|
] });
|
|
3054
3227
|
};
|
|
3055
3228
|
|
|
3056
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BottomSheet, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, CopyableId, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, FormDialog, HEADER_STACK_BREAKPOINT, Heading, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, ModalShell, PageFrame, RowSelectedStyle, ScreenColumn, Section, SectionVariant, SegmentedControl, SelectedMarker, SideSheet, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isWideWebViewport, pageScale, resolveRowLook, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
3229
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, ConfirmDialogFocus, CopyStatus, CopyableId, CountBadge, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, FormDialog, HEADER_STACK_BREAKPOINT, Heading, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, ModalShell, PageFrame, RowSelectedStyle, ScreenColumn, Section, SectionVariant, SegmentedControl, SelectedMarker, SideSheet, SplitLayout, SplitPanes, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isSplitSideBySide, isWideWebViewport, pageScale, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
3057
3230
|
//# sourceMappingURL=index.mjs.map
|
|
3058
3231
|
//# sourceMappingURL=index.mjs.map
|