@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.85 kB
JavaScript
;var Y=Object.create;var u=Object.defineProperty,J=Object.defineProperties,Q=Object.getOwnPropertyDescriptor,W=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,Z=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var E=(e,o,r)=>o in e?u(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,l=(e,o)=>{for(var r in o||(o={}))b.call(o,r)&&E(e,r,o[r]);if(f)for(var r of f(o))I.call(o,r)&&E(e,r,o[r]);return e},c=(e,o)=>J(e,W(o));var d=(e,o)=>{var r={};for(var t in e)b.call(e,t)&&o.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&f)for(var t of f(e))o.indexOf(t)<0&&I.call(e,t)&&(r[t]=e[t]);return r};var j=(e,o)=>{for(var r in o)u(e,r,{get:o[r],enumerable:!0})},N=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of X(o))!b.call(e,s)&&s!==r&&u(e,s,{get:()=>o[s],enumerable:!(t=Q(o,s))||t.enumerable});return e};var x=(e,o,r)=>(r=e!=null?Y(Z(e)):{},N(o||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),ee=e=>N(u({},"__esModule",{value:!0}),e);var ne={};j(ne,{Link:()=>q});module.exports=ee(ne);var U=require("@radix-ui/react-context"),B=require("react");var A=x(require("react"),1);var k=x(require("react"),1),n=require("@raiadrogasil/pulso-design-tokens");var R=x(require("react"),1),oe=require("react/jsx-runtime"),C=R.createContext({currentTheme:"rdsaudesistemas"});function z(){let e=k.useMemo(()=>({rdsaudesistemas:n.RDSAUDESISTEMAS_TOKENS,drogasil:n.DROGASIL_TOKENS,raia:n.RAIA_TOKENS,subscription:n.SUBSCRIPTION_TOKENS,prime:n.PRIME_TOKENS}),[]),o=k.useContext(C);if(!o)throw new Error("[Pulso] useTheme precisa estar dentro de um <ThemeProvider>. Verifique se o provedor est\xE1 corretamente configurado na raiz da aplica\xE7\xE3o.");let{currentTheme:r}=o;return l(l({},n.GLOBALS_TOKENS),e[r])}var w=require("react/jsx-runtime");function S(s){var i=s,{symbol:e="rdicon-default",size:o="small",color:r="colorActionFillBrandPrimaryEnabled"}=i,t=d(i,["symbol","size","color"]);let a=z(),m=A.useMemo(()=>({tiny:a.sizingTiny,"extra-small":a.sizingExtrasmall,small:a.sizingSmall,medium:a.sizingMedium}),[]);return(0,w.jsx)("i",c(l({},t),{className:e,style:{fontSize:m[o],color:a[r],display:"inline-flex"}}))}S.displayName="Icon";var L=require("react/jsx-runtime");function D(s){var i=s,{__scopeLink:e,color:o="colorTextNeutralDefault",className:r}=i,t=d(i,["__scopeLink","color","className"]);let{size:a,disabled:m}=K("LinkIcon",e),T={md:"tiny",ml:"tiny"};return(0,L.jsx)("div",{className:`flex items-center ${r&&r}`,role:"figure",children:(0,L.jsx)(S,c(l({},t),{symbol:"rdicon-open",color:m?"colorTextNeutralDisabled":o,size:T[a]}))})}var M=require("tailwind-variants"),y=(0,M.createTV)({twMerge:!0,twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var _=y({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"}}),O=y({base:"inline-flex h-small items-center justify-center underline decoration-solid"}),V=y({base:"pl-onepulse no-underline"});var p=require("react/jsx-runtime"),P="Link",G=(0,B.forwardRef)((e,o)=>{let v=e,{children:r,icon:t,size:s,disabled:i,full:a,__scopeLink:m,href:T,onClick:g}=v,F=d(v,["children","icon","size","disabled","full","__scopeLink","href","onClick"]),H=_({size:s,disabled:i,full:a}),$=h=>{if(i){h.preventDefault(),h.stopPropagation();return}g&&g(h)};return(0,p.jsx)(te,{scope:m,size:s,disabled:i,children:(0,p.jsxs)("a",c(l({},F),{ref:o,href:i?void 0:T,className:H,"aria-disabled":i,role:"link",onClick:$,children:[(0,p.jsx)("div",{className:O(),children:r}),t&&(0,p.jsx)(D,{className:V()})]}))})});G.displayName=P;var[re]=(0,U.createContextScope)(P),[te,K]=re(P),q={Root:G};0&&(module.exports={Link});
//# sourceMappingURL=index.cjs.map