@lanaco/lnc-react-ui
Version:
React component library
12 lines (11 loc) • 940 B
JavaScript
;const t=require("react/jsx-runtime"),n=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),l=require("./utils-BK6B_Y9X.cjs"),b=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),y=n.styled.label`
display: block;
margin-bottom: 4px;
${e=>l.getComponentTypographyCss(e.theme,"FormField",e.size,"enabled")}
color: ${e=>l.getColorRgbaValue(e.theme,"FormField","primary","enabled","label")};
`,h=n.styled.span`
display: block;
margin-top: 8px;
${e=>l.getComponentTypographyCss(e.theme,"FormField",e.size,"enabled")}
color: ${e=>l.getColorRgbaValue(e.theme,"FormField",e.color,"enabled","text")};
`,u=e=>{const{size:o="small",color:m="primary",className:a="",style:c={},text:s="",label:r="",children:d}=e,i=b.useTheme();return t.jsxs("div",{style:c,className:"lnc-ui-form-field "+a,children:[r&&t.jsx(y,{theme:i,size:o,children:r}),d,s&&t.jsx(h,{size:o,theme:i,color:m,children:s})]})};module.exports=u;