UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

35 lines (34 loc) 1.08 kB
import { jsx as t, Fragment as m, jsxs as d } from "react/jsx-runtime"; import { StyledFormControl as a } from "../styled/StyledFormControl.js"; import { InputLabel as c, InputBase as s } from "@mui/material"; import { useId as u, useMemo as f } from "react"; function I(e) { const n = u(), { noWrapInFormControl: o, label: h, ...l } = e, i = f( () => o ? (r) => /* @__PURE__ */ t(m, { children: r.children }) : (r) => /* @__PURE__ */ t(a, { fullWidth: !0, sx: { my: 1 }, children: r.children }), [o] ); return /* @__PURE__ */ d(i, { children: [ e.label && /* @__PURE__ */ t( c, { htmlFor: e.id || n, sx: { fontWeight: 700, mb: "4px", pointerEvents: "unset", "&::after": ({ palette: r }) => ({ content: e.required ? '"*"' : void 0, marginLeft: "3px", color: r.secondary.main }) }, children: e.label } ), /* @__PURE__ */ t(s, { id: n, ...l }) ] }); } export { I as default }; //# sourceMappingURL=TextField.js.map