@dloizides/ui-forms 1.40.0 → 1.42.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 CHANGED
@@ -6,6 +6,10 @@
6
6
  - `FormSwitch`: the consumer `testID` now lands on the whole label + switch row (the pressable, at least 44 px tall) instead of RN-web's 40x20 switch wrapper, so a probe or e2e tap on `testID` hits the full target; the native switch is `${testID}-switch`, the old `${testID}-row` id is gone (D-FUNDS-18 in FINREG-FUNDS-1 "Tenant funds, deal gate, blocking roles").
7
7
 
8
8
  ### Added
9
+ - `DecisionPanel` organism: one decision surface in three variants (`sticky-bar`, `choose-then-submit`, `checks-drive`), a note required per configured outcome, an optional checklist gate, `defaultDecisionVariant(width)` on the shared form breakpoint; a rejected `onSubmit` shows `labels.submitError`, a new **required** label (MODC-1 "Module C unified console" AC-UI-5, AC-MC-10).
10
+ - `GatedChecklist` molecule + `isChecklistComplete`: the children slot (the action) stays disabled until every item is ticked.
11
+ - `RadioList` molecule + `radioRowIdentity`: labelled radiogroup of rows with an optional description, arrow keys, native checked state.
12
+ - `ActionBar` + `actionBarPosition`: action row with an optional status line, sticky on web.
9
13
  - `LineItems`: repeating lines as one labelled card each ("Line N" + a header slot such as a Debit/Credit switch + Remove), cells through `renderCell({ item, index, columnKey, wide })`; at 1280 px and wider the column headers show once and each line is one aligned row, below that the cells stack in a `FormGrid`; Add line, `minItems` (default 1), `isLineItemsWide`, `canRemoveLine` exported (D-JL-5 "Journal line layout" in FINREG-JOURNAL-LINES-1 "Journal lines read as lines").
10
14
  - `SearchSelect.renderTrigger({ open, selected, onPress, ref })`: draw your own trigger (a chip, a button) in place of the field box; the package keeps the pressable, its label, hint, expanded state, testID, the 44 px hit box and the focus return on close. A dropdown from a narrow trigger opens at least 240 px wide inside the viewport (`fitDropdownWidth`) (D-INPUTS-19 in FINREG-INPUTS-1 "Searchable dropdowns, shared country field, formatted IBAN/BIC inputs").
11
15
  - `IbanInput` / `BicInput` take `onBlur` (called after the leave verdict, so forms validate on blur); `BicInput` takes `placeholder`.
package/dist/index.d.mts CHANGED
@@ -942,7 +942,7 @@ interface DateRangeControlProps {
942
942
  /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */
943
943
  testID: string;
944
944
  }
945
- /** An inclusive from/to date pair of two shared `DateField`s; each edit patches only its own side. */
945
+ /** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */
946
946
  declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
947
947
 
948
948
  interface DateFieldProps {
@@ -979,6 +979,54 @@ declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
979
979
  /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
980
980
  declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
981
981
 
982
+ interface DatePickerLabels {
983
+ dialog: string;
984
+ rangeDialog: string;
985
+ openCalendar: string;
986
+ openCalendarHint: string;
987
+ previousMonth: string;
988
+ nextMonth: string;
989
+ monthHint: string;
990
+ month: string;
991
+ year: string;
992
+ dayHint: string;
993
+ setDate: string;
994
+ setDateHint: string;
995
+ clear: string;
996
+ clearHint: string;
997
+ cancel: string;
998
+ cancelHint: string;
999
+ apply: string;
1000
+ applyHint: string;
1001
+ presets: string;
1002
+ presetHint: string;
1003
+ today: string;
1004
+ last7Days: string;
1005
+ thisMonth: string;
1006
+ quarter: string;
1007
+ /** `{{p1}}` is the number of days. */
1008
+ dayCount: string;
1009
+ invalidDate: string;
1010
+ /** Between two dates of a range, e.g. ` – `. */
1011
+ rangeSeparator: string;
1012
+ rangeOrder: string;
1013
+ outOfRange: string;
1014
+ }
1015
+
1016
+ interface DatePickerProviderProps {
1017
+ /** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */
1018
+ labels?: Partial<DatePickerLabels>;
1019
+ /** BCP 47 locale for display, typing order and week start; omitted = the runtime locale. */
1020
+ locale?: string;
1021
+ /** Fixed `YYYY-MM-DD` today, for demos and tests. */
1022
+ today?: string;
1023
+ children: React.ReactNode;
1024
+ }
1025
+ /** Supplies picker labels, locale and an optional fixed today to every date control below it. */
1026
+ declare function DatePickerProvider({ labels, locale, today, children }: DatePickerProviderProps): React.ReactElement;
1027
+
1028
+ declare const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels;
1029
+
982
1030
  /**
983
1031
  * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.
984
1032
  *
@@ -1445,8 +1493,8 @@ interface DropdownFrame {
1445
1493
  declare function placeDropdown(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement;
1446
1494
  /** The window frame for the list next to `anchor`, on the side `placeDropdown` picks. */
1447
1495
  declare function dropdownFrame(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownFrame;
1448
- /** Widens a narrow anchor's list to a readable width and keeps it inside the viewport. */
1449
- declare function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number): DropdownFrame;
1496
+ /** Widens a narrow anchor's list to `minWidth` (default a readable width) and keeps it inside the viewport. */
1497
+ declare function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number, minWidth?: number): DropdownFrame;
1450
1498
 
