UNPKG

norma-library

Version:

Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.

16 lines 888 B
import React, { useState } from "react"; import * as S from "./styles"; var TextInput = function (_a) { var label = _a.label, className = _a.className, onChange = _a.onChange, disabled = _a.disabled, placeholder = _a.placeholder, name = _a.name, type = _a.type, value = _a.value; var _b = useState(value), valueSelected = _b[0], setValueSelected = _b[1]; var changeValue = function (event) { var value = event.target.value; setValueSelected(value); onChange(event); }; return (React.createElement(S.Container, { className: className }, React.createElement(S.Label, null, label), React.createElement(S.Input, { type: type, name: name, value: valueSelected, placeholder: placeholder, disabled: disabled, onChange: function (event) { return changeValue(event); } }))); }; export default TextInput; //# sourceMappingURL=index.js.map