@dloizides/ui-layout 1.36.1 → 1.38.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/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import React11, { createContext, useMemo, useState, useRef, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
2
- import { StyleSheet, Platform, View, Text, useWindowDimensions, Pressable, TouchableOpacity, Modal, Animated, FlatList, ScrollView, Easing } from 'react-native';
1
+ import React12, { createContext, useMemo, useState, useRef, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
2
+ import { StyleSheet, Platform, View, Text, useWindowDimensions, Modal as Modal$1, Animated, TouchableOpacity, ScrollView, 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 { MIN_TOUCH_TARGET_PX, useA11y } from '@dloizides/a11y';
5
+ import { IconButton, Button } from '@dloizides/ui-buttons';
6
+ import { SvgIcon } from '@dloizides/ui-icons';
6
7
  import { useEnterExit, Collapse } from '@dloizides/ui-motion';
8
+ import { MIN_TOUCH_TARGET_PX, useA11y } from '@dloizides/a11y';
7
9
  import { createPortal } from 'react-dom';
8
10
  import { Z_INDEX } from '@dloizides/design-tokens';
9
- import { SvgIcon } from '@dloizides/ui-icons';
10
- import { IconButton, Button } from '@dloizides/ui-buttons';
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 = React11.useMemo(
41
+ const containerStyle = React12.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
  );
@@ -91,6 +91,7 @@ var LAYOUT_TEST_IDS = {
91
91
  headingText: "heading-text",
92
92
  statusLabel: "status-label",
93
93
  stickyPreview: "sticky-preview",
94
+ pageFrame: "page-frame",
94
95
  upgradePrompt: "upgrade-prompt",
95
96
  upgradePromptCta: "upgrade-prompt-cta",
96
97
  upgradePromptDismiss: "upgrade-prompt-dismiss",
@@ -132,6 +133,9 @@ var LAYOUT_I18N = {
132
133
  closeHeading: "close",
133
134
  /** `Modal`: accessible name + web tooltip of the top-right ✕ close button. */
134
135
  dialogClose: "common.close",
136
+ /** `PageFrame` (`enlargeable`): accessible name + hint of the preview that opens the full-size page. */
137
+ pageEnlarge: "common.pageEnlarge",
138
+ pageEnlargeHint: "common.pageEnlargeHint",
135
139
  /** `ConfirmDialog`: default Confirm button label (overridable via `confirmLabel`) + its hint. */
136
140
  confirm: "common.confirm",
137
141
  confirmHint: "common.confirmHint",
@@ -202,7 +206,7 @@ var Heading = ({
202
206
  testID
203
207
  }) => {
204
208
  const { theme } = useUi();
205
- const headingStyle = React11.useMemo(
209
+ const headingStyle = React12.useMemo(
206
210
  () => [styles3.heading, { color: theme.colors.text }, style],
207
211
  [theme.colors.text, style]
208
212
  );
@@ -370,6 +374,283 @@ var StickyPreview = ({
370
374
  )
371
375
  ] });
372
376
  };
377
+ function useEscapeKey(enabled, onClose) {
378
+ useEffect(() => {
379
+ if (Platform.OS !== "web" || !enabled) return;
380
+ const onKeyDown = (event) => {
381
+ if (event.key === "Escape") onClose();
382
+ };
383
+ document.addEventListener("keydown", onKeyDown);
384
+ return () => {
385
+ document.removeEventListener("keydown", onKeyDown);
386
+ };
387
+ }, [enabled, onClose]);
388
+ }
389
+ var FOCUSABLE_SELECTOR = [
390
+ "a[href]",
391
+ "button:not([disabled])",
392
+ "input:not([disabled])",
393
+ "select:not([disabled])",
394
+ "textarea:not([disabled])",
395
+ '[tabindex]:not([tabindex="-1"])'
396
+ ].join(", ");
397
+ function getFocusableElements(container) {
398
+ return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
399
+ }
400
+ function savePreviousFocus() {
401
+ return document.activeElement instanceof HTMLElement ? document.activeElement : null;
402
+ }
403
+ function focusInitial(domNode, initialFocusTestID) {
404
+ const named = initialFocusTestID === void 0 ? null : domNode.querySelector(`[data-testid="${initialFocusTestID}"]`);
405
+ if (named) {
406
+ named.focus();
407
+ return;
408
+ }
409
+ if (domNode.contains(document.activeElement)) return;
410
+ getFocusableElements(domNode)[0]?.focus();
411
+ }
412
+ function handleKeyDown(domNode, event) {
413
+ if (event.key !== "Tab") return;
414
+ const focusable = getFocusableElements(domNode);
415
+ if (focusable.length === 0) {
416
+ event.preventDefault();
417
+ return;
418
+ }
419
+ const first = focusable[0];
420
+ const last = focusable[focusable.length - 1];
421
+ if (!first || !last) {
422
+ event.preventDefault();
423
+ return;
424
+ }
425
+ const active = document.activeElement;
426
+ if (event.shiftKey && active === first) {
427
+ event.preventDefault();
428
+ last.focus();
429
+ } else if (!event.shiftKey && active === last) {
430
+ event.preventDefault();
431
+ first.focus();
432
+ }
433
+ }
434
+ function useFocusTrap(containerRef, enabled, initialFocusTestID) {
435
+ const previousFocusRef = useRef(null);
436
+ useEffect(() => {
437
+ if (Platform.OS !== "web" || !enabled) return;
438
+ const domNode = containerRef.current;
439
+ if (!domNode) return;
440
+ const previous = savePreviousFocus();
441
+ previousFocusRef.current = previous !== null && domNode.contains(previous) ? null : previous;
442
+ queueMicrotask(() => focusInitial(domNode, initialFocusTestID));
443
+ const listener = (e) => handleKeyDown(domNode, e);
444
+ domNode.addEventListener("keydown", listener);
445
+ return () => {
446
+ domNode.removeEventListener("keydown", listener);
447
+ previousFocusRef.current?.focus();
448
+ previousFocusRef.current = null;
449
+ };
450
+ }, [containerRef, enabled, initialFocusTestID]);
451
+ }
452
+ function useScrollLock(enabled) {
453
+ useEffect(() => {
454
+ if (Platform.OS !== "web" || !enabled) return;
455
+ const { body } = document;
456
+ const previousOverflow = body.style.overflow;
457
+ body.style.overflow = "hidden";
458
+ return () => {
459
+ body.style.overflow = previousOverflow;
460
+ };
461
+ }, [enabled]);
462
+ }
463
+ var OVERLAY_PADDING = 16;
464
+ var DIALOG_RADIUS = 12;
465
+ var DIALOG_PADDING = 16;
466
+ var HEADER_GAP = 12;
467
+ var FOOTER_MARGIN = 16;
468
+ var HEADER_MARGIN = 12;
469
+ var DIALOG_MAX_HEIGHT = "90%";
470
+ var PANEL_ENTER_SCALE = 0.96;
471
+ var SIZE_MAX_WIDTH = { sm: 360, md: 480, lg: 640, xl: 880 };
472
+ var styles6 = StyleSheet.create({
473
+ overlay: {
474
+ flex: 1,
475
+ justifyContent: "center",
476
+ alignItems: "center",
477
+ padding: OVERLAY_PADDING
478
+ },
479
+ // The scrim is its OWN animated layer (behind the tap-catcher and the panel) so its opacity
480
+ // can fade independently of the panel's fade+scale. `animationType` is a native-only no-op on
481
+ // react-native-web, which is why the fade is driven by `Animated` instead. `pointerEvents` lives
482
+ // in style (not the deprecated prop) so taps fall through to the sibling tap-catcher below.
483
+ scrim: { backgroundColor: MODAL_OVERLAY_COLOR, pointerEvents: "none" },
484
+ dialog: {
485
+ width: "100%",
486
+ borderRadius: DIALOG_RADIUS,
487
+ padding: DIALOG_PADDING,
488
+ maxHeight: DIALOG_MAX_HEIGHT
489
+ },
490
+ headerRow: {
491
+ flexDirection: "row",
492
+ alignItems: "flex-start",
493
+ justifyContent: "space-between",
494
+ columnGap: HEADER_GAP,
495
+ marginBottom: HEADER_MARGIN
496
+ },
497
+ // Occupies the header's leading space so the ✕ pins to the trailing edge even without a title.
498
+ titleWrap: { flex: 1 },
499
+ footer: { marginTop: FOOTER_MARGIN }
500
+ });
501
+ var Modal = ({
502
+ visible,
503
+ onClose,
504
+ title,
505
+ children,
506
+ footer,
507
+ size = "md",
508
+ showClose = true,
509
+ testID = LAYOUT_TEST_IDS.modal,
510
+ accessibilityLabel,
511
+ initialFocusTestID
512
+ }) => {
513
+ const { theme, t } = useUi();
514
+ const dialogRef = useRef(null);
515
+ const backdrop = useEnterExit({ visible });
516
+ const panel = useEnterExit({ visible, fromScale: PANEL_ENTER_SCALE });
517
+ const mounted = panel.mounted || backdrop.mounted;
518
+ useFocusTrap(dialogRef, visible, initialFocusTestID);
519
+ useEscapeKey(visible, onClose);
520
+ useScrollLock(visible);
521
+ const accessibleName = accessibilityLabel ?? title ?? t(LAYOUT_I18N.dialog);
522
+ const closeLabel = t(LAYOUT_I18N.dialogClose);
523
+ const dialogStyle = useMemo(
524
+ () => [styles6.dialog, { backgroundColor: theme.colors.surface, maxWidth: SIZE_MAX_WIDTH[size] }],
525
+ [theme.colors.surface, size]
526
+ );
527
+ const hasHeader = title !== void 0 || showClose;
528
+ return /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: mounted, onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { style: styles6.overlay, children: [
529
+ /* @__PURE__ */ jsx(
530
+ Animated.View,
531
+ {
532
+ style: [StyleSheet.absoluteFill, styles6.scrim, { opacity: backdrop.style.opacity }]
533
+ }
534
+ ),
535
+ /* @__PURE__ */ jsx(
536
+ TouchableOpacity,
537
+ {
538
+ accessible: true,
539
+ accessibilityHint: t(LAYOUT_I18N.dismissDropdownHint),
540
+ accessibilityLabel: t(LAYOUT_I18N.dismissDropdown),
541
+ accessibilityRole: "button",
542
+ activeOpacity: 1,
543
+ style: StyleSheet.absoluteFill,
544
+ testID: `${testID}-backdrop`,
545
+ onPress: onClose
546
+ }
547
+ ),
548
+ /* @__PURE__ */ jsxs(
549
+ Animated.View,
550
+ {
551
+ ref: dialogRef,
552
+ accessibilityViewIsModal: true,
553
+ "aria-label": accessibleName,
554
+ role: "dialog",
555
+ style: [dialogStyle, panel.style],
556
+ testID,
557
+ children: [
558
+ hasHeader ? /* @__PURE__ */ jsxs(View, { style: styles6.headerRow, children: [
559
+ /* @__PURE__ */ jsx(View, { style: styles6.titleWrap, children: title !== void 0 ? /* @__PURE__ */ jsx(Heading, { children: title }) : null }),
560
+ showClose ? /* @__PURE__ */ jsx(
561
+ IconButton,
562
+ {
563
+ accessibilityHint: t(LAYOUT_I18N.closeDialogHint),
564
+ accessibilityLabel: closeLabel,
565
+ appearance: "ghost",
566
+ renderIcon: (color, iconSize) => /* @__PURE__ */ jsx(SvgIcon, { color, name: "close", size: iconSize }),
567
+ size: "md",
568
+ testID: `${testID}-close`,
569
+ tooltip: closeLabel,
570
+ variant: "ghost",
571
+ onPress: onClose
572
+ }
573
+ ) : null
574
+ ] }) : null,
575
+ /* @__PURE__ */ jsx(ScrollView, { children }),
576
+ footer !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles6.footer, children: footer }) : null
577
+ ]
578
+ }
579
+ )
580
+ ] }) });
581
+ };
582
+ var PageOverlay = ({ children, pageSize, visible, onClose, testID }) => {
583
+ const { t } = useUi();
584
+ return /* @__PURE__ */ jsx(Modal, { accessibilityLabel: t(LAYOUT_I18N.pageEnlarge), size: "xl", testID, visible, onClose, children: /* @__PURE__ */ jsx(ScrollView, { horizontal: true, children: /* @__PURE__ */ jsx(View, { style: { width: pageSize.width, height: pageSize.height }, testID: `${testID}-page`, children }) }) });
585
+ };
586
+
587
+ // src/PageFrame/utils/pageScale.ts
588
+ var HALF = 2;
589
+ var A4_PAGE = { width: 794, height: 1123 };
590
+ var pageScale = (containerWidth, pageWidth) => {
591
+ if (containerWidth <= 0 || pageWidth <= 0) return 1;
592
+ return Math.min(1, containerWidth / pageWidth);
593
+ };
594
+ var scaledFrame = (containerWidth, page) => {
595
+ const scale = pageScale(containerWidth, page.width);
596
+ return {
597
+ scale,
598
+ height: page.height * scale,
599
+ offsetX: (scale - 1) * page.width / HALF,
600
+ offsetY: (scale - 1) * page.height / HALF
601
+ };
602
+ };
603
+ var styles7 = StyleSheet.create({
604
+ outer: { width: "100%", overflow: "hidden" },
605
+ page: { position: "absolute", top: 0, left: 0 },
606
+ trigger: { width: "100%", cursor: "pointer" }
607
+ });
608
+ var PageFrame = ({
609
+ children,
610
+ pageSize = A4_PAGE,
611
+ testID = LAYOUT_TEST_IDS.pageFrame,
612
+ enlargeable = false
613
+ }) => {
614
+ const { t } = useUi();
615
+ const [containerWidth, setContainerWidth] = useState(0);
616
+ const [enlarged, setEnlarged] = useState(false);
617
+ const onLayout = useCallback((event) => {
618
+ setContainerWidth(event.nativeEvent.layout.width);
619
+ }, []);
620
+ const open = useCallback(() => setEnlarged(true), []);
621
+ const close = useCallback(() => setEnlarged(false), []);
622
+ const frame = scaledFrame(containerWidth, pageSize);
623
+ const preview = /* @__PURE__ */ jsx(View, { style: [styles7.outer, { height: frame.height }], testID, onLayout, children: /* @__PURE__ */ jsx(
624
+ View,
625
+ {
626
+ style: [
627
+ styles7.page,
628
+ {
629
+ width: pageSize.width,
630
+ height: pageSize.height,
631
+ transform: [{ translateX: frame.offsetX }, { translateY: frame.offsetY }, { scale: frame.scale }]
632
+ }
633
+ ],
634
+ children
635
+ }
636
+ ) });
637
+ if (!enlargeable) return preview;
638
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
639
+ /* @__PURE__ */ jsx(
640
+ Pressable,
641
+ {
642
+ accessibilityHint: t(LAYOUT_I18N.pageEnlargeHint),
643
+ accessibilityLabel: t(LAYOUT_I18N.pageEnlarge),
644
+ accessibilityRole: "button",
645
+ style: styles7.trigger,
646
+ testID: `${testID}-enlarge`,
647
+ onPress: open,
648
+ children: preview
649
+ }
650
+ ),
651
+ /* @__PURE__ */ jsx(PageOverlay, { pageSize, testID: `${testID}-overlay`, visible: enlarged, onClose: close, children })
652
+ ] });
653
+ };
373
654
  var TRACK_PADDING = 3;
374
655
  var TRACK_RADIUS = 999;
375
656
  var SEGMENT_RADIUS = 999;
@@ -381,7 +662,7 @@ var BORDER_WIDTH = 1;
381
662
  var SEGMENT_BOX_SHADOW = "0px 1px 3px rgba(20, 30, 50, 0.1)";
382
663
  var SHADOW_ELEVATION = 2;
383
664
  var TRANSPARENT = "transparent";
384
- var styles6 = StyleSheet.create({
665
+ var styles8 = StyleSheet.create({
385
666
  track: {
386
667
  flexDirection: "row",
387
668
  alignSelf: "flex-start",
@@ -426,7 +707,7 @@ function SegmentedControl({
426
707
  {
427
708
  accessibilityRole: "tablist",
428
709
  "aria-label": accessibilityLabel,
429
- style: [styles6.track, { backgroundColor: colors.background, borderColor: colors.border }, style],
710
+ style: [styles8.track, { backgroundColor: colors.background, borderColor: colors.border }, style],
430
711
  testID,
431
712
  children: options.map((opt) => {
432
713
  const selected = opt.value === value;
@@ -439,13 +720,13 @@ function SegmentedControl({
439
720
  accessibilityHint: opt.accessibilityHint,
440
721
  onPress: () => onChange(opt.value),
441
722
  style: [
442
- styles6.segment,
443
- selected ? styles6.segmentSelected : null,
723
+ styles8.segment,
724
+ selected ? styles8.segmentSelected : null,
444
725
  { backgroundColor: selected ? colors.surface : TRANSPARENT }
445
726
  ],
446
727
  testID: opt.testID,
447
728
  ...ariaSelectedProps(selected),
448
- children: /* @__PURE__ */ jsx(Text, { style: [styles6.label, { color: selected ? colors.text : colors.textSecondary }], children: opt.label })
729
+ children: /* @__PURE__ */ jsx(Text, { style: [styles8.label, { color: selected ? colors.text : colors.textSecondary }], children: opt.label })
449
730
  },
450
731
  opt.value
451
732
  );
@@ -460,69 +741,6 @@ var TabsCollapsedTrigger = /* @__PURE__ */ ((TabsCollapsedTrigger2) => {
460
741
  TabsCollapsedTrigger2["Hamburger"] = "hamburger";
461
742
  return TabsCollapsedTrigger2;
462
743
  })(TabsCollapsedTrigger || {});
463
- var FOCUSABLE_SELECTOR = [
464
- "a[href]",
465
- "button:not([disabled])",
466
- "input:not([disabled])",
467
- "select:not([disabled])",
468
- "textarea:not([disabled])",
469
- '[tabindex]:not([tabindex="-1"])'
470
- ].join(", ");
471
- function getFocusableElements(container) {
472
- return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
473
- }
474
- function savePreviousFocus() {
475
- return document.activeElement instanceof HTMLElement ? document.activeElement : null;
476
- }
477
- function focusInitial(domNode, initialFocusTestID) {
478
- const named = initialFocusTestID === void 0 ? null : domNode.querySelector(`[data-testid="${initialFocusTestID}"]`);
479
- if (named) {
480
- named.focus();
481
- return;
482
- }
483
- if (domNode.contains(document.activeElement)) return;
484
- getFocusableElements(domNode)[0]?.focus();
485
- }
486
- function handleKeyDown(domNode, event) {
487
- if (event.key !== "Tab") return;
488
- const focusable = getFocusableElements(domNode);
489
- if (focusable.length === 0) {
490
- event.preventDefault();
491
- return;
492
- }
493
- const first = focusable[0];
494
- const last = focusable[focusable.length - 1];
495
- if (!first || !last) {
496
- event.preventDefault();
497
- return;
498
- }
499
- const active = document.activeElement;
500
- if (event.shiftKey && active === first) {
501
- event.preventDefault();
502
- last.focus();
503
- } else if (!event.shiftKey && active === last) {
504
- event.preventDefault();
505
- first.focus();
506
- }
507
- }
508
- function useFocusTrap(containerRef, enabled, initialFocusTestID) {
509
- const previousFocusRef = useRef(null);
510
- useEffect(() => {
511
- if (Platform.OS !== "web" || !enabled) return;
512
- const domNode = containerRef.current;
513
- if (!domNode) return;
514
- const previous = savePreviousFocus();
515
- previousFocusRef.current = previous !== null && domNode.contains(previous) ? null : previous;
516
- queueMicrotask(() => focusInitial(domNode, initialFocusTestID));
517
- const listener = (e) => handleKeyDown(domNode, e);
518
- domNode.addEventListener("keydown", listener);
519
- return () => {
520
- domNode.removeEventListener("keydown", listener);
521
- previousFocusRef.current?.focus();
522
- previousFocusRef.current = null;
523
- };
524
- }, [containerRef, enabled, initialFocusTestID]);
525
- }
526
744
 
527
745
  // src/ModalDropdown/DropdownVariant.ts
528
746
  var DropdownVariant = /* @__PURE__ */ ((DropdownVariant2) => {
@@ -582,7 +800,7 @@ var HEADING_PADDING_H = 16;
582
800
  var HEADING_PADDING_TOP = 8;
583
801
  var HEADING_PADDING_BOTTOM = 4;
584
802
  var HEADING_LETTER_SPACING = 0.5;
585
- var styles7 = StyleSheet.create({
803
+ var styles9 = StyleSheet.create({
586
804
  heading: {
587
805
  fontSize: HEADING_FONT_SIZE,
588
806
  fontWeight: HEADING_FONT_WEIGHT,
@@ -598,7 +816,7 @@ var MenuHeading = ({ testID, text }) => {
598
816
  Text,
599
817
  {
600
818
  accessibilityRole: "header",
601
- style: [styles7.heading, { color: theme.colors.textSecondary }],
819
+ style: [styles9.heading, { color: theme.colors.textSecondary }],
602
820
  testID: `${testID}-menu-heading`,
603
821
  children: text
604
822
  }
@@ -619,7 +837,7 @@ var OPTION_PADDING_V = 12;
619
837
  var ACCENT_BAR_WIDTH = 3;
620
838
  var CHECK_GAP = 8;
621
839
  var CHECK_GLYPH = "\u2713";
622
- var styles8 = StyleSheet.create({
840
+ var styles10 = StyleSheet.create({
623
841
  option: {
624
842
  paddingHorizontal: OPTION_PADDING_H,
625
843
  paddingVertical: OPTION_PADDING_V,
@@ -658,16 +876,16 @@ var OptionRow = ({
658
876
  const isMarked = selectedMarker === "accent-check" /* AccentCheck */;
659
877
  const isActive = isSelected || isHighlighted;
660
878
  const rowStyle = [
661
- styles8.option,
662
- isMarked ? styles8.markedRow : null,
879
+ styles10.option,
880
+ isMarked ? styles10.markedRow : null,
663
881
  isActive ? { backgroundColor: colors.surfaceElevated } : null,
664
882
  isMarked && isSelected ? { borderLeftColor: accentColor } : null
665
883
  ];
666
884
  const textStyle = [
667
- styles8.optionText,
885
+ styles10.optionText,
668
886
  { color: colors.text },
669
- isSelected ? styles8.selectedText : null,
670
- isMarked ? styles8.markedText : null
887
+ isSelected ? styles10.selectedText : null,
888
+ isMarked ? styles10.markedText : null
671
889
  ];
672
890
  const selectionProps = asMenuItem ? { "aria-current": isSelected ? "true" : void 0 } : { "aria-selected": isSelected };
673
891
  return /* @__PURE__ */ jsxs(
@@ -683,7 +901,7 @@ var OptionRow = ({
683
901
  onPress: handlePress,
684
902
  children: [
685
903
  /* @__PURE__ */ jsx(Text, { style: textStyle, children: label }),
686
- isMarked && isSelected ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, testID: `${testID}-check`, children: /* @__PURE__ */ jsx(Text, { style: [styles8.selectedText, { color: accentColor }], children: CHECK_GLYPH }) }) : null
904
+ isMarked && isSelected ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, testID: `${testID}-check`, children: /* @__PURE__ */ jsx(Text, { style: [styles10.selectedText, { color: accentColor }], children: CHECK_GLYPH }) }) : null
687
905
  ]
688
906
  }
689
907
  );
@@ -841,7 +1059,7 @@ var IS_WEB2 = Platform.OS === "web";
841
1059
  var BORDER_RADIUS2 = 8;
842
1060
  var BORDER_WIDTH3 = 1;
843
1061
  var MENU_PADDING2 = 4;
844
- var styles9 = StyleSheet.create({
1062
+ var styles11 = StyleSheet.create({
845
1063
  /** Native (in-tree) popover — anchored absolutely just under the trigger. */
846
1064
  popover: {
847
1065
  position: "absolute",
@@ -928,7 +1146,7 @@ var InlineMenu = ({
928
1146
  themed
929
1147
  ];
930
1148
  }
931
- return [styles9.popover, { minWidth: menuMinWidth }, themed];
1149
+ return [styles11.popover, { minWidth: menuMinWidth }, themed];
932
1150
  }, [colors.border, colors.surface, menuMinWidth, rect]);
933
1151
  const menu = /* @__PURE__ */ jsx(
934
1152
  View,
@@ -943,10 +1161,10 @@ var InlineMenu = ({
943
1161
  Animated.View,
944
1162
  {
945
1163
  pointerEvents: isOpen ? "auto" : "none",
946
- style: [styles9.animated, animatedStyle, isOpen ? null : styles9.inert],
1164
+ style: [styles11.animated, animatedStyle, isOpen ? null : styles11.inert],
947
1165
  children: [
948
1166
  menuHeading !== void 0 ? /* @__PURE__ */ jsx(MenuHeading, { testID, text: menuHeading }) : null,
949
- /* @__PURE__ */ jsx(ScrollView, { style: styles9.scroll, keyboardShouldPersistTaps: "handled", children: options.map((option, index) => /* @__PURE__ */ jsx(
1167
+ /* @__PURE__ */ jsx(ScrollView, { style: styles11.scroll, keyboardShouldPersistTaps: "handled", children: options.map((option, index) => /* @__PURE__ */ jsx(
950
1168
  OptionRow,
951
1169
  {
952
1170
  asMenuItem: true,
@@ -994,7 +1212,7 @@ var CARET_OPEN_ROTATION = "180deg";
994
1212
  var CARET_CLOSED_ROTATION = "0deg";
995
1213
  var POPOVER_ENTER_SCALE = 0.96;
996
1214
  var POPOVER_MOTION_MS = 120;
997
- var styles10 = StyleSheet.create({
1215
+ var styles12 = StyleSheet.create({
998
1216
  anchor: { position: "relative" },
999
1217
  container: {
1000
1218
  borderWidth: BORDER_WIDTH4,
@@ -1109,19 +1327,19 @@ var ModalDropdown = ({
1109
1327
  const isCaret = showCaret && !isHamburger;
1110
1328
  const containerStyle = useMemo(
1111
1329
  () => renderTrigger !== void 0 ? void 0 : [
1112
- styles10.container,
1113
- isHamburger ? styles10.containerHamburger : isCaret ? styles10.containerMenu : null,
1330
+ styles12.container,
1331
+ isHamburger ? styles12.containerHamburger : isCaret ? styles12.containerMenu : null,
1114
1332
  { borderColor: colors.border, backgroundColor: colors.surface }
1115
1333
  ],
1116
1334
  [colors.border, colors.surface, renderTrigger, isHamburger, isCaret]
1117
1335
  );
1118
1336
  const hamburgerStyle = useMemo(
1119
- () => [styles10.hamburger, { color: colors.textSecondary }],
1337
+ () => [styles12.hamburger, { color: colors.textSecondary }],
1120
1338
  [colors.textSecondary]
1121
1339
  );
1122
1340
  const caretStyle = useMemo(
1123
1341
  () => [
1124
- styles10.caret,
1342
+ styles12.caret,
1125
1343
  { color: colors.textSecondary, transform: [{ rotate: isOpen ? CARET_OPEN_ROTATION : CARET_CLOSED_ROTATION }] }
1126
1344
  ],
1127
1345
  [colors.textSecondary, isOpen]
@@ -1131,11 +1349,11 @@ var ModalDropdown = ({
1131
1349
  [optionTestID, testID]
1132
1350
  );
1133
1351
  const anchorStyle = useMemo(
1134
- () => [styles10.anchor, buildAnchorStackStyle(isMenu && isOpen)],
1352
+ () => [styles12.anchor, buildAnchorStackStyle(isMenu && isOpen)],
1135
1353
  [isMenu, isOpen]
1136
1354
  );
1137
1355
  const modalContentStyle = useMemo(
1138
- () => [styles10.modalContent, { backgroundColor: colors.surface }],
1356
+ () => [styles12.modalContent, { backgroundColor: colors.surface }],
1139
1357
  [colors.surface]
1140
1358
  );
1141
1359
  const renderModalOption = useCallback(
@@ -1156,11 +1374,11 @@ var ModalDropdown = ({
1156
1374
  /* @__PURE__ */ jsxs(TouchableOpacity, { ...a11yProps, ...popupProps, ref: triggerRef, style: containerStyle, onPress: handleToggle, children: [
1157
1375
  renderTrigger !== void 0 ? renderTrigger({ label: selectedLabel, isOpen }) : isHamburger ? /* @__PURE__ */ jsxs(Fragment, { children: [
1158
1376
  /* @__PURE__ */ jsx(Text, { style: hamburgerStyle, children: HAMBURGER_GLYPH }),
1159
- /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles10.selectedText, styles10.selectedTextMenu, { color: colors.text }], children: selectedLabel })
1377
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles12.selectedText, styles12.selectedTextMenu, { color: colors.text }], children: selectedLabel })
1160
1378
  ] }) : isCaret ? /* @__PURE__ */ jsxs(Fragment, { children: [
1161
- /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles10.selectedText, styles10.selectedTextMenu, { color: colors.text }], children: selectedLabel }),
1379
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles12.selectedText, styles12.selectedTextMenu, { color: colors.text }], children: selectedLabel }),
1162
1380
  /* @__PURE__ */ jsx(Text, { style: caretStyle, children: CARET_GLYPH })
1163
- ] }) : /* @__PURE__ */ jsx(Text, { style: [styles10.selectedText, { color: colors.text }], children: selectedLabel }),
1381
+ ] }) : /* @__PURE__ */ jsx(Text, { style: [styles12.selectedText, { color: colors.text }], children: selectedLabel }),
1164
1382
  hintNode
1165
1383
  ] }),
1166
1384
  isMenu && menuAnim.mounted ? /* @__PURE__ */ jsx(
@@ -1181,7 +1399,7 @@ var ModalDropdown = ({
1181
1399
  onSelect: handleSelect
1182
1400
  }
1183
1401
  ) : null,
1184
- !isMenu ? /* @__PURE__ */ jsx(Modal, { transparent: true, visible: modalAnim.mounted, onRequestClose: handleClose, children: /* @__PURE__ */ jsxs(View, { style: styles10.modalOverlay, children: [
1402
+ !isMenu ? /* @__PURE__ */ jsx(Modal$1, { transparent: true, visible: modalAnim.mounted, onRequestClose: handleClose, children: /* @__PURE__ */ jsxs(View, { style: styles12.modalOverlay, children: [
1185
1403
  /* @__PURE__ */ jsx(
1186
1404
  TouchableOpacity,
1187
1405
  {
@@ -1274,7 +1492,7 @@ var ROW_PAD_V = 8;
1274
1492
  var PANEL_PAD_TOP = 16;
1275
1493
  var BORDER_WIDTH5 = 1;
1276
1494
  var TEXT_ON_PRIMARY = "#ffffff";
1277
- var styles11 = StyleSheet.create({
1495
+ var styles13 = StyleSheet.create({
1278
1496
  root: {
1279
1497
  width: "100%"
1280
1498
  },
@@ -1328,7 +1546,7 @@ var WideTabStrip = ({
1328
1546
  textSecondary,
1329
1547
  surfaceElevated,
1330
1548
  stripStyle
1331
- }) => /* @__PURE__ */ jsx(View, { style: [styles11.stripOuter, { borderBottomColor: borderColor }], children: /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", "aria-label": accessibilityLabel, style: [styles11.strip, stripStyle], children: tabs.map((tab) => {
1549
+ }) => /* @__PURE__ */ jsx(View, { style: [styles13.stripOuter, { borderBottomColor: borderColor }], children: /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", "aria-label": accessibilityLabel, style: [styles13.strip, stripStyle], children: tabs.map((tab) => {
1332
1550
  const selected = tab.key === activeKey;
1333
1551
  const textColor = selected ? TEXT_ON_PRIMARY : textSecondary;
1334
1552
  const pillColor = selected ? primaryColor : surfaceElevated;
@@ -1342,10 +1560,10 @@ var WideTabStrip = ({
1342
1560
  accessibilityLabel: tab.accessibilityLabel ?? tab.label,
1343
1561
  accessibilityHint: tab.accessibilityHint,
1344
1562
  onPress: () => onChange(tab.key),
1345
- style: [styles11.pill, { backgroundColor: pillColor }],
1563
+ style: [styles13.pill, { backgroundColor: pillColor }],
1346
1564
  testID: tab.testID,
1347
1565
  ...ariaTabProps(selected, panelId, tabId),
1348
- children: /* @__PURE__ */ jsx(Text, { style: [styles11.pillText, { color: textColor }], children: tab.label })
1566
+ children: /* @__PURE__ */ jsx(Text, { style: [styles13.pillText, { color: textColor }], children: tab.label })
1349
1567
  },
1350
1568
  tab.key
1351
1569
  );
@@ -1370,7 +1588,7 @@ var Tabs = ({
1370
1588
  const activePanelId = `${idPrefix}-panel-${activeKey}`;
1371
1589
  const activeTabId = `${idPrefix}-tab-${activeKey}`;
1372
1590
  const panelAria = { "aria-labelledby": activeTabId, id: activePanelId };
1373
- return /* @__PURE__ */ jsxs(View, { style: [styles11.root, style], testID, children: [
1591
+ return /* @__PURE__ */ jsxs(View, { style: [styles13.root, style], testID, children: [
1374
1592
  collapsed ? /* @__PURE__ */ jsx(
1375
1593
  TabsMenu,
1376
1594
  {
@@ -1397,7 +1615,7 @@ var Tabs = ({
1397
1615
  onChange
1398
1616
  }
1399
1617
  ),
1400
- /* @__PURE__ */ jsx(View, { accessibilityRole: "none", style: [styles11.panel, panelStyle], ...panelAria, children })
1618
+ /* @__PURE__ */ jsx(View, { accessibilityRole: "none", style: [styles13.panel, panelStyle], ...panelAria, children })
1401
1619
  ] });
1402
1620
  };
1403
1621
  var PROMPT_PADDING = 20;
@@ -1412,7 +1630,7 @@ var DISMISS_FONT_SIZE = 13;
1412
1630
  var TITLE_MARGIN_BOTTOM = 8;
1413
1631
  var MESSAGE_MARGIN_BOTTOM = 16;
1414
1632
  var CTA_MARGIN_BOTTOM = 8;
1415
- var styles12 = StyleSheet.create({
1633
+ var styles14 = StyleSheet.create({
1416
1634
  container: {
1417
1635
  padding: PROMPT_PADDING,
1418
1636
  borderRadius: PROMPT_BORDER_RADIUS,
@@ -1447,21 +1665,21 @@ var UpgradePrompt = ({
1447
1665
  return /* @__PURE__ */ jsxs(
1448
1666
  View,
1449
1667
  {
1450
- style: [styles12.container, { borderColor: primary, backgroundColor: colors.surface }],
1668
+ style: [styles14.container, { borderColor: primary, backgroundColor: colors.surface }],
1451
1669
  testID: LAYOUT_TEST_IDS.upgradePrompt,
1452
1670
  children: [
1453
- /* @__PURE__ */ jsx(Text, { style: [styles12.title, { color: colors.text }], children: t(LAYOUT_I18N.upgradePromptTitle) }),
1454
- /* @__PURE__ */ jsx(Text, { style: [styles12.message, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptMessage, requiredTier, currentTier) }),
1671
+ /* @__PURE__ */ jsx(Text, { style: [styles14.title, { color: colors.text }], children: t(LAYOUT_I18N.upgradePromptTitle) }),
1672
+ /* @__PURE__ */ jsx(Text, { style: [styles14.message, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptMessage, requiredTier, currentTier) }),
1455
1673
  /* @__PURE__ */ jsx(
1456
1674
  TouchableOpacity,
1457
1675
  {
1458
1676
  accessibilityHint: t(LAYOUT_I18N.upgradePromptCtaHint),
1459
1677
  accessibilityLabel: t(LAYOUT_I18N.upgradePromptCta),
1460
1678
  accessibilityRole: "button",
1461
- style: [styles12.cta, { backgroundColor: primary }],
1679
+ style: [styles14.cta, { backgroundColor: primary }],
1462
1680
  testID: LAYOUT_TEST_IDS.upgradePromptCta,
1463
1681
  onPress: handleUpgradePress,
1464
- children: /* @__PURE__ */ jsx(Text, { style: [styles12.ctaText, { color: colors.surface }], children: t(LAYOUT_I18N.upgradePromptCta) })
1682
+ children: /* @__PURE__ */ jsx(Text, { style: [styles14.ctaText, { color: colors.surface }], children: t(LAYOUT_I18N.upgradePromptCta) })
1465
1683
  }
1466
1684
  ),
1467
1685
  onDismiss ? /* @__PURE__ */ jsx(
@@ -1470,10 +1688,10 @@ var UpgradePrompt = ({
1470
1688
  accessibilityHint: t(LAYOUT_I18N.upgradePromptDismissHint),
1471
1689
  accessibilityLabel: t(LAYOUT_I18N.upgradePromptDismiss),
1472
1690
  accessibilityRole: "button",
1473
- style: styles12.dismiss,
1691
+ style: styles14.dismiss,
1474
1692
  testID: LAYOUT_TEST_IDS.upgradePromptDismiss,
1475
1693
  onPress: onDismiss,
1476
- children: /* @__PURE__ */ jsx(Text, { style: [styles12.dismissText, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptDismiss) })
1694
+ children: /* @__PURE__ */ jsx(Text, { style: [styles14.dismissText, { color: colors.textSecondary }], children: t(LAYOUT_I18N.upgradePromptDismiss) })
1477
1695
  }
1478
1696
  ) : null
1479
1697
  ]
@@ -1481,8 +1699,8 @@ var UpgradePrompt = ({
1481
1699
  );
1482
1700
  };
1483
1701
  var CLOSE_ICON_SIZE = 18;
1484
- var PANEL_ENTER_SCALE = 0.96;
1485
- var styles13 = StyleSheet.create({
1702
+ var PANEL_ENTER_SCALE2 = 0.96;
1703
+ var styles15 = StyleSheet.create({
1486
1704
  animatedFill: { flex: 1 },
1487
1705
  container: {
1488
1706
  flex: 1,
@@ -1507,21 +1725,21 @@ var ModalShell = ({
1507
1725
  showClose = true
1508
1726
  }) => {
1509
1727
  const { theme, t } = useUi();
1510
- const { style: sheetStyle, mounted } = useEnterExit({ visible, fromScale: PANEL_ENTER_SCALE });
1511
- const containerStyle = React11.useMemo(
1512
- () => [styles13.container, { backgroundColor: theme.colors.background }, contentStyle],
1728
+ const { style: sheetStyle, mounted } = useEnterExit({ visible, fromScale: PANEL_ENTER_SCALE2 });
1729
+ const containerStyle = React12.useMemo(
1730
+ () => [styles15.container, { backgroundColor: theme.colors.background }, contentStyle],
1513
1731
  [theme.colors.background, contentStyle]
1514
1732
  );
1515
1733
  const closeA11yLabel = t(LAYOUT_I18N.close);
1516
1734
  const accessibleTitle = typeof title === "string" ? title : t(LAYOUT_I18N.dialog);
1517
1735
  return /* @__PURE__ */ jsx(
1518
- Modal,
1736
+ Modal$1,
1519
1737
  {
1520
1738
  transparent: true,
1521
1739
  testID: LAYOUT_TEST_IDS.modalShell,
1522
1740
  visible: mounted,
1523
1741
  onRequestClose: onCancel,
1524
- children: /* @__PURE__ */ jsx(Animated.View, { style: [styles13.animatedFill, sheetStyle], children: /* @__PURE__ */ jsxs(
1742
+ children: /* @__PURE__ */ jsx(Animated.View, { style: [styles15.animatedFill, sheetStyle], children: /* @__PURE__ */ jsxs(
1525
1743
  ScrollView,
1526
1744
  {
1527
1745
  accessibilityViewIsModal: true,
@@ -1529,7 +1747,7 @@ var ModalShell = ({
1529
1747
  role: "dialog",
1530
1748
  style: containerStyle,
1531
1749
  children: [
1532
- /* @__PURE__ */ jsxs(View, { style: styles13.headerRow, children: [
1750
+ /* @__PURE__ */ jsxs(View, { style: styles15.headerRow, children: [
1533
1751
  /* @__PURE__ */ jsx(Heading, { children: title ?? t(LAYOUT_I18N.closeHeading) }),
1534
1752
  showClose ? /* @__PURE__ */ jsx(
1535
1753
  TouchableOpacity,
@@ -1537,7 +1755,7 @@ var ModalShell = ({
1537
1755
  accessibilityHint: t(LAYOUT_I18N.closeDialogHint),
1538
1756
  accessibilityLabel: closeA11yLabel,
1539
1757
  accessibilityRole: "button",
1540
- style: styles13.closeButton,
1758
+ style: styles15.closeButton,
1541
1759
  testID: LAYOUT_TEST_IDS.modalShellClose,
1542
1760
  onPress: onCancel,
1543
1761
  children: /* @__PURE__ */ jsx(SvgIcon, { color: theme.colors.textSecondary, name: "close", size: CLOSE_ICON_SIZE })
@@ -1551,152 +1769,10 @@ var ModalShell = ({
1551
1769
  }
1552
1770
  );
1553
1771
  };
1554
- function useEscapeKey(enabled, onClose) {
1555
- useEffect(() => {
1556
- if (Platform.OS !== "web" || !enabled) return;
1557
- const onKeyDown = (event) => {
1558
- if (event.key === "Escape") onClose();
1559
- };
1560
- document.addEventListener("keydown", onKeyDown);
1561
- return () => {
1562
- document.removeEventListener("keydown", onKeyDown);
1563
- };
1564
- }, [enabled, onClose]);
1565
- }
1566
- function useScrollLock(enabled) {
1567
- useEffect(() => {
1568
- if (Platform.OS !== "web" || !enabled) return;
1569
- const { body } = document;
1570
- const previousOverflow = body.style.overflow;
1571
- body.style.overflow = "hidden";
1572
- return () => {
1573
- body.style.overflow = previousOverflow;
1574
- };
1575
- }, [enabled]);
1576
- }
1577
- var OVERLAY_PADDING = 16;
1578
- var DIALOG_RADIUS = 12;
1579
- var DIALOG_PADDING = 16;
1580
- var HEADER_GAP = 12;
1581
- var FOOTER_MARGIN = 16;
1582
- var HEADER_MARGIN = 12;
1583
- var DIALOG_MAX_HEIGHT = "90%";
1584
- var PANEL_ENTER_SCALE2 = 0.96;
1585
- var SIZE_MAX_WIDTH = { sm: 360, md: 480, lg: 640 };
1586
- var styles14 = StyleSheet.create({
1587
- overlay: {
1588
- flex: 1,
1589
- justifyContent: "center",
1590
- alignItems: "center",
1591
- padding: OVERLAY_PADDING
1592
- },
1593
- // The scrim is its OWN animated layer (behind the tap-catcher and the panel) so its opacity
1594
- // can fade independently of the panel's fade+scale. `animationType` is a native-only no-op on
1595
- // react-native-web, which is why the fade is driven by `Animated` instead. `pointerEvents` lives
1596
- // in style (not the deprecated prop) so taps fall through to the sibling tap-catcher below.
1597
- scrim: { backgroundColor: MODAL_OVERLAY_COLOR, pointerEvents: "none" },
1598
- dialog: {
1599
- width: "100%",
1600
- borderRadius: DIALOG_RADIUS,
1601
- padding: DIALOG_PADDING,
1602
- maxHeight: DIALOG_MAX_HEIGHT
1603
- },
1604
- headerRow: {
1605
- flexDirection: "row",
1606
- alignItems: "flex-start",
1607
- justifyContent: "space-between",
1608
- columnGap: HEADER_GAP,
1609
- marginBottom: HEADER_MARGIN
1610
- },
1611
- // Occupies the header's leading space so the ✕ pins to the trailing edge even without a title.
1612
- titleWrap: { flex: 1 },
1613
- footer: { marginTop: FOOTER_MARGIN }
1614
- });
1615
- var Modal3 = ({
1616
- visible,
1617
- onClose,
1618
- title,
1619
- children,
1620
- footer,
1621
- size = "md",
1622
- showClose = true,
1623
- testID = LAYOUT_TEST_IDS.modal,
1624
- accessibilityLabel,
1625
- initialFocusTestID
1626
- }) => {
1627
- const { theme, t } = useUi();
1628
- const dialogRef = useRef(null);
1629
- const backdrop = useEnterExit({ visible });
1630
- const panel = useEnterExit({ visible, fromScale: PANEL_ENTER_SCALE2 });
1631
- const mounted = panel.mounted || backdrop.mounted;
1632
- useFocusTrap(dialogRef, visible, initialFocusTestID);
1633
- useEscapeKey(visible, onClose);
1634
- useScrollLock(visible);
1635
- const accessibleName = accessibilityLabel ?? title ?? t(LAYOUT_I18N.dialog);
1636
- const closeLabel = t(LAYOUT_I18N.dialogClose);
1637
- const dialogStyle = useMemo(
1638
- () => [styles14.dialog, { backgroundColor: theme.colors.surface, maxWidth: SIZE_MAX_WIDTH[size] }],
1639
- [theme.colors.surface, size]
1640
- );
1641
- const hasHeader = title !== void 0 || showClose;
1642
- return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: mounted, onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { style: styles14.overlay, children: [
1643
- /* @__PURE__ */ jsx(
1644
- Animated.View,
1645
- {
1646
- style: [StyleSheet.absoluteFill, styles14.scrim, { opacity: backdrop.style.opacity }]
1647
- }
1648
- ),
1649
- /* @__PURE__ */ jsx(
1650
- TouchableOpacity,
1651
- {
1652
- accessible: true,
1653
- accessibilityHint: t(LAYOUT_I18N.dismissDropdownHint),
1654
- accessibilityLabel: t(LAYOUT_I18N.dismissDropdown),
1655
- accessibilityRole: "button",
1656
- activeOpacity: 1,
1657
- style: StyleSheet.absoluteFill,
1658
- testID: `${testID}-backdrop`,
1659
- onPress: onClose
1660
- }
1661
- ),
1662
- /* @__PURE__ */ jsxs(
1663
- Animated.View,
1664
- {
1665
- ref: dialogRef,
1666
- accessibilityViewIsModal: true,
1667
- "aria-label": accessibleName,
1668
- role: "dialog",
1669
- style: [dialogStyle, panel.style],
1670
- testID,
1671
- children: [
1672
- hasHeader ? /* @__PURE__ */ jsxs(View, { style: styles14.headerRow, children: [
1673
- /* @__PURE__ */ jsx(View, { style: styles14.titleWrap, children: title !== void 0 ? /* @__PURE__ */ jsx(Heading, { children: title }) : null }),
1674
- showClose ? /* @__PURE__ */ jsx(
1675
- IconButton,
1676
- {
1677
- accessibilityHint: t(LAYOUT_I18N.closeDialogHint),
1678
- accessibilityLabel: closeLabel,
1679
- appearance: "ghost",
1680
- renderIcon: (color, iconSize) => /* @__PURE__ */ jsx(SvgIcon, { color, name: "close", size: iconSize }),
1681
- size: "md",
1682
- testID: `${testID}-close`,
1683
- tooltip: closeLabel,
1684
- variant: "ghost",
1685
- onPress: onClose
1686
- }
1687
- ) : null
1688
- ] }) : null,
1689
- /* @__PURE__ */ jsx(ScrollView, { children }),
1690
- footer !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles14.footer, children: footer }) : null
1691
- ]
1692
- }
1693
- )
1694
- ] }) });
1695
- };
1696
1772
  var MESSAGE_FONT_SIZE2 = 14;
1697
1773
  var MESSAGE_LINE_HEIGHT = 20;
1698
1774
  var BUTTON_GAP = 12;
1699
- var styles15 = StyleSheet.create({
1775
+ var styles16 = StyleSheet.create({
1700
1776
  message: { fontSize: MESSAGE_FONT_SIZE2, lineHeight: MESSAGE_LINE_HEIGHT },
1701
1777
  footer: { flexDirection: "row", justifyContent: "flex-end", columnGap: BUTTON_GAP }
1702
1778
  });
@@ -1715,7 +1791,7 @@ var ConfirmDialog = ({
1715
1791
  const { theme, t } = useUi();
1716
1792
  const resolvedConfirm = confirmLabel ?? t(LAYOUT_I18N.confirm);
1717
1793
  const resolvedCancel = cancelLabel ?? t(LAYOUT_I18N.cancel);
1718
- const footer = /* @__PURE__ */ jsxs(View, { style: styles15.footer, children: [
1794
+ const footer = /* @__PURE__ */ jsxs(View, { style: styles16.footer, children: [
1719
1795
  /* @__PURE__ */ jsx(
1720
1796
  Button,
1721
1797
  {
@@ -1742,7 +1818,7 @@ var ConfirmDialog = ({
1742
1818
  )
1743
1819
  ] });
1744
1820
  return /* @__PURE__ */ jsx(
1745
- Modal3,
1821
+ Modal,
1746
1822
  {
1747
1823
  footer,
1748
1824
  showClose: false,
@@ -1751,7 +1827,7 @@ var ConfirmDialog = ({
1751
1827
  title,
1752
1828
  visible,
1753
1829
  onClose: onCancel,
1754
- children: /* @__PURE__ */ jsx(Text, { style: [styles15.message, { color: theme.colors.text }], testID: `${testID}-message`, children: message })
1830
+ children: /* @__PURE__ */ jsx(Text, { style: [styles16.message, { color: theme.colors.text }], testID: `${testID}-message`, children: message })
1755
1831
  }
1756
1832
  );
1757
1833
  };
@@ -1764,14 +1840,14 @@ function useAccordionContext() {
1764
1840
  return value;
1765
1841
  }
1766
1842
  var BOXED_GAP = 12;
1767
- var styles16 = StyleSheet.create({
1843
+ var styles17 = StyleSheet.create({
1768
1844
  container: { alignSelf: "stretch" },
1769
1845
  boxed: { gap: BOXED_GAP }
1770
1846
  });
1771
1847
  function computeInitialOpen(children, defaultOpenIds, allowMultiple) {
1772
1848
  const ids = new Set(defaultOpenIds ?? []);
1773
- React11.Children.forEach(children, (child) => {
1774
- if (!React11.isValidElement(child)) return;
1849
+ React12.Children.forEach(children, (child) => {
1850
+ if (!React12.isValidElement(child)) return;
1775
1851
  const props = child.props;
1776
1852
  if (props.defaultOpen === true && typeof props.id === "string") {
1777
1853
  ids.add(props.id);
@@ -1821,7 +1897,7 @@ var Accordion = ({
1821
1897
  [openSet, toggle, allowMultiple, variant]
1822
1898
  );
1823
1899
  const containerStyle = useMemo(() => {
1824
- const base = variant === "boxed" ? [styles16.container, styles16.boxed] : [styles16.container];
1900
+ const base = variant === "boxed" ? [styles17.container, styles17.boxed] : [styles17.container];
1825
1901
  if (style === void 0) return base;
1826
1902
  return [...base, ...Array.isArray(style) ? style : [style]];
1827
1903
  }, [style, variant]);
@@ -1853,7 +1929,7 @@ var BOX_TITLE_FONT_SIZE = 14;
1853
1929
  var BOX_MARKER_FONT_SIZE = 13;
1854
1930
  var BOX_MARKER_GAP = 6;
1855
1931
  var BOX_MARKER = "\u25B8";
1856
- var styles17 = StyleSheet.create({
1932
+ var styles18 = StyleSheet.create({
1857
1933
  item: { borderTopWidth: StyleSheet.hairlineWidth },
1858
1934
  boxItem: { borderWidth: 1, borderRadius: BOX_BORDER_RADIUS, paddingHorizontal: BOX_PADDING_H },
1859
1935
  header: {
@@ -1929,19 +2005,19 @@ var AccordionItem = ({
1929
2005
  );
1930
2006
  const keyboardProps = Platform.OS === "web" ? { onKeyDown: handleKeyDown2 } : {};
1931
2007
  const itemStyle = useMemo(
1932
- () => boxed ? [styles17.boxItem, { borderColor: colors.border }] : [styles17.item, { borderTopColor: colors.border }],
2008
+ () => boxed ? [styles18.boxItem, { borderColor: colors.border }] : [styles18.item, { borderTopColor: colors.border }],
1933
2009
  [boxed, colors.border]
1934
2010
  );
1935
2011
  const headerStyle = useMemo(
1936
2012
  () => [
1937
- styles17.header,
1938
- ...boxed ? [styles17.boxHeader] : [],
2013
+ styles18.header,
2014
+ ...boxed ? [styles18.boxHeader] : [],
1939
2015
  { opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY }
1940
2016
  ],
1941
2017
  [boxed, disabled]
1942
2018
  );
1943
2019
  const resolvedLabel = accessibilityLabel ?? (typeof title === "string" ? title : void 0);
1944
- const titleNode = typeof title === "string" ? /* @__PURE__ */ jsx(Text, { style: [boxed ? styles17.boxTitle : styles17.title, { color: boxed ? colors.textSecondary : colors.text }], children: title }) : title;
2020
+ const titleNode = typeof title === "string" ? /* @__PURE__ */ jsx(Text, { style: [boxed ? styles18.boxTitle : styles18.title, { color: boxed ? colors.textSecondary : colors.text }], children: title }) : title;
1945
2021
  return /* @__PURE__ */ jsxs(View, { style: itemStyle, children: [
1946
2022
  /* @__PURE__ */ jsxs(
1947
2023
  Pressable,
@@ -1958,7 +2034,7 @@ var AccordionItem = ({
1958
2034
  onPress: handlePress,
1959
2035
  ...keyboardProps,
1960
2036
  children: [
1961
- /* @__PURE__ */ jsxs(View, { style: [styles17.headerLeft, boxed ? styles17.headerLeftRow : null], children: [
2037
+ /* @__PURE__ */ jsxs(View, { style: [styles18.headerLeft, boxed ? styles18.headerLeftRow : null], children: [
1962
2038
  boxed ? (
1963
2039
  // Decorative — the open/closed state is already conveyed by aria-expanded on the header.
1964
2040
  /* @__PURE__ */ jsx(
@@ -1967,15 +2043,15 @@ var AccordionItem = ({
1967
2043
  accessibilityElementsHidden: true,
1968
2044
  "aria-hidden": true,
1969
2045
  importantForAccessibility: "no-hide-descendants",
1970
- style: [styles17.marker, { transform: [{ rotate }] }],
2046
+ style: [styles18.marker, { transform: [{ rotate }] }],
1971
2047
  testID: chevronTestID,
1972
- children: /* @__PURE__ */ jsx(Text, { style: [styles17.markerText, { color: colors.textSecondary }], children: BOX_MARKER })
2048
+ children: /* @__PURE__ */ jsx(Text, { style: [styles18.markerText, { color: colors.textSecondary }], children: BOX_MARKER })
1973
2049
  }
1974
2050
  )
1975
2051
  ) : null,
1976
2052
  titleNode
1977
2053
  ] }),
1978
- /* @__PURE__ */ jsxs(View, { style: styles17.headerRight, children: [
2054
+ /* @__PURE__ */ jsxs(View, { style: styles18.headerRight, children: [
1979
2055
  right,
1980
2056
  boxed ? null : /* @__PURE__ */ jsx(
1981
2057
  Animated.View,
@@ -1983,7 +2059,7 @@ var AccordionItem = ({
1983
2059
  accessibilityElementsHidden: true,
1984
2060
  "aria-hidden": true,
1985
2061
  importantForAccessibility: "no-hide-descendants",
1986
- style: [styles17.chevron, { transform: [{ rotate }] }],
2062
+ style: [styles18.chevron, { transform: [{ rotate }] }],
1987
2063
  children: /* @__PURE__ */ jsx(SvgIcon, { color: colors.textSecondary, name: "chevronDown", size: CHEVRON_SIZE, testID: chevronTestID })
1988
2064
  }
1989
2065
  )
@@ -1997,7 +2073,7 @@ var AccordionItem = ({
1997
2073
  accessibilityLabel: resolvedLabel,
1998
2074
  nativeID: bodyTestID,
1999
2075
  role: ROLE_REGION,
2000
- style: boxed ? styles17.boxBody : styles17.body,
2076
+ style: boxed ? styles18.boxBody : styles18.body,
2001
2077
  testID: bodyTestID,
2002
2078
  children
2003
2079
  }
@@ -2060,7 +2136,7 @@ function useAvailableWidth() {
2060
2136
  var AVG_CHAR_WIDTH_RATIO = 0.58;
2061
2137
  var DEFAULT_FONT_SIZE2 = 13;
2062
2138
  var UNMEASURED2 = 0;
2063
- var styles18 = StyleSheet.create({
2139
+ var styles19 = StyleSheet.create({
2064
2140
  base: { fontSize: DEFAULT_FONT_SIZE2 },
2065
2141
  /** `minWidth: 0` lets the text shrink inside a flex row instead of forcing the row wider. */
2066
2142
  fill: { flexShrink: 1, minWidth: 0 }
@@ -2091,7 +2167,7 @@ var TruncatedText = ({
2091
2167
  [value, measureRef]
2092
2168
  );
2093
2169
  const flatStyle = useMemo(
2094
- () => StyleSheet.flatten([styles18.base, style]),
2170
+ () => StyleSheet.flatten([styles19.base, style]),
2095
2171
  [style]
2096
2172
  );
2097
2173
  const fontSize = flatStyle.fontSize ?? DEFAULT_FONT_SIZE2;
@@ -2106,7 +2182,7 @@ var TruncatedText = ({
2106
2182
  ref: attachRef,
2107
2183
  onLayout,
2108
2184
  numberOfLines: 1,
2109
- style: [styles18.base, styles18.fill, style],
2185
+ style: [styles19.base, styles19.fill, style],
2110
2186
  testID,
2111
2187
  accessibilityRole: onPress !== void 0 || href !== void 0 ? "link" : "text",
2112
2188
  accessibilityLabel,
@@ -2209,7 +2285,7 @@ var LABEL_LETTER_SPACING = 0.4;
2209
2285
  var ACTION_PADDING_H = 6;
2210
2286
  var ACTION_PADDING_V = 2;
2211
2287
  var ACTION_RADIUS = 6;
2212
- var styles19 = StyleSheet.create({
2288
+ var styles20 = StyleSheet.create({
2213
2289
  cell: { gap: CELL_GAP },
2214
2290
  label: {
2215
2291
  fontSize: LABEL_FONT_SIZE,
@@ -2274,14 +2350,14 @@ var CopyableId = ({
2274
2350
  const { colors } = theme;
2275
2351
  const { status, copy } = useCopyToClipboard(value, writer);
2276
2352
  const action = useActionState(status);
2277
- return /* @__PURE__ */ jsxs(View, { style: [styles19.cell, style], testID, children: [
2278
- label !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles19.label, { color: colors.textSecondary }], children: label }),
2279
- /* @__PURE__ */ jsxs(View, { style: styles19.row, children: [
2280
- /* @__PURE__ */ jsx(View, { style: styles19.valueWrap, children: /* @__PURE__ */ jsx(
2353
+ return /* @__PURE__ */ jsxs(View, { style: [styles20.cell, style], testID, children: [
2354
+ label !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles20.label, { color: colors.textSecondary }], children: label }),
2355
+ /* @__PURE__ */ jsxs(View, { style: styles20.row, children: [
2356
+ /* @__PURE__ */ jsx(View, { style: styles20.valueWrap, children: /* @__PURE__ */ jsx(
2281
2357
  TruncatedText,
2282
2358
  {
2283
2359
  value,
2284
- style: [styles19.value, { color: colors.text }],
2360
+ style: [styles20.value, { color: colors.text }],
2285
2361
  testID: `${testID}-value`,
2286
2362
  accessibilityLabel: accessibilityLabel ?? value,
2287
2363
  accessibilityHint: t(LAYOUT_I18N.copyableIdHint)
@@ -2295,7 +2371,7 @@ var CopyableId = ({
2295
2371
  accessibilityLabel: t(action.key),
2296
2372
  accessibilityHint: t(LAYOUT_I18N.copyHint),
2297
2373
  testID: `${testID}-copy`,
2298
- style: [styles19.action, { color: action.color }],
2374
+ style: [styles20.action, { color: action.color }],
2299
2375
  children: t(action.key)
2300
2376
  }
2301
2377
  )
@@ -2350,7 +2426,7 @@ var FOOTER_PADDING_V = 6;
2350
2426
  var FOOTER_PADDING_H = 12;
2351
2427
  var FOOTER_FONT_SIZE = 11;
2352
2428
  var FOOTER_OPACITY = 0.75;
2353
- var styles20 = StyleSheet.create({
2429
+ var styles21 = StyleSheet.create({
2354
2430
  footer: {
2355
2431
  paddingVertical: FOOTER_PADDING_V,
2356
2432
  paddingHorizontal: FOOTER_PADDING_H,
@@ -2376,7 +2452,7 @@ var BuildInfoFooter = ({
2376
2452
  const commit = apiCommit ?? fetchedCommit;
2377
2453
  const label = formatBuildInfo(buildVersion, commit);
2378
2454
  const textStyle = useMemo(
2379
- () => [styles20.text, { color: theme.colors.textSecondary }],
2455
+ () => [styles21.text, { color: theme.colors.textSecondary }],
2380
2456
  [theme.colors.textSecondary]
2381
2457
  );
2382
2458
  return /* @__PURE__ */ jsx(
@@ -2384,7 +2460,7 @@ var BuildInfoFooter = ({
2384
2460
  {
2385
2461
  accessibilityLabel: accessibilityLabel ?? label,
2386
2462
  accessibilityHint: accessibilityHint ?? t(LAYOUT_I18N.buildInfoHint),
2387
- style: [styles20.footer, style],
2463
+ style: [styles21.footer, style],
2388
2464
  testID,
2389
2465
  children: /* @__PURE__ */ jsx(Text, { style: textStyle, children: label })
2390
2466
  }
@@ -2395,7 +2471,7 @@ var BORDER = 2;
2395
2471
  var GLYPH_SIZE = 14;
2396
2472
  var GLYPH_LINE = 16;
2397
2473
  var TICK = "\u2713";
2398
- var styles21 = StyleSheet.create({
2474
+ var styles22 = StyleSheet.create({
2399
2475
  circle: {
2400
2476
  width: SIZE,
2401
2477
  height: SIZE,
@@ -2412,9 +2488,9 @@ var CheckMark = ({ filled, accent, ring, glyphColor, testID }) => /* @__PURE__ *
2412
2488
  "aria-hidden": true,
2413
2489
  accessibilityElementsHidden: true,
2414
2490
  importantForAccessibility: "no-hide-descendants",
2415
- style: [styles21.circle, { borderColor: filled ? accent : ring, backgroundColor: filled ? accent : void 0 }],
2491
+ style: [styles22.circle, { borderColor: filled ? accent : ring, backgroundColor: filled ? accent : void 0 }],
2416
2492
  testID,
2417
- children: filled ? /* @__PURE__ */ jsx(Text, { style: [styles21.glyph, { color: glyphColor }], children: TICK }) : null
2493
+ children: filled ? /* @__PURE__ */ jsx(Text, { style: [styles22.glyph, { color: glyphColor }], children: TICK }) : null
2418
2494
  }
2419
2495
  );
2420
2496
  var ListRowToneContext = createContext(null);
@@ -2537,7 +2613,7 @@ var PAD_V = 12;
2537
2613
  var GAP = 4;
2538
2614
  var MARK_GAP = 12;
2539
2615
  var LINE_GAP = 8;
2540
- var styles22 = StyleSheet.create({
2616
+ var styles23 = StyleSheet.create({
2541
2617
  row: {
2542
2618
  flexDirection: "row",
2543
2619
  alignItems: "center",
@@ -2561,7 +2637,7 @@ function focusTarget(event) {
2561
2637
  }
2562
2638
  function slot(node, color, strong) {
2563
2639
  if (typeof node !== "string") return node;
2564
- return /* @__PURE__ */ jsx(Text, { style: [styles22.shrink, strong ? styles22.strong : null, { color }], children: node });
2640
+ return /* @__PURE__ */ jsx(Text, { style: [styles23.shrink, strong ? styles23.strong : null, { color }], children: node });
2565
2641
  }
2566
2642
  var ListRow = ({
2567
2643
  title,
@@ -2593,7 +2669,7 @@ var ListRow = ({
2593
2669
  style: (state) => {
2594
2670
  const { pressed, hovered } = state;
2595
2671
  const look = resolveRowLook(selectedStyle, { selected, pressed, focused, hovered: hovered === true }, palette);
2596
- return [styles22.row, { borderTopColor: colors.border }, look.container];
2672
+ return [styles23.row, { borderTopColor: colors.border }, look.container];
2597
2673
  },
2598
2674
  testID,
2599
2675
  onBlur: () => {
@@ -2606,14 +2682,14 @@ var ListRow = ({
2606
2682
  ...pressedProps(selected),
2607
2683
  children: [
2608
2684
  rest.showCheck ? /* @__PURE__ */ jsx(CheckMark, { accent: palette.accent, filled: rest.checkFilled, glyphColor: palette.background, ring: palette.border, testID: checkTestId }) : null,
2609
- /* @__PURE__ */ jsxs(View, { style: styles22.body, children: [
2610
- /* @__PURE__ */ jsxs(View, { style: styles22.line, children: [
2685
+ /* @__PURE__ */ jsxs(View, { style: styles23.body, children: [
2686
+ /* @__PURE__ */ jsxs(View, { style: styles23.line, children: [
2611
2687
  slot(title, rest.titleColor, true),
2612
2688
  slot(trailing, rest.textColor, true)
2613
2689
  ] }),
2614
- /* @__PURE__ */ jsxs(View, { style: styles22.line, children: [
2615
- /* @__PURE__ */ jsx(View, { style: styles22.shrink, children: slot(meta, rest.textColor, false) }),
2616
- badges === void 0 ? null : /* @__PURE__ */ jsx(View, { style: styles22.badges, children: badges })
2690
+ /* @__PURE__ */ jsxs(View, { style: styles23.line, children: [
2691
+ /* @__PURE__ */ jsx(View, { style: styles23.shrink, children: slot(meta, rest.textColor, false) }),
2692
+ badges === void 0 ? null : /* @__PURE__ */ jsx(View, { style: styles23.badges, children: badges })
2617
2693
  ] })
2618
2694
  ] })
2619
2695
  ]
@@ -2623,6 +2699,6 @@ var ListRow = ({
2623
2699
  ] });
2624
2700
  };
2625
2701
 
2626
- export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, CopyableId, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, Heading, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, MIN_TARGET_PX, Modal3 as Modal, ModalDropdown, ModalShell, RowSelectedStyle, ScreenColumn, Section, SectionVariant, SegmentedControl, SelectedMarker, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatUrlForDisplay, isKeyboardOpen, isWideWebViewport, resolveRowLook, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
2702
+ export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, CopyableId, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, Heading, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, MIN_TARGET_PX, Modal, ModalDropdown, ModalShell, PageFrame, RowSelectedStyle, ScreenColumn, Section, SectionVariant, SegmentedControl, SelectedMarker, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatUrlForDisplay, isKeyboardOpen, isWideWebViewport, pageScale, resolveRowLook, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
2627
2703
  //# sourceMappingURL=index.mjs.map
2628
2704
  //# sourceMappingURL=index.mjs.map