1451
1499
  /** Focuses `ref` on the next tick, after the closing list surface has left the page. */
1452
1500
  declare function useDeferredFocus(ref: RefObject<{
@@ -1629,4 +1677,125 @@ declare function useBlurVerdict<T>(validate: () => T): BlurVerdict<T>;
1629
1677
  /** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */
1630
1678
  declare function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null;
1631
1679
 
1632
- export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
1680
+ type ActionBarPosition = 'sticky' | 'relative';
1681
+ /** Where the bar sits: pinned to the bottom of its scroll area on web when sticky, in flow otherwise. */
1682
+ declare const actionBarPosition: (sticky: boolean, os: string) => ActionBarPosition;
1683
+ interface ActionBarProps {
1684
+ children: React.ReactNode;
1685
+ message?: string;
1686
+ sticky?: boolean;
1687
+ testID: string;
1688
+ style?: StyleProp<ViewStyle>;
1689
+ }
1690
+ /** A bar of action buttons with an optional status line, pinned to the bottom edge when sticky. */
1691
+ declare const ActionBar: ({ children, message, sticky, testID, style }: ActionBarProps) => React.ReactElement;
1692
+
1693
+ interface ChecklistItem {
1694
+ id: string;
1695
+ label: string;
1696
+ description?: string;
1697
+ }
1698
+ /** True when every item's id is checked; an empty list is complete. */
1699
+ declare const isChecklistComplete: (items: readonly ChecklistItem[], checked: readonly string[]) => boolean;
1700
+
1701
+ interface GatedChecklistProps {
1702
+ title: string;
1703
+ items: readonly ChecklistItem[];
1704
+ checked: readonly string[];
1705
+ onToggle: (id: string) => void;
1706
+ testID: string;
1707
+ disabled?: boolean;
1708
+ children?: (complete: boolean) => React.ReactNode;
1709
+ }
1710
+ /** A checklist that tells its `children` slot whether every item is ticked, so the slot can gate its action. */
1711
+ declare const GatedChecklist: ({ title, items, checked, onToggle, testID, disabled, children }: GatedChecklistProps) => React.ReactElement;
1712
+
1713
+ interface RadioOption<T> {
1714
+ value: T;
1715
+ label: string;
1716
+ hint: string;
1717
+ description?: string;
1718
+ }
1719
+ interface RadioListProps<T> {
1720
+ options: ReadonlyArray<RadioOption<T>>;
1721
+ value: T | undefined;
1722
+ onChange: (value: T) => void;
1723
+ optionTestIDPrefix: string;
1724
+ label?: string;
1725
+ error?: string;
1726
+ required?: boolean;
1727
+ disabled?: boolean;
1728
+ testID?: string;
1729
+ }
1730
+
1731
+ /** A vertical radio group of labelled rows with descriptions; arrow keys move the choice. */
1732
+ declare function RadioList<T extends string | number>(props: RadioListProps<T>): React.ReactElement;
1733
+
1734
+ interface RadioRowIdentity {
1735
+ testID: string;
1736
+ accessibilityLabel: string;
1737
+ accessibilityState: {
1738
+ checked: boolean;
1739
+ selected: boolean;
1740
+ disabled: boolean;
1741
+ };
1742
+ }
1743
+ /** The testID, accessible name (label, then description) and native radio state of one row. */
1744
+ declare const radioRowIdentity: <T>(option: RadioOption<T>, selected: boolean, disabled: boolean, prefix: string) => RadioRowIdentity;
1745
+
1746
+ type DecisionPanelVariant = 'sticky-bar' | 'choose-then-submit' | 'checks-drive';
1747
+ type DecisionTone = 'primary' | 'neutral' | 'danger';
1748
+ type DecisionError = 'choose' | 'note' | 'submit';
1749
+ interface DecisionOutcome<T extends string> {
1750
+ value: T;
1751
+ label: string;
1752
+ hint: string;
1753
+ description?: string;
1754
+ tone?: DecisionTone;
1755
+ noteRequired?: boolean;
1756
+ }
1757
+ interface DecisionSubmission<T extends string> {
1758
+ outcome: T;
1759
+ note: string;
1760
+ reasons: string[];
1761
+ }
1762
+ interface DecisionPanelLabels {
1763
+ title: string;
1764
+ note: string;
1765
+ noteRequiredError: string;
1766
+ chooseError: string;
1767
+ submit: string;
1768
+ submitHint: string;
1769
+ submitError: string;
1770
+ notePlaceholder?: string;
1771
+ reasons?: string;
1772
+ message?: string;
1773
+ }
1774
+ interface DecisionChecklist {
1775
+ title: string;
1776
+ items: readonly ChecklistItem[];
1777
+ }
1778
+ interface DecisionPanelProps<T extends string> {
1779
+ variant: DecisionPanelVariant;
1780
+ outcomes: ReadonlyArray<DecisionOutcome<T>>;
1781
+ onSubmit: (submission: DecisionSubmission<T>) => void | Promise<unknown>;
1782
+ labels: DecisionPanelLabels;
1783
+ testID: string;
1784
+ reasons?: Array<ChipOption<string>>;
1785
+ leadOutcome?: T;
1786
+ checklist?: DecisionChecklist;
1787
+ disabled?: boolean;
1788
+ style?: StyleProp<ViewStyle>;
1789
+ }
1790
+
1791
+ /** A decision control in one of three layouts; outcomes, labels and note rules come in as config. */
1792
+ declare function DecisionPanel<T extends string>(props: DecisionPanelProps<T>): React.ReactElement;
1793
+
1794
+ /** The first reason the chosen outcome and note cannot be submitted, or null when they can. */
1795
+ declare const validateDecision: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, outcome: string, note: string) => DecisionError | null;
1796
+ /** The default variant for a viewport width: choose-then-submit on phones, the sticky bar at the shared wide breakpoint. */
1797
+ declare const defaultDecisionVariant: (width: number) => DecisionPanelVariant;
1798
+ /** The outcomes with the lead one first; the rest keep their order. */
1799
+ declare const leadFirst: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined) => Array<DecisionOutcome<T>>;
1800
+
1801
+ export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, GatedChecklist, type GatedChecklistProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, actionBarPosition, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };
package/dist/index.d.ts CHANGED
@@ -942,7 +942,7 @@ interface DateRangeControlProps {
942
942
  /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */
943
943
  testID: string;
944
944
  }
