@getflip/swirl-components 0.432.0 → 0.433.0
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/components.json +1 -1
- package/dist/cjs/floating-ui.dom-C8bqk2dV.js +1624 -0
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +4 -4
- package/dist/cjs/swirl-menu.cjs.entry.js +4 -4
- package/dist/cjs/swirl-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/swirl-skeleton-box.cjs.entry.js +1 -1
- package/dist/cjs/swirl-tooltip.cjs.entry.js +10 -10
- package/dist/collection/components/swirl-skeleton-box/swirl-skeleton-box.css +1 -2
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +3 -3
- package/dist/components/assets/pdfjs/pdf.worker.min.mjs +1 -1
- package/dist/components/floating-ui.dom.js +1617 -0
- package/dist/components/swirl-autocomplete.js +4 -4
- package/dist/components/swirl-menu.js +4 -4
- package/dist/components/swirl-popover2.js +6 -6
- package/dist/components/swirl-skeleton-box2.js +1 -1
- package/dist/components/swirl-tooltip2.js +10 -10
- package/dist/esm/floating-ui.dom-CLsTbQHn.js +1617 -0
- package/dist/esm/swirl-autocomplete.entry.js +4 -4
- package/dist/esm/swirl-menu.entry.js +4 -4
- package/dist/esm/swirl-popover_2.entry.js +6 -6
- package/dist/esm/swirl-skeleton-box.entry.js +1 -1
- package/dist/esm/swirl-tooltip.entry.js +10 -10
- package/dist/swirl-components/p-13d33aa2.entry.js +1 -0
- package/dist/swirl-components/{p-f53180cb.entry.js → p-322f18d4.entry.js} +1 -1
- package/dist/swirl-components/p-52737e44.entry.js +1 -0
- package/dist/swirl-components/{p-35461505.entry.js → p-8d0be9c3.entry.js} +1 -1
- package/dist/swirl-components/p-CLsTbQHn.js +1 -0
- package/dist/swirl-components/{p-85371da0.entry.js → p-c8c1b0b2.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/floating-ui.dom.browser.min-PA1q-Uql.js +0 -12
- package/dist/components/floating-ui.dom.browser.min.js +0 -5
- package/dist/esm/floating-ui.dom.browser.min-BtsCuEVE.js +0 -5
- package/dist/swirl-components/p-5c638e8c.entry.js +0 -1
- package/dist/swirl-components/p-BtsCuEVE.js +0 -1
- package/dist/swirl-components/p-de985b44.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,H as i,d as s}from"./p-Dj_4Fda9.js";import{u as e,P as a,D as r,k as l,b as n,N as h}from"./p-BtsCuEVE.js";import{c as p}from"./p-orsBiyT_.js";import{n as c}from"./p-Dn2SWlGn.js";const d=class{constructor(o){t(this,o),this.active=!0,this.delay=200,this.intent="default",this.maxWidth="17.5rem",this.position="top",this.positioning="absolute",this.trigger=["focus","hover"],this.visible=!1,this.onKeydown=t=>{"Escape"===t.code&&this.hide()},this.onFocusIn=()=>{this.trigger.includes("focus")&&this.show()},this.onFocusOut=()=>{this.trigger.includes("focus")&&this.hide()},this.reposition=async()=>{const t=this.el.children[0];if(!Boolean(t)||!Boolean(this.popperEl))return;const o=[...this.options.middleware.filter((t=>"arrow"!==t.name)),e({element:this.arrowElement,padding:12})];this.actualPosition=await a(t,this.popperEl,{...this.options,middleware:o});const i=this.actualPosition.middlewareData.arrow?.x,s=this.actualPosition.middlewareData.arrow?.y;this.arrowStyles={left:Boolean(i)?i+"px":void 0,top:Boolean(s)?s+"px":void 0}},this.showWithDelay=()=>{this.active&&(Boolean(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=void 0),this.showTimeout=setTimeout((()=>{this.show()}),this.delay))},this.updateOptions=()=>{const t=c("--s-space-12"),o=c("--s-space-8"),i=c("--s-space-16");this.options={middleware:[r(t),l({padding:{top:o,bottom:o,left:i,right:i}}),n()],placement:this.position,strategy:this.positioning}}}watchPosition(){this.updateOptions()}onMouseEnter(){this.trigger.includes("hover")&&this.showWithDelay()}onMouseLeave(){this.trigger.includes("hover")&&this.hide()}onWindowResize(){this.active&&this.reposition()}onWindowScroll(){this.active&&this.visible&&this.reposition()}componentWillLoad(){this.reposition()}componentDidLoad(){this.updateOptions()}async show(){this.active&&(this.visible=!0,requestAnimationFrame((()=>{const t=this.el.children[0];Boolean(t)&&(this.reposition(),this.disableAutoUpdate=h(t,this.popperEl,this.reposition.bind(this)))})))}async hide(){Boolean(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=void 0),this.visible=!1,this.disableAutoUpdate?.()}render(){const t=p("tooltip",`tooltip--actual-placement-${this.actualPosition?.placement}`,`tooltip--intent-${this.intent}`,{"tooltip--active":this.active,"tooltip--visible":this.visible});return o(i,{key:"62242ca0238a1cb072fc0253b57732bb6fe8ba1d",onKeydown:this.onKeydown},o("span",{key:"4613ceba81107da0ad513184b72628cef5e889c8",class:t},o("span",{key:"ed854da20f19bc50077926a2fd28297113dcc359",class:"tooltip__reference","aria-describedby":"tooltip",onFocusout:this.onFocusOut,onClick:this.hide,onFocusin:this.onFocusIn},o("slot",{key:"1302b8ce283daf7e2f1357b2f595bf9cc3038d5c"})),o("span",{key:"a1105e62cb7154e9818c7d9db5cd1625d2519833",class:"tooltip__popper",ref:t=>this.popperEl=t,style:{top:Boolean(this.actualPosition)?`${this.actualPosition?.y}px`:"",left:Boolean(this.actualPosition)?`${this.actualPosition?.x}px`:"",position:this.positioning,maxWidth:this.maxWidth}},this.visible&&o("span",{key:"b039c561fac0504934448f157417c8dca033b0e1",class:"tooltip__bubble",id:"tooltip",part:"tooltip__bubble",role:"tooltip"},o("span",{key:"ef6ab50e99dd78d3152a1cb2068ac3a3b6081798",class:"tooltip__content",innerHTML:this.content})),o("span",{key:"087f97b8b1a01cf85f841089ff5d2d2e7bff6746",class:"tooltip__arrow",ref:t=>this.arrowElement=t,style:{...this.arrowStyles,visibility:this.visible?"visible":"hidden"}}))))}get el(){return s(this)}static get watchers(){return{position:["watchPosition"]}}};d.style=":host{display:contents;font-weight:var(--s-font-weight-normal)}:host *{box-sizing:border-box}.tooltip{display:contents}.tooltip--active .tooltip__popper{display:block}.tooltip--visible .tooltip__popper{animation:tooltip-fade-in 0.15s;animation-delay:0.1s;animation-fill-mode:forwards;opacity:0}.tooltip--actual-placement-top .tooltip__arrow{top:calc(100% - 0.0625rem);transform:translate3d(0, -50%, 0) rotate(45deg)}.tooltip--actual-placement-bottom .tooltip__arrow{bottom:calc(100% - 0.0625rem);transform:translate3d(0, 50%, 0) rotate(45deg)}.tooltip--actual-placement-left .tooltip__arrow{left:calc(100% - 0.0625rem);transform:translate3d(-50%, 0, 0) rotate(45deg)}.tooltip--actual-placement-right .tooltip__arrow{right:calc(100% - 0.0625rem);transform:translate3d(50%, 0, 0) rotate(45deg)}.tooltip .tooltip__reference{display:contents}.tooltip__popper{position:absolute;z-index:var(--s-z-40);display:none;opacity:0}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:calc(var(--s-space-8) + 0.0625rem);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);text-align:start;box-shadow:var(--s-shadow-level-2)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tooltip__bubble{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tooltip__content{white-space:normal}.tooltip__arrow{position:absolute;width:0.6875rem;height:0.6875rem;border-radius:0.125rem;background-color:var(--s-surface-neutral-default)}.tooltip--intent-info .tooltip__bubble,.tooltip--intent-info .tooltip__arrow{background-color:var(--s-surface-info-default)}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}";export{d as swirl_tooltip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function e(t){return t.split("-")[0]}function o(t){return["top","bottom"].includes(e(t))?"x":"y"}function r(r,i,l){let{reference:a,floating:c}=r;const s=a.x+a.width/2-c.width/2,u=a.y+a.height/2-c.height/2,f=o(i),d=n(f),m=a[d]/2-c[d]/2,y="x"===f;let g;switch(e(i)){case"top":g={x:s,y:a.y-c.height};break;case"bottom":g={x:s,y:a.y+a.height};break;case"right":g={x:a.x+a.width,y:u};break;case"left":g={x:a.x-c.width,y:u};break;default:g={x:a.x,y:a.y}}switch(t(i)){case"start":g[f]-=m*(l&&y?-1:1);break;case"end":g[f]+=m*(l&&y?-1:1)}return g}function i(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function a(t,n){var e;void 0===n&&(n={});const{x:o,y:r,platform:a,rects:c,elements:s,strategy:u}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:m="floating",altBoundary:y=!1,padding:g=0}=n,p=i(g),h=s[y?"floating"===m?"reference":"floating":m],x=l(await a.getClippingRect({element:null==(e=await(null==a.isElement?void 0:a.isElement(h)))||e?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:f,rootBoundary:d,strategy:u})),w="floating"===m?{...c.floating,x:o,y:r}:c.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},A=l(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:v,strategy:u}):w);return{top:(x.top-A.top+p.top)/b.y,bottom:(A.bottom-x.bottom+p.bottom)/b.y,left:(x.left-A.left+p.left)/b.x,right:(A.right-x.right+p.right)/b.x}}const c=Math.min,s=Math.max;function u(t,n,e){return s(t,c(n,e))}const f=e=>({name:"arrow",options:e,async fn(r){const{element:l,padding:a=0}=e||{},{x:c,y:s,placement:f,rects:d,platform:m,elements:y}=r;if(null==l)return{};const g=i(a),p={x:c,y:s},h=o(f),x=n(h),w=await m.getDimensions(l),v="y"===h,b=v?"top":"left",A=v?"bottom":"right",R=v?"clientHeight":"clientWidth",k=d.reference[x]+d.reference[h]-p[h]-d.floating[x],P=p[h]-d.reference[h],D=await(null==m.getOffsetParent?void 0:m.getOffsetParent(l));let S=D?D[R]:0;S&&await(null==m.isElement?void 0:m.isElement(D))||(S=y.floating[R]||d.floating[x]);const T=g[b],z=S-w[x]-g[A],B=S/2-w[x]/2+(k/2-P/2),F=u(T,B,z),L=null!=t(f)&&B!=F&&d.reference[x]/2-(B<T?g[b]:g[A])-w[x]/2<0;return{[h]:p[h]-(L?B<T?T-B:z-B:0),data:{[h]:F,centerOffset:B-F}}}});["top","right","bottom","left"].reduce(((t,n)=>t.concat(n,n+"-start",n+"-end")),[]);const d={left:"right",right:"left",bottom:"top",top:"bottom"};function m(t){return t.replace(/left|right|bottom|top/g,(t=>d[t]))}function y(e,r,i){void 0===i&&(i=!1);const l=t(e),a=o(e),c=n(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return r.reference[c]>r.floating[c]&&(s=m(s)),{main:s,cross:m(s)}}const g={start:"end",end:"start"};function p(t){return t.replace(/start|end/g,(t=>g[t]))}const h=function(n){return void 0===n&&(n={}),{name:"flip",options:n,async fn(o){var r;const{placement:i,middlewareData:l,rects:c,initialPlacement:s,platform:u,elements:f}=o,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...b}=n,A=e(i),R=e(s)===s,k=await(null==u.isRTL?void 0:u.isRTL(f.floating)),P=h||(R||!v?[m(s)]:function(t){const n=m(t);return[p(t),n,p(n)]}(s));h||"none"===w||P.push(...function(n,o,r,i){const l=t(n);let a=function(t,n,e){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return e?n?r:o:n?o:r;case"left":case"right":return n?i:l;default:return[]}}(e(n),"start"===r,i);return l&&(a=a.map((t=>t+"-"+l)),o&&(a=a.concat(a.map(p)))),a}(s,v,w,k));const D=[s,...P],S=await a(o,b),T=[];let z=(null==(r=l.flip)?void 0:r.overflows)||[];if(d&&T.push(S[A]),g){const{main:t,cross:n}=y(i,c,k);T.push(S[t],S[n])}if(z=[...z,{placement:i,overflows:T}],!T.every((t=>t<=0))){var B,F;const t=((null==(B=l.flip)?void 0:B.index)||0)+1,n=D[t];if(n)return{data:{index:t,overflows:z},reset:{placement:n}};let e=null==(F=z.filter((t=>t.overflows[0]<=0)).sort(((t,n)=>t.overflows[1]-n.overflows[1]))[0])?void 0:F.placement;if(!e)switch(x){case"bestFit":{var L;const t=null==(L=z.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,n)=>t+n),0)])).sort(((t,n)=>t[1]-n[1]))[0])?void 0:L[0];t&&(e=t);break}case"initialPlacement":e=s}if(i!==e)return{reset:{placement:e}}}return{}}}},x=function(n){return void 0===n&&(n=0),{name:"offset",options:n,async fn(r){const{x:i,y:l}=r,a=await async function(n,r){const{placement:i,platform:l,elements:a}=n,c=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=e(i),u=t(i),f="x"===o(i),d=["left","top"].includes(s)?-1:1,m=c&&f?-1:1,y="function"==typeof r?r(n):r;let{mainAxis:g,crossAxis:p,alignmentAxis:h}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof h&&(p="end"===u?-1*h:h),f?{x:p*m,y:g*d}:{x:g*d,y:p*m}}(r,n);return{x:i+a.x,y:l+a.y,data:a}}}},w=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(n){const{x:r,y:i,placement:l}=n,{mainAxis:c=!0,crossAxis:s=!1,limiter:f={fn:t=>{let{x:n,y:e}=t;return{x:n,y:e}}},...d}=t,m={x:r,y:i},y=await a(n,d),g=o(e(l)),p=function(t){return"x"===t?"y":"x"}(g);let h=m[g],x=m[p];c&&(h=u(h+y["y"===g?"top":"left"],h,h-y["y"===g?"bottom":"right"])),s&&(x=u(x+y["y"===p?"top":"left"],x,x-y["y"===p?"bottom":"right"]));const w=f.fn({...n,[g]:h,[p]:x});return{...w,data:{x:w.x-r,y:w.y-i}}}}};function v(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function b(t){if(null==t)return window;if(!v(t)){const n=t.ownerDocument;return n&&n.defaultView||window}return t}function A(t){return b(t).getComputedStyle(t)}function R(t){return v(t)?"":t?(t.nodeName||"").toLowerCase():""}function k(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function P(t){return t instanceof b(t).HTMLElement}function D(t){return t instanceof b(t).Element}function S(t){return"undefined"!=typeof ShadowRoot&&(t instanceof b(t).ShadowRoot||t instanceof ShadowRoot)}function T(t){const{overflow:n,overflowX:e,overflowY:o}=A(t);return/auto|scroll|overlay|hidden/.test(n+o+e)}function z(t){return["table","td","th"].includes(R(t))}function B(t){const n=/firefox/i.test(k()),e=A(t);return"none"!==e.transform||"none"!==e.perspective||"paint"===e.contain||["transform","perspective"].includes(e.willChange)||n&&"filter"===e.willChange||n&&!!e.filter&&"none"!==e.filter}function F(){return!/^((?!chrome|android).)*safari/i.test(k())}const L=Math.min,M=Math.max,O=Math.round;function C(t,n,e){var o,r,i,l;void 0===n&&(n=!1),void 0===e&&(e=!1);const a=t.getBoundingClientRect();let c=1,s=1;n&&P(t)&&(c=t.offsetWidth>0&&O(a.width)/t.offsetWidth||1,s=t.offsetHeight>0&&O(a.height)/t.offsetHeight||1);const u=D(t)?b(t):window,f=!F()&&e,d=(a.left+(f&&null!=(o=null==(r=u.visualViewport)?void 0:r.offsetLeft)?o:0))/c,m=(a.top+(f&&null!=(i=null==(l=u.visualViewport)?void 0:l.offsetTop)?i:0))/s,y=a.width/c,g=a.height/s;return{width:y,height:g,top:m,right:d+y,bottom:m+g,left:d,x:d,y:m}}function E(t){return(n=t,(n instanceof b(n).Node?t.ownerDocument:t.document)||window.document).documentElement;var n}function j(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(t){return C(E(t)).left+j(t).scrollLeft}function H(t,n,e){const o=P(n),r=E(n),i=C(t,o&&function(t){const n=C(t);return O(n.width)!==t.offsetWidth||O(n.height)!==t.offsetHeight}(n),"fixed"===e);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==e)if(("body"!==R(n)||T(r))&&(l=j(n)),P(n)){const t=C(n,!0);a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}else r&&(a.x=q(r));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function V(t){return"html"===R(t)?t:t.assignedSlot||t.parentNode||(S(t)?t.host:null)||E(t)}function W(t){return P(t)&&"fixed"!==A(t).position?function(t){let{offsetParent:n}=t,e=t,o=!1;for(;e&&e!==n;){const{assignedSlot:t}=e;if(t){let r=t.offsetParent;if("contents"===A(t).display){const n=t.hasAttribute("style"),o=t.style.display;t.style.display=A(e).display,r=t.offsetParent,t.style.display=o,n||t.removeAttribute("style")}e=t,n!==r&&(n=r,o=!0)}else if(S(e)&&e.host&&o)break;e=S(e)&&e.host||e.parentNode}return n}(t):null}function X(t){const n=b(t);let e=W(t);for(;e&&z(e)&&"static"===A(e).position;)e=W(e);return e&&("html"===R(e)||"body"===R(e)&&"static"===A(e).position&&!B(e))?n:e||function(t){let n=V(t);for(S(n)&&(n=n.host);P(n)&&!["html","body"].includes(R(n));){if(B(n))return n;{const t=n.parentNode;n=S(t)?t.host:t}}return null}(t)||n}function Y(t){if(P(t))return{width:t.offsetWidth,height:t.offsetHeight};const n=C(t);return{width:n.width,height:n.height}}function G(t){const n=V(t);return["html","body","#document"].includes(R(n))?t.ownerDocument.body:P(n)&&T(n)?n:G(n)}function I(t,n){var e;void 0===n&&(n=[]);const o=G(t),r=o===(null==(e=t.ownerDocument)?void 0:e.body),i=b(o),l=r?[i].concat(i.visualViewport||[],T(o)?o:[]):o,a=n.concat(l);return r?a:a.concat(I(l))}function J(t,n,e){return"viewport"===n?l(function(t,n){const e=b(t),o=E(t),r=e.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const t=F();(t||!t&&"fixed"===n)&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}(t,e)):D(n)?function(t,n){const e=C(t,!1,"fixed"===n),o=e.top+t.clientTop,r=e.left+t.clientLeft;return{top:o,left:r,x:r,y:o,right:r+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,e):l(function(t){var n;const e=E(t),o=j(t),r=null==(n=t.ownerDocument)?void 0:n.body,i=M(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=M(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let a=-o.scrollLeft+q(t);const c=-o.scrollTop;return"rtl"===A(r||e).direction&&(a+=M(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:l,x:a,y:c}}(E(t)))}function K(t){const n=I(t),e=["absolute","fixed"].includes(A(t).position)&&P(t)?X(t):t;return D(e)?n.filter((t=>D(t)&&function(t,n){const e=null==n.getRootNode?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&S(e)){let e=n;do{if(e&&t===e)return!0;e=e.parentNode||e.host}while(e)}return!1}(t,e)&&"body"!==R(t))):[]}const N={getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===e?K(n):[].concat(e),o],l=i.reduce(((t,e)=>{const o=J(n,e,r);return t.top=M(o.top,t.top),t.right=L(o.right,t.right),t.bottom=L(o.bottom,t.bottom),t.left=M(o.left,t.left),t}),J(n,i[0],r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:e,strategy:o}=t;const r=P(e),i=E(e);if(e===i)return n;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==R(e)||T(i))&&(l=j(e)),P(e))){const t=C(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}return{...n,x:n.x-l.scrollLeft+a.x,y:n.y-l.scrollTop+a.y}},isElement:D,getDimensions:Y,getOffsetParent:X,getDocumentElement:E,getElementRects:t=>{let{reference:n,floating:e,strategy:o}=t;return{reference:H(n,X(e),o),floating:{...Y(e),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===A(t).direction};function Q(t,n,e,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=!0,animationFrame:a=!1}=o,c=r&&!a,s=i&&!a,u=c||s?[...D(t)?I(t):[],...I(n)]:[];u.forEach((t=>{c&&t.addEventListener("scroll",e,{passive:!0}),s&&t.addEventListener("resize",e)}));let f,d=null;if(l){let o=!0;d=new ResizeObserver((()=>{o||e(),o=!1})),D(t)&&!a&&d.observe(t),d.observe(n)}let m=a?C(t):null;return a&&function n(){const o=C(t);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||e(),m=o,f=requestAnimationFrame(n)}(),e(),()=>{var t;u.forEach((t=>{c&&t.removeEventListener("scroll",e),s&&t.removeEventListener("resize",e)})),null==(t=d)||t.disconnect(),d=null,a&&cancelAnimationFrame(f)}}const U=(t,n,e)=>(async(t,n,e)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:a}=e,c=l.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(n));let u=await a.getElementRects({reference:t,floating:n,strategy:i}),{x:f,y:d}=r(u,o,s),m=o,y={},g=0;for(let e=0;e<c.length;e++){const{name:l,fn:p}=c[e],{x:h,y:x,data:w,reset:v}=await p({x:f,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:y,rects:u,platform:a,elements:{reference:t,floating:n}});f=null!=h?h:f,d=null!=x?x:d,y={...y,[l]:{...y[l],...w}},v&&g<=50&&(g++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(u=!0===v.rects?await a.getElementRects({reference:t,floating:n,strategy:i}):v.rects),({x:f,y:d}=r(u,m,s))),e=-1)}return{x:f,y:d,placement:m,strategy:i,middlewareData:y}})(t,n,{platform:N,...e});export{x as D,Q as N,U as P,h as b,w as k,f as u}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s,H as o}from"./p-Dj_4Fda9.js";import{c as r}from"./p-orsBiyT_.js";const i=class{constructor(s){e(this,s),this.animated=!0,this.borderRadius="base"}render(){const e=r("skeleton-box",`skeleton-box--border-radius-${this.borderRadius}`,{"skeleton-box--static":!this.animated});return s(o,{key:"b7d0def70588e3c02bf9256c5ecc6fa67bd7da21",style:{width:Boolean(this.width)||Boolean(this.aspectRatio)?void 0:"100%"}},s("div",{key:"90743565eeb02ab7384466699284c3ad9cca7e83",class:e,style:{aspectRatio:this.aspectRatio,borderRadius:"pill"!==this.borderRadius&&"none"!==this.borderRadius?`var(--s-border-radius-${this.borderRadius})`:void 0,height:this.height,width:this.width}}))}};i.style=':host{display:block}:host *{box-sizing:border-box}.skeleton-box{position:relative;overflow:hidden;min-height:var(--s-font-size-sm);background-color:var(--s-surface-raised-hovered)}.skeleton-box:before{position:relative;z-index:1;display:block;width:100%;height:100%;background-image:linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0,\n rgba(255, 255, 255, 0) 12%,\n var(--s-surface-raised-default) 50%,\n rgba(255, 255, 255, 0) 88%,\n rgba(255, 255, 255, 0) 100%\n );content:"";transform:translateX(-100%);animation:skeleton-box-shimmer 3s infinite}@keyframes skeleton-box-shimmer{100%{transform:translateX(100%)}}.skeleton-box--static:before{display:none}.skeleton-box--border-radius-pill{border-radius:100rem}.skeleton-box--border-radius-none{border-radius:0}';export{i as swirl_skeleton_box}
|