UNPKG

@spark-web/text-input

Version:

--- title: Text Input storybookPath: forms-textinput--default isExperimentalPackage: false ---

47 lines (46 loc) 1.6 kB
import type { ReactElement } from 'react'; declare type InputAdornmentContextType = { placement: PlacementType; }; export declare const useInputAdornmentContext: () => InputAdornmentContextType | null; declare const placementToPadding: { readonly start: { readonly paddingLeft: "medium"; readonly paddingRight: "xsmall"; }; readonly end: { readonly paddingLeft: "xsmall"; readonly paddingRight: "medium"; }; }; declare type PlacementType = keyof typeof placementToPadding; export declare type InputAdornmentProps = { children: ReactElement; /** * When using another input component as an adornment, you may optionally * override the parent field label. */ fieldLabel?: string; /** Where to place the adornment. */ placement: PlacementType; /** * By default, the adornment element will be wrapped to provide alignment and * spacing, use the "raw" property to opt-out of this behaviour. */ raw?: boolean; }; /** * Places an element at the "start" or "end" of the input, only one adornment * may be provided for each placement. By default, the adornment element will be * wrapped to provide alignment and spacing, use the "raw" property to opt-out * of this behaviour. * * @example * <TextInput> * <InputAdornment placement="start"> * <Text tone="placeholder">$</Text> * </InputAdornment> * </TextInput> */ export declare const InputAdornment: ({ children, fieldLabel, placement, raw, }: InputAdornmentProps) => import("@emotion/react/jsx-runtime").JSX.Element; export {};