@scalably/ui 0.9.0 → 0.9.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.
package/dist/index.esm.js CHANGED
@@ -22,7 +22,7 @@ import {memo,forwardRef,useId,Children,createContext,useState,cloneElement,useRe
22
22
  .ProseMirror figure img[width] {
23
23
  max-width: unset !important;
24
24
  }
25
- `}),jsxs("div",{className:g("sui-relative sui-w-full sui-overflow-y-auto sui-overflow-x-visible sui-cursor-text sui-py-3 sui-px-10",b),style:{minHeight:s},ref:S,role:"textbox",tabIndex:u?-1:0,"aria-labelledby":t?D:void 0,onClick:$=>{!F||u||$.target===$.currentTarget&&(F.isFocused||F.chain().focus("end").run());},onKeyDown:$=>{!F||u||$.target===$.currentTarget&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),F.chain().focus("end").run());},children:[F&&U&&N&&jsx(K1,{editor:F}),F&&U&&H&&(T==="slash"||T==="both")&&jsx(J1,{editor:F,triggers:T==="slash"?"slash":"both",onImageUpload:y,imageSourceMode:k,portalContainer:S.current??void 0}),F&&U&&H&&(T==="plus"||T==="both")&&jsx(ea,{editor:F,enabled:T==="plus"||T==="both",onImageUpload:y,imageSourceMode:k,portalContainer:S.current??void 0,plusMenuYOffset:E}),jsx(EditorContent,{id:V,editor:F,"aria-label":t,className:g("sui-h-full","[&_.ProseMirror]:sui-min-h-full","[&_.ProseMirror]:focus:sui-outline-none",h)}),F&&_&&jsx(X1,{editor:F,max:_})]})]}),(o||i)&&jsxs("div",{className:g("sui-mt-2",f),children:[o&&jsx("p",{id:z,role:"alert",className:"sui-text-12 sui-leading-[100%] sui-tracking-[-0.01em] sui-text-error",children:o}),!o&&i&&jsx("p",{id:Z,className:"sui-text-12 sui-leading-[100%] sui-tracking-[-0.01em] sui-text-inactive",children:i})]})]})};fa.displayName="RichTextEditor";var A0=e=>{if(typeof window>"u"||!e)return e;try{let t=new DOMParser().parseFromString(e,"text/html"),o=l=>{let b=l.hasAttribute("width"),h=l.hasAttribute("height");if(!b||!h){let d=l.getAttribute("viewBox");if(d){let[,,f,y]=d.split(/\s+|,/).map(Number);if(f&&y&&!isNaN(f)&&!isNaN(y)){let x=16*(f/y);b||l.setAttribute("width",`${x}`),h||l.setAttribute("height","16");}}l.hasAttribute("width")||l.setAttribute("width","16"),l.hasAttribute("height")||l.setAttribute("height","16");}},i=Array.from(t.querySelectorAll("svg"));for(let l of i){if(l.parentElement?.tagName!=="SPAN"){o(l);continue}let b=l.parentElement,h=null;for(;b&&b.tagName==="SPAN";){let d=(b.className||"").toString(),f=b.hasAttribute("data-node-view-wrapper"),y=d.includes("react-renderer")&&d.includes("node-svg"),k=d.includes("sui-inline-flex")||d.includes("inline-flex");if((f||y||k)&&(h=b),b.parentElement?.tagName==="SPAN")b=b.parentElement;else break}if(h){let d=l.cloneNode(!0);o(d),h.replaceWith(d);}else if(l.parentElement?.tagName==="SPAN"){let d=l.cloneNode(!0);o(d),l.parentElement.replaceWith(d);}else o(l);}let a=Array.from(t.querySelectorAll('span[data-svg-node="true"]'));for(let l of a){let b=l.getAttribute("data-svg-html");if(b){let h=t.createElement("div");h.innerHTML=b;let d=h.querySelector("svg");if(d){let f=d.hasAttribute("width"),y=d.hasAttribute("height");if(!f||!y){let w=d.getAttribute("viewBox");if(w){let[,,x,L]=w.split(/\s+|,/).map(Number);if(x&&L&&!isNaN(x)&&!isNaN(L)){let P=16*(x/L);f||d.setAttribute("width",`${P}`),y||d.setAttribute("height","16");}}d.hasAttribute("width")||d.setAttribute("width","16"),d.hasAttribute("height")||d.setAttribute("height","16");}let k=l.getAttribute("class");if(k){let w=d.getAttribute("class")||"";d.setAttribute("class",w?`${w} ${k}`:k);}l.replaceWith(d);}else l.remove();}else l.remove();}let s=Array.from(t.querySelectorAll("svg"));for(let l of s)if(l.parentElement?.tagName==="SPAN"){let b=l.cloneNode(!0);o(b),l.parentElement.replaceWith(b);}else o(l);let n=Array.from(t.querySelectorAll("img"));for(let l of n){let b=l.getAttribute("width"),h=l.getAttribute("height"),d=l.closest("figure"),f=!!d,y=null;if(d){let k=d.getAttribute("style")||"",w=d.getAttribute("data-align"),x=k.match(/text-align\s*:\s*([^;]+)/i);if(x){let L=x[1].trim().toLowerCase();L==="left"?y="left":L==="right"?y="right":L==="center"&&(y="center");}y||(w==="left"?y="left":w==="right"?y="right":w==="center"&&(y="center")),y||(y="center");}if(b||h){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(L=>L.trim()).filter(Boolean).reduce((L,v)=>{let[M,P]=v.split(":").map(C=>C.trim());return M&&P&&(L[M]=P),L},{});if(b){let L=b.includes("px")?b:`${b}px`;w.push(`width: ${L}`);}if(h){let L=h.includes("px")?h:`${h}px`;w.push(`height: ${L}`);}f&&y&&(w.push("display: block !important"),y==="center"?(w.push("margin-left: auto !important"),w.push("margin-right: auto !important")):y==="left"?(w.push("margin-left: 0 !important"),w.push("margin-right: auto !important")):y==="right"&&(w.push("margin-left: auto !important"),w.push("margin-right: 0 !important"))),Object.entries(x).forEach(([L,v])=>{L!=="width"&&L!=="height"&&L!=="margin"&&L!=="margin-left"&&L!=="margin-right"&&L!=="display"&&w.push(`${L}: ${v}`);}),w.length>0&&l.setAttribute("style",w.join("; "));}else if(f&&y){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(L=>L.trim()).filter(Boolean).reduce((L,v)=>{let[M,P]=v.split(":").map(C=>C.trim());return M&&P&&M!=="margin"&&M!=="margin-left"&&M!=="margin-right"&&M!=="display"&&(L[M]=P),L},{});w.push("display: block !important"),y==="center"?(w.push("margin-left: auto !important"),w.push("margin-right: auto !important")):y==="left"?(w.push("margin-left: 0 !important"),w.push("margin-right: auto !important")):y==="right"&&(w.push("margin-left: auto !important"),w.push("margin-right: 0 !important")),Object.entries(x).forEach(([L,v])=>{w.push(`${L}: ${v}`);}),w.length>0&&l.setAttribute("style",w.join("; "));}else if(!f){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(M=>M.trim()).filter(Boolean).reduce((M,P)=>{let[C,N]=P.split(":").map(H=>H.trim());return C&&N&&(M[C]=N),M},{}),L=l.hasAttribute("data-align"),v=x["margin-left"]||x["margin-right"]||x.margin;!L&&!v&&(w.push("display: block"),w.push("margin-left: auto"),w.push("margin-right: auto"),Object.entries(x).forEach(([M,P])=>{M!=="margin"&&M!=="margin-left"&&M!=="margin-right"&&M!=="display"&&w.push(`${M}: ${P}`);}),w.length>0&&l.setAttribute("style",w.join("; ")));}}let u=Array.from(t.querySelectorAll("iframe"));for(let l of u){let b=l.getAttribute("width"),h=l.getAttribute("height");if(b||h){let f=l.getAttribute("style")||"",y=[],k=f.split(";").map(w=>w.trim()).filter(Boolean).reduce((w,x)=>{let[L,v]=x.split(":").map(M=>M.trim());return L&&v&&(w[L]=v),w},{});if(b&&!k.width){let w=b.includes("px")?b:`${b}px`;y.push(`width: ${w}`);}if(h&&!k.height){let w=h.includes("px")?h:`${h}px`;y.push(`height: ${w}`);}Object.entries(k).forEach(([w,x])=>{y.push(`${w}: ${x}`);}),y.length>0&&l.setAttribute("style",y.join("; "));}let d=l.closest("div[data-youtube-video]");if(d instanceof HTMLElement){let f=d.getAttribute("style")||"";if(!f.includes("text-align")){let k=f?`${f}; text-align: center`:"text-align: center";d.setAttribute("style",k);}let y=l.getAttribute("style")||"";y.includes("display")||l.setAttribute("style",y?`${y}; display: inline-block`:"display: inline-block");}}let p=Array.from(t.getElementsByTagName("figcaption"));for(let l of p)Array.from(l.querySelectorAll("br.ProseMirror-trailingBreak")).forEach(h=>h.remove()),(!l.textContent||l.textContent.trim()==="")&&l.remove();let c=Array.from(t.getElementsByTagName("figure"));for(let l of c){let b=l.getAttribute("style")||"";if(b=b.replace(/text-align\s*:\s*/gi,"text-align:"),b.includes("text-align:"))l.setAttribute("style",b);else {let d=b.trim(),f=d?`${d}; text-align:center`:"text-align:center";l.setAttribute("style",f);}}let m=Array.from(t.getElementsByTagName("figure"));for(let l of m){let b=Array.from(l.children).filter(d=>d.tagName==="FIGCAPTION");if(b.length>1){let f=b.find(y=>y.textContent&&y.textContent.trim().length>0)||b[0];b.forEach(y=>{y!==f&&y.remove();});}Array.from(l.querySelectorAll(":scope > * > figcaption")).forEach(d=>{Array.from(l.children).some(y=>y.tagName==="FIGCAPTION")&&d.remove();});}return t.body.innerHTML}catch{return e}};var ha=({content:e,className:r,"data-testid":t})=>{let o=A0(e);return jsx("div",{className:g(Ei,r),dangerouslySetInnerHTML:{__html:o},"data-testid":t})};ha.displayName="RichTextViewer";var D0=forwardRef(({label:e,currentValue:r,maxValue:t,showValue:o=false,color:i,className:a,...s},n)=>{let u=Math.min(Math.max(r/t*100,0),100);return jsxs("div",{ref:n,className:g("sui-w-full",a),...s,role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":t,"aria-label":e,children:[e&&jsx("div",{className:"sui-mb-2 sui-text-16 sui-text-default",children:e}),jsxs("div",{className:"sui-flex sui-items-center sui-gap-3",children:[jsx("div",{className:"sui-relative sui-h-3 sui-w-full sui-overflow-hidden sui-rounded-full sui-bg-secondary",children:jsx("div",{className:"sui-h-full sui-rounded-full sui-transition-all sui-duration-500 sui-ease-out",style:{width:`${u}%`,backgroundColor:i||"var(--sui-color-primary)"}})}),o&&jsx("span",{className:"sui-text-16 sui-font-medium sui-text-gray-500",children:r})]})]})});D0.displayName="ProgressBar";var z0=forwardRef(({className:e,children:r,step:t=1,nextIcon:o,prevIcon:i,hideNavWhenDisabled:a=true,...s},n)=>{let u=useRef(null),[p,c]=useState(false),[m,l]=useState(true),b=useCallback(()=>{let d=u.current;if(d){let{scrollLeft:f,scrollWidth:y,clientWidth:k}=d;c(f>0),l(Math.ceil(f+k+2)<y);}},[]);useEffect(()=>(b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)),[b]),useEffect(()=>{let d=u.current;if(!d)return;let f=new MutationObserver(()=>{b();});return f.observe(d,{childList:true,subtree:true,attributes:true,characterData:true}),()=>f.disconnect()},[b]);let h=d=>{let f=u.current;if(!f||!f.firstElementChild)return;let y=f.firstElementChild.offsetWidth||0,k=parseFloat(window.getComputedStyle(f).columnGap)||0,w=y+k,x=Math.round(f.scrollLeft/w),v=(d==="left"?Math.max(0,x-t):x+t)*w;f.scrollTo({left:v,behavior:"smooth"}),setTimeout(b,50),setTimeout(b,300);};return jsxs("div",{className:g("sui-relative sui-w-full sui-group",e),...s,ref:n,children:[(!a||p)&&jsx("button",{type:"button",className:g("sui-absolute sui-left-0 sui-top-1/2 sui-z-10 -sui-translate-y-1/2 -sui-translate-x-1/2 sui-inline-flex sui-h-8 sui-w-8 sui-items-center sui-justify-center sui-rounded-full sui-bg-white sui-text-primary sui-shadow-md hover:sui-bg-gray-50 hover:sui-scale-110 active:sui-scale-95 focus:sui-outline-none disabled:sui-pointer-events-none disabled:sui-opacity-0 sui-transition-all",!p&&"sui-opacity-0 sui-pointer-events-none"),onClick:()=>h("left"),disabled:!p,"aria-label":"Previous slide",children:i||jsx(Tr,{size:20})}),jsx("div",{className:"sui-w-full sui-overflow-hidden",children:jsx("div",{ref:u,className:"sui-flex sui-w-full sui-overflow-x-hidden sui-scroll-smooth sui-gap-4 sui-outline-none",onScroll:b,tabIndex:-1,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r})}),(!a||m)&&jsx("button",{type:"button",className:g("sui-absolute sui-right-0 sui-top-1/2 sui-z-10 -sui-translate-y-1/2 sui-translate-x-1/2 sui-inline-flex sui-h-8 sui-w-8 sui-items-center sui-justify-center sui-rounded-full sui-bg-white sui-text-primary sui-shadow-md hover:sui-bg-gray-50 hover:sui-scale-110 active:sui-scale-95 focus:sui-outline-none disabled:sui-pointer-events-none disabled:sui-opacity-0 sui-transition-all",!m&&"sui-opacity-0 sui-pointer-events-none"),onClick:()=>h("right"),disabled:!m,"aria-label":"Next slide",children:o||jsx(Nr,{size:20})})]})});z0.displayName="Slider";var n6=()=>`
25
+ `}),jsxs("div",{className:g("sui-relative sui-w-full sui-overflow-y-auto sui-overflow-x-visible sui-cursor-text sui-py-3 sui-px-10",b),style:{minHeight:s},ref:S,role:"textbox",tabIndex:u?-1:0,"aria-labelledby":t?D:void 0,onClick:$=>{!F||u||$.target===$.currentTarget&&(F.isFocused||F.chain().focus("end").run());},onKeyDown:$=>{!F||u||$.target===$.currentTarget&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),F.chain().focus("end").run());},children:[F&&U&&N&&jsx(K1,{editor:F}),F&&U&&H&&(T==="slash"||T==="both")&&jsx(J1,{editor:F,triggers:T==="slash"?"slash":"both",onImageUpload:y,imageSourceMode:k,portalContainer:S.current??void 0}),F&&U&&H&&(T==="plus"||T==="both")&&jsx(ea,{editor:F,enabled:T==="plus"||T==="both",onImageUpload:y,imageSourceMode:k,portalContainer:S.current??void 0,plusMenuYOffset:E}),jsx(EditorContent,{id:V,editor:F,"aria-label":t,className:g("sui-h-full","[&_.ProseMirror]:sui-min-h-full","[&_.ProseMirror]:focus:sui-outline-none",h)}),F&&_&&jsx(X1,{editor:F,max:_})]})]}),(o||i)&&jsxs("div",{className:g("sui-mt-2",f),children:[o&&jsx("p",{id:z,role:"alert",className:"sui-text-12 sui-leading-[100%] sui-tracking-[-0.01em] sui-text-error",children:o}),!o&&i&&jsx("p",{id:Z,className:"sui-text-12 sui-leading-[100%] sui-tracking-[-0.01em] sui-text-inactive",children:i})]})]})};fa.displayName="RichTextEditor";var A0=e=>{if(typeof window>"u"||!e)return e;try{let t=new DOMParser().parseFromString(e,"text/html"),o=l=>{let b=l.hasAttribute("width"),h=l.hasAttribute("height");if(!b||!h){let d=l.getAttribute("viewBox");if(d){let[,,f,y]=d.split(/\s+|,/).map(Number);if(f&&y&&!isNaN(f)&&!isNaN(y)){let x=16*(f/y);b||l.setAttribute("width",`${x}`),h||l.setAttribute("height","16");}}l.hasAttribute("width")||l.setAttribute("width","16"),l.hasAttribute("height")||l.setAttribute("height","16");}},i=Array.from(t.querySelectorAll("svg"));for(let l of i){if(l.parentElement?.tagName!=="SPAN"){o(l);continue}let b=l.parentElement,h=null;for(;b&&b.tagName==="SPAN";){let d=(b.className||"").toString(),f=b.hasAttribute("data-node-view-wrapper"),y=d.includes("react-renderer")&&d.includes("node-svg"),k=d.includes("sui-inline-flex")||d.includes("inline-flex");if((f||y||k)&&(h=b),b.parentElement?.tagName==="SPAN")b=b.parentElement;else break}if(h){let d=l.cloneNode(!0);o(d),h.replaceWith(d);}else if(l.parentElement?.tagName==="SPAN"){let d=l.cloneNode(!0);o(d),l.parentElement.replaceWith(d);}else o(l);}let a=Array.from(t.querySelectorAll('span[data-svg-node="true"]'));for(let l of a){let b=l.getAttribute("data-svg-html");if(b){let h=t.createElement("div");h.innerHTML=b;let d=h.querySelector("svg");if(d){let f=d.hasAttribute("width"),y=d.hasAttribute("height");if(!f||!y){let w=d.getAttribute("viewBox");if(w){let[,,x,L]=w.split(/\s+|,/).map(Number);if(x&&L&&!isNaN(x)&&!isNaN(L)){let P=16*(x/L);f||d.setAttribute("width",`${P}`),y||d.setAttribute("height","16");}}d.hasAttribute("width")||d.setAttribute("width","16"),d.hasAttribute("height")||d.setAttribute("height","16");}let k=l.getAttribute("class");if(k){let w=d.getAttribute("class")||"";d.setAttribute("class",w?`${w} ${k}`:k);}l.replaceWith(d);}else l.remove();}else l.remove();}let s=Array.from(t.querySelectorAll("svg"));for(let l of s)if(l.parentElement?.tagName==="SPAN"){let b=l.cloneNode(!0);o(b),l.parentElement.replaceWith(b);}else o(l);let n=Array.from(t.querySelectorAll("img"));for(let l of n){let b=l.getAttribute("width"),h=l.getAttribute("height"),d=l.closest("figure"),f=!!d,y=null;if(d){let k=d.getAttribute("style")||"",w=d.getAttribute("data-align"),x=k.match(/text-align\s*:\s*([^;]+)/i);if(x){let L=x[1].trim().toLowerCase();L==="left"?y="left":L==="right"?y="right":L==="center"&&(y="center");}y||(w==="left"?y="left":w==="right"?y="right":w==="center"&&(y="center")),y||(y="center");}if(b||h){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(L=>L.trim()).filter(Boolean).reduce((L,v)=>{let[M,P]=v.split(":").map(C=>C.trim());return M&&P&&(L[M]=P),L},{});if(b){let L=b.includes("px")?b:`${b}px`;w.push(`width: ${L}`);}if(h){let L=h.includes("px")?h:`${h}px`;w.push(`height: ${L}`);}f&&y&&(w.push("display: block !important"),y==="center"?(w.push("margin-left: auto !important"),w.push("margin-right: auto !important")):y==="left"?(w.push("margin-left: 0 !important"),w.push("margin-right: auto !important")):y==="right"&&(w.push("margin-left: auto !important"),w.push("margin-right: 0 !important"))),Object.entries(x).forEach(([L,v])=>{L!=="width"&&L!=="height"&&L!=="margin"&&L!=="margin-left"&&L!=="margin-right"&&L!=="display"&&w.push(`${L}: ${v}`);}),w.length>0&&l.setAttribute("style",w.join("; "));}else if(f&&y){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(L=>L.trim()).filter(Boolean).reduce((L,v)=>{let[M,P]=v.split(":").map(C=>C.trim());return M&&P&&M!=="margin"&&M!=="margin-left"&&M!=="margin-right"&&M!=="display"&&(L[M]=P),L},{});w.push("display: block !important"),y==="center"?(w.push("margin-left: auto !important"),w.push("margin-right: auto !important")):y==="left"?(w.push("margin-left: 0 !important"),w.push("margin-right: auto !important")):y==="right"&&(w.push("margin-left: auto !important"),w.push("margin-right: 0 !important")),Object.entries(x).forEach(([L,v])=>{w.push(`${L}: ${v}`);}),w.length>0&&l.setAttribute("style",w.join("; "));}else if(!f){let k=l.getAttribute("style")||"",w=[],x=k.split(";").map(M=>M.trim()).filter(Boolean).reduce((M,P)=>{let[C,N]=P.split(":").map(H=>H.trim());return C&&N&&(M[C]=N),M},{}),L=l.hasAttribute("data-align"),v=x["margin-left"]||x["margin-right"]||x.margin;!L&&!v&&(w.push("display: block"),w.push("margin-left: auto"),w.push("margin-right: auto"),Object.entries(x).forEach(([M,P])=>{M!=="margin"&&M!=="margin-left"&&M!=="margin-right"&&M!=="display"&&w.push(`${M}: ${P}`);}),w.length>0&&l.setAttribute("style",w.join("; ")));}}let u=Array.from(t.querySelectorAll("iframe"));for(let l of u){let b=l.getAttribute("width"),h=l.getAttribute("height");if(b||h){let f=l.getAttribute("style")||"",y=[],k=f.split(";").map(w=>w.trim()).filter(Boolean).reduce((w,x)=>{let[L,v]=x.split(":").map(M=>M.trim());return L&&v&&(w[L]=v),w},{});if(b&&!k.width){let w=b.includes("px")?b:`${b}px`;y.push(`width: ${w}`);}if(h&&!k.height){let w=h.includes("px")?h:`${h}px`;y.push(`height: ${w}`);}Object.entries(k).forEach(([w,x])=>{y.push(`${w}: ${x}`);}),y.length>0&&l.setAttribute("style",y.join("; "));}let d=l.closest("div[data-youtube-video]");if(d instanceof HTMLElement){let f=d.getAttribute("style")||"";if(!f.includes("text-align")){let k=f?`${f}; text-align: center`:"text-align: center";d.setAttribute("style",k);}let y=l.getAttribute("style")||"";y.includes("display")||l.setAttribute("style",y?`${y}; display: inline-block`:"display: inline-block");}}let p=Array.from(t.getElementsByTagName("figcaption"));for(let l of p)Array.from(l.querySelectorAll("br.ProseMirror-trailingBreak")).forEach(h=>h.remove()),(!l.textContent||l.textContent.trim()==="")&&l.remove();let c=Array.from(t.getElementsByTagName("figure"));for(let l of c){let b=l.getAttribute("style")||"";if(b=b.replace(/text-align\s*:\s*/gi,"text-align:"),b.includes("text-align:"))l.setAttribute("style",b);else {let d=b.trim(),f=d?`${d}; text-align:center`:"text-align:center";l.setAttribute("style",f);}}let m=Array.from(t.getElementsByTagName("figure"));for(let l of m){let b=Array.from(l.children).filter(d=>d.tagName==="FIGCAPTION");if(b.length>1){let f=b.find(y=>y.textContent&&y.textContent.trim().length>0)||b[0];b.forEach(y=>{y!==f&&y.remove();});}Array.from(l.querySelectorAll(":scope > * > figcaption")).forEach(d=>{Array.from(l.children).some(y=>y.tagName==="FIGCAPTION")&&d.remove();});}return t.body.innerHTML}catch{return e}};var ha=({content:e,className:r,"data-testid":t})=>{let o=A0(e);return jsx("div",{className:g(Ei,r),dangerouslySetInnerHTML:{__html:o},"data-testid":t})};ha.displayName="RichTextViewer";var D0=forwardRef(({label:e,currentValue:r,maxValue:t,showValue:o=false,color:i,className:a,...s},n)=>{let u=Math.min(Math.max(r/t*100,0),100);return jsxs("div",{ref:n,className:g("sui-w-full",a),...s,role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":t,"aria-label":e,children:[e&&jsx("div",{className:"sui-mb-2 sui-text-16 sui-text-default",children:e}),jsxs("div",{className:"sui-flex sui-items-center sui-gap-3",children:[jsx("div",{className:"sui-relative sui-h-3 sui-w-full sui-overflow-hidden sui-rounded-full sui-bg-secondary",children:jsx("div",{className:"sui-h-full sui-rounded-full sui-transition-all sui-duration-500 sui-ease-out",style:{width:`${u}%`,backgroundColor:i||"var(--sui-color-primary)"}})}),o&&jsx("span",{className:"sui-text-16 sui-font-medium sui-text-gray-500",children:r})]})]})});D0.displayName="ProgressBar";var z0=forwardRef(({className:e,children:r,step:t=1,nextIcon:o,prevIcon:i,hideNavWhenDisabled:a=true,...s},n)=>{let u=useRef(null),[p,c]=useState(false),[m,l]=useState(true),b=useCallback(()=>{let d=u.current;if(d){let{scrollLeft:f,scrollWidth:y,clientWidth:k}=d;c(f>0),l(Math.ceil(f+k+2)<y);}},[u.current]);useEffect(()=>(b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)),[b]),useEffect(()=>{let d=u.current;if(!d)return;let f=new MutationObserver(()=>{b();});return f.observe(d,{childList:true,subtree:true,attributes:true,characterData:true}),()=>f.disconnect()},[b]);let h=d=>{let f=u.current;if(!f||!f.firstElementChild)return;let y=f.firstElementChild.offsetWidth||0,k=parseFloat(window.getComputedStyle(f).columnGap)||0,w=y+k,x=Math.round(f.scrollLeft/w),v=(d==="left"?Math.max(0,x-t):x+t)*w;f.scrollTo({left:v,behavior:"smooth"}),setTimeout(b,50),setTimeout(b,300);};return jsxs("div",{className:g("sui-relative sui-w-full sui-group",e),...s,ref:n,children:[(!a||p)&&jsx("button",{type:"button",className:g("sui-absolute sui-left-0 sui-top-1/2 sui-z-10 -sui-translate-y-1/2 -sui-translate-x-1/2 sui-inline-flex sui-h-8 sui-w-8 sui-items-center sui-justify-center sui-rounded-full sui-bg-white sui-text-primary sui-shadow-md hover:sui-bg-gray-50 hover:sui-scale-110 active:sui-scale-95 focus:sui-outline-none disabled:sui-pointer-events-none disabled:sui-opacity-0 sui-transition-all",!p&&"sui-opacity-0 sui-pointer-events-none"),onClick:()=>h("left"),disabled:!p,"aria-label":"Previous slide",children:i||jsx(Tr,{size:20})}),jsx("div",{className:"sui-w-full sui-overflow-hidden",children:jsx("div",{ref:u,className:"sui-flex sui-w-full sui-overflow-x-hidden sui-scroll-smooth sui-gap-4 sui-outline-none",onScroll:b,tabIndex:-1,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r})}),(!a||m)&&jsx("button",{type:"button",className:g("sui-absolute sui-right-0 sui-top-1/2 sui-z-10 -sui-translate-y-1/2 sui-translate-x-1/2 sui-inline-flex sui-h-8 sui-w-8 sui-items-center sui-justify-center sui-rounded-full sui-bg-white sui-text-primary sui-shadow-md hover:sui-bg-gray-50 hover:sui-scale-110 active:sui-scale-95 focus:sui-outline-none disabled:sui-pointer-events-none disabled:sui-opacity-0 sui-transition-all",!m&&"sui-opacity-0 sui-pointer-events-none"),onClick:()=>h("right"),disabled:!m,"aria-label":"Next slide",children:o||jsx(Nr,{size:20})})]})});z0.displayName="Slider";var n6=()=>`
26
26
  <a
27
27
  class="button"
28
28
  href="#0"