945
- /** An inclusive from/to date pair of two shared `DateField`s; each edit patches only its own side. */
945
+ /** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */
946
946
  declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
947
947
 
948
948
  interface DateFieldProps {
@@ -979,6 +979,54 @@ declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
979
979
  /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
980
980
  declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
981
981
 
982
+ interface DatePickerLabels {
983
+ dialog: string;
984
+ rangeDialog: string;
985
+ openCalendar: string;
986
+ openCalendarHint: string;
987
+ previousMonth: string;
988
+ nextMonth: string;
989
+ monthHint: string;
990
+ month: string;
991
+ year: string;
992
+ dayHint: string;
993
+ setDate: string;
994
+ setDateHint: string;
995
+ clear: string;
996
+ clearHint: string;
997
+ cancel: string;
998
+ cancelHint: string;
999
+ apply: string;
1000
+ applyHint: string;
1001
+ presets: string;
1002
+ presetHint: string;
1003
+ today: string;
1004
+ last7Days: string;
1005
+ thisMonth: string;
1006
+ quarter: string;
1007
+ /** `{{p1}}` is the number of days. */
1008
+ dayCount: string;
1009
+ invalidDate: string;
1010
+ /** Between two dates of a range, e.g. ` – `. */
1011
+ rangeSeparator: string;
1012
+ rangeOrder: string;
1013
+ outOfRange: string;
1014
+ }
1015
+
1016
+ interface DatePickerProviderProps {
1017
+ /** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */
1018
+ labels?: Partial<DatePickerLabels>;
1019
+ /** BCP 47 locale for display, typing order and week start; omitted = the runtime locale. */
1020
+ locale?: string;
1021
+ /** Fixed `YYYY-MM-DD` today, for demos and tests. */
1022
+ today?: string;
1023
+ children: React.ReactNode;
1024
+ }
1025
+ /** Supplies picker labels, locale and an optional fixed today to every date control below it. */
1026
+ declare function DatePickerProvider({ labels, locale, today, children }: DatePickerProviderProps): React.ReactElement;
1027
+
1028
+ declare const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels;
1029
+
982
1030
  /**
983
1031
  * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.
984
1032
  *
@@ -1445,8 +1493,8 @@ interface DropdownFrame {
1445
1493
  declare function placeDropdown(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownPlacement;
1446
1494
  /** The window frame for the list next to `anchor`, on the side `placeDropdown` picks. */
1447
1495
  declare function dropdownFrame(anchor: AnchorRect, panelHeight: number, viewportHeight: number): DropdownFrame;
1448
- /** Widens a narrow anchor's list to a readable width and keeps it inside the viewport. */
1449
- declare function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number): DropdownFrame;
1496
+ /** Widens a narrow anchor's list to `minWidth` (default a readable width) and keeps it inside the viewport. */
1497
+ declare function fitDropdownWidth(frame: DropdownFrame, viewportWidth: number, minWidth?: number): DropdownFrame;
1450
1498
 
