import type * as React from 'react'; import { TextInputProps } from './TextInput'; /** * Function for taking raw input and formatting it for a label mask. Passing `true` to * `valueOnly` will return just the formatted value entered. */ export type MaskFunction = (rawInput: string, valueOnly?: boolean) => string; /** * Regular expressions for matching commonly used masks, ensure capture groups are * set for each set of items that are separated by a delimiter, delimiters are * optional and so should be shown as well with the `?` optional flag. */ export declare const RE_DATE: RegExp; export declare const RE_PHONE: RegExp; export declare const RE_SSN: RegExp; export declare const RE_ZIP: RegExp; export declare const RE_CURRENCY: RegExp; /** * The date mask automatically pads months and days that are one digit */ export declare const DATE_MASK: MaskFunction; /** * Formatting for US phone numbers */ export declare const PHONE_MASK: MaskFunction; /** * Formatting for US Postal codes, this could be expanded to allow for 9 digit numbers */ export declare const ZIP_MASK: MaskFunction; /** * Formatting for social security numbers. */ export declare const SSN_MASK: MaskFunction; /** * Does the same thing as SSN_MASK except that it obfuscates the first five digits */ export declare const SSN_MASK_OBFUSCATED: MaskFunction; /** * Currency mask is a little different, we need to modify the incoming content to strip * out any commas or dollar signs before evaluating it via the Intl.NumberFormat function. */ export declare const CURRENCY_MASK: (rawInput?: string, valueOnly?: boolean) => string; export declare function useLabelMask(maskFn: MaskFunction, originalInputProps: TextInputProps): { labelMask: import("react/jsx-runtime").JSX.Element; inputProps: { defaultValue: any; value: string; onChange: (e: React.ChangeEvent) => void; onFocus: (e: React.FocusEvent) => void; onBlur: (e: React.FocusEvent) => void; type: string; inputMode: "numeric"; 'aria-describedby': string; form?: string | undefined; slot?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; min?: number | string | undefined; prefix?: string | undefined; className?: string | undefined; children?: React.ReactNode | undefined; id?: string | undefined; suppressHydrationWarning?: boolean | undefined; color?: string | undefined; height?: number | string | undefined; lang?: string | undefined; max?: number | string | undefined; name?: string | undefined; width?: number | string | undefined; role?: React.AriaRole | undefined; tabIndex?: number | undefined; "aria-activedescendant"?: string | undefined; "aria-atomic"?: (boolean | "true" | "false") | undefined; "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined; "aria-braillelabel"?: string | undefined; "aria-brailleroledescription"?: string | undefined; "aria-busy"?: (boolean | "true" | "false") | undefined; "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined; "aria-colcount"?: number | undefined; "aria-colindex"?: number | undefined; "aria-colindextext"?: string | undefined; "aria-colspan"?: number | undefined; "aria-controls"?: string | undefined; "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined; "aria-description"?: string | undefined; "aria-details"?: string | undefined; "aria-disabled"?: (boolean | "true" | "false") | undefined; "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined; "aria-errormessage"?: string | undefined; "aria-expanded"?: (boolean | "true" | "false") | undefined; "aria-flowto"?: string | undefined; "aria-grabbed"?: (boolean | "true" | "false") | undefined; "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined; "aria-hidden"?: (boolean | "true" | "false") | undefined; "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined; "aria-keyshortcuts"?: string | undefined; "aria-label"?: string | undefined; "aria-labelledby"?: string | undefined; "aria-level"?: number | undefined; "aria-live"?: "off" | "assertive" | "polite" | undefined; "aria-modal"?: (boolean | "true" | "false") | undefined; "aria-multiline"?: (boolean | "true" | "false") | undefined; "aria-multiselectable"?: (boolean | "true" | "false") | undefined; "aria-orientation"?: "horizontal" | "vertical" | undefined; "aria-owns"?: string | undefined; "aria-placeholder"?: string | undefined; "aria-posinset"?: number | undefined; "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined; "aria-readonly"?: (boolean | "true" | "false") | undefined; "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined; "aria-required"?: (boolean | "true" | "false") | undefined; "aria-roledescription"?: string | undefined; "aria-rowcount"?: number | undefined; "aria-rowindex"?: number | undefined; "aria-rowindextext"?: string | undefined; "aria-rowspan"?: number | undefined; "aria-selected"?: (boolean | "true" | "false") | undefined; "aria-setsize"?: number | undefined; "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined; "aria-valuemax"?: number | undefined; "aria-valuemin"?: number | undefined; "aria-valuenow"?: number | undefined; "aria-valuetext"?: string | undefined; dangerouslySetInnerHTML?: { __html: string | TrustedHTML; } | undefined; onCopy?: React.ClipboardEventHandler; onCopyCapture?: React.ClipboardEventHandler; onCut?: React.ClipboardEventHandler; onCutCapture?: React.ClipboardEventHandler; onPaste?: React.ClipboardEventHandler; onPasteCapture?: React.ClipboardEventHandler; onCompositionEnd?: React.CompositionEventHandler; onCompositionEndCapture?: React.CompositionEventHandler; onCompositionStart?: React.CompositionEventHandler; onCompositionStartCapture?: React.CompositionEventHandler; onCompositionUpdate?: React.CompositionEventHandler; onCompositionUpdateCapture?: React.CompositionEventHandler; onFocusCapture?: React.FocusEventHandler; onBlurCapture?: React.FocusEventHandler; onChangeCapture?: React.FormEventHandler; onBeforeInput?: React.FormEventHandler; onBeforeInputCapture?: React.FormEventHandler; onInput?: React.FormEventHandler; onInputCapture?: React.FormEventHandler; onReset?: React.FormEventHandler; onResetCapture?: React.FormEventHandler; onSubmit?: React.FormEventHandler; onSubmitCapture?: React.FormEventHandler; onInvalid?: React.FormEventHandler; onInvalidCapture?: React.FormEventHandler; onLoad?: React.ReactEventHandler; onLoadCapture?: React.ReactEventHandler; onError?: React.ReactEventHandler; onErrorCapture?: React.ReactEventHandler; onKeyDown?: React.KeyboardEventHandler; onKeyDownCapture?: React.KeyboardEventHandler; onKeyPress?: React.KeyboardEventHandler; onKeyPressCapture?: React.KeyboardEventHandler; onKeyUp?: React.KeyboardEventHandler; onKeyUpCapture?: React.KeyboardEventHandler; onAbort?: React.ReactEventHandler; onAbortCapture?: React.ReactEventHandler; onCanPlay?: React.ReactEventHandler; onCanPlayCapture?: React.ReactEventHandler; onCanPlayThrough?: React.ReactEventHandler; onCanPlayThroughCapture?: React.ReactEventHandler; onDurationChange?: React.ReactEventHandler; onDurationChangeCapture?: React.ReactEventHandler; onEmptied?: React.ReactEventHandler; onEmptiedCapture?: React.ReactEventHandler; onEncrypted?: React.ReactEventHandler; onEncryptedCapture?: React.ReactEventHandler; onEnded?: React.ReactEventHandler; onEndedCapture?: React.ReactEventHandler; onLoadedData?: React.ReactEventHandler; onLoadedDataCapture?: React.ReactEventHandler; onLoadedMetadata?: React.ReactEventHandler; onLoadedMetadataCapture?: React.ReactEventHandler; onLoadStart?: React.ReactEventHandler; onLoadStartCapture?: React.ReactEventHandler; onPause?: React.ReactEventHandler; onPauseCapture?: React.ReactEventHandler; onPlay?: React.ReactEventHandler; onPlayCapture?: React.ReactEventHandler; onPlaying?: React.ReactEventHandler; onPlayingCapture?: React.ReactEventHandler; onProgress?: React.ReactEventHandler; onProgressCapture?: React.ReactEventHandler; onRateChange?: React.ReactEventHandler; onRateChangeCapture?: React.ReactEventHandler; onResize?: React.ReactEventHandler; onResizeCapture?: React.ReactEventHandler; onSeeked?: React.ReactEventHandler; onSeekedCapture?: React.ReactEventHandler; onSeeking?: React.ReactEventHandler; onSeekingCapture?: React.ReactEventHandler; onStalled?: React.ReactEventHandler; onStalledCapture?: React.ReactEventHandler; onSuspend?: React.ReactEventHandler; onSuspendCapture?: React.ReactEventHandler; onTimeUpdate?: React.ReactEventHandler; onTimeUpdateCapture?: React.ReactEventHandler; onVolumeChange?: React.ReactEventHandler; onVolumeChangeCapture?: React.ReactEventHandler; onWaiting?: React.ReactEventHandler; onWaitingCapture?: React.ReactEventHandler; onAuxClick?: React.MouseEventHandler; onAuxClickCapture?: React.MouseEventHandler; onClick?: React.MouseEventHandler; onClickCapture?: React.MouseEventHandler; onContextMenu?: React.MouseEventHandler; onContextMenuCapture?: React.MouseEventHandler; onDoubleClick?: React.MouseEventHandler; onDoubleClickCapture?: React.MouseEventHandler; onDrag?: React.DragEventHandler; onDragCapture?: React.DragEventHandler; onDragEnd?: React.DragEventHandler; onDragEndCapture?: React.DragEventHandler; onDragEnter?: React.DragEventHandler; onDragEnterCapture?: React.DragEventHandler; onDragExit?: React.DragEventHandler; onDragExitCapture?: React.DragEventHandler; onDragLeave?: React.DragEventHandler; onDragLeaveCapture?: React.DragEventHandler; onDragOver?: React.DragEventHandler; onDragOverCapture?: React.DragEventHandler; onDragStart?: React.DragEventHandler; onDragStartCapture?: React.DragEventHandler; onDrop?: React.DragEventHandler; onDropCapture?: React.DragEventHandler; onMouseDown?: React.MouseEventHandler; onMouseDownCapture?: React.MouseEventHandler; onMouseEnter?: React.MouseEventHandler; onMouseLeave?: React.MouseEventHandler; onMouseMove?: React.MouseEventHandler; onMouseMoveCapture?: React.MouseEventHandler; onMouseOut?: React.MouseEventHandler; onMouseOutCapture?: React.MouseEventHandler; onMouseOver?: React.MouseEventHandler; onMouseOverCapture?: React.MouseEventHandler; onMouseUp?: React.MouseEventHandler; onMouseUpCapture?: React.MouseEventHandler; onSelect?: React.ReactEventHandler; onSelectCapture?: React.ReactEventHandler; onTouchCancel?: React.TouchEventHandler; onTouchCancelCapture?: React.TouchEventHandler; onTouchEnd?: React.TouchEventHandler; onTouchEndCapture?: React.TouchEventHandler; onTouchMove?: React.TouchEventHandler; onTouchMoveCapture?: React.TouchEventHandler; onTouchStart?: React.TouchEventHandler; onTouchStartCapture?: React.TouchEventHandler; onPointerDown?: React.PointerEventHandler; onPointerDownCapture?: React.PointerEventHandler; onPointerMove?: React.PointerEventHandler; onPointerMoveCapture?: React.PointerEventHandler; onPointerUp?: React.PointerEventHandler; onPointerUpCapture?: React.PointerEventHandler; onPointerCancel?: React.PointerEventHandler; onPointerCancelCapture?: React.PointerEventHandler; onPointerEnter?: React.PointerEventHandler; onPointerLeave?: React.PointerEventHandler; onPointerOver?: React.PointerEventHandler; onPointerOverCapture?: React.PointerEventHandler; onPointerOut?: React.PointerEventHandler; onPointerOutCapture?: React.PointerEventHandler; onGotPointerCapture?: React.PointerEventHandler; onGotPointerCaptureCapture?: React.PointerEventHandler; onLostPointerCapture?: React.PointerEventHandler; onLostPointerCaptureCapture?: React.PointerEventHandler; onScroll?: React.UIEventHandler; onScrollCapture?: React.UIEventHandler; onWheel?: React.WheelEventHandler; onWheelCapture?: React.WheelEventHandler; onAnimationStart?: React.AnimationEventHandler; onAnimationStartCapture?: React.AnimationEventHandler; onAnimationEnd?: React.AnimationEventHandler; onAnimationEndCapture?: React.AnimationEventHandler; onAnimationIteration?: React.AnimationEventHandler; onAnimationIterationCapture?: React.AnimationEventHandler; onTransitionEnd?: React.TransitionEventHandler; onTransitionEndCapture?: React.TransitionEventHandler; key?: React.Key | null | undefined; list?: string | undefined; step?: number | string | undefined; hidden?: boolean | undefined; pattern?: string | undefined; defaultChecked?: boolean | undefined; suppressContentEditableWarning?: boolean | undefined; accessKey?: string | undefined; autoFocus?: boolean | undefined; contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: (boolean | "true" | "false") | undefined; nonce?: string | undefined; spellCheck?: (boolean | "true" | "false") | undefined; translate?: "yes" | "no" | undefined; radioGroup?: string | undefined; about?: string | undefined; content?: string | undefined; datatype?: string | undefined; inlist?: any; property?: string | undefined; rel?: string | undefined; resource?: string | undefined; rev?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: "on" | "off" | undefined; is?: string | undefined; disabled?: boolean | undefined; checked?: boolean | undefined; formAction?: string | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined; formEncType?: string | undefined; formMethod?: string | undefined; formNoValidate?: boolean | undefined; formTarget?: string | undefined; multiple?: boolean | undefined; placeholder?: string | undefined; autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined; accept?: string | undefined; alt?: string | undefined; capture?: boolean | "user" | "environment" | undefined; enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined; maxLength?: number | undefined; minLength?: number | undefined; readOnly?: boolean | undefined; required?: boolean | undefined; src?: string | undefined; ariaLabel?: string; fieldClassName?: string; inversed?: boolean; multiline?: boolean; numeric?: boolean; rows?: import("./TextInput").TextInputRows; inputRef?: React.Ref | React.MutableRefObject; size?: import("./TextInput").TextInputSize; }; }; export default useLabelMask;