@floegence/floe-webapp-core 0.90.0 → 0.90.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.
@@ -1,47 +1,47 @@
1
- import { setAttribute as g, insert as v, memo as S, createComponent as E, Portal as H, spread as T, mergeProps as z, effect as q, template as O, use as R, delegateEvents as j } from "solid-js/web";
2
- import { createSignal as C, createMemo as N, createEffect as U, onCleanup as K, Show as W } from "solid-js";
3
- import { cn as D } from "../../utils/cn.js";
4
- import { calculateMenuPosition as G } from "./menuUtils.js";
5
- import { LOCAL_INTERACTION_SURFACE_ATTR as J } from "./localInteractionSurface.js";
6
- import { createFloatingPresence as Q } from "./floatingPresence.js";
7
- import { useOverlayMask as V } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as X, projectSurfacePortalPosition as Y, isSurfacePortalMode as Z, resolveSurfacePortalMount as ee, resolveSurfacePortalBoundaryRect as te } from "./dialogSurfaceScope.js";
9
- var oe = /* @__PURE__ */ O("<div data-floe-popover-panel role=dialog aria-modal=false data-floe-surface=floating>"), ne = /* @__PURE__ */ O('<div class="relative inline-flex"><div class=inline-flex data-floe-popover-trigger>');
10
- let re = 0;
11
- function ge(t) {
12
- const h = () => t.open !== void 0, [_, k] = C(t.defaultOpen ?? !1), c = () => h() ? !!t.open : _(), i = (o) => {
1
+ import { setAttribute as f, insert as v, memo as C, createComponent as E, Portal as q, use as O, spread as z, mergeProps as j, effect as N, template as k, delegateEvents as U } from "solid-js/web";
2
+ import { createSignal as h, createMemo as K, createEffect as W, onCleanup as D, Show as G } from "solid-js";
3
+ import { cn as J } from "../../utils/cn.js";
4
+ import { calculateMenuPosition as Q } from "./menuUtils.js";
5
+ import { LOCAL_INTERACTION_SURFACE_ATTR as V } from "./localInteractionSurface.js";
6
+ import { createFloatingPresence as X } from "./floatingPresence.js";
7
+ import { useOverlayMask as Y } from "../../hooks/useOverlayMask.js";
8
+ import { resolveSurfacePortalHost as Z, projectSurfacePortalPosition as ee, isSurfacePortalMode as te, resolveSurfacePortalMount as oe, resolveSurfacePortalBoundaryRect as ne } from "./dialogSurfaceScope.js";
9
+ var re = /* @__PURE__ */ k("<div data-floe-popover-panel role=dialog aria-modal=false data-floe-surface=floating>"), ae = /* @__PURE__ */ k('<div class="relative inline-flex"><div class=inline-flex data-floe-popover-trigger>');
10
+ let ie = 0;
11
+ function pe(t) {
12
+ const b = () => t.open !== void 0, [B, _] = h(t.defaultOpen ?? !1), c = () => b() ? !!t.open : B(), s = (o) => {
13
13
  const e = o !== c();
14
- h() || k(o), e && t.onOpenChange?.(o);
15
- }, r = Q({
14
+ b() || _(o), e && t.onOpenChange?.(o);
15
+ }, a = X({
16
16
  open: c,
17
- element: () => l
18
- }), [w, m] = C({
17
+ element: () => i
18
+ }), [w, g] = h({
19
19
  x: -9999,
20
20
  y: -9999
21
- });
22
- let a, l;
23
- const p = `floe-popover-${re += 1}`, b = `${p}-panel`, u = N(() => r.mounted() ? X({
24
- owner: a
21
+ }), [A, y] = h("bottom");
22
+ let r, i;
23
+ const m = `floe-popover-${ie += 1}`, x = `${m}-panel`, u = K(() => a.mounted() ? Z({
24
+ owner: r
25
25
  }) : {
26
26
  host: null,
27
27
  boundaryHost: null,
28
28
  mountHost: null,
29
29
  mode: "global"
30
- }), A = () => ee(u()), y = () => Z(u()), B = () => te(u()), x = (o) => Y(o, u()), $ = () => (t.placement ?? "bottom-start").startsWith("top") ? "top" : "bottom", F = () => (t.placement ?? "bottom-start").slice($() === "top" ? 5 : 7), I = () => i(!1), L = () => {
31
- i(!1), a?.querySelector('button, input, [tabindex="0"]')?.focus({
30
+ }), F = () => oe(u()), S = () => te(u()), I = () => ne(u()), P = (o) => ee(o, u()), R = () => (t.placement ?? "bottom-start").startsWith("top") ? "top" : "bottom", L = () => (t.placement ?? "bottom-start").slice(R() === "top" ? 5 : 7), M = () => s(!1), H = () => {
31
+ s(!1), r?.querySelector('button, input, [tabindex="0"]')?.focus({
32
32
  preventScroll: !0
33
33
  });
34
34
  };
35
- V({
36
- open: r.mounted,
37
- root: () => l,
35
+ Y({
36
+ open: a.mounted,
37
+ root: () => i,
38
38
  containsTarget: (o) => {
39
39
  const e = o instanceof Element ? o : document.activeElement;
40
- return l?.contains(e ?? null) || e?.closest(`[data-floe-popover="${p}"]`) ? !0 : !!a?.contains(e ?? null);
40
+ return i?.contains(e ?? null) || e?.closest(`[data-floe-popover="${m}"]`) ? !0 : !!r?.contains(e ?? null);
41
41
  },
42
- onClose: L,
43
- onInteractOutside: () => i(!1),
44
- onEscapeOutside: () => i(!1),
42
+ onClose: H,
43
+ onInteractOutside: () => s(!1),
44
+ onEscapeOutside: () => s(!1),
45
45
  lockBodyScroll: !1,
46
46
  trapFocus: !1,
47
47
  autoFocus: !1,
@@ -50,104 +50,111 @@ function ge(t) {
50
50
  closeOnEscape: () => t.closeOnEscape === !1 ? !1 : "inside",
51
51
  escapeKeyPhase: "bubble"
52
52
  });
53
- const P = () => {
54
- if (!a || !l) return;
55
- const o = G(a.getBoundingClientRect(), l.getBoundingClientRect(), F(), B());
56
- if ($() === "top") {
57
- const e = a.getBoundingClientRect(), d = l.getBoundingClientRect();
58
- m({
53
+ const p = () => {
54
+ if (!r || !i) return;
55
+ const o = Q(r.getBoundingClientRect(), i.getBoundingClientRect(), L(), I());
56
+ if (R() === "top") {
57
+ const e = r.getBoundingClientRect(), d = i.getBoundingClientRect();
58
+ y("top"), g({
59
59
  x: o.x,
60
60
  y: e.top - d.height - 6
61
61
  });
62
62
  return;
63
63
  }
64
- m(o);
64
+ y(o.y < r.getBoundingClientRect().top ? "top" : "bottom"), g(o);
65
65
  };
66
- U(() => {
67
- if (!r.mounted()) {
68
- m({
66
+ W(() => {
67
+ if (!a.mounted()) {
68
+ g({
69
69
  x: -9999,
70
70
  y: -9999
71
71
  });
72
72
  return;
73
73
  }
74
- const o = requestAnimationFrame(P), e = () => P();
75
- window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), K(() => {
74
+ const o = requestAnimationFrame(p), e = () => p();
75
+ window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), D(() => {
76
76
  cancelAnimationFrame(o), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
77
77
  });
78
78
  });
79
- const M = {
79
+ const T = {
80
80
  "aria-haspopup": "dialog",
81
81
  get "aria-expanded"() {
82
82
  return c();
83
83
  },
84
84
  get "aria-controls"() {
85
- return r.mounted() ? b : void 0;
85
+ return a.mounted() ? x : void 0;
86
86
  }
87
87
  };
88
88
  return (() => {
89
- var o = ne(), e = o.firstChild;
90
- g(o, "data-floe-popover", p), e.$$keydown = (n) => {
91
- n.key === "Escape" && c() && (n.stopPropagation(), i(!1));
92
- }, e.$$click = () => i(!c());
93
- var d = a;
94
- return typeof d == "function" ? R(d, e) : a = e, v(e, (() => {
95
- var n = S(() => typeof t.trigger == "function");
96
- return () => n() ? t.trigger(M) : t.trigger;
97
- })()), v(o, E(W, {
89
+ var o = ae(), e = o.firstChild;
90
+ f(o, "data-floe-popover", m), e.$$keydown = (n) => {
91
+ n.key === "Escape" && c() && (n.stopPropagation(), s(!1));
92
+ }, e.$$click = () => s(!c());
93
+ var d = r;
94
+ return typeof d == "function" ? O(d, e) : r = e, v(e, (() => {
95
+ var n = C(() => typeof t.trigger == "function");
96
+ return () => n() ? t.trigger(T) : t.trigger;
97
+ })()), v(o, E(G, {
98
98
  get when() {
99
- return r.mounted();
99
+ return a.mounted();
100
100
  },
101
101
  get children() {
102
- return E(H, {
102
+ return E(q, {
103
103
  get mount() {
104
- return A();
104
+ return F();
105
105
  },
106
106
  get children() {
107
- var n = oe(), s = l;
108
- return typeof s == "function" ? R(s, n) : l = n, g(n, "id", b), T(n, z({
107
+ var n = re();
108
+ return O((l) => {
109
+ i = l, queueMicrotask(() => {
110
+ l.isConnected && p();
111
+ });
112
+ }, n), f(n, "id", x), z(n, j({
109
113
  get class() {
110
- return D(y() ? "absolute z-20" : "fixed z-50", "bg-popover text-popover-foreground", "rounded-panel border border-[var(--floe-line)]", "shadow-[var(--floe-window-shadow)]", "floe-floating-presence floe-floating-menu", t.class);
114
+ return J(S() ? "absolute z-20" : "fixed z-50", "bg-popover text-popover-foreground", "rounded-panel border border-[var(--floe-line)]", "shadow-[var(--floe-window-shadow)]", "floe-floating-presence floe-floating-menu", t.class);
111
115
  },
112
116
  get "data-floating-presence"() {
113
- return r.state();
117
+ return a.state();
118
+ },
119
+ get "data-floating-side"() {
120
+ return A();
114
121
  },
115
122
  get "aria-hidden"() {
116
- return r.exiting() ? "true" : void 0;
123
+ return a.exiting() ? "true" : void 0;
117
124
  },
118
125
  get inert() {
119
- return r.exiting();
126
+ return a.exiting();
120
127
  },
121
128
  get "aria-label"() {
122
129
  return t.ariaLabel;
123
130
  },
124
131
  get style() {
125
132
  return {
126
- left: `${x(w()).x}px`,
127
- top: `${x(w()).y}px`,
133
+ left: `${P(w()).x}px`,
134
+ top: `${P(w()).y}px`,
128
135
  "min-width": t.width ? `${t.width}px` : void 0,
129
136
  "max-width": "min(calc(100vw - 24px), 420px)"
130
137
  };
131
138
  }
132
139
  }, () => ({
133
- [J]: y() ? "true" : void 0
140
+ [V]: S() ? "true" : void 0
134
141
  })), !1, !0), v(n, (() => {
135
- var f = S(() => typeof t.children == "function");
136
- return () => f() ? t.children(I) : t.children;
142
+ var l = C(() => typeof t.children == "function");
143
+ return () => l() ? t.children(M) : t.children;
137
144
  })()), n;
138
145
  }
139
146
  });
140
147
  }
141
- }), null), q((n) => {
142
- var s = t.triggerInputSurface ? "true" : void 0, f = t.triggerInputSurface ? "inset" : void 0;
143
- return s !== n.e && g(e, "data-floe-input-surface", n.e = s), f !== n.t && g(e, "data-floe-surface", n.t = f), n;
148
+ }), null), N((n) => {
149
+ var l = t.triggerInputSurface ? "true" : void 0, $ = t.triggerInputSurface ? "inset" : void 0;
150
+ return l !== n.e && f(e, "data-floe-input-surface", n.e = l), $ !== n.t && f(e, "data-floe-surface", n.t = $), n;
144
151
  }, {
145
152
  e: void 0,
146
153
  t: void 0
147
154
  }), o;
148
155
  })();
149
156
  }
150
- j(["click", "keydown"]);
157
+ U(["click", "keydown"]);
151
158
  export {
152
- ge as Popover
159
+ pe as Popover
153
160
  };
@@ -1,63 +1,63 @@
1
- import { createComponent as F, mergeProps as J, memo as K } from "solid-js/web";
2
- import { splitProps as N, createSignal as f, createEffect as M, onCleanup as R, onMount as Q, Show as U } from "solid-js";
3
- import { SurfaceFloatingLayer as X } from "./SurfaceFloatingLayer.js";
4
- import { resolveFloatingBoundary as Z } from "./surfaceFloatingBoundary.js";
5
- import { observeViewport as _ } from "../../viewport.js";
1
+ import { createComponent as C, mergeProps as J, memo as K } from "solid-js/web";
2
+ import { splitProps as N, createSignal as f, createEffect as M, onCleanup as R, onMount as Q, Show as U, untrack as X } from "solid-js";
3
+ import { SurfaceFloatingLayer as Z } from "./SurfaceFloatingLayer.js";
4
+ import { resolveFloatingBoundary as _ } from "./surfaceFloatingBoundary.js";
5
+ import { observeViewport as ee } from "../../viewport.js";
6
6
  import { resolveSurfacePortalHost as E } from "./dialogSurfaceScope.js";
7
- function ae(L) {
8
- const [o, C] = N(L, ["anchor", "revision", "topOffset", "reservedSpace", "placement", "gap", "children", "class", "style", "layerRef", "onAnchorDisconnect"]), [O, H] = f(!1), [$, B] = f({
7
+ function se(L) {
8
+ const [o, H] = N(L, ["anchor", "revision", "topOffset", "reservedSpace", "placement", "gap", "children", "class", "style", "layerRef", "onAnchorDisconnect"]), [A, $] = f(!1), [k, q] = f({
9
9
  x: 0,
10
10
  y: 0
11
- }), [V, Y] = f("above"), [P, v] = f(!1), [q, D] = f(480), [S, k] = f();
12
- let d, w = !1;
13
- const [z, T] = f({
11
+ }), [B, V] = f("above"), [F, v] = f(!1), [Y, D] = f(480), [O, T] = f();
12
+ let m, w = !1;
13
+ const [P, W] = f({
14
14
  x: 0,
15
15
  y: 0
16
- }), [W, j] = f(0), G = () => {
17
- d = void 0;
18
- const n = o.anchor, l = S();
16
+ }), [j, G] = f(0), S = () => {
17
+ m = void 0;
18
+ const n = o.anchor, l = O();
19
19
  if (!n || !l) return;
20
20
  if (!n.isConnected) {
21
21
  v(!1), w || o.onAnchorDisconnect?.(), w = !0;
22
22
  return;
23
23
  }
24
24
  w = !1;
25
- const t = Z(E({
25
+ const t = _(E({
26
26
  owner: n
27
27
  }));
28
28
  if (!t) {
29
29
  v(!1);
30
30
  return;
31
31
  }
32
- const e = n.getBoundingClientRect(), s = o.reservedSpace, m = t.top + (window.matchMedia("(max-width:760px)").matches ? s?.narrowTop ?? s?.top ?? 12 : s?.top ?? 12);
33
- D(Math.max(120, t.width - 24)), j(Math.max(0, t.bottom - (s?.bottom ?? 12) - m));
32
+ const e = n.getBoundingClientRect(), s = o.reservedSpace, d = t.top + (window.matchMedia("(max-width:760px)").matches ? s?.narrowTop ?? s?.top ?? 12 : s?.top ?? 12);
33
+ D(Math.max(120, t.width - 24)), G(Math.max(0, t.bottom - (s?.bottom ?? 12) - d));
34
34
  const r = l.getBoundingClientRect(), I = (Math.max(t.left, e.left) + Math.min(t.right, e.right)) / 2;
35
35
  let p = Math.max(t.left + 12, Math.min(I - r.width / 2, t.right - r.width - 12));
36
- const x = e.top - (o.topOffset ?? 0), i = Math.max(0, o.gap ?? 12), g = x - r.height - i, y = Math.max(m, t.bottom - (s?.bottom ?? 12) - r.height), u = (b) => Math.max(m, Math.min(b, y));
37
- let c = g, a = "above";
36
+ const x = e.top - (o.topOffset ?? 0), i = Math.max(0, o.gap ?? 12), u = x - r.height - i, y = Math.max(d, t.bottom - (s?.bottom ?? 12) - r.height), g = (b) => Math.max(d, Math.min(b, y));
37
+ let c = u, a = "above";
38
38
  if (o.placement === "right" || o.placement === "left") {
39
- const b = e.right + i + r.width <= t.right - 12, A = e.left - i - r.width >= t.left + 12;
40
- a = o.placement, a === "right" && !b && A ? a = "left" : a === "left" && !A && b && (a = "right"), p = Math.max(t.left + 12, Math.min(a === "right" ? e.right + i : e.left - r.width - i, t.right - r.width - 12)), c = u(e.top + e.height / 2 - r.height / 2);
41
- } else g < m ? e.bottom + i <= y ? (c = e.bottom + i, a = "below") : g >= t.top + 12 ? a = "above" : e.bottom + r.height + i <= t.bottom - 12 ? (c = e.bottom + i, a = "below") : e.right + r.width + i + 12 <= t.right ? (p = e.right + i, c = u(x), a = "right") : e.left - r.width - i - 12 >= t.left ? (p = e.left - r.width - i, c = u(x), a = "left") : (c = u(g), a = "edge") : c = Math.min(c, y);
42
- T({
39
+ const b = e.right + i + r.width <= t.right - 12, z = e.left - i - r.width >= t.left + 12;
40
+ a = o.placement, a === "right" && !b && z ? a = "left" : a === "left" && !z && b && (a = "right"), p = Math.max(t.left + 12, Math.min(a === "right" ? e.right + i : e.left - r.width - i, t.right - r.width - 12)), c = g(e.top + e.height / 2 - r.height / 2);
41
+ } else u < d ? e.bottom + i <= y ? (c = e.bottom + i, a = "below") : u >= t.top + 12 ? a = "above" : e.bottom + r.height + i <= t.bottom - 12 ? (c = e.bottom + i, a = "below") : e.right + r.width + i + 12 <= t.right ? (p = e.right + i, c = g(x), a = "right") : e.left - r.width - i - 12 >= t.left ? (p = e.left - r.width - i, c = g(x), a = "left") : (c = g(u), a = "edge") : c = Math.min(c, y);
42
+ W({
43
43
  x: Math.max(18, Math.min(e.left + e.width / 2 - p, Math.max(18, r.width - 18))),
44
44
  y: Math.max(18, Math.min(e.top + e.height / 2 - c, Math.max(18, r.height - 18)))
45
- }), Y(a), B({
45
+ }), V(a), q({
46
46
  x: Math.round(p),
47
47
  y: Math.round(c)
48
48
  }), v(e.right > t.left && e.left < t.right && e.bottom > t.top && e.top < t.bottom);
49
49
  }, h = () => {
50
- d === void 0 && typeof requestAnimationFrame == "function" && (d = requestAnimationFrame(G));
50
+ m === void 0 && typeof requestAnimationFrame == "function" && (m = requestAnimationFrame(S));
51
51
  };
52
52
  return M(() => {
53
53
  o.anchor, o.revision, o.topOffset, o.reservedSpace, o.placement, o.gap, h();
54
54
  }), M(() => {
55
- const n = S();
55
+ const n = O();
56
56
  if (!n || typeof ResizeObserver > "u") return;
57
57
  const l = new ResizeObserver(h);
58
58
  l.observe(n), R(() => l.disconnect());
59
- }), Q(() => H(!0)), M(() => {
60
- if (!O()) return;
59
+ }), Q(() => $(!0)), M(() => {
60
+ if (!A()) return;
61
61
  const n = o.anchor, l = typeof ResizeObserver == "function" ? new ResizeObserver(h) : void 0, t = E({
62
62
  owner: n
63
63
  }).boundaryHost;
@@ -74,46 +74,48 @@ function ae(L) {
74
74
  childList: !0
75
75
  }), s !== t); )
76
76
  s = s.parentElement;
77
- const m = _(window, h);
77
+ const d = ee(window, h);
78
78
  window.addEventListener("scroll", h, !0), h(), R(() => {
79
- l?.disconnect(), e.disconnect(), m(), window.removeEventListener("scroll", h, !0);
79
+ l?.disconnect(), e.disconnect(), d(), window.removeEventListener("scroll", h, !0);
80
80
  });
81
81
  }), R(() => {
82
- d !== void 0 && cancelAnimationFrame(d);
83
- }), F(U, {
82
+ m !== void 0 && cancelAnimationFrame(m);
83
+ }), C(U, {
84
84
  get when() {
85
- return K(() => !!O())() && o.anchor;
85
+ return K(() => !!A())() && o.anchor;
86
86
  },
87
87
  get children() {
88
- return F(X, J(C, {
88
+ return C(Z, J(H, {
89
89
  get owner() {
90
90
  return o.anchor;
91
91
  },
92
92
  get position() {
93
- return $();
93
+ return k();
94
94
  },
95
95
  get class() {
96
96
  return o.class;
97
97
  },
98
98
  get "data-placement"() {
99
- return V();
99
+ return B();
100
100
  },
101
101
  get inert() {
102
- return !P();
102
+ return !F();
103
103
  },
104
104
  get style() {
105
105
  return {
106
106
  ...o.style,
107
- "--floe-anchored-layer-anchor-x": `${z().x}px`,
108
- "--floe-anchored-layer-anchor-y": `${z().y}px`,
109
- "--floe-anchored-layer-max-height": `${W()}px`,
110
- visibility: P() ? "visible" : "hidden",
111
- "max-width": `${q()}px`,
107
+ "--floe-anchored-layer-anchor-x": `${P().x}px`,
108
+ "--floe-anchored-layer-anchor-y": `${P().y}px`,
109
+ "--floe-anchored-layer-max-height": `${j()}px`,
110
+ visibility: F() ? "visible" : "hidden",
111
+ "max-width": `${Y()}px`,
112
112
  "z-index": o.style?.["z-index"] ?? 60
113
113
  };
114
114
  },
115
115
  layerRef: (n) => {
116
- k(n), o.layerRef?.(n), h();
116
+ T(n), o.layerRef?.(n), queueMicrotask(() => X(() => {
117
+ n.isConnected && (m !== void 0 && cancelAnimationFrame(m), S());
118
+ }));
117
119
  },
118
120
  get children() {
119
121
  return o.children;
@@ -123,5 +125,5 @@ function ae(L) {
123
125
  });
124
126
  }
125
127
  export {
126
- ae as SurfaceAnchoredLayer
128
+ se as SurfaceAnchoredLayer
127
129
  };
package/dist/floe.css CHANGED
@@ -480,6 +480,9 @@
480
480
  * which costs memory and rasterisation on every window, menu and dialog that
481
481
  * merely sits on screen. Only the two transitions need it. */
482
482
  .floe-floating-presence[data-floating-presence='entering'] {
483
+ /* Placement may resolve after the initial size read. Set its starting pose
484
+ * immediately; only the subsequent open state should transition. */
485
+ transition: none;
483
486
  opacity: 0;
484
487
  --floe-floating-presence-x: var(--floe-floating-enter-x);
485
488
  --floe-floating-presence-y: var(--floe-floating-enter-y);
@@ -591,6 +594,46 @@
591
594
  --floe-floating-origin: left top;
592
595
  }
593
596
 
597
+ /* The positioning owner supplies the resolved side, including collision flips.
598
+ * Keep motion on the child so measuring the anchor layer never reads a scale. */
599
+ [data-floe-surface-floating-layer][data-placement='above'] > .floe-floating-menu,
600
+ .floe-floating-menu[data-floating-side='top'] {
601
+ --floe-floating-enter-y: 0.375rem;
602
+ --floe-floating-exit-y: 0.125rem;
603
+ --floe-floating-origin: var(--floe-anchored-layer-anchor-x, 50%) bottom;
604
+ }
605
+
606
+ [data-floe-surface-floating-layer][data-placement='below'] > .floe-floating-menu,
607
+ .floe-floating-menu[data-floating-side='bottom'] {
608
+ --floe-floating-origin: var(--floe-anchored-layer-anchor-x, 50%) top;
609
+ }
610
+
611
+ [data-floe-surface-floating-layer][data-placement='right'] > .floe-floating-menu,
612
+ .floe-floating-menu[data-floating-side='right'] {
613
+ --floe-floating-enter-x: -0.375rem;
614
+ --floe-floating-exit-x: -0.125rem;
615
+ --floe-floating-enter-y: 0;
616
+ --floe-floating-exit-y: 0;
617
+ --floe-floating-origin: left var(--floe-anchored-layer-anchor-y, 50%);
618
+ }
619
+
620
+ [data-floe-surface-floating-layer][data-placement='left'] > .floe-floating-menu,
621
+ .floe-floating-menu[data-floating-side='left'] {
622
+ --floe-floating-enter-x: 0.375rem;
623
+ --floe-floating-exit-x: 0.125rem;
624
+ --floe-floating-enter-y: 0;
625
+ --floe-floating-exit-y: 0;
626
+ --floe-floating-origin: right var(--floe-anchored-layer-anchor-y, 50%);
627
+ }
628
+
629
+ /* A fully clamped panel has no reliable opening side. Fade it in place. */
630
+ [data-floe-surface-floating-layer][data-placement='edge'] > .floe-floating-menu {
631
+ --floe-floating-enter-y: 0;
632
+ --floe-floating-exit-y: 0;
633
+ --floe-floating-enter-scale: 1;
634
+ --floe-floating-exit-scale: 1;
635
+ }
636
+
594
637
  .floe-floating-tooltip {
595
638
  --floe-floating-enter-duration: 140ms;
596
639
  --floe-floating-exit-duration: 90ms;