1451
1499
  /** Focuses `ref` on the next tick, after the closing list surface has left the page. */
1452
1500
  declare function useDeferredFocus(ref: RefObject<{
@@ -1629,4 +1677,125 @@ declare function useBlurVerdict<T>(validate: () => T): BlurVerdict<T>;
1629
1677
  /** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */
1630
1678
  declare function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null;
1631
1679
 
1632
- export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
1680
+ type ActionBarPosition = 'sticky' | 'relative';
1681
+ /** Where the bar sits: pinned to the bottom of its scroll area on web when sticky, in flow otherwise. */
1682
+ declare const actionBarPosition: (sticky: boolean, os: string) => ActionBarPosition;
1683
+ interface ActionBarProps {
1684
+ children: React.ReactNode;
1685
+ message?: string;
1686
+ sticky?: boolean;
1687
+ testID: string;
1688
+ style?: StyleProp<ViewStyle>;
1689
+ }
1690
+ /** A bar of action buttons with an optional status line, pinned to the bottom edge when sticky. */
1691
+ declare const ActionBar: ({ children, message, sticky, testID, style }: ActionBarProps) => React.ReactElement;
1692
+
1693
+ interface ChecklistItem {
1694
+ id: string;
1695
+ label: string;
1696
+ description?: string;
1697
+ }
1698
+ /** True when every item's id is checked; an empty list is complete. */
1699
+ declare const isChecklistComplete: (items: readonly ChecklistItem[], checked: readonly string[]) => boolean;
1700
+
1701
+ interface GatedChecklistProps {
1702
+ title: string;
1703
+ items: readonly ChecklistItem[];
1704
+ checked: readonly string[];
1705
+ onToggle: (id: string) => void;
1706
+ testID: string;
1707
+ disabled?: boolean;
1708
+ children?: (complete: boolean) => React.ReactNode;
1709
+ }
1710
+ /** A checklist that tells its `children` slot whether every item is ticked, so the slot can gate its action. */
1711
+ declare const GatedChecklist: ({ title, items, checked, onToggle, testID, disabled, children }: GatedChecklistProps) => React.ReactElement;
1712
+
1713
+ interface RadioOption<T> {
1714
+ value: T;
1715
+ label: string;
1716
+ hint: string;
1717
+ description?: string;
1718
+ }
1719
+ interface RadioListProps<T> {
1720
+ options: ReadonlyArray<RadioOption<T>>;
1721
+ value: T | undefined;
1722
+ onChange: (value: T) => void;
1723
+ optionTestIDPrefix: string;
1724
+ label?: string;
1725
+ error?: string;
1726
+ required?: boolean;
1727
+ disabled?: boolean;
1728
+ testID?: string;
1729
+ }
1730
+
1731
+ /** A vertical radio group of labelled rows with descriptions; arrow keys move the choice. */
1732
+ declare function RadioList<T extends string | number>(props: RadioListProps<T>): React.ReactElement;
1733
+
1734
+ interface RadioRowIdentity {
1735
+ testID: string;
1736
+ accessibilityLabel: string;
1737
+ accessibilityState: {
1738
+ checked: boolean;
1739
+ selected: boolean;
1740
+ disabled: boolean;
1741
+ };
1742
+ }
1743
+ /** The testID, accessible name (label, then description) and native radio state of one row. */
1744
+ declare const radioRowIdentity: <T>(option: RadioOption<T>, selected: boolean, disabled: boolean, prefix: string) => RadioRowIdentity;
1745
+
1746
+ type DecisionPanelVariant = 'sticky-bar' | 'choose-then-submit' | 'checks-drive';
1747
+ type DecisionTone = 'primary' | 'neutral' | 'danger';
1748
+ type DecisionError = 'choose' | 'note' | 'submit';
1749
+ interface DecisionOutcome<T extends string> {
1750
+ value: T;
1751
+ label: string;
1752
+ hint: string;
1753
+ description?: string;
1754
+ tone?: DecisionTone;
1755
+ noteRequired?: boolean;
1756
+ }
1757
+ interface DecisionSubmission<T extends string> {
1758
+ outcome: T;
1759
+ note: string;
1760
+ reasons: string[];
1761
+ }
1762
+ interface DecisionPanelLabels {
1763
+ title: string;
1764
+ note: string;
1765
+ noteRequiredError: string;
1766
+ chooseError: string;
1767
+ submit: string;
1768
+ submitHint: string;
1769
+ submitError: string;
1770
+ notePlaceholder?: string;
1771
+ reasons?: string;
1772
+ message?: string;
1773
+ }
1774
+ interface DecisionChecklist {
1775
+ title: string;
1776
+ items: readonly ChecklistItem[];
1777
+ }
1778
+ interface DecisionPanelProps<T extends string> {
1779
+ variant: DecisionPanelVariant;
1780
+ outcomes: ReadonlyArray<DecisionOutcome<T>>;
1781
+ onSubmit: (submission: DecisionSubmission<T>) => void | Promise<unknown>;
1782
+ labels: DecisionPanelLabels;
1783
+ testID: string;
1784
+ reasons?: Array<ChipOption<string>>;
1785
+ leadOutcome?: T;
1786
+ checklist?: DecisionChecklist;
1787
+ disabled?: boolean;
1788
+ style?: StyleProp<ViewStyle>;
1789
+ }
1790
+
1791
+ /** A decision control in one of three layouts; outcomes, labels and note rules come in as config. */
1792
+ declare function DecisionPanel<T extends string>(props: DecisionPanelProps<T>): React.ReactElement;
1793
+
1794
+ /** The first reason the chosen outcome and note cannot be submitted, or null when they can. */
1795
+ declare const validateDecision: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, outcome: string, note: string) => DecisionError | null;
1796
+ /** The default variant for a viewport width: choose-then-submit on phones, the sticky bar at the shared wide breakpoint. */
1797
+ declare const defaultDecisionVariant: (width: number) => DecisionPanelVariant;
1798
+ /** The outcomes with the lead one first; the rest keep their order. */
1799
+ declare const leadFirst: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined) => Array<DecisionOutcome<T>>;
1800
+
1801
+ export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, GatedChecklist, type GatedChecklistProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, actionBarPosition, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };