@dloizides/ui-forms 1.44.1 → 1.46.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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.46.0] - 2026-11-23
4
+
5
+ ### Added
6
+ - `PasswordField` (FORM-VALID-1 D7, D-FV-3, D-FV-4): password input with a reveal eye and four rule layouts (`PasswordRulesDisplay`), rule changes announced, optional token-shaped `colors` prop over the theme; uses `@dloizides/ui-icons ^1.4.0`.
7
+ - `useServerFieldErrors({ fields, refs?, formatCode? })` (FORM-VALID-1 D4): `apply(error)` parses a 400/422 with `@dloizides/api-client-base` `parseFieldErrors`, puts the first message under each known field (exact path, then lower-cased last segment), sends the rest to `formError`, focuses the first invalid field; `errorFor`, `clear`, `reset`. `formatCode(code, error)` is injected so the app's `FM` stays in the app; a null result shows the server reason.
8
+ - Peer `@dloizides/api-client-base >=1.2.0`.
9
+
3
10
  ## [Unreleased]
4
11
 
5
12
  ### Changed
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextInput, LayoutChangeEvent, View } from 'react-native';
3
+ import { FieldError } from '@dloizides/api-client-base';
3
4
 
4
5
  /**
5
6
  * `Field`'s TWO spacing models — the F3 fix, shipped as an OPT-IN rather than a breaking change.
@@ -1004,6 +1005,11 @@ declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
1004
1005
  /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
1005
1006
  declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
1006
1007
 
1008
+ declare const enum DateDisplay {
1009
+ Long = "long",
1010
+ Numeric = "numeric"
1011
+ }
1012
+
1007
1013
  interface DatePickerLabels {
1008
1014
  dialog: string;
1009
1015
  rangeDialog: string;
@@ -1045,10 +1051,12 @@ interface DatePickerProviderProps {
1045
1051
  locale?: string;
1046
1052
  /** Fixed `YYYY-MM-DD` today, for demos and tests. */
1047
1053
  today?: string;
1054
+ /** Closed-field format; omitted = Long (`Fri 20 Nov 2026`), Numeric = the locale's `20/11/2026`. */
1055
+ display?: DateDisplay;
1048
1056
  children: React.ReactNode;
1049
1057
  }
1050
1058
  /** Supplies picker labels, locale and an optional fixed today to every date control below it. */
1051
- declare function DatePickerProvider({ labels, locale, today, children }: DatePickerProviderProps): React.ReactElement;
1059
+ declare function DatePickerProvider({ labels, locale, today, display, children }: DatePickerProviderProps): React.ReactElement;
1052
1060
 
1053
1061
  declare const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels;
1054
1062
 
@@ -1344,6 +1352,30 @@ type FocusableRefs<Field extends string> = Readonly<Record<Field, RefObject<Focu
1344
1352
  /** Returns a stable function that focuses the first listed field that is on screen. */
1345
1353
  declare function useFocusFirstInvalid<Field extends string>(refs: FocusableRefs<Field>): (invalid: readonly Field[]) => void;
1346
1354
 
1355
+ type CodeFormatter = (code: string, error: FieldError) => string | null | undefined;
1356
+ interface AssignedServerErrors<Field extends string> {
1357
+ byField: Partial<Record<Field, string>>;
1358
+ formError: string | null;
1359
+ matched: Field[];
1360
+ }
1361
+ /** Splits parsed server errors into the first message per known field and the first unmatched message. */
1362
+ declare function assignServerErrors<Field extends string>(errors: readonly FieldError[], fields: readonly Field[], formatCode?: CodeFormatter): AssignedServerErrors<Field>;
1363
+
1364
+ interface UseServerFieldErrorsOptions<Field extends string> {
1365
+ fields: readonly Field[];
1366
+ refs?: FocusableRefs<Field>;
1367
+ formatCode?: CodeFormatter;
1368
+ }
1369
+ interface ServerFieldErrors<Field extends string> {
1370
+ errorFor: (field: Field) => string | undefined;
1371
+ apply: (error: unknown) => boolean;
1372
+ clear: (field: Field) => void;
1373
+ formError: string | null;
1374
+ reset: () => void;
1375
+ }
1376
+ /** Binds a thrown 400 to form fields: the message under each known field, the rest on the form status line. */
1377
+ declare function useServerFieldErrors<Field extends string>(options: UseServerFieldErrorsOptions<Field>): ServerFieldErrors<Field>;
1378
+
1347
1379
  /** Scrolls the returned view fully into sight each time `trigger` takes a new value. */
