UNPKG

@rdsaude/pulso-react-components

Version:

Biblioteca de componentes React do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.

7 lines 2.89 kB
import{a as x}from"./chunk-UIRO4VLM.js";import{a as i}from"./chunk-V5IX4U5J.js";import{createContextScope as L}from"@radix-ui/react-context";import{jsx as y}from"react/jsx-runtime";var T=l=>{let{symbol:a,__scopeTag:t}=l,{variants:e}=n(o,t),r={principal:"colorLabelingTextPrincipalDefault",secondary:"colorLabelingTextSecondaryDefault",onSale:"colorLabelingTextOnsaleDefault",clubeDrogasil:"colorLabelingTextClubeDefault",clubeRaia:"colorLabelingTextClubeDefault",assinatura:"colorLabelingTextAssinaturaDefault",medicamentoGeladeira:"colorLabelingTextRefrigerateDefault",receitaObrigatoria:"colorLabelingTextPrescriptionDefault",generico:"colorLabelingTextGenericoDefault",referencia:"colorLabelingTextReferenciaDefault",similar:"colorLabelingTextSimilarDefault",stix:"colorLabelingTextStixDefault"};return y(x,{symbol:e==="onSale"?"rdicon-arrow-down":a,color:r[e],size:"tiny","data-testid":"tag-icon"})};var m=i({base:` h-extrasmall font-semibold text-threepulse font-rdmodern leading-medium text-center whitespace-nowrap truncate `,variants:{variants:{onSale:"text-labelling-text-onsale",principal:"text-labelling-text-principal",secondary:"text-labelling-text-secondary",clubeRaia:"text-labelling-text-clube",clubeDrogasil:"text-labelling-text-clube",assinatura:"text-labelling-text-assinatura",medicamentoGeladeira:"text-labelling-text-refrigerate",receitaObrigatoria:"text-labelling-text-prescription",generico:"text-labelling-text-generico",referencia:"text-labelling-text-referencia",similar:"text-labelling-text-similar",stix:"text-labelling-text-stix"}}});import{jsx as S}from"react/jsx-runtime";var f=l=>{var p,b;let{children:a,__scopeTag:t}=l,{variants:e}=n(o,t),r=(p=a==null?void 0:a.toString())!=null?p:"",s=0,c=/\d+/g;if(e==="onSale"&&c.test(r)){let[P]=(b=r.match(c))!=null?b:[],g=Number(P);g>=0&&g<=100&&(s=g)}return S("p",{className:m({variants:e}),"data-testid":"tag-label",children:e==="onSale"?`${s}%`:r})};var u=i({base:` flex items-center justify-center h-small min-w-small rounded-pill px-twopulse gap-halfpulse max-w-[16rem] `,variants:{variants:{onSale:"bg-labelling-fill-onsale",principal:"bg-labelling-fill-principal",secondary:"bg-labelling-fill-secondary",clubeRaia:"bg-labelling-fill-clube",clubeDrogasil:"bg-labelling-fill-clube",assinatura:"bg-labelling-fill-assinatura",medicamentoGeladeira:"bg-labelling-fill-refrigerate",receitaObrigatoria:"bg-labelling-fill-prescription",generico:"bg-labelling-fill-generico",referencia:"bg-labelling-fill-referencia",similar:"bg-labelling-fill-similar",stix:"bg-labelling-fill-stix"}}});import{jsx as d}from"react/jsx-runtime";var o="Tag",D=l=>{let{children:a,variants:t,__scopeTag:e}=l;return d(I,{variants:t,scope:e,children:d("div",{"data-testid":"tag-root",className:u({variants:t}),children:a})})},[v]=L(o),[I,n]=v(o),R={Root:D,Label:f,Icon:T};export{R as a}; //# sourceMappingURL=chunk-XQY5GWJ7.js.map