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 5.77 kB
import{a as f}from"./chunk-B2JPULLR.js";import{a as N}from"./chunk-Q6P2XB56.js";import{a as c}from"./chunk-V5IX4U5J.js";import{a as l,b as i,c as s}from"./chunk-UABQX4UA.js";import{createContextScope as U}from"@radix-ui/react-context";import o,{forwardRef as W}from"react";import{jsx as Y}from"react/jsx-runtime";function B(d){var n=d,{children:a,id:r}=n,t=s(n,["children","id"]);return Y("div",i(l({},t),{"data-testid":r,className:"border-[#e6e6e6] border-t-none border-r-quarterpulse border-b-none border-l-quarterpulse bg-[#FFF] pt-fourpulse pr-fourpulse pb-fourpulse pl-fourpulse",children:a}))}import{jsx as S}from"react/jsx-runtime";function T(t){var d=t,{onClick:a}=d,r=s(d,["onClick"]);return S(f.Root,i(l({},r),{variant:"neutral-tertiary",size:"lg",onClick:a,"data-testid":r.id,children:S(f.Icon,{symbol:"rdicon-dismiss"})}))}var V=c({base:"line-clamp-5 pt-none pr-none pb-none pl-none text-left font-rdmodern font-regular text-text-neutral text-threeandhalfpulse leading-small tracking-tiny"});import{jsx as G}from"react/jsx-runtime";function g(t){var d=t,{children:a}=d,r=s(d,["children"]);return G("span",i(l({},r),{"data-testid":r.id,className:V(),children:a}))}import I from"react";import{jsx as y}from"react/jsx-runtime";function x(d){var n=d,{onClick:a,children:r}=n,t=s(n,["onClick","children"]);return y(f.Root,i(l({},t),{full:!0,variant:"brand-primary",size:"lg",onClick:a,"data-testid":t.id,children:r}))}function M(d){var n=d,{onClick:a,children:r}=n,t=s(n,["onClick","children"]);return y(f.Root,i(l({},t),{full:!0,variant:"neutral-secondary",size:"lg",onClick:a,"data-testid":t.id,children:r}))}function w(d){var n=d,{children:a,orientation:r="horizontal"}=n,t=s(n,["children","orientation"]);let u=I.Children.toArray(a).filter(p=>I.isValidElement(p)&&(p.type===x||p.type===M));r==="horizontal"?u.sort((p,P)=>p.type===M?-1:1):u.sort((p,P)=>p.type===x?-1:1);let v=()=>r==="horizontal"?"flex w-[100%] max-w-[720px] flex-row items-center justify-center ml-auto mr-auto gap-fourpulse bg-[transparent] pt-fourpulse pr-fourpulse pb-fourpulse pl-fourpulse":"flex w-[100%] max-w-[360px] flex-col items-center justify-center ml-auto mr-auto gap-fourpulse bg-[transparent] pt-fourpulse pr-fourpulse pb-fourpulse pl-fourpulse";return y("div",i(l({},t),{"data-testid":t.id,className:"rounded-tl-none rounded-tr-none rounded-br-mediumcontainer rounded-bl-mediumcontainer border-[#e6e6e6] border-t-none border-r-quarterpulse border-b-quarterpulse border-l-quarterpulse bg-[#FFF]",children:y("div",{className:v(),children:u==null?void 0:u.slice(0,2)})}))}var L=c({base:"min-w[100%] row flex h-[72px] max-h-[72px] min-h-[72px] items-center gap-twopulse rounded-tl-mediumcontainer rounded-tr-mediumcontainer rounded-br-none rounded-bl-none border-[#e6e6e6] border-t-quarterpulse border-r-quarterpulse border-b-none border-b-none border-l-quarterpulse bg-[#FFF] pt-fourpulse pb-twopulse pl-sixpulse"});import{jsx as J}from"react/jsx-runtime";var h=({children:a})=>J("div",{className:L(),children:a});import{jsx as K}from"react/jsx-runtime";function F(d){var n=d,{symbol:a,color:r}=n,t=s(n,["symbol","color"]);return K(N,i(l({},t),{size:"small",symbol:a,color:r}))}import{jsx as Q}from"react/jsx-runtime";function C(d){var n=d,{children:a,id:r}=n,t=s(n,["children","id"]);return Q("span",i(l({},t),{"data-testid":r,className:"line-clamp-1 font-bold font-rdmodern text-sixpulse text-text-neutral leading-tiny tracking-tiny",children:a}))}var q=c({base:"relative bg-transparent [z-index:999]",variants:{variant:{sm:"h-auto min-w-[240px] max-w-[319px]",md:"h-auto min-w-[320px] max-w-[719px]",lg:"h-auto min-w-[720px] max-w-[1151px]",xl:"h-auto min-w-[1152px] max-w-[1920px]"}},defaultVariants:{variant:"sm"}});import{jsx as b,jsxs as E}from"react/jsx-runtime";var H="Modal",z=W((a,r)=>{let R=a,{children:t,variant:d,visible:n,id:u,_scopeModal:v}=R,p=s(R,["children","variant","visible","id","_scopeModal"]),P=q({variant:d}),k=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===F)return o.cloneElement(e)}),A=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===C)return o.cloneElement(e)}),D=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===T)return o.cloneElement(e)}),m=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===g)return o.cloneElement(e)}),O=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===B)return o.cloneElement(e)}),_=o.Children.map(t,e=>{if(o.isValidElement(e)&&o.isValidElement(e)&&e.type===w)return o.cloneElement(e)});return n?b(Z,{scope:v,variant:d,visible:n,children:E("div",{className:"flex h-[100%] w-[100%] items-center justify-center overflow-hidden",children:[b("div",{style:{backgroundColor:"rgba(66, 66, 66, 0.32)"},className:"absolute top-0 right-0 bottom-0 left-0 h-[100vh] w-[100vw] overflow-hidden"}),E("div",i(l({},p),{ref:r,className:P,"data-testid":u,children:[E(h,{children:[k,A,b("div",{className:"ml-auto flex w-[80px] items-center justify-end bg-transparent",children:D})]}),b("div",{"data-testid":"first-description-container",className:"w-[100%] rounded-none border-[#e6e6e6] border-r-quarterpulse border-l-quarterpulse bg-[#FFF] pt-twopulse pr-sixpulse pb-twopulse pl-sixpulse",children:m==null?void 0:m.slice(0,1)}),O,b("div",{"data-testid":"second-description-container",className:"w-[100%] rounded-none border-[#e6e6e6] border-r-quarterpulse border-l-quarterpulse bg-[#FFF] pt-twopulse pr-sixpulse pb-twopulse pl-sixpulse",children:m==null?void 0:m.slice(1,2)}),_]}))]})}):null});z.displayName=H;var[X]=U(H),[Z,Oe]=X(H),$={Root:z,HeaderIcon:F,HeaderTitle:C,HeaderClosableButton:T,Description:g,Body:B,Footer:w,PrimaryButton:x,SecondaryButton:M};export{$ as a}; //# sourceMappingURL=chunk-6VDYJQXI.js.map