@dloizides/ui-layout 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Section/Section.tsx","../src/constants.ts","../src/Heading/Heading.tsx","../src/StatusBadge/StatusBadge.tsx","../src/SegmentedControl/SegmentedControl.tsx","../src/UpgradePrompt/UpgradePrompt.tsx","../src/hooks/useFocusTrap.ts","../src/ModalDropdown/DropdownVariant.ts","../src/ModalDropdown/menuStacking.ts","../src/ModalDropdown/OptionRow.tsx","../src/ModalDropdown/useMenuKeyboard.ts","../src/ModalDropdown/InlineMenu.tsx","../src/ModalDropdown/resolveDropdownVariant.ts","../src/ModalDropdown/ModalDropdown.tsx","../src/ModalShell/ModalShell.tsx","../src/Accordion/AccordionContext.ts","../src/Accordion/accordionAnimation.ts","../src/Accordion/Accordion.tsx","../src/Accordion/AccordionItem.tsx"],"names":["StyleSheet","useUi","React","jsx","View","styles","Text","useMemo","Pressable","jsxs","TouchableOpacity","useRef","useEffect","Platform","DropdownVariant","BORDER_WIDTH","useCallback","BORDER_RADIUS","MENU_PADDING","useState","useLayoutEffect","ScrollView","createPortal","useWindowDimensions","BODY_FONT_SIZE","MODAL_OVERLAY_COLOR","Modal","FlatList","SvgIcon","createContext","useContext","UIManager","LayoutAnimation","TITLE_FONT_SIZE","prefersReducedMotion","Animated","Easing","handleKeyDown"],"mappings":";;;;;;;;;;;;;;AASA,IAAM,MAAA,GAASA,uBAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,EAAA;AAAA,IACT,WAAA,EAAa,CAAA;AAAA,IACb,YAAA,EAAc;AAAA;AAElB,CAAC,CAAA;AAOM,IAAM,OAAA,GAAU,CAAC,EAAE,QAAA,EAAU,OAAM,KAAwC;AAChF,EAAA,MAAM,EAAE,KAAA,EAAM,GAAIC,gBAAA,EAAM;A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n */\nimport React from 'react';\n\nimport { StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst styles = StyleSheet.create({\n card: {\n padding: 16,\n borderWidth: 1,\n borderRadius: 6,\n },\n});\n\nexport interface SectionProps {\n children?: React.ReactNode;\n style?: ViewStyle | ViewStyle[];\n}\n\nexport const Section = ({ children, style }: SectionProps): React.ReactElement => {\n const { theme } = useUi();\n\n const containerStyle = React.useMemo(\n () => [styles.card, { borderColor: theme.colors.border, backgroundColor: theme.colors.surface }, style],\n [theme.colors.border, theme.colors.surface, style],\n );\n\n return <View style={containerStyle}>{children}</View>;\n};\n\nexport default Section;\n","/** Default testIDs — match the apps' existing values so Playwright selectors keep working. */\nexport const LAYOUT_TEST_IDS = {\n headingText: 'heading-text',\n statusLabel: 'status-label',\n upgradePrompt: 'upgrade-prompt',\n upgradePromptCta: 'upgrade-prompt-cta',\n upgradePromptDismiss: 'upgrade-prompt-dismiss',\n modalShell: 'template-modal',\n modalShellClose: 'cancel-button',\n accordion: 'accordion',\n} as const;\n\n/** Route the UpgradePrompt CTA navigates to by default (the apps' billing settings path). */\nexport const DEFAULT_BILLING_ROUTE = '/settings/billing';\n","/**\n * Heading — themed section heading text.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst styles = StyleSheet.create({\n heading: {\n fontWeight: '700',\n fontSize: 16,\n },\n});\n\nexport interface HeadingProps {\n text?: string;\n children?: React.ReactNode;\n}\n\nexport const Heading = ({ text, children }: HeadingProps): React.ReactElement => {\n const { theme } = useUi();\n\n const headingStyle = React.useMemo(\n () => [styles.heading, { color: theme.colors.text }],\n [theme.colors.text],\n );\n\n return (\n <Text accessibilityRole=\"header\" style={headingStyle} testID={LAYOUT_TEST_IDS.headingText}>\n {text ?? children}\n </Text>\n );\n};\n\nexport default Heading;\n","/**\n * StatusBadge — unified status pill. Colours are passed in; domain adapters map their\n * enums to label/color/backgroundColor.\n */\nimport React, { useMemo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst DEFAULT_PADDING_H = 10;\nconst DEFAULT_PADDING_V = 4;\nconst DEFAULT_BORDER_RADIUS = 12;\nconst DEFAULT_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n badge: {\n paddingHorizontal: DEFAULT_PADDING_H,\n paddingVertical: DEFAULT_PADDING_V,\n borderRadius: DEFAULT_BORDER_RADIUS,\n alignSelf: 'flex-start',\n },\n text: {\n fontSize: DEFAULT_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface StatusBadgeProps {\n label: string;\n color: string;\n backgroundColor: string;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport const StatusBadge = ({\n label,\n color,\n backgroundColor,\n testID = LAYOUT_TEST_IDS.statusLabel,\n accessibilityLabel,\n accessibilityHint,\n}: StatusBadgeProps): React.ReactElement => {\n const { t } = useUi();\n\n const dynamicBadge = useMemo(() => ({ backgroundColor }), [backgroundColor]);\n const dynamicText = useMemo(() => ({ color }), [color]);\n\n return (\n <View\n accessibilityHint={accessibilityHint ?? t('common.statusBadgeHint')}\n accessibilityLabel={accessibilityLabel ?? label}\n style={[styles.badge, dynamicBadge]}\n testID={testID}\n >\n <Text style={[styles.text, dynamicText]}>{label}</Text>\n </View>\n );\n};\n\nexport default StatusBadge;\n","/**\n * SegmentedControl — a single rounded pill *track* holding N mutually-exclusive segments\n * (the iOS-style segmented / tab toggle). The selected segment lifts onto a raised surface\n * with a subtle shadow; the rest stay transparent. Promoted from the v1 AML console's\n * `.lf-mode` mode switch so erevna/katalogos/kefi can share ONE toggle instead of\n * hand-rolling two primary/ghost buttons.\n *\n * Contract discipline (same as the rest of `@dloizides/ui-layout`): NO FM/router/store/icon\n * imports. Labels are pre-localized strings; every colour is read from the\n * `@dloizides/ui-feedback` UiProvider theme, so it re-skins on tenant swap. Renders as a\n * `tablist` of `tab`s (`accessibilityRole` + `accessibilityState.selected`, which\n * react-native-web forwards to `role`/`aria-selected` on the DOM).\n */\nimport React from 'react';\n\nimport {\n Pressable,\n StyleSheet,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst TRACK_PADDING = 3;\nconst TRACK_RADIUS = 999;\nconst SEGMENT_RADIUS = 999;\nconst SEGMENT_PAD_H = 15;\nconst SEGMENT_PAD_V = 7;\nconst SEGMENT_FONT = 14;\nconst SEGMENT_WEIGHT = '600';\nconst BORDER_WIDTH = 1;\n\n/** Shadow under the SELECTED segment — matches v1 `.lf-mode__btn[aria-selected] box-shadow`. */\nconst SHADOW_COLOR = '#141e32';\nconst SHADOW_OPACITY = 0.1;\nconst SHADOW_RADIUS = 3;\nconst SHADOW_OFFSET = { width: 0, height: 1 } as const;\nconst SHADOW_ELEVATION = 2;\nconst TRANSPARENT = 'transparent';\n\nconst styles = StyleSheet.create({\n track: {\n flexDirection: 'row',\n alignSelf: 'flex-start',\n alignItems: 'center',\n gap: TRACK_PADDING + 1,\n padding: TRACK_PADDING,\n borderRadius: TRACK_RADIUS,\n borderWidth: BORDER_WIDTH,\n },\n segment: {\n paddingHorizontal: SEGMENT_PAD_H,\n paddingVertical: SEGMENT_PAD_V,\n borderRadius: SEGMENT_RADIUS,\n },\n segmentSelected: {\n shadowColor: SHADOW_COLOR,\n shadowOpacity: SHADOW_OPACITY,\n shadowRadius: SHADOW_RADIUS,\n shadowOffset: SHADOW_OFFSET,\n elevation: SHADOW_ELEVATION,\n },\n label: {\n fontSize: SEGMENT_FONT,\n fontWeight: SEGMENT_WEIGHT,\n textAlign: 'center',\n },\n});\n\n/**\n * `aria-selected` marks the active tab for assistive tech. react-native's prop types omit\n * `aria-selected`, but react-native-web forwards `aria-*` to the DOM — so we attach it (no\n * `any`) rather than rely on `accessibilityState` (which this RNW build does not map to it).\n */\nfunction ariaSelectedProps(selected: boolean): PressableProps & { 'aria-selected': boolean } {\n return { 'aria-selected': selected };\n}\n\n/** One selectable segment. `value` is what `onChange` emits when it's pressed. */\nexport interface SegmentedOption<V extends string = string> {\n label: string;\n value: V;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport interface SegmentedControlProps<V extends string = string> {\n /** The segments, left → right. */\n options: ReadonlyArray<SegmentedOption<V>>;\n /** The currently-selected value. */\n value: V;\n /** Fired with a segment's `value` when it is pressed. */\n onChange: (value: V) => void;\n /** Accessible name for the whole group (the `tablist`). */\n accessibilityLabel: string;\n /** Optional style override merged LAST onto the track. */\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * A segmented toggle. Generic over the value union so callers get a typed `onChange`\n * (e.g. `SegmentedControl<'peps' | 'leaders'>`).\n */\nexport function SegmentedControl<V extends string = string>({\n options,\n value,\n onChange,\n accessibilityLabel,\n style,\n testID,\n}: SegmentedControlProps<V>): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n\n return (\n <View\n accessibilityRole=\"tablist\"\n aria-label={accessibilityLabel}\n style={[styles.track, { backgroundColor: colors.background, borderColor: colors.border }, style]}\n testID={testID}\n >\n {options.map((opt) => {\n const selected = opt.value === value;\n return (\n <Pressable\n key={opt.value}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n accessibilityLabel={opt.accessibilityLabel ?? opt.label}\n accessibilityHint={opt.accessibilityHint}\n onPress={() => onChange(opt.value)}\n style={[\n styles.segment,\n selected ? styles.segmentSelected : null,\n { backgroundColor: selected ? colors.surface : TRANSPARENT },\n ]}\n testID={opt.testID}\n {...ariaSelectedProps(selected)}\n >\n <Text style={[styles.label, { color: selected ? colors.text : colors.textSecondary }]}>{opt.label}</Text>\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nexport default SegmentedControl;\n","/**\n * UpgradePrompt — shown when a free-tier user hits a feature limit. CTA navigates to the\n * billing route via the injected navigate (default route overridable).\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS, DEFAULT_BILLING_ROUTE } from '../constants';\n\nconst PROMPT_PADDING = 20;\nconst PROMPT_BORDER_RADIUS = 12;\nconst PROMPT_BORDER_WIDTH = 1;\nconst TITLE_FONT_SIZE = 16;\nconst MESSAGE_FONT_SIZE = 14;\nconst BUTTON_PADDING_V = 12;\nconst BUTTON_BORDER_RADIUS = 8;\nconst BUTTON_FONT_SIZE = 14;\nconst DISMISS_FONT_SIZE = 13;\nconst TITLE_MARGIN_BOTTOM = 8;\nconst MESSAGE_MARGIN_BOTTOM = 16;\nconst CTA_MARGIN_BOTTOM = 8;\n\nconst styles = StyleSheet.create({\n container: {\n padding: PROMPT_PADDING,\n borderRadius: PROMPT_BORDER_RADIUS,\n borderWidth: PROMPT_BORDER_WIDTH,\n },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: '700', marginBottom: TITLE_MARGIN_BOTTOM },\n message: { fontSize: MESSAGE_FONT_SIZE, marginBottom: MESSAGE_MARGIN_BOTTOM },\n cta: { paddingVertical: BUTTON_PADDING_V, borderRadius: BUTTON_BORDER_RADIUS, alignItems: 'center', marginBottom: CTA_MARGIN_BOTTOM },\n ctaText: { fontSize: BUTTON_FONT_SIZE, fontWeight: '700' },\n dismiss: { alignItems: 'center', paddingVertical: BUTTON_PADDING_V },\n dismissText: { fontSize: DISMISS_FONT_SIZE },\n});\n\nexport interface UpgradePromptProps {\n /** Human-readable name of the required tier (e.g. \"Pro\"). */\n requiredTier: string;\n /** Current tier name (e.g. \"Free\"). */\n currentTier: string;\n /** Called when the user dismisses the prompt. */\n onDismiss?: () => void;\n /** Route the CTA navigates to (defaults to the billing settings path). */\n billingRoute?: string;\n}\n\nexport const UpgradePrompt = ({\n requiredTier,\n currentTier,\n onDismiss,\n billingRoute = DEFAULT_BILLING_ROUTE,\n}: UpgradePromptProps): React.ReactElement => {\n const { theme, t, navigate } = useUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n function handleUpgradePress(): void {\n if (typeof navigate === 'function') navigate(billingRoute);\n }\n\n return (\n <View\n style={[styles.container, { borderColor: primary, backgroundColor: colors.surface }]}\n testID={LAYOUT_TEST_IDS.upgradePrompt}\n >\n <Text style={[styles.title, { color: colors.text }]}>\n {t('settings.billing.upgradePrompt.title')}\n </Text>\n\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t('settings.billing.upgradePrompt.message', requiredTier, currentTier)}\n </Text>\n\n <TouchableOpacity\n accessibilityHint={t('settings.billing.upgradePrompt.ctaHint')}\n accessibilityLabel={t('settings.billing.upgradePrompt.cta')}\n accessibilityRole=\"button\"\n style={[styles.cta, { backgroundColor: primary }]}\n testID={LAYOUT_TEST_IDS.upgradePromptCta}\n onPress={handleUpgradePress}\n >\n <Text style={[styles.ctaText, { color: colors.surface }]}>\n {t('settings.billing.upgradePrompt.cta')}\n </Text>\n </TouchableOpacity>\n\n {onDismiss ? (\n <TouchableOpacity\n accessibilityHint={t('settings.billing.upgradePrompt.dismissHint')}\n accessibilityLabel={t('settings.billing.upgradePrompt.dismiss')}\n accessibilityRole=\"button\"\n style={styles.dismiss}\n testID={LAYOUT_TEST_IDS.upgradePromptDismiss}\n onPress={onDismiss}\n >\n <Text style={[styles.dismissText, { color: colors.textSecondary }]}>\n {t('settings.billing.upgradePrompt.dismiss')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default UpgradePrompt;\n","/**\n * Traps keyboard focus within a container element on web.\n * No-op on native platforms where `<Modal>` handles focus containment.\n *\n * On enable: saves the previously focused element and focuses the first focusable child.\n * Tab wraps from last to first; Shift+Tab wraps from first to last. On disable/unmount:\n * restores focus to the saved element.\n */\nimport { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nimport { Platform } from 'react-native';\nimport type { View } from 'react-native';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\nfunction getFocusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR));\n}\n\nfunction savePreviousFocus(): HTMLElement | null {\n return document.activeElement instanceof HTMLElement ? document.activeElement : null;\n}\n\nfunction handleKeyDown(domNode: HTMLElement, event: KeyboardEvent): void {\n if (event.key !== 'Tab') return;\n\n const focusable = getFocusableElements(domNode);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (!first || !last) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n\n if (event.shiftKey && active === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n}\n\nexport function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean): void {\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (Platform.OS !== 'web' || !enabled) return;\n\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const domNode = containerRef.current as unknown as HTMLElement | null;\n if (!domNode) return;\n\n previousFocusRef.current = savePreviousFocus();\n queueMicrotask(() => getFocusableElements(domNode)[0]?.focus());\n\n const listener = (e: KeyboardEvent): void => handleKeyDown(domNode, e);\n domNode.addEventListener('keydown', listener);\n\n return () => {\n domNode.removeEventListener('keydown', listener);\n previousFocusRef.current?.focus();\n previousFocusRef.current = null;\n };\n }, [containerRef, enabled]);\n}\n","/**\n * How a {@link ModalDropdown} renders its list of options.\n *\n * Exported as a regular (non-`const`) enum on purpose: `const enum` values are\n * inlined at compile time and cannot cross a published-package boundary when the\n * consumer bundles with `isolatedModules` (esbuild / vite / babel — i.e. every\n * app that consumes this package). A regular enum emits a runtime object that is\n * safe to import and compare in any consumer.\n */\nexport enum DropdownVariant {\n /** Inline popover anchored directly under the trigger — the native `<select>` feel. */\n Menu = 'menu',\n /** Full modal / bottom-sheet overlay with a scrim (the original behaviour). */\n Modal = 'modal',\n}\n","/**\n * menuStacking — the stacking/positioning geometry for the inline dropdown menu.\n *\n * WHY THIS EXISTS (the bug it fixes): react-native-web renders **every** `View` with\n * `position: relative; z-index: 0`, so every View is its OWN stacking context. An inline\n * popover rendered `position:absolute` under its anchor therefore has its `zIndex` trapped\n * inside the anchor's (and the app's field wrapper's) `z-index: 0` context — it can never\n * rise above later-painting sibling Views (adjacent filter fields, the results table, cards).\n * That is why the open menu painted UNDERNEATH following content on wide/desktop web.\n *\n * THE FIX: on web the menu is rendered in a PORTAL to `document.body` with `position: fixed`\n * at the trigger's measured viewport rect and a high `zIndex`. A portal escapes every ancestor\n * stacking context AND every ancestor `overflow: hidden`, so the menu always paints on top and\n * is never clipped — the same \"menu above the table\" outcome the `@dloizides/ui-tables`\n * `SizeDropdown` achieves. On native the menu stays in-tree (`position:absolute` + `elevation`),\n * and the anchor gets a raised `zIndex` while open as defence-in-depth for direct siblings.\n *\n * These builders are pure so the stacking behaviour is unit-testable without RN-web's\n * class-name-based styling (which does not surface as inline DOM styles).\n */\nimport type { ViewStyle } from 'react-native';\n\n/** z-index for the open menu popover — high enough to clear app chrome (tables, cards, fields). */\nexport const MENU_Z_INDEX = 1000;\n/** z-index lifted onto the anchor WRAPPER while the menu is open (native/defence-in-depth). */\nexport const ANCHOR_OPEN_Z_INDEX = 1000;\n/** Native drop shadow depth so the popover reads as floating above the page. */\nexport const MENU_ELEVATION = 8;\n/** Gap between the trigger's bottom edge and the popover's top edge. */\nexport const MENU_TOP_GAP = 4;\n/** The popover scrolls past this height rather than growing unbounded. */\nexport const MENU_MAX_HEIGHT = 300;\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst MENU_PADDING = 4;\n/** Soft drop shadow so the popover reads as floating above the page (web). */\nexport const MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\n\n/** The trigger's viewport-space rect (from `getBoundingClientRect`) needed to place a fixed menu. */\nexport interface AnchorRect {\n top: number;\n left: number;\n width: number;\n bottom: number;\n}\n\n/**\n * Web portal popover style: `position: fixed` at the trigger rect with a high `zIndex`. Because\n * it is portalled to `document.body`, `fixed` positions it against the viewport, so it tracks the\n * trigger via the measured rect (recomputed on scroll/resize) and is clipped by nothing.\n */\nexport function buildPortalPopoverStyle(rect: AnchorRect): ViewStyle {\n return {\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\n position: 'fixed' as unknown as ViewStyle['position'],\n top: rect.bottom + MENU_TOP_GAP,\n left: rect.left,\n width: rect.width,\n zIndex: MENU_Z_INDEX,\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n padding: MENU_PADDING,\n maxHeight: MENU_MAX_HEIGHT,\n boxShadow: MENU_BOX_SHADOW,\n elevation: MENU_ELEVATION,\n };\n}\n\n/**\n * Anchor-wrapper stacking style: while the inline menu is open the wrapper is lifted to a raised\n * `zIndex` so it wins over immediate sibling views (defence-in-depth on top of the web portal;\n * the primary stacking behaviour on native). Returns `null` when closed so nothing changes.\n */\nexport function buildAnchorStackStyle(isMenuOpen: boolean): ViewStyle | null {\n return isMenuOpen ? { zIndex: ANCHOR_OPEN_Z_INDEX, elevation: MENU_ELEVATION } : null;\n}\n","/**\n * OptionRow — a single selectable option, shared by both the modal and the inline\n * menu variants of ModalDropdown so selection/rendering logic is never duplicated.\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst OPTION_BORDER_RADIUS = 4;\nconst BODY_FONT_SIZE = 14;\nconst SELECTED_FONT_WEIGHT = '600' as const;\nconst OPTION_PADDING_H = 16;\nconst OPTION_PADDING_V = 12;\n\nconst styles = StyleSheet.create({\n option: {\n paddingHorizontal: OPTION_PADDING_H,\n paddingVertical: OPTION_PADDING_V,\n borderRadius: OPTION_BORDER_RADIUS,\n },\n optionText: { fontSize: BODY_FONT_SIZE },\n selectedText: { fontWeight: SELECTED_FONT_WEIGHT },\n});\n\nexport interface OptionRowProps {\n testID: string;\n label: string;\n isSelected: boolean;\n /** Keyboard-highlighted row (arrow-key navigation) in the inline menu. */\n isHighlighted?: boolean;\n onSelect: () => void;\n}\n\nexport const OptionRow = ({\n testID,\n label,\n isSelected,\n isHighlighted = false,\n onSelect,\n}: OptionRowProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const handlePress = useCallback(() => { onSelect(); }, [onSelect]);\n\n const isActive = isSelected || isHighlighted;\n const rowStyle = [styles.option, isActive ? { backgroundColor: colors.surfaceElevated } : null];\n const textStyle = [styles.optionText, { color: colors.text }, isSelected ? styles.selectedText : null];\n\n return (\n <TouchableOpacity\n accessible\n accessibilityHint={t('common.selectOptionHint')}\n accessibilityLabel={label}\n accessibilityRole=\"button\"\n aria-selected={isSelected}\n style={rowStyle}\n testID={testID}\n onPress={handlePress}\n >\n <Text style={textStyle}>{label}</Text>\n </TouchableOpacity>\n );\n};\n\nexport default OptionRow;\n","/**\n * useMenuKeyboard — web-only keyboard navigation + click-outside dismissal for the\n * inline dropdown menu. No-op on native platforms (the modal variant is used there).\n *\n * While enabled it wires, on `document`:\n * - ArrowDown / ArrowUp — move the highlight (clamped to the option range)\n * - Home / End — jump to first / last option\n * - Enter — select the highlighted option\n * - Escape — close the menu\n * - mousedown outside the container AND the menu — close the menu\n *\n * On web the menu popover is portalled to `document.body` (to escape ancestor stacking contexts),\n * so it is NOT a DOM descendant of `containerRef`. The outside-click check therefore consults the\n * optional `menuRef` too, otherwise a mousedown on an option would count as \"outside\" and close the\n * menu before the option's click could select it.\n */\nimport { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\nimport { Platform } from 'react-native';\nimport type { View } from 'react-native';\n\nexport interface MenuKeyboardParams {\n containerRef: RefObject<View | null>;\n /** The popover node (portalled on web); clicks inside it are NOT \"outside\". */\n menuRef?: RefObject<View | null>;\n enabled: boolean;\n itemCount: number;\n onHighlightChange: (next: (prev: number) => number) => void;\n onSelectHighlighted: () => void;\n onClose: () => void;\n}\n\n/** True when `target` is inside the DOM node held by `ref` (RN-web refs are HTMLElements at runtime). */\nfunction refContains(ref: RefObject<View | null> | undefined, target: Node | null): boolean {\n if (ref === undefined) return false;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = ref.current as unknown as HTMLElement | null;\n return node !== null && target !== null && node.contains(target);\n}\n\nconst clampIndex = (index: number, itemCount: number): number => {\n if (index < 0) return 0;\n const lastIndex = itemCount - 1;\n return index > lastIndex ? lastIndex : index;\n};\n\nfunction buildKeyHandler(params: MenuKeyboardParams): (event: KeyboardEvent) => void {\n const { itemCount, onHighlightChange, onSelectHighlighted, onClose } = params;\n\n return (event: KeyboardEvent): void => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n onHighlightChange((prev) => clampIndex(prev + 1, itemCount));\n return;\n case 'ArrowUp':\n event.preventDefault();\n onHighlightChange((prev) => clampIndex(prev - 1, itemCount));\n return;\n case 'Home':\n event.preventDefault();\n onHighlightChange(() => 0);\n return;\n case 'End':\n event.preventDefault();\n onHighlightChange(() => clampIndex(itemCount - 1, itemCount));\n return;\n case 'Enter':\n event.preventDefault();\n onSelectHighlighted();\n return;\n case 'Escape':\n event.preventDefault();\n onClose();\n return;\n default:\n }\n };\n}\n\nexport function useMenuKeyboard(params: MenuKeyboardParams): void {\n const { containerRef, menuRef, enabled, onClose } = params;\n\n useEffect(() => {\n if (Platform.OS !== 'web' || !enabled) return;\n\n const onKeyDown = buildKeyHandler(params);\n\n const onMouseDown = (event: MouseEvent): void => {\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = refContains(containerRef, target);\n const insideMenu = refContains(menuRef, target);\n if (!insideAnchor && !insideMenu) onClose();\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n };\n // `params` is rebuilt each render; the primitive/callback members it carries are the real deps.\n }, [containerRef, menuRef, enabled, onClose, params]);\n}\n","/**\n * InlineMenu — the anchored inline dropdown popover (web-native `<select>` feel).\n *\n * Dismissible via click-outside / Escape and navigable with the arrow keys + Enter (see\n * {@link useMenuKeyboard}). It reuses {@link OptionRow} for rendering/selection so no option\n * logic is duplicated.\n *\n * STACKING (the bug this file fixes): react-native-web gives every `View`\n * `position: relative; z-index: 0`, making each View its own stacking context. An absolutely\n * positioned popover therefore has its `zIndex` trapped inside its anchor/field wrapper and paints\n * UNDER later siblings (adjacent filter fields, the results table, cards). To escape that, on WEB\n * the popover is rendered in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured viewport rect and a high `zIndex` — clipped by nothing, above everything. On native it\n * stays in-tree (`position:absolute` + `elevation`). See {@link menuStacking}.\n *\n * The `containerRef` is the relatively-positioned wrapper owned by ModalDropdown that holds the\n * trigger; on native the popover renders inside it. On web the popover lives in the portal, so\n * outside-click detection also consults this popover's own node (`menuRef`).\n */\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { RefObject } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport { Platform, ScrollView, StyleSheet, View } from 'react-native';\nimport type { View as RNView } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { DropdownOption } from './dropdownTypes';\nimport {\n MENU_BOX_SHADOW,\n MENU_ELEVATION,\n MENU_MAX_HEIGHT,\n MENU_TOP_GAP,\n MENU_Z_INDEX,\n buildPortalPopoverStyle,\n type AnchorRect,\n} from './menuStacking';\nimport { OptionRow } from './OptionRow';\nimport { useMenuKeyboard } from './useMenuKeyboard';\n\nconst IS_WEB = Platform.OS === 'web';\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst MENU_PADDING = 4;\n\nconst styles = StyleSheet.create({\n /** Native (in-tree) popover — anchored absolutely just under the trigger. */\n popover: {\n position: 'absolute',\n top: '100%',\n left: 0,\n right: 0,\n marginTop: MENU_TOP_GAP,\n zIndex: MENU_Z_INDEX,\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n padding: MENU_PADDING,\n maxHeight: MENU_MAX_HEIGHT,\n boxShadow: MENU_BOX_SHADOW,\n elevation: MENU_ELEVATION,\n },\n});\n\n/** Read the anchor's viewport rect (web only). Returns null when unavailable (native / no node). */\nfunction readAnchorRect(containerRef: RefObject<RNView | null>): AnchorRect | null {\n if (!IS_WEB) return null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = containerRef.current as unknown as HTMLElement | null;\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\n const r = node.getBoundingClientRect();\n return { top: r.top, left: r.left, width: r.width, bottom: r.bottom };\n}\n\n/**\n * Keep the fixed-positioned web popover glued to its trigger: measure once before paint, then\n * re-measure on scroll (capture, so nested scrollers count) and resize while open. No-op on native.\n */\nfunction useAnchorRect(containerRef: RefObject<RNView | null>): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(() => readAnchorRect(containerRef));\n\n useLayoutEffect(() => {\n if (!IS_WEB) return undefined;\n const measure = (): void => { setRect(readAnchorRect(containerRef)); };\n measure();\n window.addEventListener('scroll', measure, true);\n window.addEventListener('resize', measure);\n return () => {\n window.removeEventListener('scroll', measure, true);\n window.removeEventListener('resize', measure);\n };\n }, [containerRef]);\n\n return rect;\n}\n\nexport interface InlineMenuProps<T> {\n testID: string;\n accessibilityLabel: string;\n value: T;\n options: ReadonlyArray<DropdownOption<T>>;\n containerRef: RefObject<RNView | null>;\n /** Custom testID per option row. Defaults to `` `${testID}-option-${value}` ``. */\n optionTestID?: (value: T) => string;\n onSelect: (value: T) => void;\n onClose: () => void;\n}\n\nexport const InlineMenu = <T extends string | number>({\n testID,\n accessibilityLabel,\n value,\n options,\n containerRef,\n optionTestID,\n onSelect,\n onClose,\n}: InlineMenuProps<T>): React.ReactElement | null => {\n const { theme } = useUi();\n const { colors } = theme;\n\n const menuRef = useRef<RNView>(null);\n const rect = useAnchorRect(containerRef);\n\n const selectedIndex = useMemo(\n () => Math.max(0, options.findIndex((opt) => opt.value === value)),\n [options, value],\n );\n // Lazy init: start the keyboard highlight on the currently-selected option.\n const [highlightedIndex, setHighlightedIndex] = useState<number>(() => selectedIndex);\n\n const selectAt = useCallback(\n (index: number) => {\n const option = options[index];\n if (option !== undefined) onSelect(option.value);\n },\n [options, onSelect],\n );\n\n const selectHighlighted = useCallback(\n () => { selectAt(highlightedIndex); },\n [selectAt, highlightedIndex],\n );\n\n useMenuKeyboard({\n containerRef,\n menuRef,\n enabled: true,\n itemCount: options.length,\n onHighlightChange: setHighlightedIndex,\n onSelectHighlighted: selectHighlighted,\n onClose,\n });\n\n const popoverStyle = useMemo(() => {\n const themed = { borderColor: colors.border, backgroundColor: colors.surface };\n // Web: fixed-positioned in a portal at the measured trigger rect (escapes stacking + clipping).\n if (IS_WEB) return [buildPortalPopoverStyle(rect ?? { top: 0, left: 0, width: 0, bottom: 0 }), themed];\n // Native: in-tree absolute popover under the trigger.\n return [styles.popover, themed];\n }, [colors.border, colors.surface, rect]);\n\n const menu = (\n <View\n ref={menuRef}\n accessibilityRole=\"menu\"\n aria-label={accessibilityLabel}\n style={popoverStyle}\n testID={`${testID}-menu`}\n >\n <ScrollView keyboardShouldPersistTaps=\"handled\">\n {options.map((option, index) => (\n <OptionRow\n key={String(option.value)}\n isHighlighted={index === highlightedIndex}\n isSelected={option.value === value}\n label={option.label}\n testID={\n optionTestID !== undefined ? optionTestID(option.value) : `${testID}-option-${String(option.value)}`\n }\n onSelect={() => onSelect(option.value)}\n />\n ))}\n </ScrollView>\n </View>\n );\n\n // Portal to document.body on web so no ancestor stacking context / overflow can trap or clip it.\n if (IS_WEB) return createPortal(menu, document.body);\n return menu;\n};\n\nexport default InlineMenu;\n","/**\n * Responsive resolution of the effective {@link DropdownVariant}.\n *\n * `resolveDropdownVariant` is a pure function (easy to unit-test with a mocked\n * width); `useResolvedDropdownVariant` is the thin hook that feeds it the live\n * viewport width + platform.\n */\nimport { Platform, useWindowDimensions } from 'react-native';\n\nimport { DropdownVariant } from './DropdownVariant';\n\n/**\n * At or above this viewport width (web only) the dropdown defaults to the inline\n * anchored menu; below it — or on any native platform — it defaults to the modal.\n */\nexport const MENU_BREAKPOINT = 768;\n\n/** The web platform key that {@link Platform.OS} reports under react-native-web. */\nconst WEB_PLATFORM = 'web';\n\n/**\n * Pure resolver. An explicit `variant` always wins; otherwise the inline\n * {@link DropdownVariant.Menu} is chosen on wide web viewports and\n * {@link DropdownVariant.Modal} on narrow web or any native platform.\n */\nexport function resolveDropdownVariant(\n explicit: DropdownVariant | undefined,\n width: number,\n platformOS: string,\n): DropdownVariant {\n if (explicit !== undefined) return explicit;\n\n const isWideWeb = platformOS === WEB_PLATFORM && width >= MENU_BREAKPOINT;\n return isWideWeb ? DropdownVariant.Menu : DropdownVariant.Modal;\n}\n\n/** Hook wrapper that reads the live viewport width + platform and resolves the variant. */\nexport function useResolvedDropdownVariant(\n explicit: DropdownVariant | undefined,\n): DropdownVariant {\n const { width } = useWindowDimensions();\n return resolveDropdownVariant(explicit, width, Platform.OS);\n}\n","/**\n * ModalDropdown — generic dropdown selector (any value type via generics).\n *\n * Renders as either an inline anchored menu (web-native `<select>` feel) or a\n * modal / bottom-sheet, selectable per screen via the `variant` prop. When\n * `variant` is omitted the choice is **responsive**: inline menu on wide/desktop\n * web, modal on narrow/mobile (and always modal on native). Existing callers that\n * never passed `variant` therefore get the inline-on-desktop behaviour for free.\n *\n * Both variants share {@link OptionRow} for option rendering + selection.\n */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { FlatList, Modal, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useUi, MODAL_OVERLAY_COLOR } from '@dloizides/ui-feedback';\n\nimport { useFocusTrap } from '../hooks/useFocusTrap';\nimport { DropdownVariant } from './DropdownVariant';\nimport type { DropdownOption } from './dropdownTypes';\nimport { InlineMenu } from './InlineMenu';\nimport { buildAnchorStackStyle } from './menuStacking';\nimport { OptionRow } from './OptionRow';\nimport { useResolvedDropdownVariant } from './resolveDropdownVariant';\n\n/** State handed to a custom trigger renderer. */\nexport interface DropdownTriggerState {\n /** The selected option's label (or the select placeholder when nothing matches). */\n label: string;\n /** Whether the menu is currently open. */\n isOpen: boolean;\n}\n\nexport interface ModalDropdownProps<T> {\n testID: string;\n accessibilityLabel: string;\n accessibilityHint: string;\n value: T;\n options: ReadonlyArray<DropdownOption<T>>;\n onChange: (value: T) => void;\n /**\n * Force a rendering variant. When omitted the dropdown is **responsive**:\n * an inline anchored menu on wide/desktop web, a modal on narrow/mobile\n * (and always a modal on native). An explicit value overrides the auto choice.\n */\n variant?: DropdownVariant;\n /**\n * Custom ANCHOR content. When supplied, the caller owns the trigger's visuals\n * entirely (the default bordered field box is not rendered) — use it for compact\n * chips / avatars / icon triggers. The a11y wrapper (role=button, `aria-expanded`,\n * the label + hint, the testID) is still supplied by the dropdown, so a custom\n * trigger cannot drop the accessible contract. Omit for the default field look.\n */\n renderTrigger?: (state: DropdownTriggerState) => React.ReactNode;\n /**\n * Custom testID per option row. Defaults to `` `${testID}-option-${value}` ``.\n * Lets a caller keep a pre-existing selector stable when a flat control becomes\n * a dropdown.\n */\n optionTestID?: (value: T) => string;\n}\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst BODY_FONT_SIZE = 14;\nconst MODAL_PADDING = 8;\nconst MODAL_MIN_WIDTH = 200;\nconst MODAL_MAX_HEIGHT = 300;\nconst CONTAINER_PADDING_H = 12;\nconst CONTAINER_PADDING_V = 10;\n\nconst styles = StyleSheet.create({\n anchor: { position: 'relative' },\n container: {\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n paddingHorizontal: CONTAINER_PADDING_H,\n paddingVertical: CONTAINER_PADDING_V,\n },\n selectedText: { fontSize: BODY_FONT_SIZE },\n modalOverlay: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: MODAL_OVERLAY_COLOR,\n },\n modalContent: {\n borderRadius: BORDER_RADIUS,\n padding: MODAL_PADDING,\n minWidth: MODAL_MIN_WIDTH,\n maxHeight: MODAL_MAX_HEIGHT,\n },\n});\n\nexport const ModalDropdown = <T extends string | number>({\n testID,\n accessibilityLabel,\n accessibilityHint,\n value,\n options,\n onChange,\n variant,\n renderTrigger,\n optionTestID,\n}: ModalDropdownProps<T>): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n const resolvedVariant = useResolvedDropdownVariant(variant);\n const isMenu = resolvedVariant === DropdownVariant.Menu;\n\n const [isOpen, setIsOpen] = useState(false);\n const anchorRef = useRef<View>(null);\n const dialogRef = useRef<View>(null);\n useFocusTrap(dialogRef, isOpen && !isMenu);\n\n const selectedLabel = useMemo(() => {\n const found = options.find((opt) => opt.value === value);\n return found?.label ?? t('common.selectPlaceholder');\n }, [options, value, t]);\n\n const handleToggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const handleClose = useCallback(() => { setIsOpen(false); }, []);\n\n const handleSelect = useCallback(\n (optionValue: T) => {\n onChange(optionValue);\n setIsOpen(false);\n },\n [onChange],\n );\n\n // A custom trigger owns its own visuals, so the default bordered field box stands down.\n const containerStyle = useMemo(\n () =>\n renderTrigger !== undefined\n ? undefined\n : [styles.container, { borderColor: colors.border, backgroundColor: colors.surface }],\n [colors.border, colors.surface, renderTrigger],\n );\n\n const optionTestIDFor = useCallback(\n (optionValue: T): string =>\n optionTestID !== undefined ? optionTestID(optionValue) : `${testID}-option-${String(optionValue)}`,\n [optionTestID, testID],\n );\n // While the inline menu is open, lift the anchor wrapper's stacking so it wins over immediate\n // sibling views (defence-in-depth behind the web portal; the primary lift on native).\n const anchorStyle = useMemo(\n () => [styles.anchor, buildAnchorStackStyle(isMenu && isOpen)],\n [isMenu, isOpen],\n );\n const modalContentStyle = useMemo(\n () => [styles.modalContent, { backgroundColor: colors.surface }],\n [colors.surface],\n );\n\n const renderModalOption = useCallback(\n ({ item }: { item: DropdownOption<T> }) => (\n <OptionRow\n isSelected={item.value === value}\n label={item.label}\n testID={optionTestIDFor(item.value)}\n onSelect={() => handleSelect(item.value)}\n />\n ),\n [handleSelect, optionTestIDFor, value],\n );\n const keyExtractor = useCallback((item: DropdownOption<T>) => String(item.value), []);\n\n return (\n <View ref={anchorRef} style={anchorStyle}>\n <TouchableOpacity\n accessible\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: isOpen }}\n aria-expanded={isOpen}\n style={containerStyle}\n testID={testID}\n onPress={handleToggle}\n >\n {renderTrigger !== undefined ? (\n renderTrigger({ label: selectedLabel, isOpen })\n ) : (\n <Text style={[styles.selectedText, { color: colors.text }]}>{selectedLabel}</Text>\n )}\n </TouchableOpacity>\n\n {isMenu && isOpen ? (\n <InlineMenu\n accessibilityLabel={accessibilityLabel}\n containerRef={anchorRef}\n optionTestID={optionTestIDFor}\n options={options}\n testID={testID}\n value={value}\n onClose={handleClose}\n onSelect={handleSelect}\n />\n ) : null}\n\n {!isMenu ? (\n <Modal transparent animationType=\"fade\" visible={isOpen} onRequestClose={handleClose}>\n {/* The dismiss backdrop is a SIBLING behind the dialog, not its parent — a wrapping\n pressable would nest the option buttons inside a button (invalid DOM: \"<button>\n cannot contain a nested <button>\"). Absolute-fill catches taps outside the dialog. */}\n <View style={styles.modalOverlay}>\n <TouchableOpacity\n accessible\n accessibilityHint={t('common.dismissDropdownHint')}\n accessibilityLabel={t('common.dismissDropdown')}\n accessibilityRole=\"button\"\n activeOpacity={1}\n style={StyleSheet.absoluteFill}\n testID={`${testID}-backdrop`}\n onPress={handleClose}\n />\n <View\n ref={dialogRef}\n accessibilityViewIsModal\n aria-label={accessibilityLabel}\n role=\"dialog\"\n style={modalContentStyle}\n >\n <FlatList data={[...options]} keyExtractor={keyExtractor} renderItem={renderModalOption} />\n </View>\n </View>\n </Modal>\n ) : null}\n </View>\n );\n};\n\nexport default ModalDropdown;\n","/**\n * ModalShell — a slide-up full-screen modal with a themed header (title + close button)\n * and a scrollable body. Composes Heading (this package) + SvgIcon (@dloizides/ui-icons).\n */\nimport React from 'react';\n\nimport { Modal, ScrollView, StyleSheet, TouchableOpacity, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { Heading } from '../Heading/Heading';\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst CLOSE_ICON_SIZE = 18;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n headerRow: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n closeButton: {\n padding: 6,\n borderRadius: 6,\n },\n});\n\nexport interface ModalShellProps {\n visible: boolean;\n onCancel: () => void;\n title?: string | React.ReactNode;\n children?: React.ReactNode;\n contentStyle?: StyleProp<ViewStyle>;\n showClose?: boolean;\n}\n\nexport const ModalShell = ({\n visible,\n onCancel,\n title,\n children,\n contentStyle,\n showClose = true,\n}: ModalShellProps): React.ReactElement => {\n const { theme, t } = useUi();\n\n const containerStyle = React.useMemo(\n () => [styles.container, { backgroundColor: theme.colors.background }, contentStyle],\n [theme.colors.background, contentStyle],\n );\n const closeA11yLabel = t('quizTemplates.cancel');\n const accessibleTitle = typeof title === 'string' ? title : t('common.dialog');\n\n return (\n <Modal\n animationType=\"slide\"\n testID={LAYOUT_TEST_IDS.modalShell}\n visible={visible}\n onRequestClose={onCancel}\n >\n <ScrollView\n accessibilityViewIsModal\n aria-label={accessibleTitle}\n role=\"dialog\"\n style={containerStyle}\n >\n <View style={styles.headerRow}>\n <Heading>{title ?? t('close')}</Heading>\n {showClose ? (\n <TouchableOpacity\n accessibilityHint={t('common.closeDialogHint')}\n accessibilityLabel={closeA11yLabel}\n accessibilityRole=\"button\"\n style={styles.closeButton}\n testID={LAYOUT_TEST_IDS.modalShellClose}\n onPress={onCancel}\n >\n <SvgIcon color={theme.colors.textSecondary} name=\"close\" size={CLOSE_ICON_SIZE} />\n </TouchableOpacity>\n ) : null}\n </View>\n\n {children}\n </ScrollView>\n </Modal>\n );\n};\n\nexport default ModalShell;\n","/**\n * AccordionContext — shares the open-item set + toggle between the `Accordion`\n * container (which owns the state) and its `AccordionItem` children.\n */\nimport { createContext, useContext } from 'react';\n\nimport type { AccordionVariant } from './AccordionVariant';\n\nexport interface AccordionContextValue {\n /** Ids of the currently-open items. */\n openIds: ReadonlySet<string>;\n /** Toggle an item open/closed by id (respects `allowMultiple`). */\n toggle: (id: string) => void;\n /** When false, opening an item closes the others. */\n allowMultiple: boolean;\n /** Visual treatment shared with every item (`plain` default, or `boxed`). */\n variant: AccordionVariant;\n}\n\nexport const AccordionContext = createContext<AccordionContextValue | null>(null);\n\n/** Reads the accordion context; throws if an item is rendered outside an `<Accordion>`. */\nexport function useAccordionContext(): AccordionContextValue {\n const value = useContext(AccordionContext);\n if (value === null) {\n throw new Error('AccordionItem must be rendered inside an <Accordion>.');\n }\n return value;\n}\n","/**\n * accordionAnimation — a lightweight, cross-platform-safe open/close animation.\n *\n * `animateNextLayout()` asks the next layout pass to animate (RN `LayoutAnimation`).\n * It is a guarded no-op wherever `LayoutAnimation` is unavailable (e.g. react-native-web\n * stubs it), so it never throws on web OR native.\n */\nimport { LayoutAnimation, Platform, UIManager } from 'react-native';\n\nlet androidEnabled = false;\n\n/** Old-architecture Android requires opting in to LayoutAnimation once, at runtime. */\nfunction enableAndroidLayoutAnimationOnce(): void {\n if (androidEnabled) return;\n androidEnabled = true;\n const isAndroid = Platform.OS === 'android';\n const setter = UIManager.setLayoutAnimationEnabledExperimental;\n if (isAndroid && typeof setter === 'function') {\n setter(true);\n }\n}\n\n/**\n * True when the user asked the OS to reduce motion (web only). The expand/collapse layout\n * animation is then skipped so the panel appears/disappears instantly (WCAG 2.3.3). Safe under\n * SSR / where `matchMedia` is unavailable, and always false on native (handled by the caller).\n */\nfunction prefersReducedMotion(): boolean {\n if (Platform.OS !== 'web' || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/** Animate the layout change caused by the next state update (expand/collapse). */\nexport function animateNextLayout(): void {\n // Honour reduced-motion: skip the animation entirely so the change is instant.\n if (prefersReducedMotion()) return;\n enableAndroidLayoutAnimationOnce();\n const configure = LayoutAnimation.configureNext;\n if (typeof configure !== 'function') return;\n try {\n configure(LayoutAnimation.Presets.easeInEaseOut);\n } catch {\n // LayoutAnimation is a no-op / unavailable on this platform — ignore.\n }\n}\n","/**\n * Accordion — a themed expand/collapse disclosure group.\n *\n * Owns the open-item state and shares it with its {@link AccordionItem} children via\n * context. Works controlled (`openIds` + `onOpenChange`) or uncontrolled\n * (`defaultOpenIds`, plus per-item `defaultOpen`). `allowMultiple` (default) lets any\n * number of items be open at once; set it false for single-open (radio-like) behaviour.\n *\n * `variant` picks the look: `plain` (default) renders borderless so it drops cleanly inside a\n * `Section` / `Card`; `boxed` renders each item as its own bordered, rounded box with a leading\n * ▸ marker (the AML v1 console `<details>` look).\n */\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { AccordionContext, type AccordionContextValue } from './AccordionContext';\nimport type { AccordionItemProps } from './AccordionItem';\nimport type { AccordionVariant } from './AccordionVariant';\nimport { animateNextLayout } from './accordionAnimation';\n\nconst BOXED_GAP = 12;\n\nconst styles = StyleSheet.create({\n container: { alignSelf: 'stretch' },\n boxed: { gap: BOXED_GAP },\n});\n\nexport interface AccordionProps {\n /** `AccordionItem` children. */\n children?: React.ReactNode;\n /** Controlled open ids. When provided, the accordion is controlled. */\n openIds?: readonly string[];\n /** Initial open ids in uncontrolled mode. */\n defaultOpenIds?: readonly string[];\n /** Fired with the next open-id set whenever an item toggles. */\n onOpenChange?: (openIds: string[]) => void;\n /** Allow several items open at once (default true). False = single-open. */\n allowMultiple?: boolean;\n /** Visual treatment: `plain` (default, borderless) or `boxed` (bordered ▸ boxes). */\n variant?: AccordionVariant;\n testID?: string;\n style?: ViewStyle | ViewStyle[];\n}\n\n/** Read the initial open set from `defaultOpenIds` + any child `defaultOpen` flags. */\nfunction computeInitialOpen(\n children: React.ReactNode,\n defaultOpenIds: readonly string[] | undefined,\n allowMultiple: boolean,\n): Set<string> {\n const ids = new Set<string>(defaultOpenIds ?? []);\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n const props = child.props as Partial<AccordionItemProps>;\n if (props.defaultOpen === true && typeof props.id === 'string') {\n ids.add(props.id);\n }\n });\n if (!allowMultiple && ids.size > 1) {\n const first = ids.values().next().value;\n return new Set(first === undefined ? [] : [first]);\n }\n return ids;\n}\n\nexport const Accordion = ({\n children,\n openIds,\n defaultOpenIds,\n onOpenChange,\n allowMultiple = true,\n variant = 'plain',\n testID = 'accordion',\n style,\n}: AccordionProps): React.ReactElement => {\n const isControlled = openIds !== undefined;\n\n const [internalOpen, setInternalOpen] = useState<Set<string>>(() =>\n computeInitialOpen(children, defaultOpenIds, allowMultiple),\n );\n\n const openSet = useMemo<Set<string>>(\n () => (isControlled ? new Set(openIds) : internalOpen),\n [isControlled, openIds, internalOpen],\n );\n\n const toggle = useCallback(\n (id: string) => {\n animateNextLayout();\n const next = new Set(openSet);\n const willOpen = !next.has(id);\n if (!allowMultiple) next.clear();\n if (willOpen) {\n next.add(id);\n } else {\n next.delete(id);\n }\n if (!isControlled) setInternalOpen(next);\n if (onOpenChange !== undefined) onOpenChange(Array.from(next));\n },\n [allowMultiple, isControlled, onOpenChange, openSet],\n );\n\n const contextValue = useMemo<AccordionContextValue>(\n () => ({ openIds: openSet, toggle, allowMultiple, variant }),\n [openSet, toggle, allowMultiple, variant],\n );\n\n const containerStyle = useMemo<ViewStyle[]>(() => {\n const base = variant === 'boxed' ? [styles.container, styles.boxed] : [styles.container];\n if (style === undefined) return base;\n return [...base, ...(Array.isArray(style) ? style : [style])];\n }, [style, variant]);\n\n return (\n <AccordionContext.Provider value={contextValue}>\n <View style={containerStyle} testID={testID}>\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport default Accordion;\n","/**\n * AccordionItem — one disclosure row: a pressable header (title, optional right\n * adornment/badge slot, a rotating chevron) plus a collapsible body region.\n *\n * Reads its open state, toggle and `variant` from the enclosing {@link Accordion} via context.\n * - `plain` (default): a borderless row with the title left and a right-hand chevron that\n * flips 180° on open, separated from the previous item by a hairline divider.\n * - `boxed`: the item is its own bordered, rounded box with a LEADING ▸ marker that rotates\n * 90° on open and a muted, 600-weight summary (the AML v1 console `<details>` look).\n */\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { Animated, Easing, Platform, Pressable, StyleSheet, Text, View, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { useAccordionContext } from './AccordionContext';\n\nconst HEADER_PADDING_H = 16;\nconst HEADER_PADDING_V = 12;\nconst BODY_PADDING_H = 16;\nconst BODY_PADDING_V = 12;\nconst HEADER_GAP = 8;\nconst TITLE_FONT_SIZE = 15;\nconst TITLE_FONT_WEIGHT = '600' as const;\nconst CHEVRON_SIZE = 18;\nconst ROTATE_DURATION_MS = 160;\nconst ROTATE_COLLAPSED = 0;\nconst ROTATE_EXPANDED = 1;\nconst COLLAPSED_DEG = '0deg';\nconst PLAIN_EXPANDED_DEG = '180deg';\nconst BOXED_EXPANDED_DEG = '90deg';\nconst DISABLED_OPACITY = 0.5;\nconst FULL_OPACITY = 1;\nconst ROLE_REGION = 'region';\n\n// Boxed variant (AML v1 `.sc-more` / `.adv-match` <details>).\nconst BOX_BORDER_RADIUS = 10;\nconst BOX_PADDING_H = 14;\nconst BOX_HEADER_PADDING_V = 8;\nconst BOX_BODY_PADDING_BOTTOM = 10;\nconst BOX_BODY_PADDING_TOP = 2;\nconst BOX_TITLE_FONT_SIZE = 14;\nconst BOX_MARKER_FONT_SIZE = 13;\nconst BOX_MARKER_GAP = 6;\nconst BOX_MARKER = '▸'; // ▸\n\nconst styles = StyleSheet.create({\n item: { borderTopWidth: StyleSheet.hairlineWidth },\n boxItem: { borderWidth: 1, borderRadius: BOX_BORDER_RADIUS, paddingHorizontal: BOX_PADDING_H },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: HEADER_PADDING_H,\n paddingVertical: HEADER_PADDING_V,\n },\n boxHeader: { paddingHorizontal: 0, paddingVertical: BOX_HEADER_PADDING_V },\n headerLeft: { flexShrink: 1, flexGrow: 1 },\n headerLeftRow: { flexDirection: 'row', alignItems: 'center' },\n headerRight: { flexDirection: 'row', alignItems: 'center', marginLeft: HEADER_GAP },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n boxTitle: { fontSize: BOX_TITLE_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n chevron: { marginLeft: HEADER_GAP },\n marker: { marginRight: BOX_MARKER_GAP },\n markerText: { fontSize: BOX_MARKER_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n body: { paddingHorizontal: BODY_PADDING_H, paddingBottom: BODY_PADDING_V },\n boxBody: { paddingHorizontal: 0, paddingBottom: BOX_BODY_PADDING_BOTTOM, paddingTop: BOX_BODY_PADDING_TOP },\n});\n\nexport interface AccordionItemProps {\n /** Stable unique id used for open-state tracking + derived testIDs. */\n id: string;\n /** Header title — a string (rendered as themed text) or custom node. */\n title: string | React.ReactNode;\n /** Optional right-hand adornment (badge, count, icon…) shown before the chevron. */\n right?: React.ReactNode;\n /** Collapsible body content. */\n children?: React.ReactNode;\n /** Start open in uncontrolled mode (ignored when the container is controlled). */\n defaultOpen?: boolean;\n /** Disable toggling for this item. */\n disabled?: boolean;\n /** testID for the header button. Body = `${testID}-body`, chevron = `${testID}-chevron`. */\n testID?: string;\n /** Accessible name for the header button (defaults to `title` when it is a string). */\n accessibilityLabel?: string;\n /** Accessible hint for the header button. */\n accessibilityHint?: string;\n}\n\n/**\n * Extra web-only DOM prop react-native-web's `Pressable` forwards but RN's types omit.\n * `Pressable` renders `accessibilityRole=\"button\"` as a native `<button>` (keyboard-operable\n * for free in real browsers); the handler calls `preventDefault()` so the native\n * Enter/Space activation does not ALSO fire `onPress` (no double toggle).\n */\ninterface WebKeyboardProps {\n onKeyDown?: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\nconst ACTIVATION_KEYS = ['Enter', ' ', 'Spacebar'];\nconst INSTANT_DURATION_MS = 0;\n\n/**\n * True when the user asked the OS to reduce motion (web only). The chevron/marker rotation then\n * snaps instead of easing (WCAG 2.3.3). Safe under SSR / where `matchMedia` is absent.\n */\nfunction prefersReducedMotion(): boolean {\n if (Platform.OS !== 'web' || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nexport const AccordionItem = ({\n id,\n title,\n right,\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- read by the container's initial-open scan, not here\n defaultOpen: _defaultOpen,\n disabled = false,\n testID,\n accessibilityLabel,\n accessibilityHint,\n}: AccordionItemProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n const { openIds, toggle, variant } = useAccordionContext();\n const boxed = variant === 'boxed';\n\n const expanded = openIds.has(id);\n const headerTestID = testID ?? `accordion-item-${id}`;\n const bodyTestID = `${headerTestID}-body`;\n const chevronTestID = `${headerTestID}-chevron`;\n\n const [rotation] = useState(() => new Animated.Value(expanded ? ROTATE_EXPANDED : ROTATE_COLLAPSED));\n\n useEffect(() => {\n Animated.timing(rotation, {\n toValue: expanded ? ROTATE_EXPANDED : ROTATE_COLLAPSED,\n duration: prefersReducedMotion() ? INSTANT_DURATION_MS : ROTATE_DURATION_MS,\n easing: Easing.out(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [expanded, rotation]);\n\n const rotate = rotation.interpolate({\n inputRange: [ROTATE_COLLAPSED, ROTATE_EXPANDED],\n outputRange: [COLLAPSED_DEG, boxed ? BOXED_EXPANDED_DEG : PLAIN_EXPANDED_DEG],\n });\n\n const handlePress = useCallback(() => {\n if (!disabled) toggle(id);\n }, [disabled, id, toggle]);\n\n const handleKeyDown = useCallback(\n (event: { key?: string; preventDefault?: () => void }) => {\n if (disabled) return;\n const key = event.key ?? '';\n const isActivation = ACTIVATION_KEYS.includes(key);\n if (!isActivation) return;\n if (typeof event.preventDefault === 'function') event.preventDefault();\n toggle(id);\n },\n [disabled, id, toggle],\n );\n\n const keyboardProps: WebKeyboardProps =\n Platform.OS === 'web' ? { onKeyDown: handleKeyDown } : {};\n\n const itemStyle = useMemo<ViewStyle[]>(\n () =>\n boxed\n ? [styles.boxItem, { borderColor: colors.border }]\n : [styles.item, { borderTopColor: colors.border }],\n [boxed, colors.border],\n );\n const headerStyle = useMemo<ViewStyle[]>(\n () => [\n styles.header,\n ...(boxed ? [styles.boxHeader] : []),\n { opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY },\n ],\n [boxed, disabled],\n );\n\n const resolvedLabel =\n accessibilityLabel ?? (typeof title === 'string' ? title : undefined);\n\n const titleNode =\n typeof title === 'string' ? (\n <Text style={[boxed ? styles.boxTitle : styles.title, { color: boxed ? colors.textSecondary : colors.text }]}>\n {title}\n </Text>\n ) : (\n title\n );\n\n return (\n <View style={itemStyle}>\n <Pressable\n accessibilityHint={accessibilityHint ?? t('common.accordionToggleHint')}\n accessibilityLabel={resolvedLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded, disabled }}\n aria-controls={bodyTestID}\n aria-expanded={expanded}\n disabled={disabled}\n style={headerStyle}\n testID={headerTestID}\n onPress={handlePress}\n {...keyboardProps}\n >\n <View style={[styles.headerLeft, boxed ? styles.headerLeftRow : null]}>\n {boxed ? (\n // Decorative — the open/closed state is already conveyed by aria-expanded on the header.\n <Animated.View\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.marker, { transform: [{ rotate }] }]}\n testID={chevronTestID}\n >\n <Text style={[styles.markerText, { color: colors.textSecondary }]}>{BOX_MARKER}</Text>\n </Animated.View>\n ) : null}\n {titleNode}\n </View>\n <View style={styles.headerRight}>\n {right}\n {boxed ? null : (\n <Animated.View\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.chevron, { transform: [{ rotate }] }]}\n >\n <SvgIcon color={colors.textSecondary} name=\"chevronDown\" size={CHEVRON_SIZE} testID={chevronTestID} />\n </Animated.View>\n )}\n </View>\n </Pressable>\n\n {expanded ? (\n <View\n accessibilityLabel={resolvedLabel}\n nativeID={bodyTestID}\n role={ROLE_REGION}\n style={boxed ? styles.boxBody : styles.body}\n testID={bodyTestID}\n >\n {children}\n </View>\n ) : null}\n </View>\n );\n};\n\nexport default AccordionItem;\n"]}
1
+ {"version":3,"sources":["../src/Section/Section.tsx","../src/constants.ts","../src/Heading/Heading.tsx","../src/StatusBadge/StatusBadge.tsx","../src/SegmentedControl/SegmentedControl.tsx","../src/UpgradePrompt/UpgradePrompt.tsx","../src/hooks/useFocusTrap.ts","../src/ModalDropdown/DropdownVariant.ts","../src/ModalDropdown/menuStacking.ts","../src/ModalDropdown/OptionRow.tsx","../src/ModalDropdown/useMenuKeyboard.ts","../src/ModalDropdown/InlineMenu.tsx","../src/ModalDropdown/resolveDropdownVariant.ts","../src/ModalDropdown/ModalDropdown.tsx","../src/ModalShell/ModalShell.tsx","../src/Accordion/AccordionContext.ts","../src/Accordion/accordionAnimation.ts","../src/Accordion/Accordion.tsx","../src/Accordion/AccordionItem.tsx"],"names":["StyleSheet","useUi","React","jsx","View","styles","Text","useMemo","Pressable","jsxs","TouchableOpacity","useRef","useEffect","Platform","DropdownVariant","BORDER_WIDTH","useCallback","BORDER_RADIUS","MENU_PADDING","useState","useLayoutEffect","ScrollView","createPortal","useWindowDimensions","BODY_FONT_SIZE","MODAL_OVERLAY_COLOR","Modal","FlatList","SvgIcon","createContext","useContext","UIManager","LayoutAnimation","TITLE_FONT_SIZE","prefersReducedMotion","Animated","Easing","handleKeyDown"],"mappings":";;;;;;;;;;;;;;AASA,IAAM,MAAA,GAASA,uBAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,EAAA;AAAA,IACT,WAAA,EAAa,CAAA;AAAA,IACb,YAAA,EAAc;AAAA;AAElB,CAAC,CAAA;AAOM,IAAM,OAAA,GAAU,CAAC,EAAE,QAAA,EAAU,OAAM,KAAwC;AAChF,EAAA,MAAM,EAAE,KAAA,EAAM,GAAIC,gBAAA,EAAM;AAExB,EAAA,MAAM,iBAAiBC,uBAAA,CAAM,OAAA;AAAA,IAC3B,MAAM,CAAC,MAAA,CAAO,IAAA,EAAM,EAAE,WAAA,EAAa,KAAA,CAAM,MAAA,CAAO,MAAA,EAAQ,eAAA,EAAiB,KAAA,CAAM,MAAA,CAAO,OAAA,IAAW,KAAK,CAAA;AAAA,IACtG,CAAC,KAAA,CAAM,MAAA,CAAO,QAAQ,KAAA,CAAM,MAAA,CAAO,SAAS,KAAK;AAAA,GACnD;AAEA,EAAA,uBAAOC,cAAA,CAACC,gBAAA,EAAA,EAAK,KAAA,EAAO,cAAA,EAAiB,QAAA,EAAS,CAAA;AAChD;;;AC9BO,IAAM,eAAA,GAAkB;AAAA,EAC7B,WAAA,EAAa,cAAA;AAAA,EACb,WAAA,EAAa,cAAA;AAAA,EACb,aAAA,EAAe,gBAAA;AAAA,EACf,gBAAA,EAAkB,oBAAA;AAAA,EAClB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AAAA,WAAA,EACH,CAAA;AAAA,0BACAI,eAAAA,CAACL,gBAAAA,EAAA,EAAK,KAAA,EAAOC,SAAO,WAAA,EACjB,QAAA,EAAA;AAAA,YAAA,KAAA;AAAA,YACA,KAAA,GAAQ,uBACPF,cAAAA;AAAA,cAACgC,oBAAA,CAAS,IAAA;AAAA,cAAT;AAAA,gBACC,2BAAA,EAA2B,IAAA;AAAA,gBAC3B,aAAA,EAAW,IAAA;AAAA,gBACX,yBAAA,EAA0B,qBAAA;AAAA,gBAC1B,KAAA,EAAO,CAAC9B,QAAAA,CAAO,OAAA,EAAS,EAAE,SAAA,EAAW,CAAC,EAAE,MAAA,EAAQ,CAAA,EAAG,CAAA;AAAA,gBAEnD,QAAA,kBAAAF,cAAAA,CAACyB,eAAAA,EAAA,EAAQ,KAAA,EAAO,MAAA,CAAO,aAAA,EAAe,IAAA,EAAK,aAAA,EAAc,IAAA,EAAM,YAAA,EAAc,MAAA,EAAQ,aAAA,EAAe;AAAA;AAAA;AACtG,WAAA,EAEJ;AAAA;AAAA;AAAA,KACF;AAAA,IAEC,2BACCzB,cAAAA;AAAA,MAACC,gBAAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAoB,aAAA;AAAA,QACpB,QAAA,EAAU,UAAA;AAAA,QACV,IAAA,EAAM,WAAA;AAAA,QACN,KAAA,EAAO,KAAA,GAAQC,QAAAA,CAAO,OAAA,GAAUA,QAAAA,CAAO,IAAA;AAAA,QACvC,MAAA,EAAQ,UAAA;AAAA,QAEP;AAAA;AAAA,KACH,GACE;AAAA,GAAA,EACN,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * Section — a bordered card container that themes its border + surface.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst styles = StyleSheet.create({\n card: {\n padding: 16,\n borderWidth: 1,\n borderRadius: 6,\n },\n});\n\nexport interface SectionProps {\n children?: React.ReactNode;\n style?: ViewStyle | ViewStyle[];\n}\n\nexport const Section = ({ children, style }: SectionProps): React.ReactElement => {\n const { theme } = useUi();\n\n const containerStyle = React.useMemo(\n () => [styles.card, { borderColor: theme.colors.border, backgroundColor: theme.colors.surface }, style],\n [theme.colors.border, theme.colors.surface, style],\n );\n\n return <View style={containerStyle}>{children}</View>;\n};\n\nexport default Section;\n","/** Default testIDs — match the apps' existing values so Playwright selectors keep working. */\nexport const LAYOUT_TEST_IDS = {\n headingText: 'heading-text',\n statusLabel: 'status-label',\n upgradePrompt: 'upgrade-prompt',\n upgradePromptCta: 'upgrade-prompt-cta',\n upgradePromptDismiss: 'upgrade-prompt-dismiss',\n modalShell: 'template-modal',\n modalShellClose: 'cancel-button',\n accordion: 'accordion',\n} as const;\n\n/** Route the UpgradePrompt CTA navigates to by default (the apps' billing settings path). */\nexport const DEFAULT_BILLING_ROUTE = '/settings/billing';\n","/**\n * Heading — themed section heading text.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst styles = StyleSheet.create({\n heading: {\n fontWeight: '700',\n fontSize: 16,\n },\n});\n\nexport interface HeadingProps {\n text?: string;\n children?: React.ReactNode;\n}\n\nexport const Heading = ({ text, children }: HeadingProps): React.ReactElement => {\n const { theme } = useUi();\n\n const headingStyle = React.useMemo(\n () => [styles.heading, { color: theme.colors.text }],\n [theme.colors.text],\n );\n\n return (\n <Text accessibilityRole=\"header\" style={headingStyle} testID={LAYOUT_TEST_IDS.headingText}>\n {text ?? children}\n </Text>\n );\n};\n\nexport default Heading;\n","/**\n * StatusBadge — unified status pill. Colours are passed in; domain adapters map their\n * enums to label/color/backgroundColor.\n */\nimport React, { useMemo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst DEFAULT_PADDING_H = 10;\nconst DEFAULT_PADDING_V = 4;\nconst DEFAULT_BORDER_RADIUS = 12;\nconst DEFAULT_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n badge: {\n paddingHorizontal: DEFAULT_PADDING_H,\n paddingVertical: DEFAULT_PADDING_V,\n borderRadius: DEFAULT_BORDER_RADIUS,\n alignSelf: 'flex-start',\n },\n text: {\n fontSize: DEFAULT_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface StatusBadgeProps {\n label: string;\n color: string;\n backgroundColor: string;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport const StatusBadge = ({\n label,\n color,\n backgroundColor,\n testID = LAYOUT_TEST_IDS.statusLabel,\n accessibilityLabel,\n accessibilityHint,\n}: StatusBadgeProps): React.ReactElement => {\n const { t } = useUi();\n\n const dynamicBadge = useMemo(() => ({ backgroundColor }), [backgroundColor]);\n const dynamicText = useMemo(() => ({ color }), [color]);\n\n return (\n <View\n accessibilityHint={accessibilityHint ?? t('common.statusBadgeHint')}\n accessibilityLabel={accessibilityLabel ?? label}\n style={[styles.badge, dynamicBadge]}\n testID={testID}\n >\n <Text style={[styles.text, dynamicText]}>{label}</Text>\n </View>\n );\n};\n\nexport default StatusBadge;\n","/**\n * SegmentedControl — a single rounded pill *track* holding N mutually-exclusive segments\n * (the iOS-style segmented / tab toggle). The selected segment lifts onto a raised surface\n * with a subtle shadow; the rest stay transparent. Promoted from the v1 AML console's\n * `.lf-mode` mode switch so erevna/katalogos/kefi can share ONE toggle instead of\n * hand-rolling two primary/ghost buttons.\n *\n * Contract discipline (same as the rest of `@dloizides/ui-layout`): NO FM/router/store/icon\n * imports. Labels are pre-localized strings; every colour is read from the\n * `@dloizides/ui-feedback` UiProvider theme, so it re-skins on tenant swap. Renders as a\n * `tablist` of `tab`s (`accessibilityRole` + `accessibilityState.selected`, which\n * react-native-web forwards to `role`/`aria-selected` on the DOM).\n */\nimport React from 'react';\n\nimport {\n Pressable,\n StyleSheet,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst TRACK_PADDING = 3;\nconst TRACK_RADIUS = 999;\nconst SEGMENT_RADIUS = 999;\nconst SEGMENT_PAD_H = 15;\nconst SEGMENT_PAD_V = 7;\nconst SEGMENT_FONT = 14;\nconst SEGMENT_WEIGHT = '600';\nconst BORDER_WIDTH = 1;\n\n/** Shadow under the SELECTED segment — matches v1 `.lf-mode__btn[aria-selected] box-shadow`. */\nconst SHADOW_COLOR = '#141e32';\nconst SHADOW_OPACITY = 0.1;\nconst SHADOW_RADIUS = 3;\nconst SHADOW_OFFSET = { width: 0, height: 1 } as const;\nconst SHADOW_ELEVATION = 2;\nconst TRANSPARENT = 'transparent';\n\nconst styles = StyleSheet.create({\n track: {\n flexDirection: 'row',\n alignSelf: 'flex-start',\n alignItems: 'center',\n gap: TRACK_PADDING + 1,\n padding: TRACK_PADDING,\n borderRadius: TRACK_RADIUS,\n borderWidth: BORDER_WIDTH,\n },\n segment: {\n paddingHorizontal: SEGMENT_PAD_H,\n paddingVertical: SEGMENT_PAD_V,\n borderRadius: SEGMENT_RADIUS,\n },\n segmentSelected: {\n shadowColor: SHADOW_COLOR,\n shadowOpacity: SHADOW_OPACITY,\n shadowRadius: SHADOW_RADIUS,\n shadowOffset: SHADOW_OFFSET,\n elevation: SHADOW_ELEVATION,\n },\n label: {\n fontSize: SEGMENT_FONT,\n fontWeight: SEGMENT_WEIGHT,\n textAlign: 'center',\n },\n});\n\n/**\n * `aria-selected` marks the active tab for assistive tech. react-native's prop types omit\n * `aria-selected`, but react-native-web forwards `aria-*` to the DOM — so we attach it (no\n * `any`) rather than rely on `accessibilityState` (which this RNW build does not map to it).\n */\nfunction ariaSelectedProps(selected: boolean): PressableProps & { 'aria-selected': boolean } {\n return { 'aria-selected': selected };\n}\n\n/** One selectable segment. `value` is what `onChange` emits when it's pressed. */\nexport interface SegmentedOption<V extends string = string> {\n label: string;\n value: V;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport interface SegmentedControlProps<V extends string = string> {\n /** The segments, left → right. */\n options: ReadonlyArray<SegmentedOption<V>>;\n /** The currently-selected value. */\n value: V;\n /** Fired with a segment's `value` when it is pressed. */\n onChange: (value: V) => void;\n /** Accessible name for the whole group (the `tablist`). */\n accessibilityLabel: string;\n /** Optional style override merged LAST onto the track. */\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * A segmented toggle. Generic over the value union so callers get a typed `onChange`\n * (e.g. `SegmentedControl<'peps' | 'leaders'>`).\n */\nexport function SegmentedControl<V extends string = string>({\n options,\n value,\n onChange,\n accessibilityLabel,\n style,\n testID,\n}: SegmentedControlProps<V>): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n\n return (\n <View\n accessibilityRole=\"tablist\"\n aria-label={accessibilityLabel}\n style={[styles.track, { backgroundColor: colors.background, borderColor: colors.border }, style]}\n testID={testID}\n >\n {options.map((opt) => {\n const selected = opt.value === value;\n return (\n <Pressable\n key={opt.value}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n accessibilityLabel={opt.accessibilityLabel ?? opt.label}\n accessibilityHint={opt.accessibilityHint}\n onPress={() => onChange(opt.value)}\n style={[\n styles.segment,\n selected ? styles.segmentSelected : null,\n { backgroundColor: selected ? colors.surface : TRANSPARENT },\n ]}\n testID={opt.testID}\n {...ariaSelectedProps(selected)}\n >\n <Text style={[styles.label, { color: selected ? colors.text : colors.textSecondary }]}>{opt.label}</Text>\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nexport default SegmentedControl;\n","/**\n * UpgradePrompt — shown when a free-tier user hits a feature limit. CTA navigates to the\n * billing route via the injected navigate (default route overridable).\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { LAYOUT_TEST_IDS, DEFAULT_BILLING_ROUTE } from '../constants';\n\nconst PROMPT_PADDING = 20;\nconst PROMPT_BORDER_RADIUS = 12;\nconst PROMPT_BORDER_WIDTH = 1;\nconst TITLE_FONT_SIZE = 16;\nconst MESSAGE_FONT_SIZE = 14;\nconst BUTTON_PADDING_V = 12;\nconst BUTTON_BORDER_RADIUS = 8;\nconst BUTTON_FONT_SIZE = 14;\nconst DISMISS_FONT_SIZE = 13;\nconst TITLE_MARGIN_BOTTOM = 8;\nconst MESSAGE_MARGIN_BOTTOM = 16;\nconst CTA_MARGIN_BOTTOM = 8;\n\nconst styles = StyleSheet.create({\n container: {\n padding: PROMPT_PADDING,\n borderRadius: PROMPT_BORDER_RADIUS,\n borderWidth: PROMPT_BORDER_WIDTH,\n },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: '700', marginBottom: TITLE_MARGIN_BOTTOM },\n message: { fontSize: MESSAGE_FONT_SIZE, marginBottom: MESSAGE_MARGIN_BOTTOM },\n cta: { paddingVertical: BUTTON_PADDING_V, borderRadius: BUTTON_BORDER_RADIUS, alignItems: 'center', marginBottom: CTA_MARGIN_BOTTOM },\n ctaText: { fontSize: BUTTON_FONT_SIZE, fontWeight: '700' },\n dismiss: { alignItems: 'center', paddingVertical: BUTTON_PADDING_V },\n dismissText: { fontSize: DISMISS_FONT_SIZE },\n});\n\nexport interface UpgradePromptProps {\n /** Human-readable name of the required tier (e.g. \"Pro\"). */\n requiredTier: string;\n /** Current tier name (e.g. \"Free\"). */\n currentTier: string;\n /** Called when the user dismisses the prompt. */\n onDismiss?: () => void;\n /** Route the CTA navigates to (defaults to the billing settings path). */\n billingRoute?: string;\n}\n\nexport const UpgradePrompt = ({\n requiredTier,\n currentTier,\n onDismiss,\n billingRoute = DEFAULT_BILLING_ROUTE,\n}: UpgradePromptProps): React.ReactElement => {\n const { theme, t, navigate } = useUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n function handleUpgradePress(): void {\n if (typeof navigate === 'function') navigate(billingRoute);\n }\n\n return (\n <View\n style={[styles.container, { borderColor: primary, backgroundColor: colors.surface }]}\n testID={LAYOUT_TEST_IDS.upgradePrompt}\n >\n <Text style={[styles.title, { color: colors.text }]}>\n {t('settings.billing.upgradePrompt.title')}\n </Text>\n\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t('settings.billing.upgradePrompt.message', requiredTier, currentTier)}\n </Text>\n\n <TouchableOpacity\n accessibilityHint={t('settings.billing.upgradePrompt.ctaHint')}\n accessibilityLabel={t('settings.billing.upgradePrompt.cta')}\n accessibilityRole=\"button\"\n style={[styles.cta, { backgroundColor: primary }]}\n testID={LAYOUT_TEST_IDS.upgradePromptCta}\n onPress={handleUpgradePress}\n >\n <Text style={[styles.ctaText, { color: colors.surface }]}>\n {t('settings.billing.upgradePrompt.cta')}\n </Text>\n </TouchableOpacity>\n\n {onDismiss ? (\n <TouchableOpacity\n accessibilityHint={t('settings.billing.upgradePrompt.dismissHint')}\n accessibilityLabel={t('settings.billing.upgradePrompt.dismiss')}\n accessibilityRole=\"button\"\n style={styles.dismiss}\n testID={LAYOUT_TEST_IDS.upgradePromptDismiss}\n onPress={onDismiss}\n >\n <Text style={[styles.dismissText, { color: colors.textSecondary }]}>\n {t('settings.billing.upgradePrompt.dismiss')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default UpgradePrompt;\n","/**\n * Traps keyboard focus within a container element on web.\n * No-op on native platforms where `<Modal>` handles focus containment.\n *\n * On enable: saves the previously focused element and focuses the first focusable child.\n * Tab wraps from last to first; Shift+Tab wraps from first to last. On disable/unmount:\n * restores focus to the saved element.\n */\nimport { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nimport { Platform } from 'react-native';\nimport type { View } from 'react-native';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\nfunction getFocusableElements(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR));\n}\n\nfunction savePreviousFocus(): HTMLElement | null {\n return document.activeElement instanceof HTMLElement ? document.activeElement : null;\n}\n\nfunction handleKeyDown(domNode: HTMLElement, event: KeyboardEvent): void {\n if (event.key !== 'Tab') return;\n\n const focusable = getFocusableElements(domNode);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (!first || !last) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n\n if (event.shiftKey && active === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n}\n\nexport function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean): void {\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (Platform.OS !== 'web' || !enabled) return;\n\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const domNode = containerRef.current as unknown as HTMLElement | null;\n if (!domNode) return;\n\n previousFocusRef.current = savePreviousFocus();\n queueMicrotask(() => getFocusableElements(domNode)[0]?.focus());\n\n const listener = (e: KeyboardEvent): void => handleKeyDown(domNode, e);\n domNode.addEventListener('keydown', listener);\n\n return () => {\n domNode.removeEventListener('keydown', listener);\n previousFocusRef.current?.focus();\n previousFocusRef.current = null;\n };\n }, [containerRef, enabled]);\n}\n","/**\n * How a {@link ModalDropdown} renders its list of options.\n *\n * Exported as a regular (non-`const`) enum on purpose: `const enum` values are\n * inlined at compile time and cannot cross a published-package boundary when the\n * consumer bundles with `isolatedModules` (esbuild / vite / babel — i.e. every\n * app that consumes this package). A regular enum emits a runtime object that is\n * safe to import and compare in any consumer.\n */\nexport enum DropdownVariant {\n /** Inline popover anchored directly under the trigger — the native `<select>` feel. */\n Menu = 'menu',\n /** Full modal / bottom-sheet overlay with a scrim (the original behaviour). */\n Modal = 'modal',\n}\n","/**\n * menuStacking — the stacking/positioning geometry for the inline dropdown menu.\n *\n * WHY THIS EXISTS (the bug it fixes): react-native-web renders **every** `View` with\n * `position: relative; z-index: 0`, so every View is its OWN stacking context. An inline\n * popover rendered `position:absolute` under its anchor therefore has its `zIndex` trapped\n * inside the anchor's (and the app's field wrapper's) `z-index: 0` context — it can never\n * rise above later-painting sibling Views (adjacent filter fields, the results table, cards).\n * That is why the open menu painted UNDERNEATH following content on wide/desktop web.\n *\n * THE FIX: on web the menu is rendered in a PORTAL to `document.body` with `position: fixed`\n * at the trigger's measured viewport rect and a high `zIndex`. A portal escapes every ancestor\n * stacking context AND every ancestor `overflow: hidden`, so the menu always paints on top and\n * is never clipped — the same \"menu above the table\" outcome the `@dloizides/ui-tables`\n * `SizeDropdown` achieves. On native the menu stays in-tree (`position:absolute` + `elevation`),\n * and the anchor gets a raised `zIndex` while open as defence-in-depth for direct siblings.\n *\n * These builders are pure so the stacking behaviour is unit-testable without RN-web's\n * class-name-based styling (which does not surface as inline DOM styles).\n */\nimport type { ViewStyle } from 'react-native';\n\n/** z-index for the open menu popover — high enough to clear app chrome (tables, cards, fields). */\nexport const MENU_Z_INDEX = 1000;\n/** z-index lifted onto the anchor WRAPPER while the menu is open (native/defence-in-depth). */\nexport const ANCHOR_OPEN_Z_INDEX = 1000;\n/** Native drop shadow depth so the popover reads as floating above the page. */\nexport const MENU_ELEVATION = 8;\n/** Gap between the trigger's bottom edge and the popover's top edge. */\nexport const MENU_TOP_GAP = 4;\n/** The popover scrolls past this height rather than growing unbounded. */\nexport const MENU_MAX_HEIGHT = 300;\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst MENU_PADDING = 4;\n/** Soft drop shadow so the popover reads as floating above the page (web). */\nexport const MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\n\n/** The trigger's viewport-space rect (from `getBoundingClientRect`) needed to place a fixed menu. */\nexport interface AnchorRect {\n top: number;\n left: number;\n width: number;\n bottom: number;\n}\n\n/**\n * Web portal popover style: `position: fixed` at the trigger rect with a high `zIndex`. Because\n * it is portalled to `document.body`, `fixed` positions it against the viewport, so it tracks the\n * trigger via the measured rect (recomputed on scroll/resize) and is clipped by nothing.\n *\n * The popover matches the trigger's width — right for a full-width field, but a COMPACT anchor (a\n * locale pill, an avatar chip, an icon button) would then get a menu too narrow to read its own\n * option labels. `minWidth` sets a floor for exactly that case; it never shrinks a menu.\n */\nexport function buildPortalPopoverStyle(rect: AnchorRect, minWidth = 0): ViewStyle {\n return {\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\n position: 'fixed' as unknown as ViewStyle['position'],\n top: rect.bottom + MENU_TOP_GAP,\n left: rect.left,\n width: Math.max(rect.width, minWidth),\n zIndex: MENU_Z_INDEX,\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n padding: MENU_PADDING,\n maxHeight: MENU_MAX_HEIGHT,\n boxShadow: MENU_BOX_SHADOW,\n elevation: MENU_ELEVATION,\n };\n}\n\n/**\n * Anchor-wrapper stacking style: while the inline menu is open the wrapper is lifted to a raised\n * `zIndex` so it wins over immediate sibling views (defence-in-depth on top of the web portal;\n * the primary stacking behaviour on native). Returns `null` when closed so nothing changes.\n */\nexport function buildAnchorStackStyle(isMenuOpen: boolean): ViewStyle | null {\n return isMenuOpen ? { zIndex: ANCHOR_OPEN_Z_INDEX, elevation: MENU_ELEVATION } : null;\n}\n","/**\n * OptionRow — a single selectable option, shared by both the modal and the inline\n * menu variants of ModalDropdown so selection/rendering logic is never duplicated.\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst OPTION_BORDER_RADIUS = 4;\nconst BODY_FONT_SIZE = 14;\nconst SELECTED_FONT_WEIGHT = '600' as const;\nconst OPTION_PADDING_H = 16;\nconst OPTION_PADDING_V = 12;\n\nconst styles = StyleSheet.create({\n option: {\n paddingHorizontal: OPTION_PADDING_H,\n paddingVertical: OPTION_PADDING_V,\n borderRadius: OPTION_BORDER_RADIUS,\n },\n optionText: { fontSize: BODY_FONT_SIZE },\n selectedText: { fontWeight: SELECTED_FONT_WEIGHT },\n});\n\nexport interface OptionRowProps {\n testID: string;\n label: string;\n isSelected: boolean;\n /** Keyboard-highlighted row (arrow-key navigation) in the inline menu. */\n isHighlighted?: boolean;\n onSelect: () => void;\n}\n\nexport const OptionRow = ({\n testID,\n label,\n isSelected,\n isHighlighted = false,\n onSelect,\n}: OptionRowProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const handlePress = useCallback(() => { onSelect(); }, [onSelect]);\n\n const isActive = isSelected || isHighlighted;\n const rowStyle = [styles.option, isActive ? { backgroundColor: colors.surfaceElevated } : null];\n const textStyle = [styles.optionText, { color: colors.text }, isSelected ? styles.selectedText : null];\n\n return (\n <TouchableOpacity\n accessible\n accessibilityHint={t('common.selectOptionHint')}\n accessibilityLabel={label}\n accessibilityRole=\"button\"\n aria-selected={isSelected}\n style={rowStyle}\n testID={testID}\n onPress={handlePress}\n >\n <Text style={textStyle}>{label}</Text>\n </TouchableOpacity>\n );\n};\n\nexport default OptionRow;\n","/**\n * useMenuKeyboard — web-only keyboard navigation + click-outside dismissal for the\n * inline dropdown menu. No-op on native platforms (the modal variant is used there).\n *\n * While enabled it wires, on `document`:\n * - ArrowDown / ArrowUp — move the highlight (clamped to the option range)\n * - Home / End — jump to first / last option\n * - Enter — select the highlighted option\n * - Escape — close the menu\n * - mousedown outside the container AND the menu — close the menu\n *\n * On web the menu popover is portalled to `document.body` (to escape ancestor stacking contexts),\n * so it is NOT a DOM descendant of `containerRef`. The outside-click check therefore consults the\n * optional `menuRef` too, otherwise a mousedown on an option would count as \"outside\" and close the\n * menu before the option's click could select it.\n *\n * WHY THE KEY LISTENER IS ON THE **CAPTURE** PHASE (a real bug this fixes): the trigger keeps DOM\n * focus while the menu is open, and react-native-web maps Enter on a focused Touchable to `onPress`.\n * React dispatches that from its ROOT container listener — an ancestor of the trigger but a\n * DESCENDANT of `document` — so on a BUBBLING listener React's handler ran FIRST: it toggled the\n * menu shut, React unmounted the popover, this effect's cleanup removed the very listener the event\n * was still travelling toward, and `document` never saw the Enter. Net effect: **Enter closed the\n * menu instead of selecting the highlighted option** — keyboard users could open and navigate a\n * dropdown but never choose with the keyboard. Listening in the CAPTURE phase puts this handler\n * ahead of React's, and `stopPropagation` on the keys the open menu owns keeps the trigger from\n * re-toggling behind our back.\n */\nimport { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\nimport { Platform } from 'react-native';\nimport type { View } from 'react-native';\n\nexport interface MenuKeyboardParams {\n containerRef: RefObject<View | null>;\n /** The popover node (portalled on web); clicks inside it are NOT \"outside\". */\n menuRef?: RefObject<View | null>;\n enabled: boolean;\n itemCount: number;\n onHighlightChange: (next: (prev: number) => number) => void;\n onSelectHighlighted: () => void;\n onClose: () => void;\n}\n\n/** True when `target` is inside the DOM node held by `ref` (RN-web refs are HTMLElements at runtime). */\nfunction refContains(ref: RefObject<View | null> | undefined, target: Node | null): boolean {\n if (ref === undefined) return false;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = ref.current as unknown as HTMLElement | null;\n return node !== null && target !== null && node.contains(target);\n}\n\nconst clampIndex = (index: number, itemCount: number): number => {\n if (index < 0) return 0;\n const lastIndex = itemCount - 1;\n return index > lastIndex ? lastIndex : index;\n};\n\n/**\n * An OPEN menu owns these keys: swallow them so the still-focused trigger (whose Enter\n * react-native-web maps to `onPress`) cannot toggle the menu shut behind the handler's back.\n */\nfunction claimKey(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nfunction buildKeyHandler(params: MenuKeyboardParams): (event: KeyboardEvent) => void {\n const { itemCount, onHighlightChange, onSelectHighlighted, onClose } = params;\n\n return (event: KeyboardEvent): void => {\n switch (event.key) {\n case 'ArrowDown':\n claimKey(event);\n onHighlightChange((prev) => clampIndex(prev + 1, itemCount));\n return;\n case 'ArrowUp':\n claimKey(event);\n onHighlightChange((prev) => clampIndex(prev - 1, itemCount));\n return;\n case 'Home':\n claimKey(event);\n onHighlightChange(() => 0);\n return;\n case 'End':\n claimKey(event);\n onHighlightChange(() => clampIndex(itemCount - 1, itemCount));\n return;\n case 'Enter':\n claimKey(event);\n onSelectHighlighted();\n return;\n case 'Escape':\n claimKey(event);\n onClose();\n return;\n default:\n }\n };\n}\n\nexport function useMenuKeyboard(params: MenuKeyboardParams): void {\n const { containerRef, menuRef, enabled, onClose } = params;\n\n useEffect(() => {\n if (Platform.OS !== 'web' || !enabled) return;\n\n const onKeyDown = buildKeyHandler(params);\n\n const onMouseDown = (event: MouseEvent): void => {\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = refContains(containerRef, target);\n const insideMenu = refContains(menuRef, target);\n if (!insideAnchor && !insideMenu) onClose();\n };\n\n // CAPTURE phase — see the file header: on the bubble phase React's root listener (the trigger's\n // Enter → onPress) ran first, closed the menu, and unmounted this listener mid-flight, so Enter\n // never selected. Capture puts the open menu's keys ahead of it.\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onMouseDown);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown, true);\n document.removeEventListener('mousedown', onMouseDown);\n };\n // `params` is rebuilt each render; the primitive/callback members it carries are the real deps.\n }, [containerRef, menuRef, enabled, onClose, params]);\n}\n","/**\n * InlineMenu — the anchored inline dropdown popover (web-native `<select>` feel).\n *\n * Dismissible via click-outside / Escape and navigable with the arrow keys + Enter (see\n * {@link useMenuKeyboard}). It reuses {@link OptionRow} for rendering/selection so no option\n * logic is duplicated.\n *\n * STACKING (the bug this file fixes): react-native-web gives every `View`\n * `position: relative; z-index: 0`, making each View its own stacking context. An absolutely\n * positioned popover therefore has its `zIndex` trapped inside its anchor/field wrapper and paints\n * UNDER later siblings (adjacent filter fields, the results table, cards). To escape that, on WEB\n * the popover is rendered in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured viewport rect and a high `zIndex` — clipped by nothing, above everything. On native it\n * stays in-tree (`position:absolute` + `elevation`). See {@link menuStacking}.\n *\n * The `containerRef` is the relatively-positioned wrapper owned by ModalDropdown that holds the\n * trigger; on native the popover renders inside it. On web the popover lives in the portal, so\n * outside-click detection also consults this popover's own node (`menuRef`).\n */\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { RefObject } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport { Platform, ScrollView, StyleSheet, View } from 'react-native';\nimport type { View as RNView } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { DropdownOption } from './dropdownTypes';\nimport {\n MENU_BOX_SHADOW,\n MENU_ELEVATION,\n MENU_MAX_HEIGHT,\n MENU_TOP_GAP,\n MENU_Z_INDEX,\n buildPortalPopoverStyle,\n type AnchorRect,\n} from './menuStacking';\nimport { OptionRow } from './OptionRow';\nimport { useMenuKeyboard } from './useMenuKeyboard';\n\nconst IS_WEB = Platform.OS === 'web';\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst MENU_PADDING = 4;\n\nconst styles = StyleSheet.create({\n /** Native (in-tree) popover — anchored absolutely just under the trigger. */\n popover: {\n position: 'absolute',\n top: '100%',\n left: 0,\n right: 0,\n marginTop: MENU_TOP_GAP,\n zIndex: MENU_Z_INDEX,\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n padding: MENU_PADDING,\n maxHeight: MENU_MAX_HEIGHT,\n boxShadow: MENU_BOX_SHADOW,\n elevation: MENU_ELEVATION,\n },\n});\n\n/** Read the anchor's viewport rect (web only). Returns null when unavailable (native / no node). */\nfunction readAnchorRect(containerRef: RefObject<RNView | null>): AnchorRect | null {\n if (!IS_WEB) return null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = containerRef.current as unknown as HTMLElement | null;\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\n const r = node.getBoundingClientRect();\n return { top: r.top, left: r.left, width: r.width, bottom: r.bottom };\n}\n\n/**\n * Keep the fixed-positioned web popover glued to its trigger: measure once before paint, then\n * re-measure on scroll (capture, so nested scrollers count) and resize while open. No-op on native.\n */\nfunction useAnchorRect(containerRef: RefObject<RNView | null>): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(() => readAnchorRect(containerRef));\n\n useLayoutEffect(() => {\n if (!IS_WEB) return undefined;\n const measure = (): void => { setRect(readAnchorRect(containerRef)); };\n measure();\n window.addEventListener('scroll', measure, true);\n window.addEventListener('resize', measure);\n return () => {\n window.removeEventListener('scroll', measure, true);\n window.removeEventListener('resize', measure);\n };\n }, [containerRef]);\n\n return rect;\n}\n\nexport interface InlineMenuProps<T> {\n testID: string;\n accessibilityLabel: string;\n value: T;\n options: ReadonlyArray<DropdownOption<T>>;\n containerRef: RefObject<RNView | null>;\n /** Custom testID per option row. Defaults to `` `${testID}-option-${value}` ``. */\n optionTestID?: (value: T) => string;\n /** Minimum popover width — a floor for COMPACT anchors, whose width cannot fit an option label. */\n menuMinWidth?: number;\n onSelect: (value: T) => void;\n onClose: () => void;\n}\n\nexport const InlineMenu = <T extends string | number>({\n testID,\n accessibilityLabel,\n value,\n options,\n containerRef,\n optionTestID,\n menuMinWidth = 0,\n onSelect,\n onClose,\n}: InlineMenuProps<T>): React.ReactElement | null => {\n const { theme } = useUi();\n const { colors } = theme;\n\n const menuRef = useRef<RNView>(null);\n const rect = useAnchorRect(containerRef);\n\n const selectedIndex = useMemo(\n () => Math.max(0, options.findIndex((opt) => opt.value === value)),\n [options, value],\n );\n // Lazy init: start the keyboard highlight on the currently-selected option.\n const [highlightedIndex, setHighlightedIndex] = useState<number>(() => selectedIndex);\n\n const selectAt = useCallback(\n (index: number) => {\n const option = options[index];\n if (option !== undefined) onSelect(option.value);\n },\n [options, onSelect],\n );\n\n const selectHighlighted = useCallback(\n () => { selectAt(highlightedIndex); },\n [selectAt, highlightedIndex],\n );\n\n useMenuKeyboard({\n containerRef,\n menuRef,\n enabled: true,\n itemCount: options.length,\n onHighlightChange: setHighlightedIndex,\n onSelectHighlighted: selectHighlighted,\n onClose,\n });\n\n const popoverStyle = useMemo(() => {\n const themed = { borderColor: colors.border, backgroundColor: colors.surface };\n // Web: fixed-positioned in a portal at the measured trigger rect (escapes stacking + clipping).\n if (IS_WEB)\n return [\n buildPortalPopoverStyle(rect ?? { top: 0, left: 0, width: 0, bottom: 0 }, menuMinWidth),\n themed,\n ];\n // Native: in-tree absolute popover under the trigger (stretched to the anchor, floored the same).\n return [styles.popover, { minWidth: menuMinWidth }, themed];\n }, [colors.border, colors.surface, menuMinWidth, rect]);\n\n const menu = (\n <View\n ref={menuRef}\n accessibilityRole=\"menu\"\n aria-label={accessibilityLabel}\n style={popoverStyle}\n testID={`${testID}-menu`}\n >\n <ScrollView keyboardShouldPersistTaps=\"handled\">\n {options.map((option, index) => (\n <OptionRow\n key={String(option.value)}\n isHighlighted={index === highlightedIndex}\n isSelected={option.value === value}\n label={option.label}\n testID={\n optionTestID !== undefined ? optionTestID(option.value) : `${testID}-option-${String(option.value)}`\n }\n onSelect={() => onSelect(option.value)}\n />\n ))}\n </ScrollView>\n </View>\n );\n\n // Portal to document.body on web so no ancestor stacking context / overflow can trap or clip it.\n if (IS_WEB) return createPortal(menu, document.body);\n return menu;\n};\n\nexport default InlineMenu;\n","/**\n * Responsive resolution of the effective {@link DropdownVariant}.\n *\n * `resolveDropdownVariant` is a pure function (easy to unit-test with a mocked\n * width); `useResolvedDropdownVariant` is the thin hook that feeds it the live\n * viewport width + platform.\n */\nimport { Platform, useWindowDimensions } from 'react-native';\n\nimport { DropdownVariant } from './DropdownVariant';\n\n/**\n * At or above this viewport width (web only) the dropdown defaults to the inline\n * anchored menu; below it — or on any native platform — it defaults to the modal.\n */\nexport const MENU_BREAKPOINT = 768;\n\n/** The web platform key that {@link Platform.OS} reports under react-native-web. */\nconst WEB_PLATFORM = 'web';\n\n/**\n * Pure resolver. An explicit `variant` always wins; otherwise the inline\n * {@link DropdownVariant.Menu} is chosen on wide web viewports and\n * {@link DropdownVariant.Modal} on narrow web or any native platform.\n */\nexport function resolveDropdownVariant(\n explicit: DropdownVariant | undefined,\n width: number,\n platformOS: string,\n): DropdownVariant {\n if (explicit !== undefined) return explicit;\n\n const isWideWeb = platformOS === WEB_PLATFORM && width >= MENU_BREAKPOINT;\n return isWideWeb ? DropdownVariant.Menu : DropdownVariant.Modal;\n}\n\n/** Hook wrapper that reads the live viewport width + platform and resolves the variant. */\nexport function useResolvedDropdownVariant(\n explicit: DropdownVariant | undefined,\n): DropdownVariant {\n const { width } = useWindowDimensions();\n return resolveDropdownVariant(explicit, width, Platform.OS);\n}\n","/**\n * ModalDropdown — generic dropdown selector (any value type via generics).\n *\n * Renders as either an inline anchored menu (web-native `<select>` feel) or a\n * modal / bottom-sheet, selectable per screen via the `variant` prop. When\n * `variant` is omitted the choice is **responsive**: inline menu on wide/desktop\n * web, modal on narrow/mobile (and always modal on native). Existing callers that\n * never passed `variant` therefore get the inline-on-desktop behaviour for free.\n *\n * Both variants share {@link OptionRow} for option rendering + selection.\n */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { FlatList, Modal, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useUi, MODAL_OVERLAY_COLOR } from '@dloizides/ui-feedback';\n\nimport { useFocusTrap } from '../hooks/useFocusTrap';\nimport { DropdownVariant } from './DropdownVariant';\nimport type { DropdownOption } from './dropdownTypes';\nimport { InlineMenu } from './InlineMenu';\nimport { buildAnchorStackStyle } from './menuStacking';\nimport { OptionRow } from './OptionRow';\nimport { useResolvedDropdownVariant } from './resolveDropdownVariant';\n\n/** State handed to a custom trigger renderer. */\nexport interface DropdownTriggerState {\n /** The selected option's label (or the select placeholder when nothing matches). */\n label: string;\n /** Whether the menu is currently open. */\n isOpen: boolean;\n}\n\nexport interface ModalDropdownProps<T> {\n testID: string;\n accessibilityLabel: string;\n accessibilityHint: string;\n value: T;\n options: ReadonlyArray<DropdownOption<T>>;\n onChange: (value: T) => void;\n /**\n * Force a rendering variant. When omitted the dropdown is **responsive**:\n * an inline anchored menu on wide/desktop web, a modal on narrow/mobile\n * (and always a modal on native). An explicit value overrides the auto choice.\n */\n variant?: DropdownVariant;\n /**\n * Custom ANCHOR content. When supplied, the caller owns the trigger's visuals\n * entirely (the default bordered field box is not rendered) — use it for compact\n * chips / avatars / icon triggers. The a11y wrapper (role=button, `aria-expanded`,\n * the label + hint, the testID) is still supplied by the dropdown, so a custom\n * trigger cannot drop the accessible contract. Omit for the default field look.\n */\n renderTrigger?: (state: DropdownTriggerState) => React.ReactNode;\n /**\n * Custom testID per option row. Defaults to `` `${testID}-option-${value}` ``.\n * Lets a caller keep a pre-existing selector stable when a flat control becomes\n * a dropdown.\n */\n optionTestID?: (value: T) => string;\n /**\n * Minimum width of the open inline menu. The menu otherwise matches the TRIGGER's width, which\n * is right for a full-width field but leaves a COMPACT anchor (a locale pill, an avatar chip, an\n * icon button — see `renderTrigger`) with a menu too narrow to read its own option labels. It is\n * a floor only: a wider trigger still wins. Omit to keep the trigger-width behaviour.\n */\n menuMinWidth?: number;\n}\n\nconst BORDER_RADIUS = 8;\nconst BORDER_WIDTH = 1;\nconst BODY_FONT_SIZE = 14;\nconst MODAL_PADDING = 8;\nconst MODAL_MIN_WIDTH = 200;\nconst MODAL_MAX_HEIGHT = 300;\nconst CONTAINER_PADDING_H = 12;\nconst CONTAINER_PADDING_V = 10;\n\nconst styles = StyleSheet.create({\n anchor: { position: 'relative' },\n container: {\n borderWidth: BORDER_WIDTH,\n borderRadius: BORDER_RADIUS,\n paddingHorizontal: CONTAINER_PADDING_H,\n paddingVertical: CONTAINER_PADDING_V,\n },\n selectedText: { fontSize: BODY_FONT_SIZE },\n modalOverlay: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: MODAL_OVERLAY_COLOR,\n },\n modalContent: {\n borderRadius: BORDER_RADIUS,\n padding: MODAL_PADDING,\n minWidth: MODAL_MIN_WIDTH,\n maxHeight: MODAL_MAX_HEIGHT,\n },\n});\n\nexport const ModalDropdown = <T extends string | number>({\n testID,\n accessibilityLabel,\n accessibilityHint,\n value,\n options,\n onChange,\n variant,\n renderTrigger,\n optionTestID,\n menuMinWidth,\n}: ModalDropdownProps<T>): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n const resolvedVariant = useResolvedDropdownVariant(variant);\n const isMenu = resolvedVariant === DropdownVariant.Menu;\n\n const [isOpen, setIsOpen] = useState(false);\n const anchorRef = useRef<View>(null);\n const dialogRef = useRef<View>(null);\n useFocusTrap(dialogRef, isOpen && !isMenu);\n\n const selectedLabel = useMemo(() => {\n const found = options.find((opt) => opt.value === value);\n return found?.label ?? t('common.selectPlaceholder');\n }, [options, value, t]);\n\n const handleToggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const handleClose = useCallback(() => { setIsOpen(false); }, []);\n\n const handleSelect = useCallback(\n (optionValue: T) => {\n onChange(optionValue);\n setIsOpen(false);\n },\n [onChange],\n );\n\n // A custom trigger owns its own visuals, so the default bordered field box stands down.\n const containerStyle = useMemo(\n () =>\n renderTrigger !== undefined\n ? undefined\n : [styles.container, { borderColor: colors.border, backgroundColor: colors.surface }],\n [colors.border, colors.surface, renderTrigger],\n );\n\n const optionTestIDFor = useCallback(\n (optionValue: T): string =>\n optionTestID !== undefined ? optionTestID(optionValue) : `${testID}-option-${String(optionValue)}`,\n [optionTestID, testID],\n );\n // While the inline menu is open, lift the anchor wrapper's stacking so it wins over immediate\n // sibling views (defence-in-depth behind the web portal; the primary lift on native).\n const anchorStyle = useMemo(\n () => [styles.anchor, buildAnchorStackStyle(isMenu && isOpen)],\n [isMenu, isOpen],\n );\n const modalContentStyle = useMemo(\n () => [styles.modalContent, { backgroundColor: colors.surface }],\n [colors.surface],\n );\n\n const renderModalOption = useCallback(\n ({ item }: { item: DropdownOption<T> }) => (\n <OptionRow\n isSelected={item.value === value}\n label={item.label}\n testID={optionTestIDFor(item.value)}\n onSelect={() => handleSelect(item.value)}\n />\n ),\n [handleSelect, optionTestIDFor, value],\n );\n const keyExtractor = useCallback((item: DropdownOption<T>) => String(item.value), []);\n\n return (\n <View ref={anchorRef} style={anchorStyle}>\n <TouchableOpacity\n accessible\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: isOpen }}\n aria-expanded={isOpen}\n style={containerStyle}\n testID={testID}\n onPress={handleToggle}\n >\n {renderTrigger !== undefined ? (\n renderTrigger({ label: selectedLabel, isOpen })\n ) : (\n <Text style={[styles.selectedText, { color: colors.text }]}>{selectedLabel}</Text>\n )}\n </TouchableOpacity>\n\n {isMenu && isOpen ? (\n <InlineMenu\n accessibilityLabel={accessibilityLabel}\n containerRef={anchorRef}\n menuMinWidth={menuMinWidth}\n optionTestID={optionTestIDFor}\n options={options}\n testID={testID}\n value={value}\n onClose={handleClose}\n onSelect={handleSelect}\n />\n ) : null}\n\n {!isMenu ? (\n <Modal transparent animationType=\"fade\" visible={isOpen} onRequestClose={handleClose}>\n {/* The dismiss backdrop is a SIBLING behind the dialog, not its parent — a wrapping\n pressable would nest the option buttons inside a button (invalid DOM: \"<button>\n cannot contain a nested <button>\"). Absolute-fill catches taps outside the dialog. */}\n <View style={styles.modalOverlay}>\n <TouchableOpacity\n accessible\n accessibilityHint={t('common.dismissDropdownHint')}\n accessibilityLabel={t('common.dismissDropdown')}\n accessibilityRole=\"button\"\n activeOpacity={1}\n style={StyleSheet.absoluteFill}\n testID={`${testID}-backdrop`}\n onPress={handleClose}\n />\n <View\n ref={dialogRef}\n accessibilityViewIsModal\n aria-label={accessibilityLabel}\n role=\"dialog\"\n style={modalContentStyle}\n >\n <FlatList data={[...options]} keyExtractor={keyExtractor} renderItem={renderModalOption} />\n </View>\n </View>\n </Modal>\n ) : null}\n </View>\n );\n};\n\nexport default ModalDropdown;\n","/**\n * ModalShell — a slide-up full-screen modal with a themed header (title + close button)\n * and a scrollable body. Composes Heading (this package) + SvgIcon (@dloizides/ui-icons).\n */\nimport React from 'react';\n\nimport { Modal, ScrollView, StyleSheet, TouchableOpacity, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { Heading } from '../Heading/Heading';\nimport { LAYOUT_TEST_IDS } from '../constants';\n\nconst CLOSE_ICON_SIZE = 18;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n headerRow: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n closeButton: {\n padding: 6,\n borderRadius: 6,\n },\n});\n\nexport interface ModalShellProps {\n visible: boolean;\n onCancel: () => void;\n title?: string | React.ReactNode;\n children?: React.ReactNode;\n contentStyle?: StyleProp<ViewStyle>;\n showClose?: boolean;\n}\n\nexport const ModalShell = ({\n visible,\n onCancel,\n title,\n children,\n contentStyle,\n showClose = true,\n}: ModalShellProps): React.ReactElement => {\n const { theme, t } = useUi();\n\n const containerStyle = React.useMemo(\n () => [styles.container, { backgroundColor: theme.colors.background }, contentStyle],\n [theme.colors.background, contentStyle],\n );\n const closeA11yLabel = t('quizTemplates.cancel');\n const accessibleTitle = typeof title === 'string' ? title : t('common.dialog');\n\n return (\n <Modal\n animationType=\"slide\"\n testID={LAYOUT_TEST_IDS.modalShell}\n visible={visible}\n onRequestClose={onCancel}\n >\n <ScrollView\n accessibilityViewIsModal\n aria-label={accessibleTitle}\n role=\"dialog\"\n style={containerStyle}\n >\n <View style={styles.headerRow}>\n <Heading>{title ?? t('close')}</Heading>\n {showClose ? (\n <TouchableOpacity\n accessibilityHint={t('common.closeDialogHint')}\n accessibilityLabel={closeA11yLabel}\n accessibilityRole=\"button\"\n style={styles.closeButton}\n testID={LAYOUT_TEST_IDS.modalShellClose}\n onPress={onCancel}\n >\n <SvgIcon color={theme.colors.textSecondary} name=\"close\" size={CLOSE_ICON_SIZE} />\n </TouchableOpacity>\n ) : null}\n </View>\n\n {children}\n </ScrollView>\n </Modal>\n );\n};\n\nexport default ModalShell;\n","/**\n * AccordionContext — shares the open-item set + toggle between the `Accordion`\n * container (which owns the state) and its `AccordionItem` children.\n */\nimport { createContext, useContext } from 'react';\n\nimport type { AccordionVariant } from './AccordionVariant';\n\nexport interface AccordionContextValue {\n /** Ids of the currently-open items. */\n openIds: ReadonlySet<string>;\n /** Toggle an item open/closed by id (respects `allowMultiple`). */\n toggle: (id: string) => void;\n /** When false, opening an item closes the others. */\n allowMultiple: boolean;\n /** Visual treatment shared with every item (`plain` default, or `boxed`). */\n variant: AccordionVariant;\n}\n\nexport const AccordionContext = createContext<AccordionContextValue | null>(null);\n\n/** Reads the accordion context; throws if an item is rendered outside an `<Accordion>`. */\nexport function useAccordionContext(): AccordionContextValue {\n const value = useContext(AccordionContext);\n if (value === null) {\n throw new Error('AccordionItem must be rendered inside an <Accordion>.');\n }\n return value;\n}\n","/**\n * accordionAnimation — a lightweight, cross-platform-safe open/close animation.\n *\n * `animateNextLayout()` asks the next layout pass to animate (RN `LayoutAnimation`).\n * It is a guarded no-op wherever `LayoutAnimation` is unavailable (e.g. react-native-web\n * stubs it), so it never throws on web OR native.\n */\nimport { LayoutAnimation, Platform, UIManager } from 'react-native';\n\nlet androidEnabled = false;\n\n/** Old-architecture Android requires opting in to LayoutAnimation once, at runtime. */\nfunction enableAndroidLayoutAnimationOnce(): void {\n if (androidEnabled) return;\n androidEnabled = true;\n const isAndroid = Platform.OS === 'android';\n const setter = UIManager.setLayoutAnimationEnabledExperimental;\n if (isAndroid && typeof setter === 'function') {\n setter(true);\n }\n}\n\n/**\n * True when the user asked the OS to reduce motion (web only). The expand/collapse layout\n * animation is then skipped so the panel appears/disappears instantly (WCAG 2.3.3). Safe under\n * SSR / where `matchMedia` is unavailable, and always false on native (handled by the caller).\n */\nfunction prefersReducedMotion(): boolean {\n if (Platform.OS !== 'web' || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/** Animate the layout change caused by the next state update (expand/collapse). */\nexport function animateNextLayout(): void {\n // Honour reduced-motion: skip the animation entirely so the change is instant.\n if (prefersReducedMotion()) return;\n enableAndroidLayoutAnimationOnce();\n const configure = LayoutAnimation.configureNext;\n if (typeof configure !== 'function') return;\n try {\n configure(LayoutAnimation.Presets.easeInEaseOut);\n } catch {\n // LayoutAnimation is a no-op / unavailable on this platform — ignore.\n }\n}\n","/**\n * Accordion — a themed expand/collapse disclosure group.\n *\n * Owns the open-item state and shares it with its {@link AccordionItem} children via\n * context. Works controlled (`openIds` + `onOpenChange`) or uncontrolled\n * (`defaultOpenIds`, plus per-item `defaultOpen`). `allowMultiple` (default) lets any\n * number of items be open at once; set it false for single-open (radio-like) behaviour.\n *\n * `variant` picks the look: `plain` (default) renders borderless so it drops cleanly inside a\n * `Section` / `Card`; `boxed` renders each item as its own bordered, rounded box with a leading\n * ▸ marker (the AML v1 console `<details>` look).\n */\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { AccordionContext, type AccordionContextValue } from './AccordionContext';\nimport type { AccordionItemProps } from './AccordionItem';\nimport type { AccordionVariant } from './AccordionVariant';\nimport { animateNextLayout } from './accordionAnimation';\n\nconst BOXED_GAP = 12;\n\nconst styles = StyleSheet.create({\n container: { alignSelf: 'stretch' },\n boxed: { gap: BOXED_GAP },\n});\n\nexport interface AccordionProps {\n /** `AccordionItem` children. */\n children?: React.ReactNode;\n /** Controlled open ids. When provided, the accordion is controlled. */\n openIds?: readonly string[];\n /** Initial open ids in uncontrolled mode. */\n defaultOpenIds?: readonly string[];\n /** Fired with the next open-id set whenever an item toggles. */\n onOpenChange?: (openIds: string[]) => void;\n /** Allow several items open at once (default true). False = single-open. */\n allowMultiple?: boolean;\n /** Visual treatment: `plain` (default, borderless) or `boxed` (bordered ▸ boxes). */\n variant?: AccordionVariant;\n testID?: string;\n style?: ViewStyle | ViewStyle[];\n}\n\n/** Read the initial open set from `defaultOpenIds` + any child `defaultOpen` flags. */\nfunction computeInitialOpen(\n children: React.ReactNode,\n defaultOpenIds: readonly string[] | undefined,\n allowMultiple: boolean,\n): Set<string> {\n const ids = new Set<string>(defaultOpenIds ?? []);\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n const props = child.props as Partial<AccordionItemProps>;\n if (props.defaultOpen === true && typeof props.id === 'string') {\n ids.add(props.id);\n }\n });\n if (!allowMultiple && ids.size > 1) {\n const first = ids.values().next().value;\n return new Set(first === undefined ? [] : [first]);\n }\n return ids;\n}\n\nexport const Accordion = ({\n children,\n openIds,\n defaultOpenIds,\n onOpenChange,\n allowMultiple = true,\n variant = 'plain',\n testID = 'accordion',\n style,\n}: AccordionProps): React.ReactElement => {\n const isControlled = openIds !== undefined;\n\n const [internalOpen, setInternalOpen] = useState<Set<string>>(() =>\n computeInitialOpen(children, defaultOpenIds, allowMultiple),\n );\n\n const openSet = useMemo<Set<string>>(\n () => (isControlled ? new Set(openIds) : internalOpen),\n [isControlled, openIds, internalOpen],\n );\n\n const toggle = useCallback(\n (id: string) => {\n animateNextLayout();\n const next = new Set(openSet);\n const willOpen = !next.has(id);\n if (!allowMultiple) next.clear();\n if (willOpen) {\n next.add(id);\n } else {\n next.delete(id);\n }\n if (!isControlled) setInternalOpen(next);\n if (onOpenChange !== undefined) onOpenChange(Array.from(next));\n },\n [allowMultiple, isControlled, onOpenChange, openSet],\n );\n\n const contextValue = useMemo<AccordionContextValue>(\n () => ({ openIds: openSet, toggle, allowMultiple, variant }),\n [openSet, toggle, allowMultiple, variant],\n );\n\n const containerStyle = useMemo<ViewStyle[]>(() => {\n const base = variant === 'boxed' ? [styles.container, styles.boxed] : [styles.container];\n if (style === undefined) return base;\n return [...base, ...(Array.isArray(style) ? style : [style])];\n }, [style, variant]);\n\n return (\n <AccordionContext.Provider value={contextValue}>\n <View style={containerStyle} testID={testID}>\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport default Accordion;\n","/**\n * AccordionItem — one disclosure row: a pressable header (title, optional right\n * adornment/badge slot, a rotating chevron) plus a collapsible body region.\n *\n * Reads its open state, toggle and `variant` from the enclosing {@link Accordion} via context.\n * - `plain` (default): a borderless row with the title left and a right-hand chevron that\n * flips 180° on open, separated from the previous item by a hairline divider.\n * - `boxed`: the item is its own bordered, rounded box with a LEADING ▸ marker that rotates\n * 90° on open and a muted, 600-weight summary (the AML v1 console `<details>` look).\n */\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { Animated, Easing, Platform, Pressable, StyleSheet, Text, View, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { useAccordionContext } from './AccordionContext';\n\nconst HEADER_PADDING_H = 16;\nconst HEADER_PADDING_V = 12;\nconst BODY_PADDING_H = 16;\nconst BODY_PADDING_V = 12;\nconst HEADER_GAP = 8;\nconst TITLE_FONT_SIZE = 15;\nconst TITLE_FONT_WEIGHT = '600' as const;\nconst CHEVRON_SIZE = 18;\nconst ROTATE_DURATION_MS = 160;\nconst ROTATE_COLLAPSED = 0;\nconst ROTATE_EXPANDED = 1;\nconst COLLAPSED_DEG = '0deg';\nconst PLAIN_EXPANDED_DEG = '180deg';\nconst BOXED_EXPANDED_DEG = '90deg';\nconst DISABLED_OPACITY = 0.5;\nconst FULL_OPACITY = 1;\nconst ROLE_REGION = 'region';\n\n// Boxed variant (AML v1 `.sc-more` / `.adv-match` <details>).\nconst BOX_BORDER_RADIUS = 10;\nconst BOX_PADDING_H = 14;\nconst BOX_HEADER_PADDING_V = 8;\nconst BOX_BODY_PADDING_BOTTOM = 10;\nconst BOX_BODY_PADDING_TOP = 2;\nconst BOX_TITLE_FONT_SIZE = 14;\nconst BOX_MARKER_FONT_SIZE = 13;\nconst BOX_MARKER_GAP = 6;\nconst BOX_MARKER = '▸'; // ▸\n\nconst styles = StyleSheet.create({\n item: { borderTopWidth: StyleSheet.hairlineWidth },\n boxItem: { borderWidth: 1, borderRadius: BOX_BORDER_RADIUS, paddingHorizontal: BOX_PADDING_H },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: HEADER_PADDING_H,\n paddingVertical: HEADER_PADDING_V,\n },\n boxHeader: { paddingHorizontal: 0, paddingVertical: BOX_HEADER_PADDING_V },\n headerLeft: { flexShrink: 1, flexGrow: 1 },\n headerLeftRow: { flexDirection: 'row', alignItems: 'center' },\n headerRight: { flexDirection: 'row', alignItems: 'center', marginLeft: HEADER_GAP },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n boxTitle: { fontSize: BOX_TITLE_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n chevron: { marginLeft: HEADER_GAP },\n marker: { marginRight: BOX_MARKER_GAP },\n markerText: { fontSize: BOX_MARKER_FONT_SIZE, fontWeight: TITLE_FONT_WEIGHT },\n body: { paddingHorizontal: BODY_PADDING_H, paddingBottom: BODY_PADDING_V },\n boxBody: { paddingHorizontal: 0, paddingBottom: BOX_BODY_PADDING_BOTTOM, paddingTop: BOX_BODY_PADDING_TOP },\n});\n\nexport interface AccordionItemProps {\n /** Stable unique id used for open-state tracking + derived testIDs. */\n id: string;\n /** Header title — a string (rendered as themed text) or custom node. */\n title: string | React.ReactNode;\n /** Optional right-hand adornment (badge, count, icon…) shown before the chevron. */\n right?: React.ReactNode;\n /** Collapsible body content. */\n children?: React.ReactNode;\n /** Start open in uncontrolled mode (ignored when the container is controlled). */\n defaultOpen?: boolean;\n /** Disable toggling for this item. */\n disabled?: boolean;\n /** testID for the header button. Body = `${testID}-body`, chevron = `${testID}-chevron`. */\n testID?: string;\n /** Accessible name for the header button (defaults to `title` when it is a string). */\n accessibilityLabel?: string;\n /** Accessible hint for the header button. */\n accessibilityHint?: string;\n}\n\n/**\n * Extra web-only DOM prop react-native-web's `Pressable` forwards but RN's types omit.\n * `Pressable` renders `accessibilityRole=\"button\"` as a native `<button>` (keyboard-operable\n * for free in real browsers); the handler calls `preventDefault()` so the native\n * Enter/Space activation does not ALSO fire `onPress` (no double toggle).\n */\ninterface WebKeyboardProps {\n onKeyDown?: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\nconst ACTIVATION_KEYS = ['Enter', ' ', 'Spacebar'];\nconst INSTANT_DURATION_MS = 0;\n\n/**\n * True when the user asked the OS to reduce motion (web only). The chevron/marker rotation then\n * snaps instead of easing (WCAG 2.3.3). Safe under SSR / where `matchMedia` is absent.\n */\nfunction prefersReducedMotion(): boolean {\n if (Platform.OS !== 'web' || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nexport const AccordionItem = ({\n id,\n title,\n right,\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- read by the container's initial-open scan, not here\n defaultOpen: _defaultOpen,\n disabled = false,\n testID,\n accessibilityLabel,\n accessibilityHint,\n}: AccordionItemProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n const { openIds, toggle, variant } = useAccordionContext();\n const boxed = variant === 'boxed';\n\n const expanded = openIds.has(id);\n const headerTestID = testID ?? `accordion-item-${id}`;\n const bodyTestID = `${headerTestID}-body`;\n const chevronTestID = `${headerTestID}-chevron`;\n\n const [rotation] = useState(() => new Animated.Value(expanded ? ROTATE_EXPANDED : ROTATE_COLLAPSED));\n\n useEffect(() => {\n Animated.timing(rotation, {\n toValue: expanded ? ROTATE_EXPANDED : ROTATE_COLLAPSED,\n duration: prefersReducedMotion() ? INSTANT_DURATION_MS : ROTATE_DURATION_MS,\n easing: Easing.out(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [expanded, rotation]);\n\n const rotate = rotation.interpolate({\n inputRange: [ROTATE_COLLAPSED, ROTATE_EXPANDED],\n outputRange: [COLLAPSED_DEG, boxed ? BOXED_EXPANDED_DEG : PLAIN_EXPANDED_DEG],\n });\n\n const handlePress = useCallback(() => {\n if (!disabled) toggle(id);\n }, [disabled, id, toggle]);\n\n const handleKeyDown = useCallback(\n (event: { key?: string; preventDefault?: () => void }) => {\n if (disabled) return;\n const key = event.key ?? '';\n const isActivation = ACTIVATION_KEYS.includes(key);\n if (!isActivation) return;\n if (typeof event.preventDefault === 'function') event.preventDefault();\n toggle(id);\n },\n [disabled, id, toggle],\n );\n\n const keyboardProps: WebKeyboardProps =\n Platform.OS === 'web' ? { onKeyDown: handleKeyDown } : {};\n\n const itemStyle = useMemo<ViewStyle[]>(\n () =>\n boxed\n ? [styles.boxItem, { borderColor: colors.border }]\n : [styles.item, { borderTopColor: colors.border }],\n [boxed, colors.border],\n );\n const headerStyle = useMemo<ViewStyle[]>(\n () => [\n styles.header,\n ...(boxed ? [styles.boxHeader] : []),\n { opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY },\n ],\n [boxed, disabled],\n );\n\n const resolvedLabel =\n accessibilityLabel ?? (typeof title === 'string' ? title : undefined);\n\n const titleNode =\n typeof title === 'string' ? (\n <Text style={[boxed ? styles.boxTitle : styles.title, { color: boxed ? colors.textSecondary : colors.text }]}>\n {title}\n </Text>\n ) : (\n title\n );\n\n return (\n <View style={itemStyle}>\n <Pressable\n accessibilityHint={accessibilityHint ?? t('common.accordionToggleHint')}\n accessibilityLabel={resolvedLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded, disabled }}\n aria-controls={bodyTestID}\n aria-expanded={expanded}\n disabled={disabled}\n style={headerStyle}\n testID={headerTestID}\n onPress={handlePress}\n {...keyboardProps}\n >\n <View style={[styles.headerLeft, boxed ? styles.headerLeftRow : null]}>\n {boxed ? (\n // Decorative — the open/closed state is already conveyed by aria-expanded on the header.\n <Animated.View\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.marker, { transform: [{ rotate }] }]}\n testID={chevronTestID}\n >\n <Text style={[styles.markerText, { color: colors.textSecondary }]}>{BOX_MARKER}</Text>\n </Animated.View>\n ) : null}\n {titleNode}\n </View>\n <View style={styles.headerRight}>\n {right}\n {boxed ? null : (\n <Animated.View\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.chevron, { transform: [{ rotate }] }]}\n >\n <SvgIcon color={colors.textSecondary} name=\"chevronDown\" size={CHEVRON_SIZE} testID={chevronTestID} />\n </Animated.View>\n )}\n </View>\n </Pressable>\n\n {expanded ? (\n <View\n accessibilityLabel={resolvedLabel}\n nativeID={bodyTestID}\n role={ROLE_REGION}\n style={boxed ? styles.boxBody : styles.body}\n testID={bodyTestID}\n >\n {children}\n </View>\n ) : null}\n </View>\n );\n};\n\nexport default AccordionItem;\n"]}
package/dist/index.mjs CHANGED
@@ -317,14 +317,14 @@ var BORDER_RADIUS = 8;
317
317
  var BORDER_WIDTH2 = 1;
318
318
  var MENU_PADDING = 4;
319
319
  var MENU_BOX_SHADOW = "0px 2px 8px rgba(0, 0, 0, 0.15)";
320
- function buildPortalPopoverStyle(rect) {
320
+ function buildPortalPopoverStyle(rect, minWidth = 0) {
321
321
  return {
322
322
  // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.
323
323
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value
324
324
  position: "fixed",
325
325
  top: rect.bottom + MENU_TOP_GAP,
326
326
  left: rect.left,
327
- width: rect.width,
327
+ width: Math.max(rect.width, minWidth),
328
328
  zIndex: MENU_Z_INDEX,
329
329
  borderWidth: BORDER_WIDTH2,
330
330
  borderRadius: BORDER_RADIUS,
@@ -391,32 +391,36 @@ var clampIndex = (index, itemCount) => {
391
391
  const lastIndex = itemCount - 1;
392
392
  return index > lastIndex ? lastIndex : index;
393
393
  };
394
+ function claimKey(event) {
395
+ event.preventDefault();
396
+ event.stopPropagation();
397
+ }
394
398
  function buildKeyHandler(params) {
395
399
  const { itemCount, onHighlightChange, onSelectHighlighted, onClose } = params;
396
400
  return (event) => {
397
401
  switch (event.key) {
398
402
  case "ArrowDown":
399
- event.preventDefault();
403
+ claimKey(event);
400
404
  onHighlightChange((prev) => clampIndex(prev + 1, itemCount));
401
405
  return;
402
406
  case "ArrowUp":
403
- event.preventDefault();
407
+ claimKey(event);
404
408
  onHighlightChange((prev) => clampIndex(prev - 1, itemCount));
405
409
  return;
406
410
  case "Home":
407
- event.preventDefault();
411
+ claimKey(event);
408
412
  onHighlightChange(() => 0);
409
413
  return;
410
414
  case "End":
411
- event.preventDefault();
415
+ claimKey(event);
412
416
  onHighlightChange(() => clampIndex(itemCount - 1, itemCount));
413
417
  return;
414
418
  case "Enter":
415
- event.preventDefault();
419
+ claimKey(event);
416
420
  onSelectHighlighted();
417
421
  return;
418
422
  case "Escape":
419
- event.preventDefault();
423
+ claimKey(event);
420
424
  onClose();
421
425
  return;
422
426
  }
@@ -433,10 +437,10 @@ function useMenuKeyboard(params) {
433
437
  const insideMenu = refContains(menuRef, target);
434
438
  if (!insideAnchor && !insideMenu) onClose();
435
439
  };
436
- document.addEventListener("keydown", onKeyDown);
440
+ document.addEventListener("keydown", onKeyDown, true);
437
441
  document.addEventListener("mousedown", onMouseDown);
438
442
  return () => {
439
- document.removeEventListener("keydown", onKeyDown);
443
+ document.removeEventListener("keydown", onKeyDown, true);
440
444
  document.removeEventListener("mousedown", onMouseDown);
441
445
  };
442
446
  }, [containerRef, menuRef, enabled, onClose, params]);
@@ -493,6 +497,7 @@ var InlineMenu = ({
493
497
  options,
494
498
  containerRef,
495
499
  optionTestID,
500
+ menuMinWidth = 0,
496
501
  onSelect,
497
502
  onClose
498
503
  }) => {
@@ -529,9 +534,13 @@ var InlineMenu = ({
529
534
  });
530
535
  const popoverStyle = useMemo(() => {
531
536
  const themed = { borderColor: colors.border, backgroundColor: colors.surface };
532
- if (IS_WEB) return [buildPortalPopoverStyle(rect ?? { left: 0, width: 0, bottom: 0 }), themed];
533
- return [styles7.popover, themed];
534
- }, [colors.border, colors.surface, rect]);
537
+ if (IS_WEB)
538
+ return [
539
+ buildPortalPopoverStyle(rect ?? { left: 0, width: 0, bottom: 0 }, menuMinWidth),
540
+ themed
541
+ ];
542
+ return [styles7.popover, { minWidth: menuMinWidth }, themed];
543
+ }, [colors.border, colors.surface, menuMinWidth, rect]);
535
544
  const menu = /* @__PURE__ */ jsx(
536
545
  View,
537
546
  {
@@ -606,7 +615,8 @@ var ModalDropdown = ({
606
615
  onChange,
607
616
  variant,
608
617
  renderTrigger,
609
- optionTestID
618
+ optionTestID,
619
+ menuMinWidth
610
620
  }) => {
611
621
  const { theme, t } = useUi();
612
622
  const { colors } = theme;
@@ -683,6 +693,7 @@ var ModalDropdown = ({
683
693
  {
684
694
  accessibilityLabel,
685
695
  containerRef: anchorRef,
696
+ menuMinWidth,
686
697
  optionTestID: optionTestIDFor,
687
698
  options,
688
699
  testID,