1348
1380
  declare function useKeepInView(trigger: unknown): RefObject<View | null>;
1349
1381
 
@@ -1846,4 +1878,87 @@ declare const defaultDecisionVariant: (width: number) => DecisionPanelVariant;
1846
1878
  /** The outcomes with the lead one first; the rest keep their order. */
1847
1879
  declare const leadFirst: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined) => Array<DecisionOutcome<T>>;
1848
1880
 
1849
- export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AutoGrowRows, 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, FileInput, type FileInputProps, 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, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, 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, rowsForText, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };
1881
+ declare const enum PasswordRulesDisplay {
1882
+ Checklist = "checklist",
1883
+ MeterGrid = "meterGrid",
1884
+ Chips = "chips",
1885
+ Sentence = "sentence"
1886
+ }
1887
+
1888
+ interface PasswordRuleState {
1889
+ id: string;
1890
+ label: string;
1891
+ met: boolean;
1892
+ }
1893
+ interface PasswordFieldLabels {
1894
+ show: string;
1895
+ hide: string;
1896
+ met: string;
1897
+ unmet: string;
1898
+ }
1899
+ interface PasswordFieldColors {
1900
+ success: string;
1901
+ error: string;
1902
+ text: string;
1903
+ textSecondary: string;
1904
+ border: string;
1905
+ background: string;
1906
+ }
1907
+
1908
+ interface PasswordFieldProps {
1909
+ label: string;
1910
+ value: string;
1911
+ onChangeText: (value: string) => void;
1912
+ labels: PasswordFieldLabels;
1913
+ testID: string;
1914
+ rules?: readonly PasswordRuleState[];
1915
+ rulesDisplay?: PasswordRulesDisplay;
1916
+ flagUnmet?: boolean;
1917
+ error?: string;
1918
+ colors?: PasswordFieldColors;
1919
+ inputProps?: Omit<ThemedTextInputProps, 'value' | 'onChangeText' | 'secureTextEntry' | 'testID'>;
1920
+ }
1921
+ declare const PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<TextInput>>;
1922
+
1923
+ declare const enum RuleTone {
1924
+ Met = "met",
1925
+ Unmet = "unmet",
1926
+ Refused = "refused"
1927
+ }
1928
+ declare function ruleTone(met: boolean, flagUnmet: boolean): RuleTone;
1929
+
1930
+ interface RuleColors {
1931
+ mark: Record<RuleTone, string>;
1932
+ text: Record<RuleTone, string>;
1933
+ track: string;
1934
+ onMark: string;
1935
+ }
1936
+ declare function ruleColorsFrom(palette: PasswordFieldColors): RuleColors;
1937
+
1938
+ interface RuleVariantProps {
1939
+ rules: readonly PasswordRuleState[];
1940
+ flagUnmet: boolean;
1941
+ colors: RuleColors;
1942
+ testID: string;
1943
+ }
1944
+
1945
+ interface PasswordRulesProps extends RuleVariantProps {
1946
+ display: PasswordRulesDisplay;
1947
+ }
1948
+ declare function PasswordRules({ display, ...variant }: PasswordRulesProps): React.ReactElement;
1949
+
1950
+ interface RevealToggleProps {
1951
+ revealed: boolean;
1952
+ onToggle: () => void;
1953
+ onPressIn?: () => void;
1954
+ showLabel: string;
1955
+ hideLabel: string;
1956
+ color: string;
1957
+ testID: string;
1958
+ }
1959
+ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }: RevealToggleProps): React.ReactElement;
1960
+
1961
+ declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
1962
+ declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
1963
+
1964
+ export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, 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 CodeFormatter, 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, DateDisplay, 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, FileInput, type FileInputProps, 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, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, 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, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextInput, LayoutChangeEvent, View } from 'react-native';
3
+ import { FieldError } from '@dloizides/api-client-base';
3
4
 
