@threadlabs/looma 0.1.16 → 0.1.17
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-SVINNT3E.js → chunk-OY4D3W4U.js} +29 -29
- package/dist/{chunk-G53JEAQK.js → chunk-SZJQ3NPX.js} +6 -3
- package/dist/chunk-YHXJC5M5.js +341 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/{manager-BOpVXb92.js → manager-C9j3HZay.js} +5 -2
- package/dist/cjs/positioning-i0WrCAdF.js +384 -0
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +3 -113
- package/dist/cjs/ui-context-menu.cjs.entry.js +40 -5
- package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu.cjs.entry.js +83 -2
- package/dist/cjs/ui-popover.cjs.entry.js +43 -3
- package/dist/cjs/ui-toast-region.cjs.entry.js +17 -2
- package/dist/cjs/ui-tooltip.cjs.entry.js +95 -27
- package/dist/cjs/ui-tree-item.cjs.entry.js +1 -1
- package/dist/collection/components/ui-context-menu/ui-context-menu.css +17 -4
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +38 -3
- package/dist/collection/components/ui-menu/ui-menu.css +39 -0
- package/dist/collection/components/ui-menu/ui-menu.js +128 -1
- package/dist/collection/components/ui-popover/ui-popover.css +31 -0
- package/dist/collection/components/ui-popover/ui-popover.js +87 -1
- package/dist/collection/components/ui-toast-region/ui-toast-region.css +6 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +16 -1
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +20 -0
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +160 -25
- package/dist/collection/components/ui-tree-item/ui-tree-item.css +10 -6
- package/dist/collection/input-modality.js +24 -0
- package/dist/collection/overlay/manager.js +5 -2
- package/dist/collection/overlay/positioning.js +246 -0
- package/dist/components/p-CEYIKqYc.js +1 -0
- package/dist/components/p-DOulVJT7.js +1 -0
- package/dist/components/p-PM9a74r7.js +1 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.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/components/ui-tree-item.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/{manager-CR7f2MQC.js → manager-PM9a74r7.js} +5 -2
- package/dist/esm/positioning-Bu0dmLBE.js +379 -0
- package/dist/esm/ui-affordance-scope.entry.js +1 -111
- package/dist/esm/ui-context-menu.entry.js +40 -5
- package/dist/esm/ui-dialog.entry.js +1 -1
- package/dist/esm/ui-menu.entry.js +83 -2
- package/dist/esm/ui-popover.entry.js +43 -3
- package/dist/esm/ui-toast-region.entry.js +17 -2
- package/dist/esm/ui-tooltip.entry.js +95 -27
- package/dist/esm/ui-tree-item.entry.js +1 -1
- package/dist/index.cjs +776 -59
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +235 -4
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/{p-c6721aba.entry.js → p-11083743.entry.js} +1 -1
- package/dist/looma/p-1674cda4.entry.js +1 -0
- package/dist/looma/p-2e6f791e.entry.js +1 -0
- package/dist/looma/p-54c41576.entry.js +1 -0
- package/dist/looma/p-9194a99d.entry.js +1 -0
- package/dist/looma/p-Bu0dmLBE.js +1 -0
- package/dist/looma/p-PM9a74r7.js +1 -0
- package/dist/looma/p-ba01f45d.entry.js +1 -0
- package/dist/looma/p-caa8fc7b.entry.js +1 -0
- package/dist/looma/{p-ef9ca2ed.entry.js → p-d01960c2.entry.js} +2 -2
- package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +3 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +13 -0
- package/dist/types/components/ui-popover/ui-popover.d.ts +9 -0
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +2 -0
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +16 -1
- package/dist/types/components.d.ts +71 -0
- package/dist/types/input-modality.d.ts +6 -0
- package/dist/types/overlay/manager.d.ts +3 -0
- package/dist/types/overlay/positioning.d.ts +33 -0
- package/dist/ui-affordance-scope.entry-X7DTKJGL.js +54 -0
- package/dist/{ui-avatar-group.entry-DQDP325O.js → ui-avatar-group.entry-MC34FKAN.js} +1 -1
- package/dist/{ui-avatar.entry-WYIDMOFE.js → ui-avatar.entry-OKRQWTQV.js} +1 -1
- package/dist/{ui-badge.entry-VGHXPEDT.js → ui-badge.entry-RI7JB7KV.js} +1 -1
- package/dist/{ui-button.entry-LKPLOJ22.js → ui-button.entry-PFO5TTPN.js} +1 -1
- package/dist/{ui-checkbox.entry-J74HEA22.js → ui-checkbox.entry-UHFWVISP.js} +1 -1
- package/dist/{ui-context-menu.entry-MQM2FCLI.js → ui-context-menu.entry-AIXB6U5D.js} +40 -6
- package/dist/{ui-dialog.entry-DQMMDO4Z.js → ui-dialog.entry-LPREQH2T.js} +2 -2
- package/dist/{ui-disclosure.entry-ONF7UZDC.js → ui-disclosure.entry-7XCUIYVZ.js} +1 -1
- package/dist/{ui-floating-action-button.entry-FKTGVC5T.js → ui-floating-action-button.entry-5PNIMUAW.js} +1 -1
- package/dist/{ui-form-field.entry-M3ISWQNU.js → ui-form-field.entry-77YW46SM.js} +1 -1
- package/dist/{ui-icon-button.entry-AWFIQUHM.js → ui-icon-button.entry-4AD6ALPQ.js} +1 -1
- package/dist/{ui-input.entry-JZ6RETMT.js → ui-input.entry-E7E6QDTV.js} +1 -1
- package/dist/{ui-menu-item.entry-5MFR5LFL.js → ui-menu-item.entry-H3HFLUB6.js} +1 -1
- package/dist/ui-menu.entry-UAKZU4HG.js +184 -0
- package/dist/{ui-popover.entry-ELCMKO6Y.js → ui-popover.entry-GVQKX26B.js} +46 -4
- package/dist/{ui-radio-group.entry-RJHUPPEM.js → ui-radio-group.entry-MNSR6UEE.js} +1 -1
- package/dist/{ui-radio.entry-3VRDPOY4.js → ui-radio.entry-6D4WTI5E.js} +1 -1
- package/dist/{ui-search-result-row.entry-J34YPAV7.js → ui-search-result-row.entry-J2TILUH2.js} +1 -1
- package/dist/{ui-search-shell.entry-IJ4UUP27.js → ui-search-shell.entry-FSWHEZQF.js} +1 -1
- package/dist/{ui-select.entry-C6YD3HQ5.js → ui-select.entry-JRCYYNNW.js} +1 -1
- package/dist/{ui-switch.entry-UZDF5QTI.js → ui-switch.entry-YZWMNRP2.js} +1 -1
- package/dist/{ui-tabs.entry-YRAKWOMR.js → ui-tabs.entry-F2Y344JY.js} +1 -1
- package/dist/{ui-textarea.entry-JLDKFT3K.js → ui-textarea.entry-3EZCUUAK.js} +1 -1
- package/dist/{ui-toast-region.entry-GC7C7KXF.js → ui-toast-region.entry-BTV4AW3I.js} +20 -3
- package/dist/ui-tooltip.entry-U644CF5U.js +214 -0
- package/dist/{ui-top-bar.entry-5W5UA5KV.js → ui-top-bar.entry-FGGOREQR.js} +1 -1
- package/dist/{ui-tree-item.entry-3LM7IXIK.js → ui-tree-item.entry-XVMHEONY.js} +2 -2
- package/dist/{ui-tree.entry-X4FU42A6.js → ui-tree.entry-4R7DYGAM.js} +1 -1
- package/editor.css +3 -4
- package/package.json +1 -1
- package/tokens.css +14 -2
- package/vue/editor/index.js +62 -51
- package/dist/components/p-CR7f2MQC.js +0 -1
- package/dist/components/p-QiwSQmKJ.js +0 -1
- package/dist/looma/p-2ae73d5b.entry.js +0 -1
- package/dist/looma/p-3ac2e0d4.entry.js +0 -1
- package/dist/looma/p-65c25c94.entry.js +0 -1
- package/dist/looma/p-8c09c724.entry.js +0 -1
- package/dist/looma/p-95cd639d.entry.js +0 -1
- package/dist/looma/p-96f73d07.entry.js +0 -1
- package/dist/looma/p-CR7f2MQC.js +0 -1
- package/dist/ui-affordance-scope.entry-PFP2TDKO.js +0 -145
- package/dist/ui-menu.entry-IOEIDATQ.js +0 -98
- package/dist/ui-tooltip.entry-F26XDTYX.js +0 -145
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
|
|
2
2
|
import { d as dispatchDetail, e as eventToTrigger } from './events-JwSoedEO.js';
|
|
3
|
+
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-PM9a74r7.js';
|
|
4
|
+
import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
|
|
3
5
|
|
|
4
|
-
const uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;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: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)}::slotted(ui-menu-item){display:block;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(ui-menu-item:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}::slotted(ui-menu-item[aria-disabled='true']),::slotted(ui-menu-item[disabled]){opacity:0.6;cursor:not-allowed}`;
|
|
6
|
+
const uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;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: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)}: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%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(ui-menu-item:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}::slotted(ui-menu-item[aria-disabled='true']),::slotted(ui-menu-item[disabled]){opacity:0.6;cursor:not-allowed}`;
|
|
5
7
|
|
|
6
8
|
const UIMenu = class {
|
|
7
9
|
constructor(hostRef) {
|
|
@@ -10,19 +12,84 @@ const UIMenu = class {
|
|
|
10
12
|
get host() { return getElement(this); }
|
|
11
13
|
open = false;
|
|
12
14
|
defaultOpen = false;
|
|
15
|
+
/** Id of the control that anchors this menu in the top layer. */
|
|
16
|
+
for;
|
|
17
|
+
/** Preferred placement; Looma flips and shifts when space is constrained. */
|
|
18
|
+
placement = 'bottom-start';
|
|
13
19
|
internalOpen = false;
|
|
20
|
+
overlayId = `ui-menu-${Math.random().toString(36).slice(2, 11)}`;
|
|
21
|
+
anchor = null;
|
|
22
|
+
surface = null;
|
|
14
23
|
syncFromProp() {
|
|
15
24
|
this.internalOpen = this.open;
|
|
16
25
|
}
|
|
26
|
+
resetSurface() {
|
|
27
|
+
this.setupSurface();
|
|
28
|
+
this.syncSurface();
|
|
29
|
+
}
|
|
30
|
+
syncSurface() {
|
|
31
|
+
this.syncAnchorState();
|
|
32
|
+
if (!this.surface)
|
|
33
|
+
return;
|
|
34
|
+
if (this.internalOpen) {
|
|
35
|
+
this.surface.show();
|
|
36
|
+
openOverlay({
|
|
37
|
+
id: this.overlayId,
|
|
38
|
+
modal: false,
|
|
39
|
+
element: this.host,
|
|
40
|
+
relatedElements: this.anchor ? [this.anchor] : undefined,
|
|
41
|
+
dismissible: true,
|
|
42
|
+
requestClose: (reason, trigger) => this.closeMenu(reason, trigger),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.surface.hide();
|
|
47
|
+
closeOverlay(this.overlayId);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
17
50
|
componentDidLoad() {
|
|
18
51
|
this.syncFromProp();
|
|
19
52
|
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
20
53
|
this.host.addEventListener('click', this.onItemClick);
|
|
21
54
|
this.host.addEventListener('keydown', this.onKeydown);
|
|
55
|
+
this.setupSurface();
|
|
56
|
+
this.syncSurface();
|
|
22
57
|
}
|
|
23
58
|
disconnectedCallback() {
|
|
24
59
|
this.host.removeEventListener('click', this.onItemClick);
|
|
25
60
|
this.host.removeEventListener('keydown', this.onKeydown);
|
|
61
|
+
this.surface?.destroy();
|
|
62
|
+
this.surface = null;
|
|
63
|
+
closeOverlay(this.overlayId);
|
|
64
|
+
}
|
|
65
|
+
setupSurface() {
|
|
66
|
+
this.surface?.destroy();
|
|
67
|
+
this.surface = null;
|
|
68
|
+
this.anchor = this.for ? this.host.ownerDocument.getElementById(this.for) : null;
|
|
69
|
+
if (!this.anchor)
|
|
70
|
+
return;
|
|
71
|
+
this.surface = createAnchoredSurface(this.host, {
|
|
72
|
+
anchor: this.anchor,
|
|
73
|
+
placement: this.placement,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
syncAnchorState() {
|
|
77
|
+
if (!this.anchor)
|
|
78
|
+
return;
|
|
79
|
+
this.anchor.setAttribute('aria-haspopup', 'menu');
|
|
80
|
+
this.anchor.setAttribute('aria-expanded', this.internalOpen ? 'true' : 'false');
|
|
81
|
+
}
|
|
82
|
+
closeMenu(reason, trigger) {
|
|
83
|
+
if (!this.internalOpen)
|
|
84
|
+
return;
|
|
85
|
+
this.internalOpen = false;
|
|
86
|
+
dispatchDetail(this.host, 'close', {
|
|
87
|
+
open: false,
|
|
88
|
+
reason: reason,
|
|
89
|
+
trigger: trigger,
|
|
90
|
+
});
|
|
91
|
+
if (reason === 'escape')
|
|
92
|
+
this.anchor?.focus();
|
|
26
93
|
}
|
|
27
94
|
getItems() {
|
|
28
95
|
return Array.from(this.host.querySelectorAll('ui-menu-item'));
|
|
@@ -49,6 +116,11 @@ const UIMenu = class {
|
|
|
49
116
|
this.internalOpen = false;
|
|
50
117
|
};
|
|
51
118
|
onKeydown = (e) => {
|
|
119
|
+
if (e.key === 'Escape') {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
requestTopOverlayClose('escape', 'keyboard');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
52
124
|
const items = this.getItems().filter((i) => !this.isItemDisabled(i));
|
|
53
125
|
if (items.length === 0)
|
|
54
126
|
return;
|
|
@@ -81,11 +153,20 @@ const UIMenu = class {
|
|
|
81
153
|
}
|
|
82
154
|
};
|
|
83
155
|
render() {
|
|
84
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '06ad0750df843cb874bd4f257d8567157c855493', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: '50118ac749a2747ca06f4d483499c4cd20125a89' })));
|
|
85
157
|
}
|
|
86
158
|
static get watchers() { return {
|
|
87
159
|
"open": [{
|
|
88
160
|
"syncFromProp": 0
|
|
161
|
+
}],
|
|
162
|
+
"for": [{
|
|
163
|
+
"resetSurface": 0
|
|
164
|
+
}],
|
|
165
|
+
"placement": [{
|
|
166
|
+
"resetSurface": 0
|
|
167
|
+
}],
|
|
168
|
+
"internalOpen": [{
|
|
169
|
+
"syncSurface": 0
|
|
89
170
|
}]
|
|
90
171
|
}; }
|
|
91
172
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
|
|
2
|
-
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-
|
|
2
|
+
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-PM9a74r7.js';
|
|
3
3
|
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
|
+
import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
|
|
4
5
|
|
|
5
|
-
const uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);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);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:auto}`;
|
|
6
|
+
const uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);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);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:auto}: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}}`;
|
|
6
7
|
|
|
7
8
|
const UIPopover = class {
|
|
8
9
|
constructor(hostRef) {
|
|
@@ -11,8 +12,13 @@ const UIPopover = class {
|
|
|
11
12
|
get host() { return getElement(this); }
|
|
12
13
|
open = false;
|
|
13
14
|
defaultOpen = false;
|
|
15
|
+
/** Optional id of the element this popover follows in the top layer. */
|
|
16
|
+
for;
|
|
17
|
+
placement = 'bottom-start';
|
|
14
18
|
internalOpen = false;
|
|
15
19
|
overlayId = `ui-popover-${Math.random().toString(36).slice(2, 11)}`;
|
|
20
|
+
anchor = null;
|
|
21
|
+
surface = null;
|
|
16
22
|
syncFromProp() {
|
|
17
23
|
this.internalOpen = this.open;
|
|
18
24
|
}
|
|
@@ -33,12 +39,37 @@ const UIPopover = class {
|
|
|
33
39
|
});
|
|
34
40
|
}
|
|
35
41
|
}
|
|
42
|
+
resetSurface() {
|
|
43
|
+
this.setupSurface();
|
|
44
|
+
this.syncSurface();
|
|
45
|
+
}
|
|
46
|
+
setupSurface() {
|
|
47
|
+
this.surface?.destroy();
|
|
48
|
+
this.surface = null;
|
|
49
|
+
this.anchor = this.for ? this.host.ownerDocument.getElementById(this.for) : null;
|
|
50
|
+
if (!this.anchor)
|
|
51
|
+
return;
|
|
52
|
+
this.surface = createAnchoredSurface(this.host, {
|
|
53
|
+
anchor: this.anchor,
|
|
54
|
+
placement: this.placement,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
syncSurface() {
|
|
58
|
+
if (!this.surface)
|
|
59
|
+
return;
|
|
60
|
+
if (this.internalOpen)
|
|
61
|
+
this.surface.show();
|
|
62
|
+
else
|
|
63
|
+
this.surface.hide();
|
|
64
|
+
}
|
|
36
65
|
syncOverlay() {
|
|
66
|
+
this.syncSurface();
|
|
37
67
|
if (this.internalOpen) {
|
|
38
68
|
openOverlay({
|
|
39
69
|
id: this.overlayId,
|
|
40
70
|
modal: false,
|
|
41
71
|
element: this.host,
|
|
72
|
+
relatedElements: this.anchor ? [this.anchor] : undefined,
|
|
42
73
|
dismissible: true,
|
|
43
74
|
requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
|
|
44
75
|
});
|
|
@@ -51,10 +82,13 @@ const UIPopover = class {
|
|
|
51
82
|
this.syncFromProp();
|
|
52
83
|
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
53
84
|
this.host.addEventListener('keydown', this.onKeydown);
|
|
85
|
+
this.setupSurface();
|
|
54
86
|
this.syncOverlay();
|
|
55
87
|
}
|
|
56
88
|
disconnectedCallback() {
|
|
57
89
|
this.host.removeEventListener('keydown', this.onKeydown);
|
|
90
|
+
this.surface?.destroy();
|
|
91
|
+
this.surface = null;
|
|
58
92
|
closeOverlay(this.overlayId);
|
|
59
93
|
}
|
|
60
94
|
componentDidUpdate() {
|
|
@@ -74,7 +108,7 @@ const UIPopover = class {
|
|
|
74
108
|
}
|
|
75
109
|
};
|
|
76
110
|
render() {
|
|
77
|
-
return (h(Host, { key: '
|
|
111
|
+
return (h(Host, { key: '8e45be54147ff8f76a0d5e7fd875c3f4cf5ac40a', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '3141729cd32c8dcdaec1fbd763eb034242563c8f' })));
|
|
78
112
|
}
|
|
79
113
|
static get watchers() { return {
|
|
80
114
|
"open": [{
|
|
@@ -82,6 +116,12 @@ const UIPopover = class {
|
|
|
82
116
|
}],
|
|
83
117
|
"internalOpen": [{
|
|
84
118
|
"onOpenChange": 0
|
|
119
|
+
}],
|
|
120
|
+
"for": [{
|
|
121
|
+
"resetSurface": 0
|
|
122
|
+
}],
|
|
123
|
+
"placement": [{
|
|
124
|
+
"resetSurface": 0
|
|
85
125
|
}]
|
|
86
126
|
}; }
|
|
87
127
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
|
|
2
2
|
import { d as dispatchDetail, e as eventToTrigger } from './events-JwSoedEO.js';
|
|
3
|
+
import { b as createViewportSurface } from './positioning-Bu0dmLBE.js';
|
|
3
4
|
|
|
4
|
-
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>*{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}`;
|
|
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}`;
|
|
5
6
|
|
|
6
7
|
const UIToastRegion = class {
|
|
7
8
|
constructor(hostRef) {
|
|
@@ -10,15 +11,26 @@ const UIToastRegion = class {
|
|
|
10
11
|
get host() { return getElement(this); }
|
|
11
12
|
open = true;
|
|
12
13
|
internalOpen = true;
|
|
14
|
+
surface = null;
|
|
13
15
|
syncFromProp() {
|
|
14
16
|
this.internalOpen = this.open;
|
|
15
17
|
}
|
|
18
|
+
syncSurface() {
|
|
19
|
+
if (this.internalOpen)
|
|
20
|
+
this.surface?.show();
|
|
21
|
+
else
|
|
22
|
+
this.surface?.hide();
|
|
23
|
+
}
|
|
16
24
|
componentDidLoad() {
|
|
25
|
+
this.surface = createViewportSurface(this.host);
|
|
17
26
|
this.syncFromProp();
|
|
27
|
+
this.syncSurface();
|
|
18
28
|
this.host.addEventListener('click', this.onClick);
|
|
19
29
|
}
|
|
20
30
|
disconnectedCallback() {
|
|
21
31
|
this.host.removeEventListener('click', this.onClick);
|
|
32
|
+
this.surface?.destroy();
|
|
33
|
+
this.surface = null;
|
|
22
34
|
}
|
|
23
35
|
getToasts() {
|
|
24
36
|
return Array.from(this.host.querySelectorAll('[data-ui-toast]'));
|
|
@@ -52,11 +64,14 @@ const UIToastRegion = class {
|
|
|
52
64
|
}
|
|
53
65
|
};
|
|
54
66
|
render() {
|
|
55
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '693e24016ec0881a4d619a489f1b655feee41784', role: "region", "aria-label": "Notifications", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: 'e666b2a73a5d7eb8dd607df3d1c5135b78cf3775' })));
|
|
56
68
|
}
|
|
57
69
|
static get watchers() { return {
|
|
58
70
|
"open": [{
|
|
59
71
|
"syncFromProp": 0
|
|
72
|
+
}],
|
|
73
|
+
"internalOpen": [{
|
|
74
|
+
"syncSurface": 0
|
|
60
75
|
}]
|
|
61
76
|
}; }
|
|
62
77
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
|
|
2
|
-
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-
|
|
2
|
+
import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-PM9a74r7.js';
|
|
3
3
|
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
|
+
import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
|
|
4
5
|
|
|
5
|
-
const uiTooltipCss = () => `:host{display:inline-block;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([hidden]){display:none !important}`;
|
|
6
|
+
const uiTooltipCss = () => `:host{position:fixed;inset:auto;margin:0;display:inline-block;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);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}: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}}`;
|
|
6
7
|
|
|
7
8
|
const UITooltip = class {
|
|
8
9
|
constructor(hostRef) {
|
|
@@ -12,51 +13,79 @@ const UITooltip = class {
|
|
|
12
13
|
for = '';
|
|
13
14
|
open = false;
|
|
14
15
|
defaultOpen = false;
|
|
16
|
+
placement = 'top-start';
|
|
17
|
+
/** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
|
|
18
|
+
showDelay = 500;
|
|
19
|
+
/** Pointer leave grace period in milliseconds. */
|
|
20
|
+
hideDelay = 100;
|
|
15
21
|
internalOpen = false;
|
|
16
22
|
overlayId = `ui-tooltip-${Math.random().toString(36).slice(2, 11)}`;
|
|
17
23
|
trigger = null;
|
|
24
|
+
surface = null;
|
|
25
|
+
showTimer = null;
|
|
26
|
+
hideTimer = null;
|
|
18
27
|
syncFromProp() {
|
|
28
|
+
this.clearTimers();
|
|
19
29
|
this.internalOpen = this.open;
|
|
20
30
|
}
|
|
31
|
+
resetSurface() {
|
|
32
|
+
this.syncTrigger();
|
|
33
|
+
this.setupSurface();
|
|
34
|
+
this.syncOverlay();
|
|
35
|
+
}
|
|
21
36
|
syncOverlay() {
|
|
22
37
|
if (this.internalOpen) {
|
|
38
|
+
this.surface?.show();
|
|
23
39
|
openOverlay({
|
|
24
40
|
id: this.overlayId,
|
|
25
41
|
modal: false,
|
|
26
42
|
element: this.host,
|
|
43
|
+
relatedElements: this.trigger ? [this.trigger] : undefined,
|
|
27
44
|
dismissible: true,
|
|
28
45
|
requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
|
|
29
46
|
});
|
|
30
47
|
}
|
|
31
48
|
else {
|
|
49
|
+
this.surface?.hide();
|
|
32
50
|
closeOverlay(this.overlayId);
|
|
33
51
|
}
|
|
34
52
|
}
|
|
35
53
|
componentDidLoad() {
|
|
36
54
|
this.syncFromProp();
|
|
37
55
|
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
56
|
+
this.syncTrigger();
|
|
57
|
+
this.setupSurface();
|
|
40
58
|
this.host.addEventListener('keydown', this.onKeydown);
|
|
41
59
|
this.syncOverlay();
|
|
42
60
|
}
|
|
43
61
|
componentDidUpdate() {
|
|
44
|
-
this.
|
|
45
|
-
this.attachTriggerListeners();
|
|
46
|
-
this.syncOverlay();
|
|
62
|
+
this.syncTrigger();
|
|
47
63
|
}
|
|
48
64
|
disconnectedCallback() {
|
|
65
|
+
this.clearTimers();
|
|
49
66
|
this.detachTriggerListeners();
|
|
67
|
+
this.surface?.destroy();
|
|
68
|
+
this.surface = null;
|
|
50
69
|
this.host.removeEventListener('keydown', this.onKeydown);
|
|
51
70
|
closeOverlay(this.overlayId);
|
|
52
71
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
syncTrigger() {
|
|
73
|
+
const next = this.for
|
|
74
|
+
? this.host.ownerDocument.getElementById(this.for)
|
|
75
|
+
: this.host.previousElementSibling;
|
|
76
|
+
if (next === this.trigger)
|
|
77
|
+
return;
|
|
78
|
+
this.detachTriggerListeners();
|
|
79
|
+
this.trigger = next;
|
|
80
|
+
this.attachTriggerListeners();
|
|
81
|
+
this.surface?.setAnchor(next);
|
|
82
|
+
}
|
|
83
|
+
setupSurface() {
|
|
84
|
+
this.surface?.destroy();
|
|
85
|
+
this.surface = createAnchoredSurface(this.host, {
|
|
86
|
+
anchor: this.trigger,
|
|
87
|
+
placement: this.placement,
|
|
88
|
+
});
|
|
60
89
|
}
|
|
61
90
|
attachTriggerListeners() {
|
|
62
91
|
this.detachTriggerListeners();
|
|
@@ -75,31 +104,64 @@ const UITooltip = class {
|
|
|
75
104
|
this.trigger.removeEventListener('focusin', this.onTriggerFocusIn);
|
|
76
105
|
this.trigger.removeEventListener('focusout', this.onTriggerFocusOut);
|
|
77
106
|
}
|
|
107
|
+
clearShowTimer() {
|
|
108
|
+
if (this.showTimer === null)
|
|
109
|
+
return;
|
|
110
|
+
clearTimeout(this.showTimer);
|
|
111
|
+
this.showTimer = null;
|
|
112
|
+
}
|
|
113
|
+
clearHideTimer() {
|
|
114
|
+
if (this.hideTimer === null)
|
|
115
|
+
return;
|
|
116
|
+
clearTimeout(this.hideTimer);
|
|
117
|
+
this.hideTimer = null;
|
|
118
|
+
}
|
|
119
|
+
clearTimers() {
|
|
120
|
+
this.clearShowTimer();
|
|
121
|
+
this.clearHideTimer();
|
|
122
|
+
}
|
|
123
|
+
setInteractionOpen(nextOpen, trigger) {
|
|
124
|
+
if (this.internalOpen === nextOpen)
|
|
125
|
+
return;
|
|
126
|
+
this.internalOpen = nextOpen;
|
|
127
|
+
dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
|
|
128
|
+
open: nextOpen,
|
|
129
|
+
reason: 'action',
|
|
130
|
+
trigger,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
78
133
|
onTriggerEnter = () => {
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
|
|
134
|
+
this.clearHideTimer();
|
|
135
|
+
if (this.internalOpen || this.showTimer !== null)
|
|
136
|
+
return;
|
|
137
|
+
this.showTimer = setTimeout(() => {
|
|
138
|
+
this.showTimer = null;
|
|
139
|
+
this.setInteractionOpen(true, 'pointer');
|
|
140
|
+
}, Math.max(0, this.showDelay));
|
|
82
141
|
};
|
|
83
142
|
onTriggerLeave = () => {
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
|
|
143
|
+
this.clearShowTimer();
|
|
144
|
+
if (!this.internalOpen || this.hideTimer !== null)
|
|
145
|
+
return;
|
|
146
|
+
this.hideTimer = setTimeout(() => {
|
|
147
|
+
this.hideTimer = null;
|
|
148
|
+
this.setInteractionOpen(false, 'pointer');
|
|
149
|
+
}, Math.max(0, this.hideDelay));
|
|
87
150
|
};
|
|
88
151
|
onTriggerFocusIn = () => {
|
|
89
|
-
this.
|
|
90
|
-
|
|
91
|
-
this.syncOverlay();
|
|
152
|
+
this.clearTimers();
|
|
153
|
+
this.setInteractionOpen(true, 'keyboard');
|
|
92
154
|
};
|
|
93
155
|
onTriggerFocusOut = (e) => {
|
|
94
156
|
const related = e.relatedTarget;
|
|
95
157
|
if (related && this.host.contains(related))
|
|
96
158
|
return;
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
this.syncOverlay();
|
|
159
|
+
this.clearTimers();
|
|
160
|
+
this.setInteractionOpen(false, 'keyboard');
|
|
100
161
|
};
|
|
101
162
|
handleRequestClose(reason, trigger) {
|
|
102
163
|
if (reason === 'escape') {
|
|
164
|
+
this.clearTimers();
|
|
103
165
|
this.internalOpen = false;
|
|
104
166
|
dispatchDetail(this.host, 'close', {
|
|
105
167
|
open: false,
|
|
@@ -115,12 +177,18 @@ const UITooltip = class {
|
|
|
115
177
|
}
|
|
116
178
|
};
|
|
117
179
|
render() {
|
|
118
|
-
return (h(Host, { key: '
|
|
180
|
+
return (h(Host, { key: '4c3890a7371508ede06a5b370d1cec32db25280f', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '2e3bcd0dc69b0c3e3376d73dc4efc82e4f4cfaaa' })));
|
|
119
181
|
}
|
|
120
182
|
static get watchers() { return {
|
|
121
183
|
"open": [{
|
|
122
184
|
"syncFromProp": 0
|
|
123
185
|
}],
|
|
186
|
+
"for": [{
|
|
187
|
+
"resetSurface": 0
|
|
188
|
+
}],
|
|
189
|
+
"placement": [{
|
|
190
|
+
"resetSurface": 0
|
|
191
|
+
}],
|
|
124
192
|
"internalOpen": [{
|
|
125
193
|
"syncOverlay": 0
|
|
126
194
|
}]
|
|
@@ -601,7 +601,7 @@ function loomaIconMarkup(name, className = 'looma-icon') {
|
|
|
601
601
|
].join('');
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
const uiTreeItemCss = () => `:host{--ui-tree-indent:16px;--ui-tree-row-min-height:
|
|
604
|
+
const uiTreeItemCss = () => `:host{--ui-tree-indent:16px;--ui-tree-row-min-height:32px;--ui-tree-drop-color:var(--ui-accent-solid);position:relative;display:block;min-inline-size:0;margin-inline-start:calc(var(--ui-tree-item-depth, 0) * var(--ui-tree-indent))}.row{position:relative;display:grid;grid-template-columns:20px auto minmax(0, 1fr) auto;align-items:center;min-block-size:var(--ui-tree-row-min-height);min-inline-size:0;font-size:var(--ui-tree-font-size, var(--ui-font-size-ui, 0.9375rem));border-radius:var(--ui-radius-md);color:var(--ui-text-secondary);transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), opacity var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), min-block-size var(--ui-motion-base) var(--ui-motion-ease)}.row:hover,:host([data-selected]) .row,.row:focus-within{color:var(--ui-text-primary);background:var(--ui-surface-muted)}:host([data-disabled]) .row{opacity:0.55}:host([data-dragging]) .row{opacity:0.42}:host(:focus){outline:none}:host(:focus-visible) .row{box-shadow:0 0 0 2px var(--ui-focus-ring)}:host([data-drop-position='inside']) .row{background:var(--ui-accent-subtle);box-shadow:inset 0 0 0 1px var(--ui-tree-drop-color)}.disclosure,.disclosure-spacer{grid-column:1;grid-row:1;inline-size:20px;block-size:28px}.disclosure{display:grid;place-items:center;padding:0;color:var(--ui-text-muted);background:transparent;border:0;border-radius:var(--ui-radius-sm);cursor:pointer}.disclosure:hover{color:var(--ui-text-primary);background:var(--ui-surface-elevated)}.disclosure-icon{display:block;inline-size:14px;block-size:14px;transform:rotate(-90deg);transition:transform var(--ui-motion-fast) var(--ui-motion-ease)}.disclosure-icon--expanded{transform:rotate(0deg)}.disclosure-icon :is(svg),.drag-handle :is(svg){display:block;inline-size:100%;block-size:100%}.leading{display:none}.leading:has(*){display:inline-grid;place-items:center;grid-column:2;grid-row:1;inline-size:16px;block-size:16px;margin-inline-start:var(--ui-space-1)}.label{grid-column:3;grid-row:1;min-inline-size:0;padding:var(--ui-space-1) var(--ui-space-2)}.actions{grid-column:4;grid-row:1;display:inline-flex;align-items:center;min-inline-size:0}.drag-handle{position:absolute;z-index:2;inset-block-start:50%;inset-inline-start:-22px;inline-size:20px;block-size:32px;display:grid;place-items:center;padding:7px 3px;color:var(--ui-text-muted);background:var(--ui-surface-elevated);border:1px solid transparent;border-radius:var(--ui-radius-sm);cursor:grab;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease)}.row:hover .drag-handle,.drag-handle:focus-visible,:host([data-dragging]) .drag-handle{opacity:1;pointer-events:auto}.drag-handle:active{cursor:grabbing}.drop-indicator{position:absolute;z-index:3;inset-inline:1px;display:none;block-size:2px;border-radius:999px;background:var(--ui-tree-drop-color);pointer-events:none}.drop-indicator::before,.drop-indicator::after{content:'';position:absolute;inset-block-start:50%;inline-size:7px;block-size:7px;border:2px solid var(--ui-tree-drop-color);border-radius:999px;background:var(--ui-surface-elevated);transform:translateY(-50%)}.drop-indicator::before{inset-inline-start:-1px}.drop-indicator::after{inset-inline-end:-1px}:host([data-drop-position='before']) .drop-indicator{display:block;inset-block-start:-1px}:host([data-drop-position='after']) .drop-indicator{display:block;inset-block-end:-1px}.children[hidden]{display:none}:host-context(html[data-ui-input-modality='touch']){--ui-tree-row-min-height:44px}:host-context(html[data-ui-input-modality='touch']) .drag-handle{display:none}@media (prefers-reduced-motion: reduce){.row,.disclosure-icon,.drag-handle{transition:none}}`;
|
|
605
605
|
|
|
606
606
|
const UITreeItem = class {
|
|
607
607
|
constructor(hostRef) {
|