1 | import * as React from "react";
|
2 | import { createComponent } from "reakit-system/createComponent";
|
3 | import { createHook } from "reakit-system/createHook";
|
4 | import {
|
5 | TabbableOptions,
|
6 | TabbableHTMLProps,
|
7 | useTabbable,
|
8 | } from "../Tabbable/Tabbable";
|
9 | import { INPUT_KEYS } from "./__keys";
|
10 |
|
11 | export type InputOptions = TabbableOptions;
|
12 |
|
13 | export type InputHTMLProps = TabbableHTMLProps & React.InputHTMLAttributes<any>;
|
14 |
|
15 | export type InputProps = InputOptions & InputHTMLProps;
|
16 |
|
17 | export const useInput = createHook<InputOptions, InputHTMLProps>({
|
18 | name: "Input",
|
19 | compose: useTabbable,
|
20 | keys: INPUT_KEYS,
|
21 | });
|
22 |
|
23 | export const Input = createComponent({
|
24 | as: "input",
|
25 | memo: true,
|
26 | useHook: useInput,
|
27 | });
|