4
5
  /**
5
6
  * `Field`'s TWO spacing models — the F3 fix, shipped as an OPT-IN rather than a breaking change.
@@ -1004,6 +1005,11 @@ declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
1004
1005
  /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
1005
1006
  declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
1006
1007
 
1008
+ declare const enum DateDisplay {
1009
+ Long = "long",
1010
+ Numeric = "numeric"
1011
+ }
1012
+
1007
1013
  interface DatePickerLabels {
1008
1014
  dialog: string;
1009
1015
  rangeDialog: string;
@@ -1045,10 +1051,12 @@ interface DatePickerProviderProps {
1045
1051
  locale?: string;
1046
1052
  /** Fixed `YYYY-MM-DD` today, for demos and tests. */
1047
1053
  today?: string;
1054
+ /** Closed-field format; omitted = Long (`Fri 20 Nov 2026`), Numeric = the locale's `20/11/2026`. */
1055
+ display?: DateDisplay;
1048
1056
  children: React.ReactNode;
1049
1057
  }
1050
1058
  /** Supplies picker labels, locale and an optional fixed today to every date control below it. */
1051
- declare function DatePickerProvider({ labels, locale, today, children }: DatePickerProviderProps): React.ReactElement;
1059
+ declare function DatePickerProvider({ labels, locale, today, display, children }: DatePickerProviderProps): React.ReactElement;
1052
1060
 
1053
1061
  declare const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels;
1054
1062
 
@@ -1344,6 +1352,30 @@ type FocusableRefs<Field extends string> = Readonly<Record<Field, RefObject<Focu
1344
1352
  /** Returns a stable function that focuses the first listed field that is on screen. */
1345
1353
  declare function useFocusFirstInvalid<Field extends string>(refs: FocusableRefs<Field>): (invalid: readonly Field[]) => void;
1346
1354
 
1355
+ type CodeFormatter = (code: string, error: FieldError) => string | null | undefined;
1356
+ interface AssignedServerErrors<Field extends string> {
1357
+ byField: Partial<Record<Field, string>>;
1358
+ formError: string | null;
1359
+ matched: Field[];
1360
+ }
1361
+ /** Splits parsed server errors into the first message per known field and the first unmatched message. */
1362
+ declare function assignServerErrors<Field extends string>(errors: readonly FieldError[], fields: readonly Field[], formatCode?: CodeFormatter): AssignedServerErrors<Field>;
1363
+
1364
+ interface UseServerFieldErrorsOptions<Field extends string> {
1365
+ fields: readonly Field[];
1366
+ refs?: FocusableRefs<Field>;
1367
+ formatCode?: CodeFormatter;
1368
+ }
1369
+ interface ServerFieldErrors<Field extends string> {
1370
+ errorFor: (field: Field) => string | undefined;
1371
+ apply: (error: unknown) => boolean;
1372
+ clear: (field: Field) => void;
1373
+ formError: string | null;
1374
+ reset: () => void;
1375
+ }
1376
+ /** Binds a thrown 400 to form fields: the message under each known field, the rest on the form status line. */
1377
+ declare function useServerFieldErrors<Field extends string>(options: UseServerFieldErrorsOptions<Field>): ServerFieldErrors<Field>;
1378
+
1347
1379
  /** Scrolls the returned view fully into sight each time `trigger` takes a new value. */
