@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.
8 lines • 3.83 kB
JavaScript
;var l=Object.defineProperty,K=Object.defineProperties,q=Object.getOwnPropertyDescriptor,B=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var I=(t,o,e)=>o in t?l(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,p=(t,o)=>{for(var e in o||(o={}))u.call(o,e)&&I(t,e,o[e]);if(c)for(var e of c(o))g.call(o,e)&&I(t,e,o[e]);return t},m=(t,o)=>K(t,B(o));var T=(t,o)=>{var e={};for(var r in t)u.call(t,r)&&o.indexOf(r)<0&&(e[r]=t[r]);if(t!=null&&c)for(var r of c(t))o.indexOf(r)<0&&g.call(t,r)&&(e[r]=t[r]);return e};var U=(t,o)=>{for(var e in o)l(t,e,{get:o[e],enumerable:!0})},Y=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of G(o))!u.call(t,s)&&s!==e&&l(t,s,{get:()=>o[s],enumerable:!(r=q(o,s))||r.enumerable});return t};var F=t=>Y(l({},"__esModule",{value:!0}),t);var Q={};U(Q,{Toast:()=>M});module.exports=F(Q);var L=require("@radix-ui/react-context"),V=require("react");var v=require("tailwind-variants"),d=(0,v.createTV)({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var h=d({base:`
text-text-neutral !font-rdmodern font-regular text-threeandhalfpulse
leading-small truncate
`,variants:{}});var C=require("react/jsx-runtime"),S=t=>{let{children:o}=t;return(0,C.jsx)("span",{className:h(),"data-testid":"toast-description","aria-label":`${o==null?void 0:o.toString()}`,children:o})};var _=require("react");var n=require("@raiadrogasil/pulso-design-tokens"),b=require("react");var x=require("react"),H=require("react/jsx-runtime"),R=(0,x.createContext)({});function D(){let{currentTheme:t}=(0,b.useContext)(R);return p(p({},{rdsaudesistemas:n.RDSAUDESISTEMAS_TOKENS,drogasil:n.DROGASIL_TOKENS,raia:n.RAIA_TOKENS,subscription:n.SUBSCRIPTION_TOKENS,prime:n.PRIME_TOKENS}[t]),n.GLOBALS_TOKENS)}function N(t){let o=D();return Object.keys(o).reduce((s,a)=>{if(a.includes("color")){let i=a;s[i]=o[i]}return s},{})[t]}var E={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};var A=require("react/jsx-runtime");function P(s){var a=s,{symbol:t="rdicon-default",size:o="small",color:e="colorActionFillBrandPrimaryEnabled"}=a,r=T(a,["symbol","size","color"]);let i=t.replace("rdicon","").trim();return(0,A.jsx)("i",m(p({},r),{title:i,className:t,style:{fontSize:E[o],color:N(e)}}))}var O=require("react/jsx-runtime"),w=t=>{let{symbol:o,__scopeToast:e}=t,{type:r}=k(f,e),s={success:"colorTextSuccessAlternative",informative:"colorTextInformativeAlternative",warning:"colorTextWarningAlternative",danger:"colorTextDangerAlternative",neutral:"colorTextNeutralDefault"},a=(0,_.useCallback)(()=>s[r],[r]);return(0,O.jsx)(P,{symbol:o,size:"small",color:a(),"data-testid":"toast-icon"})};var z=d({base:`
flex flex-row h-large min-w-[256px] max-w-[768px] items-center border-quarterpulse border-border-neutral rounded-pill
px-fourpulse gap-twopulse
`,variants:{type:{neutral:"bg-fill-neutral-alternative ",informative:"bg-fill-informative-alternative ",success:"bg-fill-success-alternative ",warning:"bg-fill-warning-alternative ",danger:"bg-fill-danger-alternative "}}});var y=require("react/jsx-runtime"),f="Toast",W=(0,V.forwardRef)((t,o)=>{let i=t,{type:e,children:r,__scopeToast:s}=i,a=T(i,["type","children","__scopeToast"]);return(0,y.jsx)(J,m(p({type:e,scope:s},a),{children:(0,y.jsx)("div",{"data-testid":"toast-root",className:z({type:e}),ref:o,children:r})}))}),[$]=(0,L.createContextScope)(f),[J,k]=$(f),M={Root:W,Icon:w,Description:S};0&&(module.exports={Toast});
//# sourceMappingURL=index.cjs.map