rds-ui-system 2.13.0 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6349,8 +6349,8 @@ const Et = ({
6349
6349
  G(s);
6350
6350
  }, []);
6351
6351
  q(() => {
6352
- A.length === 0 && O();
6353
- }, []), q(() => {
6352
+ A.length !== s.length && O();
6353
+ }, [s, A]), q(() => {
6354
6354
  const Z = (Q) => {
6355
6355
  Q.key === "Escape" && (M(!1), r(A.map((D) => D.id)));
6356
6356
  };
@@ -6605,8 +6605,8 @@ const yr = {
6605
6605
  k(r);
6606
6606
  }, []);
6607
6607
  q(() => {
6608
- j || G();
6609
- }, []), q(() => {
6608
+ (!j || r !== j) && G();
6609
+ }, [j, r]), q(() => {
6610
6610
  const O = (m) => {
6611
6611
  m.key === "Escape" && (P(!1), j && t(j.id));
6612
6612
  };
@@ -26,4 +26,4 @@ Check the top-level render call using <`+p+">.")}return h}}function Gt(i,h){{if(
26
26
  ${G?"border-error":""}
27
27
  ${gt[t]}`;return e.jsx(e.Fragment,{children:e.jsxs("div",{className:k("relative flex h-14 w-full flex-shrink-0 flex-grow-0 flex-col items-start justify-start rounded-tl rounded-tr bg-white",a&&"pointer-events-none cursor-not-allowed opacity-[0.3]",y),"data-testid":"test-input",children:[r&&e.jsx("label",{className:k("absolute -top-2 left-2 flex items-center justify-start rounded bg-white px-1 text-left text-xs text-black",G&&"text-error"),"data-testid":"test-input-label",children:r}),e.jsx("input",{id:x,ref:R,value:E,name:d,type:T?"text":c,onChange:C,placeholder:s,className:z,style:{WebkitAppearance:"none",appearance:"none"},disabled:a,required:j,"aria-invalid":l,"data-testid":"test-input-input",...P}),e.jsxs("div",{style:{background:""},className:"absolute right-[0.08em] top-[0.1em] flex h-[2.8em] flex-shrink-0 flex-grow-0 items-center justify-center gap-2.5 rounded-r py-0 pl-2 pr-2",children:[c=="password"&&e.jsx(Y,{onClick:g=>{g.preventDefault(),q()},className:"px-0 hover:bg-transparent [&_path]:hover:!fill-black","data-testid":T?"toggle-visibility-off":"toggle-visibility",variant:"TEXT",iconName:T?"VisibilityOff":"Visibility"}),l?e.jsx(Y,{iconName:"Error",onClick:A,variant:"TEXT",className:"hover:bg-transparent [&_path]:hover:!fill-black",iconColor:"fill-brand","data-testid":"button-clear"}):e.jsx(Y,{iconName:"Cancel",onClick:A,variant:"TEXT",className:"hover:bg-transparent [&_path]:hover:!fill-black","data-testid":"button-clear"})]}),f&&e.jsx(fe,{message:f,showErrorStyles:G,className:"ml-4 mt-1"})]})})});jt.displayName="Input";const ve=s=>e.jsx("a",{...s,className:k("rds-copy-lg cursor-pointer underline-offset-2 hover:underline",s.disabled&&"pointer-events-none cursor-none opacity-50",s.className),children:s.children}),Ss={DEFAULT:"primary"},Is={DEFAULT:"bg-yellow-200 hover-bg-green-400 active-bg-green-500"},Xe=m.forwardRef(({label:s,disabled:r=!1,isError:t=!1,required:a=!1,onChange:l,checked:n,id:o,readOnly:d,...c},x)=>{const[f,j]=m.useState(n||!1),[y,P]=m.useState(!1);m.useEffect(()=>{j(n||!1)},[n]);const R=t||a;return e.jsxs("div",{className:`relative flex items-center justify-start gap-2 ${r?"pointer-events-none opacity-50":""}`,"data-testid":"test-radio",children:[e.jsxs("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`relative h-5 w-5 flex-shrink-0 flex-grow-0 ${f?"text-black":"text-white"}`,preserveAspectRatio:"none",children:[e.jsx("rect",{x:"0.5",y:"0.5",width:19,height:19,rx:"10",fill:"white",stroke:R?"#e2001a":y?"black":"#AFB0B7",strokeWidth:1}),y&&e.jsx("circle",{cx:10,cy:10,r:6,fill:"lightgrey","data-testid":"circle"}),f&&e.jsx("circle",{cx:10,cy:10,r:6,fill:"black"})]}),e.jsx("span",{className:k("text-left text-base text-black"),children:s}),e.jsx("input",{type:"checkbox",ref:x,id:o,checked:f,onChange:E=>{j(E.target.checked),l==null||l(E)},readOnly:d,className:"absolute h-[1.2em] w-[1.2em] cursor-pointer opacity-0",onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),"data-testid":"test-radio-input",...c})]})});Xe.displayName="Radio";const Bs={DEFAULT:"default",GREY:"grey"},Ke=m.forwardRef(({option:s,isActive:r,className:t,onSelectionChange:a,withCheckbox:l=!0,variant:n="DEFAULT",checkboxPosition:o="leading",showAmount:d,...c},x)=>{const f=l&&o==="leading",j=l&&o==="trailing";return e.jsxs("li",{ref:x,className:k("flex w-full items-center border-b border-brand-50 px-4 py-2","delay-10 transition-all duration-200 hover:bg-brand-50","last:rounded-b last:border-transparent",n==="GREY"&&"bg-grey-50",r&&"bg-brand-100",n==="GREY"&&r&&"bg-grey-300",!l&&"items-start",t),title:s.name,onClick:()=>a(s),"data-testid":"test-selectItem-"+s.id,...c,children:[f&&e.jsx(Ee,{id:"checkbox-"+s.id,checked:r,onChange:()=>a(s)}),e.jsx("span",{className:"ml-4",children:s.name}),d&&s.amountResults&&e.jsxs("span",{className:"ml-4",children:["(",s.amountResults,")"]}),j&&e.jsx(Ee,{id:"checkbox-"+s.id,checked:r,onChange:()=>a(s)})]})});Ke.displayName="SelectItem";const Ws=({className:s})=>e.jsx("div",{className:k("h- animate-pulse rounded bg-gray-300 dark:bg-gray-500",s)}),Os=({min:s,max:r,step:t=1,value:a=s,disabled:l=!1,onChange:n,trackColor:o="bg-gray-200",thumbColor:d="bg-white",percentage:c})=>{const[x,f]=m.useState(a),j=y=>{const P=Number(y.target.value);f(P),n==null||n(P)};return e.jsxs("div",{className:"relative flex h-[1.5em] w-full items-center",children:[e.jsx("div",{className:"absolute h-2 w-full rounded-lg border border-black"}),e.jsx("div",{className:k("absolute h-2 rounded-lg border border-black transition-all duration-0",o),style:{width:`${(x-s)/(r-s)*100}%`},"data-testid":"test-track"}),e.jsx("input",{type:"range",min:s,max:r,step:t,value:x,onChange:j,disabled:l,className:k("relative z-20 h-2 w-full cursor-pointer appearance-none rounded-lg bg-transparent","hover:brightness-90 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"),style:{WebkitAppearance:"none",appearance:"none"},"data-testid":"test-slider"}),e.jsx("div",{className:k("absolute top-1/2 h-[1.3em] w-[1.3em] rounded-full border border-black bg-red-500 shadow-md transition-transform duration-200 ease-in-out",d),style:{left:`${(x-(s-1))/(r-(s-2))*100}%`,transform:"translate(-50%, -50%)"},"data-testid":"test-thumb"}),c&&e.jsxs("span",{className:"absolute text-sm font-medium text-black",style:{left:`${(x-(s-1))/(r-(s-2))*100}%`,transform:"translate(-50%, -150%)",top:"1em"},children:[Math.round(x),"%"]})]})},zs={DEFAULT:"default",LARGE:"large",SMALL:"small",BUTTON:"button",TAB:"tab"},bt={DEFAULT:"rds-copy",SMALL:"rds-copy-small",LARGE:"rds-copy-large",BUTTON:"rds-button",TAB:"rds-tab"},_t=m.forwardRef(({isDisabled:s=!1,text:r,children:t,bold:a,className:l,title:n,variant:o="DEFAULT"},d)=>e.jsx("p",{ref:d,title:n,className:k(bt[o],a&&"font-semibold",s&&"pointer-events-none cursor-not-allowed opacity-[0.3]",l),"data-testid":"test-text",children:t??r}));_t.displayName="Text";const Us={DEFAULT:"default"},Lt={DEFAULT:"flex flex-col justify-start items-start self-stretch flex-grow-0 flex-shrink-0 gap-2.5 transition-all duration-400 rounded border border-1 border-grey-800 hover:outline outline-offset-0 outline-1"},kt=m.forwardRef(({value:s,placeholder:r,label:t,variant:a="DEFAULT",disabled:l=!1,isError:n=!1,defaultValue:o,required:d,onChange:c,supportingText:x,id:f,...j},y)=>{const P=`h-[3.1em] w-full transition-colors px-4 py-3 rounded-md
28
28
  ${d||n?"border-error":""}
29
- ${Lt[a]} ${l?"cursor-not-allowed pointer-events-none":""} ${j.rows!==void 0&&"h-fit"}`;return e.jsxs("div",{className:`relative flex w-full flex-col items-start justify-start rounded-tl rounded-tr ${l&&"pointer-events-none cursor-not-allowed opacity-[0.3]"}`,"data-testid":"test-textarea",children:[t&&e.jsx("div",{className:"label absolute -top-2 left-3 flex items-center justify-start rounded bg-white px-1",children:e.jsx("p",{className:`text-left text-xs ${d||n?"text-error":"text-black"}`,"data-testid":"test-textarea-label",children:t})}),e.jsx("textarea",{id:f,ref:y,value:s,defaultValue:o,placeholder:r,onChange:c,className:P,disabled:l,required:d,"data-testid":"test-textarea-input",...j}),x&&e.jsx(fe,{message:x,className:"ml-4 mt-1",showErrorStyles:d||n})]})});kt.displayName="Textarea";const Ds={DEFAULT:"default"},Gs={DEFAULT:"bg-black hover:bg-black-800 active:bg-grey-900"},Ys=({options:s,allowMultiple:r=!1})=>{const[t,a]=m.useState(void 0),[l,n]=m.useState([]),o=d=>{r?l.includes(d)?n(l.filter(c=>c!==d)):n([...l,d]):a(c=>c===d?void 0:d)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:"w-full overflow-hidden rounded border border-brand-black","data-testid":"test-accordion",children:s.map((d,c)=>{const x=t===c||l.includes(c);return e.jsxs("div",{className:"accordion-item relative h-fit w-full flex-col items-start justify-start gap-2.5 overflow-hidden border-b bg-brand-white pt-4 transition-all duration-700 last:border-b-0 hover:cursor-pointer focus:border-blue-500 focus:outline-none",children:[e.jsxs("button",{className:"flex h-[2.5em] w-full justify-between border-b bg-brand-white px-4",onClick:()=>o(c),"data-testid":"test-accordion-header-"+c,children:[d.title,x?e.jsx(F,{name:"ExpandLess"}):e.jsx(F,{name:"ExpandMore"})]}),e.jsx("div",{className:`h-fit transition-all duration-500 ${x?"max-h-[15em] overflow-y-scroll":"max-h-0 overflow-hidden"}`,"data-testid":"test-accordion-body-"+c,children:d.content?e.jsx("div",{className:"p-4",children:d.content}):e.jsx("p",{className:"p-4",children:d.description})})]},"accordion-"+c)})})})},yt=({links:s,variant:r="dark",className:t})=>e.jsx("ol",{className:k("flex gap-2",t),children:s.map((a,l)=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ve,{...a,className:k("text-sm",r==="light"?"text-white":"text-black"),children:a.label}),l<s.length-1&&e.jsx(F,{name:"KeyboardArrowRight",iconColor:r==="light"?"white":"black"})]},"breadcrumb-"+a.label))}),Nt=({title:s,links:r,className:t,variant:a="dark"})=>{const[l,n]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{const c=()=>{n(!1)};return o.current&&o.current.addEventListener("mouseleave",c),()=>{o.current&&o.current.removeEventListener("mouseleave",c)}},[]);const d=()=>{n(!1)};return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>{n(!0)},onMouseEnter:()=>{n(!0)},className:k("rds-copy-lg flex text-white",a==="dark"&&"text-black"),children:[s," ",e.jsx(F,{name:"ExpandMore",iconColor:a==="dark"?"fill-black":"fill-white",className:k(l&&"rotate-180 duration-300")})]}),e.jsx("div",{className:k("absolute top-full z-10 mt-4 h-fit w-fit min-w-36 rounded-lg transition-all duration-500",l?"max-h-96 opacity-100":"max-h-0 overflow-hidden opacity-0",t),children:e.jsx("ul",{ref:o,onMouseLeave:d,children:r.map((c,x)=>e.jsx("li",{className:"px-4 py-2 transition-all duration-150 first:rounded-t-lg last:rounded-b-lg hover:backdrop-brightness-75",children:e.jsx(ve,{href:c.href,className:k(a==="dark"?"text-black":"text-white"),children:c.label})},s+x))})})]})},Ct=({navigation:s,className:r,classNameDropdown:t})=>{const[a,l]=m.useState(!1),n=m.useRef(null),[o,d]=m.useState(void 0);m.useEffect(()=>{const f=()=>{l(!1)};return n.current&&n.current.addEventListener("mouseleave",f),()=>{n.current&&n.current.removeEventListener("mouseleave",f)}},[]);const c=()=>{l(!1)},x="py-2 last:pb-0";return e.jsxs("div",{className:k("flex items-center lg:hidden",r),children:[e.jsx("button",{onClick:()=>l(!a),children:e.jsx(F,{name:"Menu",iconColor:"fill-white",className:"block [&_svg]:h-8 [&_svg]:w-8"})}),e.jsx("div",{className:k("absolute right-0 top-[100%] h-fit w-fit min-w-48 rounded-lg rounded-tr-none p-4 transition-all duration-500",a?"max-h-96 opacity-100":"max-h-0 overflow-hidden opacity-0",t),children:e.jsx("ul",{ref:n,onMouseLeave:c,children:o?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(Y,{variant:"TEXT",iconName:"KeyboardArrowLeft",className:"px-0 pt-0 hover:bg-transparent",onClick:()=>d(void 0)})}),o.links.map(f=>e.jsx("li",{className:x,children:e.jsx(ve,{href:f.href,children:f.label})},"link-"+f.label))]}):e.jsx(e.Fragment,{children:s.map((f,j)=>"title"in f?e.jsxs("button",{onClick:()=>d(f),className:"flex items-center",children:[f.title," ",e.jsx(F,{name:"KeyboardArrowRight"})]},"dropdown-"+f.title):e.jsx("li",{className:x,children:e.jsx(ve,{href:f.href,children:f.label})},f.label+j))})})})]})},Xs={DEFAULT:"default"},Vt=m.forwardRef(({children:s,onClick:r,width:t,height:a,className:l,headline:n},o)=>(m.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]),m.useEffect(()=>{const d=c=>{c.key==="Escape"&&(r==null||r())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:r,className:"fixed inset-0 z-50 transition-opacity",style:{background:"black",opacity:"0.6"}}),e.jsx("div",{"data-testid":"test-modal",ref:o,className:k(`fixed left-1/2 top-1/2 z-50 max-h-full max-w-full -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-md border border-white bg-white p-4 md:p-6 lg:p-8 ${l} `),style:{width:t||"",height:a||""},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:k("flex items-center justify-end p-2",n&&"justify-between"),children:[n&&e.jsx(Ye,{variant:"h3",children:n}),e.jsx(Y,{iconName:"Close",onClick:r,className:"justify-self-end p-2 hover:bg-grey-50 active:bg-grey-300",variant:"UNSTYLED"})]}),s||"empty"]})})]})));Vt.displayName="Modal";const Je=({className:s,isOpen:r,wideDropdown:t,handleMouseLeave:a,handleSelection:l,options:n,optionProps:o,showSearchField:d,inputValue:c="",setInputValue:x,searchFieldPlaceholder:f,currSelected:j})=>{const y=m.useRef(null),P=m.useRef(null),R=m.useRef(null),E=_=>{const C=_.current;C==null||C.scrollIntoView({behavior:"smooth",block:"nearest"})};return m.useEffect(()=>{const _=j.length===1&&r,C=_&&c.length===0;if(_||C){const A=setTimeout(()=>E(y),500);return()=>clearTimeout(A)}},[r,j,c,y]),e.jsxs(e.Fragment,{children:[d&&e.jsx("input",{type:"text",value:c,onChange:_=>x==null?void 0:x(_.target.value),className:k("pointer-events-none absolute z-[10] mt-1 h-0 w-full rounded-t border bg-white p-2 opacity-0 shadow-sm transition-all focus:outline-none",r&&"pointer-events-auto h-fit opacity-100"),placeholder:f}),e.jsx("div",{className:k("absolute left-0 top-full z-[5] mt-1 h-0 w-full cursor-pointer overflow-y-auto overflow-x-hidden rounded-b border bg-grey-50 opacity-0 shadow-md outline-none transition-all",r&&"h-fit max-h-60 opacity-100",t&&"w-fit",d&&r&&"mt-10 max-h-[85vh] min-h-[60vh]",s),ref:R,children:e.jsxs("ul",{className:k("h-full w-full",r&&"h-fit max-h-[200px]",d&&r&&"top-10"),"data-testid":"test-multiselect-list",onMouseLeave:a,ref:P,children:[n.length===0&&e.jsx("p",{className:"bg-slate-200 p-2",children:"keine Optionen gefunden"}),n==null?void 0:n.filter(_=>_.name.toLowerCase().includes(c.toLowerCase())).map(_=>e.jsx(Ke,{id:_.id,option:_,isActive:j==null?void 0:j.some(C=>C.id===_.id),onSelectionChange:l,className:t?"whitespace-nowrap":void 0,ref:j.length===1&&(j!=null&&j.some(C=>C.id===_.id))?y:null,...o},_.id))]})})]})},Ks={DEFAULT:"default"},Mt={DEFAULT:"rounded border border-black bg-brand-white duration-300 transition-all hover:bg-grey-100"},Rt=m.forwardRef(({selectedOptions:s=[],onSelectionChange:r,options:t,isDisabled:a,label:l,variant:n="DEFAULT",wideDropdown:o=!1,optionProps:d,hasError:c=!1,errorMessage:x,placeholder:f="Auswählen",showSelectedAsChips:j=!1,exceptionOptions:y,showSearchField:P=!1,searchFieldPlaceholder:R="Optionen durchsuchen",className:E},_)=>{const[C,A]=m.useState(!1),[T,X]=m.useState([]),[q,G]=m.useState(""),z=m.useCallback(()=>{if(typeof s[0]=="string"){const $=t.filter(K=>s.includes(K.id));X($)}else X(s)},[]);m.useEffect(()=>{T.length===0&&z()},[]),m.useEffect(()=>{const S=$=>{$.key==="Escape"&&(A(!1),r(T.map(K=>K.id)))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}});const g=S=>{let $=T??[];y!=null&&y.includes(S.id)?$=[S]:T!=null&&T.includes(S)?$=T.filter(K=>K!==S&&!(y!=null&&y.includes(K.id))):$=[...T.filter(K=>!(y!=null&&y.includes(K.id)))??[],S],X($)},U=()=>{setTimeout(()=>{T.length>0&&r(T.map(S=>S.id)),C&&A(!1)},500)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:_,className:k("relative rounded",Mt[n],c&&"border-error",E),children:[e.jsxs("button",{onClick:()=>A(!C),className:k("flex w-full cursor-pointer items-start justify-between rounded px-4 py-3 disabled:pointer-events-none disabled:bg-brand-grey-light"),disabled:a,"data-testid":"test-multiselect",children:[e.jsx("label",{className:k("absolute -top-2 left-3 rounded bg-white px-1 text-xs text-black",c&&"text-error"),children:l}),!j&&s.length>0?e.jsx(e.Fragment,{children:T.map(S=>S.name).join(", ")}):e.jsx("p",{className:k(c&&"text-error"),children:f}),e.jsx("div",{className:k("duration-600 -rotate-180 transition-all",C&&"rotate-0"),"data-testid":"test-multiselect-icon-wrapper",children:e.jsx(F,{name:"ExpandLess",className:"relative h-6 w-6 flex-shrink-0 flex-grow-0"})})]}),e.jsx(Je,{handleMouseLeave:U,setInputValue:G,inputValue:q,options:t,currSelected:T,optionProps:d,handleSelection:g,isOpen:C,showSearchField:P,searchFieldPlaceholder:R,wideDropdown:o})]}),c&&x&&e.jsx(fe,{message:x,showErrorStyles:!0,className:"mt-2"}),j&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-4",children:T.map(S=>e.jsx(Ge,{label:S.name,onClick:()=>g(S)},"selected-"+S.name))})]})});Rt.displayName="MultiSelect";const Js={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary"},At={PRIMARY:"bg-white hover:bg-black-800 active:bg-grey-900",SECONDARY:"bg-blue-200 hover:bg-blue-400 active:bg-blue-500",TERTIARY:"bg-red-200 hover:bg-red-400 active:bg-red-500"},Qs={SECONDARY:"bg-blue-500 text-white",TERTIARY:"bg-red-500 text-white",PRIMARY:"bg-black text-white"},qs=({pages:s,onNavigate:r,classNames:t,activeIndex:a})=>{const[l,n]=m.useState([2,3]),o=m.useCallback(()=>{if(a===2||a===s-1)return;if(a===1){n([2,3]);return}if(a===10){n([8,9]);return}const c=[a-1,a,a+1];n(c)},[s,a]);m.useEffect(()=>{o()},[a]);const d=a!==s&&a!==s-1&&a!==s-2;return e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:t(a===1),onClick:()=>r==null?void 0:r(1),"data-testid":"test-constructed-pagination-button-0",children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:1})}),l[0]!==2&&e.jsx(e.Fragment,{children:"..."}),l.map((c,x)=>e.jsx(Y,{className:t(a===c),onClick:()=>r==null?void 0:r(c),"data-testid":"test-pagination-button-"+x,children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:c})},x)),d&&e.jsx(e.Fragment,{children:"..."}),e.jsx(Y,{className:t(a===s),onClick:()=>r==null?void 0:r(10),"data-testid":"test-pagination-button-10",children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:s})})]})},$s=({pages:s,variant:r="PRIMARY",onNavigate:t})=>{const[a,l]=m.useState(1),n=x=>{l(f=>f===x?f:x),t==null||t(x)},o={className:"relative h-6 w-6 flex-shrink-0 flex-grow-0 bg-transparent px-2 hover:bg-grey-300 active:bg-grey-400 [&_path]:disabled:!fill-white",iconColor:"black",iconPosition:"leading"},d=x=>k("flex h-fit rounded p-1 text-black active:text-white",At[r],x&&Qs[r]),c=s<=5;return e.jsxs("div",{className:"relative flex items-center justify-center gap-4","data-testid":"test-pagination",children:[e.jsx(Y,{iconName:"KeyboardArrowLeft",onClick:()=>{const x=a-1;l(x),t==null||t(x)},disabled:a===1,"data-testid":"button-prev",...o}),c?e.jsx(e.Fragment,{children:Array.from(Array(s)).map((x,f)=>e.jsx(Y,{className:d(a===f+1),onClick:()=>{n(f),t==null||t(f)},"data-testid":"test-pagination-button-"+f,children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:f+1})},f))}):e.jsx(qs,{activeIndex:a,classNames:d,pages:s,onNavigate:n}),e.jsx(Y,{iconName:"KeyboardArrowRight",onClick:()=>{const x=a+1;l(x),t==null||t(x)},disabled:a===s,"data-testid":"button-next",...o})]})},Fs=({options:s,supportingText:r,required:t,selectedValue:a,setSelectedValue:l,className:n,showSupportingText:o})=>e.jsxs("div",{className:k("flex flex-col gap-2",n),"data-testid":"test-radioGroup",children:[s.map(d=>e.jsx(Xe,{value:d.value,label:d.label,onChange:c=>l(c.target.value),checked:a===d.value,required:t},"radio-group-"+d.value)),o&&r&&e.jsx(fe,{message:r,showErrorStyles:t,className:"mt-1"})]}),er={DEFAULT:"default",TOP_PULL:"top_pull"},tr={DEFAULT:"bg-black hover:bg-black-800 active:bg-grey-900",TOP_PULL:"bg-black hover:bg-black-800 active:bg-grey-900"},Ht=m.forwardRef(({options:s,selectedOption:r,onSelectionChange:t,label:a,isDisabled:l=!1,optionProps:n,wideDropdown:o=!1,hasError:d=!1,placeholder:c="Auswählen",showSearchField:x=!1,searchFieldPlaceholder:f="Optionen durchsuchen",className:j,errorMessage:y},P)=>{const[R,E]=m.useState(!1),[_,C]=m.useState(void 0),[A,T]=m.useState(""),X=m.useCallback(()=>{if(typeof r=="string"){const g=s.find(U=>r===U.id);C(g)}else C(r)},[]);m.useEffect(()=>{_||X()},[]),m.useEffect(()=>{const z=g=>{g.key==="Escape"&&(E(!1),_&&t(_.id))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}});const q=()=>{E(!R)},G=()=>{setTimeout(()=>{_&&t(_.id),R&&E(!1)},500)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:P,className:k("relative rounded border border-black",d&&"border-error",j),children:[e.jsxs("button",{className:"flex h-[3.1em] w-full items-center gap-2.5 self-stretch rounded pr-2.5 hover:bg-grey-100 disabled:pointer-events-none disabled:bg-brand-grey-light",onClick:q,tabIndex:0,disabled:l,"data-testid":"test-select",children:[e.jsx("label",{className:k("absolute -top-2 left-3 rounded bg-white px-1 text-xs text-black",d&&"text-error"),children:a}),e.jsxs("div",{className:"flex w-full items-center justify-between self-stretch rounded-tl rounded-tr py-1 pl-4",children:[e.jsx("div",{className:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-left text-base text-black",children:(_==null?void 0:_.name)??c}),e.jsx("div",{className:k("duration-600 -rotate-180 transition-all",R&&"rotate-0"),"data-testid":"test-select-icon",children:e.jsx(F,{name:"ExpandLess",className:"relative h-6 w-6 flex-shrink-0 flex-grow-0"})})]})]}),e.jsx(Je,{isOpen:R,handleMouseLeave:G,options:s,currSelected:_?[_]:[],handleSelection:z=>{z.id===(_==null?void 0:_.id)?C(void 0):C(z)},optionProps:n,inputValue:A,setInputValue:T,wideDropdown:o,showSearchField:x,searchFieldPlaceholder:f})]}),d&&y&&e.jsx(fe,{message:y,showErrorStyles:!0,className:"mt-2"})]})});Ht.displayName="Select";var Pt=(s=>(s.SUCCESS="success",s.INFO="info",s.ERROR="error",s))(Pt||{});const Et=({type:s,message:r,showClosingButton:t=!0,showDetails:a,detailsLink:l,className:n})=>{const o=s==="success"?"Checked":"Info";return e.jsxs("div",{className:k("flex w-80 justify-between rounded p-2 text-white drop-shadow-sm",s==="success"&&"bg-success",s==="error"&&"bg-error",s==="info"&&"bg-warning",n),children:[e.jsxs("div",{className:"flex grow",children:[e.jsx(F,{name:o,iconColor:"white",className:"mr-2 pt-0.5",isIconSolid:!0}),e.jsx("span",{className:k(a&&"max-w-[68%]"),children:r}),a&&e.jsx(Y,{variant:"TEXT",label:"Details",className:"ml-2 h-fit grow self-end text-white hover:bg-transparent active:bg-transparent",onClick:a}),l&&e.jsx("a",{href:l,className:"rds-button ml-2 self-end p-2 underline-offset-2 hover:underline",children:"Details"})]}),t&&e.jsx(Y,{iconColor:"fill-white",iconName:"Close",className:"h-fit self-start bg-transparent px-2 py-0 hover:bg-transparent active:bg-transparent"})]})},sr=({logo:s,className:r,classNameContent:t,children:a,navigation:l,classNameDropdown:n,variant:o,handleLogout:d,account:c,breadcrumbs:x})=>e.jsxs("header",{className:k("fixed right-0 top-0 z-0 w-full py-5",r),children:[e.jsxs("div",{className:k("mx-auto flex items-center justify-between lg:justify-start",t),children:[s,l&&e.jsxs(e.Fragment,{children:[e.jsx("nav",{className:"ml-8 mr-4 hidden grow items-center lg:flex",children:e.jsx("ul",{className:"flex items-center gap-4",children:l==null?void 0:l.map(f=>"title"in f?e.jsx("li",{children:e.jsx(Nt,{...f,className:n,variant:o})},"dropdown-"+f.title):e.jsx("li",{children:e.jsx(ve,{href:f.href,className:o==="light"?"text-white":"text-black",children:f.label})},"headerlink-"+f.label))})}),e.jsx(Ct,{navigation:l,classNameDropdown:n})]}),a,d&&e.jsx(Y,{onClick:d,iconName:"Login",variant:"UNSTYLED",iconColor:o==="light"?"white":"dark"}),c]}),x&&x.length>0&&e.jsx(yt,{links:x,variant:o,className:"mx-auto mt-4 max-w-[80%]"})]}),rr=({duration:s,positionY:r,positionX:t,showNotification:a,toast:l,children:n,className:o})=>{const[d,c]=m.useState(!1),x=()=>setTimeout(()=>{c(!1)},s);return m.useEffect(()=>(a&&c(!0),x(),()=>clearTimeout(x())),[a]),d?e.jsxs("div",{className:k("absolute",r==="top"&&"top-0",r==="bottom"&&"bottom-0",t==="left"&&"left-0",t==="right"&&"right-0",t==="center"&&"left-[calc(50%-190px)]",o),children:[l&&e.jsx(Et,{...l}),n]}):null};v.ACCORDION_VARIANT=Ds,v.BUTTON_VARIANT=Rs,v.Breadcrumb=yt,v.Button=Y,v.CHECKBOX_VARIANT=As,v.Checkbox=Ee,v.ContentAccordion=Ys,v.Dropdown=Nt,v.FILTERCHIP_VARIANT=Ps,v.FilterChip=Ge,v.HEADING_VARIANT=Ts,v.Header=sr,v.Heading=Ye,v.INPUT_VARIANT=Zs,v.Icon=F,v.InfoText=fe,v.Input=jt,v.Link=ve,v.MODAL_VARIANT=Xs,v.MULTISELECT_VARIANT=Ks,v.MobileNav=Ct,v.Modal=Vt,v.MultiSelect=Rt,v.PAGINATION_VARIANT=Js,v.Pagination=$s,v.RADIO_VARIANT=Ss,v.Radio=Xe,v.RadioGroup=Fs,v.SELECT_ITEM_VARIANT=Bs,v.SELECT_VARIANT=er,v.Select=Ht,v.SelectDropdown=Je,v.SelectItem=Ke,v.Skeleton=Ws,v.Slider=Os,v.TEXTAREA_VARIANT=Us,v.TEXT_VARIANT=zs,v.Text=_t,v.Textarea=kt,v.Toast=Et,v.ToastDisplay=rr,v.ToastType=Pt,v.accordionVariant=Gs,v.buttonVariantStyles=mt,v.checkboxVariant=Hs,v.filterChipVariant=Es,v.headingVariantStyles=vt,v.iconMapping=De,v.inputVariant=gt,v.paginationVariant=At,v.radioboxVariant=Is,v.selectVariant=tr,v.textVariantClasses=bt,v.textarea=Lt,v.variantClasses=Mt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
29
+ ${Lt[a]} ${l?"cursor-not-allowed pointer-events-none":""} ${j.rows!==void 0&&"h-fit"}`;return e.jsxs("div",{className:`relative flex w-full flex-col items-start justify-start rounded-tl rounded-tr ${l&&"pointer-events-none cursor-not-allowed opacity-[0.3]"}`,"data-testid":"test-textarea",children:[t&&e.jsx("div",{className:"label absolute -top-2 left-3 flex items-center justify-start rounded bg-white px-1",children:e.jsx("p",{className:`text-left text-xs ${d||n?"text-error":"text-black"}`,"data-testid":"test-textarea-label",children:t})}),e.jsx("textarea",{id:f,ref:y,value:s,defaultValue:o,placeholder:r,onChange:c,className:P,disabled:l,required:d,"data-testid":"test-textarea-input",...j}),x&&e.jsx(fe,{message:x,className:"ml-4 mt-1",showErrorStyles:d||n})]})});kt.displayName="Textarea";const Ds={DEFAULT:"default"},Gs={DEFAULT:"bg-black hover:bg-black-800 active:bg-grey-900"},Ys=({options:s,allowMultiple:r=!1})=>{const[t,a]=m.useState(void 0),[l,n]=m.useState([]),o=d=>{r?l.includes(d)?n(l.filter(c=>c!==d)):n([...l,d]):a(c=>c===d?void 0:d)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:"w-full overflow-hidden rounded border border-brand-black","data-testid":"test-accordion",children:s.map((d,c)=>{const x=t===c||l.includes(c);return e.jsxs("div",{className:"accordion-item relative h-fit w-full flex-col items-start justify-start gap-2.5 overflow-hidden border-b bg-brand-white pt-4 transition-all duration-700 last:border-b-0 hover:cursor-pointer focus:border-blue-500 focus:outline-none",children:[e.jsxs("button",{className:"flex h-[2.5em] w-full justify-between border-b bg-brand-white px-4",onClick:()=>o(c),"data-testid":"test-accordion-header-"+c,children:[d.title,x?e.jsx(F,{name:"ExpandLess"}):e.jsx(F,{name:"ExpandMore"})]}),e.jsx("div",{className:`h-fit transition-all duration-500 ${x?"max-h-[15em] overflow-y-scroll":"max-h-0 overflow-hidden"}`,"data-testid":"test-accordion-body-"+c,children:d.content?e.jsx("div",{className:"p-4",children:d.content}):e.jsx("p",{className:"p-4",children:d.description})})]},"accordion-"+c)})})})},yt=({links:s,variant:r="dark",className:t})=>e.jsx("ol",{className:k("flex gap-2",t),children:s.map((a,l)=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ve,{...a,className:k("text-sm",r==="light"?"text-white":"text-black"),children:a.label}),l<s.length-1&&e.jsx(F,{name:"KeyboardArrowRight",iconColor:r==="light"?"white":"black"})]},"breadcrumb-"+a.label))}),Nt=({title:s,links:r,className:t,variant:a="dark"})=>{const[l,n]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{const c=()=>{n(!1)};return o.current&&o.current.addEventListener("mouseleave",c),()=>{o.current&&o.current.removeEventListener("mouseleave",c)}},[]);const d=()=>{n(!1)};return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>{n(!0)},onMouseEnter:()=>{n(!0)},className:k("rds-copy-lg flex text-white",a==="dark"&&"text-black"),children:[s," ",e.jsx(F,{name:"ExpandMore",iconColor:a==="dark"?"fill-black":"fill-white",className:k(l&&"rotate-180 duration-300")})]}),e.jsx("div",{className:k("absolute top-full z-10 mt-4 h-fit w-fit min-w-36 rounded-lg transition-all duration-500",l?"max-h-96 opacity-100":"max-h-0 overflow-hidden opacity-0",t),children:e.jsx("ul",{ref:o,onMouseLeave:d,children:r.map((c,x)=>e.jsx("li",{className:"px-4 py-2 transition-all duration-150 first:rounded-t-lg last:rounded-b-lg hover:backdrop-brightness-75",children:e.jsx(ve,{href:c.href,className:k(a==="dark"?"text-black":"text-white"),children:c.label})},s+x))})})]})},Ct=({navigation:s,className:r,classNameDropdown:t})=>{const[a,l]=m.useState(!1),n=m.useRef(null),[o,d]=m.useState(void 0);m.useEffect(()=>{const f=()=>{l(!1)};return n.current&&n.current.addEventListener("mouseleave",f),()=>{n.current&&n.current.removeEventListener("mouseleave",f)}},[]);const c=()=>{l(!1)},x="py-2 last:pb-0";return e.jsxs("div",{className:k("flex items-center lg:hidden",r),children:[e.jsx("button",{onClick:()=>l(!a),children:e.jsx(F,{name:"Menu",iconColor:"fill-white",className:"block [&_svg]:h-8 [&_svg]:w-8"})}),e.jsx("div",{className:k("absolute right-0 top-[100%] h-fit w-fit min-w-48 rounded-lg rounded-tr-none p-4 transition-all duration-500",a?"max-h-96 opacity-100":"max-h-0 overflow-hidden opacity-0",t),children:e.jsx("ul",{ref:n,onMouseLeave:c,children:o?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(Y,{variant:"TEXT",iconName:"KeyboardArrowLeft",className:"px-0 pt-0 hover:bg-transparent",onClick:()=>d(void 0)})}),o.links.map(f=>e.jsx("li",{className:x,children:e.jsx(ve,{href:f.href,children:f.label})},"link-"+f.label))]}):e.jsx(e.Fragment,{children:s.map((f,j)=>"title"in f?e.jsxs("button",{onClick:()=>d(f),className:"flex items-center",children:[f.title," ",e.jsx(F,{name:"KeyboardArrowRight"})]},"dropdown-"+f.title):e.jsx("li",{className:x,children:e.jsx(ve,{href:f.href,children:f.label})},f.label+j))})})})]})},Xs={DEFAULT:"default"},Vt=m.forwardRef(({children:s,onClick:r,width:t,height:a,className:l,headline:n},o)=>(m.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]),m.useEffect(()=>{const d=c=>{c.key==="Escape"&&(r==null||r())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:r,className:"fixed inset-0 z-50 transition-opacity",style:{background:"black",opacity:"0.6"}}),e.jsx("div",{"data-testid":"test-modal",ref:o,className:k(`fixed left-1/2 top-1/2 z-50 max-h-full max-w-full -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-md border border-white bg-white p-4 md:p-6 lg:p-8 ${l} `),style:{width:t||"",height:a||""},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:k("flex items-center justify-end p-2",n&&"justify-between"),children:[n&&e.jsx(Ye,{variant:"h3",children:n}),e.jsx(Y,{iconName:"Close",onClick:r,className:"justify-self-end p-2 hover:bg-grey-50 active:bg-grey-300",variant:"UNSTYLED"})]}),s||"empty"]})})]})));Vt.displayName="Modal";const Je=({className:s,isOpen:r,wideDropdown:t,handleMouseLeave:a,handleSelection:l,options:n,optionProps:o,showSearchField:d,inputValue:c="",setInputValue:x,searchFieldPlaceholder:f,currSelected:j})=>{const y=m.useRef(null),P=m.useRef(null),R=m.useRef(null),E=_=>{const C=_.current;C==null||C.scrollIntoView({behavior:"smooth",block:"nearest"})};return m.useEffect(()=>{const _=j.length===1&&r,C=_&&c.length===0;if(_||C){const A=setTimeout(()=>E(y),500);return()=>clearTimeout(A)}},[r,j,c,y]),e.jsxs(e.Fragment,{children:[d&&e.jsx("input",{type:"text",value:c,onChange:_=>x==null?void 0:x(_.target.value),className:k("pointer-events-none absolute z-[10] mt-1 h-0 w-full rounded-t border bg-white p-2 opacity-0 shadow-sm transition-all focus:outline-none",r&&"pointer-events-auto h-fit opacity-100"),placeholder:f}),e.jsx("div",{className:k("absolute left-0 top-full z-[5] mt-1 h-0 w-full cursor-pointer overflow-y-auto overflow-x-hidden rounded-b border bg-grey-50 opacity-0 shadow-md outline-none transition-all",r&&"h-fit max-h-60 opacity-100",t&&"w-fit",d&&r&&"mt-10 max-h-[85vh] min-h-[60vh]",s),ref:R,children:e.jsxs("ul",{className:k("h-full w-full",r&&"h-fit max-h-[200px]",d&&r&&"top-10"),"data-testid":"test-multiselect-list",onMouseLeave:a,ref:P,children:[n.length===0&&e.jsx("p",{className:"bg-slate-200 p-2",children:"keine Optionen gefunden"}),n==null?void 0:n.filter(_=>_.name.toLowerCase().includes(c.toLowerCase())).map(_=>e.jsx(Ke,{id:_.id,option:_,isActive:j==null?void 0:j.some(C=>C.id===_.id),onSelectionChange:l,className:t?"whitespace-nowrap":void 0,ref:j.length===1&&(j!=null&&j.some(C=>C.id===_.id))?y:null,...o},_.id))]})})]})},Ks={DEFAULT:"default"},Mt={DEFAULT:"rounded border border-black bg-brand-white duration-300 transition-all hover:bg-grey-100"},Rt=m.forwardRef(({selectedOptions:s=[],onSelectionChange:r,options:t,isDisabled:a,label:l,variant:n="DEFAULT",wideDropdown:o=!1,optionProps:d,hasError:c=!1,errorMessage:x,placeholder:f="Auswählen",showSelectedAsChips:j=!1,exceptionOptions:y,showSearchField:P=!1,searchFieldPlaceholder:R="Optionen durchsuchen",className:E},_)=>{const[C,A]=m.useState(!1),[T,X]=m.useState([]),[q,G]=m.useState(""),z=m.useCallback(()=>{if(typeof s[0]=="string"){const $=t.filter(K=>s.includes(K.id));X($)}else X(s)},[]);m.useEffect(()=>{T.length!==s.length&&z()},[s,T]),m.useEffect(()=>{const S=$=>{$.key==="Escape"&&(A(!1),r(T.map(K=>K.id)))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}});const g=S=>{let $=T??[];y!=null&&y.includes(S.id)?$=[S]:T!=null&&T.includes(S)?$=T.filter(K=>K!==S&&!(y!=null&&y.includes(K.id))):$=[...T.filter(K=>!(y!=null&&y.includes(K.id)))??[],S],X($)},U=()=>{setTimeout(()=>{T.length>0&&r(T.map(S=>S.id)),C&&A(!1)},500)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:_,className:k("relative rounded",Mt[n],c&&"border-error",E),children:[e.jsxs("button",{onClick:()=>A(!C),className:k("flex w-full cursor-pointer items-start justify-between rounded px-4 py-3 disabled:pointer-events-none disabled:bg-brand-grey-light"),disabled:a,"data-testid":"test-multiselect",children:[e.jsx("label",{className:k("absolute -top-2 left-3 rounded bg-white px-1 text-xs text-black",c&&"text-error"),children:l}),!j&&s.length>0?e.jsx(e.Fragment,{children:T.map(S=>S.name).join(", ")}):e.jsx("p",{className:k(c&&"text-error"),children:f}),e.jsx("div",{className:k("duration-600 -rotate-180 transition-all",C&&"rotate-0"),"data-testid":"test-multiselect-icon-wrapper",children:e.jsx(F,{name:"ExpandLess",className:"relative h-6 w-6 flex-shrink-0 flex-grow-0"})})]}),e.jsx(Je,{handleMouseLeave:U,setInputValue:G,inputValue:q,options:t,currSelected:T,optionProps:d,handleSelection:g,isOpen:C,showSearchField:P,searchFieldPlaceholder:R,wideDropdown:o})]}),c&&x&&e.jsx(fe,{message:x,showErrorStyles:!0,className:"mt-2"}),j&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-4",children:T.map(S=>e.jsx(Ge,{label:S.name,onClick:()=>g(S)},"selected-"+S.name))})]})});Rt.displayName="MultiSelect";const Js={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary"},At={PRIMARY:"bg-white hover:bg-black-800 active:bg-grey-900",SECONDARY:"bg-blue-200 hover:bg-blue-400 active:bg-blue-500",TERTIARY:"bg-red-200 hover:bg-red-400 active:bg-red-500"},Qs={SECONDARY:"bg-blue-500 text-white",TERTIARY:"bg-red-500 text-white",PRIMARY:"bg-black text-white"},qs=({pages:s,onNavigate:r,classNames:t,activeIndex:a})=>{const[l,n]=m.useState([2,3]),o=m.useCallback(()=>{if(a===2||a===s-1)return;if(a===1){n([2,3]);return}if(a===10){n([8,9]);return}const c=[a-1,a,a+1];n(c)},[s,a]);m.useEffect(()=>{o()},[a]);const d=a!==s&&a!==s-1&&a!==s-2;return e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:t(a===1),onClick:()=>r==null?void 0:r(1),"data-testid":"test-constructed-pagination-button-0",children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:1})}),l[0]!==2&&e.jsx(e.Fragment,{children:"..."}),l.map((c,x)=>e.jsx(Y,{className:t(a===c),onClick:()=>r==null?void 0:r(c),"data-testid":"test-pagination-button-"+x,children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:c})},x)),d&&e.jsx(e.Fragment,{children:"..."}),e.jsx(Y,{className:t(a===s),onClick:()=>r==null?void 0:r(10),"data-testid":"test-pagination-button-10",children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:s})})]})},$s=({pages:s,variant:r="PRIMARY",onNavigate:t})=>{const[a,l]=m.useState(1),n=x=>{l(f=>f===x?f:x),t==null||t(x)},o={className:"relative h-6 w-6 flex-shrink-0 flex-grow-0 bg-transparent px-2 hover:bg-grey-300 active:bg-grey-400 [&_path]:disabled:!fill-white",iconColor:"black",iconPosition:"leading"},d=x=>k("flex h-fit rounded p-1 text-black active:text-white",At[r],x&&Qs[r]),c=s<=5;return e.jsxs("div",{className:"relative flex items-center justify-center gap-4","data-testid":"test-pagination",children:[e.jsx(Y,{iconName:"KeyboardArrowLeft",onClick:()=>{const x=a-1;l(x),t==null||t(x)},disabled:a===1,"data-testid":"button-prev",...o}),c?e.jsx(e.Fragment,{children:Array.from(Array(s)).map((x,f)=>e.jsx(Y,{className:d(a===f+1),onClick:()=>{n(f),t==null||t(f)},"data-testid":"test-pagination-button-"+f,children:e.jsx("p",{className:"w-4 flex-shrink-0 flex-grow-0 text-center text-sm font-medium",children:f+1})},f))}):e.jsx(qs,{activeIndex:a,classNames:d,pages:s,onNavigate:n}),e.jsx(Y,{iconName:"KeyboardArrowRight",onClick:()=>{const x=a+1;l(x),t==null||t(x)},disabled:a===s,"data-testid":"button-next",...o})]})},Fs=({options:s,supportingText:r,required:t,selectedValue:a,setSelectedValue:l,className:n,showSupportingText:o})=>e.jsxs("div",{className:k("flex flex-col gap-2",n),"data-testid":"test-radioGroup",children:[s.map(d=>e.jsx(Xe,{value:d.value,label:d.label,onChange:c=>l(c.target.value),checked:a===d.value,required:t},"radio-group-"+d.value)),o&&r&&e.jsx(fe,{message:r,showErrorStyles:t,className:"mt-1"})]}),er={DEFAULT:"default",TOP_PULL:"top_pull"},tr={DEFAULT:"bg-black hover:bg-black-800 active:bg-grey-900",TOP_PULL:"bg-black hover:bg-black-800 active:bg-grey-900"},Ht=m.forwardRef(({options:s,selectedOption:r,onSelectionChange:t,label:a,isDisabled:l=!1,optionProps:n,wideDropdown:o=!1,hasError:d=!1,placeholder:c="Auswählen",showSearchField:x=!1,searchFieldPlaceholder:f="Optionen durchsuchen",className:j,errorMessage:y},P)=>{const[R,E]=m.useState(!1),[_,C]=m.useState(void 0),[A,T]=m.useState(""),X=m.useCallback(()=>{if(typeof r=="string"){const g=s.find(U=>r===U.id);C(g)}else C(r)},[]);m.useEffect(()=>{(!_||r!==_)&&X()},[_,r]),m.useEffect(()=>{const z=g=>{g.key==="Escape"&&(E(!1),_&&t(_.id))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}});const q=()=>{E(!R)},G=()=>{setTimeout(()=>{_&&t(_.id),R&&E(!1)},500)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:P,className:k("relative rounded border border-black",d&&"border-error",j),children:[e.jsxs("button",{className:"flex h-[3.1em] w-full items-center gap-2.5 self-stretch rounded pr-2.5 hover:bg-grey-100 disabled:pointer-events-none disabled:bg-brand-grey-light",onClick:q,tabIndex:0,disabled:l,"data-testid":"test-select",children:[e.jsx("label",{className:k("absolute -top-2 left-3 rounded bg-white px-1 text-xs text-black",d&&"text-error"),children:a}),e.jsxs("div",{className:"flex w-full items-center justify-between self-stretch rounded-tl rounded-tr py-1 pl-4",children:[e.jsx("div",{className:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-left text-base text-black",children:(_==null?void 0:_.name)??c}),e.jsx("div",{className:k("duration-600 -rotate-180 transition-all",R&&"rotate-0"),"data-testid":"test-select-icon",children:e.jsx(F,{name:"ExpandLess",className:"relative h-6 w-6 flex-shrink-0 flex-grow-0"})})]})]}),e.jsx(Je,{isOpen:R,handleMouseLeave:G,options:s,currSelected:_?[_]:[],handleSelection:z=>{z.id===(_==null?void 0:_.id)?C(void 0):C(z)},optionProps:n,inputValue:A,setInputValue:T,wideDropdown:o,showSearchField:x,searchFieldPlaceholder:f})]}),d&&y&&e.jsx(fe,{message:y,showErrorStyles:!0,className:"mt-2"})]})});Ht.displayName="Select";var Pt=(s=>(s.SUCCESS="success",s.INFO="info",s.ERROR="error",s))(Pt||{});const Et=({type:s,message:r,showClosingButton:t=!0,showDetails:a,detailsLink:l,className:n})=>{const o=s==="success"?"Checked":"Info";return e.jsxs("div",{className:k("flex w-80 justify-between rounded p-2 text-white drop-shadow-sm",s==="success"&&"bg-success",s==="error"&&"bg-error",s==="info"&&"bg-warning",n),children:[e.jsxs("div",{className:"flex grow",children:[e.jsx(F,{name:o,iconColor:"white",className:"mr-2 pt-0.5",isIconSolid:!0}),e.jsx("span",{className:k(a&&"max-w-[68%]"),children:r}),a&&e.jsx(Y,{variant:"TEXT",label:"Details",className:"ml-2 h-fit grow self-end text-white hover:bg-transparent active:bg-transparent",onClick:a}),l&&e.jsx("a",{href:l,className:"rds-button ml-2 self-end p-2 underline-offset-2 hover:underline",children:"Details"})]}),t&&e.jsx(Y,{iconColor:"fill-white",iconName:"Close",className:"h-fit self-start bg-transparent px-2 py-0 hover:bg-transparent active:bg-transparent"})]})},sr=({logo:s,className:r,classNameContent:t,children:a,navigation:l,classNameDropdown:n,variant:o,handleLogout:d,account:c,breadcrumbs:x})=>e.jsxs("header",{className:k("fixed right-0 top-0 z-0 w-full py-5",r),children:[e.jsxs("div",{className:k("mx-auto flex items-center justify-between lg:justify-start",t),children:[s,l&&e.jsxs(e.Fragment,{children:[e.jsx("nav",{className:"ml-8 mr-4 hidden grow items-center lg:flex",children:e.jsx("ul",{className:"flex items-center gap-4",children:l==null?void 0:l.map(f=>"title"in f?e.jsx("li",{children:e.jsx(Nt,{...f,className:n,variant:o})},"dropdown-"+f.title):e.jsx("li",{children:e.jsx(ve,{href:f.href,className:o==="light"?"text-white":"text-black",children:f.label})},"headerlink-"+f.label))})}),e.jsx(Ct,{navigation:l,classNameDropdown:n})]}),a,d&&e.jsx(Y,{onClick:d,iconName:"Login",variant:"UNSTYLED",iconColor:o==="light"?"white":"dark"}),c]}),x&&x.length>0&&e.jsx(yt,{links:x,variant:o,className:"mx-auto mt-4 max-w-[80%]"})]}),rr=({duration:s,positionY:r,positionX:t,showNotification:a,toast:l,children:n,className:o})=>{const[d,c]=m.useState(!1),x=()=>setTimeout(()=>{c(!1)},s);return m.useEffect(()=>(a&&c(!0),x(),()=>clearTimeout(x())),[a]),d?e.jsxs("div",{className:k("absolute",r==="top"&&"top-0",r==="bottom"&&"bottom-0",t==="left"&&"left-0",t==="right"&&"right-0",t==="center"&&"left-[calc(50%-190px)]",o),children:[l&&e.jsx(Et,{...l}),n]}):null};v.ACCORDION_VARIANT=Ds,v.BUTTON_VARIANT=Rs,v.Breadcrumb=yt,v.Button=Y,v.CHECKBOX_VARIANT=As,v.Checkbox=Ee,v.ContentAccordion=Ys,v.Dropdown=Nt,v.FILTERCHIP_VARIANT=Ps,v.FilterChip=Ge,v.HEADING_VARIANT=Ts,v.Header=sr,v.Heading=Ye,v.INPUT_VARIANT=Zs,v.Icon=F,v.InfoText=fe,v.Input=jt,v.Link=ve,v.MODAL_VARIANT=Xs,v.MULTISELECT_VARIANT=Ks,v.MobileNav=Ct,v.Modal=Vt,v.MultiSelect=Rt,v.PAGINATION_VARIANT=Js,v.Pagination=$s,v.RADIO_VARIANT=Ss,v.Radio=Xe,v.RadioGroup=Fs,v.SELECT_ITEM_VARIANT=Bs,v.SELECT_VARIANT=er,v.Select=Ht,v.SelectDropdown=Je,v.SelectItem=Ke,v.Skeleton=Ws,v.Slider=Os,v.TEXTAREA_VARIANT=Us,v.TEXT_VARIANT=zs,v.Text=_t,v.Textarea=kt,v.Toast=Et,v.ToastDisplay=rr,v.ToastType=Pt,v.accordionVariant=Gs,v.buttonVariantStyles=mt,v.checkboxVariant=Hs,v.filterChipVariant=Es,v.headingVariantStyles=vt,v.iconMapping=De,v.inputVariant=gt,v.paginationVariant=At,v.radioboxVariant=Is,v.selectVariant=tr,v.textVariantClasses=bt,v.textarea=Lt,v.variantClasses=Mt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rds-ui-system",
3
3
  "private": false,
4
- "version": "2.13.0",
4
+ "version": "2.13.1",
5
5
  "packageManager": "pnpm@10.11.0",
6
6
  "main": "./dist/rds-ui-system.umd.js",
7
7
  "module": "./dist/rds-ui-system.es.js",