1348
1380
  declare function useKeepInView(trigger: unknown): RefObject<View | null>;
1349
1381
 
@@ -1846,4 +1878,87 @@ declare const defaultDecisionVariant: (width: number) => DecisionPanelVariant;
1846
1878
  /** The outcomes with the lead one first; the rest keep their order. */
1847
1879
  declare const leadFirst: <T extends string>(outcomes: ReadonlyArray<DecisionOutcome<T>>, lead: T | undefined) => Array<DecisionOutcome<T>>;
1848
1880
 
1849
- export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AutoGrowRows, 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, FileInput, type FileInputProps, 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, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, 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, rowsForText, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };
1881
+ declare const enum PasswordRulesDisplay {
1882
+ Checklist = "checklist",
1883
+ MeterGrid = "meterGrid",
1884
+ Chips = "chips",
1885
+ Sentence = "sentence"
1886
+ }
1887
+
1888
+ interface PasswordRuleState {
1889
+ id: string;
1890
+ label: string;
1891
+ met: boolean;
1892
+ }
1893
+ interface PasswordFieldLabels {
1894
+ show: string;
1895
+ hide: string;
1896
+ met: string;
1897
+ unmet: string;
1898
+ }
1899
+ interface PasswordFieldColors {
1900
+ success: string;
1901
+ error: string;
1902
+ text: string;
1903
+ textSecondary: string;
1904
+ border: string;
1905
+ background: string;
1906
+ }
1907
+
1908
+ interface PasswordFieldProps {
1909
+ label: string;
1910
+ value: string;
1911
+ onChangeText: (value: string) => void;
1912
+ labels: PasswordFieldLabels;
1913
+ testID: string;
1914
+ rules?: readonly PasswordRuleState[];
1915
+ rulesDisplay?: PasswordRulesDisplay;
1916
+ flagUnmet?: boolean;
1917
+ error?: string;
1918
+ colors?: PasswordFieldColors;
1919
+ inputProps?: Omit<ThemedTextInputProps, 'value' | 'onChangeText' | 'secureTextEntry' | 'testID'>;
1920
+ }
1921
+ declare const PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<TextInput>>;
1922
+
1923
+ declare const enum RuleTone {
1924
+ Met = "met",
1925
+ Unmet = "unmet",
1926
+ Refused = "refused"
1927
+ }
1928
+ declare function ruleTone(met: boolean, flagUnmet: boolean): RuleTone;
1929
+
1930
+ interface RuleColors {
1931
+ mark: Record<RuleTone, string>;
1932
+ text: Record<RuleTone, string>;
1933
+ track: string;
1934
+ onMark: string;
1935
+ }
1936
+ declare function ruleColorsFrom(palette: PasswordFieldColors): RuleColors;
1937
+
1938
+ interface RuleVariantProps {
1939
+ rules: readonly PasswordRuleState[];
1940
+ flagUnmet: boolean;
1941
+ colors: RuleColors;
1942
+ testID: string;
1943
+ }
1944
+
1945
+ interface PasswordRulesProps extends RuleVariantProps {
1946
+ display: PasswordRulesDisplay;
1947
+ }
1948
+ declare function PasswordRules({ display, ...variant }: PasswordRulesProps): React.ReactElement;
1949
+
1950
+ interface RevealToggleProps {
1951
+ revealed: boolean;
1952
+ onToggle: () => void;
1953
+ onPressIn?: () => void;
1954
+ showLabel: string;
1955
+ hideLabel: string;
1956
+ color: string;
1957
+ testID: string;
1958
+ }
1959
+ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }: RevealToggleProps): React.ReactElement;
1960
+
1961
+ declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
1962
+ declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
1963
+
1964
+ export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, 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 CodeFormatter, 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, DateDisplay, 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, FileInput, type FileInputProps, 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, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, 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, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };