@threadlabs/looma 0.1.27 → 0.1.28

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.
Files changed (87) hide show
  1. package/dist/{chunk-RLELJVBL.js → chunk-G5AWV77V.js} +33 -33
  2. package/dist/{chunk-YHXJC5M5.js → chunk-M7FPK6GN.js} +17 -12
  3. package/dist/cjs/{positioning-i0WrCAdF.js → positioning-D5q9DM-0.js} +19 -12
  4. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  5. package/dist/cjs/ui-chip_2.cjs.entry.js +1 -1
  6. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  7. package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
  8. package/dist/cjs/ui-menu.cjs.entry.js +2 -2
  9. package/dist/cjs/ui-popover.cjs.entry.js +2 -2
  10. package/dist/cjs/ui-toast-region.cjs.entry.js +1 -1
  11. package/dist/cjs/ui-tooltip.cjs.entry.js +1 -1
  12. package/dist/collection/components/ui-dialog/ui-dialog.css +1 -0
  13. package/dist/collection/components/ui-menu/ui-menu.css +7 -2
  14. package/dist/collection/components/ui-popover/ui-popover.css +6 -2
  15. package/dist/collection/overlay/positioning.js +21 -14
  16. package/dist/components/{p-DZRtXH6j.js → p-B1macZOS.js} +1 -1
  17. package/dist/components/{p-BKzrrab4.js → p-DiyiodGX.js} +1 -1
  18. package/dist/components/p-Drw41pSY.js +1 -0
  19. package/dist/components/{p-D0wBI-9r.js → p-d5fk1vBI.js} +1 -1
  20. package/dist/components/ui-affordance-scope.js +1 -1
  21. package/dist/components/ui-combobox.js +1 -1
  22. package/dist/components/ui-context-menu.js +1 -1
  23. package/dist/components/ui-dialog.js +1 -1
  24. package/dist/components/ui-menu.js +1 -1
  25. package/dist/components/ui-multi-combobox.js +1 -1
  26. package/dist/components/ui-popover.js +1 -1
  27. package/dist/components/ui-toast-region.js +1 -1
  28. package/dist/components/ui-tooltip.js +1 -1
  29. package/dist/esm/{positioning-Bu0dmLBE.js → positioning-Drmwg-C1.js} +19 -12
  30. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  31. package/dist/esm/ui-chip_2.entry.js +1 -1
  32. package/dist/esm/ui-context-menu.entry.js +1 -1
  33. package/dist/esm/ui-dialog.entry.js +1 -1
  34. package/dist/esm/ui-menu.entry.js +2 -2
  35. package/dist/esm/ui-popover.entry.js +2 -2
  36. package/dist/esm/ui-toast-region.entry.js +1 -1
  37. package/dist/esm/ui-tooltip.entry.js +1 -1
  38. package/dist/index.cjs +54 -36
  39. package/dist/index.js +26 -13
  40. package/dist/looma/looma.esm.js +1 -1
  41. package/dist/looma/{p-0fd60103.entry.js → p-311e54d4.entry.js} +1 -1
  42. package/dist/looma/{p-72338f53.entry.js → p-32c85198.entry.js} +1 -1
  43. package/dist/looma/{p-a939c00f.entry.js → p-3957f7ef.entry.js} +1 -1
  44. package/dist/looma/{p-66c6b6dd.entry.js → p-4a10a875.entry.js} +1 -1
  45. package/dist/looma/{p-77dcfa6f.entry.js → p-4f68f939.entry.js} +1 -1
  46. package/dist/looma/p-63a9159f.entry.js +1 -0
  47. package/dist/looma/{p-85a6716e.entry.js → p-82de1112.entry.js} +1 -1
  48. package/dist/looma/{p-b75aff63.entry.js → p-88e61cab.entry.js} +1 -1
  49. package/dist/looma/p-Drmwg-C1.js +1 -0
  50. package/dist/{ui-affordance-scope.entry-7H6GIQEK.js → ui-affordance-scope.entry-X5526PRP.js} +2 -2
  51. package/dist/{ui-avatar-group.entry-QB25IUWA.js → ui-avatar-group.entry-U72MPB5K.js} +1 -1
  52. package/dist/{ui-avatar.entry-L377CWPR.js → ui-avatar.entry-OC4J3LTV.js} +1 -1
  53. package/dist/{ui-badge.entry-QHC3KI5S.js → ui-badge.entry-4MSUQRQV.js} +1 -1
  54. package/dist/{ui-button.entry-MZGTPU22.js → ui-button.entry-22DESWN4.js} +1 -1
  55. package/dist/{ui-callout.entry-2D4LO74K.js → ui-callout.entry-LOGODDM5.js} +1 -1
  56. package/dist/{ui-checkbox.entry-B2O5DREC.js → ui-checkbox.entry-XAGW3BW4.js} +1 -1
  57. package/dist/{ui-chip_2.entry-OOSON72O.js → ui-chip_2.entry-JCPHPXAG.js} +2 -2
  58. package/dist/{ui-context-menu.entry-UY76G7HM.js → ui-context-menu.entry-24YOHF7L.js} +2 -2
  59. package/dist/{ui-dialog.entry-345V7IJ3.js → ui-dialog.entry-XKNYDWOQ.js} +2 -2
  60. package/dist/{ui-disclosure.entry-RUU7VNDN.js → ui-disclosure.entry-2AWCGZ4C.js} +1 -1
  61. package/dist/{ui-editable.entry-WWFFHOMP.js → ui-editable.entry-HLEWO7BN.js} +1 -1
  62. package/dist/{ui-floating-action-button.entry-Y2TLDJO4.js → ui-floating-action-button.entry-2NJDB4YN.js} +1 -1
  63. package/dist/{ui-form-field.entry-C63GZMQR.js → ui-form-field.entry-FJ5HYCTN.js} +1 -1
  64. package/dist/{ui-icon-button.entry-35MJYYEI.js → ui-icon-button.entry-YZHJQ5YR.js} +1 -1
  65. package/dist/{ui-input.entry-3FAXEH5M.js → ui-input.entry-JMBLMNP6.js} +1 -1
  66. package/dist/{ui-menu-item.entry-3J42XLCJ.js → ui-menu-item.entry-VBGXM66D.js} +1 -1
  67. package/dist/{ui-menu.entry-YDABO3OO.js → ui-menu.entry-I2N5H3YC.js} +3 -3
  68. package/dist/{ui-multi-combobox.entry-XXLS4V3I.js → ui-multi-combobox.entry-MEX7MU7P.js} +1 -1
  69. package/dist/{ui-popover.entry-YP7R6FQO.js → ui-popover.entry-7JRSJM5S.js} +3 -3
  70. package/dist/{ui-radio-group.entry-TYXAN7G5.js → ui-radio-group.entry-Q2XB7P3B.js} +1 -1
  71. package/dist/{ui-radio.entry-JW7HX3LW.js → ui-radio.entry-NJO4NA4M.js} +1 -1
  72. package/dist/{ui-search-result-row.entry-MKQYGNFO.js → ui-search-result-row.entry-RPMNDSRN.js} +1 -1
  73. package/dist/{ui-search-shell.entry-KHIQTT4J.js → ui-search-shell.entry-FMIMYD3B.js} +1 -1
  74. package/dist/{ui-select.entry-R235Y3IL.js → ui-select.entry-7NDBWNAU.js} +1 -1
  75. package/dist/{ui-switch.entry-BJ6FIEPB.js → ui-switch.entry-YUCPIZE4.js} +1 -1
  76. package/dist/{ui-tabs.entry-ZBP3FLR2.js → ui-tabs.entry-FXZWV665.js} +1 -1
  77. package/dist/{ui-textarea.entry-2YW7TCEU.js → ui-textarea.entry-HHLQR5GG.js} +1 -1
  78. package/dist/{ui-toast-region.entry-ZSCMMIKQ.js → ui-toast-region.entry-PIIBHNYA.js} +2 -2
  79. package/dist/{ui-tooltip.entry-VG4AWEBD.js → ui-tooltip.entry-AQ6UPBUP.js} +2 -2
  80. package/dist/{ui-top-bar.entry-CZW3MLC6.js → ui-top-bar.entry-S2L7ZM4U.js} +1 -1
  81. package/dist/{ui-tree-item.entry-CU2SWAOK.js → ui-tree-item.entry-UID7IJPA.js} +1 -1
  82. package/dist/{ui-tree.entry-M6KXK7GJ.js → ui-tree.entry-UMD3DNG5.js} +1 -1
  83. package/package.json +1 -1
  84. package/styles.css +6 -4
  85. package/dist/components/p-DOulVJT7.js +0 -1
  86. package/dist/looma/p-8f102407.entry.js +0 -1
  87. package/dist/looma/p-Bu0dmLBE.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e,g as t,h as i,H as s}from"./p-8BGiMGQ0.js";import{d as a,e as r}from"./p-JwSoedEO.js";import{o,c as n,r as l}from"./p-C-0syqXZ.js";import{i as c,c as h}from"./p-BnGhGgTH.js";import{a as u}from"./p-Bu0dmLBE.js";const d=class{constructor(t){e(this,t)}get host(){return t(this)}open;defaultOpen=!1;for;placement="bottom-start";internalOpen=!1;overlayId=`ui-menu-${Math.random().toString(36).slice(2,11)}`;anchor=null;surface=null;syncFromProp(){c(this.open)&&(this.internalOpen=this.open)}resetSurface(){this.setupSurface(),this.syncSurface()}syncSurface(){this.syncAnchorState(),this.surface&&(this.internalOpen?(this.surface.show(),o({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.anchor?[this.anchor]:void 0,dismissible:!0,requestClose:(e,t)=>this.closeMenu(e,t)})):(this.surface.hide(),n(this.overlayId)))}componentDidLoad(){this.internalOpen=h(this.open,this.defaultOpen),this.host.addEventListener("click",this.onItemClick),this.host.addEventListener("keydown",this.onKeydown),this.setupSurface(),this.syncSurface()}disconnectedCallback(){this.host.removeEventListener("click",this.onItemClick),this.host.removeEventListener("keydown",this.onKeydown),this.surface?.destroy(),this.surface=null,n(this.overlayId)}setupSurface(){this.surface?.destroy(),this.surface=null,this.anchor=this.for?this.host.ownerDocument.getElementById(this.for):null,this.anchor&&(this.surface=u(this.host,{anchor:this.anchor,placement:this.placement}))}syncAnchorState(){this.anchor&&(this.anchor.setAttribute("aria-haspopup","menu"),this.anchor.setAttribute("aria-expanded",this.internalOpen?"true":"false"))}closeMenu(e,t){this.internalOpen&&(c(this.open)||(this.internalOpen=!1),a(this.host,"close",{open:!1,reason:e,trigger:t}),"escape"===e&&this.anchor?.focus())}getItems(){return Array.from(this.host.querySelectorAll("ui-menu-item"))}isItemDisabled(e){return"true"===e.getAttribute("aria-disabled")||e.hasAttribute("disabled")||"true"===e.getAttribute("disabled")||!0===e.disabled}onItemClick=e=>{const t=e.target.closest?.("ui-menu-item");if(!t||t.getRootNode()!==this.host.getRootNode())return;if(this.isItemDisabled(t))return;const i=t.getAttribute("value")??t.getAttribute("data-value")??"";a(this.host,"select",{value:i,trigger:r(e)}),a(this.host,"close",{open:!1,reason:"action",trigger:r(e)}),c(this.open)||(this.internalOpen=!1)};onKeydown=e=>{if("Escape"===e.key)return e.preventDefault(),void l("escape","keyboard");const t=this.getItems().filter((e=>!this.isItemDisabled(e)));if(0===t.length)return;const i=e.target.closest?.("ui-menu-item"),s=i&&i instanceof HTMLElement?t.indexOf(i):-1;if("Enter"!==e.key&&" "!==e.key)"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t["ArrowDown"===e.key?s<0?0:Math.min(s+1,t.length-1):s<=0?t.length-1:s-1].focus());else if(e.preventDefault(),i&&s>=0){const e=i.getAttribute("value")??i.getAttribute("data-value")??"";a(this.host,"select",{value:e,trigger:"keyboard"}),a(this.host,"close",{open:!1,reason:"action",trigger:"keyboard"}),c(this.open)||(this.internalOpen=!1)}};render(){return i(s,{key:"22689ca1b0514bb27a76bfb9a702c0d4ce49d136",role:"menu","aria-orientation":"vertical","data-open":this.internalOpen?"":void 0},i("div",{key:"cff891a33348f077631f1b92f1167285aafd25f1",class:"menu__surface"},i("slot",{key:"3a0e9ff4f36b1afbe5f879e0e51ff4943279b5b5"})))}static get watchers(){return{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncSurface:0}]}}};d.style=":host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;box-sizing:border-box;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:auto;max-block-size:calc(100dvh - (var(--ui-menu-viewport-gap) * 2));opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}::slotted(ui-menu-item){display:block;width:100%}";export{d as ui_menu}
@@ -1 +0,0 @@
1
- const t=16;let n=0;const o=new WeakMap;function a(t){try{return t.matches(":popover-open")}catch{return!t.hidden}}function i(t){if(t.setAttribute("popover","manual"),t.hidden=!1,"function"==typeof t.showPopover&&!a(t))try{t.showPopover()}catch{}}function e(t){if("function"==typeof t.hidePopover&&a(t))try{t.hidePopover()}catch{}t.hidden=!0}function r(t){return t.setAttribute("popover","manual"),t.dataset.uiPositioning="viewport",{show(){i(t)},hide(){e(t)},destroy(){e(t)}}}function l(t,n,o,a,i){const e=u(t.ownerDocument.defaultView??window),r=t.getBoundingClientRect(),l=o.startsWith("top"),c=o.endsWith("end"),s=e.bottom-n.bottom-i,h=n.top-e.top-i,p=(l?!(h<r.height+a&&s>h):s<r.height+a&&h>s)?n.top-r.height-a:n.bottom+a,f=c?n.right-r.width:n.left,d=function(t,n=u(),o=0){const a=Math.max(0,n.width-2*o),i=Math.max(0,n.height-2*o),e=t.width>a?n.left+o:Math.min(Math.max(t.left,n.left+o),n.right-o-t.width),r=t.height>i?n.top+o:Math.min(Math.max(t.top,n.top+o),n.bottom-o-t.height);return{x:e-t.left,y:r-t.top}}({left:f,top:p,width:r.width,height:r.height},e,i);t.style.left=`${Math.round(f+d.x)}px`,t.style.top=`${Math.round(p+d.y)}px`,t.style.right="auto",t.style.bottom="auto"}function c(t,a={}){const r=t.ownerDocument.defaultView??window,c=a.placement??"bottom-start",u=Math.max(0,a.gap??4),s=Math.max(0,a.viewportGap??8),h=function(t){const n=t.CSS;return"function"==typeof n?.supports&&n.supports("anchor-name: --ui-anchor-test")&&n.supports("position-anchor: --ui-anchor-test")&&n.supports("top: anchor(bottom)")}(r),p="--ui-anchor-"+ ++n;let f=a.anchor??null,d=null,m=!1,g=null,y=null;t.setAttribute("popover","manual"),t.dataset.uiPositioning=h?"anchor":"fallback",t.style.position="fixed",t.style.margin="0";const w=n=>{f&&function(t,n){const a=o.get(t);if(a)if(a.names.delete(n),a.names.size){const n=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",n.join(", "))}else a.original?t.style.setProperty("anchor-name",a.original):t.style.removeProperty("anchor-name"),o.delete(t)}(f,p),f=n,f?(function(t,n){const a=o.get(t)??{original:t.style.getPropertyValue("anchor-name"),names:new Set};a.names.add(n),o.set(t,a);const i=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",i.join(", "))}(f,p),t.style.setProperty("position-anchor",p)):t.style.removeProperty("position-anchor")},v=()=>{g=null,m&&(d?l(t,{left:d.x,right:d.x,top:d.y,bottom:d.y},"bottom-start",u,s):f&&(h?(()=>{const n=c.startsWith("bottom"),o=c.endsWith("end");t.style.top=n?`calc(anchor(bottom) + ${u}px)`:"auto",t.style.bottom=n?"auto":`calc(anchor(top) + ${u}px)`,t.style.left=o?"auto":"anchor(left)",t.style.right=o?"anchor(right)":"auto",t.style.setProperty("position-try-fallbacks","flip-block, flip-inline")})():l(t,f.getBoundingClientRect(),c,u,s)))},b=()=>{m&&null===g&&(g=r.requestAnimationFrame(v))},M=()=>{if(!m||null===d&&h)return y?.abort(),void(y=null);if(y)return;y=new AbortController;const t=y.signal;r.addEventListener("resize",b,{passive:!0,signal:t}),r.addEventListener("scroll",b,{passive:!0,capture:!0,signal:t}),r.visualViewport?.addEventListener("resize",b,{passive:!0,signal:t}),r.visualViewport?.addEventListener("scroll",b,{passive:!0,signal:t})};return w(f),{setAnchor(t){d=null,w(t),M(),b()},show(){d=null,m=!0,M(),i(t),v()},showAtPoint(n){d=n,m=!0,M(),i(t),v()},hide(){m=!1,d=null,M(),null!==g&&r.cancelAnimationFrame(g),g=null,e(t)},refresh:b,destroy(){m=!1,y?.abort(),y=null,null!==g&&r.cancelAnimationFrame(g),g=null,e(t),w(null)}}}function u(t=window){const n=t.visualViewport,o=n?.offsetLeft??0,a=n?.offsetTop??0,i=n?.width??t.innerWidth,e=n?.height??t.innerHeight;return{left:o,top:a,right:o+i,bottom:a+e,width:i,height:e}}function s(t,n){const o=Math.max(n.left-t.x,0,t.x-n.right),a=Math.max(n.top-t.y,0,t.y-n.bottom);return Math.hypot(o,a)}function h(t,n={}){const o=t.ownerDocument.defaultView??window,a=n.pointerTarget??t,i=n.anchorSelector??"[data-ui-affordance]",e=n.nearRadius??16,r=Number.isFinite(e)?Math.max(0,e):16,l=new AbortController;let c=[],u=null,h=null,p=!1;const f=()=>{for(const{element:t}of c)t.hasAttribute("data-ui-proximity")&&t.removeAttribute("data-ui-proximity");t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},d=()=>{c=Array.from(t.querySelectorAll(i)).filter((t=>!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-disabled"))).map((t=>({element:t,rect:t.getBoundingClientRect()}))),p=!1},m=()=>{if(u=null,p&&d(),!h)return void f();let n=!1;for(const t of c){const o=s(h,t.rect)<=r;o&&"near"!==t.element.getAttribute("data-ui-proximity")?t.element.setAttribute("data-ui-proximity","near"):!o&&t.element.hasAttribute("data-ui-proximity")&&t.element.removeAttribute("data-ui-proximity"),n||=o}n&&"engaged"!==t.getAttribute("data-ui-interaction")?t.setAttribute("data-ui-interaction","engaged"):!n&&t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},g=()=>{null===u&&(u=o.requestAnimationFrame(m))},y=()=>{p=!0,g()};return a.addEventListener("pointermove",(t=>{h="touch"===t.pointerType?null:{x:t.clientX,y:t.clientY},g()}),{passive:!0,signal:l.signal}),o.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.addEventListener("scroll",y,{passive:!0,capture:!0,signal:l.signal}),o.visualViewport?.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.visualViewport?.addEventListener("scroll",y,{passive:!0,signal:l.signal}),d(),{refresh:y,destroy(){l.abort(),null!==u&&o.cancelAnimationFrame(u),u=null,h=null,f(),c=[]}}}export{t as D,c as a,r as b,h as c}