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.

2 lines 4.56 kB
"use strict";var u=Object.defineProperty,Y=Object.defineProperties,$=Object.getOwnPropertyDescriptor,J=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var v=(e,o,r)=>o in e?u(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,a=(e,o)=>{for(var r in o||(o={}))b.call(o,r)&&v(e,r,o[r]);if(m)for(var r of m(o))C.call(o,r)&&v(e,r,o[r]);return e},c=(e,o)=>Y(e,J(o));var p=(e,o)=>{var r={};for(var t in e)b.call(e,t)&&o.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&m)for(var t of m(e))o.indexOf(t)<0&&C.call(e,t)&&(r[t]=e[t]);return r};var W=(e,o)=>{for(var r in o)u(e,r,{get:o[r],enumerable:!0})},X=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Q(o))!b.call(e,i)&&i!==r&&u(e,i,{get:()=>o[i],enumerable:!(t=$(o,i))||t.enumerable});return e};var Z=e=>X(u({},"__esModule",{value:!0}),e);var re={};W(re,{Link:()=>q});module.exports=Z(re);var K=require("@radix-ui/react-context"),B=require("react");var s=require("@raiadrogasil/pulso-design-tokens"),N=require("react");var y=require("react"),j=require("react/jsx-runtime"),S=(0,y.createContext)({});function E(){let{currentTheme:e}=(0,N.useContext)(S);return a(a({},{rdsaudesistemas:s.RDSAUDESISTEMAS_TOKENS,drogasil:s.DROGASIL_TOKENS,raia:s.RAIA_TOKENS,subscription:s.SUBSCRIPTION_TOKENS,prime:s.PRIME_TOKENS}[e]),s.GLOBALS_TOKENS)}function z(e){let o=E();return Object.keys(o).reduce((i,n)=>{if(n.includes("color")){let l=n;i[l]=o[l]}return i},{})[e]}var R={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};var w=require("react/jsx-runtime");function h(i){var n=i,{symbol:e="rdicon-default",size:o="small",color:r="colorActionFillBrandPrimaryEnabled"}=n,t=p(n,["symbol","size","color"]);let l=e.replace("rdicon","").trim();return(0,w.jsx)("i",c(a({},t),{title:l,className:e,style:{fontSize:R[o],color:z(r)}}))}var L=require("react/jsx-runtime");function A(i){var n=i,{__scopeLink:e,color:o="colorTextNeutralDefault",className:r}=n,t=p(n,["__scopeLink","color","className"]);let{size:l,disabled:k}=_("LinkIcon",e),x={md:"tiny",ml:"tiny"};return(0,L.jsx)("div",{className:`flex items-center ${r&&r}`,role:"figure",children:(0,L.jsx)(h,c(a({},t),{symbol:"rdicon-open",color:k?"colorTextNeutralDisabled":o,size:x[l]}))})}var O=require("tailwind-variants"),f=(0,O.createTV)({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var V=f({base:"letter-spacing-default inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md rounded-pill border-action-border-neutral-tertiary-enabled bg-action-fill-neutral-tertiary-enabled px-fourpulse text-text-neutral hover:border-action-border-neutral-tertiary-hovered hover:bg-action-fill-neutral-tertiary-hovered focus:border-action-border-focused focus:border-halfpulse active:border-action-border-neutral-tertiary-pressed active:bg-action-fill-neutral-tertiary-pressed focus:active:border-action-border-focused",variants:{size:{md:"h-medium min-w-medium font-semibold text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge font-semibold text-threeandhalfpulse leading-small"},disabled:{true:"cursor-not-allowed border-action-border-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-disabled text-text-neutral-disabled hover:bg-action-fill-neutral-tertiary-disabled active:bg-action-fill-neutral-tertiary-disabled",false:""},full:{true:"w-full"},withIcon:{true:"pl-1"}},defaultVariants:{size:"md"}}),D=f({base:"inline-flex h-small items-center justify-center underline decoration-solid"}),M=f({base:"pl-onepulse no-underline"});var d=require("react/jsx-runtime"),P="Link",G=(0,B.forwardRef)((e,o)=>{let I=e,{children:r,icon:t,size:i,disabled:n,full:l,__scopeLink:k,href:x,onClick:g}=I,H=p(I,["children","icon","size","disabled","full","__scopeLink","href","onClick"]),U=V({size:i,disabled:n,full:l}),F=T=>{if(n){T.preventDefault(),T.stopPropagation();return}g&&g(T)};return(0,d.jsx)(oe,{scope:k,size:i,disabled:n,children:(0,d.jsxs)("a",c(a({},H),{ref:o,href:n?void 0:x,className:U,"aria-disabled":n,role:"link",onClick:F,children:[(0,d.jsx)("div",{className:D(),children:r}),t&&(0,d.jsx)(A,{className:M()})]}))})});G.displayName=P;var[ee]=(0,K.createContextScope)(P),[oe,_]=ee(P),q={Root:G};0&&(module.exports={Link}); //# sourceMappingURL=index.cjs.map