@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.25 kB
JavaScript
import{a as E}from"./chunk-V22JYXG2.js";import{a as x}from"./chunk-6YYRH2FS.js";import{c as D}from"./chunk-WWOETHYY.js";import{a as y}from"./chunk-V5IX4U5J.js";import{c as R}from"./chunk-UABQX4UA.js";import{jsx as S}from"react/jsx-runtime";var l=()=>S("div",{className:"x-full flex py-onepulse","data-testid":"separator",children:S("div",{className:"flex-1 border-border-neutral border-hairline","data-testid":"divider-line"})});import{jsx as k}from"react/jsx-runtime";var P=({controls:t,testID:e})=>k("div",{"data-testid":e,className:"x-full flex items-center gap-threepulse border-border-neutral border-t-hairline bg-fill-neutral p-threepulse ",children:t.slice(0,2).map((o,s)=>{let n=o.type==="confirm"?"brand-primary":"neutral-tertiary";return k(E.Root,{size:"lg",variant:n,onClick:o.handler,children:o.label},String(s))})});import{createContextScope as q}from"@radix-ui/react-context";import O from"react";import{jsx as M,jsxs as B}from"react/jsx-runtime";function b({children:t,title:e}){let o=!!(e!=null&&e.length);return B("div",{className:"flex flex-col",children:[M(l,{}),M("div",{className:"px-fivepulse py-twopulse",children:o&&M("h2",{className:"font-bold text-rdmodern text-text-neutral-readonly text-threeandhalfpulse leading-small",children:e})}),t]})}import{useCallback as L,useState as $}from"react";var w=y({base:"flex items-center space-x-2",variants:{type:{single:"px-twopulse py-onepulse",multi:"px-twopulse py-onepulse"}}}),se=y({base:"gap-onepulse p-onepulse"}),T=y({base:["bg-action-fill-neutral-tertiary-enabled","border-border-neutral-tertiary-enabled","border-none","duration-100 ease-in","focus:border-x-halfpulse","focus:border-y-halfpulse","focus:border-action-border-focused","focus:rounded-pill","hover:bg-action-fill-neutral-tertiary-hovered","hover:border-action-border-neutral-tertiary-hovered","hover:rounded-pill","disabled:cursor-not-allowed","disabled:bg-action-fill-neutral-tertiary-disabled","disabled:border-action-border-neutral-tertiary-disabled","disabled:border-none","active:bg-action-fill-neutral-tertiary-pressed","active:border-action-border-neutral-tertiary-pressed","active:rounded-pill","px-twopulse","py-onepulse"]});import{jsx as p,jsxs as V}from"react/jsx-runtime";function h({type:t="multi",content:e,checked:o,customColor:s,disabled:n,testID:u,onPress:c}){let[a,m]=$(!1),i=!!e.prefixIcon,r=!!e.description,g=L(()=>m(!0),[]),G=L(()=>m(!1),[]),A=f=>{let C=i?23:25;return f&&f.length>C?`${f.substr(0,C)}...`:f};return p("button",{onMouseDown:g,onMouseUp:G,onClick:c,"data-testid":u,disabled:n,type:"button",className:T(),children:V("div",{className:w({type:t}),children:[t==="multi"&&p("div",{className:"flex items-center p-onepulse",children:p(x,{symbol:o?"rdicon-checkbox-checked":"rdicon-checkbox-unchecked",color:n?"colorTextNeutralDisabled":o?s||"colorActionFillBrandPrimaryEnabled":"colorTextNeutralDefault",size:"small"})}),i&&p(x,{symbol:e.prefixIcon,color:n?"colorTextNeutralDisabled":"colorTextNeutralDefault",size:"small"}),V("div",{className:"flex flex-1 flex-col items-start gap-halfpulse p-onepulse ",children:[p("p",{className:`tracking font-rdmodern font-regular text-threeandhalfpulse leading-small ${n?"text-text-neutral-disabled":"text-text-neutral"}`,children:e.label}),r&&p("p",{className:`tracking font-rdmodern font-regular text-threepulse leading-small ${n?"text-text-neutral-disabled":"text-text-neutral-placeholder"}`,children:A(e.description)})]}),t==="single"&&o&&p(x,{symbol:"rdicon-checkmark",color:"colorTextSuccessAlternative",size:"small"})]})})}import v from"react";import z from"react";function I(t){return z.isValidElement(t)&&t.type===h}import{jsx as W}from"react/jsx-runtime";var H="Only Fragment, OptionMenu.Item and Group components are allowed as children of OptionMenu.List. Please remove or replace any other elements.";function N(o){var s=o,{maxHeight:t=480}=s,e=R(s,["maxHeight"]);let{__scopeOptionMenu:n,children:u,testID:c}=e,a=D(),{type:m}=_("OptionMenuList",n),i=[];return v.Children.forEach(u,r=>{if(v.isValidElement(r)){if(r.type===v.Fragment){let g=r.props.children;i.push(g);return}if(I(r)||r.type===b||r.type===l)i.push(r);else throw new Error(H)}}),i=i.map(r=>I(r)?v.cloneElement(r,{key:((1+Math.random())*65536|0).toString(16).substring(1),type:m}):r),W("div",{className:`flex max-h-[${t}px] flex-col overflow-y-scroll px-onepulse py-onepulse ${a.spacingInlineOnepulse}`,"data-testid":c,children:i})}import{jsx as d}from"react/jsx-runtime";var F="OptionMenu",U=t=>{let{type:e,children:o,customEmptyMessage:s="N\xE3o foi encontrado nenhum resultado.",testID:n,__scopeOptionMenu:u}=t,c=O.Children.map(o,a=>{if(O.isValidElement(a)&&(a.type===N||a.type===P))return a});return d(J,{scope:u,type:e,"data-testid":n,children:d("div",{className:"rounded-form border-border-neutral border-quarterpulse bg-fill-neutral py-onepulse ",children:O.Children.count(o)>0?d("div",{className:"flex-grow",children:c}):d("div",{className:"flex items-start justify-center",children:d("p",{className:"tracking px-onepulse py-twopulse font-regular text-rdmodern text-text-neutral text-threeandhalfpulse leading-small",children:s})})})})},[Y]=q(F),[J,_]=Y(F),K={Root:U,Footer:P,Divider:l,Item:h,List:N,Group:b};export{K as a};
//# sourceMappingURL=chunk-BBXSKGFE.js.map