@floegence/floe-webapp-core 0.86.58 → 0.86.62
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/chat/blocks/BlockRenderer.js +1 -1
- package/dist/components/chat/blocks/CodeDiffBlock.js +56 -56
- package/dist/components/chat/blocks/ImageBlock.js +1 -1
- package/dist/components/chat/blocks/ToolCallBlock.js +57 -57
- package/dist/components/chat/status/ConnectionStatus.js +10 -10
- package/dist/components/deck/DeckCell.js +25 -25
- package/dist/components/deck/DeckContextMenu.js +20 -20
- package/dist/components/deck/DeckGrid.js +1 -1
- package/dist/components/deck/DeckTopBar.js +42 -42
- package/dist/components/deck/DropZonePreview.js +6 -6
- package/dist/components/deck/LayoutSelector.js +53 -53
- package/dist/components/deck/WidgetFrame.js +28 -28
- package/dist/components/deck/WidgetPalette.js +31 -31
- package/dist/components/deck/WidgetTypeSwitcher.js +31 -31
- package/dist/components/file-browser/Breadcrumb.js +27 -27
- package/dist/components/file-browser/DirectoryTree.js +15 -15
- package/dist/components/file-browser/DragPreview.js +58 -58
- package/dist/components/file-browser/FileBrowser.js +17 -17
- package/dist/components/file-browser/FileBrowserStatusBar.js +18 -18
- package/dist/components/file-browser/FileBrowserToolbar.js +27 -27
- package/dist/components/file-browser/FileContextMenu.js +47 -47
- package/dist/components/file-browser/FileGridView.js +53 -51
- package/dist/components/file-browser/FileItemDecorations.js +30 -27
- package/dist/components/file-browser/FileListView.js +114 -114
- package/dist/components/icons/index.js +1357 -1357
- package/dist/components/launchpad/Launchpad.js +14 -14
- package/dist/components/launchpad/LaunchpadGrid.js +7 -7
- package/dist/components/launchpad/LaunchpadItem.js +11 -11
- package/dist/components/launchpad/LaunchpadPagination.js +16 -16
- package/dist/components/launchpad/LaunchpadSearch.js +9 -9
- package/dist/components/layout/ActivityBar.js +52 -55
- package/dist/components/layout/BottomBar.js +17 -17
- package/dist/components/layout/MobileNavigationPanel.js +36 -36
- package/dist/components/layout/MobileTabBar.js +39 -39
- package/dist/components/layout/Panel.js +16 -16
- package/dist/components/layout/ResizeHandle.js +19 -19
- package/dist/components/layout/Shell.js +50 -50
- package/dist/components/layout/Sidebar.js +37 -36
- package/dist/components/layout/SidebarPane.js +19 -19
- package/dist/components/layout/TopBar.js +16 -16
- package/dist/components/layout/TopBarIconButton.js +15 -15
- package/dist/components/loading/LoadingOverlay.js +9 -9
- package/dist/components/loading/Skeleton.js +11 -11
- package/dist/components/ui/Button.js +36 -36
- package/dist/components/ui/Card.d.ts +11 -62
- package/dist/components/ui/Card.js +64 -237
- package/dist/components/ui/Checkbox.js +79 -79
- package/dist/components/ui/CommandPalette.js +56 -55
- package/dist/components/ui/Dialog.js +91 -93
- package/dist/components/ui/DirectoryInput.js +22 -22
- package/dist/components/ui/DirectoryPicker.js +8 -8
- package/dist/components/ui/Dropdown.js +89 -87
- package/dist/components/ui/FeedbackIndicator.js +57 -57
- package/dist/components/ui/FileOpenPicker.js +37 -37
- package/dist/components/ui/FileSavePicker.js +41 -41
- package/dist/components/ui/FloatingWindow.js +266 -261
- package/dist/components/ui/Form.js +76 -76
- package/dist/components/ui/HighlightBlock.js +14 -14
- package/dist/components/ui/Input.js +106 -109
- package/dist/components/ui/Pagination.js +86 -86
- package/dist/components/ui/Popover.d.ts +33 -0
- package/dist/components/ui/Popover.js +133 -0
- package/dist/components/ui/ProcessingIndicator.js +344 -345
- package/dist/components/ui/Progress.js +94 -97
- package/dist/components/ui/QuoteBlock.js +25 -25
- package/dist/components/ui/Radio.js +91 -91
- package/dist/components/ui/SegmentedControl.js +24 -24
- package/dist/components/ui/Stepper.js +68 -60
- package/dist/components/ui/Switch.js +25 -25
- package/dist/components/ui/Tabs.js +99 -87
- package/dist/components/ui/Tag.js +12 -9
- package/dist/components/ui/Tooltip.js +30 -30
- package/dist/components/ui/floatingPresence.d.ts +7 -0
- package/dist/components/ui/floatingPresence.js +80 -39
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/picker/DirectoryFavorites.js +27 -27
- package/dist/components/ui/picker/PickerBase.js +107 -107
- package/dist/context/NotificationContext.js +4 -4
- package/dist/context/ThemeContext.js +71 -70
- package/dist/floe.css +205 -43
- package/dist/full.js +650 -652
- package/dist/language.css +320 -0
- package/dist/primitives.css +23 -17
- package/dist/standalone.css +1 -0
- package/dist/styles/themes/classicSemanticTokens.d.ts +122 -122
- package/dist/styles/themes/classicSemanticTokens.js +140 -138
- package/dist/styles/themes/index.d.ts +3 -1
- package/dist/styles/themes/index.js +10 -10
- package/dist/styles/themes/presets.d.ts +2 -2
- package/dist/styles/themes/presets.js +34 -34
- package/dist/styles/tokens.d.ts +152 -68
- package/dist/styles/tokens.js +87 -49
- package/dist/styles.css +1 -1
- package/dist/surface.css +161 -116
- package/dist/themes/dark.css +64 -64
- package/dist/themes/light.css +64 -64
- package/dist/ui.css +171 -255
- package/dist/ui.js +176 -178
- package/dist/utils/hotInteraction.d.ts +7 -0
- package/dist/utils/hotInteraction.js +12 -12
- package/dist/widgets/TerminalWidget.js +28 -28
- package/dist/workbench-composition.css +15 -15
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createComponent as t, spread as M, mergeProps as I, insert as s, effect as g, className as w, memo as J, setAttribute as
|
|
2
|
-
import { splitProps as j, createMemo as q, Switch as H, Match as N, Show as
|
|
3
|
-
import { cn as
|
|
4
|
-
var K = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M9.78 4.22a.75.75 0 010 1.06L7.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L5.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), O = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M6.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), Q = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M8.78 4.22a.75.75 0 010 1.06L6.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L4.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd></path><path fill-rule=evenodd d="M12.78 4.22a.75.75 0 010 1.06L10.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L8.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), U = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M3.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L5.94 8 3.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd></path><path fill-rule=evenodd d="M7.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L9.94 8 7.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), V = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><circle cx=4 cy=8 r=1.5></circle><circle cx=8 cy=8 r=1.5></circle><circle cx=12 cy=8 r=1.5>'), W = /* @__PURE__ */ u("<button type=button data-floe-surface-part=action>"), X = /* @__PURE__ */ u("<nav aria-label=Pagination><span>Page <!> of "), Y = /* @__PURE__ */ u("<nav aria-label=Pagination><span> / "), Z = /* @__PURE__ */ u("<span> items"), ee = /* @__PURE__ */ u('<div class="flex items-center gap-2"><span>Show</span><select data-floe-surface=inset>'), te = /* @__PURE__ */ u('<div class="flex items-center gap-2"><span>Go to</span><input data-floe-surface=inset type=number min=1>'), re = /* @__PURE__ */ u('<nav aria-label=Pagination><div class="flex items-center gap-1">'),
|
|
1
|
+
import { createComponent as t, spread as M, mergeProps as I, insert as s, effect as g, className as w, memo as J, setAttribute as m, template as u, delegateEvents as D } from "solid-js/web";
|
|
2
|
+
import { splitProps as j, createMemo as q, Switch as H, Match as N, Show as $, For as E } from "solid-js";
|
|
3
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
|
+
var K = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M9.78 4.22a.75.75 0 010 1.06L7.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L5.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), O = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M6.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), Q = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M8.78 4.22a.75.75 0 010 1.06L6.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L4.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd></path><path fill-rule=evenodd d="M12.78 4.22a.75.75 0 010 1.06L10.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L8.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), U = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M3.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L5.94 8 3.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd></path><path fill-rule=evenodd d="M7.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L9.94 8 7.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), V = /* @__PURE__ */ u('<svg viewBox="0 0 16 16"fill=currentColor><circle cx=4 cy=8 r=1.5></circle><circle cx=8 cy=8 r=1.5></circle><circle cx=12 cy=8 r=1.5>'), W = /* @__PURE__ */ u("<button type=button data-floe-surface-part=action>"), X = /* @__PURE__ */ u("<nav aria-label=Pagination><span>Page <!> of "), Y = /* @__PURE__ */ u("<nav aria-label=Pagination><span> / "), Z = /* @__PURE__ */ u("<span> items"), ee = /* @__PURE__ */ u('<div class="flex items-center gap-2"><span>Show</span><select data-floe-surface=inset>'), te = /* @__PURE__ */ u('<div class="flex items-center gap-2"><span>Go to</span><input data-floe-surface=inset type=number min=1>'), re = /* @__PURE__ */ u('<nav aria-label=Pagination><div class="flex items-center gap-1">'), le = /* @__PURE__ */ u("<option>"), ne = /* @__PURE__ */ u("<span>");
|
|
5
5
|
const ae = {
|
|
6
6
|
sm: {
|
|
7
7
|
button: "h-7 min-w-7 px-2 text-xs",
|
|
@@ -19,88 +19,88 @@ const ae = {
|
|
|
19
19
|
input: "h-9 w-18 text-sm"
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
function A(
|
|
22
|
+
function A(d) {
|
|
23
23
|
return (() => {
|
|
24
24
|
var e = K();
|
|
25
|
-
return g(() =>
|
|
25
|
+
return g(() => m(e, "class", d.class)), e;
|
|
26
26
|
})();
|
|
27
27
|
}
|
|
28
|
-
function R(
|
|
28
|
+
function R(d) {
|
|
29
29
|
return (() => {
|
|
30
30
|
var e = O();
|
|
31
|
-
return g(() =>
|
|
31
|
+
return g(() => m(e, "class", d.class)), e;
|
|
32
32
|
})();
|
|
33
33
|
}
|
|
34
|
-
function T(
|
|
34
|
+
function T(d) {
|
|
35
35
|
return (() => {
|
|
36
36
|
var e = Q();
|
|
37
|
-
return g(() =>
|
|
37
|
+
return g(() => m(e, "class", d.class)), e;
|
|
38
38
|
})();
|
|
39
39
|
}
|
|
40
|
-
function G(
|
|
40
|
+
function G(d) {
|
|
41
41
|
return (() => {
|
|
42
42
|
var e = U();
|
|
43
|
-
return g(() =>
|
|
43
|
+
return g(() => m(e, "class", d.class)), e;
|
|
44
44
|
})();
|
|
45
45
|
}
|
|
46
|
-
function ie(
|
|
46
|
+
function ie(d) {
|
|
47
47
|
return (() => {
|
|
48
48
|
var e = V();
|
|
49
|
-
return g(() =>
|
|
49
|
+
return g(() => m(e, "class", d.class)), e;
|
|
50
50
|
})();
|
|
51
51
|
}
|
|
52
|
-
function se(
|
|
53
|
-
const P =
|
|
52
|
+
function se(d, e, x) {
|
|
53
|
+
const P = x * 2 + 5;
|
|
54
54
|
if (e <= P)
|
|
55
55
|
return Array.from({
|
|
56
56
|
length: e
|
|
57
57
|
}, (b, o) => o + 1);
|
|
58
|
-
const
|
|
59
|
-
return !
|
|
60
|
-
length: 3 + 2 *
|
|
61
|
-
}, (o,
|
|
62
|
-
length: 3 + 2 *
|
|
63
|
-
}, (o,
|
|
64
|
-
length:
|
|
65
|
-
}, (b, o) =>
|
|
58
|
+
const _ = Math.max(d - x, 1), y = Math.min(d + x, e), v = _ > 2, z = y < e - 1;
|
|
59
|
+
return !v && z ? [...Array.from({
|
|
60
|
+
length: 3 + 2 * x
|
|
61
|
+
}, (o, S) => S + 1), "ellipsis", e] : v && !z ? [1, "ellipsis", ...Array.from({
|
|
62
|
+
length: 3 + 2 * x
|
|
63
|
+
}, (o, S) => e - (3 + 2 * x) + S + 1)] : [1, "ellipsis", ...Array.from({
|
|
64
|
+
length: y - _ + 1
|
|
65
|
+
}, (b, o) => _ + o), "ellipsis", e];
|
|
66
66
|
}
|
|
67
|
-
function ue(
|
|
68
|
-
const [e,
|
|
67
|
+
function ue(d) {
|
|
68
|
+
const [e, x] = j(d, ["page", "totalPages", "onChange", "size", "variant", "siblingCount", "showFirstLast", "showPageSize", "pageSize", "pageSizes", "onPageSizeChange", "showJumpTo", "totalItems", "disabled", "class"]), P = () => e.size ?? "md", _ = () => e.variant ?? "default", y = () => e.siblingCount ?? 1, v = () => ae[P()], z = q(() => se(e.page, e.totalPages, y())), L = () => e.page > 1, b = () => e.page < e.totalPages, o = (r) => {
|
|
69
69
|
if (e.disabled) return;
|
|
70
70
|
const a = Math.max(1, Math.min(r, e.totalPages));
|
|
71
71
|
a !== e.page && e.onChange?.(a);
|
|
72
|
-
},
|
|
73
|
-
const a = r.target,
|
|
74
|
-
isNaN(
|
|
75
|
-
},
|
|
72
|
+
}, S = (r) => {
|
|
73
|
+
const a = r.target, l = parseInt(a.value, 10);
|
|
74
|
+
isNaN(l) || o(l), a.value = "";
|
|
75
|
+
}, p = (r) => {
|
|
76
76
|
const a = () => r.onClick?.();
|
|
77
77
|
return (() => {
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
-
var
|
|
81
|
-
return
|
|
78
|
+
var l = W();
|
|
79
|
+
return l.$$click = a, s(l, () => r.children), g((i) => {
|
|
80
|
+
var c = r.isActive ? "inset" : "raised", n = r.isActive ? "page" : void 0, h = r.disabled || e.disabled, C = r.title, k = f("inline-flex items-center justify-center rounded-sm font-medium", "transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] cursor-pointer", v().button, r.isActive ? "bg-[var(--floe-plane)] text-[var(--floe-ink)] border border-[var(--floe-accent-line)] shadow-[var(--floe-elevation-raised)]" : "bg-transparent text-[var(--floe-ink-soft)] border border-[var(--floe-line)] hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", (r.disabled || e.disabled) && "opacity-50 cursor-not-allowed");
|
|
81
|
+
return c !== i.e && m(l, "data-floe-surface", i.e = c), n !== i.t && m(l, "aria-current", i.t = n), h !== i.a && (l.disabled = i.a = h), C !== i.o && m(l, "title", i.o = C), k !== i.i && w(l, i.i = k), i;
|
|
82
82
|
}, {
|
|
83
83
|
e: void 0,
|
|
84
84
|
t: void 0,
|
|
85
85
|
a: void 0,
|
|
86
86
|
o: void 0,
|
|
87
87
|
i: void 0
|
|
88
|
-
}),
|
|
88
|
+
}), l;
|
|
89
89
|
})();
|
|
90
90
|
};
|
|
91
91
|
return t(H, {
|
|
92
92
|
get children() {
|
|
93
93
|
return [t(N, {
|
|
94
94
|
get when() {
|
|
95
|
-
return
|
|
95
|
+
return _() === "simple";
|
|
96
96
|
},
|
|
97
97
|
get children() {
|
|
98
|
-
var r = X(), a = r.firstChild,
|
|
98
|
+
var r = X(), a = r.firstChild, l = a.firstChild, i = l.nextSibling;
|
|
99
99
|
return i.nextSibling, M(r, I({
|
|
100
100
|
get class() {
|
|
101
|
-
return
|
|
101
|
+
return f("flex items-center gap-2", e.class);
|
|
102
102
|
}
|
|
103
|
-
},
|
|
103
|
+
}, x), !1, !0), s(r, t(p, {
|
|
104
104
|
get disabled() {
|
|
105
105
|
return !L();
|
|
106
106
|
},
|
|
@@ -111,7 +111,7 @@ function ue(c) {
|
|
|
111
111
|
class: "w-4 h-4"
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
}), a), s(a, () => e.page, i), s(a, () => e.totalPages, null), s(r, t(
|
|
114
|
+
}), a), s(a, () => e.page, i), s(a, () => e.totalPages, null), s(r, t(p, {
|
|
115
115
|
get disabled() {
|
|
116
116
|
return !b();
|
|
117
117
|
},
|
|
@@ -122,24 +122,24 @@ function ue(c) {
|
|
|
122
122
|
class: "w-4 h-4"
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
}), null), g(() => w(a,
|
|
125
|
+
}), null), g(() => w(a, f("text-[var(--floe-ink-soft)] px-2", v().text))), r;
|
|
126
126
|
}
|
|
127
127
|
}), t(N, {
|
|
128
128
|
get when() {
|
|
129
|
-
return
|
|
129
|
+
return _() === "minimal";
|
|
130
130
|
},
|
|
131
131
|
get children() {
|
|
132
|
-
var r = Y(), a = r.firstChild,
|
|
132
|
+
var r = Y(), a = r.firstChild, l = a.firstChild;
|
|
133
133
|
return M(r, I({
|
|
134
134
|
get class() {
|
|
135
|
-
return
|
|
135
|
+
return f("flex items-center gap-1", e.class);
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, x), !1, !0), s(r, t($, {
|
|
138
138
|
get when() {
|
|
139
139
|
return e.showFirstLast;
|
|
140
140
|
},
|
|
141
141
|
get children() {
|
|
142
|
-
return t(
|
|
142
|
+
return t(p, {
|
|
143
143
|
get disabled() {
|
|
144
144
|
return !L();
|
|
145
145
|
},
|
|
@@ -152,7 +152,7 @@ function ue(c) {
|
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
}), a), s(r, t(
|
|
155
|
+
}), a), s(r, t(p, {
|
|
156
156
|
get disabled() {
|
|
157
157
|
return !L();
|
|
158
158
|
},
|
|
@@ -163,7 +163,7 @@ function ue(c) {
|
|
|
163
163
|
class: "w-4 h-4"
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
}), a), s(a, () => e.page,
|
|
166
|
+
}), a), s(a, () => e.page, l), s(a, () => e.totalPages, null), s(r, t(p, {
|
|
167
167
|
get disabled() {
|
|
168
168
|
return !b();
|
|
169
169
|
},
|
|
@@ -174,12 +174,12 @@ function ue(c) {
|
|
|
174
174
|
class: "w-4 h-4"
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
}), null), s(r, t(
|
|
177
|
+
}), null), s(r, t($, {
|
|
178
178
|
get when() {
|
|
179
179
|
return e.showFirstLast;
|
|
180
180
|
},
|
|
181
181
|
get children() {
|
|
182
|
-
return t(
|
|
182
|
+
return t(p, {
|
|
183
183
|
get disabled() {
|
|
184
184
|
return !b();
|
|
185
185
|
},
|
|
@@ -192,55 +192,55 @@ function ue(c) {
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
}), null), g(() => w(a,
|
|
195
|
+
}), null), g(() => w(a, f("text-[var(--floe-ink-soft)] px-3 tabular-nums", v().text))), r;
|
|
196
196
|
}
|
|
197
197
|
}), t(N, {
|
|
198
198
|
get when() {
|
|
199
|
-
return
|
|
199
|
+
return _() === "default";
|
|
200
200
|
},
|
|
201
201
|
get children() {
|
|
202
202
|
var r = re(), a = r.firstChild;
|
|
203
203
|
return M(r, I({
|
|
204
204
|
get class() {
|
|
205
|
-
return
|
|
205
|
+
return f("flex items-center gap-4", e.class);
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, x), !1, !0), s(r, t($, {
|
|
208
208
|
get when() {
|
|
209
209
|
return e.totalItems !== void 0;
|
|
210
210
|
},
|
|
211
211
|
get children() {
|
|
212
|
-
var
|
|
213
|
-
return s(
|
|
212
|
+
var l = Z(), i = l.firstChild;
|
|
213
|
+
return s(l, () => e.totalItems, i), g(() => w(l, f("text-[var(--floe-ink-soft)]", v().text))), l;
|
|
214
214
|
}
|
|
215
|
-
}), a), s(r, t(
|
|
215
|
+
}), a), s(r, t($, {
|
|
216
216
|
get when() {
|
|
217
217
|
return J(() => !!e.showPageSize)() && e.pageSizes;
|
|
218
218
|
},
|
|
219
219
|
get children() {
|
|
220
|
-
var
|
|
221
|
-
return
|
|
220
|
+
var l = ee(), i = l.firstChild, c = i.nextSibling;
|
|
221
|
+
return c.addEventListener("change", (n) => e.onPageSizeChange?.(parseInt(n.target.value, 10))), s(c, t(E, {
|
|
222
222
|
get each() {
|
|
223
223
|
return e.pageSizes;
|
|
224
224
|
},
|
|
225
|
-
children: (
|
|
226
|
-
var
|
|
227
|
-
return
|
|
225
|
+
children: (n) => (() => {
|
|
226
|
+
var h = le();
|
|
227
|
+
return h.value = n, s(h, n), h;
|
|
228
228
|
})()
|
|
229
|
-
})), g((
|
|
230
|
-
var
|
|
231
|
-
return
|
|
229
|
+
})), g((n) => {
|
|
230
|
+
var h = f("text-[var(--floe-ink-soft)]", v().text), C = e.disabled, k = f("rounded-control border border-[var(--floe-line)] bg-background px-2 focus:outline-none", v().input, e.disabled && "opacity-50 cursor-not-allowed");
|
|
231
|
+
return h !== n.e && w(i, n.e = h), C !== n.t && (c.disabled = n.t = C), k !== n.a && w(c, n.a = k), n;
|
|
232
232
|
}, {
|
|
233
233
|
e: void 0,
|
|
234
234
|
t: void 0,
|
|
235
235
|
a: void 0
|
|
236
|
-
}), g(() =>
|
|
236
|
+
}), g(() => c.value = e.pageSize), l;
|
|
237
237
|
}
|
|
238
|
-
}), a), s(a, t(
|
|
238
|
+
}), a), s(a, t($, {
|
|
239
239
|
get when() {
|
|
240
240
|
return e.showFirstLast;
|
|
241
241
|
},
|
|
242
242
|
get children() {
|
|
243
|
-
return t(
|
|
243
|
+
return t(p, {
|
|
244
244
|
get disabled() {
|
|
245
245
|
return !L();
|
|
246
246
|
},
|
|
@@ -253,7 +253,7 @@ function ue(c) {
|
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
}), null), s(a, t(
|
|
256
|
+
}), null), s(a, t(p, {
|
|
257
257
|
get disabled() {
|
|
258
258
|
return !L();
|
|
259
259
|
},
|
|
@@ -268,20 +268,20 @@ function ue(c) {
|
|
|
268
268
|
get each() {
|
|
269
269
|
return z();
|
|
270
270
|
},
|
|
271
|
-
children: (
|
|
272
|
-
var i =
|
|
271
|
+
children: (l) => l === "ellipsis" ? (() => {
|
|
272
|
+
var i = ne();
|
|
273
273
|
return s(i, t(ie, {
|
|
274
274
|
class: "w-4 h-4"
|
|
275
|
-
})), g(() => w(i,
|
|
276
|
-
})() : t(
|
|
277
|
-
page:
|
|
275
|
+
})), g(() => w(i, f("px-2 text-[var(--floe-ink-soft)]", v().text))), i;
|
|
276
|
+
})() : t(p, {
|
|
277
|
+
page: l,
|
|
278
278
|
get isActive() {
|
|
279
|
-
return
|
|
279
|
+
return l === e.page;
|
|
280
280
|
},
|
|
281
|
-
onClick: () => o(
|
|
282
|
-
children:
|
|
281
|
+
onClick: () => o(l),
|
|
282
|
+
children: l
|
|
283
283
|
})
|
|
284
|
-
}), null), s(a, t(
|
|
284
|
+
}), null), s(a, t(p, {
|
|
285
285
|
get disabled() {
|
|
286
286
|
return !b();
|
|
287
287
|
},
|
|
@@ -292,12 +292,12 @@ function ue(c) {
|
|
|
292
292
|
class: "w-4 h-4"
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
-
}), null), s(a, t(
|
|
295
|
+
}), null), s(a, t($, {
|
|
296
296
|
get when() {
|
|
297
297
|
return e.showFirstLast;
|
|
298
298
|
},
|
|
299
299
|
get children() {
|
|
300
|
-
return t(
|
|
300
|
+
return t(p, {
|
|
301
301
|
get disabled() {
|
|
302
302
|
return !b();
|
|
303
303
|
},
|
|
@@ -310,22 +310,22 @@ function ue(c) {
|
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
}), null), s(r, t(
|
|
313
|
+
}), null), s(r, t($, {
|
|
314
314
|
get when() {
|
|
315
315
|
return e.showJumpTo;
|
|
316
316
|
},
|
|
317
317
|
get children() {
|
|
318
|
-
var
|
|
319
|
-
return
|
|
320
|
-
var
|
|
321
|
-
return
|
|
318
|
+
var l = te(), i = l.firstChild, c = i.nextSibling;
|
|
319
|
+
return c.addEventListener("blur", S), c.$$keydown = (n) => n.key === "Enter" && S(n), g((n) => {
|
|
320
|
+
var h = f("text-[var(--floe-ink-soft)]", v().text), C = e.totalPages, k = String(e.page), F = e.disabled, B = f("rounded-control border border-[var(--floe-line)] bg-background px-2 text-center", "focus:outline-none", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", v().input, e.disabled && "opacity-50 cursor-not-allowed");
|
|
321
|
+
return h !== n.e && w(i, n.e = h), C !== n.t && m(c, "max", n.t = C), k !== n.a && m(c, "placeholder", n.a = k), F !== n.o && (c.disabled = n.o = F), B !== n.i && w(c, n.i = B), n;
|
|
322
322
|
}, {
|
|
323
323
|
e: void 0,
|
|
324
324
|
t: void 0,
|
|
325
325
|
a: void 0,
|
|
326
326
|
o: void 0,
|
|
327
327
|
i: void 0
|
|
328
|
-
}),
|
|
328
|
+
}), l;
|
|
329
329
|
}
|
|
330
330
|
}), null), r;
|
|
331
331
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export type PopoverPlacement = 'bottom-start' | 'bottom-center' | 'bottom-end' | 'top-start' | 'top-center' | 'top-end';
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
/** The element that opens the panel. It keeps its own layout and semantics. */
|
|
5
|
+
trigger: JSX.Element;
|
|
6
|
+
children: JSX.Element | ((close: () => void) => JSX.Element);
|
|
7
|
+
/** Controlled visibility. Omit for uncontrolled use with `defaultOpen`. */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
placement?: PopoverPlacement;
|
|
12
|
+
/** Accessible name for the panel. */
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
/** Panel width in CSS pixels. Content can still shrink below it. */
|
|
15
|
+
width?: number;
|
|
16
|
+
class?: string;
|
|
17
|
+
/** Reset the trigger boundary onto an input surface instead of a plain button. */
|
|
18
|
+
triggerInputSurface?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Panel content that owns its own pointer semantics, such as a native text
|
|
21
|
+
* selection, still closes on outside pointer input.
|
|
22
|
+
*/
|
|
23
|
+
closeOnEscape?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A non-modal anchored panel.
|
|
27
|
+
*
|
|
28
|
+
* Unlike Dropdown it carries no menu semantics: the panel is a plain labelled
|
|
29
|
+
* region, so it can host forms, previews, or reading content. Placement,
|
|
30
|
+
* portal ownership, and exit motion reuse the same primitives as the menu so
|
|
31
|
+
* both layers move and dismiss identically.
|
|
32
|
+
*/
|
|
33
|
+
export declare function Popover(props: PopoverProps): JSX.Element;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { setAttribute as i, insert as g, createComponent as R, Portal as M, spread as H, mergeProps as T, memo as z, effect as j, template as k, use as S, delegateEvents as q } from "solid-js/web";
|
|
2
|
+
import { createSignal as O, 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__ */ k("<div data-floe-popover-panel role=dialog aria-modal=false data-floe-surface=floating>"), ne = /* @__PURE__ */ k('<div class="relative inline-flex"><div class=inline-flex data-floe-popover-trigger aria-haspopup=dialog>');
|
|
10
|
+
let re = 0;
|
|
11
|
+
function me(n) {
|
|
12
|
+
const h = () => n.open !== void 0, [B, A] = O(n.defaultOpen ?? !1), s = () => h() ? !!n.open : B(), c = (o) => {
|
|
13
|
+
h() || A(o), o !== s() && n.onOpenChange?.(o);
|
|
14
|
+
}, r = Q({
|
|
15
|
+
open: s,
|
|
16
|
+
element: () => l
|
|
17
|
+
}), [w, v] = O({
|
|
18
|
+
x: -9999,
|
|
19
|
+
y: -9999
|
|
20
|
+
});
|
|
21
|
+
let a, l;
|
|
22
|
+
const p = `floe-popover-${re += 1}`, b = `${p}-panel`, u = N(() => r.mounted() ? X({
|
|
23
|
+
owner: a
|
|
24
|
+
}) : {
|
|
25
|
+
host: null,
|
|
26
|
+
boundaryHost: null,
|
|
27
|
+
mountHost: null,
|
|
28
|
+
mode: "global"
|
|
29
|
+
}), F = () => ee(u()), y = () => Z(u()), I = () => te(u()), x = (o) => Y(o, u()), P = () => (n.placement ?? "bottom-start").startsWith("top") ? "top" : "bottom", L = () => (n.placement ?? "bottom-start").slice(P() === "top" ? 5 : 7), _ = () => c(!1);
|
|
30
|
+
V({
|
|
31
|
+
open: r.mounted,
|
|
32
|
+
root: () => l,
|
|
33
|
+
containsTarget: (o) => {
|
|
34
|
+
const e = o instanceof Element ? o : document.activeElement;
|
|
35
|
+
return e?.closest(`[data-floe-popover="${p}"]`) ? !0 : !!a?.contains(e ?? null);
|
|
36
|
+
},
|
|
37
|
+
onClose: () => c(!1),
|
|
38
|
+
onEscapeOutside: () => c(!1),
|
|
39
|
+
lockBodyScroll: !1,
|
|
40
|
+
trapFocus: !1,
|
|
41
|
+
autoFocus: !1,
|
|
42
|
+
restoreFocus: !1,
|
|
43
|
+
blockHotkeys: !1,
|
|
44
|
+
closeOnEscape: () => n.closeOnEscape === !1 ? !1 : "inside",
|
|
45
|
+
escapeKeyPhase: "bubble"
|
|
46
|
+
});
|
|
47
|
+
const E = () => {
|
|
48
|
+
if (!a || !l) return;
|
|
49
|
+
const o = G(a.getBoundingClientRect(), l.getBoundingClientRect(), L(), I());
|
|
50
|
+
if (P() === "top") {
|
|
51
|
+
const e = a.getBoundingClientRect(), f = l.getBoundingClientRect();
|
|
52
|
+
v({
|
|
53
|
+
x: o.x,
|
|
54
|
+
y: e.top - f.height - 6
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
v(o);
|
|
59
|
+
};
|
|
60
|
+
return U(() => {
|
|
61
|
+
if (!r.mounted()) {
|
|
62
|
+
v({
|
|
63
|
+
x: -9999,
|
|
64
|
+
y: -9999
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const o = requestAnimationFrame(E), e = () => E();
|
|
69
|
+
window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), K(() => {
|
|
70
|
+
cancelAnimationFrame(o), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
71
|
+
});
|
|
72
|
+
}), (() => {
|
|
73
|
+
var o = ne(), e = o.firstChild;
|
|
74
|
+
i(o, "data-floe-popover", p), e.$$keydown = (t) => {
|
|
75
|
+
t.key === "Escape" && s() && (t.stopPropagation(), c(!1));
|
|
76
|
+
}, e.$$click = () => c(!s());
|
|
77
|
+
var f = a;
|
|
78
|
+
return typeof f == "function" ? S(f, e) : a = e, g(e, () => n.trigger), g(o, R(W, {
|
|
79
|
+
get when() {
|
|
80
|
+
return r.mounted();
|
|
81
|
+
},
|
|
82
|
+
get children() {
|
|
83
|
+
return R(M, {
|
|
84
|
+
get mount() {
|
|
85
|
+
return F();
|
|
86
|
+
},
|
|
87
|
+
get children() {
|
|
88
|
+
var t = oe(), d = l;
|
|
89
|
+
return typeof d == "function" ? S(d, t) : l = t, i(t, "id", b), H(t, T({
|
|
90
|
+
get class() {
|
|
91
|
+
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", n.class);
|
|
92
|
+
},
|
|
93
|
+
get "data-floating-presence"() {
|
|
94
|
+
return r.state();
|
|
95
|
+
},
|
|
96
|
+
get "aria-hidden"() {
|
|
97
|
+
return r.exiting() ? "true" : void 0;
|
|
98
|
+
},
|
|
99
|
+
get "aria-label"() {
|
|
100
|
+
return n.ariaLabel;
|
|
101
|
+
},
|
|
102
|
+
get style() {
|
|
103
|
+
return {
|
|
104
|
+
left: `${x(w()).x}px`,
|
|
105
|
+
top: `${x(w()).y}px`,
|
|
106
|
+
"min-width": n.width ? `${n.width}px` : void 0,
|
|
107
|
+
"max-width": "min(calc(100vw - 24px), 420px)"
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}, () => ({
|
|
111
|
+
[J]: y() ? "true" : void 0
|
|
112
|
+
})), !1, !0), g(t, (() => {
|
|
113
|
+
var m = z(() => typeof n.children == "function");
|
|
114
|
+
return () => m() ? n.children(_) : n.children;
|
|
115
|
+
})()), t;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}), null), j((t) => {
|
|
120
|
+
var d = n.triggerInputSurface ? "true" : void 0, m = n.triggerInputSurface ? "inset" : void 0, $ = s(), C = r.mounted() ? b : void 0;
|
|
121
|
+
return d !== t.e && i(e, "data-floe-input-surface", t.e = d), m !== t.t && i(e, "data-floe-surface", t.t = m), $ !== t.a && i(e, "aria-expanded", t.a = $), C !== t.o && i(e, "aria-controls", t.o = C), t;
|
|
122
|
+
}, {
|
|
123
|
+
e: void 0,
|
|
124
|
+
t: void 0,
|
|
125
|
+
a: void 0,
|
|
126
|
+
o: void 0
|
|
127
|
+
}), o;
|
|
128
|
+
})();
|
|
129
|
+
}
|
|
130
|
+
q(["click", "keydown"]);
|
|
131
|
+
export {
|
|
132
|
+
me as Popover
|
|
133
|
+
};
|