@threadlabs/looma 0.2.0 → 0.2.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/{chunk-JXSHRMYW.js → chunk-WW7Y67EW.js} +32 -32
- package/dist/{chunk-M7FPK6GN.js → chunk-Z4W5W53T.js} +19 -1
- package/dist/cjs/{positioning-D5q9DM-0.js → positioning-BiPpyC-_.js} +26 -0
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/ui-combobox.cjs.entry.js +1 -1
- package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-popover.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +1 -1
- package/dist/collection/overlay/positioning.js +26 -0
- package/dist/components/p-BOC_l2hE.js +1 -0
- package/dist/components/{p-DWN2m6ta.js → p-Btk_75st.js} +1 -1
- package/dist/components/{p-DYiNETk6.js → p-biKnomFl.js} +1 -1
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-combobox.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/esm/{positioning-Drmwg-C1.js → positioning-Ig1jYhE1.js} +26 -0
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-chip_2.entry.js +1 -1
- package/dist/esm/ui-combobox.entry.js +1 -1
- package/dist/esm/ui-context-menu.entry.js +1 -1
- package/dist/esm/ui-menu.entry.js +1 -1
- package/dist/esm/ui-popover.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +1 -1
- package/dist/index.cjs +45 -10
- package/dist/index.js +18 -1
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/{p-32c85198.entry.js → p-08c9e253.entry.js} +1 -1
- package/dist/looma/{p-37ec2b4b.entry.js → p-0fa7062f.entry.js} +1 -1
- package/dist/looma/{p-d46317e0.entry.js → p-172d67ff.entry.js} +1 -1
- package/dist/looma/{p-5cbbf7a0.entry.js → p-3fba3edd.entry.js} +1 -1
- package/dist/looma/p-4354f48f.entry.js +1 -0
- package/dist/looma/{p-55e06e2e.entry.js → p-7ebbe74e.entry.js} +1 -1
- package/dist/looma/p-Ig1jYhE1.js +1 -0
- package/dist/looma/{p-b6fb6ba3.entry.js → p-ec1c02e5.entry.js} +1 -1
- package/dist/{ui-affordance-scope.entry-VR7FLAWG.js → ui-affordance-scope.entry-FENYADN3.js} +2 -2
- package/dist/{ui-avatar-group.entry-L3UKOY3U.js → ui-avatar-group.entry-K7D6QKDP.js} +1 -1
- package/dist/{ui-avatar.entry-VM5OHEFQ.js → ui-avatar.entry-WCYFUQZT.js} +1 -1
- package/dist/{ui-badge.entry-ZTM4OPUD.js → ui-badge.entry-VZC4LONR.js} +1 -1
- package/dist/{ui-button.entry-CIPUSV5B.js → ui-button.entry-7E2KMPRF.js} +1 -1
- package/dist/{ui-callout.entry-OBFCI2O7.js → ui-callout.entry-7WXQ47S6.js} +1 -1
- package/dist/{ui-checkbox.entry-XT6ET56H.js → ui-checkbox.entry-GTSEB7ZS.js} +1 -1
- package/dist/{ui-chip_2.entry-32SHCLV6.js → ui-chip_2.entry-PG24H67I.js} +2 -2
- package/dist/{ui-combobox.entry-ONBBPQ2C.js → ui-combobox.entry-NTCOCZOH.js} +2 -2
- package/dist/{ui-context-menu.entry-RXNUOK24.js → ui-context-menu.entry-7GSDWHTP.js} +2 -2
- package/dist/{ui-dialog.entry-IJXNUARC.js → ui-dialog.entry-F53O6FBQ.js} +1 -1
- package/dist/{ui-disclosure.entry-5QS7UDRH.js → ui-disclosure.entry-YWJA42GQ.js} +1 -1
- package/dist/{ui-editable.entry-D7LOQN2H.js → ui-editable.entry-3QPCWDPM.js} +1 -1
- package/dist/{ui-floating-action-button.entry-XQZCTZQT.js → ui-floating-action-button.entry-L4UC6RFM.js} +1 -1
- package/dist/{ui-form-field.entry-A654LJZE.js → ui-form-field.entry-2VCITLQA.js} +1 -1
- package/dist/{ui-icon-button.entry-MJ7F7ZIH.js → ui-icon-button.entry-MRRA6NVP.js} +1 -1
- package/dist/{ui-input.entry-B2XM7JQU.js → ui-input.entry-7LYLUJNT.js} +1 -1
- package/dist/{ui-menu-item.entry-JULYSFVW.js → ui-menu-item.entry-YHSIKO5W.js} +1 -1
- package/dist/{ui-menu.entry-ORRWW7HD.js → ui-menu.entry-ZQBF7B4T.js} +2 -2
- package/dist/{ui-popover.entry-W67V4UPA.js → ui-popover.entry-2HG5ZWQX.js} +2 -2
- package/dist/{ui-radio-group.entry-KCFOR27M.js → ui-radio-group.entry-A6LI3KHW.js} +1 -1
- package/dist/{ui-radio.entry-I2P4V5E3.js → ui-radio.entry-WBCZZG5D.js} +1 -1
- package/dist/{ui-search-result-row.entry-GHODLSLR.js → ui-search-result-row.entry-P25POOYP.js} +1 -1
- package/dist/{ui-search-shell.entry-PDB5UN4B.js → ui-search-shell.entry-R6IVRPSW.js} +1 -1
- package/dist/{ui-select.entry-D3CZHCKB.js → ui-select.entry-CAAGCELJ.js} +1 -1
- package/dist/{ui-switch.entry-WUDRL4H5.js → ui-switch.entry-SKU445KH.js} +1 -1
- package/dist/{ui-tabs.entry-MW64GKIJ.js → ui-tabs.entry-7BQPZEH3.js} +1 -1
- package/dist/{ui-textarea.entry-VHRBYY6G.js → ui-textarea.entry-OFC4YUU7.js} +1 -1
- package/dist/{ui-toast-region.entry-ET75RWYP.js → ui-toast-region.entry-7VNTFVDO.js} +2 -2
- package/dist/{ui-top-bar.entry-QIYA3LD3.js → ui-top-bar.entry-2N3EKMVF.js} +1 -1
- package/dist/{ui-tree-item.entry-BDB7VEUS.js → ui-tree-item.entry-SLHAE42A.js} +1 -1
- package/dist/{ui-tree.entry-GSC7BPRN.js → ui-tree.entry-LF45JUC4.js} +1 -1
- package/package.json +1 -1
- package/dist/components/p-Drw41pSY.js +0 -1
- package/dist/looma/p-56dac38a.entry.js +0 -1
- package/dist/looma/p-Drmwg-C1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,h as o,c as s,t as r}from"./p-Bh_1GxOD.js";import{o as i,c as a,r as n}from"./p-C-0syqXZ.js";import{d as p}from"./p-JwSoedEO.js";import{i as c,c as h}from"./p-BnGhGgTH.js";import{c as d}from"./p-
|
|
1
|
+
import{p as e,H as t,h as o,c as s,t as r}from"./p-Bh_1GxOD.js";import{o as i,c as a,r as n}from"./p-C-0syqXZ.js";import{d as p}from"./p-JwSoedEO.js";import{i as c,c as h}from"./p-BnGhGgTH.js";import{c as d}from"./p-BOC_l2hE.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}get host(){return this}open;defaultOpen=!1;for;placement="bottom-start";internalOpen=!1;overlayId="ui-popover-"+Math.random().toString(36).slice(2,11);anchor=null;surface=null;syncFromProp(){c(this.open)&&(this.internalOpen=this.open)}onOpenChange(){this.syncOverlay(),this.internalOpen?p(this.host,"open",{open:!0,reason:"programmatic",trigger:"programmatic"}):p(this.host,"close",{open:!1,reason:"programmatic",trigger:"programmatic"})}resetSurface(){this.setupSurface(),this.syncSurface()}setupSurface(){this.surface?.destroy(),this.surface=null,this.anchor=this.for?this.host.ownerDocument.getElementById(this.for):null,this.anchor&&(this.surface=d(this.host,{anchor:this.anchor,placement:this.placement}))}syncSurface(){this.surface&&(this.internalOpen?this.surface.show():this.surface.hide())}syncOverlay(){this.syncSurface(),this.internalOpen?i({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.anchor?[this.anchor]:void 0,dismissible:!0,requestClose:(e,t)=>this.handleRequestClose(e,t)}):a(this.overlayId)}componentDidLoad(){this.internalOpen=h(this.open,this.defaultOpen),this.host.addEventListener("keydown",this.onKeydown),this.setupSurface(),this.syncOverlay()}disconnectedCallback(){this.host.removeEventListener("keydown",this.onKeydown),this.surface?.destroy(),this.surface=null,a(this.overlayId)}componentDidUpdate(){this.syncOverlay()}handleRequestClose(e,t){c(this.open)||(this.internalOpen=!1),p(this.host,"close",{open:!1,reason:e,trigger:t})}onKeydown=e=>{"Escape"===e.key&&n("escape","keyboard")};render(){return o(s,{key:"65a0927abc40450205989704bfde2cf7fd80d1f9","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},o("div",{key:"255acaf99e0fe70a92048351b24bdfde1a4ea45f",class:"popover__surface"},o("slot",{key:"9d2f6c9d5a0f7a2766225aef0ec5b98b33ec9f07"})))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}}static get style(){return":host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);box-sizing:border-box;max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.popover__surface{box-sizing:border-box;max-inline-size:inherit;max-block-size:inherit;overflow:auto;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;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}}"}},[769,"ui-popover",{open:[4],defaultOpen:[4,"default-open"],for:[1],placement:[1],internalOpen:[32]},void 0,{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}]),u=l,m=function(){"undefined"!=typeof customElements&&["ui-popover"].forEach((e=>{"ui-popover"===e&&(customElements.get(r(e))||customElements.define(r(e),l))}))};export{u as UiPopover,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,h as i,c as e,t as a}from"./p-Bh_1GxOD.js";import{d as r,e as o}from"./p-JwSoedEO.js";import{b as n}from"./p-
|
|
1
|
+
import{p as t,H as s,h as i,c as e,t as a}from"./p-Bh_1GxOD.js";import{d as r,e as o}from"./p-JwSoedEO.js";import{b as n}from"./p-BOC_l2hE.js";const c=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get host(){return this}open=!0;internalOpen=!1;surface=null;contentObserver=null;pendingDismiss=null;syncFromProp(){this.syncContents()}syncSurface(){this.internalOpen?this.surface?.show():this.surface?.hide()}componentDidLoad(){this.surface=n(this.host),this.contentObserver=new MutationObserver(this.syncContents),this.contentObserver.observe(this.host,{childList:!0,subtree:!0}),this.syncContents(),this.syncSurface(),this.host.addEventListener("click",this.onClick)}disconnectedCallback(){this.host.removeEventListener("click",this.onClick),this.contentObserver?.disconnect(),this.contentObserver=null,this.surface?.destroy(),this.surface=null}getToasts(){return Array.from(this.host.querySelectorAll("[data-ui-toast]"))}syncContents=()=>{const t=this.open&&this.getToasts().length>0,s=this.internalOpen,i=this.pendingDismiss&&!this.host.contains(this.pendingDismiss.toast)?this.pendingDismiss:null;this.internalOpen=t,s&&!t&&i&&r(this.host,"close",{open:!1,reason:"action",trigger:i.trigger}),!i&&this.open||(this.pendingDismiss=null)};onClick=t=>{const s=t.target.closest?.("[data-ui-toast-dismiss]");if(!s)return;const i=s.closest?.("[data-ui-toast]");if(!i)return;const e=i.id??"",a=o(t);this.pendingDismiss={toast:i,trigger:a},r(this.host,"dismiss",{id:e,reason:"action",trigger:a})};render(){return i(e,{key:"9f9c2e14150c631c0f7cb427c693dcd52c20897d",role:"region","aria-label":"Notifications","aria-live":"polite","data-open":this.internalOpen?"":void 0},i("slot",{key:"9e1d9ebb6b587afab2c4302241cecb03a321cee1"}))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{syncSurface:0}]}}static get style(){return":host{position:fixed;top:calc(var(--ui-space-4) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:9999;display:grid;gap:var(--ui-space-2);inline-size:min(24rem, calc(100vw - (var(--ui-space-4) * 2)));max-inline-size:100%;pointer-events:none}:host([popover]){right:auto;bottom:auto;margin:0}:host>*{pointer-events:auto}::slotted([data-ui-toast]){display:grid;grid-template-columns:1fr auto;gap:var(--ui-space-2);align-items:start;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);padding:var(--ui-space-3) var(--ui-space-4);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-lg);animation:ui-toast-enter 0.25s var(--ui-motion-ease) forwards}@keyframes ui-toast-enter{from{opacity:0;transform:translateY(-0.5rem)}to{opacity:1;transform:translateY(0)}}::slotted([data-ui-toast][aria-hidden='true']){display:none}::slotted([data-ui-toast-dismiss]){border:0;background:transparent;color:var(--ui-text-secondary);cursor:pointer;font:inherit}"}},[769,"ui-toast-region",{open:[4],internalOpen:[32]},void 0,{open:[{syncFromProp:0}],internalOpen:[{syncSurface:0}]}]),u=c,l=function(){"undefined"!=typeof customElements&&["ui-toast-region"].forEach((t=>{"ui-toast-region"===t&&(customElements.get(a(t))||customElements.define(a(t),c))}))};export{u as UiToastRegion,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{U as
|
|
1
|
+
import{U as s,d as t}from"./p-Btk_75st.js";const o=s,p=t;export{o as UiTooltip,p as defineCustomElement}
|
|
@@ -131,6 +131,22 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
131
131
|
let open = false;
|
|
132
132
|
let frame = null;
|
|
133
133
|
let listenerAbort = null;
|
|
134
|
+
let sizeObserver = null;
|
|
135
|
+
// The surface can enter the top layer before its content has laid out (a
|
|
136
|
+
// menu's items, a tooltip's text), so its measured size is briefly zero or
|
|
137
|
+
// stale and the viewport clamp would run against the wrong geometry. Re-run
|
|
138
|
+
// positioning whenever the surface's own size settles.
|
|
139
|
+
const ResizeObserverImpl = owner.ResizeObserver;
|
|
140
|
+
const observeSurfaceSize = () => {
|
|
141
|
+
if (sizeObserver || typeof ResizeObserverImpl !== "function")
|
|
142
|
+
return;
|
|
143
|
+
sizeObserver = new ResizeObserverImpl(() => schedule());
|
|
144
|
+
sizeObserver.observe(surface);
|
|
145
|
+
};
|
|
146
|
+
const stopObservingSurfaceSize = () => {
|
|
147
|
+
sizeObserver?.disconnect();
|
|
148
|
+
sizeObserver = null;
|
|
149
|
+
};
|
|
134
150
|
surface.setAttribute("popover", "manual");
|
|
135
151
|
surface.dataset.uiPositioning = nativeAnchor ? "anchor" : "fallback";
|
|
136
152
|
surface.style.position = "fixed";
|
|
@@ -217,6 +233,12 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
217
233
|
syncFallbackListeners();
|
|
218
234
|
showInTopLayer(surface);
|
|
219
235
|
position();
|
|
236
|
+
// The surface has just entered the top layer and may not be laid out yet,
|
|
237
|
+
// so the first position() can measure a zero/stale size and skip the
|
|
238
|
+
// viewport clamp. Re-position on the next frame, and keep re-positioning
|
|
239
|
+
// while the surface's own size settles as its content renders.
|
|
240
|
+
schedule();
|
|
241
|
+
observeSurfaceSize();
|
|
220
242
|
},
|
|
221
243
|
showAtPoint(nextPoint) {
|
|
222
244
|
point = nextPoint;
|
|
@@ -224,11 +246,14 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
224
246
|
syncFallbackListeners();
|
|
225
247
|
showInTopLayer(surface);
|
|
226
248
|
position();
|
|
249
|
+
schedule();
|
|
250
|
+
observeSurfaceSize();
|
|
227
251
|
},
|
|
228
252
|
hide() {
|
|
229
253
|
open = false;
|
|
230
254
|
point = null;
|
|
231
255
|
syncFallbackListeners();
|
|
256
|
+
stopObservingSurfaceSize();
|
|
232
257
|
if (frame !== null)
|
|
233
258
|
owner.cancelAnimationFrame(frame);
|
|
234
259
|
frame = null;
|
|
@@ -239,6 +264,7 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
239
264
|
open = false;
|
|
240
265
|
listenerAbort?.abort();
|
|
241
266
|
listenerAbort = null;
|
|
267
|
+
stopObservingSurfaceSize();
|
|
242
268
|
if (frame !== null)
|
|
243
269
|
owner.cancelAnimationFrame(frame);
|
|
244
270
|
frame = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
-
import { D as DEFAULT_AFFORDANCE_NEAR_RADIUS, c as createProximityCoordinator } from './positioning-
|
|
2
|
+
import { D as DEFAULT_AFFORDANCE_NEAR_RADIUS, c as createProximityCoordinator } from './positioning-Ig1jYhE1.js';
|
|
3
3
|
|
|
4
4
|
const uiAffordanceScopeCss = () => `:host{display:contents;--ui-affordance-scope-engaged:0}:host([data-ui-interaction='engaged']){--ui-affordance-scope-engaged:1}`;
|
|
5
5
|
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, H as Host, c as createEvent, g as getElement
|
|
|
2
2
|
import { o as openOverlay, c as closeOverlay } from './manager-C-0syqXZ.js';
|
|
3
3
|
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
4
|
import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
|
|
5
|
-
import { a as createAnchoredSurface } from './positioning-
|
|
5
|
+
import { a as createAnchoredSurface } from './positioning-Ig1jYhE1.js';
|
|
6
6
|
|
|
7
7
|
const uiChipCss = () => `:host{--ui-chip-surface:var(--ui-surface-subtle);--ui-chip-text:var(--ui-text-secondary);--ui-chip-border:var(--ui-border-default);--ui-chip-font-size:var(--ui-font-size-xs);--ui-chip-font-weight:var(--ui-font-normal);--ui-chip-line-height:var(--ui-line-height-tight);--ui-chip-padding-block:var(--ui-space-0-5);--ui-chip-padding-inline:var(--ui-space-2);--ui-chip-notch:var(--ui-space-1);display:inline-flex;min-width:0;max-width:100%}:host([data-size='sm']){--ui-chip-font-size:var(--ui-font-size-sm)}.chip__surface{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;max-width:100%;padding:var(--ui-chip-padding-block) var(--ui-chip-padding-inline);border:1px solid var(--ui-chip-border);background:var(--ui-chip-surface);color:var(--ui-chip-text) !important;font-family:var(--ui-font-family-sans) !important;font-size:var(--ui-chip-font-size) !important;font-weight:var(--ui-chip-font-weight) !important;line-height:var(--ui-chip-line-height) !important}.chip__label{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-appearance='pill']) .chip__surface{border-radius:var(--ui-radius-round)}:host([data-appearance='tag']) .chip__surface{border:0;padding-inline-end:calc(var(--ui-chip-padding-inline) + var(--ui-chip-notch));clip-path:polygon(0 0, calc(100% - var(--ui-chip-notch)) 0, 100% 50%, calc(100% - var(--ui-chip-notch)) 100%, 0 100%)}`;
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
-
import { a as createAnchoredSurface } from './positioning-
|
|
2
|
+
import { a as createAnchoredSurface } from './positioning-Ig1jYhE1.js';
|
|
3
3
|
import { c as closeOverlay, o as openOverlay } from './manager-C-0syqXZ.js';
|
|
4
4
|
|
|
5
5
|
/** Formatting is additive: every original character must survive in order.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
2
|
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
|
|
3
3
|
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
|
-
import { a as createAnchoredSurface } from './positioning-
|
|
4
|
+
import { a as createAnchoredSurface } from './positioning-Ig1jYhE1.js';
|
|
5
5
|
|
|
6
6
|
const uiContextMenuCss = () => `:host{display:contents}:host([data-focus-trigger='pointer']) ::slotted(ui-menu-item:focus){outline:none}.menu{position:fixed;inset:auto;margin:0;z-index:var(--ui-z-overlay, 1000);min-width:12rem;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}.menu:popover-open{opacity:1;transform:translateY(0) scale(1)}@starting-style{.menu:popover-open{opacity:0;transform:translateY(-4px) scale(0.99)}}.menu[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){.menu{transition:none}}`;
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, g as getElement, h, H as Host } from './index-8B
|
|
|
2
2
|
import { d as dispatchDetail, e as eventToTrigger } from './events-JwSoedEO.js';
|
|
3
3
|
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
|
|
4
4
|
import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
|
|
5
|
-
import { a as createAnchoredSurface } from './positioning-
|
|
5
|
+
import { a as createAnchoredSurface } from './positioning-Ig1jYhE1.js';
|
|
6
6
|
|
|
7
7
|
const uiMenuCss = () => `: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:none;overflow:visible}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;max-inline-size:inherit;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg);max-block-size:inherit;overflow:auto}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:visible;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%}`;
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, g as getElement, h, H as Host } from './index-8B
|
|
|
2
2
|
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
|
|
3
3
|
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
4
|
import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
|
|
5
|
-
import { a as createAnchoredSurface } from './positioning-
|
|
5
|
+
import { a as createAnchoredSurface } from './positioning-Ig1jYhE1.js';
|
|
6
6
|
|
|
7
7
|
const uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);box-sizing:border-box;max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.popover__surface{box-sizing:border-box;max-inline-size:inherit;max-block-size:inherit;overflow:auto;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;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}}`;
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
2
|
import { d as dispatchDetail, e as eventToTrigger } from './events-JwSoedEO.js';
|
|
3
|
-
import { b as createViewportSurface } from './positioning-
|
|
3
|
+
import { b as createViewportSurface } from './positioning-Ig1jYhE1.js';
|
|
4
4
|
|
|
5
5
|
const uiToastRegionCss = () => `:host{position:fixed;top:calc(var(--ui-space-4) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:9999;display:grid;gap:var(--ui-space-2);inline-size:min(24rem, calc(100vw - (var(--ui-space-4) * 2)));max-inline-size:100%;pointer-events:none}:host([popover]){right:auto;bottom:auto;margin:0}:host>*{pointer-events:auto}::slotted([data-ui-toast]){display:grid;grid-template-columns:1fr auto;gap:var(--ui-space-2);align-items:start;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);padding:var(--ui-space-3) var(--ui-space-4);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-lg);animation:ui-toast-enter 0.25s var(--ui-motion-ease) forwards}@keyframes ui-toast-enter{from{opacity:0;transform:translateY(-0.5rem)}to{opacity:1;transform:translateY(0)}}::slotted([data-ui-toast][aria-hidden='true']){display:none}::slotted([data-ui-toast-dismiss]){border:0;background:transparent;color:var(--ui-text-secondary);cursor:pointer;font:inherit}`;
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
};
|
|
25
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
26
|
|
|
27
|
-
// dist/esm/positioning-
|
|
27
|
+
// dist/esm/positioning-Ig1jYhE1.js
|
|
28
28
|
function bindAnchorName(anchor, name) {
|
|
29
29
|
const binding = anchorBindings.get(anchor) ?? {
|
|
30
30
|
original: anchor.style.getPropertyValue("anchor-name"),
|
|
@@ -129,6 +129,18 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
129
129
|
let open = false;
|
|
130
130
|
let frame = null;
|
|
131
131
|
let listenerAbort = null;
|
|
132
|
+
let sizeObserver = null;
|
|
133
|
+
const ResizeObserverImpl = owner.ResizeObserver;
|
|
134
|
+
const observeSurfaceSize = () => {
|
|
135
|
+
if (sizeObserver || typeof ResizeObserverImpl !== "function")
|
|
136
|
+
return;
|
|
137
|
+
sizeObserver = new ResizeObserverImpl(() => schedule());
|
|
138
|
+
sizeObserver.observe(surface);
|
|
139
|
+
};
|
|
140
|
+
const stopObservingSurfaceSize = () => {
|
|
141
|
+
sizeObserver?.disconnect();
|
|
142
|
+
sizeObserver = null;
|
|
143
|
+
};
|
|
132
144
|
surface.setAttribute("popover", "manual");
|
|
133
145
|
surface.dataset.uiPositioning = nativeAnchor ? "anchor" : "fallback";
|
|
134
146
|
surface.style.position = "fixed";
|
|
@@ -214,6 +226,8 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
214
226
|
syncFallbackListeners();
|
|
215
227
|
showInTopLayer(surface);
|
|
216
228
|
position();
|
|
229
|
+
schedule();
|
|
230
|
+
observeSurfaceSize();
|
|
217
231
|
},
|
|
218
232
|
showAtPoint(nextPoint) {
|
|
219
233
|
point = nextPoint;
|
|
@@ -221,11 +235,14 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
221
235
|
syncFallbackListeners();
|
|
222
236
|
showInTopLayer(surface);
|
|
223
237
|
position();
|
|
238
|
+
schedule();
|
|
239
|
+
observeSurfaceSize();
|
|
224
240
|
},
|
|
225
241
|
hide() {
|
|
226
242
|
open = false;
|
|
227
243
|
point = null;
|
|
228
244
|
syncFallbackListeners();
|
|
245
|
+
stopObservingSurfaceSize();
|
|
229
246
|
if (frame !== null)
|
|
230
247
|
owner.cancelAnimationFrame(frame);
|
|
231
248
|
frame = null;
|
|
@@ -236,6 +253,7 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
236
253
|
open = false;
|
|
237
254
|
listenerAbort?.abort();
|
|
238
255
|
listenerAbort = null;
|
|
256
|
+
stopObservingSurfaceSize();
|
|
239
257
|
if (frame !== null)
|
|
240
258
|
owner.cancelAnimationFrame(frame);
|
|
241
259
|
frame = null;
|
|
@@ -361,8 +379,8 @@ function createProximityCoordinator(scope, options = {}) {
|
|
|
361
379
|
};
|
|
362
380
|
}
|
|
363
381
|
var DEFAULT_AFFORDANCE_NEAR_RADIUS, anchorSequence, anchorBindings;
|
|
364
|
-
var
|
|
365
|
-
"dist/esm/positioning-
|
|
382
|
+
var init_positioning_Ig1jYhE1 = __esm({
|
|
383
|
+
"dist/esm/positioning-Ig1jYhE1.js"() {
|
|
366
384
|
DEFAULT_AFFORDANCE_NEAR_RADIUS = 16;
|
|
367
385
|
anchorSequence = 0;
|
|
368
386
|
anchorBindings = /* @__PURE__ */ new WeakMap();
|
|
@@ -378,7 +396,7 @@ var uiAffordanceScopeCss, UIAffordanceScope;
|
|
|
378
396
|
var init_ui_affordance_scope_entry = __esm({
|
|
379
397
|
"dist/esm/ui-affordance-scope.entry.js"() {
|
|
380
398
|
init_index_8BGiMGQ0();
|
|
381
|
-
|
|
399
|
+
init_positioning_Ig1jYhE1();
|
|
382
400
|
uiAffordanceScopeCss = () => `:host{display:contents;--ui-affordance-scope-engaged:0}:host([data-ui-interaction='engaged']){--ui-affordance-scope-engaged:1}`;
|
|
383
401
|
UIAffordanceScope = class {
|
|
384
402
|
constructor(hostRef) {
|
|
@@ -1220,7 +1238,7 @@ var init_ui_chip_2_entry = __esm({
|
|
|
1220
1238
|
init_manager_C_0syqXZ();
|
|
1221
1239
|
init_events_JwSoedEO();
|
|
1222
1240
|
init_controlled_state_BnGhGgTH();
|
|
1223
|
-
|
|
1241
|
+
init_positioning_Ig1jYhE1();
|
|
1224
1242
|
uiChipCss = () => `:host{--ui-chip-surface:var(--ui-surface-subtle);--ui-chip-text:var(--ui-text-secondary);--ui-chip-border:var(--ui-border-default);--ui-chip-font-size:var(--ui-font-size-xs);--ui-chip-font-weight:var(--ui-font-normal);--ui-chip-line-height:var(--ui-line-height-tight);--ui-chip-padding-block:var(--ui-space-0-5);--ui-chip-padding-inline:var(--ui-space-2);--ui-chip-notch:var(--ui-space-1);display:inline-flex;min-width:0;max-width:100%}:host([data-size='sm']){--ui-chip-font-size:var(--ui-font-size-sm)}.chip__surface{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;max-width:100%;padding:var(--ui-chip-padding-block) var(--ui-chip-padding-inline);border:1px solid var(--ui-chip-border);background:var(--ui-chip-surface);color:var(--ui-chip-text) !important;font-family:var(--ui-font-family-sans) !important;font-size:var(--ui-chip-font-size) !important;font-weight:var(--ui-chip-font-weight) !important;line-height:var(--ui-chip-line-height) !important}.chip__label{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-appearance='pill']) .chip__surface{border-radius:var(--ui-radius-round)}:host([data-appearance='tag']) .chip__surface{border:0;padding-inline-end:calc(var(--ui-chip-padding-inline) + var(--ui-chip-notch));clip-path:polygon(0 0, calc(100% - var(--ui-chip-notch)) 0, 100% 50%, calc(100% - var(--ui-chip-notch)) 100%, 0 100%)}`;
|
|
1225
1243
|
UIChip = class {
|
|
1226
1244
|
constructor(hostRef) {
|
|
@@ -1535,7 +1553,7 @@ var uiComboboxCss, UICombobox;
|
|
|
1535
1553
|
var init_ui_combobox_entry = __esm({
|
|
1536
1554
|
"dist/esm/ui-combobox.entry.js"() {
|
|
1537
1555
|
init_index_8BGiMGQ0();
|
|
1538
|
-
|
|
1556
|
+
init_positioning_Ig1jYhE1();
|
|
1539
1557
|
init_manager_C_0syqXZ();
|
|
1540
1558
|
uiComboboxCss = () => `:host{display:grid;gap:var(--ui-space-1);min-inline-size:0;color:var(--ui-text-primary);font:inherit}label{color:var(--ui-field-label-color, var(--ui-text-primary));font-size:var(--ui-field-label-size, 0.875rem);font-weight:var(--ui-field-label-weight, 500)}.field{display:flex;min-inline-size:0;border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default))}.field:focus-within{border-color:var(--ui-control-focus, var(--ui-focus-ring));outline:2px solid var(--ui-control-focus, var(--ui-focus-ring));outline-offset:1px}input{appearance:none;width:100%;min-inline-size:0;min-block-size:var(--ui-control-min-block-size, 2.75rem);box-sizing:border-box;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;outline:none}:host([data-size='sm']) input{min-block-size:var(--ui-field-compact-size, 2rem);padding:var(--ui-space-1) var(--ui-space-2)}button{appearance:none;border:0;border-radius:var(--ui-radius-2);background:transparent;color:var(--ui-field-affordance-color, var(--ui-text-secondary));font:inherit;font-weight:var(--ui-field-affordance-weight, 400);min-inline-size:2rem;padding:var(--ui-space-1);cursor:pointer}button:hover:enabled{background:var(--ui-surface-muted);color:var(--ui-text-primary)}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-3px}input:disabled,button:disabled{color:var(--ui-text-muted);cursor:not-allowed}.field:has(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted))}:host([data-validation='error']) .field{border-color:var(--ui-danger-solid, var(--ui-accent-active))}.popup{box-sizing:border-box;min-inline-size:12rem;max-inline-size:calc(100vw - 1rem);max-block-size:var(--ui-combobox-max-block-size, 18rem);overflow:auto;margin:0;padding:var(--ui-space-1);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-md)}[hidden]{display:none !important}.option{padding:var(--ui-space-2) var(--ui-space-3);border-radius:var(--ui-radius-1);cursor:pointer;overflow-wrap:anywhere}.option:hover,.option[data-active]{background:var(--ui-surface-muted);outline:1px solid var(--ui-focus-ring);outline-offset:-1px}.option[aria-disabled='true']{color:var(--ui-text-muted);cursor:not-allowed}.primary{display:block;color:var(--ui-option-primary-color, var(--ui-text-primary));font-weight:var(--ui-option-primary-weight, 500)}.secondary{display:block;color:var(--ui-option-secondary-color, var(--ui-text-secondary));font-weight:var(--ui-option-secondary-weight, 400);font-size:var(--ui-font-size-sm)}.message,.group{color:var(--ui-field-message-color, var(--ui-text-secondary));font-weight:var(--ui-field-message-weight, 400);font-size:var(--ui-font-size-sm);line-height:var(--ui-line-height-md);overflow-wrap:anywhere}.group,.popup .message{padding:var(--ui-space-2) var(--ui-space-3)}.sr-only{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (pointer: coarse){button{min-inline-size:2.75rem;min-block-size:2.75rem}}@media (forced-colors: active){.field,.popup{border-color:CanvasText}.option[data-active]{outline-color:Highlight}}:host([multiple]) .field{flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}:host([multiple]) input{flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;min-inline-size:0;max-inline-size:min(100%, var(--ui-multi-combobox-item-max-inline-size, 12rem));overflow:hidden;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item>slot{display:block;min-inline-size:0;max-inline-size:100%;overflow:hidden}.item>slot::slotted(*){min-inline-size:0;max-inline-size:100%}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
|
|
1541
1559
|
UICombobox = class {
|
|
@@ -2192,7 +2210,7 @@ var init_ui_context_menu_entry = __esm({
|
|
|
2192
2210
|
init_index_8BGiMGQ0();
|
|
2193
2211
|
init_manager_C_0syqXZ();
|
|
2194
2212
|
init_events_JwSoedEO();
|
|
2195
|
-
|
|
2213
|
+
init_positioning_Ig1jYhE1();
|
|
2196
2214
|
uiContextMenuCss = () => `:host{display:contents}:host([data-focus-trigger='pointer']) ::slotted(ui-menu-item:focus){outline:none}.menu{position:fixed;inset:auto;margin:0;z-index:var(--ui-z-overlay, 1000);min-width:12rem;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}.menu:popover-open{opacity:1;transform:translateY(0) scale(1)}@starting-style{.menu:popover-open{opacity:0;transform:translateY(-4px) scale(0.99)}}.menu[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){.menu{transition:none}}`;
|
|
2197
2215
|
UIContextMenu = class {
|
|
2198
2216
|
constructor(hostRef) {
|
|
@@ -3117,7 +3135,7 @@ var init_ui_menu_entry = __esm({
|
|
|
3117
3135
|
init_events_JwSoedEO();
|
|
3118
3136
|
init_manager_C_0syqXZ();
|
|
3119
3137
|
init_controlled_state_BnGhGgTH();
|
|
3120
|
-
|
|
3138
|
+
init_positioning_Ig1jYhE1();
|
|
3121
3139
|
uiMenuCss = () => `: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:none;overflow:visible}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;max-inline-size:inherit;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg);max-block-size:inherit;overflow:auto}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:visible;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%}`;
|
|
3122
3140
|
UIMenu = class {
|
|
3123
3141
|
constructor(hostRef) {
|
|
@@ -3298,7 +3316,7 @@ var init_ui_popover_entry = __esm({
|
|
|
3298
3316
|
init_manager_C_0syqXZ();
|
|
3299
3317
|
init_events_JwSoedEO();
|
|
3300
3318
|
init_controlled_state_BnGhGgTH();
|
|
3301
|
-
|
|
3319
|
+
init_positioning_Ig1jYhE1();
|
|
3302
3320
|
uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);box-sizing:border-box;max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.popover__surface{box-sizing:border-box;max-inline-size:inherit;max-block-size:inherit;overflow:auto;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;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}}`;
|
|
3303
3321
|
UIPopover = class {
|
|
3304
3322
|
constructor(hostRef) {
|
|
@@ -4215,7 +4233,7 @@ var init_ui_toast_region_entry = __esm({
|
|
|
4215
4233
|
"dist/esm/ui-toast-region.entry.js"() {
|
|
4216
4234
|
init_index_8BGiMGQ0();
|
|
4217
4235
|
init_events_JwSoedEO();
|
|
4218
|
-
|
|
4236
|
+
init_positioning_Ig1jYhE1();
|
|
4219
4237
|
uiToastRegionCss = () => `:host{position:fixed;top:calc(var(--ui-space-4) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:9999;display:grid;gap:var(--ui-space-2);inline-size:min(24rem, calc(100vw - (var(--ui-space-4) * 2)));max-inline-size:100%;pointer-events:none}:host([popover]){right:auto;bottom:auto;margin:0}:host>*{pointer-events:auto}::slotted([data-ui-toast]){display:grid;grid-template-columns:1fr auto;gap:var(--ui-space-2);align-items:start;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);padding:var(--ui-space-3) var(--ui-space-4);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-lg);animation:ui-toast-enter 0.25s var(--ui-motion-ease) forwards}@keyframes ui-toast-enter{from{opacity:0;transform:translateY(-0.5rem)}to{opacity:1;transform:translateY(0)}}::slotted([data-ui-toast][aria-hidden='true']){display:none}::slotted([data-ui-toast-dismiss]){border:0;background:transparent;color:var(--ui-text-secondary);cursor:pointer;font:inherit}`;
|
|
4220
4238
|
UIToastRegion = class {
|
|
4221
4239
|
constructor(hostRef) {
|
|
@@ -6848,6 +6866,17 @@ function createAnchoredSurface2(surface, options = {}) {
|
|
|
6848
6866
|
let open = false;
|
|
6849
6867
|
let frame = null;
|
|
6850
6868
|
let listenerAbort = null;
|
|
6869
|
+
let sizeObserver = null;
|
|
6870
|
+
const ResizeObserverImpl = owner.ResizeObserver;
|
|
6871
|
+
const observeSurfaceSize = () => {
|
|
6872
|
+
if (sizeObserver || typeof ResizeObserverImpl !== "function") return;
|
|
6873
|
+
sizeObserver = new ResizeObserverImpl(() => schedule());
|
|
6874
|
+
sizeObserver.observe(surface);
|
|
6875
|
+
};
|
|
6876
|
+
const stopObservingSurfaceSize = () => {
|
|
6877
|
+
sizeObserver?.disconnect();
|
|
6878
|
+
sizeObserver = null;
|
|
6879
|
+
};
|
|
6851
6880
|
surface.setAttribute("popover", "manual");
|
|
6852
6881
|
surface.dataset.uiPositioning = nativeAnchor ? "anchor" : "fallback";
|
|
6853
6882
|
surface.style.position = "fixed";
|
|
@@ -6936,6 +6965,8 @@ function createAnchoredSurface2(surface, options = {}) {
|
|
|
6936
6965
|
syncFallbackListeners();
|
|
6937
6966
|
showInTopLayer2(surface);
|
|
6938
6967
|
position();
|
|
6968
|
+
schedule();
|
|
6969
|
+
observeSurfaceSize();
|
|
6939
6970
|
},
|
|
6940
6971
|
showAtPoint(nextPoint) {
|
|
6941
6972
|
point = nextPoint;
|
|
@@ -6943,11 +6974,14 @@ function createAnchoredSurface2(surface, options = {}) {
|
|
|
6943
6974
|
syncFallbackListeners();
|
|
6944
6975
|
showInTopLayer2(surface);
|
|
6945
6976
|
position();
|
|
6977
|
+
schedule();
|
|
6978
|
+
observeSurfaceSize();
|
|
6946
6979
|
},
|
|
6947
6980
|
hide() {
|
|
6948
6981
|
open = false;
|
|
6949
6982
|
point = null;
|
|
6950
6983
|
syncFallbackListeners();
|
|
6984
|
+
stopObservingSurfaceSize();
|
|
6951
6985
|
if (frame !== null) owner.cancelAnimationFrame(frame);
|
|
6952
6986
|
frame = null;
|
|
6953
6987
|
hideFromTopLayer2(surface);
|
|
@@ -6957,6 +6991,7 @@ function createAnchoredSurface2(surface, options = {}) {
|
|
|
6957
6991
|
open = false;
|
|
6958
6992
|
listenerAbort?.abort();
|
|
6959
6993
|
listenerAbort = null;
|
|
6994
|
+
stopObservingSurfaceSize();
|
|
6960
6995
|
if (frame !== null) owner.cancelAnimationFrame(frame);
|
|
6961
6996
|
frame = null;
|
|
6962
6997
|
hideFromTopLayer2(surface);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bootstrapLazy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WW7Y67EW.js";
|
|
4
4
|
|
|
5
5
|
// dist/esm/app-globals-DQuL1Twl.js
|
|
6
6
|
var globalScripts = () => {
|
|
@@ -241,6 +241,17 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
241
241
|
let open = false;
|
|
242
242
|
let frame = null;
|
|
243
243
|
let listenerAbort = null;
|
|
244
|
+
let sizeObserver = null;
|
|
245
|
+
const ResizeObserverImpl = owner.ResizeObserver;
|
|
246
|
+
const observeSurfaceSize = () => {
|
|
247
|
+
if (sizeObserver || typeof ResizeObserverImpl !== "function") return;
|
|
248
|
+
sizeObserver = new ResizeObserverImpl(() => schedule());
|
|
249
|
+
sizeObserver.observe(surface);
|
|
250
|
+
};
|
|
251
|
+
const stopObservingSurfaceSize = () => {
|
|
252
|
+
sizeObserver?.disconnect();
|
|
253
|
+
sizeObserver = null;
|
|
254
|
+
};
|
|
244
255
|
surface.setAttribute("popover", "manual");
|
|
245
256
|
surface.dataset.uiPositioning = nativeAnchor ? "anchor" : "fallback";
|
|
246
257
|
surface.style.position = "fixed";
|
|
@@ -329,6 +340,8 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
329
340
|
syncFallbackListeners();
|
|
330
341
|
showInTopLayer(surface);
|
|
331
342
|
position();
|
|
343
|
+
schedule();
|
|
344
|
+
observeSurfaceSize();
|
|
332
345
|
},
|
|
333
346
|
showAtPoint(nextPoint) {
|
|
334
347
|
point = nextPoint;
|
|
@@ -336,11 +349,14 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
336
349
|
syncFallbackListeners();
|
|
337
350
|
showInTopLayer(surface);
|
|
338
351
|
position();
|
|
352
|
+
schedule();
|
|
353
|
+
observeSurfaceSize();
|
|
339
354
|
},
|
|
340
355
|
hide() {
|
|
341
356
|
open = false;
|
|
342
357
|
point = null;
|
|
343
358
|
syncFallbackListeners();
|
|
359
|
+
stopObservingSurfaceSize();
|
|
344
360
|
if (frame !== null) owner.cancelAnimationFrame(frame);
|
|
345
361
|
frame = null;
|
|
346
362
|
hideFromTopLayer(surface);
|
|
@@ -350,6 +366,7 @@ function createAnchoredSurface(surface, options = {}) {
|
|
|
350
366
|
open = false;
|
|
351
367
|
listenerAbort?.abort();
|
|
352
368
|
listenerAbort = null;
|
|
369
|
+
stopObservingSurfaceSize();
|
|
353
370
|
if (frame !== null) owner.cancelAnimationFrame(frame);
|
|
354
371
|
frame = null;
|
|
355
372
|
hideFromTopLayer(surface);
|
package/dist/looma/looma.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-8BGiMGQ0.js";export{s as setNonce}from"./p-8BGiMGQ0.js";import{g as n}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,n={};return""!==a&&(n.resourcesUrl=new URL(".",a).href),e(n)})().then((async e=>(await n(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-8BGiMGQ0.js";export{s as setNonce}from"./p-8BGiMGQ0.js";import{g as n}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,n={};return""!==a&&(n.resourcesUrl=new URL(".",a).href),e(n)})().then((async e=>(await n(),a([["p-7ebbe74e",[[769,"ui-combobox",{label:[1],placeholder:[1],name:[1],value:[1],defaultValue:[1,"default-value"],multiple:[516],tokenSeparators:[16],query:[1],defaultQuery:[1,"default-query"],config:[16],disabled:[4],readOnly:[4,"readonly"],required:[4],size:[1],labelVisibility:[1,"label-visibility"],disclosure:[4],clearable:[4],help:[1],raw:[32],display:[32],selected:[32],expanded:[32],rows:[32],active:[32],loading:[32],helpOpen:[32],lookupError:[32],validation:[32],validate:[64],focusInput:[64]},null,{value:[{syncValue:0}],query:[{syncQuery:0}],disabled:[{syncDisabled:0}],readOnly:[{syncDisabled:0}],config:[{syncConfig:0}]}]]],["p-0fa7062f",[[769,"ui-context-menu",{open:[4],defaultOpen:[4,"default-open"],for:[1],internalOpen:[32],focusTrigger:[32]},null,{open:[{syncFromProp:0}],for:[{syncTarget:0}],internalOpen:[{syncOverlay:0}]}]]],["p-08c9e253",[[769,"ui-affordance-scope",{nearRadius:[514,"near-radius"]},null,{nearRadius:[{connectCoordinator:0}]}]]],["p-08f80207",[[513,"ui-avatar",{src:[1],alt:[1],name:[1],fallback:[1],hasImage:[32]},null,{src:[{watchSrc:0}]}]]],["p-d56571a2",[[769,"ui-avatar-group",{max:[2],label:[1],overflowCount:[32]},null,{max:[{syncOverflow:0}]}]]],["p-5fdcee1d",[[769,"ui-badge",{variant:[1],tone:[1]}]]],["p-7ab661ec",[[769,"ui-button",{variant:[1],size:[1],disabled:[4]},null,{variant:[{syncToButton:0}],size:[{syncToButton:0}],disabled:[{syncToButton:0}]}]]],["p-add67e4c",[[769,"ui-callout",{tone:[1]}]]],["p-9d2662ca",[[769,"ui-checkbox",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],indeterminate:[4],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}],internalChecked:[{syncToInput:0}],indeterminate:[{syncToInput:0}],disabled:[{syncToInput:0}],required:[{syncToInput:0}]}]]],["p-e604e906",[[769,"ui-dialog",{open:[4],defaultOpen:[4,"default-open"],modal:[4],dismissible:[4],label:[1],internalOpen:[32],accessibleLabel:[32]},null,{open:[{syncFromProp:0}],label:[{syncLabelFromProp:0}],internalOpen:[{syncOpen:0}]}]]],["p-2915d5c0",[[769,"ui-disclosure",{open:[4],defaultOpen:[4,"default-open"],disabled:[4],internalOpen:[32],contentId:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{syncState:0}]}]]],["p-22842f8c",[[769,"ui-editable",{edit:[4],defaultEdit:[4,"default-edit"],disabled:[4],internalEdit:[32]},null,{edit:[{syncFromProp:0}]}]]],["p-3f60f4c8",[[769,"ui-floating-action-button",{disabled:[516],mobileOnly:[516,"mobile-only"],label:[1]}]]],["p-3b2961a6",[[769,"ui-form-field",{invalid:[4],disabled:[4],required:[4]}]]],["p-b6ede6bb",[[769,"ui-icon-button",{disabled:[516],label:[1],size:[513],variant:[513],anticipatory:[516]}]]],["p-1c00670f",[[769,"ui-input",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],readOnly:[4,"readonly"],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToInput:0}],defaultValue:[{syncToInput:0}],disabled:[{syncToInput:0}],invalid:[{syncToInput:0}],readOnly:[{syncToInput:0}]}]]],["p-7c0b5364",[[769,"ui-menu-item",{disabled:[516],value:[1]}]]],["p-ec1c02e5",[[769,"ui-popover",{open:[4],defaultOpen:[4,"default-open"],for:[1],placement:[1],internalOpen:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}]]],["p-424d6719",[[769,"ui-radio",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],name:[1],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}],disabled:[{syncToInput:0}],name:[{syncToInput:0}],required:[{syncToInput:0}],value:[{syncToInput:0}]}]]],["p-d5c3954f",[[769,"ui-radio-group",{value:[1],name:[1],orientation:[1],disabled:[4],required:[4],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToRadios:0}],name:[{syncToRadios:0}],orientation:[{syncToRadios:0}],disabled:[{syncToRadios:0}]}]]],["p-9cfbf722",[[769,"ui-search-result-row",{disabled:[516],selected:[516],hasLeading:[32],hasMeta:[32],hasExcerpt:[32],hasTrailing:[32]}]]],["p-8bdd9495",[[769,"ui-search-shell",{hasStatus:[32],hasFooter:[32]}]]],["p-6f20d470",[[769,"ui-select",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],required:[4],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToSelect:0}],defaultValue:[{syncToSelect:0}],disabled:[{syncToSelect:0}],invalid:[{syncToSelect:0}],required:[{syncToSelect:0}]}]]],["p-d4825822",[[769,"ui-switch",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}]}]]],["p-d372b0db",[[769,"ui-tabs",{value:[1],defaultValue:[1,"default-value"],orientation:[1],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncState:0}],orientation:[{syncState:0}]}]]],["p-b76e2111",[[769,"ui-textarea",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],readOnly:[4,"readonly"],rows:[2],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToTextarea:0}],defaultValue:[{syncToTextarea:0}],disabled:[{syncToTextarea:0}],invalid:[{syncToTextarea:0}],readOnly:[{syncToTextarea:0}],rows:[{syncToTextarea:0}]}]]],["p-4354f48f",[[769,"ui-toast-region",{open:[4],internalOpen:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{syncSurface:0}]}]]],["p-1249a806",[[769,"ui-top-bar",{hasLeading:[32],hasSearch:[32],hasActions:[32]}]]],["p-f1f7c5cb",[[769,"ui-tree",{label:[1],hoverExpandDelay:[2,"hover-expand-delay"],maxDepth:[2,"max-depth"]}]]],["p-4caccfce",[[769,"ui-tree-item",{itemId:[1,"item-id"],label:[1],dropDepth:[2,"drop-depth"],subtreeDepth:[2,"subtree-depth"],container:[4],sortable:[4],dragType:[1,"drag-type"],dropScope:[1,"drop-scope"],accepts:[1],expanded:[4],defaultExpanded:[4,"default-expanded"],selected:[4],disabled:[4],internalExpanded:[32],structuralLevel:[32],tabStop:[32]},null,{expanded:[{syncExpandedFromProp:0}]}]]],["p-172d67ff",[[769,"ui-menu",{open:[4],defaultOpen:[4,"default-open"],for:[1],placement:[1],internalOpen:[32]},null,{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncSurface:0}]}]]],["p-3fba3edd",[[769,"ui-chip",{appearance:[1],size:[1]}],[769,"ui-tooltip",{for:[1],open:[4],defaultOpen:[4,"default-open"],placement:[1],showDelay:[2,"show-delay"],hideDelay:[2,"hide-delay"],toggleOnClick:[4,"toggle-on-click"],internalOpen:[32]},null,{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncOverlay:0}]}]]]],e))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as a,h as e,H as o}from"./p-8BGiMGQ0.js";import{D as s,c as n}from"./p-
|
|
1
|
+
import{r as t,g as a,h as e,H as o}from"./p-8BGiMGQ0.js";import{D as s,c as n}from"./p-Ig1jYhE1.js";const i=class{constructor(a){t(this,a)}get host(){return a(this)}nearRadius=s;coordinator=null;componentDidLoad(){this.connectCoordinator()}disconnectedCallback(){this.coordinator?.destroy(),this.coordinator=null}connectCoordinator(){this.coordinator?.destroy(),this.coordinator=n(this.host,{nearRadius:this.nearRadius})}onSlotChange=()=>{this.coordinator?.refresh()};render(){return e(o,{key:"f500fa48554ed6224efd2dbe9632880bf0a15a19"},e("slot",{key:"37c5c5b7925b260ff8f9edd411ee6c90a12a4909",onSlotchange:this.onSlotChange}))}static get watchers(){return{nearRadius:[{connectCoordinator:0}]}}};i.style=":host{display:contents;--ui-affordance-scope-engaged:0}:host([data-ui-interaction='engaged']){--ui-affordance-scope-engaged:1}";export{i as ui_affordance_scope}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as i,h as e,H as s}from"./p-8BGiMGQ0.js";import{o,c as n,r}from"./p-C-0syqXZ.js";import{d as a}from"./p-JwSoedEO.js";import{a as h}from"./p-
|
|
1
|
+
import{r as t,g as i,h as e,H as s}from"./p-8BGiMGQ0.js";import{o,c as n,r}from"./p-C-0syqXZ.js";import{d as a}from"./p-JwSoedEO.js";import{a as h}from"./p-Ig1jYhE1.js";const c=class{constructor(i){t(this,i)}get host(){return i(this)}open=!1;defaultOpen=!1;for;internalOpen=!1;focusTrigger="programmatic";overlayId=`ui-context-menu-${Math.random().toString(36).slice(2,11)}`;trigger=null;contextTarget=null;pointerX=0;pointerY=0;pointPositioned=!1;surface=null;syncFromProp(){this.internalOpen=this.open}syncTarget(){this.resolveTargets(),this.attachTargetListeners()}syncOverlay(){this.syncTriggerState(),this.internalOpen?(this.pointPositioned?this.surface?.showAtPoint({x:this.pointerX,y:this.pointerY}):this.surface?.show(),o({id:this.overlayId,modal:!1,element:this.host,dismissible:!0,requestClose:(t,i)=>this.closeMenu(t,i)})):(this.surface?.hide(),n(this.overlayId))}componentDidLoad(){this.syncFromProp(),this.internalOpen=this.internalOpen||this.defaultOpen,this.resolveTargets(),this.attachTargetListeners(),this.setupSurface(),this.syncTriggerState(),this.syncOverlay()}componentDidUpdate(){this.resolveTargets(),this.attachTargetListeners(),this.pointPositioned||this.surface?.setAnchor(this.trigger),this.syncTriggerState()}disconnectedCallback(){this.detachTargetListeners(),this.surface?.destroy(),this.surface=null,n(this.overlayId)}setupSurface(){const t=this.host.shadowRoot?.querySelector(".menu");t&&(this.surface?.destroy(),this.surface=h(t,{anchor:this.trigger,placement:"bottom-start"}))}resolveTargets(){const t=this.trigger,i=this.contextTarget,e=this.host.querySelector('[slot="trigger"]'),s=this.for?document.getElementById(this.for):null;this.trigger=e,this.contextTarget=s??e??this.host.parentElement,t===this.trigger&&i===this.contextTarget||(t?.removeEventListener("click",this.onTriggerClick),t?.removeEventListener("keydown",this.onTriggerKeydown),i?.removeEventListener("contextmenu",this.onContextMenu))}attachTargetListeners(){this.detachTargetListeners(),this.trigger?.addEventListener("click",this.onTriggerClick),this.trigger?.addEventListener("keydown",this.onTriggerKeydown),this.contextTarget?.addEventListener("contextmenu",this.onContextMenu)}detachTargetListeners(){this.trigger?.removeEventListener("click",this.onTriggerClick),this.trigger?.removeEventListener("keydown",this.onTriggerKeydown),this.contextTarget?.removeEventListener("contextmenu",this.onContextMenu)}syncTriggerState(){this.trigger&&(this.trigger.setAttribute("aria-haspopup","menu"),this.trigger.setAttribute("aria-expanded",this.internalOpen?"true":"false"))}getItems(){return Array.from(this.host.querySelectorAll("ui-menu-item")).filter((t=>!this.isItemDisabled(t)))}focusFirstItem(){requestAnimationFrame((()=>this.getItems()[0]?.focus()))}openMenu(t,i,e){this.pointerX=t,this.pointerY=i,this.focusTrigger=e,this.pointPositioned=!0,this.surface?.showAtPoint({x:t,y:i}),this.internalOpen=!0,a(this.host,"open",{open:!0,reason:"action",trigger:e}),this.focusFirstItem()}openFromTrigger(t){this.trigger&&(this.pointPositioned=!1,this.internalOpen=!0,a(this.host,"open",{open:!0,reason:"action",trigger:t}),this.focusFirstItem())}closeMenu(t,i,e=!0){this.internalOpen&&(this.internalOpen=!1,a(this.host,"close",{open:!1,reason:t,trigger:i}),e&&this.trigger?.focus())}onTriggerClick=t=>{this.internalOpen?this.closeMenu("action",0===t.detail?"keyboard":"pointer"):this.openFromTrigger(0===t.detail?"keyboard":"pointer")};onTriggerKeydown=t=>{"Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.internalOpen?this.focusFirstItem():this.openFromTrigger("keyboard"))};onContextMenu=t=>{t.preventDefault(),this.openMenu(t.clientX,t.clientY,"pointer")};isItemDisabled(t){return"true"===t.getAttribute("aria-disabled")||t.hasAttribute("disabled")||"true"===t.getAttribute("disabled")||!0===t.disabled}onKeydown=t=>{if(this.internalOpen){if(this.focusTrigger="keyboard","Escape"===t.key)return t.preventDefault(),void r("escape","keyboard");if("Enter"===t.key||" "===t.key){const i=t.target.closest?.("ui-menu-item");if(!i||this.isItemDisabled(i))return;t.preventDefault();const e=i.getAttribute("value")??i.getAttribute("data-value")??"";a(this.host,"select",{value:e,trigger:"keyboard"}),this.closeMenu("action","keyboard")}}};onItemClick=t=>{const i=t.target.closest?.("ui-menu-item");if(!i||this.isItemDisabled(i))return;const e=i.getAttribute("value")??i.getAttribute("data-value")??"";a(this.host,"select",{value:e,trigger:"pointer"}),this.closeMenu("action","pointer")};render(){return e(s,{key:"aaf9f27402b0c88cede3847ee9c8f61ac844f889","data-open":this.internalOpen?"":void 0,"data-focus-trigger":this.internalOpen?this.focusTrigger:void 0,onKeyDown:this.onKeydown,onClick:this.onItemClick},e("slot",{key:"d801d564ec2ee073e517cb991c26efc61d3e499d",name:"trigger"}),e("div",{key:"4febcc5d76c79c2e5361db7b203e971582197fd2",class:"menu","data-open":this.internalOpen?"":void 0},e("ui-menu",{key:"7aace2479a8014a20da35f69bd3ed57b402f9ef2",open:this.internalOpen},e("slot",{key:"a31d703c437cf5d9ab82e5f7793caa093a312dfd"}))))}static get watchers(){return{open:[{syncFromProp:0}],for:[{syncTarget:0}],internalOpen:[{syncOverlay:0}]}}};c.style=":host{display:contents}:host([data-focus-trigger='pointer']) ::slotted(ui-menu-item:focus){outline:none}.menu{position:fixed;inset:auto;margin:0;z-index:var(--ui-z-overlay, 1000);min-width:12rem;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}.menu:popover-open{opacity:1;transform:translateY(0) scale(1)}@starting-style{.menu:popover-open{opacity:0;transform:translateY(-4px) scale(0.99)}}.menu[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){.menu{transition:none}}";export{c as ui_context_menu}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,g as i,h as t,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 c}from"./p-C-0syqXZ.js";import{i as l,c as h}from"./p-BnGhGgTH.js";import{a as u}from"./p-
|
|
1
|
+
import{r as e,g as i,h as t,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 c}from"./p-C-0syqXZ.js";import{i as l,c as h}from"./p-BnGhGgTH.js";import{a as u}from"./p-Ig1jYhE1.js";const d=class{constructor(i){e(this,i)}get host(){return i(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(){l(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,i)=>this.closeMenu(e,i)})):(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,i){this.internalOpen&&(l(this.open)||(this.internalOpen=!1),a(this.host,"close",{open:!1,reason:e,trigger:i}),"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 i=e.target.closest?.("ui-menu-item");if(!i||i.getRootNode()!==this.host.getRootNode())return;if(this.isItemDisabled(i))return;const t=i.getAttribute("value")??i.getAttribute("data-value")??"";a(this.host,"select",{value:t,trigger:r(e)}),a(this.host,"close",{open:!1,reason:"action",trigger:r(e)}),l(this.open)||(this.internalOpen=!1)};onKeydown=e=>{if("Escape"===e.key)return e.preventDefault(),void c("escape","keyboard");const i=this.getItems().filter((e=>!this.isItemDisabled(e)));if(0===i.length)return;const t=e.target.closest?.("ui-menu-item"),s=t&&t instanceof HTMLElement?i.indexOf(t):-1;if("Enter"!==e.key&&" "!==e.key)"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),i["ArrowDown"===e.key?s<0?0:Math.min(s+1,i.length-1):s<=0?i.length-1:s-1].focus());else if(e.preventDefault(),t&&s>=0){const e=t.getAttribute("value")??t.getAttribute("data-value")??"";a(this.host,"select",{value:e,trigger:"keyboard"}),a(this.host,"close",{open:!1,reason:"action",trigger:"keyboard"}),l(this.open)||(this.internalOpen=!1)}};render(){return t(s,{key:"5b64cc53ca56ea04a63013c8cb61231c9b1045cc",role:"menu","aria-orientation":"vertical","data-open":this.internalOpen?"":void 0},t("div",{key:"6410a56cc5efcffd0673c9abdf8f8aa45295c516",class:"menu__surface"},t("slot",{key:"7e7f9d3b19bbf3024d61ecf44cd8b103748ef966"})))}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:none;overflow:visible}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;max-inline-size:inherit;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg);max-block-size:inherit;overflow:auto}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:visible;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 +1 @@
|
|
|
1
|
-
import{r as i,h as t,H as s,c as e,g as a}from"./p-8BGiMGQ0.js";import{o as r,c as
|
|
1
|
+
import{r as i,h as t,H as s,c as e,g as a}from"./p-8BGiMGQ0.js";import{o as r,c as h}from"./p-C-0syqXZ.js";import{d as o}from"./p-JwSoedEO.js";import{i as n,c}from"./p-BnGhGgTH.js";import{a as d}from"./p-Ig1jYhE1.js";const p=class{constructor(t){i(this,t)}appearance="tag";size="xs";render(){return t(s,{key:"970cb48cf8d70c47feaab90fe428c09f0d052a03","data-appearance":this.appearance,"data-size":this.size},t("span",{key:"6d8c6104d2869520097a2a61bd2a887b363b4912",class:"chip__surface"},t("span",{key:"638fb68ff5dffa629576c9e1079bb3169f2adb4f",class:"chip__label"},t("slot",{key:"8b31f2130e202e18d7717aee6add6bc6e7f119b5"}))))}};p.style=":host{--ui-chip-surface:var(--ui-surface-subtle);--ui-chip-text:var(--ui-text-secondary);--ui-chip-border:var(--ui-border-default);--ui-chip-font-size:var(--ui-font-size-xs);--ui-chip-font-weight:var(--ui-font-normal);--ui-chip-line-height:var(--ui-line-height-tight);--ui-chip-padding-block:var(--ui-space-0-5);--ui-chip-padding-inline:var(--ui-space-2);--ui-chip-notch:var(--ui-space-1);display:inline-flex;min-width:0;max-width:100%}:host([data-size='sm']){--ui-chip-font-size:var(--ui-font-size-sm)}.chip__surface{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;max-width:100%;padding:var(--ui-chip-padding-block) var(--ui-chip-padding-inline);border:1px solid var(--ui-chip-border);background:var(--ui-chip-surface);color:var(--ui-chip-text) !important;font-family:var(--ui-font-family-sans) !important;font-size:var(--ui-chip-font-size) !important;font-weight:var(--ui-chip-font-weight) !important;line-height:var(--ui-chip-line-height) !important}.chip__label{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-appearance='pill']) .chip__surface{border-radius:var(--ui-radius-round)}:host([data-appearance='tag']) .chip__surface{border:0;padding-inline-end:calc(var(--ui-chip-padding-inline) + var(--ui-chip-notch));clip-path:polygon(0 0, calc(100% - var(--ui-chip-notch)) 0, 100% 50%, calc(100% - var(--ui-chip-notch)) 100%, 0 100%)}";const l=class{constructor(t){i(this,t),this.opened=e(this,"open"),this.closed=e(this,"close")}get host(){return a(this)}for="";open;defaultOpen=!1;placement="top-start";showDelay=500;hideDelay=100;toggleOnClick=!1;pinned=!1;focused=!1;opened;closed;internalOpen=!1;overlayId=`ui-tooltip-${Math.random().toString(36).slice(2,11)}`;trigger=null;surface=null;showTimer=null;hideTimer=null;syncFromProp(){this.clearTimers(),n(this.open)&&(this.internalOpen=this.open)}resetSurface(){this.syncTrigger(),this.setupSurface(),this.syncOverlay()}syncOverlay(){this.internalOpen?(this.surface?.show(),r({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.trigger?[this.trigger]:void 0,dismissible:!0,requestClose:(i,t)=>this.handleRequestClose(i,t)})):(this.surface?.hide(),h(this.overlayId))}componentDidLoad(){this.host.id||(this.host.id=this.overlayId),this.internalOpen=c(this.open,this.defaultOpen),this.syncTrigger(),this.setupSurface(),this.host.addEventListener("pointerenter",this.onSurfaceEnter),this.host.addEventListener("pointerleave",this.onTriggerLeave),this.syncOverlay()}componentDidUpdate(){this.syncTrigger()}disconnectedCallback(){this.clearTimers(),this.detachTriggerListeners(),this.surface?.destroy(),this.surface=null,this.host.removeEventListener("pointerenter",this.onSurfaceEnter),this.host.removeEventListener("pointerleave",this.onTriggerLeave),h(this.overlayId)}syncTrigger(){const i=this.for?this.host.getRootNode().getElementById(this.for):this.host.previousElementSibling;i!==this.trigger&&(this.detachTriggerListeners(),this.trigger=i,this.attachTriggerListeners(),this.surface?.setAnchor(i))}setupSurface(){this.surface?.destroy(),this.surface=d(this.host,{anchor:this.trigger,placement:this.placement})}attachTriggerListeners(){if(this.detachTriggerListeners(),!this.trigger)return;const i=new Set((this.trigger.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));i.add(this.host.id),this.trigger.setAttribute("aria-describedby",[...i].join(" ")),this.trigger.addEventListener("click",this.onTriggerClick),this.trigger.addEventListener("keydown",this.onTriggerKeydown),this.trigger.addEventListener("pointerenter",this.onTriggerEnter),this.trigger.addEventListener("pointerleave",this.onTriggerLeave),this.trigger.addEventListener("focusin",this.onTriggerFocusIn),this.trigger.addEventListener("focusout",this.onTriggerFocusOut)}detachTriggerListeners(){if(!this.trigger)return;const i=(this.trigger.getAttribute("aria-describedby")||"").split(/\s+/).filter((i=>i&&i!==this.host.id));i.length?this.trigger.setAttribute("aria-describedby",i.join(" ")):this.trigger.removeAttribute("aria-describedby"),this.trigger.removeEventListener("click",this.onTriggerClick),this.trigger.removeEventListener("keydown",this.onTriggerKeydown),this.trigger.removeEventListener("pointerenter",this.onTriggerEnter),this.trigger.removeEventListener("pointerleave",this.onTriggerLeave),this.trigger.removeEventListener("focusin",this.onTriggerFocusIn),this.trigger.removeEventListener("focusout",this.onTriggerFocusOut)}clearShowTimer(){null!==this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)}clearHideTimer(){null!==this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)}clearTimers(){this.clearShowTimer(),this.clearHideTimer()}setInteractionOpen(i,t){this.internalOpen!==i&&(n(this.open)||(this.internalOpen=i),o(this.host,i?"open":"close",{open:i,reason:"action",trigger:t}))}onSurfaceEnter=()=>this.clearHideTimer();onTriggerClick=i=>{this.toggleOnClick&&(this.clearTimers(),this.pinned=!this.pinned,this.setInteractionOpen(this.pinned,0===i.detail?"keyboard":"pointer"))};onTriggerKeydown=i=>{"Escape"===i.key&&this.clearTimers()};onTriggerEnter=i=>{"touch"!==i.pointerType&&(this.clearHideTimer(),this.internalOpen||null!==this.showTimer||(this.showTimer=setTimeout((()=>{this.showTimer=null,this.setInteractionOpen(!0,"pointer")}),Math.max(0,this.showDelay))))};onTriggerLeave=()=>{this.clearShowTimer(),this.focused||this.pinned||!this.internalOpen||null!==this.hideTimer||(this.hideTimer=setTimeout((()=>{this.hideTimer=null,this.setInteractionOpen(!1,"pointer")}),Math.max(0,this.hideDelay)))};onTriggerFocusIn=()=>{this.focused=!0,this.clearTimers(),this.setInteractionOpen(!0,"keyboard")};onTriggerFocusOut=i=>{const t=i.relatedTarget;t&&this.host.contains(t)||(this.focused=!1,this.pinned=!1,this.clearTimers(),this.setInteractionOpen(!1,"keyboard"))};handleRequestClose(i,t){("escape"===i||"light-dismiss"===i&&this.toggleOnClick)&&(this.pinned=!1,this.clearTimers(),n(this.open)||(this.internalOpen=!1),o(this.host,"close",{open:!1,reason:i,trigger:t}))}render(){return t(s,{key:"fd4d81febd147b846aca66e94f25d56f14b171dc",role:"tooltip",hidden:!this.internalOpen,"data-open":this.internalOpen?"":void 0},t("div",{key:"d31ac8c0e087becd7e60459f2cd894a9b15e95fa",class:"tooltip__surface"},t("slot",{key:"06e7aac9b6992a9cf0f92c9d356b97d18fb2da8b"})))}static get watchers(){return{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncOverlay:0}]}}};l.style=":host{position:fixed;inset:auto;margin:0;display:inline-block;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent;opacity:0;transform:translateY(4px);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}.tooltip__surface{box-sizing:border-box;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md)}:host(:popover-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}";export{p as ui_chip,l as ui_tooltip}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,g as s,h as i,H as a}from"./p-8BGiMGQ0.js";import{d as e,e as r}from"./p-JwSoedEO.js";import{b as o}from"./p-Ig1jYhE1.js";const n=class{constructor(s){t(this,s)}get host(){return s(this)}open=!0;internalOpen=!1;surface=null;contentObserver=null;pendingDismiss=null;syncFromProp(){this.syncContents()}syncSurface(){this.internalOpen?this.surface?.show():this.surface?.hide()}componentDidLoad(){this.surface=o(this.host),this.contentObserver=new MutationObserver(this.syncContents),this.contentObserver.observe(this.host,{childList:!0,subtree:!0}),this.syncContents(),this.syncSurface(),this.host.addEventListener("click",this.onClick)}disconnectedCallback(){this.host.removeEventListener("click",this.onClick),this.contentObserver?.disconnect(),this.contentObserver=null,this.surface?.destroy(),this.surface=null}getToasts(){return Array.from(this.host.querySelectorAll("[data-ui-toast]"))}syncContents=()=>{const t=this.open&&this.getToasts().length>0,s=this.internalOpen,i=this.pendingDismiss&&!this.host.contains(this.pendingDismiss.toast)?this.pendingDismiss:null;this.internalOpen=t,s&&!t&&i&&e(this.host,"close",{open:!1,reason:"action",trigger:i.trigger}),!i&&this.open||(this.pendingDismiss=null)};onClick=t=>{const s=t.target.closest?.("[data-ui-toast-dismiss]");if(!s)return;const i=s.closest?.("[data-ui-toast]");if(!i)return;const a=i.id??"",o=r(t);this.pendingDismiss={toast:i,trigger:o},e(this.host,"dismiss",{id:a,reason:"action",trigger:o})};render(){return i(a,{key:"9f9c2e14150c631c0f7cb427c693dcd52c20897d",role:"region","aria-label":"Notifications","aria-live":"polite","data-open":this.internalOpen?"":void 0},i("slot",{key:"9e1d9ebb6b587afab2c4302241cecb03a321cee1"}))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{syncSurface:0}]}}};n.style=":host{position:fixed;top:calc(var(--ui-space-4) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:9999;display:grid;gap:var(--ui-space-2);inline-size:min(24rem, calc(100vw - (var(--ui-space-4) * 2)));max-inline-size:100%;pointer-events:none}:host([popover]){right:auto;bottom:auto;margin:0}:host>*{pointer-events:auto}::slotted([data-ui-toast]){display:grid;grid-template-columns:1fr auto;gap:var(--ui-space-2);align-items:start;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);padding:var(--ui-space-3) var(--ui-space-4);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-lg);animation:ui-toast-enter 0.25s var(--ui-motion-ease) forwards}@keyframes ui-toast-enter{from{opacity:0;transform:translateY(-0.5rem)}to{opacity:1;transform:translateY(0)}}::slotted([data-ui-toast][aria-hidden='true']){display:none}::slotted([data-ui-toast-dismiss]){border:0;background:transparent;color:var(--ui-text-secondary);cursor:pointer;font:inherit}";export{n as ui_toast_region}
|