UNPKG

matrix-react-sdk

Version:
321 lines (320 loc) 16.9 kB
import React from 'react'; export declare type ButtonEvent = React.MouseEvent<Element> | React.KeyboardEvent<Element>; /** * children: React's magic prop. Represents all children given to the element. * element: (optional) The base element type. "div" by default. * onClick: (required) Event handler for button activation. Should be * implemented exactly like a normal onClick handler. */ interface IProps extends React.InputHTMLAttributes<Element> { inputRef?: React.Ref<Element>; element?: string; kind?: string; role?: string; tabIndex?: number; disabled?: boolean; className?: string; onClick(e?: ButtonEvent): void; } /** * AccessibleButton is a generic wrapper for any element that should be treated * as a button. Identifies the element as a button, setting proper tab * indexing and keyboard activation behavior. * * @param {Object} props react element properties * @returns {Object} rendered react */ declare function AccessibleButton({ element, onClick, children, kind, disabled, inputRef, className, ...restProps }: IProps): React.DOMElement<{ role?: string; tabIndex?: number; accept?: string; alt?: string; autoComplete?: string; autoFocus?: boolean; capture?: string | boolean; checked?: boolean; crossOrigin?: string; form?: string; formAction?: string; formEncType?: string; formMethod?: string; formNoValidate?: boolean; formTarget?: string; height?: string | number; list?: string; max?: string | number; maxLength?: number; min?: string | number; minLength?: number; multiple?: boolean; name?: string; pattern?: string; placeholder?: string; readOnly?: boolean; required?: boolean; size?: number; src?: string; step?: string | number; type?: string; value?: string | number | readonly string[]; width?: string | number; onChange?: (event: React.ChangeEvent<Element>) => void; defaultChecked?: boolean; defaultValue?: string | number | readonly string[]; suppressContentEditableWarning?: boolean; suppressHydrationWarning?: boolean; accessKey?: string; contentEditable?: boolean | "inherit" | "false" | "true"; contextMenu?: string; dir?: string; draggable?: boolean | "false" | "true"; hidden?: boolean; id?: string; lang?: string; slot?: string; spellCheck?: boolean | "false" | "true"; style?: React.CSSProperties; title?: string; translate?: "yes" | "no"; radioGroup?: string; about?: string; datatype?: string; inlist?: any; prefix?: string; property?: string; resource?: string; typeof?: string; vocab?: string; autoCapitalize?: string; autoCorrect?: string; autoSave?: string; color?: string; itemProp?: string; itemScope?: boolean; itemType?: string; itemID?: string; itemRef?: string; results?: number; security?: string; unselectable?: "on" | "off"; inputMode?: "search" | "none" | "text" | "decimal" | "numeric" | "tel" | "url" | "email"; is?: string; 'aria-activedescendant'?: string; 'aria-atomic'?: boolean | "false" | "true"; 'aria-autocomplete'?: "both" | "none" | "inline" | "list"; 'aria-busy'?: boolean | "false" | "true"; 'aria-checked'?: boolean | "mixed" | "false" | "true"; 'aria-colcount'?: number; 'aria-colindex'?: number; 'aria-colspan'?: number; 'aria-controls'?: string; 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date"; 'aria-describedby'?: string; 'aria-details'?: string; 'aria-disabled'?: boolean | "false" | "true"; 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup"; 'aria-errormessage'?: string; 'aria-expanded'?: boolean | "false" | "true"; 'aria-flowto'?: string; 'aria-grabbed'?: boolean | "false" | "true"; 'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree"; 'aria-hidden'?: boolean | "false" | "true"; 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling"; 'aria-keyshortcuts'?: string; 'aria-label'?: string; 'aria-labelledby'?: string; 'aria-level'?: number; 'aria-live'?: "off" | "assertive" | "polite"; 'aria-modal'?: boolean | "false" | "true"; 'aria-multiline'?: boolean | "false" | "true"; 'aria-multiselectable'?: boolean | "false" | "true"; 'aria-orientation'?: "horizontal" | "vertical"; 'aria-owns'?: string; 'aria-placeholder'?: string; 'aria-posinset'?: number; 'aria-pressed'?: boolean | "mixed" | "false" | "true"; 'aria-readonly'?: boolean | "false" | "true"; 'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"; 'aria-required'?: boolean | "false" | "true"; 'aria-roledescription'?: string; 'aria-rowcount'?: number; 'aria-rowindex'?: number; 'aria-rowspan'?: number; 'aria-selected'?: boolean | "false" | "true"; 'aria-setsize'?: number; 'aria-sort'?: "none" | "other" | "ascending" | "descending"; 'aria-valuemax'?: number; 'aria-valuemin'?: number; 'aria-valuenow'?: number; 'aria-valuetext'?: string; dangerouslySetInnerHTML?: { __html: string; }; onCopy?: (event: React.ClipboardEvent<Element>) => void; onCopyCapture?: (event: React.ClipboardEvent<Element>) => void; onCut?: (event: React.ClipboardEvent<Element>) => void; onCutCapture?: (event: React.ClipboardEvent<Element>) => void; onPaste?: (event: React.ClipboardEvent<Element>) => void; onPasteCapture?: (event: React.ClipboardEvent<Element>) => void; onCompositionEnd?: (event: React.CompositionEvent<Element>) => void; onCompositionEndCapture?: (event: React.CompositionEvent<Element>) => void; onCompositionStart?: (event: React.CompositionEvent<Element>) => void; onCompositionStartCapture?: (event: React.CompositionEvent<Element>) => void; onCompositionUpdate?: (event: React.CompositionEvent<Element>) => void; onCompositionUpdateCapture?: (event: React.CompositionEvent<Element>) => void; onFocus?: (event: React.FocusEvent<Element>) => void; onFocusCapture?: (event: React.FocusEvent<Element>) => void; onBlur?: (event: React.FocusEvent<Element>) => void; onBlurCapture?: (event: React.FocusEvent<Element>) => void; onChangeCapture?: (event: React.FormEvent<Element>) => void; onBeforeInput?: (event: React.FormEvent<Element>) => void; onBeforeInputCapture?: (event: React.FormEvent<Element>) => void; onInput?: (event: React.FormEvent<Element>) => void; onInputCapture?: (event: React.FormEvent<Element>) => void; onReset?: (event: React.FormEvent<Element>) => void; onResetCapture?: (event: React.FormEvent<Element>) => void; onSubmit?: (event: React.FormEvent<Element>) => void; onSubmitCapture?: (event: React.FormEvent<Element>) => void; onInvalid?: (event: React.FormEvent<Element>) => void; onInvalidCapture?: (event: React.FormEvent<Element>) => void; onLoad?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onError?: (event: React.SyntheticEvent<Element, Event>) => void; onErrorCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onKeyDown?: (event: React.KeyboardEvent<Element>) => void; onKeyDownCapture?: (event: React.KeyboardEvent<Element>) => void; onKeyPress?: (event: React.KeyboardEvent<Element>) => void; onKeyPressCapture?: (event: React.KeyboardEvent<Element>) => void; onKeyUp?: (event: React.KeyboardEvent<Element>) => void; onKeyUpCapture?: (event: React.KeyboardEvent<Element>) => void; onAbort?: (event: React.SyntheticEvent<Element, Event>) => void; onAbortCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onCanPlay?: (event: React.SyntheticEvent<Element, Event>) => void; onCanPlayCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onCanPlayThrough?: (event: React.SyntheticEvent<Element, Event>) => void; onCanPlayThroughCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onDurationChange?: (event: React.SyntheticEvent<Element, Event>) => void; onDurationChangeCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onEmptied?: (event: React.SyntheticEvent<Element, Event>) => void; onEmptiedCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onEncrypted?: (event: React.SyntheticEvent<Element, Event>) => void; onEncryptedCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onEnded?: (event: React.SyntheticEvent<Element, Event>) => void; onEndedCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadedData?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadedDataCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadedMetadata?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadedMetadataCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadStart?: (event: React.SyntheticEvent<Element, Event>) => void; onLoadStartCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onPause?: (event: React.SyntheticEvent<Element, Event>) => void; onPauseCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onPlay?: (event: React.SyntheticEvent<Element, Event>) => void; onPlayCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onPlaying?: (event: React.SyntheticEvent<Element, Event>) => void; onPlayingCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onProgress?: (event: React.SyntheticEvent<Element, Event>) => void; onProgressCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onRateChange?: (event: React.SyntheticEvent<Element, Event>) => void; onRateChangeCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onSeeked?: (event: React.SyntheticEvent<Element, Event>) => void; onSeekedCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onSeeking?: (event: React.SyntheticEvent<Element, Event>) => void; onSeekingCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onStalled?: (event: React.SyntheticEvent<Element, Event>) => void; onStalledCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onSuspend?: (event: React.SyntheticEvent<Element, Event>) => void; onSuspendCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onTimeUpdate?: (event: React.SyntheticEvent<Element, Event>) => void; onTimeUpdateCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onVolumeChange?: (event: React.SyntheticEvent<Element, Event>) => void; onVolumeChangeCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onWaiting?: (event: React.SyntheticEvent<Element, Event>) => void; onWaitingCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onAuxClick?: (event: React.MouseEvent<Element, MouseEvent>) => void; onAuxClickCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onClickCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onContextMenu?: (event: React.MouseEvent<Element, MouseEvent>) => void; onContextMenuCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onDoubleClick?: (event: React.MouseEvent<Element, MouseEvent>) => void; onDoubleClickCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onDrag?: (event: React.DragEvent<Element>) => void; onDragCapture?: (event: React.DragEvent<Element>) => void; onDragEnd?: (event: React.DragEvent<Element>) => void; onDragEndCapture?: (event: React.DragEvent<Element>) => void; onDragEnter?: (event: React.DragEvent<Element>) => void; onDragEnterCapture?: (event: React.DragEvent<Element>) => void; onDragExit?: (event: React.DragEvent<Element>) => void; onDragExitCapture?: (event: React.DragEvent<Element>) => void; onDragLeave?: (event: React.DragEvent<Element>) => void; onDragLeaveCapture?: (event: React.DragEvent<Element>) => void; onDragOver?: (event: React.DragEvent<Element>) => void; onDragOverCapture?: (event: React.DragEvent<Element>) => void; onDragStart?: (event: React.DragEvent<Element>) => void; onDragStartCapture?: (event: React.DragEvent<Element>) => void; onDrop?: (event: React.DragEvent<Element>) => void; onDropCapture?: (event: React.DragEvent<Element>) => void; onMouseDown?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseDownCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseEnter?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseLeave?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseMove?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseMoveCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseOut?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseOutCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseOver?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseOverCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseUp?: (event: React.MouseEvent<Element, MouseEvent>) => void; onMouseUpCapture?: (event: React.MouseEvent<Element, MouseEvent>) => void; onSelect?: (event: React.SyntheticEvent<Element, Event>) => void; onSelectCapture?: (event: React.SyntheticEvent<Element, Event>) => void; onTouchCancel?: (event: React.TouchEvent<Element>) => void; onTouchCancelCapture?: (event: React.TouchEvent<Element>) => void; onTouchEnd?: (event: React.TouchEvent<Element>) => void; onTouchEndCapture?: (event: React.TouchEvent<Element>) => void; onTouchMove?: (event: React.TouchEvent<Element>) => void; onTouchMoveCapture?: (event: React.TouchEvent<Element>) => void; onTouchStart?: (event: React.TouchEvent<Element>) => void; onTouchStartCapture?: (event: React.TouchEvent<Element>) => void; onPointerDown?: (event: React.PointerEvent<Element>) => void; onPointerDownCapture?: (event: React.PointerEvent<Element>) => void; onPointerMove?: (event: React.PointerEvent<Element>) => void; onPointerMoveCapture?: (event: React.PointerEvent<Element>) => void; onPointerUp?: (event: React.PointerEvent<Element>) => void; onPointerUpCapture?: (event: React.PointerEvent<Element>) => void; onPointerCancel?: (event: React.PointerEvent<Element>) => void; onPointerCancelCapture?: (event: React.PointerEvent<Element>) => void; onPointerEnter?: (event: React.PointerEvent<Element>) => void; onPointerEnterCapture?: (event: React.PointerEvent<Element>) => void; onPointerLeave?: (event: React.PointerEvent<Element>) => void; onPointerLeaveCapture?: (event: React.PointerEvent<Element>) => void; onPointerOver?: (event: React.PointerEvent<Element>) => void; onPointerOverCapture?: (event: React.PointerEvent<Element>) => void; onPointerOut?: (event: React.PointerEvent<Element>) => void; onPointerOutCapture?: (event: React.PointerEvent<Element>) => void; onGotPointerCapture?: (event: React.PointerEvent<Element>) => void; onGotPointerCaptureCapture?: (event: React.PointerEvent<Element>) => void; onLostPointerCapture?: (event: React.PointerEvent<Element>) => void; onLostPointerCaptureCapture?: (event: React.PointerEvent<Element>) => void; onScroll?: (event: React.UIEvent<Element, UIEvent>) => void; onScrollCapture?: (event: React.UIEvent<Element, UIEvent>) => void; onWheel?: (event: React.WheelEvent<Element>) => void; onWheelCapture?: (event: React.WheelEvent<Element>) => void; onAnimationStart?: (event: React.AnimationEvent<Element>) => void; onAnimationStartCapture?: (event: React.AnimationEvent<Element>) => void; onAnimationEnd?: (event: React.AnimationEvent<Element>) => void; onAnimationEndCapture?: (event: React.AnimationEvent<Element>) => void; onAnimationIteration?: (event: React.AnimationEvent<Element>) => void; onAnimationIterationCapture?: (event: React.AnimationEvent<Element>) => void; onTransitionEnd?: (event: React.TransitionEvent<Element>) => void; onTransitionEndCapture?: (event: React.TransitionEvent<Element>) => void; }, Element>; declare namespace AccessibleButton { var defaultProps: { element: string; role: string; tabIndex: number; }; var displayName: string; } export default AccessibleButton;