@lanaco/lnc-react-ui
Version:
React component library
12 lines (11 loc) • 1.26 kB
JavaScript
;const s=require("react/jsx-runtime"),r=require("./index-BPVoEhTF.cjs"),a=require("./emotion-styled.browser.esm-Cle7tAM9.cjs"),o=require("./utils-NZLCh-J5.cjs"),b=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),g=a.newStyled.label`
display: block;
margin-bottom: 4px;
${e=>o.getComponentTypographyCss(e.theme,"FormField",e.size,"enabled")}
color: ${e=>o.getColorRgbaValue(e.theme,"FormField","primary","enabled","label")};
`,u=a.newStyled.span`
display: block;
margin-top: 8px;
${e=>o.getComponentTypographyCss(e.theme,"FormField",e.size,"enabled")}
color: ${e=>o.getColorRgbaValue(e.theme,"FormField",e.color,"enabled","text")};
`,m=e=>{const{size:l="small",color:c="primary",className:d="",style:p={},text:t="",label:n="",children:y,...h}=e,i=b.useTheme();return s.jsxs("div",{style:p,className:"lnc-ui-form-field "+d,children:[n&&s.jsx(g,{theme:i,size:l,children:n}),y,t&&s.jsx(u,{size:l,theme:i,color:c,children:t})]})};m.propTypes={text:r.PropTypes.string,label:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"]),style:r.PropTypes.object,className:r.PropTypes.string};module.exports=m;