@dloizides/ui-forms 1.47.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +525 -376
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +337 -188
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Field/attachControlId.ts","../src/Field/useHtmlFor.ts","../src/Field/FieldLabel.tsx","../src/Field/fieldMarkers.ts","../src/Field/fieldSpacing.ts","../src/Field/labelVariants.ts","../src/FormGrid/formGridContext.ts","../src/fieldErrorInk/fieldErrorInk.ts","../src/Field/Field.tsx","../src/FormGrid/FormGrid.tsx","../src/AlignToControl/AlignToControl.tsx","../src/FormGrid/FormCell.tsx","../src/InlineFieldRow/inlineFieldRowLayout.ts","../src/InlineFieldRow/InlineFieldRow.tsx","../src/LineItems/utils/lineItemsLayout.ts","../src/LineItems/components/LineItemCard.tsx","../src/LineItems/components/LineItemsColumnHeaders.tsx","../src/LineItems/LineItems.tsx","../src/FormStack/FormStack.tsx","../src/ResponsiveFormLayout/isWideFormLayout.ts","../src/ResponsiveFormLayout/ResponsiveFormLayout.tsx","../src/FormSection/FormSection.tsx","../src/FormActions/FormActions.tsx","../src/controls/controlStyles.ts","../src/AnchoredMenu/components/OptionRow.tsx","../src/AnchoredMenu/menuPortal.ts","../src/AnchoredMenu/AnchoredMenu.tsx","../src/useThemedInput/useThemedInput.ts","../src/webFieldA11y/webFieldA11y.ts","../src/ThemedTextInput/ThemedTextInput.tsx","../src/useRecentValues/recentValuesCore.ts","../src/useRecentValues/useRecentValues.ts","../src/FormField/RecentInputField.tsx","../src/FormField/textRows.ts","../src/FormField/useAutoGrowRows.ts","../src/FormField/FormField.tsx","../src/segmentBesideField/segmentBesideField.ts","../src/ChipSelector/constants.ts","../src/ChipSelector/ChipLabelWrap.ts","../src/ChipSelector/utils/chipLabelLayout.ts","../src/ChipSelector/components/chipStyles.ts","../src/ChipSelector/components/ChipContent.tsx","../src/ChipSelector/components/OutlineChip.tsx","../src/ChipSelector/components/SolidChip.tsx","../src/ChipSelector/utils/radioKeyboard.ts","../src/ChipSelector/hooks/useRadioKeyboard.ts","../src/ChipSelector/utils/chipColors.ts","../src/ChipSelector/utils/chipIdentity.ts","../src/ChipSelector/ChipSelector.tsx","../src/FormSwitch/FormSwitch.tsx","../src/FormCheckbox/checkboxColors.ts","../src/FormCheckbox/FormCheckbox.tsx","../src/SelectControl/NativeSelect.tsx","../src/controls/nextHighlight.ts","../src/SelectControl/useSelectListbox.ts","../src/SelectControl/SelectControl.tsx","../src/SelectField/SelectField.tsx","../src/MultiSelectField/components/SelectedChip.tsx","../src/MultiSelectField/utils/multiSelectValues.ts","../src/MultiSelectField/MultiSelectField.tsx","../src/TypeaheadControl/hooks/useDelayedBlurClose.ts","../src/controls/suggestOptions.ts","../src/TypeaheadControl/hooks/useTypeaheadSearch.ts","../src/TypeaheadControl/hooks/useTypeaheadState.ts","../src/TypeaheadControl/TypeaheadControl.tsx","../src/DateField/components/WebDateInput.tsx","../src/DatePicker/components/Glyph.tsx","../src/DatePicker/hooks/usePickerColors.ts","../src/DatePicker/components/PickerDialog.tsx","../src/SearchSelect/hooks/useAnchorRect.ts","../src/SearchSelect/DropdownPlacement.ts","../src/SearchSelect/utils/dropdownFrame.ts","../src/SearchSelect/components/DropdownSurface.tsx","../src/SearchSelect/components/SheetSurface.tsx","../src/SearchSelect/hooks/useReducedMotion.ts","../src/DatePicker/data/defaultLabels.ts","../src/DatePicker/utils/isoDate.ts","../src/DatePicker/utils/formatDate.ts","../src/DatePicker/utils/DateDisplay.ts","../src/DatePicker/utils/weekStart.ts","../src/DatePicker/hooks/useDatePickerConfig.tsx","../src/DatePicker/utils/motionStyles.ts","../src/DatePicker/components/PickerSurface.tsx","../src/DatePicker/utils/calendarKeys.ts","../src/DatePicker/hooks/useGridFocus.ts","../src/DatePicker/components/DayCell.tsx","../src/DatePicker/utils/monthGrid.ts","../src/DatePicker/components/MonthGrid.tsx","../src/DatePicker/components/MonthHeader.tsx","../src/DatePicker/components/PickerFooter.tsx","../src/DatePicker/hooks/useMotion.ts","../src/DatePicker/components/SingleCalendar.tsx","../src/DatePicker/hooks/useIsPhone.ts","../src/DatePicker/hooks/useReturnFocus.ts","../src/DatePicker/hooks/useTypedDate.ts","../src/DatePicker/utils/fieldWidth.ts","../src/DatePicker/utils/typedEdit.ts","../src/DateField/components/DatePickerInput.tsx","../src/DateField/components/TemporalInput.tsx","../src/DateField/components/TemporalField.tsx","../src/DateField/DateField.tsx","../src/DateRangeControl/components/NativeDateRange.tsx","../src/DatePicker/utils/rangePresets.ts","../src/DatePicker/components/PresetChips.tsx","../src/DatePicker/components/PresetMenu.tsx","../src/DatePicker/components/RangeMonths.tsx","../src/DatePicker/components/RangeCalendar.tsx","../src/DateRangeControl/components/WebDateRange.tsx","../src/DateRangeControl/DateRangeControl.tsx","../src/DateField/DateTimeField.tsx","../src/DateField/DateInput.tsx","../src/groupSelection/groupSelection.ts","../src/Stepper/StepperTabs.tsx","../src/Stepper/stepperModel.ts","../src/Stepper/StepperNav.tsx","../src/FormStatusLine/FormStatusLine.tsx","../src/useFocusFirstInvalid/useFocusFirstInvalid.ts","../src/useServerFieldErrors/assignServerErrors.ts","../src/useServerFieldErrors/useServerFieldErrors.ts","../src/useKeepInView/useKeepInView.ts","../src/FileInput/FileInput.tsx","../src/UploadWithLinkField/UploadWithLinkField.tsx","../src/AddOnRequest/AddOnRequest.tsx","../src/FixBar/FixBar.tsx","../src/SearchSelect/SelectSurface.ts","../src/SearchSelect/components/OptionRow.tsx","../src/SearchSelect/components/OptionSection.tsx","../src/SearchSelect/components/SearchSelectPanel.tsx","../src/SearchSelect/hooks/useRefocusOnClose.ts","../src/SearchSelect/utils/searchSelectModel.ts","../src/SearchSelect/hooks/useSearchSelectState.ts","../src/SearchSelect/utils/searchSelectMotion.ts","../src/SearchSelect/SearchSelect.tsx","../src/SearchSelect/hooks/useOutsidePress.ts","../src/SearchSelect/hooks/useDeferredFocus.ts","../src/CountryFlag/data/flagPalette.ts","../src/CountryFlag/FlagShapeKind.ts","../src/CountryFlag/data/flagDrawingsAtoL.ts","../src/CountryFlag/data/flagDrawingsMtoZ.ts","../src/CountryFlag/data/flagDrawings.ts","../src/CountryFlag/data/flagSpecs.ts","../src/CountryFlag/utils/flagPrimitives.ts","../src/CountryFlag/utils/flagDrawing.ts","../src/CountryFlag/utils/flagShapes.ts","../src/CountryFlag/CountryFlag.tsx","../src/countries/countriesData.ts","../src/countries/countryOptions.ts","../src/CountryField/CountryField.tsx","../src/IbanInput/hooks/useBlurVerdict.ts","../src/IbanInput/data/ibanCountryLengths.ts","../src/IbanInput/utils/ibanFormat.ts","../src/IbanInput/utils/ibanCaret.ts","../src/IbanInput/hooks/useIbanCaret.ts","../src/IbanInput/utils/ghostStyles.ts","../src/IbanInput/data/IbanRejection.ts","../src/IbanInput/utils/iban.ts","../src/IbanInput/components/RejectionLine.tsx","../src/IbanInput/utils/rejectionMessage.ts","../src/IbanInput/IbanInput.tsx","../src/IbanInput/data/BicRejection.ts","../src/IbanInput/utils/bic.ts","../src/IbanInput/BicInput.tsx","../src/FixBar/ActionBar.tsx","../src/GatedChecklist/isChecklistComplete.ts","../src/GatedChecklist/GatedChecklist.tsx","../src/RadioList/components/RadioRow.tsx","../src/RadioList/utils/radioRowIdentity.ts","../src/RadioList/RadioList.tsx","../src/DecisionPanel/utils/decisionRules.ts","../src/DecisionPanel/components/DecisionNote.tsx","../src/DecisionPanel/components/OutcomeButtons.tsx","../src/DecisionPanel/components/ChecksDriveDecision.tsx","../src/DecisionPanel/components/ChooseThenSubmitDecision.tsx","../src/DecisionPanel/components/StickyBarDecision.tsx","../src/DecisionPanel/components/SubmitError.tsx","../src/DecisionPanel/hooks/useDecisionPanel.ts","../src/DecisionPanel/DecisionPanel.tsx","../src/PasswordField/PasswordRulesDisplay.ts","../src/PasswordField/RuleTone.ts","../src/PasswordField/RuleMark.tsx","../src/PasswordField/RuleVariants.tsx","../src/PasswordField/PasswordRules.tsx","../src/PasswordField/RevealToggle.tsx","../src/PasswordField/ruleAnnouncement.ts","../src/PasswordField/usePasswordRuleAnnouncement.ts","../src/PasswordField/useRuleColors.ts","../src/PasswordField/PasswordField.tsx"],"names":["React","IS_WEB","Platform","StyleSheet","jsxs","jsx","Text","styles","View","field","useUi","useWindowDimensions","Fragment","Button","Z_INDEX","MENU_TOP_GAP","rect","useEffect","useState","useMemo","ThemedTextInput","useCallback","useRef","ChipLabelWrap","Pressable","HEX_SHORT_LENGTH","HEX_RADIX","withAlpha","DESCRIPTION_FONT_SIZE","MIN_TOUCH_TARGET_PX","toggle","HINT_FONT_SIZE","CHEVRON_DOWN","CHEVRON_UP","CLOSE_DELAY_MS","FORWARD","BACKWARD","TextInput","useAnchorRect","DropdownPlacement","Modal","Animated","PAD","MONDAY","parts","numbers","DateDisplay","SUNDAY","DAYS_IN_WEEK","MONTHS_IN_YEAR","BOLD","selection","FONT","FALLBACK","GAP","IconButton","EPOCH","REGULAR","ROW_GAP","INPUT_FONT","useFocusRing","SelectSurface","OPTION_FONT","DETAIL_FONT","OptionRow","ROW_PAD_H","SHEET_MAX_HEIGHT","ScrollView","KEY_ESCAPE","FlagShapeKind","HALF","cross","circle","NO_COUNTRY","INPUT_PAD_V","IbanRejection","COUNTRY_LENGTH","CODE_A","verdict","BicRejection","BIC8_LENGTH","BIC11_LENGTH","ALPHANUMERIC","refused","TEXT_SIZE","TEXT_LINE","MIN_TARGET_PX","PAD_H","PAD_V","RADIUS","TITLE_SIZE","PasswordRulesDisplay","RuleTone","CHIP_PAD_V","CHIP_PAD_H","SvgIcon","PasswordField"],"mappings":";;;;;;;;;;;;;AAkEO,SAAS,eAAA,CACd,KAAA,EACA,WAAA,EACA,aAAA,EACiB;A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F,GAAAA,CAAC,iBAAc,MAAA,EAAgB,OAAA,EAAS,cAAc,SAAA,EAAsB,KAAA,EAAc,QAAQ,OAAA,EAAS,CAAA;AAAA,sBAC3GA,GAAAA,CAACC,IAAAA,EAAA,EAAK,aAAU,QAAA,EAAS,uBAAA,EAAwB,QAAA,EAAS,KAAA,EAAOC,SAAO,IAAA,EAAM,MAAA,EAAQ,CAAA,EAAG,MAAM,aAC5F,QAAA,EAAA,YAAA,EACH;AAAA,KAAA,EACF,CAAA,GACE;AAAA,GAAA,EACN,CAAA,EAEJ,CAAA;AAEJ,CAAC","file":"index.mjs","sourcesContent":["/**\n * Give a `Field`'s plain-node child the `id` its `<label for>` points at.\n *\n * ## Why cloning rather than asking the caller\n *\n * `Field`'s documented, overwhelmingly common shape is a plain child:\n *\n * ```tsx\n * <Field label={FM('guides.titleLabel')}>\n * <ThemedTextInput … />\n * </Field>\n * ```\n *\n * There is no seam in that shape to hand an id through — which is exactly why label association\n * was never wired and why a live audit found 0 controls with an `id` across an entire CMS page.\n * The alternatives were worse: making every call site switch to the render-function form is a\n * fleet-wide migration that fails open (any missed call site silently keeps the old behaviour),\n * and wrapping the control inside the `<label>` element for implicit association breaks down on\n * the controls that are not native form elements — a `SelectControl` trigger is a\n * `<div role=\"button\">`, and nesting it in a `<label>` invites a double-fire on click.\n *\n * So the id is injected here, one level deep, and only when it is safe to do so.\n *\n * ## What \"safe\" means\n *\n * - Only a single valid element is touched. Arrays, strings and `null` are returned untouched,\n * because there is no unambiguous \"the control\" to point a label at. A **fragment** is excluded\n * explicitly: `React.isValidElement` says yes to one, but a fragment accepts no props beyond\n * `key`, so cloning an `id` onto it both warns in development and attaches nothing.\n * - A child that already carries an `id` keeps it. The caller was explicit; a label that silently\n * retargets someone else's id is worse than no label.\n * - The returned `controlId` is what the label should actually use: `undefined` when nothing was\n * attached, so `FieldLabel` emits no dangling `htmlFor` pointing at an element that does not\n * exist. A `<label for>` aimed at nothing is not a smaller bug than no label — it is a lie that\n * passes a \"has a label\" check.\n */\nimport React from 'react';\n\n/** Props any RN component may carry that we read or write here. `id` is RN ≥0.71 → DOM `id`. */\ninterface IdentifiableProps {\n id?: string;\n nativeID?: string;\n /** The kit's own contract for `aria-describedby`, honoured by `ThemedTextInput`/`ChipSelector`. */\n describedById?: string;\n}\n\nexport interface AttachedControl {\n /** The child, cloned with the field wiring when it could be attached; otherwise the original. */\n node: React.ReactNode;\n /** The id the label should target, or `undefined` when nothing could safely receive one. */\n controlId?: string;\n}\n\n/**\n * Returns the child wired to its `Field`, plus the id the label should point at.\n *\n * `candidateId` is only USED when it can be attached — the caller must not assume it was.\n *\n * `describedById` is injected too, under the kit's own `describedById` prop name, so the hint and\n * error lines are announced by a plain child exactly as they are by a render-function child. That\n * they were NOT was a real gap: a YouTube field made read-only with an on-screen sentence saying\n * why gave a screen-reader user the read-only state and none of the explanation.\n *\n * A child that is not a kit control simply ignores the prop; if it needs different wiring, use\n * the render-function form, which hands over the ids and lets the caller place them.\n */\nexport function attachControlId(\n child: React.ReactNode,\n candidateId: string,\n describedById?: string,\n): AttachedControl {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n return { node: child };\n }\n\n const props = child.props as IdentifiableProps;\n const existing = props.id ?? props.nativeID;\n const element = child as React.ReactElement<IdentifiableProps>;\n\n // An explicit id from the caller is never overwritten — but the description wiring still goes\n // on, because that is the field's to give and the caller expressed no opinion about it.\n const controlId = existing !== undefined && existing !== '' ? existing : candidateId;\n const injected: IdentifiableProps = { id: controlId };\n\n if (describedById !== undefined && props.describedById === undefined) {\n injected.describedById = describedById;\n }\n\n return { node: React.cloneElement(element, injected), controlId };\n}\n","/**\n * Put a real `for` attribute on a `<label>` rendered through react-native-web.\n *\n * ## Why this is imperative, which looks like a smell and is not\n *\n * The obvious implementation — pass `htmlFor` to `<Text role=\"label\">` — does not work, and\n * fails SILENTLY. react-native-web filters props through an allowlist (`forwardedProps`), and\n * `htmlFor` is not on it, so the prop is dropped somewhere between the component and the DOM\n * with no warning. This is the same family as the hint that never arrives: `accessibilityHint`\n * has no ARIA equivalent, so RN-web discards it, which is why this kit renders hints as\n * sr-only nodes instead of trusting the prop.\n *\n * That failure mode is the reason this is worth the imperative escape. A prop-level test\n * (`expect(label.props.htmlFor).toBe(id)`) passes against a build where the attribute never\n * reaches the browser. Setting it on the node and asserting `container.querySelector('label')\n * .getAttribute('for')` is the only version that can tell the difference.\n *\n * The alternatives were each worse:\n * - **Implicit association** (nesting the control inside the `<label>`) needs no attribute, but\n * changes the DOM structure of every field in seven portals, and a label wrapping a control\n * that turns out to be activatable is the classic double-fire bug.\n * - **Rendering the label as a raw DOM element** abandons the RN style pipeline, so the label\n * would need a second, hand-maintained styling path that could drift from every other label.\n *\n * Native is a no-op: there is no `<label>` and no DOM, and the association there is already\n * carried by the control's `accessibilityLabel`.\n */\nimport { useEffect, useRef } from 'react';\n\nimport { Platform } from 'react-native';\n\nconst IS_WEB = Platform.OS === 'web';\n\n/** The sliver of the DOM this touches — no `any`, no global DOM lib dependency. */\ninterface AttributeHost {\n setAttribute: (name: string, value: string) => void;\n removeAttribute: (name: string) => void;\n ownerDocument?: { getElementById: (id: string) => unknown } | null;\n}\n\nfunction isAttributeHost(node: unknown): node is AttributeHost {\n return (\n typeof node === 'object' &&\n node !== null &&\n typeof (node as AttributeHost).setAttribute === 'function'\n );\n}\n\n/**\n * Returns a ref to attach to the label element. The `for` attribute is set only when the target\n * it names is genuinely in the document.\n *\n * ## Why the existence check is not paranoia\n *\n * `Field` cannot know whether a render-function child actually placed the id it was handed. The\n * difficulty dropdown is the case that proved it: `SelectControl` is a `<div role=\"button\">` and\n * associates itself the other way round, via `aria-labelledby`, so nothing ever received\n * `controlId` — and the label emitted `for=\"field-control-3\"` pointing at nothing. Measured on a\n * real page, that produced a label that LOOKED correct in every audit (`<label>`: yes, `for`:\n * yes) and focused nothing when clicked.\n *\n * Trusting the caller here means the guarantee holds only as long as every call site remembers.\n * Checking the document makes it hold by construction, for both the injected and the\n * render-function paths, without either having to declare which one it is.\n *\n * It runs in an effect rather than in the ref callback because the check needs the whole\n * committed tree present — the control is a LATER sibling than its label, so at ref time the\n * answer would depend on commit ordering rather than on the truth.\n */\nexport function useHtmlFor(controlId?: string): React.RefObject<unknown> {\n const ref = useRef<unknown>(null);\n\n useEffect(() => {\n const node = ref.current;\n\n if (!IS_WEB || !isAttributeHost(node)) return;\n\n const target = controlId !== undefined && controlId !== '' ? node.ownerDocument?.getElementById(controlId) : null;\n\n // No target, or a target that is not in the document: emit nothing. A `for` pointing at a\n // missing element passes every \"does this page have labels?\" check while doing nothing.\n if (target === null || target === undefined) {\n node.removeAttribute('for');\n return;\n }\n\n node.setAttribute('for', controlId as string);\n }, [controlId]);\n\n return ref;\n}\n","/**\n * `FieldLabel` — the label row of a `Field`: the label text plus at most one marker.\n *\n * Split out of `Field` so the marker rules and the two label voices stay readable, and so `Field`\n * itself remains an orchestrator small enough to review.\n *\n * ## Why this is a real `<label>` on web\n *\n * It used to render a plain `<Text>`, i.e. a `<div>`. Controls still ANNOUNCED correctly, because\n * every one of them carries an `accessibilityLabel` → `aria-label`, so an audit of screen-reader\n * naming came back clean and the gap looked like it did not exist. What was missing was the other\n * half of a label: **clicking the words did not focus the field**. A page measured live had 0\n * `<label>` elements, 0 `label[for]` and 0 controls with an `id` — every field silently throwing\n * away a free doubling of its own hit area, on top of already being under the target-size floor.\n *\n * `role=\"label\"` is react-native-web's documented escape to a real `<label>` element (it is\n * special-cased ahead of the ARIA role map, since `label` is not an ARIA role). The `for`\n * attribute is set on the node itself — see `useHtmlFor` for why the obvious `htmlFor` prop is\n * silently discarded. On native both are inert: RN has no `<label>`, and the association there\n * is already carried by `accessibilityLabel`.\n *\n * The control keeps its `aria-label`, which still WINS for the accessible name — so this adds\n * click-to-focus without changing a single screen-reader announcement.\n */\nimport React from 'react';\n\nimport { Platform, Text, type StyleProp, type TextProps, type TextStyle } from 'react-native';\n\nimport { useHtmlFor } from './useHtmlFor';\n\nimport type { FieldMarker } from './fieldMarkers';\n\nconst IS_WEB = Platform.OS === 'web';\n\n/**\n * `label` is not an ARIA role, so RN's `role` union does not admit it; react-native-web\n * special-cases it into a real `<label>` element. Cast at the spread site through the host's own\n * props rather than through `any`.\n */\ninterface WebLabelProps {\n role?: 'label';\n}\n\nexport interface FieldLabelProps {\n label: string;\n marker: FieldMarker;\n /** Pre-localized text for the optional marker. Ignored unless `marker` is `optional`. */\n optionalLabel: string;\n /**\n * `id` of the control this label names. Emits `<label for>` on web so clicking the label text\n * focuses the field. Omitted when the field wraps a control that cannot be labelled that way\n * (a `<div role=\"button\">` select trigger), which uses `aria-labelledby` instead.\n */\n controlId?: string;\n /** `id` given to the label element itself, so a non-labelable control can point back at it. */\n labelId?: string;\n /** Composed style chain: base → variant → caller's `labelStyle` (applied last). */\n style: StyleProp<TextStyle>;\n requiredMarkStyle: StyleProp<TextStyle>;\n optionalMarkStyle: StyleProp<TextStyle>;\n}\n\nexport function FieldLabel({\n label,\n marker,\n optionalLabel,\n controlId,\n labelId,\n style,\n requiredMarkStyle,\n optionalMarkStyle,\n}: FieldLabelProps): React.ReactElement {\n const webProps = (IS_WEB ? { role: 'label' } : {}) as WebLabelProps as TextProps;\n const labelRef = useHtmlFor(controlId);\n\n return (\n <Text id={labelId} ref={labelRef as React.Ref<Text>} style={style} {...webProps}>\n {label}{' '}\n {marker === 'required' ? (\n // The asterisk is decorative — the control's `aria-required` conveys \"required\" to\n // assistive tech, so a screen reader says \"required\" instead of \"star\".\n <Text aria-hidden accessibilityElementsHidden importantForAccessibility=\"no\" style={requiredMarkStyle}>\n *\n </Text>\n ) : null}\n {marker === 'optional' && optionalLabel !== '' ? (\n // Also decorative: \"optional\" is the ABSENCE of `aria-required`, which assistive tech\n // already conveys. Rendering it to a screen reader would double-announce the same fact.\n <Text aria-hidden accessibilityElementsHidden importantForAccessibility=\"no\" style={optionalMarkStyle}>\n {optionalLabel}\n </Text>\n ) : null}\n </Text>\n );\n}\n\nexport default FieldLabel;\n","/**\n * Required / optional markers, per the shared forms contract\n * (`…/wwwroot/shared/FORMS.md` → \"Required and optional markers\").\n *\n * The contract says the two markers are MUTUALLY EXCLUSIVE — a field is required or optional, never\n * annotated as both — and that you mark the MINORITY: on a mostly-required form mark the optional\n * fields, on a mostly-optional form mark the required ones. Asterisking twelve of thirteen fields\n * is noise that trains the eye to ignore the marker.\n *\n * Exclusivity is enforced here rather than in the type system so that a caller spreading a props\n * object (`<Field {...fieldProps} />`, where both flags may be computed) still gets a defined,\n * single-marker result instead of a compile error it cannot act on.\n *\n * Precedence when a caller asks for BOTH: `required` wins. That is the safe failure direction —\n * showing \"optional\" on a field the server will reject sends the user into a failed submit, while\n * showing \"required\" on a genuinely optional field costs, at worst, an unnecessary keystroke.\n */\n\n/** Which marker a field label carries. Exactly one, never both. */\nexport type FieldMarker = 'none' | 'required' | 'optional';\n\n/**\n * The English fallback for the optional marker's text.\n *\n * `@dloizides/ui-forms` contains NO i18n runtime by design — aml-v2 uses `@dloizides/i18n` with\n * positional `{0}` params while the other six apps use i18next `{{p1}}`, and nothing bridges them,\n * so all user-visible copy arrives as pre-localized props. This constant exists ONLY so a\n * single-locale app can adopt `optional` in one line. It is exported precisely so it is greppable:\n * **a localized app MUST pass `optionalLabel`.** The required marker needs no such escape — `*` is\n * a glyph, not copy.\n */\nexport const DEFAULT_OPTIONAL_LABEL = '(optional)';\n\n/**\n * Resolve the two boolean flags to the single marker actually rendered.\n * `required` beats `optional`; neither flag yields `none`.\n */\nexport function resolveFieldMarker(required: boolean, optional: boolean): FieldMarker {\n if (required) return 'required';\n if (optional) return 'optional';\n return 'none';\n}\n","/**\n * `Field`'s TWO spacing models — the F3 fix, shipped as an OPT-IN rather than a breaking change.\n *\n * ## The defect\n *\n * `Field` hard-coded a 16px bottom margin on its container and 4px margins on its label / hint /\n * error. That is the pre-flexbox model: the CHILD owns the space after itself. In a `gap`-laid-out\n * parent — which is how every modern form row in this fleet is written — the child's margin STACKS\n * on the parent's gap, so the consumer has to cancel it by hand. aml-v2 alone carries 13\n * `marginBottom: 0` cancels, each with an apologetic comment; the fleet carries 16.\n *\n * AML v1 got this right in CSS: `.ui-field { display: flex; flex-direction: column; gap: 6px; }` —\n * internal gap only, and the parent grid owns the space BETWEEN fields. That contract is written up\n * in `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md` (\"The gap is owned by the container,\n * never by margins on the children\").\n *\n * ## Why opt-in and not a 2.0.0\n *\n * Switching every `Field` to the gap model at once moves pixels on every form in seven portals in a\n * single publish — which is exactly the change you cannot visually QA, because there is no app you\n * can look at that is still on the old behaviour to compare against. The two models are therefore\n * both implemented, selected per field:\n *\n * - `stack` (DEFAULT) — the historical margins, byte-identical to 1.8.0. Every existing consumer\n * is untouched, including the 16 that currently cancel the margin.\n * - `gap` — the FORMS.md contract: no bottom margin at all, uniform 6px internal gap. The parent\n * owns the rhythm.\n *\n * A `Field` inside a `FormGrid` resolves to `gap` automatically, so adopting the shared grid IS the\n * opt-in — the consumer deletes its hand-rolled `grid`/`field` styles and its margin cancel in the\n * same edit, and the fleet migrates one app at a time behind visual QA.\n */\nimport { StyleSheet, type TextStyle, type ViewStyle } from 'react-native';\n\n/**\n * Which spacing model a field speaks.\n *\n * A plain string union rather than a `const enum` for the same reason as `FieldLabelVariant`: this\n * type crosses the package boundary into consumers' `.d.ts`, and a cross-boundary `const enum`\n * breaks `isolatedModules` / Babel-only builds.\n */\nexport type FieldSpacing = 'stack' | 'gap';\n\n/** The historical bottom margin of a whole field block. Load-bearing for every un-migrated form. */\nexport const FIELD_STACK_MARGIN_BOTTOM = 16;\n/** The historical label→control margin. */\nexport const FIELD_STACK_LABEL_MARGIN_BOTTOM = 4;\n/** The historical control→hint and hint→error margin. */\nexport const FIELD_STACK_CHILD_MARGIN_TOP = 4;\n/** FORMS.md: one uniform gap between label, control, hint and error. Not four separate margins. */\nexport const FIELD_CONTRACT_GAP = 6;\n\nexport const fieldSpacingStyles = StyleSheet.create({\n stackContainer: { marginBottom: FIELD_STACK_MARGIN_BOTTOM },\n stackLabel: { marginBottom: FIELD_STACK_LABEL_MARGIN_BOTTOM },\n stackChild: { marginTop: FIELD_STACK_CHILD_MARGIN_TOP },\n /**\n * The gap model sets NO margins — not even zeroed ones. An explicit `marginBottom: 0` here would\n * defeat a caller who legitimately wants to push one field down via `containerStyle`, because\n * `containerStyle` composes AFTER this and a zero is indistinguishable from \"unset\" to a reader.\n */\n gapContainer: { gap: FIELD_CONTRACT_GAP },\n none: {},\n});\n\n/** The style pieces a field applies for one spacing model. */\nexport interface FieldSpacingStyles {\n container: ViewStyle;\n label: TextStyle;\n /** Applied to the hint AND the error — the two lines that sit under the control. */\n child: TextStyle;\n}\n\n/**\n * Resolve the caller's explicit choice against the surrounding grid.\n *\n * Precedence, and why: an EXPLICIT `spacing` prop always wins, so a consumer inside a `FormGrid`\n * that genuinely needs the old margin (a one-off cell that stacks two fields) can say so without\n * leaving the grid. Absent that, a grid means the grid's `gap` owns the rhythm. Absent both, the\n * historical model — the answer that changes nothing.\n */\nexport function resolveFieldSpacing(explicit: FieldSpacing | undefined, insideGrid: boolean): FieldSpacing {\n if (explicit !== undefined) return explicit;\n\n return insideGrid ? 'gap' : 'stack';\n}\n\n/**\n * The style pieces for a resolved model.\n *\n * Exported and pure so `Field` and `ChipSelector` can be proven to resolve IDENTICALLY. They drifted\n * once already — `ChipSelector` grew a `marginBottom: -8` whose comment blamed `Field`'s 16px — and a\n * shared pure function is what makes \"they agree\" a testable claim rather than a convention.\n */\nexport function fieldSpacingStyleSet(spacing: FieldSpacing): FieldSpacingStyles {\n if (spacing === 'gap') {\n return {\n container: fieldSpacingStyles.gapContainer,\n label: fieldSpacingStyles.none,\n child: fieldSpacingStyles.none,\n };\n }\n\n return {\n container: fieldSpacingStyles.stackContainer,\n label: fieldSpacingStyles.stackLabel,\n child: fieldSpacingStyles.stackChild,\n };\n}\n","/**\n * The TWO legitimate label voices, per the shared forms contract\n * (`PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md` → \"The TWO legitimate label voices\").\n *\n * - `field` — 13 / 600 / sentence case. A label that is READ: prose addressed to the person\n * filling the form. This is `Field`'s historical, unchanged default, so every\n * existing consumer renders byte-identically.\n * - `control` — 11 / 700 / UPPERCASE + letter-spacing. A label that is SCANNED: a key over a value\n * in a dense row (filter bars, compact toolbars, pager controls). These are exactly\n * the metrics `@dloizides/ui-tables` forked into its private `FieldShell` because\n * `Field` hard-coded the `field` voice and offered no way out.\n *\n * Pick the voice from the SURFACE, not the component: every label on one surface uses one voice,\n * and voices are never mixed within a single row.\n *\n * Why a plain string union and not a `const enum`: this type crosses the package boundary into\n * consumers' `.d.ts`, and a cross-boundary `const enum` breaks `isolatedModules` / Babel-only\n * builds. `@dloizides/ui-buttons` sets the same precedent for `ButtonVariant` for the same reason.\n */\nimport { StyleSheet, type TextStyle } from 'react-native';\n\n/** Which of the two contract voices a field label speaks. */\nexport type FieldLabelVariant = 'field' | 'control' | 'caption';\n\n/** The historical `Field` label metrics. Changing these moves pixels in every consumer. */\nconst FIELD_FONT_SIZE = 13;\nconst FIELD_FONT_WEIGHT = '600';\n\n/** The dense-control metrics, taken verbatim from `ui-tables`' `FieldShell` fork so it can retire. */\nconst CONTROL_FONT_SIZE = 11;\nconst CONTROL_FONT_WEIGHT = '700';\nconst CONTROL_LETTER_SPACING = 0.4;\n\nconst CAPTION_FONT_SIZE = 12;\nconst CAPTION_FONT_WEIGHT = '600';\n\nexport const labelVariantStyles = StyleSheet.create({\n field: {\n fontSize: FIELD_FONT_SIZE,\n fontWeight: FIELD_FONT_WEIGHT,\n },\n control: {\n fontSize: CONTROL_FONT_SIZE,\n fontWeight: CONTROL_FONT_WEIGHT,\n letterSpacing: CONTROL_LETTER_SPACING,\n textTransform: 'uppercase',\n },\n caption: {\n fontSize: CAPTION_FONT_SIZE,\n fontWeight: CAPTION_FONT_WEIGHT,\n letterSpacing: CONTROL_LETTER_SPACING,\n textTransform: 'uppercase',\n },\n});\n\n/**\n * Resolve a variant name to its style. An unknown/absent variant falls back to `field` — the\n * historical default — so a bad value degrades to \"unchanged\" rather than to \"unstyled\".\n */\nexport function resolveLabelVariantStyle(variant?: FieldLabelVariant): TextStyle {\n return labelVariantStyles[variant ?? 'field'] ?? labelVariantStyles.field;\n}\n","/**\n * The two contexts the layout primitives publish.\n *\n * They are SEPARATE on purpose, because they answer different questions and have different scopes:\n *\n * - `FormGridContext` carries a row's CELL METRICS, so `FormCell` can be written `<FormCell>` at\n * the overwhelmingly common call site and still get the row's `minWidth` / `flexBasis` — the four\n * constants (200 / 220 / 240 / 260) that the fleet re-declares by hand.\n * - `GapOwnedContext` says only \"the vertical rhythm here is owned by a parent's `gap`\". A `Field`\n * that sees it drops its own 16px bottom margin, which is the whole point of F3.\n *\n * Merging them would force `FormSection` — which also spaces with `gap`, and would otherwise\n * recreate the identical double-spacing bug one level up — to publish cell metrics it has no\n * business having. A section is not a row: a `Field` directly inside a section should be full width,\n * not 260px wide.\n *\n * Nothing about gap-ownership is inferable at runtime — RN's `StyleSheet` gives a child no way to\n * ask \"does my parent space me with gap?\" — so it has to be declared. Making the declaration a side\n * effect of using the shared primitives means the correct thing happens without a second opt-in.\n */\nimport React from 'react';\n\n/** Cell metrics a `FormGrid` hands down to its `FormCell` children. */\nexport interface FormGridMetrics {\n /** Below this the cell stops shrinking and the row wraps. */\n minWidth: number;\n /** The cell's ideal width before grow/shrink — its `flexBasis`. */\n basis: number;\n}\n\n/** `null` outside a grid, so `FormCell` can fall back to the package defaults rather than throw. */\nconst FormGridContext = React.createContext<FormGridMetrics | null>(null);\n\n/**\n * `false` — the historical model — unless a primitive above says otherwise. The default is what\n * every un-migrated `Field` in the fleet reads, so it must be the answer that changes nothing.\n */\nconst GapOwnedContext = React.createContext(false);\n\nexport const FormGridProvider = FormGridContext.Provider;\nexport const GapOwnedProvider = GapOwnedContext.Provider;\n\n/** The enclosing grid's cell metrics, or `null` outside a `FormGrid`. */\nexport function useFormGridMetrics(): FormGridMetrics | null {\n return React.useContext(FormGridContext);\n}\n\n/** True when a parent primitive owns this subtree's vertical rhythm with `gap`. */\nexport function useIsGapOwned(): boolean {\n return React.useContext(GapOwnedContext);\n}\n","import { readableScaleInk } from '@dloizides/design-tokens';\n\nimport type { UiTheme } from '@dloizides/ui-feedback';\n\nconst ERROR_LIGHT_STEPS = ['500', '600', '700'];\nconst ERROR_DARK_STEPS = ['300', '200', '400', '100', '500'];\n\ntype ThemeWithSemanticText = UiTheme & { semanticText?: { error?: string } };\n\n/** The error ink for helper text and borders: the theme's error text colour, else the error step that clears 4.5:1 on the surface. */\nexport function fieldErrorInk(theme: ThemeWithSemanticText): string {\n return theme.semanticText?.error ?? readableScaleInk({ ...theme.semantic.error }, theme.colors.surface, ERROR_LIGHT_STEPS, ERROR_DARK_STEPS);\n}\n","/**\n * Field — the generic \"label over a control, hint + error under it\" wrapper.\n *\n * `FormField` is hard-wired to a text input, so any NON-text control (a dropdown, a date picker,\n * a chip selector) had no shared way to get a label — and ended up visually misaligned next to\n * its `FormField` siblings: its box started a label-row higher, and it missed the container's\n * bottom margin so wrapped rows lost their vertical rhythm.\n *\n * `Field` is that label row + spacing, control-agnostic. Its metrics are the single source of\n * truth: `FormField` composes `Field` internally, so the two can never drift apart.\n *\n * Children may be a plain node (the common case — just wrap your control) or a render function\n * receiving `{ describedById, hasError }`, so a custom control can wire the hint AND error lines\n * into its own `aria-describedby` / invalid state exactly the way `FormField` does.\n *\n * The anatomy (label → control → hint → error), the two label voices, the mutually-exclusive\n * required/optional markers and the collapsing error slot all implement the shared cross-stack\n * contract in `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, Text, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { attachControlId } from './attachControlId';\nimport { FieldLabel } from './FieldLabel';\nimport { DEFAULT_OPTIONAL_LABEL, resolveFieldMarker } from './fieldMarkers';\nimport { fieldSpacingStyleSet, resolveFieldSpacing, type FieldSpacing } from './fieldSpacing';\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from './labelVariants';\nimport { useIsGapOwned } from '../FormGrid/formGridContext';\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\nconst ERROR_FONT_SIZE = 12;\nconst HINT_FONT_SIZE = 12;\n/** The optional marker drops to normal weight so it reads as an aside inside a 600 label. */\nconst OPTIONAL_MARK_FONT_WEIGHT = '400';\n\n/**\n * The metrics that do NOT depend on the spacing model. Everything positional — the container's\n * bottom margin, the label's bottom margin, the hint/error top margins — moved to `fieldSpacing`,\n * because those are exactly the values the two models disagree about.\n */\nconst styles = StyleSheet.create({\n hintText: {\n fontSize: HINT_FONT_SIZE,\n },\n errorText: {\n fontSize: ERROR_FONT_SIZE,\n },\n optionalMark: {\n fontWeight: OPTIONAL_MARK_FONT_WEIGHT,\n },\n});\n\ninterface ThemeStyles {\n label: TextStyle;\n requiredMark: TextStyle;\n optionalMark: TextStyle;\n hintText: TextStyle;\n errorText: TextStyle;\n}\n\n/** What a render-function child receives, so it can mirror `FormField`'s error wiring. */\nexport interface FieldChildContext {\n /**\n * Space-separated ids of the lines describing this control — the hint, the error, or both, in\n * reading order. `undefined` when there is neither. Assign straight to `aria-describedby`.\n */\n describedById?: string;\n hasError: boolean;\n /**\n * `id` this field's `<label for>` points at. Assign it to the control (RN `id` → DOM `id`) and\n * clicking the label text focuses the control — a free doubling of the hit area that every\n * field was throwing away.\n *\n * A plain-node child gets this injected automatically (see below); a render-function child has\n * to place it, because only the caller knows which element inside is the actual control.\n */\n controlId: string;\n /**\n * `id` OF the label element. For a control that `<label for>` cannot address — anything that is\n * not a native form element, e.g. the `<div role=\"button\">` a `SelectControl` trigger renders —\n * point `aria-labelledby` here instead.\n */\n labelId: string;\n}\n\nexport type FieldChildren = React.ReactNode | ((context: FieldChildContext) => React.ReactNode);\n\nexport interface FieldProps {\n /**\n * Label shown above the control. Optional so a control whose label is supplied elsewhere (or\n * which genuinely has none) can still use the shared shell for its error line + spacing: an\n * absent or empty label renders NO label row at all, rather than an empty one that would add a\n * phantom gap and misalign the control against its labelled siblings.\n */\n label?: string;\n children: FieldChildren;\n required?: boolean;\n /**\n * Marks the field explicitly optional. MUTUALLY EXCLUSIVE with `required` — if both are set,\n * `required` wins (the safe direction: an under-marked required field causes a failed submit).\n * Use it to mark the MINORITY: on a mostly-required form, marking the two optional fields is far\n * less noise than asterisking the other eleven.\n */\n optional?: boolean;\n /**\n * Pre-localized text for the optional marker. Defaults to the English `DEFAULT_OPTIONAL_LABEL`\n * so a single-locale app can adopt `optional` in one line; a localized app MUST pass this.\n */\n optionalLabel?: string;\n /**\n * Help line rendered UNDER the control and ABOVE the error — the sentence that stops the user\n * guessing. It coexists with `error` (the hint states the rule, the error says which rule was\n * broken) and both are reachable from the control via `aria-describedby`.\n *\n * Rendering a hint INSIDE the field is the point: as an outside sibling it lands past the\n * container's 16px bottom margin and detaches from the control it explains.\n */\n hint?: string;\n error?: string;\n /**\n * Which of the two contract label voices to speak: `field` (13/600 sentence case — the default,\n * unchanged) or `control` (11/700 uppercase — dense filter bars and toolbars).\n */\n labelVariant?: FieldLabelVariant;\n /**\n * Escape hatch applied AFTER `labelVariant`, for the genuine one-off a variant does not cover.\n * Prefer `labelVariant`: it is the reviewable, named choice, and a bare `labelStyle` is the thing\n * to grep for when auditing label drift.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * `StyleProp` (not a bare `ViewStyle`) so a caller can compose an array — e.g. a base field style\n * plus a `grow` modifier — instead of having to restate a COMPLETE style per variant.\n */\n containerStyle?: StyleProp<ViewStyle>;\n /**\n * Which of the two spacing models this field speaks — see `fieldSpacing.ts`.\n *\n * Leave it unset. Inside a `FormGrid` or `FormSection` it resolves to `gap` (the FORMS.md\n * contract: no bottom margin, the parent's `gap` owns the rhythm); anywhere else it resolves to\n * `stack` (the historical 16px margin, byte-identical to 1.8.0). Set it explicitly only to\n * override that — e.g. a cell inside a grid that genuinely stacks two fields wants `stack`.\n */\n spacing?: FieldSpacing;\n testID?: string;\n}\n\nlet fieldSeq = 0;\n/**\n * Stable-per-instance ids so the label, hint and error lines can be linked to the control via\n * `htmlFor` / `aria-labelledby` / `aria-describedby`. One counter bump per field keeps every id\n * of a field in lockstep.\n */\nexport function useFieldIds(): { hintId: string; errorId: string; controlId: string; labelId: string } {\n const [ids] = React.useState(() => {\n fieldSeq += 1;\n const seq = String(fieldSeq);\n return {\n hintId: `field-hint-${seq}`,\n errorId: `field-error-${seq}`,\n controlId: `field-control-${seq}`,\n labelId: `field-label-${seq}`,\n };\n });\n return ids;\n}\n\n/** Stable-per-instance id so the error line can be linked to the control via aria-describedby. */\nexport function useFieldErrorId(): string {\n return useFieldIds().errorId;\n}\n\n/** True only for a present, non-empty string. */\nfunction isPresent(value?: string): boolean {\n return typeof value === 'string' && value !== '';\n}\n\n/** True only for a present, non-empty error string. */\nexport function hasFieldError(error?: string): boolean {\n return isPresent(error);\n}\n\n/**\n * Join the ids of the lines describing the control, in reading order (hint then error), skipping\n * any that is not rendered. `undefined` — not `''` — when there is nothing, so the attribute is\n * omitted entirely rather than emitted empty.\n */\nexport function joinDescribedBy(hintId?: string, errorId?: string): string | undefined {\n const ids = [hintId, errorId].filter((id): id is string => isPresent(id));\n return ids.length > 0 ? ids.join(' ') : undefined;\n}\n\nexport const Field = ({\n label,\n children,\n required = false,\n optional = false,\n optionalLabel = DEFAULT_OPTIONAL_LABEL,\n hint,\n error,\n labelVariant,\n labelStyle,\n containerStyle,\n spacing,\n testID,\n}: FieldProps): React.ReactElement => {\n const { theme } = useUi();\n const gapOwned = useIsGapOwned();\n const spacingStyles = fieldSpacingStyleSet(resolveFieldSpacing(spacing, gapOwned));\n const { colors } = theme;\n const errorColor = fieldErrorInk(theme);\n const hasError = hasFieldError(error);\n const hasHint = isPresent(hint);\n const labelText = label ?? '';\n const hasLabel = labelText !== '';\n const marker = resolveFieldMarker(required, optional);\n const { hintId, errorId, controlId, labelId } = useFieldIds();\n\n const themeStyles = React.useMemo<ThemeStyles>(\n () => ({\n label: { color: colors.textSecondary },\n requiredMark: { color: errorColor },\n // The optional marker is an aside, so it sits a step back from the label's own ink.\n optionalMark: { color: colors.textSecondary },\n hintText: { color: colors.textSecondary },\n errorText: { color: errorColor },\n }),\n [colors.textSecondary, errorColor],\n );\n\n const describedById = joinDescribedBy(hasHint ? hintId : undefined, hasError ? errorId : undefined);\n\n // A render-function child places `controlId` itself, so the label always targets it. A plain\n // node has the id injected — and `attachControlId` reports back whether that was possible, so\n // the label never emits an `htmlFor` pointing at an element that does not exist.\n const isRenderChild = typeof children === 'function';\n const attached = isRenderChild\n ? { node: children({ describedById, hasError, controlId, labelId }), controlId }\n : attachControlId(children, controlId, describedById);\n const control = attached.node;\n\n return (\n <View style={[spacingStyles.container, containerStyle]} testID={testID}>\n {hasLabel ? (\n <FieldLabel\n controlId={attached.controlId}\n label={labelText}\n labelId={labelId}\n marker={marker}\n optionalLabel={optionalLabel}\n optionalMarkStyle={[styles.optionalMark, themeStyles.optionalMark]}\n requiredMarkStyle={themeStyles.requiredMark}\n style={[spacingStyles.label, resolveLabelVariantStyle(labelVariant), themeStyles.label, labelStyle]}\n />\n ) : null}\n {control}\n {hasHint ? (\n <Text nativeID={hintId} style={[styles.hintText, spacingStyles.child, themeStyles.hintText]}>\n {hint}\n </Text>\n ) : null}\n {hasError ? (\n <Text nativeID={errorId} role=\"alert\" style={[styles.errorText, spacingStyles.child, themeStyles.errorText]}>\n {error}\n </Text>\n ) : null}\n </View>\n );\n};\n\nexport default Field;\n","/**\n * `FormGrid` — the wrapping form row, extracted from ~177 hand-rolled copies.\n *\n * Verbatim in every portal, differing only in one constant:\n *\n * ```ts\n * grid: { flexDirection: 'row', flexWrap: 'wrap', gap: 12 },\n * field: { minWidth: 220, flexGrow: 1, flexBasis: 260 }, // or 200/240/260\n * ```\n *\n * Extracting it is worth more than the deleted lines: because the grid declares itself through\n * `FormGridContext`, a `Field` inside it knows its vertical rhythm is owned by the grid's `gap` and\n * drops its own bottom margin. That kills the fleet's 16 `marginBottom: 0` cancel hacks at the same\n * time — the grid and the cancel were always two halves of one bug.\n *\n * The cell metrics live on the GRID, not on each cell, because that is how the real call sites are\n * written: one `styles.field` reused by every cell in the row, with the occasional narrow one-off.\n * `<FormCell>` with no props is therefore the common case, and `<FormCell basis={160} grow={false}>`\n * the exception — which is exactly the ratio in aml-v2's `ScreeningForm`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { FormGridProvider, GapOwnedProvider, type FormGridMetrics } from './formGridContext';\n\n/** The gap 24 of aml-v2's 41 wrapping rows already use. The de-facto fleet default. */\nexport const FORM_GRID_DEFAULT_GAP = 12;\n/** The most common `minWidth` across the fleet's copies (the others are 200 / 240 / 260). */\nexport const FORM_GRID_DEFAULT_MIN_WIDTH = 220;\n/** The most common `flexBasis` across the fleet's copies. */\nexport const FORM_GRID_DEFAULT_BASIS = 260;\n\nconst styles = StyleSheet.create({\n grid: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n});\n\nexport interface FormGridProps {\n children: React.ReactNode;\n /**\n * Space between cells, horizontally AND between wrapped rows. This is the value that makes the\n * grid own the vertical rhythm, so it is also what a descendant `Field` is dropping its own\n * margin in favour of.\n */\n gap?: number;\n /** Default `minWidth` for every `FormCell` in this grid. */\n minWidth?: number;\n /** Default `flexBasis` for every `FormCell` in this grid. */\n basis?: number;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormGrid = ({\n children,\n gap = FORM_GRID_DEFAULT_GAP,\n minWidth = FORM_GRID_DEFAULT_MIN_WIDTH,\n basis = FORM_GRID_DEFAULT_BASIS,\n style,\n testID,\n}: FormGridProps): React.ReactElement => {\n // Memoised on the two primitives, not the object literal: a fresh identity every render would\n // re-render every `Field` in the row on every keystroke in any one of them.\n const metrics = React.useMemo<FormGridMetrics>(() => ({ minWidth, basis }), [minWidth, basis]);\n\n return (\n <FormGridProvider value={metrics}>\n <GapOwnedProvider value>\n <View style={[styles.grid, { gap }, style]} testID={testID}>\n {children}\n </View>\n </GapOwnedProvider>\n </FormGridProvider>\n );\n};\n\nexport default FormGrid;\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { fieldSpacingStyleSet, resolveFieldSpacing, type FieldSpacing } from '../Field/fieldSpacing';\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from '../Field/labelVariants';\nimport { useIsGapOwned } from '../FormGrid/formGridContext';\n\nconst LABEL_LINE_PLACEHOLDER = ' ';\n\nconst styles = StyleSheet.create({\n labelLine: {\n userSelect: 'none',\n },\n});\n\nexport interface AlignToControlProps {\n children: React.ReactNode;\n labelVariant?: FieldLabelVariant;\n spacing?: FieldSpacing;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/** Puts a button or other unlabelled control on the input line of the labelled `Field`s beside it. */\nexport const AlignToControl = ({\n children,\n labelVariant,\n spacing,\n style,\n testID,\n}: AlignToControlProps): React.ReactElement => {\n const spacingStyles = fieldSpacingStyleSet(resolveFieldSpacing(spacing, useIsGapOwned()));\n const labelLineTestID = testID !== undefined ? `${testID}-label-line` : undefined;\n\n return (\n <View style={[spacingStyles.container, style]} testID={testID}>\n <Text\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no\"\n style={[spacingStyles.label, resolveLabelVariantStyle(labelVariant), styles.labelLine]}\n testID={labelLineTestID}\n >\n {LABEL_LINE_PLACEHOLDER}\n </Text>\n {children}\n </View>\n );\n};\n\nexport default AlignToControl;\n","/**\n * `FormCell` — one cell of a `FormGrid`.\n *\n * Replaces the `<View style={styles.field}>` wrapper every real call site already puts around each\n * control. It inherits `minWidth` / `flexBasis` from the enclosing grid so the common case is a bare\n * `<FormCell>`, and takes per-cell overrides for the genuine one-offs (aml-v2's `fieldNarrow`:\n * `minWidth: 140, flexBasis: 160, flexGrow: 0`).\n *\n * Used OUTSIDE a `FormGrid` it still renders a sensible cell from the package defaults rather than\n * throwing — a cell is a layout hint, and a form that renders slightly wide is a better failure than\n * a form that does not render. The grid-owned SPACING behaviour, by contrast, is deliberately NOT\n * available this way: that one has to come from a real grid, because a `Field` dropping its margin\n * with nothing to replace it would collapse the form.\n */\nimport React from 'react';\n\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { AlignToControl } from '../AlignToControl/AlignToControl';\n\nimport {\n FORM_GRID_DEFAULT_BASIS,\n FORM_GRID_DEFAULT_MIN_WIDTH,\n} from './FormGrid';\nimport { useFormGridMetrics } from './formGridContext';\n\n/** A cell that grows to fill the row's slack. The default — most fields want the space. */\nconst GROW = 1;\n/** A cell pinned to its basis. For the narrow one-offs (a 2-digit threshold next to a name field). */\nconst NO_GROW = 0;\n\nexport interface FormCellProps {\n children: React.ReactNode;\n /** Overrides the grid's `minWidth` for this cell only. */\n minWidth?: number;\n /** Overrides the grid's `basis` for this cell only. */\n basis?: number;\n /** `false` pins the cell to its basis instead of letting it absorb the row's slack. */\n grow?: boolean;\n /** Puts an unlabelled control (a button) on the input line of the labelled cells beside it. */\n alignToControl?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormCell = ({\n children,\n minWidth,\n basis,\n grow = true,\n alignToControl = false,\n style,\n testID,\n}: FormCellProps): React.ReactElement => {\n const metrics = useFormGridMetrics();\n const resolvedMinWidth = minWidth ?? metrics?.minWidth ?? FORM_GRID_DEFAULT_MIN_WIDTH;\n const resolvedBasis = basis ?? metrics?.basis ?? FORM_GRID_DEFAULT_BASIS;\n\n const cellStyle: ViewStyle = {\n minWidth: resolvedMinWidth,\n flexBasis: resolvedBasis,\n flexGrow: grow ? GROW : NO_GROW,\n };\n\n return (\n <View style={[cellStyle, style]} testID={testID}>\n {alignToControl ? <AlignToControl>{children}</AlignToControl> : children}\n </View>\n );\n};\n\nexport default FormCell;\n","export const INLINE_FIELD_ROW_MIN_WIDTH = 1024;\n\nexport interface InlineFieldRowLayout {\n inline: boolean;\n fieldMaxWidth: number | undefined;\n}\n\n/** Field and action share one row only at `inlineMinWidth` and wider; below it they stack. */\nexport function inlineFieldRowLayout(\n windowWidth: number,\n fieldMaxWidth: number,\n inlineMinWidth: number = INLINE_FIELD_ROW_MIN_WIDTH,\n): InlineFieldRowLayout {\n const inline = windowWidth >= inlineMinWidth;\n return { inline, fieldMaxWidth: inline ? fieldMaxWidth : undefined };\n}\n","import React, { useMemo } from 'react';\n\nimport { StyleSheet, View, useWindowDimensions } from 'react-native';\n\nimport { AlignToControl } from '../AlignToControl/AlignToControl';\nimport { FORM_GRID_DEFAULT_GAP } from '../FormGrid/FormGrid';\n\nimport { inlineFieldRowLayout } from './inlineFieldRowLayout';\n\nconst styles = StyleSheet.create({\n action: {\n flexShrink: 0,\n },\n field: {\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 1,\n },\n row: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n },\n});\n\nexport interface InlineFieldRowProps {\n field: React.ReactNode;\n action: React.ReactNode;\n fieldMaxWidth: number;\n inlineMinWidth?: number;\n gap?: number;\n testID?: string;\n}\n\n/** A labelled field and its action: stacked on phones, one row on desktop with the action on the input line. */\nexport const InlineFieldRow = ({\n field,\n action,\n fieldMaxWidth,\n inlineMinWidth,\n gap = FORM_GRID_DEFAULT_GAP,\n testID,\n}: InlineFieldRowProps): React.ReactElement => {\n const { width } = useWindowDimensions();\n const layout = inlineFieldRowLayout(width, fieldMaxWidth, inlineMinWidth);\n const rowStyle = useMemo(() => [styles.row, { gap }], [gap]);\n const fieldStyle = useMemo(() => [styles.field, { maxWidth: layout.fieldMaxWidth }], [layout.fieldMaxWidth]);\n\n if (!layout.inline)\n return (\n <>\n {field}\n {action}\n </>\n );\n\n return (\n <View style={rowStyle} testID={testID}>\n <View style={fieldStyle}>{field}</View>\n <AlignToControl style={styles.action}>{action}</AlignToControl>\n </View>\n );\n};\n\nexport default InlineFieldRow;\n","import type { LineItemColumn } from '../types';\n\nexport const LINE_ITEMS_WIDE_MIN_WIDTH = 1280;\nexport const LINE_ITEMS_DEFAULT_MIN_ITEMS = 1;\nexport const LINE_ITEMS_CARD_PADDING = 12;\nexport const LINE_ITEMS_CARD_BORDER = 1;\n\nconst DEFAULT_COLUMN_FLEX = 1;\n\n/** True when the window is wide enough for column headers shown once above the lines. */\nexport function isLineItemsWide(width: number, wideMinWidth: number = LINE_ITEMS_WIDE_MIN_WIDTH): boolean {\n return width >= wideMinWidth;\n}\n\n/** True when a line may be removed without going below `minItems`. */\nexport function canRemoveLine(count: number, minItems: number = LINE_ITEMS_DEFAULT_MIN_ITEMS): boolean {\n return count > minItems;\n}\n\n/** The 1-based number a reader sees for the line at `index`. */\nexport function lineNumberOf(index: number): number {\n return index + 1;\n}\n\n/** The share of the row a column takes on the wide layout. */\nexport function lineItemColumnFlex(column: LineItemColumn): number {\n return column.flex ?? DEFAULT_COLUMN_FLEX;\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle } from '../../Field/labelVariants';\nimport { FORM_GRID_DEFAULT_GAP } from '../../FormGrid/FormGrid';\nimport { LINE_ITEMS_CARD_BORDER, LINE_ITEMS_CARD_PADDING } from '../utils/lineItemsLayout';\n\nconst CARD_RADIUS = 8;\nconst HEADER_GAP = 8;\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: CARD_RADIUS,\n borderWidth: LINE_ITEMS_CARD_BORDER,\n gap: FORM_GRID_DEFAULT_GAP,\n padding: LINE_ITEMS_CARD_PADDING,\n },\n header: { alignItems: 'center', columnGap: HEADER_GAP, flexDirection: 'row', flexWrap: 'wrap', rowGap: HEADER_GAP },\n spacer: { flexGrow: 1 },\n});\n\ninterface LineItemCardProps {\n title: string;\n header?: React.ReactNode;\n removeAction?: React.ReactNode;\n children: React.ReactNode;\n testID: string;\n}\n\n/** One labelled line: a title row with a header slot and a remove action, then the line's cells. */\nexport const LineItemCard = ({ title, header, removeAction, children, testID }: LineItemCardProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n\n return (\n <View\n aria-label={title}\n role=\"group\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <View style={styles.header}>\n <Text style={[resolveLabelVariantStyle(), { color: colors.text }]} testID={`${testID}-title`}>\n {title}\n </Text>\n {header}\n <View style={styles.spacer} />\n {removeAction}\n </View>\n {children}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle } from '../../Field/labelVariants';\nimport { FORM_GRID_DEFAULT_GAP } from '../../FormGrid/FormGrid';\nimport type { LineItemColumn } from '../types';\nimport { LINE_ITEMS_CARD_BORDER, LINE_ITEMS_CARD_PADDING, lineItemColumnFlex } from '../utils/lineItemsLayout';\n\nconst styles = StyleSheet.create({\n cell: { flexBasis: 0, flexShrink: 1, minWidth: 0 },\n row: {\n flexDirection: 'row',\n gap: FORM_GRID_DEFAULT_GAP,\n paddingHorizontal: LINE_ITEMS_CARD_PADDING + LINE_ITEMS_CARD_BORDER,\n },\n});\n\ninterface LineItemsColumnHeadersProps {\n columns: readonly LineItemColumn[];\n testID: string;\n}\n\n/** Column labels shown once above the lines on the wide layout. */\nexport const LineItemsColumnHeaders = ({ columns, testID }: LineItemsColumnHeadersProps): React.ReactElement => {\n const { theme } = useUi();\n const labelStyle = [resolveLabelVariantStyle(), { color: theme.colors.textSecondary }];\n\n return (\n <View style={styles.row} testID={testID}>\n {columns.map((column) => (\n <View key={column.key} style={[styles.cell, { flexGrow: lineItemColumnFlex(column) }]}>\n <Text style={labelStyle}>{column.label}</Text>\n </View>\n ))}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, View, useWindowDimensions } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { FORM_GRID_DEFAULT_GAP, FormGrid } from '../FormGrid/FormGrid';\nimport { FormCell } from '../FormGrid/FormCell';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nimport { LineItemCard } from './components/LineItemCard';\nimport { LineItemsColumnHeaders } from './components/LineItemsColumnHeaders';\nimport type { LineItemsProps } from './types';\nimport { canRemoveLine, isLineItemsWide, lineItemColumnFlex, lineNumberOf } from './utils/lineItemsLayout';\n\nconst styles = StyleSheet.create({\n add: { alignSelf: 'flex-start' },\n cell: { flexBasis: 0, flexShrink: 1, minWidth: 0 },\n list: { gap: FORM_GRID_DEFAULT_GAP },\n wideRow: { alignItems: 'flex-start', flexDirection: 'row', gap: FORM_GRID_DEFAULT_GAP },\n});\n\n/** Repeating lines as labelled cards: stacked cells on phones, one row under column headers shown once when wide. */\nexport function LineItems<T>({\n items,\n getKey,\n columns,\n renderCell,\n lineLabel,\n labels,\n testID,\n renderLineHeader,\n onAdd,\n onRemove,\n minItems,\n wideMinWidth,\n}: LineItemsProps<T>): React.ReactElement {\n const { width } = useWindowDimensions();\n const wide = isLineItemsWide(width, wideMinWidth);\n const removable = onRemove !== undefined && canRemoveLine(items.length, minItems);\n\n const renderCells = (item: T, index: number): React.ReactNode => {\n if (wide)\n return (\n <GapOwnedProvider value>\n <View style={styles.wideRow}>\n {columns.map((column) => (\n <View key={column.key} style={[styles.cell, { flexGrow: lineItemColumnFlex(column) }]}>\n {renderCell({ item, index, columnKey: column.key, wide })}\n </View>\n ))}\n </View>\n </GapOwnedProvider>\n );\n return (\n <FormGrid>\n {columns.map((column) => (\n <FormCell key={column.key}>{renderCell({ item, index, columnKey: column.key, wide })}</FormCell>\n ))}\n </FormGrid>\n );\n };\n\n return (\n <View style={styles.list} testID={testID}>\n {wide ? <LineItemsColumnHeaders columns={columns} testID={`${testID}-columns`} /> : null}\n {items.map((item, index) => {\n const lineNumber = lineNumberOf(index);\n const lineTestID = `${testID}-line-${String(lineNumber)}`;\n const removeAction = removable ? (\n <Button\n accessibilityHint={labels.removeHint}\n accessibilityLabel={labels.remove(lineNumber)}\n label={labels.remove(lineNumber)}\n testID={`${lineTestID}-remove`}\n variant=\"ghost\"\n onPress={() => onRemove(index)}\n />\n ) : undefined;\n return (\n <LineItemCard\n key={getKey(item, index)}\n header={renderLineHeader?.(item, index)}\n removeAction={removeAction}\n testID={lineTestID}\n title={lineLabel(lineNumber)}\n >\n {renderCells(item, index)}\n </LineItemCard>\n );\n })}\n {onAdd !== undefined ? (\n <View style={styles.add}>\n <Button\n accessibilityHint={labels.addHint}\n accessibilityLabel={labels.add}\n label={labels.add}\n testID={`${testID}-add`}\n variant=\"secondary\"\n onPress={onAdd}\n />\n </View>\n ) : null}\n </View>\n );\n}\n\nexport default LineItems;\n","import React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { FORM_GRID_DEFAULT_GAP } from '../FormGrid/FormGrid';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nconst styles = StyleSheet.create({\n stack: { flexDirection: 'column' },\n});\n\nexport interface FormStackProps {\n children: React.ReactNode;\n gap?: number;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/** A vertical form column whose `gap` owns the rhythm, so the `Field`s inside drop their own bottom margin. */\nexport const FormStack = ({\n children,\n gap = FORM_GRID_DEFAULT_GAP,\n style,\n testID,\n}: FormStackProps): React.ReactElement => (\n <GapOwnedProvider value>\n <View style={[styles.stack, { gap }, style]} testID={testID}>\n {children}\n </View>\n </GapOwnedProvider>\n);\n","export const RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;\n\n/** True when `width` reaches `breakpoint`, so the wide layout applies. */\nexport function isWideFormLayout(width: number, breakpoint: number = RESPONSIVE_FORM_DEFAULT_BREAKPOINT): boolean {\n return width >= breakpoint;\n}\n","import React from 'react';\n\nimport { useWindowDimensions } from 'react-native';\n\nimport { isWideFormLayout, RESPONSIVE_FORM_DEFAULT_BREAKPOINT } from './isWideFormLayout';\n\nexport interface ResponsiveFormLayoutProps {\n narrow: React.ReactNode;\n wide: React.ReactNode;\n breakpoint?: number;\n}\n\n/** Renders `wide` when the window reaches `breakpoint`, else `narrow`, so a form switches layout by width. */\nexport function ResponsiveFormLayout({\n narrow,\n wide,\n breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT,\n}: ResponsiveFormLayoutProps): React.ReactElement {\n const { width } = useWindowDimensions();\n return <>{isWideFormLayout(width, breakpoint) ? wide : narrow}</>;\n}\n","/**\n * `FormSection` — a titled group of fields. The React answer to v1's `<fieldset>` / `<legend>`.\n *\n * v1 has a real `<fieldset>` whose `<legend>` takes the identical label metric as a field label, so\n * a group heading reads as part of the form rather than as page furniture. Nothing in the React\n * fleet has this: zygos fakes it with a generic `Heading`, and everybody else emits an untitled\n * `<View>` — which means the grouping exists visually but not semantically, so a screen-reader user\n * tabbing into \"Threshold\" is never told it belongs to \"Advanced matching\".\n *\n * ## Why not a literal `<fieldset>`\n *\n * react-native-web has no `fieldset` mapping — a `View` is a `div`, and there is no escape hatch\n * that turns one into a `<fieldset>` with a real `<legend>`. What IS available is the pattern the\n * ARIA spec defines as the equivalent: `role=\"group\"` + `aria-labelledby` pointing at the heading.\n * Assistive tech announces \"Advanced matching, group\" exactly as it would for a fieldset. This is\n * the honest ceiling of the platform, not a shortcut — and it is why the legend is a `Text` whose\n * `nativeID` is generated the same way `Field`'s hint/error ids are.\n *\n * The legend deliberately reuses `resolveLabelVariantStyle` — the SAME function `Field` uses for its\n * label — so the two cannot drift. A section titled in one metric above fields labelled in another\n * is precisely the \"third voice is drift\" failure FORMS.md warns about.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from '../Field/labelVariants';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\n/** Space between the legend, the description and the section's content. */\nconst SECTION_GAP = 10;\n/** A description is a help line for the whole group — same size as `Field`'s hint. */\nconst DESCRIPTION_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n section: {\n gap: SECTION_GAP,\n },\n description: {\n fontSize: DESCRIPTION_FONT_SIZE,\n },\n});\n\nlet sectionSeq = 0;\n\n/** Stable-per-instance id so the group can point at its own legend via `aria-labelledby`. */\nfunction useSectionLegendId(): string {\n const [id] = React.useState(() => {\n sectionSeq += 1;\n return `form-section-legend-${String(sectionSeq)}`;\n });\n return id;\n}\n\n/**\n * Web-only ARIA attributes react-native-web forwards to the underlying element but that RN's\n * `ViewProps` type does not enumerate — the same escape-hatch-free pattern `ChipSelector` uses.\n */\ninterface WebSectionA11y {\n 'aria-labelledby'?: string;\n}\n\nexport interface FormSectionProps {\n /**\n * The legend — pre-localized, like every string in this package. Optional: a section with no\n * title still groups its children for layout, but renders NO legend row and NO `aria-labelledby`,\n * because a group labelled by an empty element is worse for assistive tech than an unlabelled one.\n */\n title?: string;\n /** Help line for the whole group, under the legend. The group-level sibling of `Field`'s hint. */\n description?: string;\n children: React.ReactNode;\n /**\n * Which label voice the legend speaks. Defaults to `field` — a section heading on a form the user\n * fills in. Pass `control` on a dense surface so the legend matches the controls beneath it.\n */\n labelVariant?: FieldLabelVariant;\n /** Escape hatch applied AFTER `labelVariant`, for the genuine one-off a variant does not cover. */\n titleStyle?: StyleProp<TextStyle>;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormSection = ({\n title,\n description,\n children,\n labelVariant,\n titleStyle,\n style,\n testID,\n}: FormSectionProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const legendId = useSectionLegendId();\n const hasTitle = typeof title === 'string' && title !== '';\n const hasDescription = typeof description === 'string' && description !== '';\n\n const a11y: WebSectionA11y = { 'aria-labelledby': hasTitle ? legendId : undefined };\n\n return (\n // The section spaces its children with `gap`, so it owns their vertical rhythm exactly as a\n // `FormGrid` owns a row's — without this a `Field` placed directly in a section would stack its\n // 16px margin on the section's gap and recreate the F3 bug one level up.\n <GapOwnedProvider value>\n <View role=\"group\" style={[styles.section, style]} testID={testID} {...a11y}>\n {hasTitle ? (\n <Text\n nativeID={legendId}\n style={[resolveLabelVariantStyle(labelVariant), { color: colors.text }, titleStyle]}\n >\n {title}\n </Text>\n ) : null}\n {hasDescription ? (\n <Text style={[styles.description, { color: colors.textSecondary }]}>{description}</Text>\n ) : null}\n {children}\n </View>\n </GapOwnedProvider>\n );\n};\n\nexport default FormSection;\n","/**\n * `FormActions` — the submit/cancel button row every form ends with.\n *\n * Promoted from the BYTE-IDENTICAL `erevna-web/src/components/Forms/FormActions.tsx` and\n * `katalogos-web/src/components/Forms/FormActions.tsx` (68 lines each, `diff` returns nothing);\n * all seven apps hand-roll the same row. Buttons come from the shared `@dloizides/ui-buttons` kit\n * rather than being forked here, so there is exactly one button implementation in the estate.\n *\n * The layout implements the contract's actions row\n * (`…/wwwroot/shared/FORMS.md` → \"Actions row\"): the primary action is LAST in DOM order, so tab\n * order reaches Cancel before Save, and `saving` drives the primary button's spinner rather than\n * disabling-and-relabelling it.\n *\n * Two minimal generalizations over the app-local twins:\n * 1. Labels and hints arrive as PRE-LOCALIZED props. The twins called `FM()` internally, which\n * cannot work here: aml-v2 localizes via `@dloizides/i18n` with positional `{0}` params while\n * the other six use i18next `{{p1}}`, and nothing bridges them.\n * 2. `testID`s are overridable but default to the twins' `save-button` / `cancel-button`, so the\n * existing Playwright selectors in every app keep matching.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\n/** Gap between the actions, matching the contract's `.actions { gap: 12px }`. */\nconst ACTIONS_GAP = 12;\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: ACTIONS_GAP,\n },\n});\n\nexport interface FormActionsProps {\n /** Submit handler. May be async — the shared Button drives its own spinner for the promise. */\n onSave: () => void | Promise<unknown>;\n /** Cancel handler. Omit it entirely to render a save-only row (no empty Cancel slot). */\n onCancel?: () => void | Promise<unknown>;\n /** Pre-localized label for the primary action. */\n saveLabel: string;\n /** Pre-localized label for the cancel action. Required whenever `onCancel` is supplied. */\n cancelLabel?: string;\n /** Pre-localized accessibility hint for the primary action. Falls back to its label. */\n saveHint?: string;\n /** Pre-localized accessibility hint for the cancel action. Falls back to its label. */\n cancelHint?: string;\n /** In-flight submit: spins the primary action and disables cancel so the form can't be abandoned mid-write. */\n saving?: boolean;\n /** Disables the primary action independently of `saving` (e.g. an invalid form). */\n saveDisabled?: boolean;\n containerStyle?: StyleProp<ViewStyle>;\n saveTestID?: string;\n cancelTestID?: string;\n testID?: string;\n}\n\nexport const FormActions = ({\n onSave,\n onCancel,\n saveLabel,\n cancelLabel = '',\n saveHint,\n cancelHint,\n saving = false,\n saveDisabled = false,\n containerStyle,\n saveTestID = 'save-button',\n cancelTestID = 'cancel-button',\n testID,\n}: FormActionsProps): React.ReactElement => (\n <View style={[styles.container, containerStyle]} testID={testID}>\n {typeof onCancel === 'function' ? (\n <Button\n accessibilityHint={cancelHint ?? cancelLabel}\n accessibilityLabel={cancelLabel}\n disabled={saving}\n label={cancelLabel}\n testID={cancelTestID}\n variant=\"outline\"\n onPress={onCancel}\n />\n ) : null}\n\n <Button\n accessibilityHint={saveHint ?? saveLabel}\n accessibilityLabel={saveLabel}\n disabled={saveDisabled}\n label={saveLabel}\n loading={saving}\n testID={saveTestID}\n variant=\"primary\"\n onPress={onSave}\n />\n </View>\n);\n\nexport default FormActions;\n","/**\r\n * `controlStyles` — the tuned metrics for the dense CONTROLS (text box, select trigger, floating\r\n * option menu, date-range row), promoted VERBATIM out of `@dloizides/ui-tables`' private\r\n * `Filters/styles.ts`.\r\n *\r\n * That file's own header said the quiet part out loud: it \"reconcile[d] the per-field styles that\r\n * were copy-pasted across aml-v2's filter files into one shared source\" — and then locked the\r\n * reconciliation inside one bar, where no other surface could reach it. These numbers are that\r\n * reconciliation, unchanged to the pixel, now reachable.\r\n *\r\n * Colours are applied INLINE from `useUi().theme` at render — nothing here carries a colour\r\n * literal, so a control re-themes per tenant without a stylesheet change.\r\n */\r\nimport { StyleSheet } from 'react-native';\r\n\r\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\r\nimport { Z_INDEX } from '@dloizides/design-tokens';\r\n\r\nconst FIELD_GAP = 4;\r\nconst LABEL_FONT = 11;\r\nconst LABEL_LETTER_SPACING = 0.4;\r\nconst INPUT_RADIUS = 8;\r\nconst INPUT_PAD_H = 12;\r\nconst INPUT_PAD_V = 10;\r\nconst INPUT_FONT = 14;\r\nconst INPUT_BORDER = 1;\r\nconst DATE_ROW_GAP = 8;\r\nconst CHEVRON_FONT = 10;\r\nconst MENU_TOP_GAP = 4;\r\nconst MENU_RADIUS = 8;\r\nconst MENU_PAD_V = 4;\r\nconst MENU_OPT_PAD_H = 12;\r\nconst MENU_OPT_PAD_V = 8;\r\nexport const MENU_MIN_WIDTH = 160;\r\nexport const MENU_MAX_HEIGHT = 260;\r\nconst MENU_ELEVATION = 8;\r\nconst MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\r\nconst OPTION_FONT = 14;\r\nconst ERROR_FONT = 12;\r\nconst ERROR_GAP = 3;\r\n\r\nexport const controlStyles = StyleSheet.create({\r\n /**\r\n * The shared bordered box every dense text control renders in.\r\n *\r\n * `minHeight` is the kit floor: padding alone produced a ~38px box, and a bare input with no\r\n * box style at all measured **19px** in production. Height is a hit-target guarantee, so it\r\n * is stated rather than left to emerge from font size + padding.\r\n */\r\n input: {\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: INPUT_RADIUS,\r\n paddingHorizontal: INPUT_PAD_H,\r\n paddingVertical: INPUT_PAD_V,\r\n fontSize: INPUT_FONT,\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n },\r\n /** The select trigger: a bordered field box matching the text inputs + a chevron. */\r\n selectTrigger: {\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: DATE_ROW_GAP,\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: INPUT_RADIUS,\r\n paddingHorizontal: INPUT_PAD_H,\r\n paddingVertical: INPUT_PAD_V,\r\n },\r\n selectTriggerText: { fontSize: INPUT_FONT, flexShrink: 1 },\r\n chevron: { fontSize: CHEVRON_FONT },\r\n dateRow: { flexDirection: 'row', gap: DATE_ROW_GAP },\r\n dateCol: { gap: FIELD_GAP, flex: 1 },\r\n /**\r\n * The micro-caption above a sub-control (a date range's From/To) and beside a switch. Note it\r\n * is deliberately NOT the `control` label voice: it carries no `700`/uppercase, because it\r\n * names a HALF of a control that already has a `control`-voice label above it. Uppercasing it\r\n * too would make one field shout twice.\r\n */\r\n subLabel: { fontSize: LABEL_FONT, letterSpacing: LABEL_LETTER_SPACING },\r\n /** Positioning context for a floating `AnchoredMenu` (`position:absolute; top:100%`). */\r\n anchor: { position: 'relative' },\r\n menu: {\r\n position: 'absolute',\r\n top: '100%',\r\n left: 0,\r\n marginTop: MENU_TOP_GAP,\r\n minWidth: MENU_MIN_WIDTH,\r\n maxHeight: MENU_MAX_HEIGHT,\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: MENU_RADIUS,\r\n paddingVertical: MENU_PAD_V,\r\n zIndex: Z_INDEX.dropdown,\r\n boxShadow: MENU_BOX_SHADOW,\r\n elevation: MENU_ELEVATION,\r\n overflow: 'hidden',\r\n },\r\n /** A menu option is a tap target, so it carries the kit floor (SHOWCASE-1). */\r\n option: {\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n justifyContent: 'center',\r\n paddingHorizontal: MENU_OPT_PAD_H,\r\n paddingVertical: MENU_OPT_PAD_V,\r\n },\r\n optionText: { fontSize: OPTION_FONT },\r\n error: { fontSize: ERROR_FONT, marginTop: ERROR_GAP },\r\n});\r\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { controlStyles as s } from '../../controls/controlStyles';\nimport type { ControlOption } from '../../controls/controlTypes';\n\nconst ACTIVE_WEIGHT = '700' as const;\nconst IDLE_WEIGHT = '400' as const;\nconst DETAIL_FONT = 12;\nconst DETAIL_GAP = 12;\nconst STACK_GAP = 2;\nconst DETAIL_BESIDE_MIN_MENU_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n beside: { alignItems: 'baseline', flexDirection: 'row', gap: DETAIL_GAP, justifyContent: 'space-between' },\n stacked: { gap: STACK_GAP },\n shrink: { flexShrink: 1 },\n detail: { flexShrink: 1, fontSize: DETAIL_FONT },\n});\n\nexport interface OptionRowColors {\n text: string;\n textSecondary?: string;\n border: string;\n surface: string;\n brand: string;\n}\n\nexport interface OptionRowProps {\n option: ControlOption;\n isActive: boolean;\n isHighlighted: boolean;\n isListboxRow: boolean;\n menuWidth: number;\n hint: string;\n colors: OptionRowColors;\n testID: string;\n onSelect: (value: string) => void;\n}\n\n/** The DOM id `aria-activedescendant` points at; whitespace is replaced to keep it one token. */\nexport function optionDomId(testID: string, value: string): string {\n return `${testID}-option-${value}`.replace(/\\s+/g, '_');\n}\n\n/** The DOM id `aria-controls` points at. */\nexport function listboxDomId(testID: string): string {\n return `${testID}-listbox`;\n}\n\n/** Whether a row has the width to show its detail beside the title instead of under it. */\nexport function isDetailBesideTitle(menuWidth: number): boolean {\n return menuWidth >= DETAIL_BESIDE_MIN_MENU_WIDTH;\n}\n\nfunction rowInk(colors: OptionRowColors, isActive: boolean, isHighlighted: boolean): { title: string; detail: string } {\n if (isHighlighted) return { title: colors.surface, detail: colors.surface };\n return { title: isActive ? colors.brand : colors.text, detail: colors.textSecondary ?? colors.text };\n}\n\nexport function OptionRow({ option, isActive, isHighlighted, isListboxRow, menuWidth, hint, colors, testID, onSelect }: OptionRowProps): React.ReactElement {\n const hasDetail = option.detail !== undefined && option.detail !== '';\n const label = hasDetail ? `${option.label}, ${option.detail}` : option.label;\n const roleProps = isListboxRow\n ? { role: 'option' as const, tabIndex: -1 as const, id: optionDomId(testID, option.value), 'aria-selected': isHighlighted }\n : { accessibilityRole: 'menuitem' as const, 'aria-selected': isActive };\n const isBold = isActive || isHighlighted;\n const ink = rowInk(colors, isActive, isHighlighted);\n\n return (\n <Pressable\n {...roleProps}\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ selected: isActive }}\n onPress={() => onSelect(option.value)}\n style={[s.option, isHighlighted ? { backgroundColor: colors.text } : null]}\n testID={`${testID}-option-${option.value}`}\n >\n <View style={isDetailBesideTitle(menuWidth) ? styles.beside : styles.stacked}>\n <Text style={[s.optionText, styles.shrink, { color: ink.title, fontWeight: isBold ? ACTIVE_WEIGHT : IDLE_WEIGHT }]}>\n {option.label}\n </Text>\n {hasDetail ? <Text style={[styles.detail, { color: ink.detail }]}>{option.detail}</Text> : null}\n </View>\n </Pressable>\n );\n}\n","/**\r\n * menuPortal — web-only stacking/positioning geometry for {@link AnchoredMenu}.\r\n *\r\n * WHY THIS EXISTS (the bug it fixes): react-native-web renders EVERY `View` with\r\n * `position: relative; z-index: 0`, so every View is its own stacking context. An in-tree\r\n * `position:absolute` popover therefore has its `zIndex` trapped inside its anchor's (and the\r\n * app's field-wrapper's) `z-index: 0` context — it can never rise above later-painting sibling\r\n * Views (the adjacent filter fields, the PEP-class guide, the results table/card). That is why the\r\n * Country typeahead menu painted UNDERNEATH the content below it (\"hidden below\").\r\n *\r\n * THE FIX: on web the menu is rendered in a PORTAL to `document.body` with `position: fixed` at the\r\n * trigger's measured viewport rect and a high `zIndex`. A portal escapes every ancestor stacking\r\n * context AND every ancestor `overflow: hidden`, so the menu always paints on top and is never\r\n * clipped. {@link useAnchorRect} keeps the fixed coordinate glued to the trigger as the page\r\n * scrolls / resizes / reflows. On native the menu stays in-tree (`position:absolute` + `elevation`).\r\n *\r\n * DUPLICATION NOTE: `@dloizides/ui-layout`'s `ModalDropdown`/`InlineMenu` and `@dloizides/ui-tables`'\r\n * `SizeDropdown` already carry the same portal mechanism. It is NOT shared from there because\r\n * `ui-forms` is the LOWEST-level UI primitive and must not depend on those higher packages (that\r\n * would invert the dependency graph). The proper DRY home is `ui-forms` itself; unifying the three\r\n * copies onto this one (ui-layout/ui-tables importing it from here) is a tracked follow-up, kept out\r\n * of this change so the proven ModalDropdown is not disturbed while fixing the typeahead.\r\n */\r\nimport { useLayoutEffect, useState } from 'react';\r\nimport type { RefObject } from 'react';\r\n\r\nimport { Platform, type ViewStyle } from 'react-native';\r\nimport type { View as RNView } from 'react-native';\r\n\r\nimport { Z_INDEX } from '@dloizides/design-tokens';\r\n\r\nimport { MENU_MAX_HEIGHT, MENU_MIN_WIDTH } from '../controls/controlStyles';\r\n\r\nconst IS_WEB = Platform.OS === 'web';\r\n\r\n/**\r\n * z-index for the open popover: the shared `popover` layer, above RN-web's body-level `Modal`\r\n * (9999) so a menu opened inside a dialog paints and clicks on top of it, and below toasts.\r\n */\r\nexport const MENU_PORTAL_Z_INDEX = Z_INDEX.popover;\r\n/** Gap between the trigger's bottom edge and the popover's top edge. */\r\nconst MENU_TOP_GAP = 4;\r\nconst MENU_MIN_HEIGHT = 96;\r\nconst VIEWPORT_MARGIN = 8;\r\n\r\n/** The trigger's viewport-space rect (from `getBoundingClientRect`) needed to place a fixed menu. */\r\nexport interface AnchorRect {\r\n top: number;\r\n left: number;\r\n width: number;\r\n bottom: number;\r\n}\r\n\r\n/** The RN-web `View` ref is an `HTMLElement` at runtime; native refs are not. */\r\nfunction toDomNode(ref: RefObject<RNView | null>): HTMLElement | null {\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\r\n const node = ref.current as unknown as HTMLElement | null;\r\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\r\n return node;\r\n}\r\n\r\n/** Read the anchor's viewport rect (web only). Returns null when unavailable (native / no node). */\r\nexport function readAnchorRect(ref: RefObject<RNView | null>): AnchorRect | null {\r\n if (!IS_WEB) return null;\r\n const node = toDomNode(ref);\r\n if (node === null) return null;\r\n const r = node.getBoundingClientRect();\r\n return { top: r.top, left: r.left, width: r.width, bottom: r.bottom };\r\n}\r\n\r\n/**\r\n * Web portal popover style: `position: fixed` at the trigger rect with a high `zIndex`. Portalled to\r\n * `document.body`, so `fixed` positions it against the viewport and it tracks the trigger via the\r\n * measured rect (recomputed on scroll/resize/reflow) — clipped by nothing, above everything.\r\n */\r\nexport function buildPortalPopoverStyle(rect: AnchorRect, viewportBottom?: number, viewportWidth?: number): ViewStyle {\r\n return {\r\n ...(viewportBottom !== undefined ? { maxHeight: menuMaxHeight(rect.bottom, viewportBottom) } : null),\r\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\r\n position: 'fixed' as unknown as ViewStyle['position'],\r\n top: rect.bottom + MENU_TOP_GAP,\r\n ...horizontalPlacement(rect, viewportWidth),\r\n zIndex: MENU_PORTAL_Z_INDEX,\r\n };\r\n}\r\n\r\nfunction horizontalPlacement(rect: AnchorRect, viewportWidth: number | undefined): { left: number; width: number } {\r\n if (viewportWidth === undefined) return { left: rect.left, width: rect.width };\r\n const width = Math.min(Math.max(rect.width, MENU_MIN_WIDTH), viewportWidth - 2 * VIEWPORT_MARGIN);\r\n const left = Math.max(VIEWPORT_MARGIN, Math.min(rect.left, viewportWidth - VIEWPORT_MARGIN - width));\r\n return { left, width };\r\n}\r\n\r\n/**\r\n * Track the anchor's viewport rect while `enabled`. Measures on enable, then re-measures on scroll\r\n * (capture phase, so a scroll inside ANY ancestor scroll container counts — element `scroll` events\r\n * do not bubble) + window resize + any layout reflow that moves the trigger without scrolling (an\r\n * accordion above it expanding, an async list rendering, a font swapping — caught by a\r\n * `ResizeObserver` on the anchor and `document.body`). Work is coalesced into one\r\n * `requestAnimationFrame` per frame so a momentum scroll cannot thrash layout. No-op on native\r\n * (returns null), where the in-tree absolute popover moves with its anchor automatically.\r\n */\r\nexport function useAnchorRect(ref: RefObject<RNView | null>, enabled: boolean): AnchorRect | null {\r\n const [rect, setRect] = useState<AnchorRect | null>(null);\r\n\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) {\r\n setRect(null);\r\n return undefined;\r\n }\r\n let frame: number | null = null;\r\n let disposed = false;\r\n\r\n const apply = (): void => {\r\n frame = null;\r\n if (disposed) return;\r\n setRect(readAnchorRect(ref));\r\n };\r\n const schedule = (): void => {\r\n if (frame !== null) return;\r\n frame = window.requestAnimationFrame(apply);\r\n };\r\n\r\n apply();\r\n document.addEventListener('scroll', schedule, true);\r\n window.addEventListener('resize', schedule);\r\n const node = toDomNode(ref);\r\n const observer = typeof ResizeObserver === 'function' ? new ResizeObserver(schedule) : null;\r\n if (observer !== null) {\r\n if (node !== null) observer.observe(node);\r\n observer.observe(document.body);\r\n }\r\n\r\n return () => {\r\n disposed = true;\r\n if (frame !== null) window.cancelAnimationFrame(frame);\r\n document.removeEventListener('scroll', schedule, true);\r\n window.removeEventListener('resize', schedule);\r\n if (observer !== null) observer.disconnect();\r\n };\r\n }, [ref, enabled]);\r\n\r\n return IS_WEB && enabled ? rect : null;\r\n}\r\n\r\nfunction roomUnderAnchor(anchorBottom: number, viewportBottom: number): number {\r\n return viewportBottom - anchorBottom - MENU_TOP_GAP - VIEWPORT_MARGIN;\r\n}\r\n\r\nexport function menuMaxHeight(anchorBottom: number, viewportBottom: number): number {\r\n return Math.min(MENU_MAX_HEIGHT, Math.max(MENU_MIN_HEIGHT, roomUnderAnchor(anchorBottom, viewportBottom)));\r\n}\r\n\r\n/** Where to scroll the field: to the top only when the full list does not fit under it. */\r\nexport function anchorScrollBlock(anchorBottom: number, viewportBottom: number): ScrollLogicalPosition {\r\n return roomUnderAnchor(anchorBottom, viewportBottom) < MENU_MAX_HEIGHT ? 'start' : 'nearest';\r\n}\r\n\r\nfunction readViewportBottom(): number {\r\n const viewport = window.visualViewport ?? null;\r\n return viewport === null ? window.innerHeight : viewport.offsetTop + viewport.height;\r\n}\r\n\r\nexport function useVisualViewportBottom(enabled: boolean): number | null {\r\n const [bottom, setBottom] = useState<number | null>(null);\r\n\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) {\r\n setBottom(null);\r\n return undefined;\r\n }\r\n const update = (): void => setBottom(readViewportBottom());\r\n update();\r\n const viewport = window.visualViewport ?? null;\r\n viewport?.addEventListener('resize', update);\r\n viewport?.addEventListener('scroll', update);\r\n window.addEventListener('resize', update);\r\n return () => {\r\n viewport?.removeEventListener('resize', update);\r\n viewport?.removeEventListener('scroll', update);\r\n window.removeEventListener('resize', update);\r\n };\r\n }, [enabled]);\r\n\r\n return bottom;\r\n}\r\n\r\nexport function scrollNodeIntoView(node: HTMLElement | null, block: ScrollLogicalPosition): void {\r\n if (node !== null && typeof node.scrollIntoView === 'function') node.scrollIntoView({ block });\r\n}\r\n\r\nexport function scrollAnchorIntoView(ref: RefObject<RNView | null>, marginTop: number): void {\r\n if (!IS_WEB) return;\r\n const node = toDomNode(ref);\r\n if (node === null) return;\r\n node.style.scrollMarginTop = `${marginTop}px`;\r\n scrollNodeIntoView(node, anchorScrollBlock(node.getBoundingClientRect().bottom, readViewportBottom()));\r\n}\r\n\r\n/** While enabled, keeps room for the list under the field, also when a keyboard shrinks the viewport. */\r\nexport function useKeepAnchorInRoom(ref: RefObject<RNView | null>, marginTop: number, enabled: boolean): void {\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) return undefined;\r\n const place = (): void => scrollAnchorIntoView(ref, marginTop);\r\n place();\r\n const viewport = window.visualViewport ?? null;\r\n viewport?.addEventListener('resize', place);\r\n return () => viewport?.removeEventListener('resize', place);\r\n }, [ref, marginTop, enabled]);\r\n}\r\n","/**\n * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.\n *\n * By DEFAULT (web) it renders in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured rect: that escapes react-native-web's trapped `z-index: 0` stacking contexts and any\n * ancestor `overflow: hidden`, so the menu is never painted under / clipped by later siblings (a\n * table, a card, the next filter field). On native, and when {@link AnchoredMenuProps.usePortal} is\n * explicitly `false`, it renders an in-tree, absolutely-positioned popover under its anchor\n * (`position:absolute; top:100%; zIndex; elevation`) — which is exactly what left `SelectControl`'s\n * menu hidden behind the attendee table until the default flipped. See {@link menuPortal}.\n * On web it dismisses on outside-click / Escape; on native the caller closes it on blur/select.\n * Purely presentational + theme-flat, so it stays reusable.\n *\n * Promoted verbatim out of `@dloizides/ui-tables`' private `Filters/components/AnchoredMenu`.\n *\n * Deliberately no `ui-layout` dependency: `ui-forms` is a low-level primitive and must not take a\n * runtime dependency on the higher-level `ui-layout` `ModalDropdown` — that would invert the graph\n * for every consumer. The portal mechanism therefore lives locally in {@link menuPortal}.\n */\nimport React, { useEffect } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport { ScrollView, Text, View, useWindowDimensions } from 'react-native';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { listboxDomId, optionDomId, OptionRow } from './components/OptionRow';\nimport { buildPortalPopoverStyle, scrollNodeIntoView, useAnchorRect, useVisualViewportBottom } from './menuPortal';\n\nconst IS_WEB = typeof document !== 'undefined';\nconst ESCAPE_KEY = 'Escape';\nconst LISTBOX_ROLE: Readonly<Record<string, string>> = { role: 'listbox' };\nconst KEEP_FIELD_FOCUS = { onMouseDown: (event: { preventDefault: () => void }): void => event.preventDefault() };\n\n/** The four theme colours the menu paints with — passed in, so the menu stays theme-flat. */\nexport interface AnchoredMenuColors {\n text: string;\n textSecondary?: string;\n border: string;\n surface: string;\n brand: string;\n}\n\nexport interface AnchoredMenuListbox {\n highlightedValue?: string;\n statusText?: string;\n}\n\n/** Web: keeps the portalled menu on screen, lined up with positionRef when given, else with anchorRef. */\nexport interface AnchoredMenuPlacement {\n positionRef?: React.RefObject<View | null>;\n}\n\nexport interface AnchoredMenuProps {\n options: readonly ControlOption[];\n /** The currently-selected value, highlighted in the list ('' = none). */\n selectedValue: string;\n onSelect: (value: string) => void;\n onDismiss: () => void;\n colors: AnchoredMenuColors;\n /** PRE-LOCALIZED accessibility hint applied to every option. */\n optionHint: string;\n /**\n * PRE-LOCALIZED accessible NAME for the menu container itself (e.g. \"Recent values\"). Optional and\n * additive — omitted, the menu keeps only its `role=\"menu\"` as before, so existing callers are\n * unaffected. Supplied, a screen reader announces the list's purpose, not just \"menu\".\n */\n accessibilityLabel?: string;\n /** Base testID: the menu is `${testID}-menu`, each option `${testID}-option-${value}`. */\n testID: string;\n /** Node whose clicks count as \"inside\" (the anchor) so its own press doesn't self-dismiss. */\n anchorRef: React.RefObject<View | null>;\n /**\n * On web, render the popover in a portal to `document.body` with `position: fixed` at the anchor's\n * measured rect, so it escapes react-native-web's trapped stacking contexts and any ancestor\n * `overflow: hidden` (the fix for a menu that paints under / is clipped by the content below it).\n * No effect on native (the `IS_WEB` guard keeps native in-tree regardless).\n *\n * Default `true` — portalling is the CORRECT default: an in-tree popover is always at risk of\n * being painted under a later-painting sibling (a table, a card, the next filter field). The old\n * default was `false`, which silently left `SelectControl`'s menu hidden behind the attendee table\n * (a recurrence of the exact bug this mechanism fixed for `TypeaheadControl`). Pass `usePortal={false}`\n * only for the rare case that genuinely wants the menu clipped to its container.\n */\n usePortal?: boolean;\n listbox?: AnchoredMenuListbox;\n placement?: AnchoredMenuPlacement;\n}\n\n/** Web-only outside-click + Escape dismissal (no-op on native). */\nfunction useDismiss(\n anchorRef: React.RefObject<View | null>,\n menuRef: React.RefObject<View | null>,\n onDismiss: () => void,\n): void {\n useEffect(() => {\n if (!IS_WEB) return undefined;\n const onMouseDown = (event: MouseEvent): void => {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const anchorNode = anchorRef.current as unknown as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const menuNode = menuRef.current as unknown as HTMLElement | null;\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = anchorNode !== null && target !== null && anchorNode.contains(target);\n const insideMenu = menuNode !== null && target !== null && menuNode.contains(target);\n if (!insideAnchor && !insideMenu) onDismiss();\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === ESCAPE_KEY) onDismiss();\n };\n document.addEventListener('mousedown', onMouseDown);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [anchorRef, menuRef, onDismiss]);\n}\n\nfunction useKeepHighlightInView(testID: string, highlightedValue: string | undefined): void {\n useEffect(() => {\n if (!IS_WEB || highlightedValue === undefined || highlightedValue === '') return;\n scrollNodeIntoView(document.getElementById(optionDomId(testID, highlightedValue)), 'nearest');\n }, [testID, highlightedValue]);\n}\n\nexport function AnchoredMenu({\n options,\n selectedValue,\n onSelect,\n onDismiss,\n colors,\n optionHint,\n accessibilityLabel,\n testID,\n anchorRef,\n usePortal = true,\n listbox,\n placement,\n}: AnchoredMenuProps): React.ReactElement {\n const menuRef = React.useRef<View>(null);\n useDismiss(anchorRef, menuRef, onDismiss);\n useKeepHighlightInView(testID, listbox?.highlightedValue);\n // Web + usePortal: track the anchor rect so the fixed, portalled menu stays glued to the trigger.\n const rect = useAnchorRect(placement?.positionRef ?? anchorRef, usePortal);\n const viewportBottom = useVisualViewportBottom(usePortal);\n const { width: windowWidth } = useWindowDimensions();\n const portalStyle = rect !== null ? buildPortalPopoverStyle(rect, viewportBottom ?? undefined, placement !== undefined ? windowWidth : undefined) : null;\n const menuWidth = rect?.width ?? windowWidth;\n const isListbox = listbox !== undefined;\n const statusText = listbox?.statusText;\n const rows = options.map((option) => (\n <OptionRow\n key={option.value}\n colors={colors}\n hint={optionHint}\n isActive={option.value === selectedValue}\n isHighlighted={option.value === listbox?.highlightedValue}\n isListboxRow={isListbox}\n menuWidth={menuWidth}\n option={option}\n testID={testID}\n onSelect={onSelect}\n />\n ));\n const listboxBody = options.length > 0 ? (\n <View accessibilityLabel={accessibilityLabel} id={listboxDomId(testID)} {...LISTBOX_ROLE} testID={listboxDomId(testID)}>\n {rows}\n </View>\n ) : null;\n\n const menu = (\n <View\n {...(isListbox ? KEEP_FIELD_FOCUS : null)}\n ref={menuRef}\n accessibilityLabel={isListbox ? undefined : accessibilityLabel}\n accessibilityRole={isListbox ? undefined : 'menu'}\n // `portalStyle` (position:fixed at the measured rect) is appended LAST so it wins over\n // s.menu's default `position:absolute; top:100%` when portalling; null (native / no portal)\n // leaves the in-tree anchored style untouched.\n style={[s.menu, { borderColor: colors.border, backgroundColor: colors.surface }, portalStyle]}\n testID={`${testID}-menu`}\n >\n {isListbox ? (\n <Text role=\"status\" style={statusText !== undefined ? [s.option, s.optionText, { color: colors.text }] : undefined}>{statusText ?? ''}</Text>\n ) : null}\n {/* Scroll the options when they exceed the menu's maxHeight (s.menu). Without this the list was\n clipped by `overflow: hidden` with no way to reach the options below the fold. */}\n <ScrollView keyboardShouldPersistTaps=\"handled\" nestedScrollEnabled>\n {isListbox ? listboxBody : rows}\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 (usePortal && IS_WEB) return createPortal(menu, document.body);\n return menu;\n}\n\nexport default AnchoredMenu;\n","/**\n * `useThemedInput` — the shared \"readable + lively\" text-input treatment, driven entirely by\n * the active `@dloizides/ui-feedback` theme (so it re-themes per tenant, no hard-coded hex).\n *\n * At rest: dark readable text on a subtle off-white surface with a soft border.\n * On hover (web): the border strengthens a touch.\n * On focus: the border becomes the brand primary, the background brightens to the plain surface\n * (white), and a soft 3px brand-tinted focus ring fades in.\n *\n * Kept FAST: the animation is a pure GPU-cheap CSS transition on `border-color`,\n * `background-color` and `box-shadow` (the focus ring is a `box-shadow`, so it never triggers\n * layout/reflow). There is NO `Animated`, `LayoutAnimation` or JS timer — only React state\n * toggled by focus/blur/hover. Web-only style keys (`transition*`, `boxShadow`, `outlineStyle`)\n * and the mouse-hover handlers are guarded behind `Platform.OS === 'web'`, so the hook stays\n * native-safe (native simply applies the state-driven colours instantly).\n */\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { Platform, type TextInputProps, type TextStyle } from 'react-native';\n\nimport { focusRingOutline } from '@dloizides/design-tokens';\nimport { themeFocusRingColor } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\n/** The exact focus/blur event types of the installed `react-native` `TextInput` (version-safe). */\ntype FocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];\ntype BlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];\n\nconst IS_WEB = Platform.OS === 'web';\n\nconst TRANSITION_PROPERTY = 'border-color, background-color, box-shadow';\nconst TRANSITION_DURATION = '0.14s';\nconst TRANSITION_TIMING = 'ease';\nconst NO_RING = { outlineWidth: 0 };\nconst HOVER_BORDER_ALPHA = 0.22;\nconst HEX_RADIX = 16;\nconst HEX_SHORT_LENGTH = 4;\nconst HEX_FULL_LENGTH = 7;\nconst RED_START = 1;\nconst GREEN_START = 3;\nconst BLUE_START = 5;\nconst CHANNEL_END_OFFSET = 2;\n\n/**\n * Convert an `#rgb` / `#rrggbb` colour to an `rgba(...)` string at the given alpha. Any other\n * colour form (already `rgba()`, a CSS name, …) is returned unchanged — so the caller degrades\n * gracefully rather than emitting an invalid value.\n */\n/**\n * True when the user asked the OS to reduce motion (web only). Read at render so the\n * focus/hover transition collapses to an instant change for those users (WCAG 2.3.3 / the\n * `prefers-reduced-motion: reduce` contract). Safe under SSR / no `matchMedia`.\n */\nfunction prefersReducedMotion(): boolean {\n if (!IS_WEB || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nfunction withAlpha(color: string, alpha: number): string {\n const hex = color.trim();\n const isHex = hex.charAt(0) === '#' && (hex.length === HEX_FULL_LENGTH || hex.length === HEX_SHORT_LENGTH);\n if (!isHex) return color;\n const full =\n hex.length === HEX_SHORT_LENGTH\n ? `#${hex.charAt(1)}${hex.charAt(1)}${hex.charAt(2)}${hex.charAt(2)}${hex.charAt(3)}${hex.charAt(3)}`\n : hex;\n const r = parseInt(full.slice(RED_START, RED_START + CHANNEL_END_OFFSET), HEX_RADIX);\n const g = parseInt(full.slice(GREEN_START, GREEN_START + CHANNEL_END_OFFSET), HEX_RADIX);\n const b = parseInt(full.slice(BLUE_START, BLUE_START + CHANNEL_END_OFFSET), HEX_RADIX);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n\nexport interface UseThemedInputOptions {\n /** Render with the error border colour (the brand focus border is suppressed while errored). */\n hasError?: boolean;\n /** Consumer focus handler — composed with the internal focus-state toggle. */\n onFocus?: (e: FocusEvent) => void;\n /** Consumer blur handler — composed with the internal focus-state toggle. */\n onBlur?: (e: BlurEvent) => void;\n /** `false` renders the read-only treatment: flat surface fill, no input outline, secondary ink. */\n editable?: boolean;\n}\n\nexport interface ThemedInput {\n /** The themed input style for the current focus/hover state (memoised). Merge AFTER your box style. */\n style: TextStyle;\n /**\n * The placeholder colour: the theme's `textSecondary` composited toward the field\n * background ({@link PLACEHOLDER_ALPHA}) so a placeholder reads as a faint hint, clearly\n * lighter than the solid entered text rather than looking like an already-filled value.\n */\n placeholderTextColor: string;\n isFocused: boolean;\n isHovered: boolean;\n /** Spread/attach onto the `<TextInput>` to drive the focus treatment. */\n focusBind: {\n onFocus: (e: FocusEvent) => void;\n onBlur: (e: BlurEvent) => void;\n };\n /** Web-only mouse-hover handlers, pre-typed for `<TextInput>` (an empty object on native). */\n hoverBind: TextInputProps;\n}\n\nexport function useThemedInput(options: UseThemedInputOptions = {}): ThemedInput {\n const { hasError = false, onFocus, onBlur, editable = true } = options;\n const { theme } = useUi();\n const { colors, palette } = theme;\n\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const handleFocus = useCallback(\n (e: FocusEvent) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n const handleBlur = useCallback(\n (e: BlurEvent) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n const handleHoverIn = useCallback(() => setIsHovered(true), []);\n const handleHoverOut = useCallback(() => setIsHovered(false), []);\n\n const primary = palette.primary['500'];\n const errorColor = fieldErrorInk(theme);\n\n const style = useMemo<TextStyle>(() => {\n const restBorder = hasError ? errorColor : colors.border;\n const focusBorder = hasError ? errorColor : primary;\n const editableBorder = isFocused ? focusBorder : isHovered ? withAlpha(colors.text, HOVER_BORDER_ALPHA) : restBorder;\n const borderColor = editable ? editableBorder : restBorder;\n const editableFill = isFocused ? colors.surface : colors.surfaceElevated;\n const backgroundColor = editable ? editableFill : colors.surface;\n const base: TextStyle = { color: editable ? colors.text : colors.textSecondary, borderColor, backgroundColor };\n if (!IS_WEB) return base;\n // A focused field ALWAYS gets a ring — an errored one just changes its colour to the error\n // tint (v1: `input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-tint) }`). Suppressing\n // the ring while errored, as this did, removed the focus indicator (WCAG 2.4.7) from precisely\n // the field the user was sent back to fix, at the moment they are most likely on a keyboard.\n const ringColor = hasError ? errorColor : themeFocusRingColor(theme);\n const ring = isFocused ? focusRingOutline(ringColor) : NO_RING;\n const webStyle = {\n transitionProperty: TRANSITION_PROPERTY,\n // Collapse the eased transition to instant when the user prefers reduced motion.\n transitionDuration: prefersReducedMotion() ? '0s' : TRANSITION_DURATION,\n transitionTimingFunction: TRANSITION_TIMING,\n ...ring,\n };\n return { ...base, ...webStyle } as TextStyle;\n }, [\n isFocused,\n isHovered,\n hasError,\n colors.text,\n colors.border,\n colors.surface,\n colors.surfaceElevated,\n colors.textSecondary,\n editable,\n primary,\n errorColor,\n theme,\n ]);\n\n const focusBind = useMemo(() => ({ onFocus: handleFocus, onBlur: handleBlur }), [handleFocus, handleBlur]);\n\n const hoverBind = useMemo<TextInputProps>(\n () =>\n IS_WEB ? ({ onMouseEnter: handleHoverIn, onMouseLeave: handleHoverOut } as unknown as TextInputProps) : {},\n [handleHoverIn, handleHoverOut],\n );\n\n return {\n style,\n placeholderTextColor: colors.textSecondary,\n isFocused,\n isHovered,\n focusBind,\n hoverBind,\n };\n}\n","/**\n * Validation ARIA for a form control — web only, no-op on native.\n *\n * ## Why this is here and NOT in `@dloizides/a11y`\n *\n * This looks exactly like adapter work, and moving it into the shared accessibility package\n * is the obvious next step. It would be a mistake, and the reason is worth spelling out\n * because the next person to read this will have the same instinct.\n *\n * `@dloizides/a11y` states its own invariant in `types.ts`: `A11yState` models\n * \"only the members with a faithful expression on BOTH platforms ... so a contract can never\n * promise something one platform silently drops (the exact bug class this package exists to\n * close)\". `invalid` and `required` have NO faithful React Native expression — RN's\n * `AccessibilityState` has no `invalid`, and `accessibilityRequired` does not exist. Adding\n * them to `A11yState` would make the adapter accept a contract it can only honour on web and\n * must silently discard on native. That is precisely the failure the package was built to\n * prevent, reintroduced through its own front door.\n *\n * So the seam stays here, in the package that owns form semantics, where \"web-only\" is an\n * honest local statement rather than a promise broken at a platform boundary. Consequently\n * `@dloizides/a11y` needs no version bump for this change.\n *\n * ## Why it exists at all\n *\n * The identical branch was written twice — `ThemedTextInput` and `ChipSelector` — the second\n * even documenting itself as \"the same escape-hatch-free pattern `ThemedTextInput` uses\". Two\n * copies of one rule is two places for it to drift.\n */\nimport { Platform } from 'react-native';\n\n/**\n * Web-only ARIA attributes react-native-web forwards to the underlying DOM element but that\n * RN's prop types do not enumerate. Callers cast through their own host props at the spread\n * site (never `any`), so these semantics reach a screen reader without a type escape hatch.\n */\nexport interface WebFieldA11y {\n 'aria-invalid'?: boolean;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n}\n\nexport interface WebFieldA11yInput {\n /** id of the element describing this control — typically `Field`'s error/hint line. */\n describedById?: string;\n /** Announce the control as failing validation. */\n hasError?: boolean;\n /**\n * Mark the control mandatory. Omit for controls that have no required affordance; an\n * omitted value emits nothing rather than `aria-required=\"false\"`, which would tell a\n * screen reader something different from saying nothing at all.\n */\n required?: boolean;\n}\n\nconst IS_WEB = Platform.OS === 'web';\n\n/**\n * Build the validation ARIA for a form control.\n *\n * Returns an EMPTY object on native — deliberately, and not as an oversight: there is no\n * native equivalent to emit, and inventing one would mean claiming a guarantee the platform\n * cannot keep. Every attribute is `undefined` unless genuinely true, so nothing is emitted\n * that a screen reader would have to interpret as an explicit negative.\n */\nexport function webFieldA11y({ describedById, hasError = false, required = false }: WebFieldA11yInput): WebFieldA11y {\n if (!IS_WEB) {\n return {};\n }\n return {\n 'aria-invalid': hasError ? true : undefined,\n 'aria-describedby': describedById,\n 'aria-required': required ? true : undefined,\n };\n}\n","/**\n * `ThemedTextInput` — the shared, readable + lively text-input primitive. A thin `<TextInput>`\n * wrapper that applies the `useThemedInput` treatment (dark readable text, subtle off-white rest\n * background, and the brand focus animation: indigo border + white background + soft 3px ring,\n * eased over .14s via a GPU-cheap CSS transition on web; instant, native-safe off web).\n *\n * It is the ONE source of truth for the input look: `FormField` renders it, and raw filter inputs\n * (search / country / year / date fallbacks) use it directly instead of forking the styles.\n *\n * ## The box metrics are applied HERE, and that is new\n *\n * This component claimed to be the source of truth for the input look while shipping only\n * COLOURS — no border, no radius, no padding, no height. `FormField` happened to pass its own\n * private copy of those metrics, so every input reached through `FormField` looked right and the\n * gap stayed invisible. Any caller that used `ThemedTextInput` directly — the documented, blessed\n * way to use it — got a raw browser input: **19px tall**, measured in production on an admin CMS\n * where all 10 inputs failed the hit-target floor.\n *\n * So `controlStyles.input` is now the component's own base, ahead of the caller's `style` in the\n * cascade. Callers that already passed the same metrics (`FormField`) are unaffected — the values\n * are identical, which is precisely why the duplication was invisible — and callers that pass\n * their own overrides still win, because their `style` merges after the base.\n *\n * Every existing `TextInputProps` (value, placeholder, onChangeText, testID, accessibility…) is\n * forwarded untouched; `onFocus`/`onBlur` you pass are composed with the internal focus state.\n */\nimport React from 'react';\n\nimport { StyleSheet, TextInput, type TextInputProps } from 'react-native';\n\nimport { controlStyles } from '../controls/controlStyles';\nimport { useThemedInput } from '../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\n/**\n * A multi-line box has to be tall enough to show that it IS multi-line. Left at the single-line\n * floor a textarea looks exactly like a text field, and an author writing a paragraph gets one\n * visible line. Two lines of content plus the box's own padding.\n */\nconst MULTILINE_MIN_HEIGHT = 96;\n\nconst boxStyles = StyleSheet.create({\n multiline: {\n minHeight: MULTILINE_MIN_HEIGHT,\n textAlignVertical: 'top',\n },\n});\n\nexport interface ThemedTextInputProps extends TextInputProps {\n /** Render with the error border colour (matches `FormField`'s error treatment). */\n hasError?: boolean;\n /**\n * id of an element describing this input (e.g. an error/hint line). Linked via\n * `aria-describedby` on web so a screen reader reads it after the field's name. No-op native.\n */\n describedById?: string;\n /** Marks the field required for assistive tech (`aria-required` on web). No-op on native. */\n requiredField?: boolean;\n /**\n * Opt OUT of the shared box metrics (border, radius, padding, the kit's min-height floor) and\n * render colours only — the pre-1.11 behaviour.\n *\n * For the rare control that supplies its own complete box, e.g. an input embedded inside an\n * already-bordered composite where a second border would double up. It is a prop rather than\n * the default because the default has to be the accessible one: the previous default shipped\n * 19px inputs to production precisely because \"no metrics\" was the silent fallback.\n */\n unstyledBox?: boolean;\n}\n\nexport const ThemedTextInput = React.forwardRef<TextInput, ThemedTextInputProps>(function ThemedTextInput(\n {\n hasError = false,\n describedById,\n requiredField = false,\n unstyledBox = false,\n onFocus,\n onBlur,\n style,\n placeholderTextColor,\n ...rest\n },\n ref,\n): React.ReactElement {\n const {\n style: themedStyle,\n placeholderTextColor: themedPlaceholder,\n focusBind,\n hoverBind,\n } = useThemedInput({ hasError, onFocus, onBlur, editable: rest.editable });\n\n // aria-invalid announces the error state; aria-describedby ties the error/hint text to the\n // field; aria-required marks it mandatory. Web-only (RN-web → DOM); omitted on native.\n const webA11y = webFieldA11y({ describedById, hasError, required: requiredField });\n\n // Base box FIRST so the caller's `style` still overrides it; `themedStyle` stays last because\n // the theme's colours are not the caller's to override (unchanged from previous versions).\n const boxStyle = unstyledBox ? null : controlStyles.input;\n const multilineStyle = rest.multiline === true && !unstyledBox ? boxStyles.multiline : null;\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor ?? themedPlaceholder}\n {...rest}\n {...(webA11y as TextInputProps)}\n {...hoverBind}\n onFocus={focusBind.onFocus}\n onBlur={focusBind.onBlur}\n style={[boxStyle, multilineStyle, style, themedStyle]}\n />\n );\n});\n","/**\n * `recentValuesCore` — the pure + storage-facing internals of {@link useRecentValues}, kept out of\n * the hook file so the list algebra (trim / de-dupe / promote / cap) and the `localStorage` access\n * are each unit-testable in isolation.\n *\n * ## RN-web storage reality\n *\n * `ui-forms` runs on react-native-web, so a component using this may mount on web (where\n * `window.localStorage` exists), on native (where it does NOT), or under SSR / a hardened browser\n * where touching `window.localStorage` THROWS (disabled cookies, privacy mode, quota). Every access\n * therefore goes through {@link getStorage}, which returns `null` rather than throwing, and every\n * read/write is wrapped so a storage failure degrades to an in-memory-only no-op instead of\n * exploding inside render. On native / when storage is unavailable the feature is simply inert and\n * the recents list is always `[]`.\n */\n\n/** The single namespace every persisted list lives under, so one product can never collide with another. */\nconst STORAGE_PREFIX = '@dloizides/ui-forms:recent:';\n\n/** Default cap on remembered values (most-recent-first). */\nexport const DEFAULT_MAX_RECENTS = 10;\n\n/** The full `localStorage` key for a caller's logical `key`. */\nexport function recentStorageKey(key: string): string {\n return `${STORAGE_PREFIX}${key}`;\n}\n\n/**\n * The active web `localStorage`, or `null` on native / SSR / when merely READING the property\n * throws (some browsers throw on `window.localStorage` access when storage is disabled). Never\n * throws — callers treat `null` as \"storage unavailable, no-op\".\n */\nfunction getStorage(): Storage | null {\n try {\n if (typeof window === 'undefined') return null;\n const storage = window.localStorage;\n return storage !== null && storage !== undefined ? storage : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Read the persisted list for `key`. Returns `[]` when storage is unavailable, the key is absent,\n * the stored JSON is corrupt, or the parsed value is not an array of strings — corruption is\n * tolerated, never surfaced as a throw.\n */\nexport function readRecents(key: string): string[] {\n const storage = getStorage();\n if (storage === null) return [];\n try {\n const raw = storage.getItem(recentStorageKey(key));\n if (raw === null) return [];\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) return [];\n return parsed.filter((entry): entry is string => typeof entry === 'string');\n } catch {\n return [];\n }\n}\n\n/** Persist `values` for `key`. Silent no-op when storage is unavailable or the write throws (quota). */\nexport function writeRecents(key: string, values: readonly string[]): void {\n const storage = getStorage();\n if (storage === null) return;\n try {\n storage.setItem(recentStorageKey(key), JSON.stringify(values));\n } catch {\n // Quota exceeded / storage disabled mid-session — drop the write rather than throw into render.\n }\n}\n\n/** Remove the persisted list for `key`. Silent no-op when storage is unavailable or removal throws. */\nexport function clearRecents(key: string): void {\n const storage = getStorage();\n if (storage === null) return;\n try {\n storage.removeItem(recentStorageKey(key));\n } catch {\n // Storage disabled mid-session — nothing to do.\n }\n}\n\n/**\n * The pure list algebra: fold `value` into `current`, returning the new most-recent-first list.\n *\n * - trims `value`; an empty (or whitespace-only) value is ignored, returning `current` unchanged;\n * - de-dupes case-insensitively, so \"Cyprus\" typed after \"cyprus\" does not create a second row;\n * - PROMOTES an existing (case-insensitive) match to the front, keeping the newly-typed casing;\n * - caps the result at `max` (most-recent-first), so the list can never grow without bound.\n */\nexport function computeNextRecents(current: readonly string[], value: string, max: number): string[] {\n const trimmed = value.trim();\n if (trimmed === '') return [...current];\n const lower = trimmed.toLowerCase();\n const withoutMatch = current.filter((entry) => entry.toLowerCase() !== lower);\n const promoted = [trimmed, ...withoutMatch];\n const cap = max > 0 ? max : 0;\n return promoted.slice(0, cap);\n}\n\n/** True when two lists hold the same values in the same order (reference-stability guard for state). */\nexport function recentsEqual(a: readonly string[], b: readonly string[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((entry, index) => entry === b[index]);\n}\n","/**\n * `useRecentValues` — an opt-in \"remember the last N submitted values, show them again\" store for a\n * single logical input, persisted to `localStorage` under `@dloizides/ui-forms:recent:<key>`.\n *\n * It is the engine behind {@link FormField}'s `recentKey` prop, but is exported on its own so any\n * consumer can build a bespoke recents surface. Pure + storage-guarded (see {@link recentValuesCore}):\n * on native / SSR / disabled storage it is a silent no-op that always reports `recents: []`.\n *\n * ```ts\n * const { recents, remember, clear } = useRecentValues('invoice-search');\n * // on submit / blur: remember(text); in a menu: recents.map(...); to reset: clear();\n * ```\n */\nimport { useCallback, useEffect, useState } from 'react';\n\nimport {\n DEFAULT_MAX_RECENTS,\n clearRecents,\n computeNextRecents,\n readRecents,\n recentsEqual,\n writeRecents,\n} from './recentValuesCore';\n\nexport interface RecentValues {\n /** The remembered values, most-recent-first (never longer than `max`; `[]` when storage is unavailable). */\n recents: string[];\n /** Fold a value into the list (trim / de-dupe / promote / cap) and persist. Empty values are ignored. */\n remember: (value: string) => void;\n /** Forget every remembered value for this key and clear it from storage. */\n clear: () => void;\n}\n\n/**\n * @param key logical name for this input's history (namespaced under `@dloizides/ui-forms:recent:`).\n * @param max most-recent-first cap on remembered values. Default {@link DEFAULT_MAX_RECENTS}.\n */\nexport function useRecentValues(key: string, max: number = DEFAULT_MAX_RECENTS): RecentValues {\n // Seeded from storage on first render (lazy initialiser — no read on every render).\n const [recents, setRecents] = useState<string[]>(() => readRecents(key).slice(0, max));\n\n // Re-hydrate when the key or cap changes, so switching which input this drives shows its own history.\n useEffect(() => {\n setRecents(readRecents(key).slice(0, max));\n }, [key, max]);\n\n const remember = useCallback(\n (value: string) => {\n setRecents((current) => {\n const next = computeNextRecents(current, value, max);\n // An ignored (empty) value or an already-front value yields an identical list — keep the\n // same reference so no re-render fires and no redundant write hits storage.\n if (recentsEqual(next, current)) return current;\n writeRecents(key, next);\n return next;\n });\n },\n [key, max],\n );\n\n const clear = useCallback(() => {\n clearRecents(key);\n setRecents([]);\n }, [key]);\n\n return { recents, remember, clear };\n}\n\nexport default useRecentValues;\n","/**\n * `RecentInputField` — the `ThemedTextInput` PLUS the opt-in \"recent values\" dropdown that\n * {@link FormField} renders only when a `recentKey` is supplied. Split out of `FormField` so the\n * default (no `recentKey`) path stays a plain input with ZERO extra state, refs, effects or storage\n * access, and every consumer that never opts in pays nothing.\n *\n * On focus it surfaces the values previously submitted through this key (via {@link useRecentValues})\n * in the shared {@link AnchoredMenu} — reused rather than hand-rolled, and forced through a\n * `document.body` portal (`usePortal`) so the list is never painted behind a table / card / the next\n * field (the kit's known AnchoredMenu stacking gotcha). Picking a row fills the input (`onChangeText`)\n * and closes. A value is remembered on submit (Enter) AND on blur-with-content, so both \"hit enter\"\n * and \"typed then moved on\" are captured. Colours come only from the active theme — no literals.\n */\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { ThemedTextInput, type ThemedTextInputProps } from '../ThemedTextInput/ThemedTextInput';\nimport { useRecentValues } from '../useRecentValues/useRecentValues';\n\n/** Delay before blur closes the menu, so a tap on a recent row registers first (matches TypeaheadControl). */\nconst CLOSE_DELAY_MS = 140;\n\n// Event types taken from the input's OWN prop signatures, so they track the installed react-native\n// version exactly (focus/blur/submit event shapes have drifted between RN releases).\ntype FocusEvent = Parameters<NonNullable<ThemedTextInputProps['onFocus']>>[0];\ntype BlurEvent = Parameters<NonNullable<ThemedTextInputProps['onBlur']>>[0];\ntype SubmitEvent = Parameters<NonNullable<ThemedTextInputProps['onSubmitEditing']>>[0];\n\nexport interface RecentInputFieldProps extends ThemedTextInputProps {\n /** Namespace under which this input's submitted values are remembered. */\n recentKey: string;\n /** Cap on remembered values (most-recent-first). Defaults to the hook's own default. */\n recentMax?: number;\n /** The field's accessible name — used to build the recents menu/row a11y strings. */\n label: string;\n}\n\nexport function RecentInputField({\n recentKey,\n recentMax,\n label,\n value,\n testID,\n onChangeText,\n onSubmitEditing,\n onFocus,\n onBlur,\n ...rest\n}: RecentInputFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const { recents, remember } = useRecentValues(recentKey, recentMax);\n\n const anchorRef = useRef<View>(null);\n // Latest text, tracked independently of whether the field is controlled, so blur/submit can\n // remember the right value even when the parent does not pass `value`.\n const latestText = useRef<string>(typeof value === 'string' ? value : '');\n const [isOpen, setIsOpen] = useState(false);\n\n const handleChange = useCallback(\n (text: string) => {\n latestText.current = text;\n onChangeText?.(text);\n },\n [onChangeText],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent) => {\n setIsOpen(true);\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: BlurEvent) => {\n const blurredText = latestText.current;\n setTimeout(() => {\n setIsOpen(false);\n if (blurredText.trim() !== '') remember(blurredText);\n }, CLOSE_DELAY_MS);\n onBlur?.(event);\n },\n [remember, onBlur],\n );\n\n const handleSubmit = useCallback(\n (event: SubmitEvent) => {\n remember(latestText.current);\n setIsOpen(false);\n onSubmitEditing?.(event);\n },\n [remember, onSubmitEditing],\n );\n\n const pick = useCallback(\n (picked: string) => {\n latestText.current = picked;\n onChangeText?.(picked);\n remember(picked);\n setIsOpen(false);\n },\n [onChangeText, remember],\n );\n\n const options: ControlOption[] = recents.map((entry) => ({ label: entry, value: entry }));\n const showMenu = isOpen && options.length > 0;\n const recentTestID = testID !== undefined ? `${testID}-recent` : 'form-field-recent';\n\n return (\n <View ref={anchorRef} style={s.anchor}>\n <ThemedTextInput\n {...rest}\n testID={testID}\n value={value}\n onChangeText={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onSubmitEditing={handleSubmit}\n />\n {showMenu ? (\n <AnchoredMenu\n accessibilityLabel={`Recent ${label} values`}\n anchorRef={anchorRef}\n colors={{ text: colors.text, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n onDismiss={() => setIsOpen(false)}\n onSelect={pick}\n optionHint={`Fill ${label} with this recent value`}\n options={options}\n selectedValue={typeof value === 'string' ? value : ''}\n testID={recentTestID}\n // Portal to document.body: the recents list sits above later-painting content (rows, cards,\n // the next field). Without the portal RN-web's trapped z-index paints it behind them.\n usePortal\n />\n ) : null}\n </View>\n );\n}\n\nexport default RecentInputField;\n","const INPUT_SIDE_INSET = 26;\nconst AVERAGE_CHAR_WIDTH = 8.4;\nconst SPARE_ROWS = 1;\n\n/** The narrowest text box the app draws, used until the real width is measured. */\nexport const NARROWEST_INPUT_WIDTH = 296;\n\n/** The rows a text box needs to show all of its text once wrapped at its width. */\nexport function rowsForText(text: string, inputWidth: number, minRows: number): number {\n const charsPerLine = Math.max(1, Math.floor((inputWidth - INPUT_SIDE_INSET) / AVERAGE_CHAR_WIDTH));\n const wrappedLines = text\n .split('\\n')\n .reduce((rows, line) => rows + Math.max(1, Math.ceil(line.length / charsPerLine)), 0);\n return Math.max(minRows, wrappedLines + SPARE_ROWS);\n}\n","import { useCallback, useState } from 'react';\n\nimport { type LayoutChangeEvent } from 'react-native';\n\nimport { NARROWEST_INPUT_WIDTH, rowsForText } from './textRows';\n\nexport interface AutoGrowRows {\n numberOfLines: number;\n onLayout: (event: LayoutChangeEvent) => void;\n}\n\n/** The rows a multi-line box needs for its text at its measured width, and the layout handler that measures it. */\nexport function useAutoGrowRows(text: string, minRows: number): AutoGrowRows {\n const [inputWidth, setInputWidth] = useState(NARROWEST_INPUT_WIDTH);\n const onLayout = useCallback((event: LayoutChangeEvent) => {\n setInputWidth(event.nativeEvent.layout.width);\n }, []);\n return { numberOfLines: rowsForText(text, inputWidth, minRows), onLayout };\n}\n","/**\r\n * Reusable form field — labelled text input with optional required mark + error.\r\n *\r\n * The label row, the required mark, the error line and the container spacing all come from the\r\n * generic `Field` wrapper, so a `FormField` and a `Field`-wrapped dropdown sitting next to each\r\n * other line up exactly and can never drift apart. FormField only adds the control itself.\r\n *\r\n * The input is the shared `ThemedTextInput` primitive, so every FormField gets the readable +\r\n * lively treatment (dark text, subtle off-white rest background, brand focus animation with a\r\n * soft ring) for free, driven by the active theme.\r\n */\r\nimport React from 'react';\r\n\r\nimport { type TextInput, type TextInputProps, type ViewStyle } from 'react-native';\r\n\r\nimport { Field } from '../Field/Field';\r\nimport type { FieldLabelVariant } from '../Field/labelVariants';\r\nimport { RecentInputField } from './RecentInputField';\r\nimport { ThemedTextInput } from '../ThemedTextInput/ThemedTextInput';\r\nimport { useAutoGrowRows } from './useAutoGrowRows';\r\n\r\n/**\r\n * The private `styles.input` that used to live here — padding 10/12, radius 8, border 1 — was a\r\n * verbatim duplicate of `controlStyles.input`, and `ThemedTextInput` now applies that itself. The\r\n * duplication is what hid the real defect: because `FormField` supplied metrics, inputs reached\r\n * through it looked correct, while every DIRECT `ThemedTextInput` caller got an unstyled 19px box\r\n * and nobody could see the difference from in here.\r\n */\r\nexport interface FormFieldProps extends Omit<TextInputProps, 'style'> {\r\n label: string;\r\n /**\r\n * Hide the VISIBLE label row while keeping the accessible name.\r\n *\r\n * For a field whose placeholder already names it (a toolbar search box, an inline\r\n * filter) the stacked visible label both wastes a row and misaligns the input\r\n * against a bare button beside it. Setting this drops ONLY the visible `<label>`:\r\n * the input still carries `accessibilityLabel={label}`, so a screen reader reads\r\n * the same name and `label` stays REQUIRED — you never lose the accessible name by\r\n * blanking it, which is the trap this option exists to remove. Default `false`.\r\n */\r\n labelHidden?: boolean;\r\n required?: boolean;\r\n error?: string;\r\n containerStyle?: ViewStyle;\r\n /**\r\n * OPT-IN \"recent values\" behaviour. When set, the values submitted through this field are\r\n * remembered (per this key) and offered in a dropdown on focus; picking one fills the input.\r\n * Values are recorded on submit (Enter) and on blur-with-content. Persisted to `localStorage`\r\n * under `@dloizides/ui-forms:recent:<recentKey>`; a silent no-op on native / when storage is\r\n * unavailable.\r\n *\r\n * Leave it UNSET (the default) and the field behaves exactly as before — nothing rendered, no\r\n * storage touched. NEVER set it on a password / secure field: recents must not persist secrets.\r\n */\r\n recentKey?: string;\r\n /** Cap on remembered values when {@link recentKey} is set (most-recent-first). Default 10. */\r\n recentMax?: number;\r\n /** Reaches the input, for focusing it without scrolling the page. Not forwarded when `recentKey` is set. */\r\n inputRef?: React.Ref<TextInput>;\r\n /** Grows a multi-line box to fit its text, so nothing scrolls inside it; never fewer rows than this. */\r\n autoGrowMinRows?: number;\r\n labelVariant?: FieldLabelVariant;\r\n}\r\n\r\ntype PlainFormFieldProps = Omit<FormFieldProps, 'autoGrowMinRows'>;\r\n\r\nconst PlainFormField = ({\r\n label,\r\n labelHidden = false,\r\n required = false,\r\n error,\r\n containerStyle,\r\n recentKey,\r\n recentMax,\r\n inputRef,\r\n labelVariant,\r\n ...textInputProps\r\n}: PlainFormFieldProps): React.ReactElement => (\r\n <Field\r\n containerStyle={containerStyle}\r\n error={error}\r\n // An undefined label renders NO label row (see Field): that is how the visible\r\n // label is hidden. The accessible name is kept on the input below, so hiding\r\n // the label never strips the name.\r\n label={labelHidden ? undefined : label}\r\n labelVariant={labelVariant}\r\n required={required}\r\n >\r\n {({ describedById, hasError, controlId }) => {\r\n // Shared props for either input path — identical wiring, so a field looks and behaves the\r\n // same whether or not it opts into recents.\r\n const inputProps = {\r\n accessibilityHint: `Enter ${label}`,\r\n accessibilityLabel: label,\r\n describedById,\r\n hasError,\r\n id: controlId,\r\n requiredField: required,\r\n testID: 'form-field-input',\r\n ...textInputProps,\r\n };\r\n // recentKey set → the recents-enabled input; unset → the plain input, unchanged from before\r\n // (no extra state/refs/effects/storage — the default path pays nothing).\r\n return recentKey !== undefined && recentKey !== '' ? (\r\n <RecentInputField label={label} recentKey={recentKey} recentMax={recentMax} {...inputProps} />\r\n ) : (\r\n <ThemedTextInput ref={inputRef} {...inputProps} />\r\n );\r\n }}\r\n </Field>\r\n);\r\n\r\nconst AutoGrowFormField = ({\r\n minRows,\r\n ...fieldProps\r\n}: PlainFormFieldProps & { minRows: number }): React.ReactElement => {\r\n const grow = useAutoGrowRows(fieldProps.value ?? '', minRows);\r\n return (\r\n <PlainFormField\r\n {...fieldProps}\r\n multiline\r\n numberOfLines={grow.numberOfLines}\r\n onLayout={grow.onLayout}\r\n />\r\n );\r\n};\r\n\r\nexport const FormField = ({ autoGrowMinRows, ...fieldProps }: FormFieldProps): React.ReactElement =>\r\n autoGrowMinRows === undefined ? (\r\n <PlainFormField {...fieldProps} />\r\n ) : (\r\n <AutoGrowFormField {...fieldProps} minRows={autoGrowMinRows} />\r\n );\r\n\r\nexport default FormField;\r\n","import { StyleSheet } from 'react-native';\n\nconst TEXT_INPUT_HEIGHT = 48;\n\nconst styles = StyleSheet.create({\n track: { padding: 0, borderWidth: 0 },\n besideTextInput: {\n padding: 0,\n borderWidth: 0,\n minHeight: TEXT_INPUT_HEIGHT,\n alignItems: 'stretch',\n },\n});\n\nexport const SEGMENT_BESIDE_FIELD = styles.track;\nexport const SEGMENT_BESIDE_TEXT_INPUT = styles.besideTextInput;\n","/** Shared ChipSelector constants. */\n\nexport const TRANSPARENT_COLOR = 'transparent';\n\n/**\n * Extra touch margin around a chip. NATIVE ONLY — this does NOT widen the hit area on RN-web,\n * which is what these portals ship. Measured 2026-09-21 (headless Chromium, 360x640):\n * `elementFromPoint` 5px above a chip's top edge, inside `top: 10`, returns the parent, not the\n * chip. react-native-web 0.21.2 uses `hitSlop` only in the legacy `Touchable` press-retention\n * path and ignores it entirely in `Pressable`. The web target is carried by `minHeight:\n * MIN_TARGET_PX` in `chipStyles`; this constant only helps iOS/Android.\n */\nexport const CHIP_HIT_SLOP = { top: 10, bottom: 10, left: 4, right: 4 } as const;\n\n/** Gap between adjacent chips, horizontally and between wrapped rows. */\nexport const CHIP_GUTTER = 8;\n\n/**\n * Default chip testID stem. NOT derived from the `testID` prop, because aml-v2's unit +\n * Playwright specs and erevna/katalogos's `Accessibility.test.tsx` already select on\n * `chip-selector-chip-<value>`. `chipTestIDPrefix` is the opt-in override for consumers\n * (kefi) that need their own stem; the default is frozen.\n */\nexport const DEFAULT_CHIP_TESTID_PREFIX = 'chip-selector-chip';\n","/** How a long chip label fits: `None` (default) grows the chip, `Wrap` and `Truncate` cap it at its container. */\nexport const enum ChipLabelWrap {\n None = 'none',\n Wrap = 'wrap',\n Truncate = 'truncate',\n}\n","import type { TextStyle, ViewStyle } from 'react-native';\n\nimport { ChipLabelWrap } from '../ChipLabelWrap';\n\nexport interface ChipLabelLayout {\n boxStyle: ViewStyle | undefined;\n textStyle: TextStyle | undefined;\n numberOfLines: number | undefined;\n}\n\nconst CAPPED_BOX: ViewStyle = { maxWidth: '100%', flexShrink: 1 };\nconst SHRINKING_TEXT: TextStyle = { flexShrink: 1 };\nconst SINGLE_LINE = 1;\n\n/** Resolves a chip's box and label layout for its `labelWrap` mode; `none` keeps today's render. */\nexport function chipLabelLayout(labelWrap: ChipLabelWrap | undefined): ChipLabelLayout {\n if (labelWrap === ChipLabelWrap.Wrap)\n return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: undefined };\n if (labelWrap === ChipLabelWrap.Truncate)\n return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };\n\n return { boxStyle: undefined, textStyle: undefined, numberOfLines: undefined };\n}\n","import { StyleSheet } from 'react-native';\n\nimport { TRANSPARENT_COLOR } from '../constants';\n\nconst SOLID_RADIUS = 20;\nconst OUTLINE_RADIUS = 999;\nconst OUTLINE_PAD_H = 12;\nconst OUTLINE_PAD_V = 5;\nconst OUTLINE_FONT_SIZE = 13;\n/** Gap between an option's icon and its label. */\nconst CHIP_ICON_GAP = 6;\n/**\n * WCAG minimum touch-target edge, in CSS px. Source of truth is `MIN_TARGET_PX` in\n * `@dloizides/ui-layout`; duplicated here as a local constant rather than taking a whole\n * dependency for one integer. Keep the two in step if ui-layout ever changes it.\n *\n * Needed because `hitSlop` is NATIVE-ONLY: measured 2026-09-21 in headless Chromium at 360px,\n * `document.elementFromPoint` 5px above a chip (inside `CHIP_HIT_SLOP.top: 10`) returns the\n * PARENT, not the chip. react-native-web 0.21.2 references `hitSlop` only in the legacy\n * `Touchable` mixin's press-RETENTION path and not at all in `Pressable`, so on web the\n * rendered box IS the whole tappable area.\n */\nconst MIN_TARGET_PX = 44;\n\nexport const chipStyles = StyleSheet.create({\n chip: {\n paddingHorizontal: 12,\n paddingVertical: 6,\n minHeight: MIN_TARGET_PX,\n minWidth: MIN_TARGET_PX,\n justifyContent: 'center',\n borderRadius: SOLID_RADIUS,\n backgroundColor: TRANSPARENT_COLOR,\n borderWidth: 1,\n },\n chipOutline: {\n paddingHorizontal: OUTLINE_PAD_H,\n paddingVertical: OUTLINE_PAD_V,\n minHeight: MIN_TARGET_PX,\n minWidth: MIN_TARGET_PX,\n justifyContent: 'center',\n borderRadius: OUTLINE_RADIUS,\n borderWidth: 1,\n },\n chipContent: { flexDirection: 'row', alignItems: 'center', gap: CHIP_ICON_GAP },\n chipText: {},\n chipTextOutline: { fontSize: OUTLINE_FONT_SIZE },\n});\n","import React from 'react';\n\nimport { Text, View, type StyleProp, type TextStyle } from 'react-native';\n\nimport { chipStyles } from './chipStyles';\n\ninterface ChipContentProps {\n icon: React.ReactNode;\n label: string;\n textStyle: StyleProp<TextStyle>;\n numberOfLines?: number;\n}\n\n/** Chip label, preceded by the option's decorative icon when one is supplied. */\nexport function ChipContent({ icon, label, textStyle, numberOfLines }: ChipContentProps): React.ReactElement {\n const text = (\n <Text numberOfLines={numberOfLines} style={textStyle}>\n {label}\n </Text>\n );\n if (icon === undefined || icon === null)\n return text;\n\n return (\n <View style={chipStyles.chipContent}>\n <View aria-hidden={true}>{icon}</View>\n {text}\n </View>\n );\n}\n","import React from 'react';\n\nimport { Pressable, View } from 'react-native';\n\nimport { CHIP_HIT_SLOP } from '../constants';\nimport type { ChipProps } from '../types';\n\nimport { chipLabelLayout } from '../utils/chipLabelLayout';\n\nimport { ChipContent } from './ChipContent';\nimport { chipStyles } from './chipStyles';\n\n/** A single outline chip — owns its own hover state (web) for the border/ink lift. */\nexport function OutlineChip<T extends string | number>(props: ChipProps<T>): React.ReactElement {\n const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;\n const [hovered, setHovered] = React.useState(false);\n const active = selected || hovered;\n\n const borderColor = active ? colors.primary : colors.border;\n const backgroundColor = selected ? colors.tint : colors.muted;\n // Selected AND hovered both lift the ink to the primary colour (v1's indigo / indigo-dark);\n // the theme surface only guarantees the 500 step, so both use it — border + fill carry the state.\n const textColor = active ? colors.primary : colors.textMuted;\n const layout = chipLabelLayout(option.labelWrap);\n\n return (\n <Pressable\n ref={props.hostRef}\n accessibilityHint={accessibilityHint}\n accessibilityLabel={option.label}\n accessibilityRole={props.accessibilityRole}\n accessibilityState={{ selected, disabled }}\n aria-checked={props.ariaChecked}\n aria-pressed={props.ariaPressed}\n disabled={disabled}\n hitSlop={CHIP_HIT_SLOP}\n style={layout.boxStyle}\n tabIndex={props.tabIndex}\n testID={testID}\n onHoverIn={() => setHovered(true)}\n onHoverOut={() => setHovered(false)}\n onPress={onPress}\n >\n <View style={[chipStyles.chipOutline, { borderColor, backgroundColor }, layout.boxStyle]}>\n <ChipContent\n icon={option.icon}\n label={option.label}\n numberOfLines={layout.numberOfLines}\n textStyle={[chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }, layout.textStyle]}\n />\n </View>\n </Pressable>\n );\n}\n","import React from 'react';\n\nimport { TouchableOpacity, View, type ViewProps } from 'react-native';\n\nimport { CHIP_HIT_SLOP, TRANSPARENT_COLOR } from '../constants';\nimport type { ChipProps } from '../types';\n\nimport { chipLabelLayout } from '../utils/chipLabelLayout';\n\nimport { ChipContent } from './ChipContent';\nimport { chipStyles } from './chipStyles';\n\n/** A single solid chip — the original filled-pill look (unchanged for existing consumers). */\nexport function SolidChip<T extends string | number>(props: ChipProps<T>): React.ReactElement {\n const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;\n const backgroundColor = selected ? colors.primary : TRANSPARENT_COLOR;\n const textColor = selected ? colors.onPrimary : colors.textStrong;\n const layout = chipLabelLayout(option.labelWrap);\n // RNW forwards `tabIndex` to the DOM, but RN's TouchableOpacity types omit it (ViewProps has it).\n const rovingTabStop: Pick<ViewProps, 'tabIndex'> = { tabIndex: props.tabIndex };\n return (\n <TouchableOpacity\n ref={props.hostRef}\n accessibilityHint={accessibilityHint}\n accessibilityLabel={option.label}\n accessibilityRole={props.accessibilityRole}\n accessibilityState={{ selected, disabled }}\n aria-checked={props.ariaChecked}\n aria-pressed={props.ariaPressed}\n disabled={disabled}\n hitSlop={CHIP_HIT_SLOP}\n style={layout.boxStyle}\n testID={testID}\n onPress={onPress}\n {...rovingTabStop}\n >\n <View style={[chipStyles.chip, { borderColor: colors.border, backgroundColor }, layout.boxStyle]}>\n <ChipContent\n icon={option.icon}\n label={option.label}\n numberOfLines={layout.numberOfLines}\n textStyle={[chipStyles.chipText, { color: textColor }, layout.textStyle]}\n />\n </View>\n </TouchableOpacity>\n );\n}\n","/**\n * Pure key logic for the WAI-ARIA radio group pattern used by ChipSelector's opt-in radio mode.\n * Kept free of React and the DOM so every branch is unit-testable without rendering.\n */\n\nconst SPACE_KEYS: readonly string[] = [' ', 'Spacebar'];\nconst NEXT_KEYS: readonly string[] = ['ArrowRight', 'ArrowDown'];\nconst PREVIOUS_KEYS: readonly string[] = ['ArrowLeft', 'ArrowUp'];\nconst ROVING_TAB_STOP = 0;\nconst ROVING_SKIPPED = -1;\n\n/**\n * The option index a radio group should select when `key` is pressed on the chip at `index`,\n * or `null` when the key is not part of the pattern.\n *\n * - Space activates the focused chip (returns `index`).\n * - ArrowRight/ArrowDown → next chip, ArrowLeft/ArrowUp → previous, wrapping at both ends.\n * - Enter is deliberately `null`: RNW's press responder already activates a `<div>` chip on\n * Enter, so handling it here would fire `onChange` twice.\n * - Arrows in a one-chip group are `null` — there is nowhere to move, so nothing is selected.\n */\nexport function radioKeyTarget(key: string, index: number, count: number): number | null {\n const isOutOfRange = index < 0 || index >= count;\n if (isOutOfRange)\n return null;\n\n if (SPACE_KEYS.includes(key))\n return index;\n\n const isArrow = NEXT_KEYS.includes(key) || PREVIOUS_KEYS.includes(key);\n if (!isArrow || count === 1)\n return null;\n\n const step = NEXT_KEYS.includes(key) ? 1 : -1;\n return (index + step + count) % count;\n}\n\n/**\n * Roving tabindex: only the selected chip — or the first chip when nothing is selected — is a\n * tab stop. A disabled group has no tab stop at all.\n */\nexport function radioTabIndex(index: number, selectedIndex: number, disabled: boolean): 0 | -1 {\n if (disabled)\n return ROVING_SKIPPED;\n\n const tabStop = selectedIndex >= 0 ? selectedIndex : 0;\n return index === tabStop ? ROVING_TAB_STOP : ROVING_SKIPPED;\n}\n","/**\n * Keyboard + focus wiring for ChipSelector's opt-in radio group.\n *\n * One `onKeyDown` sits on the radiogroup container and catches the key events bubbling up from\n * the focused chip. It lives on the GROUP, not the chip, because RNW's `TouchableOpacity` spreads\n * its press handlers AFTER the caller's props — a chip-level `onKeyDown` on the solid variant is\n * silently overwritten. The focused chip is identified by matching `event.target` against the\n * host nodes registered through `chipRef`.\n */\nimport React from 'react';\n\nimport type { ViewProps } from 'react-native';\n\nimport { radioKeyTarget, radioTabIndex } from '../utils/radioKeyboard';\n\ninterface FocusableNode {\n focus?: () => void;\n}\n\ninterface RadioKeyEvent {\n key: string;\n target: unknown;\n preventDefault: () => void;\n}\n\nexport interface RadioKeyboardConfig<T> {\n /** `false` for button / multi-select groups: the hook then emits nothing at all. */\n enabled: boolean;\n disabled: boolean;\n values: T[];\n /** Index of the selected option, or `-1` when nothing is selected. */\n selectedIndex: number;\n onChange: (value: T) => void;\n}\n\nexport interface RadioKeyboard {\n /** Ref callback factory registering the host node of the chip at `index`. */\n chipRef: (index: number) => (node: unknown) => void;\n /** Roving tabindex for the chip at `index`; `undefined` when radio mode is off. */\n tabIndexFor: (index: number) => 0 | -1 | undefined;\n /** Web props for the group container (`onKeyDown` in radio mode, nothing otherwise). */\n groupProps: ViewProps;\n}\n\nconst NO_GROUP_PROPS: ViewProps = {};\n\nexport function useRadioKeyboard<T>(config: RadioKeyboardConfig<T>): RadioKeyboard {\n const { enabled, disabled, values, selectedIndex, onChange } = config;\n const nodes = React.useRef<unknown[]>([]);\n\n const chipRef = React.useCallback((index: number) => (node: unknown): void => {\n nodes.current[index] = node;\n }, []);\n\n const onKeyDown = (event: RadioKeyEvent): void => {\n if (disabled)\n return;\n\n const index = nodes.current.indexOf(event.target);\n const target = radioKeyTarget(event.key, index, values.length);\n const nextValue = target === null ? undefined : values[target];\n if (target === null || nextValue === undefined)\n return;\n\n // Stops Space scrolling the page and arrows scrolling a scroll container.\n event.preventDefault();\n if (target !== index)\n (nodes.current[target] as FocusableNode | null | undefined)?.focus?.();\n\n onChange(nextValue);\n };\n\n return {\n chipRef,\n tabIndexFor: (index) => (enabled ? radioTabIndex(index, selectedIndex, disabled) : undefined),\n // `onKeyDown` is a web-only View prop RN's types do not declare; RNW forwards it to the DOM.\n groupProps: enabled ? ({ onKeyDown } as unknown as ViewProps) : NO_GROUP_PROPS,\n };\n}\n","/** Theme → chip colour resolution for both ChipSelector variants. */\nimport type { ChipColors } from '../types';\n\nconst WHITE_COLOR = '#fff';\nconst OUTLINE_TINT_ALPHA = 0.1;\nconst HEX_SHORT_LENGTH = 3;\nconst HEX_RADIX = 16;\nconst RGB_R_START = 0;\nconst RGB_R_END = 2;\nconst RGB_G_END = 4;\nconst RGB_B_END = 6;\n\n/** Palette scale carrying the ink for content sitting ON the brand colour. */\nconst ON_BRAND_SCALE = 'onBrand';\n/** The one step every theme scale is guaranteed to define. */\nconst MAIN_STEP = '500';\n\n/**\n * Read the on-brand ink out of a theme palette.\n *\n * Deliberately typed as OPTIONAL rather than read through `palette.onBrand`. Two reasons:\n * this package's declared peer floor is `ui-feedback >= 1.1.0`, whose palette type has no\n * index signature at all; and even on current versions the index signature types every\n * scale as present, which is a lie — only `primary` is guaranteed, and most apps in the\n * fleet publish no `onBrand` scale today. Modelling it as absent-able is what makes the\n * `WHITE_COLOR` fallback honest instead of dead code.\n */\nfunction onBrandInk(palette: object): string {\n const scales = palette as Record<string, Record<string, string> | undefined>;\n return scales[ON_BRAND_SCALE]?.[MAIN_STEP] ?? WHITE_COLOR;\n}\n\n/** Composite a hex colour over the background at a given alpha (theme-driven tint). */\nfunction withAlpha(hex: string, alpha: number): string {\n const normalized = hex.replace('#', '');\n const isShort = normalized.length === HEX_SHORT_LENGTH;\n const full = isShort ? normalized.split('').map((c) => c + c).join('') : normalized;\n const r = parseInt(full.slice(RGB_R_START, RGB_R_END), HEX_RADIX);\n const g = parseInt(full.slice(RGB_R_END, RGB_G_END), HEX_RADIX);\n const b = parseInt(full.slice(RGB_G_END, RGB_B_END), HEX_RADIX);\n const isValid = !Number.isNaN(r) && !Number.isNaN(g) && !Number.isNaN(b);\n return isValid ? `rgba(${r}, ${g}, ${b}, ${alpha})` : hex;\n}\n\ninterface ThemeColorsInput {\n border: string;\n text: string;\n textSecondary: string;\n background: string;\n}\n\n/** Resolve the colours both chip variants read, from the active theme's colours + palette. */\nexport function buildChipColors(\n colors: ThemeColorsInput,\n palette: { primary: { 500: string } },\n): ChipColors {\n const primary = palette.primary[500];\n return {\n border: colors.border,\n textStrong: colors.text,\n textMuted: colors.textSecondary,\n primary,\n onPrimary: onBrandInk(palette),\n muted: colors.background,\n tint: withAlpha(primary, OUTLINE_TINT_ALPHA),\n };\n}\n","import type { ChipOption, ChipProps } from '../types';\n\n/**\n * The a11y + testID triple a chip needs, resolved once for both variants.\n *\n * Exported for direct unit testing. It has to be tested as a pure function rather than\n * through the DOM because react-native-web DROPS `accessibilityHint` entirely — it reaches\n * native, but no web attribute carries it, so no rendering assertion can tell a correctly\n * threaded hint from one that was never passed. Testing the resolver is the only honest way\n * to pin the behaviour.\n */\nexport function chipIdentity<T>(\n option: ChipOption<T>,\n selected: boolean,\n config: { prefix: string; hint?: string; multiple: boolean; radio?: boolean },\n): Pick<ChipProps<T>, 'testID' | 'accessibilityHint' | 'ariaPressed' | 'accessibilityRole' | 'ariaChecked'> {\n const isRadio = config.radio === true && !config.multiple;\n return {\n testID: `${config.prefix}-${String(option.value)}`,\n // The English default is retained verbatim: erevna/katalogos assert the exact string\n // `Selects Red`. Consumers that localize pass `optionAccessibilityHint`.\n accessibilityHint: config.hint ?? `Selects ${option.label}`,\n ariaPressed: config.multiple ? selected : undefined,\n accessibilityRole: isRadio ? 'radio' : 'button',\n ariaChecked: isRadio ? selected : undefined,\n };\n}\n","/**\n * Chip/pill selector for selecting one or multiple options.\n *\n * Two visual variants (both fully theme-driven):\n * - `solid` (default) — the original filled-pill look: selected = solid primary fill with\n * white ink. Unchanged, so existing consumers (erevna / katalogos / kefi) render identically.\n * - `outline` — the AML v1 console look: an outlined pill on a muted fill; selected = a subtle\n * tinted-outline (primary border + primary ink + a low-alpha primary wash), NOT a solid fill.\n * Hover (web) lifts the border/ink to the primary colour.\n *\n * The label row, the error line and the container spacing come from the shared `Field` wrapper —\n * NOT from a local `<Text>`. Its own label used to drift from `Field` on three of four axes\n * (`marginBottom: 8` vs 4, no `fontSize` at all so ~14 vs 13, `colors.text` vs `textSecondary`),\n * so a `ChipSelector` next to a `FormField` in a row/grid started a different distance down the\n * column and read as a different weight of text. Now there is exactly one label implementation.\n *\n * Structure: chip variants in `components/`, the radio keyboard wiring in `hooks/`, and the pure\n * resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type ViewProps } from 'react-native';\n\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { Field } from '../Field/Field';\n\nimport { OutlineChip } from './components/OutlineChip';\nimport { SolidChip } from './components/SolidChip';\nimport { CHIP_GUTTER, DEFAULT_CHIP_TESTID_PREFIX } from './constants';\nimport { useRadioKeyboard } from './hooks/useRadioKeyboard';\nimport type { ChipColors, ChipOption, ChipSelectorProps } from './types';\nimport { buildChipColors } from './utils/chipColors';\nimport { chipIdentity } from './utils/chipIdentity';\n\nconst styles = StyleSheet.create({\n chipContainer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n // `gap`, NOT per-chip margins plus a compensating negative container margin.\n //\n // The old form was `chipWrapper { marginRight: 8, marginBottom: 8 }` with\n // `chipContainer { marginBottom: -8 }`. Its comment blamed `Field`'s 16px container margin —\n // that was WRONG, and worth recording: F3 was briefed on the belief that the -8 compensated for\n // `Field` and had to move in lockstep with it. It did not. -8 cancelled the CHIP's own gutter\n // hanging off the last row, identically whether `Field` contributed 16, 0, or anything else.\n //\n // The pair is still the wrong tool: it holds only while the two constants agree, and it leaves\n // a real negative margin any measuring parent inherits. `gap` produces the byte-identical box\n // and is correct under BOTH of `Field`'s spacing models, not just the one it was tuned against.\n gap: CHIP_GUTTER,\n },\n});\n\n/*\n * `groupA11yProps` + its local `WebGroupA11y` type used to live here — a copy of\n * ThemedTextInput's branch, as its own comment admitted. Both now call `webFieldA11y`.\n * The chip group passes no `required`, so nothing is emitted for it, exactly as before.\n */\n\nexport const ChipSelector = <T extends string | number>({\n label,\n options,\n value,\n onChange,\n multiple = false,\n disabled = false,\n variant = 'solid',\n containerStyle,\n spacing,\n required = false,\n error,\n testID,\n chipTestIDPrefix = DEFAULT_CHIP_TESTID_PREFIX,\n optionAccessibilityHint,\n singleSelectRole = 'button',\n}: ChipSelectorProps<T>): React.ReactElement => {\n const isRadioGroup = !multiple && singleSelectRole === 'radio';\n const { theme } = useUi();\n const { colors, palette } = theme;\n\n const chipColors = React.useMemo<ChipColors>(() => buildChipColors(colors, palette), [colors, palette]);\n\n function isSelected(optionValue: T): boolean {\n if (multiple && Array.isArray(value))\n return value.includes(optionValue);\n\n return value === optionValue;\n }\n\n const radio = useRadioKeyboard({\n enabled: isRadioGroup,\n disabled,\n values: options.map((option) => option.value),\n selectedIndex: options.findIndex((option) => isSelected(option.value)),\n onChange,\n });\n\n function renderChip(option: ChipOption<T>, index: number): React.ReactElement {\n const selected = isSelected(option.value);\n const chipProps = {\n colors: chipColors,\n disabled,\n option,\n selected,\n ...chipIdentity(option, selected, {\n prefix: chipTestIDPrefix,\n hint: optionAccessibilityHint,\n multiple,\n radio: isRadioGroup,\n }),\n // Radio mode only: roving tab stop + host node for arrow-key focus moves. Both stay\n // `undefined` otherwise, so button / multi chips keep their existing tab order.\n tabIndex: radio.tabIndexFor(index),\n hostRef: isRadioGroup ? radio.chipRef(index) : undefined,\n onPress: (): void => onChange(option.value),\n };\n const key = String(option.value);\n return variant === 'outline' ? <OutlineChip key={key} {...chipProps} /> : <SolidChip key={key} {...chipProps} />;\n }\n\n return (\n <Field\n containerStyle={containerStyle}\n error={error}\n label={label}\n required={required}\n spacing={spacing}\n testID={testID}\n >\n {({ describedById, hasError }) => (\n <View\n accessibilityRole={isRadioGroup ? 'radiogroup' : undefined}\n style={styles.chipContainer}\n {...(webFieldA11y({ describedById, hasError }) as ViewProps)}\n {...radio.groupProps}\n >\n {options.map(renderChip)}\n </View>\n )}\n </Field>\n );\n};\n\nexport default ChipSelector;\n","/**\n * Reusable form switch/toggle with an optional description.\n */\nimport React from \"react\";\n\nimport {\n StyleSheet,\n View,\n Text,\n Switch,\n Pressable,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\n\nimport { MIN_TOUCH_TARGET_PX } from \"@dloizides/a11y\";\nimport { useUi } from \"@dloizides/ui-feedback\";\n\nconst DESCRIPTION_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n marginBottom: 12,\n // The ROW is the hit box (SHOWCASE-1): RN-web renders Switch as a 40x20 box and ignores\n // `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.\n minHeight: MIN_TOUCH_TARGET_PX,\n },\n switchSlot: {\n minWidth: MIN_TOUCH_TARGET_PX,\n minHeight: MIN_TOUCH_TARGET_PX,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n textColumn: {\n flex: 1,\n },\n label: {\n fontWeight: \"600\",\n },\n description: {\n fontSize: DESCRIPTION_FONT_SIZE,\n marginTop: 2,\n },\n});\n\ninterface ThemeStyles {\n label: TextStyle;\n description: TextStyle;\n}\n\nexport interface FormSwitchProps {\n label: string;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled?: boolean;\n description?: string;\n containerStyle?: ViewStyle;\n testID?: string;\n accessibilityHint?: string;\n}\n\nexport const FormSwitch = ({\n label,\n value,\n onValueChange,\n disabled = false,\n description,\n containerStyle,\n testID = \"form-switch\",\n accessibilityHint,\n}: FormSwitchProps): React.ReactElement => {\n const { theme } = useUi();\n const toggle = React.useCallback((): void => {\n if (!disabled) onValueChange(!value);\n }, [disabled, onValueChange, value]);\n const { colors } = theme;\n const hasDescription = typeof description === \"string\" && description !== \"\";\n\n const themeStyles = React.useMemo<ThemeStyles>(() => {\n const labelStyle: TextStyle = { color: colors.text };\n const descriptionStyle: TextStyle = { color: colors.textSecondary };\n return { label: labelStyle, description: descriptionStyle };\n }, [colors.text, colors.textSecondary]);\n\n return (\n /*\n Pointer target only: the whole row toggles on press. It is NOT an a11y element and NOT a tab\n stop (`accessible` / `focusable` false) so the native input below stays the ONE switch. The\n Switch sits under `pointerEvents=\"none\"`, so a tap on it reaches this row exactly once\n instead of toggling twice; keyboard focus + Space still reach the input directly.\n */\n <Pressable\n accessible={false}\n disabled={disabled}\n onPress={toggle}\n style={[styles.container, containerStyle]}\n // RN-web's Pressable always stamps a tabIndex (0, or -1 when disabled) and only an explicit\n // one overrides it — `focusable={false}` does not. -1 keeps the row out of the tab order.\n tabIndex={-1}\n testID={testID}\n >\n <View style={styles.textColumn}>\n <Text style={[styles.label, themeStyles.label]}>{label}</Text>\n {hasDescription ? (\n <Text style={[styles.description, themeStyles.description]}>\n {description}\n </Text>\n ) : null}\n </View>\n {/*\n Exactly ONE element exposes the switch (A11Y-ARIA-CHECKED-1). On web, react-native-web's\n Switch renders a wrapper <div> around a native <input type=\"checkbox\" role=\"switch\"> that\n already carries `checked` / `disabled` — the state assistive tech reads (HTML-AAM maps\n `checked` to the checked state, so no `aria-checked` is needed or allowed on it).\n Passing `accessibilityRole=\"switch\"` here put a SECOND `role=\"switch\"` on the wrapper,\n which RNW then made a `tabindex=\"0\"` stop even when disabled; literal `aria-checked` /\n `aria-disabled` would land on that role-less wrapper too. So neither is passed: the\n wrapper is plain and unfocusable, and native keeps its `switch` role from RN's Switch\n default (`accessibilityRole ?? 'switch'`) plus `accessibilityState` below.\n */}\n <View pointerEvents=\"none\" style={styles.switchSlot} testID={`${testID}-hitbox`}>\n <Switch\n accessibilityHint={accessibilityHint ?? label}\n accessibilityLabel={label}\n accessibilityState={{ checked: value, disabled }}\n disabled={disabled}\n testID={`${testID}-switch`}\n value={value}\n onValueChange={onValueChange}\n />\n </View>\n </Pressable>\n );\n};\n\nexport default FormSwitch;\n","import type { ViewStyle } from 'react-native';\n\nexport interface CheckboxColorTokens {\n border: string;\n textSecondary: string;\n}\n\n/** Fill and border of the checkbox square; unchecked uses textSecondary for 3:1 non-text contrast. */\nexport const checkboxBoxColors = (\n colors: CheckboxColorTokens,\n brand: string,\n checked: boolean\n): Pick<ViewStyle, 'backgroundColor' | 'borderColor'> =>\n checked\n ? { backgroundColor: brand, borderColor: brand }\n : { backgroundColor: 'transparent', borderColor: colors.textSecondary };\n","/**\n * Reusable, native-safe checkbox — a themed `Pressable` (works on RN-web AND native, where RN has\n * no built-in checkbox). A small rounded square that fills with the brand colour and shows a check\n * glyph when on, with a label and an optional hint. Mirrors `FormSwitch`'s prop shape so it is a\n * drop-in replacement for the boolean toggles v1 renders as checkboxes.\n */\nimport React from 'react';\n\nimport { Platform, StyleSheet, View, Text, Pressable, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useFieldIds } from '../Field/Field';\n\nimport { checkboxBoxColors } from './checkboxColors';\n\n/**\n * Web-only keydown prop react-native-web's `Pressable` forwards but RN's types omit. A\n * `role=\"checkbox\"` Pressable renders a `<div>` (not a native `<button>`), so — unlike a\n * button-role Pressable — it gets NO free Enter/Space activation. We add it explicitly so the\n * checkbox is keyboard-operable (WCAG 2.1.1). `preventDefault()` stops Space from scrolling.\n */\ninterface WebKeyboardProps {\n onKeyDown?: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\nconst ACTIVATION_KEYS = ['Enter', ' ', 'Spacebar'];\n\nconst HINT_FONT_SIZE = 12;\nconst BOX_SIZE = 20;\nconst BOX_RADIUS = 5;\nconst TICK_WIDTH = 6;\nconst TICK_HEIGHT = 10;\nconst TICK_STROKE = 2;\nconst TICK_LIFT = -2;\nconst DISABLED_OPACITY = 0.5;\nconst FOCUS_RING_WIDTH = 2;\nconst FOCUS_RING_GAP = 2;\nconst WEB_NO_DEFAULT_OUTLINE = { outlineStyle: 'none' } as unknown as ViewStyle;\nconst FOCUS_RING_INSET = -(FOCUS_RING_WIDTH + FOCUS_RING_GAP + FOCUS_RING_WIDTH);\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n gap: 10,\n marginBottom: 12,\n // The whole row is the Pressable, so the row IS the hit box: on RN-web `hitSlop` is inert and a\n // one-line label measured 36px tall (SHOWCASE-1). The 20px visual box keeps its size inside.\n minHeight: MIN_TOUCH_TARGET_PX,\n },\n /** With no hint the row is a single line, so centre it vertically inside the floor. */\n centered: {\n alignItems: 'center',\n },\n box: {\n width: BOX_SIZE,\n height: BOX_SIZE,\n borderRadius: BOX_RADIUS,\n borderWidth: 2,\n alignItems: 'center',\n justifyContent: 'center',\n // Nudge the box to sit on the label's first text line.\n marginTop: 1,\n },\n focusRing: {\n position: 'absolute',\n top: FOCUS_RING_INSET,\n left: FOCUS_RING_INSET,\n right: FOCUS_RING_INSET,\n bottom: FOCUS_RING_INSET,\n borderWidth: FOCUS_RING_WIDTH,\n borderRadius: BOX_RADIUS - FOCUS_RING_INSET,\n },\n tick: {\n width: TICK_WIDTH,\n height: TICK_HEIGHT,\n marginTop: TICK_LIFT,\n borderRightWidth: TICK_STROKE,\n borderBottomWidth: TICK_STROKE,\n transform: [{ rotate: '45deg' }],\n },\n textColumn: {\n flex: 1,\n },\n label: {\n fontWeight: '600',\n },\n hint: {\n fontSize: HINT_FONT_SIZE,\n marginTop: 2,\n },\n});\n\nexport interface FormCheckboxProps {\n label: string;\n value: boolean;\n /** Primary change handler (mirrors `FormSwitch`). `onChange` is accepted as an alias. */\n onValueChange?: (value: boolean) => void;\n /** Alias for `onValueChange` so either name works as a drop-in. */\n onChange?: (value: boolean) => void;\n /** Optional secondary description shown under the label. `description` is accepted as an alias. */\n hint?: string;\n description?: string;\n disabled?: boolean;\n containerStyle?: ViewStyle;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport const FormCheckbox = ({\n label,\n value,\n onValueChange,\n onChange,\n hint,\n description,\n disabled = false,\n containerStyle,\n testID = 'form-checkbox',\n accessibilityLabel,\n accessibilityHint,\n}: FormCheckboxProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n const hintText = typeof hint === 'string' && hint !== '' ? hint : description;\n const hasHint = typeof hintText === 'string' && hintText !== '';\n const { hintId } = useFieldIds();\n\n const [focused, setFocused] = React.useState(false);\n\n const themeStyles = React.useMemo(() => {\n const boxOn: ViewStyle = checkboxBoxColors(colors, brand, true);\n const boxOff: ViewStyle = checkboxBoxColors(colors, brand, false);\n const ring: ViewStyle = { borderColor: brand };\n const labelStyle: TextStyle = { color: colors.text };\n const hintStyle: TextStyle = { color: colors.textSecondary };\n return { boxOn, boxOff, ring, label: labelStyle, hint: hintStyle };\n }, [brand, colors]);\n\n const toggle = (): void => {\n const next = !value;\n if (onValueChange) onValueChange(next);\n if (onChange) onChange(next);\n };\n\n const handleKeyDown = (event: { key?: string; preventDefault?: () => void }): void => {\n if (disabled) return;\n const key = event.key ?? '';\n if (!ACTIVATION_KEYS.includes(key)) return;\n if (typeof event.preventDefault === 'function') event.preventDefault();\n toggle();\n };\n\n const keyboardProps: WebKeyboardProps = Platform.OS === 'web' ? { onKeyDown: handleKeyDown } : {};\n\n return (\n <Pressable\n accessibilityHint={accessibilityHint ?? label}\n accessibilityLabel={accessibilityLabel ?? label}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked: value, disabled }}\n // RN-web maps this to the ARIA `role=\"checkbox\"` + `aria-checked` a screen reader announces.\n aria-checked={value}\n aria-describedby={hasHint ? hintId : undefined}\n disabled={disabled}\n onBlur={() => setFocused(false)}\n onFocus={() => setFocused(true)}\n onPress={toggle}\n role=\"checkbox\"\n style={[\n styles.container,\n hasHint ? null : styles.centered,\n containerStyle,\n disabled ? { opacity: DISABLED_OPACITY } : null,\n Platform.OS === 'web' ? WEB_NO_DEFAULT_OUTLINE : null,\n ]}\n testID={testID}\n {...keyboardProps}\n >\n <View style={[styles.box, value ? themeStyles.boxOn : themeStyles.boxOff]} testID={`${testID}-box`}>\n {focused ? (\n <View pointerEvents=\"none\" style={[styles.focusRing, themeStyles.ring]} testID={`${testID}-focus-ring`} />\n ) : null}\n {value ? (\n <View accessibilityElementsHidden pointerEvents=\"none\" style={[styles.tick, { borderColor: colors.surface }]} testID={`${testID}-tick`} />\n ) : null}\n </View>\n <View style={styles.textColumn}>\n <Text style={[styles.label, themeStyles.label]}>{label}</Text>\n {hasHint ? <Text nativeID={hintId} style={[styles.hint, themeStyles.hint]}>{hintText}</Text> : null}\n </View>\n </Pressable>\n );\n};\n\nexport default FormCheckbox;\n","import React from 'react';\r\n\r\nimport { StyleSheet, View } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\n\r\nimport type { SelectControlProps } from './SelectControl';\r\n\r\nconst NATIVE_SELECT_BOX: React.CSSProperties = {\r\n borderStyle: 'solid',\r\n boxSizing: 'border-box',\r\n fontFamily: 'inherit',\r\n width: '100%',\r\n};\r\n\r\nfunction nativeSelectStyle(borderColor: string, backgroundColor: string, color: string): React.CSSProperties {\r\n const trigger = StyleSheet.flatten(s.selectTrigger);\r\n const text = StyleSheet.flatten(s.selectTriggerText);\r\n return {\r\n ...NATIVE_SELECT_BOX,\r\n minHeight: trigger.minHeight,\r\n borderWidth: trigger.borderWidth,\r\n borderRadius: trigger.borderRadius,\r\n fontSize: text.fontSize,\r\n paddingBlock: trigger.paddingVertical,\r\n paddingInline: trigger.paddingHorizontal,\r\n borderColor,\r\n backgroundColor,\r\n color,\r\n } as React.CSSProperties;\r\n}\r\n\r\n/** The web `SelectControl` as a real DOM `<select>`, so browsers and test drivers can pick an option natively. */\r\nexport function NativeSelect({\r\n options,\r\n value,\r\n onChange,\r\n placeholder = '',\r\n accessibilityLabel,\r\n accessibilityHint,\r\n labelledById,\r\n style,\r\n testID,\r\n}: SelectControlProps): React.ReactElement {\r\n const { theme } = useUi();\r\n const { colors } = theme;\r\n const hasMatch = options.some((o) => o.value === value);\r\n const textColor = hasMatch ? colors.text : colors.textSecondary;\r\n\r\n const handleChange = (event: React.ChangeEvent<HTMLSelectElement>): void => onChange(event.target.value);\r\n\r\n return (\r\n <View style={[s.anchor, style]}>\r\n <select\r\n aria-label={accessibilityLabel}\r\n aria-labelledby={labelledById}\r\n data-testid={testID}\r\n style={nativeSelectStyle(colors.border, colors.surfaceElevated, textColor)}\r\n title={accessibilityHint}\r\n value={value}\r\n onChange={handleChange}\r\n >\r\n {hasMatch ? null : <option disabled value={value}>{placeholder}</option>}\r\n {options.map((o) => <option key={o.value} value={o.value}>{o.label}</option>)}\r\n </select>\r\n </View>\r\n );\r\n}\r\n","export const NO_HIGHLIGHT = -1;\n\n/** The row index an arrow key moves to: wraps at both ends, -1 when there are no rows. */\nexport function nextHighlight(current: number, count: number, delta: number): number {\n if (count === 0) return NO_HIGHLIGHT;\n if (current === NO_HIGHLIGHT) return delta > 0 ? 0 : count - 1;\n return (current + delta + count) % count;\n}\n","import { useEffect, useState } from 'react';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport { NO_HIGHLIGHT, nextHighlight } from '../controls/nextHighlight';\n\nconst FORWARD = 1;\nconst BACKWARD = -1;\n\ninterface ListboxKeyEvent {\n key: string;\n preventDefault: () => void;\n stopPropagation: () => void;\n}\n\nexport interface SelectListboxInput {\n options: readonly ControlOption[];\n isOpen: boolean;\n open: () => void;\n toggle: () => void;\n select: (value: string) => void;\n}\n\nexport interface SelectListbox {\n highlighted: ControlOption | undefined;\n onKeyDown: (event: ListboxKeyEvent) => void;\n}\n\n/** Keyboard for a select whose focus stays on its trigger: arrows move the highlight, Enter or Space commits. */\nexport function useSelectListbox({ options, isOpen, open, toggle, select }: SelectListboxInput): SelectListbox {\n const [row, setRow] = useState(NO_HIGHLIGHT);\n const highlighted: ControlOption | undefined = isOpen ? options[row] : undefined;\n\n useEffect(() => {\n if (!isOpen) setRow(NO_HIGHLIGHT);\n }, [isOpen]);\n\n const onKeyDown = (event: ListboxKeyEvent): void => {\n const { key } = event;\n const isArrow = key === 'ArrowDown' || key === 'ArrowUp';\n if (!isArrow && key !== 'Enter' && key !== ' ') return;\n event.preventDefault();\n event.stopPropagation();\n if (isArrow) {\n open();\n setRow((current) => nextHighlight(current, options.length, key === 'ArrowDown' ? FORWARD : BACKWARD));\n } else if (highlighted !== undefined) select(highlighted.value);\n else toggle();\n };\n\n return { highlighted, onKeyDown };\n}\n","/**\r\n * `SelectControl` — a single-select enum/status dropdown. A bordered trigger shows the selected\r\n * option's label (or the placeholder when unset) plus a chevron; pressing it opens the shared\r\n * {@link AnchoredMenu}. Selecting fires `onChange` and closes.\r\n *\r\n * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/SelectField`, where six portals\r\n * could see it working and none could import it — which is why the fleet grew SIX independent\r\n * select implementations.\r\n *\r\n * The control is LABEL-FREE by design: wrap it in a `Field` (with `labelVariant=\"control\"` on a\r\n * dense surface) to get the label, hint and error slots. That keeps one label implementation for\r\n * every control instead of one per control.\r\n *\r\n * i18n: this package never calls `t`. `accessibilityLabel`, `placeholder`, `accessibilityHint`\r\n * and `optionHint` are PRE-LOCALIZED strings supplied by the caller — the only shape that can\r\n * serve both aml-v2's positional `{0}` `@dloizides/i18n` and the other six portals' i18next\r\n * `{{p1}}` from one component.\r\n */\r\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\r\n\r\nimport { Platform, Pressable, Text, View, type StyleProp, type ViewStyle } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\r\nimport { listboxDomId, optionDomId } from '../AnchoredMenu/components/OptionRow';\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\nimport type { ControlOption } from '../controls/controlTypes';\r\nimport { NativeSelect } from './NativeSelect';\r\nimport { useSelectListbox } from './useSelectListbox';\r\n\r\nconst IS_WEB = Platform.OS === 'web';\r\n\r\nconst CHEVRON_DOWN = '▾';\r\nconst CHEVRON_UP = '▴';\r\n\r\n/** Opts in to a menu that stays on screen with focus on the trigger, for screen edges and focus-trapped sheets. */\r\nexport interface SelectMenuAnchor {\r\n listboxLabel: string;\r\n anchorRef?: React.RefObject<View | null>;\r\n}\r\n\r\nexport interface SelectControlProps {\r\n options: readonly ControlOption[];\r\n /** The selected option's `value`. `''` (or any unmatched value) renders the placeholder. */\r\n value: string;\r\n onChange: (value: string) => void;\r\n /** PRE-LOCALIZED text shown when the value matches no option. */\r\n placeholder?: string;\r\n /**\r\n * PRE-LOCALIZED accessible NAME of the trigger. It REPLACES the trigger's visible text for a\r\n * screen reader, so it must carry the SELECTION too — \"Status: Active\", not just \"Status\",\r\n * which announces the control but silently hides its value.\r\n */\r\n accessibilityLabel: string;\r\n accessibilityHint?: string;\r\n /**\r\n * `id` of the `Field` label naming this control — take it from the render-child context's\r\n * `labelId`. The trigger is a `<div role=\"button\">`, which `<label for>` cannot address (that\r\n * only works for native form elements), so the association runs the other way: the trigger\r\n * points AT the label.\r\n *\r\n * `accessibilityLabel` still wins for the accessible NAME, deliberately — it is the only one of\r\n * the two that carries the current selection (\"Status: Active\"). This adds the structural link\r\n * without changing a single announcement.\r\n */\r\n labelledById?: string;\r\n /** PRE-LOCALIZED accessibility hint applied to every option in the menu. */\r\n optionHint?: string;\r\n menuAnchor?: SelectMenuAnchor;\r\n /** Merged LAST onto the anchor wrapper — the consumer always wins over the shared style. */\r\n style?: StyleProp<ViewStyle>;\r\n /** Trigger is `${testID}-trigger`, menu `${testID}-menu`, options `${testID}-option-${value}`. */\r\n testID: string;\r\n /** Web only: render a real `<select>` (the select carries the plain `testID`); ignored off web. */\r\n native?: boolean;\r\n}\r\n\r\nfunction listboxTriggerAria(testID: string, hasList: boolean, highlighted: ControlOption | undefined): Record<string, string | undefined> {\r\n return {\r\n role: 'combobox',\r\n 'aria-controls': hasList ? listboxDomId(testID) : undefined,\r\n 'aria-activedescendant': highlighted !== undefined ? optionDomId(testID, highlighted.value) : undefined,\r\n };\r\n}\r\n\r\nexport function SelectControl(props: SelectControlProps): React.ReactElement {\r\n return props.native === true && IS_WEB ? <NativeSelect {...props} /> : <MenuSelectControl {...props} />;\r\n}\r\n\r\nfunction MenuSelectControl({\r\n options,\r\n value,\r\n onChange,\r\n placeholder = '',\r\n accessibilityLabel,\r\n accessibilityHint,\r\n labelledById,\r\n optionHint = '',\r\n menuAnchor,\r\n style,\r\n testID,\r\n}: SelectControlProps): React.ReactElement {\r\n const { theme } = useUi();\r\n const { colors, palette } = theme;\r\n const anchorRef = useRef<View>(null);\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const selectedLabel = useMemo(() => {\r\n const found = options.find((o) => o.value === value);\r\n return found?.label ?? placeholder;\r\n }, [options, placeholder, value]);\r\n\r\n const close = useCallback(() => { setIsOpen(false); }, []);\r\n const open = useCallback(() => { setIsOpen(true); }, []);\r\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\r\n const select = useCallback(\r\n (next: string) => {\r\n onChange(next);\r\n setIsOpen(false);\r\n },\r\n [onChange],\r\n );\r\n const listbox = useSelectListbox({ options, isOpen, open, toggle, select });\r\n const isListbox = menuAnchor !== undefined;\r\n const captureKeys: Record<string, unknown> = isListbox ? { onKeyDownCapture: listbox.onKeyDown } : {};\r\n const triggerAria = isListbox ? listboxTriggerAria(testID, isOpen && options.length > 0, listbox.highlighted) : {};\r\n\r\n return (\r\n <View ref={anchorRef} style={[s.anchor, style]} {...captureKeys}>\r\n <Pressable\r\n {...triggerAria}\r\n accessibilityRole={isListbox ? undefined : 'button'}\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityHint={accessibilityHint}\r\n accessibilityState={{ expanded: isOpen }}\r\n aria-expanded={isOpen}\r\n aria-haspopup={isListbox ? 'listbox' : 'menu'}\r\n aria-labelledby={labelledById}\r\n onBlur={isListbox ? close : undefined}\r\n onPress={toggle}\r\n style={[s.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}\r\n testID={`${testID}-trigger`}\r\n >\r\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: value === '' ? colors.textSecondary : colors.text }]}>\r\n {selectedLabel}\r\n </Text>\r\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\r\n </Pressable>\r\n {isOpen ? (\r\n <AnchoredMenu\r\n options={options}\r\n selectedValue={value}\r\n onSelect={select}\r\n onDismiss={close}\r\n colors={{ text: colors.text, ...(isListbox ? { textSecondary: colors.textSecondary } : null), border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\r\n optionHint={optionHint}\r\n testID={testID}\r\n anchorRef={anchorRef}\r\n accessibilityLabel={menuAnchor?.listboxLabel}\r\n listbox={isListbox ? { highlightedValue: listbox.highlighted?.value } : undefined}\r\n placement={isListbox ? { positionRef: menuAnchor.anchorRef } : undefined}\r\n />\r\n ) : null}\r\n </View>\r\n );\r\n}\r\n\r\nexport default SelectControl;\r\n","import React from 'react';\n\nimport { Field } from '../Field/Field';\nimport { SelectControl } from '../SelectControl/SelectControl';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { FieldLabelVariant } from '../Field/labelVariants';\n\nexport interface SelectFieldProps {\n label: string;\n accessibilityHint: string;\n value: string;\n options: readonly ControlOption[];\n onChange: (value: string) => void;\n testID: string;\n labelVariant?: FieldLabelVariant;\n}\n\nexport const SelectField = ({\n label,\n accessibilityHint,\n value,\n options,\n onChange,\n testID,\n labelVariant,\n}: SelectFieldProps): React.ReactElement => {\n const selected = options.find((option) => option.value === value)?.label ?? '';\n return (\n <Field label={label} labelVariant={labelVariant}>\n {({ labelId }) => (\n <SelectControl\n accessibilityHint={accessibilityHint}\n accessibilityLabel={`${label}: ${selected}`}\n labelledById={labelId}\n options={options}\n testID={testID}\n value={value}\n onChange={onChange}\n />\n )}\n </Field>\n );\n};\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text } from 'react-native';\n\nimport { CHIP_HIT_SLOP } from '../../ChipSelector/constants';\n\nimport type { ControlOption } from '../../controls/controlTypes';\n\nconst REMOVE_GLYPH = '×';\nconst CHIP_GAP = 4;\nconst CHIP_PAD_H = 8;\nconst CHIP_PAD_V = 4;\nconst CHIP_RADIUS = 999;\nconst CHIP_FONT = 13;\n\nconst styles = StyleSheet.create({\n chip: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: CHIP_GAP,\n paddingHorizontal: CHIP_PAD_H,\n paddingVertical: CHIP_PAD_V,\n borderWidth: 1,\n borderRadius: CHIP_RADIUS,\n maxWidth: '100%',\n },\n text: { fontSize: CHIP_FONT, flexShrink: 1 },\n});\n\nexport interface SelectedChipColors {\n text: string;\n border: string;\n surface: string;\n}\n\nexport interface SelectedChipProps {\n option: ControlOption;\n colors: SelectedChipColors;\n removeLabel: string;\n removeHint: string;\n onRemove: (value: string) => void;\n testID: string;\n}\n\n/** One chosen option inside a multi-select box; pressing it removes the option. */\nexport function SelectedChip({ option, colors, removeLabel, removeHint, onRemove, testID }: SelectedChipProps): React.ReactElement {\n return (\n <Pressable\n accessibilityHint={removeHint}\n accessibilityLabel={removeLabel}\n accessibilityRole=\"button\"\n hitSlop={CHIP_HIT_SLOP}\n style={[styles.chip, { borderColor: colors.border, backgroundColor: colors.surface }]}\n testID={testID}\n onPress={() => onRemove(option.value)}\n >\n <Text numberOfLines={1} style={[styles.text, { color: colors.text }]}>{option.label}</Text>\n <Text aria-hidden style={[styles.text, { color: colors.text }]}>{REMOVE_GLYPH}</Text>\n </Pressable>\n );\n}\n","import type { ControlOption } from '../../controls/controlTypes';\n\n/** Values with `value` appended once; an already chosen value leaves the list unchanged. */\nexport function addValue(values: readonly string[], value: string): string[] {\n return values.includes(value) ? [...values] : [...values, value];\n}\n\n/** Values without `value`. */\nexport function removeValue(values: readonly string[], value: string): string[] {\n return values.filter((current) => current !== value);\n}\n\n/** The chosen options, in the order they were chosen; unknown values are skipped. */\nexport function selectedOptions(options: readonly ControlOption[], values: readonly string[]): ControlOption[] {\n return values.flatMap((value) => options.filter((option) => option.value === value));\n}\n\n/** The options not chosen yet, in their original order. */\nexport function remainingOptions(options: readonly ControlOption[], values: readonly string[]): ControlOption[] {\n return options.filter((option) => !values.includes(option.value));\n}\n","import React, { useCallback, useRef, useState } from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { Field } from '../Field/Field';\nimport { SelectedChip } from './components/SelectedChip';\nimport { addValue, remainingOptions, removeValue, selectedOptions } from './utils/multiSelectValues';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { FieldLabelVariant } from '../Field/labelVariants';\n\nconst CHEVRON_DOWN = '▾';\nconst CHEVRON_UP = '▴';\nconst BOX_GAP = 6;\nconst TRIGGER_MIN_WIDTH = 96;\n\nconst styles = StyleSheet.create({\n box: { flexWrap: 'wrap', justifyContent: 'flex-start', gap: BOX_GAP },\n trigger: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n minHeight: MIN_TOUCH_TARGET_PX,\n minWidth: TRIGGER_MIN_WIDTH,\n },\n});\n\nexport interface MultiSelectChipLabels {\n removeLabel: (optionLabel: string) => string;\n removeHint: string;\n}\n\nexport interface MultiSelectFieldProps {\n label: string;\n accessibilityHint: string;\n values: readonly string[];\n options: readonly ControlOption[];\n onChange: (values: string[]) => void;\n placeholder: string;\n chipLabels: MultiSelectChipLabels;\n testID: string;\n labelVariant?: FieldLabelVariant;\n hint?: string;\n error?: string;\n}\n\ntype MultiSelectBoxProps = Omit<MultiSelectFieldProps, 'labelVariant' | 'hint' | 'error'> & { labelId: string };\n\nfunction MultiSelectBox(props: MultiSelectBoxProps): React.ReactElement {\n const { label, accessibilityHint, values, options, onChange, placeholder, chipLabels, testID, labelId } = props;\n const { colors, palette } = useUi().theme;\n const anchorRef = useRef<View>(null);\n const [isOpen, setIsOpen] = useState(false);\n const chosen = selectedOptions(options, values);\n const remaining = remainingOptions(options, values);\n const close = useCallback(() => { setIsOpen(false); }, []);\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const add = useCallback((next: string) => { onChange(addValue(values, next)); setIsOpen(false); }, [onChange, values]);\n const remove = useCallback((value: string) => { onChange(removeValue(values, value)); }, [onChange, values]);\n const chipColors = { text: colors.text, border: colors.border, surface: colors.surface };\n const summary = chosen.map((option) => option.label).join(', ');\n\n return (\n <View ref={anchorRef} style={s.anchor}>\n <View style={[s.selectTrigger, styles.box, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]} testID={`${testID}-box`}>\n {chosen.map((option) => (\n <SelectedChip\n key={option.value}\n colors={chipColors}\n option={option}\n removeHint={chipLabels.removeHint}\n removeLabel={chipLabels.removeLabel(option.label)}\n testID={`${testID}-chip-${option.value}`}\n onRemove={remove}\n />\n ))}\n <Pressable\n accessibilityHint={accessibilityHint}\n accessibilityLabel={`${label}: ${summary}`}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: isOpen, disabled: remaining.length === 0 }}\n aria-expanded={isOpen}\n aria-haspopup=\"menu\"\n aria-labelledby={labelId}\n disabled={remaining.length === 0}\n style={styles.trigger}\n testID={`${testID}-trigger`}\n onPress={toggle}\n >\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: colors.textSecondary }]}>{placeholder}</Text>\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\n </Pressable>\n </View>\n {isOpen ? (\n <AnchoredMenu\n anchorRef={anchorRef}\n colors={{ text: colors.text, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n optionHint={accessibilityHint}\n options={remaining}\n selectedValue=\"\"\n testID={testID}\n onDismiss={close}\n onSelect={add}\n />\n ) : null}\n </View>\n );\n}\n\n/** A labelled select that holds several values, shown as removable chips inside the select box. */\nexport const MultiSelectField = ({ labelVariant, hint, error, ...boxProps }: MultiSelectFieldProps): React.ReactElement => (\n <Field error={error} hint={hint} label={boxProps.label} labelVariant={labelVariant}>\n {({ labelId }) => <MultiSelectBox {...boxProps} labelId={labelId} />}\n </Field>\n);\n\nexport default MultiSelectField;\n","import { useCallback, useEffect, useRef } from 'react';\n\nconst CLOSE_DELAY_MS = 140;\n\nexport interface DelayedBlurClose {\n handleFocus: () => void;\n handleBlur: () => void;\n}\n\n/** Closes after blur with a delay so a tap on an option registers; a refocus or unmount cancels it. */\nexport function useDelayedBlurClose(open: () => void, close: () => void): DelayedBlurClose {\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const cancelClose = useCallback(() => {\n if (timerRef.current !== null) clearTimeout(timerRef.current);\n timerRef.current = null;\n }, []);\n\n useEffect(() => cancelClose, [cancelClose]);\n\n const handleFocus = useCallback(() => {\n cancelClose();\n open();\n }, [cancelClose, open]);\n const handleBlur = useCallback(() => {\n cancelClose();\n timerRef.current = setTimeout(close, CLOSE_DELAY_MS);\n }, [cancelClose, close]);\n\n return { handleFocus, handleBlur };\n}\n","/**\n * `suggestOptions` — the ranked substring matcher behind `TypeaheadControl`, generalized from\n * aml-v2's `suggestCountries` and promoted verbatim out of `@dloizides/ui-tables`' private\n * `Filters/utils/suggest.ts`.\n *\n * Ranks: value exact (0) > value prefix (1) > label prefix (2) > label contains (3); ties broken\n * by `label.localeCompare`. Empty/short queries return `[]` — nothing surfaces until `minChars`\n * is typed, mirroring a native `<datalist>`.\n */\nimport type { ControlOption } from './controlTypes';\n\nconst RANK_VALUE_EXACT = 0;\nconst RANK_VALUE_PREFIX = 1;\nconst RANK_LABEL_PREFIX = 2;\nconst RANK_LABEL_CONTAINS = 3;\nconst RANK_DETAIL_CONTAINS = 4;\nconst NO_MATCH = -1;\n\nfunction rankOf(option: ControlOption, needle: string): number {\n const value = option.value.toLowerCase();\n const label = option.label.toLowerCase();\n if (value === needle) return RANK_VALUE_EXACT;\n if (value.startsWith(needle)) return RANK_VALUE_PREFIX;\n if (label.startsWith(needle)) return RANK_LABEL_PREFIX;\n if (label.includes(needle)) return RANK_LABEL_CONTAINS;\n if ((option.detail ?? '').toLowerCase().includes(needle)) return RANK_DETAIL_CONTAINS;\n return NO_MATCH;\n}\n\n/**\n * Rank + cap the options matching `query`. Returns `[]` until `query` (trimmed) is at least\n * `minChars` long, then the best `limit` matches, ranked as documented above.\n */\nexport function suggestOptions(\n options: readonly ControlOption[],\n query: string,\n minChars: number,\n limit: number,\n): readonly ControlOption[] {\n const needle = query.trim().toLowerCase();\n if (needle.length < minChars) return [];\n\n const scored: Array<{ option: ControlOption; rank: number }> = [];\n for (const option of options) {\n const rank = rankOf(option, needle);\n if (rank !== NO_MATCH) scored.push({ option, rank });\n }\n scored.sort((a, b) => (a.rank !== b.rank ? a.rank - b.rank : a.option.label.localeCompare(b.option.label)));\n return scored.slice(0, limit).map((entry) => entry.option);\n}\n\n/** True when `text` is non-empty yet matches no option's value or label exactly (case-insensitive). */\nexport function isUnmatched(options: readonly ControlOption[], text: string): boolean {\n const needle = text.trim().toLowerCase();\n if (needle === '') return false;\n return !options.some((o) => o.value.toLowerCase() === needle || o.label.toLowerCase() === needle);\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { TypeaheadSearch } from '../types';\n\nexport const DEFAULT_TYPEAHEAD_DEBOUNCE_MS = 250;\n\nexport interface TypeaheadSearchState {\n readonly results: readonly ControlOption[];\n readonly isLoading: boolean;\n readonly hasFailed: boolean;\n readonly hasSettled: boolean;\n}\n\nconst IDLE: TypeaheadSearchState = { results: [], isLoading: false, hasFailed: false, hasSettled: false };\n\n/** Debounced search: each new query aborts the last one, so an older response can never land. */\nexport function useTypeaheadSearch(\n load: TypeaheadSearch['load'] | undefined,\n query: string,\n enabled: boolean,\n debounceMs: number,\n): TypeaheadSearchState {\n const [state, setState] = useState(IDLE);\n const loadRef = useRef(load);\n loadRef.current = load;\n\n useEffect(() => {\n if (!enabled) {\n setState(IDLE);\n return undefined;\n }\n setState((current) => ({ ...current, isLoading: true, hasFailed: false }));\n const controller = new AbortController();\n const settle = (next: TypeaheadSearchState): void => {\n if (!controller.signal.aborted) setState(next);\n };\n const timer = setTimeout(() => {\n Promise.resolve()\n .then(() => loadRef.current?.(query, controller.signal) ?? [])\n .then(\n (results) => settle({ results, isLoading: false, hasFailed: false, hasSettled: true }),\n () => settle({ results: [], isLoading: false, hasFailed: true, hasSettled: true }),\n );\n }, debounceMs);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [query, enabled, debounceMs]);\n\n return state;\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport type { NativeSyntheticEvent, TextInputKeyPressEventData } from 'react-native';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { NO_HIGHLIGHT, nextHighlight } from '../../controls/nextHighlight';\nimport { suggestOptions } from '../../controls/suggestOptions';\nimport type { TypeaheadSearch } from '../types';\nimport { DEFAULT_TYPEAHEAD_DEBOUNCE_MS, useTypeaheadSearch, type TypeaheadSearchState } from './useTypeaheadSearch';\n\nconst FORWARD = 1;\nconst BACKWARD = -1;\nconst NO_ROWS: readonly ControlOption[] = [];\n\nexport interface TypeaheadStateInput {\n options: readonly ControlOption[] | undefined;\n search: TypeaheadSearch | undefined;\n value: string;\n minChars: number;\n maxSuggestions: number;\n onChange: (value: string) => void;\n onSubmit: (() => void) | undefined;\n}\n\nexport interface TypeaheadState {\n rows: readonly ControlOption[];\n statusText: string | undefined;\n isOpen: boolean;\n picked: ControlOption | null;\n highlighted: ControlOption | undefined;\n open: () => void;\n close: () => void;\n selectValue: (value: string) => void;\n handleChange: (next: string) => void;\n handleKeyPress: (event: NativeSyntheticEvent<TextInputKeyPressEventData>) => void;\n handleSubmit: () => void;\n}\n\nfunction searchStatusText(found: TypeaheadSearchState, search: TypeaheadSearch): string | undefined {\n if (found.hasFailed) return search.errorText;\n if (found.results.length > 0) return undefined;\n if (found.isLoading) return search.loadingText;\n return found.hasSettled ? search.emptyText : undefined;\n}\n\nfunction useTypeaheadRows(\n input: TypeaheadStateInput,\n isOpen: boolean,\n isPicked: boolean,\n): { rows: readonly ControlOption[]; statusText: string | undefined } {\n const { options, search, value, minChars, maxSuggestions } = input;\n const query = value.trim();\n const isSearching = search !== undefined && isOpen && !isPicked && query.length >= minChars;\n const found = useTypeaheadSearch(search?.load, query, isSearching, search?.debounceMs ?? DEFAULT_TYPEAHEAD_DEBOUNCE_MS);\n const staticRows = useMemo(() => {\n if (options === undefined || options.some((o) => o.label === value)) return NO_ROWS;\n return suggestOptions(options, value, minChars, maxSuggestions);\n }, [options, value, minChars, maxSuggestions]);\n const foundRows = useMemo(() => found.results.slice(0, maxSuggestions), [found.results, maxSuggestions]);\n if (search === undefined) return { rows: staticRows, statusText: undefined };\n return { rows: foundRows, statusText: searchStatusText(found, search) };\n}\n\n/** Everything `TypeaheadControl` decides: rows, open state, highlight, pick and key handling. */\nexport function useTypeaheadState(input: TypeaheadStateInput): TypeaheadState {\n const { search, value, onChange, onSubmit } = input;\n const [isOpen, setIsOpen] = useState(false);\n const [picked, setPicked] = useState<ControlOption | null>(null);\n const [highlightIndex, setHighlightIndex] = useState(NO_HIGHLIGHT);\n const { rows, statusText } = useTypeaheadRows(input, isOpen, picked !== null && picked.label === value);\n const rowKey = rows.map((row) => row.value).join('\\n');\n const highlighted: ControlOption | undefined = isOpen ? rows[highlightIndex] : undefined;\n\n useEffect(() => setHighlightIndex(NO_HIGHLIGHT), [rowKey]);\n useEffect(() => setPicked((current) => (current !== null && current.label !== value ? null : current)), [value]);\n\n const open = useCallback(() => setIsOpen(true), []);\n const close = useCallback(() => {\n setIsOpen(false);\n setHighlightIndex(NO_HIGHLIGHT);\n }, []);\n const pick = useCallback(\n (option: ControlOption) => {\n setPicked(option);\n onChange(option.label);\n search?.onPick(option);\n close();\n },\n [onChange, search, close],\n );\n const selectValue = useCallback(\n (optionValue: string) => {\n const option = rows.find((row) => row.value === optionValue);\n if (option !== undefined) pick(option);\n },\n [rows, pick],\n );\n const handleChange = useCallback(\n (next: string) => {\n if (picked !== null) {\n setPicked(null);\n search?.onPick(null);\n }\n onChange(next);\n setIsOpen(true);\n setHighlightIndex(NO_HIGHLIGHT);\n },\n [picked, search, onChange],\n );\n const handleKeyPress = useTypeaheadKeys({ rowCount: rows.length, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick });\n const handleSubmit = useCallback(() => {\n if (highlighted !== undefined) {\n pick(highlighted);\n return;\n }\n close();\n onSubmit?.();\n }, [highlighted, pick, close, onSubmit]);\n\n return { rows, statusText, isOpen, picked, highlighted, open, close, selectValue, handleChange, handleKeyPress, handleSubmit };\n}\n\ninterface TypeaheadKeysInput {\n rowCount: number;\n isOpen: boolean;\n highlighted: ControlOption | undefined;\n setIsOpen: (isOpen: boolean) => void;\n setHighlightIndex: (update: (current: number) => number) => void;\n close: () => void;\n pick: (option: ControlOption) => void;\n}\n\nfunction useTypeaheadKeys(input: TypeaheadKeysInput): TypeaheadState['handleKeyPress'] {\n const { rowCount, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick } = input;\n return useCallback(\n (event) => {\n const { key } = event.nativeEvent;\n if (key === 'ArrowDown' || key === 'ArrowUp') {\n event.preventDefault();\n setIsOpen(true);\n setHighlightIndex((current) => nextHighlight(current, rowCount, key === 'ArrowDown' ? FORWARD : BACKWARD));\n } else if (key === 'Escape' && isOpen) {\n event.preventDefault();\n close();\n } else if (key === 'Enter' && highlighted !== undefined) {\n event.preventDefault();\n pick(highlighted);\n }\n },\n [rowCount, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick],\n );\n}\n","/**\n * `TypeaheadControl` — a search-as-you-type combobox (aml-v2's CountryPicker, generalized). A\n * text input plus a floating {@link AnchoredMenu} of ranked suggestions ({@link suggestOptions});\n * picking one fills the canonical label.\n *\n * Free typing is PRESERVED: the value is the raw text, so a caller can accept \"CY\", \"cyprus\" or\n * \"Cyprus (CY)\" and normalise it themselves at query time, exactly as aml does. An optional\n * PRE-LOCALIZED `error` shows a persistent banner and tints the border.\n *\n * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/TypeaheadField`.\n *\n * Label-free by design — wrap in a `Field` for the label/hint slots.\n */\nimport React, { forwardRef, useRef, type ForwardedRef } from 'react';\n\nimport { TextInput, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { listboxDomId, optionDomId } from '../AnchoredMenu/components/OptionRow';\nimport { useKeepAnchorInRoom } from '../AnchoredMenu/menuPortal';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\nimport { useDelayedBlurClose } from './hooks/useDelayedBlurClose';\nimport { useTypeaheadState } from './hooks/useTypeaheadState';\nimport type { FieldControlWiring, TypeaheadSearch } from './types';\n\nexport type { TypeaheadSearch } from './types';\n\n/** Default min characters before suggestions surface. */\nexport const DEFAULT_TYPEAHEAD_MIN_CHARS = 1;\n/** Default cap on rendered suggestions. */\nexport const DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS = 8;\n\ninterface TypeaheadCommonProps {\n /** The raw text in the box — NOT necessarily an option value. */\n value: string;\n onChange: (value: string) => void;\n /** Called on Enter/submit (after the menu closes). Omit if the surface has nothing to commit. */\n onSubmit?: () => void;\n placeholder?: string;\n /** PRE-LOCALIZED accessible name of the input. */\n accessibilityLabel: string;\n accessibilityHint?: string;\n /** PRE-LOCALIZED accessibility hint applied to every suggestion. */\n optionHint?: string;\n /** PRE-LOCALIZED inline error (e.g. \"Unrecognised country\"). Shows a persistent banner. */\n error?: string;\n /** Minimum characters before suggestions surface. Default 1. */\n minChars?: number;\n /** Merged LAST onto the anchor wrapper. */\n style?: StyleProp<ViewStyle>;\n /** Input is `${testID}-input`, menu `${testID}-menu`, error `${testID}-error`. */\n testID: string;\n}\n\nexport interface TypeaheadControlProps extends TypeaheadCommonProps {\n options: readonly ControlOption[];\n maxSuggestions?: number;\n}\n\nexport interface TypeaheadSearchProps extends TypeaheadCommonProps {\n search: TypeaheadSearch;\n}\n\nfunction comboboxAria(testID: string, isExpanded: boolean, highlighted: ControlOption | undefined): Record<string, string | boolean | undefined> {\n return {\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': isExpanded,\n 'aria-controls': isExpanded ? listboxDomId(testID) : undefined,\n 'aria-activedescendant': highlighted !== undefined ? optionDomId(testID, highlighted.value) : undefined,\n };\n}\n\nfunction TypeaheadControlImpl(props: (TypeaheadControlProps | TypeaheadSearchProps) & FieldControlWiring, ref: ForwardedRef<TextInput>): React.ReactElement {\n const { value, onChange, onSubmit, placeholder, accessibilityLabel, accessibilityHint, optionHint = '', error, minChars = DEFAULT_TYPEAHEAD_MIN_CHARS, style, testID } = props;\n const { id, describedById } = props;\n const search = 'search' in props ? props.search : undefined;\n const options = 'options' in props ? props.options : undefined;\n const maxSuggestions = ('search' in props ? props.search.maxResults : props.maxSuggestions) ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS;\n const { theme } = useUi();\n const { colors, palette } = theme;\n const anchorRef = useRef<View>(null);\n const state = useTypeaheadState({ options, search, value, minChars, maxSuggestions, onChange, onSubmit });\n const { handleFocus, handleBlur } = useDelayedBlurClose(state.open, state.close);\n const showMenu = state.isOpen && (state.rows.length > 0 || state.statusText !== undefined);\n const isExpanded = state.isOpen && state.rows.length > 0;\n const hasError = error !== undefined && error !== '';\n useKeepAnchorInRoom(anchorRef, search?.scrollMarginTop ?? 0, search !== undefined && state.isOpen);\n\n return (\n <View ref={anchorRef} style={[s.anchor, style]}>\n <TextInput\n ref={ref}\n id={id}\n {...comboboxAria(testID, isExpanded, state.highlighted)}\n {...webFieldA11y({ describedById })}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n autoCapitalize=\"none\"\n autoComplete=\"off\"\n autoCorrect={false}\n blurOnSubmit={search === undefined}\n placeholder={placeholder}\n placeholderTextColor={colors.textSecondary}\n spellCheck={false}\n value={value}\n onChangeText={state.handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyPress={state.handleKeyPress}\n onSubmitEditing={state.handleSubmit}\n style={[s.input, { borderColor: hasError ? fieldErrorInk(theme) : colors.border, backgroundColor: colors.surface, color: colors.text }]}\n testID={search?.inputTestID ?? `${testID}-input`}\n />\n {showMenu ? (\n <AnchoredMenu\n accessibilityLabel={accessibilityLabel}\n options={state.rows}\n selectedValue={search !== undefined ? (state.picked?.value ?? '') : value}\n onSelect={state.selectValue}\n onDismiss={state.close}\n colors={{ text: colors.text, textSecondary: colors.textSecondary, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n optionHint={optionHint}\n testID={testID}\n anchorRef={anchorRef}\n listbox={{ highlightedValue: state.highlighted?.value ?? '', statusText: state.statusText }}\n // Portal the suggestions to document.body on web: a typeahead sits in a filter row above\n // other content (fields, guides, a results table), and the in-tree popover was painted\n // under / clipped by it (\"hidden below\"). The portal escapes that stacking + clipping.\n usePortal\n />\n ) : null}\n {hasError ? (\n <Text role=\"alert\" style={[s.error, { color: fieldErrorInk(theme) }]} testID={`${testID}-error`}>\n {error}\n </Text>\n ) : null}\n </View>\n );\n}\n\nexport const TypeaheadControl = forwardRef(TypeaheadControlImpl);\n\nexport default TypeaheadControl;\n","import React from 'react';\n\nimport { StyleSheet, type TextStyle } from 'react-native';\n\nimport { controlStyles } from '../../controls/controlStyles';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nconst NATIVE_INPUT_BOX: React.CSSProperties = {\n borderStyle: 'solid',\n boxSizing: 'border-box',\n fontFamily: 'inherit',\n width: '100%',\n};\n\ninterface WebDateInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n webInputType: string;\n}\n\nexport function buildNativeInputStyle(themed: TextStyle): React.CSSProperties {\n const { paddingHorizontal, paddingVertical, ...box } = StyleSheet.flatten(controlStyles.input);\n return {\n ...box,\n ...themed,\n ...NATIVE_INPUT_BOX,\n paddingBlock: paddingVertical,\n paddingInline: paddingHorizontal,\n } as React.CSSProperties;\n}\n\n/** A real DOM input: react-native-web's `TextInput` discards a `type` prop, so it cannot open a calendar. */\nexport function WebDateInput({ fieldProps, context, webInputType }: WebDateInputProps): React.ReactElement {\n const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });\n const webA11y = webFieldA11y({\n describedById: context.describedById,\n hasError: context.hasError,\n required,\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => onChange(event.target.value);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(hoverBind as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(focusBind as unknown as React.InputHTMLAttributes<HTMLInputElement>)}\n aria-label={label}\n data-testid={testID}\n disabled={disabled}\n id={context.controlId}\n max={max}\n min={min}\n style={buildNativeInputStyle(style)}\n title={accessibilityHint}\n type={webInputType}\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n />\n );\n}\n","import React from 'react';\n\nimport { GlyphName } from './GlyphName';\n\nconst PATHS: Readonly<Record<GlyphName, string>> = {\n [GlyphName.Calendar]: 'M7 3v3M17 3v3M4 9h16M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z',\n [GlyphName.Previous]: 'M15 5l-7 7 7 7',\n [GlyphName.Next]: 'M9 5l7 7-7 7',\n};\nconst SIZE = 18;\nconst STROKE = 2;\n\n/** A line glyph for an `IconButton` `renderIcon`, drawn in the colour the button hands it. */\nexport function Glyph({ name, color }: { name: GlyphName; color: string }): React.ReactElement {\n return (\n <svg aria-hidden=\"true\" fill=\"none\" height={SIZE} stroke={color} strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={STROKE} viewBox=\"0 0 24 24\" width={SIZE}>\n <path d={PATHS[name]} />\n </svg>\n );\n}\n","import { resolveOnBrand } from '@dloizides/design-tokens';\nimport { useUi } from '@dloizides/ui-feedback';\n\nexport interface PickerColors {\n text: string;\n textSecondary: string;\n border: string;\n surface: string;\n brand: string;\n onBrand: string;\n tint: string;\n}\n\nconst TINT_STEP = '100';\n\nexport function usePickerColors(): PickerColors {\n const { theme } = useUi();\n const brand = theme.palette.primary['500'];\n return {\n text: theme.colors.text,\n textSecondary: theme.colors.textSecondary,\n border: theme.colors.border,\n surface: theme.colors.surface,\n brand,\n onBrand: resolveOnBrand(brand),\n tint: theme.palette.primary[TINT_STEP] ?? theme.colors.background,\n };\n}\n","import React, { useRef, type CSSProperties, type KeyboardEvent, type ReactNode } from 'react';\n\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nexport interface PickerDialogProps {\n testID: string;\n sheet: boolean;\n onDismiss: () => void;\n children: ReactNode;\n}\n\nconst FOCUSABLE = 'button, select, input, [tabindex]';\nconst RADIUS = 12;\nconst SHEET_RADIUS = 16;\nconst PAD = 12;\nconst SHEET_MAX_HEIGHT = '90vh';\n\n/** The focusable controls inside `container` in DOM order, skipping disabled and roving (-1) ones. */\nexport function tabStops(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (node) => node.tabIndex >= 0 && !node.hasAttribute('disabled') && node.getAttribute('aria-disabled') !== 'true',\n );\n}\n\n/** The date dialog body inside the named modal: Tab and Shift+Tab wrap inside it, Escape closes it. */\nexport function PickerDialog({ testID, sheet, onDismiss, children }: PickerDialogProps): React.ReactElement {\n const colors = usePickerColors();\n const ref = useRef<HTMLDivElement>(null);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onDismiss();\n return;\n }\n if (event.key !== 'Tab' || ref.current === null) return;\n const stops = tabStops(ref.current);\n const first = stops[0];\n const last = stops[stops.length - 1];\n if (first === undefined || last === undefined) return;\n const atEdge = event.shiftKey ? document.activeElement === first : document.activeElement === last;\n if (!atEdge) return;\n event.preventDefault();\n (event.shiftKey ? last : first).focus();\n };\n\n const shape: CSSProperties = sheet\n ? { borderTopLeftRadius: SHEET_RADIUS, borderTopRightRadius: SHEET_RADIUS, width: '100%', maxHeight: SHEET_MAX_HEIGHT, overflowY: 'auto' }\n : { borderRadius: RADIUS, boxShadow: `0 12px 32px ${colors.border}` };\n const style: CSSProperties = { boxSizing: 'border-box', padding: PAD, background: colors.surface, color: colors.text, border: `1px solid ${colors.border}`, fontFamily: 'inherit', ...shape };\n\n return (\n <div ref={ref} data-testid={testID} data-variant={sheet ? 'sheet' : 'popover'} style={style} onKeyDown={onKeyDown}>\n {children}\n </div>\n );\n}\n","import { useEffect, useState, type RefObject } from 'react';\n\nimport type { View } from 'react-native';\n\nimport type { AnchorRect } from '../utils/dropdownFrame';\n\n/** The anchor box in window coordinates, measured once when the list opens. */\nexport function useAnchorRect(anchorRef: RefObject<View | null>): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null);\n useEffect(() => {\n anchorRef.current?.measureInWindow((x, y, width, height) => setRect({ x, y, width, height }));\n }, [anchorRef]);\n return rect;\n}\n","export enum DropdownPlacement {\n Below = 'below',\n Above = 'above',\n}\n","import { DropdownPlacement } from '../DropdownPlacement';\n\nconst MIN_PANEL_WIDTH = 240;\nconst EDGE = 8;\n\nexport interface AnchorRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DropdownFrame {\n placement: DropdownPlacement;\n left: number;\n width: number;\n top?: number;\n bottom?: number;\n}\n\n/** Opens below when the list fits there, else on whichever side has more room. */\nexport function placeDropdown(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement {\n const roomBelow = viewportHeight - (anchor.y + anchor.height);\n if (roomBelow >= panelHeight) return DropdownPlacement.Below;\n return anchor.y > roomBelow ? DropdownPlacement.Above : DropdownPlacement.Below;\n}\n\nfunction placeBelowFirst(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement {\n const roomBelow = viewportHeight - (anchor.y + anchor.height);\n const fitsOnlyAbove = roomBelow < panelHeight && anchor.y - EDGE >= panelHeight;\n return fitsOnlyAbove ? DropdownPlacement.Above : DropdownPlacement.Below;\n}\n\nfunction clampTop(top: number, panelHeight: number, viewportHeight: number): number {\n return Math.max(EDGE, Math.min(top, viewportHeight - panelHeight - EDGE));\n}\n\n/** The window frame for the list next to `anchor`, kept inside the viewport; `preferBelow` opens under the field unless only the room above fits the list. */\nexport function dropdownFrame(anchor: AnchorRect, panelHeight: number, viewportHeight: number, preferBelow = false): DropdownFrame {\n const placement = preferBelow ? placeBelowFirst(anchor, panelHeight, viewportHeight) : placeDropdown(anchor, panelHeight, viewportHeight);\n const base = { placement, left: anchor.x, width: anchor.width };\n if (placement === DropdownPlacement.Above) return { ...base, bottom: viewportHeight - clampTop(anchor.y - panelHeight, panelHeight, viewportHeight) - panelHeight };\n return { ...base, top: clampTop(anchor.y + anchor.height, panelHeight, viewportHeight) };\n}\n\n/** Widens a narrow anchor's list to `minWidth` (default a readable width) and keeps it inside the viewport. */\nexport function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number, minWidth = MIN_PANEL_WIDTH): DropdownFrame {\n const width = Math.max(frame.width, Math.min(minWidth, viewportWidth - EDGE - EDGE));\n const left = Math.max(EDGE, Math.min(frame.left, viewportWidth - width - EDGE));\n return { ...frame, width, left: frame.width >= width ? frame.left : left };\n}\n","import React, { useCallback, useState, type RefObject } from 'react';\n\nimport { Animated, Modal, Pressable, StyleSheet, useWindowDimensions, type LayoutChangeEvent, type View } from 'react-native';\n\nimport { useAnchorRect } from '../hooks/useAnchorRect';\nimport { dropdownFrame, fitDropdownWidth } from '../utils/dropdownFrame';\n\nexport interface DropdownSurfaceProps {\n progress: Animated.Value;\n translateY: Animated.AnimatedInterpolation<number>;\n anchorRef: RefObject<View | null>;\n onDismiss: () => void;\n closeLabel: string;\n closeHint: string;\n testID: string;\n children: React.ReactNode;\n /** Smallest panel width; defaults to the list width. */\n minWidth?: number;\n /** Optional grow-from-the-field scale, applied from the top-left corner. */\n scale?: Animated.AnimatedInterpolation<number>;\n /** Accessible name of the modal dialog; omitted = unnamed, as before. */\n accessibilityLabel?: string;\n /** Always open under the field, moved up to stay inside the viewport. */\n preferBelow?: boolean;\n}\n\n/** The computer surface: a layer above the page beside the field, opening upward when there is no room below. */\nexport function DropdownSurface({ progress, translateY, anchorRef, onDismiss, closeLabel, closeHint, testID, children, minWidth, scale, accessibilityLabel, preferBelow = false }: DropdownSurfaceProps): React.ReactElement {\n const { height: viewportHeight, width: viewportWidth } = useWindowDimensions();\n const anchor = useAnchorRect(anchorRef);\n const [panelHeight, setPanelHeight] = useState(0);\n const onLayout = useCallback((event: LayoutChangeEvent) => setPanelHeight(event.nativeEvent.layout.height), []);\n const frame = anchor === null ? null : fitDropdownWidth(dropdownFrame(anchor, panelHeight, viewportHeight, preferBelow), viewportWidth, minWidth);\n const place = frame === null ? null : { left: frame.left, width: frame.width, top: frame.top, bottom: frame.bottom };\n\n return (\n <Modal transparent visible animationType=\"none\" aria-label={accessibilityLabel} onRequestClose={onDismiss}>\n <Pressable accessibilityHint={closeHint} accessibilityLabel={closeLabel} accessibilityRole=\"button\" style={StyleSheet.absoluteFill} testID={`${testID}-backdrop`} onPress={onDismiss} />\n {frame !== null ? (\n <Animated.View style={[styles.dropdown, place, { opacity: progress, transform: scale === undefined ? [{ translateY }] : [{ translateY }, { scale }] }, scale === undefined ? null : styles.growFromField]} testID={`${testID}-dropdown-${frame.placement}`} onLayout={onLayout}>\n {children}\n </Animated.View>\n ) : null}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n dropdown: { position: 'absolute' },\n growFromField: { transformOrigin: 'top left' },\n});\n","import React from 'react';\n\nimport { Animated, Modal, Pressable, StyleSheet, View } from 'react-native';\n\nexport interface SheetSurfaceProps {\n translateY: Animated.AnimatedInterpolation<number>;\n onDismiss: () => void;\n closeLabel: string;\n closeHint: string;\n testID: string;\n children: React.ReactNode;\n /** Optional fade, 0 to 1. */\n progress?: Animated.Value;\n /** Optional grow scale, applied from the bottom edge. */\n scale?: Animated.AnimatedInterpolation<number>;\n /** Accessible name of the modal dialog; omitted = unnamed, as before. */\n accessibilityLabel?: string;\n}\n\n/** The phone surface: a bottom sheet over a backdrop that closes the list when tapped. */\nexport function SheetSurface({ translateY, onDismiss, closeLabel, closeHint, testID, children, progress, scale, accessibilityLabel }: SheetSurfaceProps): React.ReactElement {\n return (\n <Modal transparent visible animationType=\"none\" aria-label={accessibilityLabel} onRequestClose={onDismiss}>\n <View style={styles.backdrop}>\n <Pressable accessibilityHint={closeHint} accessibilityLabel={closeLabel} accessibilityRole=\"button\" style={StyleSheet.absoluteFill} testID={`${testID}-backdrop`} onPress={onDismiss} />\n <Animated.View testID={`${testID}-sheet`} style={[styles.sheet, { transform: scale === undefined ? [{ translateY }] : [{ translateY }, { scale }] }, progress === undefined ? null : { opacity: progress }]}>{children}</Animated.View>\n </View>\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n backdrop: { flex: 1, justifyContent: 'flex-end' },\n sheet: { width: '100%', alignSelf: 'stretch' },\n});\n","import { useEffect, useState } from 'react';\n\nimport { AccessibilityInfo } from 'react-native';\n\n/** True when the user asked the system to reduce motion. */\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n let active = true;\n AccessibilityInfo.isReduceMotionEnabled()\n .then((value) => {\n if (active) setReduced(value);\n })\n .catch(() => undefined);\n const subscription: { remove: () => void } | undefined = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduced);\n return () => {\n active = false;\n subscription?.remove();\n };\n }, []);\n return reduced;\n}\n","import type { DatePickerLabels } from '../types';\n\nexport const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels = {\n dialog: 'Choose a date',\n rangeDialog: 'Choose a date range',\n openCalendar: 'Open calendar',\n openCalendarHint: 'Opens a calendar to pick the date',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n monthHint: 'Shows another month',\n month: 'Month',\n year: 'Year',\n dayHint: 'Picks this day',\n setDate: 'Set date',\n setDateHint: 'Saves the picked date',\n clear: 'Clear',\n clearHint: 'Removes the date',\n cancel: 'Cancel',\n cancelHint: 'Closes without changes',\n apply: 'Apply',\n applyHint: 'Saves the picked range',\n presets: 'Quick ranges',\n presetHint: 'Sets the range to this period',\n today: 'Today',\n last7Days: 'Last 7 days',\n thisMonth: 'This month',\n quarter: 'Quarter',\n dayCount: '{{p1}} days',\n invalidDate: 'Enter a real date',\n rangeSeparator: ' – ',\n rangeOrder: 'The start must be on or before the end',\n outOfRange: 'This date is outside the allowed range',\n};\n","export interface DayParts {\n year: number;\n month: number;\n day: number;\n}\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst MONTHS_IN_YEAR = 12;\nconst DAYS_IN_WEEK = 7;\nconst PAD = 2;\nconst YEAR_PAD = 4;\nconst SUNDAY = 0;\nconst MONDAY = 1;\nconst MS_PER_DAY = 86_400_000;\nconst MONTH_PREFIX = 'YYYY-MM'.length;\nconst EPOCH = { year: 1970, month: 1, day: 1 };\n\nexport function daysInMonth(year: number, month: number): number {\n return new Date(Date.UTC(year, month, 0)).getUTCDate();\n}\n\nexport function isValidParts({ year, month, day }: DayParts): boolean {\n const inMonth = month >= 1 && month <= MONTHS_IN_YEAR;\n return Number.isInteger(year) && year > 0 && inMonth && Number.isInteger(day) && day >= 1 && day <= daysInMonth(year, month);\n}\n\nexport function parseIso(value: string): DayParts | null {\n const match = ISO_DATE.exec(value);\n if (match === null) return null;\n const parts = { year: Number(match[1]), month: Number(match[2]), day: Number(match[3]) };\n return isValidParts(parts) ? parts : null;\n}\n\nexport function toIso({ year, month, day }: DayParts): string {\n return `${String(year).padStart(YEAR_PAD, '0')}-${String(month).padStart(PAD, '0')}-${String(day).padStart(PAD, '0')}`;\n}\n\nfunction toUtc(iso: string): Date {\n const parts = parseIso(iso) ?? EPOCH;\n return new Date(Date.UTC(parts.year, parts.month - 1, parts.day));\n}\n\nfunction fromUtc(date: Date): string {\n return toIso({ year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate() });\n}\n\nexport function addDays(iso: string, days: number): string {\n const date = toUtc(iso);\n date.setUTCDate(date.getUTCDate() + days);\n return fromUtc(date);\n}\n\nexport function addMonths(iso: string, months: number): string {\n const parts = parseIso(iso) ?? EPOCH;\n const index = parts.year * MONTHS_IN_YEAR + (parts.month - 1) + months;\n const year = Math.floor(index / MONTHS_IN_YEAR);\n const month = (index % MONTHS_IN_YEAR) + 1;\n return toIso({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) });\n}\n\n/** Days after the week start `firstDay` (1 = Monday ... 7 = Sunday). */\nexport function weekdayIndex(iso: string, firstDay = MONDAY): number {\n const day = toUtc(iso).getUTCDay();\n const isoDay = day === SUNDAY ? DAYS_IN_WEEK : day;\n return (isoDay - firstDay + DAYS_IN_WEEK) % DAYS_IN_WEEK;\n}\n\nexport function daysBetweenInclusive(from: string, to: string): number {\n return Math.round((toUtc(to).getTime() - toUtc(from).getTime()) / MS_PER_DAY) + 1;\n}\n\nexport function isWithinBounds(iso: string, min?: string, max?: string): boolean {\n const aboveMin = min === undefined || min === '' || iso >= min.slice(0, iso.length);\n const belowMax = max === undefined || max === '' || iso <= max.slice(0, iso.length);\n return aboveMin && belowMax;\n}\n\nexport function clampToBounds(iso: string, min?: string, max?: string): string {\n if (min !== undefined && min !== '' && iso < min.slice(0, iso.length)) return min.slice(0, iso.length);\n if (max !== undefined && max !== '' && iso > max.slice(0, iso.length)) return max.slice(0, iso.length);\n return iso;\n}\n\nexport function todayIso(now: Date = new Date()): string {\n return toIso({ year: now.getFullYear(), month: now.getMonth() + 1, day: now.getDate() });\n}\n\nexport function monthStart(iso: string): string {\n return `${iso.slice(0, MONTH_PREFIX)}-01`;\n}\n","import { DatePart } from './DatePart';\nimport { isValidParts, parseIso, toIso } from './isoDate';\n\nconst SAMPLE_UTC = Date.UTC(2027, 5, 12);\nconst TWO_DIGIT_YEAR = 100;\nconst CENTURY = 2000;\nconst PART_COUNT = 3;\nconst PAD = 2;\nconst MONDAY = 1;\nconst ISO_LIKE = /^\\d{4}-\\d{1,2}-\\d{1,2}$/;\nconst MONTH_INDEXES = Array.from({ length: 12 }, (_unused, index) => index);\nconst WEEK_OFFSETS = Array.from({ length: 7 }, (_unused, index) => index);\nconst UTC = 'UTC';\nconst PART_OF: Readonly<Partial<Record<string, DatePart>>> = { day: DatePart.Day, month: DatePart.Month, year: DatePart.Year };\n\nfunction utcOf(iso: string): Date | null {\n const parts = parseIso(iso);\n return parts === null ? null : new Date(Date.UTC(parts.year, parts.month - 1, parts.day));\n}\n\nfunction formatWith(iso: string, locale: string | undefined, options: Intl.DateTimeFormatOptions): string {\n const date = utcOf(iso);\n if (date === null) return iso;\n return new Intl.DateTimeFormat(locale, { ...options, timeZone: UTC }).format(date).replace(/,/g, '');\n}\n\n/** The closed-field display, e.g. en-GB `Sat 12 Jun 2027`. */\nexport function formatDisplay(iso: string, locale?: string): string {\n return formatWith(iso, locale, { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' });\n}\n\nexport function formatShort(iso: string, locale?: string, withYear = true): string {\n return formatWith(iso, locale, withYear ? { day: 'numeric', month: 'short', year: 'numeric' } : { day: 'numeric', month: 'short' });\n}\n\nexport function formatMonthYear(iso: string, locale?: string): string {\n return formatWith(iso, locale, { month: 'long', year: 'numeric' });\n}\n\nexport function monthNames(locale?: string): string[] {\n const format = new Intl.DateTimeFormat(locale, { month: 'long', timeZone: UTC });\n return MONTH_INDEXES.map((month) => format.format(new Date(Date.UTC(2024, month, 1))));\n}\n\n/** Short weekday names starting on `firstDay` (1 = Monday ... 7 = Sunday). */\nexport function weekdayNames(locale?: string, firstDay = MONDAY): string[] {\n const format = new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: UTC });\n return WEEK_OFFSETS.map((offset) => format.format(new Date(Date.UTC(2024, 0, firstDay + offset))));\n}\n\nexport function typedOrder(locale?: string): DatePart[] {\n const parts = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'numeric', year: 'numeric', timeZone: UTC }).formatToParts(new Date(SAMPLE_UTC));\n return parts.map((part) => PART_OF[part.type]).filter((part): part is DatePart => part !== undefined);\n}\n\n/** The numeric form shown while typing, in the locale's order, e.g. en-GB `02/06/2027`. */\nexport function formatTyped(iso: string, locale?: string): string {\n const parts = parseIso(iso);\n if (parts === null) return iso;\n const text: Record<DatePart, string> = {\n [DatePart.Day]: String(parts.day).padStart(PAD, '0'),\n [DatePart.Month]: String(parts.month).padStart(PAD, '0'),\n [DatePart.Year]: String(parts.year),\n };\n return typedOrder(locale).map((part) => text[part]).join('/');\n}\n\n/** Reads a typed date (`YYYY-MM-DD` or the locale's numeric order) as `YYYY-MM-DD`, else `null`. */\nexport function parseTyped(text: string, locale?: string): string | null {\n const trimmed = text.trim();\n if (ISO_LIKE.test(trimmed)) {\n const [year = 0, month = 0, day = 0] = trimmed.split('-').map(Number);\n const parts = { year, month, day };\n return isValidParts(parts) ? toIso(parts) : null;\n }\n const numbers = trimmed.split(/\\D+/).filter((piece) => piece !== '').map(Number);\n if (numbers.length !== PART_COUNT) return null;\n const order = typedOrder(locale);\n const read = (part: DatePart): number => numbers[order.indexOf(part)] ?? 0;\n const rawYear = read(DatePart.Year);\n const parts = { year: rawYear < TWO_DIGIT_YEAR ? CENTURY + rawYear : rawYear, month: read(DatePart.Month), day: read(DatePart.Day) };\n return isValidParts(parts) ? toIso(parts) : null;\n}\n","import { formatDisplay, formatTyped } from './formatDate';\n\nexport const enum DateDisplay {\n Long = 'long',\n Numeric = 'numeric',\n}\n\n/** The closed-field formatter: Long `Fri 20 Nov 2026`, Numeric in the locale's order, en-GB `20/11/2026`. */\nexport function displayFormatter(display: DateDisplay): (iso: string, locale?: string) => string {\n return display === DateDisplay.Numeric ? formatTyped : formatDisplay;\n}\n","const MONDAY = 1;\nconst SUNDAY = 7;\nconst SUNDAY_REGIONS = new Set(['US', 'CA', 'MX', 'BR', 'JP', 'KR', 'TW', 'HK', 'IL', 'PH', 'IN', 'ZA', 'SA', 'PE', 'CO', 'VE', 'GT', 'HN', 'PA', 'PR', 'DO', 'SV', 'TH', 'ID']);\n\ninterface WeekInfoLocale {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n}\n\n/** The locale's first day of the week, ISO numbering: 1 = Monday ... 7 = Sunday. */\nexport function weekFirstDay(locale?: string): number {\n try {\n const resolved = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale);\n const info = resolved as unknown as WeekInfoLocale;\n const first = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;\n if (first !== undefined) return first;\n return SUNDAY_REGIONS.has(resolved.maximize().region ?? '') ? SUNDAY : MONDAY;\n } catch {\n return MONDAY;\n }\n}\n","import React, { createContext, useContext, useMemo } from 'react';\n\nimport { DEFAULT_DATE_PICKER_LABELS } from '../data/defaultLabels';\nimport { DateDisplay } from '../utils/DateDisplay';\nimport { todayIso } from '../utils/isoDate';\nimport { weekFirstDay } from '../utils/weekStart';\n\nimport type { DatePickerLabels } from '../types';\n\nexport interface DatePickerConfig {\n labels: DatePickerLabels;\n locale?: string;\n today: string;\n /** First day of the week from the locale, 1 = Monday ... 7 = Sunday. */\n firstDay: number;\n display: DateDisplay;\n}\n\nexport interface DatePickerProviderProps {\n /** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */\n labels?: Partial<DatePickerLabels>;\n /** BCP 47 locale for display, typing order and week start; omitted = the runtime locale. */\n locale?: string;\n /** Fixed `YYYY-MM-DD` today, for demos and tests. */\n today?: string;\n /** Closed-field format; omitted = Long (`Fri 20 Nov 2026`), Numeric = the locale's `20/11/2026`. */\n display?: DateDisplay;\n children: React.ReactNode;\n}\n\ninterface StoredConfig {\n labels: DatePickerLabels;\n locale?: string;\n today?: string;\n display?: DateDisplay;\n}\n\nconst DatePickerContext = createContext<StoredConfig>({ labels: DEFAULT_DATE_PICKER_LABELS });\n\n/** Supplies picker labels, locale and an optional fixed today to every date control below it. */\nexport function DatePickerProvider({ labels, locale, today, display, children }: DatePickerProviderProps): React.ReactElement {\n const value = useMemo(() => ({ labels: { ...DEFAULT_DATE_PICKER_LABELS, ...labels }, locale, today, display }), [labels, locale, today, display]);\n return <DatePickerContext.Provider value={value}>{children}</DatePickerContext.Provider>;\n}\n\nexport function useDatePickerConfig(): DatePickerConfig {\n const config = useContext(DatePickerContext);\n const firstDay = useMemo(() => weekFirstDay(config.locale), [config.locale]);\n return { labels: config.labels, locale: config.locale, today: config.today ?? todayIso(), firstDay, display: config.display ?? DateDisplay.Long };\n}\n","import type { CSSProperties } from 'react';\n\nexport const OPEN_MS = 180;\nexport const MONTH_SLIDE_MS = 200;\nexport const MONTH_SLIDE_PX = 16;\nconst OPEN_SCALE = 0.96;\nconst EASE = 'cubic-bezier(0.2, 0, 0, 1)';\n\nexport interface OpenMotion {\n durationMs: number;\n fromScale: number;\n}\n\n/** Open: scale + fade from the field; reduced motion opens at once. */\nexport function resolveOpenMotion(reduced: boolean): OpenMotion {\n return reduced ? { durationMs: 0, fromScale: 1 } : { durationMs: OPEN_MS, fromScale: OPEN_SCALE };\n}\n\n/** Month change: a short slide in the direction of travel; none on first show or reduced motion. */\nexport function monthSlideStyle(entered: boolean, reduced: boolean, direction: number): CSSProperties {\n if (reduced || direction === 0) return {};\n return {\n opacity: entered ? 1 : 0,\n transform: entered ? 'translateX(0px)' : `translateX(${direction * MONTH_SLIDE_PX}px)`,\n transition: `opacity ${MONTH_SLIDE_MS}ms ${EASE}, transform ${MONTH_SLIDE_MS}ms ${EASE}`,\n };\n}\n","import React, { useEffect, useRef, type ReactNode, type RefObject } from 'react';\n\nimport { Animated, type View } from 'react-native';\n\nimport { PickerDialog } from './PickerDialog';\nimport { DropdownSurface } from '../../SearchSelect/components/DropdownSurface';\nimport { SheetSurface } from '../../SearchSelect/components/SheetSurface';\nimport { useReducedMotion } from '../../SearchSelect/hooks/useReducedMotion';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { resolveOpenMotion } from '../utils/motionStyles';\n\nexport interface PickerSurfaceProps {\n anchorRef: RefObject<View | null>;\n phone: boolean;\n minWidth: number;\n label: string;\n testID: string;\n onDismiss: () => void;\n children: ReactNode;\n}\n\ninterface OpenProgress {\n progress: Animated.Value;\n scale: Animated.AnimatedInterpolation<number>;\n still: Animated.AnimatedInterpolation<number>;\n}\n\nfunction useOpenProgress(): OpenProgress {\n const { durationMs, fromScale } = resolveOpenMotion(useReducedMotion());\n const progress = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();\n }, [progress, durationMs]);\n return {\n progress,\n scale: progress.interpolate({ inputRange: [0, 1], outputRange: [fromScale, 1] }),\n still: progress.interpolate({ inputRange: [0, 1], outputRange: [0, 0] }),\n };\n}\n\n/** The calendar on the shared select surfaces: `SheetSurface` on a phone, `DropdownSurface` beside the field otherwise. */\nexport function PickerSurface({ anchorRef, phone, minWidth, label, testID, onDismiss, children }: PickerSurfaceProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const { progress, scale, still } = useOpenProgress();\n const body = (\n <PickerDialog sheet={phone} testID={testID} onDismiss={onDismiss}>\n {children}\n </PickerDialog>\n );\n if (phone) {\n return <SheetSurface accessibilityLabel={label} closeHint={labels.cancelHint} closeLabel={labels.cancel} progress={progress} testID={testID} translateY={still} onDismiss={onDismiss}>{body}</SheetSurface>;\n }\n return (\n <DropdownSurface accessibilityLabel={label} anchorRef={anchorRef} closeHint={labels.cancelHint} closeLabel={labels.cancel} minWidth={minWidth} preferBelow progress={progress} scale={scale} testID={testID} translateY={still} onDismiss={onDismiss}>\n {body}\n </DropdownSurface>\n );\n}\n","import { addDays, addMonths, weekdayIndex } from './isoDate';\n\nconst DAYS_IN_WEEK = 7;\nconst MONTHS_IN_YEAR = 12;\nconst MONDAY = 1;\n\nconst DAY_STEPS: Readonly<Record<string, number>> = {\n ArrowLeft: -1,\n ArrowRight: 1,\n ArrowUp: -DAYS_IN_WEEK,\n ArrowDown: DAYS_IN_WEEK,\n};\n\n/** The day a WAI-ARIA date grid key moves focus to, or `null` when the key is not a grid move. */\nexport function nextFocusDay(iso: string, key: string, shiftKey = false, firstDay = MONDAY): string | null {\n const step = DAY_STEPS[key];\n if (step !== undefined) return addDays(iso, step);\n const monthStep = shiftKey ? MONTHS_IN_YEAR : 1;\n if (key === 'PageUp') return addMonths(iso, -monthStep);\n if (key === 'PageDown') return addMonths(iso, monthStep);\n if (key === 'Home') return addDays(iso, -weekdayIndex(iso, firstDay));\n if (key === 'End') return addDays(iso, DAYS_IN_WEEK - 1 - weekdayIndex(iso, firstDay));\n return null;\n}\n","import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from 'react';\n\nimport { useDatePickerConfig } from './useDatePickerConfig';\nimport { nextFocusDay } from '../utils/calendarKeys';\nimport { clampToBounds } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport function dayDomId(testID: string, iso: string): string {\n return `${testID}-day-${iso}`;\n}\n\nexport interface GridFocus {\n focusedDay: string;\n moveTo: (iso: string) => void;\n onDayKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\n/** Roving focus for a WAI-ARIA date grid: focuses `initial` on mount, then follows key moves. */\nexport function useGridFocus(initial: string, bounds: DateBounds, testID: string, onPick: (iso: string) => void): GridFocus {\n const { firstDay } = useDatePickerConfig();\n const [focusedDay, setFocusedDay] = useState(initial);\n const focusPending = useRef(true);\n const { min, max } = bounds;\n\n useEffect(() => {\n if (!focusPending.current) return;\n focusPending.current = false;\n document.getElementById(dayDomId(testID, focusedDay))?.focus();\n }, [focusedDay, testID]);\n\n const moveTo = useCallback((iso: string) => setFocusedDay(clampToBounds(iso, min, max)), [min, max]);\n\n const onDayKey = useCallback(\n (event: KeyboardEvent<HTMLButtonElement>, iso: string) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onPick(iso);\n return;\n }\n const next = nextFocusDay(iso, event.key, event.shiftKey, firstDay);\n if (next === null) return;\n event.preventDefault();\n focusPending.current = true;\n moveTo(next);\n },\n [moveTo, onPick, firstDay],\n );\n\n return { focusedDay, moveTo, onDayKey };\n}\n","import React, { type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { dayDomId } from '../hooks/useGridFocus';\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nexport interface DayCellState {\n inRange: boolean;\n isEnd: boolean;\n isToday: boolean;\n enabled: boolean;\n focusable: boolean;\n}\n\nexport interface DayCellProps {\n iso: string;\n state: DayCellState;\n testID: string;\n label: string;\n hint: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\nexport const DAY_CELL_PX = 44;\nconst DAY_START = 8;\nconst RING = 2;\nconst FONT = 14;\nconst BOLD = 700;\nconst REGULAR = 400;\n\n/** One 44 px day button inside its grid cell. */\nexport function DayCell({ iso, state, testID, label, hint, onPick, onKey }: DayCellProps): React.ReactElement {\n const colors = usePickerColors();\n const { inRange, isEnd, isToday, enabled, focusable } = state;\n const cellStyle: CSSProperties = { width: DAY_CELL_PX, height: DAY_CELL_PX, flexShrink: 0, background: inRange && !isEnd ? colors.tint : 'transparent' };\n const textColor = isEnd ? colors.onBrand : enabled ? colors.text : colors.textSecondary;\n const buttonStyle: CSSProperties = {\n width: DAY_CELL_PX,\n height: DAY_CELL_PX,\n padding: 0,\n boxSizing: 'border-box',\n borderRadius: DAY_CELL_PX / 2,\n border: `${RING}px solid ${isToday ? colors.brand : 'transparent'}`,\n background: isEnd ? colors.brand : 'transparent',\n color: textColor,\n textDecoration: enabled ? 'none' : 'line-through',\n fontFamily: 'inherit',\n fontSize: FONT,\n fontWeight: isEnd || isToday ? BOLD : REGULAR,\n cursor: enabled ? 'pointer' : 'default',\n };\n return (\n <div aria-selected={isEnd} role=\"gridcell\" style={cellStyle}>\n <button\n aria-current={isToday ? 'date' : undefined}\n aria-label={label}\n data-testid={dayDomId(testID, iso)}\n disabled={!enabled}\n id={dayDomId(testID, iso)}\n style={buttonStyle}\n tabIndex={focusable ? 0 : -1}\n title={hint}\n type=\"button\"\n onClick={() => onPick(iso)}\n onKeyDown={(event) => onKey(event, iso)}\n >\n {Number(iso.slice(DAY_START))}\n </button>\n </div>\n );\n}\n","import { daysInMonth, toIso, weekdayIndex } from './isoDate';\n\nconst DAYS_IN_WEEK = 7;\nconst MONDAY = 1;\n\nexport type MonthWeek = ReadonlyArray<string | null>;\n\n/** Weeks of a month starting on `firstDay` (1 = Monday ... 7 = Sunday); days outside the month are `null`. */\nexport function buildMonthGrid(year: number, month: number, firstDay = MONDAY): MonthWeek[] {\n const lead = weekdayIndex(toIso({ year, month, day: 1 }), firstDay);\n const cells: Array<string | null> = Array.from({ length: lead }, () => null);\n for (let day = 1; day <= daysInMonth(year, month); day += 1) cells.push(toIso({ year, month, day }));\n while (cells.length % DAYS_IN_WEEK !== 0) cells.push(null);\n const weeks: MonthWeek[] = [];\n for (let start = 0; start < cells.length; start += DAYS_IN_WEEK) weeks.push(cells.slice(start, start + DAYS_IN_WEEK));\n return weeks;\n}\n","import React, { useMemo, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { DAY_CELL_PX, DayCell, type DayCellState } from './DayCell';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { formatDisplay, formatMonthYear, weekdayNames } from '../utils/formatDate';\nimport { isWithinBounds, parseIso } from '../utils/isoDate';\nimport { buildMonthGrid } from '../utils/monthGrid';\n\nimport type { DateBounds } from '../types';\nimport type { DateRangeValue } from '../../controls/controlTypes';\n\nexport interface MonthGridProps {\n month: string;\n selection: DateRangeValue;\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n showCaption?: boolean;\n motion?: CSSProperties;\n}\n\nconst SHORT_DAY = 2;\nconst DAYS_IN_WEEK = 7;\nconst HEADER_LINE = 28;\nconst CAPTION_FONT = 15;\nconst WEEKDAY_FONT = 12;\nconst BOLD = 700;\nconst ROW: CSSProperties = { display: 'flex' };\nconst EMPTY: CSSProperties = { width: DAY_CELL_PX, height: DAY_CELL_PX, flexShrink: 0 };\nconst FALLBACK = { year: 1970, month: 1, day: 1 };\n\n/** One month as a WAI-ARIA grid, starting on the locale week start. */\nexport function MonthGrid({ month, selection, focusedDay, bounds, testID, onPick, onKey, showCaption = false, motion }: MonthGridProps): React.ReactElement {\n const { labels, locale, today, firstDay } = useDatePickerConfig();\n const colors = usePickerColors();\n const parts = parseIso(month) ?? FALLBACK;\n const weeks = useMemo(() => buildMonthGrid(parts.year, parts.month, firstDay), [parts.year, parts.month, firstDay]);\n const weekdays = useMemo(() => weekdayNames(locale, firstDay), [locale, firstDay]);\n const title = formatMonthYear(month, locale);\n const end = selection.to === '' ? selection.from : selection.to;\n\n const stateOf = (iso: string): DayCellState => ({\n inRange: selection.from !== '' && iso >= selection.from && iso <= end,\n isEnd: iso === selection.from || iso === selection.to,\n isToday: iso === today,\n enabled: isWithinBounds(iso, bounds.min, bounds.max),\n focusable: iso === focusedDay,\n });\n\n return (\n <div style={{ width: DAYS_IN_WEEK * DAY_CELL_PX, margin: '0 auto', ...motion }}>\n {showCaption ? <div style={{ textAlign: 'center', fontWeight: BOLD, fontSize: CAPTION_FONT, lineHeight: `${MIN_TOUCH_TARGET_PX}px` }}>{title}</div> : null}\n <div aria-label={title} data-testid={`${testID}-grid-${month.slice(0, '2026-11'.length)}`} role=\"grid\">\n <div role=\"row\" style={ROW}>\n {weekdays.map((name) => (\n <div key={name} role=\"columnheader\" style={{ width: DAY_CELL_PX, textAlign: 'center', fontSize: WEEKDAY_FONT, lineHeight: `${HEADER_LINE}px`, color: colors.textSecondary }}>\n {name.slice(0, SHORT_DAY)}\n </div>\n ))}\n </div>\n {weeks.map((week, row) => (\n <div key={`${month}-${row}`} role=\"row\" style={ROW}>\n {week.map((iso, column) =>\n iso === null ? (\n <div key={`empty-${column}`} role=\"gridcell\" style={EMPTY} />\n ) : (\n <DayCell key={iso} hint={labels.dayHint} iso={iso} label={formatDisplay(iso, locale)} state={stateOf(iso)} testID={testID} onKey={onKey} onPick={onPick} />\n ),\n )}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import React, { useMemo, type CSSProperties } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { Glyph } from './Glyph';\nimport { GlyphName } from './GlyphName';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { monthNames } from '../utils/formatDate';\nimport { addMonths, daysInMonth, parseIso, toIso } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface MonthHeaderProps {\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onMove: (iso: string) => void;\n}\n\nconst YEARS_BACK = 100;\nconst YEARS_AHEAD = 20;\nconst ISO_LENGTH = 10;\nconst FONT = 15;\nconst BOLD = 700;\nconst GAP = 4;\nconst FALLBACK = { year: 1970, month: 1, day: 1 };\n\nfunction boundYear(bound: string | undefined): number | undefined {\n return parseIso((bound ?? '').slice(0, ISO_LENGTH))?.year;\n}\n\nfunction yearOptions(current: number, bounds: DateBounds): number[] {\n const first = Math.min(current, boundYear(bounds.min) ?? current - YEARS_BACK);\n const last = Math.max(current, boundYear(bounds.max) ?? current + YEARS_AHEAD);\n return Array.from({ length: last - first + 1 }, (_unused, index) => first + index);\n}\n\n/** Previous / next month plus month and year menus. */\nexport function MonthHeader({ focusedDay, bounds, testID, onMove }: MonthHeaderProps): React.ReactElement {\n const { labels, locale } = useDatePickerConfig();\n const colors = usePickerColors();\n const parts = parseIso(focusedDay) ?? FALLBACK;\n const names = useMemo(() => monthNames(locale), [locale]);\n const setMonthYear = (year: number, month: number): void => onMove(toIso({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) }));\n const selectStyle: CSSProperties = { minHeight: MIN_TOUCH_TARGET_PX, border: 'none', background: 'transparent', color: colors.text, fontWeight: BOLD, fontSize: FONT, fontFamily: 'inherit', cursor: 'pointer' };\n\n return (\n <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.previousMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Previous} />} testID={`${testID}-previous`} onPress={() => onMove(addMonths(focusedDay, -1))} />\n <div style={{ display: 'flex', gap: GAP }}>\n <select aria-label={labels.month} data-testid={`${testID}-month`} style={selectStyle} title={labels.monthHint} value={parts.month} onChange={(event) => setMonthYear(parts.year, Number(event.target.value))}>\n {names.map((name, index) => (\n <option key={name} value={index + 1}>\n {name}\n </option>\n ))}\n </select>\n <select aria-label={labels.year} data-testid={`${testID}-year`} style={selectStyle} title={labels.monthHint} value={parts.year} onChange={(event) => setMonthYear(Number(event.target.value), parts.month)}>\n {yearOptions(parts.year, bounds).map((year) => (\n <option key={year} value={year}>\n {year}\n </option>\n ))}\n </select>\n </div>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.nextMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Next} />} testID={`${testID}-next`} onPress={() => onMove(addMonths(focusedDay, 1))} />\n </div>\n );\n}\n","import React, { type ReactNode } from 'react';\n\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nconst GAP = 8;\n\n/** The footer row under a calendar: optional summary on the left, actions on the right. */\nexport function PickerFooter({ summary, children }: { summary?: ReactNode; children: ReactNode }): React.ReactElement {\n const colors = usePickerColors();\n return (\n <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: GAP, borderTop: `1px solid ${colors.border}`, paddingTop: GAP, marginTop: GAP }}>\n {summary}\n <div style={{ display: 'flex', gap: GAP, marginLeft: 'auto' }}>{children}</div>\n </div>\n );\n}\n","import { useEffect, useRef, useState, type CSSProperties } from 'react';\n\nimport { useReducedMotion } from '../../SearchSelect/hooks/useReducedMotion';\nimport { monthSlideStyle } from '../utils/motionStyles';\n\n/** False for the first painted frame of `key`, then true, so a CSS transition runs from the start state. */\nexport function useEntered(key: string, reduced: boolean): boolean {\n const [enteredKey, setEnteredKey] = useState<string | null>(null);\n useEffect(() => {\n if (reduced) return undefined;\n let inner = 0;\n const outer = requestAnimationFrame(() => {\n inner = requestAnimationFrame(() => setEnteredKey(key));\n });\n return () => {\n cancelAnimationFrame(outer);\n cancelAnimationFrame(inner);\n };\n }, [key, reduced]);\n return reduced || enteredKey === key;\n}\n\nexport function useMonthSlide(month: string): CSSProperties {\n const reduced = useReducedMotion();\n const previous = useRef(month);\n const direction = useRef(0);\n if (previous.current !== month) {\n direction.current = month > previous.current ? 1 : -1;\n previous.current = month;\n }\n const entered = useEntered(month, reduced);\n return monthSlideStyle(entered, reduced, direction.current);\n}\n","import React, { useState } from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { MonthGrid } from './MonthGrid';\nimport { MonthHeader } from './MonthHeader';\nimport { PickerFooter } from './PickerFooter';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { useGridFocus } from '../hooks/useGridFocus';\nimport { useMonthSlide } from '../hooks/useMotion';\nimport { clampToBounds, monthStart } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface SingleCalendarProps {\n value: string;\n bounds: DateBounds;\n testID: string;\n onCommit: (iso: string) => void;\n}\n\n/** One month with menus; a picked day is a draft until Set date commits it. */\nexport function SingleCalendar({ value, bounds, testID, onCommit }: SingleCalendarProps): React.ReactElement {\n const { labels, today } = useDatePickerConfig();\n const [draft, setDraft] = useState(value);\n const grid = useGridFocus(clampToBounds(value !== '' ? value : today, bounds.min, bounds.max), bounds, testID, setDraft);\n const month = monthStart(grid.focusedDay);\n const motion = useMonthSlide(month);\n\n const pick = (iso: string): void => {\n setDraft(iso);\n grid.moveTo(iso);\n };\n\n return (\n <div>\n <MonthHeader bounds={bounds} focusedDay={grid.focusedDay} testID={testID} onMove={grid.moveTo} />\n <MonthGrid bounds={bounds} focusedDay={grid.focusedDay} month={month} motion={motion} selection={{ from: draft, to: draft }} testID={testID} onKey={grid.onDayKey} onPick={pick} />\n <PickerFooter>\n <Button accessibilityHint={labels.clearHint} accessibilityLabel={labels.clear} label={labels.clear} testID={`${testID}-clear`} variant=\"ghost\" onPress={() => onCommit('')} />\n <Button accessibilityHint={labels.setDateHint} accessibilityLabel={labels.setDate} disabled={draft === ''} label={labels.setDate} testID={`${testID}-set`} onPress={() => onCommit(draft)} />\n </PickerFooter>\n </div>\n );\n}\n","import { useWindowDimensions } from 'react-native';\n\nimport { isWideFormLayout } from '../../ResponsiveFormLayout/isWideFormLayout';\n\nexport function useIsPhone(): boolean {\n return !isWideFormLayout(useWindowDimensions().width);\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/** Moves focus back to `target` once the picker has closed, after the modal's own focus restore has run. */\nexport function useReturnFocus(open: boolean, target: RefObject<HTMLElement | null>): void {\n const wasOpen = useRef(open);\n useEffect(() => {\n const closed = wasOpen.current && !open;\n wasOpen.current = open;\n if (!closed) return undefined;\n const timer = setTimeout(() => target.current?.focus(), 0);\n return () => clearTimeout(timer);\n }, [open, target]);\n}\n","import { useEffect, useState } from 'react';\n\nimport { useDatePickerConfig } from './useDatePickerConfig';\nimport { formatTyped, parseTyped } from '../utils/formatDate';\nimport { isWithinBounds } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface TypedDateArgs {\n value: string;\n onChange: (value: string) => void;\n bounds: DateBounds;\n format: (iso: string, locale?: string) => string;\n onError?: (message: string | undefined) => void;\n /** Replaces the out-of-bounds error, e.g. a range end order message. */\n rangeMessage?: string;\n /** Keeps the locale display on focus until the user edits (`onEdit` or typing). */\n editOnType?: boolean;\n}\n\nexport interface TypedDate {\n display: string;\n onText: (text: string) => void;\n onFocus: () => void;\n onBlur: () => void;\n /** Starts editing: the text becomes `replacement` when given, else the typed numeric form; true when it applied `replacement`. */\n onEdit: (replacement?: string) => boolean;\n /** True when the typed text is empty or a valid in-bounds date; reports the error otherwise. */\n isReady: () => boolean;\n}\n\n/** A typeable date: shows the locale display at rest, the numeric form while editing, emits only valid in-bounds dates. */\nexport function useTypedDate({ value, onChange, bounds, format, onError, rangeMessage, editOnType = false }: TypedDateArgs): TypedDate {\n const { labels, locale } = useDatePickerConfig();\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState('');\n\n useEffect(() => {\n setText((current) => {\n const parsed = current.trim() === '' ? '' : parseTyped(current, locale);\n if (parsed === null || parsed === value) return current;\n return value === '' ? '' : formatTyped(value, locale);\n });\n }, [value, locale]);\n\n const verdict = (typed: string): string | undefined => {\n if (typed.trim() === '') return undefined;\n const parsed = parseTyped(typed, locale);\n if (parsed === null) return labels.invalidDate;\n return isWithinBounds(parsed, bounds.min, bounds.max) ? undefined : rangeMessage ?? labels.outOfRange;\n };\n\n const startEdit = (): void => {\n setEditing(true);\n setText(value === '' ? '' : formatTyped(value, locale));\n };\n\n const onText = (next: string): void => {\n setEditing(true);\n setText(next);\n if (next.trim() === '') {\n onError?.(undefined);\n onChange('');\n return;\n }\n const parsed = parseTyped(next, locale);\n if (parsed === null) return;\n const message = verdict(next);\n onError?.(message);\n if (message === undefined) onChange(parsed);\n };\n\n const isReady = (): boolean => {\n if (!editing) return true;\n const message = verdict(text);\n onError?.(message);\n return message === undefined;\n };\n\n return {\n display: editing ? text : value === '' ? '' : format(value, locale),\n onText,\n onFocus: () => {\n if (!editOnType) startEdit();\n },\n onBlur: () => {\n setEditing(false);\n if (editing && verdict(text) !== undefined) onError?.(verdict(text));\n },\n onEdit: (replacement) => {\n if (editing) return false;\n if (replacement !== undefined) onText(replacement);\n else startEdit();\n return replacement !== undefined;\n },\n isReady,\n };\n}\n","const FONT_PX = 14;\nconst GLYPH_EM = 0.62;\nconst PAD_INLINE = 12;\nconst BORDER = 1;\nconst PLACEHOLDER_CHARS = 15;\n\n/** The smallest field width that shows `text` (or a full formatted date when empty) beside the trailing icon room. */\nexport function closedFieldMinWidth(text: string, iconRoom: number): number {\n const chars = Math.max(text.length, PLACEHOLDER_CHARS);\n return Math.ceil(chars * FONT_PX * GLYPH_EM) + PAD_INLINE + iconRoom + BORDER + BORDER;\n}\n","import type { ClipboardEvent, KeyboardEvent, SyntheticEvent } from 'react';\n\nimport type { TypedDate } from '../hooks/useTypedDate';\n\nconst DELETE_KEYS = new Set(['Backspace', 'Delete']);\n\nexport interface TypedEditBind {\n onEditKey: (event: KeyboardEvent<HTMLInputElement>) => void;\n onPaste: (event: ClipboardEvent<HTMLInputElement>) => void;\n onCut: (event: ClipboardEvent<HTMLInputElement>) => void;\n}\n\ninterface EditedText {\n text: string;\n caret: number;\n}\n\nfunction isPrintable(event: KeyboardEvent<HTMLInputElement>): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey;\n}\n\nfunction selection(input: HTMLInputElement): [number, number] {\n const end = input.selectionEnd ?? input.value.length;\n return [input.selectionStart ?? end, end];\n}\n\nfunction editedText(input: HTMLInputElement, insert: string): EditedText {\n const [start, end] = selection(input);\n return { text: input.value.slice(0, start) + insert + input.value.slice(end), caret: start + insert.length };\n}\n\nfunction placeCaret(input: HTMLInputElement, caret: number): void {\n requestAnimationFrame(() => input.setSelectionRange(caret, caret));\n}\n\n/** Edit handlers for a typed date input: a key, paste or cut over a selection edits the shown text there and keeps the caret, else the typed form starts. */\nexport function typedEditBind(typed: TypedDate): TypedEditBind {\n const start = (event: SyntheticEvent<HTMLInputElement>, insert: string): void => {\n const input = event.currentTarget;\n const [from, to] = selection(input);\n if (from === to) {\n typed.onEdit();\n return;\n }\n const edit = editedText(input, insert);\n if (!typed.onEdit(edit.text)) return;\n event.preventDefault();\n placeCaret(input, edit.caret);\n };\n return {\n onEditKey: (event) => {\n if (isPrintable(event)) start(event, event.key);\n else if (DELETE_KEYS.has(event.key)) start(event, '');\n },\n onPaste: (event) => start(event, event.clipboardData.getData('text')),\n onCut: (event) => {\n const input = event.currentTarget;\n const [from, to] = selection(input);\n if (from === to) return;\n event.clipboardData.setData('text/plain', input.value.slice(from, to));\n start(event, '');\n },\n };\n}\n","import React, { useCallback, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { buildNativeInputStyle } from './WebDateInput';\nimport { Glyph } from '../../DatePicker/components/Glyph';\nimport { GlyphName } from '../../DatePicker/components/GlyphName';\nimport { PickerSurface } from '../../DatePicker/components/PickerSurface';\nimport { SingleCalendar } from '../../DatePicker/components/SingleCalendar';\nimport { useDatePickerConfig } from '../../DatePicker/hooks/useDatePickerConfig';\nimport { useIsPhone } from '../../DatePicker/hooks/useIsPhone';\nimport { useReturnFocus } from '../../DatePicker/hooks/useReturnFocus';\nimport { useTypedDate } from '../../DatePicker/hooks/useTypedDate';\nimport { closedFieldMinWidth } from '../../DatePicker/utils/fieldWidth';\nimport { displayFormatter } from '../../DatePicker/utils/DateDisplay';\nimport { typedEditBind } from '../../DatePicker/utils/typedEdit';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nexport interface DatePickerInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n onTypedError?: (message: string | undefined) => void;\n}\n\nexport interface FocusHandlers {\n onFocus?: (event: unknown) => void;\n onBlur?: (event: unknown) => void;\n}\n\nexport const SINGLE_PICKER_WIDTH = 340;\nexport const ICON_ROOM = 48;\nexport const ICON_SLOT: CSSProperties = { position: 'absolute', right: 2, top: 0, bottom: 0, display: 'flex', alignItems: 'center' };\nexport const anchorStyles = StyleSheet.create({ wrap: { position: 'relative', width: '100%' } });\n\n/** A typeable date with a calendar button; the calendar opens as a sheet on a phone and a dropdown on desktop. */\nexport function DatePickerInput({ fieldProps, context, onTypedError }: DatePickerInputProps): React.ReactElement {\n const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;\n const { labels, display } = useDatePickerConfig();\n const phone = useIsPhone();\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<View>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const bounds = { min, max };\n const typed = useTypedDate({ value, onChange, bounds, format: displayFormatter(display), onError: onTypedError, editOnType: true });\n const edit = typedEditBind(typed);\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });\n const focus = focusBind as unknown as FocusHandlers;\n const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError, required });\n\n const close = useCallback(() => setOpen(false), []);\n useReturnFocus(open, inputRef);\n const commit = (iso: string): void => {\n onTypedError?.(undefined);\n onChange(iso);\n close();\n };\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n edit.onEditKey(event);\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n if (typed.isReady()) onSubmit();\n };\n\n return (\n <View ref={anchorRef} style={[anchorStyles.wrap, { minWidth: closedFieldMinWidth(typed.display, ICON_ROOM) }]} testID={`${testID}-anchor`}>\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(hoverBind as React.InputHTMLAttributes<HTMLInputElement>)}\n ref={inputRef}\n aria-label={label}\n autoComplete=\"off\"\n data-testid={testID}\n disabled={disabled}\n id={context.controlId}\n style={{ ...buildNativeInputStyle(style), paddingInlineEnd: ICON_ROOM }}\n title={accessibilityHint}\n type=\"text\"\n value={typed.display}\n onBlur={(event) => {\n focus.onBlur?.(event);\n typed.onBlur();\n }}\n onChange={(event) => typed.onText(event.target.value)}\n onFocus={(event) => {\n focus.onFocus?.(event);\n typed.onFocus();\n }}\n onKeyDown={onKeyDown}\n onCut={edit.onCut}\n onPaste={edit.onPaste}\n />\n <div style={ICON_SLOT}>\n <IconButton accessibilityHint={labels.openCalendarHint} accessibilityLabel={labels.openCalendar} appearance=\"ghost\" disabled={disabled} renderIcon={(color) => <Glyph color={color} name={GlyphName.Calendar} />} testID={`${testID}-calendar`} onPress={() => setOpen((current) => !current)} />\n </div>\n {open ? (\n <PickerSurface anchorRef={anchorRef} label={labels.dialog} minWidth={SINGLE_PICKER_WIDTH} phone={phone} testID={`${testID}-picker`} onDismiss={close}>\n <SingleCalendar bounds={bounds} testID={`${testID}-picker`} value={value} onCommit={commit} />\n </PickerSurface>\n ) : null}\n </View>\n );\n}\n","import React from 'react';\n\nimport { Platform } from 'react-native';\n\nimport { DatePickerInput } from './DatePickerInput';\nimport { WebDateInput } from './WebDateInput';\nimport { ThemedTextInput } from '../../ThemedTextInput/ThemedTextInput';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nconst IS_WEB = Platform.OS === 'web';\nconst DATE_TYPE = 'date';\n\ninterface TemporalInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n webInputType: string;\n onTypedError?: (message: string | undefined) => void;\n}\n\n/** The bare control: the shared date picker or a native date-time input on web, a text input off it. */\nexport function TemporalInput({ fieldProps, context, webInputType, onTypedError }: TemporalInputProps): React.ReactElement {\n if (IS_WEB && webInputType === DATE_TYPE) return <DatePickerInput context={context} fieldProps={fieldProps} onTypedError={onTypedError} />;\n if (IS_WEB) return <WebDateInput context={context} fieldProps={fieldProps} webInputType={webInputType} />;\n return (\n <ThemedTextInput\n accessibilityHint={fieldProps.accessibilityHint}\n accessibilityLabel={fieldProps.label}\n describedById={context.describedById}\n editable={fieldProps.disabled !== true}\n hasError={context.hasError}\n id={context.controlId}\n requiredField={fieldProps.required}\n testID={fieldProps.testID}\n value={fieldProps.value}\n onChangeText={fieldProps.onChange}\n onSubmitEditing={fieldProps.onSubmit}\n />\n );\n}\n","import React, { useState } from 'react';\n\nimport { TemporalInput } from './TemporalInput';\nimport { Field } from '../../Field/Field';\n\nimport type { DateFieldProps } from '../types';\n\ninterface TemporalFieldProps {\n fieldProps: DateFieldProps;\n webInputType: string;\n}\n\n/** The `Field` shell shared by `DateField` and `DateTimeField`; a typed date error shows when the caller has none. */\nexport function TemporalField({ fieldProps, webInputType }: TemporalFieldProps): React.ReactElement {\n const { label, required, hint, error } = fieldProps;\n const [typedError, setTypedError] = useState<string | undefined>(undefined);\n return (\n <Field error={error ?? typedError} hint={hint} label={label} required={required}>\n {(context) => <TemporalInput context={context} fieldProps={fieldProps} webInputType={webInputType} onTypedError={setTypedError} />}\n </Field>\n );\n}\n","import React from 'react';\n\nimport { TemporalField } from './components/TemporalField';\n\nimport type { DateFieldProps } from './types';\n\n/** A labelled calendar date: takes and emits `YYYY-MM-DD`, empty is `''`. */\nexport function DateField(props: DateFieldProps): React.ReactElement {\n return <TemporalField fieldProps={props} webInputType=\"date\" />;\n}\n","import React from 'react';\n\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { controlStyles as s } from '../../controls/controlStyles';\nimport { DateField } from '../../DateField/DateField';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\n\nexport interface NativeDateRangeProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit?: () => void;\n fromLabel: string;\n toLabel: string;\n hint: string;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}\n\n/** Native: two shared `DateField`s side by side; each edit patches only its own side. */\nexport function NativeDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, style, testID }: NativeDateRangeProps): React.ReactElement {\n return (\n <View style={[s.dateRow, style]} testID={`${testID}-range`}>\n <View style={s.dateCol}>\n <DateField accessibilityHint={hint} label={fromLabel} testID={`${testID}-from`} value={value.from} onChange={(from) => onChange({ from, to: value.to })} onSubmit={onSubmit} />\n </View>\n <View style={s.dateCol}>\n <DateField accessibilityHint={hint} label={toLabel} testID={`${testID}-to`} value={value.to} onChange={(to) => onChange({ from: value.from, to })} onSubmit={onSubmit} />\n </View>\n </View>\n );\n}\n","import { addDays, monthStart, parseIso, toIso } from './isoDate';\nimport { RangePreset } from './RangePreset';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DatePickerLabels } from '../types';\n\nexport const RANGE_PRESETS: readonly RangePreset[] = [RangePreset.Today, RangePreset.Last7Days, RangePreset.ThisMonth, RangePreset.Quarter];\n\nconst PRESET_LABEL: Readonly<Record<RangePreset, keyof DatePickerLabels>> = {\n [RangePreset.Today]: 'today',\n [RangePreset.Last7Days]: 'last7Days',\n [RangePreset.ThisMonth]: 'thisMonth',\n [RangePreset.Quarter]: 'quarter',\n};\n\nconst WEEK_BACK = 6;\nconst MONTHS_IN_QUARTER = 3;\nconst EPOCH = { year: 1970, month: 1, day: 1 };\n\nexport function presetLabel(labels: DatePickerLabels, preset: RangePreset): string {\n return labels[PRESET_LABEL[preset]];\n}\n\nfunction quarterStart(today: string): string {\n const parts = parseIso(today) ?? EPOCH;\n const month = Math.floor((parts.month - 1) / MONTHS_IN_QUARTER) * MONTHS_IN_QUARTER + 1;\n return toIso({ year: parts.year, month, day: 1 });\n}\n\n/** The inclusive range a preset stands for, ending today. */\nexport function presetRange(preset: RangePreset, today: string): DateRangeValue {\n if (preset === RangePreset.Last7Days) return { from: addDays(today, -WEEK_BACK), to: today };\n if (preset === RangePreset.ThisMonth) return { from: monthStart(today), to: today };\n if (preset === RangePreset.Quarter) return { from: quarterStart(today), to: today };\n return { from: today, to: today };\n}\n\nexport function matchingPreset(range: DateRangeValue, today: string): RangePreset | null {\n return RANGE_PRESETS.find((preset) => {\n const span = presetRange(preset, today);\n return span.from === range.from && span.to === range.to;\n }) ?? null;\n}\n\n/** A first pick starts a range; a second pick closes it, ends in order. */\nexport function pickRangeDay(range: DateRangeValue, day: string): DateRangeValue {\n const open = range.from !== '' && range.to === '';\n if (!open) return { from: day, to: '' };\n return day < range.from ? { from: day, to: range.from } : { from: range.from, to: day };\n}\n","import React, { type CSSProperties } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { presetLabel, RANGE_PRESETS } from '../utils/rangePresets';\n\nimport type { RangePreset } from '../utils/RangePreset';\n\nexport interface PresetPickerProps {\n active: RangePreset | null;\n testID: string;\n onPick: (preset: RangePreset) => void;\n}\n\nconst GAP = 8;\nconst CHIP_PAD = 16;\nconst FONT = 14;\nconst BOLD = 700;\nconst REGULAR = 400;\nconst ACTIVE_BORDER = 2;\n\n/** Desktop range presets: one chip per preset, the active one ticked. */\nexport function PresetChips({ active, testID, onPick }: PresetPickerProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const colors = usePickerColors();\n const chipStyle = (isActive: boolean): CSSProperties => ({\n minHeight: MIN_TOUCH_TARGET_PX,\n padding: `0 ${CHIP_PAD}px`,\n borderRadius: MIN_TOUCH_TARGET_PX / 2,\n border: `${isActive ? ACTIVE_BORDER : 1}px solid ${isActive ? colors.brand : colors.border}`,\n background: colors.surface,\n color: colors.text,\n fontFamily: 'inherit',\n fontSize: FONT,\n fontWeight: isActive ? BOLD : REGULAR,\n cursor: 'pointer',\n });\n return (\n <div aria-label={labels.presets} role=\"group\" style={{ display: 'flex', flexWrap: 'wrap', gap: GAP, marginBottom: GAP }}>\n {RANGE_PRESETS.map((preset) => (\n <button key={preset} aria-pressed={active === preset} data-testid={`${testID}-preset-${preset}`} style={chipStyle(active === preset)} title={labels.presetHint} type=\"button\" onClick={() => onPick(preset)}>\n {active === preset ? '✓ ' : ''}\n {presetLabel(labels, preset)}\n </button>\n ))}\n </div>\n );\n}\n","import React from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { presetLabel, RANGE_PRESETS } from '../utils/rangePresets';\n\nimport type { PresetPickerProps } from './PresetChips';\n\nconst GAP = 8;\nconst FONT = 14;\n\n/** Phone range presets: one menu. */\nexport function PresetMenu({ active, testID, onPick }: PresetPickerProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const colors = usePickerColors();\n const onChange = (event: React.ChangeEvent<HTMLSelectElement>): void => {\n const preset = RANGE_PRESETS.find((candidate) => candidate === event.target.value);\n if (preset !== undefined) onPick(preset);\n };\n return (\n <select\n aria-label={labels.presets}\n data-testid={`${testID}-presets`}\n style={{ minHeight: MIN_TOUCH_TARGET_PX, width: '100%', marginBottom: GAP, border: `1px solid ${colors.border}`, borderRadius: GAP, background: colors.surface, color: colors.text, fontFamily: 'inherit', fontSize: FONT }}\n title={labels.presetHint}\n value={active ?? ''}\n onChange={onChange}\n >\n <option value=\"\">{labels.presets}</option>\n {RANGE_PRESETS.map((preset) => (\n <option key={preset} value={preset}>\n {presetLabel(labels, preset)}\n </option>\n ))}\n </select>\n );\n}\n","import React, { type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { Glyph } from './Glyph';\nimport { GlyphName } from './GlyphName';\nimport { MonthGrid } from './MonthGrid';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DateBounds } from '../types';\n\nexport interface RangeGridProps {\n selection: DateRangeValue;\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\nconst PHONE_LIST_HEIGHT = 'min(56vh, 440px)';\nconst MONTH_GAP = 32;\nconst NAV_ROW: CSSProperties = { position: 'absolute', left: 0, right: 0, top: 0, display: 'flex', justifyContent: 'space-between', pointerEvents: 'none' };\nconst NAV_SLOT: CSSProperties = { pointerEvents: 'auto' };\n\n/** Phone: the months in one vertical scroll list, the next one peeking. */\nexport function RangeMonthsList({ months, grid }: { months: readonly string[]; grid: RangeGridProps }): React.ReactElement {\n return (\n <div data-testid={`${grid.testID}-months`} style={{ maxHeight: PHONE_LIST_HEIGHT, overflowY: 'auto' }}>\n {months.map((month) => (\n <MonthGrid key={month} showCaption month={month} {...grid} />\n ))}\n </div>\n );\n}\n\nexport interface RangeMonthsPairProps {\n months: readonly string[];\n grid: RangeGridProps;\n motion: CSSProperties;\n onShift: (step: number) => void;\n}\n\n/** Desktop: two months side by side with previous / next. */\nexport function RangeMonthsPair({ months, grid, motion, onShift }: RangeMonthsPairProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n return (\n <div style={{ position: 'relative' }}>\n <div style={NAV_ROW}>\n <div style={NAV_SLOT}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.previousMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Previous} />} testID={`${grid.testID}-previous`} onPress={() => onShift(-1)} />\n </div>\n <div style={NAV_SLOT}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.nextMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Next} />} testID={`${grid.testID}-next`} onPress={() => onShift(1)} />\n </div>\n </div>\n <div style={{ display: 'flex', gap: MONTH_GAP }}>\n {months.map((month) => (\n <MonthGrid key={month} showCaption month={month} motion={motion} {...grid} />\n ))}\n </div>\n </div>\n );\n}\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { PickerFooter } from './PickerFooter';\nimport { PresetChips } from './PresetChips';\nimport { PresetMenu } from './PresetMenu';\nimport { RangeMonthsList, RangeMonthsPair } from './RangeMonths';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { useGridFocus } from '../hooks/useGridFocus';\nimport { useMonthSlide } from '../hooks/useMotion';\nimport { formatShort } from '../utils/formatDate';\nimport { addMonths, clampToBounds, daysBetweenInclusive, monthStart } from '../utils/isoDate';\nimport { matchingPreset, pickRangeDay, presetRange } from '../utils/rangePresets';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DateBounds } from '../types';\nimport type { RangePreset } from '../utils/RangePreset';\n\nexport interface RangeCalendarProps {\n value: DateRangeValue;\n bounds: DateBounds;\n phone: boolean;\n testID: string;\n onApply: (range: DateRangeValue) => void;\n onCancel: () => void;\n}\n\nconst PHONE_MONTHS = 6;\nconst DESKTOP_MONTHS = 2;\nconst SUMMARY_FONT = 14;\nconst SEMIBOLD = 600;\n\nfunction useRangeSummary(draft: DateRangeValue): string {\n const { labels, locale } = useDatePickerConfig();\n if (draft.from === '') return '';\n if (draft.to === '') return formatShort(draft.from, locale);\n const days = labels.dayCount.replace('{{p1}}', String(daysBetweenInclusive(draft.from, draft.to)));\n return `${formatShort(draft.from, locale, false)}${labels.rangeSeparator}${formatShort(draft.to, locale)} · ${days}`;\n}\n\n/** Range picker: presets, months, a summary, Cancel and Apply. */\nexport function RangeCalendar({ value, bounds, phone, testID, onApply, onCancel }: RangeCalendarProps): React.ReactElement {\n const { labels, today } = useDatePickerConfig();\n const [draft, setDraft] = useState(value);\n const initialDay = clampToBounds(value.from !== '' ? value.from : today, bounds.min, bounds.max);\n const pickDraft = useCallback((iso: string) => setDraft((current) => pickRangeDay(current, iso)), []);\n const focus = useGridFocus(initialDay, bounds, testID, pickDraft);\n const visible = phone ? PHONE_MONTHS : DESKTOP_MONTHS;\n const [first, setFirst] = useState(() => monthStart(phone ? initialDay : addMonths(initialDay, 1 - DESKTOP_MONTHS)));\n const focusMonth = monthStart(focus.focusedDay);\n const last = addMonths(first, visible - 1);\n const motion = useMonthSlide(first);\n const summary = useRangeSummary(draft);\n\n useEffect(() => {\n if (focusMonth < first) setFirst(focusMonth);\n else if (focusMonth > last) setFirst(addMonths(focusMonth, 1 - visible));\n }, [focusMonth, first, last, visible]);\n\n const pick = (iso: string): void => {\n pickDraft(iso);\n focus.moveTo(iso);\n };\n const applyPreset = (preset: RangePreset): void => {\n const range = presetRange(preset, today);\n setDraft(range);\n focus.moveTo(range.to);\n };\n const shift = (step: number): void => {\n setFirst(addMonths(first, step));\n focus.moveTo(addMonths(focus.focusedDay, step));\n };\n const months = Array.from({ length: visible }, (_unused, index) => addMonths(first, index));\n const grid = { selection: draft, focusedDay: focus.focusedDay, bounds, testID, onPick: pick, onKey: focus.onDayKey };\n const presets = { active: matchingPreset(draft, today), testID, onPick: applyPreset };\n\n return (\n <div>\n {phone ? <PresetMenu {...presets} /> : <PresetChips {...presets} />}\n {phone ? <RangeMonthsList grid={grid} months={months} /> : <RangeMonthsPair grid={grid} months={months} motion={motion} onShift={shift} />}\n <PickerFooter summary={<span aria-live=\"polite\" data-testid={`${testID}-summary`} style={{ fontSize: SUMMARY_FONT, fontWeight: SEMIBOLD }}>{summary}</span>}>\n <Button accessibilityHint={labels.cancelHint} accessibilityLabel={labels.cancel} label={labels.cancel} testID={`${testID}-cancel`} variant=\"ghost\" onPress={onCancel} />\n <Button\n accessibilityHint={labels.applyHint}\n accessibilityLabel={labels.apply}\n disabled={draft.from === ''}\n label={labels.apply}\n testID={`${testID}-apply`}\n onPress={() => onApply({ from: draft.from, to: draft.to === '' ? draft.from : draft.to })}\n />\n </PickerFooter>\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { View } from 'react-native';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { RangeSide } from './RangeSide';\nimport { anchorStyles, ICON_ROOM, ICON_SLOT, type FocusHandlers } from '../../DateField/components/DatePickerInput';\nimport { buildNativeInputStyle } from '../../DateField/components/WebDateInput';\nimport { Glyph } from '../../DatePicker/components/Glyph';\nimport { GlyphName } from '../../DatePicker/components/GlyphName';\nimport { PickerSurface } from '../../DatePicker/components/PickerSurface';\nimport { RangeCalendar } from '../../DatePicker/components/RangeCalendar';\nimport { useDatePickerConfig } from '../../DatePicker/hooks/useDatePickerConfig';\nimport { useIsPhone } from '../../DatePicker/hooks/useIsPhone';\nimport { useReturnFocus } from '../../DatePicker/hooks/useReturnFocus';\nimport { useTypedDate, type TypedDate } from '../../DatePicker/hooks/useTypedDate';\nimport { typedEditBind } from '../../DatePicker/utils/typedEdit';\nimport { formatShort } from '../../DatePicker/utils/formatDate';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { FieldChildContext } from '../../Field/Field';\n\nexport interface WebDateRangeProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit?: () => void;\n fromLabel: string;\n toLabel: string;\n hint: string;\n testID: string;\n context: FieldChildContext;\n onTypedError: (message: string | undefined) => void;\n}\n\nconst RANGE_PICKER_WIDTH = 690;\nconst GAP = 8;\nconst NO_BOUNDS = {};\nconst SEGMENT: CSSProperties = { flex: 1, minWidth: 0, border: 'none', background: 'transparent', color: 'inherit', font: 'inherit', outline: 'none', padding: 0 };\n\nfunction orNone(value: string): string | undefined {\n return value !== '' ? value : undefined;\n}\n\n/** One field holding both range ends, each typeable with its own error, plus a calendar with presets. */\nexport function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, testID, context, onTypedError }: WebDateRangeProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const phone = useIsPhone();\n const [open, setOpen] = useState(false);\n const [fromError, setFromError] = useState<string | undefined>(undefined);\n const [toError, setToError] = useState<string | undefined>(undefined);\n const anchorRef = useRef<View>(null);\n const fromRef = useRef<HTMLInputElement>(null);\n const from = useTypedDate({ value: value.from, onChange: (next) => onChange({ from: next, to: value.to }), bounds: { max: orNone(value.to) }, format: formatShort, onError: setFromError, rangeMessage: labels.rangeOrder, editOnType: true });\n const to = useTypedDate({ value: value.to, onChange: (next) => onChange({ from: value.from, to: next }), bounds: { min: orNone(value.from) }, format: formatShort, onError: setToError, rangeMessage: labels.rangeOrder, editOnType: true });\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: true });\n const focus = focusBind as unknown as FocusHandlers;\n const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError });\n\n useEffect(() => onTypedError(fromError ?? toError), [fromError, toError, onTypedError]);\n\n const close = useCallback(() => setOpen(false), []);\n useReturnFocus(open, fromRef);\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n const ready = [from.isReady(), to.isReady()].every(Boolean);\n if (ready) onSubmit();\n };\n const segment = (side: RangeSide, typed: TypedDate): React.ReactElement => {\n const edit = typedEditBind(typed);\n return (\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n ref={side === RangeSide.From ? fromRef : undefined}\n aria-label={side === RangeSide.From ? fromLabel : toLabel}\n autoComplete=\"off\"\n data-testid={`${testID}-${side}`}\n id={side === RangeSide.From ? context.controlId : undefined}\n style={SEGMENT}\n title={hint}\n type=\"text\"\n value={typed.display}\n onBlur={(event) => {\n focus.onBlur?.(event);\n typed.onBlur();\n }}\n onChange={(event) => typed.onText(event.target.value)}\n onFocus={(event) => {\n focus.onFocus?.(event);\n typed.onFocus();\n }}\n onCut={edit.onCut}\n onKeyDown={(event) => {\n edit.onEditKey(event);\n onKeyDown(event);\n }}\n onPaste={edit.onPaste}\n />\n );\n };\n\n return (\n <View ref={anchorRef} style={anchorStyles.wrap}>\n <div {...(hoverBind as React.HTMLAttributes<HTMLDivElement>)} style={{ ...buildNativeInputStyle(style), display: 'flex', alignItems: 'center', gap: GAP, paddingInlineEnd: ICON_ROOM }}>\n {segment(RangeSide.From, from)}\n <span aria-hidden=\"true\">→</span>\n {segment(RangeSide.To, to)}\n </div>\n <div style={ICON_SLOT}>\n <IconButton accessibilityHint={labels.openCalendarHint} accessibilityLabel={labels.openCalendar} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Calendar} />} testID={`${testID}-calendar`} onPress={() => setOpen((current) => !current)} />\n </div>\n {open ? (\n <PickerSurface anchorRef={anchorRef} label={labels.rangeDialog} minWidth={RANGE_PICKER_WIDTH} phone={phone} testID={`${testID}-picker`} onDismiss={close}>\n <RangeCalendar\n bounds={NO_BOUNDS}\n phone={phone}\n testID={`${testID}-picker`}\n value={value}\n onApply={(range) => {\n setFromError(undefined);\n setToError(undefined);\n onChange(range);\n close();\n }}\n onCancel={close}\n />\n </PickerSurface>\n ) : null}\n </View>\n );\n}\n","import React, { useState } from 'react';\n\nimport { Platform, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { NativeDateRange } from './components/NativeDateRange';\nimport { WebDateRange } from './components/WebDateRange';\nimport { useDatePickerConfig } from '../DatePicker/hooks/useDatePickerConfig';\nimport { Field } from '../Field/Field';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nimport type { DateRangeValue } from '../controls/controlTypes';\n\nconst IS_WEB = Platform.OS === 'web';\n\nexport interface DateRangeControlProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n /** Called on Enter/submit in either side. */\n onSubmit?: () => void;\n /** PRE-LOCALIZED sub-label for the FROM input (e.g. \"From\"). Also its accessible name. */\n fromLabel: string;\n /** PRE-LOCALIZED sub-label for the TO input (e.g. \"To\"). Also its accessible name. */\n toLabel: string;\n /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */\n fromPlaceholder?: string;\n /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */\n toPlaceholder?: string;\n /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */\n accessibilityHint?: string;\n /** Merged LAST onto the row wrapper. */\n style?: StyleProp<ViewStyle>;\n /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */\n testID: string;\n}\n\n/** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */\nexport function DateRangeControl({\n value,\n onChange,\n onSubmit,\n fromLabel,\n toLabel,\n accessibilityHint,\n style,\n testID,\n}: DateRangeControlProps): React.ReactElement {\n const hint = accessibilityHint ?? `${fromLabel} – ${toLabel}`;\n const { labels } = useDatePickerConfig();\n const [typedError, setTypedError] = useState<string | undefined>(undefined);\n\n if (!IS_WEB) {\n return (\n <GapOwnedProvider value>\n <NativeDateRange fromLabel={fromLabel} hint={hint} style={style} testID={testID} toLabel={toLabel} value={value} onChange={onChange} onSubmit={onSubmit} />\n </GapOwnedProvider>\n );\n }\n return (\n <GapOwnedProvider value>\n <View style={style} testID={`${testID}-range`}>\n <Field error={typedError} label={`${fromLabel}${labels.rangeSeparator}${toLabel}`}>\n {(context) => (\n <WebDateRange context={context} fromLabel={fromLabel} hint={hint} testID={testID} toLabel={toLabel} value={value} onChange={onChange} onSubmit={onSubmit} onTypedError={setTypedError} />\n )}\n </Field>\n </View>\n </GapOwnedProvider>\n );\n}\n\nexport default DateRangeControl;\n","import React from 'react';\n\nimport { TemporalField } from './components/TemporalField';\n\nimport type { DateTimeFieldProps } from './types';\n\n/** A labelled local date and time: takes and emits `YYYY-MM-DDTHH:mm`, empty is `''`. */\nexport function DateTimeField(props: DateTimeFieldProps): React.ReactElement {\n return <TemporalField fieldProps={props} webInputType=\"datetime-local\" />;\n}\n","import React from 'react';\n\nimport { TemporalInput } from './components/TemporalInput';\n\nimport type { DateInputProps } from './types';\n\n/** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */\nexport function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement {\n return <TemporalInput context={context} fieldProps={fieldProps} webInputType=\"date\" />;\n}\n","/**\n * Group selection — the pure tri-state logic behind a \"select all\" / \"select this category\"\n * control, kept out of any component so it is testable as LOGIC rather than through the DOM.\n *\n * ## Why it lives here and not in @dloizides/ui-tables\n *\n * `ui-tables` already had this arithmetic inside `DataTable/selection.ts`, but deliberately\n * unexported: its tri-state is a `const enum`, which in a published `.d.ts` is an ambient const\n * enum that every `isolatedModules` consumer rejects. It is also page-scoped and wired to the\n * table's select-all banner. So the second consumer (a 12-tile console picker with no table in\n * sight, and no reason to pull a table package into its bundle budget) could not reach it.\n *\n * This module is the extraction: domain-neutral (keys in, keys out — nothing here knows what a\n * key *is*), component-free, and crossing the package boundary as a plain interface rather than\n * an enum. `ui-tables` can adopt it and delete its private copy.\n */\n\n/** Nothing selected / an empty group — the empty count. */\nconst NONE = 0;\n\n/**\n * A group's tri-state, as two booleans rather than an enum.\n *\n * `all` and `some` are mutually exclusive: a fully selected group is `{ all: true, some: false }`,\n * so a caller can branch on `all` then `some` without re-deriving \"partial\" itself. Both false\n * means nothing in the group is selected — which is also what an EMPTY group reports, because an\n * empty group is neither fully nor partially selected.\n */\nexport interface GroupSelection {\n /** Every key in the group is selected (never true for an empty group). */\n readonly all: boolean;\n /** At least one, but not every, key in the group is selected — the mixed/indeterminate state. */\n readonly some: boolean;\n}\n\n/** How many of the group's keys are currently selected. */\nfunction countSelected<T>(selected: readonly T[], groupKeys: readonly T[]): number {\n return groupKeys.filter((key) => selected.includes(key)).length;\n}\n\n/**\n * Resolve a group's tri-state from the selection ∩ the group.\n *\n * Scoped to the GROUP, not to the whole selection: selected keys OUTSIDE the group must never\n * make this group look partially selected.\n */\nexport function resolveGroupSelection<T>(selected: readonly T[], groupKeys: readonly T[]): GroupSelection {\n const count = countSelected(selected, groupKeys);\n if (count === NONE) return { all: false, some: false };\n return count === groupKeys.length ? { all: true, some: false } : { all: false, some: true };\n}\n\n/**\n * The value an `aria-checked` / `accessibilityState` consumer needs for a tri-state control.\n *\n * A partially selected group is `'mixed'`, which is what makes a screen reader announce the\n * control honestly instead of claiming the whole category is on.\n */\nexport function groupAriaChecked(state: GroupSelection): boolean | 'mixed' {\n if (state.all) return true;\n return state.some ? 'mixed' : false;\n}\n\n/**\n * Toggle a whole group, returning the NEXT selection array. Pure — never mutates the input.\n *\n * All-on → off. Partial or off → on: the conventional behaviour, and the one a mixed checkbox\n * looks like it will do. Keys OUTSIDE the group always survive untouched, so a category control\n * can never silently clear a selection it does not own.\n *\n * `order`, when given, is the canonical key order the result is sorted into (catalogue order, say)\n * so the selection does not carry click order around. Without it, newly added keys are appended.\n */\nexport function toggleGroupSelection<T>(\n selected: readonly T[],\n groupKeys: readonly T[],\n order?: readonly T[],\n): T[] {\n const { all } = resolveGroupSelection(selected, groupKeys);\n if (all) return selected.filter((key) => !groupKeys.includes(key));\n const merged = [...selected];\n groupKeys.forEach((key) => {\n if (!merged.includes(key)) merged.push(key);\n });\n return order === undefined ? merged : order.filter((key) => merged.includes(key));\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useFocusRing } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { StepperStep } from './stepperModel';\n\nconst ROW_GAP = 4;\nconst TAB_PADDING = 4;\nconst INDICATOR_WIDTH = 2;\nconst TAB_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n row: { flexDirection: 'row', flexWrap: 'nowrap', gap: ROW_GAP },\n tab: {\n borderBottomWidth: INDICATOR_WIDTH,\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 1,\n justifyContent: 'center',\n minHeight: MIN_TOUCH_TARGET_PX,\n minWidth: 0,\n paddingHorizontal: TAB_PADDING,\n },\n text: { fontSize: TAB_FONT_SIZE, textAlign: 'center' },\n textSelected: { fontWeight: '700' },\n});\n\ninterface WebKeyProps {\n onKeyDown: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\ninterface StepperTabProps<TKey extends string | number> {\n step: StepperStep<TKey>;\n selected: boolean;\n hint: string;\n onStep: (key: TKey) => void;\n testID: string;\n}\n\nconst StepperTab = <TKey extends string | number>({\n step,\n selected,\n hint,\n onStep,\n testID,\n}: StepperTabProps<TKey>): React.ReactElement => {\n const { theme } = useUi();\n const ring = useFocusRing();\n const indicator = selected ? theme.palette.primary['500'] : theme.colors.border;\n const webKeyProps: WebKeyProps = {\n onKeyDown: (event) => {\n if (event.key !== ' ') return;\n event.preventDefault?.();\n onStep(step.key);\n },\n };\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={step.label}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n aria-selected={selected}\n style={[styles.tab, { borderBottomColor: indicator }, ring.ringStyle]}\n testID={testID}\n onBlur={ring.onBlur}\n onFocus={ring.onFocus}\n onPress={() => onStep(step.key)}\n {...webKeyProps}\n >\n <Text style={[styles.text, { color: theme.colors.text }, selected ? styles.textSelected : undefined]}>\n {step.label}\n </Text>\n </Pressable>\n );\n};\n\nexport interface StepperTabsProps<TKey extends string | number = string> {\n steps: readonly StepperStep<TKey>[];\n current: TKey;\n onStep: (key: TKey) => void;\n /** Pre-localized accessibility hint for every tab. */\n stepHint: string;\n /** Row testID; each tab is `${testID}-${step.key}`. */\n testID: string;\n}\n\n/** A row of step tabs sharing the width; each label wraps inside its own tab. */\nexport const StepperTabs = <TKey extends string | number = string>({\n steps,\n current,\n onStep,\n stepHint,\n testID,\n}: StepperTabsProps<TKey>): React.ReactElement => (\n <View accessibilityRole=\"tablist\" style={styles.row} testID={testID}>\n {steps.map((step) => (\n <StepperTab\n hint={stepHint}\n key={step.key}\n selected={step.key === current}\n step={step}\n testID={`${testID}-${step.key}`}\n onStep={onStep}\n />\n ))}\n </View>\n);\n","/** One step; `label` is pre-localized and shown on its tab. */\nexport interface StepperStep<TKey extends string | number = string> {\n key: TKey;\n label: string;\n}\n\nexport interface StepNeighbours<TKey extends string | number = string> {\n previous: StepperStep<TKey> | null;\n next: StepperStep<TKey> | null;\n}\n\n/** The steps either side of `current`; both null when `current` is not a step. */\nexport function resolveStepNeighbours<TKey extends string | number>(\n steps: readonly StepperStep<TKey>[],\n current: TKey,\n): StepNeighbours<TKey> {\n const index = steps.findIndex((step) => step.key === current);\n if (index < 0) return { previous: null, next: null };\n return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };\n}\n","import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { resolveStepNeighbours } from './stepperModel';\nimport type { StepperStep } from './stepperModel';\n\nconst ROW_GAP = 8;\n\nconst styles = StyleSheet.create({\n cell: { flex: 1, minWidth: 0 },\n row: { flexDirection: 'row', gap: ROW_GAP },\n});\n\nexport interface StepperNavLabels<TKey extends string | number = string> {\n back: string;\n backHint: string;\n /** The next button's label, built from the step it leads to. */\n next: (step: StepperStep<TKey>) => string;\n nextHint: string;\n}\n\nexport interface StepperNavProps<TKey extends string | number = string> {\n steps: readonly StepperStep<TKey>[];\n current: TKey;\n onStep: (key: TKey) => void;\n labels: StepperNavLabels<TKey>;\n /** Row testID; the buttons are `${testID}-back` and `${testID}-next`. */\n testID: string;\n}\n\n/** Back and next under a step: back is disabled on the first step, next is absent on the last. */\nexport const StepperNav = <TKey extends string | number = string>({\n steps,\n current,\n onStep,\n labels,\n testID,\n}: StepperNavProps<TKey>): React.ReactElement => {\n const { previous, next } = resolveStepNeighbours(steps, current);\n return (\n <View style={styles.row} testID={testID}>\n <View style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={labels.backHint}\n accessibilityLabel={labels.back}\n autoLoading={false}\n disabled={previous === null}\n label={labels.back}\n testID={`${testID}-back`}\n variant=\"outline\"\n onPress={() => {\n if (previous !== null) onStep(previous.key);\n }}\n />\n </View>\n {next === null ? null : (\n <View style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={labels.nextHint}\n accessibilityLabel={labels.next(next)}\n autoLoading={false}\n label={labels.next(next)}\n testID={`${testID}-next`}\n onPress={() => onStep(next.key)}\n />\n </View>\n )}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, type StyleProp, type TextStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst STATUS_FONT = 16;\n\nconst styles = StyleSheet.create({\n line: { fontSize: STATUS_FONT },\n});\n\nexport interface FormStatusLineProps {\n message: string | null | undefined;\n testID: string;\n style?: StyleProp<TextStyle>;\n}\n\n/** A form's result message, announced as an alert; renders nothing until there is one. */\nexport function FormStatusLine({ message, testID, style }: FormStatusLineProps): React.ReactElement | null {\n const { theme } = useUi();\n if (message === null || message === undefined || message === '') return null;\n return (\n <Text role=\"alert\" style={[styles.line, { color: theme.colors.text }, style]} testID={testID}>\n {message}\n </Text>\n );\n}\n","import { useCallback, useRef, type RefObject } from 'react';\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type FocusableRefs<Field extends string> = Readonly<Record<Field, RefObject<Focusable | null>>>;\n\n/** Returns a stable function that focuses the first listed field that is on screen. */\nexport function useFocusFirstInvalid<Field extends string>(refs: FocusableRefs<Field>): (invalid: readonly Field[]) => void {\n const latest = useRef(refs);\n latest.current = refs;\n return useCallback((invalid: readonly Field[]) => {\n const first = invalid.map((field) => latest.current[field].current).find((node) => node !== null);\n first?.focus();\n }, []);\n}\n","import type { FieldError } from '@dloizides/api-client-base';\n\nexport type CodeFormatter = (code: string, error: FieldError) => string | null | undefined;\n\nexport interface AssignedServerErrors<Field extends string> {\n byField: Partial<Record<Field, string>>;\n formError: string | null;\n matched: Field[];\n}\n\nfunction lastSegment(path: string): string {\n return path.slice(path.lastIndexOf('.') + 1).toLowerCase();\n}\n\nfunction matchField<Field extends string>(path: string, fields: readonly Field[]): Field | null {\n const exact = fields.find((field) => field === path);\n if (exact !== undefined) {return exact;}\n const key = lastSegment(path);\n return key === '' ? null : fields.find((field) => field.toLowerCase() === key) ?? null;\n}\n\nfunction messageOf(error: FieldError, formatCode: CodeFormatter | undefined): string {\n const formatted = error.code !== undefined && formatCode !== undefined ? formatCode(error.code, error) : null;\n return typeof formatted === 'string' && formatted !== '' ? formatted : error.message;\n}\n\n/** Splits parsed server errors into the first message per known field and the first unmatched message. */\nexport function assignServerErrors<Field extends string>(\n errors: readonly FieldError[],\n fields: readonly Field[],\n formatCode?: CodeFormatter,\n): AssignedServerErrors<Field> {\n const byField: Partial<Record<Field, string>> = {};\n let formError: string | null = null;\n for (const error of errors) {\n const field = matchField(error.path, fields);\n const message = messageOf(error, formatCode);\n if (field === null) {formError = formError ?? message;}\n else if (byField[field] === undefined) {byField[field] = message;}\n }\n const matched = fields.filter((field) => byField[field] !== undefined);\n return { byField, formError, matched };\n}\n","import { useCallback, useState } from 'react';\n\nimport { parseFieldErrors } from '@dloizides/api-client-base';\n\nimport { assignServerErrors, type CodeFormatter } from './assignServerErrors';\nimport { useFocusFirstInvalid, type FocusableRefs } from '../useFocusFirstInvalid/useFocusFirstInvalid';\n\nexport interface UseServerFieldErrorsOptions<Field extends string> {\n fields: readonly Field[];\n refs?: FocusableRefs<Field>;\n formatCode?: CodeFormatter;\n}\n\nexport interface ServerFieldErrors<Field extends string> {\n errorFor: (field: Field) => string | undefined;\n apply: (error: unknown) => boolean;\n clear: (field: Field) => void;\n formError: string | null;\n reset: () => void;\n}\n\ninterface ServerErrorState<Field extends string> {\n byField: Partial<Record<Field, string>>;\n formError: string | null;\n}\n\nconst EMPTY_STATE = { byField: {}, formError: null };\nconst NO_REFS = {};\n\nfunction withoutField<Field extends string>(state: ServerErrorState<Field>, field: Field): ServerErrorState<Field> {\n if (state.byField[field] === undefined) {return state;}\n const byField = { ...state.byField };\n delete byField[field];\n return { ...state, byField };\n}\n\n/** Binds a thrown 400 to form fields: the message under each known field, the rest on the form status line. */\nexport function useServerFieldErrors<Field extends string>(options: UseServerFieldErrorsOptions<Field>): ServerFieldErrors<Field> {\n const { fields, refs, formatCode } = options;\n const [state, setState] = useState<ServerErrorState<Field>>(EMPTY_STATE);\n const focusFirst = useFocusFirstInvalid<Field>(refs ?? (NO_REFS as FocusableRefs<Field>));\n const hasRefs = refs !== undefined;\n\n const apply = useCallback(\n (error: unknown): boolean => {\n const assigned = assignServerErrors(parseFieldErrors(error), fields, formatCode);\n setState({ byField: assigned.byField, formError: assigned.formError });\n if (hasRefs && assigned.matched.length > 0) {focusFirst(assigned.matched);}\n return assigned.matched.length > 0;\n },\n [fields, formatCode, focusFirst, hasRefs],\n );\n const clear = useCallback((field: Field) => setState((current) => withoutField(current, field)), []);\n const reset = useCallback(() => setState(EMPTY_STATE), []);\n const errorFor = useCallback((field: Field) => state.byField[field], [state.byField]);\n\n return { errorFor, apply, clear, formError: state.formError, reset };\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\nimport type { View } from 'react-native';\n\ntype Scrollable = Pick<HTMLElement, 'scrollIntoView'>;\n\nfunction isScrollable(node: unknown): node is Scrollable {\n return 'scrollIntoView' in Object(node);\n}\n\n/** Scrolls the returned view fully into sight each time `trigger` takes a new value. */\nexport function useKeepInView(trigger: unknown): RefObject<View | null> {\n const ref = useRef<View>(null);\n useEffect(() => {\n const node: unknown = ref.current;\n const hasTrigger = trigger !== undefined && trigger !== null;\n if (hasTrigger && isScrollable(node)) node.scrollIntoView({ block: 'nearest' });\n }, [trigger]);\n return ref;\n}\n","import React from 'react';\n\nimport { Platform, Pressable, StyleSheet, Text } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst IS_WEB = Platform.OS === 'web';\nconst INPUT_FONT = 14;\n\nconst styles = StyleSheet.create({\n nativeButton: { minHeight: MIN_TOUCH_TARGET_PX, minWidth: MIN_TOUCH_TARGET_PX, justifyContent: 'center' },\n nativeText: { fontSize: INPUT_FONT },\n});\n\nexport interface FileInputProps {\n /** PRE-LOCALIZED accessible name of the control. */\n accessibilityLabel: string;\n accessibilityHint?: string;\n /** Called with the chosen files; never called with an empty list. */\n onFiles: (files: readonly File[]) => void;\n /** Accepted types, e.g. `.pdf,image/*`. */\n accept?: string;\n multiple?: boolean;\n disabled?: boolean;\n /** DOM id, e.g. the `Field` render-child `controlId`, so `<label for>` names the input. */\n id?: string;\n describedById?: string;\n /** PRE-LOCALIZED button text off web. Defaults to `accessibilityLabel`. */\n nativeLabel?: string;\n /** Off web there is no file input: the caller opens its own picker here. */\n onNativePick?: () => void;\n /** testID of the web `<input type=\"file\">` (Playwright `setInputFiles`) or the native button. */\n testID: string;\n}\n\n/** A file picker atom: a real `<input type=\"file\">` on web, a pressable that hands off to the caller's picker elsewhere. */\nexport function FileInput({\n accessibilityLabel,\n accessibilityHint,\n onFiles,\n accept,\n multiple = false,\n disabled = false,\n id,\n describedById,\n nativeLabel,\n onNativePick,\n testID,\n}: FileInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n\n if (!IS_WEB) {\n return (\n <Pressable\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled }}\n disabled={disabled}\n style={styles.nativeButton}\n testID={testID}\n onPress={onNativePick}\n >\n <Text style={[styles.nativeText, { color: colors.text }]}>{nativeLabel ?? accessibilityLabel}</Text>\n </Pressable>\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const files = Array.from(event.target.files ?? []);\n if (files.length > 0) onFiles(files);\n };\n\n return (\n <input\n accept={accept}\n aria-describedby={describedById}\n aria-label={accessibilityLabel}\n data-testid={testID}\n disabled={disabled}\n id={id}\n multiple={multiple}\n style={{ minHeight: MIN_TOUCH_TARGET_PX, color: colors.text, fontSize: INPUT_FONT, fontFamily: 'inherit' }}\n title={accessibilityHint}\n type=\"file\"\n onChange={handleChange}\n />\n );\n}\n\nexport default FileInput;\n","import React, { useState } from 'react';\n\nimport { Image, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useFocusRing } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FormField } from '../FormField/FormField';\n\nconst DEFAULT_PREVIEW_PX = 48;\nconst PREVIEW_RADIUS = 8;\nconst GAP = 8;\nconst TITLE_FONT_SIZE = 14;\nconst HELP_FONT_SIZE = 13;\n\nconst styles = StyleSheet.create({\n help: { flex: 1, fontSize: HELP_FONT_SIZE },\n root: { gap: GAP },\n tile: { alignItems: 'center', flexDirection: 'row', gap: GAP },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: '700' },\n toggle: { alignSelf: 'flex-start', justifyContent: 'center', minHeight: MIN_TOUCH_TARGET_PX },\n toggleText: { fontSize: TITLE_FONT_SIZE, fontWeight: '700', textDecorationLine: 'underline' },\n});\n\n/** Every string the field shows; all pre-localized. */\nexport interface UploadWithLinkLabels {\n title: string;\n help?: string;\n pasteToggle: string;\n pasteToggleHint: string;\n link: string;\n linkHint: string;\n linkPlaceholder: string;\n}\n\nexport interface UploadWithLinkFieldProps {\n value: string | null | undefined;\n onChange: (url: string) => void;\n labels: UploadWithLinkLabels;\n /** The upload control, e.g. ui-media `ImagePickerButton`; its transport stays with the app. */\n uploadControl: React.ReactNode;\n /** The link input; the others are `${testID}-preview` and `${testID}-paste`. */\n testID: string;\n disabled?: boolean;\n previewSize?: number;\n}\n\n/** An image field: preview, an upload control, and a link input revealed on request. */\nexport const UploadWithLinkField = ({\n value,\n onChange,\n labels,\n uploadControl,\n testID,\n disabled = false,\n previewSize = DEFAULT_PREVIEW_PX,\n}: UploadWithLinkFieldProps): React.ReactElement => {\n const { theme } = useUi();\n const ring = useFocusRing();\n const url = value ?? '';\n const [pasting, setPasting] = useState(url !== '');\n const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };\n return (\n <View style={styles.root}>\n <Text style={[styles.title, { color: theme.colors.text }]}>{labels.title}</Text>\n <View style={styles.tile}>\n {url === ''\n ? <View style={[previewBox, { backgroundColor: theme.colors.border }]} />\n : <Image accessible={false} source={{ uri: url }} style={previewBox} testID={`${testID}-preview`} />}\n {labels.help === undefined ? null : (\n <Text style={[styles.help, { color: theme.colors.text }]}>{labels.help}</Text>\n )}\n </View>\n {uploadControl}\n <Pressable\n accessibilityHint={labels.pasteToggleHint}\n accessibilityLabel={labels.pasteToggle}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: pasting }}\n aria-expanded={pasting}\n style={[styles.toggle, ring.ringStyle]}\n testID={`${testID}-paste`}\n onBlur={ring.onBlur}\n onFocus={ring.onFocus}\n onPress={() => setPasting(!pasting)}\n >\n <Text style={[styles.toggleText, { color: theme.colors.text }]}>{labels.pasteToggle}</Text>\n </Pressable>\n {pasting ? (\n <FormField\n accessibilityHint={labels.linkHint}\n editable={!disabled}\n label={labels.link}\n placeholder={labels.linkPlaceholder}\n testID={testID}\n value={url}\n onChangeText={onChange}\n />\n ) : null}\n </View>\n );\n};\n","import React, { useState } from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nconst ACTION_GAP = 8;\nconst GROUP_GAP = 16;\n\nconst styles = StyleSheet.create({\n action: { alignItems: 'flex-start', marginTop: ACTION_GAP },\n group: { marginBottom: GROUP_GAP },\n});\n\nexport interface AddOnRequestProps {\n addLabel: string;\n addHint: string;\n removeLabel: string;\n removeHint: string;\n hasValue: boolean;\n onRemove: () => void;\n testID: string;\n children: React.ReactNode;\n disabled?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/** Whether an optional field group shows its fields: once it holds a value or the user asked for it. */\nexport const isAddOnOpen = (hasValue: boolean, requested: boolean): boolean => hasValue || requested;\n\n/** An optional field group: an Add button until asked for or filled, then the fields (children) and a Remove button. */\nexport const AddOnRequest = ({\n addLabel,\n addHint,\n removeLabel,\n removeHint,\n hasValue,\n onRemove,\n testID,\n children,\n disabled = false,\n style,\n}: AddOnRequestProps): React.ReactElement => {\n const [requested, setRequested] = useState<boolean>(false);\n const remove = (): void => {\n setRequested(false);\n onRemove();\n };\n if (!isAddOnOpen(hasValue, requested))\n return (\n <View style={[styles.action, style]}>\n <Button\n accessibilityHint={addHint}\n accessibilityLabel={addLabel}\n disabled={disabled}\n label={addLabel}\n testID={`${testID}-add`}\n variant=\"secondary\"\n onPress={() => setRequested(true)}\n />\n </View>\n );\n return (\n <View style={[styles.group, style]} testID={testID}>\n {children}\n <View style={styles.action}>\n <Button\n accessibilityHint={removeHint}\n accessibilityLabel={removeLabel}\n disabled={disabled}\n label={removeLabel}\n testID={`${testID}-remove`}\n variant=\"secondary\"\n onPress={remove}\n />\n </View>\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\nconst ROW_GAP = 8;\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n row: { alignItems: 'center', columnGap: ROW_GAP, flexDirection: 'row', justifyContent: 'space-between' },\n text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\nexport interface FixBarProps {\n count: number;\n message: string;\n showLabel: string;\n showHint: string;\n onShow: () => void;\n testID: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** Whether the fix bar shows: only while at least one field stops the save. */\nexport const isFixBarVisible = (count: number): boolean => count > 0;\n\n/** A bar above Save: a pre-localized message naming the fields that stop the save, and a Show button. */\nexport const FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }: FixBarProps): React.ReactElement | null => {\n const { theme } = useUi();\n if (!isFixBarVisible(count)) return null;\n return (\n <View style={[styles.row, style]} testID={testID}>\n <Text role=\"alert\" style={[styles.text, { color: fieldErrorInk(theme) }]} testID={`${testID}-count`}>\n {message}\n </Text>\n <Button\n accessibilityHint={showHint}\n accessibilityLabel={showLabel}\n label={showLabel}\n testID={`${testID}-show`}\n variant=\"secondary\"\n onPress={onShow}\n />\n </View>\n );\n};\n","/** How the option list opens: a sheet from below (phone) or a list unfolding under the field. */\nexport enum SelectSurface {\n Sheet = 'sheet',\n Dropdown = 'dropdown',\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { useKeepInView } from '../../useKeepInView/useKeepInView';\n\nconst ROW_PAD_H = 12;\nconst ROW_GAP = 8;\nconst OPTION_FONT = 14;\nconst DETAIL_FONT = 12;\n\nexport interface OptionRowProps {\n option: ControlOption;\n active: boolean;\n current: boolean;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n onPick: (option: ControlOption) => void;\n optionHint: string;\n testID: string;\n}\n\n/** One option row; the highlighted row is announced as selected and kept in view. */\nexport function OptionRow({ option, active, current, renderLeading, renderDetail, onPick, optionHint, testID }: OptionRowProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const ref = useKeepInView(active ? option.value : null);\n const detailBelow = renderDetail === undefined && option.detail !== undefined;\n return (\n <Pressable\n ref={ref}\n accessibilityHint={optionHint}\n accessibilityLabel={option.label}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: active, checked: current }}\n style={[styles.row, active ? { backgroundColor: colors.surface } : null]}\n testID={`${testID}-option-${option.value}`}\n onPress={() => onPick(option)}\n >\n {renderLeading?.(option)}\n <View style={styles.label}>\n <Text style={[styles.primary, { color: colors.text }]}>{option.label}</Text>\n {detailBelow ? <Text style={[styles.secondary, { color: colors.textSecondary }]}>{option.detail}</Text> : null}\n </View>\n {renderDetail?.(option)}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n row: { minHeight: MIN_TOUCH_TARGET_PX, flexDirection: 'row', alignItems: 'center', gap: ROW_GAP, paddingHorizontal: ROW_PAD_H },\n label: { flex: 1 },\n primary: { fontSize: OPTION_FONT, flexShrink: 1 },\n secondary: { fontSize: DETAIL_FONT },\n});\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { OptionRow } from './OptionRow';\n\nconst ROW_PAD_H = 12;\nconst ROW_GAP = 8;\nconst HEADER_FONT = 11;\n\ninterface OptionSectionProps {\n title: string;\n options: readonly ControlOption[];\n offset: number;\n highlight: number;\n selectedValue: string;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n onPick: (option: ControlOption) => void;\n optionHint: string;\n testID: string;\n}\n\n/** One titled group of option rows (Recent or All). */\nexport function OptionSection({ title, options, offset, highlight, selectedValue, ...row }: OptionSectionProps): React.ReactElement | null {\n const { theme } = useUi();\n const { colors } = theme;\n if (options.length === 0) return null;\n return (\n <View>\n <Text accessibilityRole=\"header\" style={[styles.header, { color: colors.textSecondary }]}>{title}</Text>\n {options.map((option, index) => (\n <OptionRow key={option.value} {...row} active={offset + index === highlight} current={option.value === selectedValue} option={option} />\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H, paddingTop: ROW_GAP, textTransform: 'uppercase' },\n});\n","import React, { useCallback, useEffect, useRef, type RefObject } from 'react';\n\nimport { Animated, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s, MENU_MAX_HEIGHT } from '../../controls/controlStyles';\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { SearchSelectState } from '../hooks/useSearchSelectState';\nimport { SelectSurface } from '../SelectSurface';\nimport type { SearchSelectLabels } from '../types';\nimport type { SelectMotion } from '../utils/searchSelectMotion';\nimport { DropdownSurface } from './DropdownSurface';\nimport { OptionSection } from './OptionSection';\nimport { SheetSurface } from './SheetSurface';\n\nconst KEY_ESCAPE = 'Escape';\nconst PANEL_PAD = 8;\nconst PANEL_RADIUS = 8;\nconst SHEET_MAX_HEIGHT = 480;\n\ninterface SearchSelectPanelProps {\n motion: SelectMotion;\n state: SearchSelectState;\n labels: SearchSelectLabels;\n anchorRef: RefObject<View | null>;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n selectedValue: string;\n testID: string;\n}\n\n/** The search box and the option list, on a sheet or a dropdown surface. */\nexport function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, renderDetail, selectedValue, testID }: SearchSelectPanelProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const progress = useRef(new Animated.Value(0)).current;\n const { durationMs } = motion;\n\n useEffect(() => {\n Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();\n }, [progress, durationMs]);\n\n const leaving = useRef(false);\n const leave = useCallback((after: () => void) => {\n if (leaving.current) return;\n leaving.current = true;\n if (durationMs === 0) return after();\n Animated.timing(progress, { toValue: 0, duration: durationMs, useNativeDriver: false }).start(() => after());\n }, [progress, durationMs]);\n\n const { close, pick: pickNow, submit: submitNow, onKey, sections, highlight } = state;\n const dismiss = useCallback(() => leave(close), [leave, close]);\n const pick = useCallback((option: ControlOption) => leave(() => pickNow(option)), [leave, pickNow]);\n const submit = useCallback(() => submitNow(pick), [submitNow, pick]);\n const onKeyPress = useCallback((key: string) => (key === KEY_ESCAPE ? dismiss() : onKey(key)), [dismiss, onKey]);\n\n const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });\n const isSheet = motion.surface === SelectSurface.Sheet;\n const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };\n const list = (\n <View style={[styles.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }]} testID={`${testID}-panel`}>\n <TextInput\n autoFocus\n accessibilityHint={labels.searchHint}\n accessibilityLabel={labels.search}\n placeholder={labels.search}\n placeholderTextColor={colors.textSecondary}\n style={[s.input, { color: colors.text, borderColor: colors.border }]}\n testID={`${testID}-search`}\n value={state.query}\n onChangeText={state.setQuery}\n onKeyPress={(event) => onKeyPress(event.nativeEvent.key)}\n onSubmitEditing={submit}\n />\n <ScrollView keyboardShouldPersistTaps=\"handled\" style={isSheet ? styles.sheetList : styles.dropList}>\n <OptionSection {...shared} offset={0} options={sections.recent} title={labels.recent} />\n <OptionSection {...shared} offset={sections.recent.length} options={sections.all} title={labels.all} />\n {sections.flat.length === 0 ? <Text style={[styles.empty, { color: colors.textSecondary }]}>{labels.empty}</Text> : null}\n </ScrollView>\n </View>\n );\n\n if (!isSheet) return <DropdownSurface anchorRef={anchorRef} closeHint={labels.closeHint} closeLabel={labels.close} progress={progress} testID={testID} translateY={translateY} onDismiss={dismiss}>{list}</DropdownSurface>;\n return <SheetSurface closeHint={labels.closeHint} closeLabel={labels.close} testID={testID} translateY={translateY} onDismiss={dismiss}>{list}</SheetSurface>;\n}\n\nconst styles = StyleSheet.create({\n panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },\n dropList: { maxHeight: MENU_MAX_HEIGHT },\n sheetList: { maxHeight: SHEET_MAX_HEIGHT },\n empty: { padding: PANEL_PAD },\n});\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/** Focuses `ref` once the list has closed and its surface, with the Modal focus trap, has left the page. */\nexport function useRefocusOnClose(open: boolean, ref: RefObject<{ focus: () => void } | null>): void {\n const wasOpen = useRef(false);\n useEffect(() => {\n if (wasOpen.current && !open) ref.current?.focus();\n wasOpen.current = open;\n }, [open, ref]);\n}\n","import type { ControlOption } from '../../controls/controlTypes';\r\nimport { suggestOptions } from '../../controls/suggestOptions';\r\n\r\nconst MIN_QUERY = 1;\r\n\r\n/** The open list: recently picked matches first, then every other match; `flat` is the walk order. */\r\nexport interface SearchSelectSections {\r\n readonly recent: readonly ControlOption[];\r\n readonly all: readonly ControlOption[];\r\n readonly flat: readonly ControlOption[];\r\n}\r\n\r\n/** Filters by label, value and detail, then splits the matches into Recent and All. */\r\nexport function buildSearchSelectSections(options: readonly ControlOption[], query: string, recentValues: readonly string[]): SearchSelectSections {\r\n const matches = query.trim() === '' ? options : suggestOptions(options, query, MIN_QUERY, options.length);\r\n const byValue = new Map(matches.map((option) => [option.value, option] as const));\r\n const recent = recentValues.map((value) => byValue.get(value)).filter((option): option is ControlOption => option !== undefined);\r\n const recentSet = new Set(recent.map((option) => option.value));\r\n const all = matches.filter((option) => !recentSet.has(option.value));\r\n return { recent, all, flat: [...recent, ...all] };\r\n}\r\n\r\n/** The option whose value is `value`, or `null`; a value that is no option shows the placeholder. */\r\nexport function findOption(options: readonly ControlOption[], value: string): ControlOption | null {\r\n return options.find((option) => option.value === value) ?? null;\r\n}\r\n\r\n/** Moves the highlight by `step`, wrapping at both ends; `-1` means nothing highlighted. */\r\nexport function moveHighlight(index: number, count: number, step: number): number {\r\n if (count === 0) return -1;\r\n if (index < 0) return step > 0 ? 0 : count - 1;\r\n return (index + step + count) % count;\r\n}\r\n\r\n/** The highlight after the search text changes: the first match while there is text, nothing when empty. */\r\nexport function highlightAfterQuery(query: string): number {\r\n return query.trim() === '' ? -1 : 0;\r\n}\r\n","import { useCallback, useMemo, useState } from 'react';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { RecentValues } from '../../useRecentValues/useRecentValues';\nimport { buildSearchSelectSections, highlightAfterQuery, moveHighlight, type SearchSelectSections } from '../utils/searchSelectModel';\n\nconst KEY_DOWN = 'ArrowDown';\nconst KEY_UP = 'ArrowUp';\nconst KEY_ESCAPE = 'Escape';\n\n/** Open state, query, highlight and the actions of one SearchSelect. */\nexport interface SearchSelectState {\n open: boolean;\n query: string;\n highlight: number;\n active: ControlOption | undefined;\n sections: SearchSelectSections;\n openList: () => void;\n close: () => void;\n setQuery: (query: string) => void;\n pick: (option: ControlOption) => void;\n submit: (via?: (option: ControlOption) => void) => void;\n onKey: (key: string) => void;\n}\n\n/** Only `pick` calls `onChange`, so the value is always an option, never typed text; Enter picks only through `submit`. */\nexport function useSearchSelectState(options: readonly ControlOption[], recents: RecentValues, onChange: (value: string) => void, onClosed: () => void): SearchSelectState {\n const [open, setOpen] = useState(false);\n const [query, setQueryState] = useState('');\n const [rawHighlight, setHighlight] = useState(-1);\n const sections = useMemo(() => buildSearchSelectSections(options, query, recents.recents), [options, query, recents.recents]);\n const highlight = rawHighlight < sections.flat.length ? rawHighlight : -1;\n const active = sections.flat[highlight];\n const { remember } = recents;\n\n const close = useCallback(() => {\n setOpen(false);\n setQueryState('');\n setHighlight(-1);\n onClosed();\n }, [onClosed]);\n\n const pick = useCallback((option: ControlOption) => {\n remember(option.value);\n onChange(option.value);\n close();\n }, [remember, onChange, close]);\n\n const submit = useCallback((via: (option: ControlOption) => void = pick) => {\n if (active !== undefined) via(active);\n }, [active, pick]);\n\n const setQuery = useCallback((next: string) => {\n setQueryState(next);\n setHighlight(highlightAfterQuery(next));\n }, []);\n\n const onKey = useCallback((key: string) => {\n const count = sections.flat.length;\n if (key === KEY_DOWN) setHighlight(moveHighlight(highlight, count, 1));\n if (key === KEY_UP) setHighlight(moveHighlight(highlight, count, -1));\n if (key === KEY_ESCAPE) close();\n }, [sections.flat.length, highlight, close]);\n\n const openList = useCallback(() => setOpen(true), []);\n return { open, query, highlight, active, sections, openList, close, setQuery, pick, submit, onKey };\n}\n","import { SelectSurface } from '../SelectSurface';\n\n/** Below this window width the list opens as a sheet from the bottom. */\nexport const PHONE_MAX_WIDTH = 600;\nconst SHEET_TRAVEL_PX = 320;\nconst DROPDOWN_TRAVEL_PX = -8;\nconst SHEET_MS = 240;\nconst DROPDOWN_MS = 160;\n\n/** Where the list slides from and how long it takes. */\nexport interface SelectMotion {\n readonly surface: SelectSurface;\n readonly fromY: number;\n readonly durationMs: number;\n}\n\n/** Sheet on a phone, unfolding list on a computer; reduced motion keeps the surface and drops the slide. */\nexport function resolveSelectMotion(width: number, reducedMotion: boolean): SelectMotion {\n const isPhone = width < PHONE_MAX_WIDTH;\n const surface = isPhone ? SelectSurface.Sheet : SelectSurface.Dropdown;\n if (reducedMotion) return { surface, fromY: 0, durationMs: 0 };\n return isPhone ? { surface, fromY: SHEET_TRAVEL_PX, durationMs: SHEET_MS } : { surface, fromY: DROPDOWN_TRAVEL_PX, durationMs: DROPDOWN_MS };\n}\n","import React, { useCallback, useRef } from 'react';\r\n\r\nimport { Pressable, StyleSheet, Text, View, useWindowDimensions } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\nimport type { ControlOption } from '../controls/controlTypes';\r\nimport { useRecentValues } from '../useRecentValues/useRecentValues';\r\nimport { SearchSelectPanel } from './components/SearchSelectPanel';\r\nimport { useReducedMotion } from './hooks/useReducedMotion';\r\nimport { useRefocusOnClose } from './hooks/useRefocusOnClose';\r\nimport { useSearchSelectState } from './hooks/useSearchSelectState';\r\nimport type { SearchSelectLabels, SearchSelectTrigger } from './types';\r\nimport { findOption } from './utils/searchSelectModel';\r\nimport { resolveSelectMotion } from './utils/searchSelectMotion';\r\n\r\nconst CHEVRON = '▾';\r\nconst VALUE_GAP = 8;\r\nconst MIN_TOUCH = 44;\r\nconst NOTHING_ON_CLOSE = (): void => undefined;\r\n\r\nexport interface SearchSelectProps {\r\n options: readonly ControlOption[];\r\n value: string;\r\n onChange: (value: string) => void;\r\n accessibilityLabel: string;\r\n accessibilityHint: string;\r\n labels: SearchSelectLabels;\r\n testID: string;\r\n recentKey?: string;\r\n renderLeading?: (option: ControlOption) => React.ReactNode;\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n renderTrigger?: (trigger: SearchSelectTrigger) => React.ReactNode;\r\n onBlur?: () => void;\r\n}\r\n\r\n/** A select you can type into to filter; `renderTrigger` swaps the field box for your own visual; `onBlur` fires when focus leaves the closed field. */\r\nexport function SearchSelect(props: SearchSelectProps): React.ReactElement {\r\n const { options, value, onChange, accessibilityLabel, accessibilityHint, labels, testID, recentKey, renderLeading, renderDetail, renderTrigger, onBlur } = props;\r\n const { theme } = useUi();\r\n const { colors } = theme;\r\n const triggerRef = useRef<View>(null);\r\n const anchorRef = useRef<View>(null);\r\n const { width } = useWindowDimensions();\r\n const motion = resolveSelectMotion(width, useReducedMotion());\r\n const recents = useRecentValues(recentKey ?? `search-select:${testID}`);\r\n const state = useSearchSelectState(options, recents, onChange, NOTHING_ON_CLOSE);\r\n useRefocusOnClose(state.open, triggerRef);\r\n const selected = findOption(options, value);\r\n const onPress = state.open ? state.close : state.openList;\r\n const openRef = useRef(state.open);\r\n openRef.current = state.open;\r\n const onTriggerBlur = useCallback(() => {\r\n if (!openRef.current) onBlur?.();\r\n }, [onBlur]);\r\n\r\n return (\r\n <View ref={anchorRef} style={styles.anchor}>\r\n <Pressable\r\n ref={triggerRef}\r\n accessibilityHint={accessibilityHint}\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityRole=\"button\"\r\n accessibilityState={{ expanded: state.open }}\r\n style={renderTrigger === undefined ? [s.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles.customTrigger}\r\n testID={testID}\r\n onBlur={onTriggerBlur}\r\n onPress={onPress}\r\n >\r\n {renderTrigger !== undefined ? renderTrigger({ open: state.open, selected, onPress, ref: triggerRef }) : (\r\n <FieldBoxContent colors={colors} placeholder={labels.placeholder} renderDetail={renderDetail} renderLeading={renderLeading} selected={selected} />\r\n )}\r\n </Pressable>\r\n {state.open ? <SearchSelectPanel anchorRef={anchorRef} labels={labels} motion={motion} renderDetail={renderDetail} renderLeading={renderLeading} selectedValue={value} state={state} testID={testID} /> : null}\r\n </View>\r\n );\r\n}\r\n\r\ninterface FieldBoxContentProps {\r\n selected: ControlOption | null;\r\n placeholder: string;\r\n colors: { text: string; textSecondary: string };\r\n renderLeading?: (option: ControlOption) => React.ReactNode;\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n}\r\n\r\nfunction FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }: FieldBoxContentProps): React.ReactElement {\r\n return (\r\n <>\r\n <View style={styles.value}>\r\n {selected !== null && renderLeading !== undefined ? renderLeading(selected) : null}\r\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }]}>{selected?.label ?? placeholder}</Text>\r\n {selected !== null ? <SelectedDetail colors={colors} option={selected} renderDetail={renderDetail} /> : null}\r\n </View>\r\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{CHEVRON}</Text>\r\n </>\r\n );\r\n}\r\n\r\ninterface SelectedDetailProps {\r\n option: ControlOption;\r\n colors: { textSecondary: string };\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n}\r\n\r\nfunction SelectedDetail({ option, colors, renderDetail }: SelectedDetailProps): React.ReactElement | null {\r\n if (renderDetail !== undefined) return <>{renderDetail(option)}</>;\r\n if (option.detail === undefined) return null;\r\n return <Text style={[s.selectTriggerText, { color: colors.textSecondary }]}>{option.detail}</Text>;\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n anchor: { position: 'relative' },\r\n customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: 'flex-start', justifyContent: 'center' },\r\n value: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: VALUE_GAP },\r\n});\r\n","import { useEffect, type RefObject } from 'react';\n\nimport { Platform, type View } from 'react-native';\n\ntype Container = Pick<Node, 'contains'>;\n\nfunction isContainer(node: unknown): node is Container {\n return 'contains' in Object(node);\n}\n\n/** True when `target` lies outside `container`; false when `container` is no DOM node. */\nexport function isOutside(container: unknown, target: EventTarget | null): boolean {\n if (!isContainer(container)) return false;\n return !(target instanceof Node && container.contains(target));\n}\n\n/** On web, calls `onOutside` for a pointer press that starts outside the view behind `ref`. */\nexport function useOutsidePress(ref: RefObject<View | null>, onOutside: () => void): void {\n useEffect(() => {\n if (Platform.OS !== 'web' || typeof document === 'undefined') return undefined;\n const onPointerDown = (event: PointerEvent): void => {\n if (isOutside(ref.current, event.target)) onOutside();\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n return () => document.removeEventListener('pointerdown', onPointerDown, true);\n }, [ref, onOutside]);\n}\n","import { useCallback, type RefObject } from 'react';\n\nconst AFTER_SURFACE_UNMOUNT_MS = 0;\n\n/** Focuses `ref` on the next tick, after the closing list surface has left the page. */\nexport function useDeferredFocus(ref: RefObject<{ focus: () => void } | null>): () => void {\n return useCallback(() => {\n setTimeout(() => ref.current?.focus(), AFTER_SURFACE_UNMOUNT_MS);\n }, [ref]);\n}\n","export const FLAG_PALETTE: Readonly<Record<string, string | undefined>> = {\n R: '#D52B1E', W: '#FFFFFF', B: '#0039A6', N: '#012169', S: '#6CACE4', G: '#009A44',\n D: '#006A4E', Y: '#FCD116', K: '#000000', O: '#FF8200', M: '#9E3039',\n A: '#8D1B3D', T: '#00778B', P: '#5B2C83', I: '#A7A8AA', C: '#D57800', E: '#002664',\n};\n\nexport const FLAG_FALLBACK_FILL = '#C8CDD2';\n\nexport const FLAG_EDGE = '#8A9199';\n","export enum FlagShapeKind {\n Rect = 'rect',\n Circle = 'circle',\n Polygon = 'polygon',\n}\n","const BLUE_ENSIGN = 'HN j0,0,10,7';\nconst AUSTRALIA = `${BLUE_ENSIGN} s5,10.5,1.6,W s15,3,0.9,W s13,7,0.9,W s17,6,0.9,W s15,11.5,0.9,W`;\nconst SALTIRE_A = 'p0,0,1.8,0,20,12.7,20,14,18.2,14,0,1.3';\nconst SALTIRE_B = 'p20,0,18.2,0,0,12.7,0,14,1.8,14,20,1.3';\nconst SHIELD = 'p13.5,3.5,16.5,3.5,16.5,8.5,15,10,13.5,8.5';\n\nexport const FLAG_DRAWINGS_A_TO_L: Readonly<Record<string, string | undefined>> = {\n AD: 'VBYR p8.6,5.2,11.4,5.2,11.4,8,10,9.2,8.6,8,M',\n AG: 'HR p0,0,20,0,10,14,K c10,7,2.6,Y p5,7,15,7,10,14,B p6.8,9.5,13.2,9.5,10,14,W',\n AI: `${BLUE_ENSIGN} c15,7,2.6,W c15,8,1.4,O`,\n AL: 'HR p10,2.5,14,5,13,11,10,9,7,11,6,5,K',\n AO: 'HRK s10,7,2.2,Y',\n AQ: 'HS c10,7,3.5,W',\n AS: 'HN p20,0,0,7,20,14,R p20,1.2,2.6,7,20,12.8,W',\n AU: AUSTRALIA,\n AW: 'HS r0,9,20,0.8,Y r0,10.6,20,0.8,Y s3.5,3.5,2.2,W s3.5,3.5,1.6,R',\n BA: 'HB p5,0,15,0,15,14,Y s4.2,1.2,0.8,W s5.7,3.5,0.8,W s7.2,5.8,0.8,W s8.7,8.1,0.8,W s10.2,10.4,0.8,W s11.7,12.7,0.8,W',\n BB: 'VBYB p9.4,5,10,3,10.6,5,10.4,11,9.6,11,K p7.8,3.5,8.6,3.5,9,6.5,11,6.5,11.4,3.5,12.2,3.5,11.6,7.5,8.4,7.5,K',\n BF: 'HRG s10,7,1.8,Y',\n BH: 'HR p0,0,6,0,8,1.4,6,2.8,8,4.2,6,5.6,8,7,6,8.4,8,9.8,6,11.2,8,12.6,6,14,0,14,W',\n BI: `HR p0,0,10,7,0,14,G p20,0,10,7,20,14,G ${SALTIRE_A},W ${SALTIRE_B},W c10,7,3,W s10,5.8,0.8,R s9,7.8,0.8,R s11,7.8,0.8,R`,\n BJ: 'HYR r0,0,8,14,G',\n BM: 'HR j0,0,10,7 c15,7.5,2.6,W c15,8.4,1.4,R',\n BN: 'HY p0,3,20,9,20,11.5,0,5.5,W p0,5.5,20,11.5,20,14,0,8,K c10,7,2.5,R',\n BQ: 'HW p0,0,10,0,0,7,Y p20,4,20,14,6,14,B c5.5,6,2,K c5.5,6,1.5,W s5.5,6,1,R',\n BR: 'HG p10,1.5,18.5,7,10,12.5,1.5,7,Y c10,7,3.4,N p6.8,6,13.2,7.6,13.2,8.2,6.8,6.6,W',\n BS: 'HTYT p0,0,8,7,0,14,K',\n BT: 'HO p0,0,20,0,0,14,Y c10,7,2.4,W',\n BW: 'HS r0,5.2,20,3.6,W r0,5.8,20,2.4,K',\n BZ: 'HB r0,0,20,1.2,R r0,12.8,20,1.2,R c10,7,3.8,W c10,7,2.8,G',\n CA: 'HW r0,0,5,14,R r15,0,5,14,R p10,2.5,11,4.5,12,4,11.6,6.5,13.5,5.5,13,7,13.6,7.6,11.3,9,11.6,10,10.2,9.6,10.2,11.5,9.8,11.5,9.8,9.6,8.4,10,8.7,9,6.4,7.6,7,7,6.5,5.5,8.4,6.5,8,4,9,4.5,R',\n CC: 'HG c4,4,2.2,Y p3.5,6,4.5,6,4.2,2.5,3.8,2.5,G c9,7,1.8,Y c9.6,7,1.5,G s16,3,0.8,Y s14,7,0.8,Y s18,7,0.8,Y s16,11,0.8,Y',\n CD: 'HS p0,11,16,0,20,0,20,3,4,14,0,14,Y p0,12.2,17.6,0,20,0,20,1.8,2.4,14,0,14,R s4,3.5,2.2,Y',\n CF: 'HBWGY r8.5,0,3,14,R s3,1.75,1.2,Y',\n CG: 'HY p0,0,13,0,0,14,G p20,0,20,14,7,14,R',\n CK: `${BLUE_ENSIGN} c15,7,3,W c15,7,2.3,N`,\n CL: 'HWR r0,0,7,7,B s3.5,3.5,1.8,W',\n CN: 'HR s3.5,3.5,2.2,Y s7,1.4,0.7,Y s8.4,2.8,0.7,Y s8.4,4.9,0.7,Y s7,6.3,0.7,Y',\n CU: 'HBWBWB p0,0,10,7,0,14,R s3.3,7,1.8,W',\n CV: 'HB r0,7.4,20,1,W r0,8.4,20,1.2,R r0,9.6,20,1,W s7,6,0.6,Y s9.6,7,0.6,Y s9.6,11,0.6,Y s7,12,0.6,Y s4.4,11,0.6,Y s4.4,7,0.6,Y',\n CW: 'HB r0,9,20,1.8,Y s3,3,1.4,W s5.5,5,1,W',\n CX: 'HB p0,0,20,0,20,14,G c10,7,2,Y s3,10,0.8,W s5.5,12,0.8,W s6,8.5,0.8,W s3,6,0.6,W p13,3,17,2,15,4.5,Y',\n CY: 'HW p3,6,7,4,13,3.5,17,2,15,5,11,7,6,7.5,C p6.5,10.5,9.5,9.2,9.5,10,G p13.5,10.5,10.5,9.2,10.5,10,G',\n CZ: 'HWR p0,0,10,7,0,14,B',\n DJ: 'HSG p0,0,10,7,0,14,W s3.5,7,1.4,R',\n DM: 'HG r8.4,0,1,14,Y r9.4,0,1,14,K r10.4,0,1,14,W r0,5.4,20,1,Y r0,6.4,20,1,K r0,7.4,20,1,W c9.9,6.9,3,R c9.9,6.9,1.2,P',\n DO: 'HW r0,0,8.5,5.5,N r11.5,0,8.5,5.5,R r0,8.5,8.5,5.5,R r11.5,8.5,8.5,5.5,N c10,7,1.2,G',\n DZ: 'VGW c10,7,3.2,R c11.2,7,2.6,W s12.5,7,1.2,R',\n EC: 'HYYBR c10,7,2,Y c10,7,1.4,S',\n EG: 'HRWK p9,5.2,11,5.2,10.6,8.6,9.4,8.6,Y',\n EH: 'HKWG p0,0,7,7,0,14,R c10,7,1.8,R c10.6,7,1.5,W s11,7,0.9,R',\n ER: 'HGB p0,0,20,7,0,14,R c5,7,2.6,Y c5,7,2,R',\n FJ: 'HS j0,0,10,7 r13.5,4,3.5,4.5,W r13.5,4,3.5,1.2,R',\n FK: `${BLUE_ENSIGN} c15,7,2.6,S c15,8.2,1.4,W`,\n FM: 'HS s10,3.5,1.2,W s6.5,7,1.2,W s13.5,7,1.2,W s10,10.5,1.2,W',\n GB: 'j0,0,20,14',\n GD: 'HR p1.5,1.5,18.5,1.5,10,7,Y p1.5,12.5,18.5,12.5,10,7,Y p1.5,1.5,10,7,1.5,12.5,G p18.5,1.5,10,7,18.5,12.5,G c10,7,2,R s10,7,1.3,Y s5,0.75,0.6,Y s10,0.75,0.6,Y s15,0.75,0.6,Y s5,13.25,0.6,Y s10,13.25,0.6,Y s15,13.25,0.6,Y',\n GG: 'HW r8.5,0,3,14,R r0,5.5,20,3,R r9.6,4.2,0.8,5.6,Y r7.2,6.6,5.6,0.8,Y',\n GH: 'HRYG s10,7,2,K',\n GI: 'HWWR r6.5,3,7,5,R r6.5,1.8,1.5,1.4,R r9.25,1.8,1.5,1.4,R r12,1.8,1.5,1.4,R p9.5,9.3,10.5,9.3,10.5,12,9.5,12,Y',\n GL: 'HWR c7,7,4.5,R p2.5,7,3.1,9.25,4.75,10.9,7,11.5,9.25,10.9,10.9,9.25,11.5,7,W',\n GQ: 'HGWR p0,0,5,7,0,14,B c10,7,1.3,G',\n GR: 'HBWBWBWBWB r0,0,7.78,7.78,B r3.11,0,1.56,7.78,W r0,3.11,7.78,1.56,W',\n GS: `${BLUE_ENSIGN} c15,7,2.6,W c15,7.5,1.4,Y`,\n GU: 'HR r1,1,18,12,N p10,3,13,7,10,11,7,7,S',\n GW: 'HYG r0,0,7,14,R s3.5,7,2,K',\n GY: 'HG p0,0,20,7,0,14,W p0,0.8,18.6,7,0,13.2,Y p0,0,10,7,0,14,K p0,1,8.6,7,0,13,R',\n HK: 'HR s10,7,3.4,W s10,7,1,R',\n HM: AUSTRALIA,\n HN: 'HBWB s10,7,0.9,B s6.5,5.8,0.9,B s6.5,8.2,0.9,B s13.5,5.8,0.9,B s13.5,8.2,0.9,B',\n HR: 'HRWB r8.5,3.5,3,4,W r8.5,3.5,1,1,R r10.5,3.5,1,1,R r9.5,4.5,1,1,R r8.5,5.5,1,1,R r10.5,5.5,1,1,R r9.5,6.5,1,1,R',\n HT: 'HBR r7,4.5,6,5,W r9.3,5.3,1.4,3.4,G',\n IL: 'HW r0,1.4,20,2,B r0,10.6,20,2,B p10,4,12.6,8.5,7.4,8.5,B p10,10,7.4,5.5,12.6,5.5,B p10,4.8,11.9,8.1,8.1,8.1,W p10,9.2,8.1,5.9,11.9,5.9,W',\n IM: 'HR p9.6,6.6,6.2,3.4,6.8,2.8,10.4,6.4,W p10,6.4,14.5,4.3,14.8,5.1,10.2,7.2,W p9.6,7.2,9.1,11.8,10,11.9,10.4,7,W',\n IN: 'HOWG c10,7,1.8,N c10,7,1.4,W',\n IO: 'HW r0,3,20,1,N r0,6,20,1,N r0,9,20,1,N r0,12,20,1,N j0,0,10,7 p14,10,15,10,14.8,5,14.2,5,G c14.5,5,1.4,G',\n IQ: 'HRWK r7,5.6,6,1.4,G',\n JE: `HW ${SALTIRE_A},R ${SALTIRE_B},R p8.8,1.5,11.2,1.5,11.2,3.5,10,4.3,8.8,3.5,R c10,1.2,0.6,Y`,\n JM: `HG p0,0,10,7,0,14,K p20,0,10,7,20,14,K ${SALTIRE_A},Y ${SALTIRE_B},Y`,\n JO: 'HKWG p0,0,10,7,0,14,R s3.5,7,1.2,W',\n KE: 'HK r0,4.2,20,5.6,W r0,5,20,4,R r0,9.8,20,4.2,G p10,2,12.2,7,10,12,7.8,7,K p10,3,11.4,7,10,11,8.6,7,R r9.8,4,0.4,6,W',\n KH: 'HBRRB p6,9.5,6.5,6.5,8,6.5,8.5,5,9.5,5,10,3.5,10.5,5,11.5,5,12,6.5,13.5,6.5,14,9.5,W',\n KI: 'HR c10,7.2,3,Y r0,7,20,7,B r0,8.2,20,0.8,W r0,10.2,20,0.8,W r0,12.2,20,0.8,W p6.5,3.5,13.5,2.5,10.5,4.5,Y',\n KM: 'HYWRB p0,0,9,7,0,14,G c3.2,7,2.2,W c4,7,1.9,G',\n KN: 'HR p0,0,20,0,0,14,G p0,10,14.3,0,20,0,20,4,5.7,14,0,14,Y p0,11.6,16.6,0,20,0,20,2.4,3.4,14,0,14,K s7,8,0.9,W s13,4,0.9,W',\n KP: 'HB r0,2.4,20,9.2,W r0,2.9,20,8.2,R c6.5,7,2.6,W s6.5,7,2.3,R',\n KR: 'HW c10,7,3.4,R p6.6,7,7.1,8.7,8.3,9.9,10,10.4,11.7,9.9,12.9,8.7,13.4,7,B c8.3,7,1.7,R c11.7,7,1.7,B r3,2,2.4,0.5,K r3,3,2.4,0.5,K r3,4,2.4,0.5,K r14.6,10,2.4,0.5,K r14.6,11,2.4,0.5,K r14.6,12,2.4,0.5,K r3,10,2.4,0.5,K r3,11,2.4,0.5,K r3,12,2.4,0.5,K r14.6,2,2.4,0.5,K r14.6,3,2.4,0.5,K r14.6,4,2.4,0.5,K',\n KW: 'HGWR p0,0,5,4.67,5,9.33,0,14,K',\n KY: `${BLUE_ENSIGN} c15,7,2.6,W c15,7.8,1.6,R`,\n KZ: 'HS c10,6,2.2,Y p6,9,14,9,10,10.5,Y r1,0,1,14,Y',\n LB: 'HR r0,3.5,20,7,W p10,4.2,13,9.5,7,9.5,G',\n LC: 'HS p10,2,15,12,5,12,W p10,3.5,14,12,6,12,K p10,7,15,12,5,12,Y',\n LI: 'HBR p3,4.5,3,2,4.2,3,5,1.5,5.8,3,7,2,7,4.5,Y',\n LK: 'HY r1,1,2.5,12,G r3.5,1,2.5,12,O r7,1,12,12,A p9,11,17,11,16,4,13,3.5,11,5,Y',\n LR: 'HRWRWRWRWRWR r0,0,6.36,6.36,N s3.18,3.18,1.8,W',\n LY: 'HRKKG c10,7,2.2,W c10.7,7,1.8,K s12.2,7,0.9,W',\n};\n\nexport { BLUE_ENSIGN, SALTIRE_A, SALTIRE_B, SHIELD };\n","import { BLUE_ENSIGN, SHIELD } from './flagDrawingsAtoL';\n\nconst USA = 'HRWRWRWRWRWRWR r0,0,9,7.54,N s2,1.5,0.5,W s4.5,1.5,0.5,W s7,1.5,0.5,W s3.2,3.8,0.5,W s5.8,3.8,0.5,W s2,6,0.5,W s4.5,6,0.5,W s7,6,0.5,W';\nconst TRIBAND_FIMBRIATED = 'HK r0,4.2,20,5.6,W r0,5,20,4,R r0,9.8,20,4.2,G';\n\nexport const FLAG_DRAWINGS_M_TO_Z: Readonly<Record<string, string | undefined>> = {\n MA: 'HR s10,7,3.2,G s10,7,2.4,R',\n MD: 'VBYR p8.5,5,11.5,5,11,8.5,10,9.5,9,8.5,C',\n ME: 'HY r1,1,18,12,R p10,4,13,6,12,10,10,9,8,10,7,6,Y',\n MG: 'HRG r0,0,6.7,14,W',\n MH: 'HN p0,14,20,0.2,20,2.5,O p0,14,20,2.5,20,4.8,W s4.5,4.5,2.2,W',\n MK: 'HR p0,0,3,0,10,7,0,2,Y p20,0,17,0,10,7,20,2,Y p0,14,3,14,10,7,0,12,Y p20,14,17,14,10,7,20,12,Y p8.5,0,11.5,0,10,7,Y p8.5,14,11.5,14,10,7,Y p0,5.5,0,8.5,10,7,Y p20,5.5,20,8.5,10,7,Y c10,7,2.4,R c10,7,2,Y',\n MM: 'HYGR s10,7.4,4,W',\n MO: 'HG c10,8.5,1.8,W p7,10.5,13,10.5,12,11.2,8,11.2,W s10,4,0.9,Y s7.5,5,0.6,Y s12.5,5,0.6,Y s6,6.5,0.6,Y s14,6.5,0.6,Y',\n MP: 'HB c10,7,3.4,O c10,7,2.8,B p9,10,11,10,10.6,4.5,9.4,4.5,I s10,7,1.8,W',\n MR: 'HG r0,0,20,2,R r0,12,20,2,R c10,6.2,3,Y c10,5.2,2.8,G s10,5.4,1,Y',\n MS: `${BLUE_ENSIGN} c15,7,2.6,S c15,8.2,1.4,G`,\n MV: 'HR r4,3.5,12,7,G c10,7,2.6,W c11,7,2.3,G',\n MX: 'VGWR c10,6.8,1.5,M p8.2,7.6,11.8,7.6,11,9,9,9,G',\n MY: 'HRWRWRWRWRWRWRW r0,0,10,8,N c4,4,2.6,Y c4.8,4,2.2,N s7.6,4,1.6,Y',\n MZ: 'HG r0,4.5,20,5,W r0,5,20,4,K r0,9.5,20,4.5,Y p0,0,8,7,0,14,R s3,7,1.8,Y',\n NA: 'HG p0,0,20,0,0,14,B p0,14,0,11,15.7,0,20,0,20,3,4.3,14,W p0,14,0,12.4,17.7,0,20,0,20,1.6,2.3,14,R s4.5,3.5,2.2,Y',\n NE: 'HOWG c10,7,1.5,O',\n NF: 'VGWG p10,2,12,11,8,11,G r9.6,11,0.8,1.5,G',\n NI: 'HBWB p10,5.2,12,8.6,8,8.6,S',\n NP: 'HW p2,0,14,6,5.5,6,14,13.5,2,13.5,B p3,1.2,11.5,5.5,4,5.5,11.5,12.8,3,12.8,R c5.5,4,1,W s5.5,10,1.3,W',\n NR: 'HN r0,6.3,20,1.4,Y s5,10.5,1.8,W',\n NU: 'HY j0,0,10,7 c5,3.5,1,N s5,3.5,0.8,Y',\n NZ: `${BLUE_ENSIGN} s15,3,1.1,W s15,3,0.7,R s12.5,7,1.1,W s12.5,7,0.7,R s17.5,6,1,W s17.5,6,0.6,R s15,11,1.2,W s15,11,0.8,R`,\n OM: 'HWRG r0,0,5.5,14,R p1.5,2,4,2,2.75,3.5,W',\n PA: 'HW r10,0,10,7,R r0,7,10,7,B s5,3.5,1.6,B s15,10.5,1.6,R',\n PG: 'HK p0,0,20,0,20,14,R p12,3,17,2,16,4,13,6,Y s4,5,0.8,W s6.5,7,0.8,W s4,10,0.9,W s2,7,0.7,W',\n PH: 'HBR p0,0,10,7,0,14,W c3.2,7,1.4,Y s1.2,1.8,0.6,Y s1.2,12.2,0.6,Y s7.8,7,0.6,Y',\n PK: 'HG r0,0,5,14,W c12.5,7,3.4,W c13.5,6.3,3,G s14.8,5.5,1.2,W',\n PN: `${BLUE_ENSIGN} p13.5,4,16.5,4,16.5,8,15,9.5,13.5,8,G r13.5,4,3,1.5,S`,\n PR: 'HRWRWR p0,0,10,7,0,14,B s3.5,7,1.8,W',\n PS: 'HKWG p0,0,8,7,0,14,R',\n PY: 'HRWB c10,7,1.6,Y c10,7,1.1,W',\n QA: 'HA p0,0,5.5,0,7.5,0.78,5.5,1.56,7.5,2.33,5.5,3.11,7.5,3.89,5.5,4.67,7.5,5.44,5.5,6.22,7.5,7,5.5,7.78,7.5,8.56,5.5,9.33,7.5,10.11,5.5,10.89,7.5,11.67,5.5,12.44,7.5,13.22,5.5,14,0,14,W',\n SA: 'HG r4,4,12,1.2,W r5,6,10,0.8,W r5,9,10,0.7,W r14.5,8.5,1.2,1.2,W',\n SB: 'HG p0,0,20,0,0,14,B p0,13,18.6,0,20,0,20,1,1.4,14,0,14,Y s2.5,2,0.8,W s6.5,2,0.8,W s4.5,3.5,0.8,W s2.5,5,0.8,W s6.5,5,0.8,W',\n SC: 'HG p0,14,0,0,6.7,0,B p0,14,6.7,0,13.3,0,Y p0,14,13.3,0,20,0,20,4.7,R p0,14,20,4.7,20,9.3,W',\n SD: 'HRWK p0,0,7,7,0,14,G',\n SG: 'HRW c4.5,3.5,2.6,W c5.5,3.5,2.4,R s6.5,1.9,0.5,W s5.3,3,0.5,W s7.7,3,0.5,W s5.8,4.6,0.5,W s7.2,4.6,0.5,W',\n SH: `${BLUE_ENSIGN} ${SHIELD},S r13.5,3.5,3,1.8,Y`,\n SI: 'HWBR p3.5,2.5,6.5,2.5,6.5,6,5,7.2,3.5,6,B',\n SK: 'HWBR p3.5,3.5,8,3.5,8,9,5.75,10.5,3.5,9,R p5.4,5,6.1,5,6.1,9,5.4,9,W',\n SM: 'HWS c10,7,1.8,Y c10,7,1.2,G',\n SN: 'VGYR s10,7,1.8,G',\n SO: 'HS s10,7,3.2,W',\n SR: 'HG r0,2.8,20,8.4,W r0,4.2,20,5.6,R s10,7,2.4,Y',\n SS: `${TRIBAND_FIMBRIATED} p0,0,8,7,0,14,B s3,7,1.5,Y`,\n ST: 'HG r0,4,20,6,Y p0,0,6,7,0,14,R s10,7,1.3,K s14.5,7,1.3,K',\n SX: 'HRB p0,0,10,7,0,14,W c3.6,7,1.6,Y c3.6,7,1.1,S',\n SY: 'HRWK s7,7,1.3,G s13,7,1.3,G',\n SZ: 'HB r0,3,20,8,Y r0,4,20,6,R p4,7,10,4.4,16,7,10,9.6,W p10,4.4,16,7,10,9.6,K',\n TC: `${BLUE_ENSIGN} ${SHIELD},Y`,\n TD: 'VEYR',\n TG: 'HGYGYG r0,0,8.4,8.4,R s4.2,4.2,2.2,W',\n TJ: 'HRWG p8,7.5,12,7.5,11.5,5.8,10,6.6,8.5,5.8,Y',\n TK: 'HN p4,10,16,9,15,11,6,11.5,Y s4,3,0.8,W s7,5,0.8,W s5,7,0.8,W s3,5.5,0.6,W',\n TL: 'HR p0,0,10,7,0,14,Y p0,0,6.7,7,0,14,K s2.4,7,1.3,W',\n TM: 'HG r2.5,0,3,14,A r3.4,0,0.4,14,O r4.2,0,0.4,14,O c9.5,4,2.4,W c10.3,3.6,2.2,G s12,3,0.6,W s12.5,4.6,0.6,W',\n TN: 'HR c10,7,3.5,W c10.4,7,2.6,R c11.1,7,2.1,W s11.2,7,1.2,R',\n TO: 'HR r0,0,8,7,W r3.3,1,1.4,5,R r1.5,2.8,5,1.4,R',\n TR: 'HR c7.5,7,3.5,W c8.4,7,2.8,R s12.3,7,1.5,W',\n TT: 'HR p0,0,5,0,20,10.5,20,14,15,14,0,3.5,W p0,0.7,1,0,4,0,20,11.3,20,13.3,19,14,16,14,0,2.7,K',\n TV: 'HS j0,0,10,7 s13,9,0.7,Y s15,11,0.7,Y s17,8,0.7,Y s12,12,0.7,Y s16,4,0.7,Y s18,11.5,0.7,Y s14,6.5,0.7,Y s18.5,3,0.7,Y s11.5,9.5,0.7,Y',\n TW: 'HR r0,0,10,7,N s5,3.5,2.4,W c5,3.5,1.3,N c5,3.5,1,W',\n TZ: 'HB p0,0,20,0,0,14,G p0,11,15.7,0,20,0,20,3,4.3,14,0,14,Y p0,12.4,17.7,0,20,0,20,1.6,2.3,14,0,14,K',\n UM: USA,\n US: USA,\n UY: 'HWBWBWBWBW r0,0,7.78,7.78,W s3.9,3.9,2.6,Y c3.9,3.9,1.5,Y',\n VA: 'VYW p12,4,15,10,14.3,10.3,11.3,4.3,Y p15,4,12,10,12.7,10.3,15.7,4.3,I',\n VC: 'VBYYG p7,7,8.3,4.5,9.6,7,8.3,9.5,G p10.4,7,11.7,4.5,13,7,11.7,9.5,G p8.7,9.5,10,7,11.3,9.5,10,12,G',\n VG: `${BLUE_ENSIGN} ${SHIELD},G r14.6,4.5,0.8,3.5,W`,\n VI: 'HW p6,5,14,5,12,8,8,8,Y p9,4,11,4,11,10,9,10,Y r9.3,8.4,1.4,2,S',\n VN: 'HR s10,7,3.6,Y',\n VU: 'HRG r0,5.9,20,2.2,Y r0,6.4,20,1.2,K p0,0,10.4,7,0,14,Y p0,1.2,8.6,7,0,12.8,K c3.2,7,1.3,Y',\n WS: 'HR r0,0,10,7,N s5,1.6,0.8,W s3,3.5,0.8,W s7,3,0.8,W s5,5.6,0.9,W s6,4.2,0.5,W',\n ZA: 'HRB p0,0,1.6,0,9.4,4.6,20,4.6,20,9.4,9.4,9.4,1.6,14,0,14,W p0,0.9,8.6,5.6,20,5.6,20,8.4,8.6,8.4,0,13.1,0,11,6.6,7,0,3,G p0,3,6.6,7,0,11,Y p0,4,5,7,0,10,K',\n ZM: 'HG r13,7,2.33,7,R r15.33,7,2.33,7,K r17.67,7,2.33,7,O p14,4,17,3,19,4,16.5,5,O',\n ZW: 'HGYRKRYG p0,0,8.5,7,0,14,K p0,0.6,7.8,7,0,13.4,W s3,7,1.5,R p2.5,6.5,4,5.5,3.6,8,Y',\n};\n","import { FLAG_DRAWINGS_A_TO_L } from './flagDrawingsAtoL';\nimport { FLAG_DRAWINGS_M_TO_Z } from './flagDrawingsMtoZ';\n\nexport const FLAG_DRAWINGS: Readonly<Record<string, string | undefined>> = { ...FLAG_DRAWINGS_A_TO_L, ...FLAG_DRAWINGS_M_TO_Z };\n","const FRENCH = 'V BWR';\nconst NORWAY = 'N RWB';\n\nexport const FLAG_SPECS: Readonly<Record<string, string | undefined>> = {\n AE: 'H GWK', AF: 'V KRG', AM: 'H RBO', AR: 'H SWS', AT: 'H RWR', AX: 'N BYR', AZ: 'H SRG',\n BD: 'D DR', BE: 'V KYR', BG: 'H WGR', BL: FRENCH, BO: 'H RYG', BV: NORWAY, BY: 'H RRG',\n CH: 'P RW', CI: 'V OWG', CM: 'V GRY', CO: 'H YYBR', CR: 'H BWRRWB', DE: 'H KRY', DK: 'N RW',\n EE: 'H BKW', ES: 'H RYYR', ET: 'H GYR', FI: 'N WB', FO: 'N WRB',\n FR: FRENCH, GA: 'H GYB', GE: 'P WR', GF: FRENCH, GM: 'H RBG', GN: 'V RYG', GP: FRENCH,\n GT: 'V SWS', HU: 'H RWG', ID: 'H RW', IE: 'V GWO',\n IR: 'H GWR', IS: 'N BWR', IT: 'V GWR', JP: 'D WR', KG: 'D RY', LA: 'H RNR',\n LS: 'H BWG', LT: 'H YGR', LU: 'H RWS', LV: 'H MWM', MC: 'H RW', MF: FRENCH,\n ML: 'V GYR', MN: 'V RBR', MQ: FRENCH, MT: 'V WR', MU: 'H RBYG', MW: 'H KRG',\n NC: FRENCH, NG: 'V GWG', NL: 'H RWB', NO: NORWAY, PE: 'V RWR',\n PF: FRENCH, PL: 'H WR', PM: FRENCH, PT: 'V GGRRR', PW: 'D SY', RE: FRENCH,\n RO: 'V BYR', RS: 'H RBW', RU: 'H WBR', RW: 'H SSYG', SE: 'N BY', SJ: NORWAY,\n SL: 'H GWS', SV: 'H BWB', TF: FRENCH, TH: 'H RWNNWR',\n UA: 'H BY', UG: 'H KYRKYR', UZ: 'H SWG', VE: 'H YBR',\n WF: FRENCH, YE: 'H RWK', YT: FRENCH,\n};\n","import { FlagShapeKind } from '../FlagShapeKind';\n\nexport const FLAG_WIDTH = 20;\nexport const FLAG_HEIGHT = 14;\n\nexport interface FlagShape {\n readonly kind: FlagShapeKind;\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n readonly fill: string;\n readonly points?: string;\n}\n\nconst HALF = 2;\nconst STAR_TIPS = 5;\nconst STAR_INNER = 0.4;\nconst DEGREES_HALF_TURN = 180;\nconst STAR_START = -90;\nconst DECIMALS = 100;\nconst JACK_DIAGONAL = 0.12;\nconst JACK_RED_DIAGONAL = 0.05;\nconst JACK_WHITE_CROSS = 3;\nconst JACK_RED_CROSS = 5;\n\nexport function rect(x: number, y: number, size: readonly [number, number], fill: string): FlagShape {\n return { kind: FlagShapeKind.Rect, x, y, width: size[0], height: size[1], fill };\n}\n\nexport function field(fill: string): FlagShape {\n return rect(0, 0, [FLAG_WIDTH, FLAG_HEIGHT], fill);\n}\n\nexport function circle(cx: number, cy: number, radius: number, fill: string): FlagShape {\n return { kind: FlagShapeKind.Circle, x: cx, y: cy, width: radius * HALF, height: radius * HALF, fill };\n}\n\nexport function polygon(coords: readonly number[], fill: string): FlagShape {\n const pairs: string[] = [];\n for (let i = 0; i + 1 < coords.length; i += HALF) pairs.push(`${coords[i]},${coords[i + 1]}`);\n return { kind: FlagShapeKind.Polygon, x: 0, y: 0, width: 0, height: 0, fill, points: pairs.join(' ') };\n}\n\nexport function stripes(fills: readonly string[], vertical: boolean): FlagShape[] {\n const step = (vertical ? FLAG_WIDTH : FLAG_HEIGHT) / fills.length;\n return fills.map((fill, i) => (vertical ? rect(i * step, 0, [step, FLAG_HEIGHT], fill) : rect(0, i * step, [FLAG_WIDTH, step], fill)));\n}\n\nfunction round(value: number): number {\n return Math.round(value * DECIMALS) / DECIMALS;\n}\n\nexport function star(cx: number, cy: number, radius: number, fill: string): FlagShape {\n const coords: number[] = [];\n for (let i = 0; i < STAR_TIPS * HALF; i++) {\n const r = i % HALF === 0 ? radius : radius * STAR_INNER;\n const angle = ((STAR_START + (i * DEGREES_HALF_TURN) / STAR_TIPS) * Math.PI) / DEGREES_HALF_TURN;\n coords.push(round(cx + r * Math.cos(angle)), round(cy + r * Math.sin(angle)));\n }\n return polygon(coords, fill);\n}\n\nfunction diagonals(box: readonly [number, number, number, number], share: number, fill: string): FlagShape[] {\n const [x, y, w, h] = box;\n const dx = w * share;\n const dy = h * share;\n const right = x + w;\n const bottom = y + h;\n return [\n polygon([x, y, x + dx, y, right, bottom - dy, right, bottom, right - dx, bottom, x, y + dy], fill),\n polygon([right, y, right - dx, y, x, bottom - dy, x, bottom, x + dx, bottom, right, y + dy], fill),\n ];\n}\n\nfunction cross(box: readonly [number, number, number, number], bar: number, fill: string): FlagShape[] {\n const [x, y, w, h] = box;\n return [rect(x + (w - bar) / HALF, y, [bar, h], fill), rect(x, y + (h - bar) / HALF, [w, bar], fill)];\n}\n\n/** The Union Jack drawn inside a box (x, y, width, height). */\nexport function unionJack(box: readonly [number, number, number, number], colors: readonly [string, string, string]): FlagShape[] {\n const [navy, white, red] = colors;\n const [x, y, w, h] = box;\n return [\n rect(x, y, [w, h], navy),\n ...diagonals(box, JACK_DIAGONAL, white),\n ...diagonals(box, JACK_RED_DIAGONAL, red),\n ...cross(box, h / JACK_WHITE_CROSS, white),\n ...cross(box, h / JACK_RED_CROSS, red),\n ];\n}\n","import { FLAG_FALLBACK_FILL, FLAG_PALETTE } from '../data/flagPalette';\nimport { circle, polygon, rect, star, stripes, unionJack, type FlagShape } from './flagPrimitives';\n\nconst OP_HORIZONTAL = 'H';\nconst OP_VERTICAL = 'V';\nconst OP_RECT = 'r';\nconst OP_CIRCLE = 'c';\nconst OP_POLYGON = 'p';\nconst OP_STAR = 's';\nconst OP_JACK = 'j';\n\nfunction fillOf(letter: string | undefined): string {\n return FLAG_PALETTE[letter ?? ''] ?? FLAG_FALLBACK_FILL;\n}\n\nfunction numbers(values: readonly string[]): number[] {\n return values.map(Number);\n}\n\nfunction drawOp(op: string): FlagShape[] {\n const kind = op.charAt(0);\n const body = op.slice(1);\n if (kind === OP_HORIZONTAL || kind === OP_VERTICAL) return stripes(Array.from(body, fillOf), kind === OP_VERTICAL);\n const args = body.split(',');\n const [a = 0, b = 0, c = 0, d = 0] = numbers(args);\n if (kind === OP_JACK) return unionJack([a, b, c, d], [fillOf('N'), fillOf('W'), fillOf('R')]);\n const fill = fillOf(args[args.length - 1]);\n if (kind === OP_RECT) return [rect(a, b, [c, d], fill)];\n if (kind === OP_CIRCLE) return [circle(a, b, c, fill)];\n if (kind === OP_STAR) return [star(a, b, c, fill)];\n if (kind === OP_POLYGON) return [polygon(numbers(args.slice(0, -1)), fill)];\n return [];\n}\n\n/** The shapes of a drawing of space-separated ops: H/V stripes, r rect, c disc, s star, p polygon, j Union Jack. */\nexport function drawFlag(drawing: string): FlagShape[] {\n return drawing.split(' ').filter((op) => op !== '').flatMap(drawOp);\n}\n","import { FLAG_FALLBACK_FILL, FLAG_PALETTE } from '../data/flagPalette';\nimport { FLAG_DRAWINGS } from '../data/flagDrawings';\nimport { FLAG_SPECS } from '../data/flagSpecs';\nimport { FlagShapeKind } from '../FlagShapeKind';\nimport { drawFlag } from './flagDrawing';\nimport { FLAG_HEIGHT, FLAG_WIDTH, field, rect, stripes, type FlagShape } from './flagPrimitives';\n\nexport { FLAG_HEIGHT, FLAG_WIDTH } from './flagPrimitives';\nexport type { FlagShape } from './flagPrimitives';\n\nconst CROSS_X = 5.5;\nconst CROSS_Y = 5.5;\nconst CROSS_BAR = 3;\nconst INNER_INSET = 1;\nconst INNER_BAR = 1;\nconst PLUS_ARM_X = 8.5;\nconst PLUS_ARM_Y = 3;\nconst PLUS_SPAN_X = 5;\nconst PLUS_SPAN = 10;\nconst PLUS_ARM_LEN = 8;\nconst DISC_DIAMETER = 8;\nconst HALF = 2;\n\nfunction nordic([ground = FLAG_FALLBACK_FILL, cross = FLAG_FALLBACK_FILL, inner]: readonly string[]): FlagShape[] {\n const shapes = [field(ground), rect(CROSS_X, 0, [CROSS_BAR, FLAG_HEIGHT], cross), rect(0, CROSS_Y, [FLAG_WIDTH, CROSS_BAR], cross)];\n if (inner === undefined) return shapes;\n return [...shapes, rect(CROSS_X + INNER_INSET, 0, [INNER_BAR, FLAG_HEIGHT], inner), rect(0, CROSS_Y + INNER_INSET, [FLAG_WIDTH, INNER_BAR], inner)];\n}\n\nfunction centredCross([ground = FLAG_FALLBACK_FILL, cross = FLAG_FALLBACK_FILL]: readonly string[]): FlagShape[] {\n return [field(ground), rect(PLUS_ARM_X, PLUS_ARM_Y, [CROSS_BAR, PLUS_ARM_LEN], cross), rect(PLUS_SPAN_X, CROSS_Y, [PLUS_SPAN, CROSS_BAR], cross)];\n}\n\nfunction disc([ground = FLAG_FALLBACK_FILL, mark = FLAG_FALLBACK_FILL]: readonly string[]): FlagShape[] {\n const circle: FlagShape = { kind: FlagShapeKind.Circle, x: FLAG_WIDTH / HALF, y: FLAG_HEIGHT / HALF, width: DISC_DIAMETER, height: DISC_DIAMETER, fill: mark };\n return [field(ground), circle];\n}\n\n/** True when the country has no drawn flag and shows the generic one. */\nexport function isFallbackFlag(code: string): boolean {\n const upper = code.toUpperCase();\n return FLAG_SPECS[upper] === undefined && FLAG_DRAWINGS[upper] === undefined;\n}\n\n/** The shapes that draw the flag of a 2-letter code; a generic flag for a code with no drawn flag. */\nexport function flagShapes(code: string): FlagShape[] {\n const upper = code.toUpperCase();\n const drawing = FLAG_DRAWINGS[upper];\n if (drawing !== undefined) return drawFlag(drawing);\n const spec = FLAG_SPECS[upper];\n if (spec === undefined) return [field(FLAG_FALLBACK_FILL)];\n const [layout = '', letters = ''] = spec.split(' ');\n const fills = Array.from(letters, (letter) => FLAG_PALETTE[letter] ?? FLAG_FALLBACK_FILL);\n if (layout === 'V') return stripes(fills, true);\n if (layout === 'N') return nordic(fills);\n if (layout === 'P') return centredCross(fills);\n if (layout === 'D') return disc(fills);\n return stripes(fills, false);\n}\n","import React from 'react';\n\nimport Svg, { Circle, Polygon, Rect } from 'react-native-svg';\n\nimport { FLAG_EDGE } from './data/flagPalette';\nimport { FlagShapeKind } from './FlagShapeKind';\nimport { FLAG_HEIGHT, FLAG_WIDTH, flagShapes, type FlagShape } from './utils/flagShapes';\n\nconst EDGE_WIDTH = 0.5;\nconst EDGE_INSET = 0.25;\nconst HALF = 2;\nconst VIEW_BOX = `0 0 ${FLAG_WIDTH} ${FLAG_HEIGHT}`;\n\nfunction drawShape(shape: FlagShape, key: number): React.ReactElement {\n if (shape.kind === FlagShapeKind.Circle) return <Circle key={key} cx={shape.x} cy={shape.y} fill={shape.fill} r={shape.width / HALF} />;\n if (shape.kind === FlagShapeKind.Polygon) return <Polygon key={key} fill={shape.fill} points={shape.points} />;\n return <Rect key={key} fill={shape.fill} height={shape.height} width={shape.width} x={shape.x} y={shape.y} />;\n}\n\nexport interface CountryFlagProps {\n code: string;\n testID?: string;\n}\n\n/** A 20x14 drawn flag for a 2-letter country code; decorative, the country name carries the meaning. */\nexport function CountryFlag({ code, testID }: CountryFlagProps): React.ReactElement {\n return (\n <Svg accessibilityElementsHidden aria-hidden height={FLAG_HEIGHT} importantForAccessibility=\"no-hide-descendants\" testID={testID} viewBox={VIEW_BOX} width={FLAG_WIDTH}>\n {flagShapes(code).map((shape, index) => drawShape(shape, index))}\n <Rect fill=\"none\" height={FLAG_HEIGHT - EDGE_WIDTH} stroke={FLAG_EDGE} strokeWidth={EDGE_WIDTH} width={FLAG_WIDTH - EDGE_WIDTH} x={EDGE_INSET} y={EDGE_INSET} />\n </Svg>\n );\n}\n","import type { Country } from './country';\n\n/** ISO 3166-1 alpha-2 countries (249) with English short names. */\nexport const COUNTRIES: readonly Country[] = [\n { code: 'AF', name: 'Afghanistan' },\n { code: 'AX', name: 'Åland Islands' },\n { code: 'AL', name: 'Albania' },\n { code: 'DZ', name: 'Algeria' },\n { code: 'AS', name: 'American Samoa' },\n { code: 'AD', name: 'Andorra' },\n { code: 'AO', name: 'Angola' },\n { code: 'AI', name: 'Anguilla' },\n { code: 'AQ', name: 'Antarctica' },\n { code: 'AG', name: 'Antigua and Barbuda' },\n { code: 'AR', name: 'Argentina' },\n { code: 'AM', name: 'Armenia' },\n { code: 'AW', name: 'Aruba' },\n { code: 'AU', name: 'Australia' },\n { code: 'AT', name: 'Austria' },\n { code: 'AZ', name: 'Azerbaijan' },\n { code: 'BS', name: 'Bahamas' },\n { code: 'BH', name: 'Bahrain' },\n { code: 'BD', name: 'Bangladesh' },\n { code: 'BB', name: 'Barbados' },\n { code: 'BY', name: 'Belarus' },\n { code: 'BE', name: 'Belgium' },\n { code: 'BZ', name: 'Belize' },\n { code: 'BJ', name: 'Benin' },\n { code: 'BM', name: 'Bermuda' },\n { code: 'BT', name: 'Bhutan' },\n { code: 'BO', name: 'Bolivia' },\n { code: 'BQ', name: 'Bonaire, Sint Eustatius and Saba' },\n { code: 'BA', name: 'Bosnia and Herzegovina' },\n { code: 'BW', name: 'Botswana' },\n { code: 'BV', name: 'Bouvet Island' },\n { code: 'BR', name: 'Brazil' },\n { code: 'IO', name: 'British Indian Ocean Territory' },\n { code: 'BN', name: 'Brunei Darussalam' },\n { code: 'BG', name: 'Bulgaria' },\n { code: 'BF', name: 'Burkina Faso' },\n { code: 'BI', name: 'Burundi' },\n { code: 'CV', name: 'Cabo Verde' },\n { code: 'KH', name: 'Cambodia' },\n { code: 'CM', name: 'Cameroon' },\n { code: 'CA', name: 'Canada' },\n { code: 'KY', name: 'Cayman Islands' },\n { code: 'CF', name: 'Central African Republic' },\n { code: 'TD', name: 'Chad' },\n { code: 'CL', name: 'Chile' },\n { code: 'CN', name: 'China' },\n { code: 'CX', name: 'Christmas Island' },\n { code: 'CC', name: 'Cocos (Keeling) Islands' },\n { code: 'CO', name: 'Colombia' },\n { code: 'KM', name: 'Comoros' },\n { code: 'CG', name: 'Congo' },\n { code: 'CD', name: 'Congo (Democratic Republic)' },\n { code: 'CK', name: 'Cook Islands' },\n { code: 'CR', name: 'Costa Rica' },\n { code: 'CI', name: 'Côte d\\'Ivoire' },\n { code: 'HR', name: 'Croatia' },\n { code: 'CU', name: 'Cuba' },\n { code: 'CW', name: 'Curaçao' },\n { code: 'CY', name: 'Cyprus' },\n { code: 'CZ', name: 'Czechia' },\n { code: 'DK', name: 'Denmark' },\n { code: 'DJ', name: 'Djibouti' },\n { code: 'DM', name: 'Dominica' },\n { code: 'DO', name: 'Dominican Republic' },\n { code: 'EC', name: 'Ecuador' },\n { code: 'EG', name: 'Egypt' },\n { code: 'SV', name: 'El Salvador' },\n { code: 'GQ', name: 'Equatorial Guinea' },\n { code: 'ER', name: 'Eritrea' },\n { code: 'EE', name: 'Estonia' },\n { code: 'SZ', name: 'Eswatini' },\n { code: 'ET', name: 'Ethiopia' },\n { code: 'FK', name: 'Falkland Islands' },\n { code: 'FO', name: 'Faroe Islands' },\n { code: 'FJ', name: 'Fiji' },\n { code: 'FI', name: 'Finland' },\n { code: 'FR', name: 'France' },\n { code: 'GF', name: 'French Guiana' },\n { code: 'PF', name: 'French Polynesia' },\n { code: 'TF', name: 'French Southern Territories' },\n { code: 'GA', name: 'Gabon' },\n { code: 'GM', name: 'Gambia' },\n { code: 'GE', name: 'Georgia' },\n { code: 'DE', name: 'Germany' },\n { code: 'GH', name: 'Ghana' },\n { code: 'GI', name: 'Gibraltar' },\n { code: 'GR', name: 'Greece' },\n { code: 'GL', name: 'Greenland' },\n { code: 'GD', name: 'Grenada' },\n { code: 'GP', name: 'Guadeloupe' },\n { code: 'GU', name: 'Guam' },\n { code: 'GT', name: 'Guatemala' },\n { code: 'GG', name: 'Guernsey' },\n { code: 'GN', name: 'Guinea' },\n { code: 'GW', name: 'Guinea-Bissau' },\n { code: 'GY', name: 'Guyana' },\n { code: 'HT', name: 'Haiti' },\n { code: 'HM', name: 'Heard Island and McDonald Islands' },\n { code: 'VA', name: 'Holy See' },\n { code: 'HN', name: 'Honduras' },\n { code: 'HK', name: 'Hong Kong' },\n { code: 'HU', name: 'Hungary' },\n { code: 'IS', name: 'Iceland' },\n { code: 'IN', name: 'India' },\n { code: 'ID', name: 'Indonesia' },\n { code: 'IR', name: 'Iran' },\n { code: 'IQ', name: 'Iraq' },\n { code: 'IE', name: 'Ireland' },\n { code: 'IM', name: 'Isle of Man' },\n { code: 'IL', name: 'Israel' },\n { code: 'IT', name: 'Italy' },\n { code: 'JM', name: 'Jamaica' },\n { code: 'JP', name: 'Japan' },\n { code: 'JE', name: 'Jersey' },\n { code: 'JO', name: 'Jordan' },\n { code: 'KZ', name: 'Kazakhstan' },\n { code: 'KE', name: 'Kenya' },\n { code: 'KI', name: 'Kiribati' },\n { code: 'KP', name: 'Korea (North)' },\n { code: 'KR', name: 'Korea (South)' },\n { code: 'KW', name: 'Kuwait' },\n { code: 'KG', name: 'Kyrgyzstan' },\n { code: 'LA', name: 'Laos' },\n { code: 'LV', name: 'Latvia' },\n { code: 'LB', name: 'Lebanon' },\n { code: 'LS', name: 'Lesotho' },\n { code: 'LR', name: 'Liberia' },\n { code: 'LY', name: 'Libya' },\n { code: 'LI', name: 'Liechtenstein' },\n { code: 'LT', name: 'Lithuania' },\n { code: 'LU', name: 'Luxembourg' },\n { code: 'MO', name: 'Macao' },\n { code: 'MG', name: 'Madagascar' },\n { code: 'MW', name: 'Malawi' },\n { code: 'MY', name: 'Malaysia' },\n { code: 'MV', name: 'Maldives' },\n { code: 'ML', name: 'Mali' },\n { code: 'MT', name: 'Malta' },\n { code: 'MH', name: 'Marshall Islands' },\n { code: 'MQ', name: 'Martinique' },\n { code: 'MR', name: 'Mauritania' },\n { code: 'MU', name: 'Mauritius' },\n { code: 'YT', name: 'Mayotte' },\n { code: 'MX', name: 'Mexico' },\n { code: 'FM', name: 'Micronesia' },\n { code: 'MD', name: 'Moldova' },\n { code: 'MC', name: 'Monaco' },\n { code: 'MN', name: 'Mongolia' },\n { code: 'ME', name: 'Montenegro' },\n { code: 'MS', name: 'Montserrat' },\n { code: 'MA', name: 'Morocco' },\n { code: 'MZ', name: 'Mozambique' },\n { code: 'MM', name: 'Myanmar' },\n { code: 'NA', name: 'Namibia' },\n { code: 'NR', name: 'Nauru' },\n { code: 'NP', name: 'Nepal' },\n { code: 'NL', name: 'Netherlands' },\n { code: 'NC', name: 'New Caledonia' },\n { code: 'NZ', name: 'New Zealand' },\n { code: 'NI', name: 'Nicaragua' },\n { code: 'NE', name: 'Niger' },\n { code: 'NG', name: 'Nigeria' },\n { code: 'NU', name: 'Niue' },\n { code: 'NF', name: 'Norfolk Island' },\n { code: 'MK', name: 'North Macedonia' },\n { code: 'MP', name: 'Northern Mariana Islands' },\n { code: 'NO', name: 'Norway' },\n { code: 'OM', name: 'Oman' },\n { code: 'PK', name: 'Pakistan' },\n { code: 'PW', name: 'Palau' },\n { code: 'PS', name: 'Palestine' },\n { code: 'PA', name: 'Panama' },\n { code: 'PG', name: 'Papua New Guinea' },\n { code: 'PY', name: 'Paraguay' },\n { code: 'PE', name: 'Peru' },\n { code: 'PH', name: 'Philippines' },\n { code: 'PN', name: 'Pitcairn' },\n { code: 'PL', name: 'Poland' },\n { code: 'PT', name: 'Portugal' },\n { code: 'PR', name: 'Puerto Rico' },\n { code: 'QA', name: 'Qatar' },\n { code: 'RE', name: 'Réunion' },\n { code: 'RO', name: 'Romania' },\n { code: 'RU', name: 'Russian Federation' },\n { code: 'RW', name: 'Rwanda' },\n { code: 'BL', name: 'Saint Barthélemy' },\n { code: 'SH', name: 'Saint Helena, Ascension and Tristan da Cunha' },\n { code: 'KN', name: 'Saint Kitts and Nevis' },\n { code: 'LC', name: 'Saint Lucia' },\n { code: 'MF', name: 'Saint Martin (French part)' },\n { code: 'PM', name: 'Saint Pierre and Miquelon' },\n { code: 'VC', name: 'Saint Vincent and the Grenadines' },\n { code: 'WS', name: 'Samoa' },\n { code: 'SM', name: 'San Marino' },\n { code: 'ST', name: 'Sao Tome and Principe' },\n { code: 'SA', name: 'Saudi Arabia' },\n { code: 'SN', name: 'Senegal' },\n { code: 'RS', name: 'Serbia' },\n { code: 'SC', name: 'Seychelles' },\n { code: 'SL', name: 'Sierra Leone' },\n { code: 'SG', name: 'Singapore' },\n { code: 'SX', name: 'Sint Maarten (Dutch part)' },\n { code: 'SK', name: 'Slovakia' },\n { code: 'SI', name: 'Slovenia' },\n { code: 'SB', name: 'Solomon Islands' },\n { code: 'SO', name: 'Somalia' },\n { code: 'ZA', name: 'South Africa' },\n { code: 'GS', name: 'South Georgia and the South Sandwich Islands' },\n { code: 'SS', name: 'South Sudan' },\n { code: 'ES', name: 'Spain' },\n { code: 'LK', name: 'Sri Lanka' },\n { code: 'SD', name: 'Sudan' },\n { code: 'SR', name: 'Suriname' },\n { code: 'SJ', name: 'Svalbard and Jan Mayen' },\n { code: 'SE', name: 'Sweden' },\n { code: 'CH', name: 'Switzerland' },\n { code: 'SY', name: 'Syrian Arab Republic' },\n { code: 'TW', name: 'Taiwan' },\n { code: 'TJ', name: 'Tajikistan' },\n { code: 'TZ', name: 'Tanzania' },\n { code: 'TH', name: 'Thailand' },\n { code: 'TL', name: 'Timor-Leste' },\n { code: 'TG', name: 'Togo' },\n { code: 'TK', name: 'Tokelau' },\n { code: 'TO', name: 'Tonga' },\n { code: 'TT', name: 'Trinidad and Tobago' },\n { code: 'TN', name: 'Tunisia' },\n { code: 'TR', name: 'Türkiye' },\n { code: 'TM', name: 'Turkmenistan' },\n { code: 'TC', name: 'Turks and Caicos Islands' },\n { code: 'TV', name: 'Tuvalu' },\n { code: 'UG', name: 'Uganda' },\n { code: 'UA', name: 'Ukraine' },\n { code: 'AE', name: 'United Arab Emirates' },\n { code: 'GB', name: 'United Kingdom' },\n { code: 'US', name: 'United States' },\n { code: 'UM', name: 'United States Minor Outlying Islands' },\n { code: 'UY', name: 'Uruguay' },\n { code: 'UZ', name: 'Uzbekistan' },\n { code: 'VU', name: 'Vanuatu' },\n { code: 'VE', name: 'Venezuela' },\n { code: 'VN', name: 'Viet Nam' },\n { code: 'VG', name: 'Virgin Islands (British)' },\n { code: 'VI', name: 'Virgin Islands (U.S.)' },\n { code: 'WF', name: 'Wallis and Futuna' },\n { code: 'EH', name: 'Western Sahara' },\n { code: 'YE', name: 'Yemen' },\n { code: 'ZM', name: 'Zambia' },\n { code: 'ZW', name: 'Zimbabwe' },\n];\n","import type { ControlOption } from '../controls/controlTypes';\nimport { COUNTRIES } from './countriesData';\nimport type { Country } from './country';\n\nconst REGIONAL_INDICATOR_A = 0x1f1e6;\nconst CODE_A = 65;\nconst TWO_LETTERS = /^[A-Z]{2}$/;\nconst KNOWN_CODES = new Set(COUNTRIES.map((country) => country.code));\n\n/** Countries as select options: name as the label, the 2-letter code as value and detail. */\nexport function countryOptions(list: readonly Country[] = COUNTRIES): ControlOption[] {\n return list.map((country) => ({ label: country.name, value: country.code, detail: country.code }));\n}\n\nconst DEFAULT_OPTIONS = countryOptions();\nconst NO_COUNTRY = '';\n\n/** The country options, led by a \"no country\" choice (value '') when `noneLabel` is given. */\nexport function countryFieldOptions(countries?: readonly Country[], noneLabel?: string): readonly ControlOption[] {\n const list = countries === undefined ? DEFAULT_OPTIONS : countryOptions(countries);\n return noneLabel === undefined ? list : [{ label: noneLabel, value: NO_COUNTRY }, ...list];\n}\n\n/** The flag emoji for a 2-letter code, or '' for anything else. */\nexport function countryFlag(code: string): string {\n const upper = code.toUpperCase();\n if (!TWO_LETTERS.test(upper)) return '';\n return String.fromCodePoint(...Array.from(upper, (letter) => REGIONAL_INDICATOR_A + letter.charCodeAt(0) - CODE_A));\n}\n\n/** The stored value for an input: a known 2-letter code in upper case, else ''. */\nexport function toCountryValue(input: string): string {\n const upper = input.trim().toUpperCase();\n return KNOWN_CODES.has(upper) ? upper : '';\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { Country } from '../countries/country';\nimport { countryFieldOptions, toCountryValue } from '../countries/countryOptions';\nimport { CountryFlag } from '../CountryFlag/CountryFlag';\nimport { SearchSelect } from '../SearchSelect/SearchSelect';\nimport type { SearchSelectLabels } from '../SearchSelect/types';\n\nconst CODE_FONT = 12;\n\nexport interface CountryFieldProps {\n value: string;\n onChange: (code: string) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n labels: SearchSelectLabels;\n testID: string;\n countries?: readonly Country[];\n noneLabel?: string;\n onBlur?: () => void;\n}\n\nconst NO_COUNTRY = '';\n\nconst renderFlag = (option: ControlOption): React.ReactNode => (option.value === NO_COUNTRY ? null : <CountryFlag code={option.value} />);\n\n\n/** A searchable country field: flag, name and grey code; stores the ISO 3166-1 alpha-2 code, or '' for `noneLabel`; `onBlur` fires when focus leaves the closed field. */\nexport function CountryField({ value, onChange, accessibilityLabel, accessibilityHint, labels, testID, countries, noneLabel, onBlur }: CountryFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { textSecondary } = theme.colors;\n const options = useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);\n const renderCode = useCallback((option: ControlOption): React.ReactNode => <Text style={[styles.code, { color: textSecondary }]}>{option.detail}</Text>, [textSecondary]);\n return (\n <SearchSelect\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n labels={labels}\n options={options}\n recentKey=\"country\"\n renderDetail={renderCode}\n renderLeading={renderFlag}\n testID={testID}\n value={toCountryValue(value)}\n onBlur={onBlur}\n onChange={onChange}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n code: { fontSize: CODE_FONT },\n});\n","import { useCallback, useState } from 'react';\n\n/** A verdict that appears only when the field is left and clears on the next edit. */\nexport interface BlurVerdict<T> {\n verdict: T | null;\n onEdit: () => void;\n onLeave: () => T;\n}\n\n/** Runs `validate` on leave only, so an error never shows while typing. */\nexport function useBlurVerdict<T>(validate: () => T): BlurVerdict<T> {\n const [verdict, setVerdict] = useState<T | null>(null);\n const onEdit = useCallback(() => setVerdict(null), []);\n const onLeave = useCallback(() => {\n const next = validate();\n setVerdict(next);\n return next;\n }, [validate]);\n return { verdict, onEdit, onLeave };\n}\n","const IBAN_LENGTHS: Readonly<Record<string, number | undefined>> = {\n AD: 24, AE: 23, AL: 28, AT: 20, AZ: 28, BA: 20, BE: 16, BG: 22, BH: 22, BI: 27,\n BR: 29, BY: 28, CH: 21, CR: 22, CY: 28, CZ: 24, DE: 22, DJ: 27, DK: 18, DO: 28,\n EE: 20, EG: 29, ES: 24, FI: 18, FK: 18, FO: 18, FR: 27, GB: 22, GE: 22, GI: 23,\n GL: 18, GR: 27, GT: 28, HN: 28, HR: 21, HU: 28, IE: 22, IL: 23, IQ: 23, IS: 26,\n IT: 27, JO: 30, KW: 30, KZ: 20, LB: 28, LC: 32, LI: 21, LT: 20, LU: 20, LV: 21,\n LY: 25, MC: 27, MD: 24, ME: 22, MK: 19, MN: 20, MR: 27, MT: 31, MU: 30, NI: 28,\n NL: 18, NO: 15, OM: 23, PK: 24, PL: 28, PS: 29, PT: 25, QA: 29, RO: 24, RS: 22,\n RU: 33, SA: 24, SC: 31, SD: 18, SE: 24, SI: 19, SK: 24, SM: 27, SO: 23, ST: 25,\n SV: 28, TL: 23, TN: 24, TR: 26, UA: 29, VA: 22, VG: 24, XK: 20, YE: 30,\n};\n\n/** The longest IBAN ISO 13616 permits. */\nexport const IBAN_MAX_LENGTH = 34;\n\n/** How many countries the registry table covers. */\nexport const IBAN_REGISTERED_COUNTRY_COUNT = Object.keys(IBAN_LENGTHS).length;\n\n/** The registered IBAN length for an upper-case country code, or `null` when it is not registered. */\nexport function ibanLengthFor(country: string): number | null {\n return IBAN_LENGTHS[country] ?? null;\n}\n","import { IBAN_MAX_LENGTH, ibanLengthFor } from '../data/ibanCountryLengths';\n\nconst NOT_ALPHANUMERIC = /[^A-Za-z0-9]/g;\nconst COUNTRY_PREFIX = /^[A-Z]{2}/;\nconst COUNTRY_LENGTH = 2;\nconst BIC8_LENGTH = 8;\nconst BIC11_LENGTH = 11;\nconst BRANCH_LENGTH = 3;\nconst DEFAULT_GHOST = '0';\nconst DEFAULT_BIC_GHOST = 'X';\n\n/** What an IBAN field shows while typing: stored form, grouped display, counter and ghost tail. */\nexport interface IbanDraft {\n readonly electronic: string;\n readonly display: string;\n readonly country: string;\n readonly typed: number;\n readonly expected: number | null;\n readonly ghost: string;\n}\n\n/** What a BIC field shows while typing: stored form, the required ghost and the optional branch ghost. */\nexport interface BicDraft {\n readonly value: string;\n readonly ghost: string;\n readonly branchGhost: string;\n}\n\n/** Groups a string in blocks of four separated by single spaces. */\nexport function groupInFours(text: string): string {\n return text.replace(/(.{4})(?=.)/g, '$1 ');\n}\n\nfunction cleaned(raw: string): string {\n return raw.replace(NOT_ALPHANUMERIC, '').toUpperCase();\n}\n\n/** Upper-cases, strips separators, caps at the country length and groups an IBAN as typed. */\nexport function draftIban(raw: string, ghostChar: string = DEFAULT_GHOST): IbanDraft {\n const text = cleaned(raw);\n const country = COUNTRY_PREFIX.test(text) ? text.slice(0, COUNTRY_LENGTH) : '';\n const expected = country === '' ? null : ibanLengthFor(country);\n const electronic = text.slice(0, expected ?? IBAN_MAX_LENGTH);\n const display = groupInFours(electronic);\n const mask = expected === null ? '' : groupInFours(ghostChar.repeat(expected));\n return { electronic, display, country, typed: electronic.length, expected, ghost: mask.slice(display.length) };\n}\n\n/** The \"typed / expected\" counter, or `null` before the country is known. */\nexport function ibanCounter(draft: IbanDraft): string | null {\n return draft.expected === null ? null : `${draft.typed} / ${draft.expected}`;\n}\n\n/** Upper-cases and caps a BIC at 11, with ghosts for the required part and the optional branch. */\nexport function draftBic(raw: string, ghostChar: string = DEFAULT_BIC_GHOST): BicDraft {\n const value = cleaned(raw).slice(0, BIC11_LENGTH);\n const ghost = ghostChar.repeat(Math.max(0, BIC8_LENGTH - value.length));\n const branchLeft = value.length <= BIC8_LENGTH ? BRANCH_LENGTH : BIC11_LENGTH - value.length;\n return { value, ghost, branchGhost: ghostChar.repeat(branchLeft) };\n}\n","import { draftIban } from './ibanFormat';\n\nconst GROUP = 4;\nconst ALPHANUMERIC = /[A-Za-z0-9]/;\n\n/** Where the caret lands in the regrouped IBAN, given the caret position in the raw edited text. */\nexport function caretAfterEdit(raw: string, rawCaret: number): number {\n const kept = Array.from(raw.slice(0, rawCaret)).filter((char) => ALPHANUMERIC.test(char)).length;\n const characters = Math.min(kept, draftIban(raw).electronic.length);\n return characters === 0 ? 0 : characters + Math.floor((characters - 1) / GROUP);\n}\n\n/** The caret in the raw edited text, taking the edit to have happened at the previous caret. */\nexport function rawCaretAfterChange(previous: string, previousCaret: number, next: string): number {\n return Math.max(0, Math.min(next.length, previousCaret + next.length - previous.length));\n}\n","import { useCallback, useState } from 'react';\n\nimport type { NativeSyntheticEvent, TextInputSelectionChangeEventData } from 'react-native';\n\nimport { caretAfterEdit, rawCaretAfterChange } from '../utils/ibanCaret';\n\nexport interface IbanSelection {\n start: number;\n end: number;\n}\n\nexport interface IbanCaret {\n selection: IbanSelection;\n onSelectionChange: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;\n placeAfterEdit: (text: string) => void;\n}\n\n/** A controlled caret for the grouped IBAN text that survives the spaces added and removed while typing. */\nexport function useIbanCaret(display: string): IbanCaret {\n const [selection, setSelection] = useState<IbanSelection>({ start: display.length, end: display.length });\n\n const onSelectionChange = useCallback((event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n setSelection(event.nativeEvent.selection);\n }, []);\n\n const placeAfterEdit = useCallback((text: string) => {\n const caret = caretAfterEdit(text, rawCaretAfterChange(display, selection.end, text));\n setSelection({ start: caret, end: caret });\n }, [display, selection.end]);\n\n const clamped = { start: Math.min(selection.start, display.length), end: Math.min(selection.end, display.length) };\n return { selection: clamped, onSelectionChange, placeAfterEdit };\n}\n","import { StyleSheet } from 'react-native';\n\nconst FONT_SIZE = 14;\nconst LINE_HEIGHT = 20;\nconst COUNTER_FONT = 12;\nconst BRANCH_OPACITY = 0.5;\nconst GAP = 8;\nconst INPUT_PAD_V = 13;\n\nexport const ghostStyles = StyleSheet.create({\n field: { flex: 1, justifyContent: 'center', minHeight: LINE_HEIGHT },\n mono: { fontFamily: 'monospace', fontSize: FONT_SIZE, lineHeight: LINE_HEIGHT },\n layer: { position: 'absolute', left: 0, top: INPUT_PAD_V, bottom: INPUT_PAD_V },\n hidden: { opacity: 0 },\n branch: { opacity: BRANCH_OPACITY },\n input: { padding: 0, paddingVertical: INPUT_PAD_V, borderWidth: 0, minHeight: LINE_HEIGHT },\n trigger: { paddingVertical: 0 },\n counter: { fontSize: COUNTER_FONT, marginLeft: GAP },\n});\n","/** Why an IBAN was refused; member names match `Finreg.Core.Banking.IbanRejection`. */\nexport enum IbanRejection {\n None = 'None',\n Missing = 'Missing',\n IllegalCharacter = 'IllegalCharacter',\n MalformedCountryCode = 'MalformedCountryCode',\n MalformedCheckDigits = 'MalformedCheckDigits',\n UnknownCountry = 'UnknownCountry',\n WrongLengthForCountry = 'WrongLengthForCountry',\n ChecksumFailed = 'ChecksumFailed',\n}\n","import { IbanRejection } from '../data/IbanRejection';\nimport { ibanLengthFor } from '../data/ibanCountryLengths';\n\nconst COUNTRY_LENGTH = 2;\nconst PREFIX_LENGTH = 4;\nconst MODULUS = 97;\nconst VALID_REMAINDER = 1;\nconst LETTER_OFFSET = 10;\nconst DIGIT_SHIFT = 10;\nconst LETTER_SHIFT = 100;\nconst CODE_A = 65;\nconst CODE_0 = 48;\nconst LETTER = /^[A-Za-z]$/;\nconst DIGIT = /^[0-9]$/;\n\n/** The outcome of validating one IBAN; `electronic` (upper case, no spaces) is set only when valid. */\nexport interface IbanVerdict {\n readonly rejection: IbanRejection;\n readonly electronic: string | null;\n readonly expectedLength: number | null;\n}\n\nfunction refused(rejection: IbanRejection, expectedLength: number | null = null): IbanVerdict {\n return { rejection, electronic: null, expectedLength };\n}\n\nfunction stripSeparators(raw: string): string | null {\n let out = '';\n for (const character of raw) {\n if (character === ' ') continue;\n if (!LETTER.test(character) && !DIGIT.test(character)) return null;\n out += character.toUpperCase();\n }\n return out === '' ? null : out;\n}\n\nfunction shapeFailure(iban: string): IbanVerdict | null {\n if (iban.length <= PREFIX_LENGTH) return refused(IbanRejection.MalformedCountryCode);\n if (!LETTER.test(iban.charAt(0)) || !LETTER.test(iban.charAt(1))) return refused(IbanRejection.MalformedCountryCode);\n if (!DIGIT.test(iban.charAt(2)) || !DIGIT.test(iban.charAt(3))) return refused(IbanRejection.MalformedCheckDigits);\n const expected = ibanLengthFor(iban.slice(0, COUNTRY_LENGTH));\n if (expected === null) return refused(IbanRejection.UnknownCountry);\n return iban.length === expected ? null : refused(IbanRejection.WrongLengthForCountry, expected);\n}\n\nfunction mod97(iban: string): number {\n let remainder = 0;\n for (let index = 0; index < iban.length; index++) {\n const character = iban.charAt((index + PREFIX_LENGTH) % iban.length);\n const code = character.charCodeAt(0);\n remainder = DIGIT.test(character)\n ? remainder * DIGIT_SHIFT + (code - CODE_0)\n : remainder * LETTER_SHIFT + (code - CODE_A + LETTER_OFFSET);\n remainder %= MODULUS;\n }\n return remainder;\n}\n\n/** Validates an IBAN with the same rules as `Finreg.Core.Banking.Iban.Validate`. */\nexport function validateIban(raw: string | null | undefined): IbanVerdict {\n if (raw === null || raw === undefined || raw.trim() === '') return refused(IbanRejection.Missing);\n const normalised = stripSeparators(raw);\n if (normalised === null) return refused(IbanRejection.IllegalCharacter);\n const failure = shapeFailure(normalised);\n if (failure !== null) return failure;\n if (mod97(normalised) !== VALID_REMAINDER) return refused(IbanRejection.ChecksumFailed);\n return { rejection: IbanRejection.None, electronic: normalised, expectedLength: null };\n}\n","import React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../../fieldErrorInk/fieldErrorInk';\n\nconst LINE_GAP = 4;\n\nexport interface RejectionLineProps {\n message: string | null;\n testID: string;\n}\n\n/** The localized refusal under a bank field, announced politely, or nothing when there is none. */\nexport function RejectionLine({ message, testID }: RejectionLineProps): React.ReactElement | null {\n const { theme } = useUi();\n if (message === null) return null;\n return <Text accessibilityLiveRegion=\"polite\" style={[styles.line, { color: fieldErrorInk(theme) }]} testID={`${testID}-rejection`}>{message}</Text>;\n}\n\nconst styles = StyleSheet.create({\n line: { marginTop: LINE_GAP },\n});\n","/** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */\nexport function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null {\n if (labels === undefined || rejection === null || rejection === none) return null;\n return labels[rejection as Exclude<R, N>];\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { useBlurVerdict } from './hooks/useBlurVerdict';\nimport { useIbanCaret } from './hooks/useIbanCaret';\nimport { ghostStyles as g } from './utils/ghostStyles';\nimport { validateIban, type IbanVerdict } from './utils/iban';\nimport { RejectionLine } from './components/RejectionLine';\nimport { IbanRejection } from './data/IbanRejection';\nimport type { IbanRejectionLabels } from './types';\nimport { rejectionMessage } from './utils/rejectionMessage';\nimport { draftIban, ibanCounter } from './utils/ibanFormat';\n\nexport interface IbanInputProps {\n value: string;\n onChange: (electronic: string) => void;\n onVerdict?: (verdict: IbanVerdict | null) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n onBlur?: () => void;\n rejectionLabels?: IbanRejectionLabels;\n placeholder?: string;\n}\n\n/** An IBAN box that groups in fours as you type, stores no spaces and validates on leave. */\nexport function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }: IbanInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const draft = useMemo(() => draftIban(value), [value]);\n const validate = useCallback(() => validateIban(value), [value]);\n const { verdict, onEdit, onLeave } = useBlurVerdict(validate);\n const message = value === '' ? null : rejectionMessage(verdict?.rejection ?? null, IbanRejection.None, rejectionLabels);\n const counter = ibanCounter(draft);\n const { selection, onSelectionChange, placeAfterEdit } = useIbanCaret(draft.display);\n\n const onChangeText = useCallback((text: string) => {\n onEdit();\n onVerdict?.(null);\n placeAfterEdit(text);\n onChange(draftIban(text).electronic);\n }, [onEdit, onVerdict, placeAfterEdit, onChange]);\n\n const onBlur = useCallback(() => {\n const verdict = onLeave();\n onVerdict?.(value === '' ? null : verdict);\n onLeft?.();\n }, [onLeave, onVerdict, value, onLeft]);\n\n return (\n <View>\n <View style={[s.selectTrigger, g.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}>\n <View style={g.field}>\n <Text aria-hidden style={[g.mono, g.layer]}>\n <Text style={g.hidden}>{draft.display}</Text>\n <Text style={{ color: colors.textSecondary }}>{draft.ghost}</Text>\n </Text>\n <TextInput\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n autoCapitalize=\"characters\"\n autoComplete=\"off\"\n autoCorrect={false}\n placeholder={draft.display === '' ? placeholder : undefined}\n placeholderTextColor={colors.textSecondary}\n selection={selection}\n spellCheck={false}\n style={[g.mono, g.input, { color: colors.text }]}\n testID={testID}\n value={draft.display}\n onBlur={onBlur}\n onChangeText={onChangeText}\n onSelectionChange={onSelectionChange}\n />\n </View>\n {counter !== null ? <Text testID={`${testID}-counter`} style={[g.counter, { color: colors.textSecondary }]}>{counter}</Text> : null}\n </View>\n <RejectionLine message={message} testID={testID} />\n </View>\n );\n}\n","/** Why a BIC was refused; member names match `Finreg.Core.Banking.BicRejection`. */\nexport enum BicRejection {\n None = 'None',\n Missing = 'Missing',\n IllegalCharacter = 'IllegalCharacter',\n WrongLength = 'WrongLength',\n MalformedInstitution = 'MalformedInstitution',\n MalformedCountry = 'MalformedCountry',\n MalformedLocation = 'MalformedLocation',\n}\n","import { BicRejection } from '../data/BicRejection';\n\nconst BIC8_LENGTH = 8;\nconst BIC11_LENGTH = 11;\nconst COUNTRY_START = 4;\nconst LOCATION_INDEX = 6;\nconst ALPHANUMERIC = /^[A-Za-z0-9]*$/;\nconst INSTITUTION = /^[A-Z]{4}/;\nconst COUNTRY = /^[A-Z]{2}$/;\nconst RESERVED_LOCATION = ['0', '1'];\n\n/** The outcome of validating one BIC; `electronic` (upper case, trimmed) is set only when valid. */\nexport interface BicVerdict {\n readonly rejection: BicRejection;\n readonly electronic: string | null;\n}\n\nconst refused = (rejection: BicRejection): BicVerdict => ({ rejection, electronic: null });\n\n/** Validates a BIC with the same rules as `Finreg.Core.Banking.Bic.Validate`. */\nexport function validateBic(raw: string | null | undefined): BicVerdict {\n if (raw === null || raw === undefined || raw.trim() === '') return refused(BicRejection.Missing);\n const trimmed = raw.trim();\n if (!ALPHANUMERIC.test(trimmed)) return refused(BicRejection.IllegalCharacter);\n const bic = trimmed.toUpperCase();\n if (bic.length !== BIC8_LENGTH && bic.length !== BIC11_LENGTH) return refused(BicRejection.WrongLength);\n if (!INSTITUTION.test(bic)) return refused(BicRejection.MalformedInstitution);\n if (!COUNTRY.test(bic.slice(COUNTRY_START, LOCATION_INDEX))) return refused(BicRejection.MalformedCountry);\n if (RESERVED_LOCATION.includes(bic.charAt(LOCATION_INDEX))) return refused(BicRejection.MalformedLocation);\n return { rejection: BicRejection.None, electronic: bic };\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { useBlurVerdict } from './hooks/useBlurVerdict';\nimport { validateBic, type BicVerdict } from './utils/bic';\nimport { RejectionLine } from './components/RejectionLine';\nimport { BicRejection } from './data/BicRejection';\nimport type { BicRejectionLabels } from './types';\nimport { rejectionMessage } from './utils/rejectionMessage';\nimport { ghostStyles as g } from './utils/ghostStyles';\nimport { draftBic } from './utils/ibanFormat';\n\nexport interface BicInputProps {\n value: string;\n onChange: (bic: string) => void;\n onVerdict?: (verdict: BicVerdict | null) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n onBlur?: () => void;\n rejectionLabels?: BicRejectionLabels;\n placeholder?: string;\n}\n\n/** A BIC box that upper-cases as you type, ghosts the optional branch and validates on leave. */\nexport function BicInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }: BicInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const draft = useMemo(() => draftBic(value), [value]);\n const validate = useCallback(() => validateBic(value), [value]);\n const { verdict, onEdit, onLeave } = useBlurVerdict(validate);\n const message = value === '' ? null : rejectionMessage(verdict?.rejection ?? null, BicRejection.None, rejectionLabels);\n\n const onChangeText = useCallback((text: string) => {\n onEdit();\n onVerdict?.(null);\n onChange(draftBic(text).value);\n }, [onEdit, onVerdict, onChange]);\n\n const onBlur = useCallback(() => {\n const verdict = onLeave();\n onVerdict?.(value === '' ? null : verdict);\n onLeft?.();\n }, [onLeave, onVerdict, value, onLeft]);\n\n return (\n <View>\n <View style={[s.selectTrigger, g.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}>\n <View style={g.field}>\n <Text aria-hidden style={[g.mono, g.layer]}>\n <Text style={g.hidden}>{draft.value}</Text>\n <Text style={{ color: colors.textSecondary }}>{draft.ghost}</Text>\n <Text style={[g.branch, { color: colors.textSecondary }]}>{draft.branchGhost}</Text>\n </Text>\n <TextInput\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n autoCapitalize=\"characters\"\n autoComplete=\"off\"\n autoCorrect={false}\n placeholder={draft.value === '' ? placeholder : undefined}\n placeholderTextColor={colors.textSecondary}\n spellCheck={false}\n style={[g.mono, g.input, { color: colors.text }]}\n testID={testID}\n value={draft.value}\n onBlur={onBlur}\n onChangeText={onChangeText}\n />\n </View>\n </View>\n <RejectionLine message={message} testID={testID} />\n </View>\n );\n}\n","import React from 'react';\n\nimport { Platform, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst BAR_GAP = 8;\nconst PAD_V = 10;\nconst PAD_H = 16;\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },\n actions: { flexDirection: 'row', flexWrap: 'wrap', gap: BAR_GAP },\n message: { fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\ntype ActionBarPosition = 'sticky' | 'relative';\n\nconst PINNED = { position: 'sticky', bottom: 0, zIndex: 1 } as unknown as ViewStyle;\n\n/** Where the bar sits: pinned to the bottom of its scroll area on web when sticky, in flow otherwise. */\nexport const actionBarPosition = (sticky: boolean, os: string): ActionBarPosition => (sticky && os === 'web' ? 'sticky' : 'relative');\n\nexport interface ActionBarProps {\n children: React.ReactNode;\n message?: string;\n sticky?: boolean;\n testID: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** A bar of action buttons with an optional status line, pinned to the bottom edge when sticky. */\nexport const ActionBar = ({ children, message, sticky = false, testID, style }: ActionBarProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const pinned = actionBarPosition(sticky, Platform.OS) === 'sticky' ? PINNED : null;\n const hasMessage = message !== undefined && message !== '';\n\n return (\n <View style={[styles.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style]} testID={testID}>\n {hasMessage ? (\n <Text role=\"status\" style={[styles.message, { color: colors.text }]} testID={`${testID}-message`}>\n {message}\n </Text>\n ) : null}\n <View style={styles.actions}>{children}</View>\n </View>\n );\n};\n","export interface ChecklistItem {\n id: string;\n label: string;\n description?: string;\n}\n\n/** True when every item's id is checked; an empty list is complete. */\nexport const isChecklistComplete = (items: readonly ChecklistItem[], checked: readonly string[]): boolean =>\n items.every((item) => checked.includes(item.id));\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FormCheckbox } from '../FormCheckbox/FormCheckbox';\n\nimport { isChecklistComplete, type ChecklistItem } from './isChecklistComplete';\n\nconst TITLE_SIZE = 13;\nconst TITLE_GAP = 6;\n\nconst styles = StyleSheet.create({\n title: { fontSize: TITLE_SIZE, fontWeight: '700', marginBottom: TITLE_GAP },\n});\n\nexport interface GatedChecklistProps {\n title: string;\n items: readonly ChecklistItem[];\n checked: readonly string[];\n onToggle: (id: string) => void;\n testID: string;\n disabled?: boolean;\n children?: (complete: boolean) => React.ReactNode;\n}\n\n/** A checklist that tells its `children` slot whether every item is ticked, so the slot can gate its action. */\nexport const GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }: GatedChecklistProps): React.ReactElement => {\n const { theme } = useUi();\n const complete = isChecklistComplete(items, checked);\n\n return (\n <View testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.title, { color: theme.colors.text }]}>\n {title}\n </Text>\n {items.map((item) => (\n <FormCheckbox\n key={item.id}\n description={item.description}\n disabled={disabled}\n label={item.label}\n testID={`${testID}-item-${item.id}`}\n value={checked.includes(item.id)}\n onValueChange={() => onToggle(item.id)}\n />\n ))}\n {children?.(complete)}\n </View>\n );\n};\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type { ChipColors } from '../../ChipSelector/types';\nimport type { RadioOption } from '../types';\nimport type { RadioRowIdentity } from '../utils/radioRowIdentity';\n\nconst MIN_TARGET_PX = 44;\nconst DOT_SIZE = 18;\nconst DOT_INNER = 8;\nconst ROW_GAP = 10;\nconst PAD_H = 12;\nconst PAD_V = 8;\nconst RADIUS = 8;\nconst LABEL_SIZE = 14;\nconst DESCRIPTION_SIZE = 12;\nconst DESCRIPTION_LINE = 16;\n\nconst styles = StyleSheet.create({\n row: {\n alignItems: 'center',\n borderRadius: RADIUS,\n borderWidth: 1,\n columnGap: ROW_GAP,\n flexDirection: 'row',\n minHeight: MIN_TARGET_PX,\n paddingHorizontal: PAD_H,\n paddingVertical: PAD_V,\n },\n dot: { alignItems: 'center', borderRadius: DOT_SIZE / 2, borderWidth: 2, height: DOT_SIZE, justifyContent: 'center', width: DOT_SIZE },\n dotInner: { borderRadius: DOT_INNER / 2, height: DOT_INNER, width: DOT_INNER },\n text: { flex: 1, flexShrink: 1 },\n label: { fontSize: LABEL_SIZE, fontWeight: '600' },\n description: { fontSize: DESCRIPTION_SIZE, lineHeight: DESCRIPTION_LINE },\n});\n\nexport interface RadioRowProps<T> {\n option: RadioOption<T>;\n identity: RadioRowIdentity;\n colors: ChipColors;\n tabIndex?: 0 | -1;\n hostRef: (node: unknown) => void;\n onPress: () => void;\n}\n\n/** One full-width radio row: a dot, the option label and an optional description under it. */\nexport function RadioRow<T>({ option, identity, colors, tabIndex, hostRef, onPress }: RadioRowProps<T>): React.ReactElement {\n const { checked, disabled } = identity.accessibilityState;\n const accent = checked ? colors.primary : colors.border;\n const hasDescription = option.description !== undefined && option.description !== '';\n\n return (\n <Pressable\n ref={hostRef}\n accessibilityHint={option.hint}\n accessibilityLabel={identity.accessibilityLabel}\n accessibilityRole=\"radio\"\n accessibilityState={identity.accessibilityState}\n aria-checked={checked}\n disabled={disabled}\n style={[styles.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }]}\n tabIndex={tabIndex}\n testID={identity.testID}\n onPress={onPress}\n >\n <View style={[styles.dot, { borderColor: accent }]}>\n {checked ? <View style={[styles.dotInner, { backgroundColor: colors.primary }]} /> : null}\n </View>\n <View style={styles.text}>\n <Text style={[styles.label, { color: checked ? colors.primary : colors.textStrong }]}>{option.label}</Text>\n {hasDescription ? (\n <Text style={[styles.description, { color: colors.textMuted }]} testID={`${identity.testID}-description`}>\n {option.description}\n </Text>\n ) : null}\n </View>\n </Pressable>\n );\n}\n","import type { RadioOption } from '../types';\n\nexport interface RadioRowIdentity {\n testID: string;\n accessibilityLabel: string;\n accessibilityState: { checked: boolean; selected: boolean; disabled: boolean };\n}\n\n/** The testID, accessible name (label, then description) and native radio state of one row. */\nexport const radioRowIdentity = <T>(option: RadioOption<T>, selected: boolean, disabled: boolean, prefix: string): RadioRowIdentity => {\n const hasDescription = option.description !== undefined && option.description !== '';\n return {\n testID: `${prefix}-${String(option.value)}`,\n accessibilityLabel: hasDescription ? `${option.label}, ${String(option.description)}` : option.label,\n accessibilityState: { checked: selected, selected, disabled },\n };\n};\n","import React from 'react';\n\nimport { StyleSheet, View, type ViewProps } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useRadioKeyboard } from '../ChipSelector/hooks/useRadioKeyboard';\nimport { buildChipColors } from '../ChipSelector/utils/chipColors';\nimport { Field } from '../Field/Field';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\nimport { RadioRow } from './components/RadioRow';\nimport type { RadioListProps } from './types';\nimport { radioRowIdentity } from './utils/radioRowIdentity';\n\nconst ROW_GAP = 8;\n\nconst styles = StyleSheet.create({\n list: { rowGap: ROW_GAP },\n});\n\n/** A vertical radio group of labelled rows with descriptions; arrow keys move the choice. */\nexport function RadioList<T extends string | number>(props: RadioListProps<T>): React.ReactElement {\n const { options, value, onChange, optionTestIDPrefix, label, error, required = false, disabled = false, testID } = props;\n const { theme } = useUi();\n const colors = React.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);\n const selectedIndex = options.findIndex((option) => option.value === value);\n const radio = useRadioKeyboard({ enabled: true, disabled, values: options.map((option) => option.value), selectedIndex, onChange });\n\n return (\n <Field error={error} label={label} required={required} testID={testID}>\n {({ describedById, hasError }) => (\n <View\n accessibilityRole=\"radiogroup\"\n style={styles.list}\n {...(webFieldA11y({ describedById, hasError }) as ViewProps)}\n {...radio.groupProps}\n >\n {options.map((option, index) => (\n <RadioRow\n key={String(option.value)}\n colors={colors}\n hostRef={radio.chipRef(index)}\n identity={radioRowIdentity(option, index === selectedIndex, disabled, optionTestIDPrefix)}\n option={option}\n tabIndex={radio.tabIndexFor(index)}\n onPress={() => onChange(option.value)}\n />\n ))}\n </View>\n )}\n </Field>\n );\n}\n","import { isWideFormLayout } from '../../ResponsiveFormLayout/isWideFormLayout';\nimport type { DecisionError, DecisionOutcome, DecisionPanelVariant, DecisionTone } from '../types';\n\ntype OutcomeButtonVariant = 'primary' | 'secondary' | 'danger';\n\n/** The first reason the chosen outcome and note cannot be submitted, or null when they can. */\nexport const validateDecision = <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, outcome: string, note: string): DecisionError | null => {\n const chosen = outcomes.find((item) => item.value === outcome);\n if (chosen === undefined) return 'choose';\n const noteMissing = chosen.noteRequired === true && note.trim() === '';\n return noteMissing ? 'note' : null;\n};\n\n/** The default variant for a viewport width: choose-then-submit on phones, the sticky bar at the shared wide breakpoint. */\nexport const defaultDecisionVariant = (width: number): DecisionPanelVariant => (isWideFormLayout(width) ? 'sticky-bar' : 'choose-then-submit');\n\n/** The outcomes with the lead one first; the rest keep their order. */\nexport const leadFirst = <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined): Array<DecisionOutcome<T>> => [\n ...outcomes.filter((item) => item.value === lead),\n ...outcomes.filter((item) => item.value !== lead),\n];\n\n/** The button variant an outcome tone renders as. */\nexport const toneVariant = (tone: DecisionTone | undefined): OutcomeButtonVariant => {\n if (tone === 'primary') return 'primary';\n return tone === 'danger' ? 'danger' : 'secondary';\n};\n","import React from 'react';\n\nimport { FormField } from '../../FormField/FormField';\nimport type { DecisionVariantProps } from './variantProps';\n\nconst NOTE_LINES = 3;\n\n/** The decision note: multi-line (Enter adds a line), showing the note-required refusal. */\nexport function DecisionNote<T extends string>({ state, labels, testID, disabled }: DecisionVariantProps<T>): React.ReactElement {\n const error = state.error === 'note' ? labels.noteRequiredError : undefined;\n return (\n <FormField\n multiline\n editable={!disabled}\n error={error}\n label={labels.note}\n numberOfLines={NOTE_LINES}\n placeholder={labels.notePlaceholder}\n testID={`${testID}-note`}\n value={state.note}\n onChangeText={state.setNote}\n />\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { toneVariant } from '../utils/decisionRules';\nimport type { DecisionOutcome } from '../types';\n\nconst BUTTON_BASIS = '40%';\n\nconst styles = StyleSheet.create({\n cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 },\n});\n\nexport interface OutcomeButtonsProps<T extends string> {\n outcomes: ReadonlyArray<DecisionOutcome<T>>;\n pending: T | null;\n disabled: boolean;\n testID: string;\n onPress: (outcome: T) => Promise<void>;\n}\n\n/** One button per outcome; the one being submitted shows the shared loading state. */\nexport function OutcomeButtons<T extends string>({ outcomes, pending, disabled, testID, onPress }: OutcomeButtonsProps<T>): React.ReactElement {\n return (\n <>\n {outcomes.map((item) => (\n <View key={item.value} style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={item.hint}\n accessibilityLabel={item.label}\n disabled={disabled || (pending !== null && pending !== item.value)}\n label={item.label}\n loading={pending === item.value}\n testID={`${testID}-action-${item.value}`}\n variant={toneVariant(item.tone)}\n onPress={() => onPress(item.value)}\n />\n </View>\n ))}\n </>\n );\n}\n","import React from 'react';\n\nimport { ChipSelector } from '../../ChipSelector/ChipSelector';\nimport { ActionBar } from '../../FixBar/ActionBar';\nimport { leadFirst } from '../utils/decisionRules';\nimport type { DecisionOutcome } from '../types';\n\nimport { DecisionNote } from './DecisionNote';\nimport { OutcomeButtons } from './OutcomeButtons';\nimport type { DecisionVariantProps } from './variantProps';\n\nconst retone = <T extends string>(item: DecisionOutcome<T>, lead: T | undefined): DecisionOutcome<T> => {\n if (item.value === lead) return { ...item, tone: 'primary' };\n return item.tone === 'primary' ? { ...item, tone: 'neutral' } : item;\n};\n\n/** The failed checks become reason chips for the note, and the lead outcome comes first. */\nexport function ChecksDriveDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled, reasons = [], leadOutcome } = props;\n const ordered = leadFirst(outcomes, leadOutcome).map((item) => retone(item, leadOutcome));\n return (\n <>\n {reasons.length > 0 ? (\n <ChipSelector\n multiple\n chipTestIDPrefix={`${testID}-reason`}\n disabled={disabled}\n label={labels.reasons}\n options={reasons}\n testID={`${testID}-reasons`}\n value={state.reasons}\n variant=\"outline\"\n onChange={state.toggleReason}\n />\n ) : null}\n <DecisionNote {...props} />\n <ActionBar message={labels.message} testID={`${testID}-bar`}>\n <OutcomeButtons disabled={disabled} outcomes={ordered} pending={state.pending} testID={testID} onPress={state.submit} />\n </ActionBar>\n </>\n );\n}\n","import React from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { RadioList } from '../../RadioList/RadioList';\n\nimport { DecisionNote } from './DecisionNote';\nimport type { DecisionVariantProps } from './variantProps';\n\n/** Labelled choices with what each does, one note, one Submit: no outcome lands on one tap. */\nexport function ChooseThenSubmitDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled } = props;\n return (\n <>\n <RadioList\n disabled={disabled}\n error={state.error === 'choose' ? labels.chooseError : undefined}\n optionTestIDPrefix={`${testID}-outcome`}\n options={outcomes}\n testID={`${testID}-outcomes`}\n value={state.outcome === '' ? undefined : state.outcome}\n onChange={state.choose}\n />\n <DecisionNote {...props} />\n <Button\n fullWidth\n accessibilityHint={labels.submitHint}\n accessibilityLabel={labels.submit}\n disabled={disabled}\n label={labels.submit}\n loading={state.pending !== null}\n testID={`${testID}-submit`}\n onPress={() => state.submit()}\n />\n </>\n );\n}\n","import React from 'react';\n\nimport { ActionBar } from '../../FixBar/ActionBar';\n\nimport { DecisionNote } from './DecisionNote';\nimport { OutcomeButtons } from './OutcomeButtons';\nimport type { DecisionVariantProps } from './variantProps';\n\n/** Note in the page, every outcome a button in a bar pinned under the thumb. */\nexport function StickyBarDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled } = props;\n return (\n <>\n <DecisionNote {...props} />\n <ActionBar sticky message={labels.message} testID={`${testID}-bar`}>\n <OutcomeButtons disabled={disabled} outcomes={outcomes} pending={state.pending} testID={testID} onPress={state.submit} />\n </ActionBar>\n </>\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../../fieldErrorInk/fieldErrorInk';\n\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n text: { fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\n/** The alert shown when the decision could not be sent. */\nexport const SubmitError = ({ message, testID }: { message: string; testID: string }): React.ReactElement => {\n const { theme } = useUi();\n return (\n <Text role=\"alert\" style={[styles.text, { color: fieldErrorInk(theme) }]} testID={testID}>\n {message}\n </Text>\n );\n};\n","import React from 'react';\n\nimport { validateDecision } from '../utils/decisionRules';\nimport type { DecisionError, DecisionOutcome, DecisionSubmission } from '../types';\n\nexport interface DecisionPanelState<T extends string> {\n outcome: T | '';\n note: string;\n reasons: string[];\n checked: string[];\n error: DecisionError | null;\n pending: T | null;\n choose: (outcome: T) => void;\n setNote: (note: string) => void;\n toggleReason: (reason: string) => void;\n toggleCheck: (id: string) => void;\n submit: (override?: T) => Promise<void>;\n}\n\nconst toggle = (list: string[], id: string): string[] => (list.includes(id) ? list.filter((item) => item !== id) : [...list, id]);\n\n/** The decision panel's state: chosen outcome, note, reasons, checklist ticks, the refusal and the submit in flight. */\nexport function useDecisionPanel<T extends string>(\n outcomes: ReadonlyArray<DecisionOutcome<T>>,\n onSubmit: (submission: DecisionSubmission<T>) => void | Promise<unknown>,\n): DecisionPanelState<T> {\n const [outcome, setOutcome] = React.useState<T | ''>('');\n const [note, setNote] = React.useState('');\n const [reasons, setReasons] = React.useState<string[]>([]);\n const [checked, setChecked] = React.useState<string[]>([]);\n const [error, setError] = React.useState<DecisionError | null>(null);\n const [pending, setPending] = React.useState<T | null>(null);\n\n const submit = async (override?: T): Promise<void> => {\n const target = override ?? outcome;\n const problem = validateDecision(outcomes, target, note);\n setError(problem);\n if (problem !== null || target === '') return;\n setPending(target);\n try {\n await onSubmit({ outcome: target, note, reasons });\n } catch {\n setError('submit');\n } finally {\n setPending(null);\n }\n };\n\n return {\n outcome,\n note,\n reasons,\n checked,\n error,\n pending,\n choose: (next: T): void => {\n setOutcome(next);\n setError(null);\n },\n setNote,\n toggleReason: (reason: string): void => setReasons((list) => toggle(list, reason)),\n toggleCheck: (id: string): void => setChecked((list) => toggle(list, id)),\n submit,\n };\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { GatedChecklist } from '../GatedChecklist/GatedChecklist';\n\nimport { ChecksDriveDecision } from './components/ChecksDriveDecision';\nimport { ChooseThenSubmitDecision } from './components/ChooseThenSubmitDecision';\nimport { StickyBarDecision } from './components/StickyBarDecision';\nimport { SubmitError } from './components/SubmitError';\nimport type { DecisionVariantProps } from './components/variantProps';\nimport { useDecisionPanel } from './hooks/useDecisionPanel';\nimport type { DecisionPanelProps, DecisionPanelVariant } from './types';\n\nconst TITLE_SIZE = 15;\nconst PANEL_GAP = 12;\n\nconst styles = StyleSheet.create({\n panel: { rowGap: PANEL_GAP },\n title: { fontSize: TITLE_SIZE, fontWeight: '700' },\n});\n\nfunction renderVariant<T extends string>(variant: DecisionPanelVariant, props: DecisionVariantProps<T>): React.ReactElement {\n if (variant === 'sticky-bar') return <StickyBarDecision {...props} />;\n if (variant === 'checks-drive') return <ChecksDriveDecision {...props} />;\n return <ChooseThenSubmitDecision {...props} />;\n}\n\n/** A decision control in one of three layouts; outcomes, labels and note rules come in as config. */\nexport function DecisionPanel<T extends string>(props: DecisionPanelProps<T>): React.ReactElement {\n const { variant, outcomes, onSubmit, labels, testID, reasons, leadOutcome, checklist, disabled = false, style } = props;\n const { theme } = useUi();\n const state = useDecisionPanel(outcomes, onSubmit);\n const body = (locked: boolean): React.ReactElement =>\n renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });\n\n return (\n <View style={[styles.panel, style]} testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.title, { color: theme.colors.text }]}>\n {labels.title}\n </Text>\n {checklist !== undefined ? (\n <GatedChecklist checked={state.checked} items={checklist.items} testID={`${testID}-checklist`} title={checklist.title} onToggle={state.toggleCheck}>\n {(complete) => body(!complete)}\n </GatedChecklist>\n ) : (\n body(false)\n )}\n {state.error === 'submit' ? <SubmitError message={labels.submitError} testID={`${testID}-error`} /> : null}\n </View>\n );\n}\n","export const enum PasswordRulesDisplay {\n Checklist = 'checklist',\n MeterGrid = 'meterGrid',\n Chips = 'chips',\n Sentence = 'sentence',\n}\n","export const enum RuleTone {\n Met = 'met',\n Unmet = 'unmet',\n Refused = 'refused',\n}\n\nexport function ruleTone(met: boolean, flagUnmet: boolean): RuleTone {\n if (met) return RuleTone.Met;\n return flagUnmet ? RuleTone.Refused : RuleTone.Unmet;\n}\n","import React, { useEffect, useRef } from 'react';\n\nimport { Animated, Easing, StyleSheet, View } from 'react-native';\n\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { useReducedMotion } from '../SearchSelect/hooks/useReducedMotion';\nimport { RuleTone } from './RuleTone';\nimport type { RuleColors } from './useRuleColors';\n\nconst MARK_SIZE = 16;\nconst CHECK_SIZE = 12;\nconst RING_WIDTH = 1.5;\nconst POP_FROM = 0.6;\nconst POP_PEAK = 1.12;\nconst POP_UP_MS = 160;\nconst POP_SETTLE_MS = 100;\n\nconst styles = StyleSheet.create({\n mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: 'center', justifyContent: 'center' },\n ring: { borderWidth: RING_WIDTH },\n});\n\nexport interface RuleMarkProps {\n tone: RuleTone;\n colors: RuleColors;\n}\n\nexport function RuleMark({ tone, colors }: RuleMarkProps): React.ReactElement {\n const reduced = useReducedMotion();\n const scale = useRef(new Animated.Value(1)).current;\n const wasMet = useRef(tone === RuleTone.Met);\n const met = tone === RuleTone.Met;\n useEffect(() => {\n const turnedMet = met && !wasMet.current;\n wasMet.current = met;\n if (!turnedMet || reduced) return;\n scale.setValue(POP_FROM);\n Animated.sequence([\n Animated.timing(scale, { toValue: POP_PEAK, duration: POP_UP_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false }),\n Animated.timing(scale, { toValue: 1, duration: POP_SETTLE_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false }),\n ]).start();\n }, [met, reduced, scale]);\n const color = colors.mark[tone];\n const shape = met ? { backgroundColor: color } : [styles.ring, { borderColor: color }];\n return (\n <Animated.View style={{ transform: [{ scale }] }}>\n <View style={[styles.mark, shape]}>\n {met ? <SvgIcon color={colors.onMark} name=\"check\" size={CHECK_SIZE} /> : null}\n </View>\n </Animated.View>\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { RuleMark } from './RuleMark';\nimport { ruleTone } from './RuleTone';\nimport type { PasswordRuleState } from './types';\nimport type { RuleColors } from './useRuleColors';\n\nconst GAP = 6;\nconst ROW_GAP = 8;\nconst FONT = 14;\nconst LINE = 20;\nconst METER_HEIGHT = 4;\nconst RADIUS = 999;\nconst CHIP_PAD_V = 4;\nconst CHIP_PAD_H = 10;\nconst CHIP_BORDER = 1;\nconst HALF = '50%';\n\nconst styles = StyleSheet.create({\n column: { gap: GAP },\n row: { flexDirection: 'row', alignItems: 'center', gap: ROW_GAP },\n text: { fontSize: FONT, lineHeight: LINE, flexShrink: 1 },\n meter: { flexDirection: 'row', gap: GAP },\n segment: { flex: 1, height: METER_HEIGHT, borderRadius: RADIUS },\n grid: { flexDirection: 'row', flexWrap: 'wrap', rowGap: GAP },\n cell: { flexBasis: HALF, maxWidth: HALF, paddingRight: GAP },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: GAP },\n chip: { borderRadius: RADIUS, borderWidth: CHIP_BORDER, paddingVertical: CHIP_PAD_V, paddingHorizontal: CHIP_PAD_H },\n metPhrase: { fontWeight: '700', textDecorationLine: 'underline' },\n});\n\nexport interface RuleVariantProps {\n rules: readonly PasswordRuleState[];\n flagUnmet: boolean;\n colors: RuleColors;\n testID: string;\n}\n\ninterface RuleListProps extends RuleVariantProps {\n listStyle: StyleProp<ViewStyle>;\n itemStyle?: StyleProp<ViewStyle>;\n outlined?: boolean;\n}\n\nfunction RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }: RuleListProps): React.ReactElement {\n return (\n <View role=\"list\" style={listStyle} testID={testID}>\n {rules.map((rule) => {\n const tone = ruleTone(rule.met, flagUnmet);\n const outline = outlined ? { borderColor: colors.mark[tone] } : null;\n return (\n <View key={rule.id} role=\"listitem\" style={[styles.row, itemStyle, outline]} testID={`${testID}-${rule.id}`} {...{ dataSet: { tone } }}>\n <RuleMark colors={colors} tone={tone} />\n <Text style={[styles.text, { color: colors.text[tone] }]}>{rule.label}</Text>\n </View>\n );\n })}\n </View>\n );\n}\n\nexport function RulesChecklist(props: RuleVariantProps): React.ReactElement {\n return <RuleList {...props} listStyle={styles.column} />;\n}\n\nexport function RulesChips(props: RuleVariantProps): React.ReactElement {\n return <RuleList {...props} outlined itemStyle={styles.chip} listStyle={styles.chips} />;\n}\n\nexport function RulesMeterGrid(props: RuleVariantProps): React.ReactElement {\n const { rules, flagUnmet, colors, testID } = props;\n const metCount = rules.filter((rule) => rule.met).length;\n const unfilled = flagUnmet ? colors.mark.refused : colors.track;\n return (\n <View style={styles.column}>\n <View style={styles.meter} testID={`${testID}-meter`}>\n {rules.map((rule, index) => (\n <View key={rule.id} style={[styles.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }]} />\n ))}\n </View>\n <RuleList {...props} itemStyle={styles.cell} listStyle={styles.grid} />\n </View>\n );\n}\n\nexport function RulesSentence({ rules, flagUnmet, colors, testID }: RuleVariantProps): React.ReactElement {\n return (\n <Text style={[styles.text, { color: colors.text.unmet }]} testID={testID}>\n {rules.map((rule, index) => {\n const tone = ruleTone(rule.met, flagUnmet);\n return (\n <Text key={rule.id} style={[{ color: colors.text[tone] }, rule.met ? styles.metPhrase : null]} testID={`${testID}-${rule.id}`} {...{ dataSet: { tone } }}>\n {index > 0 ? ', ' : ''}\n {rule.label}\n </Text>\n );\n })}\n </Text>\n );\n}\n","import React from 'react';\n\nimport { PasswordRulesDisplay } from './PasswordRulesDisplay';\nimport { RulesChecklist, RulesChips, RulesMeterGrid, RulesSentence, type RuleVariantProps } from './RuleVariants';\n\nexport interface PasswordRulesProps extends RuleVariantProps {\n display: PasswordRulesDisplay;\n}\n\nexport function PasswordRules({ display, ...variant }: PasswordRulesProps): React.ReactElement {\n switch (display) {\n case PasswordRulesDisplay.Checklist:\n return <RulesChecklist {...variant} />;\n case PasswordRulesDisplay.Chips:\n return <RulesChips {...variant} />;\n case PasswordRulesDisplay.Sentence:\n return <RulesSentence {...variant} />;\n default:\n return <RulesMeterGrid {...variant} />;\n }\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nconst ICON_SIZE = 20;\n\nconst styles = StyleSheet.create({\n button: { width: MIN_TOUCH_TARGET_PX, height: MIN_TOUCH_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n});\n\nexport interface RevealToggleProps {\n revealed: boolean;\n onToggle: () => void;\n onPressIn?: () => void;\n showLabel: string;\n hideLabel: string;\n color: string;\n testID: string;\n}\n\nexport function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }: RevealToggleProps): React.ReactElement {\n const label = revealed ? hideLabel : showLabel;\n return (\n <Pressable\n accessibilityHint={label}\n accessibilityLabel={label}\n accessibilityRole=\"button\"\n aria-pressed={revealed}\n style={styles.button}\n testID={testID}\n onPress={onToggle}\n onPressIn={onPressIn}\n >\n <SvgIcon color={color} name={revealed ? 'eyeOff' : 'eye'} size={ICON_SIZE} />\n </Pressable>\n );\n}\n","import type { PasswordFieldLabels, PasswordRuleState } from './types';\n\nexport function changedRules(\n previous: readonly PasswordRuleState[],\n next: readonly PasswordRuleState[],\n): PasswordRuleState[] {\n const before = new Map(previous.map((rule) => [rule.id, rule.met]));\n return next.filter((rule) => before.has(rule.id) && before.get(rule.id) !== rule.met);\n}\n\nexport function ruleAnnouncement(\n changed: readonly PasswordRuleState[],\n labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>,\n): string {\n return changed.map((rule) => `${rule.label}: ${rule.met ? labels.met : labels.unmet}`).join('. ');\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport { changedRules, ruleAnnouncement } from './ruleAnnouncement';\nimport type { PasswordFieldLabels, PasswordRuleState } from './types';\n\nexport function usePasswordRuleAnnouncement(\n rules: readonly PasswordRuleState[],\n labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>,\n): string {\n const previous = useRef<readonly PasswordRuleState[]>(rules);\n const [message, setMessage] = useState('');\n useEffect(() => {\n const changed = changedRules(previous.current, rules);\n previous.current = rules;\n if (changed.length > 0) setMessage(ruleAnnouncement(changed, labels));\n }, [rules, labels]);\n return message;\n}\n","import { useMemo } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { RuleTone } from './RuleTone';\nimport type { PasswordFieldColors } from './types';\n\nexport interface RuleColors {\n mark: Record<RuleTone, string>;\n text: Record<RuleTone, string>;\n track: string;\n onMark: string;\n}\n\nexport function ruleColorsFrom(palette: PasswordFieldColors): RuleColors {\n return {\n mark: { [RuleTone.Met]: palette.success, [RuleTone.Unmet]: palette.textSecondary, [RuleTone.Refused]: palette.error },\n text: { [RuleTone.Met]: palette.text, [RuleTone.Unmet]: palette.textSecondary, [RuleTone.Refused]: palette.error },\n track: palette.border,\n onMark: palette.background,\n };\n}\n\nexport function useRuleColors(override?: PasswordFieldColors): RuleColors {\n const { theme } = useUi();\n return useMemo(() => {\n if (override !== undefined) return ruleColorsFrom(override);\n return ruleColorsFrom({\n success: theme.semantic.success?.['500'] ?? theme.colors.text,\n error: theme.semantic.error['500'],\n text: theme.colors.text,\n textSecondary: theme.colors.textSecondary,\n border: theme.colors.border,\n background: theme.colors.background,\n });\n }, [theme, override]);\n}\n","import React, { useCallback, useImperativeHandle, useRef, useState } from 'react';\n\nimport { StyleSheet, Text, View, type NativeSyntheticEvent, type TextInput, type TextInputSelectionChangeEventData } from 'react-native';\n\nimport { Field } from '../Field/Field';\nimport { ThemedTextInput, type ThemedTextInputProps } from '../ThemedTextInput/ThemedTextInput';\nimport { PasswordRules } from './PasswordRules';\nimport { PasswordRulesDisplay } from './PasswordRulesDisplay';\nimport { RevealToggle } from './RevealToggle';\nimport type { PasswordFieldColors, PasswordFieldLabels, PasswordRuleState } from './types';\nimport { usePasswordRuleAnnouncement } from './usePasswordRuleAnnouncement';\nimport { useRuleColors } from './useRuleColors';\n\nconst RULES_GAP = 8;\nconst TOGGLE_INSET = 48;\nconst NO_RULES: readonly PasswordRuleState[] = [];\n\nconst styles = StyleSheet.create({\n inputRow: { position: 'relative', justifyContent: 'center' },\n input: { paddingRight: TOGGLE_INSET },\n toggle: { position: 'absolute', right: 0, top: 0, bottom: 0, justifyContent: 'center' },\n rules: { marginTop: RULES_GAP },\n live: { position: 'absolute', width: 1, height: 1, overflow: 'hidden', opacity: 0 },\n});\n\ntype Selection = TextInputSelectionChangeEventData['selection'];\ntype FocusableNode = { focus: () => void; setSelectionRange?: (start: number, end: number) => void };\n\nexport interface PasswordFieldProps {\n label: string;\n value: string;\n onChangeText: (value: string) => void;\n labels: PasswordFieldLabels;\n testID: string;\n rules?: readonly PasswordRuleState[];\n rulesDisplay?: PasswordRulesDisplay;\n flagUnmet?: boolean;\n error?: string;\n colors?: PasswordFieldColors;\n inputProps?: Omit<ThemedTextInputProps, 'value' | 'onChangeText' | 'secureTextEntry' | 'testID'>;\n}\n\nfunction joinIds(...ids: Array<string | undefined>): string | undefined {\n const joined = ids.filter((id): id is string => id !== undefined && id !== '').join(' ');\n return joined === '' ? undefined : joined;\n}\n\nfunction useCaretKeepingToggle(inputRef: React.RefObject<TextInput | null>, initialLength: number): {\n revealed: boolean;\n onPressIn: () => void;\n onToggle: () => void;\n onSelectionChange: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;\n} {\n const [revealed, setRevealed] = useState(false);\n const selection = useRef<Selection>({ start: initialLength, end: initialLength });\n const hadFocus = useRef(false);\n const onSelectionChange = useCallback((event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n selection.current = event.nativeEvent.selection;\n }, []);\n const onPressIn = useCallback(() => {\n hadFocus.current = inputRef.current?.isFocused?.() ?? false;\n }, [inputRef]);\n const onToggle = useCallback(() => {\n setRevealed((current) => !current);\n if (!hadFocus.current) return;\n const node = inputRef.current as unknown as FocusableNode | null;\n const { start, end } = selection.current;\n requestAnimationFrame(() => {\n node?.focus();\n node?.setSelectionRange?.(start, end);\n });\n }, [inputRef]);\n return { revealed, onPressIn, onToggle, onSelectionChange };\n}\n\nexport const PasswordField = React.forwardRef<TextInput, PasswordFieldProps>(function PasswordField(\n { label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = PasswordRulesDisplay.MeterGrid, flagUnmet = false, error, colors: colorOverride, inputProps },\n ref,\n): React.ReactElement {\n const inputRef = useRef<TextInput>(null);\n useImperativeHandle(ref, () => inputRef.current as TextInput);\n const toggle = useCaretKeepingToggle(inputRef, value.length);\n const colors = useRuleColors(colorOverride);\n const announcement = usePasswordRuleAnnouncement(rules, labels);\n const rulesId = `${testID}-rules`;\n const hasRules = rules.length > 0;\n return (\n <Field error={error} label={label} testID={`${testID}-field`}>\n {(context) => (\n <View>\n <View style={styles.inputRow}>\n <ThemedTextInput\n autoCapitalize=\"none\"\n autoCorrect={false}\n {...inputProps}\n ref={inputRef}\n describedById={joinIds(context.describedById, hasRules ? rulesId : undefined)}\n hasError={context.hasError || (flagUnmet && rules.some((rule) => !rule.met))}\n id={context.controlId}\n secureTextEntry={!toggle.revealed}\n style={[styles.input, inputProps?.style]}\n testID={testID}\n value={value}\n onChangeText={onChangeText}\n onSelectionChange={toggle.onSelectionChange}\n />\n <View style={styles.toggle}>\n <RevealToggle color={colors.text.unmet} hideLabel={labels.hide} revealed={toggle.revealed} showLabel={labels.show} testID={`${testID}-reveal`} onPressIn={toggle.onPressIn} onToggle={toggle.onToggle} />\n </View>\n </View>\n {hasRules ? (\n <View nativeID={rulesId} style={styles.rules}>\n <PasswordRules colors={colors} display={rulesDisplay} flagUnmet={flagUnmet} rules={rules} testID={rulesId} />\n <Text aria-live=\"polite\" accessibilityLiveRegion=\"polite\" style={styles.live} testID={`${testID}-announce`}>\n {announcement}\n </Text>\n </View>\n ) : null}\n </View>\n )}\n </Field>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/Field/attachControlId.ts","../src/Field/useHtmlFor.ts","../src/Field/FieldLabel.tsx","../src/Field/fieldMarkers.ts","../src/Field/fieldSpacing.ts","../src/Field/labelVariants.ts","../src/FormGrid/formGridContext.ts","../src/fieldErrorInk/fieldErrorInk.ts","../src/Field/Field.tsx","../src/FormGrid/FormGrid.tsx","../src/AlignToControl/AlignToControl.tsx","../src/FormGrid/FormCell.tsx","../src/InlineFieldRow/inlineFieldRowLayout.ts","../src/InlineFieldRow/InlineFieldRow.tsx","../src/LineItems/utils/lineItemsLayout.ts","../src/LineItems/components/LineItemCard.tsx","../src/LineItems/components/LineItemsColumnHeaders.tsx","../src/LineItems/LineItems.tsx","../src/FormStack/FormStack.tsx","../src/ResponsiveFormLayout/isWideFormLayout.ts","../src/ResponsiveFormLayout/ResponsiveFormLayout.tsx","../src/FormSection/FormSection.tsx","../src/FormActions/FormActions.tsx","../src/controls/controlStyles.ts","../src/AnchoredMenu/components/OptionRow.tsx","../src/AnchoredMenu/menuPortal.ts","../src/AnchoredMenu/AnchoredMenu.tsx","../src/useThemedInput/useThemedInput.ts","../src/webFieldA11y/webFieldA11y.ts","../src/ThemedTextInput/ThemedTextInput.tsx","../src/useRecentValues/recentValuesCore.ts","../src/useRecentValues/useRecentValues.ts","../src/FormField/RecentInputField.tsx","../src/FormField/textRows.ts","../src/FormField/useAutoGrowRows.ts","../src/FormField/FormField.tsx","../src/segmentBesideField/segmentBesideField.ts","../src/ChipSelector/constants.ts","../src/ChipSelector/ChipLabelWrap.ts","../src/ChipSelector/utils/chipLabelLayout.ts","../src/ChipSelector/components/chipSizeStyles.ts","../src/ChipSelector/utils/chipLook.ts","../src/ChipSelector/components/chipStyles.ts","../src/ChipSelector/components/ChipContent.tsx","../src/ChipSelector/components/OutlineChip.tsx","../src/ChipSelector/components/SolidChip.tsx","../src/ChipSelector/utils/radioKeyboard.ts","../src/ChipSelector/hooks/useRadioKeyboard.ts","../src/ChipSelector/utils/chipColors.ts","../src/ChipSelector/utils/chipIdentity.ts","../src/ChipSelector/ChipSelector.tsx","../src/FormSwitch/SwitchSlot.tsx","../src/FormSwitch/FormSwitchBox.tsx","../src/FormSwitch/FormSwitch.tsx","../src/FormCheckbox/checkboxColors.ts","../src/FormCheckbox/FormCheckbox.tsx","../src/SelectControl/NativeSelect.tsx","../src/controls/nextHighlight.ts","../src/SelectControl/useSelectListbox.ts","../src/SelectControl/SelectControl.tsx","../src/SelectField/SelectField.tsx","../src/MultiSelectField/components/SelectedChip.tsx","../src/MultiSelectField/utils/multiSelectValues.ts","../src/MultiSelectField/MultiSelectField.tsx","../src/TypeaheadControl/hooks/useDelayedBlurClose.ts","../src/controls/suggestOptions.ts","../src/TypeaheadControl/hooks/useTypeaheadSearch.ts","../src/TypeaheadControl/hooks/useTypeaheadState.ts","../src/TypeaheadControl/TypeaheadControl.tsx","../src/DateField/components/WebDateInput.tsx","../src/DatePicker/components/Glyph.tsx","../src/DatePicker/hooks/usePickerColors.ts","../src/DatePicker/components/PickerDialog.tsx","../src/SearchSelect/hooks/useAnchorRect.ts","../src/SearchSelect/DropdownPlacement.ts","../src/SearchSelect/utils/dropdownFrame.ts","../src/SearchSelect/components/DropdownSurface.tsx","../src/SearchSelect/components/SheetSurface.tsx","../src/SearchSelect/hooks/useReducedMotion.ts","../src/DatePicker/data/defaultLabels.ts","../src/DatePicker/utils/isoDate.ts","../src/DatePicker/utils/formatDate.ts","../src/DatePicker/utils/DateDisplay.ts","../src/DatePicker/utils/weekStart.ts","../src/DatePicker/hooks/useDatePickerConfig.tsx","../src/DatePicker/utils/motionStyles.ts","../src/DatePicker/components/PickerSurface.tsx","../src/DatePicker/utils/calendarKeys.ts","../src/DatePicker/hooks/useGridFocus.ts","../src/DatePicker/components/DayCell.tsx","../src/DatePicker/utils/monthGrid.ts","../src/DatePicker/components/MonthGrid.tsx","../src/DatePicker/components/MonthHeader.tsx","../src/DatePicker/components/PickerFooter.tsx","../src/DatePicker/hooks/useMotion.ts","../src/DatePicker/components/SingleCalendar.tsx","../src/DatePicker/hooks/useIsPhone.ts","../src/DatePicker/hooks/useReturnFocus.ts","../src/DatePicker/hooks/useTypedDate.ts","../src/DatePicker/utils/fieldWidth.ts","../src/DatePicker/utils/typedEdit.ts","../src/DateField/components/DatePickerInput.tsx","../src/DateField/components/TemporalInput.tsx","../src/DateField/components/TemporalField.tsx","../src/DateField/DateField.tsx","../src/DateRangeControl/components/NativeDateRange.tsx","../src/DatePicker/utils/rangePresets.ts","../src/DatePicker/components/PresetChips.tsx","../src/DatePicker/components/PresetMenu.tsx","../src/DatePicker/components/RangeMonths.tsx","../src/DatePicker/components/RangeCalendar.tsx","../src/DateRangeControl/components/WebDateRange.tsx","../src/DateRangeControl/DateRangeControl.tsx","../src/DateField/DateTimeField.tsx","../src/DateField/DateInput.tsx","../src/groupSelection/groupSelection.ts","../src/Stepper/StepperTabs.tsx","../src/Stepper/stepperModel.ts","../src/Stepper/StepperNav.tsx","../src/FormStatusLine/FormStatusLine.tsx","../src/useFocusFirstInvalid/useFocusFirstInvalid.ts","../src/useServerFieldErrors/assignServerErrors.ts","../src/useServerFieldErrors/useServerFieldErrors.ts","../src/useKeepInView/useKeepInView.ts","../src/FileInput/FileInput.tsx","../src/UploadWithLinkField/UploadWithLinkField.tsx","../src/AddOnRequest/AddOnRequest.tsx","../src/FixBar/FixBar.tsx","../src/SearchSelect/SelectSurface.ts","../src/SearchSelect/components/OptionRow.tsx","../src/SearchSelect/components/OptionSection.tsx","../src/SearchSelect/components/SearchSelectPanel.tsx","../src/SearchSelect/hooks/useRefocusOnClose.ts","../src/SearchSelect/utils/searchSelectModel.ts","../src/SearchSelect/hooks/useSearchSelectState.ts","../src/SearchSelect/utils/searchSelectMotion.ts","../src/SearchSelect/SearchSelect.tsx","../src/SearchSelect/hooks/useOutsidePress.ts","../src/SearchSelect/hooks/useDeferredFocus.ts","../src/CountryFlag/data/flagPalette.ts","../src/CountryFlag/FlagShapeKind.ts","../src/CountryFlag/data/flagDrawingsAtoL.ts","../src/CountryFlag/data/flagDrawingsMtoZ.ts","../src/CountryFlag/data/flagDrawings.ts","../src/CountryFlag/data/flagSpecs.ts","../src/CountryFlag/utils/flagPrimitives.ts","../src/CountryFlag/utils/flagDrawing.ts","../src/CountryFlag/utils/flagShapes.ts","../src/CountryFlag/CountryFlag.tsx","../src/countries/countriesData.ts","../src/countries/countryOptions.ts","../src/CountryField/CountryField.tsx","../src/IbanInput/hooks/useBlurVerdict.ts","../src/IbanInput/data/ibanCountryLengths.ts","../src/IbanInput/utils/ibanFormat.ts","../src/IbanInput/utils/ibanCaret.ts","../src/IbanInput/hooks/useIbanCaret.ts","../src/IbanInput/utils/ghostStyles.ts","../src/IbanInput/data/IbanRejection.ts","../src/IbanInput/utils/iban.ts","../src/IbanInput/components/RejectionLine.tsx","../src/IbanInput/utils/rejectionMessage.ts","../src/IbanInput/IbanInput.tsx","../src/IbanInput/data/BicRejection.ts","../src/IbanInput/utils/bic.ts","../src/IbanInput/BicInput.tsx","../src/FixBar/ActionBar.tsx","../src/GatedChecklist/isChecklistComplete.ts","../src/GatedChecklist/GatedChecklist.tsx","../src/RadioList/components/RadioRow.tsx","../src/RadioList/utils/radioRowIdentity.ts","../src/RadioList/RadioList.tsx","../src/DecisionPanel/utils/decisionRules.ts","../src/DecisionPanel/components/DecisionNote.tsx","../src/DecisionPanel/components/OutcomeButtons.tsx","../src/DecisionPanel/components/ChecksDriveDecision.tsx","../src/DecisionPanel/components/ChooseThenSubmitDecision.tsx","../src/DecisionPanel/components/StickyBarDecision.tsx","../src/DecisionPanel/components/SubmitError.tsx","../src/DecisionPanel/hooks/useDecisionPanel.ts","../src/DecisionPanel/DecisionPanel.tsx","../src/PasswordField/PasswordRulesDisplay.ts","../src/PasswordField/RuleTone.ts","../src/PasswordField/RuleMark.tsx","../src/PasswordField/RuleVariants.tsx","../src/PasswordField/PasswordRules.tsx","../src/PasswordField/RevealToggle.tsx","../src/PasswordField/ruleAnnouncement.ts","../src/PasswordField/usePasswordRuleAnnouncement.ts","../src/PasswordField/useRuleColors.ts","../src/PasswordField/PasswordField.tsx"],"names":["React","IS_WEB","Platform","StyleSheet","jsxs","jsx","Text","styles","View","field","useUi","useWindowDimensions","Fragment","Button","Z_INDEX","MENU_TOP_GAP","rect","useEffect","useState","useMemo","ThemedTextInput","useCallback","useRef","ChipLabelWrap","MIN_TARGET_PX","Pressable","HEX_SHORT_LENGTH","HEX_RADIX","withAlpha","MIN_TOUCH_TARGET_PX","toggle","DESCRIPTION_FONT_SIZE","HINT_FONT_SIZE","BOX_RADIUS","CHEVRON_DOWN","CHEVRON_UP","CLOSE_DELAY_MS","FORWARD","BACKWARD","TextInput","useAnchorRect","DropdownPlacement","Modal","Animated","PAD","MONDAY","parts","numbers","DateDisplay","SUNDAY","DAYS_IN_WEEK","MONTHS_IN_YEAR","BOLD","selection","FONT","FALLBACK","GAP","IconButton","EPOCH","REGULAR","ROW_GAP","INPUT_FONT","useFocusRing","SelectSurface","OPTION_FONT","DETAIL_FONT","OptionRow","ROW_PAD_H","SHEET_MAX_HEIGHT","ScrollView","KEY_ESCAPE","FlagShapeKind","HALF","cross","circle","NO_COUNTRY","INPUT_PAD_V","IbanRejection","COUNTRY_LENGTH","CODE_A","verdict","BicRejection","BIC8_LENGTH","BIC11_LENGTH","ALPHANUMERIC","refused","TEXT_SIZE","TEXT_LINE","PAD_H","PAD_V","RADIUS","TITLE_SIZE","PasswordRulesDisplay","RuleTone","CHECK_SIZE","SvgIcon","CHIP_PAD_V","CHIP_PAD_H","CHIP_BORDER","PasswordField"],"mappings":";;;;;;;;;;;;;AAkEO,SAAS,eAAA,CACd,KAAA,EACA,WAAA,EACA,aAAA,EACiB;AACjB,EAAA,IAAI,CAACA,QAAM,cAAA,CAAe,KAAK,KAAK,KAAA,CAAM,IAAA,KAASA,QAAM,QAAA,EAAU;AACjE,IAAA,OAAO,EAAE,MAAM,KAAA,EAAM;AAAA,EACvB;AAEA,EAAA,MAAM,QAAQ,KAAA,CAAM,KAAA;AACpB,EAAA,MAAM,QAAA,GAAW,KAAA,CAAM,EAAA,IAAM,KAAA,CAAM,QAAA;AACnC,EAAA,MAAM,OAAA,GAAU,KAAA;AAIhB,EAAA,MAAM,SAAA,GAAY,QAAA,KAAa,MAAA,IAAa,QAAA,KAAa,KAAK,QAAA,GAAW,WAAA;AACzE,EAAA,MAAM,QAAA,GAA8B,EAAE,EAAA,EAAI,SAAA,EAAU;AAEpD,EAAA,IAAI,aAAA,KAAkB,MAAA,IAAa,KAAA,CAAM,aAAA,KAAkB,MAAA,EAAW;AACpE,IAAA,QAAA,CAAS,aAAA,GAAgB,aAAA;AAAA,EAC3B;AAEA,EAAA,OAAO,EAAE,IAAA,EAAMA,OAAA,CAAM,aAAa,OAAA,EAAS,QAAQ,GAAG,SAAA,EAAU;AAClE;AC1DA,IAAM,MAAA,GAAS,SAAS,EAAA,KAAO,KAAA;AAS/B,SAAS,gBAAgB,IAAA,EAAsC;AAC7D,EAAA,OACE,OAAO,IAAA,KAAS,QAAA,IAChB,SAAS,IAAA,IACT,OAAQ,KAAuB,YAAA,KAAiB,UAAA;AAEpD;AAuBO,SAAS,WAAW,SAAA,EAA8C;AACvE,EAAA,MAAM,GA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ACH;AAAA,KAAA,EACF,CAAA,GACE;AAAA,GAAA,EACN,CAAA,EAEJ,CAAA;AAEJ,CAAC","file":"index.mjs","sourcesContent":["/**\n * Give a `Field`'s plain-node child the `id` its `<label for>` points at.\n *\n * ## Why cloning rather than asking the caller\n *\n * `Field`'s documented, overwhelmingly common shape is a plain child:\n *\n * ```tsx\n * <Field label={FM('guides.titleLabel')}>\n * <ThemedTextInput … />\n * </Field>\n * ```\n *\n * There is no seam in that shape to hand an id through — which is exactly why label association\n * was never wired and why a live audit found 0 controls with an `id` across an entire CMS page.\n * The alternatives were worse: making every call site switch to the render-function form is a\n * fleet-wide migration that fails open (any missed call site silently keeps the old behaviour),\n * and wrapping the control inside the `<label>` element for implicit association breaks down on\n * the controls that are not native form elements — a `SelectControl` trigger is a\n * `<div role=\"button\">`, and nesting it in a `<label>` invites a double-fire on click.\n *\n * So the id is injected here, one level deep, and only when it is safe to do so.\n *\n * ## What \"safe\" means\n *\n * - Only a single valid element is touched. Arrays, strings and `null` are returned untouched,\n * because there is no unambiguous \"the control\" to point a label at. A **fragment** is excluded\n * explicitly: `React.isValidElement` says yes to one, but a fragment accepts no props beyond\n * `key`, so cloning an `id` onto it both warns in development and attaches nothing.\n * - A child that already carries an `id` keeps it. The caller was explicit; a label that silently\n * retargets someone else's id is worse than no label.\n * - The returned `controlId` is what the label should actually use: `undefined` when nothing was\n * attached, so `FieldLabel` emits no dangling `htmlFor` pointing at an element that does not\n * exist. A `<label for>` aimed at nothing is not a smaller bug than no label — it is a lie that\n * passes a \"has a label\" check.\n */\nimport React from 'react';\n\n/** Props any RN component may carry that we read or write here. `id` is RN ≥0.71 → DOM `id`. */\ninterface IdentifiableProps {\n id?: string;\n nativeID?: string;\n /** The kit's own contract for `aria-describedby`, honoured by `ThemedTextInput`/`ChipSelector`. */\n describedById?: string;\n}\n\nexport interface AttachedControl {\n /** The child, cloned with the field wiring when it could be attached; otherwise the original. */\n node: React.ReactNode;\n /** The id the label should target, or `undefined` when nothing could safely receive one. */\n controlId?: string;\n}\n\n/**\n * Returns the child wired to its `Field`, plus the id the label should point at.\n *\n * `candidateId` is only USED when it can be attached — the caller must not assume it was.\n *\n * `describedById` is injected too, under the kit's own `describedById` prop name, so the hint and\n * error lines are announced by a plain child exactly as they are by a render-function child. That\n * they were NOT was a real gap: a YouTube field made read-only with an on-screen sentence saying\n * why gave a screen-reader user the read-only state and none of the explanation.\n *\n * A child that is not a kit control simply ignores the prop; if it needs different wiring, use\n * the render-function form, which hands over the ids and lets the caller place them.\n */\nexport function attachControlId(\n child: React.ReactNode,\n candidateId: string,\n describedById?: string,\n): AttachedControl {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n return { node: child };\n }\n\n const props = child.props as IdentifiableProps;\n const existing = props.id ?? props.nativeID;\n const element = child as React.ReactElement<IdentifiableProps>;\n\n // An explicit id from the caller is never overwritten — but the description wiring still goes\n // on, because that is the field's to give and the caller expressed no opinion about it.\n const controlId = existing !== undefined && existing !== '' ? existing : candidateId;\n const injected: IdentifiableProps = { id: controlId };\n\n if (describedById !== undefined && props.describedById === undefined) {\n injected.describedById = describedById;\n }\n\n return { node: React.cloneElement(element, injected), controlId };\n}\n","/**\n * Put a real `for` attribute on a `<label>` rendered through react-native-web.\n *\n * ## Why this is imperative, which looks like a smell and is not\n *\n * The obvious implementation — pass `htmlFor` to `<Text role=\"label\">` — does not work, and\n * fails SILENTLY. react-native-web filters props through an allowlist (`forwardedProps`), and\n * `htmlFor` is not on it, so the prop is dropped somewhere between the component and the DOM\n * with no warning. This is the same family as the hint that never arrives: `accessibilityHint`\n * has no ARIA equivalent, so RN-web discards it, which is why this kit renders hints as\n * sr-only nodes instead of trusting the prop.\n *\n * That failure mode is the reason this is worth the imperative escape. A prop-level test\n * (`expect(label.props.htmlFor).toBe(id)`) passes against a build where the attribute never\n * reaches the browser. Setting it on the node and asserting `container.querySelector('label')\n * .getAttribute('for')` is the only version that can tell the difference.\n *\n * The alternatives were each worse:\n * - **Implicit association** (nesting the control inside the `<label>`) needs no attribute, but\n * changes the DOM structure of every field in seven portals, and a label wrapping a control\n * that turns out to be activatable is the classic double-fire bug.\n * - **Rendering the label as a raw DOM element** abandons the RN style pipeline, so the label\n * would need a second, hand-maintained styling path that could drift from every other label.\n *\n * Native is a no-op: there is no `<label>` and no DOM, and the association there is already\n * carried by the control's `accessibilityLabel`.\n */\nimport { useEffect, useRef } from 'react';\n\nimport { Platform } from 'react-native';\n\nconst IS_WEB = Platform.OS === 'web';\n\n/** The sliver of the DOM this touches — no `any`, no global DOM lib dependency. */\ninterface AttributeHost {\n setAttribute: (name: string, value: string) => void;\n removeAttribute: (name: string) => void;\n ownerDocument?: { getElementById: (id: string) => unknown } | null;\n}\n\nfunction isAttributeHost(node: unknown): node is AttributeHost {\n return (\n typeof node === 'object' &&\n node !== null &&\n typeof (node as AttributeHost).setAttribute === 'function'\n );\n}\n\n/**\n * Returns a ref to attach to the label element. The `for` attribute is set only when the target\n * it names is genuinely in the document.\n *\n * ## Why the existence check is not paranoia\n *\n * `Field` cannot know whether a render-function child actually placed the id it was handed. The\n * difficulty dropdown is the case that proved it: `SelectControl` is a `<div role=\"button\">` and\n * associates itself the other way round, via `aria-labelledby`, so nothing ever received\n * `controlId` — and the label emitted `for=\"field-control-3\"` pointing at nothing. Measured on a\n * real page, that produced a label that LOOKED correct in every audit (`<label>`: yes, `for`:\n * yes) and focused nothing when clicked.\n *\n * Trusting the caller here means the guarantee holds only as long as every call site remembers.\n * Checking the document makes it hold by construction, for both the injected and the\n * render-function paths, without either having to declare which one it is.\n *\n * It runs in an effect rather than in the ref callback because the check needs the whole\n * committed tree present — the control is a LATER sibling than its label, so at ref time the\n * answer would depend on commit ordering rather than on the truth.\n */\nexport function useHtmlFor(controlId?: string): React.RefObject<unknown> {\n const ref = useRef<unknown>(null);\n\n useEffect(() => {\n const node = ref.current;\n\n if (!IS_WEB || !isAttributeHost(node)) return;\n\n const target = controlId !== undefined && controlId !== '' ? node.ownerDocument?.getElementById(controlId) : null;\n\n // No target, or a target that is not in the document: emit nothing. A `for` pointing at a\n // missing element passes every \"does this page have labels?\" check while doing nothing.\n if (target === null || target === undefined) {\n node.removeAttribute('for');\n return;\n }\n\n node.setAttribute('for', controlId as string);\n }, [controlId]);\n\n return ref;\n}\n","/**\n * `FieldLabel` — the label row of a `Field`: the label text plus at most one marker.\n *\n * Split out of `Field` so the marker rules and the two label voices stay readable, and so `Field`\n * itself remains an orchestrator small enough to review.\n *\n * ## Why this is a real `<label>` on web\n *\n * It used to render a plain `<Text>`, i.e. a `<div>`. Controls still ANNOUNCED correctly, because\n * every one of them carries an `accessibilityLabel` → `aria-label`, so an audit of screen-reader\n * naming came back clean and the gap looked like it did not exist. What was missing was the other\n * half of a label: **clicking the words did not focus the field**. A page measured live had 0\n * `<label>` elements, 0 `label[for]` and 0 controls with an `id` — every field silently throwing\n * away a free doubling of its own hit area, on top of already being under the target-size floor.\n *\n * `role=\"label\"` is react-native-web's documented escape to a real `<label>` element (it is\n * special-cased ahead of the ARIA role map, since `label` is not an ARIA role). The `for`\n * attribute is set on the node itself — see `useHtmlFor` for why the obvious `htmlFor` prop is\n * silently discarded. On native both are inert: RN has no `<label>`, and the association there\n * is already carried by `accessibilityLabel`.\n *\n * The control keeps its `aria-label`, which still WINS for the accessible name — so this adds\n * click-to-focus without changing a single screen-reader announcement.\n */\nimport React from 'react';\n\nimport { Platform, Text, type StyleProp, type TextProps, type TextStyle } from 'react-native';\n\nimport { useHtmlFor } from './useHtmlFor';\n\nimport type { FieldMarker } from './fieldMarkers';\n\nconst IS_WEB = Platform.OS === 'web';\n\n/**\n * `label` is not an ARIA role, so RN's `role` union does not admit it; react-native-web\n * special-cases it into a real `<label>` element. Cast at the spread site through the host's own\n * props rather than through `any`.\n */\ninterface WebLabelProps {\n role?: 'label';\n}\n\nexport interface FieldLabelProps {\n label: string;\n marker: FieldMarker;\n /** Pre-localized text for the optional marker. Ignored unless `marker` is `optional`. */\n optionalLabel: string;\n /**\n * `id` of the control this label names. Emits `<label for>` on web so clicking the label text\n * focuses the field. Omitted when the field wraps a control that cannot be labelled that way\n * (a `<div role=\"button\">` select trigger), which uses `aria-labelledby` instead.\n */\n controlId?: string;\n /** `id` given to the label element itself, so a non-labelable control can point back at it. */\n labelId?: string;\n /** Composed style chain: base → variant → caller's `labelStyle` (applied last). */\n style: StyleProp<TextStyle>;\n requiredMarkStyle: StyleProp<TextStyle>;\n optionalMarkStyle: StyleProp<TextStyle>;\n}\n\nexport function FieldLabel({\n label,\n marker,\n optionalLabel,\n controlId,\n labelId,\n style,\n requiredMarkStyle,\n optionalMarkStyle,\n}: FieldLabelProps): React.ReactElement {\n const webProps = (IS_WEB ? { role: 'label' } : {}) as WebLabelProps as TextProps;\n const labelRef = useHtmlFor(controlId);\n\n return (\n <Text id={labelId} ref={labelRef as React.Ref<Text>} style={style} {...webProps}>\n {label}{' '}\n {marker === 'required' ? (\n // The asterisk is decorative — the control's `aria-required` conveys \"required\" to\n // assistive tech, so a screen reader says \"required\" instead of \"star\".\n <Text aria-hidden accessibilityElementsHidden importantForAccessibility=\"no\" style={requiredMarkStyle}>\n *\n </Text>\n ) : null}\n {marker === 'optional' && optionalLabel !== '' ? (\n // Also decorative: \"optional\" is the ABSENCE of `aria-required`, which assistive tech\n // already conveys. Rendering it to a screen reader would double-announce the same fact.\n <Text aria-hidden accessibilityElementsHidden importantForAccessibility=\"no\" style={optionalMarkStyle}>\n {optionalLabel}\n </Text>\n ) : null}\n </Text>\n );\n}\n\nexport default FieldLabel;\n","/**\n * Required / optional markers, per the shared forms contract\n * (`…/wwwroot/shared/FORMS.md` → \"Required and optional markers\").\n *\n * The contract says the two markers are MUTUALLY EXCLUSIVE — a field is required or optional, never\n * annotated as both — and that you mark the MINORITY: on a mostly-required form mark the optional\n * fields, on a mostly-optional form mark the required ones. Asterisking twelve of thirteen fields\n * is noise that trains the eye to ignore the marker.\n *\n * Exclusivity is enforced here rather than in the type system so that a caller spreading a props\n * object (`<Field {...fieldProps} />`, where both flags may be computed) still gets a defined,\n * single-marker result instead of a compile error it cannot act on.\n *\n * Precedence when a caller asks for BOTH: `required` wins. That is the safe failure direction —\n * showing \"optional\" on a field the server will reject sends the user into a failed submit, while\n * showing \"required\" on a genuinely optional field costs, at worst, an unnecessary keystroke.\n */\n\n/** Which marker a field label carries. Exactly one, never both. */\nexport type FieldMarker = 'none' | 'required' | 'optional';\n\n/**\n * The English fallback for the optional marker's text.\n *\n * `@dloizides/ui-forms` contains NO i18n runtime by design — aml-v2 uses `@dloizides/i18n` with\n * positional `{0}` params while the other six apps use i18next `{{p1}}`, and nothing bridges them,\n * so all user-visible copy arrives as pre-localized props. This constant exists ONLY so a\n * single-locale app can adopt `optional` in one line. It is exported precisely so it is greppable:\n * **a localized app MUST pass `optionalLabel`.** The required marker needs no such escape — `*` is\n * a glyph, not copy.\n */\nexport const DEFAULT_OPTIONAL_LABEL = '(optional)';\n\n/**\n * Resolve the two boolean flags to the single marker actually rendered.\n * `required` beats `optional`; neither flag yields `none`.\n */\nexport function resolveFieldMarker(required: boolean, optional: boolean): FieldMarker {\n if (required) return 'required';\n if (optional) return 'optional';\n return 'none';\n}\n","/**\n * `Field`'s TWO spacing models — the F3 fix, shipped as an OPT-IN rather than a breaking change.\n *\n * ## The defect\n *\n * `Field` hard-coded a 16px bottom margin on its container and 4px margins on its label / hint /\n * error. That is the pre-flexbox model: the CHILD owns the space after itself. In a `gap`-laid-out\n * parent — which is how every modern form row in this fleet is written — the child's margin STACKS\n * on the parent's gap, so the consumer has to cancel it by hand. aml-v2 alone carries 13\n * `marginBottom: 0` cancels, each with an apologetic comment; the fleet carries 16.\n *\n * AML v1 got this right in CSS: `.ui-field { display: flex; flex-direction: column; gap: 6px; }` —\n * internal gap only, and the parent grid owns the space BETWEEN fields. That contract is written up\n * in `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md` (\"The gap is owned by the container,\n * never by margins on the children\").\n *\n * ## Why opt-in and not a 2.0.0\n *\n * Switching every `Field` to the gap model at once moves pixels on every form in seven portals in a\n * single publish — which is exactly the change you cannot visually QA, because there is no app you\n * can look at that is still on the old behaviour to compare against. The two models are therefore\n * both implemented, selected per field:\n *\n * - `stack` (DEFAULT) — the historical margins, byte-identical to 1.8.0. Every existing consumer\n * is untouched, including the 16 that currently cancel the margin.\n * - `gap` — the FORMS.md contract: no bottom margin at all, uniform 6px internal gap. The parent\n * owns the rhythm.\n *\n * A `Field` inside a `FormGrid` resolves to `gap` automatically, so adopting the shared grid IS the\n * opt-in — the consumer deletes its hand-rolled `grid`/`field` styles and its margin cancel in the\n * same edit, and the fleet migrates one app at a time behind visual QA.\n */\nimport { StyleSheet, type TextStyle, type ViewStyle } from 'react-native';\n\n/**\n * Which spacing model a field speaks.\n *\n * A plain string union rather than a `const enum` for the same reason as `FieldLabelVariant`: this\n * type crosses the package boundary into consumers' `.d.ts`, and a cross-boundary `const enum`\n * breaks `isolatedModules` / Babel-only builds.\n */\nexport type FieldSpacing = 'stack' | 'gap';\n\n/** The historical bottom margin of a whole field block. Load-bearing for every un-migrated form. */\nexport const FIELD_STACK_MARGIN_BOTTOM = 16;\n/** The historical label→control margin. */\nexport const FIELD_STACK_LABEL_MARGIN_BOTTOM = 4;\n/** The historical control→hint and hint→error margin. */\nexport const FIELD_STACK_CHILD_MARGIN_TOP = 4;\n/** FORMS.md: one uniform gap between label, control, hint and error. Not four separate margins. */\nexport const FIELD_CONTRACT_GAP = 6;\n\nexport const fieldSpacingStyles = StyleSheet.create({\n stackContainer: { marginBottom: FIELD_STACK_MARGIN_BOTTOM },\n stackLabel: { marginBottom: FIELD_STACK_LABEL_MARGIN_BOTTOM },\n stackChild: { marginTop: FIELD_STACK_CHILD_MARGIN_TOP },\n /**\n * The gap model sets NO margins — not even zeroed ones. An explicit `marginBottom: 0` here would\n * defeat a caller who legitimately wants to push one field down via `containerStyle`, because\n * `containerStyle` composes AFTER this and a zero is indistinguishable from \"unset\" to a reader.\n */\n gapContainer: { gap: FIELD_CONTRACT_GAP },\n none: {},\n});\n\n/** The style pieces a field applies for one spacing model. */\nexport interface FieldSpacingStyles {\n container: ViewStyle;\n label: TextStyle;\n /** Applied to the hint AND the error — the two lines that sit under the control. */\n child: TextStyle;\n}\n\n/**\n * Resolve the caller's explicit choice against the surrounding grid.\n *\n * Precedence, and why: an EXPLICIT `spacing` prop always wins, so a consumer inside a `FormGrid`\n * that genuinely needs the old margin (a one-off cell that stacks two fields) can say so without\n * leaving the grid. Absent that, a grid means the grid's `gap` owns the rhythm. Absent both, the\n * historical model — the answer that changes nothing.\n */\nexport function resolveFieldSpacing(explicit: FieldSpacing | undefined, insideGrid: boolean): FieldSpacing {\n if (explicit !== undefined) return explicit;\n\n return insideGrid ? 'gap' : 'stack';\n}\n\n/**\n * The style pieces for a resolved model.\n *\n * Exported and pure so `Field` and `ChipSelector` can be proven to resolve IDENTICALLY. They drifted\n * once already — `ChipSelector` grew a `marginBottom: -8` whose comment blamed `Field`'s 16px — and a\n * shared pure function is what makes \"they agree\" a testable claim rather than a convention.\n */\nexport function fieldSpacingStyleSet(spacing: FieldSpacing): FieldSpacingStyles {\n if (spacing === 'gap') {\n return {\n container: fieldSpacingStyles.gapContainer,\n label: fieldSpacingStyles.none,\n child: fieldSpacingStyles.none,\n };\n }\n\n return {\n container: fieldSpacingStyles.stackContainer,\n label: fieldSpacingStyles.stackLabel,\n child: fieldSpacingStyles.stackChild,\n };\n}\n","/**\n * The TWO legitimate label voices, per the shared forms contract\n * (`PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md` → \"The TWO legitimate label voices\").\n *\n * - `field` — 13 / 600 / sentence case. A label that is READ: prose addressed to the person\n * filling the form. This is `Field`'s historical, unchanged default, so every\n * existing consumer renders byte-identically.\n * - `control` — 11 / 700 / UPPERCASE + letter-spacing. A label that is SCANNED: a key over a value\n * in a dense row (filter bars, compact toolbars, pager controls). These are exactly\n * the metrics `@dloizides/ui-tables` forked into its private `FieldShell` because\n * `Field` hard-coded the `field` voice and offered no way out.\n *\n * Pick the voice from the SURFACE, not the component: every label on one surface uses one voice,\n * and voices are never mixed within a single row.\n *\n * Why a plain string union and not a `const enum`: this type crosses the package boundary into\n * consumers' `.d.ts`, and a cross-boundary `const enum` breaks `isolatedModules` / Babel-only\n * builds. `@dloizides/ui-buttons` sets the same precedent for `ButtonVariant` for the same reason.\n */\nimport { StyleSheet, type TextStyle } from 'react-native';\n\n/** Which of the two contract voices a field label speaks. */\nexport type FieldLabelVariant = 'field' | 'control' | 'caption';\n\n/** The historical `Field` label metrics. Changing these moves pixels in every consumer. */\nconst FIELD_FONT_SIZE = 13;\nconst FIELD_FONT_WEIGHT = '600';\n\n/** The dense-control metrics, taken verbatim from `ui-tables`' `FieldShell` fork so it can retire. */\nconst CONTROL_FONT_SIZE = 11;\nconst CONTROL_FONT_WEIGHT = '700';\nconst CONTROL_LETTER_SPACING = 0.4;\n\nconst CAPTION_FONT_SIZE = 12;\nconst CAPTION_FONT_WEIGHT = '600';\n\nexport const labelVariantStyles = StyleSheet.create({\n field: {\n fontSize: FIELD_FONT_SIZE,\n fontWeight: FIELD_FONT_WEIGHT,\n },\n control: {\n fontSize: CONTROL_FONT_SIZE,\n fontWeight: CONTROL_FONT_WEIGHT,\n letterSpacing: CONTROL_LETTER_SPACING,\n textTransform: 'uppercase',\n },\n caption: {\n fontSize: CAPTION_FONT_SIZE,\n fontWeight: CAPTION_FONT_WEIGHT,\n letterSpacing: CONTROL_LETTER_SPACING,\n textTransform: 'uppercase',\n },\n});\n\n/**\n * Resolve a variant name to its style. An unknown/absent variant falls back to `field` — the\n * historical default — so a bad value degrades to \"unchanged\" rather than to \"unstyled\".\n */\nexport function resolveLabelVariantStyle(variant?: FieldLabelVariant): TextStyle {\n return labelVariantStyles[variant ?? 'field'] ?? labelVariantStyles.field;\n}\n","/**\n * The two contexts the layout primitives publish.\n *\n * They are SEPARATE on purpose, because they answer different questions and have different scopes:\n *\n * - `FormGridContext` carries a row's CELL METRICS, so `FormCell` can be written `<FormCell>` at\n * the overwhelmingly common call site and still get the row's `minWidth` / `flexBasis` — the four\n * constants (200 / 220 / 240 / 260) that the fleet re-declares by hand.\n * - `GapOwnedContext` says only \"the vertical rhythm here is owned by a parent's `gap`\". A `Field`\n * that sees it drops its own 16px bottom margin, which is the whole point of F3.\n *\n * Merging them would force `FormSection` — which also spaces with `gap`, and would otherwise\n * recreate the identical double-spacing bug one level up — to publish cell metrics it has no\n * business having. A section is not a row: a `Field` directly inside a section should be full width,\n * not 260px wide.\n *\n * Nothing about gap-ownership is inferable at runtime — RN's `StyleSheet` gives a child no way to\n * ask \"does my parent space me with gap?\" — so it has to be declared. Making the declaration a side\n * effect of using the shared primitives means the correct thing happens without a second opt-in.\n */\nimport React from 'react';\n\n/** Cell metrics a `FormGrid` hands down to its `FormCell` children. */\nexport interface FormGridMetrics {\n /** Below this the cell stops shrinking and the row wraps. */\n minWidth: number;\n /** The cell's ideal width before grow/shrink — its `flexBasis`. */\n basis: number;\n}\n\n/** `null` outside a grid, so `FormCell` can fall back to the package defaults rather than throw. */\nconst FormGridContext = React.createContext<FormGridMetrics | null>(null);\n\n/**\n * `false` — the historical model — unless a primitive above says otherwise. The default is what\n * every un-migrated `Field` in the fleet reads, so it must be the answer that changes nothing.\n */\nconst GapOwnedContext = React.createContext(false);\n\nexport const FormGridProvider = FormGridContext.Provider;\nexport const GapOwnedProvider = GapOwnedContext.Provider;\n\n/** The enclosing grid's cell metrics, or `null` outside a `FormGrid`. */\nexport function useFormGridMetrics(): FormGridMetrics | null {\n return React.useContext(FormGridContext);\n}\n\n/** True when a parent primitive owns this subtree's vertical rhythm with `gap`. */\nexport function useIsGapOwned(): boolean {\n return React.useContext(GapOwnedContext);\n}\n","import { readableScaleInk } from '@dloizides/design-tokens';\n\nimport type { UiTheme } from '@dloizides/ui-feedback';\n\nconst ERROR_LIGHT_STEPS = ['500', '600', '700'];\nconst ERROR_DARK_STEPS = ['300', '200', '400', '100', '500'];\n\ntype ThemeWithSemanticText = UiTheme & { semanticText?: { error?: string } };\n\n/** The error ink for helper text and borders: the theme's error text colour, else the error step that clears 4.5:1 on the surface. */\nexport function fieldErrorInk(theme: ThemeWithSemanticText): string {\n return theme.semanticText?.error ?? readableScaleInk({ ...theme.semantic.error }, theme.colors.surface, ERROR_LIGHT_STEPS, ERROR_DARK_STEPS);\n}\n","/**\n * Field — the generic \"label over a control, hint + error under it\" wrapper.\n *\n * `FormField` is hard-wired to a text input, so any NON-text control (a dropdown, a date picker,\n * a chip selector) had no shared way to get a label — and ended up visually misaligned next to\n * its `FormField` siblings: its box started a label-row higher, and it missed the container's\n * bottom margin so wrapped rows lost their vertical rhythm.\n *\n * `Field` is that label row + spacing, control-agnostic. Its metrics are the single source of\n * truth: `FormField` composes `Field` internally, so the two can never drift apart.\n *\n * Children may be a plain node (the common case — just wrap your control) or a render function\n * receiving `{ describedById, hasError }`, so a custom control can wire the hint AND error lines\n * into its own `aria-describedby` / invalid state exactly the way `FormField` does.\n *\n * The anatomy (label → control → hint → error), the two label voices, the mutually-exclusive\n * required/optional markers and the collapsing error slot all implement the shared cross-stack\n * contract in `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, Text, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { attachControlId } from './attachControlId';\nimport { FieldLabel } from './FieldLabel';\nimport { DEFAULT_OPTIONAL_LABEL, resolveFieldMarker } from './fieldMarkers';\nimport { fieldSpacingStyleSet, resolveFieldSpacing, type FieldSpacing } from './fieldSpacing';\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from './labelVariants';\nimport { useIsGapOwned } from '../FormGrid/formGridContext';\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\nconst ERROR_FONT_SIZE = 12;\nconst HINT_FONT_SIZE = 12;\n/** The optional marker drops to normal weight so it reads as an aside inside a 600 label. */\nconst OPTIONAL_MARK_FONT_WEIGHT = '400';\n\n/**\n * The metrics that do NOT depend on the spacing model. Everything positional — the container's\n * bottom margin, the label's bottom margin, the hint/error top margins — moved to `fieldSpacing`,\n * because those are exactly the values the two models disagree about.\n */\nconst styles = StyleSheet.create({\n hintText: {\n fontSize: HINT_FONT_SIZE,\n },\n errorText: {\n fontSize: ERROR_FONT_SIZE,\n },\n optionalMark: {\n fontWeight: OPTIONAL_MARK_FONT_WEIGHT,\n },\n});\n\ninterface ThemeStyles {\n label: TextStyle;\n requiredMark: TextStyle;\n optionalMark: TextStyle;\n hintText: TextStyle;\n errorText: TextStyle;\n}\n\n/** What a render-function child receives, so it can mirror `FormField`'s error wiring. */\nexport interface FieldChildContext {\n /**\n * Space-separated ids of the lines describing this control — the hint, the error, or both, in\n * reading order. `undefined` when there is neither. Assign straight to `aria-describedby`.\n */\n describedById?: string;\n hasError: boolean;\n /**\n * `id` this field's `<label for>` points at. Assign it to the control (RN `id` → DOM `id`) and\n * clicking the label text focuses the control — a free doubling of the hit area that every\n * field was throwing away.\n *\n * A plain-node child gets this injected automatically (see below); a render-function child has\n * to place it, because only the caller knows which element inside is the actual control.\n */\n controlId: string;\n /**\n * `id` OF the label element. For a control that `<label for>` cannot address — anything that is\n * not a native form element, e.g. the `<div role=\"button\">` a `SelectControl` trigger renders —\n * point `aria-labelledby` here instead.\n */\n labelId: string;\n}\n\nexport type FieldChildren = React.ReactNode | ((context: FieldChildContext) => React.ReactNode);\n\nexport interface FieldProps {\n /**\n * Label shown above the control. Optional so a control whose label is supplied elsewhere (or\n * which genuinely has none) can still use the shared shell for its error line + spacing: an\n * absent or empty label renders NO label row at all, rather than an empty one that would add a\n * phantom gap and misalign the control against its labelled siblings.\n */\n label?: string;\n children: FieldChildren;\n required?: boolean;\n /**\n * Marks the field explicitly optional. MUTUALLY EXCLUSIVE with `required` — if both are set,\n * `required` wins (the safe direction: an under-marked required field causes a failed submit).\n * Use it to mark the MINORITY: on a mostly-required form, marking the two optional fields is far\n * less noise than asterisking the other eleven.\n */\n optional?: boolean;\n /**\n * Pre-localized text for the optional marker. Defaults to the English `DEFAULT_OPTIONAL_LABEL`\n * so a single-locale app can adopt `optional` in one line; a localized app MUST pass this.\n */\n optionalLabel?: string;\n /**\n * Help line rendered UNDER the control and ABOVE the error — the sentence that stops the user\n * guessing. It coexists with `error` (the hint states the rule, the error says which rule was\n * broken) and both are reachable from the control via `aria-describedby`.\n *\n * Rendering a hint INSIDE the field is the point: as an outside sibling it lands past the\n * container's 16px bottom margin and detaches from the control it explains.\n */\n hint?: string;\n error?: string;\n /**\n * Which of the two contract label voices to speak: `field` (13/600 sentence case — the default,\n * unchanged) or `control` (11/700 uppercase — dense filter bars and toolbars).\n */\n labelVariant?: FieldLabelVariant;\n /**\n * Escape hatch applied AFTER `labelVariant`, for the genuine one-off a variant does not cover.\n * Prefer `labelVariant`: it is the reviewable, named choice, and a bare `labelStyle` is the thing\n * to grep for when auditing label drift.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * `StyleProp` (not a bare `ViewStyle`) so a caller can compose an array — e.g. a base field style\n * plus a `grow` modifier — instead of having to restate a COMPLETE style per variant.\n */\n containerStyle?: StyleProp<ViewStyle>;\n /**\n * Which of the two spacing models this field speaks — see `fieldSpacing.ts`.\n *\n * Leave it unset. Inside a `FormGrid` or `FormSection` it resolves to `gap` (the FORMS.md\n * contract: no bottom margin, the parent's `gap` owns the rhythm); anywhere else it resolves to\n * `stack` (the historical 16px margin, byte-identical to 1.8.0). Set it explicitly only to\n * override that — e.g. a cell inside a grid that genuinely stacks two fields wants `stack`.\n */\n spacing?: FieldSpacing;\n testID?: string;\n}\n\nlet fieldSeq = 0;\n/**\n * Stable-per-instance ids so the label, hint and error lines can be linked to the control via\n * `htmlFor` / `aria-labelledby` / `aria-describedby`. One counter bump per field keeps every id\n * of a field in lockstep.\n */\nexport function useFieldIds(): { hintId: string; errorId: string; controlId: string; labelId: string } {\n const [ids] = React.useState(() => {\n fieldSeq += 1;\n const seq = String(fieldSeq);\n return {\n hintId: `field-hint-${seq}`,\n errorId: `field-error-${seq}`,\n controlId: `field-control-${seq}`,\n labelId: `field-label-${seq}`,\n };\n });\n return ids;\n}\n\n/** Stable-per-instance id so the error line can be linked to the control via aria-describedby. */\nexport function useFieldErrorId(): string {\n return useFieldIds().errorId;\n}\n\n/** True only for a present, non-empty string. */\nfunction isPresent(value?: string): boolean {\n return typeof value === 'string' && value !== '';\n}\n\n/** True only for a present, non-empty error string. */\nexport function hasFieldError(error?: string): boolean {\n return isPresent(error);\n}\n\n/**\n * Join the ids of the lines describing the control, in reading order (hint then error), skipping\n * any that is not rendered. `undefined` — not `''` — when there is nothing, so the attribute is\n * omitted entirely rather than emitted empty.\n */\nexport function joinDescribedBy(hintId?: string, errorId?: string): string | undefined {\n const ids = [hintId, errorId].filter((id): id is string => isPresent(id));\n return ids.length > 0 ? ids.join(' ') : undefined;\n}\n\nexport const Field = ({\n label,\n children,\n required = false,\n optional = false,\n optionalLabel = DEFAULT_OPTIONAL_LABEL,\n hint,\n error,\n labelVariant,\n labelStyle,\n containerStyle,\n spacing,\n testID,\n}: FieldProps): React.ReactElement => {\n const { theme } = useUi();\n const gapOwned = useIsGapOwned();\n const spacingStyles = fieldSpacingStyleSet(resolveFieldSpacing(spacing, gapOwned));\n const { colors } = theme;\n const errorColor = fieldErrorInk(theme);\n const hasError = hasFieldError(error);\n const hasHint = isPresent(hint);\n const labelText = label ?? '';\n const hasLabel = labelText !== '';\n const marker = resolveFieldMarker(required, optional);\n const { hintId, errorId, controlId, labelId } = useFieldIds();\n\n const themeStyles = React.useMemo<ThemeStyles>(\n () => ({\n label: { color: colors.textSecondary },\n requiredMark: { color: errorColor },\n // The optional marker is an aside, so it sits a step back from the label's own ink.\n optionalMark: { color: colors.textSecondary },\n hintText: { color: colors.textSecondary },\n errorText: { color: errorColor },\n }),\n [colors.textSecondary, errorColor],\n );\n\n const describedById = joinDescribedBy(hasHint ? hintId : undefined, hasError ? errorId : undefined);\n\n // A render-function child places `controlId` itself, so the label always targets it. A plain\n // node has the id injected — and `attachControlId` reports back whether that was possible, so\n // the label never emits an `htmlFor` pointing at an element that does not exist.\n const isRenderChild = typeof children === 'function';\n const attached = isRenderChild\n ? { node: children({ describedById, hasError, controlId, labelId }), controlId }\n : attachControlId(children, controlId, describedById);\n const control = attached.node;\n\n return (\n <View style={[spacingStyles.container, containerStyle]} testID={testID}>\n {hasLabel ? (\n <FieldLabel\n controlId={attached.controlId}\n label={labelText}\n labelId={labelId}\n marker={marker}\n optionalLabel={optionalLabel}\n optionalMarkStyle={[styles.optionalMark, themeStyles.optionalMark]}\n requiredMarkStyle={themeStyles.requiredMark}\n style={[spacingStyles.label, resolveLabelVariantStyle(labelVariant), themeStyles.label, labelStyle]}\n />\n ) : null}\n {control}\n {hasHint ? (\n <Text nativeID={hintId} style={[styles.hintText, spacingStyles.child, themeStyles.hintText]}>\n {hint}\n </Text>\n ) : null}\n {hasError ? (\n <Text nativeID={errorId} role=\"alert\" style={[styles.errorText, spacingStyles.child, themeStyles.errorText]}>\n {error}\n </Text>\n ) : null}\n </View>\n );\n};\n\nexport default Field;\n","/**\n * `FormGrid` — the wrapping form row, extracted from ~177 hand-rolled copies.\n *\n * Verbatim in every portal, differing only in one constant:\n *\n * ```ts\n * grid: { flexDirection: 'row', flexWrap: 'wrap', gap: 12 },\n * field: { minWidth: 220, flexGrow: 1, flexBasis: 260 }, // or 200/240/260\n * ```\n *\n * Extracting it is worth more than the deleted lines: because the grid declares itself through\n * `FormGridContext`, a `Field` inside it knows its vertical rhythm is owned by the grid's `gap` and\n * drops its own bottom margin. That kills the fleet's 16 `marginBottom: 0` cancel hacks at the same\n * time — the grid and the cancel were always two halves of one bug.\n *\n * The cell metrics live on the GRID, not on each cell, because that is how the real call sites are\n * written: one `styles.field` reused by every cell in the row, with the occasional narrow one-off.\n * `<FormCell>` with no props is therefore the common case, and `<FormCell basis={160} grow={false}>`\n * the exception — which is exactly the ratio in aml-v2's `ScreeningForm`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { FormGridProvider, GapOwnedProvider, type FormGridMetrics } from './formGridContext';\n\n/** The gap 24 of aml-v2's 41 wrapping rows already use. The de-facto fleet default. */\nexport const FORM_GRID_DEFAULT_GAP = 12;\n/** The most common `minWidth` across the fleet's copies (the others are 200 / 240 / 260). */\nexport const FORM_GRID_DEFAULT_MIN_WIDTH = 220;\n/** The most common `flexBasis` across the fleet's copies. */\nexport const FORM_GRID_DEFAULT_BASIS = 260;\n\nconst styles = StyleSheet.create({\n grid: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n});\n\nexport interface FormGridProps {\n children: React.ReactNode;\n /**\n * Space between cells, horizontally AND between wrapped rows. This is the value that makes the\n * grid own the vertical rhythm, so it is also what a descendant `Field` is dropping its own\n * margin in favour of.\n */\n gap?: number;\n /** Default `minWidth` for every `FormCell` in this grid. */\n minWidth?: number;\n /** Default `flexBasis` for every `FormCell` in this grid. */\n basis?: number;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormGrid = ({\n children,\n gap = FORM_GRID_DEFAULT_GAP,\n minWidth = FORM_GRID_DEFAULT_MIN_WIDTH,\n basis = FORM_GRID_DEFAULT_BASIS,\n style,\n testID,\n}: FormGridProps): React.ReactElement => {\n // Memoised on the two primitives, not the object literal: a fresh identity every render would\n // re-render every `Field` in the row on every keystroke in any one of them.\n const metrics = React.useMemo<FormGridMetrics>(() => ({ minWidth, basis }), [minWidth, basis]);\n\n return (\n <FormGridProvider value={metrics}>\n <GapOwnedProvider value>\n <View style={[styles.grid, { gap }, style]} testID={testID}>\n {children}\n </View>\n </GapOwnedProvider>\n </FormGridProvider>\n );\n};\n\nexport default FormGrid;\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { fieldSpacingStyleSet, resolveFieldSpacing, type FieldSpacing } from '../Field/fieldSpacing';\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from '../Field/labelVariants';\nimport { useIsGapOwned } from '../FormGrid/formGridContext';\n\nconst LABEL_LINE_PLACEHOLDER = ' ';\n\nconst styles = StyleSheet.create({\n labelLine: {\n userSelect: 'none',\n },\n});\n\nexport interface AlignToControlProps {\n children: React.ReactNode;\n labelVariant?: FieldLabelVariant;\n spacing?: FieldSpacing;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/** Puts a button or other unlabelled control on the input line of the labelled `Field`s beside it. */\nexport const AlignToControl = ({\n children,\n labelVariant,\n spacing,\n style,\n testID,\n}: AlignToControlProps): React.ReactElement => {\n const spacingStyles = fieldSpacingStyleSet(resolveFieldSpacing(spacing, useIsGapOwned()));\n const labelLineTestID = testID !== undefined ? `${testID}-label-line` : undefined;\n\n return (\n <View style={[spacingStyles.container, style]} testID={testID}>\n <Text\n accessibilityElementsHidden\n aria-hidden\n importantForAccessibility=\"no\"\n style={[spacingStyles.label, resolveLabelVariantStyle(labelVariant), styles.labelLine]}\n testID={labelLineTestID}\n >\n {LABEL_LINE_PLACEHOLDER}\n </Text>\n {children}\n </View>\n );\n};\n\nexport default AlignToControl;\n","/**\n * `FormCell` — one cell of a `FormGrid`.\n *\n * Replaces the `<View style={styles.field}>` wrapper every real call site already puts around each\n * control. It inherits `minWidth` / `flexBasis` from the enclosing grid so the common case is a bare\n * `<FormCell>`, and takes per-cell overrides for the genuine one-offs (aml-v2's `fieldNarrow`:\n * `minWidth: 140, flexBasis: 160, flexGrow: 0`).\n *\n * Used OUTSIDE a `FormGrid` it still renders a sensible cell from the package defaults rather than\n * throwing — a cell is a layout hint, and a form that renders slightly wide is a better failure than\n * a form that does not render. The grid-owned SPACING behaviour, by contrast, is deliberately NOT\n * available this way: that one has to come from a real grid, because a `Field` dropping its margin\n * with nothing to replace it would collapse the form.\n */\nimport React from 'react';\n\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { AlignToControl } from '../AlignToControl/AlignToControl';\n\nimport {\n FORM_GRID_DEFAULT_BASIS,\n FORM_GRID_DEFAULT_MIN_WIDTH,\n} from './FormGrid';\nimport { useFormGridMetrics } from './formGridContext';\n\n/** A cell that grows to fill the row's slack. The default — most fields want the space. */\nconst GROW = 1;\n/** A cell pinned to its basis. For the narrow one-offs (a 2-digit threshold next to a name field). */\nconst NO_GROW = 0;\n\nexport interface FormCellProps {\n children: React.ReactNode;\n /** Overrides the grid's `minWidth` for this cell only. */\n minWidth?: number;\n /** Overrides the grid's `basis` for this cell only. */\n basis?: number;\n /** `false` pins the cell to its basis instead of letting it absorb the row's slack. */\n grow?: boolean;\n /** Puts an unlabelled control (a button) on the input line of the labelled cells beside it. */\n alignToControl?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormCell = ({\n children,\n minWidth,\n basis,\n grow = true,\n alignToControl = false,\n style,\n testID,\n}: FormCellProps): React.ReactElement => {\n const metrics = useFormGridMetrics();\n const resolvedMinWidth = minWidth ?? metrics?.minWidth ?? FORM_GRID_DEFAULT_MIN_WIDTH;\n const resolvedBasis = basis ?? metrics?.basis ?? FORM_GRID_DEFAULT_BASIS;\n\n const cellStyle: ViewStyle = {\n minWidth: resolvedMinWidth,\n flexBasis: resolvedBasis,\n flexGrow: grow ? GROW : NO_GROW,\n };\n\n return (\n <View style={[cellStyle, style]} testID={testID}>\n {alignToControl ? <AlignToControl>{children}</AlignToControl> : children}\n </View>\n );\n};\n\nexport default FormCell;\n","export const INLINE_FIELD_ROW_MIN_WIDTH = 1024;\n\nexport interface InlineFieldRowLayout {\n inline: boolean;\n fieldMaxWidth: number | undefined;\n}\n\n/** Field and action share one row only at `inlineMinWidth` and wider; below it they stack. */\nexport function inlineFieldRowLayout(\n windowWidth: number,\n fieldMaxWidth: number,\n inlineMinWidth: number = INLINE_FIELD_ROW_MIN_WIDTH,\n): InlineFieldRowLayout {\n const inline = windowWidth >= inlineMinWidth;\n return { inline, fieldMaxWidth: inline ? fieldMaxWidth : undefined };\n}\n","import React, { useMemo } from 'react';\n\nimport { StyleSheet, View, useWindowDimensions } from 'react-native';\n\nimport { AlignToControl } from '../AlignToControl/AlignToControl';\nimport { FORM_GRID_DEFAULT_GAP } from '../FormGrid/FormGrid';\n\nimport { inlineFieldRowLayout } from './inlineFieldRowLayout';\n\nconst styles = StyleSheet.create({\n action: {\n flexShrink: 0,\n },\n field: {\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 1,\n },\n row: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n },\n});\n\nexport interface InlineFieldRowProps {\n field: React.ReactNode;\n action: React.ReactNode;\n fieldMaxWidth: number;\n inlineMinWidth?: number;\n gap?: number;\n testID?: string;\n}\n\n/** A labelled field and its action: stacked on phones, one row on desktop with the action on the input line. */\nexport const InlineFieldRow = ({\n field,\n action,\n fieldMaxWidth,\n inlineMinWidth,\n gap = FORM_GRID_DEFAULT_GAP,\n testID,\n}: InlineFieldRowProps): React.ReactElement => {\n const { width } = useWindowDimensions();\n const layout = inlineFieldRowLayout(width, fieldMaxWidth, inlineMinWidth);\n const rowStyle = useMemo(() => [styles.row, { gap }], [gap]);\n const fieldStyle = useMemo(() => [styles.field, { maxWidth: layout.fieldMaxWidth }], [layout.fieldMaxWidth]);\n\n if (!layout.inline)\n return (\n <>\n {field}\n {action}\n </>\n );\n\n return (\n <View style={rowStyle} testID={testID}>\n <View style={fieldStyle}>{field}</View>\n <AlignToControl style={styles.action}>{action}</AlignToControl>\n </View>\n );\n};\n\nexport default InlineFieldRow;\n","import type { LineItemColumn } from '../types';\n\nexport const LINE_ITEMS_WIDE_MIN_WIDTH = 1280;\nexport const LINE_ITEMS_DEFAULT_MIN_ITEMS = 1;\nexport const LINE_ITEMS_CARD_PADDING = 12;\nexport const LINE_ITEMS_CARD_BORDER = 1;\n\nconst DEFAULT_COLUMN_FLEX = 1;\n\n/** True when the window is wide enough for column headers shown once above the lines. */\nexport function isLineItemsWide(width: number, wideMinWidth: number = LINE_ITEMS_WIDE_MIN_WIDTH): boolean {\n return width >= wideMinWidth;\n}\n\n/** True when a line may be removed without going below `minItems`. */\nexport function canRemoveLine(count: number, minItems: number = LINE_ITEMS_DEFAULT_MIN_ITEMS): boolean {\n return count > minItems;\n}\n\n/** The 1-based number a reader sees for the line at `index`. */\nexport function lineNumberOf(index: number): number {\n return index + 1;\n}\n\n/** The share of the row a column takes on the wide layout. */\nexport function lineItemColumnFlex(column: LineItemColumn): number {\n return column.flex ?? DEFAULT_COLUMN_FLEX;\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle } from '../../Field/labelVariants';\nimport { FORM_GRID_DEFAULT_GAP } from '../../FormGrid/FormGrid';\nimport { LINE_ITEMS_CARD_BORDER, LINE_ITEMS_CARD_PADDING } from '../utils/lineItemsLayout';\n\nconst CARD_RADIUS = 8;\nconst HEADER_GAP = 8;\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: CARD_RADIUS,\n borderWidth: LINE_ITEMS_CARD_BORDER,\n gap: FORM_GRID_DEFAULT_GAP,\n padding: LINE_ITEMS_CARD_PADDING,\n },\n header: { alignItems: 'center', columnGap: HEADER_GAP, flexDirection: 'row', flexWrap: 'wrap', rowGap: HEADER_GAP },\n spacer: { flexGrow: 1 },\n});\n\ninterface LineItemCardProps {\n title: string;\n header?: React.ReactNode;\n removeAction?: React.ReactNode;\n children: React.ReactNode;\n testID: string;\n}\n\n/** One labelled line: a title row with a header slot and a remove action, then the line's cells. */\nexport const LineItemCard = ({ title, header, removeAction, children, testID }: LineItemCardProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n\n return (\n <View\n aria-label={title}\n role=\"group\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <View style={styles.header}>\n <Text style={[resolveLabelVariantStyle(), { color: colors.text }]} testID={`${testID}-title`}>\n {title}\n </Text>\n {header}\n <View style={styles.spacer} />\n {removeAction}\n </View>\n {children}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle } from '../../Field/labelVariants';\nimport { FORM_GRID_DEFAULT_GAP } from '../../FormGrid/FormGrid';\nimport type { LineItemColumn } from '../types';\nimport { LINE_ITEMS_CARD_BORDER, LINE_ITEMS_CARD_PADDING, lineItemColumnFlex } from '../utils/lineItemsLayout';\n\nconst styles = StyleSheet.create({\n cell: { flexBasis: 0, flexShrink: 1, minWidth: 0 },\n row: {\n flexDirection: 'row',\n gap: FORM_GRID_DEFAULT_GAP,\n paddingHorizontal: LINE_ITEMS_CARD_PADDING + LINE_ITEMS_CARD_BORDER,\n },\n});\n\ninterface LineItemsColumnHeadersProps {\n columns: readonly LineItemColumn[];\n testID: string;\n}\n\n/** Column labels shown once above the lines on the wide layout. */\nexport const LineItemsColumnHeaders = ({ columns, testID }: LineItemsColumnHeadersProps): React.ReactElement => {\n const { theme } = useUi();\n const labelStyle = [resolveLabelVariantStyle(), { color: theme.colors.textSecondary }];\n\n return (\n <View style={styles.row} testID={testID}>\n {columns.map((column) => (\n <View key={column.key} style={[styles.cell, { flexGrow: lineItemColumnFlex(column) }]}>\n <Text style={labelStyle}>{column.label}</Text>\n </View>\n ))}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, View, useWindowDimensions } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { FORM_GRID_DEFAULT_GAP, FormGrid } from '../FormGrid/FormGrid';\nimport { FormCell } from '../FormGrid/FormCell';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nimport { LineItemCard } from './components/LineItemCard';\nimport { LineItemsColumnHeaders } from './components/LineItemsColumnHeaders';\nimport type { LineItemsProps } from './types';\nimport { canRemoveLine, isLineItemsWide, lineItemColumnFlex, lineNumberOf } from './utils/lineItemsLayout';\n\nconst styles = StyleSheet.create({\n add: { alignSelf: 'flex-start' },\n cell: { flexBasis: 0, flexShrink: 1, minWidth: 0 },\n list: { gap: FORM_GRID_DEFAULT_GAP },\n wideRow: { alignItems: 'flex-start', flexDirection: 'row', gap: FORM_GRID_DEFAULT_GAP },\n});\n\n/** Repeating lines as labelled cards: stacked cells on phones, one row under column headers shown once when wide. */\nexport function LineItems<T>({\n items,\n getKey,\n columns,\n renderCell,\n lineLabel,\n labels,\n testID,\n renderLineHeader,\n onAdd,\n onRemove,\n minItems,\n wideMinWidth,\n}: LineItemsProps<T>): React.ReactElement {\n const { width } = useWindowDimensions();\n const wide = isLineItemsWide(width, wideMinWidth);\n const removable = onRemove !== undefined && canRemoveLine(items.length, minItems);\n\n const renderCells = (item: T, index: number): React.ReactNode => {\n if (wide)\n return (\n <GapOwnedProvider value>\n <View style={styles.wideRow}>\n {columns.map((column) => (\n <View key={column.key} style={[styles.cell, { flexGrow: lineItemColumnFlex(column) }]}>\n {renderCell({ item, index, columnKey: column.key, wide })}\n </View>\n ))}\n </View>\n </GapOwnedProvider>\n );\n return (\n <FormGrid>\n {columns.map((column) => (\n <FormCell key={column.key}>{renderCell({ item, index, columnKey: column.key, wide })}</FormCell>\n ))}\n </FormGrid>\n );\n };\n\n return (\n <View style={styles.list} testID={testID}>\n {wide ? <LineItemsColumnHeaders columns={columns} testID={`${testID}-columns`} /> : null}\n {items.map((item, index) => {\n const lineNumber = lineNumberOf(index);\n const lineTestID = `${testID}-line-${String(lineNumber)}`;\n const removeAction = removable ? (\n <Button\n accessibilityHint={labels.removeHint}\n accessibilityLabel={labels.remove(lineNumber)}\n label={labels.remove(lineNumber)}\n testID={`${lineTestID}-remove`}\n variant=\"ghost\"\n onPress={() => onRemove(index)}\n />\n ) : undefined;\n return (\n <LineItemCard\n key={getKey(item, index)}\n header={renderLineHeader?.(item, index)}\n removeAction={removeAction}\n testID={lineTestID}\n title={lineLabel(lineNumber)}\n >\n {renderCells(item, index)}\n </LineItemCard>\n );\n })}\n {onAdd !== undefined ? (\n <View style={styles.add}>\n <Button\n accessibilityHint={labels.addHint}\n accessibilityLabel={labels.add}\n label={labels.add}\n testID={`${testID}-add`}\n variant=\"secondary\"\n onPress={onAdd}\n />\n </View>\n ) : null}\n </View>\n );\n}\n\nexport default LineItems;\n","import React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { FORM_GRID_DEFAULT_GAP } from '../FormGrid/FormGrid';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nconst styles = StyleSheet.create({\n stack: { flexDirection: 'column' },\n});\n\nexport interface FormStackProps {\n children: React.ReactNode;\n gap?: number;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/** A vertical form column whose `gap` owns the rhythm, so the `Field`s inside drop their own bottom margin. */\nexport const FormStack = ({\n children,\n gap = FORM_GRID_DEFAULT_GAP,\n style,\n testID,\n}: FormStackProps): React.ReactElement => (\n <GapOwnedProvider value>\n <View style={[styles.stack, { gap }, style]} testID={testID}>\n {children}\n </View>\n </GapOwnedProvider>\n);\n","export const RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;\n\n/** True when `width` reaches `breakpoint`, so the wide layout applies. */\nexport function isWideFormLayout(width: number, breakpoint: number = RESPONSIVE_FORM_DEFAULT_BREAKPOINT): boolean {\n return width >= breakpoint;\n}\n","import React from 'react';\n\nimport { useWindowDimensions } from 'react-native';\n\nimport { isWideFormLayout, RESPONSIVE_FORM_DEFAULT_BREAKPOINT } from './isWideFormLayout';\n\nexport interface ResponsiveFormLayoutProps {\n narrow: React.ReactNode;\n wide: React.ReactNode;\n breakpoint?: number;\n}\n\n/** Renders `wide` when the window reaches `breakpoint`, else `narrow`, so a form switches layout by width. */\nexport function ResponsiveFormLayout({\n narrow,\n wide,\n breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT,\n}: ResponsiveFormLayoutProps): React.ReactElement {\n const { width } = useWindowDimensions();\n return <>{isWideFormLayout(width, breakpoint) ? wide : narrow}</>;\n}\n","/**\n * `FormSection` — a titled group of fields. The React answer to v1's `<fieldset>` / `<legend>`.\n *\n * v1 has a real `<fieldset>` whose `<legend>` takes the identical label metric as a field label, so\n * a group heading reads as part of the form rather than as page furniture. Nothing in the React\n * fleet has this: zygos fakes it with a generic `Heading`, and everybody else emits an untitled\n * `<View>` — which means the grouping exists visually but not semantically, so a screen-reader user\n * tabbing into \"Threshold\" is never told it belongs to \"Advanced matching\".\n *\n * ## Why not a literal `<fieldset>`\n *\n * react-native-web has no `fieldset` mapping — a `View` is a `div`, and there is no escape hatch\n * that turns one into a `<fieldset>` with a real `<legend>`. What IS available is the pattern the\n * ARIA spec defines as the equivalent: `role=\"group\"` + `aria-labelledby` pointing at the heading.\n * Assistive tech announces \"Advanced matching, group\" exactly as it would for a fieldset. This is\n * the honest ceiling of the platform, not a shortcut — and it is why the legend is a `Text` whose\n * `nativeID` is generated the same way `Field`'s hint/error ids are.\n *\n * The legend deliberately reuses `resolveLabelVariantStyle` — the SAME function `Field` uses for its\n * label — so the two cannot drift. A section titled in one metric above fields labelled in another\n * is precisely the \"third voice is drift\" failure FORMS.md warns about.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { resolveLabelVariantStyle, type FieldLabelVariant } from '../Field/labelVariants';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\n/** Space between the legend, the description and the section's content. */\nconst SECTION_GAP = 10;\n/** A description is a help line for the whole group — same size as `Field`'s hint. */\nconst DESCRIPTION_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n section: {\n gap: SECTION_GAP,\n },\n description: {\n fontSize: DESCRIPTION_FONT_SIZE,\n },\n});\n\nlet sectionSeq = 0;\n\n/** Stable-per-instance id so the group can point at its own legend via `aria-labelledby`. */\nfunction useSectionLegendId(): string {\n const [id] = React.useState(() => {\n sectionSeq += 1;\n return `form-section-legend-${String(sectionSeq)}`;\n });\n return id;\n}\n\n/**\n * Web-only ARIA attributes react-native-web forwards to the underlying element but that RN's\n * `ViewProps` type does not enumerate — the same escape-hatch-free pattern `ChipSelector` uses.\n */\ninterface WebSectionA11y {\n 'aria-labelledby'?: string;\n}\n\nexport interface FormSectionProps {\n /**\n * The legend — pre-localized, like every string in this package. Optional: a section with no\n * title still groups its children for layout, but renders NO legend row and NO `aria-labelledby`,\n * because a group labelled by an empty element is worse for assistive tech than an unlabelled one.\n */\n title?: string;\n /** Help line for the whole group, under the legend. The group-level sibling of `Field`'s hint. */\n description?: string;\n children: React.ReactNode;\n /**\n * Which label voice the legend speaks. Defaults to `field` — a section heading on a form the user\n * fills in. Pass `control` on a dense surface so the legend matches the controls beneath it.\n */\n labelVariant?: FieldLabelVariant;\n /** Escape hatch applied AFTER `labelVariant`, for the genuine one-off a variant does not cover. */\n titleStyle?: StyleProp<TextStyle>;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nexport const FormSection = ({\n title,\n description,\n children,\n labelVariant,\n titleStyle,\n style,\n testID,\n}: FormSectionProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const legendId = useSectionLegendId();\n const hasTitle = typeof title === 'string' && title !== '';\n const hasDescription = typeof description === 'string' && description !== '';\n\n const a11y: WebSectionA11y = { 'aria-labelledby': hasTitle ? legendId : undefined };\n\n return (\n // The section spaces its children with `gap`, so it owns their vertical rhythm exactly as a\n // `FormGrid` owns a row's — without this a `Field` placed directly in a section would stack its\n // 16px margin on the section's gap and recreate the F3 bug one level up.\n <GapOwnedProvider value>\n <View role=\"group\" style={[styles.section, style]} testID={testID} {...a11y}>\n {hasTitle ? (\n <Text\n nativeID={legendId}\n style={[resolveLabelVariantStyle(labelVariant), { color: colors.text }, titleStyle]}\n >\n {title}\n </Text>\n ) : null}\n {hasDescription ? (\n <Text style={[styles.description, { color: colors.textSecondary }]}>{description}</Text>\n ) : null}\n {children}\n </View>\n </GapOwnedProvider>\n );\n};\n\nexport default FormSection;\n","/**\n * `FormActions` — the submit/cancel button row every form ends with.\n *\n * Promoted from the BYTE-IDENTICAL `erevna-web/src/components/Forms/FormActions.tsx` and\n * `katalogos-web/src/components/Forms/FormActions.tsx` (68 lines each, `diff` returns nothing);\n * all seven apps hand-roll the same row. Buttons come from the shared `@dloizides/ui-buttons` kit\n * rather than being forked here, so there is exactly one button implementation in the estate.\n *\n * The layout implements the contract's actions row\n * (`…/wwwroot/shared/FORMS.md` → \"Actions row\"): the primary action is LAST in DOM order, so tab\n * order reaches Cancel before Save, and `saving` drives the primary button's spinner rather than\n * disabling-and-relabelling it.\n *\n * Two minimal generalizations over the app-local twins:\n * 1. Labels and hints arrive as PRE-LOCALIZED props. The twins called `FM()` internally, which\n * cannot work here: aml-v2 localizes via `@dloizides/i18n` with positional `{0}` params while\n * the other six use i18next `{{p1}}`, and nothing bridges them.\n * 2. `testID`s are overridable but default to the twins' `save-button` / `cancel-button`, so the\n * existing Playwright selectors in every app keep matching.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\n/** Gap between the actions, matching the contract's `.actions { gap: 12px }`. */\nconst ACTIONS_GAP = 12;\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: ACTIONS_GAP,\n },\n});\n\nexport interface FormActionsProps {\n /** Submit handler. May be async — the shared Button drives its own spinner for the promise. */\n onSave: () => void | Promise<unknown>;\n /** Cancel handler. Omit it entirely to render a save-only row (no empty Cancel slot). */\n onCancel?: () => void | Promise<unknown>;\n /** Pre-localized label for the primary action. */\n saveLabel: string;\n /** Pre-localized label for the cancel action. Required whenever `onCancel` is supplied. */\n cancelLabel?: string;\n /** Pre-localized accessibility hint for the primary action. Falls back to its label. */\n saveHint?: string;\n /** Pre-localized accessibility hint for the cancel action. Falls back to its label. */\n cancelHint?: string;\n /** In-flight submit: spins the primary action and disables cancel so the form can't be abandoned mid-write. */\n saving?: boolean;\n /** Disables the primary action independently of `saving` (e.g. an invalid form). */\n saveDisabled?: boolean;\n containerStyle?: StyleProp<ViewStyle>;\n saveTestID?: string;\n cancelTestID?: string;\n testID?: string;\n}\n\nexport const FormActions = ({\n onSave,\n onCancel,\n saveLabel,\n cancelLabel = '',\n saveHint,\n cancelHint,\n saving = false,\n saveDisabled = false,\n containerStyle,\n saveTestID = 'save-button',\n cancelTestID = 'cancel-button',\n testID,\n}: FormActionsProps): React.ReactElement => (\n <View style={[styles.container, containerStyle]} testID={testID}>\n {typeof onCancel === 'function' ? (\n <Button\n accessibilityHint={cancelHint ?? cancelLabel}\n accessibilityLabel={cancelLabel}\n disabled={saving}\n label={cancelLabel}\n testID={cancelTestID}\n variant=\"outline\"\n onPress={onCancel}\n />\n ) : null}\n\n <Button\n accessibilityHint={saveHint ?? saveLabel}\n accessibilityLabel={saveLabel}\n disabled={saveDisabled}\n label={saveLabel}\n loading={saving}\n testID={saveTestID}\n variant=\"primary\"\n onPress={onSave}\n />\n </View>\n);\n\nexport default FormActions;\n","/**\r\n * `controlStyles` — the tuned metrics for the dense CONTROLS (text box, select trigger, floating\r\n * option menu, date-range row), promoted VERBATIM out of `@dloizides/ui-tables`' private\r\n * `Filters/styles.ts`.\r\n *\r\n * That file's own header said the quiet part out loud: it \"reconcile[d] the per-field styles that\r\n * were copy-pasted across aml-v2's filter files into one shared source\" — and then locked the\r\n * reconciliation inside one bar, where no other surface could reach it. These numbers are that\r\n * reconciliation, unchanged to the pixel, now reachable.\r\n *\r\n * Colours are applied INLINE from `useUi().theme` at render — nothing here carries a colour\r\n * literal, so a control re-themes per tenant without a stylesheet change.\r\n */\r\nimport { StyleSheet } from 'react-native';\r\n\r\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\r\nimport { Z_INDEX } from '@dloizides/design-tokens';\r\n\r\nconst FIELD_GAP = 4;\r\nconst LABEL_FONT = 11;\r\nconst LABEL_LETTER_SPACING = 0.4;\r\nconst INPUT_RADIUS = 8;\r\nconst INPUT_PAD_H = 12;\r\nconst INPUT_PAD_V = 10;\r\nconst INPUT_FONT = 14;\r\nconst INPUT_BORDER = 1;\r\nconst DATE_ROW_GAP = 8;\r\nconst CHEVRON_FONT = 10;\r\nconst MENU_TOP_GAP = 4;\r\nconst MENU_RADIUS = 8;\r\nconst MENU_PAD_V = 4;\r\nconst MENU_OPT_PAD_H = 12;\r\nconst MENU_OPT_PAD_V = 8;\r\nexport const MENU_MIN_WIDTH = 160;\r\nexport const MENU_MAX_HEIGHT = 260;\r\nconst MENU_ELEVATION = 8;\r\nconst MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\r\nconst OPTION_FONT = 14;\r\nconst ERROR_FONT = 12;\r\nconst ERROR_GAP = 3;\r\n\r\nexport const controlStyles = StyleSheet.create({\r\n /**\r\n * The shared bordered box every dense text control renders in.\r\n *\r\n * `minHeight` is the kit floor: padding alone produced a ~38px box, and a bare input with no\r\n * box style at all measured **19px** in production. Height is a hit-target guarantee, so it\r\n * is stated rather than left to emerge from font size + padding.\r\n */\r\n input: {\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: INPUT_RADIUS,\r\n paddingHorizontal: INPUT_PAD_H,\r\n paddingVertical: INPUT_PAD_V,\r\n fontSize: INPUT_FONT,\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n },\r\n /** The select trigger: a bordered field box matching the text inputs + a chevron. */\r\n selectTrigger: {\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: DATE_ROW_GAP,\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: INPUT_RADIUS,\r\n paddingHorizontal: INPUT_PAD_H,\r\n paddingVertical: INPUT_PAD_V,\r\n },\r\n selectTriggerText: { fontSize: INPUT_FONT, flexShrink: 1 },\r\n chevron: { fontSize: CHEVRON_FONT },\r\n dateRow: { flexDirection: 'row', gap: DATE_ROW_GAP },\r\n dateCol: { gap: FIELD_GAP, flex: 1 },\r\n /**\r\n * The micro-caption above a sub-control (a date range's From/To) and beside a switch. Note it\r\n * is deliberately NOT the `control` label voice: it carries no `700`/uppercase, because it\r\n * names a HALF of a control that already has a `control`-voice label above it. Uppercasing it\r\n * too would make one field shout twice.\r\n */\r\n subLabel: { fontSize: LABEL_FONT, letterSpacing: LABEL_LETTER_SPACING },\r\n /** Positioning context for a floating `AnchoredMenu` (`position:absolute; top:100%`). */\r\n anchor: { position: 'relative' },\r\n menu: {\r\n position: 'absolute',\r\n top: '100%',\r\n left: 0,\r\n marginTop: MENU_TOP_GAP,\r\n minWidth: MENU_MIN_WIDTH,\r\n maxHeight: MENU_MAX_HEIGHT,\r\n borderWidth: INPUT_BORDER,\r\n borderRadius: MENU_RADIUS,\r\n paddingVertical: MENU_PAD_V,\r\n zIndex: Z_INDEX.dropdown,\r\n boxShadow: MENU_BOX_SHADOW,\r\n elevation: MENU_ELEVATION,\r\n overflow: 'hidden',\r\n },\r\n /** A menu option is a tap target, so it carries the kit floor (SHOWCASE-1). */\r\n option: {\r\n minHeight: MIN_TOUCH_TARGET_PX,\r\n justifyContent: 'center',\r\n paddingHorizontal: MENU_OPT_PAD_H,\r\n paddingVertical: MENU_OPT_PAD_V,\r\n },\r\n optionText: { fontSize: OPTION_FONT },\r\n error: { fontSize: ERROR_FONT, marginTop: ERROR_GAP },\r\n});\r\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { controlStyles as s } from '../../controls/controlStyles';\nimport type { ControlOption } from '../../controls/controlTypes';\n\nconst ACTIVE_WEIGHT = '700' as const;\nconst IDLE_WEIGHT = '400' as const;\nconst DETAIL_FONT = 12;\nconst DETAIL_GAP = 12;\nconst STACK_GAP = 2;\nconst DETAIL_BESIDE_MIN_MENU_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n beside: { alignItems: 'baseline', flexDirection: 'row', gap: DETAIL_GAP, justifyContent: 'space-between' },\n stacked: { gap: STACK_GAP },\n shrink: { flexShrink: 1 },\n detail: { flexShrink: 1, fontSize: DETAIL_FONT },\n});\n\nexport interface OptionRowColors {\n text: string;\n textSecondary?: string;\n border: string;\n surface: string;\n brand: string;\n}\n\nexport interface OptionRowProps {\n option: ControlOption;\n isActive: boolean;\n isHighlighted: boolean;\n isListboxRow: boolean;\n menuWidth: number;\n hint: string;\n colors: OptionRowColors;\n testID: string;\n onSelect: (value: string) => void;\n}\n\n/** The DOM id `aria-activedescendant` points at; whitespace is replaced to keep it one token. */\nexport function optionDomId(testID: string, value: string): string {\n return `${testID}-option-${value}`.replace(/\\s+/g, '_');\n}\n\n/** The DOM id `aria-controls` points at. */\nexport function listboxDomId(testID: string): string {\n return `${testID}-listbox`;\n}\n\n/** Whether a row has the width to show its detail beside the title instead of under it. */\nexport function isDetailBesideTitle(menuWidth: number): boolean {\n return menuWidth >= DETAIL_BESIDE_MIN_MENU_WIDTH;\n}\n\nfunction rowInk(colors: OptionRowColors, isActive: boolean, isHighlighted: boolean): { title: string; detail: string } {\n if (isHighlighted) return { title: colors.surface, detail: colors.surface };\n return { title: isActive ? colors.brand : colors.text, detail: colors.textSecondary ?? colors.text };\n}\n\nexport function OptionRow({ option, isActive, isHighlighted, isListboxRow, menuWidth, hint, colors, testID, onSelect }: OptionRowProps): React.ReactElement {\n const hasDetail = option.detail !== undefined && option.detail !== '';\n const label = hasDetail ? `${option.label}, ${option.detail}` : option.label;\n const roleProps = isListboxRow\n ? { role: 'option' as const, tabIndex: -1 as const, id: optionDomId(testID, option.value), 'aria-selected': isHighlighted }\n : { accessibilityRole: 'menuitem' as const, 'aria-selected': isActive };\n const isBold = isActive || isHighlighted;\n const ink = rowInk(colors, isActive, isHighlighted);\n\n return (\n <Pressable\n {...roleProps}\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ selected: isActive }}\n onPress={() => onSelect(option.value)}\n style={[s.option, isHighlighted ? { backgroundColor: colors.text } : null]}\n testID={`${testID}-option-${option.value}`}\n >\n <View style={isDetailBesideTitle(menuWidth) ? styles.beside : styles.stacked}>\n <Text style={[s.optionText, styles.shrink, { color: ink.title, fontWeight: isBold ? ACTIVE_WEIGHT : IDLE_WEIGHT }]}>\n {option.label}\n </Text>\n {hasDetail ? <Text style={[styles.detail, { color: ink.detail }]}>{option.detail}</Text> : null}\n </View>\n </Pressable>\n );\n}\n","/**\r\n * menuPortal — web-only stacking/positioning geometry for {@link AnchoredMenu}.\r\n *\r\n * WHY THIS EXISTS (the bug it fixes): react-native-web renders EVERY `View` with\r\n * `position: relative; z-index: 0`, so every View is its own stacking context. An in-tree\r\n * `position:absolute` popover therefore has its `zIndex` trapped inside its anchor's (and the\r\n * app's field-wrapper's) `z-index: 0` context — it can never rise above later-painting sibling\r\n * Views (the adjacent filter fields, the PEP-class guide, the results table/card). That is why the\r\n * Country typeahead menu painted UNDERNEATH the content below it (\"hidden below\").\r\n *\r\n * THE FIX: on web the menu is rendered in a PORTAL to `document.body` with `position: fixed` at the\r\n * trigger's measured viewport rect and a high `zIndex`. A portal escapes every ancestor stacking\r\n * context AND every ancestor `overflow: hidden`, so the menu always paints on top and is never\r\n * clipped. {@link useAnchorRect} keeps the fixed coordinate glued to the trigger as the page\r\n * scrolls / resizes / reflows. On native the menu stays in-tree (`position:absolute` + `elevation`).\r\n *\r\n * DUPLICATION NOTE: `@dloizides/ui-layout`'s `ModalDropdown`/`InlineMenu` and `@dloizides/ui-tables`'\r\n * `SizeDropdown` already carry the same portal mechanism. It is NOT shared from there because\r\n * `ui-forms` is the LOWEST-level UI primitive and must not depend on those higher packages (that\r\n * would invert the dependency graph). The proper DRY home is `ui-forms` itself; unifying the three\r\n * copies onto this one (ui-layout/ui-tables importing it from here) is a tracked follow-up, kept out\r\n * of this change so the proven ModalDropdown is not disturbed while fixing the typeahead.\r\n */\r\nimport { useLayoutEffect, useState } from 'react';\r\nimport type { RefObject } from 'react';\r\n\r\nimport { Platform, type ViewStyle } from 'react-native';\r\nimport type { View as RNView } from 'react-native';\r\n\r\nimport { Z_INDEX } from '@dloizides/design-tokens';\r\n\r\nimport { MENU_MAX_HEIGHT, MENU_MIN_WIDTH } from '../controls/controlStyles';\r\n\r\nconst IS_WEB = Platform.OS === 'web';\r\n\r\n/**\r\n * z-index for the open popover: the shared `popover` layer, above RN-web's body-level `Modal`\r\n * (9999) so a menu opened inside a dialog paints and clicks on top of it, and below toasts.\r\n */\r\nexport const MENU_PORTAL_Z_INDEX = Z_INDEX.popover;\r\n/** Gap between the trigger's bottom edge and the popover's top edge. */\r\nconst MENU_TOP_GAP = 4;\r\nconst MENU_MIN_HEIGHT = 96;\r\nconst VIEWPORT_MARGIN = 8;\r\n\r\n/** The trigger's viewport-space rect (from `getBoundingClientRect`) needed to place a fixed menu. */\r\nexport interface AnchorRect {\r\n top: number;\r\n left: number;\r\n width: number;\r\n bottom: number;\r\n}\r\n\r\n/** The RN-web `View` ref is an `HTMLElement` at runtime; native refs are not. */\r\nfunction toDomNode(ref: RefObject<RNView | null>): HTMLElement | null {\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\r\n const node = ref.current as unknown as HTMLElement | null;\r\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\r\n return node;\r\n}\r\n\r\n/** Read the anchor's viewport rect (web only). Returns null when unavailable (native / no node). */\r\nexport function readAnchorRect(ref: RefObject<RNView | null>): AnchorRect | null {\r\n if (!IS_WEB) return null;\r\n const node = toDomNode(ref);\r\n if (node === null) return null;\r\n const r = node.getBoundingClientRect();\r\n return { top: r.top, left: r.left, width: r.width, bottom: r.bottom };\r\n}\r\n\r\n/**\r\n * Web portal popover style: `position: fixed` at the trigger rect with a high `zIndex`. Portalled to\r\n * `document.body`, so `fixed` positions it against the viewport and it tracks the trigger via the\r\n * measured rect (recomputed on scroll/resize/reflow) — clipped by nothing, above everything.\r\n */\r\nexport function buildPortalPopoverStyle(rect: AnchorRect, viewportBottom?: number, viewportWidth?: number): ViewStyle {\r\n return {\r\n ...(viewportBottom !== undefined ? { maxHeight: menuMaxHeight(rect.bottom, viewportBottom) } : null),\r\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\r\n position: 'fixed' as unknown as ViewStyle['position'],\r\n top: rect.bottom + MENU_TOP_GAP,\r\n ...horizontalPlacement(rect, viewportWidth),\r\n zIndex: MENU_PORTAL_Z_INDEX,\r\n };\r\n}\r\n\r\nfunction horizontalPlacement(rect: AnchorRect, viewportWidth: number | undefined): { left: number; width: number } {\r\n if (viewportWidth === undefined) return { left: rect.left, width: rect.width };\r\n const width = Math.min(Math.max(rect.width, MENU_MIN_WIDTH), viewportWidth - 2 * VIEWPORT_MARGIN);\r\n const left = Math.max(VIEWPORT_MARGIN, Math.min(rect.left, viewportWidth - VIEWPORT_MARGIN - width));\r\n return { left, width };\r\n}\r\n\r\n/**\r\n * Track the anchor's viewport rect while `enabled`. Measures on enable, then re-measures on scroll\r\n * (capture phase, so a scroll inside ANY ancestor scroll container counts — element `scroll` events\r\n * do not bubble) + window resize + any layout reflow that moves the trigger without scrolling (an\r\n * accordion above it expanding, an async list rendering, a font swapping — caught by a\r\n * `ResizeObserver` on the anchor and `document.body`). Work is coalesced into one\r\n * `requestAnimationFrame` per frame so a momentum scroll cannot thrash layout. No-op on native\r\n * (returns null), where the in-tree absolute popover moves with its anchor automatically.\r\n */\r\nexport function useAnchorRect(ref: RefObject<RNView | null>, enabled: boolean): AnchorRect | null {\r\n const [rect, setRect] = useState<AnchorRect | null>(null);\r\n\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) {\r\n setRect(null);\r\n return undefined;\r\n }\r\n let frame: number | null = null;\r\n let disposed = false;\r\n\r\n const apply = (): void => {\r\n frame = null;\r\n if (disposed) return;\r\n setRect(readAnchorRect(ref));\r\n };\r\n const schedule = (): void => {\r\n if (frame !== null) return;\r\n frame = window.requestAnimationFrame(apply);\r\n };\r\n\r\n apply();\r\n document.addEventListener('scroll', schedule, true);\r\n window.addEventListener('resize', schedule);\r\n const node = toDomNode(ref);\r\n const observer = typeof ResizeObserver === 'function' ? new ResizeObserver(schedule) : null;\r\n if (observer !== null) {\r\n if (node !== null) observer.observe(node);\r\n observer.observe(document.body);\r\n }\r\n\r\n return () => {\r\n disposed = true;\r\n if (frame !== null) window.cancelAnimationFrame(frame);\r\n document.removeEventListener('scroll', schedule, true);\r\n window.removeEventListener('resize', schedule);\r\n if (observer !== null) observer.disconnect();\r\n };\r\n }, [ref, enabled]);\r\n\r\n return IS_WEB && enabled ? rect : null;\r\n}\r\n\r\nfunction roomUnderAnchor(anchorBottom: number, viewportBottom: number): number {\r\n return viewportBottom - anchorBottom - MENU_TOP_GAP - VIEWPORT_MARGIN;\r\n}\r\n\r\nexport function menuMaxHeight(anchorBottom: number, viewportBottom: number): number {\r\n return Math.min(MENU_MAX_HEIGHT, Math.max(MENU_MIN_HEIGHT, roomUnderAnchor(anchorBottom, viewportBottom)));\r\n}\r\n\r\n/** Where to scroll the field: to the top only when the full list does not fit under it. */\r\nexport function anchorScrollBlock(anchorBottom: number, viewportBottom: number): ScrollLogicalPosition {\r\n return roomUnderAnchor(anchorBottom, viewportBottom) < MENU_MAX_HEIGHT ? 'start' : 'nearest';\r\n}\r\n\r\nfunction readViewportBottom(): number {\r\n const viewport = window.visualViewport ?? null;\r\n return viewport === null ? window.innerHeight : viewport.offsetTop + viewport.height;\r\n}\r\n\r\nexport function useVisualViewportBottom(enabled: boolean): number | null {\r\n const [bottom, setBottom] = useState<number | null>(null);\r\n\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) {\r\n setBottom(null);\r\n return undefined;\r\n }\r\n const update = (): void => setBottom(readViewportBottom());\r\n update();\r\n const viewport = window.visualViewport ?? null;\r\n viewport?.addEventListener('resize', update);\r\n viewport?.addEventListener('scroll', update);\r\n window.addEventListener('resize', update);\r\n return () => {\r\n viewport?.removeEventListener('resize', update);\r\n viewport?.removeEventListener('scroll', update);\r\n window.removeEventListener('resize', update);\r\n };\r\n }, [enabled]);\r\n\r\n return bottom;\r\n}\r\n\r\nexport function scrollNodeIntoView(node: HTMLElement | null, block: ScrollLogicalPosition): void {\r\n if (node !== null && typeof node.scrollIntoView === 'function') node.scrollIntoView({ block });\r\n}\r\n\r\nexport function scrollAnchorIntoView(ref: RefObject<RNView | null>, marginTop: number): void {\r\n if (!IS_WEB) return;\r\n const node = toDomNode(ref);\r\n if (node === null) return;\r\n node.style.scrollMarginTop = `${marginTop}px`;\r\n scrollNodeIntoView(node, anchorScrollBlock(node.getBoundingClientRect().bottom, readViewportBottom()));\r\n}\r\n\r\n/** While enabled, keeps room for the list under the field, also when a keyboard shrinks the viewport. */\r\nexport function useKeepAnchorInRoom(ref: RefObject<RNView | null>, marginTop: number, enabled: boolean): void {\r\n useLayoutEffect(() => {\r\n if (!IS_WEB || !enabled) return undefined;\r\n const place = (): void => scrollAnchorIntoView(ref, marginTop);\r\n place();\r\n const viewport = window.visualViewport ?? null;\r\n viewport?.addEventListener('resize', place);\r\n return () => viewport?.removeEventListener('resize', place);\r\n }, [ref, marginTop, enabled]);\r\n}\r\n","/**\n * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.\n *\n * By DEFAULT (web) it renders in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured rect: that escapes react-native-web's trapped `z-index: 0` stacking contexts and any\n * ancestor `overflow: hidden`, so the menu is never painted under / clipped by later siblings (a\n * table, a card, the next filter field). On native, and when {@link AnchoredMenuProps.usePortal} is\n * explicitly `false`, it renders an in-tree, absolutely-positioned popover under its anchor\n * (`position:absolute; top:100%; zIndex; elevation`) — which is exactly what left `SelectControl`'s\n * menu hidden behind the attendee table until the default flipped. See {@link menuPortal}.\n * On web it dismisses on outside-click / Escape; on native the caller closes it on blur/select.\n * Purely presentational + theme-flat, so it stays reusable.\n *\n * Promoted verbatim out of `@dloizides/ui-tables`' private `Filters/components/AnchoredMenu`.\n *\n * Deliberately no `ui-layout` dependency: `ui-forms` is a low-level primitive and must not take a\n * runtime dependency on the higher-level `ui-layout` `ModalDropdown` — that would invert the graph\n * for every consumer. The portal mechanism therefore lives locally in {@link menuPortal}.\n */\nimport React, { useEffect } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport { ScrollView, Text, View, useWindowDimensions } from 'react-native';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { listboxDomId, optionDomId, OptionRow } from './components/OptionRow';\nimport { buildPortalPopoverStyle, scrollNodeIntoView, useAnchorRect, useVisualViewportBottom } from './menuPortal';\n\nconst IS_WEB = typeof document !== 'undefined';\nconst ESCAPE_KEY = 'Escape';\nconst LISTBOX_ROLE: Readonly<Record<string, string>> = { role: 'listbox' };\nconst KEEP_FIELD_FOCUS = { onMouseDown: (event: { preventDefault: () => void }): void => event.preventDefault() };\n\n/** The four theme colours the menu paints with — passed in, so the menu stays theme-flat. */\nexport interface AnchoredMenuColors {\n text: string;\n textSecondary?: string;\n border: string;\n surface: string;\n brand: string;\n}\n\nexport interface AnchoredMenuListbox {\n highlightedValue?: string;\n statusText?: string;\n}\n\n/** Web: keeps the portalled menu on screen, lined up with positionRef when given, else with anchorRef. */\nexport interface AnchoredMenuPlacement {\n positionRef?: React.RefObject<View | null>;\n}\n\nexport interface AnchoredMenuProps {\n options: readonly ControlOption[];\n /** The currently-selected value, highlighted in the list ('' = none). */\n selectedValue: string;\n onSelect: (value: string) => void;\n onDismiss: () => void;\n colors: AnchoredMenuColors;\n /** PRE-LOCALIZED accessibility hint applied to every option. */\n optionHint: string;\n /**\n * PRE-LOCALIZED accessible NAME for the menu container itself (e.g. \"Recent values\"). Optional and\n * additive — omitted, the menu keeps only its `role=\"menu\"` as before, so existing callers are\n * unaffected. Supplied, a screen reader announces the list's purpose, not just \"menu\".\n */\n accessibilityLabel?: string;\n /** Base testID: the menu is `${testID}-menu`, each option `${testID}-option-${value}`. */\n testID: string;\n /** Node whose clicks count as \"inside\" (the anchor) so its own press doesn't self-dismiss. */\n anchorRef: React.RefObject<View | null>;\n /**\n * On web, render the popover in a portal to `document.body` with `position: fixed` at the anchor's\n * measured rect, so it escapes react-native-web's trapped stacking contexts and any ancestor\n * `overflow: hidden` (the fix for a menu that paints under / is clipped by the content below it).\n * No effect on native (the `IS_WEB` guard keeps native in-tree regardless).\n *\n * Default `true` — portalling is the CORRECT default: an in-tree popover is always at risk of\n * being painted under a later-painting sibling (a table, a card, the next filter field). The old\n * default was `false`, which silently left `SelectControl`'s menu hidden behind the attendee table\n * (a recurrence of the exact bug this mechanism fixed for `TypeaheadControl`). Pass `usePortal={false}`\n * only for the rare case that genuinely wants the menu clipped to its container.\n */\n usePortal?: boolean;\n listbox?: AnchoredMenuListbox;\n placement?: AnchoredMenuPlacement;\n}\n\n/** Web-only outside-click + Escape dismissal (no-op on native). */\nfunction useDismiss(\n anchorRef: React.RefObject<View | null>,\n menuRef: React.RefObject<View | null>,\n onDismiss: () => void,\n): void {\n useEffect(() => {\n if (!IS_WEB) return undefined;\n const onMouseDown = (event: MouseEvent): void => {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const anchorNode = anchorRef.current as unknown as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const menuNode = menuRef.current as unknown as HTMLElement | null;\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = anchorNode !== null && target !== null && anchorNode.contains(target);\n const insideMenu = menuNode !== null && target !== null && menuNode.contains(target);\n if (!insideAnchor && !insideMenu) onDismiss();\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === ESCAPE_KEY) onDismiss();\n };\n document.addEventListener('mousedown', onMouseDown);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [anchorRef, menuRef, onDismiss]);\n}\n\nfunction useKeepHighlightInView(testID: string, highlightedValue: string | undefined): void {\n useEffect(() => {\n if (!IS_WEB || highlightedValue === undefined || highlightedValue === '') return;\n scrollNodeIntoView(document.getElementById(optionDomId(testID, highlightedValue)), 'nearest');\n }, [testID, highlightedValue]);\n}\n\nexport function AnchoredMenu({\n options,\n selectedValue,\n onSelect,\n onDismiss,\n colors,\n optionHint,\n accessibilityLabel,\n testID,\n anchorRef,\n usePortal = true,\n listbox,\n placement,\n}: AnchoredMenuProps): React.ReactElement {\n const menuRef = React.useRef<View>(null);\n useDismiss(anchorRef, menuRef, onDismiss);\n useKeepHighlightInView(testID, listbox?.highlightedValue);\n // Web + usePortal: track the anchor rect so the fixed, portalled menu stays glued to the trigger.\n const rect = useAnchorRect(placement?.positionRef ?? anchorRef, usePortal);\n const viewportBottom = useVisualViewportBottom(usePortal);\n const { width: windowWidth } = useWindowDimensions();\n const portalStyle = rect !== null ? buildPortalPopoverStyle(rect, viewportBottom ?? undefined, placement !== undefined ? windowWidth : undefined) : null;\n const menuWidth = rect?.width ?? windowWidth;\n const isListbox = listbox !== undefined;\n const statusText = listbox?.statusText;\n const rows = options.map((option) => (\n <OptionRow\n key={option.value}\n colors={colors}\n hint={optionHint}\n isActive={option.value === selectedValue}\n isHighlighted={option.value === listbox?.highlightedValue}\n isListboxRow={isListbox}\n menuWidth={menuWidth}\n option={option}\n testID={testID}\n onSelect={onSelect}\n />\n ));\n const listboxBody = options.length > 0 ? (\n <View accessibilityLabel={accessibilityLabel} id={listboxDomId(testID)} {...LISTBOX_ROLE} testID={listboxDomId(testID)}>\n {rows}\n </View>\n ) : null;\n\n const menu = (\n <View\n {...(isListbox ? KEEP_FIELD_FOCUS : null)}\n ref={menuRef}\n accessibilityLabel={isListbox ? undefined : accessibilityLabel}\n accessibilityRole={isListbox ? undefined : 'menu'}\n // `portalStyle` (position:fixed at the measured rect) is appended LAST so it wins over\n // s.menu's default `position:absolute; top:100%` when portalling; null (native / no portal)\n // leaves the in-tree anchored style untouched.\n style={[s.menu, { borderColor: colors.border, backgroundColor: colors.surface }, portalStyle]}\n testID={`${testID}-menu`}\n >\n {isListbox ? (\n <Text role=\"status\" style={statusText !== undefined ? [s.option, s.optionText, { color: colors.text }] : undefined}>{statusText ?? ''}</Text>\n ) : null}\n {/* Scroll the options when they exceed the menu's maxHeight (s.menu). Without this the list was\n clipped by `overflow: hidden` with no way to reach the options below the fold. */}\n <ScrollView keyboardShouldPersistTaps=\"handled\" nestedScrollEnabled>\n {isListbox ? listboxBody : rows}\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 (usePortal && IS_WEB) return createPortal(menu, document.body);\n return menu;\n}\n\nexport default AnchoredMenu;\n","/**\n * `useThemedInput` — the shared \"readable + lively\" text-input treatment, driven entirely by\n * the active `@dloizides/ui-feedback` theme (so it re-themes per tenant, no hard-coded hex).\n *\n * At rest: dark readable text on a subtle off-white surface with a soft border.\n * On hover (web): the border strengthens a touch.\n * On focus: the border becomes the brand primary, the background brightens to the plain surface\n * (white), and a soft 3px brand-tinted focus ring fades in.\n *\n * Kept FAST: the animation is a pure GPU-cheap CSS transition on `border-color`,\n * `background-color` and `box-shadow` (the focus ring is a `box-shadow`, so it never triggers\n * layout/reflow). There is NO `Animated`, `LayoutAnimation` or JS timer — only React state\n * toggled by focus/blur/hover. Web-only style keys (`transition*`, `boxShadow`, `outlineStyle`)\n * and the mouse-hover handlers are guarded behind `Platform.OS === 'web'`, so the hook stays\n * native-safe (native simply applies the state-driven colours instantly).\n */\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { Platform, type TextInputProps, type TextStyle } from 'react-native';\n\nimport { focusRingOutline } from '@dloizides/design-tokens';\nimport { themeFocusRingColor } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\n/** The exact focus/blur event types of the installed `react-native` `TextInput` (version-safe). */\ntype FocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];\ntype BlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];\n\nconst IS_WEB = Platform.OS === 'web';\n\nconst TRANSITION_PROPERTY = 'border-color, background-color, box-shadow';\nconst TRANSITION_DURATION = '0.14s';\nconst TRANSITION_TIMING = 'ease';\nconst NO_RING = { outlineWidth: 0 };\nconst HOVER_BORDER_ALPHA = 0.22;\nconst HEX_RADIX = 16;\nconst HEX_SHORT_LENGTH = 4;\nconst HEX_FULL_LENGTH = 7;\nconst RED_START = 1;\nconst GREEN_START = 3;\nconst BLUE_START = 5;\nconst CHANNEL_END_OFFSET = 2;\n\n/**\n * Convert an `#rgb` / `#rrggbb` colour to an `rgba(...)` string at the given alpha. Any other\n * colour form (already `rgba()`, a CSS name, …) is returned unchanged — so the caller degrades\n * gracefully rather than emitting an invalid value.\n */\n/**\n * True when the user asked the OS to reduce motion (web only). Read at render so the\n * focus/hover transition collapses to an instant change for those users (WCAG 2.3.3 / the\n * `prefers-reduced-motion: reduce` contract). Safe under SSR / no `matchMedia`.\n */\nfunction prefersReducedMotion(): boolean {\n if (!IS_WEB || typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nfunction withAlpha(color: string, alpha: number): string {\n const hex = color.trim();\n const isHex = hex.charAt(0) === '#' && (hex.length === HEX_FULL_LENGTH || hex.length === HEX_SHORT_LENGTH);\n if (!isHex) return color;\n const full =\n hex.length === HEX_SHORT_LENGTH\n ? `#${hex.charAt(1)}${hex.charAt(1)}${hex.charAt(2)}${hex.charAt(2)}${hex.charAt(3)}${hex.charAt(3)}`\n : hex;\n const r = parseInt(full.slice(RED_START, RED_START + CHANNEL_END_OFFSET), HEX_RADIX);\n const g = parseInt(full.slice(GREEN_START, GREEN_START + CHANNEL_END_OFFSET), HEX_RADIX);\n const b = parseInt(full.slice(BLUE_START, BLUE_START + CHANNEL_END_OFFSET), HEX_RADIX);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n\nexport interface UseThemedInputOptions {\n /** Render with the error border colour (the brand focus border is suppressed while errored). */\n hasError?: boolean;\n /** Consumer focus handler — composed with the internal focus-state toggle. */\n onFocus?: (e: FocusEvent) => void;\n /** Consumer blur handler — composed with the internal focus-state toggle. */\n onBlur?: (e: BlurEvent) => void;\n /** `false` renders the read-only treatment: flat surface fill, no input outline, secondary ink. */\n editable?: boolean;\n}\n\nexport interface ThemedInput {\n /** The themed input style for the current focus/hover state (memoised). Merge AFTER your box style. */\n style: TextStyle;\n /**\n * The placeholder colour: the theme's `textSecondary` composited toward the field\n * background ({@link PLACEHOLDER_ALPHA}) so a placeholder reads as a faint hint, clearly\n * lighter than the solid entered text rather than looking like an already-filled value.\n */\n placeholderTextColor: string;\n isFocused: boolean;\n isHovered: boolean;\n /** Spread/attach onto the `<TextInput>` to drive the focus treatment. */\n focusBind: {\n onFocus: (e: FocusEvent) => void;\n onBlur: (e: BlurEvent) => void;\n };\n /** Web-only mouse-hover handlers, pre-typed for `<TextInput>` (an empty object on native). */\n hoverBind: TextInputProps;\n}\n\nexport function useThemedInput(options: UseThemedInputOptions = {}): ThemedInput {\n const { hasError = false, onFocus, onBlur, editable = true } = options;\n const { theme } = useUi();\n const { colors, palette } = theme;\n\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const handleFocus = useCallback(\n (e: FocusEvent) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n const handleBlur = useCallback(\n (e: BlurEvent) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n const handleHoverIn = useCallback(() => setIsHovered(true), []);\n const handleHoverOut = useCallback(() => setIsHovered(false), []);\n\n const primary = palette.primary['500'];\n const errorColor = fieldErrorInk(theme);\n\n const style = useMemo<TextStyle>(() => {\n const restBorder = hasError ? errorColor : colors.border;\n const focusBorder = hasError ? errorColor : primary;\n const editableBorder = isFocused ? focusBorder : isHovered ? withAlpha(colors.text, HOVER_BORDER_ALPHA) : restBorder;\n const borderColor = editable ? editableBorder : restBorder;\n const editableFill = isFocused ? colors.surface : colors.surfaceElevated;\n const backgroundColor = editable ? editableFill : colors.surface;\n const base: TextStyle = { color: editable ? colors.text : colors.textSecondary, borderColor, backgroundColor };\n if (!IS_WEB) return base;\n // A focused field ALWAYS gets a ring — an errored one just changes its colour to the error\n // tint (v1: `input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-tint) }`). Suppressing\n // the ring while errored, as this did, removed the focus indicator (WCAG 2.4.7) from precisely\n // the field the user was sent back to fix, at the moment they are most likely on a keyboard.\n const ringColor = hasError ? errorColor : themeFocusRingColor(theme);\n const ring = isFocused ? focusRingOutline(ringColor) : NO_RING;\n const webStyle = {\n transitionProperty: TRANSITION_PROPERTY,\n // Collapse the eased transition to instant when the user prefers reduced motion.\n transitionDuration: prefersReducedMotion() ? '0s' : TRANSITION_DURATION,\n transitionTimingFunction: TRANSITION_TIMING,\n ...ring,\n };\n return { ...base, ...webStyle } as TextStyle;\n }, [\n isFocused,\n isHovered,\n hasError,\n colors.text,\n colors.border,\n colors.surface,\n colors.surfaceElevated,\n colors.textSecondary,\n editable,\n primary,\n errorColor,\n theme,\n ]);\n\n const focusBind = useMemo(() => ({ onFocus: handleFocus, onBlur: handleBlur }), [handleFocus, handleBlur]);\n\n const hoverBind = useMemo<TextInputProps>(\n () =>\n IS_WEB ? ({ onMouseEnter: handleHoverIn, onMouseLeave: handleHoverOut } as unknown as TextInputProps) : {},\n [handleHoverIn, handleHoverOut],\n );\n\n return {\n style,\n placeholderTextColor: colors.textSecondary,\n isFocused,\n isHovered,\n focusBind,\n hoverBind,\n };\n}\n","/**\n * Validation ARIA for a form control — web only, no-op on native.\n *\n * ## Why this is here and NOT in `@dloizides/a11y`\n *\n * This looks exactly like adapter work, and moving it into the shared accessibility package\n * is the obvious next step. It would be a mistake, and the reason is worth spelling out\n * because the next person to read this will have the same instinct.\n *\n * `@dloizides/a11y` states its own invariant in `types.ts`: `A11yState` models\n * \"only the members with a faithful expression on BOTH platforms ... so a contract can never\n * promise something one platform silently drops (the exact bug class this package exists to\n * close)\". `invalid` and `required` have NO faithful React Native expression — RN's\n * `AccessibilityState` has no `invalid`, and `accessibilityRequired` does not exist. Adding\n * them to `A11yState` would make the adapter accept a contract it can only honour on web and\n * must silently discard on native. That is precisely the failure the package was built to\n * prevent, reintroduced through its own front door.\n *\n * So the seam stays here, in the package that owns form semantics, where \"web-only\" is an\n * honest local statement rather than a promise broken at a platform boundary. Consequently\n * `@dloizides/a11y` needs no version bump for this change.\n *\n * ## Why it exists at all\n *\n * The identical branch was written twice — `ThemedTextInput` and `ChipSelector` — the second\n * even documenting itself as \"the same escape-hatch-free pattern `ThemedTextInput` uses\". Two\n * copies of one rule is two places for it to drift.\n */\nimport { Platform } from 'react-native';\n\n/**\n * Web-only ARIA attributes react-native-web forwards to the underlying DOM element but that\n * RN's prop types do not enumerate. Callers cast through their own host props at the spread\n * site (never `any`), so these semantics reach a screen reader without a type escape hatch.\n */\nexport interface WebFieldA11y {\n 'aria-invalid'?: boolean;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n}\n\nexport interface WebFieldA11yInput {\n /** id of the element describing this control — typically `Field`'s error/hint line. */\n describedById?: string;\n /** Announce the control as failing validation. */\n hasError?: boolean;\n /**\n * Mark the control mandatory. Omit for controls that have no required affordance; an\n * omitted value emits nothing rather than `aria-required=\"false\"`, which would tell a\n * screen reader something different from saying nothing at all.\n */\n required?: boolean;\n}\n\nconst IS_WEB = Platform.OS === 'web';\n\n/**\n * Build the validation ARIA for a form control.\n *\n * Returns an EMPTY object on native — deliberately, and not as an oversight: there is no\n * native equivalent to emit, and inventing one would mean claiming a guarantee the platform\n * cannot keep. Every attribute is `undefined` unless genuinely true, so nothing is emitted\n * that a screen reader would have to interpret as an explicit negative.\n */\nexport function webFieldA11y({ describedById, hasError = false, required = false }: WebFieldA11yInput): WebFieldA11y {\n if (!IS_WEB) {\n return {};\n }\n return {\n 'aria-invalid': hasError ? true : undefined,\n 'aria-describedby': describedById,\n 'aria-required': required ? true : undefined,\n };\n}\n","/**\n * `ThemedTextInput` — the shared, readable + lively text-input primitive. A thin `<TextInput>`\n * wrapper that applies the `useThemedInput` treatment (dark readable text, subtle off-white rest\n * background, and the brand focus animation: indigo border + white background + soft 3px ring,\n * eased over .14s via a GPU-cheap CSS transition on web; instant, native-safe off web).\n *\n * It is the ONE source of truth for the input look: `FormField` renders it, and raw filter inputs\n * (search / country / year / date fallbacks) use it directly instead of forking the styles.\n *\n * ## The box metrics are applied HERE, and that is new\n *\n * This component claimed to be the source of truth for the input look while shipping only\n * COLOURS — no border, no radius, no padding, no height. `FormField` happened to pass its own\n * private copy of those metrics, so every input reached through `FormField` looked right and the\n * gap stayed invisible. Any caller that used `ThemedTextInput` directly — the documented, blessed\n * way to use it — got a raw browser input: **19px tall**, measured in production on an admin CMS\n * where all 10 inputs failed the hit-target floor.\n *\n * So `controlStyles.input` is now the component's own base, ahead of the caller's `style` in the\n * cascade. Callers that already passed the same metrics (`FormField`) are unaffected — the values\n * are identical, which is precisely why the duplication was invisible — and callers that pass\n * their own overrides still win, because their `style` merges after the base.\n *\n * Every existing `TextInputProps` (value, placeholder, onChangeText, testID, accessibility…) is\n * forwarded untouched; `onFocus`/`onBlur` you pass are composed with the internal focus state.\n */\nimport React from 'react';\n\nimport { StyleSheet, TextInput, type TextInputProps } from 'react-native';\n\nimport { controlStyles } from '../controls/controlStyles';\nimport { useThemedInput } from '../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\n/**\n * A multi-line box has to be tall enough to show that it IS multi-line. Left at the single-line\n * floor a textarea looks exactly like a text field, and an author writing a paragraph gets one\n * visible line. Two lines of content plus the box's own padding.\n */\nconst MULTILINE_MIN_HEIGHT = 96;\n\nconst boxStyles = StyleSheet.create({\n multiline: {\n minHeight: MULTILINE_MIN_HEIGHT,\n textAlignVertical: 'top',\n },\n});\n\nexport interface ThemedTextInputProps extends TextInputProps {\n /** Render with the error border colour (matches `FormField`'s error treatment). */\n hasError?: boolean;\n /**\n * id of an element describing this input (e.g. an error/hint line). Linked via\n * `aria-describedby` on web so a screen reader reads it after the field's name. No-op native.\n */\n describedById?: string;\n /** Marks the field required for assistive tech (`aria-required` on web). No-op on native. */\n requiredField?: boolean;\n /**\n * Opt OUT of the shared box metrics (border, radius, padding, the kit's min-height floor) and\n * render colours only — the pre-1.11 behaviour.\n *\n * For the rare control that supplies its own complete box, e.g. an input embedded inside an\n * already-bordered composite where a second border would double up. It is a prop rather than\n * the default because the default has to be the accessible one: the previous default shipped\n * 19px inputs to production precisely because \"no metrics\" was the silent fallback.\n */\n unstyledBox?: boolean;\n}\n\nexport const ThemedTextInput = React.forwardRef<TextInput, ThemedTextInputProps>(function ThemedTextInput(\n {\n hasError = false,\n describedById,\n requiredField = false,\n unstyledBox = false,\n onFocus,\n onBlur,\n style,\n placeholderTextColor,\n ...rest\n },\n ref,\n): React.ReactElement {\n const {\n style: themedStyle,\n placeholderTextColor: themedPlaceholder,\n focusBind,\n hoverBind,\n } = useThemedInput({ hasError, onFocus, onBlur, editable: rest.editable });\n\n // aria-invalid announces the error state; aria-describedby ties the error/hint text to the\n // field; aria-required marks it mandatory. Web-only (RN-web → DOM); omitted on native.\n const webA11y = webFieldA11y({ describedById, hasError, required: requiredField });\n\n // Base box FIRST so the caller's `style` still overrides it; `themedStyle` stays last because\n // the theme's colours are not the caller's to override (unchanged from previous versions).\n const boxStyle = unstyledBox ? null : controlStyles.input;\n const multilineStyle = rest.multiline === true && !unstyledBox ? boxStyles.multiline : null;\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor ?? themedPlaceholder}\n {...rest}\n {...(webA11y as TextInputProps)}\n {...hoverBind}\n onFocus={focusBind.onFocus}\n onBlur={focusBind.onBlur}\n style={[boxStyle, multilineStyle, style, themedStyle]}\n />\n );\n});\n","/**\n * `recentValuesCore` — the pure + storage-facing internals of {@link useRecentValues}, kept out of\n * the hook file so the list algebra (trim / de-dupe / promote / cap) and the `localStorage` access\n * are each unit-testable in isolation.\n *\n * ## RN-web storage reality\n *\n * `ui-forms` runs on react-native-web, so a component using this may mount on web (where\n * `window.localStorage` exists), on native (where it does NOT), or under SSR / a hardened browser\n * where touching `window.localStorage` THROWS (disabled cookies, privacy mode, quota). Every access\n * therefore goes through {@link getStorage}, which returns `null` rather than throwing, and every\n * read/write is wrapped so a storage failure degrades to an in-memory-only no-op instead of\n * exploding inside render. On native / when storage is unavailable the feature is simply inert and\n * the recents list is always `[]`.\n */\n\n/** The single namespace every persisted list lives under, so one product can never collide with another. */\nconst STORAGE_PREFIX = '@dloizides/ui-forms:recent:';\n\n/** Default cap on remembered values (most-recent-first). */\nexport const DEFAULT_MAX_RECENTS = 10;\n\n/** The full `localStorage` key for a caller's logical `key`. */\nexport function recentStorageKey(key: string): string {\n return `${STORAGE_PREFIX}${key}`;\n}\n\n/**\n * The active web `localStorage`, or `null` on native / SSR / when merely READING the property\n * throws (some browsers throw on `window.localStorage` access when storage is disabled). Never\n * throws — callers treat `null` as \"storage unavailable, no-op\".\n */\nfunction getStorage(): Storage | null {\n try {\n if (typeof window === 'undefined') return null;\n const storage = window.localStorage;\n return storage !== null && storage !== undefined ? storage : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Read the persisted list for `key`. Returns `[]` when storage is unavailable, the key is absent,\n * the stored JSON is corrupt, or the parsed value is not an array of strings — corruption is\n * tolerated, never surfaced as a throw.\n */\nexport function readRecents(key: string): string[] {\n const storage = getStorage();\n if (storage === null) return [];\n try {\n const raw = storage.getItem(recentStorageKey(key));\n if (raw === null) return [];\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) return [];\n return parsed.filter((entry): entry is string => typeof entry === 'string');\n } catch {\n return [];\n }\n}\n\n/** Persist `values` for `key`. Silent no-op when storage is unavailable or the write throws (quota). */\nexport function writeRecents(key: string, values: readonly string[]): void {\n const storage = getStorage();\n if (storage === null) return;\n try {\n storage.setItem(recentStorageKey(key), JSON.stringify(values));\n } catch {\n // Quota exceeded / storage disabled mid-session — drop the write rather than throw into render.\n }\n}\n\n/** Remove the persisted list for `key`. Silent no-op when storage is unavailable or removal throws. */\nexport function clearRecents(key: string): void {\n const storage = getStorage();\n if (storage === null) return;\n try {\n storage.removeItem(recentStorageKey(key));\n } catch {\n // Storage disabled mid-session — nothing to do.\n }\n}\n\n/**\n * The pure list algebra: fold `value` into `current`, returning the new most-recent-first list.\n *\n * - trims `value`; an empty (or whitespace-only) value is ignored, returning `current` unchanged;\n * - de-dupes case-insensitively, so \"Cyprus\" typed after \"cyprus\" does not create a second row;\n * - PROMOTES an existing (case-insensitive) match to the front, keeping the newly-typed casing;\n * - caps the result at `max` (most-recent-first), so the list can never grow without bound.\n */\nexport function computeNextRecents(current: readonly string[], value: string, max: number): string[] {\n const trimmed = value.trim();\n if (trimmed === '') return [...current];\n const lower = trimmed.toLowerCase();\n const withoutMatch = current.filter((entry) => entry.toLowerCase() !== lower);\n const promoted = [trimmed, ...withoutMatch];\n const cap = max > 0 ? max : 0;\n return promoted.slice(0, cap);\n}\n\n/** True when two lists hold the same values in the same order (reference-stability guard for state). */\nexport function recentsEqual(a: readonly string[], b: readonly string[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((entry, index) => entry === b[index]);\n}\n","/**\n * `useRecentValues` — an opt-in \"remember the last N submitted values, show them again\" store for a\n * single logical input, persisted to `localStorage` under `@dloizides/ui-forms:recent:<key>`.\n *\n * It is the engine behind {@link FormField}'s `recentKey` prop, but is exported on its own so any\n * consumer can build a bespoke recents surface. Pure + storage-guarded (see {@link recentValuesCore}):\n * on native / SSR / disabled storage it is a silent no-op that always reports `recents: []`.\n *\n * ```ts\n * const { recents, remember, clear } = useRecentValues('invoice-search');\n * // on submit / blur: remember(text); in a menu: recents.map(...); to reset: clear();\n * ```\n */\nimport { useCallback, useEffect, useState } from 'react';\n\nimport {\n DEFAULT_MAX_RECENTS,\n clearRecents,\n computeNextRecents,\n readRecents,\n recentsEqual,\n writeRecents,\n} from './recentValuesCore';\n\nexport interface RecentValues {\n /** The remembered values, most-recent-first (never longer than `max`; `[]` when storage is unavailable). */\n recents: string[];\n /** Fold a value into the list (trim / de-dupe / promote / cap) and persist. Empty values are ignored. */\n remember: (value: string) => void;\n /** Forget every remembered value for this key and clear it from storage. */\n clear: () => void;\n}\n\n/**\n * @param key logical name for this input's history (namespaced under `@dloizides/ui-forms:recent:`).\n * @param max most-recent-first cap on remembered values. Default {@link DEFAULT_MAX_RECENTS}.\n */\nexport function useRecentValues(key: string, max: number = DEFAULT_MAX_RECENTS): RecentValues {\n // Seeded from storage on first render (lazy initialiser — no read on every render).\n const [recents, setRecents] = useState<string[]>(() => readRecents(key).slice(0, max));\n\n // Re-hydrate when the key or cap changes, so switching which input this drives shows its own history.\n useEffect(() => {\n setRecents(readRecents(key).slice(0, max));\n }, [key, max]);\n\n const remember = useCallback(\n (value: string) => {\n setRecents((current) => {\n const next = computeNextRecents(current, value, max);\n // An ignored (empty) value or an already-front value yields an identical list — keep the\n // same reference so no re-render fires and no redundant write hits storage.\n if (recentsEqual(next, current)) return current;\n writeRecents(key, next);\n return next;\n });\n },\n [key, max],\n );\n\n const clear = useCallback(() => {\n clearRecents(key);\n setRecents([]);\n }, [key]);\n\n return { recents, remember, clear };\n}\n\nexport default useRecentValues;\n","/**\n * `RecentInputField` — the `ThemedTextInput` PLUS the opt-in \"recent values\" dropdown that\n * {@link FormField} renders only when a `recentKey` is supplied. Split out of `FormField` so the\n * default (no `recentKey`) path stays a plain input with ZERO extra state, refs, effects or storage\n * access, and every consumer that never opts in pays nothing.\n *\n * On focus it surfaces the values previously submitted through this key (via {@link useRecentValues})\n * in the shared {@link AnchoredMenu} — reused rather than hand-rolled, and forced through a\n * `document.body` portal (`usePortal`) so the list is never painted behind a table / card / the next\n * field (the kit's known AnchoredMenu stacking gotcha). Picking a row fills the input (`onChangeText`)\n * and closes. A value is remembered on submit (Enter) AND on blur-with-content, so both \"hit enter\"\n * and \"typed then moved on\" are captured. Colours come only from the active theme — no literals.\n */\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { ThemedTextInput, type ThemedTextInputProps } from '../ThemedTextInput/ThemedTextInput';\nimport { useRecentValues } from '../useRecentValues/useRecentValues';\n\n/** Delay before blur closes the menu, so a tap on a recent row registers first (matches TypeaheadControl). */\nconst CLOSE_DELAY_MS = 140;\n\n// Event types taken from the input's OWN prop signatures, so they track the installed react-native\n// version exactly (focus/blur/submit event shapes have drifted between RN releases).\ntype FocusEvent = Parameters<NonNullable<ThemedTextInputProps['onFocus']>>[0];\ntype BlurEvent = Parameters<NonNullable<ThemedTextInputProps['onBlur']>>[0];\ntype SubmitEvent = Parameters<NonNullable<ThemedTextInputProps['onSubmitEditing']>>[0];\n\nexport interface RecentInputFieldProps extends ThemedTextInputProps {\n /** Namespace under which this input's submitted values are remembered. */\n recentKey: string;\n /** Cap on remembered values (most-recent-first). Defaults to the hook's own default. */\n recentMax?: number;\n /** The field's accessible name — used to build the recents menu/row a11y strings. */\n label: string;\n}\n\nexport function RecentInputField({\n recentKey,\n recentMax,\n label,\n value,\n testID,\n onChangeText,\n onSubmitEditing,\n onFocus,\n onBlur,\n ...rest\n}: RecentInputFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const { recents, remember } = useRecentValues(recentKey, recentMax);\n\n const anchorRef = useRef<View>(null);\n // Latest text, tracked independently of whether the field is controlled, so blur/submit can\n // remember the right value even when the parent does not pass `value`.\n const latestText = useRef<string>(typeof value === 'string' ? value : '');\n const [isOpen, setIsOpen] = useState(false);\n\n const handleChange = useCallback(\n (text: string) => {\n latestText.current = text;\n onChangeText?.(text);\n },\n [onChangeText],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent) => {\n setIsOpen(true);\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: BlurEvent) => {\n const blurredText = latestText.current;\n setTimeout(() => {\n setIsOpen(false);\n if (blurredText.trim() !== '') remember(blurredText);\n }, CLOSE_DELAY_MS);\n onBlur?.(event);\n },\n [remember, onBlur],\n );\n\n const handleSubmit = useCallback(\n (event: SubmitEvent) => {\n remember(latestText.current);\n setIsOpen(false);\n onSubmitEditing?.(event);\n },\n [remember, onSubmitEditing],\n );\n\n const pick = useCallback(\n (picked: string) => {\n latestText.current = picked;\n onChangeText?.(picked);\n remember(picked);\n setIsOpen(false);\n },\n [onChangeText, remember],\n );\n\n const options: ControlOption[] = recents.map((entry) => ({ label: entry, value: entry }));\n const showMenu = isOpen && options.length > 0;\n const recentTestID = testID !== undefined ? `${testID}-recent` : 'form-field-recent';\n\n return (\n <View ref={anchorRef} style={s.anchor}>\n <ThemedTextInput\n {...rest}\n testID={testID}\n value={value}\n onChangeText={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onSubmitEditing={handleSubmit}\n />\n {showMenu ? (\n <AnchoredMenu\n accessibilityLabel={`Recent ${label} values`}\n anchorRef={anchorRef}\n colors={{ text: colors.text, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n onDismiss={() => setIsOpen(false)}\n onSelect={pick}\n optionHint={`Fill ${label} with this recent value`}\n options={options}\n selectedValue={typeof value === 'string' ? value : ''}\n testID={recentTestID}\n // Portal to document.body: the recents list sits above later-painting content (rows, cards,\n // the next field). Without the portal RN-web's trapped z-index paints it behind them.\n usePortal\n />\n ) : null}\n </View>\n );\n}\n\nexport default RecentInputField;\n","const INPUT_SIDE_INSET = 26;\nconst AVERAGE_CHAR_WIDTH = 8.4;\nconst SPARE_ROWS = 1;\n\n/** The narrowest text box the app draws, used until the real width is measured. */\nexport const NARROWEST_INPUT_WIDTH = 296;\n\n/** The rows a text box needs to show all of its text once wrapped at its width. */\nexport function rowsForText(text: string, inputWidth: number, minRows: number): number {\n const charsPerLine = Math.max(1, Math.floor((inputWidth - INPUT_SIDE_INSET) / AVERAGE_CHAR_WIDTH));\n const wrappedLines = text\n .split('\\n')\n .reduce((rows, line) => rows + Math.max(1, Math.ceil(line.length / charsPerLine)), 0);\n return Math.max(minRows, wrappedLines + SPARE_ROWS);\n}\n","import { useCallback, useState } from 'react';\n\nimport { type LayoutChangeEvent } from 'react-native';\n\nimport { NARROWEST_INPUT_WIDTH, rowsForText } from './textRows';\n\nexport interface AutoGrowRows {\n numberOfLines: number;\n onLayout: (event: LayoutChangeEvent) => void;\n}\n\n/** The rows a multi-line box needs for its text at its measured width, and the layout handler that measures it. */\nexport function useAutoGrowRows(text: string, minRows: number): AutoGrowRows {\n const [inputWidth, setInputWidth] = useState(NARROWEST_INPUT_WIDTH);\n const onLayout = useCallback((event: LayoutChangeEvent) => {\n setInputWidth(event.nativeEvent.layout.width);\n }, []);\n return { numberOfLines: rowsForText(text, inputWidth, minRows), onLayout };\n}\n","/**\r\n * Reusable form field — labelled text input with optional required mark + error.\r\n *\r\n * The label row, the required mark, the error line and the container spacing all come from the\r\n * generic `Field` wrapper, so a `FormField` and a `Field`-wrapped dropdown sitting next to each\r\n * other line up exactly and can never drift apart. FormField only adds the control itself.\r\n *\r\n * The input is the shared `ThemedTextInput` primitive, so every FormField gets the readable +\r\n * lively treatment (dark text, subtle off-white rest background, brand focus animation with a\r\n * soft ring) for free, driven by the active theme.\r\n */\r\nimport React from 'react';\r\n\r\nimport { type TextInput, type TextInputProps, type ViewStyle } from 'react-native';\r\n\r\nimport { Field } from '../Field/Field';\r\nimport type { FieldLabelVariant } from '../Field/labelVariants';\r\nimport { RecentInputField } from './RecentInputField';\r\nimport { ThemedTextInput } from '../ThemedTextInput/ThemedTextInput';\r\nimport { useAutoGrowRows } from './useAutoGrowRows';\r\n\r\n/**\r\n * The private `styles.input` that used to live here — padding 10/12, radius 8, border 1 — was a\r\n * verbatim duplicate of `controlStyles.input`, and `ThemedTextInput` now applies that itself. The\r\n * duplication is what hid the real defect: because `FormField` supplied metrics, inputs reached\r\n * through it looked correct, while every DIRECT `ThemedTextInput` caller got an unstyled 19px box\r\n * and nobody could see the difference from in here.\r\n */\r\nexport interface FormFieldProps extends Omit<TextInputProps, 'style'> {\r\n label: string;\r\n /**\r\n * Hide the VISIBLE label row while keeping the accessible name.\r\n *\r\n * For a field whose placeholder already names it (a toolbar search box, an inline\r\n * filter) the stacked visible label both wastes a row and misaligns the input\r\n * against a bare button beside it. Setting this drops ONLY the visible `<label>`:\r\n * the input still carries `accessibilityLabel={label}`, so a screen reader reads\r\n * the same name and `label` stays REQUIRED — you never lose the accessible name by\r\n * blanking it, which is the trap this option exists to remove. Default `false`.\r\n */\r\n labelHidden?: boolean;\r\n required?: boolean;\r\n error?: string;\r\n containerStyle?: ViewStyle;\r\n /**\r\n * OPT-IN \"recent values\" behaviour. When set, the values submitted through this field are\r\n * remembered (per this key) and offered in a dropdown on focus; picking one fills the input.\r\n * Values are recorded on submit (Enter) and on blur-with-content. Persisted to `localStorage`\r\n * under `@dloizides/ui-forms:recent:<recentKey>`; a silent no-op on native / when storage is\r\n * unavailable.\r\n *\r\n * Leave it UNSET (the default) and the field behaves exactly as before — nothing rendered, no\r\n * storage touched. NEVER set it on a password / secure field: recents must not persist secrets.\r\n */\r\n recentKey?: string;\r\n /** Cap on remembered values when {@link recentKey} is set (most-recent-first). Default 10. */\r\n recentMax?: number;\r\n /** Reaches the input, for focusing it without scrolling the page. Not forwarded when `recentKey` is set. */\r\n inputRef?: React.Ref<TextInput>;\r\n /** Grows a multi-line box to fit its text, so nothing scrolls inside it; never fewer rows than this. */\r\n autoGrowMinRows?: number;\r\n labelVariant?: FieldLabelVariant;\r\n}\r\n\r\ntype PlainFormFieldProps = Omit<FormFieldProps, 'autoGrowMinRows'>;\r\n\r\nconst PlainFormField = ({\r\n label,\r\n labelHidden = false,\r\n required = false,\r\n error,\r\n containerStyle,\r\n recentKey,\r\n recentMax,\r\n inputRef,\r\n labelVariant,\r\n ...textInputProps\r\n}: PlainFormFieldProps): React.ReactElement => (\r\n <Field\r\n containerStyle={containerStyle}\r\n error={error}\r\n // An undefined label renders NO label row (see Field): that is how the visible\r\n // label is hidden. The accessible name is kept on the input below, so hiding\r\n // the label never strips the name.\r\n label={labelHidden ? undefined : label}\r\n labelVariant={labelVariant}\r\n required={required}\r\n >\r\n {({ describedById, hasError, controlId }) => {\r\n // Shared props for either input path — identical wiring, so a field looks and behaves the\r\n // same whether or not it opts into recents.\r\n const inputProps = {\r\n accessibilityHint: `Enter ${label}`,\r\n accessibilityLabel: label,\r\n describedById,\r\n hasError,\r\n id: controlId,\r\n requiredField: required,\r\n testID: 'form-field-input',\r\n ...textInputProps,\r\n };\r\n // recentKey set → the recents-enabled input; unset → the plain input, unchanged from before\r\n // (no extra state/refs/effects/storage — the default path pays nothing).\r\n return recentKey !== undefined && recentKey !== '' ? (\r\n <RecentInputField label={label} recentKey={recentKey} recentMax={recentMax} {...inputProps} />\r\n ) : (\r\n <ThemedTextInput ref={inputRef} {...inputProps} />\r\n );\r\n }}\r\n </Field>\r\n);\r\n\r\nconst AutoGrowFormField = ({\r\n minRows,\r\n ...fieldProps\r\n}: PlainFormFieldProps & { minRows: number }): React.ReactElement => {\r\n const grow = useAutoGrowRows(fieldProps.value ?? '', minRows);\r\n return (\r\n <PlainFormField\r\n {...fieldProps}\r\n multiline\r\n numberOfLines={grow.numberOfLines}\r\n onLayout={grow.onLayout}\r\n />\r\n );\r\n};\r\n\r\nexport const FormField = ({ autoGrowMinRows, ...fieldProps }: FormFieldProps): React.ReactElement =>\r\n autoGrowMinRows === undefined ? (\r\n <PlainFormField {...fieldProps} />\r\n ) : (\r\n <AutoGrowFormField {...fieldProps} minRows={autoGrowMinRows} />\r\n );\r\n\r\nexport default FormField;\r\n","import { StyleSheet } from 'react-native';\n\nconst TEXT_INPUT_HEIGHT = 48;\n\nconst styles = StyleSheet.create({\n track: { padding: 0, borderWidth: 0 },\n besideTextInput: {\n padding: 0,\n borderWidth: 0,\n minHeight: TEXT_INPUT_HEIGHT,\n alignItems: 'stretch',\n },\n});\n\nexport const SEGMENT_BESIDE_FIELD = styles.track;\nexport const SEGMENT_BESIDE_TEXT_INPUT = styles.besideTextInput;\n","/** Shared ChipSelector constants. */\n\nexport const TRANSPARENT_COLOR = 'transparent';\n\n/**\n * Extra touch margin around a chip. NATIVE ONLY — this does NOT widen the hit area on RN-web,\n * which is what these portals ship. Measured 2026-09-21 (headless Chromium, 360x640):\n * `elementFromPoint` 5px above a chip's top edge, inside `top: 10`, returns the parent, not the\n * chip. react-native-web 0.21.2 uses `hitSlop` only in the legacy `Touchable` press-retention\n * path and ignores it entirely in `Pressable`. The web target is carried by `minHeight:\n * MIN_TARGET_PX` in `chipStyles`; this constant only helps iOS/Android.\n */\nexport const CHIP_HIT_SLOP = { top: 10, bottom: 10, left: 4, right: 4 } as const;\n\n/** Gap between adjacent chips, horizontally and between wrapped rows. */\nexport const CHIP_GUTTER = 8;\n\n/**\n * Default chip testID stem. NOT derived from the `testID` prop, because aml-v2's unit +\n * Playwright specs and erevna/katalogos's `Accessibility.test.tsx` already select on\n * `chip-selector-chip-<value>`. `chipTestIDPrefix` is the opt-in override for consumers\n * (kefi) that need their own stem; the default is frozen.\n */\nexport const DEFAULT_CHIP_TESTID_PREFIX = 'chip-selector-chip';\n","/** How a long chip label fits: `None` (default) grows the chip, `Wrap` and `Truncate` cap it at its container. */\nexport const enum ChipLabelWrap {\n None = 'none',\n Wrap = 'wrap',\n Truncate = 'truncate',\n}\n","import type { TextStyle, ViewStyle } from 'react-native';\n\nimport { ChipLabelWrap } from '../ChipLabelWrap';\n\nexport interface ChipLabelLayout {\n boxStyle: ViewStyle | undefined;\n textStyle: TextStyle | undefined;\n numberOfLines: number | undefined;\n}\n\nconst CAPPED_BOX: ViewStyle = { maxWidth: '100%', flexShrink: 1 };\nconst SHRINKING_TEXT: TextStyle = { flexShrink: 1 };\nconst SINGLE_LINE = 1;\n\n/** Resolves a chip's box and label layout for its `labelWrap` mode; `none` keeps today's render. */\nexport function chipLabelLayout(labelWrap: ChipLabelWrap | undefined): ChipLabelLayout {\n if (labelWrap === ChipLabelWrap.Wrap)\n return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: undefined };\n if (labelWrap === ChipLabelWrap.Truncate)\n return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };\n\n return { boxStyle: undefined, textStyle: undefined, numberOfLines: undefined };\n}\n","import { StyleSheet } from 'react-native';\n\nconst MIN_TARGET_PX = 44;\nconst COMPACT_PAD_V = 4;\nconst COMPACT_PAD_H = 10;\nconst COMPACT_FONT_SIZE = 12;\nconst COMPACT_LINE_HEIGHT = 18;\nconst CHIP_BORDER = 1;\n\n/** Compact size: a 28 px pill drawn inside a transparent hit box of at least 44x44 (web and native). */\nexport const chipSizeStyles = StyleSheet.create({\n compactHitBox: {\n minHeight: MIN_TARGET_PX,\n minWidth: MIN_TARGET_PX,\n justifyContent: 'center',\n alignItems: 'center',\n },\n compactVisual: {\n paddingVertical: COMPACT_PAD_V,\n paddingHorizontal: COMPACT_PAD_H,\n minHeight: 0,\n minWidth: 0,\n borderWidth: CHIP_BORDER,\n },\n compactText: {\n fontSize: COMPACT_FONT_SIZE,\n fontWeight: '600',\n lineHeight: COMPACT_LINE_HEIGHT,\n },\n});\n","import type { StyleProp, TextStyle, ViewStyle } from 'react-native';\n\nimport { chipSizeStyles } from '../components/chipSizeStyles';\nimport type { ChipSize } from '../ChipSize';\n\nexport interface ChipFill {\n backgroundColor: string;\n textColor: string;\n checkColor: string | undefined;\n}\n\nexport interface ChipSizeLook {\n hitBox: StyleProp<ViewStyle>;\n visual: StyleProp<ViewStyle>;\n text: StyleProp<TextStyle>;\n}\n\ninterface FillInput {\n selected: boolean;\n selectedFill: string | undefined;\n ink: string;\n rest: { backgroundColor: string; textColor: string };\n}\n\n/** The chip's fill: the variant's own colours, or `selectedFill` plus a check mark when selected. */\nexport function chipFill({ selected, selectedFill, ink, rest }: FillInput): ChipFill {\n if (!selected || selectedFill === undefined)\n return { ...rest, checkColor: undefined };\n\n return { backgroundColor: selectedFill, textColor: ink, checkColor: ink };\n}\n\n/** The extra box and text styles for a chip size; `default` adds none. */\nexport function chipSizeLook(size: ChipSize): ChipSizeLook {\n if (size !== 'compact')\n return { hitBox: undefined, visual: undefined, text: undefined };\n\n return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };\n}\n","import { StyleSheet } from 'react-native';\n\nimport { TRANSPARENT_COLOR } from '../constants';\n\nconst SOLID_RADIUS = 20;\nconst OUTLINE_RADIUS = 999;\nconst OUTLINE_PAD_H = 12;\nconst OUTLINE_PAD_V = 5;\nconst OUTLINE_FONT_SIZE = 13;\n/** Gap between an option's icon and its label. */\nconst CHIP_ICON_GAP = 6;\n/**\n * WCAG minimum touch-target edge, in CSS px. Source of truth is `MIN_TARGET_PX` in\n * `@dloizides/ui-layout`; duplicated here as a local constant rather than taking a whole\n * dependency for one integer. Keep the two in step if ui-layout ever changes it.\n *\n * Needed because `hitSlop` is NATIVE-ONLY: measured 2026-09-21 in headless Chromium at 360px,\n * `document.elementFromPoint` 5px above a chip (inside `CHIP_HIT_SLOP.top: 10`) returns the\n * PARENT, not the chip. react-native-web 0.21.2 references `hitSlop` only in the legacy\n * `Touchable` mixin's press-RETENTION path and not at all in `Pressable`, so on web the\n * rendered box IS the whole tappable area.\n */\nconst MIN_TARGET_PX = 44;\n\nexport const chipStyles = StyleSheet.create({\n chip: {\n paddingHorizontal: 12,\n paddingVertical: 6,\n minHeight: MIN_TARGET_PX,\n minWidth: MIN_TARGET_PX,\n justifyContent: 'center',\n borderRadius: SOLID_RADIUS,\n backgroundColor: TRANSPARENT_COLOR,\n borderWidth: 1,\n },\n chipOutline: {\n paddingHorizontal: OUTLINE_PAD_H,\n paddingVertical: OUTLINE_PAD_V,\n minHeight: MIN_TARGET_PX,\n minWidth: MIN_TARGET_PX,\n justifyContent: 'center',\n borderRadius: OUTLINE_RADIUS,\n borderWidth: 1,\n },\n chipContent: { flexDirection: 'row', alignItems: 'center', gap: CHIP_ICON_GAP },\n chipText: {},\n chipTextOutline: { fontSize: OUTLINE_FONT_SIZE },\n});\n","import React from 'react';\n\nimport { Text, View, type StyleProp, type TextStyle } from 'react-native';\n\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { chipStyles } from './chipStyles';\n\nconst CHECK_SIZE = 12;\n\ninterface ChipContentProps {\n icon: React.ReactNode;\n label: string;\n textStyle: StyleProp<TextStyle>;\n numberOfLines?: number;\n checkColor?: string;\n checkTestID: string;\n}\n\n/** Chip label, preceded by a check mark when `checkColor` is set and the option's decorative icon. */\nexport function ChipContent(props: ChipContentProps): React.ReactElement {\n const { icon, label, textStyle, numberOfLines, checkColor } = props;\n const text = (\n <Text numberOfLines={numberOfLines} style={textStyle}>\n {label}\n </Text>\n );\n const hasIcon = icon !== undefined && icon !== null;\n if (!hasIcon && checkColor === undefined)\n return text;\n\n return (\n <View style={chipStyles.chipContent}>\n {checkColor === undefined ? null : (\n <View aria-hidden={true} testID={props.checkTestID}>\n <SvgIcon color={checkColor} name=\"check\" size={CHECK_SIZE} />\n </View>\n )}\n {hasIcon ? <View aria-hidden={true}>{icon}</View> : null}\n {text}\n </View>\n );\n}\n","import React from 'react';\n\nimport { Pressable, View } from 'react-native';\n\nimport { CHIP_HIT_SLOP } from '../constants';\nimport type { ChipProps } from '../types';\n\nimport { chipLabelLayout } from '../utils/chipLabelLayout';\nimport { chipFill, chipSizeLook } from '../utils/chipLook';\r\n\nimport { ChipContent } from './ChipContent';\nimport { chipStyles } from './chipStyles';\n\n/** A single outline chip — owns its own hover state (web) for the border/ink lift. */\nexport function OutlineChip<T extends string | number>(props: ChipProps<T>): React.ReactElement {\n const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;\n const [hovered, setHovered] = React.useState(false);\n const active = selected || hovered;\n\n const borderColor = active ? colors.primary : colors.border;\n const fill = chipFill({\r\n selected,\r\n selectedFill: props.selectedFill,\r\n ink: colors.textStrong,\r\n rest: { backgroundColor: selected ? colors.tint : colors.muted, textColor: active ? colors.primary : colors.textMuted },\r\n });\r\n const sized = chipSizeLook(props.size);\r\n const layout = chipLabelLayout(option.labelWrap);\n\n return (\n <Pressable\n ref={props.hostRef}\n accessibilityHint={accessibilityHint}\n accessibilityLabel={option.label}\n accessibilityRole={props.accessibilityRole}\n accessibilityState={{ selected, disabled }}\n aria-checked={props.ariaChecked}\n aria-pressed={props.ariaPressed}\n disabled={disabled}\n hitSlop={CHIP_HIT_SLOP}\n style={[sized.hitBox, layout.boxStyle]}\r\n tabIndex={props.tabIndex}\n testID={testID}\n onHoverIn={() => setHovered(true)}\n onHoverOut={() => setHovered(false)}\n onPress={onPress}\n >\n <View style={[chipStyles.chipOutline, sized.visual, { borderColor, backgroundColor: fill.backgroundColor }, layout.boxStyle]}>\r\n <ChipContent\n checkColor={fill.checkColor}\r\n checkTestID={`${testID}-check`}\r\n icon={option.icon}\n label={option.label}\n numberOfLines={layout.numberOfLines}\n textStyle={[chipStyles.chipText, chipStyles.chipTextOutline, sized.text, { color: fill.textColor }, layout.textStyle]}\r\n />\n </View>\n </Pressable>\n );\n}\n","import React from 'react';\n\nimport { TouchableOpacity, View, type ViewProps } from 'react-native';\n\nimport { CHIP_HIT_SLOP, TRANSPARENT_COLOR } from '../constants';\nimport type { ChipProps } from '../types';\n\nimport { chipLabelLayout } from '../utils/chipLabelLayout';\nimport { chipFill, chipSizeLook } from '../utils/chipLook';\r\n\nimport { ChipContent } from './ChipContent';\nimport { chipStyles } from './chipStyles';\n\n/** A single solid chip — the original filled-pill look (unchanged for existing consumers). */\nexport function SolidChip<T extends string | number>(props: ChipProps<T>): React.ReactElement {\n const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;\n const fill = chipFill({\r\n selected,\r\n selectedFill: props.selectedFill,\r\n ink: colors.textStrong,\r\n rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong },\r\n });\r\n const sized = chipSizeLook(props.size);\r\n const layout = chipLabelLayout(option.labelWrap);\n // RNW forwards `tabIndex` to the DOM, but RN's TouchableOpacity types omit it (ViewProps has it).\n const rovingTabStop: Pick<ViewProps, 'tabIndex'> = { tabIndex: props.tabIndex };\n return (\n <TouchableOpacity\n ref={props.hostRef}\n accessibilityHint={accessibilityHint}\n accessibilityLabel={option.label}\n accessibilityRole={props.accessibilityRole}\n accessibilityState={{ selected, disabled }}\n aria-checked={props.ariaChecked}\n aria-pressed={props.ariaPressed}\n disabled={disabled}\n hitSlop={CHIP_HIT_SLOP}\n style={[sized.hitBox, layout.boxStyle]}\r\n testID={testID}\n onPress={onPress}\n {...rovingTabStop}\n >\n <View style={[chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle]}>\r\n <ChipContent\n checkColor={fill.checkColor}\r\n checkTestID={`${testID}-check`}\r\n icon={option.icon}\n label={option.label}\n numberOfLines={layout.numberOfLines}\n textStyle={[chipStyles.chipText, sized.text, { color: fill.textColor }, layout.textStyle]}\r\n />\n </View>\n </TouchableOpacity>\n );\n}\n","/**\n * Pure key logic for the WAI-ARIA radio group pattern used by ChipSelector's opt-in radio mode.\n * Kept free of React and the DOM so every branch is unit-testable without rendering.\n */\n\nconst SPACE_KEYS: readonly string[] = [' ', 'Spacebar'];\nconst NEXT_KEYS: readonly string[] = ['ArrowRight', 'ArrowDown'];\nconst PREVIOUS_KEYS: readonly string[] = ['ArrowLeft', 'ArrowUp'];\nconst ROVING_TAB_STOP = 0;\nconst ROVING_SKIPPED = -1;\n\n/**\n * The option index a radio group should select when `key` is pressed on the chip at `index`,\n * or `null` when the key is not part of the pattern.\n *\n * - Space activates the focused chip (returns `index`).\n * - ArrowRight/ArrowDown → next chip, ArrowLeft/ArrowUp → previous, wrapping at both ends.\n * - Enter is deliberately `null`: RNW's press responder already activates a `<div>` chip on\n * Enter, so handling it here would fire `onChange` twice.\n * - Arrows in a one-chip group are `null` — there is nowhere to move, so nothing is selected.\n */\nexport function radioKeyTarget(key: string, index: number, count: number): number | null {\n const isOutOfRange = index < 0 || index >= count;\n if (isOutOfRange)\n return null;\n\n if (SPACE_KEYS.includes(key))\n return index;\n\n const isArrow = NEXT_KEYS.includes(key) || PREVIOUS_KEYS.includes(key);\n if (!isArrow || count === 1)\n return null;\n\n const step = NEXT_KEYS.includes(key) ? 1 : -1;\n return (index + step + count) % count;\n}\n\n/**\n * Roving tabindex: only the selected chip — or the first chip when nothing is selected — is a\n * tab stop. A disabled group has no tab stop at all.\n */\nexport function radioTabIndex(index: number, selectedIndex: number, disabled: boolean): 0 | -1 {\n if (disabled)\n return ROVING_SKIPPED;\n\n const tabStop = selectedIndex >= 0 ? selectedIndex : 0;\n return index === tabStop ? ROVING_TAB_STOP : ROVING_SKIPPED;\n}\n","/**\n * Keyboard + focus wiring for ChipSelector's opt-in radio group.\n *\n * One `onKeyDown` sits on the radiogroup container and catches the key events bubbling up from\n * the focused chip. It lives on the GROUP, not the chip, because RNW's `TouchableOpacity` spreads\n * its press handlers AFTER the caller's props — a chip-level `onKeyDown` on the solid variant is\n * silently overwritten. The focused chip is identified by matching `event.target` against the\n * host nodes registered through `chipRef`.\n */\nimport React from 'react';\n\nimport type { ViewProps } from 'react-native';\n\nimport { radioKeyTarget, radioTabIndex } from '../utils/radioKeyboard';\n\ninterface FocusableNode {\n focus?: () => void;\n}\n\ninterface RadioKeyEvent {\n key: string;\n target: unknown;\n preventDefault: () => void;\n}\n\nexport interface RadioKeyboardConfig<T> {\n /** `false` for button / multi-select groups: the hook then emits nothing at all. */\n enabled: boolean;\n disabled: boolean;\n values: T[];\n /** Index of the selected option, or `-1` when nothing is selected. */\n selectedIndex: number;\n onChange: (value: T) => void;\n}\n\nexport interface RadioKeyboard {\n /** Ref callback factory registering the host node of the chip at `index`. */\n chipRef: (index: number) => (node: unknown) => void;\n /** Roving tabindex for the chip at `index`; `undefined` when radio mode is off. */\n tabIndexFor: (index: number) => 0 | -1 | undefined;\n /** Web props for the group container (`onKeyDown` in radio mode, nothing otherwise). */\n groupProps: ViewProps;\n}\n\nconst NO_GROUP_PROPS: ViewProps = {};\n\nexport function useRadioKeyboard<T>(config: RadioKeyboardConfig<T>): RadioKeyboard {\n const { enabled, disabled, values, selectedIndex, onChange } = config;\n const nodes = React.useRef<unknown[]>([]);\n\n const chipRef = React.useCallback((index: number) => (node: unknown): void => {\n nodes.current[index] = node;\n }, []);\n\n const onKeyDown = (event: RadioKeyEvent): void => {\n if (disabled)\n return;\n\n const index = nodes.current.indexOf(event.target);\n const target = radioKeyTarget(event.key, index, values.length);\n const nextValue = target === null ? undefined : values[target];\n if (target === null || nextValue === undefined)\n return;\n\n // Stops Space scrolling the page and arrows scrolling a scroll container.\n event.preventDefault();\n if (target !== index)\n (nodes.current[target] as FocusableNode | null | undefined)?.focus?.();\n\n onChange(nextValue);\n };\n\n return {\n chipRef,\n tabIndexFor: (index) => (enabled ? radioTabIndex(index, selectedIndex, disabled) : undefined),\n // `onKeyDown` is a web-only View prop RN's types do not declare; RNW forwards it to the DOM.\n groupProps: enabled ? ({ onKeyDown } as unknown as ViewProps) : NO_GROUP_PROPS,\n };\n}\n","/** Theme → chip colour resolution for both ChipSelector variants. */\nimport type { ChipColors } from '../types';\n\nconst WHITE_COLOR = '#fff';\nconst OUTLINE_TINT_ALPHA = 0.1;\nconst HEX_SHORT_LENGTH = 3;\nconst HEX_RADIX = 16;\nconst RGB_R_START = 0;\nconst RGB_R_END = 2;\nconst RGB_G_END = 4;\nconst RGB_B_END = 6;\n\n/** Palette scale carrying the ink for content sitting ON the brand colour. */\nconst ON_BRAND_SCALE = 'onBrand';\n/** The one step every theme scale is guaranteed to define. */\nconst MAIN_STEP = '500';\n\n/**\n * Read the on-brand ink out of a theme palette.\n *\n * Deliberately typed as OPTIONAL rather than read through `palette.onBrand`. Two reasons:\n * this package's declared peer floor is `ui-feedback >= 1.1.0`, whose palette type has no\n * index signature at all; and even on current versions the index signature types every\n * scale as present, which is a lie — only `primary` is guaranteed, and most apps in the\n * fleet publish no `onBrand` scale today. Modelling it as absent-able is what makes the\n * `WHITE_COLOR` fallback honest instead of dead code.\n */\nfunction onBrandInk(palette: object): string {\n const scales = palette as Record<string, Record<string, string> | undefined>;\n return scales[ON_BRAND_SCALE]?.[MAIN_STEP] ?? WHITE_COLOR;\n}\n\n/** Composite a hex colour over the background at a given alpha (theme-driven tint). */\nfunction withAlpha(hex: string, alpha: number): string {\n const normalized = hex.replace('#', '');\n const isShort = normalized.length === HEX_SHORT_LENGTH;\n const full = isShort ? normalized.split('').map((c) => c + c).join('') : normalized;\n const r = parseInt(full.slice(RGB_R_START, RGB_R_END), HEX_RADIX);\n const g = parseInt(full.slice(RGB_R_END, RGB_G_END), HEX_RADIX);\n const b = parseInt(full.slice(RGB_G_END, RGB_B_END), HEX_RADIX);\n const isValid = !Number.isNaN(r) && !Number.isNaN(g) && !Number.isNaN(b);\n return isValid ? `rgba(${r}, ${g}, ${b}, ${alpha})` : hex;\n}\n\ninterface ThemeColorsInput {\n border: string;\n text: string;\n textSecondary: string;\n background: string;\n}\n\n/** Resolve the colours both chip variants read, from the active theme's colours + palette. */\nexport function buildChipColors(\n colors: ThemeColorsInput,\n palette: { primary: { 500: string } },\n): ChipColors {\n const primary = palette.primary[500];\n return {\n border: colors.border,\n textStrong: colors.text,\n textMuted: colors.textSecondary,\n primary,\n onPrimary: onBrandInk(palette),\n muted: colors.background,\n tint: withAlpha(primary, OUTLINE_TINT_ALPHA),\n };\n}\n","import type { ChipOption, ChipProps } from '../types';\n\n/**\n * The a11y + testID triple a chip needs, resolved once for both variants.\n *\n * Exported for direct unit testing. It has to be tested as a pure function rather than\n * through the DOM because react-native-web DROPS `accessibilityHint` entirely — it reaches\n * native, but no web attribute carries it, so no rendering assertion can tell a correctly\n * threaded hint from one that was never passed. Testing the resolver is the only honest way\n * to pin the behaviour.\n */\nexport function chipIdentity<T>(\n option: ChipOption<T>,\n selected: boolean,\n config: { prefix: string; hint?: string; multiple: boolean; radio?: boolean },\n): Pick<ChipProps<T>, 'testID' | 'accessibilityHint' | 'ariaPressed' | 'accessibilityRole' | 'ariaChecked'> {\n const isRadio = config.radio === true && !config.multiple;\n return {\n testID: `${config.prefix}-${String(option.value)}`,\n // The English default is retained verbatim: erevna/katalogos assert the exact string\n // `Selects Red`. Consumers that localize pass `optionAccessibilityHint`.\n accessibilityHint: config.hint ?? `Selects ${option.label}`,\n ariaPressed: config.multiple ? selected : undefined,\n accessibilityRole: isRadio ? 'radio' : 'button',\n ariaChecked: isRadio ? selected : undefined,\n };\n}\n","/**\n * Chip/pill selector for selecting one or multiple options.\n *\n * Two visual variants (both fully theme-driven):\n * - `solid` (default) — the original filled-pill look: selected = solid primary fill with\n * white ink. Unchanged, so existing consumers (erevna / katalogos / kefi) render identically.\n * - `outline` — the AML v1 console look: an outlined pill on a muted fill; selected = a subtle\n * tinted-outline (primary border + primary ink + a low-alpha primary wash), NOT a solid fill.\n * Hover (web) lifts the border/ink to the primary colour.\n *\n * The label row, the error line and the container spacing come from the shared `Field` wrapper —\n * NOT from a local `<Text>`. Its own label used to drift from `Field` on three of four axes\n * (`marginBottom: 8` vs 4, no `fontSize` at all so ~14 vs 13, `colors.text` vs `textSecondary`),\n * so a `ChipSelector` next to a `FormField` in a row/grid started a different distance down the\n * column and read as a different weight of text. Now there is exactly one label implementation.\n *\n * Structure: chip variants in `components/`, the radio keyboard wiring in `hooks/`, and the pure\n * resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.\n */\nimport React from 'react';\n\nimport { StyleSheet, View, type ViewProps } from 'react-native';\n\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { Field } from '../Field/Field';\n\nimport { OutlineChip } from './components/OutlineChip';\nimport { SolidChip } from './components/SolidChip';\nimport { CHIP_GUTTER, DEFAULT_CHIP_TESTID_PREFIX } from './constants';\nimport { useRadioKeyboard } from './hooks/useRadioKeyboard';\nimport type { ChipColors, ChipOption, ChipSelectorProps } from './types';\nimport { buildChipColors } from './utils/chipColors';\nimport { chipIdentity } from './utils/chipIdentity';\n\nconst styles = StyleSheet.create({\n chipContainer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n // `gap`, NOT per-chip margins plus a compensating negative container margin.\n //\n // The old form was `chipWrapper { marginRight: 8, marginBottom: 8 }` with\n // `chipContainer { marginBottom: -8 }`. Its comment blamed `Field`'s 16px container margin —\n // that was WRONG, and worth recording: F3 was briefed on the belief that the -8 compensated for\n // `Field` and had to move in lockstep with it. It did not. -8 cancelled the CHIP's own gutter\n // hanging off the last row, identically whether `Field` contributed 16, 0, or anything else.\n //\n // The pair is still the wrong tool: it holds only while the two constants agree, and it leaves\n // a real negative margin any measuring parent inherits. `gap` produces the byte-identical box\n // and is correct under BOTH of `Field`'s spacing models, not just the one it was tuned against.\n gap: CHIP_GUTTER,\n },\n});\n\n/*\n * `groupA11yProps` + its local `WebGroupA11y` type used to live here — a copy of\n * ThemedTextInput's branch, as its own comment admitted. Both now call `webFieldA11y`.\n * The chip group passes no `required`, so nothing is emitted for it, exactly as before.\n */\n\nexport const ChipSelector = <T extends string | number>({\n label,\n options,\n value,\n onChange,\n multiple = false,\n disabled = false,\n variant = 'solid',\n containerStyle,\n spacing,\n required = false,\n error,\n testID,\n chipTestIDPrefix = DEFAULT_CHIP_TESTID_PREFIX,\n optionAccessibilityHint,\n singleSelectRole = 'button',\n size = 'default',\r\n selectedFill,\r\n}: ChipSelectorProps<T>): React.ReactElement => {\n const isRadioGroup = !multiple && singleSelectRole === 'radio';\n const { theme } = useUi();\n const { colors, palette } = theme;\n\n const chipColors = React.useMemo<ChipColors>(() => buildChipColors(colors, palette), [colors, palette]);\n\n function isSelected(optionValue: T): boolean {\n if (multiple && Array.isArray(value))\n return value.includes(optionValue);\n\n return value === optionValue;\n }\n\n const radio = useRadioKeyboard({\n enabled: isRadioGroup,\n disabled,\n values: options.map((option) => option.value),\n selectedIndex: options.findIndex((option) => isSelected(option.value)),\n onChange,\n });\n\n function renderChip(option: ChipOption<T>, index: number): React.ReactElement {\n const selected = isSelected(option.value);\n const chipProps = {\n colors: chipColors,\n disabled,\n option,\n selected,\n size,\r\n selectedFill,\r\n ...chipIdentity(option, selected, {\n prefix: chipTestIDPrefix,\n hint: optionAccessibilityHint,\n multiple,\n radio: isRadioGroup,\n }),\n // Radio mode only: roving tab stop + host node for arrow-key focus moves. Both stay\n // `undefined` otherwise, so button / multi chips keep their existing tab order.\n tabIndex: radio.tabIndexFor(index),\n hostRef: isRadioGroup ? radio.chipRef(index) : undefined,\n onPress: (): void => onChange(option.value),\n };\n const key = String(option.value);\n return variant === 'outline' ? <OutlineChip key={key} {...chipProps} /> : <SolidChip key={key} {...chipProps} />;\n }\n\n return (\n <Field\n containerStyle={containerStyle}\n error={error}\n label={label}\n required={required}\n spacing={spacing}\n testID={testID}\n >\n {({ describedById, hasError }) => (\n <View\n accessibilityRole={isRadioGroup ? 'radiogroup' : undefined}\n style={styles.chipContainer}\n {...(webFieldA11y({ describedById, hasError }) as ViewProps)}\n {...radio.groupProps}\n >\n {options.map(renderChip)}\n </View>\n )}\n </Field>\n );\n};\n\nexport default ChipSelector;\n","import React from 'react';\n\nimport { StyleSheet, Switch, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nconst BOX_SLOT_PAD_H = 10;\n\nconst styles = StyleSheet.create({\n row: {\n minWidth: MIN_TOUCH_TARGET_PX,\n minHeight: MIN_TOUCH_TARGET_PX,\n alignItems: 'center',\n justifyContent: 'center',\n },\n box: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: BOX_SLOT_PAD_H,\n },\n});\n\nexport interface SwitchSlotProps {\n label: string;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled: boolean;\n testID: string;\n accessibilityHint?: string;\n activeTrackColor?: string;\n inBox?: boolean;\n}\n\n/** The one switch element shared by both FormSwitch variants; pointer input goes to the parent hit box. */\nexport const SwitchSlot = ({\n label,\n value,\n onValueChange,\n disabled,\n testID,\n accessibilityHint,\n activeTrackColor,\n inBox = false,\n}: SwitchSlotProps): React.ReactElement => (\n <View pointerEvents=\"none\" style={inBox ? styles.box : styles.row} testID={`${testID}-hitbox`}>\n <Switch\n accessibilityHint={accessibilityHint ?? label}\n accessibilityLabel={label}\n accessibilityState={{ checked: value, disabled }}\n disabled={disabled}\n testID={`${testID}-switch`}\n trackColor={activeTrackColor === undefined ? undefined : { true: activeTrackColor }}\n value={value}\n onValueChange={onValueChange}\n />\n </View>\n);\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, type ViewStyle } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { Field } from '../Field/Field';\n\nimport { SwitchSlot, type SwitchSlotProps } from './SwitchSlot';\n\nconst BOX_RADIUS = 8;\nconst BOX_PAD_LEFT = 10;\nconst BOX_BORDER = 1;\nconst STATE_FONT_SIZE = 13;\n\nconst styles = StyleSheet.create({\n box: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n minHeight: MIN_TOUCH_TARGET_PX,\n borderWidth: BOX_BORDER,\n borderRadius: BOX_RADIUS,\n paddingLeft: BOX_PAD_LEFT,\n },\n state: {\n flex: 1,\n fontSize: STATE_FONT_SIZE,\n },\n});\n\nexport interface FormSwitchBoxProps extends Omit<SwitchSlotProps, 'inBox'> {\n stateLabel?: string;\n description?: string;\n containerStyle?: ViewStyle;\n}\n\n/** FormSwitch `box` variant: a control-voice label over a bordered 44 px field box; the whole box toggles. */\nexport const FormSwitchBox = ({\n stateLabel,\n description,\n containerStyle,\n ...slot\n}: FormSwitchBoxProps): React.ReactElement => {\n const { colors } = useUi().theme;\n const { disabled, onValueChange, value } = slot;\n const toggle = React.useCallback((): void => {\n if (!disabled) onValueChange(!value);\n }, [disabled, onValueChange, value]);\n const boxColors = React.useMemo<ViewStyle>(\n () => ({ borderColor: colors.border, backgroundColor: colors.surface }),\n [colors.border, colors.surface],\n );\n\n return (\n <Field containerStyle={containerStyle} hint={description} label={slot.label} labelVariant=\"control\">\n {() => (\n <Pressable\n accessible={false}\n disabled={disabled}\n style={[styles.box, boxColors]}\n tabIndex={-1}\n testID={slot.testID}\n onPress={toggle}\n >\n <Text numberOfLines={1} style={[styles.state, { color: colors.text }]}>\n {stateLabel ?? ''}\n </Text>\n <SwitchSlot {...slot} inBox />\n </Pressable>\n )}\n </Field>\n );\n};\n","/**\n * Reusable form switch/toggle with an optional description.\n */\nimport React from \"react\";\n\nimport {\n StyleSheet,\n View,\n Text,\n Pressable,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\n\nimport { MIN_TOUCH_TARGET_PX } from \"@dloizides/a11y\";\nimport { useUi } from \"@dloizides/ui-feedback\";\n\nimport { FormSwitchBox } from \"./FormSwitchBox\";\nimport type { FormSwitchVariant } from \"./FormSwitchVariant\";\nimport { SwitchSlot } from \"./SwitchSlot\";\n\nconst DESCRIPTION_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n marginBottom: 12,\n // The ROW is the hit box (SHOWCASE-1): RN-web renders Switch as a 40x20 box and ignores\n // `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.\n minHeight: MIN_TOUCH_TARGET_PX,\n },\n textColumn: {\n flex: 1,\n },\n label: {\n fontWeight: \"600\",\n },\n description: {\n fontSize: DESCRIPTION_FONT_SIZE,\n marginTop: 2,\n },\n});\n\ninterface ThemeStyles {\n label: TextStyle;\n description: TextStyle;\n}\n\nexport interface FormSwitchProps {\n label: string;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled?: boolean;\n description?: string;\n containerStyle?: ViewStyle;\n testID?: string;\n accessibilityHint?: string;\n /** `row` (default) or `box`, the field-box look that sits in a form row beside text fields. */\n variant?: FormSwitchVariant;\n /** Pre-localized state text shown inside the `box` variant (e.g. \"On\"); ignored by `row`. */\n stateLabel?: string;\n /** Track colour of an ON switch, from the app's tokens; unset keeps the platform default. */\n activeTrackColor?: string;\n}\n\ntype FormSwitchRowProps = Omit<FormSwitchProps, \"variant\" | \"stateLabel\" | \"testID\"> & { testID: string };\n\nconst FormSwitchRow = ({\n label,\n value,\n onValueChange,\n disabled = false,\n description,\n containerStyle,\n testID,\n accessibilityHint,\n activeTrackColor,\n}: FormSwitchRowProps): React.ReactElement => {\n const { theme } = useUi();\n const toggle = React.useCallback((): void => {\n if (!disabled) onValueChange(!value);\n }, [disabled, onValueChange, value]);\n const { colors } = theme;\n const hasDescription = typeof description === \"string\" && description !== \"\";\n\n const themeStyles = React.useMemo<ThemeStyles>(() => {\n const labelStyle: TextStyle = { color: colors.text };\n const descriptionStyle: TextStyle = { color: colors.textSecondary };\n return { label: labelStyle, description: descriptionStyle };\n }, [colors.text, colors.textSecondary]);\n\n return (\n /*\n Pointer target only: the whole row toggles on press. It is NOT an a11y element and NOT a tab\n stop (`accessible` / `focusable` false) so the native input below stays the ONE switch. The\n Switch sits under `pointerEvents=\"none\"`, so a tap on it reaches this row exactly once\n instead of toggling twice; keyboard focus + Space still reach the input directly.\n */\n <Pressable\n accessible={false}\n disabled={disabled}\n onPress={toggle}\n style={[styles.container, containerStyle]}\n // RN-web's Pressable always stamps a tabIndex (0, or -1 when disabled) and only an explicit\n // one overrides it — `focusable={false}` does not. -1 keeps the row out of the tab order.\n tabIndex={-1}\n testID={testID}\n >\n <View style={styles.textColumn}>\n <Text style={[styles.label, themeStyles.label]}>{label}</Text>\n {hasDescription ? (\n <Text style={[styles.description, themeStyles.description]}>\n {description}\n </Text>\n ) : null}\n </View>\n <SwitchSlot\n accessibilityHint={accessibilityHint}\n activeTrackColor={activeTrackColor}\n disabled={disabled}\n label={label}\n testID={testID}\n value={value}\n onValueChange={onValueChange}\n />\n </Pressable>\n );\n};\n\nexport const FormSwitch = ({\n variant = \"row\",\n stateLabel,\n testID = \"form-switch\",\n disabled = false,\n ...props\n}: FormSwitchProps): React.ReactElement =>\n variant === \"box\" ? (\n <FormSwitchBox {...props} disabled={disabled} stateLabel={stateLabel} testID={testID} />\n ) : (\n <FormSwitchRow {...props} disabled={disabled} testID={testID} />\n );\n\nexport default FormSwitch;\n","import type { ViewStyle } from 'react-native';\n\nexport interface CheckboxColorTokens {\n border: string;\n textSecondary: string;\n}\n\n/** Fill and border of the checkbox square; unchecked uses textSecondary for 3:1 non-text contrast. */\nexport const checkboxBoxColors = (\n colors: CheckboxColorTokens,\n brand: string,\n checked: boolean\n): Pick<ViewStyle, 'backgroundColor' | 'borderColor'> =>\n checked\n ? { backgroundColor: brand, borderColor: brand }\n : { backgroundColor: 'transparent', borderColor: colors.textSecondary };\n","/**\n * Reusable, native-safe checkbox — a themed `Pressable` (works on RN-web AND native, where RN has\n * no built-in checkbox). A small rounded square that fills with the brand colour and shows a check\n * glyph when on, with a label and an optional hint. Mirrors `FormSwitch`'s prop shape so it is a\n * drop-in replacement for the boolean toggles v1 renders as checkboxes.\n */\nimport React from 'react';\n\nimport { Platform, StyleSheet, View, Text, Pressable, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useFieldIds } from '../Field/Field';\n\nimport { checkboxBoxColors } from './checkboxColors';\n\n/**\n * Web-only keydown prop react-native-web's `Pressable` forwards but RN's types omit. A\n * `role=\"checkbox\"` Pressable renders a `<div>` (not a native `<button>`), so — unlike a\n * button-role Pressable — it gets NO free Enter/Space activation. We add it explicitly so the\n * checkbox is keyboard-operable (WCAG 2.1.1). `preventDefault()` stops Space from scrolling.\n */\ninterface WebKeyboardProps {\n onKeyDown?: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\nconst ACTIVATION_KEYS = ['Enter', ' ', 'Spacebar'];\n\nconst HINT_FONT_SIZE = 12;\nconst BOX_SIZE = 20;\nconst BOX_RADIUS = 5;\nconst TICK_WIDTH = 6;\nconst TICK_HEIGHT = 10;\nconst TICK_STROKE = 2;\nconst TICK_LIFT = -2;\nconst DISABLED_OPACITY = 0.5;\nconst FOCUS_RING_WIDTH = 2;\nconst FOCUS_RING_GAP = 2;\nconst WEB_NO_DEFAULT_OUTLINE = { outlineStyle: 'none' } as unknown as ViewStyle;\nconst FOCUS_RING_INSET = -(FOCUS_RING_WIDTH + FOCUS_RING_GAP + FOCUS_RING_WIDTH);\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n gap: 10,\n marginBottom: 12,\n // The whole row is the Pressable, so the row IS the hit box: on RN-web `hitSlop` is inert and a\n // one-line label measured 36px tall (SHOWCASE-1). The 20px visual box keeps its size inside.\n minHeight: MIN_TOUCH_TARGET_PX,\n },\n /** With no hint the row is a single line, so centre it vertically inside the floor. */\n centered: {\n alignItems: 'center',\n },\n box: {\n width: BOX_SIZE,\n height: BOX_SIZE,\n borderRadius: BOX_RADIUS,\n borderWidth: 2,\n alignItems: 'center',\n justifyContent: 'center',\n // Nudge the box to sit on the label's first text line.\n marginTop: 1,\n },\n focusRing: {\n position: 'absolute',\n top: FOCUS_RING_INSET,\n left: FOCUS_RING_INSET,\n right: FOCUS_RING_INSET,\n bottom: FOCUS_RING_INSET,\n borderWidth: FOCUS_RING_WIDTH,\n borderRadius: BOX_RADIUS - FOCUS_RING_INSET,\n },\n tick: {\n width: TICK_WIDTH,\n height: TICK_HEIGHT,\n marginTop: TICK_LIFT,\n borderRightWidth: TICK_STROKE,\n borderBottomWidth: TICK_STROKE,\n transform: [{ rotate: '45deg' }],\n },\n textColumn: {\n flex: 1,\n },\n label: {\n fontWeight: '600',\n },\n hint: {\n fontSize: HINT_FONT_SIZE,\n marginTop: 2,\n },\n});\n\nexport interface FormCheckboxProps {\n label: string;\n value: boolean;\n /** Primary change handler (mirrors `FormSwitch`). `onChange` is accepted as an alias. */\n onValueChange?: (value: boolean) => void;\n /** Alias for `onValueChange` so either name works as a drop-in. */\n onChange?: (value: boolean) => void;\n /** Optional secondary description shown under the label. `description` is accepted as an alias. */\n hint?: string;\n description?: string;\n disabled?: boolean;\n containerStyle?: ViewStyle;\n testID?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n}\n\nexport const FormCheckbox = ({\n label,\n value,\n onValueChange,\n onChange,\n hint,\n description,\n disabled = false,\n containerStyle,\n testID = 'form-checkbox',\n accessibilityLabel,\n accessibilityHint,\n}: FormCheckboxProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n const hintText = typeof hint === 'string' && hint !== '' ? hint : description;\n const hasHint = typeof hintText === 'string' && hintText !== '';\n const { hintId } = useFieldIds();\n\n const [focused, setFocused] = React.useState(false);\n\n const themeStyles = React.useMemo(() => {\n const boxOn: ViewStyle = checkboxBoxColors(colors, brand, true);\n const boxOff: ViewStyle = checkboxBoxColors(colors, brand, false);\n const ring: ViewStyle = { borderColor: brand };\n const labelStyle: TextStyle = { color: colors.text };\n const hintStyle: TextStyle = { color: colors.textSecondary };\n return { boxOn, boxOff, ring, label: labelStyle, hint: hintStyle };\n }, [brand, colors]);\n\n const toggle = (): void => {\n const next = !value;\n if (onValueChange) onValueChange(next);\n if (onChange) onChange(next);\n };\n\n const handleKeyDown = (event: { key?: string; preventDefault?: () => void }): void => {\n if (disabled) return;\n const key = event.key ?? '';\n if (!ACTIVATION_KEYS.includes(key)) return;\n if (typeof event.preventDefault === 'function') event.preventDefault();\n toggle();\n };\n\n const keyboardProps: WebKeyboardProps = Platform.OS === 'web' ? { onKeyDown: handleKeyDown } : {};\n\n return (\n <Pressable\n accessibilityHint={accessibilityHint ?? label}\n accessibilityLabel={accessibilityLabel ?? label}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked: value, disabled }}\n // RN-web maps this to the ARIA `role=\"checkbox\"` + `aria-checked` a screen reader announces.\n aria-checked={value}\n aria-describedby={hasHint ? hintId : undefined}\n disabled={disabled}\n onBlur={() => setFocused(false)}\n onFocus={() => setFocused(true)}\n onPress={toggle}\n role=\"checkbox\"\n style={[\n styles.container,\n hasHint ? null : styles.centered,\n containerStyle,\n disabled ? { opacity: DISABLED_OPACITY } : null,\n Platform.OS === 'web' ? WEB_NO_DEFAULT_OUTLINE : null,\n ]}\n testID={testID}\n {...keyboardProps}\n >\n <View style={[styles.box, value ? themeStyles.boxOn : themeStyles.boxOff]} testID={`${testID}-box`}>\n {focused ? (\n <View pointerEvents=\"none\" style={[styles.focusRing, themeStyles.ring]} testID={`${testID}-focus-ring`} />\n ) : null}\n {value ? (\n <View accessibilityElementsHidden pointerEvents=\"none\" style={[styles.tick, { borderColor: colors.surface }]} testID={`${testID}-tick`} />\n ) : null}\n </View>\n <View style={styles.textColumn}>\n <Text style={[styles.label, themeStyles.label]}>{label}</Text>\n {hasHint ? <Text nativeID={hintId} style={[styles.hint, themeStyles.hint]}>{hintText}</Text> : null}\n </View>\n </Pressable>\n );\n};\n\nexport default FormCheckbox;\n","import React from 'react';\r\n\r\nimport { StyleSheet, View } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\n\r\nimport type { SelectControlProps } from './SelectControl';\r\n\r\nconst NATIVE_SELECT_BOX: React.CSSProperties = {\r\n borderStyle: 'solid',\r\n boxSizing: 'border-box',\r\n fontFamily: 'inherit',\r\n width: '100%',\r\n};\r\n\r\nfunction nativeSelectStyle(borderColor: string, backgroundColor: string, color: string): React.CSSProperties {\r\n const trigger = StyleSheet.flatten(s.selectTrigger);\r\n const text = StyleSheet.flatten(s.selectTriggerText);\r\n return {\r\n ...NATIVE_SELECT_BOX,\r\n minHeight: trigger.minHeight,\r\n borderWidth: trigger.borderWidth,\r\n borderRadius: trigger.borderRadius,\r\n fontSize: text.fontSize,\r\n paddingBlock: trigger.paddingVertical,\r\n paddingInline: trigger.paddingHorizontal,\r\n borderColor,\r\n backgroundColor,\r\n color,\r\n } as React.CSSProperties;\r\n}\r\n\r\n/** The web `SelectControl` as a real DOM `<select>`, so browsers and test drivers can pick an option natively. */\r\nexport function NativeSelect({\r\n options,\r\n value,\r\n onChange,\r\n placeholder = '',\r\n accessibilityLabel,\r\n accessibilityHint,\r\n labelledById,\r\n style,\r\n testID,\r\n}: SelectControlProps): React.ReactElement {\r\n const { theme } = useUi();\r\n const { colors } = theme;\r\n const hasMatch = options.some((o) => o.value === value);\r\n const textColor = hasMatch ? colors.text : colors.textSecondary;\r\n\r\n const handleChange = (event: React.ChangeEvent<HTMLSelectElement>): void => onChange(event.target.value);\r\n\r\n return (\r\n <View style={[s.anchor, style]}>\r\n <select\r\n aria-label={accessibilityLabel}\r\n aria-labelledby={labelledById}\r\n data-testid={testID}\r\n style={nativeSelectStyle(colors.border, colors.surfaceElevated, textColor)}\r\n title={accessibilityHint}\r\n value={value}\r\n onChange={handleChange}\r\n >\r\n {hasMatch ? null : <option disabled value={value}>{placeholder}</option>}\r\n {options.map((o) => <option key={o.value} value={o.value}>{o.label}</option>)}\r\n </select>\r\n </View>\r\n );\r\n}\r\n","export const NO_HIGHLIGHT = -1;\n\n/** The row index an arrow key moves to: wraps at both ends, -1 when there are no rows. */\nexport function nextHighlight(current: number, count: number, delta: number): number {\n if (count === 0) return NO_HIGHLIGHT;\n if (current === NO_HIGHLIGHT) return delta > 0 ? 0 : count - 1;\n return (current + delta + count) % count;\n}\n","import { useEffect, useState } from 'react';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport { NO_HIGHLIGHT, nextHighlight } from '../controls/nextHighlight';\n\nconst FORWARD = 1;\nconst BACKWARD = -1;\n\ninterface ListboxKeyEvent {\n key: string;\n preventDefault: () => void;\n stopPropagation: () => void;\n}\n\nexport interface SelectListboxInput {\n options: readonly ControlOption[];\n isOpen: boolean;\n open: () => void;\n toggle: () => void;\n select: (value: string) => void;\n}\n\nexport interface SelectListbox {\n highlighted: ControlOption | undefined;\n onKeyDown: (event: ListboxKeyEvent) => void;\n}\n\n/** Keyboard for a select whose focus stays on its trigger: arrows move the highlight, Enter or Space commits. */\nexport function useSelectListbox({ options, isOpen, open, toggle, select }: SelectListboxInput): SelectListbox {\n const [row, setRow] = useState(NO_HIGHLIGHT);\n const highlighted: ControlOption | undefined = isOpen ? options[row] : undefined;\n\n useEffect(() => {\n if (!isOpen) setRow(NO_HIGHLIGHT);\n }, [isOpen]);\n\n const onKeyDown = (event: ListboxKeyEvent): void => {\n const { key } = event;\n const isArrow = key === 'ArrowDown' || key === 'ArrowUp';\n if (!isArrow && key !== 'Enter' && key !== ' ') return;\n event.preventDefault();\n event.stopPropagation();\n if (isArrow) {\n open();\n setRow((current) => nextHighlight(current, options.length, key === 'ArrowDown' ? FORWARD : BACKWARD));\n } else if (highlighted !== undefined) select(highlighted.value);\n else toggle();\n };\n\n return { highlighted, onKeyDown };\n}\n","/**\r\n * `SelectControl` — a single-select enum/status dropdown. A bordered trigger shows the selected\r\n * option's label (or the placeholder when unset) plus a chevron; pressing it opens the shared\r\n * {@link AnchoredMenu}. Selecting fires `onChange` and closes.\r\n *\r\n * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/SelectField`, where six portals\r\n * could see it working and none could import it — which is why the fleet grew SIX independent\r\n * select implementations.\r\n *\r\n * The control is LABEL-FREE by design: wrap it in a `Field` (with `labelVariant=\"control\"` on a\r\n * dense surface) to get the label, hint and error slots. That keeps one label implementation for\r\n * every control instead of one per control.\r\n *\r\n * i18n: this package never calls `t`. `accessibilityLabel`, `placeholder`, `accessibilityHint`\r\n * and `optionHint` are PRE-LOCALIZED strings supplied by the caller — the only shape that can\r\n * serve both aml-v2's positional `{0}` `@dloizides/i18n` and the other six portals' i18next\r\n * `{{p1}}` from one component.\r\n */\r\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\r\n\r\nimport { Platform, Pressable, Text, View, type StyleProp, type ViewStyle } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\r\nimport { listboxDomId, optionDomId } from '../AnchoredMenu/components/OptionRow';\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\nimport type { ControlOption } from '../controls/controlTypes';\r\nimport { NativeSelect } from './NativeSelect';\r\nimport { useSelectListbox } from './useSelectListbox';\r\n\r\nconst IS_WEB = Platform.OS === 'web';\r\n\r\nconst CHEVRON_DOWN = '▾';\r\nconst CHEVRON_UP = '▴';\r\n\r\n/** Opts in to a menu that stays on screen with focus on the trigger, for screen edges and focus-trapped sheets. */\r\nexport interface SelectMenuAnchor {\r\n listboxLabel: string;\r\n anchorRef?: React.RefObject<View | null>;\r\n}\r\n\r\nexport interface SelectControlProps {\r\n options: readonly ControlOption[];\r\n /** The selected option's `value`. `''` (or any unmatched value) renders the placeholder. */\r\n value: string;\r\n onChange: (value: string) => void;\r\n /** PRE-LOCALIZED text shown when the value matches no option. */\r\n placeholder?: string;\r\n /**\r\n * PRE-LOCALIZED accessible NAME of the trigger. It REPLACES the trigger's visible text for a\r\n * screen reader, so it must carry the SELECTION too — \"Status: Active\", not just \"Status\",\r\n * which announces the control but silently hides its value.\r\n */\r\n accessibilityLabel: string;\r\n accessibilityHint?: string;\r\n /**\r\n * `id` of the `Field` label naming this control — take it from the render-child context's\r\n * `labelId`. The trigger is a `<div role=\"button\">`, which `<label for>` cannot address (that\r\n * only works for native form elements), so the association runs the other way: the trigger\r\n * points AT the label.\r\n *\r\n * `accessibilityLabel` still wins for the accessible NAME, deliberately — it is the only one of\r\n * the two that carries the current selection (\"Status: Active\"). This adds the structural link\r\n * without changing a single announcement.\r\n */\r\n labelledById?: string;\r\n /** PRE-LOCALIZED accessibility hint applied to every option in the menu. */\r\n optionHint?: string;\r\n menuAnchor?: SelectMenuAnchor;\r\n /** Merged LAST onto the anchor wrapper — the consumer always wins over the shared style. */\r\n style?: StyleProp<ViewStyle>;\r\n /** Trigger is `${testID}-trigger`, menu `${testID}-menu`, options `${testID}-option-${value}`. */\r\n testID: string;\r\n /** Web only: render a real `<select>` (the select carries the plain `testID`); ignored off web. */\r\n native?: boolean;\r\n}\r\n\r\nfunction listboxTriggerAria(testID: string, hasList: boolean, highlighted: ControlOption | undefined): Record<string, string | undefined> {\r\n return {\r\n role: 'combobox',\r\n 'aria-controls': hasList ? listboxDomId(testID) : undefined,\r\n 'aria-activedescendant': highlighted !== undefined ? optionDomId(testID, highlighted.value) : undefined,\r\n };\r\n}\r\n\r\nexport function SelectControl(props: SelectControlProps): React.ReactElement {\r\n return props.native === true && IS_WEB ? <NativeSelect {...props} /> : <MenuSelectControl {...props} />;\r\n}\r\n\r\nfunction MenuSelectControl({\r\n options,\r\n value,\r\n onChange,\r\n placeholder = '',\r\n accessibilityLabel,\r\n accessibilityHint,\r\n labelledById,\r\n optionHint = '',\r\n menuAnchor,\r\n style,\r\n testID,\r\n}: SelectControlProps): React.ReactElement {\r\n const { theme } = useUi();\r\n const { colors, palette } = theme;\r\n const anchorRef = useRef<View>(null);\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const selectedLabel = useMemo(() => {\r\n const found = options.find((o) => o.value === value);\r\n return found?.label ?? placeholder;\r\n }, [options, placeholder, value]);\r\n\r\n const close = useCallback(() => { setIsOpen(false); }, []);\r\n const open = useCallback(() => { setIsOpen(true); }, []);\r\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\r\n const select = useCallback(\r\n (next: string) => {\r\n onChange(next);\r\n setIsOpen(false);\r\n },\r\n [onChange],\r\n );\r\n const listbox = useSelectListbox({ options, isOpen, open, toggle, select });\r\n const isListbox = menuAnchor !== undefined;\r\n const captureKeys: Record<string, unknown> = isListbox ? { onKeyDownCapture: listbox.onKeyDown } : {};\r\n const triggerAria = isListbox ? listboxTriggerAria(testID, isOpen && options.length > 0, listbox.highlighted) : {};\r\n\r\n return (\r\n <View ref={anchorRef} style={[s.anchor, style]} {...captureKeys}>\r\n <Pressable\r\n {...triggerAria}\r\n accessibilityRole={isListbox ? undefined : 'button'}\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityHint={accessibilityHint}\r\n accessibilityState={{ expanded: isOpen }}\r\n aria-expanded={isOpen}\r\n aria-haspopup={isListbox ? 'listbox' : 'menu'}\r\n aria-labelledby={labelledById}\r\n onBlur={isListbox ? close : undefined}\r\n onPress={toggle}\r\n style={[s.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}\r\n testID={`${testID}-trigger`}\r\n >\r\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: value === '' ? colors.textSecondary : colors.text }]}>\r\n {selectedLabel}\r\n </Text>\r\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\r\n </Pressable>\r\n {isOpen ? (\r\n <AnchoredMenu\r\n options={options}\r\n selectedValue={value}\r\n onSelect={select}\r\n onDismiss={close}\r\n colors={{ text: colors.text, ...(isListbox ? { textSecondary: colors.textSecondary } : null), border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\r\n optionHint={optionHint}\r\n testID={testID}\r\n anchorRef={anchorRef}\r\n accessibilityLabel={menuAnchor?.listboxLabel}\r\n listbox={isListbox ? { highlightedValue: listbox.highlighted?.value } : undefined}\r\n placement={isListbox ? { positionRef: menuAnchor.anchorRef } : undefined}\r\n />\r\n ) : null}\r\n </View>\r\n );\r\n}\r\n\r\nexport default SelectControl;\r\n","import React from 'react';\n\nimport { Field } from '../Field/Field';\nimport { SelectControl } from '../SelectControl/SelectControl';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { FieldLabelVariant } from '../Field/labelVariants';\n\nexport interface SelectFieldProps {\n label: string;\n accessibilityHint: string;\n value: string;\n options: readonly ControlOption[];\n onChange: (value: string) => void;\n testID: string;\n labelVariant?: FieldLabelVariant;\n}\n\nexport const SelectField = ({\n label,\n accessibilityHint,\n value,\n options,\n onChange,\n testID,\n labelVariant,\n}: SelectFieldProps): React.ReactElement => {\n const selected = options.find((option) => option.value === value)?.label ?? '';\n return (\n <Field label={label} labelVariant={labelVariant}>\n {({ labelId }) => (\n <SelectControl\n accessibilityHint={accessibilityHint}\n accessibilityLabel={`${label}: ${selected}`}\n labelledById={labelId}\n options={options}\n testID={testID}\n value={value}\n onChange={onChange}\n />\n )}\n </Field>\n );\n};\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text } from 'react-native';\n\nimport { CHIP_HIT_SLOP } from '../../ChipSelector/constants';\n\nimport type { ControlOption } from '../../controls/controlTypes';\n\nconst REMOVE_GLYPH = '×';\nconst CHIP_GAP = 4;\nconst CHIP_PAD_H = 8;\nconst CHIP_PAD_V = 4;\nconst CHIP_RADIUS = 999;\nconst CHIP_FONT = 13;\n\nconst styles = StyleSheet.create({\n chip: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: CHIP_GAP,\n paddingHorizontal: CHIP_PAD_H,\n paddingVertical: CHIP_PAD_V,\n borderWidth: 1,\n borderRadius: CHIP_RADIUS,\n maxWidth: '100%',\n },\n text: { fontSize: CHIP_FONT, flexShrink: 1 },\n});\n\nexport interface SelectedChipColors {\n text: string;\n border: string;\n surface: string;\n}\n\nexport interface SelectedChipProps {\n option: ControlOption;\n colors: SelectedChipColors;\n removeLabel: string;\n removeHint: string;\n onRemove: (value: string) => void;\n testID: string;\n}\n\n/** One chosen option inside a multi-select box; pressing it removes the option. */\nexport function SelectedChip({ option, colors, removeLabel, removeHint, onRemove, testID }: SelectedChipProps): React.ReactElement {\n return (\n <Pressable\n accessibilityHint={removeHint}\n accessibilityLabel={removeLabel}\n accessibilityRole=\"button\"\n hitSlop={CHIP_HIT_SLOP}\n style={[styles.chip, { borderColor: colors.border, backgroundColor: colors.surface }]}\n testID={testID}\n onPress={() => onRemove(option.value)}\n >\n <Text numberOfLines={1} style={[styles.text, { color: colors.text }]}>{option.label}</Text>\n <Text aria-hidden style={[styles.text, { color: colors.text }]}>{REMOVE_GLYPH}</Text>\n </Pressable>\n );\n}\n","import type { ControlOption } from '../../controls/controlTypes';\n\n/** Values with `value` appended once; an already chosen value leaves the list unchanged. */\nexport function addValue(values: readonly string[], value: string): string[] {\n return values.includes(value) ? [...values] : [...values, value];\n}\n\n/** Values without `value`. */\nexport function removeValue(values: readonly string[], value: string): string[] {\n return values.filter((current) => current !== value);\n}\n\n/** The chosen options, in the order they were chosen; unknown values are skipped. */\nexport function selectedOptions(options: readonly ControlOption[], values: readonly string[]): ControlOption[] {\n return values.flatMap((value) => options.filter((option) => option.value === value));\n}\n\n/** The options not chosen yet, in their original order. */\nexport function remainingOptions(options: readonly ControlOption[], values: readonly string[]): ControlOption[] {\n return options.filter((option) => !values.includes(option.value));\n}\n","import React, { useCallback, useRef, useState } from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { Field } from '../Field/Field';\nimport { SelectedChip } from './components/SelectedChip';\nimport { addValue, remainingOptions, removeValue, selectedOptions } from './utils/multiSelectValues';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { FieldLabelVariant } from '../Field/labelVariants';\n\nconst CHEVRON_DOWN = '▾';\nconst CHEVRON_UP = '▴';\nconst BOX_GAP = 6;\nconst TRIGGER_MIN_WIDTH = 96;\n\nconst styles = StyleSheet.create({\n box: { flexWrap: 'wrap', justifyContent: 'flex-start', gap: BOX_GAP },\n trigger: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n minHeight: MIN_TOUCH_TARGET_PX,\n minWidth: TRIGGER_MIN_WIDTH,\n },\n});\n\nexport interface MultiSelectChipLabels {\n removeLabel: (optionLabel: string) => string;\n removeHint: string;\n}\n\nexport interface MultiSelectFieldProps {\n label: string;\n accessibilityHint: string;\n values: readonly string[];\n options: readonly ControlOption[];\n onChange: (values: string[]) => void;\n placeholder: string;\n chipLabels: MultiSelectChipLabels;\n testID: string;\n labelVariant?: FieldLabelVariant;\n hint?: string;\n error?: string;\n}\n\ntype MultiSelectBoxProps = Omit<MultiSelectFieldProps, 'labelVariant' | 'hint' | 'error'> & { labelId: string };\n\nfunction MultiSelectBox(props: MultiSelectBoxProps): React.ReactElement {\n const { label, accessibilityHint, values, options, onChange, placeholder, chipLabels, testID, labelId } = props;\n const { colors, palette } = useUi().theme;\n const anchorRef = useRef<View>(null);\n const [isOpen, setIsOpen] = useState(false);\n const chosen = selectedOptions(options, values);\n const remaining = remainingOptions(options, values);\n const close = useCallback(() => { setIsOpen(false); }, []);\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const add = useCallback((next: string) => { onChange(addValue(values, next)); setIsOpen(false); }, [onChange, values]);\n const remove = useCallback((value: string) => { onChange(removeValue(values, value)); }, [onChange, values]);\n const chipColors = { text: colors.text, border: colors.border, surface: colors.surface };\n const summary = chosen.map((option) => option.label).join(', ');\n\n return (\n <View ref={anchorRef} style={s.anchor}>\n <View style={[s.selectTrigger, styles.box, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]} testID={`${testID}-box`}>\n {chosen.map((option) => (\n <SelectedChip\n key={option.value}\n colors={chipColors}\n option={option}\n removeHint={chipLabels.removeHint}\n removeLabel={chipLabels.removeLabel(option.label)}\n testID={`${testID}-chip-${option.value}`}\n onRemove={remove}\n />\n ))}\n <Pressable\n accessibilityHint={accessibilityHint}\n accessibilityLabel={`${label}: ${summary}`}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: isOpen, disabled: remaining.length === 0 }}\n aria-expanded={isOpen}\n aria-haspopup=\"menu\"\n aria-labelledby={labelId}\n disabled={remaining.length === 0}\n style={styles.trigger}\n testID={`${testID}-trigger`}\n onPress={toggle}\n >\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: colors.textSecondary }]}>{placeholder}</Text>\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\n </Pressable>\n </View>\n {isOpen ? (\n <AnchoredMenu\n anchorRef={anchorRef}\n colors={{ text: colors.text, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n optionHint={accessibilityHint}\n options={remaining}\n selectedValue=\"\"\n testID={testID}\n onDismiss={close}\n onSelect={add}\n />\n ) : null}\n </View>\n );\n}\n\n/** A labelled select that holds several values, shown as removable chips inside the select box. */\nexport const MultiSelectField = ({ labelVariant, hint, error, ...boxProps }: MultiSelectFieldProps): React.ReactElement => (\n <Field error={error} hint={hint} label={boxProps.label} labelVariant={labelVariant}>\n {({ labelId }) => <MultiSelectBox {...boxProps} labelId={labelId} />}\n </Field>\n);\n\nexport default MultiSelectField;\n","import { useCallback, useEffect, useRef } from 'react';\n\nconst CLOSE_DELAY_MS = 140;\n\nexport interface DelayedBlurClose {\n handleFocus: () => void;\n handleBlur: () => void;\n}\n\n/** Closes after blur with a delay so a tap on an option registers; a refocus or unmount cancels it. */\nexport function useDelayedBlurClose(open: () => void, close: () => void): DelayedBlurClose {\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const cancelClose = useCallback(() => {\n if (timerRef.current !== null) clearTimeout(timerRef.current);\n timerRef.current = null;\n }, []);\n\n useEffect(() => cancelClose, [cancelClose]);\n\n const handleFocus = useCallback(() => {\n cancelClose();\n open();\n }, [cancelClose, open]);\n const handleBlur = useCallback(() => {\n cancelClose();\n timerRef.current = setTimeout(close, CLOSE_DELAY_MS);\n }, [cancelClose, close]);\n\n return { handleFocus, handleBlur };\n}\n","/**\n * `suggestOptions` — the ranked substring matcher behind `TypeaheadControl`, generalized from\n * aml-v2's `suggestCountries` and promoted verbatim out of `@dloizides/ui-tables`' private\n * `Filters/utils/suggest.ts`.\n *\n * Ranks: value exact (0) > value prefix (1) > label prefix (2) > label contains (3); ties broken\n * by `label.localeCompare`. Empty/short queries return `[]` — nothing surfaces until `minChars`\n * is typed, mirroring a native `<datalist>`.\n */\nimport type { ControlOption } from './controlTypes';\n\nconst RANK_VALUE_EXACT = 0;\nconst RANK_VALUE_PREFIX = 1;\nconst RANK_LABEL_PREFIX = 2;\nconst RANK_LABEL_CONTAINS = 3;\nconst RANK_DETAIL_CONTAINS = 4;\nconst NO_MATCH = -1;\n\nfunction rankOf(option: ControlOption, needle: string): number {\n const value = option.value.toLowerCase();\n const label = option.label.toLowerCase();\n if (value === needle) return RANK_VALUE_EXACT;\n if (value.startsWith(needle)) return RANK_VALUE_PREFIX;\n if (label.startsWith(needle)) return RANK_LABEL_PREFIX;\n if (label.includes(needle)) return RANK_LABEL_CONTAINS;\n if ((option.detail ?? '').toLowerCase().includes(needle)) return RANK_DETAIL_CONTAINS;\n return NO_MATCH;\n}\n\n/**\n * Rank + cap the options matching `query`. Returns `[]` until `query` (trimmed) is at least\n * `minChars` long, then the best `limit` matches, ranked as documented above.\n */\nexport function suggestOptions(\n options: readonly ControlOption[],\n query: string,\n minChars: number,\n limit: number,\n): readonly ControlOption[] {\n const needle = query.trim().toLowerCase();\n if (needle.length < minChars) return [];\n\n const scored: Array<{ option: ControlOption; rank: number }> = [];\n for (const option of options) {\n const rank = rankOf(option, needle);\n if (rank !== NO_MATCH) scored.push({ option, rank });\n }\n scored.sort((a, b) => (a.rank !== b.rank ? a.rank - b.rank : a.option.label.localeCompare(b.option.label)));\n return scored.slice(0, limit).map((entry) => entry.option);\n}\n\n/** True when `text` is non-empty yet matches no option's value or label exactly (case-insensitive). */\nexport function isUnmatched(options: readonly ControlOption[], text: string): boolean {\n const needle = text.trim().toLowerCase();\n if (needle === '') return false;\n return !options.some((o) => o.value.toLowerCase() === needle || o.label.toLowerCase() === needle);\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { TypeaheadSearch } from '../types';\n\nexport const DEFAULT_TYPEAHEAD_DEBOUNCE_MS = 250;\n\nexport interface TypeaheadSearchState {\n readonly results: readonly ControlOption[];\n readonly isLoading: boolean;\n readonly hasFailed: boolean;\n readonly hasSettled: boolean;\n}\n\nconst IDLE: TypeaheadSearchState = { results: [], isLoading: false, hasFailed: false, hasSettled: false };\n\n/** Debounced search: each new query aborts the last one, so an older response can never land. */\nexport function useTypeaheadSearch(\n load: TypeaheadSearch['load'] | undefined,\n query: string,\n enabled: boolean,\n debounceMs: number,\n): TypeaheadSearchState {\n const [state, setState] = useState(IDLE);\n const loadRef = useRef(load);\n loadRef.current = load;\n\n useEffect(() => {\n if (!enabled) {\n setState(IDLE);\n return undefined;\n }\n setState((current) => ({ ...current, isLoading: true, hasFailed: false }));\n const controller = new AbortController();\n const settle = (next: TypeaheadSearchState): void => {\n if (!controller.signal.aborted) setState(next);\n };\n const timer = setTimeout(() => {\n Promise.resolve()\n .then(() => loadRef.current?.(query, controller.signal) ?? [])\n .then(\n (results) => settle({ results, isLoading: false, hasFailed: false, hasSettled: true }),\n () => settle({ results: [], isLoading: false, hasFailed: true, hasSettled: true }),\n );\n }, debounceMs);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [query, enabled, debounceMs]);\n\n return state;\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport type { NativeSyntheticEvent, TextInputKeyPressEventData } from 'react-native';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { NO_HIGHLIGHT, nextHighlight } from '../../controls/nextHighlight';\nimport { suggestOptions } from '../../controls/suggestOptions';\nimport type { TypeaheadSearch } from '../types';\nimport { DEFAULT_TYPEAHEAD_DEBOUNCE_MS, useTypeaheadSearch, type TypeaheadSearchState } from './useTypeaheadSearch';\n\nconst FORWARD = 1;\nconst BACKWARD = -1;\nconst NO_ROWS: readonly ControlOption[] = [];\n\nexport interface TypeaheadStateInput {\n options: readonly ControlOption[] | undefined;\n search: TypeaheadSearch | undefined;\n value: string;\n minChars: number;\n maxSuggestions: number;\n onChange: (value: string) => void;\n onSubmit: (() => void) | undefined;\n}\n\nexport interface TypeaheadState {\n rows: readonly ControlOption[];\n statusText: string | undefined;\n isOpen: boolean;\n picked: ControlOption | null;\n highlighted: ControlOption | undefined;\n open: () => void;\n close: () => void;\n selectValue: (value: string) => void;\n handleChange: (next: string) => void;\n handleKeyPress: (event: NativeSyntheticEvent<TextInputKeyPressEventData>) => void;\n handleSubmit: () => void;\n}\n\nfunction searchStatusText(found: TypeaheadSearchState, search: TypeaheadSearch): string | undefined {\n if (found.hasFailed) return search.errorText;\n if (found.results.length > 0) return undefined;\n if (found.isLoading) return search.loadingText;\n return found.hasSettled ? search.emptyText : undefined;\n}\n\nfunction useTypeaheadRows(\n input: TypeaheadStateInput,\n isOpen: boolean,\n isPicked: boolean,\n): { rows: readonly ControlOption[]; statusText: string | undefined } {\n const { options, search, value, minChars, maxSuggestions } = input;\n const query = value.trim();\n const isSearching = search !== undefined && isOpen && !isPicked && query.length >= minChars;\n const found = useTypeaheadSearch(search?.load, query, isSearching, search?.debounceMs ?? DEFAULT_TYPEAHEAD_DEBOUNCE_MS);\n const staticRows = useMemo(() => {\n if (options === undefined || options.some((o) => o.label === value)) return NO_ROWS;\n return suggestOptions(options, value, minChars, maxSuggestions);\n }, [options, value, minChars, maxSuggestions]);\n const foundRows = useMemo(() => found.results.slice(0, maxSuggestions), [found.results, maxSuggestions]);\n if (search === undefined) return { rows: staticRows, statusText: undefined };\n return { rows: foundRows, statusText: searchStatusText(found, search) };\n}\n\n/** Everything `TypeaheadControl` decides: rows, open state, highlight, pick and key handling. */\nexport function useTypeaheadState(input: TypeaheadStateInput): TypeaheadState {\n const { search, value, onChange, onSubmit } = input;\n const [isOpen, setIsOpen] = useState(false);\n const [picked, setPicked] = useState<ControlOption | null>(null);\n const [highlightIndex, setHighlightIndex] = useState(NO_HIGHLIGHT);\n const { rows, statusText } = useTypeaheadRows(input, isOpen, picked !== null && picked.label === value);\n const rowKey = rows.map((row) => row.value).join('\\n');\n const highlighted: ControlOption | undefined = isOpen ? rows[highlightIndex] : undefined;\n\n useEffect(() => setHighlightIndex(NO_HIGHLIGHT), [rowKey]);\n useEffect(() => setPicked((current) => (current !== null && current.label !== value ? null : current)), [value]);\n\n const open = useCallback(() => setIsOpen(true), []);\n const close = useCallback(() => {\n setIsOpen(false);\n setHighlightIndex(NO_HIGHLIGHT);\n }, []);\n const pick = useCallback(\n (option: ControlOption) => {\n setPicked(option);\n onChange(option.label);\n search?.onPick(option);\n close();\n },\n [onChange, search, close],\n );\n const selectValue = useCallback(\n (optionValue: string) => {\n const option = rows.find((row) => row.value === optionValue);\n if (option !== undefined) pick(option);\n },\n [rows, pick],\n );\n const handleChange = useCallback(\n (next: string) => {\n if (picked !== null) {\n setPicked(null);\n search?.onPick(null);\n }\n onChange(next);\n setIsOpen(true);\n setHighlightIndex(NO_HIGHLIGHT);\n },\n [picked, search, onChange],\n );\n const handleKeyPress = useTypeaheadKeys({ rowCount: rows.length, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick });\n const handleSubmit = useCallback(() => {\n if (highlighted !== undefined) {\n pick(highlighted);\n return;\n }\n close();\n onSubmit?.();\n }, [highlighted, pick, close, onSubmit]);\n\n return { rows, statusText, isOpen, picked, highlighted, open, close, selectValue, handleChange, handleKeyPress, handleSubmit };\n}\n\ninterface TypeaheadKeysInput {\n rowCount: number;\n isOpen: boolean;\n highlighted: ControlOption | undefined;\n setIsOpen: (isOpen: boolean) => void;\n setHighlightIndex: (update: (current: number) => number) => void;\n close: () => void;\n pick: (option: ControlOption) => void;\n}\n\nfunction useTypeaheadKeys(input: TypeaheadKeysInput): TypeaheadState['handleKeyPress'] {\n const { rowCount, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick } = input;\n return useCallback(\n (event) => {\n const { key } = event.nativeEvent;\n if (key === 'ArrowDown' || key === 'ArrowUp') {\n event.preventDefault();\n setIsOpen(true);\n setHighlightIndex((current) => nextHighlight(current, rowCount, key === 'ArrowDown' ? FORWARD : BACKWARD));\n } else if (key === 'Escape' && isOpen) {\n event.preventDefault();\n close();\n } else if (key === 'Enter' && highlighted !== undefined) {\n event.preventDefault();\n pick(highlighted);\n }\n },\n [rowCount, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick],\n );\n}\n","/**\n * `TypeaheadControl` — a search-as-you-type combobox (aml-v2's CountryPicker, generalized). A\n * text input plus a floating {@link AnchoredMenu} of ranked suggestions ({@link suggestOptions});\n * picking one fills the canonical label.\n *\n * Free typing is PRESERVED: the value is the raw text, so a caller can accept \"CY\", \"cyprus\" or\n * \"Cyprus (CY)\" and normalise it themselves at query time, exactly as aml does. An optional\n * PRE-LOCALIZED `error` shows a persistent banner and tints the border.\n *\n * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/TypeaheadField`.\n *\n * Label-free by design — wrap in a `Field` for the label/hint slots.\n */\nimport React, { forwardRef, useRef, type ForwardedRef } from 'react';\n\nimport { TextInput, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { AnchoredMenu } from '../AnchoredMenu/AnchoredMenu';\nimport { listboxDomId, optionDomId } from '../AnchoredMenu/components/OptionRow';\nimport { useKeepAnchorInRoom } from '../AnchoredMenu/menuPortal';\nimport { controlStyles as s } from '../controls/controlStyles';\nimport type { ControlOption } from '../controls/controlTypes';\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\nimport { useDelayedBlurClose } from './hooks/useDelayedBlurClose';\nimport { useTypeaheadState } from './hooks/useTypeaheadState';\nimport type { FieldControlWiring, TypeaheadSearch } from './types';\n\nexport type { TypeaheadSearch } from './types';\n\n/** Default min characters before suggestions surface. */\nexport const DEFAULT_TYPEAHEAD_MIN_CHARS = 1;\n/** Default cap on rendered suggestions. */\nexport const DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS = 8;\n\ninterface TypeaheadCommonProps {\n /** The raw text in the box — NOT necessarily an option value. */\n value: string;\n onChange: (value: string) => void;\n /** Called on Enter/submit (after the menu closes). Omit if the surface has nothing to commit. */\n onSubmit?: () => void;\n placeholder?: string;\n /** PRE-LOCALIZED accessible name of the input. */\n accessibilityLabel: string;\n accessibilityHint?: string;\n /** PRE-LOCALIZED accessibility hint applied to every suggestion. */\n optionHint?: string;\n /** PRE-LOCALIZED inline error (e.g. \"Unrecognised country\"). Shows a persistent banner. */\n error?: string;\n /** Minimum characters before suggestions surface. Default 1. */\n minChars?: number;\n /** Merged LAST onto the anchor wrapper. */\n style?: StyleProp<ViewStyle>;\n /** Input is `${testID}-input`, menu `${testID}-menu`, error `${testID}-error`. */\n testID: string;\n}\n\nexport interface TypeaheadControlProps extends TypeaheadCommonProps {\n options: readonly ControlOption[];\n maxSuggestions?: number;\n}\n\nexport interface TypeaheadSearchProps extends TypeaheadCommonProps {\n search: TypeaheadSearch;\n}\n\nfunction comboboxAria(testID: string, isExpanded: boolean, highlighted: ControlOption | undefined): Record<string, string | boolean | undefined> {\n return {\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': isExpanded,\n 'aria-controls': isExpanded ? listboxDomId(testID) : undefined,\n 'aria-activedescendant': highlighted !== undefined ? optionDomId(testID, highlighted.value) : undefined,\n };\n}\n\nfunction TypeaheadControlImpl(props: (TypeaheadControlProps | TypeaheadSearchProps) & FieldControlWiring, ref: ForwardedRef<TextInput>): React.ReactElement {\n const { value, onChange, onSubmit, placeholder, accessibilityLabel, accessibilityHint, optionHint = '', error, minChars = DEFAULT_TYPEAHEAD_MIN_CHARS, style, testID } = props;\n const { id, describedById } = props;\n const search = 'search' in props ? props.search : undefined;\n const options = 'options' in props ? props.options : undefined;\n const maxSuggestions = ('search' in props ? props.search.maxResults : props.maxSuggestions) ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS;\n const { theme } = useUi();\n const { colors, palette } = theme;\n const anchorRef = useRef<View>(null);\n const state = useTypeaheadState({ options, search, value, minChars, maxSuggestions, onChange, onSubmit });\n const { handleFocus, handleBlur } = useDelayedBlurClose(state.open, state.close);\n const showMenu = state.isOpen && (state.rows.length > 0 || state.statusText !== undefined);\n const isExpanded = state.isOpen && state.rows.length > 0;\n const hasError = error !== undefined && error !== '';\n useKeepAnchorInRoom(anchorRef, search?.scrollMarginTop ?? 0, search !== undefined && state.isOpen);\n\n return (\n <View ref={anchorRef} style={[s.anchor, style]}>\n <TextInput\n ref={ref}\n id={id}\n {...comboboxAria(testID, isExpanded, state.highlighted)}\n {...webFieldA11y({ describedById })}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n autoCapitalize=\"none\"\n autoComplete=\"off\"\n autoCorrect={false}\n blurOnSubmit={search === undefined}\n placeholder={placeholder}\n placeholderTextColor={colors.textSecondary}\n spellCheck={false}\n value={value}\n onChangeText={state.handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyPress={state.handleKeyPress}\n onSubmitEditing={state.handleSubmit}\n style={[s.input, { borderColor: hasError ? fieldErrorInk(theme) : colors.border, backgroundColor: colors.surface, color: colors.text }]}\n testID={search?.inputTestID ?? `${testID}-input`}\n />\n {showMenu ? (\n <AnchoredMenu\n accessibilityLabel={accessibilityLabel}\n options={state.rows}\n selectedValue={search !== undefined ? (state.picked?.value ?? '') : value}\n onSelect={state.selectValue}\n onDismiss={state.close}\n colors={{ text: colors.text, textSecondary: colors.textSecondary, border: colors.border, surface: colors.surface, brand: palette.primary['500'] }}\n optionHint={optionHint}\n testID={testID}\n anchorRef={anchorRef}\n listbox={{ highlightedValue: state.highlighted?.value ?? '', statusText: state.statusText }}\n // Portal the suggestions to document.body on web: a typeahead sits in a filter row above\n // other content (fields, guides, a results table), and the in-tree popover was painted\n // under / clipped by it (\"hidden below\"). The portal escapes that stacking + clipping.\n usePortal\n />\n ) : null}\n {hasError ? (\n <Text role=\"alert\" style={[s.error, { color: fieldErrorInk(theme) }]} testID={`${testID}-error`}>\n {error}\n </Text>\n ) : null}\n </View>\n );\n}\n\nexport const TypeaheadControl = forwardRef(TypeaheadControlImpl);\n\nexport default TypeaheadControl;\n","import React from 'react';\n\nimport { StyleSheet, type TextStyle } from 'react-native';\n\nimport { controlStyles } from '../../controls/controlStyles';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nconst NATIVE_INPUT_BOX: React.CSSProperties = {\n borderStyle: 'solid',\n boxSizing: 'border-box',\n fontFamily: 'inherit',\n width: '100%',\n};\n\ninterface WebDateInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n webInputType: string;\n}\n\nexport function buildNativeInputStyle(themed: TextStyle): React.CSSProperties {\n const { paddingHorizontal, paddingVertical, ...box } = StyleSheet.flatten(controlStyles.input);\n return {\n ...box,\n ...themed,\n ...NATIVE_INPUT_BOX,\n paddingBlock: paddingVertical,\n paddingInline: paddingHorizontal,\n } as React.CSSProperties;\n}\n\n/** A real DOM input: react-native-web's `TextInput` discards a `type` prop, so it cannot open a calendar. */\nexport function WebDateInput({ fieldProps, context, webInputType }: WebDateInputProps): React.ReactElement {\n const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });\n const webA11y = webFieldA11y({\n describedById: context.describedById,\n hasError: context.hasError,\n required,\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => onChange(event.target.value);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(hoverBind as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(focusBind as unknown as React.InputHTMLAttributes<HTMLInputElement>)}\n aria-label={label}\n data-testid={testID}\n disabled={disabled}\n id={context.controlId}\n max={max}\n min={min}\n style={buildNativeInputStyle(style)}\n title={accessibilityHint}\n type={webInputType}\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n />\n );\n}\n","import React from 'react';\n\nimport { GlyphName } from './GlyphName';\n\nconst PATHS: Readonly<Record<GlyphName, string>> = {\n [GlyphName.Calendar]: 'M7 3v3M17 3v3M4 9h16M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z',\n [GlyphName.Previous]: 'M15 5l-7 7 7 7',\n [GlyphName.Next]: 'M9 5l7 7-7 7',\n};\nconst SIZE = 18;\nconst STROKE = 2;\n\n/** A line glyph for an `IconButton` `renderIcon`, drawn in the colour the button hands it. */\nexport function Glyph({ name, color }: { name: GlyphName; color: string }): React.ReactElement {\n return (\n <svg aria-hidden=\"true\" fill=\"none\" height={SIZE} stroke={color} strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={STROKE} viewBox=\"0 0 24 24\" width={SIZE}>\n <path d={PATHS[name]} />\n </svg>\n );\n}\n","import { resolveOnBrand } from '@dloizides/design-tokens';\nimport { useUi } from '@dloizides/ui-feedback';\n\nexport interface PickerColors {\n text: string;\n textSecondary: string;\n border: string;\n surface: string;\n brand: string;\n onBrand: string;\n tint: string;\n}\n\nconst TINT_STEP = '100';\n\nexport function usePickerColors(): PickerColors {\n const { theme } = useUi();\n const brand = theme.palette.primary['500'];\n return {\n text: theme.colors.text,\n textSecondary: theme.colors.textSecondary,\n border: theme.colors.border,\n surface: theme.colors.surface,\n brand,\n onBrand: resolveOnBrand(brand),\n tint: theme.palette.primary[TINT_STEP] ?? theme.colors.background,\n };\n}\n","import React, { useRef, type CSSProperties, type KeyboardEvent, type ReactNode } from 'react';\n\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nexport interface PickerDialogProps {\n testID: string;\n sheet: boolean;\n onDismiss: () => void;\n children: ReactNode;\n}\n\nconst FOCUSABLE = 'button, select, input, [tabindex]';\nconst RADIUS = 12;\nconst SHEET_RADIUS = 16;\nconst PAD = 12;\nconst SHEET_MAX_HEIGHT = '90vh';\n\n/** The focusable controls inside `container` in DOM order, skipping disabled and roving (-1) ones. */\nexport function tabStops(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (node) => node.tabIndex >= 0 && !node.hasAttribute('disabled') && node.getAttribute('aria-disabled') !== 'true',\n );\n}\n\n/** The date dialog body inside the named modal: Tab and Shift+Tab wrap inside it, Escape closes it. */\nexport function PickerDialog({ testID, sheet, onDismiss, children }: PickerDialogProps): React.ReactElement {\n const colors = usePickerColors();\n const ref = useRef<HTMLDivElement>(null);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onDismiss();\n return;\n }\n if (event.key !== 'Tab' || ref.current === null) return;\n const stops = tabStops(ref.current);\n const first = stops[0];\n const last = stops[stops.length - 1];\n if (first === undefined || last === undefined) return;\n const atEdge = event.shiftKey ? document.activeElement === first : document.activeElement === last;\n if (!atEdge) return;\n event.preventDefault();\n (event.shiftKey ? last : first).focus();\n };\n\n const shape: CSSProperties = sheet\n ? { borderTopLeftRadius: SHEET_RADIUS, borderTopRightRadius: SHEET_RADIUS, width: '100%', maxHeight: SHEET_MAX_HEIGHT, overflowY: 'auto' }\n : { borderRadius: RADIUS, boxShadow: `0 12px 32px ${colors.border}` };\n const style: CSSProperties = { boxSizing: 'border-box', padding: PAD, background: colors.surface, color: colors.text, border: `1px solid ${colors.border}`, fontFamily: 'inherit', ...shape };\n\n return (\n <div ref={ref} data-testid={testID} data-variant={sheet ? 'sheet' : 'popover'} style={style} onKeyDown={onKeyDown}>\n {children}\n </div>\n );\n}\n","import { useEffect, useState, type RefObject } from 'react';\n\nimport type { View } from 'react-native';\n\nimport type { AnchorRect } from '../utils/dropdownFrame';\n\n/** The anchor box in window coordinates, measured once when the list opens. */\nexport function useAnchorRect(anchorRef: RefObject<View | null>): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null);\n useEffect(() => {\n anchorRef.current?.measureInWindow((x, y, width, height) => setRect({ x, y, width, height }));\n }, [anchorRef]);\n return rect;\n}\n","export enum DropdownPlacement {\n Below = 'below',\n Above = 'above',\n}\n","import { DropdownPlacement } from '../DropdownPlacement';\n\nconst MIN_PANEL_WIDTH = 240;\nconst EDGE = 8;\n\nexport interface AnchorRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DropdownFrame {\n placement: DropdownPlacement;\n left: number;\n width: number;\n top?: number;\n bottom?: number;\n}\n\n/** Opens below when the list fits there, else on whichever side has more room. */\nexport function placeDropdown(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement {\n const roomBelow = viewportHeight - (anchor.y + anchor.height);\n if (roomBelow >= panelHeight) return DropdownPlacement.Below;\n return anchor.y > roomBelow ? DropdownPlacement.Above : DropdownPlacement.Below;\n}\n\nfunction placeBelowFirst(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement {\n const roomBelow = viewportHeight - (anchor.y + anchor.height);\n const fitsOnlyAbove = roomBelow < panelHeight && anchor.y - EDGE >= panelHeight;\n return fitsOnlyAbove ? DropdownPlacement.Above : DropdownPlacement.Below;\n}\n\nfunction clampTop(top: number, panelHeight: number, viewportHeight: number): number {\n return Math.max(EDGE, Math.min(top, viewportHeight - panelHeight - EDGE));\n}\n\n/** The window frame for the list next to `anchor`, kept inside the viewport; `preferBelow` opens under the field unless only the room above fits the list. */\nexport function dropdownFrame(anchor: AnchorRect, panelHeight: number, viewportHeight: number, preferBelow = false): DropdownFrame {\n const placement = preferBelow ? placeBelowFirst(anchor, panelHeight, viewportHeight) : placeDropdown(anchor, panelHeight, viewportHeight);\n const base = { placement, left: anchor.x, width: anchor.width };\n if (placement === DropdownPlacement.Above) return { ...base, bottom: viewportHeight - clampTop(anchor.y - panelHeight, panelHeight, viewportHeight) - panelHeight };\n return { ...base, top: clampTop(anchor.y + anchor.height, panelHeight, viewportHeight) };\n}\n\n/** Widens a narrow anchor's list to `minWidth` (default a readable width) and keeps it inside the viewport. */\nexport function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number, minWidth = MIN_PANEL_WIDTH): DropdownFrame {\n const width = Math.max(frame.width, Math.min(minWidth, viewportWidth - EDGE - EDGE));\n const left = Math.max(EDGE, Math.min(frame.left, viewportWidth - width - EDGE));\n return { ...frame, width, left: frame.width >= width ? frame.left : left };\n}\n","import React, { useCallback, useState, type RefObject } from 'react';\n\nimport { Animated, Modal, Pressable, StyleSheet, useWindowDimensions, type LayoutChangeEvent, type View } from 'react-native';\n\nimport { useAnchorRect } from '../hooks/useAnchorRect';\nimport { dropdownFrame, fitDropdownWidth } from '../utils/dropdownFrame';\n\nexport interface DropdownSurfaceProps {\n progress: Animated.Value;\n translateY: Animated.AnimatedInterpolation<number>;\n anchorRef: RefObject<View | null>;\n onDismiss: () => void;\n closeLabel: string;\n closeHint: string;\n testID: string;\n children: React.ReactNode;\n /** Smallest panel width; defaults to the list width. */\n minWidth?: number;\n /** Optional grow-from-the-field scale, applied from the top-left corner. */\n scale?: Animated.AnimatedInterpolation<number>;\n /** Accessible name of the modal dialog; omitted = unnamed, as before. */\n accessibilityLabel?: string;\n /** Always open under the field, moved up to stay inside the viewport. */\n preferBelow?: boolean;\n}\n\n/** The computer surface: a layer above the page beside the field, opening upward when there is no room below. */\nexport function DropdownSurface({ progress, translateY, anchorRef, onDismiss, closeLabel, closeHint, testID, children, minWidth, scale, accessibilityLabel, preferBelow = false }: DropdownSurfaceProps): React.ReactElement {\n const { height: viewportHeight, width: viewportWidth } = useWindowDimensions();\n const anchor = useAnchorRect(anchorRef);\n const [panelHeight, setPanelHeight] = useState(0);\n const onLayout = useCallback((event: LayoutChangeEvent) => setPanelHeight(event.nativeEvent.layout.height), []);\n const frame = anchor === null ? null : fitDropdownWidth(dropdownFrame(anchor, panelHeight, viewportHeight, preferBelow), viewportWidth, minWidth);\n const place = frame === null ? null : { left: frame.left, width: frame.width, top: frame.top, bottom: frame.bottom };\n\n return (\n <Modal transparent visible animationType=\"none\" aria-label={accessibilityLabel} onRequestClose={onDismiss}>\n <Pressable accessibilityHint={closeHint} accessibilityLabel={closeLabel} accessibilityRole=\"button\" style={StyleSheet.absoluteFill} testID={`${testID}-backdrop`} onPress={onDismiss} />\n {frame !== null ? (\n <Animated.View style={[styles.dropdown, place, { opacity: progress, transform: scale === undefined ? [{ translateY }] : [{ translateY }, { scale }] }, scale === undefined ? null : styles.growFromField]} testID={`${testID}-dropdown-${frame.placement}`} onLayout={onLayout}>\n {children}\n </Animated.View>\n ) : null}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n dropdown: { position: 'absolute' },\n growFromField: { transformOrigin: 'top left' },\n});\n","import React from 'react';\n\nimport { Animated, Modal, Pressable, StyleSheet, View } from 'react-native';\n\nexport interface SheetSurfaceProps {\n translateY: Animated.AnimatedInterpolation<number>;\n onDismiss: () => void;\n closeLabel: string;\n closeHint: string;\n testID: string;\n children: React.ReactNode;\n /** Optional fade, 0 to 1. */\n progress?: Animated.Value;\n /** Optional grow scale, applied from the bottom edge. */\n scale?: Animated.AnimatedInterpolation<number>;\n /** Accessible name of the modal dialog; omitted = unnamed, as before. */\n accessibilityLabel?: string;\n}\n\n/** The phone surface: a bottom sheet over a backdrop that closes the list when tapped. */\nexport function SheetSurface({ translateY, onDismiss, closeLabel, closeHint, testID, children, progress, scale, accessibilityLabel }: SheetSurfaceProps): React.ReactElement {\n return (\n <Modal transparent visible animationType=\"none\" aria-label={accessibilityLabel} onRequestClose={onDismiss}>\n <View style={styles.backdrop}>\n <Pressable accessibilityHint={closeHint} accessibilityLabel={closeLabel} accessibilityRole=\"button\" style={StyleSheet.absoluteFill} testID={`${testID}-backdrop`} onPress={onDismiss} />\n <Animated.View testID={`${testID}-sheet`} style={[styles.sheet, { transform: scale === undefined ? [{ translateY }] : [{ translateY }, { scale }] }, progress === undefined ? null : { opacity: progress }]}>{children}</Animated.View>\n </View>\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n backdrop: { flex: 1, justifyContent: 'flex-end' },\n sheet: { width: '100%', alignSelf: 'stretch' },\n});\n","import { useEffect, useState } from 'react';\n\nimport { AccessibilityInfo } from 'react-native';\n\n/** True when the user asked the system to reduce motion. */\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n let active = true;\n AccessibilityInfo.isReduceMotionEnabled()\n .then((value) => {\n if (active) setReduced(value);\n })\n .catch(() => undefined);\n const subscription: { remove: () => void } | undefined = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduced);\n return () => {\n active = false;\n subscription?.remove();\n };\n }, []);\n return reduced;\n}\n","import type { DatePickerLabels } from '../types';\n\nexport const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels = {\n dialog: 'Choose a date',\n rangeDialog: 'Choose a date range',\n openCalendar: 'Open calendar',\n openCalendarHint: 'Opens a calendar to pick the date',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n monthHint: 'Shows another month',\n month: 'Month',\n year: 'Year',\n dayHint: 'Picks this day',\n setDate: 'Set date',\n setDateHint: 'Saves the picked date',\n clear: 'Clear',\n clearHint: 'Removes the date',\n cancel: 'Cancel',\n cancelHint: 'Closes without changes',\n apply: 'Apply',\n applyHint: 'Saves the picked range',\n presets: 'Quick ranges',\n presetHint: 'Sets the range to this period',\n today: 'Today',\n last7Days: 'Last 7 days',\n thisMonth: 'This month',\n quarter: 'Quarter',\n dayCount: '{{p1}} days',\n invalidDate: 'Enter a real date',\n rangeSeparator: ' – ',\n rangeOrder: 'The start must be on or before the end',\n outOfRange: 'This date is outside the allowed range',\n};\n","export interface DayParts {\n year: number;\n month: number;\n day: number;\n}\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst MONTHS_IN_YEAR = 12;\nconst DAYS_IN_WEEK = 7;\nconst PAD = 2;\nconst YEAR_PAD = 4;\nconst SUNDAY = 0;\nconst MONDAY = 1;\nconst MS_PER_DAY = 86_400_000;\nconst MONTH_PREFIX = 'YYYY-MM'.length;\nconst EPOCH = { year: 1970, month: 1, day: 1 };\n\nexport function daysInMonth(year: number, month: number): number {\n return new Date(Date.UTC(year, month, 0)).getUTCDate();\n}\n\nexport function isValidParts({ year, month, day }: DayParts): boolean {\n const inMonth = month >= 1 && month <= MONTHS_IN_YEAR;\n return Number.isInteger(year) && year > 0 && inMonth && Number.isInteger(day) && day >= 1 && day <= daysInMonth(year, month);\n}\n\nexport function parseIso(value: string): DayParts | null {\n const match = ISO_DATE.exec(value);\n if (match === null) return null;\n const parts = { year: Number(match[1]), month: Number(match[2]), day: Number(match[3]) };\n return isValidParts(parts) ? parts : null;\n}\n\nexport function toIso({ year, month, day }: DayParts): string {\n return `${String(year).padStart(YEAR_PAD, '0')}-${String(month).padStart(PAD, '0')}-${String(day).padStart(PAD, '0')}`;\n}\n\nfunction toUtc(iso: string): Date {\n const parts = parseIso(iso) ?? EPOCH;\n return new Date(Date.UTC(parts.year, parts.month - 1, parts.day));\n}\n\nfunction fromUtc(date: Date): string {\n return toIso({ year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate() });\n}\n\nexport function addDays(iso: string, days: number): string {\n const date = toUtc(iso);\n date.setUTCDate(date.getUTCDate() + days);\n return fromUtc(date);\n}\n\nexport function addMonths(iso: string, months: number): string {\n const parts = parseIso(iso) ?? EPOCH;\n const index = parts.year * MONTHS_IN_YEAR + (parts.month - 1) + months;\n const year = Math.floor(index / MONTHS_IN_YEAR);\n const month = (index % MONTHS_IN_YEAR) + 1;\n return toIso({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) });\n}\n\n/** Days after the week start `firstDay` (1 = Monday ... 7 = Sunday). */\nexport function weekdayIndex(iso: string, firstDay = MONDAY): number {\n const day = toUtc(iso).getUTCDay();\n const isoDay = day === SUNDAY ? DAYS_IN_WEEK : day;\n return (isoDay - firstDay + DAYS_IN_WEEK) % DAYS_IN_WEEK;\n}\n\nexport function daysBetweenInclusive(from: string, to: string): number {\n return Math.round((toUtc(to).getTime() - toUtc(from).getTime()) / MS_PER_DAY) + 1;\n}\n\nexport function isWithinBounds(iso: string, min?: string, max?: string): boolean {\n const aboveMin = min === undefined || min === '' || iso >= min.slice(0, iso.length);\n const belowMax = max === undefined || max === '' || iso <= max.slice(0, iso.length);\n return aboveMin && belowMax;\n}\n\nexport function clampToBounds(iso: string, min?: string, max?: string): string {\n if (min !== undefined && min !== '' && iso < min.slice(0, iso.length)) return min.slice(0, iso.length);\n if (max !== undefined && max !== '' && iso > max.slice(0, iso.length)) return max.slice(0, iso.length);\n return iso;\n}\n\nexport function todayIso(now: Date = new Date()): string {\n return toIso({ year: now.getFullYear(), month: now.getMonth() + 1, day: now.getDate() });\n}\n\nexport function monthStart(iso: string): string {\n return `${iso.slice(0, MONTH_PREFIX)}-01`;\n}\n","import { DatePart } from './DatePart';\nimport { isValidParts, parseIso, toIso } from './isoDate';\n\nconst SAMPLE_UTC = Date.UTC(2027, 5, 12);\nconst TWO_DIGIT_YEAR = 100;\nconst CENTURY = 2000;\nconst PART_COUNT = 3;\nconst PAD = 2;\nconst MONDAY = 1;\nconst ISO_LIKE = /^\\d{4}-\\d{1,2}-\\d{1,2}$/;\nconst MONTH_INDEXES = Array.from({ length: 12 }, (_unused, index) => index);\nconst WEEK_OFFSETS = Array.from({ length: 7 }, (_unused, index) => index);\nconst UTC = 'UTC';\nconst PART_OF: Readonly<Partial<Record<string, DatePart>>> = { day: DatePart.Day, month: DatePart.Month, year: DatePart.Year };\n\nfunction utcOf(iso: string): Date | null {\n const parts = parseIso(iso);\n return parts === null ? null : new Date(Date.UTC(parts.year, parts.month - 1, parts.day));\n}\n\nfunction formatWith(iso: string, locale: string | undefined, options: Intl.DateTimeFormatOptions): string {\n const date = utcOf(iso);\n if (date === null) return iso;\n return new Intl.DateTimeFormat(locale, { ...options, timeZone: UTC }).format(date).replace(/,/g, '');\n}\n\n/** The closed-field display, e.g. en-GB `Sat 12 Jun 2027`. */\nexport function formatDisplay(iso: string, locale?: string): string {\n return formatWith(iso, locale, { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' });\n}\n\nexport function formatShort(iso: string, locale?: string, withYear = true): string {\n return formatWith(iso, locale, withYear ? { day: 'numeric', month: 'short', year: 'numeric' } : { day: 'numeric', month: 'short' });\n}\n\nexport function formatMonthYear(iso: string, locale?: string): string {\n return formatWith(iso, locale, { month: 'long', year: 'numeric' });\n}\n\nexport function monthNames(locale?: string): string[] {\n const format = new Intl.DateTimeFormat(locale, { month: 'long', timeZone: UTC });\n return MONTH_INDEXES.map((month) => format.format(new Date(Date.UTC(2024, month, 1))));\n}\n\n/** Short weekday names starting on `firstDay` (1 = Monday ... 7 = Sunday). */\nexport function weekdayNames(locale?: string, firstDay = MONDAY): string[] {\n const format = new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: UTC });\n return WEEK_OFFSETS.map((offset) => format.format(new Date(Date.UTC(2024, 0, firstDay + offset))));\n}\n\nexport function typedOrder(locale?: string): DatePart[] {\n const parts = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'numeric', year: 'numeric', timeZone: UTC }).formatToParts(new Date(SAMPLE_UTC));\n return parts.map((part) => PART_OF[part.type]).filter((part): part is DatePart => part !== undefined);\n}\n\n/** The numeric form shown while typing, in the locale's order, e.g. en-GB `02/06/2027`. */\nexport function formatTyped(iso: string, locale?: string): string {\n const parts = parseIso(iso);\n if (parts === null) return iso;\n const text: Record<DatePart, string> = {\n [DatePart.Day]: String(parts.day).padStart(PAD, '0'),\n [DatePart.Month]: String(parts.month).padStart(PAD, '0'),\n [DatePart.Year]: String(parts.year),\n };\n return typedOrder(locale).map((part) => text[part]).join('/');\n}\n\n/** Reads a typed date (`YYYY-MM-DD` or the locale's numeric order) as `YYYY-MM-DD`, else `null`. */\nexport function parseTyped(text: string, locale?: string): string | null {\n const trimmed = text.trim();\n if (ISO_LIKE.test(trimmed)) {\n const [year = 0, month = 0, day = 0] = trimmed.split('-').map(Number);\n const parts = { year, month, day };\n return isValidParts(parts) ? toIso(parts) : null;\n }\n const numbers = trimmed.split(/\\D+/).filter((piece) => piece !== '').map(Number);\n if (numbers.length !== PART_COUNT) return null;\n const order = typedOrder(locale);\n const read = (part: DatePart): number => numbers[order.indexOf(part)] ?? 0;\n const rawYear = read(DatePart.Year);\n const parts = { year: rawYear < TWO_DIGIT_YEAR ? CENTURY + rawYear : rawYear, month: read(DatePart.Month), day: read(DatePart.Day) };\n return isValidParts(parts) ? toIso(parts) : null;\n}\n","import { formatDisplay, formatTyped } from './formatDate';\n\nexport const enum DateDisplay {\n Long = 'long',\n Numeric = 'numeric',\n}\n\n/** The closed-field formatter: Long `Fri 20 Nov 2026`, Numeric in the locale's order, en-GB `20/11/2026`. */\nexport function displayFormatter(display: DateDisplay): (iso: string, locale?: string) => string {\n return display === DateDisplay.Numeric ? formatTyped : formatDisplay;\n}\n","const MONDAY = 1;\nconst SUNDAY = 7;\nconst SUNDAY_REGIONS = new Set(['US', 'CA', 'MX', 'BR', 'JP', 'KR', 'TW', 'HK', 'IL', 'PH', 'IN', 'ZA', 'SA', 'PE', 'CO', 'VE', 'GT', 'HN', 'PA', 'PR', 'DO', 'SV', 'TH', 'ID']);\n\ninterface WeekInfoLocale {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n}\n\n/** The locale's first day of the week, ISO numbering: 1 = Monday ... 7 = Sunday. */\nexport function weekFirstDay(locale?: string): number {\n try {\n const resolved = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale);\n const info = resolved as unknown as WeekInfoLocale;\n const first = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;\n if (first !== undefined) return first;\n return SUNDAY_REGIONS.has(resolved.maximize().region ?? '') ? SUNDAY : MONDAY;\n } catch {\n return MONDAY;\n }\n}\n","import React, { createContext, useContext, useMemo } from 'react';\n\nimport { DEFAULT_DATE_PICKER_LABELS } from '../data/defaultLabels';\nimport { DateDisplay } from '../utils/DateDisplay';\nimport { todayIso } from '../utils/isoDate';\nimport { weekFirstDay } from '../utils/weekStart';\n\nimport type { DatePickerLabels } from '../types';\n\nexport interface DatePickerConfig {\n labels: DatePickerLabels;\n locale?: string;\n today: string;\n /** First day of the week from the locale, 1 = Monday ... 7 = Sunday. */\n firstDay: number;\n display: DateDisplay;\n}\n\nexport interface DatePickerProviderProps {\n /** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */\n labels?: Partial<DatePickerLabels>;\n /** BCP 47 locale for display, typing order and week start; omitted = the runtime locale. */\n locale?: string;\n /** Fixed `YYYY-MM-DD` today, for demos and tests. */\n today?: string;\n /** Closed-field format; omitted = Long (`Fri 20 Nov 2026`), Numeric = the locale's `20/11/2026`. */\n display?: DateDisplay;\n children: React.ReactNode;\n}\n\ninterface StoredConfig {\n labels: DatePickerLabels;\n locale?: string;\n today?: string;\n display?: DateDisplay;\n}\n\nconst DatePickerContext = createContext<StoredConfig>({ labels: DEFAULT_DATE_PICKER_LABELS });\n\n/** Supplies picker labels, locale and an optional fixed today to every date control below it. */\nexport function DatePickerProvider({ labels, locale, today, display, children }: DatePickerProviderProps): React.ReactElement {\n const value = useMemo(() => ({ labels: { ...DEFAULT_DATE_PICKER_LABELS, ...labels }, locale, today, display }), [labels, locale, today, display]);\n return <DatePickerContext.Provider value={value}>{children}</DatePickerContext.Provider>;\n}\n\nexport function useDatePickerConfig(): DatePickerConfig {\n const config = useContext(DatePickerContext);\n const firstDay = useMemo(() => weekFirstDay(config.locale), [config.locale]);\n return { labels: config.labels, locale: config.locale, today: config.today ?? todayIso(), firstDay, display: config.display ?? DateDisplay.Long };\n}\n","import type { CSSProperties } from 'react';\n\nexport const OPEN_MS = 180;\nexport const MONTH_SLIDE_MS = 200;\nexport const MONTH_SLIDE_PX = 16;\nconst OPEN_SCALE = 0.96;\nconst EASE = 'cubic-bezier(0.2, 0, 0, 1)';\n\nexport interface OpenMotion {\n durationMs: number;\n fromScale: number;\n}\n\n/** Open: scale + fade from the field; reduced motion opens at once. */\nexport function resolveOpenMotion(reduced: boolean): OpenMotion {\n return reduced ? { durationMs: 0, fromScale: 1 } : { durationMs: OPEN_MS, fromScale: OPEN_SCALE };\n}\n\n/** Month change: a short slide in the direction of travel; none on first show or reduced motion. */\nexport function monthSlideStyle(entered: boolean, reduced: boolean, direction: number): CSSProperties {\n if (reduced || direction === 0) return {};\n return {\n opacity: entered ? 1 : 0,\n transform: entered ? 'translateX(0px)' : `translateX(${direction * MONTH_SLIDE_PX}px)`,\n transition: `opacity ${MONTH_SLIDE_MS}ms ${EASE}, transform ${MONTH_SLIDE_MS}ms ${EASE}`,\n };\n}\n","import React, { useEffect, useRef, type ReactNode, type RefObject } from 'react';\n\nimport { Animated, type View } from 'react-native';\n\nimport { PickerDialog } from './PickerDialog';\nimport { DropdownSurface } from '../../SearchSelect/components/DropdownSurface';\nimport { SheetSurface } from '../../SearchSelect/components/SheetSurface';\nimport { useReducedMotion } from '../../SearchSelect/hooks/useReducedMotion';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { resolveOpenMotion } from '../utils/motionStyles';\n\nexport interface PickerSurfaceProps {\n anchorRef: RefObject<View | null>;\n phone: boolean;\n minWidth: number;\n label: string;\n testID: string;\n onDismiss: () => void;\n children: ReactNode;\n}\n\ninterface OpenProgress {\n progress: Animated.Value;\n scale: Animated.AnimatedInterpolation<number>;\n still: Animated.AnimatedInterpolation<number>;\n}\n\nfunction useOpenProgress(): OpenProgress {\n const { durationMs, fromScale } = resolveOpenMotion(useReducedMotion());\n const progress = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();\n }, [progress, durationMs]);\n return {\n progress,\n scale: progress.interpolate({ inputRange: [0, 1], outputRange: [fromScale, 1] }),\n still: progress.interpolate({ inputRange: [0, 1], outputRange: [0, 0] }),\n };\n}\n\n/** The calendar on the shared select surfaces: `SheetSurface` on a phone, `DropdownSurface` beside the field otherwise. */\nexport function PickerSurface({ anchorRef, phone, minWidth, label, testID, onDismiss, children }: PickerSurfaceProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const { progress, scale, still } = useOpenProgress();\n const body = (\n <PickerDialog sheet={phone} testID={testID} onDismiss={onDismiss}>\n {children}\n </PickerDialog>\n );\n if (phone) {\n return <SheetSurface accessibilityLabel={label} closeHint={labels.cancelHint} closeLabel={labels.cancel} progress={progress} testID={testID} translateY={still} onDismiss={onDismiss}>{body}</SheetSurface>;\n }\n return (\n <DropdownSurface accessibilityLabel={label} anchorRef={anchorRef} closeHint={labels.cancelHint} closeLabel={labels.cancel} minWidth={minWidth} preferBelow progress={progress} scale={scale} testID={testID} translateY={still} onDismiss={onDismiss}>\n {body}\n </DropdownSurface>\n );\n}\n","import { addDays, addMonths, weekdayIndex } from './isoDate';\n\nconst DAYS_IN_WEEK = 7;\nconst MONTHS_IN_YEAR = 12;\nconst MONDAY = 1;\n\nconst DAY_STEPS: Readonly<Record<string, number>> = {\n ArrowLeft: -1,\n ArrowRight: 1,\n ArrowUp: -DAYS_IN_WEEK,\n ArrowDown: DAYS_IN_WEEK,\n};\n\n/** The day a WAI-ARIA date grid key moves focus to, or `null` when the key is not a grid move. */\nexport function nextFocusDay(iso: string, key: string, shiftKey = false, firstDay = MONDAY): string | null {\n const step = DAY_STEPS[key];\n if (step !== undefined) return addDays(iso, step);\n const monthStep = shiftKey ? MONTHS_IN_YEAR : 1;\n if (key === 'PageUp') return addMonths(iso, -monthStep);\n if (key === 'PageDown') return addMonths(iso, monthStep);\n if (key === 'Home') return addDays(iso, -weekdayIndex(iso, firstDay));\n if (key === 'End') return addDays(iso, DAYS_IN_WEEK - 1 - weekdayIndex(iso, firstDay));\n return null;\n}\n","import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from 'react';\n\nimport { useDatePickerConfig } from './useDatePickerConfig';\nimport { nextFocusDay } from '../utils/calendarKeys';\nimport { clampToBounds } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport function dayDomId(testID: string, iso: string): string {\n return `${testID}-day-${iso}`;\n}\n\nexport interface GridFocus {\n focusedDay: string;\n moveTo: (iso: string) => void;\n onDayKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\n/** Roving focus for a WAI-ARIA date grid: focuses `initial` on mount, then follows key moves. */\nexport function useGridFocus(initial: string, bounds: DateBounds, testID: string, onPick: (iso: string) => void): GridFocus {\n const { firstDay } = useDatePickerConfig();\n const [focusedDay, setFocusedDay] = useState(initial);\n const focusPending = useRef(true);\n const { min, max } = bounds;\n\n useEffect(() => {\n if (!focusPending.current) return;\n focusPending.current = false;\n document.getElementById(dayDomId(testID, focusedDay))?.focus();\n }, [focusedDay, testID]);\n\n const moveTo = useCallback((iso: string) => setFocusedDay(clampToBounds(iso, min, max)), [min, max]);\n\n const onDayKey = useCallback(\n (event: KeyboardEvent<HTMLButtonElement>, iso: string) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onPick(iso);\n return;\n }\n const next = nextFocusDay(iso, event.key, event.shiftKey, firstDay);\n if (next === null) return;\n event.preventDefault();\n focusPending.current = true;\n moveTo(next);\n },\n [moveTo, onPick, firstDay],\n );\n\n return { focusedDay, moveTo, onDayKey };\n}\n","import React, { type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { dayDomId } from '../hooks/useGridFocus';\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nexport interface DayCellState {\n inRange: boolean;\n isEnd: boolean;\n isToday: boolean;\n enabled: boolean;\n focusable: boolean;\n}\n\nexport interface DayCellProps {\n iso: string;\n state: DayCellState;\n testID: string;\n label: string;\n hint: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\nexport const DAY_CELL_PX = 44;\nconst DAY_START = 8;\nconst RING = 2;\nconst FONT = 14;\nconst BOLD = 700;\nconst REGULAR = 400;\n\n/** One 44 px day button inside its grid cell. */\nexport function DayCell({ iso, state, testID, label, hint, onPick, onKey }: DayCellProps): React.ReactElement {\n const colors = usePickerColors();\n const { inRange, isEnd, isToday, enabled, focusable } = state;\n const cellStyle: CSSProperties = { width: DAY_CELL_PX, height: DAY_CELL_PX, flexShrink: 0, background: inRange && !isEnd ? colors.tint : 'transparent' };\n const textColor = isEnd ? colors.onBrand : enabled ? colors.text : colors.textSecondary;\n const buttonStyle: CSSProperties = {\n width: DAY_CELL_PX,\n height: DAY_CELL_PX,\n padding: 0,\n boxSizing: 'border-box',\n borderRadius: DAY_CELL_PX / 2,\n border: `${RING}px solid ${isToday ? colors.brand : 'transparent'}`,\n background: isEnd ? colors.brand : 'transparent',\n color: textColor,\n textDecoration: enabled ? 'none' : 'line-through',\n fontFamily: 'inherit',\n fontSize: FONT,\n fontWeight: isEnd || isToday ? BOLD : REGULAR,\n cursor: enabled ? 'pointer' : 'default',\n };\n return (\n <div aria-selected={isEnd} role=\"gridcell\" style={cellStyle}>\n <button\n aria-current={isToday ? 'date' : undefined}\n aria-label={label}\n data-testid={dayDomId(testID, iso)}\n disabled={!enabled}\n id={dayDomId(testID, iso)}\n style={buttonStyle}\n tabIndex={focusable ? 0 : -1}\n title={hint}\n type=\"button\"\n onClick={() => onPick(iso)}\n onKeyDown={(event) => onKey(event, iso)}\n >\n {Number(iso.slice(DAY_START))}\n </button>\n </div>\n );\n}\n","import { daysInMonth, toIso, weekdayIndex } from './isoDate';\n\nconst DAYS_IN_WEEK = 7;\nconst MONDAY = 1;\n\nexport type MonthWeek = ReadonlyArray<string | null>;\n\n/** Weeks of a month starting on `firstDay` (1 = Monday ... 7 = Sunday); days outside the month are `null`. */\nexport function buildMonthGrid(year: number, month: number, firstDay = MONDAY): MonthWeek[] {\n const lead = weekdayIndex(toIso({ year, month, day: 1 }), firstDay);\n const cells: Array<string | null> = Array.from({ length: lead }, () => null);\n for (let day = 1; day <= daysInMonth(year, month); day += 1) cells.push(toIso({ year, month, day }));\n while (cells.length % DAYS_IN_WEEK !== 0) cells.push(null);\n const weeks: MonthWeek[] = [];\n for (let start = 0; start < cells.length; start += DAYS_IN_WEEK) weeks.push(cells.slice(start, start + DAYS_IN_WEEK));\n return weeks;\n}\n","import React, { useMemo, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { DAY_CELL_PX, DayCell, type DayCellState } from './DayCell';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { formatDisplay, formatMonthYear, weekdayNames } from '../utils/formatDate';\nimport { isWithinBounds, parseIso } from '../utils/isoDate';\nimport { buildMonthGrid } from '../utils/monthGrid';\n\nimport type { DateBounds } from '../types';\nimport type { DateRangeValue } from '../../controls/controlTypes';\n\nexport interface MonthGridProps {\n month: string;\n selection: DateRangeValue;\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n showCaption?: boolean;\n motion?: CSSProperties;\n}\n\nconst SHORT_DAY = 2;\nconst DAYS_IN_WEEK = 7;\nconst HEADER_LINE = 28;\nconst CAPTION_FONT = 15;\nconst WEEKDAY_FONT = 12;\nconst BOLD = 700;\nconst ROW: CSSProperties = { display: 'flex' };\nconst EMPTY: CSSProperties = { width: DAY_CELL_PX, height: DAY_CELL_PX, flexShrink: 0 };\nconst FALLBACK = { year: 1970, month: 1, day: 1 };\n\n/** One month as a WAI-ARIA grid, starting on the locale week start. */\nexport function MonthGrid({ month, selection, focusedDay, bounds, testID, onPick, onKey, showCaption = false, motion }: MonthGridProps): React.ReactElement {\n const { labels, locale, today, firstDay } = useDatePickerConfig();\n const colors = usePickerColors();\n const parts = parseIso(month) ?? FALLBACK;\n const weeks = useMemo(() => buildMonthGrid(parts.year, parts.month, firstDay), [parts.year, parts.month, firstDay]);\n const weekdays = useMemo(() => weekdayNames(locale, firstDay), [locale, firstDay]);\n const title = formatMonthYear(month, locale);\n const end = selection.to === '' ? selection.from : selection.to;\n\n const stateOf = (iso: string): DayCellState => ({\n inRange: selection.from !== '' && iso >= selection.from && iso <= end,\n isEnd: iso === selection.from || iso === selection.to,\n isToday: iso === today,\n enabled: isWithinBounds(iso, bounds.min, bounds.max),\n focusable: iso === focusedDay,\n });\n\n return (\n <div style={{ width: DAYS_IN_WEEK * DAY_CELL_PX, margin: '0 auto', ...motion }}>\n {showCaption ? <div style={{ textAlign: 'center', fontWeight: BOLD, fontSize: CAPTION_FONT, lineHeight: `${MIN_TOUCH_TARGET_PX}px` }}>{title}</div> : null}\n <div aria-label={title} data-testid={`${testID}-grid-${month.slice(0, '2026-11'.length)}`} role=\"grid\">\n <div role=\"row\" style={ROW}>\n {weekdays.map((name) => (\n <div key={name} role=\"columnheader\" style={{ width: DAY_CELL_PX, textAlign: 'center', fontSize: WEEKDAY_FONT, lineHeight: `${HEADER_LINE}px`, color: colors.textSecondary }}>\n {name.slice(0, SHORT_DAY)}\n </div>\n ))}\n </div>\n {weeks.map((week, row) => (\n <div key={`${month}-${row}`} role=\"row\" style={ROW}>\n {week.map((iso, column) =>\n iso === null ? (\n <div key={`empty-${column}`} role=\"gridcell\" style={EMPTY} />\n ) : (\n <DayCell key={iso} hint={labels.dayHint} iso={iso} label={formatDisplay(iso, locale)} state={stateOf(iso)} testID={testID} onKey={onKey} onPick={onPick} />\n ),\n )}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import React, { useMemo, type CSSProperties } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { Glyph } from './Glyph';\nimport { GlyphName } from './GlyphName';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { monthNames } from '../utils/formatDate';\nimport { addMonths, daysInMonth, parseIso, toIso } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface MonthHeaderProps {\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onMove: (iso: string) => void;\n}\n\nconst YEARS_BACK = 100;\nconst YEARS_AHEAD = 20;\nconst ISO_LENGTH = 10;\nconst FONT = 15;\nconst BOLD = 700;\nconst GAP = 4;\nconst FALLBACK = { year: 1970, month: 1, day: 1 };\n\nfunction boundYear(bound: string | undefined): number | undefined {\n return parseIso((bound ?? '').slice(0, ISO_LENGTH))?.year;\n}\n\nfunction yearOptions(current: number, bounds: DateBounds): number[] {\n const first = Math.min(current, boundYear(bounds.min) ?? current - YEARS_BACK);\n const last = Math.max(current, boundYear(bounds.max) ?? current + YEARS_AHEAD);\n return Array.from({ length: last - first + 1 }, (_unused, index) => first + index);\n}\n\n/** Previous / next month plus month and year menus. */\nexport function MonthHeader({ focusedDay, bounds, testID, onMove }: MonthHeaderProps): React.ReactElement {\n const { labels, locale } = useDatePickerConfig();\n const colors = usePickerColors();\n const parts = parseIso(focusedDay) ?? FALLBACK;\n const names = useMemo(() => monthNames(locale), [locale]);\n const setMonthYear = (year: number, month: number): void => onMove(toIso({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) }));\n const selectStyle: CSSProperties = { minHeight: MIN_TOUCH_TARGET_PX, border: 'none', background: 'transparent', color: colors.text, fontWeight: BOLD, fontSize: FONT, fontFamily: 'inherit', cursor: 'pointer' };\n\n return (\n <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.previousMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Previous} />} testID={`${testID}-previous`} onPress={() => onMove(addMonths(focusedDay, -1))} />\n <div style={{ display: 'flex', gap: GAP }}>\n <select aria-label={labels.month} data-testid={`${testID}-month`} style={selectStyle} title={labels.monthHint} value={parts.month} onChange={(event) => setMonthYear(parts.year, Number(event.target.value))}>\n {names.map((name, index) => (\n <option key={name} value={index + 1}>\n {name}\n </option>\n ))}\n </select>\n <select aria-label={labels.year} data-testid={`${testID}-year`} style={selectStyle} title={labels.monthHint} value={parts.year} onChange={(event) => setMonthYear(Number(event.target.value), parts.month)}>\n {yearOptions(parts.year, bounds).map((year) => (\n <option key={year} value={year}>\n {year}\n </option>\n ))}\n </select>\n </div>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.nextMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Next} />} testID={`${testID}-next`} onPress={() => onMove(addMonths(focusedDay, 1))} />\n </div>\n );\n}\n","import React, { type ReactNode } from 'react';\n\nimport { usePickerColors } from '../hooks/usePickerColors';\n\nconst GAP = 8;\n\n/** The footer row under a calendar: optional summary on the left, actions on the right. */\nexport function PickerFooter({ summary, children }: { summary?: ReactNode; children: ReactNode }): React.ReactElement {\n const colors = usePickerColors();\n return (\n <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: GAP, borderTop: `1px solid ${colors.border}`, paddingTop: GAP, marginTop: GAP }}>\n {summary}\n <div style={{ display: 'flex', gap: GAP, marginLeft: 'auto' }}>{children}</div>\n </div>\n );\n}\n","import { useEffect, useRef, useState, type CSSProperties } from 'react';\n\nimport { useReducedMotion } from '../../SearchSelect/hooks/useReducedMotion';\nimport { monthSlideStyle } from '../utils/motionStyles';\n\n/** False for the first painted frame of `key`, then true, so a CSS transition runs from the start state. */\nexport function useEntered(key: string, reduced: boolean): boolean {\n const [enteredKey, setEnteredKey] = useState<string | null>(null);\n useEffect(() => {\n if (reduced) return undefined;\n let inner = 0;\n const outer = requestAnimationFrame(() => {\n inner = requestAnimationFrame(() => setEnteredKey(key));\n });\n return () => {\n cancelAnimationFrame(outer);\n cancelAnimationFrame(inner);\n };\n }, [key, reduced]);\n return reduced || enteredKey === key;\n}\n\nexport function useMonthSlide(month: string): CSSProperties {\n const reduced = useReducedMotion();\n const previous = useRef(month);\n const direction = useRef(0);\n if (previous.current !== month) {\n direction.current = month > previous.current ? 1 : -1;\n previous.current = month;\n }\n const entered = useEntered(month, reduced);\n return monthSlideStyle(entered, reduced, direction.current);\n}\n","import React, { useState } from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { MonthGrid } from './MonthGrid';\nimport { MonthHeader } from './MonthHeader';\nimport { PickerFooter } from './PickerFooter';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { useGridFocus } from '../hooks/useGridFocus';\nimport { useMonthSlide } from '../hooks/useMotion';\nimport { clampToBounds, monthStart } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface SingleCalendarProps {\n value: string;\n bounds: DateBounds;\n testID: string;\n onCommit: (iso: string) => void;\n}\n\n/** One month with menus; a picked day is a draft until Set date commits it. */\nexport function SingleCalendar({ value, bounds, testID, onCommit }: SingleCalendarProps): React.ReactElement {\n const { labels, today } = useDatePickerConfig();\n const [draft, setDraft] = useState(value);\n const grid = useGridFocus(clampToBounds(value !== '' ? value : today, bounds.min, bounds.max), bounds, testID, setDraft);\n const month = monthStart(grid.focusedDay);\n const motion = useMonthSlide(month);\n\n const pick = (iso: string): void => {\n setDraft(iso);\n grid.moveTo(iso);\n };\n\n return (\n <div>\n <MonthHeader bounds={bounds} focusedDay={grid.focusedDay} testID={testID} onMove={grid.moveTo} />\n <MonthGrid bounds={bounds} focusedDay={grid.focusedDay} month={month} motion={motion} selection={{ from: draft, to: draft }} testID={testID} onKey={grid.onDayKey} onPick={pick} />\n <PickerFooter>\n <Button accessibilityHint={labels.clearHint} accessibilityLabel={labels.clear} label={labels.clear} testID={`${testID}-clear`} variant=\"ghost\" onPress={() => onCommit('')} />\n <Button accessibilityHint={labels.setDateHint} accessibilityLabel={labels.setDate} disabled={draft === ''} label={labels.setDate} testID={`${testID}-set`} onPress={() => onCommit(draft)} />\n </PickerFooter>\n </div>\n );\n}\n","import { useWindowDimensions } from 'react-native';\n\nimport { isWideFormLayout } from '../../ResponsiveFormLayout/isWideFormLayout';\n\nexport function useIsPhone(): boolean {\n return !isWideFormLayout(useWindowDimensions().width);\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/** Moves focus back to `target` once the picker has closed, after the modal's own focus restore has run. */\nexport function useReturnFocus(open: boolean, target: RefObject<HTMLElement | null>): void {\n const wasOpen = useRef(open);\n useEffect(() => {\n const closed = wasOpen.current && !open;\n wasOpen.current = open;\n if (!closed) return undefined;\n const timer = setTimeout(() => target.current?.focus(), 0);\n return () => clearTimeout(timer);\n }, [open, target]);\n}\n","import { useEffect, useState } from 'react';\n\nimport { useDatePickerConfig } from './useDatePickerConfig';\nimport { formatTyped, parseTyped } from '../utils/formatDate';\nimport { isWithinBounds } from '../utils/isoDate';\n\nimport type { DateBounds } from '../types';\n\nexport interface TypedDateArgs {\n value: string;\n onChange: (value: string) => void;\n bounds: DateBounds;\n format: (iso: string, locale?: string) => string;\n onError?: (message: string | undefined) => void;\n /** Replaces the out-of-bounds error, e.g. a range end order message. */\n rangeMessage?: string;\n /** Keeps the locale display on focus until the user edits (`onEdit` or typing). */\n editOnType?: boolean;\n}\n\nexport interface TypedDate {\n display: string;\n onText: (text: string) => void;\n onFocus: () => void;\n onBlur: () => void;\n /** Starts editing: the text becomes `replacement` when given, else the typed numeric form; true when it applied `replacement`. */\n onEdit: (replacement?: string) => boolean;\n /** True when the typed text is empty or a valid in-bounds date; reports the error otherwise. */\n isReady: () => boolean;\n}\n\n/** A typeable date: shows the locale display at rest, the numeric form while editing, emits only valid in-bounds dates. */\nexport function useTypedDate({ value, onChange, bounds, format, onError, rangeMessage, editOnType = false }: TypedDateArgs): TypedDate {\n const { labels, locale } = useDatePickerConfig();\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState('');\n\n useEffect(() => {\n setText((current) => {\n const parsed = current.trim() === '' ? '' : parseTyped(current, locale);\n if (parsed === null || parsed === value) return current;\n return value === '' ? '' : formatTyped(value, locale);\n });\n }, [value, locale]);\n\n const verdict = (typed: string): string | undefined => {\n if (typed.trim() === '') return undefined;\n const parsed = parseTyped(typed, locale);\n if (parsed === null) return labels.invalidDate;\n return isWithinBounds(parsed, bounds.min, bounds.max) ? undefined : rangeMessage ?? labels.outOfRange;\n };\n\n const startEdit = (): void => {\n setEditing(true);\n setText(value === '' ? '' : formatTyped(value, locale));\n };\n\n const onText = (next: string): void => {\n setEditing(true);\n setText(next);\n if (next.trim() === '') {\n onError?.(undefined);\n onChange('');\n return;\n }\n const parsed = parseTyped(next, locale);\n if (parsed === null) return;\n const message = verdict(next);\n onError?.(message);\n if (message === undefined) onChange(parsed);\n };\n\n const isReady = (): boolean => {\n if (!editing) return true;\n const message = verdict(text);\n onError?.(message);\n return message === undefined;\n };\n\n return {\n display: editing ? text : value === '' ? '' : format(value, locale),\n onText,\n onFocus: () => {\n if (!editOnType) startEdit();\n },\n onBlur: () => {\n setEditing(false);\n if (editing && verdict(text) !== undefined) onError?.(verdict(text));\n },\n onEdit: (replacement) => {\n if (editing) return false;\n if (replacement !== undefined) onText(replacement);\n else startEdit();\n return replacement !== undefined;\n },\n isReady,\n };\n}\n","const FONT_PX = 14;\nconst GLYPH_EM = 0.62;\nconst PAD_INLINE = 12;\nconst BORDER = 1;\nconst PLACEHOLDER_CHARS = 15;\n\n/** The smallest field width that shows `text` (or a full formatted date when empty) beside the trailing icon room. */\nexport function closedFieldMinWidth(text: string, iconRoom: number): number {\n const chars = Math.max(text.length, PLACEHOLDER_CHARS);\n return Math.ceil(chars * FONT_PX * GLYPH_EM) + PAD_INLINE + iconRoom + BORDER + BORDER;\n}\n","import type { ClipboardEvent, KeyboardEvent, SyntheticEvent } from 'react';\n\nimport type { TypedDate } from '../hooks/useTypedDate';\n\nconst DELETE_KEYS = new Set(['Backspace', 'Delete']);\n\nexport interface TypedEditBind {\n onEditKey: (event: KeyboardEvent<HTMLInputElement>) => void;\n onPaste: (event: ClipboardEvent<HTMLInputElement>) => void;\n onCut: (event: ClipboardEvent<HTMLInputElement>) => void;\n}\n\ninterface EditedText {\n text: string;\n caret: number;\n}\n\nfunction isPrintable(event: KeyboardEvent<HTMLInputElement>): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey;\n}\n\nfunction selection(input: HTMLInputElement): [number, number] {\n const end = input.selectionEnd ?? input.value.length;\n return [input.selectionStart ?? end, end];\n}\n\nfunction editedText(input: HTMLInputElement, insert: string): EditedText {\n const [start, end] = selection(input);\n return { text: input.value.slice(0, start) + insert + input.value.slice(end), caret: start + insert.length };\n}\n\nfunction placeCaret(input: HTMLInputElement, caret: number): void {\n requestAnimationFrame(() => input.setSelectionRange(caret, caret));\n}\n\n/** Edit handlers for a typed date input: a key, paste or cut over a selection edits the shown text there and keeps the caret, else the typed form starts. */\nexport function typedEditBind(typed: TypedDate): TypedEditBind {\n const start = (event: SyntheticEvent<HTMLInputElement>, insert: string): void => {\n const input = event.currentTarget;\n const [from, to] = selection(input);\n if (from === to) {\n typed.onEdit();\n return;\n }\n const edit = editedText(input, insert);\n if (!typed.onEdit(edit.text)) return;\n event.preventDefault();\n placeCaret(input, edit.caret);\n };\n return {\n onEditKey: (event) => {\n if (isPrintable(event)) start(event, event.key);\n else if (DELETE_KEYS.has(event.key)) start(event, '');\n },\n onPaste: (event) => start(event, event.clipboardData.getData('text')),\n onCut: (event) => {\n const input = event.currentTarget;\n const [from, to] = selection(input);\n if (from === to) return;\n event.clipboardData.setData('text/plain', input.value.slice(from, to));\n start(event, '');\n },\n };\n}\n","import React, { useCallback, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { buildNativeInputStyle } from './WebDateInput';\nimport { Glyph } from '../../DatePicker/components/Glyph';\nimport { GlyphName } from '../../DatePicker/components/GlyphName';\nimport { PickerSurface } from '../../DatePicker/components/PickerSurface';\nimport { SingleCalendar } from '../../DatePicker/components/SingleCalendar';\nimport { useDatePickerConfig } from '../../DatePicker/hooks/useDatePickerConfig';\nimport { useIsPhone } from '../../DatePicker/hooks/useIsPhone';\nimport { useReturnFocus } from '../../DatePicker/hooks/useReturnFocus';\nimport { useTypedDate } from '../../DatePicker/hooks/useTypedDate';\nimport { closedFieldMinWidth } from '../../DatePicker/utils/fieldWidth';\nimport { displayFormatter } from '../../DatePicker/utils/DateDisplay';\nimport { typedEditBind } from '../../DatePicker/utils/typedEdit';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nexport interface DatePickerInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n onTypedError?: (message: string | undefined) => void;\n}\n\nexport interface FocusHandlers {\n onFocus?: (event: unknown) => void;\n onBlur?: (event: unknown) => void;\n}\n\nexport const SINGLE_PICKER_WIDTH = 340;\nexport const ICON_ROOM = 48;\nexport const ICON_SLOT: CSSProperties = { position: 'absolute', right: 2, top: 0, bottom: 0, display: 'flex', alignItems: 'center' };\nexport const anchorStyles = StyleSheet.create({ wrap: { position: 'relative', width: '100%' } });\n\n/** A typeable date with a calendar button; the calendar opens as a sheet on a phone and a dropdown on desktop. */\nexport function DatePickerInput({ fieldProps, context, onTypedError }: DatePickerInputProps): React.ReactElement {\n const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;\n const { labels, display } = useDatePickerConfig();\n const phone = useIsPhone();\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<View>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const bounds = { min, max };\n const typed = useTypedDate({ value, onChange, bounds, format: displayFormatter(display), onError: onTypedError, editOnType: true });\n const edit = typedEditBind(typed);\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });\n const focus = focusBind as unknown as FocusHandlers;\n const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError, required });\n\n const close = useCallback(() => setOpen(false), []);\n useReturnFocus(open, inputRef);\n const commit = (iso: string): void => {\n onTypedError?.(undefined);\n onChange(iso);\n close();\n };\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n edit.onEditKey(event);\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n if (typed.isReady()) onSubmit();\n };\n\n return (\n <View ref={anchorRef} style={[anchorStyles.wrap, { minWidth: closedFieldMinWidth(typed.display, ICON_ROOM) }]} testID={`${testID}-anchor`}>\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n {...(hoverBind as React.InputHTMLAttributes<HTMLInputElement>)}\n ref={inputRef}\n aria-label={label}\n autoComplete=\"off\"\n data-testid={testID}\n disabled={disabled}\n id={context.controlId}\n style={{ ...buildNativeInputStyle(style), paddingInlineEnd: ICON_ROOM }}\n title={accessibilityHint}\n type=\"text\"\n value={typed.display}\n onBlur={(event) => {\n focus.onBlur?.(event);\n typed.onBlur();\n }}\n onChange={(event) => typed.onText(event.target.value)}\n onFocus={(event) => {\n focus.onFocus?.(event);\n typed.onFocus();\n }}\n onKeyDown={onKeyDown}\n onCut={edit.onCut}\n onPaste={edit.onPaste}\n />\n <div style={ICON_SLOT}>\n <IconButton accessibilityHint={labels.openCalendarHint} accessibilityLabel={labels.openCalendar} appearance=\"ghost\" disabled={disabled} renderIcon={(color) => <Glyph color={color} name={GlyphName.Calendar} />} testID={`${testID}-calendar`} onPress={() => setOpen((current) => !current)} />\n </div>\n {open ? (\n <PickerSurface anchorRef={anchorRef} label={labels.dialog} minWidth={SINGLE_PICKER_WIDTH} phone={phone} testID={`${testID}-picker`} onDismiss={close}>\n <SingleCalendar bounds={bounds} testID={`${testID}-picker`} value={value} onCommit={commit} />\n </PickerSurface>\n ) : null}\n </View>\n );\n}\n","import React from 'react';\n\nimport { Platform } from 'react-native';\n\nimport { DatePickerInput } from './DatePickerInput';\nimport { WebDateInput } from './WebDateInput';\nimport { ThemedTextInput } from '../../ThemedTextInput/ThemedTextInput';\n\nimport type { FieldChildContext } from '../../Field/Field';\nimport type { DateFieldProps } from '../types';\n\nconst IS_WEB = Platform.OS === 'web';\nconst DATE_TYPE = 'date';\n\ninterface TemporalInputProps {\n fieldProps: DateFieldProps;\n context: FieldChildContext;\n webInputType: string;\n onTypedError?: (message: string | undefined) => void;\n}\n\n/** The bare control: the shared date picker or a native date-time input on web, a text input off it. */\nexport function TemporalInput({ fieldProps, context, webInputType, onTypedError }: TemporalInputProps): React.ReactElement {\n if (IS_WEB && webInputType === DATE_TYPE) return <DatePickerInput context={context} fieldProps={fieldProps} onTypedError={onTypedError} />;\n if (IS_WEB) return <WebDateInput context={context} fieldProps={fieldProps} webInputType={webInputType} />;\n return (\n <ThemedTextInput\n accessibilityHint={fieldProps.accessibilityHint}\n accessibilityLabel={fieldProps.label}\n describedById={context.describedById}\n editable={fieldProps.disabled !== true}\n hasError={context.hasError}\n id={context.controlId}\n requiredField={fieldProps.required}\n testID={fieldProps.testID}\n value={fieldProps.value}\n onChangeText={fieldProps.onChange}\n onSubmitEditing={fieldProps.onSubmit}\n />\n );\n}\n","import React, { useState } from 'react';\n\nimport { TemporalInput } from './TemporalInput';\nimport { Field } from '../../Field/Field';\n\nimport type { DateFieldProps } from '../types';\n\ninterface TemporalFieldProps {\n fieldProps: DateFieldProps;\n webInputType: string;\n}\n\n/** The `Field` shell shared by `DateField` and `DateTimeField`; a typed date error shows when the caller has none. */\nexport function TemporalField({ fieldProps, webInputType }: TemporalFieldProps): React.ReactElement {\n const { label, required, hint, error } = fieldProps;\n const [typedError, setTypedError] = useState<string | undefined>(undefined);\n return (\n <Field error={error ?? typedError} hint={hint} label={label} required={required}>\n {(context) => <TemporalInput context={context} fieldProps={fieldProps} webInputType={webInputType} onTypedError={setTypedError} />}\n </Field>\n );\n}\n","import React from 'react';\n\nimport { TemporalField } from './components/TemporalField';\n\nimport type { DateFieldProps } from './types';\n\n/** A labelled calendar date: takes and emits `YYYY-MM-DD`, empty is `''`. */\nexport function DateField(props: DateFieldProps): React.ReactElement {\n return <TemporalField fieldProps={props} webInputType=\"date\" />;\n}\n","import React from 'react';\n\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { controlStyles as s } from '../../controls/controlStyles';\nimport { DateField } from '../../DateField/DateField';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\n\nexport interface NativeDateRangeProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit?: () => void;\n fromLabel: string;\n toLabel: string;\n hint: string;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}\n\n/** Native: two shared `DateField`s side by side; each edit patches only its own side. */\nexport function NativeDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, style, testID }: NativeDateRangeProps): React.ReactElement {\n return (\n <View style={[s.dateRow, style]} testID={`${testID}-range`}>\n <View style={s.dateCol}>\n <DateField accessibilityHint={hint} label={fromLabel} testID={`${testID}-from`} value={value.from} onChange={(from) => onChange({ from, to: value.to })} onSubmit={onSubmit} />\n </View>\n <View style={s.dateCol}>\n <DateField accessibilityHint={hint} label={toLabel} testID={`${testID}-to`} value={value.to} onChange={(to) => onChange({ from: value.from, to })} onSubmit={onSubmit} />\n </View>\n </View>\n );\n}\n","import { addDays, monthStart, parseIso, toIso } from './isoDate';\nimport { RangePreset } from './RangePreset';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DatePickerLabels } from '../types';\n\nexport const RANGE_PRESETS: readonly RangePreset[] = [RangePreset.Today, RangePreset.Last7Days, RangePreset.ThisMonth, RangePreset.Quarter];\n\nconst PRESET_LABEL: Readonly<Record<RangePreset, keyof DatePickerLabels>> = {\n [RangePreset.Today]: 'today',\n [RangePreset.Last7Days]: 'last7Days',\n [RangePreset.ThisMonth]: 'thisMonth',\n [RangePreset.Quarter]: 'quarter',\n};\n\nconst WEEK_BACK = 6;\nconst MONTHS_IN_QUARTER = 3;\nconst EPOCH = { year: 1970, month: 1, day: 1 };\n\nexport function presetLabel(labels: DatePickerLabels, preset: RangePreset): string {\n return labels[PRESET_LABEL[preset]];\n}\n\nfunction quarterStart(today: string): string {\n const parts = parseIso(today) ?? EPOCH;\n const month = Math.floor((parts.month - 1) / MONTHS_IN_QUARTER) * MONTHS_IN_QUARTER + 1;\n return toIso({ year: parts.year, month, day: 1 });\n}\n\n/** The inclusive range a preset stands for, ending today. */\nexport function presetRange(preset: RangePreset, today: string): DateRangeValue {\n if (preset === RangePreset.Last7Days) return { from: addDays(today, -WEEK_BACK), to: today };\n if (preset === RangePreset.ThisMonth) return { from: monthStart(today), to: today };\n if (preset === RangePreset.Quarter) return { from: quarterStart(today), to: today };\n return { from: today, to: today };\n}\n\nexport function matchingPreset(range: DateRangeValue, today: string): RangePreset | null {\n return RANGE_PRESETS.find((preset) => {\n const span = presetRange(preset, today);\n return span.from === range.from && span.to === range.to;\n }) ?? null;\n}\n\n/** A first pick starts a range; a second pick closes it, ends in order. */\nexport function pickRangeDay(range: DateRangeValue, day: string): DateRangeValue {\n const open = range.from !== '' && range.to === '';\n if (!open) return { from: day, to: '' };\n return day < range.from ? { from: day, to: range.from } : { from: range.from, to: day };\n}\n","import React, { type CSSProperties } from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { presetLabel, RANGE_PRESETS } from '../utils/rangePresets';\n\nimport type { RangePreset } from '../utils/RangePreset';\n\nexport interface PresetPickerProps {\n active: RangePreset | null;\n testID: string;\n onPick: (preset: RangePreset) => void;\n}\n\nconst GAP = 8;\nconst CHIP_PAD = 16;\nconst FONT = 14;\nconst BOLD = 700;\nconst REGULAR = 400;\nconst ACTIVE_BORDER = 2;\n\n/** Desktop range presets: one chip per preset, the active one ticked. */\nexport function PresetChips({ active, testID, onPick }: PresetPickerProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const colors = usePickerColors();\n const chipStyle = (isActive: boolean): CSSProperties => ({\n minHeight: MIN_TOUCH_TARGET_PX,\n padding: `0 ${CHIP_PAD}px`,\n borderRadius: MIN_TOUCH_TARGET_PX / 2,\n border: `${isActive ? ACTIVE_BORDER : 1}px solid ${isActive ? colors.brand : colors.border}`,\n background: colors.surface,\n color: colors.text,\n fontFamily: 'inherit',\n fontSize: FONT,\n fontWeight: isActive ? BOLD : REGULAR,\n cursor: 'pointer',\n });\n return (\n <div aria-label={labels.presets} role=\"group\" style={{ display: 'flex', flexWrap: 'wrap', gap: GAP, marginBottom: GAP }}>\n {RANGE_PRESETS.map((preset) => (\n <button key={preset} aria-pressed={active === preset} data-testid={`${testID}-preset-${preset}`} style={chipStyle(active === preset)} title={labels.presetHint} type=\"button\" onClick={() => onPick(preset)}>\n {active === preset ? '✓ ' : ''}\n {presetLabel(labels, preset)}\n </button>\n ))}\n </div>\n );\n}\n","import React from 'react';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\n\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { usePickerColors } from '../hooks/usePickerColors';\nimport { presetLabel, RANGE_PRESETS } from '../utils/rangePresets';\n\nimport type { PresetPickerProps } from './PresetChips';\n\nconst GAP = 8;\nconst FONT = 14;\n\n/** Phone range presets: one menu. */\nexport function PresetMenu({ active, testID, onPick }: PresetPickerProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const colors = usePickerColors();\n const onChange = (event: React.ChangeEvent<HTMLSelectElement>): void => {\n const preset = RANGE_PRESETS.find((candidate) => candidate === event.target.value);\n if (preset !== undefined) onPick(preset);\n };\n return (\n <select\n aria-label={labels.presets}\n data-testid={`${testID}-presets`}\n style={{ minHeight: MIN_TOUCH_TARGET_PX, width: '100%', marginBottom: GAP, border: `1px solid ${colors.border}`, borderRadius: GAP, background: colors.surface, color: colors.text, fontFamily: 'inherit', fontSize: FONT }}\n title={labels.presetHint}\n value={active ?? ''}\n onChange={onChange}\n >\n <option value=\"\">{labels.presets}</option>\n {RANGE_PRESETS.map((preset) => (\n <option key={preset} value={preset}>\n {presetLabel(labels, preset)}\n </option>\n ))}\n </select>\n );\n}\n","import React, { type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { Glyph } from './Glyph';\nimport { GlyphName } from './GlyphName';\nimport { MonthGrid } from './MonthGrid';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DateBounds } from '../types';\n\nexport interface RangeGridProps {\n selection: DateRangeValue;\n focusedDay: string;\n bounds: DateBounds;\n testID: string;\n onPick: (iso: string) => void;\n onKey: (event: KeyboardEvent<HTMLButtonElement>, iso: string) => void;\n}\n\nconst PHONE_LIST_HEIGHT = 'min(56vh, 440px)';\nconst MONTH_GAP = 32;\nconst NAV_ROW: CSSProperties = { position: 'absolute', left: 0, right: 0, top: 0, display: 'flex', justifyContent: 'space-between', pointerEvents: 'none' };\nconst NAV_SLOT: CSSProperties = { pointerEvents: 'auto' };\n\n/** Phone: the months in one vertical scroll list, the next one peeking. */\nexport function RangeMonthsList({ months, grid }: { months: readonly string[]; grid: RangeGridProps }): React.ReactElement {\n return (\n <div data-testid={`${grid.testID}-months`} style={{ maxHeight: PHONE_LIST_HEIGHT, overflowY: 'auto' }}>\n {months.map((month) => (\n <MonthGrid key={month} showCaption month={month} {...grid} />\n ))}\n </div>\n );\n}\n\nexport interface RangeMonthsPairProps {\n months: readonly string[];\n grid: RangeGridProps;\n motion: CSSProperties;\n onShift: (step: number) => void;\n}\n\n/** Desktop: two months side by side with previous / next. */\nexport function RangeMonthsPair({ months, grid, motion, onShift }: RangeMonthsPairProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n return (\n <div style={{ position: 'relative' }}>\n <div style={NAV_ROW}>\n <div style={NAV_SLOT}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.previousMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Previous} />} testID={`${grid.testID}-previous`} onPress={() => onShift(-1)} />\n </div>\n <div style={NAV_SLOT}>\n <IconButton accessibilityHint={labels.monthHint} accessibilityLabel={labels.nextMonth} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Next} />} testID={`${grid.testID}-next`} onPress={() => onShift(1)} />\n </div>\n </div>\n <div style={{ display: 'flex', gap: MONTH_GAP }}>\n {months.map((month) => (\n <MonthGrid key={month} showCaption month={month} motion={motion} {...grid} />\n ))}\n </div>\n </div>\n );\n}\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { PickerFooter } from './PickerFooter';\nimport { PresetChips } from './PresetChips';\nimport { PresetMenu } from './PresetMenu';\nimport { RangeMonthsList, RangeMonthsPair } from './RangeMonths';\nimport { useDatePickerConfig } from '../hooks/useDatePickerConfig';\nimport { useGridFocus } from '../hooks/useGridFocus';\nimport { useMonthSlide } from '../hooks/useMotion';\nimport { formatShort } from '../utils/formatDate';\nimport { addMonths, clampToBounds, daysBetweenInclusive, monthStart } from '../utils/isoDate';\nimport { matchingPreset, pickRangeDay, presetRange } from '../utils/rangePresets';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { DateBounds } from '../types';\nimport type { RangePreset } from '../utils/RangePreset';\n\nexport interface RangeCalendarProps {\n value: DateRangeValue;\n bounds: DateBounds;\n phone: boolean;\n testID: string;\n onApply: (range: DateRangeValue) => void;\n onCancel: () => void;\n}\n\nconst PHONE_MONTHS = 6;\nconst DESKTOP_MONTHS = 2;\nconst SUMMARY_FONT = 14;\nconst SEMIBOLD = 600;\n\nfunction useRangeSummary(draft: DateRangeValue): string {\n const { labels, locale } = useDatePickerConfig();\n if (draft.from === '') return '';\n if (draft.to === '') return formatShort(draft.from, locale);\n const days = labels.dayCount.replace('{{p1}}', String(daysBetweenInclusive(draft.from, draft.to)));\n return `${formatShort(draft.from, locale, false)}${labels.rangeSeparator}${formatShort(draft.to, locale)} · ${days}`;\n}\n\n/** Range picker: presets, months, a summary, Cancel and Apply. */\nexport function RangeCalendar({ value, bounds, phone, testID, onApply, onCancel }: RangeCalendarProps): React.ReactElement {\n const { labels, today } = useDatePickerConfig();\n const [draft, setDraft] = useState(value);\n const initialDay = clampToBounds(value.from !== '' ? value.from : today, bounds.min, bounds.max);\n const pickDraft = useCallback((iso: string) => setDraft((current) => pickRangeDay(current, iso)), []);\n const focus = useGridFocus(initialDay, bounds, testID, pickDraft);\n const visible = phone ? PHONE_MONTHS : DESKTOP_MONTHS;\n const [first, setFirst] = useState(() => monthStart(phone ? initialDay : addMonths(initialDay, 1 - DESKTOP_MONTHS)));\n const focusMonth = monthStart(focus.focusedDay);\n const last = addMonths(first, visible - 1);\n const motion = useMonthSlide(first);\n const summary = useRangeSummary(draft);\n\n useEffect(() => {\n if (focusMonth < first) setFirst(focusMonth);\n else if (focusMonth > last) setFirst(addMonths(focusMonth, 1 - visible));\n }, [focusMonth, first, last, visible]);\n\n const pick = (iso: string): void => {\n pickDraft(iso);\n focus.moveTo(iso);\n };\n const applyPreset = (preset: RangePreset): void => {\n const range = presetRange(preset, today);\n setDraft(range);\n focus.moveTo(range.to);\n };\n const shift = (step: number): void => {\n setFirst(addMonths(first, step));\n focus.moveTo(addMonths(focus.focusedDay, step));\n };\n const months = Array.from({ length: visible }, (_unused, index) => addMonths(first, index));\n const grid = { selection: draft, focusedDay: focus.focusedDay, bounds, testID, onPick: pick, onKey: focus.onDayKey };\n const presets = { active: matchingPreset(draft, today), testID, onPick: applyPreset };\n\n return (\n <div>\n {phone ? <PresetMenu {...presets} /> : <PresetChips {...presets} />}\n {phone ? <RangeMonthsList grid={grid} months={months} /> : <RangeMonthsPair grid={grid} months={months} motion={motion} onShift={shift} />}\n <PickerFooter summary={<span aria-live=\"polite\" data-testid={`${testID}-summary`} style={{ fontSize: SUMMARY_FONT, fontWeight: SEMIBOLD }}>{summary}</span>}>\n <Button accessibilityHint={labels.cancelHint} accessibilityLabel={labels.cancel} label={labels.cancel} testID={`${testID}-cancel`} variant=\"ghost\" onPress={onCancel} />\n <Button\n accessibilityHint={labels.applyHint}\n accessibilityLabel={labels.apply}\n disabled={draft.from === ''}\n label={labels.apply}\n testID={`${testID}-apply`}\n onPress={() => onApply({ from: draft.from, to: draft.to === '' ? draft.from : draft.to })}\n />\n </PickerFooter>\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react';\n\nimport { View } from 'react-native';\n\nimport { IconButton } from '@dloizides/ui-buttons';\n\nimport { RangeSide } from './RangeSide';\nimport { anchorStyles, ICON_ROOM, ICON_SLOT, type FocusHandlers } from '../../DateField/components/DatePickerInput';\nimport { buildNativeInputStyle } from '../../DateField/components/WebDateInput';\nimport { Glyph } from '../../DatePicker/components/Glyph';\nimport { GlyphName } from '../../DatePicker/components/GlyphName';\nimport { PickerSurface } from '../../DatePicker/components/PickerSurface';\nimport { RangeCalendar } from '../../DatePicker/components/RangeCalendar';\nimport { useDatePickerConfig } from '../../DatePicker/hooks/useDatePickerConfig';\nimport { useIsPhone } from '../../DatePicker/hooks/useIsPhone';\nimport { useReturnFocus } from '../../DatePicker/hooks/useReturnFocus';\nimport { useTypedDate, type TypedDate } from '../../DatePicker/hooks/useTypedDate';\nimport { typedEditBind } from '../../DatePicker/utils/typedEdit';\nimport { formatShort } from '../../DatePicker/utils/formatDate';\nimport { useThemedInput } from '../../useThemedInput/useThemedInput';\nimport { webFieldA11y } from '../../webFieldA11y/webFieldA11y';\n\nimport type { DateRangeValue } from '../../controls/controlTypes';\nimport type { FieldChildContext } from '../../Field/Field';\n\nexport interface WebDateRangeProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit?: () => void;\n fromLabel: string;\n toLabel: string;\n hint: string;\n testID: string;\n context: FieldChildContext;\n onTypedError: (message: string | undefined) => void;\n}\n\nconst RANGE_PICKER_WIDTH = 690;\nconst GAP = 8;\nconst NO_BOUNDS = {};\nconst SEGMENT: CSSProperties = { flex: 1, minWidth: 0, border: 'none', background: 'transparent', color: 'inherit', font: 'inherit', outline: 'none', padding: 0 };\n\nfunction orNone(value: string): string | undefined {\n return value !== '' ? value : undefined;\n}\n\n/** One field holding both range ends, each typeable with its own error, plus a calendar with presets. */\nexport function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, testID, context, onTypedError }: WebDateRangeProps): React.ReactElement {\n const { labels } = useDatePickerConfig();\n const phone = useIsPhone();\n const [open, setOpen] = useState(false);\n const [fromError, setFromError] = useState<string | undefined>(undefined);\n const [toError, setToError] = useState<string | undefined>(undefined);\n const anchorRef = useRef<View>(null);\n const fromRef = useRef<HTMLInputElement>(null);\n const from = useTypedDate({ value: value.from, onChange: (next) => onChange({ from: next, to: value.to }), bounds: { max: orNone(value.to) }, format: formatShort, onError: setFromError, rangeMessage: labels.rangeOrder, editOnType: true });\n const to = useTypedDate({ value: value.to, onChange: (next) => onChange({ from: value.from, to: next }), bounds: { min: orNone(value.from) }, format: formatShort, onError: setToError, rangeMessage: labels.rangeOrder, editOnType: true });\n const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: true });\n const focus = focusBind as unknown as FocusHandlers;\n const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError });\n\n useEffect(() => onTypedError(fromError ?? toError), [fromError, toError, onTypedError]);\n\n const close = useCallback(() => setOpen(false), []);\n useReturnFocus(open, fromRef);\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (event.key !== 'Enter' || onSubmit === undefined) return;\n event.preventDefault();\n const ready = [from.isReady(), to.isReady()].every(Boolean);\n if (ready) onSubmit();\n };\n const segment = (side: RangeSide, typed: TypedDate): React.ReactElement => {\n const edit = typedEditBind(typed);\n return (\n <input\n {...(webA11y as React.InputHTMLAttributes<HTMLInputElement>)}\n ref={side === RangeSide.From ? fromRef : undefined}\n aria-label={side === RangeSide.From ? fromLabel : toLabel}\n autoComplete=\"off\"\n data-testid={`${testID}-${side}`}\n id={side === RangeSide.From ? context.controlId : undefined}\n style={SEGMENT}\n title={hint}\n type=\"text\"\n value={typed.display}\n onBlur={(event) => {\n focus.onBlur?.(event);\n typed.onBlur();\n }}\n onChange={(event) => typed.onText(event.target.value)}\n onFocus={(event) => {\n focus.onFocus?.(event);\n typed.onFocus();\n }}\n onCut={edit.onCut}\n onKeyDown={(event) => {\n edit.onEditKey(event);\n onKeyDown(event);\n }}\n onPaste={edit.onPaste}\n />\n );\n };\n\n return (\n <View ref={anchorRef} style={anchorStyles.wrap}>\n <div {...(hoverBind as React.HTMLAttributes<HTMLDivElement>)} style={{ ...buildNativeInputStyle(style), display: 'flex', alignItems: 'center', gap: GAP, paddingInlineEnd: ICON_ROOM }}>\n {segment(RangeSide.From, from)}\n <span aria-hidden=\"true\">→</span>\n {segment(RangeSide.To, to)}\n </div>\n <div style={ICON_SLOT}>\n <IconButton accessibilityHint={labels.openCalendarHint} accessibilityLabel={labels.openCalendar} appearance=\"ghost\" renderIcon={(color) => <Glyph color={color} name={GlyphName.Calendar} />} testID={`${testID}-calendar`} onPress={() => setOpen((current) => !current)} />\n </div>\n {open ? (\n <PickerSurface anchorRef={anchorRef} label={labels.rangeDialog} minWidth={RANGE_PICKER_WIDTH} phone={phone} testID={`${testID}-picker`} onDismiss={close}>\n <RangeCalendar\n bounds={NO_BOUNDS}\n phone={phone}\n testID={`${testID}-picker`}\n value={value}\n onApply={(range) => {\n setFromError(undefined);\n setToError(undefined);\n onChange(range);\n close();\n }}\n onCancel={close}\n />\n </PickerSurface>\n ) : null}\n </View>\n );\n}\n","import React, { useState } from 'react';\n\nimport { Platform, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { NativeDateRange } from './components/NativeDateRange';\nimport { WebDateRange } from './components/WebDateRange';\nimport { useDatePickerConfig } from '../DatePicker/hooks/useDatePickerConfig';\nimport { Field } from '../Field/Field';\nimport { GapOwnedProvider } from '../FormGrid/formGridContext';\n\nimport type { DateRangeValue } from '../controls/controlTypes';\n\nconst IS_WEB = Platform.OS === 'web';\n\nexport interface DateRangeControlProps {\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n /** Called on Enter/submit in either side. */\n onSubmit?: () => void;\n /** PRE-LOCALIZED sub-label for the FROM input (e.g. \"From\"). Also its accessible name. */\n fromLabel: string;\n /** PRE-LOCALIZED sub-label for the TO input (e.g. \"To\"). Also its accessible name. */\n toLabel: string;\n /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */\n fromPlaceholder?: string;\n /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */\n toPlaceholder?: string;\n /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */\n accessibilityHint?: string;\n /** Merged LAST onto the row wrapper. */\n style?: StyleProp<ViewStyle>;\n /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */\n testID: string;\n}\n\n/** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */\nexport function DateRangeControl({\n value,\n onChange,\n onSubmit,\n fromLabel,\n toLabel,\n accessibilityHint,\n style,\n testID,\n}: DateRangeControlProps): React.ReactElement {\n const hint = accessibilityHint ?? `${fromLabel} – ${toLabel}`;\n const { labels } = useDatePickerConfig();\n const [typedError, setTypedError] = useState<string | undefined>(undefined);\n\n if (!IS_WEB) {\n return (\n <GapOwnedProvider value>\n <NativeDateRange fromLabel={fromLabel} hint={hint} style={style} testID={testID} toLabel={toLabel} value={value} onChange={onChange} onSubmit={onSubmit} />\n </GapOwnedProvider>\n );\n }\n return (\n <GapOwnedProvider value>\n <View style={style} testID={`${testID}-range`}>\n <Field error={typedError} label={`${fromLabel}${labels.rangeSeparator}${toLabel}`}>\n {(context) => (\n <WebDateRange context={context} fromLabel={fromLabel} hint={hint} testID={testID} toLabel={toLabel} value={value} onChange={onChange} onSubmit={onSubmit} onTypedError={setTypedError} />\n )}\n </Field>\n </View>\n </GapOwnedProvider>\n );\n}\n\nexport default DateRangeControl;\n","import React from 'react';\n\nimport { TemporalField } from './components/TemporalField';\n\nimport type { DateTimeFieldProps } from './types';\n\n/** A labelled local date and time: takes and emits `YYYY-MM-DDTHH:mm`, empty is `''`. */\nexport function DateTimeField(props: DateTimeFieldProps): React.ReactElement {\n return <TemporalField fieldProps={props} webInputType=\"datetime-local\" />;\n}\n","import React from 'react';\n\nimport { TemporalInput } from './components/TemporalInput';\n\nimport type { DateInputProps } from './types';\n\n/** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */\nexport function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement {\n return <TemporalInput context={context} fieldProps={fieldProps} webInputType=\"date\" />;\n}\n","/**\n * Group selection — the pure tri-state logic behind a \"select all\" / \"select this category\"\n * control, kept out of any component so it is testable as LOGIC rather than through the DOM.\n *\n * ## Why it lives here and not in @dloizides/ui-tables\n *\n * `ui-tables` already had this arithmetic inside `DataTable/selection.ts`, but deliberately\n * unexported: its tri-state is a `const enum`, which in a published `.d.ts` is an ambient const\n * enum that every `isolatedModules` consumer rejects. It is also page-scoped and wired to the\n * table's select-all banner. So the second consumer (a 12-tile console picker with no table in\n * sight, and no reason to pull a table package into its bundle budget) could not reach it.\n *\n * This module is the extraction: domain-neutral (keys in, keys out — nothing here knows what a\n * key *is*), component-free, and crossing the package boundary as a plain interface rather than\n * an enum. `ui-tables` can adopt it and delete its private copy.\n */\n\n/** Nothing selected / an empty group — the empty count. */\nconst NONE = 0;\n\n/**\n * A group's tri-state, as two booleans rather than an enum.\n *\n * `all` and `some` are mutually exclusive: a fully selected group is `{ all: true, some: false }`,\n * so a caller can branch on `all` then `some` without re-deriving \"partial\" itself. Both false\n * means nothing in the group is selected — which is also what an EMPTY group reports, because an\n * empty group is neither fully nor partially selected.\n */\nexport interface GroupSelection {\n /** Every key in the group is selected (never true for an empty group). */\n readonly all: boolean;\n /** At least one, but not every, key in the group is selected — the mixed/indeterminate state. */\n readonly some: boolean;\n}\n\n/** How many of the group's keys are currently selected. */\nfunction countSelected<T>(selected: readonly T[], groupKeys: readonly T[]): number {\n return groupKeys.filter((key) => selected.includes(key)).length;\n}\n\n/**\n * Resolve a group's tri-state from the selection ∩ the group.\n *\n * Scoped to the GROUP, not to the whole selection: selected keys OUTSIDE the group must never\n * make this group look partially selected.\n */\nexport function resolveGroupSelection<T>(selected: readonly T[], groupKeys: readonly T[]): GroupSelection {\n const count = countSelected(selected, groupKeys);\n if (count === NONE) return { all: false, some: false };\n return count === groupKeys.length ? { all: true, some: false } : { all: false, some: true };\n}\n\n/**\n * The value an `aria-checked` / `accessibilityState` consumer needs for a tri-state control.\n *\n * A partially selected group is `'mixed'`, which is what makes a screen reader announce the\n * control honestly instead of claiming the whole category is on.\n */\nexport function groupAriaChecked(state: GroupSelection): boolean | 'mixed' {\n if (state.all) return true;\n return state.some ? 'mixed' : false;\n}\n\n/**\n * Toggle a whole group, returning the NEXT selection array. Pure — never mutates the input.\n *\n * All-on → off. Partial or off → on: the conventional behaviour, and the one a mixed checkbox\n * looks like it will do. Keys OUTSIDE the group always survive untouched, so a category control\n * can never silently clear a selection it does not own.\n *\n * `order`, when given, is the canonical key order the result is sorted into (catalogue order, say)\n * so the selection does not carry click order around. Without it, newly added keys are appended.\n */\nexport function toggleGroupSelection<T>(\n selected: readonly T[],\n groupKeys: readonly T[],\n order?: readonly T[],\n): T[] {\n const { all } = resolveGroupSelection(selected, groupKeys);\n if (all) return selected.filter((key) => !groupKeys.includes(key));\n const merged = [...selected];\n groupKeys.forEach((key) => {\n if (!merged.includes(key)) merged.push(key);\n });\n return order === undefined ? merged : order.filter((key) => merged.includes(key));\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useFocusRing } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { StepperStep } from './stepperModel';\n\nconst ROW_GAP = 4;\nconst TAB_PADDING = 4;\nconst INDICATOR_WIDTH = 2;\nconst TAB_FONT_SIZE = 12;\n\nconst styles = StyleSheet.create({\n row: { flexDirection: 'row', flexWrap: 'nowrap', gap: ROW_GAP },\n tab: {\n borderBottomWidth: INDICATOR_WIDTH,\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 1,\n justifyContent: 'center',\n minHeight: MIN_TOUCH_TARGET_PX,\n minWidth: 0,\n paddingHorizontal: TAB_PADDING,\n },\n text: { fontSize: TAB_FONT_SIZE, textAlign: 'center' },\n textSelected: { fontWeight: '700' },\n});\n\ninterface WebKeyProps {\n onKeyDown: (event: { key?: string; preventDefault?: () => void }) => void;\n}\n\ninterface StepperTabProps<TKey extends string | number> {\n step: StepperStep<TKey>;\n selected: boolean;\n hint: string;\n onStep: (key: TKey) => void;\n testID: string;\n}\n\nconst StepperTab = <TKey extends string | number>({\n step,\n selected,\n hint,\n onStep,\n testID,\n}: StepperTabProps<TKey>): React.ReactElement => {\n const { theme } = useUi();\n const ring = useFocusRing();\n const indicator = selected ? theme.palette.primary['500'] : theme.colors.border;\n const webKeyProps: WebKeyProps = {\n onKeyDown: (event) => {\n if (event.key !== ' ') return;\n event.preventDefault?.();\n onStep(step.key);\n },\n };\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={step.label}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n aria-selected={selected}\n style={[styles.tab, { borderBottomColor: indicator }, ring.ringStyle]}\n testID={testID}\n onBlur={ring.onBlur}\n onFocus={ring.onFocus}\n onPress={() => onStep(step.key)}\n {...webKeyProps}\n >\n <Text style={[styles.text, { color: theme.colors.text }, selected ? styles.textSelected : undefined]}>\n {step.label}\n </Text>\n </Pressable>\n );\n};\n\nexport interface StepperTabsProps<TKey extends string | number = string> {\n steps: readonly StepperStep<TKey>[];\n current: TKey;\n onStep: (key: TKey) => void;\n /** Pre-localized accessibility hint for every tab. */\n stepHint: string;\n /** Row testID; each tab is `${testID}-${step.key}`. */\n testID: string;\n}\n\n/** A row of step tabs sharing the width; each label wraps inside its own tab. */\nexport const StepperTabs = <TKey extends string | number = string>({\n steps,\n current,\n onStep,\n stepHint,\n testID,\n}: StepperTabsProps<TKey>): React.ReactElement => (\n <View accessibilityRole=\"tablist\" style={styles.row} testID={testID}>\n {steps.map((step) => (\n <StepperTab\n hint={stepHint}\n key={step.key}\n selected={step.key === current}\n step={step}\n testID={`${testID}-${step.key}`}\n onStep={onStep}\n />\n ))}\n </View>\n);\n","/** One step; `label` is pre-localized and shown on its tab. */\nexport interface StepperStep<TKey extends string | number = string> {\n key: TKey;\n label: string;\n}\n\nexport interface StepNeighbours<TKey extends string | number = string> {\n previous: StepperStep<TKey> | null;\n next: StepperStep<TKey> | null;\n}\n\n/** The steps either side of `current`; both null when `current` is not a step. */\nexport function resolveStepNeighbours<TKey extends string | number>(\n steps: readonly StepperStep<TKey>[],\n current: TKey,\n): StepNeighbours<TKey> {\n const index = steps.findIndex((step) => step.key === current);\n if (index < 0) return { previous: null, next: null };\n return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };\n}\n","import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { resolveStepNeighbours } from './stepperModel';\nimport type { StepperStep } from './stepperModel';\n\nconst ROW_GAP = 8;\n\nconst styles = StyleSheet.create({\n cell: { flex: 1, minWidth: 0 },\n row: { flexDirection: 'row', gap: ROW_GAP },\n});\n\nexport interface StepperNavLabels<TKey extends string | number = string> {\n back: string;\n backHint: string;\n /** The next button's label, built from the step it leads to. */\n next: (step: StepperStep<TKey>) => string;\n nextHint: string;\n}\n\nexport interface StepperNavProps<TKey extends string | number = string> {\n steps: readonly StepperStep<TKey>[];\n current: TKey;\n onStep: (key: TKey) => void;\n labels: StepperNavLabels<TKey>;\n /** Row testID; the buttons are `${testID}-back` and `${testID}-next`. */\n testID: string;\n}\n\n/** Back and next under a step: back is disabled on the first step, next is absent on the last. */\nexport const StepperNav = <TKey extends string | number = string>({\n steps,\n current,\n onStep,\n labels,\n testID,\n}: StepperNavProps<TKey>): React.ReactElement => {\n const { previous, next } = resolveStepNeighbours(steps, current);\n return (\n <View style={styles.row} testID={testID}>\n <View style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={labels.backHint}\n accessibilityLabel={labels.back}\n autoLoading={false}\n disabled={previous === null}\n label={labels.back}\n testID={`${testID}-back`}\n variant=\"outline\"\n onPress={() => {\n if (previous !== null) onStep(previous.key);\n }}\n />\n </View>\n {next === null ? null : (\n <View style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={labels.nextHint}\n accessibilityLabel={labels.next(next)}\n autoLoading={false}\n label={labels.next(next)}\n testID={`${testID}-next`}\n onPress={() => onStep(next.key)}\n />\n </View>\n )}\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, type StyleProp, type TextStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst STATUS_FONT = 16;\n\nconst styles = StyleSheet.create({\n line: { fontSize: STATUS_FONT },\n});\n\nexport interface FormStatusLineProps {\n message: string | null | undefined;\n testID: string;\n style?: StyleProp<TextStyle>;\n}\n\n/** A form's result message, announced as an alert; renders nothing until there is one. */\nexport function FormStatusLine({ message, testID, style }: FormStatusLineProps): React.ReactElement | null {\n const { theme } = useUi();\n if (message === null || message === undefined || message === '') return null;\n return (\n <Text role=\"alert\" style={[styles.line, { color: theme.colors.text }, style]} testID={testID}>\n {message}\n </Text>\n );\n}\n","import { useCallback, useRef, type RefObject } from 'react';\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type FocusableRefs<Field extends string> = Readonly<Record<Field, RefObject<Focusable | null>>>;\n\n/** Returns a stable function that focuses the first listed field that is on screen. */\nexport function useFocusFirstInvalid<Field extends string>(refs: FocusableRefs<Field>): (invalid: readonly Field[]) => void {\n const latest = useRef(refs);\n latest.current = refs;\n return useCallback((invalid: readonly Field[]) => {\n const first = invalid.map((field) => latest.current[field].current).find((node) => node !== null);\n first?.focus();\n }, []);\n}\n","import type { FieldError } from '@dloizides/api-client-base';\n\nexport type CodeFormatter = (code: string, error: FieldError) => string | null | undefined;\n\nexport interface AssignedServerErrors<Field extends string> {\n byField: Partial<Record<Field, string>>;\n formError: string | null;\n matched: Field[];\n}\n\nfunction lastSegment(path: string): string {\n return path.slice(path.lastIndexOf('.') + 1).toLowerCase();\n}\n\nfunction matchField<Field extends string>(path: string, fields: readonly Field[]): Field | null {\n const exact = fields.find((field) => field === path);\n if (exact !== undefined) {return exact;}\n const key = lastSegment(path);\n return key === '' ? null : fields.find((field) => field.toLowerCase() === key) ?? null;\n}\n\nfunction messageOf(error: FieldError, formatCode: CodeFormatter | undefined): string {\n const formatted = error.code !== undefined && formatCode !== undefined ? formatCode(error.code, error) : null;\n return typeof formatted === 'string' && formatted !== '' ? formatted : error.message;\n}\n\n/** Splits parsed server errors into the first message per known field and the first unmatched message. */\nexport function assignServerErrors<Field extends string>(\n errors: readonly FieldError[],\n fields: readonly Field[],\n formatCode?: CodeFormatter,\n): AssignedServerErrors<Field> {\n const byField: Partial<Record<Field, string>> = {};\n let formError: string | null = null;\n for (const error of errors) {\n const field = matchField(error.path, fields);\n const message = messageOf(error, formatCode);\n if (field === null) {formError = formError ?? message;}\n else if (byField[field] === undefined) {byField[field] = message;}\n }\n const matched = fields.filter((field) => byField[field] !== undefined);\n return { byField, formError, matched };\n}\n","import { useCallback, useState } from 'react';\n\nimport { parseFieldErrors } from '@dloizides/api-client-base';\n\nimport { assignServerErrors, type CodeFormatter } from './assignServerErrors';\nimport { useFocusFirstInvalid, type FocusableRefs } from '../useFocusFirstInvalid/useFocusFirstInvalid';\n\nexport interface UseServerFieldErrorsOptions<Field extends string> {\n fields: readonly Field[];\n refs?: FocusableRefs<Field>;\n formatCode?: CodeFormatter;\n}\n\nexport interface ServerFieldErrors<Field extends string> {\n errorFor: (field: Field) => string | undefined;\n apply: (error: unknown) => boolean;\n clear: (field: Field) => void;\n formError: string | null;\n reset: () => void;\n}\n\ninterface ServerErrorState<Field extends string> {\n byField: Partial<Record<Field, string>>;\n formError: string | null;\n}\n\nconst EMPTY_STATE = { byField: {}, formError: null };\nconst NO_REFS = {};\n\nfunction withoutField<Field extends string>(state: ServerErrorState<Field>, field: Field): ServerErrorState<Field> {\n if (state.byField[field] === undefined) {return state;}\n const byField = { ...state.byField };\n delete byField[field];\n return { ...state, byField };\n}\n\n/** Binds a thrown 400 to form fields: the message under each known field, the rest on the form status line. */\nexport function useServerFieldErrors<Field extends string>(options: UseServerFieldErrorsOptions<Field>): ServerFieldErrors<Field> {\n const { fields, refs, formatCode } = options;\n const [state, setState] = useState<ServerErrorState<Field>>(EMPTY_STATE);\n const focusFirst = useFocusFirstInvalid<Field>(refs ?? (NO_REFS as FocusableRefs<Field>));\n const hasRefs = refs !== undefined;\n\n const apply = useCallback(\n (error: unknown): boolean => {\n const assigned = assignServerErrors(parseFieldErrors(error), fields, formatCode);\n setState({ byField: assigned.byField, formError: assigned.formError });\n if (hasRefs && assigned.matched.length > 0) {focusFirst(assigned.matched);}\n return assigned.matched.length > 0;\n },\n [fields, formatCode, focusFirst, hasRefs],\n );\n const clear = useCallback((field: Field) => setState((current) => withoutField(current, field)), []);\n const reset = useCallback(() => setState(EMPTY_STATE), []);\n const errorFor = useCallback((field: Field) => state.byField[field], [state.byField]);\n\n return { errorFor, apply, clear, formError: state.formError, reset };\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\nimport type { View } from 'react-native';\n\ntype Scrollable = Pick<HTMLElement, 'scrollIntoView'>;\n\nfunction isScrollable(node: unknown): node is Scrollable {\n return 'scrollIntoView' in Object(node);\n}\n\n/** Scrolls the returned view fully into sight each time `trigger` takes a new value. */\nexport function useKeepInView(trigger: unknown): RefObject<View | null> {\n const ref = useRef<View>(null);\n useEffect(() => {\n const node: unknown = ref.current;\n const hasTrigger = trigger !== undefined && trigger !== null;\n if (hasTrigger && isScrollable(node)) node.scrollIntoView({ block: 'nearest' });\n }, [trigger]);\n return ref;\n}\n","import React from 'react';\n\nimport { Platform, Pressable, StyleSheet, Text } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst IS_WEB = Platform.OS === 'web';\nconst INPUT_FONT = 14;\n\nconst styles = StyleSheet.create({\n nativeButton: { minHeight: MIN_TOUCH_TARGET_PX, minWidth: MIN_TOUCH_TARGET_PX, justifyContent: 'center' },\n nativeText: { fontSize: INPUT_FONT },\n});\n\nexport interface FileInputProps {\n /** PRE-LOCALIZED accessible name of the control. */\n accessibilityLabel: string;\n accessibilityHint?: string;\n /** Called with the chosen files; never called with an empty list. */\n onFiles: (files: readonly File[]) => void;\n /** Accepted types, e.g. `.pdf,image/*`. */\n accept?: string;\n multiple?: boolean;\n disabled?: boolean;\n /** DOM id, e.g. the `Field` render-child `controlId`, so `<label for>` names the input. */\n id?: string;\n describedById?: string;\n /** PRE-LOCALIZED button text off web. Defaults to `accessibilityLabel`. */\n nativeLabel?: string;\n /** Off web there is no file input: the caller opens its own picker here. */\n onNativePick?: () => void;\n /** testID of the web `<input type=\"file\">` (Playwright `setInputFiles`) or the native button. */\n testID: string;\n}\n\n/** A file picker atom: a real `<input type=\"file\">` on web, a pressable that hands off to the caller's picker elsewhere. */\nexport function FileInput({\n accessibilityLabel,\n accessibilityHint,\n onFiles,\n accept,\n multiple = false,\n disabled = false,\n id,\n describedById,\n nativeLabel,\n onNativePick,\n testID,\n}: FileInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n\n if (!IS_WEB) {\n return (\n <Pressable\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled }}\n disabled={disabled}\n style={styles.nativeButton}\n testID={testID}\n onPress={onNativePick}\n >\n <Text style={[styles.nativeText, { color: colors.text }]}>{nativeLabel ?? accessibilityLabel}</Text>\n </Pressable>\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const files = Array.from(event.target.files ?? []);\n if (files.length > 0) onFiles(files);\n };\n\n return (\n <input\n accept={accept}\n aria-describedby={describedById}\n aria-label={accessibilityLabel}\n data-testid={testID}\n disabled={disabled}\n id={id}\n multiple={multiple}\n style={{ minHeight: MIN_TOUCH_TARGET_PX, color: colors.text, fontSize: INPUT_FONT, fontFamily: 'inherit' }}\n title={accessibilityHint}\n type=\"file\"\n onChange={handleChange}\n />\n );\n}\n\nexport default FileInput;\n","import React, { useState } from 'react';\n\nimport { Image, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useFocusRing } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FormField } from '../FormField/FormField';\n\nconst DEFAULT_PREVIEW_PX = 48;\nconst PREVIEW_RADIUS = 8;\nconst GAP = 8;\nconst TITLE_FONT_SIZE = 14;\nconst HELP_FONT_SIZE = 13;\n\nconst styles = StyleSheet.create({\n help: { flex: 1, fontSize: HELP_FONT_SIZE },\n root: { gap: GAP },\n tile: { alignItems: 'center', flexDirection: 'row', gap: GAP },\n title: { fontSize: TITLE_FONT_SIZE, fontWeight: '700' },\n toggle: { alignSelf: 'flex-start', justifyContent: 'center', minHeight: MIN_TOUCH_TARGET_PX },\n toggleText: { fontSize: TITLE_FONT_SIZE, fontWeight: '700', textDecorationLine: 'underline' },\n});\n\n/** Every string the field shows; all pre-localized. */\nexport interface UploadWithLinkLabels {\n title: string;\n help?: string;\n pasteToggle: string;\n pasteToggleHint: string;\n link: string;\n linkHint: string;\n linkPlaceholder: string;\n}\n\nexport interface UploadWithLinkFieldProps {\n value: string | null | undefined;\n onChange: (url: string) => void;\n labels: UploadWithLinkLabels;\n /** The upload control, e.g. ui-media `ImagePickerButton`; its transport stays with the app. */\n uploadControl: React.ReactNode;\n /** The link input; the others are `${testID}-preview` and `${testID}-paste`. */\n testID: string;\n disabled?: boolean;\n previewSize?: number;\n}\n\n/** An image field: preview, an upload control, and a link input revealed on request. */\nexport const UploadWithLinkField = ({\n value,\n onChange,\n labels,\n uploadControl,\n testID,\n disabled = false,\n previewSize = DEFAULT_PREVIEW_PX,\n}: UploadWithLinkFieldProps): React.ReactElement => {\n const { theme } = useUi();\n const ring = useFocusRing();\n const url = value ?? '';\n const [pasting, setPasting] = useState(url !== '');\n const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };\n return (\n <View style={styles.root}>\n <Text style={[styles.title, { color: theme.colors.text }]}>{labels.title}</Text>\n <View style={styles.tile}>\n {url === ''\n ? <View style={[previewBox, { backgroundColor: theme.colors.border }]} />\n : <Image accessible={false} source={{ uri: url }} style={previewBox} testID={`${testID}-preview`} />}\n {labels.help === undefined ? null : (\n <Text style={[styles.help, { color: theme.colors.text }]}>{labels.help}</Text>\n )}\n </View>\n {uploadControl}\n <Pressable\n accessibilityHint={labels.pasteToggleHint}\n accessibilityLabel={labels.pasteToggle}\n accessibilityRole=\"button\"\n accessibilityState={{ expanded: pasting }}\n aria-expanded={pasting}\n style={[styles.toggle, ring.ringStyle]}\n testID={`${testID}-paste`}\n onBlur={ring.onBlur}\n onFocus={ring.onFocus}\n onPress={() => setPasting(!pasting)}\n >\n <Text style={[styles.toggleText, { color: theme.colors.text }]}>{labels.pasteToggle}</Text>\n </Pressable>\n {pasting ? (\n <FormField\n accessibilityHint={labels.linkHint}\n editable={!disabled}\n label={labels.link}\n placeholder={labels.linkPlaceholder}\n testID={testID}\n value={url}\n onChangeText={onChange}\n />\n ) : null}\n </View>\n );\n};\n","import React, { useState } from 'react';\n\nimport { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nconst ACTION_GAP = 8;\nconst GROUP_GAP = 16;\n\nconst styles = StyleSheet.create({\n action: { alignItems: 'flex-start', marginTop: ACTION_GAP },\n group: { marginBottom: GROUP_GAP },\n});\n\nexport interface AddOnRequestProps {\n addLabel: string;\n addHint: string;\n removeLabel: string;\n removeHint: string;\n hasValue: boolean;\n onRemove: () => void;\n testID: string;\n children: React.ReactNode;\n disabled?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/** Whether an optional field group shows its fields: once it holds a value or the user asked for it. */\nexport const isAddOnOpen = (hasValue: boolean, requested: boolean): boolean => hasValue || requested;\n\n/** An optional field group: an Add button until asked for or filled, then the fields (children) and a Remove button. */\nexport const AddOnRequest = ({\n addLabel,\n addHint,\n removeLabel,\n removeHint,\n hasValue,\n onRemove,\n testID,\n children,\n disabled = false,\n style,\n}: AddOnRequestProps): React.ReactElement => {\n const [requested, setRequested] = useState<boolean>(false);\n const remove = (): void => {\n setRequested(false);\n onRemove();\n };\n if (!isAddOnOpen(hasValue, requested))\n return (\n <View style={[styles.action, style]}>\n <Button\n accessibilityHint={addHint}\n accessibilityLabel={addLabel}\n disabled={disabled}\n label={addLabel}\n testID={`${testID}-add`}\n variant=\"secondary\"\n onPress={() => setRequested(true)}\n />\n </View>\n );\n return (\n <View style={[styles.group, style]} testID={testID}>\n {children}\n <View style={styles.action}>\n <Button\n accessibilityHint={removeHint}\n accessibilityLabel={removeLabel}\n disabled={disabled}\n label={removeLabel}\n testID={`${testID}-remove`}\n variant=\"secondary\"\n onPress={remove}\n />\n </View>\n </View>\n );\n};\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../fieldErrorInk/fieldErrorInk';\n\nconst ROW_GAP = 8;\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n row: { alignItems: 'center', columnGap: ROW_GAP, flexDirection: 'row', justifyContent: 'space-between' },\n text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\nexport interface FixBarProps {\n count: number;\n message: string;\n showLabel: string;\n showHint: string;\n onShow: () => void;\n testID: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** Whether the fix bar shows: only while at least one field stops the save. */\nexport const isFixBarVisible = (count: number): boolean => count > 0;\n\n/** A bar above Save: a pre-localized message naming the fields that stop the save, and a Show button. */\nexport const FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }: FixBarProps): React.ReactElement | null => {\n const { theme } = useUi();\n if (!isFixBarVisible(count)) return null;\n return (\n <View style={[styles.row, style]} testID={testID}>\n <Text role=\"alert\" style={[styles.text, { color: fieldErrorInk(theme) }]} testID={`${testID}-count`}>\n {message}\n </Text>\n <Button\n accessibilityHint={showHint}\n accessibilityLabel={showLabel}\n label={showLabel}\n testID={`${testID}-show`}\n variant=\"secondary\"\n onPress={onShow}\n />\n </View>\n );\n};\n","/** How the option list opens: a sheet from below (phone) or a list unfolding under the field. */\nexport enum SelectSurface {\n Sheet = 'sheet',\n Dropdown = 'dropdown',\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { useKeepInView } from '../../useKeepInView/useKeepInView';\n\nconst ROW_PAD_H = 12;\nconst ROW_GAP = 8;\nconst OPTION_FONT = 14;\nconst DETAIL_FONT = 12;\n\nexport interface OptionRowProps {\n option: ControlOption;\n active: boolean;\n current: boolean;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n onPick: (option: ControlOption) => void;\n optionHint: string;\n testID: string;\n}\n\n/** One option row; the highlighted row is announced as selected and kept in view. */\nexport function OptionRow({ option, active, current, renderLeading, renderDetail, onPick, optionHint, testID }: OptionRowProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const ref = useKeepInView(active ? option.value : null);\n const detailBelow = renderDetail === undefined && option.detail !== undefined;\n return (\n <Pressable\n ref={ref}\n accessibilityHint={optionHint}\n accessibilityLabel={option.label}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: active, checked: current }}\n style={[styles.row, active ? { backgroundColor: colors.surface } : null]}\n testID={`${testID}-option-${option.value}`}\n onPress={() => onPick(option)}\n >\n {renderLeading?.(option)}\n <View style={styles.label}>\n <Text style={[styles.primary, { color: colors.text }]}>{option.label}</Text>\n {detailBelow ? <Text style={[styles.secondary, { color: colors.textSecondary }]}>{option.detail}</Text> : null}\n </View>\n {renderDetail?.(option)}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n row: { minHeight: MIN_TOUCH_TARGET_PX, flexDirection: 'row', alignItems: 'center', gap: ROW_GAP, paddingHorizontal: ROW_PAD_H },\n label: { flex: 1 },\n primary: { fontSize: OPTION_FONT, flexShrink: 1 },\n secondary: { fontSize: DETAIL_FONT },\n});\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport { OptionRow } from './OptionRow';\n\nconst ROW_PAD_H = 12;\nconst ROW_GAP = 8;\nconst HEADER_FONT = 11;\n\ninterface OptionSectionProps {\n title: string;\n options: readonly ControlOption[];\n offset: number;\n highlight: number;\n selectedValue: string;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n onPick: (option: ControlOption) => void;\n optionHint: string;\n testID: string;\n}\n\n/** One titled group of option rows (Recent or All). */\nexport function OptionSection({ title, options, offset, highlight, selectedValue, ...row }: OptionSectionProps): React.ReactElement | null {\n const { theme } = useUi();\n const { colors } = theme;\n if (options.length === 0) return null;\n return (\n <View>\n <Text accessibilityRole=\"header\" style={[styles.header, { color: colors.textSecondary }]}>{title}</Text>\n {options.map((option, index) => (\n <OptionRow key={option.value} {...row} active={offset + index === highlight} current={option.value === selectedValue} option={option} />\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H, paddingTop: ROW_GAP, textTransform: 'uppercase' },\n});\n","import React, { useCallback, useEffect, useRef, type RefObject } from 'react';\n\nimport { Animated, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s, MENU_MAX_HEIGHT } from '../../controls/controlStyles';\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { SearchSelectState } from '../hooks/useSearchSelectState';\nimport { SelectSurface } from '../SelectSurface';\nimport type { SearchSelectLabels } from '../types';\nimport type { SelectMotion } from '../utils/searchSelectMotion';\nimport { DropdownSurface } from './DropdownSurface';\nimport { OptionSection } from './OptionSection';\nimport { SheetSurface } from './SheetSurface';\n\nconst KEY_ESCAPE = 'Escape';\nconst PANEL_PAD = 8;\nconst PANEL_RADIUS = 8;\nconst SHEET_MAX_HEIGHT = 480;\n\ninterface SearchSelectPanelProps {\n motion: SelectMotion;\n state: SearchSelectState;\n labels: SearchSelectLabels;\n anchorRef: RefObject<View | null>;\n renderLeading?: (option: ControlOption) => React.ReactNode;\n renderDetail?: (option: ControlOption) => React.ReactNode;\n selectedValue: string;\n testID: string;\n}\n\n/** The search box and the option list, on a sheet or a dropdown surface. */\nexport function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, renderDetail, selectedValue, testID }: SearchSelectPanelProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const progress = useRef(new Animated.Value(0)).current;\n const { durationMs } = motion;\n\n useEffect(() => {\n Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();\n }, [progress, durationMs]);\n\n const leaving = useRef(false);\n const leave = useCallback((after: () => void) => {\n if (leaving.current) return;\n leaving.current = true;\n if (durationMs === 0) return after();\n Animated.timing(progress, { toValue: 0, duration: durationMs, useNativeDriver: false }).start(() => after());\n }, [progress, durationMs]);\n\n const { close, pick: pickNow, submit: submitNow, onKey, sections, highlight } = state;\n const dismiss = useCallback(() => leave(close), [leave, close]);\n const pick = useCallback((option: ControlOption) => leave(() => pickNow(option)), [leave, pickNow]);\n const submit = useCallback(() => submitNow(pick), [submitNow, pick]);\n const onKeyPress = useCallback((key: string) => (key === KEY_ESCAPE ? dismiss() : onKey(key)), [dismiss, onKey]);\n\n const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });\n const isSheet = motion.surface === SelectSurface.Sheet;\n const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };\n const list = (\n <View style={[styles.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }]} testID={`${testID}-panel`}>\n <TextInput\n autoFocus\n accessibilityHint={labels.searchHint}\n accessibilityLabel={labels.search}\n placeholder={labels.search}\n placeholderTextColor={colors.textSecondary}\n style={[s.input, { color: colors.text, borderColor: colors.border }]}\n testID={`${testID}-search`}\n value={state.query}\n onChangeText={state.setQuery}\n onKeyPress={(event) => onKeyPress(event.nativeEvent.key)}\n onSubmitEditing={submit}\n />\n <ScrollView keyboardShouldPersistTaps=\"handled\" style={isSheet ? styles.sheetList : styles.dropList}>\n <OptionSection {...shared} offset={0} options={sections.recent} title={labels.recent} />\n <OptionSection {...shared} offset={sections.recent.length} options={sections.all} title={labels.all} />\n {sections.flat.length === 0 ? <Text style={[styles.empty, { color: colors.textSecondary }]}>{labels.empty}</Text> : null}\n </ScrollView>\n </View>\n );\n\n if (!isSheet) return <DropdownSurface anchorRef={anchorRef} closeHint={labels.closeHint} closeLabel={labels.close} progress={progress} testID={testID} translateY={translateY} onDismiss={dismiss}>{list}</DropdownSurface>;\n return <SheetSurface closeHint={labels.closeHint} closeLabel={labels.close} testID={testID} translateY={translateY} onDismiss={dismiss}>{list}</SheetSurface>;\n}\n\nconst styles = StyleSheet.create({\n panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },\n dropList: { maxHeight: MENU_MAX_HEIGHT },\n sheetList: { maxHeight: SHEET_MAX_HEIGHT },\n empty: { padding: PANEL_PAD },\n});\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/** Focuses `ref` once the list has closed and its surface, with the Modal focus trap, has left the page. */\nexport function useRefocusOnClose(open: boolean, ref: RefObject<{ focus: () => void } | null>): void {\n const wasOpen = useRef(false);\n useEffect(() => {\n if (wasOpen.current && !open) ref.current?.focus();\n wasOpen.current = open;\n }, [open, ref]);\n}\n","import type { ControlOption } from '../../controls/controlTypes';\r\nimport { suggestOptions } from '../../controls/suggestOptions';\r\n\r\nconst MIN_QUERY = 1;\r\n\r\n/** The open list: recently picked matches first, then every other match; `flat` is the walk order. */\r\nexport interface SearchSelectSections {\r\n readonly recent: readonly ControlOption[];\r\n readonly all: readonly ControlOption[];\r\n readonly flat: readonly ControlOption[];\r\n}\r\n\r\n/** Filters by label, value and detail, then splits the matches into Recent and All. */\r\nexport function buildSearchSelectSections(options: readonly ControlOption[], query: string, recentValues: readonly string[]): SearchSelectSections {\r\n const matches = query.trim() === '' ? options : suggestOptions(options, query, MIN_QUERY, options.length);\r\n const byValue = new Map(matches.map((option) => [option.value, option] as const));\r\n const recent = recentValues.map((value) => byValue.get(value)).filter((option): option is ControlOption => option !== undefined);\r\n const recentSet = new Set(recent.map((option) => option.value));\r\n const all = matches.filter((option) => !recentSet.has(option.value));\r\n return { recent, all, flat: [...recent, ...all] };\r\n}\r\n\r\n/** The option whose value is `value`, or `null`; a value that is no option shows the placeholder. */\r\nexport function findOption(options: readonly ControlOption[], value: string): ControlOption | null {\r\n return options.find((option) => option.value === value) ?? null;\r\n}\r\n\r\n/** Moves the highlight by `step`, wrapping at both ends; `-1` means nothing highlighted. */\r\nexport function moveHighlight(index: number, count: number, step: number): number {\r\n if (count === 0) return -1;\r\n if (index < 0) return step > 0 ? 0 : count - 1;\r\n return (index + step + count) % count;\r\n}\r\n\r\n/** The highlight after the search text changes: the first match while there is text, nothing when empty. */\r\nexport function highlightAfterQuery(query: string): number {\r\n return query.trim() === '' ? -1 : 0;\r\n}\r\n","import { useCallback, useMemo, useState } from 'react';\n\nimport type { ControlOption } from '../../controls/controlTypes';\nimport type { RecentValues } from '../../useRecentValues/useRecentValues';\nimport { buildSearchSelectSections, highlightAfterQuery, moveHighlight, type SearchSelectSections } from '../utils/searchSelectModel';\n\nconst KEY_DOWN = 'ArrowDown';\nconst KEY_UP = 'ArrowUp';\nconst KEY_ESCAPE = 'Escape';\n\n/** Open state, query, highlight and the actions of one SearchSelect. */\nexport interface SearchSelectState {\n open: boolean;\n query: string;\n highlight: number;\n active: ControlOption | undefined;\n sections: SearchSelectSections;\n openList: () => void;\n close: () => void;\n setQuery: (query: string) => void;\n pick: (option: ControlOption) => void;\n submit: (via?: (option: ControlOption) => void) => void;\n onKey: (key: string) => void;\n}\n\n/** Only `pick` calls `onChange`, so the value is always an option, never typed text; Enter picks only through `submit`. */\nexport function useSearchSelectState(options: readonly ControlOption[], recents: RecentValues, onChange: (value: string) => void, onClosed: () => void): SearchSelectState {\n const [open, setOpen] = useState(false);\n const [query, setQueryState] = useState('');\n const [rawHighlight, setHighlight] = useState(-1);\n const sections = useMemo(() => buildSearchSelectSections(options, query, recents.recents), [options, query, recents.recents]);\n const highlight = rawHighlight < sections.flat.length ? rawHighlight : -1;\n const active = sections.flat[highlight];\n const { remember } = recents;\n\n const close = useCallback(() => {\n setOpen(false);\n setQueryState('');\n setHighlight(-1);\n onClosed();\n }, [onClosed]);\n\n const pick = useCallback((option: ControlOption) => {\n remember(option.value);\n onChange(option.value);\n close();\n }, [remember, onChange, close]);\n\n const submit = useCallback((via: (option: ControlOption) => void = pick) => {\n if (active !== undefined) via(active);\n }, [active, pick]);\n\n const setQuery = useCallback((next: string) => {\n setQueryState(next);\n setHighlight(highlightAfterQuery(next));\n }, []);\n\n const onKey = useCallback((key: string) => {\n const count = sections.flat.length;\n if (key === KEY_DOWN) setHighlight(moveHighlight(highlight, count, 1));\n if (key === KEY_UP) setHighlight(moveHighlight(highlight, count, -1));\n if (key === KEY_ESCAPE) close();\n }, [sections.flat.length, highlight, close]);\n\n const openList = useCallback(() => setOpen(true), []);\n return { open, query, highlight, active, sections, openList, close, setQuery, pick, submit, onKey };\n}\n","import { SelectSurface } from '../SelectSurface';\n\n/** Below this window width the list opens as a sheet from the bottom. */\nexport const PHONE_MAX_WIDTH = 600;\nconst SHEET_TRAVEL_PX = 320;\nconst DROPDOWN_TRAVEL_PX = -8;\nconst SHEET_MS = 240;\nconst DROPDOWN_MS = 160;\n\n/** Where the list slides from and how long it takes. */\nexport interface SelectMotion {\n readonly surface: SelectSurface;\n readonly fromY: number;\n readonly durationMs: number;\n}\n\n/** Sheet on a phone, unfolding list on a computer; reduced motion keeps the surface and drops the slide. */\nexport function resolveSelectMotion(width: number, reducedMotion: boolean): SelectMotion {\n const isPhone = width < PHONE_MAX_WIDTH;\n const surface = isPhone ? SelectSurface.Sheet : SelectSurface.Dropdown;\n if (reducedMotion) return { surface, fromY: 0, durationMs: 0 };\n return isPhone ? { surface, fromY: SHEET_TRAVEL_PX, durationMs: SHEET_MS } : { surface, fromY: DROPDOWN_TRAVEL_PX, durationMs: DROPDOWN_MS };\n}\n","import React, { useCallback, useRef } from 'react';\r\n\r\nimport { Pressable, StyleSheet, Text, View, useWindowDimensions } from 'react-native';\r\n\r\nimport { useUi } from '@dloizides/ui-feedback';\r\n\r\nimport { controlStyles as s } from '../controls/controlStyles';\r\nimport type { ControlOption } from '../controls/controlTypes';\r\nimport { useRecentValues } from '../useRecentValues/useRecentValues';\r\nimport { SearchSelectPanel } from './components/SearchSelectPanel';\r\nimport { useReducedMotion } from './hooks/useReducedMotion';\r\nimport { useRefocusOnClose } from './hooks/useRefocusOnClose';\r\nimport { useSearchSelectState } from './hooks/useSearchSelectState';\r\nimport type { SearchSelectLabels, SearchSelectTrigger } from './types';\r\nimport { findOption } from './utils/searchSelectModel';\r\nimport { resolveSelectMotion } from './utils/searchSelectMotion';\r\n\r\nconst CHEVRON = '▾';\r\nconst VALUE_GAP = 8;\r\nconst MIN_TOUCH = 44;\r\nconst NOTHING_ON_CLOSE = (): void => undefined;\r\n\r\nexport interface SearchSelectProps {\r\n options: readonly ControlOption[];\r\n value: string;\r\n onChange: (value: string) => void;\r\n accessibilityLabel: string;\r\n accessibilityHint: string;\r\n labels: SearchSelectLabels;\r\n testID: string;\r\n recentKey?: string;\r\n renderLeading?: (option: ControlOption) => React.ReactNode;\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n renderTrigger?: (trigger: SearchSelectTrigger) => React.ReactNode;\r\n onBlur?: () => void;\r\n}\r\n\r\n/** A select you can type into to filter; `renderTrigger` swaps the field box for your own visual; `onBlur` fires when focus leaves the closed field. */\r\nexport function SearchSelect(props: SearchSelectProps): React.ReactElement {\r\n const { options, value, onChange, accessibilityLabel, accessibilityHint, labels, testID, recentKey, renderLeading, renderDetail, renderTrigger, onBlur } = props;\r\n const { theme } = useUi();\r\n const { colors } = theme;\r\n const triggerRef = useRef<View>(null);\r\n const anchorRef = useRef<View>(null);\r\n const { width } = useWindowDimensions();\r\n const motion = resolveSelectMotion(width, useReducedMotion());\r\n const recents = useRecentValues(recentKey ?? `search-select:${testID}`);\r\n const state = useSearchSelectState(options, recents, onChange, NOTHING_ON_CLOSE);\r\n useRefocusOnClose(state.open, triggerRef);\r\n const selected = findOption(options, value);\r\n const onPress = state.open ? state.close : state.openList;\r\n const openRef = useRef(state.open);\r\n openRef.current = state.open;\r\n const onTriggerBlur = useCallback(() => {\r\n if (!openRef.current) onBlur?.();\r\n }, [onBlur]);\r\n\r\n return (\r\n <View ref={anchorRef} style={styles.anchor}>\r\n <Pressable\r\n ref={triggerRef}\r\n accessibilityHint={accessibilityHint}\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityRole=\"button\"\r\n accessibilityState={{ expanded: state.open }}\r\n style={renderTrigger === undefined ? [s.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles.customTrigger}\r\n testID={testID}\r\n onBlur={onTriggerBlur}\r\n onPress={onPress}\r\n >\r\n {renderTrigger !== undefined ? renderTrigger({ open: state.open, selected, onPress, ref: triggerRef }) : (\r\n <FieldBoxContent colors={colors} placeholder={labels.placeholder} renderDetail={renderDetail} renderLeading={renderLeading} selected={selected} />\r\n )}\r\n </Pressable>\r\n {state.open ? <SearchSelectPanel anchorRef={anchorRef} labels={labels} motion={motion} renderDetail={renderDetail} renderLeading={renderLeading} selectedValue={value} state={state} testID={testID} /> : null}\r\n </View>\r\n );\r\n}\r\n\r\ninterface FieldBoxContentProps {\r\n selected: ControlOption | null;\r\n placeholder: string;\r\n colors: { text: string; textSecondary: string };\r\n renderLeading?: (option: ControlOption) => React.ReactNode;\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n}\r\n\r\nfunction FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }: FieldBoxContentProps): React.ReactElement {\r\n return (\r\n <>\r\n <View style={styles.value}>\r\n {selected !== null && renderLeading !== undefined ? renderLeading(selected) : null}\r\n <Text numberOfLines={1} style={[s.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }]}>{selected?.label ?? placeholder}</Text>\r\n {selected !== null ? <SelectedDetail colors={colors} option={selected} renderDetail={renderDetail} /> : null}\r\n </View>\r\n <Text aria-hidden style={[s.chevron, { color: colors.textSecondary }]}>{CHEVRON}</Text>\r\n </>\r\n );\r\n}\r\n\r\ninterface SelectedDetailProps {\r\n option: ControlOption;\r\n colors: { textSecondary: string };\r\n renderDetail?: (option: ControlOption) => React.ReactNode;\r\n}\r\n\r\nfunction SelectedDetail({ option, colors, renderDetail }: SelectedDetailProps): React.ReactElement | null {\r\n if (renderDetail !== undefined) return <>{renderDetail(option)}</>;\r\n if (option.detail === undefined) return null;\r\n return <Text style={[s.selectTriggerText, { color: colors.textSecondary }]}>{option.detail}</Text>;\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n anchor: { position: 'relative' },\r\n customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: 'flex-start', justifyContent: 'center' },\r\n value: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: VALUE_GAP },\r\n});\r\n","import { useEffect, type RefObject } from 'react';\n\nimport { Platform, type View } from 'react-native';\n\ntype Container = Pick<Node, 'contains'>;\n\nfunction isContainer(node: unknown): node is Container {\n return 'contains' in Object(node);\n}\n\n/** True when `target` lies outside `container`; false when `container` is no DOM node. */\nexport function isOutside(container: unknown, target: EventTarget | null): boolean {\n if (!isContainer(container)) return false;\n return !(target instanceof Node && container.contains(target));\n}\n\n/** On web, calls `onOutside` for a pointer press that starts outside the view behind `ref`. */\nexport function useOutsidePress(ref: RefObject<View | null>, onOutside: () => void): void {\n useEffect(() => {\n if (Platform.OS !== 'web' || typeof document === 'undefined') return undefined;\n const onPointerDown = (event: PointerEvent): void => {\n if (isOutside(ref.current, event.target)) onOutside();\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n return () => document.removeEventListener('pointerdown', onPointerDown, true);\n }, [ref, onOutside]);\n}\n","import { useCallback, type RefObject } from 'react';\n\nconst AFTER_SURFACE_UNMOUNT_MS = 0;\n\n/** Focuses `ref` on the next tick, after the closing list surface has left the page. */\nexport function useDeferredFocus(ref: RefObject<{ focus: () => void } | null>): () => void {\n return useCallback(() => {\n setTimeout(() => ref.current?.focus(), AFTER_SURFACE_UNMOUNT_MS);\n }, [ref]);\n}\n","export const FLAG_PALETTE: Readonly<Record<string, string | undefined>> = {\n R: '#D52B1E', W: '#FFFFFF', B: '#0039A6', N: '#012169', S: '#6CACE4', G: '#009A44',\n D: '#006A4E', Y: '#FCD116', K: '#000000', O: '#FF8200', M: '#9E3039',\n A: '#8D1B3D', T: '#00778B', P: '#5B2C83', I: '#A7A8AA', C: '#D57800', E: '#002664',\n};\n\nexport const FLAG_FALLBACK_FILL = '#C8CDD2';\n\nexport const FLAG_EDGE = '#8A9199';\n","export enum FlagShapeKind {\n Rect = 'rect',\n Circle = 'circle',\n Polygon = 'polygon',\n}\n","const BLUE_ENSIGN = 'HN j0,0,10,7';\nconst AUSTRALIA = `${BLUE_ENSIGN} s5,10.5,1.6,W s15,3,0.9,W s13,7,0.9,W s17,6,0.9,W s15,11.5,0.9,W`;\nconst SALTIRE_A = 'p0,0,1.8,0,20,12.7,20,14,18.2,14,0,1.3';\nconst SALTIRE_B = 'p20,0,18.2,0,0,12.7,0,14,1.8,14,20,1.3';\nconst SHIELD = 'p13.5,3.5,16.5,3.5,16.5,8.5,15,10,13.5,8.5';\n\nexport const FLAG_DRAWINGS_A_TO_L: Readonly<Record<string, string | undefined>> = {\n AD: 'VBYR p8.6,5.2,11.4,5.2,11.4,8,10,9.2,8.6,8,M',\n AG: 'HR p0,0,20,0,10,14,K c10,7,2.6,Y p5,7,15,7,10,14,B p6.8,9.5,13.2,9.5,10,14,W',\n AI: `${BLUE_ENSIGN} c15,7,2.6,W c15,8,1.4,O`,\n AL: 'HR p10,2.5,14,5,13,11,10,9,7,11,6,5,K',\n AO: 'HRK s10,7,2.2,Y',\n AQ: 'HS c10,7,3.5,W',\n AS: 'HN p20,0,0,7,20,14,R p20,1.2,2.6,7,20,12.8,W',\n AU: AUSTRALIA,\n AW: 'HS r0,9,20,0.8,Y r0,10.6,20,0.8,Y s3.5,3.5,2.2,W s3.5,3.5,1.6,R',\n BA: 'HB p5,0,15,0,15,14,Y s4.2,1.2,0.8,W s5.7,3.5,0.8,W s7.2,5.8,0.8,W s8.7,8.1,0.8,W s10.2,10.4,0.8,W s11.7,12.7,0.8,W',\n BB: 'VBYB p9.4,5,10,3,10.6,5,10.4,11,9.6,11,K p7.8,3.5,8.6,3.5,9,6.5,11,6.5,11.4,3.5,12.2,3.5,11.6,7.5,8.4,7.5,K',\n BF: 'HRG s10,7,1.8,Y',\n BH: 'HR p0,0,6,0,8,1.4,6,2.8,8,4.2,6,5.6,8,7,6,8.4,8,9.8,6,11.2,8,12.6,6,14,0,14,W',\n BI: `HR p0,0,10,7,0,14,G p20,0,10,7,20,14,G ${SALTIRE_A},W ${SALTIRE_B},W c10,7,3,W s10,5.8,0.8,R s9,7.8,0.8,R s11,7.8,0.8,R`,\n BJ: 'HYR r0,0,8,14,G',\n BM: 'HR j0,0,10,7 c15,7.5,2.6,W c15,8.4,1.4,R',\n BN: 'HY p0,3,20,9,20,11.5,0,5.5,W p0,5.5,20,11.5,20,14,0,8,K c10,7,2.5,R',\n BQ: 'HW p0,0,10,0,0,7,Y p20,4,20,14,6,14,B c5.5,6,2,K c5.5,6,1.5,W s5.5,6,1,R',\n BR: 'HG p10,1.5,18.5,7,10,12.5,1.5,7,Y c10,7,3.4,N p6.8,6,13.2,7.6,13.2,8.2,6.8,6.6,W',\n BS: 'HTYT p0,0,8,7,0,14,K',\n BT: 'HO p0,0,20,0,0,14,Y c10,7,2.4,W',\n BW: 'HS r0,5.2,20,3.6,W r0,5.8,20,2.4,K',\n BZ: 'HB r0,0,20,1.2,R r0,12.8,20,1.2,R c10,7,3.8,W c10,7,2.8,G',\n CA: 'HW r0,0,5,14,R r15,0,5,14,R p10,2.5,11,4.5,12,4,11.6,6.5,13.5,5.5,13,7,13.6,7.6,11.3,9,11.6,10,10.2,9.6,10.2,11.5,9.8,11.5,9.8,9.6,8.4,10,8.7,9,6.4,7.6,7,7,6.5,5.5,8.4,6.5,8,4,9,4.5,R',\n CC: 'HG c4,4,2.2,Y p3.5,6,4.5,6,4.2,2.5,3.8,2.5,G c9,7,1.8,Y c9.6,7,1.5,G s16,3,0.8,Y s14,7,0.8,Y s18,7,0.8,Y s16,11,0.8,Y',\n CD: 'HS p0,11,16,0,20,0,20,3,4,14,0,14,Y p0,12.2,17.6,0,20,0,20,1.8,2.4,14,0,14,R s4,3.5,2.2,Y',\n CF: 'HBWGY r8.5,0,3,14,R s3,1.75,1.2,Y',\n CG: 'HY p0,0,13,0,0,14,G p20,0,20,14,7,14,R',\n CK: `${BLUE_ENSIGN} c15,7,3,W c15,7,2.3,N`,\n CL: 'HWR r0,0,7,7,B s3.5,3.5,1.8,W',\n CN: 'HR s3.5,3.5,2.2,Y s7,1.4,0.7,Y s8.4,2.8,0.7,Y s8.4,4.9,0.7,Y s7,6.3,0.7,Y',\n CU: 'HBWBWB p0,0,10,7,0,14,R s3.3,7,1.8,W',\n CV: 'HB r0,7.4,20,1,W r0,8.4,20,1.2,R r0,9.6,20,1,W s7,6,0.6,Y s9.6,7,0.6,Y s9.6,11,0.6,Y s7,12,0.6,Y s4.4,11,0.6,Y s4.4,7,0.6,Y',\n CW: 'HB r0,9,20,1.8,Y s3,3,1.4,W s5.5,5,1,W',\n CX: 'HB p0,0,20,0,20,14,G c10,7,2,Y s3,10,0.8,W s5.5,12,0.8,W s6,8.5,0.8,W s3,6,0.6,W p13,3,17,2,15,4.5,Y',\n CY: 'HW p3,6,7,4,13,3.5,17,2,15,5,11,7,6,7.5,C p6.5,10.5,9.5,9.2,9.5,10,G p13.5,10.5,10.5,9.2,10.5,10,G',\n CZ: 'HWR p0,0,10,7,0,14,B',\n DJ: 'HSG p0,0,10,7,0,14,W s3.5,7,1.4,R',\n DM: 'HG r8.4,0,1,14,Y r9.4,0,1,14,K r10.4,0,1,14,W r0,5.4,20,1,Y r0,6.4,20,1,K r0,7.4,20,1,W c9.9,6.9,3,R c9.9,6.9,1.2,P',\n DO: 'HW r0,0,8.5,5.5,N r11.5,0,8.5,5.5,R r0,8.5,8.5,5.5,R r11.5,8.5,8.5,5.5,N c10,7,1.2,G',\n DZ: 'VGW c10,7,3.2,R c11.2,7,2.6,W s12.5,7,1.2,R',\n EC: 'HYYBR c10,7,2,Y c10,7,1.4,S',\n EG: 'HRWK p9,5.2,11,5.2,10.6,8.6,9.4,8.6,Y',\n EH: 'HKWG p0,0,7,7,0,14,R c10,7,1.8,R c10.6,7,1.5,W s11,7,0.9,R',\n ER: 'HGB p0,0,20,7,0,14,R c5,7,2.6,Y c5,7,2,R',\n FJ: 'HS j0,0,10,7 r13.5,4,3.5,4.5,W r13.5,4,3.5,1.2,R',\n FK: `${BLUE_ENSIGN} c15,7,2.6,S c15,8.2,1.4,W`,\n FM: 'HS s10,3.5,1.2,W s6.5,7,1.2,W s13.5,7,1.2,W s10,10.5,1.2,W',\n GB: 'j0,0,20,14',\n GD: 'HR p1.5,1.5,18.5,1.5,10,7,Y p1.5,12.5,18.5,12.5,10,7,Y p1.5,1.5,10,7,1.5,12.5,G p18.5,1.5,10,7,18.5,12.5,G c10,7,2,R s10,7,1.3,Y s5,0.75,0.6,Y s10,0.75,0.6,Y s15,0.75,0.6,Y s5,13.25,0.6,Y s10,13.25,0.6,Y s15,13.25,0.6,Y',\n GG: 'HW r8.5,0,3,14,R r0,5.5,20,3,R r9.6,4.2,0.8,5.6,Y r7.2,6.6,5.6,0.8,Y',\n GH: 'HRYG s10,7,2,K',\n GI: 'HWWR r6.5,3,7,5,R r6.5,1.8,1.5,1.4,R r9.25,1.8,1.5,1.4,R r12,1.8,1.5,1.4,R p9.5,9.3,10.5,9.3,10.5,12,9.5,12,Y',\n GL: 'HWR c7,7,4.5,R p2.5,7,3.1,9.25,4.75,10.9,7,11.5,9.25,10.9,10.9,9.25,11.5,7,W',\n GQ: 'HGWR p0,0,5,7,0,14,B c10,7,1.3,G',\n GR: 'HBWBWBWBWB r0,0,7.78,7.78,B r3.11,0,1.56,7.78,W r0,3.11,7.78,1.56,W',\n GS: `${BLUE_ENSIGN} c15,7,2.6,W c15,7.5,1.4,Y`,\n GU: 'HR r1,1,18,12,N p10,3,13,7,10,11,7,7,S',\n GW: 'HYG r0,0,7,14,R s3.5,7,2,K',\n GY: 'HG p0,0,20,7,0,14,W p0,0.8,18.6,7,0,13.2,Y p0,0,10,7,0,14,K p0,1,8.6,7,0,13,R',\n HK: 'HR s10,7,3.4,W s10,7,1,R',\n HM: AUSTRALIA,\n HN: 'HBWB s10,7,0.9,B s6.5,5.8,0.9,B s6.5,8.2,0.9,B s13.5,5.8,0.9,B s13.5,8.2,0.9,B',\n HR: 'HRWB r8.5,3.5,3,4,W r8.5,3.5,1,1,R r10.5,3.5,1,1,R r9.5,4.5,1,1,R r8.5,5.5,1,1,R r10.5,5.5,1,1,R r9.5,6.5,1,1,R',\n HT: 'HBR r7,4.5,6,5,W r9.3,5.3,1.4,3.4,G',\n IL: 'HW r0,1.4,20,2,B r0,10.6,20,2,B p10,4,12.6,8.5,7.4,8.5,B p10,10,7.4,5.5,12.6,5.5,B p10,4.8,11.9,8.1,8.1,8.1,W p10,9.2,8.1,5.9,11.9,5.9,W',\n IM: 'HR p9.6,6.6,6.2,3.4,6.8,2.8,10.4,6.4,W p10,6.4,14.5,4.3,14.8,5.1,10.2,7.2,W p9.6,7.2,9.1,11.8,10,11.9,10.4,7,W',\n IN: 'HOWG c10,7,1.8,N c10,7,1.4,W',\n IO: 'HW r0,3,20,1,N r0,6,20,1,N r0,9,20,1,N r0,12,20,1,N j0,0,10,7 p14,10,15,10,14.8,5,14.2,5,G c14.5,5,1.4,G',\n IQ: 'HRWK r7,5.6,6,1.4,G',\n JE: `HW ${SALTIRE_A},R ${SALTIRE_B},R p8.8,1.5,11.2,1.5,11.2,3.5,10,4.3,8.8,3.5,R c10,1.2,0.6,Y`,\n JM: `HG p0,0,10,7,0,14,K p20,0,10,7,20,14,K ${SALTIRE_A},Y ${SALTIRE_B},Y`,\n JO: 'HKWG p0,0,10,7,0,14,R s3.5,7,1.2,W',\n KE: 'HK r0,4.2,20,5.6,W r0,5,20,4,R r0,9.8,20,4.2,G p10,2,12.2,7,10,12,7.8,7,K p10,3,11.4,7,10,11,8.6,7,R r9.8,4,0.4,6,W',\n KH: 'HBRRB p6,9.5,6.5,6.5,8,6.5,8.5,5,9.5,5,10,3.5,10.5,5,11.5,5,12,6.5,13.5,6.5,14,9.5,W',\n KI: 'HR c10,7.2,3,Y r0,7,20,7,B r0,8.2,20,0.8,W r0,10.2,20,0.8,W r0,12.2,20,0.8,W p6.5,3.5,13.5,2.5,10.5,4.5,Y',\n KM: 'HYWRB p0,0,9,7,0,14,G c3.2,7,2.2,W c4,7,1.9,G',\n KN: 'HR p0,0,20,0,0,14,G p0,10,14.3,0,20,0,20,4,5.7,14,0,14,Y p0,11.6,16.6,0,20,0,20,2.4,3.4,14,0,14,K s7,8,0.9,W s13,4,0.9,W',\n KP: 'HB r0,2.4,20,9.2,W r0,2.9,20,8.2,R c6.5,7,2.6,W s6.5,7,2.3,R',\n KR: 'HW c10,7,3.4,R p6.6,7,7.1,8.7,8.3,9.9,10,10.4,11.7,9.9,12.9,8.7,13.4,7,B c8.3,7,1.7,R c11.7,7,1.7,B r3,2,2.4,0.5,K r3,3,2.4,0.5,K r3,4,2.4,0.5,K r14.6,10,2.4,0.5,K r14.6,11,2.4,0.5,K r14.6,12,2.4,0.5,K r3,10,2.4,0.5,K r3,11,2.4,0.5,K r3,12,2.4,0.5,K r14.6,2,2.4,0.5,K r14.6,3,2.4,0.5,K r14.6,4,2.4,0.5,K',\n KW: 'HGWR p0,0,5,4.67,5,9.33,0,14,K',\n KY: `${BLUE_ENSIGN} c15,7,2.6,W c15,7.8,1.6,R`,\n KZ: 'HS c10,6,2.2,Y p6,9,14,9,10,10.5,Y r1,0,1,14,Y',\n LB: 'HR r0,3.5,20,7,W p10,4.2,13,9.5,7,9.5,G',\n LC: 'HS p10,2,15,12,5,12,W p10,3.5,14,12,6,12,K p10,7,15,12,5,12,Y',\n LI: 'HBR p3,4.5,3,2,4.2,3,5,1.5,5.8,3,7,2,7,4.5,Y',\n LK: 'HY r1,1,2.5,12,G r3.5,1,2.5,12,O r7,1,12,12,A p9,11,17,11,16,4,13,3.5,11,5,Y',\n LR: 'HRWRWRWRWRWR r0,0,6.36,6.36,N s3.18,3.18,1.8,W',\n LY: 'HRKKG c10,7,2.2,W c10.7,7,1.8,K s12.2,7,0.9,W',\n};\n\nexport { BLUE_ENSIGN, SALTIRE_A, SALTIRE_B, SHIELD };\n","import { BLUE_ENSIGN, SHIELD } from './flagDrawingsAtoL';\n\nconst USA = 'HRWRWRWRWRWRWR r0,0,9,7.54,N s2,1.5,0.5,W s4.5,1.5,0.5,W s7,1.5,0.5,W s3.2,3.8,0.5,W s5.8,3.8,0.5,W s2,6,0.5,W s4.5,6,0.5,W s7,6,0.5,W';\nconst TRIBAND_FIMBRIATED = 'HK r0,4.2,20,5.6,W r0,5,20,4,R r0,9.8,20,4.2,G';\n\nexport const FLAG_DRAWINGS_M_TO_Z: Readonly<Record<string, string | undefined>> = {\n MA: 'HR s10,7,3.2,G s10,7,2.4,R',\n MD: 'VBYR p8.5,5,11.5,5,11,8.5,10,9.5,9,8.5,C',\n ME: 'HY r1,1,18,12,R p10,4,13,6,12,10,10,9,8,10,7,6,Y',\n MG: 'HRG r0,0,6.7,14,W',\n MH: 'HN p0,14,20,0.2,20,2.5,O p0,14,20,2.5,20,4.8,W s4.5,4.5,2.2,W',\n MK: 'HR p0,0,3,0,10,7,0,2,Y p20,0,17,0,10,7,20,2,Y p0,14,3,14,10,7,0,12,Y p20,14,17,14,10,7,20,12,Y p8.5,0,11.5,0,10,7,Y p8.5,14,11.5,14,10,7,Y p0,5.5,0,8.5,10,7,Y p20,5.5,20,8.5,10,7,Y c10,7,2.4,R c10,7,2,Y',\n MM: 'HYGR s10,7.4,4,W',\n MO: 'HG c10,8.5,1.8,W p7,10.5,13,10.5,12,11.2,8,11.2,W s10,4,0.9,Y s7.5,5,0.6,Y s12.5,5,0.6,Y s6,6.5,0.6,Y s14,6.5,0.6,Y',\n MP: 'HB c10,7,3.4,O c10,7,2.8,B p9,10,11,10,10.6,4.5,9.4,4.5,I s10,7,1.8,W',\n MR: 'HG r0,0,20,2,R r0,12,20,2,R c10,6.2,3,Y c10,5.2,2.8,G s10,5.4,1,Y',\n MS: `${BLUE_ENSIGN} c15,7,2.6,S c15,8.2,1.4,G`,\n MV: 'HR r4,3.5,12,7,G c10,7,2.6,W c11,7,2.3,G',\n MX: 'VGWR c10,6.8,1.5,M p8.2,7.6,11.8,7.6,11,9,9,9,G',\n MY: 'HRWRWRWRWRWRWRW r0,0,10,8,N c4,4,2.6,Y c4.8,4,2.2,N s7.6,4,1.6,Y',\n MZ: 'HG r0,4.5,20,5,W r0,5,20,4,K r0,9.5,20,4.5,Y p0,0,8,7,0,14,R s3,7,1.8,Y',\n NA: 'HG p0,0,20,0,0,14,B p0,14,0,11,15.7,0,20,0,20,3,4.3,14,W p0,14,0,12.4,17.7,0,20,0,20,1.6,2.3,14,R s4.5,3.5,2.2,Y',\n NE: 'HOWG c10,7,1.5,O',\n NF: 'VGWG p10,2,12,11,8,11,G r9.6,11,0.8,1.5,G',\n NI: 'HBWB p10,5.2,12,8.6,8,8.6,S',\n NP: 'HW p2,0,14,6,5.5,6,14,13.5,2,13.5,B p3,1.2,11.5,5.5,4,5.5,11.5,12.8,3,12.8,R c5.5,4,1,W s5.5,10,1.3,W',\n NR: 'HN r0,6.3,20,1.4,Y s5,10.5,1.8,W',\n NU: 'HY j0,0,10,7 c5,3.5,1,N s5,3.5,0.8,Y',\n NZ: `${BLUE_ENSIGN} s15,3,1.1,W s15,3,0.7,R s12.5,7,1.1,W s12.5,7,0.7,R s17.5,6,1,W s17.5,6,0.6,R s15,11,1.2,W s15,11,0.8,R`,\n OM: 'HWRG r0,0,5.5,14,R p1.5,2,4,2,2.75,3.5,W',\n PA: 'HW r10,0,10,7,R r0,7,10,7,B s5,3.5,1.6,B s15,10.5,1.6,R',\n PG: 'HK p0,0,20,0,20,14,R p12,3,17,2,16,4,13,6,Y s4,5,0.8,W s6.5,7,0.8,W s4,10,0.9,W s2,7,0.7,W',\n PH: 'HBR p0,0,10,7,0,14,W c3.2,7,1.4,Y s1.2,1.8,0.6,Y s1.2,12.2,0.6,Y s7.8,7,0.6,Y',\n PK: 'HG r0,0,5,14,W c12.5,7,3.4,W c13.5,6.3,3,G s14.8,5.5,1.2,W',\n PN: `${BLUE_ENSIGN} p13.5,4,16.5,4,16.5,8,15,9.5,13.5,8,G r13.5,4,3,1.5,S`,\n PR: 'HRWRWR p0,0,10,7,0,14,B s3.5,7,1.8,W',\n PS: 'HKWG p0,0,8,7,0,14,R',\n PY: 'HRWB c10,7,1.6,Y c10,7,1.1,W',\n QA: 'HA p0,0,5.5,0,7.5,0.78,5.5,1.56,7.5,2.33,5.5,3.11,7.5,3.89,5.5,4.67,7.5,5.44,5.5,6.22,7.5,7,5.5,7.78,7.5,8.56,5.5,9.33,7.5,10.11,5.5,10.89,7.5,11.67,5.5,12.44,7.5,13.22,5.5,14,0,14,W',\n SA: 'HG r4,4,12,1.2,W r5,6,10,0.8,W r5,9,10,0.7,W r14.5,8.5,1.2,1.2,W',\n SB: 'HG p0,0,20,0,0,14,B p0,13,18.6,0,20,0,20,1,1.4,14,0,14,Y s2.5,2,0.8,W s6.5,2,0.8,W s4.5,3.5,0.8,W s2.5,5,0.8,W s6.5,5,0.8,W',\n SC: 'HG p0,14,0,0,6.7,0,B p0,14,6.7,0,13.3,0,Y p0,14,13.3,0,20,0,20,4.7,R p0,14,20,4.7,20,9.3,W',\n SD: 'HRWK p0,0,7,7,0,14,G',\n SG: 'HRW c4.5,3.5,2.6,W c5.5,3.5,2.4,R s6.5,1.9,0.5,W s5.3,3,0.5,W s7.7,3,0.5,W s5.8,4.6,0.5,W s7.2,4.6,0.5,W',\n SH: `${BLUE_ENSIGN} ${SHIELD},S r13.5,3.5,3,1.8,Y`,\n SI: 'HWBR p3.5,2.5,6.5,2.5,6.5,6,5,7.2,3.5,6,B',\n SK: 'HWBR p3.5,3.5,8,3.5,8,9,5.75,10.5,3.5,9,R p5.4,5,6.1,5,6.1,9,5.4,9,W',\n SM: 'HWS c10,7,1.8,Y c10,7,1.2,G',\n SN: 'VGYR s10,7,1.8,G',\n SO: 'HS s10,7,3.2,W',\n SR: 'HG r0,2.8,20,8.4,W r0,4.2,20,5.6,R s10,7,2.4,Y',\n SS: `${TRIBAND_FIMBRIATED} p0,0,8,7,0,14,B s3,7,1.5,Y`,\n ST: 'HG r0,4,20,6,Y p0,0,6,7,0,14,R s10,7,1.3,K s14.5,7,1.3,K',\n SX: 'HRB p0,0,10,7,0,14,W c3.6,7,1.6,Y c3.6,7,1.1,S',\n SY: 'HRWK s7,7,1.3,G s13,7,1.3,G',\n SZ: 'HB r0,3,20,8,Y r0,4,20,6,R p4,7,10,4.4,16,7,10,9.6,W p10,4.4,16,7,10,9.6,K',\n TC: `${BLUE_ENSIGN} ${SHIELD},Y`,\n TD: 'VEYR',\n TG: 'HGYGYG r0,0,8.4,8.4,R s4.2,4.2,2.2,W',\n TJ: 'HRWG p8,7.5,12,7.5,11.5,5.8,10,6.6,8.5,5.8,Y',\n TK: 'HN p4,10,16,9,15,11,6,11.5,Y s4,3,0.8,W s7,5,0.8,W s5,7,0.8,W s3,5.5,0.6,W',\n TL: 'HR p0,0,10,7,0,14,Y p0,0,6.7,7,0,14,K s2.4,7,1.3,W',\n TM: 'HG r2.5,0,3,14,A r3.4,0,0.4,14,O r4.2,0,0.4,14,O c9.5,4,2.4,W c10.3,3.6,2.2,G s12,3,0.6,W s12.5,4.6,0.6,W',\n TN: 'HR c10,7,3.5,W c10.4,7,2.6,R c11.1,7,2.1,W s11.2,7,1.2,R',\n TO: 'HR r0,0,8,7,W r3.3,1,1.4,5,R r1.5,2.8,5,1.4,R',\n TR: 'HR c7.5,7,3.5,W c8.4,7,2.8,R s12.3,7,1.5,W',\n TT: 'HR p0,0,5,0,20,10.5,20,14,15,14,0,3.5,W p0,0.7,1,0,4,0,20,11.3,20,13.3,19,14,16,14,0,2.7,K',\n TV: 'HS j0,0,10,7 s13,9,0.7,Y s15,11,0.7,Y s17,8,0.7,Y s12,12,0.7,Y s16,4,0.7,Y s18,11.5,0.7,Y s14,6.5,0.7,Y s18.5,3,0.7,Y s11.5,9.5,0.7,Y',\n TW: 'HR r0,0,10,7,N s5,3.5,2.4,W c5,3.5,1.3,N c5,3.5,1,W',\n TZ: 'HB p0,0,20,0,0,14,G p0,11,15.7,0,20,0,20,3,4.3,14,0,14,Y p0,12.4,17.7,0,20,0,20,1.6,2.3,14,0,14,K',\n UM: USA,\n US: USA,\n UY: 'HWBWBWBWBW r0,0,7.78,7.78,W s3.9,3.9,2.6,Y c3.9,3.9,1.5,Y',\n VA: 'VYW p12,4,15,10,14.3,10.3,11.3,4.3,Y p15,4,12,10,12.7,10.3,15.7,4.3,I',\n VC: 'VBYYG p7,7,8.3,4.5,9.6,7,8.3,9.5,G p10.4,7,11.7,4.5,13,7,11.7,9.5,G p8.7,9.5,10,7,11.3,9.5,10,12,G',\n VG: `${BLUE_ENSIGN} ${SHIELD},G r14.6,4.5,0.8,3.5,W`,\n VI: 'HW p6,5,14,5,12,8,8,8,Y p9,4,11,4,11,10,9,10,Y r9.3,8.4,1.4,2,S',\n VN: 'HR s10,7,3.6,Y',\n VU: 'HRG r0,5.9,20,2.2,Y r0,6.4,20,1.2,K p0,0,10.4,7,0,14,Y p0,1.2,8.6,7,0,12.8,K c3.2,7,1.3,Y',\n WS: 'HR r0,0,10,7,N s5,1.6,0.8,W s3,3.5,0.8,W s7,3,0.8,W s5,5.6,0.9,W s6,4.2,0.5,W',\n ZA: 'HRB p0,0,1.6,0,9.4,4.6,20,4.6,20,9.4,9.4,9.4,1.6,14,0,14,W p0,0.9,8.6,5.6,20,5.6,20,8.4,8.6,8.4,0,13.1,0,11,6.6,7,0,3,G p0,3,6.6,7,0,11,Y p0,4,5,7,0,10,K',\n ZM: 'HG r13,7,2.33,7,R r15.33,7,2.33,7,K r17.67,7,2.33,7,O p14,4,17,3,19,4,16.5,5,O',\n ZW: 'HGYRKRYG p0,0,8.5,7,0,14,K p0,0.6,7.8,7,0,13.4,W s3,7,1.5,R p2.5,6.5,4,5.5,3.6,8,Y',\n};\n","import { FLAG_DRAWINGS_A_TO_L } from './flagDrawingsAtoL';\nimport { FLAG_DRAWINGS_M_TO_Z } from './flagDrawingsMtoZ';\n\nexport const FLAG_DRAWINGS: Readonly<Record<string, string | undefined>> = { ...FLAG_DRAWINGS_A_TO_L, ...FLAG_DRAWINGS_M_TO_Z };\n","const FRENCH = 'V BWR';\nconst NORWAY = 'N RWB';\n\nexport const FLAG_SPECS: Readonly<Record<string, string | undefined>> = {\n AE: 'H GWK', AF: 'V KRG', AM: 'H RBO', AR: 'H SWS', AT: 'H RWR', AX: 'N BYR', AZ: 'H SRG',\n BD: 'D DR', BE: 'V KYR', BG: 'H WGR', BL: FRENCH, BO: 'H RYG', BV: NORWAY, BY: 'H RRG',\n CH: 'P RW', CI: 'V OWG', CM: 'V GRY', CO: 'H YYBR', CR: 'H BWRRWB', DE: 'H KRY', DK: 'N RW',\n EE: 'H BKW', ES: 'H RYYR', ET: 'H GYR', FI: 'N WB', FO: 'N WRB',\n FR: FRENCH, GA: 'H GYB', GE: 'P WR', GF: FRENCH, GM: 'H RBG', GN: 'V RYG', GP: FRENCH,\n GT: 'V SWS', HU: 'H RWG', ID: 'H RW', IE: 'V GWO',\n IR: 'H GWR', IS: 'N BWR', IT: 'V GWR', JP: 'D WR', KG: 'D RY', LA: 'H RNR',\n LS: 'H BWG', LT: 'H YGR', LU: 'H RWS', LV: 'H MWM', MC: 'H RW', MF: FRENCH,\n ML: 'V GYR', MN: 'V RBR', MQ: FRENCH, MT: 'V WR', MU: 'H RBYG', MW: 'H KRG',\n NC: FRENCH, NG: 'V GWG', NL: 'H RWB', NO: NORWAY, PE: 'V RWR',\n PF: FRENCH, PL: 'H WR', PM: FRENCH, PT: 'V GGRRR', PW: 'D SY', RE: FRENCH,\n RO: 'V BYR', RS: 'H RBW', RU: 'H WBR', RW: 'H SSYG', SE: 'N BY', SJ: NORWAY,\n SL: 'H GWS', SV: 'H BWB', TF: FRENCH, TH: 'H RWNNWR',\n UA: 'H BY', UG: 'H KYRKYR', UZ: 'H SWG', VE: 'H YBR',\n WF: FRENCH, YE: 'H RWK', YT: FRENCH,\n};\n","import { FlagShapeKind } from '../FlagShapeKind';\n\nexport const FLAG_WIDTH = 20;\nexport const FLAG_HEIGHT = 14;\n\nexport interface FlagShape {\n readonly kind: FlagShapeKind;\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n readonly fill: string;\n readonly points?: string;\n}\n\nconst HALF = 2;\nconst STAR_TIPS = 5;\nconst STAR_INNER = 0.4;\nconst DEGREES_HALF_TURN = 180;\nconst STAR_START = -90;\nconst DECIMALS = 100;\nconst JACK_DIAGONAL = 0.12;\nconst JACK_RED_DIAGONAL = 0.05;\nconst JACK_WHITE_CROSS = 3;\nconst JACK_RED_CROSS = 5;\n\nexport function rect(x: number, y: number, size: readonly [number, number], fill: string): FlagShape {\n return { kind: FlagShapeKind.Rect, x, y, width: size[0], height: size[1], fill };\n}\n\nexport function field(fill: string): FlagShape {\n return rect(0, 0, [FLAG_WIDTH, FLAG_HEIGHT], fill);\n}\n\nexport function circle(cx: number, cy: number, radius: number, fill: string): FlagShape {\n return { kind: FlagShapeKind.Circle, x: cx, y: cy, width: radius * HALF, height: radius * HALF, fill };\n}\n\nexport function polygon(coords: readonly number[], fill: string): FlagShape {\n const pairs: string[] = [];\n for (let i = 0; i + 1 < coords.length; i += HALF) pairs.push(`${coords[i]},${coords[i + 1]}`);\n return { kind: FlagShapeKind.Polygon, x: 0, y: 0, width: 0, height: 0, fill, points: pairs.join(' ') };\n}\n\nexport function stripes(fills: readonly string[], vertical: boolean): FlagShape[] {\n const step = (vertical ? FLAG_WIDTH : FLAG_HEIGHT) / fills.length;\n return fills.map((fill, i) => (vertical ? rect(i * step, 0, [step, FLAG_HEIGHT], fill) : rect(0, i * step, [FLAG_WIDTH, step], fill)));\n}\n\nfunction round(value: number): number {\n return Math.round(value * DECIMALS) / DECIMALS;\n}\n\nexport function star(cx: number, cy: number, radius: number, fill: string): FlagShape {\n const coords: number[] = [];\n for (let i = 0; i < STAR_TIPS * HALF; i++) {\n const r = i % HALF === 0 ? radius : radius * STAR_INNER;\n const angle = ((STAR_START + (i * DEGREES_HALF_TURN) / STAR_TIPS) * Math.PI) / DEGREES_HALF_TURN;\n coords.push(round(cx + r * Math.cos(angle)), round(cy + r * Math.sin(angle)));\n }\n return polygon(coords, fill);\n}\n\nfunction diagonals(box: readonly [number, number, number, number], share: number, fill: string): FlagShape[] {\n const [x, y, w, h] = box;\n const dx = w * share;\n const dy = h * share;\n const right = x + w;\n const bottom = y + h;\n return [\n polygon([x, y, x + dx, y, right, bottom - dy, right, bottom, right - dx, bottom, x, y + dy], fill),\n polygon([right, y, right - dx, y, x, bottom - dy, x, bottom, x + dx, bottom, right, y + dy], fill),\n ];\n}\n\nfunction cross(box: readonly [number, number, number, number], bar: number, fill: string): FlagShape[] {\n const [x, y, w, h] = box;\n return [rect(x + (w - bar) / HALF, y, [bar, h], fill), rect(x, y + (h - bar) / HALF, [w, bar], fill)];\n}\n\n/** The Union Jack drawn inside a box (x, y, width, height). */\nexport function unionJack(box: readonly [number, number, number, number], colors: readonly [string, string, string]): FlagShape[] {\n const [navy, white, red] = colors;\n const [x, y, w, h] = box;\n return [\n rect(x, y, [w, h], navy),\n ...diagonals(box, JACK_DIAGONAL, white),\n ...diagonals(box, JACK_RED_DIAGONAL, red),\n ...cross(box, h / JACK_WHITE_CROSS, white),\n ...cross(box, h / JACK_RED_CROSS, red),\n ];\n}\n","import { FLAG_FALLBACK_FILL, FLAG_PALETTE } from '../data/flagPalette';\nimport { circle, polygon, rect, star, stripes, unionJack, type FlagShape } from './flagPrimitives';\n\nconst OP_HORIZONTAL = 'H';\nconst OP_VERTICAL = 'V';\nconst OP_RECT = 'r';\nconst OP_CIRCLE = 'c';\nconst OP_POLYGON = 'p';\nconst OP_STAR = 's';\nconst OP_JACK = 'j';\n\nfunction fillOf(letter: string | undefined): string {\n return FLAG_PALETTE[letter ?? ''] ?? FLAG_FALLBACK_FILL;\n}\n\nfunction numbers(values: readonly string[]): number[] {\n return values.map(Number);\n}\n\nfunction drawOp(op: string): FlagShape[] {\n const kind = op.charAt(0);\n const body = op.slice(1);\n if (kind === OP_HORIZONTAL || kind === OP_VERTICAL) return stripes(Array.from(body, fillOf), kind === OP_VERTICAL);\n const args = body.split(',');\n const [a = 0, b = 0, c = 0, d = 0] = numbers(args);\n if (kind === OP_JACK) return unionJack([a, b, c, d], [fillOf('N'), fillOf('W'), fillOf('R')]);\n const fill = fillOf(args[args.length - 1]);\n if (kind === OP_RECT) return [rect(a, b, [c, d], fill)];\n if (kind === OP_CIRCLE) return [circle(a, b, c, fill)];\n if (kind === OP_STAR) return [star(a, b, c, fill)];\n if (kind === OP_POLYGON) return [polygon(numbers(args.slice(0, -1)), fill)];\n return [];\n}\n\n/** The shapes of a drawing of space-separated ops: H/V stripes, r rect, c disc, s star, p polygon, j Union Jack. */\nexport function drawFlag(drawing: string): FlagShape[] {\n return drawing.split(' ').filter((op) => op !== '').flatMap(drawOp);\n}\n","import { FLAG_FALLBACK_FILL, FLAG_PALETTE } from '../data/flagPalette';\nimport { FLAG_DRAWINGS } from '../data/flagDrawings';\nimport { FLAG_SPECS } from '../data/flagSpecs';\nimport { FlagShapeKind } from '../FlagShapeKind';\nimport { drawFlag } from './flagDrawing';\nimport { FLAG_HEIGHT, FLAG_WIDTH, field, rect, stripes, type FlagShape } from './flagPrimitives';\n\nexport { FLAG_HEIGHT, FLAG_WIDTH } from './flagPrimitives';\nexport type { FlagShape } from './flagPrimitives';\n\nconst CROSS_X = 5.5;\nconst CROSS_Y = 5.5;\nconst CROSS_BAR = 3;\nconst INNER_INSET = 1;\nconst INNER_BAR = 1;\nconst PLUS_ARM_X = 8.5;\nconst PLUS_ARM_Y = 3;\nconst PLUS_SPAN_X = 5;\nconst PLUS_SPAN = 10;\nconst PLUS_ARM_LEN = 8;\nconst DISC_DIAMETER = 8;\nconst HALF = 2;\n\nfunction nordic([ground = FLAG_FALLBACK_FILL, cross = FLAG_FALLBACK_FILL, inner]: readonly string[]): FlagShape[] {\n const shapes = [field(ground), rect(CROSS_X, 0, [CROSS_BAR, FLAG_HEIGHT], cross), rect(0, CROSS_Y, [FLAG_WIDTH, CROSS_BAR], cross)];\n if (inner === undefined) return shapes;\n return [...shapes, rect(CROSS_X + INNER_INSET, 0, [INNER_BAR, FLAG_HEIGHT], inner), rect(0, CROSS_Y + INNER_INSET, [FLAG_WIDTH, INNER_BAR], inner)];\n}\n\nfunction centredCross([ground = FLAG_FALLBACK_FILL, cross = FLAG_FALLBACK_FILL]: readonly string[]): FlagShape[] {\n return [field(ground), rect(PLUS_ARM_X, PLUS_ARM_Y, [CROSS_BAR, PLUS_ARM_LEN], cross), rect(PLUS_SPAN_X, CROSS_Y, [PLUS_SPAN, CROSS_BAR], cross)];\n}\n\nfunction disc([ground = FLAG_FALLBACK_FILL, mark = FLAG_FALLBACK_FILL]: readonly string[]): FlagShape[] {\n const circle: FlagShape = { kind: FlagShapeKind.Circle, x: FLAG_WIDTH / HALF, y: FLAG_HEIGHT / HALF, width: DISC_DIAMETER, height: DISC_DIAMETER, fill: mark };\n return [field(ground), circle];\n}\n\n/** True when the country has no drawn flag and shows the generic one. */\nexport function isFallbackFlag(code: string): boolean {\n const upper = code.toUpperCase();\n return FLAG_SPECS[upper] === undefined && FLAG_DRAWINGS[upper] === undefined;\n}\n\n/** The shapes that draw the flag of a 2-letter code; a generic flag for a code with no drawn flag. */\nexport function flagShapes(code: string): FlagShape[] {\n const upper = code.toUpperCase();\n const drawing = FLAG_DRAWINGS[upper];\n if (drawing !== undefined) return drawFlag(drawing);\n const spec = FLAG_SPECS[upper];\n if (spec === undefined) return [field(FLAG_FALLBACK_FILL)];\n const [layout = '', letters = ''] = spec.split(' ');\n const fills = Array.from(letters, (letter) => FLAG_PALETTE[letter] ?? FLAG_FALLBACK_FILL);\n if (layout === 'V') return stripes(fills, true);\n if (layout === 'N') return nordic(fills);\n if (layout === 'P') return centredCross(fills);\n if (layout === 'D') return disc(fills);\n return stripes(fills, false);\n}\n","import React from 'react';\n\nimport Svg, { Circle, Polygon, Rect } from 'react-native-svg';\n\nimport { FLAG_EDGE } from './data/flagPalette';\nimport { FlagShapeKind } from './FlagShapeKind';\nimport { FLAG_HEIGHT, FLAG_WIDTH, flagShapes, type FlagShape } from './utils/flagShapes';\n\nconst EDGE_WIDTH = 0.5;\nconst EDGE_INSET = 0.25;\nconst HALF = 2;\nconst VIEW_BOX = `0 0 ${FLAG_WIDTH} ${FLAG_HEIGHT}`;\n\nfunction drawShape(shape: FlagShape, key: number): React.ReactElement {\n if (shape.kind === FlagShapeKind.Circle) return <Circle key={key} cx={shape.x} cy={shape.y} fill={shape.fill} r={shape.width / HALF} />;\n if (shape.kind === FlagShapeKind.Polygon) return <Polygon key={key} fill={shape.fill} points={shape.points} />;\n return <Rect key={key} fill={shape.fill} height={shape.height} width={shape.width} x={shape.x} y={shape.y} />;\n}\n\nexport interface CountryFlagProps {\n code: string;\n testID?: string;\n}\n\n/** A 20x14 drawn flag for a 2-letter country code; decorative, the country name carries the meaning. */\nexport function CountryFlag({ code, testID }: CountryFlagProps): React.ReactElement {\n return (\n <Svg accessibilityElementsHidden aria-hidden height={FLAG_HEIGHT} importantForAccessibility=\"no-hide-descendants\" testID={testID} viewBox={VIEW_BOX} width={FLAG_WIDTH}>\n {flagShapes(code).map((shape, index) => drawShape(shape, index))}\n <Rect fill=\"none\" height={FLAG_HEIGHT - EDGE_WIDTH} stroke={FLAG_EDGE} strokeWidth={EDGE_WIDTH} width={FLAG_WIDTH - EDGE_WIDTH} x={EDGE_INSET} y={EDGE_INSET} />\n </Svg>\n );\n}\n","import type { Country } from './country';\n\n/** ISO 3166-1 alpha-2 countries (249) with English short names. */\nexport const COUNTRIES: readonly Country[] = [\n { code: 'AF', name: 'Afghanistan' },\n { code: 'AX', name: 'Åland Islands' },\n { code: 'AL', name: 'Albania' },\n { code: 'DZ', name: 'Algeria' },\n { code: 'AS', name: 'American Samoa' },\n { code: 'AD', name: 'Andorra' },\n { code: 'AO', name: 'Angola' },\n { code: 'AI', name: 'Anguilla' },\n { code: 'AQ', name: 'Antarctica' },\n { code: 'AG', name: 'Antigua and Barbuda' },\n { code: 'AR', name: 'Argentina' },\n { code: 'AM', name: 'Armenia' },\n { code: 'AW', name: 'Aruba' },\n { code: 'AU', name: 'Australia' },\n { code: 'AT', name: 'Austria' },\n { code: 'AZ', name: 'Azerbaijan' },\n { code: 'BS', name: 'Bahamas' },\n { code: 'BH', name: 'Bahrain' },\n { code: 'BD', name: 'Bangladesh' },\n { code: 'BB', name: 'Barbados' },\n { code: 'BY', name: 'Belarus' },\n { code: 'BE', name: 'Belgium' },\n { code: 'BZ', name: 'Belize' },\n { code: 'BJ', name: 'Benin' },\n { code: 'BM', name: 'Bermuda' },\n { code: 'BT', name: 'Bhutan' },\n { code: 'BO', name: 'Bolivia' },\n { code: 'BQ', name: 'Bonaire, Sint Eustatius and Saba' },\n { code: 'BA', name: 'Bosnia and Herzegovina' },\n { code: 'BW', name: 'Botswana' },\n { code: 'BV', name: 'Bouvet Island' },\n { code: 'BR', name: 'Brazil' },\n { code: 'IO', name: 'British Indian Ocean Territory' },\n { code: 'BN', name: 'Brunei Darussalam' },\n { code: 'BG', name: 'Bulgaria' },\n { code: 'BF', name: 'Burkina Faso' },\n { code: 'BI', name: 'Burundi' },\n { code: 'CV', name: 'Cabo Verde' },\n { code: 'KH', name: 'Cambodia' },\n { code: 'CM', name: 'Cameroon' },\n { code: 'CA', name: 'Canada' },\n { code: 'KY', name: 'Cayman Islands' },\n { code: 'CF', name: 'Central African Republic' },\n { code: 'TD', name: 'Chad' },\n { code: 'CL', name: 'Chile' },\n { code: 'CN', name: 'China' },\n { code: 'CX', name: 'Christmas Island' },\n { code: 'CC', name: 'Cocos (Keeling) Islands' },\n { code: 'CO', name: 'Colombia' },\n { code: 'KM', name: 'Comoros' },\n { code: 'CG', name: 'Congo' },\n { code: 'CD', name: 'Congo (Democratic Republic)' },\n { code: 'CK', name: 'Cook Islands' },\n { code: 'CR', name: 'Costa Rica' },\n { code: 'CI', name: 'Côte d\\'Ivoire' },\n { code: 'HR', name: 'Croatia' },\n { code: 'CU', name: 'Cuba' },\n { code: 'CW', name: 'Curaçao' },\n { code: 'CY', name: 'Cyprus' },\n { code: 'CZ', name: 'Czechia' },\n { code: 'DK', name: 'Denmark' },\n { code: 'DJ', name: 'Djibouti' },\n { code: 'DM', name: 'Dominica' },\n { code: 'DO', name: 'Dominican Republic' },\n { code: 'EC', name: 'Ecuador' },\n { code: 'EG', name: 'Egypt' },\n { code: 'SV', name: 'El Salvador' },\n { code: 'GQ', name: 'Equatorial Guinea' },\n { code: 'ER', name: 'Eritrea' },\n { code: 'EE', name: 'Estonia' },\n { code: 'SZ', name: 'Eswatini' },\n { code: 'ET', name: 'Ethiopia' },\n { code: 'FK', name: 'Falkland Islands' },\n { code: 'FO', name: 'Faroe Islands' },\n { code: 'FJ', name: 'Fiji' },\n { code: 'FI', name: 'Finland' },\n { code: 'FR', name: 'France' },\n { code: 'GF', name: 'French Guiana' },\n { code: 'PF', name: 'French Polynesia' },\n { code: 'TF', name: 'French Southern Territories' },\n { code: 'GA', name: 'Gabon' },\n { code: 'GM', name: 'Gambia' },\n { code: 'GE', name: 'Georgia' },\n { code: 'DE', name: 'Germany' },\n { code: 'GH', name: 'Ghana' },\n { code: 'GI', name: 'Gibraltar' },\n { code: 'GR', name: 'Greece' },\n { code: 'GL', name: 'Greenland' },\n { code: 'GD', name: 'Grenada' },\n { code: 'GP', name: 'Guadeloupe' },\n { code: 'GU', name: 'Guam' },\n { code: 'GT', name: 'Guatemala' },\n { code: 'GG', name: 'Guernsey' },\n { code: 'GN', name: 'Guinea' },\n { code: 'GW', name: 'Guinea-Bissau' },\n { code: 'GY', name: 'Guyana' },\n { code: 'HT', name: 'Haiti' },\n { code: 'HM', name: 'Heard Island and McDonald Islands' },\n { code: 'VA', name: 'Holy See' },\n { code: 'HN', name: 'Honduras' },\n { code: 'HK', name: 'Hong Kong' },\n { code: 'HU', name: 'Hungary' },\n { code: 'IS', name: 'Iceland' },\n { code: 'IN', name: 'India' },\n { code: 'ID', name: 'Indonesia' },\n { code: 'IR', name: 'Iran' },\n { code: 'IQ', name: 'Iraq' },\n { code: 'IE', name: 'Ireland' },\n { code: 'IM', name: 'Isle of Man' },\n { code: 'IL', name: 'Israel' },\n { code: 'IT', name: 'Italy' },\n { code: 'JM', name: 'Jamaica' },\n { code: 'JP', name: 'Japan' },\n { code: 'JE', name: 'Jersey' },\n { code: 'JO', name: 'Jordan' },\n { code: 'KZ', name: 'Kazakhstan' },\n { code: 'KE', name: 'Kenya' },\n { code: 'KI', name: 'Kiribati' },\n { code: 'KP', name: 'Korea (North)' },\n { code: 'KR', name: 'Korea (South)' },\n { code: 'KW', name: 'Kuwait' },\n { code: 'KG', name: 'Kyrgyzstan' },\n { code: 'LA', name: 'Laos' },\n { code: 'LV', name: 'Latvia' },\n { code: 'LB', name: 'Lebanon' },\n { code: 'LS', name: 'Lesotho' },\n { code: 'LR', name: 'Liberia' },\n { code: 'LY', name: 'Libya' },\n { code: 'LI', name: 'Liechtenstein' },\n { code: 'LT', name: 'Lithuania' },\n { code: 'LU', name: 'Luxembourg' },\n { code: 'MO', name: 'Macao' },\n { code: 'MG', name: 'Madagascar' },\n { code: 'MW', name: 'Malawi' },\n { code: 'MY', name: 'Malaysia' },\n { code: 'MV', name: 'Maldives' },\n { code: 'ML', name: 'Mali' },\n { code: 'MT', name: 'Malta' },\n { code: 'MH', name: 'Marshall Islands' },\n { code: 'MQ', name: 'Martinique' },\n { code: 'MR', name: 'Mauritania' },\n { code: 'MU', name: 'Mauritius' },\n { code: 'YT', name: 'Mayotte' },\n { code: 'MX', name: 'Mexico' },\n { code: 'FM', name: 'Micronesia' },\n { code: 'MD', name: 'Moldova' },\n { code: 'MC', name: 'Monaco' },\n { code: 'MN', name: 'Mongolia' },\n { code: 'ME', name: 'Montenegro' },\n { code: 'MS', name: 'Montserrat' },\n { code: 'MA', name: 'Morocco' },\n { code: 'MZ', name: 'Mozambique' },\n { code: 'MM', name: 'Myanmar' },\n { code: 'NA', name: 'Namibia' },\n { code: 'NR', name: 'Nauru' },\n { code: 'NP', name: 'Nepal' },\n { code: 'NL', name: 'Netherlands' },\n { code: 'NC', name: 'New Caledonia' },\n { code: 'NZ', name: 'New Zealand' },\n { code: 'NI', name: 'Nicaragua' },\n { code: 'NE', name: 'Niger' },\n { code: 'NG', name: 'Nigeria' },\n { code: 'NU', name: 'Niue' },\n { code: 'NF', name: 'Norfolk Island' },\n { code: 'MK', name: 'North Macedonia' },\n { code: 'MP', name: 'Northern Mariana Islands' },\n { code: 'NO', name: 'Norway' },\n { code: 'OM', name: 'Oman' },\n { code: 'PK', name: 'Pakistan' },\n { code: 'PW', name: 'Palau' },\n { code: 'PS', name: 'Palestine' },\n { code: 'PA', name: 'Panama' },\n { code: 'PG', name: 'Papua New Guinea' },\n { code: 'PY', name: 'Paraguay' },\n { code: 'PE', name: 'Peru' },\n { code: 'PH', name: 'Philippines' },\n { code: 'PN', name: 'Pitcairn' },\n { code: 'PL', name: 'Poland' },\n { code: 'PT', name: 'Portugal' },\n { code: 'PR', name: 'Puerto Rico' },\n { code: 'QA', name: 'Qatar' },\n { code: 'RE', name: 'Réunion' },\n { code: 'RO', name: 'Romania' },\n { code: 'RU', name: 'Russian Federation' },\n { code: 'RW', name: 'Rwanda' },\n { code: 'BL', name: 'Saint Barthélemy' },\n { code: 'SH', name: 'Saint Helena, Ascension and Tristan da Cunha' },\n { code: 'KN', name: 'Saint Kitts and Nevis' },\n { code: 'LC', name: 'Saint Lucia' },\n { code: 'MF', name: 'Saint Martin (French part)' },\n { code: 'PM', name: 'Saint Pierre and Miquelon' },\n { code: 'VC', name: 'Saint Vincent and the Grenadines' },\n { code: 'WS', name: 'Samoa' },\n { code: 'SM', name: 'San Marino' },\n { code: 'ST', name: 'Sao Tome and Principe' },\n { code: 'SA', name: 'Saudi Arabia' },\n { code: 'SN', name: 'Senegal' },\n { code: 'RS', name: 'Serbia' },\n { code: 'SC', name: 'Seychelles' },\n { code: 'SL', name: 'Sierra Leone' },\n { code: 'SG', name: 'Singapore' },\n { code: 'SX', name: 'Sint Maarten (Dutch part)' },\n { code: 'SK', name: 'Slovakia' },\n { code: 'SI', name: 'Slovenia' },\n { code: 'SB', name: 'Solomon Islands' },\n { code: 'SO', name: 'Somalia' },\n { code: 'ZA', name: 'South Africa' },\n { code: 'GS', name: 'South Georgia and the South Sandwich Islands' },\n { code: 'SS', name: 'South Sudan' },\n { code: 'ES', name: 'Spain' },\n { code: 'LK', name: 'Sri Lanka' },\n { code: 'SD', name: 'Sudan' },\n { code: 'SR', name: 'Suriname' },\n { code: 'SJ', name: 'Svalbard and Jan Mayen' },\n { code: 'SE', name: 'Sweden' },\n { code: 'CH', name: 'Switzerland' },\n { code: 'SY', name: 'Syrian Arab Republic' },\n { code: 'TW', name: 'Taiwan' },\n { code: 'TJ', name: 'Tajikistan' },\n { code: 'TZ', name: 'Tanzania' },\n { code: 'TH', name: 'Thailand' },\n { code: 'TL', name: 'Timor-Leste' },\n { code: 'TG', name: 'Togo' },\n { code: 'TK', name: 'Tokelau' },\n { code: 'TO', name: 'Tonga' },\n { code: 'TT', name: 'Trinidad and Tobago' },\n { code: 'TN', name: 'Tunisia' },\n { code: 'TR', name: 'Türkiye' },\n { code: 'TM', name: 'Turkmenistan' },\n { code: 'TC', name: 'Turks and Caicos Islands' },\n { code: 'TV', name: 'Tuvalu' },\n { code: 'UG', name: 'Uganda' },\n { code: 'UA', name: 'Ukraine' },\n { code: 'AE', name: 'United Arab Emirates' },\n { code: 'GB', name: 'United Kingdom' },\n { code: 'US', name: 'United States' },\n { code: 'UM', name: 'United States Minor Outlying Islands' },\n { code: 'UY', name: 'Uruguay' },\n { code: 'UZ', name: 'Uzbekistan' },\n { code: 'VU', name: 'Vanuatu' },\n { code: 'VE', name: 'Venezuela' },\n { code: 'VN', name: 'Viet Nam' },\n { code: 'VG', name: 'Virgin Islands (British)' },\n { code: 'VI', name: 'Virgin Islands (U.S.)' },\n { code: 'WF', name: 'Wallis and Futuna' },\n { code: 'EH', name: 'Western Sahara' },\n { code: 'YE', name: 'Yemen' },\n { code: 'ZM', name: 'Zambia' },\n { code: 'ZW', name: 'Zimbabwe' },\n];\n","import type { ControlOption } from '../controls/controlTypes';\nimport { COUNTRIES } from './countriesData';\nimport type { Country } from './country';\n\nconst REGIONAL_INDICATOR_A = 0x1f1e6;\nconst CODE_A = 65;\nconst TWO_LETTERS = /^[A-Z]{2}$/;\nconst KNOWN_CODES = new Set(COUNTRIES.map((country) => country.code));\n\n/** Countries as select options: name as the label, the 2-letter code as value and detail. */\nexport function countryOptions(list: readonly Country[] = COUNTRIES): ControlOption[] {\n return list.map((country) => ({ label: country.name, value: country.code, detail: country.code }));\n}\n\nconst DEFAULT_OPTIONS = countryOptions();\nconst NO_COUNTRY = '';\n\n/** The country options, led by a \"no country\" choice (value '') when `noneLabel` is given. */\nexport function countryFieldOptions(countries?: readonly Country[], noneLabel?: string): readonly ControlOption[] {\n const list = countries === undefined ? DEFAULT_OPTIONS : countryOptions(countries);\n return noneLabel === undefined ? list : [{ label: noneLabel, value: NO_COUNTRY }, ...list];\n}\n\n/** The flag emoji for a 2-letter code, or '' for anything else. */\nexport function countryFlag(code: string): string {\n const upper = code.toUpperCase();\n if (!TWO_LETTERS.test(upper)) return '';\n return String.fromCodePoint(...Array.from(upper, (letter) => REGIONAL_INDICATOR_A + letter.charCodeAt(0) - CODE_A));\n}\n\n/** The stored value for an input: a known 2-letter code in upper case, else ''. */\nexport function toCountryValue(input: string): string {\n const upper = input.trim().toUpperCase();\n return KNOWN_CODES.has(upper) ? upper : '';\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { ControlOption } from '../controls/controlTypes';\nimport type { Country } from '../countries/country';\nimport { countryFieldOptions, toCountryValue } from '../countries/countryOptions';\nimport { CountryFlag } from '../CountryFlag/CountryFlag';\nimport { SearchSelect } from '../SearchSelect/SearchSelect';\nimport type { SearchSelectLabels } from '../SearchSelect/types';\n\nconst CODE_FONT = 12;\n\nexport interface CountryFieldProps {\n value: string;\n onChange: (code: string) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n labels: SearchSelectLabels;\n testID: string;\n countries?: readonly Country[];\n noneLabel?: string;\n onBlur?: () => void;\n}\n\nconst NO_COUNTRY = '';\n\nconst renderFlag = (option: ControlOption): React.ReactNode => (option.value === NO_COUNTRY ? null : <CountryFlag code={option.value} />);\n\n\n/** A searchable country field: flag, name and grey code; stores the ISO 3166-1 alpha-2 code, or '' for `noneLabel`; `onBlur` fires when focus leaves the closed field. */\nexport function CountryField({ value, onChange, accessibilityLabel, accessibilityHint, labels, testID, countries, noneLabel, onBlur }: CountryFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { textSecondary } = theme.colors;\n const options = useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);\n const renderCode = useCallback((option: ControlOption): React.ReactNode => <Text style={[styles.code, { color: textSecondary }]}>{option.detail}</Text>, [textSecondary]);\n return (\n <SearchSelect\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n labels={labels}\n options={options}\n recentKey=\"country\"\n renderDetail={renderCode}\n renderLeading={renderFlag}\n testID={testID}\n value={toCountryValue(value)}\n onBlur={onBlur}\n onChange={onChange}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n code: { fontSize: CODE_FONT },\n});\n","import { useCallback, useState } from 'react';\n\n/** A verdict that appears only when the field is left and clears on the next edit. */\nexport interface BlurVerdict<T> {\n verdict: T | null;\n onEdit: () => void;\n onLeave: () => T;\n}\n\n/** Runs `validate` on leave only, so an error never shows while typing. */\nexport function useBlurVerdict<T>(validate: () => T): BlurVerdict<T> {\n const [verdict, setVerdict] = useState<T | null>(null);\n const onEdit = useCallback(() => setVerdict(null), []);\n const onLeave = useCallback(() => {\n const next = validate();\n setVerdict(next);\n return next;\n }, [validate]);\n return { verdict, onEdit, onLeave };\n}\n","const IBAN_LENGTHS: Readonly<Record<string, number | undefined>> = {\n AD: 24, AE: 23, AL: 28, AT: 20, AZ: 28, BA: 20, BE: 16, BG: 22, BH: 22, BI: 27,\n BR: 29, BY: 28, CH: 21, CR: 22, CY: 28, CZ: 24, DE: 22, DJ: 27, DK: 18, DO: 28,\n EE: 20, EG: 29, ES: 24, FI: 18, FK: 18, FO: 18, FR: 27, GB: 22, GE: 22, GI: 23,\n GL: 18, GR: 27, GT: 28, HN: 28, HR: 21, HU: 28, IE: 22, IL: 23, IQ: 23, IS: 26,\n IT: 27, JO: 30, KW: 30, KZ: 20, LB: 28, LC: 32, LI: 21, LT: 20, LU: 20, LV: 21,\n LY: 25, MC: 27, MD: 24, ME: 22, MK: 19, MN: 20, MR: 27, MT: 31, MU: 30, NI: 28,\n NL: 18, NO: 15, OM: 23, PK: 24, PL: 28, PS: 29, PT: 25, QA: 29, RO: 24, RS: 22,\n RU: 33, SA: 24, SC: 31, SD: 18, SE: 24, SI: 19, SK: 24, SM: 27, SO: 23, ST: 25,\n SV: 28, TL: 23, TN: 24, TR: 26, UA: 29, VA: 22, VG: 24, XK: 20, YE: 30,\n};\n\n/** The longest IBAN ISO 13616 permits. */\nexport const IBAN_MAX_LENGTH = 34;\n\n/** How many countries the registry table covers. */\nexport const IBAN_REGISTERED_COUNTRY_COUNT = Object.keys(IBAN_LENGTHS).length;\n\n/** The registered IBAN length for an upper-case country code, or `null` when it is not registered. */\nexport function ibanLengthFor(country: string): number | null {\n return IBAN_LENGTHS[country] ?? null;\n}\n","import { IBAN_MAX_LENGTH, ibanLengthFor } from '../data/ibanCountryLengths';\n\nconst NOT_ALPHANUMERIC = /[^A-Za-z0-9]/g;\nconst COUNTRY_PREFIX = /^[A-Z]{2}/;\nconst COUNTRY_LENGTH = 2;\nconst BIC8_LENGTH = 8;\nconst BIC11_LENGTH = 11;\nconst BRANCH_LENGTH = 3;\nconst DEFAULT_GHOST = '0';\nconst DEFAULT_BIC_GHOST = 'X';\n\n/** What an IBAN field shows while typing: stored form, grouped display, counter and ghost tail. */\nexport interface IbanDraft {\n readonly electronic: string;\n readonly display: string;\n readonly country: string;\n readonly typed: number;\n readonly expected: number | null;\n readonly ghost: string;\n}\n\n/** What a BIC field shows while typing: stored form, the required ghost and the optional branch ghost. */\nexport interface BicDraft {\n readonly value: string;\n readonly ghost: string;\n readonly branchGhost: string;\n}\n\n/** Groups a string in blocks of four separated by single spaces. */\nexport function groupInFours(text: string): string {\n return text.replace(/(.{4})(?=.)/g, '$1 ');\n}\n\nfunction cleaned(raw: string): string {\n return raw.replace(NOT_ALPHANUMERIC, '').toUpperCase();\n}\n\n/** Upper-cases, strips separators, caps at the country length and groups an IBAN as typed. */\nexport function draftIban(raw: string, ghostChar: string = DEFAULT_GHOST): IbanDraft {\n const text = cleaned(raw);\n const country = COUNTRY_PREFIX.test(text) ? text.slice(0, COUNTRY_LENGTH) : '';\n const expected = country === '' ? null : ibanLengthFor(country);\n const electronic = text.slice(0, expected ?? IBAN_MAX_LENGTH);\n const display = groupInFours(electronic);\n const mask = expected === null ? '' : groupInFours(ghostChar.repeat(expected));\n return { electronic, display, country, typed: electronic.length, expected, ghost: mask.slice(display.length) };\n}\n\n/** The \"typed / expected\" counter, or `null` before the country is known. */\nexport function ibanCounter(draft: IbanDraft): string | null {\n return draft.expected === null ? null : `${draft.typed} / ${draft.expected}`;\n}\n\n/** Upper-cases and caps a BIC at 11, with ghosts for the required part and the optional branch. */\nexport function draftBic(raw: string, ghostChar: string = DEFAULT_BIC_GHOST): BicDraft {\n const value = cleaned(raw).slice(0, BIC11_LENGTH);\n const ghost = ghostChar.repeat(Math.max(0, BIC8_LENGTH - value.length));\n const branchLeft = value.length <= BIC8_LENGTH ? BRANCH_LENGTH : BIC11_LENGTH - value.length;\n return { value, ghost, branchGhost: ghostChar.repeat(branchLeft) };\n}\n","import { draftIban } from './ibanFormat';\n\nconst GROUP = 4;\nconst ALPHANUMERIC = /[A-Za-z0-9]/;\n\n/** Where the caret lands in the regrouped IBAN, given the caret position in the raw edited text. */\nexport function caretAfterEdit(raw: string, rawCaret: number): number {\n const kept = Array.from(raw.slice(0, rawCaret)).filter((char) => ALPHANUMERIC.test(char)).length;\n const characters = Math.min(kept, draftIban(raw).electronic.length);\n return characters === 0 ? 0 : characters + Math.floor((characters - 1) / GROUP);\n}\n\n/** The caret in the raw edited text, taking the edit to have happened at the previous caret. */\nexport function rawCaretAfterChange(previous: string, previousCaret: number, next: string): number {\n return Math.max(0, Math.min(next.length, previousCaret + next.length - previous.length));\n}\n","import { useCallback, useState } from 'react';\n\nimport type { NativeSyntheticEvent, TextInputSelectionChangeEventData } from 'react-native';\n\nimport { caretAfterEdit, rawCaretAfterChange } from '../utils/ibanCaret';\n\nexport interface IbanSelection {\n start: number;\n end: number;\n}\n\nexport interface IbanCaret {\n selection: IbanSelection;\n onSelectionChange: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;\n placeAfterEdit: (text: string) => void;\n}\n\n/** A controlled caret for the grouped IBAN text that survives the spaces added and removed while typing. */\nexport function useIbanCaret(display: string): IbanCaret {\n const [selection, setSelection] = useState<IbanSelection>({ start: display.length, end: display.length });\n\n const onSelectionChange = useCallback((event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n setSelection(event.nativeEvent.selection);\n }, []);\n\n const placeAfterEdit = useCallback((text: string) => {\n const caret = caretAfterEdit(text, rawCaretAfterChange(display, selection.end, text));\n setSelection({ start: caret, end: caret });\n }, [display, selection.end]);\n\n const clamped = { start: Math.min(selection.start, display.length), end: Math.min(selection.end, display.length) };\n return { selection: clamped, onSelectionChange, placeAfterEdit };\n}\n","import { StyleSheet } from 'react-native';\n\nconst FONT_SIZE = 14;\nconst LINE_HEIGHT = 20;\nconst COUNTER_FONT = 12;\nconst BRANCH_OPACITY = 0.5;\nconst GAP = 8;\nconst INPUT_PAD_V = 13;\n\nexport const ghostStyles = StyleSheet.create({\n field: { flex: 1, justifyContent: 'center', minHeight: LINE_HEIGHT },\n mono: { fontFamily: 'monospace', fontSize: FONT_SIZE, lineHeight: LINE_HEIGHT },\n layer: { position: 'absolute', left: 0, top: INPUT_PAD_V, bottom: INPUT_PAD_V },\n hidden: { opacity: 0 },\n branch: { opacity: BRANCH_OPACITY },\n input: { padding: 0, paddingVertical: INPUT_PAD_V, borderWidth: 0, minHeight: LINE_HEIGHT },\n trigger: { paddingVertical: 0 },\n counter: { fontSize: COUNTER_FONT, marginLeft: GAP },\n});\n","/** Why an IBAN was refused; member names match `Finreg.Core.Banking.IbanRejection`. */\nexport enum IbanRejection {\n None = 'None',\n Missing = 'Missing',\n IllegalCharacter = 'IllegalCharacter',\n MalformedCountryCode = 'MalformedCountryCode',\n MalformedCheckDigits = 'MalformedCheckDigits',\n UnknownCountry = 'UnknownCountry',\n WrongLengthForCountry = 'WrongLengthForCountry',\n ChecksumFailed = 'ChecksumFailed',\n}\n","import { IbanRejection } from '../data/IbanRejection';\nimport { ibanLengthFor } from '../data/ibanCountryLengths';\n\nconst COUNTRY_LENGTH = 2;\nconst PREFIX_LENGTH = 4;\nconst MODULUS = 97;\nconst VALID_REMAINDER = 1;\nconst LETTER_OFFSET = 10;\nconst DIGIT_SHIFT = 10;\nconst LETTER_SHIFT = 100;\nconst CODE_A = 65;\nconst CODE_0 = 48;\nconst LETTER = /^[A-Za-z]$/;\nconst DIGIT = /^[0-9]$/;\n\n/** The outcome of validating one IBAN; `electronic` (upper case, no spaces) is set only when valid. */\nexport interface IbanVerdict {\n readonly rejection: IbanRejection;\n readonly electronic: string | null;\n readonly expectedLength: number | null;\n}\n\nfunction refused(rejection: IbanRejection, expectedLength: number | null = null): IbanVerdict {\n return { rejection, electronic: null, expectedLength };\n}\n\nfunction stripSeparators(raw: string): string | null {\n let out = '';\n for (const character of raw) {\n if (character === ' ') continue;\n if (!LETTER.test(character) && !DIGIT.test(character)) return null;\n out += character.toUpperCase();\n }\n return out === '' ? null : out;\n}\n\nfunction shapeFailure(iban: string): IbanVerdict | null {\n if (iban.length <= PREFIX_LENGTH) return refused(IbanRejection.MalformedCountryCode);\n if (!LETTER.test(iban.charAt(0)) || !LETTER.test(iban.charAt(1))) return refused(IbanRejection.MalformedCountryCode);\n if (!DIGIT.test(iban.charAt(2)) || !DIGIT.test(iban.charAt(3))) return refused(IbanRejection.MalformedCheckDigits);\n const expected = ibanLengthFor(iban.slice(0, COUNTRY_LENGTH));\n if (expected === null) return refused(IbanRejection.UnknownCountry);\n return iban.length === expected ? null : refused(IbanRejection.WrongLengthForCountry, expected);\n}\n\nfunction mod97(iban: string): number {\n let remainder = 0;\n for (let index = 0; index < iban.length; index++) {\n const character = iban.charAt((index + PREFIX_LENGTH) % iban.length);\n const code = character.charCodeAt(0);\n remainder = DIGIT.test(character)\n ? remainder * DIGIT_SHIFT + (code - CODE_0)\n : remainder * LETTER_SHIFT + (code - CODE_A + LETTER_OFFSET);\n remainder %= MODULUS;\n }\n return remainder;\n}\n\n/** Validates an IBAN with the same rules as `Finreg.Core.Banking.Iban.Validate`. */\nexport function validateIban(raw: string | null | undefined): IbanVerdict {\n if (raw === null || raw === undefined || raw.trim() === '') return refused(IbanRejection.Missing);\n const normalised = stripSeparators(raw);\n if (normalised === null) return refused(IbanRejection.IllegalCharacter);\n const failure = shapeFailure(normalised);\n if (failure !== null) return failure;\n if (mod97(normalised) !== VALID_REMAINDER) return refused(IbanRejection.ChecksumFailed);\n return { rejection: IbanRejection.None, electronic: normalised, expectedLength: null };\n}\n","import React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../../fieldErrorInk/fieldErrorInk';\n\nconst LINE_GAP = 4;\n\nexport interface RejectionLineProps {\n message: string | null;\n testID: string;\n}\n\n/** The localized refusal under a bank field, announced politely, or nothing when there is none. */\nexport function RejectionLine({ message, testID }: RejectionLineProps): React.ReactElement | null {\n const { theme } = useUi();\n if (message === null) return null;\n return <Text accessibilityLiveRegion=\"polite\" style={[styles.line, { color: fieldErrorInk(theme) }]} testID={`${testID}-rejection`}>{message}</Text>;\n}\n\nconst styles = StyleSheet.create({\n line: { marginTop: LINE_GAP },\n});\n","/** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */\nexport function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null {\n if (labels === undefined || rejection === null || rejection === none) return null;\n return labels[rejection as Exclude<R, N>];\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { useBlurVerdict } from './hooks/useBlurVerdict';\nimport { useIbanCaret } from './hooks/useIbanCaret';\nimport { ghostStyles as g } from './utils/ghostStyles';\nimport { validateIban, type IbanVerdict } from './utils/iban';\nimport { RejectionLine } from './components/RejectionLine';\nimport { IbanRejection } from './data/IbanRejection';\nimport type { IbanRejectionLabels } from './types';\nimport { rejectionMessage } from './utils/rejectionMessage';\nimport { draftIban, ibanCounter } from './utils/ibanFormat';\n\nexport interface IbanInputProps {\n value: string;\n onChange: (electronic: string) => void;\n onVerdict?: (verdict: IbanVerdict | null) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n onBlur?: () => void;\n rejectionLabels?: IbanRejectionLabels;\n placeholder?: string;\n}\n\n/** An IBAN box that groups in fours as you type, stores no spaces and validates on leave. */\nexport function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }: IbanInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const draft = useMemo(() => draftIban(value), [value]);\n const validate = useCallback(() => validateIban(value), [value]);\n const { verdict, onEdit, onLeave } = useBlurVerdict(validate);\n const message = value === '' ? null : rejectionMessage(verdict?.rejection ?? null, IbanRejection.None, rejectionLabels);\n const counter = ibanCounter(draft);\n const { selection, onSelectionChange, placeAfterEdit } = useIbanCaret(draft.display);\n\n const onChangeText = useCallback((text: string) => {\n onEdit();\n onVerdict?.(null);\n placeAfterEdit(text);\n onChange(draftIban(text).electronic);\n }, [onEdit, onVerdict, placeAfterEdit, onChange]);\n\n const onBlur = useCallback(() => {\n const verdict = onLeave();\n onVerdict?.(value === '' ? null : verdict);\n onLeft?.();\n }, [onLeave, onVerdict, value, onLeft]);\n\n return (\n <View>\n <View style={[s.selectTrigger, g.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}>\n <View style={g.field}>\n <Text aria-hidden style={[g.mono, g.layer]}>\n <Text style={g.hidden}>{draft.display}</Text>\n <Text style={{ color: colors.textSecondary }}>{draft.ghost}</Text>\n </Text>\n <TextInput\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n autoCapitalize=\"characters\"\n autoComplete=\"off\"\n autoCorrect={false}\n placeholder={draft.display === '' ? placeholder : undefined}\n placeholderTextColor={colors.textSecondary}\n selection={selection}\n spellCheck={false}\n style={[g.mono, g.input, { color: colors.text }]}\n testID={testID}\n value={draft.display}\n onBlur={onBlur}\n onChangeText={onChangeText}\n onSelectionChange={onSelectionChange}\n />\n </View>\n {counter !== null ? <Text testID={`${testID}-counter`} style={[g.counter, { color: colors.textSecondary }]}>{counter}</Text> : null}\n </View>\n <RejectionLine message={message} testID={testID} />\n </View>\n );\n}\n","/** Why a BIC was refused; member names match `Finreg.Core.Banking.BicRejection`. */\nexport enum BicRejection {\n None = 'None',\n Missing = 'Missing',\n IllegalCharacter = 'IllegalCharacter',\n WrongLength = 'WrongLength',\n MalformedInstitution = 'MalformedInstitution',\n MalformedCountry = 'MalformedCountry',\n MalformedLocation = 'MalformedLocation',\n}\n","import { BicRejection } from '../data/BicRejection';\n\nconst BIC8_LENGTH = 8;\nconst BIC11_LENGTH = 11;\nconst COUNTRY_START = 4;\nconst LOCATION_INDEX = 6;\nconst ALPHANUMERIC = /^[A-Za-z0-9]*$/;\nconst INSTITUTION = /^[A-Z]{4}/;\nconst COUNTRY = /^[A-Z]{2}$/;\nconst RESERVED_LOCATION = ['0', '1'];\n\n/** The outcome of validating one BIC; `electronic` (upper case, trimmed) is set only when valid. */\nexport interface BicVerdict {\n readonly rejection: BicRejection;\n readonly electronic: string | null;\n}\n\nconst refused = (rejection: BicRejection): BicVerdict => ({ rejection, electronic: null });\n\n/** Validates a BIC with the same rules as `Finreg.Core.Banking.Bic.Validate`. */\nexport function validateBic(raw: string | null | undefined): BicVerdict {\n if (raw === null || raw === undefined || raw.trim() === '') return refused(BicRejection.Missing);\n const trimmed = raw.trim();\n if (!ALPHANUMERIC.test(trimmed)) return refused(BicRejection.IllegalCharacter);\n const bic = trimmed.toUpperCase();\n if (bic.length !== BIC8_LENGTH && bic.length !== BIC11_LENGTH) return refused(BicRejection.WrongLength);\n if (!INSTITUTION.test(bic)) return refused(BicRejection.MalformedInstitution);\n if (!COUNTRY.test(bic.slice(COUNTRY_START, LOCATION_INDEX))) return refused(BicRejection.MalformedCountry);\n if (RESERVED_LOCATION.includes(bic.charAt(LOCATION_INDEX))) return refused(BicRejection.MalformedLocation);\n return { rejection: BicRejection.None, electronic: bic };\n}\n","import React, { useCallback, useMemo } from 'react';\n\nimport { Text, TextInput, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { controlStyles as s } from '../controls/controlStyles';\nimport { useBlurVerdict } from './hooks/useBlurVerdict';\nimport { validateBic, type BicVerdict } from './utils/bic';\nimport { RejectionLine } from './components/RejectionLine';\nimport { BicRejection } from './data/BicRejection';\nimport type { BicRejectionLabels } from './types';\nimport { rejectionMessage } from './utils/rejectionMessage';\nimport { ghostStyles as g } from './utils/ghostStyles';\nimport { draftBic } from './utils/ibanFormat';\n\nexport interface BicInputProps {\n value: string;\n onChange: (bic: string) => void;\n onVerdict?: (verdict: BicVerdict | null) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n onBlur?: () => void;\n rejectionLabels?: BicRejectionLabels;\n placeholder?: string;\n}\n\n/** A BIC box that upper-cases as you type, ghosts the optional branch and validates on leave. */\nexport function BicInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }: BicInputProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const draft = useMemo(() => draftBic(value), [value]);\n const validate = useCallback(() => validateBic(value), [value]);\n const { verdict, onEdit, onLeave } = useBlurVerdict(validate);\n const message = value === '' ? null : rejectionMessage(verdict?.rejection ?? null, BicRejection.None, rejectionLabels);\n\n const onChangeText = useCallback((text: string) => {\n onEdit();\n onVerdict?.(null);\n onChange(draftBic(text).value);\n }, [onEdit, onVerdict, onChange]);\n\n const onBlur = useCallback(() => {\n const verdict = onLeave();\n onVerdict?.(value === '' ? null : verdict);\n onLeft?.();\n }, [onLeave, onVerdict, value, onLeft]);\n\n return (\n <View>\n <View style={[s.selectTrigger, g.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }]}>\n <View style={g.field}>\n <Text aria-hidden style={[g.mono, g.layer]}>\n <Text style={g.hidden}>{draft.value}</Text>\n <Text style={{ color: colors.textSecondary }}>{draft.ghost}</Text>\n <Text style={[g.branch, { color: colors.textSecondary }]}>{draft.branchGhost}</Text>\n </Text>\n <TextInput\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n autoCapitalize=\"characters\"\n autoComplete=\"off\"\n autoCorrect={false}\n placeholder={draft.value === '' ? placeholder : undefined}\n placeholderTextColor={colors.textSecondary}\n spellCheck={false}\n style={[g.mono, g.input, { color: colors.text }]}\n testID={testID}\n value={draft.value}\n onBlur={onBlur}\n onChangeText={onChangeText}\n />\n </View>\n </View>\n <RejectionLine message={message} testID={testID} />\n </View>\n );\n}\n","import React from 'react';\n\nimport { Platform, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst BAR_GAP = 8;\nconst PAD_V = 10;\nconst PAD_H = 16;\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },\n actions: { flexDirection: 'row', flexWrap: 'wrap', gap: BAR_GAP },\n message: { fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\ntype ActionBarPosition = 'sticky' | 'relative';\n\nconst PINNED = { position: 'sticky', bottom: 0, zIndex: 1 } as unknown as ViewStyle;\n\n/** Where the bar sits: pinned to the bottom of its scroll area on web when sticky, in flow otherwise. */\nexport const actionBarPosition = (sticky: boolean, os: string): ActionBarPosition => (sticky && os === 'web' ? 'sticky' : 'relative');\n\nexport interface ActionBarProps {\n children: React.ReactNode;\n message?: string;\n sticky?: boolean;\n testID: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** A bar of action buttons with an optional status line, pinned to the bottom edge when sticky. */\nexport const ActionBar = ({ children, message, sticky = false, testID, style }: ActionBarProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const pinned = actionBarPosition(sticky, Platform.OS) === 'sticky' ? PINNED : null;\n const hasMessage = message !== undefined && message !== '';\n\n return (\n <View style={[styles.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style]} testID={testID}>\n {hasMessage ? (\n <Text role=\"status\" style={[styles.message, { color: colors.text }]} testID={`${testID}-message`}>\n {message}\n </Text>\n ) : null}\n <View style={styles.actions}>{children}</View>\n </View>\n );\n};\n","export interface ChecklistItem {\n id: string;\n label: string;\n description?: string;\n}\n\n/** True when every item's id is checked; an empty list is complete. */\nexport const isChecklistComplete = (items: readonly ChecklistItem[], checked: readonly string[]): boolean =>\n items.every((item) => checked.includes(item.id));\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FormCheckbox } from '../FormCheckbox/FormCheckbox';\n\nimport { isChecklistComplete, type ChecklistItem } from './isChecklistComplete';\n\nconst TITLE_SIZE = 13;\nconst TITLE_GAP = 6;\n\nconst styles = StyleSheet.create({\n title: { fontSize: TITLE_SIZE, fontWeight: '700', marginBottom: TITLE_GAP },\n});\n\nexport interface GatedChecklistProps {\n title: string;\n items: readonly ChecklistItem[];\n checked: readonly string[];\n onToggle: (id: string) => void;\n testID: string;\n disabled?: boolean;\n children?: (complete: boolean) => React.ReactNode;\n}\n\n/** A checklist that tells its `children` slot whether every item is ticked, so the slot can gate its action. */\nexport const GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }: GatedChecklistProps): React.ReactElement => {\n const { theme } = useUi();\n const complete = isChecklistComplete(items, checked);\n\n return (\n <View testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.title, { color: theme.colors.text }]}>\n {title}\n </Text>\n {items.map((item) => (\n <FormCheckbox\n key={item.id}\n description={item.description}\n disabled={disabled}\n label={item.label}\n testID={`${testID}-item-${item.id}`}\n value={checked.includes(item.id)}\n onValueChange={() => onToggle(item.id)}\n />\n ))}\n {children?.(complete)}\n </View>\n );\n};\n","import React from 'react';\n\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type { ChipColors } from '../../ChipSelector/types';\nimport type { RadioOption } from '../types';\nimport type { RadioRowIdentity } from '../utils/radioRowIdentity';\n\nconst MIN_TARGET_PX = 44;\nconst DOT_SIZE = 18;\nconst DOT_INNER = 8;\nconst ROW_GAP = 10;\nconst PAD_H = 12;\nconst PAD_V = 8;\nconst RADIUS = 8;\nconst LABEL_SIZE = 14;\nconst DESCRIPTION_SIZE = 12;\nconst DESCRIPTION_LINE = 16;\n\nconst styles = StyleSheet.create({\n row: {\n alignItems: 'center',\n borderRadius: RADIUS,\n borderWidth: 1,\n columnGap: ROW_GAP,\n flexDirection: 'row',\n minHeight: MIN_TARGET_PX,\n paddingHorizontal: PAD_H,\n paddingVertical: PAD_V,\n },\n dot: { alignItems: 'center', borderRadius: DOT_SIZE / 2, borderWidth: 2, height: DOT_SIZE, justifyContent: 'center', width: DOT_SIZE },\n dotInner: { borderRadius: DOT_INNER / 2, height: DOT_INNER, width: DOT_INNER },\n text: { flex: 1, flexShrink: 1 },\n label: { fontSize: LABEL_SIZE, fontWeight: '600' },\n description: { fontSize: DESCRIPTION_SIZE, lineHeight: DESCRIPTION_LINE },\n});\n\nexport interface RadioRowProps<T> {\n option: RadioOption<T>;\n identity: RadioRowIdentity;\n colors: ChipColors;\n tabIndex?: 0 | -1;\n hostRef: (node: unknown) => void;\n onPress: () => void;\n}\n\n/** One full-width radio row: a dot, the option label and an optional description under it. */\nexport function RadioRow<T>({ option, identity, colors, tabIndex, hostRef, onPress }: RadioRowProps<T>): React.ReactElement {\n const { checked, disabled } = identity.accessibilityState;\n const accent = checked ? colors.primary : colors.border;\n const hasDescription = option.description !== undefined && option.description !== '';\n\n return (\n <Pressable\n ref={hostRef}\n accessibilityHint={option.hint}\n accessibilityLabel={identity.accessibilityLabel}\n accessibilityRole=\"radio\"\n accessibilityState={identity.accessibilityState}\n aria-checked={checked}\n disabled={disabled}\n style={[styles.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }]}\n tabIndex={tabIndex}\n testID={identity.testID}\n onPress={onPress}\n >\n <View style={[styles.dot, { borderColor: accent }]}>\n {checked ? <View style={[styles.dotInner, { backgroundColor: colors.primary }]} /> : null}\n </View>\n <View style={styles.text}>\n <Text style={[styles.label, { color: checked ? colors.primary : colors.textStrong }]}>{option.label}</Text>\n {hasDescription ? (\n <Text style={[styles.description, { color: colors.textMuted }]} testID={`${identity.testID}-description`}>\n {option.description}\n </Text>\n ) : null}\n </View>\n </Pressable>\n );\n}\n","import type { RadioOption } from '../types';\n\nexport interface RadioRowIdentity {\n testID: string;\n accessibilityLabel: string;\n accessibilityState: { checked: boolean; selected: boolean; disabled: boolean };\n}\n\n/** The testID, accessible name (label, then description) and native radio state of one row. */\nexport const radioRowIdentity = <T>(option: RadioOption<T>, selected: boolean, disabled: boolean, prefix: string): RadioRowIdentity => {\n const hasDescription = option.description !== undefined && option.description !== '';\n return {\n testID: `${prefix}-${String(option.value)}`,\n accessibilityLabel: hasDescription ? `${option.label}, ${String(option.description)}` : option.label,\n accessibilityState: { checked: selected, selected, disabled },\n };\n};\n","import React from 'react';\n\nimport { StyleSheet, View, type ViewProps } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useRadioKeyboard } from '../ChipSelector/hooks/useRadioKeyboard';\nimport { buildChipColors } from '../ChipSelector/utils/chipColors';\nimport { Field } from '../Field/Field';\nimport { webFieldA11y } from '../webFieldA11y/webFieldA11y';\n\nimport { RadioRow } from './components/RadioRow';\nimport type { RadioListProps } from './types';\nimport { radioRowIdentity } from './utils/radioRowIdentity';\n\nconst ROW_GAP = 8;\n\nconst styles = StyleSheet.create({\n list: { rowGap: ROW_GAP },\n});\n\n/** A vertical radio group of labelled rows with descriptions; arrow keys move the choice. */\nexport function RadioList<T extends string | number>(props: RadioListProps<T>): React.ReactElement {\n const { options, value, onChange, optionTestIDPrefix, label, error, required = false, disabled = false, testID } = props;\n const { theme } = useUi();\n const colors = React.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);\n const selectedIndex = options.findIndex((option) => option.value === value);\n const radio = useRadioKeyboard({ enabled: true, disabled, values: options.map((option) => option.value), selectedIndex, onChange });\n\n return (\n <Field error={error} label={label} required={required} testID={testID}>\n {({ describedById, hasError }) => (\n <View\n accessibilityRole=\"radiogroup\"\n style={styles.list}\n {...(webFieldA11y({ describedById, hasError }) as ViewProps)}\n {...radio.groupProps}\n >\n {options.map((option, index) => (\n <RadioRow\n key={String(option.value)}\n colors={colors}\n hostRef={radio.chipRef(index)}\n identity={radioRowIdentity(option, index === selectedIndex, disabled, optionTestIDPrefix)}\n option={option}\n tabIndex={radio.tabIndexFor(index)}\n onPress={() => onChange(option.value)}\n />\n ))}\n </View>\n )}\n </Field>\n );\n}\n","import { isWideFormLayout } from '../../ResponsiveFormLayout/isWideFormLayout';\nimport type { DecisionError, DecisionOutcome, DecisionPanelVariant, DecisionTone } from '../types';\n\ntype OutcomeButtonVariant = 'primary' | 'secondary' | 'danger';\n\n/** The first reason the chosen outcome and note cannot be submitted, or null when they can. */\nexport const validateDecision = <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, outcome: string, note: string): DecisionError | null => {\n const chosen = outcomes.find((item) => item.value === outcome);\n if (chosen === undefined) return 'choose';\n const noteMissing = chosen.noteRequired === true && note.trim() === '';\n return noteMissing ? 'note' : null;\n};\n\n/** The default variant for a viewport width: choose-then-submit on phones, the sticky bar at the shared wide breakpoint. */\nexport const defaultDecisionVariant = (width: number): DecisionPanelVariant => (isWideFormLayout(width) ? 'sticky-bar' : 'choose-then-submit');\n\n/** The outcomes with the lead one first; the rest keep their order. */\nexport const leadFirst = <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined): Array<DecisionOutcome<T>> => [\n ...outcomes.filter((item) => item.value === lead),\n ...outcomes.filter((item) => item.value !== lead),\n];\n\n/** The button variant an outcome tone renders as. */\nexport const toneVariant = (tone: DecisionTone | undefined): OutcomeButtonVariant => {\n if (tone === 'primary') return 'primary';\n return tone === 'danger' ? 'danger' : 'secondary';\n};\n","import React from 'react';\n\nimport { FormField } from '../../FormField/FormField';\nimport type { DecisionVariantProps } from './variantProps';\n\nconst NOTE_LINES = 3;\n\n/** The decision note: multi-line (Enter adds a line), showing the note-required refusal. */\nexport function DecisionNote<T extends string>({ state, labels, testID, disabled }: DecisionVariantProps<T>): React.ReactElement {\n const error = state.error === 'note' ? labels.noteRequiredError : undefined;\n return (\n <FormField\n multiline\n editable={!disabled}\n error={error}\n label={labels.note}\n numberOfLines={NOTE_LINES}\n placeholder={labels.notePlaceholder}\n testID={`${testID}-note`}\n value={state.note}\n onChangeText={state.setNote}\n />\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { toneVariant } from '../utils/decisionRules';\nimport type { DecisionOutcome } from '../types';\n\nconst BUTTON_BASIS = '40%';\n\nconst styles = StyleSheet.create({\n cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 },\n});\n\nexport interface OutcomeButtonsProps<T extends string> {\n outcomes: ReadonlyArray<DecisionOutcome<T>>;\n pending: T | null;\n disabled: boolean;\n testID: string;\n onPress: (outcome: T) => Promise<void>;\n}\n\n/** One button per outcome; the one being submitted shows the shared loading state. */\nexport function OutcomeButtons<T extends string>({ outcomes, pending, disabled, testID, onPress }: OutcomeButtonsProps<T>): React.ReactElement {\n return (\n <>\n {outcomes.map((item) => (\n <View key={item.value} style={styles.cell}>\n <Button\n fullWidth\n accessibilityHint={item.hint}\n accessibilityLabel={item.label}\n disabled={disabled || (pending !== null && pending !== item.value)}\n label={item.label}\n loading={pending === item.value}\n testID={`${testID}-action-${item.value}`}\n variant={toneVariant(item.tone)}\n onPress={() => onPress(item.value)}\n />\n </View>\n ))}\n </>\n );\n}\n","import React from 'react';\n\nimport { ChipSelector } from '../../ChipSelector/ChipSelector';\nimport { ActionBar } from '../../FixBar/ActionBar';\nimport { leadFirst } from '../utils/decisionRules';\nimport type { DecisionOutcome } from '../types';\n\nimport { DecisionNote } from './DecisionNote';\nimport { OutcomeButtons } from './OutcomeButtons';\nimport type { DecisionVariantProps } from './variantProps';\n\nconst retone = <T extends string>(item: DecisionOutcome<T>, lead: T | undefined): DecisionOutcome<T> => {\n if (item.value === lead) return { ...item, tone: 'primary' };\n return item.tone === 'primary' ? { ...item, tone: 'neutral' } : item;\n};\n\n/** The failed checks become reason chips for the note, and the lead outcome comes first. */\nexport function ChecksDriveDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled, reasons = [], leadOutcome } = props;\n const ordered = leadFirst(outcomes, leadOutcome).map((item) => retone(item, leadOutcome));\n return (\n <>\n {reasons.length > 0 ? (\n <ChipSelector\n multiple\n chipTestIDPrefix={`${testID}-reason`}\n disabled={disabled}\n label={labels.reasons}\n options={reasons}\n testID={`${testID}-reasons`}\n value={state.reasons}\n variant=\"outline\"\n onChange={state.toggleReason}\n />\n ) : null}\n <DecisionNote {...props} />\n <ActionBar message={labels.message} testID={`${testID}-bar`}>\n <OutcomeButtons disabled={disabled} outcomes={ordered} pending={state.pending} testID={testID} onPress={state.submit} />\n </ActionBar>\n </>\n );\n}\n","import React from 'react';\n\nimport { Button } from '@dloizides/ui-buttons';\n\nimport { RadioList } from '../../RadioList/RadioList';\n\nimport { DecisionNote } from './DecisionNote';\nimport type { DecisionVariantProps } from './variantProps';\n\n/** Labelled choices with what each does, one note, one Submit: no outcome lands on one tap. */\nexport function ChooseThenSubmitDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled } = props;\n return (\n <>\n <RadioList\n disabled={disabled}\n error={state.error === 'choose' ? labels.chooseError : undefined}\n optionTestIDPrefix={`${testID}-outcome`}\n options={outcomes}\n testID={`${testID}-outcomes`}\n value={state.outcome === '' ? undefined : state.outcome}\n onChange={state.choose}\n />\n <DecisionNote {...props} />\n <Button\n fullWidth\n accessibilityHint={labels.submitHint}\n accessibilityLabel={labels.submit}\n disabled={disabled}\n label={labels.submit}\n loading={state.pending !== null}\n testID={`${testID}-submit`}\n onPress={() => state.submit()}\n />\n </>\n );\n}\n","import React from 'react';\n\nimport { ActionBar } from '../../FixBar/ActionBar';\n\nimport { DecisionNote } from './DecisionNote';\nimport { OutcomeButtons } from './OutcomeButtons';\nimport type { DecisionVariantProps } from './variantProps';\n\n/** Note in the page, every outcome a button in a bar pinned under the thumb. */\nexport function StickyBarDecision<T extends string>(props: DecisionVariantProps<T>): React.ReactElement {\n const { state, outcomes, labels, testID, disabled } = props;\n return (\n <>\n <DecisionNote {...props} />\n <ActionBar sticky message={labels.message} testID={`${testID}-bar`}>\n <OutcomeButtons disabled={disabled} outcomes={outcomes} pending={state.pending} testID={testID} onPress={state.submit} />\n </ActionBar>\n </>\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldErrorInk } from '../../fieldErrorInk/fieldErrorInk';\n\nconst TEXT_SIZE = 13;\nconst TEXT_LINE = 18;\n\nconst styles = StyleSheet.create({\n text: { fontSize: TEXT_SIZE, fontWeight: '700', lineHeight: TEXT_LINE },\n});\n\n/** The alert shown when the decision could not be sent. */\nexport const SubmitError = ({ message, testID }: { message: string; testID: string }): React.ReactElement => {\n const { theme } = useUi();\n return (\n <Text role=\"alert\" style={[styles.text, { color: fieldErrorInk(theme) }]} testID={testID}>\n {message}\n </Text>\n );\n};\n","import React from 'react';\n\nimport { validateDecision } from '../utils/decisionRules';\nimport type { DecisionError, DecisionOutcome, DecisionSubmission } from '../types';\n\nexport interface DecisionPanelState<T extends string> {\n outcome: T | '';\n note: string;\n reasons: string[];\n checked: string[];\n error: DecisionError | null;\n pending: T | null;\n choose: (outcome: T) => void;\n setNote: (note: string) => void;\n toggleReason: (reason: string) => void;\n toggleCheck: (id: string) => void;\n submit: (override?: T) => Promise<void>;\n}\n\nconst toggle = (list: string[], id: string): string[] => (list.includes(id) ? list.filter((item) => item !== id) : [...list, id]);\n\n/** The decision panel's state: chosen outcome, note, reasons, checklist ticks, the refusal and the submit in flight. */\nexport function useDecisionPanel<T extends string>(\n outcomes: ReadonlyArray<DecisionOutcome<T>>,\n onSubmit: (submission: DecisionSubmission<T>) => void | Promise<unknown>,\n): DecisionPanelState<T> {\n const [outcome, setOutcome] = React.useState<T | ''>('');\n const [note, setNote] = React.useState('');\n const [reasons, setReasons] = React.useState<string[]>([]);\n const [checked, setChecked] = React.useState<string[]>([]);\n const [error, setError] = React.useState<DecisionError | null>(null);\n const [pending, setPending] = React.useState<T | null>(null);\n\n const submit = async (override?: T): Promise<void> => {\n const target = override ?? outcome;\n const problem = validateDecision(outcomes, target, note);\n setError(problem);\n if (problem !== null || target === '') return;\n setPending(target);\n try {\n await onSubmit({ outcome: target, note, reasons });\n } catch {\n setError('submit');\n } finally {\n setPending(null);\n }\n };\n\n return {\n outcome,\n note,\n reasons,\n checked,\n error,\n pending,\n choose: (next: T): void => {\n setOutcome(next);\n setError(null);\n },\n setNote,\n toggleReason: (reason: string): void => setReasons((list) => toggle(list, reason)),\n toggleCheck: (id: string): void => setChecked((list) => toggle(list, id)),\n submit,\n };\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { GatedChecklist } from '../GatedChecklist/GatedChecklist';\n\nimport { ChecksDriveDecision } from './components/ChecksDriveDecision';\nimport { ChooseThenSubmitDecision } from './components/ChooseThenSubmitDecision';\nimport { StickyBarDecision } from './components/StickyBarDecision';\nimport { SubmitError } from './components/SubmitError';\nimport type { DecisionVariantProps } from './components/variantProps';\nimport { useDecisionPanel } from './hooks/useDecisionPanel';\nimport type { DecisionPanelProps, DecisionPanelVariant } from './types';\n\nconst TITLE_SIZE = 15;\nconst PANEL_GAP = 12;\n\nconst styles = StyleSheet.create({\n panel: { rowGap: PANEL_GAP },\n title: { fontSize: TITLE_SIZE, fontWeight: '700' },\n});\n\nfunction renderVariant<T extends string>(variant: DecisionPanelVariant, props: DecisionVariantProps<T>): React.ReactElement {\n if (variant === 'sticky-bar') return <StickyBarDecision {...props} />;\n if (variant === 'checks-drive') return <ChecksDriveDecision {...props} />;\n return <ChooseThenSubmitDecision {...props} />;\n}\n\n/** A decision control in one of three layouts; outcomes, labels and note rules come in as config. */\nexport function DecisionPanel<T extends string>(props: DecisionPanelProps<T>): React.ReactElement {\n const { variant, outcomes, onSubmit, labels, testID, reasons, leadOutcome, checklist, disabled = false, style } = props;\n const { theme } = useUi();\n const state = useDecisionPanel(outcomes, onSubmit);\n const body = (locked: boolean): React.ReactElement =>\n renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });\n\n return (\n <View style={[styles.panel, style]} testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.title, { color: theme.colors.text }]}>\n {labels.title}\n </Text>\n {checklist !== undefined ? (\n <GatedChecklist checked={state.checked} items={checklist.items} testID={`${testID}-checklist`} title={checklist.title} onToggle={state.toggleCheck}>\n {(complete) => body(!complete)}\n </GatedChecklist>\n ) : (\n body(false)\n )}\n {state.error === 'submit' ? <SubmitError message={labels.submitError} testID={`${testID}-error`} /> : null}\n </View>\n );\n}\n","export const enum PasswordRulesDisplay {\n Checklist = 'checklist',\n MeterGrid = 'meterGrid',\n Chips = 'chips',\n Sentence = 'sentence',\n}\n","export const enum RuleTone {\n Met = 'met',\n Unmet = 'unmet',\n Refused = 'refused',\n}\n\nexport function ruleTone(met: boolean, flagUnmet: boolean): RuleTone {\n if (met) return RuleTone.Met;\n return flagUnmet ? RuleTone.Refused : RuleTone.Unmet;\n}\n","import React, { useEffect, useRef } from 'react';\n\nimport { Animated, Easing, StyleSheet, View } from 'react-native';\n\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nimport { useReducedMotion } from '../SearchSelect/hooks/useReducedMotion';\nimport { RuleTone } from './RuleTone';\nimport type { RuleColors } from './useRuleColors';\n\nconst MARK_SIZE = 16;\nconst CHECK_SIZE = 12;\nconst RING_WIDTH = 1.5;\nconst POP_FROM = 0.6;\nconst POP_PEAK = 1.12;\nconst POP_UP_MS = 160;\nconst POP_SETTLE_MS = 100;\n\nconst styles = StyleSheet.create({\n mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: 'center', justifyContent: 'center' },\n ring: { borderWidth: RING_WIDTH },\n});\n\nexport interface RuleMarkProps {\n tone: RuleTone;\n colors: RuleColors;\n}\n\nexport function RuleMark({ tone, colors }: RuleMarkProps): React.ReactElement {\n const reduced = useReducedMotion();\n const scale = useRef(new Animated.Value(1)).current;\n const wasMet = useRef(tone === RuleTone.Met);\n const met = tone === RuleTone.Met;\n useEffect(() => {\n const turnedMet = met && !wasMet.current;\n wasMet.current = met;\n if (!turnedMet || reduced) return;\n scale.setValue(POP_FROM);\n Animated.sequence([\n Animated.timing(scale, { toValue: POP_PEAK, duration: POP_UP_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false }),\n Animated.timing(scale, { toValue: 1, duration: POP_SETTLE_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false }),\n ]).start();\n }, [met, reduced, scale]);\n const color = colors.mark[tone];\n const shape = met ? { backgroundColor: color } : [styles.ring, { borderColor: color }];\n return (\n <Animated.View style={{ transform: [{ scale }] }}>\n <View style={[styles.mark, shape]}>\n {met ? <SvgIcon color={colors.onMark} name=\"check\" size={CHECK_SIZE} /> : null}\n </View>\n </Animated.View>\n );\n}\n","import React from 'react';\n\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { RuleMark } from './RuleMark';\nimport { ruleTone } from './RuleTone';\nimport type { PasswordRuleState } from './types';\nimport type { RuleColors } from './useRuleColors';\n\nconst GAP = 6;\nconst ROW_GAP = 8;\nconst FONT = 14;\nconst LINE = 20;\nconst METER_HEIGHT = 4;\nconst RADIUS = 999;\nconst CHIP_PAD_V = 4;\nconst CHIP_PAD_H = 10;\nconst CHIP_BORDER = 1;\nconst HALF = '50%';\n\nconst styles = StyleSheet.create({\n column: { gap: GAP },\n row: { flexDirection: 'row', alignItems: 'center', gap: ROW_GAP },\n text: { fontSize: FONT, lineHeight: LINE, flexShrink: 1 },\n meter: { flexDirection: 'row', gap: GAP },\n segment: { flex: 1, height: METER_HEIGHT, borderRadius: RADIUS },\n grid: { flexDirection: 'row', flexWrap: 'wrap', rowGap: GAP },\n cell: { flexBasis: HALF, maxWidth: HALF, paddingRight: GAP },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: GAP },\n chip: { borderRadius: RADIUS, borderWidth: CHIP_BORDER, paddingVertical: CHIP_PAD_V, paddingHorizontal: CHIP_PAD_H },\n metPhrase: { fontWeight: '700', textDecorationLine: 'underline' },\n});\n\nexport interface RuleVariantProps {\n rules: readonly PasswordRuleState[];\n flagUnmet: boolean;\n colors: RuleColors;\n testID: string;\n}\n\ninterface RuleListProps extends RuleVariantProps {\n listStyle: StyleProp<ViewStyle>;\n itemStyle?: StyleProp<ViewStyle>;\n outlined?: boolean;\n}\n\nfunction RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }: RuleListProps): React.ReactElement {\n return (\n <View role=\"list\" style={listStyle} testID={testID}>\n {rules.map((rule) => {\n const tone = ruleTone(rule.met, flagUnmet);\n const outline = outlined ? { borderColor: colors.mark[tone] } : null;\n return (\n <View key={rule.id} role=\"listitem\" style={[styles.row, itemStyle, outline]} testID={`${testID}-${rule.id}`} {...{ dataSet: { tone } }}>\n <RuleMark colors={colors} tone={tone} />\n <Text style={[styles.text, { color: colors.text[tone] }]}>{rule.label}</Text>\n </View>\n );\n })}\n </View>\n );\n}\n\nexport function RulesChecklist(props: RuleVariantProps): React.ReactElement {\n return <RuleList {...props} listStyle={styles.column} />;\n}\n\nexport function RulesChips(props: RuleVariantProps): React.ReactElement {\n return <RuleList {...props} outlined itemStyle={styles.chip} listStyle={styles.chips} />;\n}\n\nexport function RulesMeterGrid(props: RuleVariantProps): React.ReactElement {\n const { rules, flagUnmet, colors, testID } = props;\n const metCount = rules.filter((rule) => rule.met).length;\n const unfilled = flagUnmet ? colors.mark.refused : colors.track;\n return (\n <View style={styles.column}>\n <View style={styles.meter} testID={`${testID}-meter`}>\n {rules.map((rule, index) => (\n <View key={rule.id} style={[styles.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }]} />\n ))}\n </View>\n <RuleList {...props} itemStyle={styles.cell} listStyle={styles.grid} />\n </View>\n );\n}\n\nexport function RulesSentence({ rules, flagUnmet, colors, testID }: RuleVariantProps): React.ReactElement {\n return (\n <Text style={[styles.text, { color: colors.text.unmet }]} testID={testID}>\n {rules.map((rule, index) => {\n const tone = ruleTone(rule.met, flagUnmet);\n return (\n <Text key={rule.id} style={[{ color: colors.text[tone] }, rule.met ? styles.metPhrase : null]} testID={`${testID}-${rule.id}`} {...{ dataSet: { tone } }}>\n {index > 0 ? ', ' : ''}\n {rule.label}\n </Text>\n );\n })}\n </Text>\n );\n}\n","import React from 'react';\n\nimport { PasswordRulesDisplay } from './PasswordRulesDisplay';\nimport { RulesChecklist, RulesChips, RulesMeterGrid, RulesSentence, type RuleVariantProps } from './RuleVariants';\n\nexport interface PasswordRulesProps extends RuleVariantProps {\n display: PasswordRulesDisplay;\n}\n\nexport function PasswordRules({ display, ...variant }: PasswordRulesProps): React.ReactElement {\n switch (display) {\n case PasswordRulesDisplay.Checklist:\n return <RulesChecklist {...variant} />;\n case PasswordRulesDisplay.Chips:\n return <RulesChips {...variant} />;\n case PasswordRulesDisplay.Sentence:\n return <RulesSentence {...variant} />;\n default:\n return <RulesMeterGrid {...variant} />;\n }\n}\n","import React from 'react';\n\nimport { Pressable, StyleSheet } from 'react-native';\n\nimport { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';\nimport { SvgIcon } from '@dloizides/ui-icons';\n\nconst ICON_SIZE = 20;\n\nconst styles = StyleSheet.create({\n button: { width: MIN_TOUCH_TARGET_PX, height: MIN_TOUCH_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n});\n\nexport interface RevealToggleProps {\n revealed: boolean;\n onToggle: () => void;\n onPressIn?: () => void;\n showLabel: string;\n hideLabel: string;\n color: string;\n testID: string;\n}\n\nexport function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }: RevealToggleProps): React.ReactElement {\n const label = revealed ? hideLabel : showLabel;\n return (\n <Pressable\n accessibilityHint={label}\n accessibilityLabel={label}\n accessibilityRole=\"button\"\n aria-pressed={revealed}\n style={styles.button}\n testID={testID}\n onPress={onToggle}\n onPressIn={onPressIn}\n >\n <SvgIcon color={color} name={revealed ? 'eyeOff' : 'eye'} size={ICON_SIZE} />\n </Pressable>\n );\n}\n","import type { PasswordFieldLabels, PasswordRuleState } from './types';\n\nexport function changedRules(\n previous: readonly PasswordRuleState[],\n next: readonly PasswordRuleState[],\n): PasswordRuleState[] {\n const before = new Map(previous.map((rule) => [rule.id, rule.met]));\n return next.filter((rule) => before.has(rule.id) && before.get(rule.id) !== rule.met);\n}\n\nexport function ruleAnnouncement(\n changed: readonly PasswordRuleState[],\n labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>,\n): string {\n return changed.map((rule) => `${rule.label}: ${rule.met ? labels.met : labels.unmet}`).join('. ');\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport { changedRules, ruleAnnouncement } from './ruleAnnouncement';\nimport type { PasswordFieldLabels, PasswordRuleState } from './types';\n\nexport function usePasswordRuleAnnouncement(\n rules: readonly PasswordRuleState[],\n labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>,\n): string {\n const previous = useRef<readonly PasswordRuleState[]>(rules);\n const [message, setMessage] = useState('');\n useEffect(() => {\n const changed = changedRules(previous.current, rules);\n previous.current = rules;\n if (changed.length > 0) setMessage(ruleAnnouncement(changed, labels));\n }, [rules, labels]);\n return message;\n}\n","import { useMemo } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { RuleTone } from './RuleTone';\nimport type { PasswordFieldColors } from './types';\n\nexport interface RuleColors {\n mark: Record<RuleTone, string>;\n text: Record<RuleTone, string>;\n track: string;\n onMark: string;\n}\n\nexport function ruleColorsFrom(palette: PasswordFieldColors): RuleColors {\n return {\n mark: { [RuleTone.Met]: palette.success, [RuleTone.Unmet]: palette.textSecondary, [RuleTone.Refused]: palette.error },\n text: { [RuleTone.Met]: palette.text, [RuleTone.Unmet]: palette.textSecondary, [RuleTone.Refused]: palette.error },\n track: palette.border,\n onMark: palette.background,\n };\n}\n\nexport function useRuleColors(override?: PasswordFieldColors): RuleColors {\n const { theme } = useUi();\n return useMemo(() => {\n if (override !== undefined) return ruleColorsFrom(override);\n return ruleColorsFrom({\n success: theme.semantic.success?.['500'] ?? theme.colors.text,\n error: theme.semantic.error['500'],\n text: theme.colors.text,\n textSecondary: theme.colors.textSecondary,\n border: theme.colors.border,\n background: theme.colors.background,\n });\n }, [theme, override]);\n}\n","import React, { useCallback, useImperativeHandle, useRef, useState } from 'react';\n\nimport { StyleSheet, Text, View, type NativeSyntheticEvent, type TextInput, type TextInputSelectionChangeEventData } from 'react-native';\n\nimport { Field } from '../Field/Field';\nimport { ThemedTextInput, type ThemedTextInputProps } from '../ThemedTextInput/ThemedTextInput';\nimport { PasswordRules } from './PasswordRules';\nimport { PasswordRulesDisplay } from './PasswordRulesDisplay';\nimport { RevealToggle } from './RevealToggle';\nimport type { PasswordFieldColors, PasswordFieldLabels, PasswordRuleState } from './types';\nimport { usePasswordRuleAnnouncement } from './usePasswordRuleAnnouncement';\nimport { useRuleColors } from './useRuleColors';\n\nconst RULES_GAP = 8;\nconst TOGGLE_INSET = 48;\nconst NO_RULES: readonly PasswordRuleState[] = [];\n\nconst styles = StyleSheet.create({\n inputRow: { position: 'relative', justifyContent: 'center' },\n input: { paddingRight: TOGGLE_INSET },\n toggle: { position: 'absolute', right: 0, top: 0, bottom: 0, justifyContent: 'center' },\n rules: { marginTop: RULES_GAP },\n live: { position: 'absolute', width: 1, height: 1, overflow: 'hidden', opacity: 0 },\n});\n\ntype Selection = TextInputSelectionChangeEventData['selection'];\ntype FocusableNode = { focus: () => void; setSelectionRange?: (start: number, end: number) => void };\n\nexport interface PasswordFieldProps {\n label: string;\n value: string;\n onChangeText: (value: string) => void;\n labels: PasswordFieldLabels;\n testID: string;\n rules?: readonly PasswordRuleState[];\n rulesDisplay?: PasswordRulesDisplay;\n flagUnmet?: boolean;\n error?: string;\n colors?: PasswordFieldColors;\n inputProps?: Omit<ThemedTextInputProps, 'value' | 'onChangeText' | 'secureTextEntry' | 'testID'>;\n}\n\nfunction joinIds(...ids: Array<string | undefined>): string | undefined {\n const joined = ids.filter((id): id is string => id !== undefined && id !== '').join(' ');\n return joined === '' ? undefined : joined;\n}\n\nfunction useCaretKeepingToggle(inputRef: React.RefObject<TextInput | null>, initialLength: number): {\n revealed: boolean;\n onPressIn: () => void;\n onToggle: () => void;\n onSelectionChange: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;\n} {\n const [revealed, setRevealed] = useState(false);\n const selection = useRef<Selection>({ start: initialLength, end: initialLength });\n const hadFocus = useRef(false);\n const onSelectionChange = useCallback((event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n selection.current = event.nativeEvent.selection;\n }, []);\n const onPressIn = useCallback(() => {\n hadFocus.current = inputRef.current?.isFocused?.() ?? false;\n }, [inputRef]);\n const onToggle = useCallback(() => {\n setRevealed((current) => !current);\n if (!hadFocus.current) return;\n const node = inputRef.current as unknown as FocusableNode | null;\n const { start, end } = selection.current;\n requestAnimationFrame(() => {\n node?.focus();\n node?.setSelectionRange?.(start, end);\n });\n }, [inputRef]);\n return { revealed, onPressIn, onToggle, onSelectionChange };\n}\n\nexport const PasswordField = React.forwardRef<TextInput, PasswordFieldProps>(function PasswordField(\n { label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = PasswordRulesDisplay.MeterGrid, flagUnmet = false, error, colors: colorOverride, inputProps },\n ref,\n): React.ReactElement {\n const inputRef = useRef<TextInput>(null);\n useImperativeHandle(ref, () => inputRef.current as TextInput);\n const toggle = useCaretKeepingToggle(inputRef, value.length);\n const colors = useRuleColors(colorOverride);\n const announcement = usePasswordRuleAnnouncement(rules, labels);\n const rulesId = `${testID}-rules`;\n const hasRules = rules.length > 0;\n return (\n <Field error={error} label={label} testID={`${testID}-field`}>\n {(context) => (\n <View>\n <View style={styles.inputRow}>\n <ThemedTextInput\n autoCapitalize=\"none\"\n autoCorrect={false}\n {...inputProps}\n ref={inputRef}\n describedById={joinIds(context.describedById, hasRules ? rulesId : undefined)}\n hasError={context.hasError || (flagUnmet && rules.some((rule) => !rule.met))}\n id={context.controlId}\n secureTextEntry={!toggle.revealed}\n style={[styles.input, inputProps?.style]}\n testID={testID}\n value={value}\n onChangeText={onChangeText}\n onSelectionChange={toggle.onSelectionChange}\n />\n <View style={styles.toggle}>\n <RevealToggle color={colors.text.unmet} hideLabel={labels.hide} revealed={toggle.revealed} showLabel={labels.show} testID={`${testID}-reveal`} onPressIn={toggle.onPressIn} onToggle={toggle.onToggle} />\n </View>\n </View>\n {hasRules ? (\n <View nativeID={rulesId} style={styles.rules}>\n <PasswordRules colors={colors} display={rulesDisplay} flagUnmet={flagUnmet} rules={rules} testID={rulesId} />\n <Text aria-live=\"polite\" accessibilityLiveRegion=\"polite\" style={styles.live} testID={`${testID}-announce`}>\n {announcement}\n </Text>\n </View>\n ) : null}\n </View>\n )}\n </Field>\n );\n});\n"]}
|