@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
34 lines (30 loc) • 1.04 kB
JavaScript
"use client";
import { createComponent } from "../../core/components/create-component.js";
import { useFieldProps } from "../field/use-field-props.js";
import { inputStyle } from "./input.style.js";
import { useInputBorder } from "./use-input-border.js";
//#region src/components/input/input.tsx
const { PropsContext: InputPropsContext, usePropsContext: useInputPropsContext, withContext } = createComponent("input", inputStyle);
/**
* `Input` is a component used to obtain text input from the user.
*
* @see https://yamada-ui.com/docs/components/input
*/
const Input = withContext("input")(void 0, (props) => {
const { props: { errorBorderColor, focusBorderColor, htmlSize,...rest }, ariaProps, dataProps, eventProps } = useFieldProps(props);
const varProps = useInputBorder({
errorBorderColor,
focusBorderColor
});
return {
size: htmlSize,
...ariaProps,
...dataProps,
...eventProps,
...varProps,
...rest
};
});
//#endregion
export { Input, InputPropsContext, useInputPropsContext };
//# sourceMappingURL=input.js.map