@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.
- package/dist/components/ui/PromptCard.d.ts +7 -2
- package/dist/components/ui/PromptCard.js +152 -123
- package/dist/components/ui/Select.d.ts +10 -0
- package/dist/components/ui/Select.js +294 -220
- package/dist/components/ui/floatingPresence.js +50 -45
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/floe.css +10 -11
- package/dist/full.js +294 -293
- package/dist/styles.css +1 -1
- package/dist/ui.js +148 -147
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
2
|
-
import { createUniqueId as
|
|
3
|
-
import { useOverlayMask as
|
|
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
|
|
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
|
|
8
|
-
import { X as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Select as
|
|
11
|
-
import { createFloatingPresence as
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 [
|
|
31
|
+
const [g, ve] = z(Ie(window)), [A, be] = z(), [Q, xe] = z({
|
|
21
32
|
width: 0,
|
|
22
33
|
height: 0
|
|
23
|
-
}),
|
|
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
|
|
28
|
-
const
|
|
29
|
-
!
|
|
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
|
-
}),
|
|
33
|
-
t.open && !
|
|
43
|
+
}), J = (n) => {
|
|
44
|
+
t.open && !l() && !t.inputDisabled && n.length && (t.attachment?.onFiles(n), G());
|
|
34
45
|
};
|
|
35
|
-
|
|
36
|
-
(!t.open ||
|
|
46
|
+
U(() => {
|
|
47
|
+
(!t.open || l() || t.inputDisabled) && ie(!1);
|
|
37
48
|
});
|
|
38
|
-
const
|
|
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 = () =>
|
|
46
|
-
x:
|
|
47
|
-
y:
|
|
56
|
+
})), H = () => Oe(T()), O = F(() => (g(), Q(), H() ? De(T()) : {
|
|
57
|
+
x: g().fixedScale,
|
|
58
|
+
y: g().fixedScale
|
|
48
59
|
}));
|
|
49
|
-
|
|
50
|
-
w.mounted() &&
|
|
51
|
-
}),
|
|
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
|
|
55
|
-
const f = n.offsetWidth,
|
|
56
|
-
return s.width === f && s.height ===
|
|
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:
|
|
69
|
+
height: d
|
|
59
70
|
};
|
|
60
|
-
}),
|
|
61
|
-
|
|
71
|
+
}), r = new ResizeObserver(i);
|
|
72
|
+
r.observe(n), i(), te(() => r.disconnect());
|
|
62
73
|
});
|
|
63
|
-
const
|
|
64
|
-
const n =
|
|
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:
|
|
68
|
-
availableWidth:
|
|
69
|
-
maxHeight:
|
|
70
|
-
side:
|
|
71
|
-
originX:
|
|
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
|
-
}),
|
|
74
|
-
x: (
|
|
75
|
-
y: (
|
|
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
|
-
|
|
78
|
-
!t.open &&
|
|
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
|
-
|
|
94
|
+
U(() => {
|
|
84
95
|
if (!t.open) return;
|
|
85
|
-
const n = document.activeElement,
|
|
86
|
-
|
|
87
|
-
!t.open || t.autoFocus === !1 || !
|
|
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
|
-
}),
|
|
100
|
+
}), v.setSelectionRange(v.value.length, v.value.length));
|
|
90
101
|
});
|
|
91
|
-
}),
|
|
102
|
+
}), ke({
|
|
92
103
|
open: () => t.open,
|
|
93
|
-
root:
|
|
94
|
-
containsTarget: (n) => !!(n instanceof Node &&
|
|
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
|
|
109
|
-
!t.open ||
|
|
110
|
-
if (!
|
|
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
|
-
|
|
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(
|
|
134
|
+
return u(we, {
|
|
124
135
|
get mount() {
|
|
125
|
-
return
|
|
136
|
+
return Te(T());
|
|
126
137
|
},
|
|
127
138
|
get children() {
|
|
128
|
-
var n = Ke(),
|
|
129
|
-
return
|
|
130
|
-
e.key !== "Escape" || e.defaultPrevented || e.isComposing ||
|
|
131
|
-
},
|
|
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 =
|
|
137
|
-
return
|
|
147
|
+
var e = Ve();
|
|
148
|
+
return c(e, () => t.icon), e;
|
|
138
149
|
}
|
|
139
|
-
}), s),
|
|
150
|
+
}), s), x(s, "id", y), c(s, () => t.title), c(r, u(ne, {
|
|
140
151
|
variant: "ghost",
|
|
141
152
|
size: "icon",
|
|
142
|
-
icon:
|
|
153
|
+
icon: Fe,
|
|
143
154
|
class: "floe-prompt-card-close",
|
|
144
155
|
get disabled() {
|
|
145
|
-
return
|
|
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),
|
|
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),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}),
|
|
167
|
-
|
|
168
|
-
}),
|
|
169
|
-
|
|
170
|
-
}),
|
|
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
|
|
187
|
+
return c(e, () => t.references), X(() => e.inert = !!l()), e;
|
|
179
188
|
}
|
|
180
|
-
}),
|
|
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", (
|
|
188
|
-
|
|
189
|
-
}), e.addEventListener("cancel",
|
|
190
|
-
var
|
|
191
|
-
return typeof
|
|
192
|
-
var
|
|
193
|
-
return
|
|
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(
|
|
217
|
+
})(), u(ne, {
|
|
199
218
|
variant: "ghost",
|
|
200
219
|
size: "icon",
|
|
201
|
-
icon:
|
|
220
|
+
icon: Be,
|
|
202
221
|
class: "floe-prompt-card-attach",
|
|
203
222
|
get disabled() {
|
|
204
|
-
return
|
|
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: () =>
|
|
231
|
+
onClick: () => p?.click()
|
|
213
232
|
})];
|
|
214
233
|
}
|
|
215
|
-
}), null),
|
|
234
|
+
}), null), c(S, u(E, {
|
|
216
235
|
get when() {
|
|
217
236
|
return t.selection;
|
|
218
237
|
},
|
|
219
238
|
get children() {
|
|
220
|
-
return u(
|
|
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
|
|
245
|
+
return ge();
|
|
227
246
|
},
|
|
228
|
-
onOpenChange:
|
|
229
|
-
onOptionSelect:
|
|
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
|
|
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),
|
|
288
|
+
}), null), c($, u(ne, {
|
|
261
289
|
variant: "primary",
|
|
262
290
|
size: "icon",
|
|
263
|
-
icon:
|
|
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
|
|
297
|
+
return l();
|
|
270
298
|
},
|
|
271
299
|
get "aria-busy"() {
|
|
272
|
-
return
|
|
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:
|
|
281
|
-
}), null),
|
|
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
|
|
315
|
+
return c(e, () => t.feedback), e;
|
|
288
316
|
}
|
|
289
|
-
}), null),
|
|
290
|
-
var
|
|
291
|
-
return
|
|
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
|
-
}),
|
|
336
|
+
}), X(() => o.value = t.value), n;
|
|
309
337
|
}
|
|
310
338
|
});
|
|
311
339
|
}
|
|
312
340
|
});
|
|
313
341
|
}
|
|
314
|
-
|
|
342
|
+
Ee(["pointerdown", "focusin", "keydown", "input"]);
|
|
315
343
|
export {
|
|
316
|
-
|
|
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 {
|