@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.
67 lines • 10.3 kB
JavaScript
import{a as s}from"./chunk-2MB3Y6WI.js";import{a as b}from"./chunk-OMQZQF62.js";import{a as k,b as P,c as z}from"./chunk-DDCCLFYC.js";import{createContextScope as J}from"@radix-ui/react-context";import{useRef as O}from"react";var h=s({base:`
flex items-center justify-center rounded-pill min-width-size-huge p-px
active:border-focused focus:border-focused w-fit m-px border-halfpulse border-transparent
has-[:focus]:border-action-border-focused focus:border-action-border-focused focus-visible:border-action-border-focused
`,variants:{disabled:{true:"cursor-not-allowed border-transparent"}},defaultVariants:{disabled:!1}}),S=s({base:`
group flex items-center justify-center rounded-pill min-w-16 relative px-fourpulse gap-twopulse border-quarterpulse text-text-neutral-alternative
bg-action-fill-neutral-secondary-enabled border-action-border-neutral-secondary-enabled
hover:bg-action-fill-neutral-secondary-hovered hover:border-action-border-neutral-secondary-hovered
active:bg-action-fill-neutral-secondary-pressed active:border-action-border-neutral-secondary-pressed cursor:pointer
`,variants:{size:{sm:"",md:"h-medium",ml:"h-mediumlarge"},disabled:{true:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`},checked:{true:`
border-action-border-neutral-secondary-activated border-halfpulse bg-action-fill-neutral-secondary-activated pl-twopulse text-text-neutral
hover:text-text-neutral
`}},compoundVariants:[{disabled:!0,checked:!0,class:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`}],defaultVariants:{size:"md",disabled:!1,checked:!1}}),I=s({base:`
group flex items-center justify-center rounded-pill min-w-10 relative px-twopulse py-onepulse gap-onepulse border-quarterpulse text-text-neutral-alternative
bg-action-fill-neutral-secondary-enabled border-action-border-neutral-secondary-enabled
hover:bg-action-fill-neutral-secondary-hovered hover:border-action-border-neutral-secondary-hovered
active:bg-action-fill-neutral-secondary-pressed active:border-action-border-neutral-secondary-pressed cursor:pointer
`,variants:{size:{sm:"h-small",md:"h-medium",ml:"h-medium"},disabled:{true:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`},readOnly:{true:`
cursor-not-allowed text-text-neutral-readonly border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`},checked:{true:"border-action-border-neutral-secondary-activated border-quarterpulse"}},compoundVariants:[{disabled:!0,checked:!0,class:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`},{checked:!0,readOnly:!0,class:`
cursor-not-allowed text-text-neutral-readonly border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`}],defaultVariants:{size:"md",disabled:!1,checked:!1}}),V=s({base:`
group flex items-center justify-center rounded-pill min-w-[64px] relative px-twopulse gap-twopulse border-quarterpulse text-text-neutral-alternative
bg-action-fill-neutral-secondary-enabled border-action-border-neutral-secondary-enabled
hover:bg-action-fill-neutral-secondary-hovered hover:border-action-border-neutral-secondary-hovered
active:bg-action-fill-neutral-secondary-pressed active:border-action-border-neutral-secondary-pressed cursor:pointer
`,variants:{size:{sm:"h-small",md:"h-medium",ml:"h-mediumlarge"},disabled:{true:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`},count:{false:"",true:""},hasChecked:{true:`
border-action-border-neutral-secondary-activated border-quarterpulse bg-action-fill-neutral-secondary-activated
hover:bg-action-fill-neutral-secondary-hovered hover:border-action-border-neutral-secondary-hovered
active:bg-action-fill-neutral-secondary-hovered active:border-action-border-neutral-secondary-activated
`}},compoundVariants:[{disabled:!0,hasChecked:!0,class:`
cursor-not-allowed border-action-border-neutral-secondary-disabled border-quarterpulse bg-action-fill-neutral-secondary-disabled
hover:bg-action-fill-neutral-secondary-disabled hover:border-action-border-neutral-secondary-disabled
active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled
`}],defaultVariants:{size:"md",disabled:!1,checked:!1}}),N=s({base:"flex h-extrasmall items-center justify-center font-bold text-text-neutral-alternative leading-small",variants:{size:{sm:"text-threeandhalfpulse",md:"h-medium min-w-medium text-threeandhalfpulse",ml:"h-mediumlarge min-w-mediumlarge text-threeandhalfpulse"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled"},readonly:{true:"cursor-not-allowed text-text-neutral-readonly"},checked:{true:"text-action-text-neutral"}},compoundVariants:[{checked:!0,disabled:!0,class:"cursor-not-allowed text-text-neutral-disabled"}],defaultVariants:{disabled:!1,checked:!1}}),y=s({base:`
hidden
`}),M=s({base:`
hidden group-has-[:checked]:block
`,variants:{size:{sm:"h-small",md:"h-tiny",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),T=s({base:`
hidden group-has-[:checked]:block
`,variants:{size:{sm:"h-small",md:"h-small",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),q=s({variants:{size:{sm:"h-small",md:"h-extrasmall",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),L=s({base:` flex justify-center items-center rounded-pill border-none bg-text-neutral text-threepulse text-text-neutral-inverse
`,variants:{size:{sm:"h-extrasmall w-extrasmall",md:"h-extrasmall w-extrasmall",ml:"h-small w-small"},disabled:{true:"cursor-not-allowed bg-text-neutral-disabled"}}});import{jsx as C,jsxs as A}from"react/jsx-runtime";var R=e=>{let{__scopeChips:a,id:l,name:d,value:n,children:o,onChange:t}=e,{size:i="sm",disabled:r,checked:p,readOnly:u}=c("Chips",a),m=O(null),g=r||u;return C("div",{className:h(),children:A("label",{className:I({checked:p,disabled:r,size:i,readOnly:u}),"aria-disabled":r,children:[C("input",{ref:m,type:"radio",className:y(),id:l,disabled:r,name:d,value:n,checked:p,onChange:t,readOnly:u}),o,!g&&C("span",{className:T({size:i}),children:C(b,{size:"small",symbol:"rdicon-dismiss",color:r?"colorTextNeutralDisabled":"colorTextDangerAlternative"})})]})})};import{jsx as H}from"react/jsx-runtime";var _=e=>{let{__scopeChips:a,children:l}=e,{size:d,disabled:n,checked:o}=c("Label",a);return H("span",{className:N({disabled:n,size:d,checked:o}),children:l})};import{useRef as j}from"react";import{useState as U}from"react";function f(){let[e,a]=U("");return{UseChips:f,selectedValue:e,setSelectedValue:a,iconSizeMapping:{sm:"extra-small",md:"extra-small",ml:"small"}}}import{jsx as v,jsxs as Y}from"react/jsx-runtime";var B=e=>{let{__scopeChips:a,children:l,icon:d,onChange:n=()=>{},count:o=0}=e,{size:t="md",disabled:i,checked:r}=c("Chips",a),{iconSizeMapping:p}=f(),u=j(null),m=r||o>0,g=d||"rdicon-options-filter";return v("div",{className:h(),children:Y("button",{type:"button",className:V({size:t,disabled:i,hasChecked:m}),ref:u,onClick:n,children:[v("span",{className:q({size:t}),children:v(b,{size:p[t],symbol:g,color:i?"colorTextNeutralDisabled":"colorTextNeutralDefault"})}),l,o>0&&v("span",{className:L({size:t,disabled:i}),children:o>9?"9+":o})]})})};import{useRef as F}from"react";import{jsx as x,jsxs as G}from"react/jsx-runtime";var D=e=>{let{__scopeChips:a,id:l,name:d,value:n,children:o,onChange:t}=e,{size:i="md",disabled:r,checked:p}=c("Chips",a),{iconSizeMapping:u}=f(),m=F(null);return x("div",{className:h(),children:G("label",{className:S({checked:p,disabled:r,size:i}),"aria-disabled":r,children:[x("input",{ref:m,type:"radio",className:y(),id:l,disabled:r,name:d,value:n,checked:p,onChange:t}),x("span",{className:M({size:i}),children:x(b,{size:u[i],symbol:"rdicon-checkmark",color:r?"colorTextNeutralDisabled":"colorTextNeutralDefault"})}),o]})})};import{jsx as X}from"react/jsx-runtime";var w="Chips",E=e=>{let t=e,{size:a,children:l,disabled:d,__scopeChips:n}=t,o=z(t,["size","children","disabled","__scopeChips"]);return X(Q,P(k({},e),{size:a,disabled:d,scope:n,children:l}))};E.displayName=w;var[K]=J(w),[Q,c]=K(w),W={Root:E,Single:D,Label:_,Input:R,Multiple:B};export{W as a};
//# sourceMappingURL=chunk-YW3NTQLR.js.map