@sandlada/mdc
Version:
@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.
2 lines • 2.64 kB
JavaScript
function e(){return typeof window<`u`}function t(e){return i(e)?(e.nodeName||``).toLowerCase():`#document`}function n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function r(e){return((i(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function i(t){return e()?t instanceof Node||t instanceof n(t).Node:!1}function a(t){return e()?t instanceof Element||t instanceof n(t).Element:!1}function o(t){return e()?t instanceof HTMLElement||t instanceof n(t).HTMLElement:!1}function s(t){return!e()||typeof ShadowRoot>`u`?!1:t instanceof ShadowRoot||t instanceof n(t).ShadowRoot}function c(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function l(e){return/^(table|td|th)$/.test(t(e))}function u(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}const d=/transform|translate|scale|rotate|perspective|filter/,f=/paint|layout|strict|content/,p=e=>!!e&&e!==`none`;let m;function h(e){let t=a(e)?y(e):e;return p(t.transform)||p(t.translate)||p(t.scale)||p(t.rotate)||p(t.perspective)||!_()&&(p(t.backdropFilter)||p(t.filter))||d.test(t.willChange||``)||f.test(t.contain||``)}function g(e){let t=x(e);for(;o(t)&&!v(t);){if(h(t))return t;if(u(t))return null;t=x(t)}return null}function _(){return m??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),m}function v(e){return/^(html|body|#document)$/.test(t(e))}function y(e){return n(e).getComputedStyle(e)}function b(e){return a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function x(e){if(t(e)===`html`)return e;let n=e.assignedSlot||e.parentNode||s(e)&&e.host||r(e);return s(n)?n.host:n}function S(e){let t=x(e);return v(t)?(e.ownerDocument||e).body:o(t)&&c(t)?t:S(t)}function C(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=!0);let i=S(e),a=i===e.ownerDocument?.body,o=n(i);if(a){let e=w(o);return t.concat(o,o.visualViewport||[],c(i)?i:[],e&&r?C(e):[])}return t.concat(i,C(i,[],r))}function w(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}export{y as getComputedStyle,g as getContainingBlock,r as getDocumentElement,w as getFrameElement,S as getNearestOverflowAncestor,t as getNodeName,b as getNodeScroll,C as getOverflowAncestors,x as getParentNode,n as getWindow,h as isContainingBlock,a as isElement,o as isHTMLElement,v as isLastTraversableNode,i as isNode,c as isOverflowElement,s as isShadowRoot,l as isTableElement,u as isTopLayer,_ as isWebKit};
//# sourceMappingURL=floating-ui.utils.dom.js.map