UNPKG

@lanaco/lnc-react-ui

Version:

React component library

18 lines (16 loc) 1.24 kB
"use strict";const h=require("react/jsx-runtime"),b=require("react"),y=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),r=require("./utils-BK6B_Y9X.cjs"),z=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),t=e=>e=="large"?"2rem":e=="medium"?"1.75rem":"1.5rem",R=y.styled.div` ${e=>r.getComponentTypographyCss(e.theme,"Badge",e.size,"enabled")}; background-color: ${e=>r.getColorRgbaValue(e.theme,"Badge",e.color,"enabled","background","backgroundOpacity")}; color: ${e=>r.getColorRgbaValue(e.theme,"Badge",e.color,"enabled","text")}; border-radius: ${e=>r.getBorderRadiusValueWithUnits(e.theme,e.borderRadius)}; display: inline-flex; min-width: ${e=>t(e.size)}; min-height: ${e=>t(e.size)}; max-height: ${e=>t(e.size)}; justify-content: center; align-items: center; padding: 0.313rem; & i { font-size: ${e=>e.size=="small"?"0.75rem":e.size=="medium"?"0.875rem":"1rem"}; } `,$=b.forwardRef((e,i)=>{const{borderRadius:s="curved",onClick:n=()=>{},className:o="",style:a={},color:d="primary",size:m="small",children:l,...c}=e,u=z.useTheme(),g={borderRadius:s,theme:u,size:m,color:d,className:"lnc-ui-badge "+o,style:a};return h.jsx(R,{ref:i,...g,onClick:n,...c,children:l})});module.exports=$;