@floegence/floe-webapp-core 0.91.5 → 0.93.0

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,5 +1,5 @@
1
1
  import { type JSX } from 'solid-js';
2
- import { type SelectOption } from './Select';
2
+ import { type SelectOption, type SelectBaseProps } from './Select';
3
3
  export interface PromptCardProps {
4
4
  open: boolean;
5
5
  /** Viewport coordinates captured by the host at the contextual action. */
@@ -19,7 +19,7 @@ export interface PromptCardProps {
19
19
  title: string;
20
20
  icon?: JSX.Element;
21
21
  closeLabel: string;
22
- question: JSX.Element;
22
+ question?: JSX.Element;
23
23
  value: string;
24
24
  onValueChange: (value: string) => void;
25
25
  inputLabel: string;
@@ -44,6 +44,9 @@ export interface PromptCardProps {
44
44
  placeholder?: string;
45
45
  value: string;
46
46
  options: readonly SelectOption[];
47
+ renderOption?: SelectBaseProps['renderOption'];
48
+ search?: SelectBaseProps['search'];
49
+ popupClass?: string;
47
50
  onChange: (value: string) => void;
48
51
  loading?: boolean;
49
52
  error?: string;
@@ -59,5 +62,7 @@ export interface PromptCardProps {
59
62
  class?: string;
60
63
  zIndex?: number;
61
64
  }
65
+ /** Capture the initiating control before a menu closes or asynchronous work starts. */
66
+ export declare function capturePromptCardAnchor(owner?: Element | null): PromptCardProps['anchor'];
62
67
  /** A short contextual input. The host owns the draft and asynchronous result. */
63
68
  export declare function PromptCard(props: PromptCardProps): JSX.Element;
@@ -1,97 +1,108 @@
1
- import { createComponent as u, Portal as ye, use as J, setAttribute as y, insert as d, spread as we, mergeProps as Se, effect as N, setStyleProperty as M, className as Ce, template as O, delegateEvents as Me } from "solid-js/web";
2
- import { createUniqueId as ke, createSignal as z, onCleanup as Z, createMemo as F, createEffect as W, untrack as p, Show as E } from "solid-js";
3
- import { useOverlayMask as Pe } from "../../hooks/useOverlayMask.js";
1
+ import { createComponent as u, Portal as we, use as ee, setAttribute as x, insert as c, spread as Ce, mergeProps as Se, effect as X, setStyleProperty as M, className as Me, template as D, delegateEvents as Ee } from "solid-js/web";
2
+ import { createUniqueId as Pe, createSignal as z, onCleanup as te, createMemo as F, untrack as K, createEffect as U, Show as E } from "solid-js";
3
+ import { useOverlayMask as ke } from "../../hooks/useOverlayMask.js";
4
4
  import { deferAfterPaint as ue } from "../../utils/defer.js";
5
- import { ensureSurfacePortalInteractionTracking as Ee, resolveSurfacePortalHost as $e, resolveSurfacePortalScale as De, resolveSurfacePortalBoundaryRect as Le, projectSurfacePortalPosition as Ae, readFreshInteractionSnapshot as Te, resolveSurfacePortalMount as Ie, isSurfacePortalMode as ze } from "./dialogSurfaceScope.js";
5
+ import { ensureSurfacePortalInteractionTracking as me, resolveSurfacePortalHost as $e, resolveSurfacePortalScale as De, resolveSurfacePortalBoundaryRect as Ae, projectSurfacePortalPosition as Le, readFreshInteractionSnapshot as he, resolveSurfacePortalMount as Te, isSurfacePortalMode as Oe } from "./dialogSurfaceScope.js";
6
6
  import { cn as fe } from "../../utils/cn.js";
7
- import { readViewportSnapshot as Fe, observeViewport as Oe } from "../../viewport.js";
8
- import { X as Be, Plus as He, ArrowUp as qe } from "../icons/index.js";
9
- import { Button as ee } from "./Button.js";
10
- import { Select as Re } from "./Select.js";
11
- import { createFloatingPresence as Ve } from "./floatingPresence.js";
12
- var _e = /* @__PURE__ */ O("<span class=floe-prompt-card-icon aria-hidden=true>"), Ne = /* @__PURE__ */ O("<div class=floe-prompt-card-references>"), We = /* @__PURE__ */ O("<input type=file multiple hidden tabindex=-1>"), Xe = /* @__PURE__ */ O("<div class=floe-prompt-card-feedback>"), Ke = /* @__PURE__ */ O("<div class=floe-prompt-card-positioner><div role=dialog aria-modal=false tabindex=-1 data-floe-prompt-card data-floe-input-surface data-floe-surface=floating data-floe-local-interaction-surface=true><header class=floe-prompt-card-header><h2></h2></header><div><div class=floe-prompt-card-question></div><div class=floe-prompt-card-composer><div class=floe-prompt-card-field><textarea class=floe-prompt-card-input rows=2></textarea></div><div class=floe-prompt-card-actions><div class=floe-prompt-card-tools>");
13
- function at(t) {
14
- Ee();
15
- const te = ke(), [me, ne] = z(!1), [he, ae] = z(!1), c = () => t.busy || me();
16
- let X = !1;
17
- Z(() => {
18
- X = !0;
7
+ import { readViewportSnapshot as Ie, observeViewport as ze } from "../../viewport.js";
8
+ import { X as Fe, Plus as Be, ArrowUp as He } from "../icons/index.js";
9
+ import { Button as ne } from "./Button.js";
10
+ import { Select as qe } from "./Select.js";
11
+ import { createFloatingPresence as Re } from "./floatingPresence.js";
12
+ var Ve = /* @__PURE__ */ D("<span class=floe-prompt-card-icon aria-hidden=true>"), _e = /* @__PURE__ */ D("<div class=floe-prompt-card-question>"), Ne = /* @__PURE__ */ D("<div class=floe-prompt-card-references>"), We = /* @__PURE__ */ D("<input type=file multiple hidden tabindex=-1>"), Xe = /* @__PURE__ */ D("<div class=floe-prompt-card-feedback>"), Ke = /* @__PURE__ */ D("<div class=floe-prompt-card-positioner><div role=dialog aria-modal=false tabindex=-1 data-floe-prompt-card data-floe-input-surface data-floe-surface=floating data-floe-local-interaction-surface=true><header class=floe-prompt-card-header><h2></h2></header><div><div class=floe-prompt-card-composer><div class=floe-prompt-card-field><textarea class=floe-prompt-card-input rows=2></textarea></div><div class=floe-prompt-card-actions><div class=floe-prompt-card-tools>");
13
+ function Ue(t) {
14
+ if (typeof document > "u") return null;
15
+ me();
16
+ const y = t ?? he()?.target ?? document.activeElement;
17
+ if (!y?.isConnected || y === document.body || y === document.documentElement) return null;
18
+ const P = y.getBoundingClientRect();
19
+ return P.width > 0 && P.height > 0 ? {
20
+ x: P.left,
21
+ y: P.bottom
22
+ } : null;
23
+ }
24
+ function it(t) {
25
+ me();
26
+ const y = Pe(), [P, ae] = z(!1), [ge, ie] = z(!1), l = () => t.busy || P();
27
+ let j = !1;
28
+ te(() => {
29
+ j = !0;
19
30
  });
20
- const [h, ge] = z(Fe(window)), [$, ve] = z(), [K, be] = z({
31
+ const [g, ve] = z(Ie(window)), [A, be] = z(), [Q, xe] = z({
21
32
  width: 0,
22
33
  height: 0
23
- }), xe = F((n) => t.open ? t.anchor : n), w = Ve({
34
+ }), ye = F((n) => t.open ? t.anchor ?? K(() => Ue(t.owner)) : n), w = Re({
24
35
  open: () => t.open,
25
- element: $
36
+ element: A
26
37
  });
27
- let g, U, D = !1, j, B;
28
- const Q = () => queueMicrotask(() => {
29
- !X && t.open && !c() && !t.inputDisabled && g?.isConnected && g.focus({
38
+ let v, Y, L = !1, p, B;
39
+ const G = () => queueMicrotask(() => {
40
+ !j && t.open && !l() && !t.inputDisabled && v?.isConnected && v.focus({
30
41
  preventScroll: !0
31
42
  });
32
- }), Y = (n) => {
33
- t.open && !c() && !t.inputDisabled && n.length && (t.attachment?.onFiles(n), Q());
43
+ }), J = (n) => {
44
+ t.open && !l() && !t.inputDisabled && n.length && (t.attachment?.onFiles(n), G());
34
45
  };
35
- W(() => {
36
- (!t.open || c() || t.inputDisabled) && ae(!1);
46
+ U(() => {
47
+ (!t.open || l() || t.inputDisabled) && ie(!1);
37
48
  });
38
- const L = F(() => !w.mounted() || t.portalScope === "viewport" ? {
49
+ const T = F(() => !w.mounted() || t.portalScope === "viewport" ? {
39
50
  host: null,
40
51
  boundaryHost: null,
41
52
  mountHost: null,
42
53
  mode: "global"
43
54
  } : $e({
44
55
  owner: t.owner
45
- })), H = () => ze(L()), A = F(() => (h(), K(), H() ? De(L()) : {
46
- x: h().fixedScale,
47
- y: h().fixedScale
56
+ })), H = () => Oe(T()), O = F(() => (g(), Q(), H() ? De(T()) : {
57
+ x: g().fixedScale,
58
+ y: g().fixedScale
48
59
  }));
49
- W(() => {
50
- w.mounted() && Z(Oe(window, ge));
51
- }), W(() => {
52
- const n = $();
60
+ U(() => {
61
+ w.mounted() && te(ze(window, ve));
62
+ }), U(() => {
63
+ const n = A();
53
64
  if (!w.mounted() || !n) return;
54
- const a = () => be((s) => {
55
- const f = n.offsetWidth, m = n.offsetHeight;
56
- return s.width === f && s.height === m ? s : {
65
+ const i = () => xe((s) => {
66
+ const f = n.offsetWidth, d = n.offsetHeight;
67
+ return s.width === f && s.height === d ? s : {
57
68
  width: f,
58
- height: m
69
+ height: d
59
70
  };
60
- }), i = new ResizeObserver(a);
61
- i.observe(n), a(), Z(() => i.disconnect());
71
+ }), r = new ResizeObserver(i);
72
+ r.observe(n), i(), te(() => r.disconnect());
62
73
  });
63
- const S = F(() => {
64
- const n = h(), a = H() ? Le(L()) : n.visible, i = n.visible.width < 640 ? 8 : 12, s = t.viewportInsets, f = Math.max(n.visible.left, a.left) + Math.max(n.safeArea.left, s?.left ?? 0) + i, m = Math.max(n.visible.top, a.top) + Math.max(n.safeArea.top, s?.top ?? 0) + i, C = Math.min(n.visible.right, a.right) - Math.max(n.safeArea.right, s?.right ?? 0) - i, k = Math.min(n.visible.bottom, a.bottom) - Math.max(n.safeArea.bottom, s?.bottom ?? 0) - i, o = Math.max(0, C - f), v = Math.min(K().width * A().x, o), P = Math.max(0, k - m), e = Math.min(K().height * A().y, P), r = xe(), l = (R, V, _) => Math.max(V, Math.min(R, _)), b = l(r ? r.x + 8 : f + (o - v) / 2, f, C - v), x = !r || r.y + 8 + e <= k, T = r ? x ? r.y + 8 : r.y - e - 8 : m + Math.max(0, (P - e) * 0.32), I = l(T, m, k - e);
74
+ const C = F(() => {
75
+ const n = g(), i = H() ? Ae(T()) : n.visible, r = n.visible.width < 640 ? 8 : 12, s = t.viewportInsets, f = Math.max(n.visible.left, i.left) + Math.max(n.safeArea.left, s?.left ?? 0) + r, d = Math.max(n.visible.top, i.top) + Math.max(n.safeArea.top, s?.top ?? 0) + r, k = Math.min(n.visible.right, i.right) - Math.max(n.safeArea.right, s?.right ?? 0) - r, o = Math.min(n.visible.bottom, i.bottom) - Math.max(n.safeArea.bottom, s?.bottom ?? 0) - r, $ = Math.max(0, k - f), S = Math.min(Q().width * O().x, $), e = Math.max(0, o - d), m = Math.min(Q().height * O().y, e), a = ye(), h = (_, N, W) => Math.max(N, Math.min(_, W)), b = h(a ? a.x + 8 : f + ($ - S) / 2, f, k - S), I = !a || a.y + 8 + m <= o, R = a ? I ? a.y + 8 : a.y - m - 8 : d + Math.max(0, (e - m) * 0.32), V = h(R, d, o - m);
65
76
  return {
66
77
  x: b,
67
- y: I,
68
- availableWidth: o,
69
- maxHeight: P,
70
- side: !r || I !== T ? "edge" : x ? "bottom" : "top",
71
- originX: r ? l(r.x - b, 16, v - 16) : v / 2
78
+ y: V,
79
+ availableWidth: $,
80
+ maxHeight: e,
81
+ side: a ? I ? "bottom" : "top" : "edge",
82
+ originX: a ? h(a.x - b, 16, S - 16) : S / 2
72
83
  };
73
- }), ie = F(() => H() ? Ae(S(), L()) : {
74
- x: (S().x + h().fixedOffset.left) / h().fixedScale,
75
- y: (S().y + h().fixedOffset.top) / h().fixedScale
84
+ }), re = F(() => H() ? Le(C(), T()) : {
85
+ x: (C().x + g().fixedOffset.left) / g().fixedScale,
86
+ y: (C().y + g().fixedOffset.top) / g().fixedScale
76
87
  }), q = (n) => {
77
- c() || !t.open || D || (t.onClose(), n && ue(() => p(() => {
78
- !t.open && U?.isConnected && U.focus({
88
+ l() || !t.open || L || (t.onClose(), n && ue(() => K(() => {
89
+ !t.open && Y?.isConnected && Y.focus({
79
90
  preventScroll: !0
80
91
  });
81
92
  })));
82
93
  };
83
- W(() => {
94
+ U(() => {
84
95
  if (!t.open) return;
85
- const n = document.activeElement, i = t.owner ?? Te()?.target?.closest("button, a[href], input, [tabindex]") ?? (n instanceof HTMLElement && n !== document.body ? n : void 0);
86
- i && !p($)?.contains(i) && !t.containsTarget?.(i) && (U = i), queueMicrotask(() => {
87
- !t.open || t.autoFocus === !1 || !g?.isConnected || (g.focus({
96
+ const n = document.activeElement, r = t.owner ?? he()?.target?.closest("button, a[href], input, [tabindex]") ?? (n instanceof HTMLElement && n !== document.body ? n : void 0);
97
+ r && !K(A)?.contains(r) && !t.containsTarget?.(r) && (Y = r), queueMicrotask(() => {
98
+ !t.open || t.autoFocus === !1 || !v?.isConnected || (v.focus({
88
99
  preventScroll: !0
89
- }), g.setSelectionRange(g.value.length, g.value.length));
100
+ }), v.setSelectionRange(v.value.length, v.value.length));
90
101
  });
91
- }), Pe({
102
+ }), ke({
92
103
  open: () => t.open,
93
- root: $,
94
- containsTarget: (n) => !!(n instanceof Node && $()?.contains(n)) || !!t.containsTarget?.(n) || !!(n instanceof Node && document.getElementById(B?.getAttribute("aria-controls") ?? "")?.parentElement?.contains(n)),
104
+ root: A,
105
+ containsTarget: (n) => !!(n instanceof Node && A()?.contains(n)) || !!t.containsTarget?.(n) || !!(n instanceof Node && document.getElementById(B?.getAttribute("aria-controls") ?? "")?.parentElement?.contains(n)),
95
106
  onClose: () => q(!0),
96
107
  onInteractOutside: (n) => {
97
108
  n.type === "pointerdown" && q(!1);
@@ -105,13 +116,13 @@ function at(t) {
105
116
  restoreFocus: !1,
106
117
  blockHotkeys: !1
107
118
  });
108
- const re = () => {
109
- !t.open || c() || t.submitDisabled || (ne(!0), ue(() => p(() => {
110
- if (!X)
119
+ const oe = () => {
120
+ !t.open || l() || t.submitDisabled || (ae(!0), ue(() => K(() => {
121
+ if (!j)
111
122
  try {
112
123
  t.open && t.onSubmit();
113
124
  } finally {
114
- ne(!1);
125
+ ae(!1);
115
126
  }
116
127
  })));
117
128
  };
@@ -120,29 +131,29 @@ function at(t) {
120
131
  return w.mounted();
121
132
  },
122
133
  get children() {
123
- return u(ye, {
134
+ return u(we, {
124
135
  get mount() {
125
- return Ie(L());
136
+ return Te(T());
126
137
  },
127
138
  get children() {
128
- var n = Ke(), a = n.firstChild, i = a.firstChild, s = i.firstChild, f = i.nextSibling, m = f.firstChild, C = m.nextSibling, k = C.firstChild, o = k.firstChild, v = k.nextSibling, P = v.firstChild;
129
- return a.$$keydown = (e) => {
130
- e.key !== "Escape" || e.defaultPrevented || e.isComposing || D || B?.getAttribute("aria-expanded") === "true" && B.contains(e.target) || (e.preventDefault(), e.stopPropagation(), q(!0));
131
- }, a.$$focusin = () => t.onActivate?.(), a.$$pointerdown = () => t.onActivate?.(), J(ve, a), y(a, "aria-labelledby", te), d(i, u(E, {
139
+ var n = Ke(), i = n.firstChild, r = i.firstChild, s = r.firstChild, f = r.nextSibling, d = f.firstChild, k = d.firstChild, o = k.firstChild, $ = k.nextSibling, S = $.firstChild;
140
+ return i.$$keydown = (e) => {
141
+ e.key !== "Escape" || e.defaultPrevented || e.isComposing || L || B?.getAttribute("aria-expanded") === "true" && B.contains(e.target) || (e.preventDefault(), e.stopPropagation(), q(!0));
142
+ }, i.$$focusin = () => t.onActivate?.(), i.$$pointerdown = () => t.onActivate?.(), ee(be, i), x(i, "aria-labelledby", y), c(r, u(E, {
132
143
  get when() {
133
144
  return t.icon;
134
145
  },
135
146
  get children() {
136
- var e = _e();
137
- return d(e, () => t.icon), e;
147
+ var e = Ve();
148
+ return c(e, () => t.icon), e;
138
149
  }
139
- }), s), y(s, "id", te), d(s, () => t.title), d(i, u(ee, {
150
+ }), s), x(s, "id", y), c(s, () => t.title), c(r, u(ne, {
140
151
  variant: "ghost",
141
152
  size: "icon",
142
- icon: Be,
153
+ icon: Fe,
143
154
  class: "floe-prompt-card-close",
144
155
  get disabled() {
145
- return c();
156
+ return l();
146
157
  },
147
158
  get title() {
148
159
  return t.closeLabel;
@@ -151,57 +162,65 @@ function at(t) {
151
162
  return t.closeLabel;
152
163
  },
153
164
  onClick: () => q(!0)
154
- }), null), we(f, Se(() => t.bodyProps, {
165
+ }), null), Ce(f, Se(() => t.bodyProps, {
155
166
  get class() {
156
167
  return fe("floe-prompt-card-body", t.bodyProps?.class);
157
168
  }
158
- }), !1, !0), d(m, () => t.question), C.addEventListener("drop", (e) => {
159
- !t.attachment || !e.dataTransfer?.files.length || (e.preventDefault(), Y(Array.from(e.dataTransfer.files)));
160
- }), C.addEventListener("dragover", (e) => {
161
- t.attachment && !c() && !t.inputDisabled && e.dataTransfer?.types.includes("Files") && e.preventDefault();
162
- }), o.$$keydown = (e) => {
163
- e.key === "Enter" && !e.shiftKey && !e.isComposing && !D && (e.preventDefault(), re());
164
- }, o.addEventListener("compositionend", (e) => {
165
- D = !1, t.onValueChange(e.currentTarget.value);
166
- }), o.addEventListener("compositionupdate", (e) => t.onValueChange(e.currentTarget.value)), o.addEventListener("compositionstart", () => {
167
- D = !0;
168
- }), o.$$input = (e) => t.onValueChange(e.currentTarget.value), o.addEventListener("paste", (e) => {
169
- !t.attachment || !e.clipboardData?.files.length || (e.preventDefault(), Y(Array.from(e.clipboardData.files)));
170
- }), J((e) => {
171
- g = e, t.editorRef?.(e);
172
- }, o), d(C, u(E, {
169
+ }), !1, !0), c(f, u(E, {
170
+ get when() {
171
+ return t.question;
172
+ },
173
+ get children() {
174
+ var e = _e();
175
+ return c(e, () => t.question), e;
176
+ }
177
+ }), d), d.addEventListener("drop", (e) => {
178
+ !t.attachment || !e.dataTransfer?.files.length || (e.preventDefault(), J(Array.from(e.dataTransfer.files)));
179
+ }), d.addEventListener("dragover", (e) => {
180
+ t.attachment && !l() && !t.inputDisabled && e.dataTransfer?.types.includes("Files") && e.preventDefault();
181
+ }), c(d, u(E, {
173
182
  get when() {
174
183
  return t.references;
175
184
  },
176
185
  get children() {
177
186
  var e = Ne();
178
- return d(e, () => t.references), N(() => e.inert = !!c()), e;
187
+ return c(e, () => t.references), X(() => e.inert = !!l()), e;
179
188
  }
180
- }), v), d(P, u(E, {
189
+ }), k), o.$$keydown = (e) => {
190
+ e.key === "Enter" && !e.shiftKey && !e.isComposing && !L && (e.preventDefault(), oe());
191
+ }, o.addEventListener("compositionend", (e) => {
192
+ L = !1, t.onValueChange(e.currentTarget.value);
193
+ }), o.addEventListener("compositionupdate", (e) => t.onValueChange(e.currentTarget.value)), o.addEventListener("compositionstart", () => {
194
+ L = !0;
195
+ }), o.$$input = (e) => t.onValueChange(e.currentTarget.value), o.addEventListener("paste", (e) => {
196
+ !t.attachment || !e.clipboardData?.files.length || (e.preventDefault(), J(Array.from(e.clipboardData.files)));
197
+ }), ee((e) => {
198
+ v = e, t.editorRef?.(e);
199
+ }, o), c(S, u(E, {
181
200
  get when() {
182
201
  return t.attachment;
183
202
  },
184
203
  get children() {
185
204
  return [(() => {
186
205
  var e = We();
187
- e.addEventListener("change", (l) => {
188
- Y(Array.from(l.currentTarget.files ?? [])), l.currentTarget.value = "";
189
- }), e.addEventListener("cancel", Q);
190
- var r = j;
191
- return typeof r == "function" ? J(r, e) : j = e, N((l) => {
192
- var b = t.attachment?.accept, x = c() || t.inputDisabled;
193
- return b !== l.e && y(e, "accept", l.e = b), x !== l.t && (e.disabled = l.t = x), l;
206
+ e.addEventListener("change", (a) => {
207
+ J(Array.from(a.currentTarget.files ?? [])), a.currentTarget.value = "";
208
+ }), e.addEventListener("cancel", G);
209
+ var m = p;
210
+ return typeof m == "function" ? ee(m, e) : p = e, X((a) => {
211
+ var h = t.attachment?.accept, b = l() || t.inputDisabled;
212
+ return h !== a.e && x(e, "accept", a.e = h), b !== a.t && (e.disabled = a.t = b), a;
194
213
  }, {
195
214
  e: void 0,
196
215
  t: void 0
197
216
  }), e;
198
- })(), u(ee, {
217
+ })(), u(ne, {
199
218
  variant: "ghost",
200
219
  size: "icon",
201
- icon: He,
220
+ icon: Be,
202
221
  class: "floe-prompt-card-attach",
203
222
  get disabled() {
204
- return c() || t.inputDisabled;
223
+ return l() || t.inputDisabled;
205
224
  },
206
225
  get "aria-label"() {
207
226
  return t.attachment?.label;
@@ -209,24 +228,24 @@ function at(t) {
209
228
  get title() {
210
229
  return t.attachment?.label;
211
230
  },
212
- onClick: () => j?.click()
231
+ onClick: () => p?.click()
213
232
  })];
214
233
  }
215
- }), null), d(P, u(E, {
234
+ }), null), c(S, u(E, {
216
235
  get when() {
217
236
  return t.selection;
218
237
  },
219
238
  get children() {
220
- return u(Re, {
239
+ return u(qe, {
221
240
  ref: (e) => {
222
241
  B = e;
223
242
  },
224
243
  class: "floe-prompt-card-selection",
225
244
  get open() {
226
- return he();
245
+ return ge();
227
246
  },
228
- onOpenChange: ae,
229
- onOptionSelect: Q,
247
+ onOpenChange: ie,
248
+ onOptionSelect: G,
230
249
  get zIndex() {
231
250
  return (t.zIndex ?? 100) + 1;
232
251
  },
@@ -242,9 +261,18 @@ function at(t) {
242
261
  get options() {
243
262
  return t.selection.options;
244
263
  },
264
+ get renderOption() {
265
+ return t.selection.renderOption;
266
+ },
267
+ get search() {
268
+ return t.selection.search;
269
+ },
270
+ get popupClass() {
271
+ return t.selection.popupClass;
272
+ },
245
273
  onChange: (e) => t.selection.onChange(e),
246
274
  get disabled() {
247
- return c() || t.inputDisabled;
275
+ return l() || t.inputDisabled;
248
276
  },
249
277
  get loading() {
250
278
  return t.selection.loading;
@@ -257,19 +285,19 @@ function at(t) {
257
285
  }
258
286
  });
259
287
  }
260
- }), null), d(v, u(ee, {
288
+ }), null), c($, u(ne, {
261
289
  variant: "primary",
262
290
  size: "icon",
263
- icon: qe,
291
+ icon: He,
264
292
  class: "floe-prompt-card-submit",
265
293
  get disabled() {
266
294
  return t.submitDisabled;
267
295
  },
268
296
  get loading() {
269
- return c();
297
+ return l();
270
298
  },
271
299
  get "aria-busy"() {
272
- return c() ? "true" : "false";
300
+ return l() ? "true" : "false";
273
301
  },
274
302
  get title() {
275
303
  return t.submitLabel;
@@ -277,18 +305,18 @@ function at(t) {
277
305
  get "aria-label"() {
278
306
  return t.submitLabel;
279
307
  },
280
- onClick: re
281
- }), null), d(f, u(E, {
308
+ onClick: oe
309
+ }), null), c(f, u(E, {
282
310
  get when() {
283
311
  return t.feedback;
284
312
  },
285
313
  get children() {
286
314
  var e = Xe();
287
- return d(e, () => t.feedback), e;
315
+ return c(e, () => t.feedback), e;
288
316
  }
289
- }), null), N((e) => {
290
- var r = H() ? "absolute" : "fixed", l = `${ie().x}px`, b = `${ie().y}px`, x = `${S().availableWidth / A().x}px`, T = `${S().maxHeight / A().y}px`, I = `${S().originX / A().x}px`, G = t.zIndex ?? 100, R = fe("floe-prompt-card floe-floating-presence", t.class), V = S().side, _ = w.state(), oe = w.exiting(), le = w.exiting() ? "true" : void 0, ce = t.inputLabel, se = t.placeholder, de = c() || t.inputDisabled;
291
- return r !== e.e && M(n, "position", e.e = r), l !== e.t && M(n, "left", e.t = l), b !== e.a && M(n, "top", e.a = b), x !== e.o && M(n, "--floe-prompt-max-width", e.o = x), T !== e.i && M(n, "--floe-prompt-max-height", e.i = T), I !== e.n && M(n, "--floe-prompt-origin-x", e.n = I), G !== e.s && M(n, "z-index", e.s = G), R !== e.h && Ce(a, e.h = R), V !== e.r && y(a, "data-floating-side", e.r = V), _ !== e.d && y(a, "data-floating-presence", e.d = _), oe !== e.l && (a.inert = e.l = oe), le !== e.u && y(a, "aria-hidden", e.u = le), ce !== e.c && y(o, "aria-label", e.c = ce), se !== e.w && y(o, "placeholder", e.w = se), de !== e.m && (o.disabled = e.m = de), e;
317
+ }), null), X((e) => {
318
+ var m = H() ? "absolute" : "fixed", a = `${re().x}px`, h = `${re().y}px`, b = `${C().availableWidth / O().x}px`, I = `${C().maxHeight / O().y}px`, R = `${C().originX / O().x}px`, V = t.zIndex ?? 100, Z = fe("floe-prompt-card floe-floating-presence", t.class), _ = C().side, N = w.state(), W = w.exiting(), le = w.exiting() ? "true" : void 0, ce = t.inputLabel, se = t.placeholder, de = l() || t.inputDisabled;
319
+ return m !== e.e && M(n, "position", e.e = m), a !== e.t && M(n, "left", e.t = a), h !== e.a && M(n, "top", e.a = h), b !== e.o && M(n, "--floe-prompt-max-width", e.o = b), I !== e.i && M(n, "--floe-prompt-max-height", e.i = I), R !== e.n && M(n, "--floe-prompt-origin-x", e.n = R), V !== e.s && M(n, "z-index", e.s = V), Z !== e.h && Me(i, e.h = Z), _ !== e.r && x(i, "data-floating-side", e.r = _), N !== e.d && x(i, "data-floating-presence", e.d = N), W !== e.l && (i.inert = e.l = W), le !== e.u && x(i, "aria-hidden", e.u = le), ce !== e.c && x(o, "aria-label", e.c = ce), se !== e.w && x(o, "placeholder", e.w = se), de !== e.m && (o.disabled = e.m = de), e;
292
320
  }, {
293
321
  e: void 0,
294
322
  t: void 0,
@@ -305,13 +333,14 @@ function at(t) {
305
333
  c: void 0,
306
334
  w: void 0,
307
335
  m: void 0
308
- }), N(() => o.value = t.value), n;
336
+ }), X(() => o.value = t.value), n;
309
337
  }
310
338
  });
311
339
  }
312
340
  });
313
341
  }
314
- Me(["pointerdown", "focusin", "keydown", "input"]);
342
+ Ee(["pointerdown", "focusin", "keydown", "input"]);
315
343
  export {
316
- at as PromptCard
344
+ it as PromptCard,
345
+ Ue as capturePromptCardAnchor
317
346
  };
@@ -4,6 +4,10 @@ export interface SelectOption {
4
4
  label: string;
5
5
  disabled?: boolean;
6
6
  keywords?: string[];
7
+ /** Stable group identity; groupLabel supplies its user-facing heading. */
8
+ group?: string;
9
+ groupLabel?: string;
10
+ description?: string;
7
11
  }
8
12
  export interface SelectBaseProps {
9
13
  id?: string;
@@ -33,6 +37,12 @@ export interface SelectBaseProps {
33
37
  /** Disable local filtering when the host supplies remote search results. */
34
38
  filter?: boolean;
35
39
  renderOption?: (option: SelectOption) => JSX.Element;
40
+ /** Search inside a button-triggered dropdown without replacing its trigger. */
41
+ search?: Readonly<{
42
+ label: string;
43
+ placeholder?: string;
44
+ }>;
45
+ popupClass?: string;
36
46
  ref?: (control: HTMLButtonElement | HTMLInputElement) => void;
37
47
  }
38
48
  export interface SelectProps extends SelectBaseProps {