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.

125 lines (123 loc) 35.6 kB
"use strict";var Et=Object.create;var D=Object.defineProperty,Lt=Object.defineProperties,At=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertyNames,G=Object.getOwnPropertySymbols,qt=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var ve=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))oe.call(t,r)&&ve(e,r,t[r]);if(G)for(var r of G(t))ge.call(t,r)&&ve(e,r,t[r]);return e},f=(e,t)=>Lt(e,Dt(t));var b=(e,t)=>{var r={};for(var o in e)oe.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&G)for(var o of G(e))t.indexOf(o)<0&&ge.call(e,o)&&(r[o]=e[o]);return r};var Ft=(e,t)=>{for(var r in t)D(e,r,{get:t[r],enumerable:!0})},Ie=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of _t(t))!oe.call(e,l)&&l!==r&&D(e,l,{get:()=>t[l],enumerable:!(o=At(t,l))||o.enumerable});return e};var U=(e,t,r)=>(r=e!=null?Et(qt(e)):{},Ie(t||!e||!e.__esModule?D(r,"default",{value:e,enumerable:!0}):r,e)),Ht=e=>Ie(D({},"__esModule",{value:!0}),e);var er={};Ft(er,{InputMultiSelect:()=>I});module.exports=Ht(er);var g=require("@raiadrogasil/pulso-design-tokens"),Se=require("react");var le=require("react"),Qt=require("react/jsx-runtime"),Ce=(0,le.createContext)({});function N(){let{currentTheme:e}=(0,Se.useContext)(Ce);return m(m({},{rdsaudesistemas:g.RDSAUDESISTEMAS_TOKENS,drogasil:g.DROGASIL_TOKENS,raia:g.RAIA_TOKENS,subscription:g.SUBSCRIPTION_TOKENS,prime:g.PRIME_TOKENS}[e]),g.GLOBALS_TOKENS)}function Me(e){let t=N();return Object.keys(t).reduce((l,a)=>{if(a.includes("color")){let n=a;l[n]=t[n]}return l},{})[e]}var Pe={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};var Te=require("react/jsx-runtime");function h(l){var a=l,{symbol:e="rdicon-default",size:t="small",color:r="colorActionFillBrandPrimaryEnabled"}=a,o=b(a,["symbol","size","color"]);let n=e.replace("rdicon","").trim();return(0,Te.jsx)("i",f(m({},o),{title:n,className:e,style:{fontSize:Pe[t],color:Me(r)}}))}var $=require("react"),K=(e,t)=>{var o;let r=(o=$.Children.toArray(e))==null?void 0:o.filter(l=>(0,$.isValidElement)(l));return r.map((l,a)=>{let n=t.find(s=>l.type===s.child),i=r.reduce((s,c,d)=>(c==null?void 0:c.type)===l.type&&d<=a?s+1:s,0);return n&&i<=(n==null?void 0:n.amount)?l:null})};var we=require("tailwind-variants"),u=(0,we.createTV)({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var Ne=u({base:` group flex w-full items-center justify-between gap-onepulse duration-100 ease-in bg-forms-fill-default border-forms-none overflow-hidden cursor-pointer min-w-[calc(var(--sizing-huge)_+_var(--sizing-tiny))] focus-visible:outline-none `,variants:{size:{md:"min-h-medium rounded-form px-threepulse",ml:"min-h-mediumlarge rounded-form px-threepulse",lg:"min-h-large rounded-form px-threepulse",xl:"min-h-extralarge rounded-largecontainer px-threepulse"},hasError:{true:""},disabled:{true:""},filled:{true:""},readonly:{true:""},active:{true:""},hasTwoItems:{true:""}},compoundVariants:[{hasError:!0,filled:!0,class:` border-forms-border-error bg-forms-fill-error hover:border-forms-border-error hover:border-halfpulse focus:border-forms-border-error focus:border-halfpulse active:border-forms-border-error active:border-halfpulse `},{hasError:!0,filled:!1,class:` border-forms-border-error bg-forms-fill-default hover:border-forms-border-error hover:bg-forms-fill-hovered hover:border-halfpulse focus:border-forms-border-error focus:border-halfpulse active:border-forms-border-error active:border-halfpulse `},{readonly:!0,filled:!0,class:` border-forms-border-readonly bg-forms-fill-readonly hover:border-forms-border-readonly hover:border-quarterpulse focus:border-forms-border-readonly focus:border-quarterpulse active:border-forms-border-readonly active:border-quarterpulse `},{readonly:!0,filled:!1,class:` border-forms-border-readonly bg-forms-fill-readonly hover:border-forms-border-readonly hover:border-quarterpulse focus:border-forms-border-readonly focus:border-quarterpulse active:border-forms-border-readonly active:border-quarterpulse `},{disabled:!0,filled:!0,class:` border-forms-border-disabled bg-forms-fill-disabled hover:border-forms-border-disabled hover:border-quarterpulse focus:border-forms-border-disabled focus:border-quarterpulse active:border-forms-border-disabled active:border-quarterpulse `},{disabled:!0,filled:!1,class:` border-forms-border-disabled bg-forms-fill-disabled hover:border-forms-border-disabled hover:border-quarterpulse focus:border-forms-border-disabled focus:border-quarterpulse active:border-forms-border-disabled active:border-quarterpulse `},{active:!0,filled:!0,readonly:!1,disabled:!1,hasError:!1,class:"cursor-pointer border-forms-border-focused bg-forms-fill-focused hover:border-forms-border-focused hover:border-halfpulse active:border-forms-border-focused active:border-halfpulse"},{active:!0,readonly:!1,disabled:!1,hasError:!1,filled:!1,class:"cursor-pointer border-forms-border-focused bg-forms-fill-focused hover:border-forms-border-focused hover:border-halfpulse active:border-forms-border-focused active:border-halfpulse"},{active:!1,hasError:!1,disabled:!1,readonly:!1,filled:!0,class:"border-forms-border-filled bg-forms-fill-filled hover:border-forms-border-filled hover:border-halfpulse focus:border-forms-border-focused focus:bg-forms-fill-focused active:border-forms-border-focused active:border-halfpulse active:bg-forms-fill-focused"},{active:!1,hasError:!1,disabled:!1,readonly:!1,filled:!1,class:` focus-within:border-halfpulse focus-within:bg-forms-fill-focused focus-simple:cursor-pointer focus:border-halfpulse focus:border-forms-border-focused focus:cursor-pointer hover:border-none hover:bg-forms-fill-hovered active:border-halfpulse active:border-forms-border-focused active:cursor-pointer active:bg-forms-fill-focused `},{size:"md",hasTwoItems:!1,class:"h-medium"},{size:"ml",hasTwoItems:!1,class:"h-mediumlarge"},{size:"lg",hasTwoItems:!1,class:"h-large"},{size:"xl",hasTwoItems:!1,class:"h-extralarge"}],defaultVariants:{size:"ml",isFocused:!1,hasError:!1,readonly:!1,disabled:!1}});var ze=require("react/jsx-runtime"),Re=o=>{var l=o,{children:e,__scopeInputMultiSelect:t}=l,r=b(l,["children","__scopeInputMultiSelect"]);let{disabled:a,hasError:n,size:i,readonly:s,isActive:c,setActive:d}=x("InputMultiSelectActions",t),p=!!(r.selectedItemsQuantity&&r.selectedItemsQuantity>0),y=!!(r.selectedItemsQuantity&&r.selectedItemsQuantity>1);return(0,ze.jsx)("button",f(m({},r),{onClick:v=>{d(!c),r.onClick&&r.onClick(v)},className:Ne({active:c,size:i,disabled:a,hasError:n,readonly:s,filled:p,hasTwoItems:y}),"aria-disabled":a,children:K(e,[{child:I.Icon,amount:1},{child:I.Field,amount:1},{child:I.Quantity,amount:4},{child:I.ClearButton,amount:1},{child:h,amount:1}])}))};var He=require("react");var Ae=require("react"),De=require("@radix-ui/react-context");var Be=u({base:` tracking inline-flex items-center justify-center gap-twopulse rounded-pill border-quarterpulse border-[transparent] font-bold font-rdmodern text-threeandhalfpulse truncate`,variants:{variant:{"brand-primary":`bg-action-fill-brand-primary-enabled text-text-neutral-inverse enabled:active:bg-action-fill-brand-primary-pressed enabled:hover:bg-action-fill-brand-primary-hovered`,"neutral-secondary":`border-action-border-neutral-secondary-enabled bg-action-fill-neutral-secondary-enabled text-text-neutral enabled:active:border-action-border-neutral-secondary-pressed enabled:active:bg-action-fill-neutral-secondary-pressed enabled:hover:bg-action-fill-neutral-secondary-hovered`,"neutral-tertiary":`border-action-border-neutral-tertiary-enabled bg-action-fill-neutral-tertiary-enabled text-text-neutral enabled:active:bg-action-fill-neutral-tertiary-pressed enabled:hover:bg-action-fill-neutral-tertiary-hovered`},size:{md:"h-medium min-w-medium px-fourpulse text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge px-fourpulse leading-small",lg:"h-large min-w-large px-fivepulse leading-small",xl:"h-extralarge min-w-extralarge px-sixpulse leading-small"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled outline-none",false:"outline-action-border-focused outline-offset-4 focus-visible:outline-1"},full:{true:"w-full"},asIconOnly:{true:"aspect-square px-none"}},compoundVariants:[{variant:"brand-primary",disabled:!0,class:"border-action-border-brand-primary-disabled bg-action-fill-brand-primary-disabled"},{variant:"neutral-secondary",disabled:!0,class:"border-action-border-neutral-secondary-disabled bg-action-fill-neutral-secondary-disabled"},{variant:"neutral-tertiary",disabled:!0,class:"border-action-fill-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-enabled"}],defaultVariants:{variant:"brand-primary",size:"ml"}});var Oe=require("react/jsx-runtime");function Y(e){let s=e,{__scopeButton:t}=s,r=b(s,["__scopeButton"]),{variant:o,size:l,disabled:a}=W("ButtonIcon",t),n={"brand-primary":"colorTextNeutralInverse","neutral-secondary":"colorTextNeutralDefault","neutral-tertiary":"colorTextNeutralDefault"},i={md:"extra-small",ml:"small",lg:"small",xl:"small"};return(0,Oe.jsx)(h,f(m({},r),{color:a?"colorTextNeutralDisabled":n[o],size:i[l]}))}function Ve(e){let t=N();return{brand:t.colorActionFillBrandPrimaryEnabled,neutral:t.colorTextNeutralReadonly,black:t.colorTextNeutralDefault,white:t.colorTextNeutralInverse}[e]}var R=require("react/jsx-runtime");function ae({color:e="brand",srText:t}){return(0,R.jsx)("div",{role:"status",className:"grid size-eightpulse place-items-center","aria-label":t,children:(0,R.jsxs)("svg",{className:"size-sixpulse animate-spin fill-none",viewBox:"0 0 24 24",children:[(0,R.jsx)("path",{fillRule:"evenodd",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0v2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12H0z",clipRule:"evenodd",fill:Ve(e)}),(0,R.jsx)("title",{children:t})]})})}var Ee=require("react/jsx-runtime");function ke(e){let a=e,{__scopeButton:t}=a,r=b(a,["__scopeButton"]),{variant:o}=W("ButtonRefresh",t),l={"brand-primary":"white","neutral-secondary":"neutral","neutral-tertiary":"black"};return(0,Ee.jsx)(ae,f(m({},r),{color:l[o]}))}var ne=U(require("react"),1);function Le(e){return ne.default.Children.count(e)===1&&ne.default.isValidElement(e)?e.type===Y:!1}var J=require("react/jsx-runtime"),se="Button",_e=(0,Ae.forwardRef)((e,t)=>{let{children:r,variant:o="brand-primary",size:l="ml",loading:a=!1,disabled:n=!1,full:i,className:s,__scopeButton:c}=e,d=a||n;return(0,J.jsx)(Ut,{scope:c,variant:o,size:l,disabled:n,children:(0,J.jsx)("button",f(m({},e),{ref:t,className:Be({variant:o,size:l,disabled:n,full:i,className:s,asIconOnly:Le(r)}),disabled:d,"aria-disabled":n,children:a?(0,J.jsx)(ke,{}):r}))})});_e.displayName=se;var[Gt]=(0,De.createContextScope)(se),[Ut,W]=Gt(se),z={Root:_e,Icon:Y};var qe=u({base:"input-text-clear-button group-active:hidden",variants:{size:{md:"-mr-[0.375rem]",ml:"-mr-[0.5rem]",lg:"-mr-[0.5rem]",xl:"-mr-[0.5rem]"},readOnly:{true:"invisible hidden"},disabled:{true:"invisible hidden"},isActive:{true:""}},compoundVariants:[{readOnly:!1,disabled:!1,isActive:!0,class:"peer-focus/field:peer-[:not(:placeholder-shown)]/field:visible peer-focus/field:peer-[:not(:placeholder-shown)]/field:flex group-hover:peer-[:not(:placeholder-shown)]/field:flex"}],defaultVariants:{readOnly:!1,disabled:!1}}),Fe=u({base:"px-none",variants:{size:{md:"h-medium w-medium",ml:"h-mediumlarge w-mediumlarge",lg:"h-mediumlarge w-mediumlarge",xl:"h-mediumlarge w-mediumlarge"}}});var X=require("react/jsx-runtime"),Qe=r=>{var o=r,{__scopeInputMultiSelect:e}=o,t=b(o,["__scopeInputMultiSelect"]);let{size:l,disabled:a,isActive:n,readonly:i}=x("InputMultiSelectClearButton",e),s=(0,He.useMemo)(()=>{switch(l){case"md":return"md";default:return"ml"}},[l]);return(0,X.jsx)("div",{className:qe({size:l,disabled:a,isActive:n,readOnly:i}),"aria-disabled":a,children:(0,X.jsx)(z.Root,f(m({},t),{size:s,disabled:a,variant:"neutral-tertiary",className:Fe({size:s}),children:(0,X.jsx)(z.Icon,{symbol:"rdicon-dismiss-circle-outline"})}))})};var Ue=require("react");var Ge=u({base:` peer/field h-small flex w-[100%] bg-[transparent] !font-rdmodern font-regular text-text-neutral-alternative tracking-tiny leading-small placeholder:opacity-transparent focus-visible:border-none focus-visible:outline-none `,variants:{size:{md:"text-threepulse",ml:"text-threeandhalfpulse",lg:"text-threeandhalfpulse",xl:"text-threeandhalfpulse"},readOnly:{true:"text-text-neutral-readonly"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""},isActive:{true:"text-text-neutral"}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{readOnly:!1,disabled:!1}});var $e=require("react/jsx-runtime"),ie=(0,Ue.forwardRef)((a,l)=>{var n=a,{__scopeInputMultiSelect:e,onFocus:t,onBlur:r}=n,o=b(n,["__scopeInputMultiSelect","onFocus","onBlur"]);let{disabled:i,readonly:s,size:c,isActive:d,setActive:p}=x("InputMultiSelectField",e),y=w=>{p(!0),t==null||t(w)},v=w=>{p(!1),r==null||r(w)};return(0,$e.jsx)("input",f(m({},o),{ref:l,disabled:i,readOnly:s,placeholder:"Placeholder is hidden",className:Ge({disabled:i,readOnly:s,isActive:d,size:c}),onFocus:y,onBlur:v}))});ie.displayName="InputMultiSelectField";var Ye=require("react");var Ke=u({base:"flex w-full flex-wrap items-center justify-start gap-onepulse px-onepulse text-left font-rdmodern font-semibold text-text-neutral-alternative text-threepulse",variants:{hasError:{true:"text-text-danger-alternative",false:""},readOnly:{true:"cursor-not-allowed text-text-neutral-readonly"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"text-text-neutral-readonly"}],defaultVariants:{error:!1,disabled:!1,readOnly:!1}});var B=require("react/jsx-runtime"),We=a=>{var n=a,{withIcon:e,iconName:t="rdicon-warning-circle",children:r,__scopeInputMultiSelect:o}=n,l=b(n,["withIcon","iconName","children","__scopeInputMultiSelect"]);let{disabled:i,hasError:s,readonly:c}=x("InputMultiSelectHelperText",o),d=s?"rdicon-warning-circle":t,p=(0,Ye.useMemo)(()=>c?"colorTextNeutralReadonly":i?"colorTextNeutralDisabled":s?"colorTextDangerAlternative":"colorTextNeutralAlternative",[i,s,c]);return r?(0,B.jsxs)("div",f(m({},l),{"aria-disabled":i,className:Ke({hasError:s,disabled:i,readOnly:c}),children:[e&&(0,B.jsx)("div",{className:"flex items-center",children:(0,B.jsx)(h,{symbol:d,color:p,size:"tiny"})}),(0,B.jsx)("span",{className:"line-clamp-2 flex-1",children:r})]})):null};var Je=require("react");var de=require("react/jsx-runtime");function Xe(o){var l=o,{__scopeInputMultiSelect:e,color:t="colorTextNeutralDefault"}=l,r=b(l,["__scopeInputMultiSelect","color"]);let{size:a,disabled:n,readonly:i}=x("InputMultiSelectField",e),s=(0,Je.useMemo)(()=>{let d={md:"extra-small",ml:"small",lg:"small",xl:"small"};return d==null?void 0:d[a]},[a]),c=()=>i?"colorTextNeutralReadonly":n?"colorTextNeutralDisabled":"colorTextNeutralDefault";return(0,de.jsx)("div",{className:"flex items-center",children:(0,de.jsx)(h,f(m({},r),{color:c(),size:s}))})}var Ze=u({base:` w-full align-middle m-none p-none text-left font-rdmodern font-regular tracking-tiny text-text-neutral text-nowrap truncate leading `,variants:{size:{md:"text-threepulse leading-[150%]",ml:"text-threeandhalfpulse leading-[140%]",lg:"text-threeandhalfpulse leading-[140%]",xl:"text-threeandhalfpulse leading-[140%]"},readOnly:{true:"",false:""},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{disabled:!1,readOnly:!1}});var ce=require("react/jsx-runtime"),je=e=>{let n=e,{__scopeInputMultiSelect:t,children:r}=n,o=b(n,["__scopeInputMultiSelect","children"]),{disabled:l,size:a}=x("InputMultiSelectLabel",t);return r?(0,ce.jsx)("div",{className:"flex h-extrasmall w-full items-center rounded-none border-none px-onepulse text-left",children:(0,ce.jsx)("label",f(m({},o),{className:Ze({disabled:l,size:a}),"aria-disabled":l,children:r}))}):null};var j=require("react");var yt=require("@radix-ui/react-context");var it=require("react");var O=u({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}}),et=u({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:border-action-border-neutral-secondary-hovered hover:bg-action-fill-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"},readOnly:{true:` border-action-border-neutral-secondary-enabled border-quarterpulse bg-action-fill-neutral-secondary-enabled hover:bg-action-fill-neutral-secondary-enabled hover:border-action-border-neutral-secondary-enabled active:border-action-border-neutral-secondary-enabled active:bg-action-fill-neutral-secondary-enabled `},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-enabled 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}}),tt=u({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 active:bg-action-fill-neutral-secondary-pressed active:border-action-border-neutral-secondary-pressed cursor:pointer hover:border-action-border-neutral-secondary-hovered hover:bg-action-fill-neutral-secondary-hovered `,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-enabled 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}}),rt=u({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"},readOnly:{true:` cursor-not-allowed border-action-borderenatral-secondary-disabled border-quarterpulse bg-actenafill-neutral-secondary-disabled hover:bg-action-fill-neutral-secondary-disableenaver:border-action-border-neutral-secondary-dienaed active:border-action-border-neutral-secondary-disabled active:bg-action-fill-neutral-secondary-disabled `},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-enabled 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}}),ot=u({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}}),Z=u({base:` hidden `}),lt=u({base:` hidden group-has-[:checked]:block `,variants:{size:{sm:"h-small",md:"h-tiny",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),at=u({base:"",variants:{size:{sm:"h-small",md:"h-small",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),nt=u({variants:{size:{sm:"h-small",md:"h-extrasmall",ml:"h-small"},disabled:{true:"cursor-not-allowed"}}}),st=u({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"}}});var M=require("react/jsx-runtime"),dt=e=>{let{__scopeChips:t,id:r,name:o,value:l,children:a,onChange:n}=e,{size:i="sm",disabled:s,checked:c,readOnly:d}=S("Chips",t),p=(0,it.useRef)(null),y=s||d;return(0,M.jsx)("div",{className:O(),children:(0,M.jsxs)("label",{className:tt({checked:c,disabled:s,size:i,readOnly:d}),"aria-disabled":s,children:[(0,M.jsx)("input",{ref:p,type:"radio",className:Z(),id:r,disabled:s,name:o,value:l,checked:c,onChange:n,onClick:()=>{!s&&!d&&n&&n()},readOnly:d}),a,!y&&c&&(0,M.jsx)("span",{className:at({size:i}),children:(0,M.jsx)(h,{size:"small",symbol:"rdicon-dismiss",color:s?"colorTextNeutralDisabled":"colorTextDangerAlternative"})})]})})};var ut=require("react/jsx-runtime"),ct=e=>{let{__scopeChips:t,children:r}=e,{size:o,disabled:l,checked:a}=S("Label",t);return(0,ut.jsx)("span",{className:ot({disabled:l,size:o,checked:a}),children:r})};var mt=require("react");var pt=require("react");function _(){let[e,t]=(0,pt.useState)("");return{UseChips:_,selectedValue:e,setSelectedValue:t,iconSizeMapping:{sm:"extra-small",md:"extra-small",ml:"small"}}}var P=require("react/jsx-runtime"),ft=e=>{let{__scopeChips:t,children:r,icon:o,onChange:l=()=>{},count:a=0}=e,{size:n="md",disabled:i,checked:s,readOnly:c}=S("Chips",t),{iconSizeMapping:d}=_(),p=(0,mt.useRef)(null),y=s||a>0,v=o||"rdicon-options-filter";return(0,P.jsx)("div",{className:O(),children:(0,P.jsxs)("button",{type:"button",className:rt({size:n,disabled:i,hasChecked:y,readOnly:c}),ref:p,onClick:l,children:[(0,P.jsx)("span",{className:nt({size:n}),children:(0,P.jsx)(h,{size:d[n],symbol:v,color:i?"colorTextNeutralDisabled":"colorTextNeutralDefault"})}),r,a>0&&(0,P.jsx)("span",{className:st({size:n,disabled:i}),children:a>9?"9+":a})]})})};var bt=require("react");var T=require("react/jsx-runtime"),ht=e=>{let{__scopeChips:t,id:r,name:o,value:l,children:a,onChange:n}=e,{size:i="md",disabled:s,readOnly:c,checked:d}=S("Chips",t),{iconSizeMapping:p}=_(),y=(0,bt.useRef)(null);return(0,T.jsx)("div",{className:O(),children:(0,T.jsxs)("label",{className:et({checked:d,disabled:s,size:i,readOnly:c}),"aria-disabled":s,children:[(0,T.jsx)("input",{ref:y,type:"radio",className:Z(),id:r,disabled:s,name:o,value:l,checked:d,onChange:n}),(0,T.jsx)("span",{className:lt({size:i}),children:(0,T.jsx)(h,{size:p[i],symbol:"rdicon-checkmark",color:s?"colorTextNeutralDisabled":"colorTextNeutralDefault"})}),a]})})};var vt=require("react/jsx-runtime"),ue="Chips",xt=e=>{let n=e,{size:t,children:r,disabled:o,__scopeChips:l}=n,a=b(n,["size","children","disabled","__scopeChips"]);return(0,vt.jsx)(Kt,f(m({},e),{size:t,disabled:o,scope:l,children:r}))};xt.displayName=ue;var[$t]=(0,yt.createContextScope)(ue),[Kt,S]=$t(ue),q={Root:xt,Single:ht,Label:ct,Input:dt,Multiple:ft};var gt=u({base:"flex w-full flex-wrap gap-1"}),ll=u({base:"flex h-[2rem] max-h-[2.5rem] items-center justify-center gap-onepulse rounded-[999px] border border-[#9E9E9E] px-twopulse py-onepulse font-bold text-[#575757] text-sm"}),al=u({base:"flex rotate-45"});var F=require("react/jsx-runtime");function It({labels:e,removeItem:t,__scopeInputMultiSelect:r}){let{disabled:o,readonly:l,size:a}=x("InputMultiSelectLabel",r),n=(0,j.useCallback)((s,c)=>c?`+${s}`:s.slice(0,1).toUpperCase()+s.slice(1),[]),i=(0,j.useMemo)(()=>a==="lg"||a==="xl"?"ml":"sm",[a]);return(0,F.jsx)("div",{className:gt(),children:e.map(({id:s,label:c,oversized:d})=>{let p=n(c,d);return(0,F.jsx)(q.Root,{id:s,name:p,disabled:o,readOnly:l,value:"",size:i,checked:!d,children:(0,F.jsx)(q.Input,{id:s,name:p,value:"",onChange:()=>t(s),children:(0,F.jsx)(q.Label,{children:p})})},s)})})}var Ot=require("@radix-ui/react-context");var Vt=require("react");var Rt=require("react");var pe=require("react/jsx-runtime"),V=()=>(0,pe.jsx)("div",{className:"x-full flex py-onepulse","data-testid":"separator",children:(0,pe.jsx)("div",{className:"flex-1 border-border-neutral border-hairline","data-testid":"divider-line"})});var me=require("react/jsx-runtime"),fe=({controls:e,testID:t})=>(0,me.jsx)("div",{"data-testid":t,className:"x-full flex items-center gap-threepulse border-border-neutral border-t-hairline bg-fill-neutral p-threepulse ",children:e.slice(0,2).map((r,o)=>{let l=r.type==="confirm"?"brand-primary":"neutral-tertiary";return(0,me.jsx)(z.Root,{size:"lg",variant:l,onClick:r.handler,children:r.label},String(o))})});var wt=require("@radix-ui/react-context"),re=U(require("react"),1);var k=require("react/jsx-runtime");function ee({children:e,title:t}){let r=!!(t!=null&&t.length);return(0,k.jsxs)("div",{className:"flex flex-col",children:[(0,k.jsx)(V,{}),(0,k.jsx)("div",{className:"px-fivepulse py-twopulse",children:r&&(0,k.jsx)("h2",{className:"font-bold text-rdmodern text-text-neutral-readonly text-threeandhalfpulse leading-small",children:t})}),e]})}var H=require("react");var Ct=u({base:"flex items-center space-x-2",variants:{type:{single:"px-twopulse py-onepulse",multi:"px-twopulse py-onepulse"}}}),yl=u({base:"gap-onepulse p-onepulse"}),St=u({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"]});var C=require("react/jsx-runtime");function te({type:e="multi",content:t,checked:r,disabled:o,testID:l,onPress:a}){let[n,i]=(0,H.useState)(!1),s=!!t.prefixIcon,c=!!t.description,d=(0,H.useCallback)(()=>i(!0),[]),p=(0,H.useCallback)(()=>i(!1),[]),y=v=>{let w=s?23:25;return v&&v.length>w?`${v.substr(0,w)}...`:v};return(0,C.jsx)("button",{onMouseDown:d,onMouseUp:p,onClick:a,"data-testid":l,disabled:o,type:"button",className:St(),children:(0,C.jsxs)("div",{className:Ct({type:e}),children:[e==="multi"&&(0,C.jsx)("div",{className:"flex items-center p-onepulse",children:(0,C.jsx)(h,{symbol:r?"rdicon-checkbox-checked":"rdicon-checkbox-unchecked",color:o?"colorTextNeutralDisabled":r?"colorActionFillBrandPrimaryEnabled":"colorTextNeutralDefault",size:"small"})}),s&&(0,C.jsx)(h,{symbol:t.prefixIcon,color:o?"colorTextNeutralDisabled":"colorTextNeutralDefault",size:"small"}),(0,C.jsxs)("div",{className:"flex flex-1 flex-col items-start gap-halfpulse p-onepulse ",children:[(0,C.jsx)("p",{className:`tracking font-rdmodern font-regular text-threeandhalfpulse leading-small ${o?"text-text-neutral-disabled":"text-text-neutral"}`,children:t.label}),c&&(0,C.jsx)("p",{className:`tracking font-rdmodern font-regular text-threepulse leading-small ${o?"text-text-neutral-disabled":"text-text-neutral-placeholder"}`,children:y(t.description)})]}),e==="single"&&r&&(0,C.jsx)(h,{symbol:"rdicon-checkmark",color:"colorTextSuccessAlternative",size:"small"})]})})}var Q=U(require("react"),1);var Mt=U(require("react"),1);function be(e){return Mt.default.isValidElement(e)&&e.type===te}var Pt=require("react/jsx-runtime"),Yt="Only Fragment, OptionMenu.Item and Group components are allowed as children of OptionMenu.List. Please remove or replace any other elements.";function he(r){var o=r,{maxHeight:e=480}=o,t=b(o,["maxHeight"]);let{__scopeOptionMenu:l,children:a,testID:n}=t,i=N(),{type:s}=Tt("OptionMenuList",l),c=[];return Q.default.Children.forEach(a,d=>{if(Q.default.isValidElement(d)){if(d.type===Q.default.Fragment){let p=d.props.children;c.push(p);return}if(be(d)||d.type===ee||d.type===V)c.push(d);else throw new Error(Yt)}}),c=c.map(d=>be(d)?Q.default.cloneElement(d,{key:((1+Math.random())*65536|0).toString(16).substring(1),type:s}):d),(0,Pt.jsx)("div",{className:`flex max-h-[${e}px] flex-col overflow-y-scroll px-onepulse py-onepulse ${i.spacingInlineOnepulse}`,"data-testid":n,children:c})}var E=require("react/jsx-runtime"),Nt="OptionMenu",Wt=e=>{let{type:t,children:r,customEmptyMessage:o="N\xE3o foi encontrado nenhum resultado.",testID:l,__scopeOptionMenu:a}=e,n=re.default.Children.map(r,i=>{if(re.default.isValidElement(i)&&(i.type===he||i.type===fe))return i});return(0,E.jsx)(Xt,{scope:a,type:t,"data-testid":l,children:(0,E.jsx)("div",{className:"rounded-form border-border-neutral border-quarterpulse bg-fill-neutral py-onepulse ",children:re.default.Children.count(r)>0?(0,E.jsx)("div",{className:"flex-grow",children:n}):(0,E.jsx)("div",{className:"flex items-start justify-center",children:(0,E.jsx)("p",{className:"tracking px-onepulse py-twopulse font-regular text-rdmodern text-text-neutral text-threeandhalfpulse leading-small",children:o})})})})},[Jt]=(0,wt.createContextScope)(Nt),[Xt,Tt]=Jt(Nt),L={Root:Wt,Footer:fe,Divider:V,Item:te,List:he,Group:ee};var A=require("react/jsx-runtime"),zt=({labels:e,selectedLabels:t,onCancel:r,onConfirm:o,__scopeInputMultiSelect:l})=>{let{isActive:a,setActive:n}=x("InputMultiSelectActions",l),[i,s]=(0,Rt.useState)(t),c=p=>!!i.find(({id:y})=>y===p),d=(p,y)=>{s(p?i.filter(({id:v})=>v!==y.id):[...i,y])};return(0,A.jsxs)(L.Root,{children:[(0,A.jsx)(L.List,{children:e.map(p=>(0,A.jsx)(L.Item,{type:"multi",checked:c(p.id),content:{label:p.label,value:p.id},onPress:()=>d(c(p.id),p)},p.id))}),(0,A.jsx)(L.Footer,{controls:[{type:"cancel",label:"Cancelar",handler:()=>{n(!a),r()}},{type:"confirm",label:"Confirmar",handler:()=>{n(!a),o(i)}}]})]})};var Bt=u({base:"flex w-full min-w-[calc(var(--sizing-gigantic)_+_var(--sizing-gigantic))] flex-col gap-halfpulse",variants:{disabled:{true:"opacity-50"},readonly:{true:"opacity-75"}}});var ye=require("react/jsx-runtime"),xe="InputMultiSelect",kt=e=>{let{size:t="ml",children:r,__scopeInputMultiSelect:o}=e,[l,a]=(0,Vt.useState)(!1);return(0,ye.jsx)(jt,f(m({},e),{size:t,scope:o,isActive:l,setActive:a,children:(0,ye.jsx)("div",{className:Bt({disabled:e.disabled,readonly:e.readonly}),children:K(r,[{child:I.Label,amount:1},{child:I.Actions,amount:1},{child:I.HelperText,amount:1},{child:I.Dropdown,amount:1}])})}))};kt.displayName=xe;var[Zt]=(0,Ot.createContextScope)(xe),[jt,x]=Zt(xe),I={Root:kt,Label:je,HelperText:We,Actions:Re,ClearButton:Qe,Icon:Xe,Field:ie,Quantity:It,Dropdown:zt};0&&(module.exports={InputMultiSelect}); //# sourceMappingURL=index.cjs.map