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

38 lines (37 loc) 1.41 kB
import { jsxs as i, Fragment as m, jsx as e } from "react/jsx-runtime"; import { StyledPopover as h } from "../../styled/StyledPopover.js"; import { HelpTwoTone as x, HelpOutline as f } from "@mui/icons-material"; import { Collapse as u, Tooltip as v, IconButton as B } from "@mui/material"; import { useState as C } from "react"; function H(p) { const { hideLabel: r = !1, fieldLabel: a, description: o, registry: l, children: s } = p, t = l.formContext.descriptionVariant || "popover", [n, d] = C(!1); return /* @__PURE__ */ i(m, { children: [ !r && /* @__PURE__ */ i("div", { className: "LabelContainer", children: [ a, o && t === "popover" && /* @__PURE__ */ e(h, { popoverContent: o, maxWidth: "350px", children: /* @__PURE__ */ e(x, { className: "HelpButton" }) }), o && t === "expand" && /* @__PURE__ */ e(v, { title: "More Info", children: /* @__PURE__ */ e( B, { onClick: (c) => { c.preventDefault(), d(!n); }, "aria-expanded": n, size: "small", children: /* @__PURE__ */ e(f, { color: "primary", sx: { width: "16px", height: "16px" } }) } ) }) ] }), s, !r && t === "expand" && /* @__PURE__ */ e(u, { className: "field-description", in: n, children: o }) ] }); } export { H as RJSFInputLabelWrapper }; //# sourceMappingURL=RJSFInputLabel.js.map