@flytedan/flytebot-design-system 0.1.4 → 0.2.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/index.cjs +1070 -1053
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +1068 -1053
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +27 -0
package/dist/index.cjs
CHANGED
|
@@ -78,6 +78,8 @@ __export(index_exports, {
|
|
|
78
78
|
FileStrip: () => FileStrip,
|
|
79
79
|
FileTile: () => FileTile,
|
|
80
80
|
Flag: () => Flag,
|
|
81
|
+
FlytedeskBrand: () => FlytedeskBrand,
|
|
82
|
+
FlytedeskMark: () => FlytedeskMark,
|
|
81
83
|
FormatEta: () => FormatEta,
|
|
82
84
|
Gate: () => Gate,
|
|
83
85
|
IconButton: () => IconButton,
|
|
@@ -915,7 +917,7 @@ function Tip({ label, children }) {
|
|
|
915
917
|
}
|
|
916
918
|
function SidebarNav({ brand, groups = [], current: current2, onNavigate, footer, open = false, className = "", ...rest }) {
|
|
917
919
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: ["fd-side", className].filter(Boolean).join(" "), "data-open": open ? "true" : "false", ...rest, children: [
|
|
918
|
-
brand ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: {
|
|
920
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { minHeight: "var(--topbar-h)", display: "flex", alignItems: "center", padding: "10px 18px", borderBottom: "1px solid var(--border)", flex: "none" }, children: brand }) : null,
|
|
919
921
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { flex: 1, overflow: "auto", padding: "4px 10px 18px" }, children: groups.map((g, gi) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
920
922
|
g.label ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "fd-side-group", children: g.label }) : null,
|
|
921
923
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "fd-stack", style: { gap: 2 }, children: g.items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
@@ -941,14 +943,27 @@ function SidebarNav({ brand, groups = [], current: current2, onNavigate, footer,
|
|
|
941
943
|
] });
|
|
942
944
|
}
|
|
943
945
|
|
|
944
|
-
// src/components/navigation/
|
|
946
|
+
// src/components/navigation/FlytedeskBrand.tsx
|
|
945
947
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
948
|
+
var LOGO_SRC = "https://sponsored.flytedesk.com/logo-white-bg.png";
|
|
949
|
+
function FlytedeskMark({ size = "md", className = "", ...rest }) {
|
|
950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: ["fd-brand-mark", size !== "md" ? "fd-brand-mark-" + size : "", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: LOGO_SRC, alt: "flytedesk" }) });
|
|
951
|
+
}
|
|
952
|
+
function FlytedeskBrand({ appName, size = "md", className = "", ...rest }) {
|
|
953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: ["fd-brand", size !== "md" ? "fd-brand-" + size : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FlytedeskMark, { size }),
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fd-overline fd-muted", children: appName })
|
|
956
|
+
] });
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// src/components/navigation/Tabs.tsx
|
|
960
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
946
961
|
function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
|
|
947
|
-
return /* @__PURE__ */ (0,
|
|
962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: ["fd-tabs", className].filter(Boolean).join(" "), role: "tablist", ...rest, children: tabs.map((t) => {
|
|
948
963
|
const v = typeof t === "string" ? t : t.value;
|
|
949
964
|
const label = typeof t === "string" ? t : t.label;
|
|
950
965
|
const count = typeof t === "string" ? void 0 : t.count;
|
|
951
|
-
return /* @__PURE__ */ (0,
|
|
966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
952
967
|
"button",
|
|
953
968
|
{
|
|
954
969
|
type: "button",
|
|
@@ -958,7 +973,7 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
|
|
|
958
973
|
onClick: onChange ? () => onChange(v) : void 0,
|
|
959
974
|
children: [
|
|
960
975
|
label,
|
|
961
|
-
count !== void 0 ? /* @__PURE__ */ (0,
|
|
976
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "fd-badge fd-badge-neutral", style: { height: 20, padding: "0 7px" }, children: count }) : null
|
|
962
977
|
]
|
|
963
978
|
},
|
|
964
979
|
v
|
|
@@ -968,82 +983,82 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
|
|
|
968
983
|
|
|
969
984
|
// src/components/navigation/Topbar.tsx
|
|
970
985
|
var React5 = __toESM(require("react"), 1);
|
|
971
|
-
var
|
|
986
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
972
987
|
function Topbar({ crumbs = [], actions, loading = false, onMenu, className = "", ...rest }) {
|
|
973
|
-
return /* @__PURE__ */ (0,
|
|
974
|
-
onMenu ? /* @__PURE__ */ (0,
|
|
975
|
-
/* @__PURE__ */ (0,
|
|
976
|
-
i > 0 ? /* @__PURE__ */ (0,
|
|
977
|
-
i === crumbs.length - 1 ? /* @__PURE__ */ (0,
|
|
988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { className: ["fd-topbar", className].filter(Boolean).join(" "), ...rest, children: [
|
|
989
|
+
onMenu ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "fd-btn-icon", "aria-label": "Menu", onClick: onMenu, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "ph ph-list" }) }) : null,
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { className: "fd-crumb", "aria-label": "Breadcrumb", children: crumbs.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(React5.Fragment, { children: [
|
|
991
|
+
i > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "ph ph-caret-right", style: { fontSize: 11, opacity: 0.6 }, "aria-hidden": "true" }) : null,
|
|
992
|
+
i === crumbs.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fd-crumb-current", children: c.label }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { href: c.href || "#", children: c.label })
|
|
978
993
|
] }, i)) }),
|
|
979
|
-
/* @__PURE__ */ (0,
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { flex: 1 } }),
|
|
980
995
|
actions,
|
|
981
|
-
loading ? /* @__PURE__ */ (0,
|
|
996
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fd-topload", "aria-hidden": "true" }) : null
|
|
982
997
|
] });
|
|
983
998
|
}
|
|
984
999
|
|
|
985
1000
|
// src/components/feedback/Avatar.tsx
|
|
986
|
-
var
|
|
1001
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
987
1002
|
function Avatar({ name = "", src, size = "md", className = "", ...rest }) {
|
|
988
1003
|
const initials = name.split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]).join("").toUpperCase();
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
1004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
990
1005
|
"span",
|
|
991
1006
|
{
|
|
992
1007
|
className: ["fd-avatar", size === "sm" ? "fd-avatar-sm" : size === "lg" ? "fd-avatar-lg" : "", className].filter(Boolean).join(" "),
|
|
993
1008
|
title: name || void 0,
|
|
994
1009
|
...rest,
|
|
995
|
-
children: src ? /* @__PURE__ */ (0,
|
|
1010
|
+
children: src ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src, alt: name }) : initials || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { className: "ph ph-user", "aria-hidden": "true" })
|
|
996
1011
|
}
|
|
997
1012
|
);
|
|
998
1013
|
}
|
|
999
1014
|
function AvatarStack({ people = [], size = "sm", max = 4, className = "" }) {
|
|
1000
1015
|
const shown = people.slice(0, max);
|
|
1001
1016
|
const rest = people.length - shown.length;
|
|
1002
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
-
shown.map((p, i) => /* @__PURE__ */ (0,
|
|
1004
|
-
rest > 0 ? /* @__PURE__ */ (0,
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: ["fd-avatar-stack", className].filter(Boolean).join(" "), children: [
|
|
1018
|
+
shown.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { name: typeof p === "string" ? p : p.name, src: typeof p === "string" ? void 0 : p.src, size }, i)),
|
|
1019
|
+
rest > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { name: "+" + rest, size }) : null
|
|
1005
1020
|
] });
|
|
1006
1021
|
}
|
|
1007
1022
|
|
|
1008
1023
|
// src/components/feedback/Badge.tsx
|
|
1009
|
-
var
|
|
1024
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1010
1025
|
var TONES = { neutral: "fd-badge-neutral", info: "fd-badge-info", success: "fd-badge-success", warning: "fd-badge-warning", danger: "fd-badge-danger", live: "fd-badge-live", approved: "fd-badge-approved", count: "fd-badge-count" };
|
|
1011
1026
|
function Badge({ children, tone = "neutral", dot = false, icon, className = "", ...rest }) {
|
|
1012
|
-
return /* @__PURE__ */ (0,
|
|
1013
|
-
dot ? /* @__PURE__ */ (0,
|
|
1014
|
-
icon ? /* @__PURE__ */ (0,
|
|
1027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: ["fd-badge", TONES[tone] || TONES.neutral, className].filter(Boolean).join(" "), ...rest, children: [
|
|
1028
|
+
dot ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "fd-badge-dot", "aria-hidden": "true" }) : null,
|
|
1029
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) : null,
|
|
1015
1030
|
children
|
|
1016
1031
|
] });
|
|
1017
1032
|
}
|
|
1018
1033
|
|
|
1019
1034
|
// src/components/feedback/EmptyState.tsx
|
|
1020
|
-
var
|
|
1035
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1021
1036
|
function EmptyState({ icon = "tray", title, children, action, className = "", ...rest }) {
|
|
1022
|
-
return /* @__PURE__ */ (0,
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1025
|
-
children ? /* @__PURE__ */ (0,
|
|
1037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: ["fd-empty", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fd-empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) }),
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fd-empty-title", children: title }),
|
|
1040
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fd-empty-body", children }) : null,
|
|
1026
1041
|
action
|
|
1027
1042
|
] });
|
|
1028
1043
|
}
|
|
1029
1044
|
|
|
1030
1045
|
// src/components/feedback/Flag.tsx
|
|
1031
|
-
var
|
|
1046
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1032
1047
|
function Flag({ statement, cost, actions, tone = "warning", className = "", ...rest }) {
|
|
1033
|
-
return /* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["fd-flag", "fd-flag-" + tone, className].filter(Boolean).join(" "), role: "status", ...rest, children: [
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "fd-flag-text", children: [
|
|
1035
1050
|
statement,
|
|
1036
|
-
cost ? /* @__PURE__ */ (0,
|
|
1051
|
+
cost ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1037
1052
|
" ",
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "fd-flag-cost", children: cost })
|
|
1039
1054
|
] }) : null
|
|
1040
1055
|
] }),
|
|
1041
|
-
actions ? /* @__PURE__ */ (0,
|
|
1056
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "fd-flag-actions", children: actions }) : null
|
|
1042
1057
|
] });
|
|
1043
1058
|
}
|
|
1044
1059
|
|
|
1045
1060
|
// src/components/feedback/KeyHint.tsx
|
|
1046
|
-
var
|
|
1061
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1047
1062
|
var IS_MAC = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent || "");
|
|
1048
1063
|
var GLYPH = {
|
|
1049
1064
|
mod: IS_MAC ? "\u2318" : "Ctrl",
|
|
@@ -1071,10 +1086,10 @@ var GLYPH = {
|
|
|
1071
1086
|
function KeyHint({ keys, size = "md", tone = "quiet", className = "", ...rest }) {
|
|
1072
1087
|
const parts = String(keys || "").split("+").map((p) => p.trim()).filter(Boolean);
|
|
1073
1088
|
const cls = ["fd-keyhint", size === "sm" ? "fd-keyhint-sm" : "", tone === "solid" ? "fd-keyhint-solid" : "", className].filter(Boolean).join(" ");
|
|
1074
|
-
return /* @__PURE__ */ (0,
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: cls, "aria-hidden": "true", ...rest, children: parts.map((p, i) => {
|
|
1075
1090
|
const k = p.toLowerCase();
|
|
1076
1091
|
const glyph = GLYPH[k] || (p.length === 1 ? p.toUpperCase() : p);
|
|
1077
|
-
return /* @__PURE__ */ (0,
|
|
1092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("kbd", { children: glyph }, i);
|
|
1078
1093
|
}) });
|
|
1079
1094
|
}
|
|
1080
1095
|
function modifierLabel() {
|
|
@@ -1085,9 +1100,9 @@ function hasModifier(e) {
|
|
|
1085
1100
|
}
|
|
1086
1101
|
|
|
1087
1102
|
// src/components/feedback/Tag.tsx
|
|
1088
|
-
var
|
|
1103
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1089
1104
|
function Tag({ children, icon, selected = false, onRemove, onClick, className = "", ...rest }) {
|
|
1090
|
-
return /* @__PURE__ */ (0,
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1091
1106
|
"button",
|
|
1092
1107
|
{
|
|
1093
1108
|
type: "button",
|
|
@@ -1096,9 +1111,9 @@ function Tag({ children, icon, selected = false, onRemove, onClick, className =
|
|
|
1096
1111
|
onClick,
|
|
1097
1112
|
...rest,
|
|
1098
1113
|
children: [
|
|
1099
|
-
icon ? /* @__PURE__ */ (0,
|
|
1114
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) : null,
|
|
1100
1115
|
children,
|
|
1101
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
1116
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1102
1117
|
"span",
|
|
1103
1118
|
{
|
|
1104
1119
|
className: "fd-tag-remove",
|
|
@@ -1108,7 +1123,7 @@ function Tag({ children, icon, selected = false, onRemove, onClick, className =
|
|
|
1108
1123
|
e.stopPropagation();
|
|
1109
1124
|
onRemove();
|
|
1110
1125
|
},
|
|
1111
|
-
children: /* @__PURE__ */ (0,
|
|
1126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "ph ph-x" })
|
|
1112
1127
|
}
|
|
1113
1128
|
) : null
|
|
1114
1129
|
]
|
|
@@ -1117,7 +1132,7 @@ function Tag({ children, icon, selected = false, onRemove, onClick, className =
|
|
|
1117
1132
|
}
|
|
1118
1133
|
|
|
1119
1134
|
// src/components/feedback/Toast.tsx
|
|
1120
|
-
var
|
|
1135
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1121
1136
|
var ICON = {
|
|
1122
1137
|
success: { i: "check", bg: "var(--ok-solid)" },
|
|
1123
1138
|
error: { i: "x", bg: "var(--danger-solid)" },
|
|
@@ -1126,24 +1141,24 @@ var ICON = {
|
|
|
1126
1141
|
};
|
|
1127
1142
|
function Toast({ title, children, tone = "success", onUndo, onDismiss, className = "", ...rest }) {
|
|
1128
1143
|
const ic = ICON[tone] || ICON.info;
|
|
1129
|
-
return /* @__PURE__ */ (0,
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1132
|
-
/* @__PURE__ */ (0,
|
|
1133
|
-
children ? /* @__PURE__ */ (0,
|
|
1134
|
-
onUndo ? /* @__PURE__ */ (0,
|
|
1144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: ["fd-toast", className].filter(Boolean).join(" "), role: "status", ...rest, children: [
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fd-toast-icon", style: { background: ic.bg }, "aria-hidden": "true", children: tone === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fd-spinner", style: { width: 12, height: 12, borderWidth: 2, color: "#fff" } }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "ph ph-" + ic.i }) }),
|
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "fd-toast-body", children: [
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fd-toast-title", style: { display: "block" }, children: title }),
|
|
1148
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fd-secondary", style: { display: "block", marginTop: 2 }, children }) : null,
|
|
1149
|
+
onUndo ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", className: "fd-btn fd-btn-link", style: { marginTop: 8 }, onClick: onUndo, children: "Undo" }) : null
|
|
1135
1150
|
] }),
|
|
1136
|
-
onDismiss ? /* @__PURE__ */ (0,
|
|
1151
|
+
onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", className: "fd-btn-icon fd-btn-icon-sm", "aria-label": "Dismiss", onClick: onDismiss, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "ph ph-x" }) }) : null
|
|
1137
1152
|
] });
|
|
1138
1153
|
}
|
|
1139
1154
|
|
|
1140
1155
|
// src/components/feedback/Tooltip.tsx
|
|
1141
1156
|
var React6 = __toESM(require("react"), 1);
|
|
1142
|
-
var
|
|
1157
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1143
1158
|
function Tooltip({ label, placement = "top", children, className = "" }) {
|
|
1144
1159
|
const [show, setShow] = React6.useState(false);
|
|
1145
1160
|
const pos = placement === "bottom" ? { top: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" } : { bottom: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" };
|
|
1146
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1147
1162
|
"span",
|
|
1148
1163
|
{
|
|
1149
1164
|
style: { position: "relative", display: "inline-flex" },
|
|
@@ -1153,7 +1168,7 @@ function Tooltip({ label, placement = "top", children, className = "" }) {
|
|
|
1153
1168
|
onBlur: () => setShow(false),
|
|
1154
1169
|
children: [
|
|
1155
1170
|
children,
|
|
1156
|
-
show ? /* @__PURE__ */ (0,
|
|
1171
|
+
show ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: ["fd-tooltip", className].filter(Boolean).join(" "), role: "tooltip", style: pos, children: label }) : null
|
|
1157
1172
|
]
|
|
1158
1173
|
}
|
|
1159
1174
|
);
|
|
@@ -1161,7 +1176,7 @@ function Tooltip({ label, placement = "top", children, className = "" }) {
|
|
|
1161
1176
|
|
|
1162
1177
|
// src/components/data/Clamp.tsx
|
|
1163
1178
|
var React7 = __toESM(require("react"), 1);
|
|
1164
|
-
var
|
|
1179
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1165
1180
|
function Clamp({
|
|
1166
1181
|
children,
|
|
1167
1182
|
text,
|
|
@@ -1202,17 +1217,17 @@ function Clamp({
|
|
|
1202
1217
|
return !v;
|
|
1203
1218
|
});
|
|
1204
1219
|
};
|
|
1205
|
-
return /* @__PURE__ */ (0,
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
(maxChars ? charClamped != null || open : overflows) ? /* @__PURE__ */ (0,
|
|
1208
|
-
/* @__PURE__ */ (0,
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: ["fd-clamp", clamped ? "is-clamped" : "", className].filter(Boolean).join(" "), children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "fd-clamp-body", ref: bodyRef, style: !maxChars && clamped ? { maxHeight } : void 0, children: maxChars ? charClamped != null ? charClamped : text != null ? text : children : children }),
|
|
1222
|
+
(maxChars ? charClamped != null || open : overflows) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", className: "fd-clamp-more", onClick: toggle, "aria-expanded": open, children: [
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down"), "aria-hidden": "true" }),
|
|
1209
1224
|
open ? lessLabel : moreLabel
|
|
1210
1225
|
] }) : null
|
|
1211
1226
|
] });
|
|
1212
1227
|
}
|
|
1213
1228
|
|
|
1214
1229
|
// src/components/data/CsiBadge.tsx
|
|
1215
|
-
var
|
|
1230
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1216
1231
|
var BANDS = {
|
|
1217
1232
|
weak: { n: 1, label: "Weak" },
|
|
1218
1233
|
adequate: { n: 2, label: "Adequate" },
|
|
@@ -1221,7 +1236,7 @@ var BANDS = {
|
|
|
1221
1236
|
};
|
|
1222
1237
|
function CsiMeter({ band = "weak", size = 4, width = 5, gap = 2 }) {
|
|
1223
1238
|
const n = (BANDS[band] || BANDS.weak).n;
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-meter", style: { gap: gap + "px" }, "aria-hidden": "true", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1225
1240
|
"span",
|
|
1226
1241
|
{
|
|
1227
1242
|
className: "fd-meter-seg" + (i <= n ? " is-on" : ""),
|
|
@@ -1232,16 +1247,16 @@ function CsiMeter({ band = "weak", size = 4, width = 5, gap = 2 }) {
|
|
|
1232
1247
|
}
|
|
1233
1248
|
function CsiBadge({ band = "weak", crp, size = "compact", preview = false, alert = false, className = "", ...rest }) {
|
|
1234
1249
|
const b = BANDS[band] || BANDS.weak;
|
|
1235
|
-
return /* @__PURE__ */ (0,
|
|
1250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1236
1251
|
"span",
|
|
1237
1252
|
{
|
|
1238
1253
|
className: ["fd-csi", "fd-csi-" + b.n, size === "medium" ? "fd-csi-medium" : "fd-csi-compact", preview ? "fd-csi-preview" : "", className].filter(Boolean).join(" "),
|
|
1239
1254
|
...rest,
|
|
1240
1255
|
children: [
|
|
1241
|
-
alert ? /* @__PURE__ */ (0,
|
|
1242
|
-
/* @__PURE__ */ (0,
|
|
1256
|
+
alert ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-badge-dot", style: { background: "var(--csi-alert)" }, "aria-label": "Fixable" }) : null,
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CsiMeter, { band, size: size === "medium" ? 11 : 9, width: size === "medium" ? 4 : 3 }),
|
|
1243
1258
|
b.label,
|
|
1244
|
-
crp !== void 0 && crp !== null ? /* @__PURE__ */ (0,
|
|
1259
|
+
crp !== void 0 && crp !== null ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-csi-crp", children: crp }) : null
|
|
1245
1260
|
]
|
|
1246
1261
|
}
|
|
1247
1262
|
);
|
|
@@ -1249,15 +1264,15 @@ function CsiBadge({ band = "weak", crp, size = "compact", preview = false, alert
|
|
|
1249
1264
|
function CsiHero({ band = "weak", crp, label, className = "" }) {
|
|
1250
1265
|
const b = BANDS[band] || BANDS.weak;
|
|
1251
1266
|
const mark = "var(--csi-" + b.n + "-mark)";
|
|
1252
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
-
/* @__PURE__ */ (0,
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1255
|
-
/* @__PURE__ */ (0,
|
|
1267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 10 }, children: [
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-csi-hero-num", style: { color: mark }, children: crp }),
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-label-lg", style: { color: "var(--text-2)" }, children: label || b.label }),
|
|
1270
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-meter", style: { gap: 3, color: mark, width: 120 }, children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fd-meter-seg" + (i <= b.n ? " is-on" : ""), style: { height: 6, flex: 1 } }, i)) })
|
|
1256
1271
|
] });
|
|
1257
1272
|
}
|
|
1258
1273
|
|
|
1259
1274
|
// src/components/data/DataTable.tsx
|
|
1260
|
-
var
|
|
1275
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1261
1276
|
function DataTable({
|
|
1262
1277
|
columns = [],
|
|
1263
1278
|
rows = [],
|
|
@@ -1274,68 +1289,68 @@ function DataTable({
|
|
|
1274
1289
|
...rest
|
|
1275
1290
|
}) {
|
|
1276
1291
|
const stale = refreshing && !loading;
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
-
/* @__PURE__ */ (0,
|
|
1292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fd-table-host", children: [
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1279
1294
|
"div",
|
|
1280
1295
|
{
|
|
1281
1296
|
className: ["fd-table-wrap", className].filter(Boolean).join(" "),
|
|
1282
1297
|
"aria-busy": loading || refreshing ? "true" : void 0,
|
|
1283
1298
|
...rest,
|
|
1284
|
-
children: /* @__PURE__ */ (0,
|
|
1285
|
-
/* @__PURE__ */ (0,
|
|
1299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("table", { className: ["fd-table", compact3 ? "fd-table-compact" : ""].filter(Boolean).join(" "), children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tr", { children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1286
1301
|
"th",
|
|
1287
1302
|
{
|
|
1288
1303
|
scope: "col",
|
|
1289
1304
|
style: { width: c.width },
|
|
1290
1305
|
className: [c.numeric ? "is-num" : "", sort && sort.key === c.key ? "is-sorted" : ""].filter(Boolean).join(" "),
|
|
1291
1306
|
"aria-sort": sort && sort.key === c.key ? sort.dir === "asc" ? "ascending" : "descending" : void 0,
|
|
1292
|
-
children: c.sortable && onSort ? /* @__PURE__ */ (0,
|
|
1307
|
+
children: c.sortable && onSort ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", onClick: () => onSort(c.key), children: [
|
|
1293
1308
|
c.label,
|
|
1294
|
-
sort && sort.key === c.key ? /* @__PURE__ */ (0,
|
|
1309
|
+
sort && sort.key === c.key ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("i", { className: "ph fd-caret ph-caret-" + (sort.dir === "asc" ? "up" : "down") }) : null
|
|
1295
1310
|
] }) : c.label
|
|
1296
1311
|
},
|
|
1297
1312
|
c.key
|
|
1298
1313
|
)) }) }),
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tbody", { className: stale ? "fd-stale" : void 0, children: loading ? Array.from({ length: skeletonRows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tr", { children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("td", { className: c.numeric ? "is-num" : "", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 13, width: c.numeric ? 52 : i % 3 === 0 ? "72%" : "88%" } }) }, c.key)) }, i)) : rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1300
1315
|
"tr",
|
|
1301
1316
|
{
|
|
1302
1317
|
"aria-selected": selectedId === r[rowKey] ? "true" : void 0,
|
|
1303
1318
|
onClick: onRowClick ? () => onRowClick(r) : void 0,
|
|
1304
1319
|
style: onRowClick ? { cursor: "pointer" } : void 0,
|
|
1305
|
-
children: columns.map((c) => /* @__PURE__ */ (0,
|
|
1320
|
+
children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("td", { className: c.numeric ? "is-num" : "", children: c.render ? c.render(r) : r[c.key] }, c.key))
|
|
1306
1321
|
},
|
|
1307
1322
|
r[rowKey]
|
|
1308
1323
|
)) })
|
|
1309
1324
|
] })
|
|
1310
1325
|
}
|
|
1311
1326
|
),
|
|
1312
|
-
stale ? /* @__PURE__ */ (0,
|
|
1313
|
-
/* @__PURE__ */ (0,
|
|
1327
|
+
stale ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "fd-table-stale", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "fd-table-stale-pill", role: "status", children: [
|
|
1328
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fd-spinner", "aria-hidden": "true" }),
|
|
1314
1329
|
" Updating\u2026"
|
|
1315
1330
|
] }) }) : null
|
|
1316
1331
|
] });
|
|
1317
1332
|
}
|
|
1318
1333
|
|
|
1319
1334
|
// src/components/data/StatTile.tsx
|
|
1320
|
-
var
|
|
1335
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1321
1336
|
function StatTile({ label, value, sub, delta, loading = false, compact: compact3 = false, className = "", ...rest }) {
|
|
1322
|
-
return /* @__PURE__ */ (0,
|
|
1323
|
-
loading ? /* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
delta ? /* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: ["fd-stat", compact3 ? "fd-stat-compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1338
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: compact3 ? 20 : 28, width: "62%" } }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "fd-stat-top", children: [
|
|
1339
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fd-stat-figure", children: value }),
|
|
1340
|
+
delta ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: delta.startsWith("-") ? "fd-stat-delta-down" : "fd-stat-delta-up", style: { fontWeight: 600, fontSize: "var(--body-sm-size)", flex: "none" }, children: [
|
|
1341
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("i", { className: "ph ph-arrow-" + (delta.startsWith("-") ? "down" : "up") + "-right", "aria-hidden": "true" }),
|
|
1327
1342
|
" ",
|
|
1328
1343
|
delta
|
|
1329
1344
|
] }) : null
|
|
1330
1345
|
] }),
|
|
1331
|
-
!loading && sub ? /* @__PURE__ */ (0,
|
|
1332
|
-
loading ? /* @__PURE__ */ (0,
|
|
1346
|
+
!loading && sub ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fd-stat-sub", children: sub }) : null,
|
|
1347
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: 10, width: "40%", marginTop: 8 } }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fd-stat-label", style: { display: "block" }, children: label })
|
|
1333
1348
|
] });
|
|
1334
1349
|
}
|
|
1335
1350
|
|
|
1336
1351
|
// src/components/data/CodeBlock.tsx
|
|
1337
1352
|
var React8 = __toESM(require("react"), 1);
|
|
1338
|
-
var
|
|
1353
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1339
1354
|
var JS_KW = /^(?:const|let|var|function|return|if|else|for|while|do|new|class|extends|import|from|export|default|await|async|try|catch|finally|throw|typeof|instanceof|of|in|switch|case|break|continue|delete|void|yield|static|get|set|this|super|interface|type|enum|implements|public|private|protected|readonly|abstract|as|satisfies|declare|namespace)$/;
|
|
1340
1355
|
var RULES = {
|
|
1341
1356
|
js: [
|
|
@@ -1491,7 +1506,7 @@ function tokenize(src, lang) {
|
|
|
1491
1506
|
}
|
|
1492
1507
|
function Highlighted({ code, lang }) {
|
|
1493
1508
|
const toks = React8.useMemo(() => tokenize(code, lang), [code, lang]);
|
|
1494
|
-
return /* @__PURE__ */ (0,
|
|
1509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: toks.map((tk, i) => tk.c ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "tok-" + tk.c, children: tk.t }, i) : tk.t) });
|
|
1495
1510
|
}
|
|
1496
1511
|
function useCopy() {
|
|
1497
1512
|
const [done, setDone] = React8.useState(false);
|
|
@@ -1539,24 +1554,24 @@ function CodeBlock({
|
|
|
1539
1554
|
const lines = body.split("\n");
|
|
1540
1555
|
const foldable = collapseAfter > 0 && lines.length > collapseAfter + 6;
|
|
1541
1556
|
const shown = foldable && !open ? lines.slice(0, collapseAfter).join("\n") : body;
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1544
|
-
filename ? /* @__PURE__ */ (0,
|
|
1545
|
-
/* @__PURE__ */ (0,
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: ["fd-code", wrap ? "is-wrap" : "", className].filter(Boolean).join(" "), children: [
|
|
1558
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fd-code-head", children: [
|
|
1559
|
+
filename ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-file", children: filename }) : null,
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-lang", children: languageLabel(language) }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-spacer" }),
|
|
1547
1562
|
actions,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1549
|
-
copyable ? /* @__PURE__ */ (0,
|
|
1550
|
-
/* @__PURE__ */ (0,
|
|
1551
|
-
/* @__PURE__ */ (0,
|
|
1563
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "fd-code-act", onClick: () => setWrap((v) => !v), "aria-pressed": wrap, title: wrap ? "No wrap" : "Soft wrap", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-text-" + (wrap ? "columns" : "align-left"), "aria-hidden": "true" }) }),
|
|
1564
|
+
copyable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "fd-code-act" + (copied ? " is-done" : ""), onClick: () => copy(body), children: [
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: copied ? "Copied" : "Copy" })
|
|
1552
1567
|
] }) : null
|
|
1553
1568
|
] }),
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1555
|
-
lineNumbers ? /* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fd-code-body", children: [
|
|
1570
|
+
lineNumbers ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "fd-code-gutter", "aria-hidden": "true", children: shown.split("\n").map((_, i) => i + 1 + "\n").join("") }) : null,
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "fd-code-pre", tabIndex: 0, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Highlighted, { code: shown, lang: language }) }) })
|
|
1557
1572
|
] }),
|
|
1558
|
-
foldable ? /* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1573
|
+
foldable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "fd-code-fold", onClick: () => setOpen((v) => !v), "aria-expanded": open, children: [
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down"), "aria-hidden": "true" }),
|
|
1560
1575
|
open ? "Collapse" : "Show all " + lines.length + " lines"
|
|
1561
1576
|
] }) : null
|
|
1562
1577
|
] });
|
|
@@ -1576,32 +1591,32 @@ function DiffBlock({ diff = "", filename, collapseAfter = 34, className = "" })
|
|
|
1576
1591
|
const dels = all.filter((l) => l.k === "del").length;
|
|
1577
1592
|
const foldable = collapseAfter > 0 && all.length > collapseAfter + 6;
|
|
1578
1593
|
const rows = foldable && !open ? all.slice(0, collapseAfter) : all;
|
|
1579
|
-
return /* @__PURE__ */ (0,
|
|
1580
|
-
/* @__PURE__ */ (0,
|
|
1581
|
-
/* @__PURE__ */ (0,
|
|
1582
|
-
filename ? /* @__PURE__ */ (0,
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: ["fd-code", "fd-diff", className].filter(Boolean).join(" "), children: [
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fd-code-head", children: [
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-git-diff fd-code-icon", "aria-hidden": "true" }),
|
|
1597
|
+
filename ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-file", children: filename }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-lang", children: "Diff" }),
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "fd-diff-stat fd-tabular", children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "is-add", children: [
|
|
1585
1600
|
"+",
|
|
1586
1601
|
adds
|
|
1587
1602
|
] }),
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "is-del", children: [
|
|
1589
1604
|
"\u2212",
|
|
1590
1605
|
dels
|
|
1591
1606
|
] })
|
|
1592
1607
|
] }),
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-code-spacer" }),
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "fd-code-act" + (copied ? " is-done" : ""), onClick: () => copy(raw), children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: copied ? "Copied" : "Copy" })
|
|
1597
1612
|
] })
|
|
1598
1613
|
] }),
|
|
1599
|
-
/* @__PURE__ */ (0,
|
|
1600
|
-
/* @__PURE__ */ (0,
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "fd-diff-body", children: rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fd-diff-line is-" + r.k, children: [
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fd-diff-mark", "aria-hidden": "true", children: r.k === "add" ? "+" : r.k === "del" ? "\u2212" : "" }),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("code", { children: r.k === "add" || r.k === "del" ? r.line.slice(1) : r.line })
|
|
1602
1617
|
] }, i)) }),
|
|
1603
|
-
foldable ? /* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1618
|
+
foldable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "fd-code-fold", onClick: () => setOpen((v) => !v), "aria-expanded": open, children: [
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down"), "aria-hidden": "true" }),
|
|
1605
1620
|
open ? "Collapse" : "Show all " + all.length + " lines"
|
|
1606
1621
|
] }) : null
|
|
1607
1622
|
] });
|
|
@@ -1609,7 +1624,7 @@ function DiffBlock({ diff = "", filename, collapseAfter = 34, className = "" })
|
|
|
1609
1624
|
|
|
1610
1625
|
// src/components/data/Markdown.tsx
|
|
1611
1626
|
var React9 = __toESM(require("react"), 1);
|
|
1612
|
-
var
|
|
1627
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1613
1628
|
var SAFE = /^(?:https?:|mailto:|tel:|#|\/|\.{1,2}\/)/i;
|
|
1614
1629
|
var safeHref = (h) => SAFE.test(String(h || "").trim()) ? String(h).trim() : null;
|
|
1615
1630
|
var INLINE = [
|
|
@@ -1639,22 +1654,22 @@ function inlineNodes(src, ctx, keyBase) {
|
|
|
1639
1654
|
const { kind, m } = best;
|
|
1640
1655
|
if (m.index > 0) out.push(rest.slice(0, m.index));
|
|
1641
1656
|
const g = (i) => m[i];
|
|
1642
|
-
if (kind === "code") out.push(/* @__PURE__ */ (0,
|
|
1657
|
+
if (kind === "code") out.push(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { className: "fd-md-code", children: g(1) }, key()));
|
|
1643
1658
|
else if (kind === "image") {
|
|
1644
1659
|
const src2 = safeHref(g(2));
|
|
1645
|
-
out.push(ctx.allowImages && src2 ? /* @__PURE__ */ (0,
|
|
1660
|
+
out.push(ctx.allowImages && src2 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { className: "fd-md-img", src: src2, alt: g(1) || "", title: g(3) || void 0, loading: "lazy" }, key()) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fd-md-imgalt", children: g(1) || "image" }, key()));
|
|
1646
1661
|
} else if (kind === "link") {
|
|
1647
1662
|
const href = safeHref(g(2));
|
|
1648
|
-
out.push(href ? /* @__PURE__ */ (0,
|
|
1663
|
+
out.push(href ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("a", { href, title: g(3) || void 0, target: /^https?:/i.test(href) ? "_blank" : void 0, rel: "noopener noreferrer", onClick: ctx.onLinkClick, children: inlineNodes(g(1), ctx, key()) }, key()) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: g(1) }, key()));
|
|
1649
1664
|
} else if (kind === "cite") {
|
|
1650
|
-
out.push(ctx.renderCitation ? /* @__PURE__ */ (0,
|
|
1651
|
-
} else if (kind === "strongem") out.push(/* @__PURE__ */ (0,
|
|
1652
|
-
else if (kind === "strong") out.push(/* @__PURE__ */ (0,
|
|
1653
|
-
else if (kind === "em") out.push(/* @__PURE__ */ (0,
|
|
1654
|
-
else if (kind === "del") out.push(/* @__PURE__ */ (0,
|
|
1665
|
+
out.push(ctx.renderCitation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React9.Fragment, { children: ctx.renderCitation(g(1)) }, key()) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("sup", { className: "fd-md-cite", children: g(1) }, key()));
|
|
1666
|
+
} else if (kind === "strongem") out.push(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("em", { children: inlineNodes(g(1), ctx, key()) }) }, key()));
|
|
1667
|
+
else if (kind === "strong") out.push(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: inlineNodes(g(1) || g(2), ctx, key()) }, key()));
|
|
1668
|
+
else if (kind === "em") out.push(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("em", { children: inlineNodes(g(1) || g(2), ctx, key()) }, key()));
|
|
1669
|
+
else if (kind === "del") out.push(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("del", { children: inlineNodes(g(1), ctx, key()) }, key()));
|
|
1655
1670
|
else if (kind === "autolink" || kind === "bare") {
|
|
1656
1671
|
const href = safeHref(g(1));
|
|
1657
|
-
out.push(href ? /* @__PURE__ */ (0,
|
|
1672
|
+
out.push(href ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", onClick: ctx.onLinkClick, children: g(1).replace(/^mailto:/, "") }, key()) : g(1));
|
|
1658
1673
|
}
|
|
1659
1674
|
rest = rest.slice(m.index + m[0].length);
|
|
1660
1675
|
}
|
|
@@ -1772,33 +1787,33 @@ function renderBlocks(blocks, ctx, path) {
|
|
|
1772
1787
|
const k = path + "-" + i;
|
|
1773
1788
|
switch (b.t) {
|
|
1774
1789
|
case "code": {
|
|
1775
|
-
if ((b.lang || "").toLowerCase() === "diff") return /* @__PURE__ */ (0,
|
|
1776
|
-
return /* @__PURE__ */ (0,
|
|
1790
|
+
if ((b.lang || "").toLowerCase() === "diff") return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DiffBlock, { diff: b.code, filename: b.file || void 0 }, k);
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CodeBlock, { code: b.code, language: b.lang, filename: b.file || void 0, ...ctx.codeProps || {} }, k);
|
|
1777
1792
|
}
|
|
1778
1793
|
case "h": {
|
|
1779
1794
|
const lvl = Math.min(6, Math.max(1, b.level + (ctx.headingOffset || 0)));
|
|
1780
1795
|
const Tag2 = "h" + lvl;
|
|
1781
|
-
return /* @__PURE__ */ (0,
|
|
1796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tag2, { className: "fd-md-h fd-md-h" + lvl, children: inlineNodes(b.text, ctx, k) }, k);
|
|
1782
1797
|
}
|
|
1783
1798
|
case "hr":
|
|
1784
|
-
return /* @__PURE__ */ (0,
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("hr", { className: "fd-md-hr" }, k);
|
|
1785
1800
|
case "quote":
|
|
1786
|
-
return /* @__PURE__ */ (0,
|
|
1801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("blockquote", { className: "fd-md-quote", children: renderBlocks(b.children, ctx, k) }, k);
|
|
1787
1802
|
case "list": {
|
|
1788
1803
|
const Tag2 = b.ordered ? "ol" : "ul";
|
|
1789
1804
|
const isTask = b.items.some((it) => it.checked != null);
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
-
it.checked != null ? /* @__PURE__ */ (0,
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tag2, { className: "fd-md-list" + (isTask ? " is-task" : ""), start: b.ordered && b.start !== 1 ? b.start : void 0, children: b.items.map((it, j) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("li", { className: it.checked != null ? it.checked ? "is-done" : "is-todo" : void 0, children: [
|
|
1806
|
+
it.checked != null ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fd-md-task", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { className: "ph ph-" + (it.checked ? "check-square" : "square") }) }) : null,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fd-md-li", children: renderBlocks(it.children, ctx, k + "-" + j) })
|
|
1793
1808
|
] }, k + "-" + j)) }, k);
|
|
1794
1809
|
}
|
|
1795
1810
|
case "table":
|
|
1796
|
-
return /* @__PURE__ */ (0,
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "fd-md-tablewrap", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("table", { className: "fd-md-table", children: [
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tr", { children: b.head.map((c, j) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("th", { style: { textAlign: b.align[j] || "left" }, children: inlineNodes(c, ctx, k + "h" + j) }, j)) }) }),
|
|
1813
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tr", { children: b.head.map((_, ci) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("td", { style: { textAlign: b.align[ci] || "left" }, children: inlineNodes(r[ci] || "", ctx, k + ri + "c" + ci) }, ci)) }, ri)) })
|
|
1799
1814
|
] }) }, k);
|
|
1800
1815
|
default:
|
|
1801
|
-
return /* @__PURE__ */ (0,
|
|
1816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "fd-md-p", children: inlineNodes(b.text, ctx, k) }, k);
|
|
1802
1817
|
}
|
|
1803
1818
|
});
|
|
1804
1819
|
}
|
|
@@ -1813,24 +1828,24 @@ function Markdown({
|
|
|
1813
1828
|
}) {
|
|
1814
1829
|
const ctx = { allowImages, headingOffset, renderCitation, onLinkClick, codeProps };
|
|
1815
1830
|
const blocks = React9.useMemo(() => parseBlocks(source), [source]);
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: ["fd-md", className].filter(Boolean).join(" "), children: renderBlocks(blocks, ctx, "b") });
|
|
1817
1832
|
}
|
|
1818
1833
|
function MarkdownInline({ source = "", className = "", onLinkClick }) {
|
|
1819
|
-
return /* @__PURE__ */ (0,
|
|
1834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: ["fd-md-inline", className].filter(Boolean).join(" "), children: inlineNodes(source, { allowImages: false, onLinkClick }, "i") });
|
|
1820
1835
|
}
|
|
1821
1836
|
function markdownToText(src) {
|
|
1822
1837
|
return String(src == null ? "" : src).replace(/```[\w+#-]*\n?([\s\S]*?)```/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/\*\*\*([^*]+)\*\*\*|\*\*([^*]+)\*\*|__([^_]+)__/g, "$1$2$3").replace(/(^|\W)[*_]([^*_\n]+)[*_](\W|$)/g, "$1$2$3").replace(/~~([^~]+)~~/g, "$1").replace(/^\s*>\s?/gm, "").trim();
|
|
1823
1838
|
}
|
|
1824
1839
|
|
|
1825
1840
|
// src/components/data/Meter.tsx
|
|
1826
|
-
var
|
|
1841
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1827
1842
|
function Meter({ segments = [], unallocated = 0, height = 8, label, legend = false, className = "" }) {
|
|
1828
1843
|
const total = segments.reduce((s, x) => s + x.value, 0) + unallocated;
|
|
1829
1844
|
const pct = (v) => total ? v / total * 100 : 0;
|
|
1830
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
-
label ? /* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
segments.map((s, i) => /* @__PURE__ */ (0,
|
|
1845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 8 }, children: [
|
|
1846
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fd-label-lg fd-secondary", children: label }) : null,
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fd-meterbar", style: { height }, children: [
|
|
1848
|
+
segments.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1834
1849
|
"span",
|
|
1835
1850
|
{
|
|
1836
1851
|
className: "fd-meterbar-seg",
|
|
@@ -1839,15 +1854,15 @@ function Meter({ segments = [], unallocated = 0, height = 8, label, legend = fal
|
|
|
1839
1854
|
},
|
|
1840
1855
|
i
|
|
1841
1856
|
)),
|
|
1842
|
-
unallocated > 0 ? /* @__PURE__ */ (0,
|
|
1857
|
+
unallocated > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fd-meterbar-seg fd-meterbar-unallocated", title: "Unallocated", style: { width: pct(unallocated) + "%" } }) : null
|
|
1843
1858
|
] }),
|
|
1844
|
-
legend ? /* @__PURE__ */ (0,
|
|
1845
|
-
segments.map((s, i) => /* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1859
|
+
legend ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fd-row", style: { gap: 16, flexWrap: "wrap" }, children: [
|
|
1860
|
+
segments.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "fd-row fd-body-sm fd-secondary", style: { gap: 7 }, children: [
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { style: { width: 9, height: 9, borderRadius: 2, background: s.color || "var(--chart-" + (i % 8 + 1) + ")" } }),
|
|
1847
1862
|
s.label
|
|
1848
1863
|
] }, i)),
|
|
1849
|
-
unallocated > 0 ? /* @__PURE__ */ (0,
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
1864
|
+
unallocated > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "fd-row fd-body-sm fd-secondary", style: { gap: 7 }, children: [
|
|
1865
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fd-meterbar-unallocated", style: { width: 9, height: 9, borderRadius: 2 } }),
|
|
1851
1866
|
"Unallocated"
|
|
1852
1867
|
] }) : null
|
|
1853
1868
|
] }) : null
|
|
@@ -1855,7 +1870,7 @@ function Meter({ segments = [], unallocated = 0, height = 8, label, legend = fal
|
|
|
1855
1870
|
}
|
|
1856
1871
|
|
|
1857
1872
|
// src/components/data/Pagination.tsx
|
|
1858
|
-
var
|
|
1873
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1859
1874
|
function Pagination({
|
|
1860
1875
|
page = 1,
|
|
1861
1876
|
pageSize = 25,
|
|
@@ -1880,12 +1895,12 @@ function Pagination({
|
|
|
1880
1895
|
if (i === 1 || i === totalPages || Math.abs(i - page) <= span) nums.push(i);
|
|
1881
1896
|
else if (nums[nums.length - 1] !== "\u2026") nums.push("\u2026");
|
|
1882
1897
|
}
|
|
1883
|
-
return /* @__PURE__ */ (0,
|
|
1884
|
-
/* @__PURE__ */ (0,
|
|
1898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: ["fd-pag", className].filter(Boolean).join(" "), ...rest, children: [
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fd-pag-count", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 12, width: 108 } }) : total === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1885
1900
|
"No ",
|
|
1886
1901
|
unit
|
|
1887
|
-
] }) : /* @__PURE__ */ (0,
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1902
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("strong", { children: [
|
|
1889
1904
|
from.toLocaleString(),
|
|
1890
1905
|
"\u2013",
|
|
1891
1906
|
to.toLocaleString()
|
|
@@ -1895,14 +1910,14 @@ function Pagination({
|
|
|
1895
1910
|
" ",
|
|
1896
1911
|
unit
|
|
1897
1912
|
] }) }),
|
|
1898
|
-
onPageSizeChange ? /* @__PURE__ */ (0,
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
1900
|
-
/* @__PURE__ */ (0,
|
|
1913
|
+
onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "fd-pag-size", children: [
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Rows" }),
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("select", { value: pageSize, onChange: (e) => onPageSizeChange(Number(e.target.value)), "aria-label": "Rows per page", children: pageSizes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: n, children: n }, n)) })
|
|
1901
1916
|
] }) : null,
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1903
|
-
/* @__PURE__ */ (0,
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
nums.map((n, i) => n === "\u2026" ? /* @__PURE__ */ (0,
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "fd-pag-nav", children: [
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => go(1), disabled: page <= 1, "aria-label": "First page", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "ph ph-caret-double-left" }) }),
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => go(page - 1), disabled: page <= 1, "aria-label": "Previous page", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "ph ph-caret-left" }) }),
|
|
1920
|
+
nums.map((n, i) => n === "\u2026" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fd-pag-gap", "aria-hidden": "true", children: "\u2026" }, "e" + i) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1906
1921
|
"button",
|
|
1907
1922
|
{
|
|
1908
1923
|
type: "button",
|
|
@@ -1913,15 +1928,15 @@ function Pagination({
|
|
|
1913
1928
|
},
|
|
1914
1929
|
n
|
|
1915
1930
|
)),
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => go(page + 1), disabled: page >= totalPages, "aria-label": "Next page", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "ph ph-caret-right" }) }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => go(totalPages), disabled: page >= totalPages, "aria-label": "Last page", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "ph ph-caret-double-right" }) })
|
|
1918
1933
|
] })
|
|
1919
1934
|
] });
|
|
1920
1935
|
}
|
|
1921
1936
|
|
|
1922
1937
|
// src/components/data/RelativeTime.tsx
|
|
1923
1938
|
var React10 = __toESM(require("react"), 1);
|
|
1924
|
-
var
|
|
1939
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1925
1940
|
var MIN = 6e4;
|
|
1926
1941
|
var HOUR = 36e5;
|
|
1927
1942
|
var DAY = 864e5;
|
|
@@ -1983,7 +1998,7 @@ function RelativeTime({ value, prefix, className = "", refresh: refresh2 = true,
|
|
|
1983
1998
|
return () => clearInterval(id);
|
|
1984
1999
|
}, [t, refresh2]);
|
|
1985
2000
|
if (!t || isNaN(t)) return null;
|
|
1986
|
-
return /* @__PURE__ */ (0,
|
|
2001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("time", { className, dateTime: new Date(t).toISOString(), title: formatAbsolute(new Date(t)), ...rest, children: [
|
|
1987
2002
|
prefix ? prefix + " " : "",
|
|
1988
2003
|
formatRelative(new Date(t))
|
|
1989
2004
|
] });
|
|
@@ -2150,7 +2165,7 @@ var FileKit = {
|
|
|
2150
2165
|
};
|
|
2151
2166
|
|
|
2152
2167
|
// src/components/data/SegmentedMeter.tsx
|
|
2153
|
-
var
|
|
2168
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2154
2169
|
var VARIANT_FILL = {
|
|
2155
2170
|
brand: "var(--brand)",
|
|
2156
2171
|
neutral: "var(--n-400)",
|
|
@@ -2197,21 +2212,21 @@ function SegmentedMeter({
|
|
|
2197
2212
|
const fill = (s, i) => s.color || (s.variant ? VARIANT_FILL[s.variant] : void 0) || CHART[i % CHART.length];
|
|
2198
2213
|
const generatedId = React11.useId();
|
|
2199
2214
|
const uid2 = id || generatedId;
|
|
2200
|
-
return /* @__PURE__ */ (0,
|
|
2201
|
-
label || showTotal ? /* @__PURE__ */ (0,
|
|
2202
|
-
label ? /* @__PURE__ */ (0,
|
|
2203
|
-
showTotal ? /* @__PURE__ */ (0,
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: ["fd-segmeter", className].filter(Boolean).join(" "), onClick, children: [
|
|
2216
|
+
label || showTotal ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "fd-segmeter-head", children: [
|
|
2217
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-label", id: uid2 + "-l", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", {}),
|
|
2218
|
+
showTotal ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "fd-segmeter-total fd-tabular", children: [
|
|
2204
2219
|
format(used),
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2220
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-sep", children: " / " }),
|
|
2206
2221
|
safeTotal ? format(safeTotal) : "\u2014",
|
|
2207
|
-
showPercent ? /* @__PURE__ */ (0,
|
|
2222
|
+
showPercent ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "fd-segmeter-pct", children: [
|
|
2208
2223
|
" (",
|
|
2209
2224
|
pct,
|
|
2210
2225
|
"%)"
|
|
2211
2226
|
] }) : null
|
|
2212
2227
|
] }) : null
|
|
2213
2228
|
] }) : null,
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2215
2230
|
"div",
|
|
2216
2231
|
{
|
|
2217
2232
|
className: "fd-segmeter-rail",
|
|
@@ -2223,7 +2238,7 @@ function SegmentedMeter({
|
|
|
2223
2238
|
"aria-valuemin": 0,
|
|
2224
2239
|
"aria-valuemax": safeTotal || 100,
|
|
2225
2240
|
"aria-valuetext": format(used) + " of " + (safeTotal ? format(safeTotal) : "unknown") + " \u2014 " + pct + "%",
|
|
2226
|
-
children: items.map((s, i) => /* @__PURE__ */ (0,
|
|
2241
|
+
children: items.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2227
2242
|
"span",
|
|
2228
2243
|
{
|
|
2229
2244
|
className: "fd-segmeter-seg",
|
|
@@ -2234,16 +2249,16 @@ function SegmentedMeter({
|
|
|
2234
2249
|
))
|
|
2235
2250
|
}
|
|
2236
2251
|
),
|
|
2237
|
-
legend ? /* @__PURE__ */ (0,
|
|
2238
|
-
items.map((s, i) => /* @__PURE__ */ (0,
|
|
2239
|
-
/* @__PURE__ */ (0,
|
|
2240
|
-
/* @__PURE__ */ (0,
|
|
2241
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
legend ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("ul", { className: "fd-segmeter-legend", children: [
|
|
2253
|
+
items.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("li", { children: [
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-dot", style: { background: fill(s, i) }, "aria-hidden": "true" }),
|
|
2255
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-key", children: s.label }),
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-val fd-tabular", children: format(s.value) })
|
|
2242
2257
|
] }, s.id || s.label || i)),
|
|
2243
|
-
safeTotal && used < safeTotal ? /* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2258
|
+
safeTotal && used < safeTotal ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("li", { className: "is-remainder", children: [
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-dot is-empty", "aria-hidden": "true" }),
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-key", children: remainderLabel }),
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-segmeter-val fd-tabular", children: format(safeTotal - used) })
|
|
2247
2262
|
] }) : null
|
|
2248
2263
|
] }) : null
|
|
2249
2264
|
] });
|
|
@@ -2251,22 +2266,22 @@ function SegmentedMeter({
|
|
|
2251
2266
|
function QuotaRow({ label, percent = 0, note, tone, className = "" }) {
|
|
2252
2267
|
const p = Math.max(0, Math.min(100, Math.round(Number(percent) || 0)));
|
|
2253
2268
|
const auto = p >= 90 ? "danger" : p >= 70 ? "warn" : "brand";
|
|
2254
|
-
return /* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
/* @__PURE__ */ (0,
|
|
2257
|
-
note ? /* @__PURE__ */ (0,
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: ["fd-quota", className].filter(Boolean).join(" "), children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "fd-quota-head", children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-quota-label", children: label }),
|
|
2272
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-quota-note", children: note }) : null,
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "fd-quota-pct fd-tabular", children: [
|
|
2259
2274
|
p,
|
|
2260
2275
|
"%"
|
|
2261
2276
|
] })
|
|
2262
2277
|
] }),
|
|
2263
|
-
/* @__PURE__ */ (0,
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "fd-quota-rail", role: "meter", "aria-label": typeof label === "string" ? label : void 0, "aria-valuenow": p, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "fd-quota-fill", style: { width: p + "%", background: VARIANT_FILL[tone || auto] } }) })
|
|
2264
2279
|
] });
|
|
2265
2280
|
}
|
|
2266
2281
|
|
|
2267
2282
|
// src/components/data/SortMenu.tsx
|
|
2268
2283
|
var React12 = __toESM(require("react"), 1);
|
|
2269
|
-
var
|
|
2284
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2270
2285
|
function SortMenu({ fields = [], sort, onSort, align = "right", className = "", ...rest }) {
|
|
2271
2286
|
const [open, setOpen] = React12.useState(false);
|
|
2272
2287
|
const ref = React12.useRef(null);
|
|
@@ -2290,7 +2305,7 @@ function SortMenu({ fields = [], sort, onSort, align = "right", className = "",
|
|
|
2290
2305
|
const arrow = (f, d) => {
|
|
2291
2306
|
const on = cur && cur.key === f.key && dir === d;
|
|
2292
2307
|
const label = d === "asc" ? f.numeric ? "lowest first" : "A to Z" : f.numeric ? "highest first" : "Z to A";
|
|
2293
|
-
return /* @__PURE__ */ (0,
|
|
2308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2294
2309
|
"button",
|
|
2295
2310
|
{
|
|
2296
2311
|
type: "button",
|
|
@@ -2308,21 +2323,21 @@ function SortMenu({ fields = [], sort, onSort, align = "right", className = "",
|
|
|
2308
2323
|
background: on ? "var(--brand)" : "var(--surface)",
|
|
2309
2324
|
color: on ? "#fff" : "var(--text-muted)"
|
|
2310
2325
|
},
|
|
2311
|
-
children: /* @__PURE__ */ (0,
|
|
2326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { className: "ph ph-arrow-" + (d === "asc" ? "up" : "down"), style: { fontSize: 13 } })
|
|
2312
2327
|
}
|
|
2313
2328
|
);
|
|
2314
2329
|
};
|
|
2315
|
-
return /* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className, style: { position: "relative", display: "inline-flex" }, ref, ...rest, children: [
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Button, { size: "sm", variant: "secondary", icon: dir === "asc" ? "sort-ascending" : "sort-descending", onClick: () => setOpen(!open), children: [
|
|
2317
2332
|
cur ? cur.label : "Unsorted",
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { className: "ph ph-" + (dir === "asc" ? "arrow-up" : "arrow-down"), style: { fontSize: 12, marginLeft: 6, opacity: 0.75 } })
|
|
2319
2334
|
] }),
|
|
2320
|
-
open ? /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2335
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "fd-view-enter", style: { position: "absolute", top: "calc(100% + 6px)", [align]: 0, zIndex: 120, width: 280, maxWidth: "calc(100vw - 32px)", display: "block", background: "var(--surface)", border: "1px solid var(--border)", borderRadius: 10, boxShadow: "0 16px 44px rgba(11,13,17,.18)", padding: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "fd-overline fd-muted", style: { padding: "4px 8px 6px" }, children: "Sort by" }),
|
|
2322
2337
|
fields.map((f) => {
|
|
2323
2338
|
const active = cur && cur.key === f.key;
|
|
2324
|
-
return /* @__PURE__ */ (0,
|
|
2325
|
-
/* @__PURE__ */ (0,
|
|
2339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "fd-row", style: { gap: 8, padding: "4px 8px", borderRadius: 7, background: active ? "var(--surface-brand)" : "transparent" }, children: [
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "fd-body-sm", style: { flex: 1, fontWeight: active ? 700 : 500, color: active ? "var(--text-on-surface-brand)" : "var(--text)" }, children: f.label }),
|
|
2326
2341
|
arrow(f, "asc"),
|
|
2327
2342
|
arrow(f, "desc")
|
|
2328
2343
|
] }, f.key);
|
|
@@ -2333,7 +2348,7 @@ function SortMenu({ fields = [], sort, onSort, align = "right", className = "",
|
|
|
2333
2348
|
|
|
2334
2349
|
// src/components/data/StepList.tsx
|
|
2335
2350
|
var React13 = __toESM(require("react"), 1);
|
|
2336
|
-
var
|
|
2351
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2337
2352
|
var KIND_ICON = { tool: "wrench", search: "magnifying-glass", read: "file-text", write: "pencil-simple", reasoning: "brain", run: "terminal", fetch: "cloud-arrow-down" };
|
|
2338
2353
|
function StepList({
|
|
2339
2354
|
steps = [],
|
|
@@ -2359,30 +2374,30 @@ function StepList({
|
|
|
2359
2374
|
if (openProp == null) setOpenState(next);
|
|
2360
2375
|
onToggle && onToggle(next);
|
|
2361
2376
|
};
|
|
2362
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
-
/* @__PURE__ */ (0,
|
|
2364
|
-
running ? /* @__PURE__ */ (0,
|
|
2365
|
-
/* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: ["fd-steps", dense ? "is-dense" : "", open ? "is-open" : "", className].filter(Boolean).join(" "), children: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { type: "button", className: "fd-steps-head", onClick: toggle, "aria-expanded": open, children: [
|
|
2379
|
+
running ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-steps-spin", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { className: "ph ph-" + (failed ? "warning-circle" : "check-circle"), "aria-hidden": "true" }),
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-steps-title", children: summary }),
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "fd-steps-count fd-tabular", children: [
|
|
2367
2382
|
steps.length,
|
|
2368
2383
|
" step",
|
|
2369
2384
|
steps.length === 1 ? "" : "s",
|
|
2370
|
-
failed ? /* @__PURE__ */ (0,
|
|
2385
|
+
failed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "fd-steps-failed", children: [
|
|
2371
2386
|
" \xB7 ",
|
|
2372
2387
|
failed,
|
|
2373
2388
|
" failed"
|
|
2374
2389
|
] }) : null
|
|
2375
2390
|
] }),
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down") + " fd-steps-caret", "aria-hidden": "true" })
|
|
2377
2392
|
] }),
|
|
2378
|
-
open ? /* @__PURE__ */ (0,
|
|
2393
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ol", { className: "fd-steps-list", children: steps.map((s, i) => {
|
|
2379
2394
|
const id = s.id || i;
|
|
2380
2395
|
const isOpen = !!expanded[id];
|
|
2381
2396
|
const icon = KIND_ICON[s.kind || ""] || "dot-outline";
|
|
2382
|
-
return /* @__PURE__ */ (0,
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2384
|
-
/* @__PURE__ */ (0,
|
|
2385
|
-
s.detail ? /* @__PURE__ */ (0,
|
|
2397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "fd-step is-" + (s.status || "ok"), children: [
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "fd-step-row", children: [
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-step-icon", "aria-hidden": "true", children: s.status === "running" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-steps-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { className: "ph ph-" + icon }) }),
|
|
2400
|
+
s.detail ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2386
2401
|
"button",
|
|
2387
2402
|
{
|
|
2388
2403
|
type: "button",
|
|
@@ -2390,15 +2405,15 @@ function StepList({
|
|
|
2390
2405
|
"aria-expanded": isOpen,
|
|
2391
2406
|
onClick: () => setExpanded((m) => Object.assign({}, m, { [id]: !isOpen })),
|
|
2392
2407
|
children: [
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: s.label }),
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { className: "ph ph-caret-" + (isOpen ? "up" : "down"), "aria-hidden": "true" })
|
|
2395
2410
|
]
|
|
2396
2411
|
}
|
|
2397
|
-
) : /* @__PURE__ */ (0,
|
|
2398
|
-
s.status === "error" ? /* @__PURE__ */ (0,
|
|
2399
|
-
showDurations && s.durationMs ? /* @__PURE__ */ (0,
|
|
2412
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-step-label is-static", children: s.label }),
|
|
2413
|
+
s.status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-step-badge is-error", children: "failed" }) : null,
|
|
2414
|
+
showDurations && s.durationMs ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fd-step-dur fd-tabular", children: formatDuration(s.durationMs) }) : null
|
|
2400
2415
|
] }),
|
|
2401
|
-
s.detail && isOpen ? /* @__PURE__ */ (0,
|
|
2416
|
+
s.detail && isOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "fd-step-detail", children: s.detail }) : null
|
|
2402
2417
|
] }, id);
|
|
2403
2418
|
}) }) : null
|
|
2404
2419
|
] });
|
|
@@ -2406,54 +2421,54 @@ function StepList({
|
|
|
2406
2421
|
|
|
2407
2422
|
// src/components/forms/Checkbox.tsx
|
|
2408
2423
|
var React14 = __toESM(require("react"), 1);
|
|
2409
|
-
var
|
|
2424
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2410
2425
|
function Checkbox({ label, description, card = false, indeterminate = false, className = "", ...rest }) {
|
|
2411
2426
|
const ref = React14.useRef(null);
|
|
2412
2427
|
React14.useEffect(() => {
|
|
2413
2428
|
if (ref.current) ref.current.indeterminate = indeterminate;
|
|
2414
2429
|
}, [indeterminate]);
|
|
2415
|
-
return /* @__PURE__ */ (0,
|
|
2416
|
-
/* @__PURE__ */ (0,
|
|
2417
|
-
/* @__PURE__ */ (0,
|
|
2418
|
-
/* @__PURE__ */ (0,
|
|
2430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: ["fd-choice", card ? "fd-choice-card" : "", className].filter(Boolean).join(" "), children: [
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "fd-choice-input", children: [
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { ref, type: "checkbox", ...rest }),
|
|
2433
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "fd-choice-box", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { className: indeterminate ? "ph ph-minus" : "ph ph-check" }) })
|
|
2419
2434
|
] }),
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
description ? /* @__PURE__ */ (0,
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "fd-choice-text", children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "fd-choice-title", children: label }),
|
|
2437
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "fd-choice-desc", children: description }) : null
|
|
2423
2438
|
] })
|
|
2424
2439
|
] });
|
|
2425
2440
|
}
|
|
2426
2441
|
|
|
2427
2442
|
// src/components/forms/Radio.tsx
|
|
2428
|
-
var
|
|
2443
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2429
2444
|
function Radio({ label, description, card = false, className = "", ...rest }) {
|
|
2430
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: ["fd-choice", card ? "fd-choice-card" : "", className].filter(Boolean).join(" "), children: [
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "fd-choice-input", children: [
|
|
2447
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { type: "radio", ...rest }),
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fd-choice-box fd-choice-box-round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fd-choice-dot" }) })
|
|
2434
2449
|
] }),
|
|
2435
|
-
/* @__PURE__ */ (0,
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2437
|
-
description ? /* @__PURE__ */ (0,
|
|
2450
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "fd-choice-text", children: [
|
|
2451
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fd-choice-title", children: label }),
|
|
2452
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fd-choice-desc", children: description }) : null
|
|
2438
2453
|
] })
|
|
2439
2454
|
] });
|
|
2440
2455
|
}
|
|
2441
2456
|
|
|
2442
2457
|
// src/components/forms/Switch.tsx
|
|
2443
|
-
var
|
|
2458
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2444
2459
|
function Switch({ label, description, className = "", ...rest }) {
|
|
2445
|
-
return /* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2447
|
-
/* @__PURE__ */ (0,
|
|
2448
|
-
label ? /* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2450
|
-
description ? /* @__PURE__ */ (0,
|
|
2460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: ["fd-switch", className].filter(Boolean).join(" "), children: [
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { type: "checkbox", role: "switch", ...rest }),
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "fd-switch-track", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "fd-switch-thumb" }) }),
|
|
2463
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "fd-choice-text", children: [
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "fd-switch-label", children: label }),
|
|
2465
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "fd-choice-desc", children: description }) : null
|
|
2451
2466
|
] }) : null
|
|
2452
2467
|
] });
|
|
2453
2468
|
}
|
|
2454
2469
|
|
|
2455
2470
|
// src/components/forms/Input.tsx
|
|
2456
|
-
var
|
|
2471
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2457
2472
|
function Input({
|
|
2458
2473
|
label,
|
|
2459
2474
|
help,
|
|
@@ -2481,46 +2496,46 @@ function Input({
|
|
|
2481
2496
|
size === "lg" ? "fd-input-lg" : "",
|
|
2482
2497
|
className
|
|
2483
2498
|
].filter(Boolean).join(" ");
|
|
2484
|
-
return /* @__PURE__ */ (0,
|
|
2485
|
-
label ? /* @__PURE__ */ (0,
|
|
2499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "fd-field", style, children: [
|
|
2500
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: "fd-field-label", htmlFor: fieldId, children: [
|
|
2486
2501
|
label,
|
|
2487
|
-
required ? /* @__PURE__ */ (0,
|
|
2502
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2488
2503
|
] }) : null,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
icon ? /* @__PURE__ */ (0,
|
|
2491
|
-
prefix ? /* @__PURE__ */ (0,
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
2493
|
-
loading ? /* @__PURE__ */ (0,
|
|
2494
|
-
suffix && !loading ? /* @__PURE__ */ (0,
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: box, children: [
|
|
2505
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-input-icon", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) }) : null,
|
|
2506
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-input-affix", children: prefix }) : null,
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { id: fieldId, disabled, style: inputStyle, "aria-invalid": error ? "true" : void 0, ...rest }),
|
|
2508
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-spinner", style: { color: "var(--text-muted)" }, "aria-label": "Loading" }) : null,
|
|
2509
|
+
suffix && !loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-input-affix", children: suffix }) : null
|
|
2495
2510
|
] }),
|
|
2496
|
-
error ? /* @__PURE__ */ (0,
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2511
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "fd-field-error", children: [
|
|
2512
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
2498
2513
|
error
|
|
2499
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
2514
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
2500
2515
|
] });
|
|
2501
2516
|
}
|
|
2502
2517
|
|
|
2503
2518
|
// src/components/forms/Textarea.tsx
|
|
2504
|
-
var
|
|
2519
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2505
2520
|
function Textarea({ label, help, error, required = false, rows = 4, disabled = false, id, className = "", style, ...rest }) {
|
|
2506
2521
|
const fieldId = id || (rest.name ? "fd-" + rest.name : void 0);
|
|
2507
2522
|
const box = ["fd-input", "fd-input-textarea", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : "", className].filter(Boolean).join(" ");
|
|
2508
|
-
return /* @__PURE__ */ (0,
|
|
2509
|
-
label ? /* @__PURE__ */ (0,
|
|
2523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fd-field", style, children: [
|
|
2524
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "fd-field-label", htmlFor: fieldId, children: [
|
|
2510
2525
|
label,
|
|
2511
|
-
required ? /* @__PURE__ */ (0,
|
|
2526
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fd-field-req", children: "*" }) : null
|
|
2512
2527
|
] }) : null,
|
|
2513
|
-
/* @__PURE__ */ (0,
|
|
2514
|
-
error ? /* @__PURE__ */ (0,
|
|
2515
|
-
/* @__PURE__ */ (0,
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: box, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("textarea", { id: fieldId, rows, disabled, "aria-invalid": error ? "true" : void 0, ...rest }) }),
|
|
2529
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "fd-field-error", children: [
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
2516
2531
|
error
|
|
2517
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
2532
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
2518
2533
|
] });
|
|
2519
2534
|
}
|
|
2520
2535
|
|
|
2521
2536
|
// src/components/forms/NumberInput.tsx
|
|
2522
2537
|
var React15 = __toESM(require("react"), 1);
|
|
2523
|
-
var
|
|
2538
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2524
2539
|
function NumberInput({
|
|
2525
2540
|
label,
|
|
2526
2541
|
help,
|
|
@@ -2579,14 +2594,14 @@ function NumberInput({
|
|
|
2579
2594
|
return n == null ? "" : format ? n.toLocaleString() : String(n);
|
|
2580
2595
|
})();
|
|
2581
2596
|
const box = ["fd-input", "fd-input-num", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" ");
|
|
2582
|
-
return /* @__PURE__ */ (0,
|
|
2583
|
-
label ? /* @__PURE__ */ (0,
|
|
2597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: ["fd-field", className].filter(Boolean).join(" "), style, children: [
|
|
2598
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "fd-field-label", children: [
|
|
2584
2599
|
label,
|
|
2585
|
-
required ? /* @__PURE__ */ (0,
|
|
2600
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-field-req", children: "*" }) : null
|
|
2586
2601
|
] }) : null,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
prefix ? /* @__PURE__ */ (0,
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: box, style: { gap: 8 }, children: [
|
|
2603
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-input-affix", children: prefix }) : null,
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2590
2605
|
"input",
|
|
2591
2606
|
{
|
|
2592
2607
|
inputMode: "numeric",
|
|
@@ -2619,9 +2634,9 @@ function NumberInput({
|
|
|
2619
2634
|
}
|
|
2620
2635
|
}
|
|
2621
2636
|
),
|
|
2622
|
-
suffix ? /* @__PURE__ */ (0,
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
2637
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-input-affix", children: suffix }) : null,
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "fd-row", style: { gap: 4, flex: "none" }, children: [
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2625
2640
|
"button",
|
|
2626
2641
|
{
|
|
2627
2642
|
type: "button",
|
|
@@ -2631,10 +2646,10 @@ function NumberInput({
|
|
|
2631
2646
|
onPointerDown: () => hold(-1),
|
|
2632
2647
|
onPointerUp: release,
|
|
2633
2648
|
onPointerLeave: release,
|
|
2634
|
-
children: /* @__PURE__ */ (0,
|
|
2649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "ph ph-minus" })
|
|
2635
2650
|
}
|
|
2636
2651
|
),
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2652
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2638
2653
|
"button",
|
|
2639
2654
|
{
|
|
2640
2655
|
type: "button",
|
|
@@ -2644,22 +2659,22 @@ function NumberInput({
|
|
|
2644
2659
|
onPointerDown: () => hold(1),
|
|
2645
2660
|
onPointerUp: release,
|
|
2646
2661
|
onPointerLeave: release,
|
|
2647
|
-
children: /* @__PURE__ */ (0,
|
|
2662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "ph ph-plus" })
|
|
2648
2663
|
}
|
|
2649
2664
|
)
|
|
2650
2665
|
] })
|
|
2651
2666
|
] }),
|
|
2652
|
-
error ? /* @__PURE__ */ (0,
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2667
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "fd-field-error", children: [
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
2654
2669
|
error
|
|
2655
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
2670
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
2656
2671
|
] });
|
|
2657
2672
|
}
|
|
2658
2673
|
|
|
2659
2674
|
// src/components/forms/Select.tsx
|
|
2660
2675
|
var React16 = __toESM(require("react"), 1);
|
|
2661
2676
|
var import_react_dom4 = require("react-dom");
|
|
2662
|
-
var
|
|
2677
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2663
2678
|
var norm = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
2664
2679
|
function usePopPos(open, ref, estH, estW) {
|
|
2665
2680
|
const [pos, setPos] = React16.useState(null);
|
|
@@ -2824,13 +2839,13 @@ function Select({
|
|
|
2824
2839
|
});
|
|
2825
2840
|
const fieldId = id || (rest.name ? "fd-" + rest.name : void 0);
|
|
2826
2841
|
const box = ["fd-input", "fd-select", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" ");
|
|
2827
|
-
return /* @__PURE__ */ (0,
|
|
2828
|
-
label ? /* @__PURE__ */ (0,
|
|
2842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: ["fd-field", "fd-popfield", open ? "is-open" : "", className].filter(Boolean).join(" "), style, ref: rootRef, children: [
|
|
2843
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "fd-field-label", htmlFor: fieldId, onClick: toggle, children: [
|
|
2829
2844
|
label,
|
|
2830
|
-
required ? /* @__PURE__ */ (0,
|
|
2845
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-field-req", children: "*" }) : null
|
|
2831
2846
|
] }) : null,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: box, style: { cursor: disabled ? "not-allowed" : "pointer" }, ref: boxRef, children: [
|
|
2848
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2834
2849
|
"button",
|
|
2835
2850
|
{
|
|
2836
2851
|
type: "button",
|
|
@@ -2843,13 +2858,13 @@ function Select({
|
|
|
2843
2858
|
"aria-haspopup": "listbox",
|
|
2844
2859
|
style: { all: "unset", flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: 8, cursor: "inherit", overflow: "hidden" },
|
|
2845
2860
|
children: [
|
|
2846
|
-
selected && selected.icon ? /* @__PURE__ */ (0,
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
2848
|
-
multiple && chosen.length > 1 ? /* @__PURE__ */ (0,
|
|
2861
|
+
selected && selected.icon ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-" + selected.icon, style: { flex: "none", color: "var(--text-2)" } }) : null,
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: (multiple ? chosen.length : selected) ? "var(--text)" : "var(--text-muted)" }, children: boxText }),
|
|
2863
|
+
multiple && chosen.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-mono", style: { flex: "none", fontSize: 11, fontWeight: 700, padding: "1px 6px", borderRadius: 99, background: "var(--brand)", color: "#fff" }, children: chosen.length }) : null
|
|
2849
2864
|
]
|
|
2850
2865
|
}
|
|
2851
2866
|
),
|
|
2852
|
-
clearable && (multiple ? chosen.length > 0 : selected) && !loading ? /* @__PURE__ */ (0,
|
|
2867
|
+
clearable && (multiple ? chosen.length > 0 : selected) && !loading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2853
2868
|
"button",
|
|
2854
2869
|
{
|
|
2855
2870
|
type: "button",
|
|
@@ -2859,22 +2874,22 @@ function Select({
|
|
|
2859
2874
|
fire(multiple ? [] : "");
|
|
2860
2875
|
},
|
|
2861
2876
|
style: { all: "unset", cursor: "pointer", color: "var(--text-muted)", display: "grid", placeItems: "center", padding: 2 },
|
|
2862
|
-
children: /* @__PURE__ */ (0,
|
|
2877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-x-circle", style: { fontSize: 15 } })
|
|
2863
2878
|
}
|
|
2864
2879
|
) : null,
|
|
2865
|
-
loading ? /* @__PURE__ */ (0,
|
|
2880
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-spinner", style: { color: "var(--text-muted)" }, "aria-label": "Loading options" }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-select-caret", onClick: toggle, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
|
|
2866
2881
|
] }),
|
|
2867
2882
|
open && pos ? (0, import_react_dom4.createPortal)(
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2869
2884
|
"div",
|
|
2870
2885
|
{
|
|
2871
2886
|
className: "fd-pop" + (pos.up ? " is-up" : ""),
|
|
2872
2887
|
ref: popRef,
|
|
2873
2888
|
style: popStyle(pos, { minWidth: Math.max(pos.width, 260), maxWidth: 380, zIndex: 130, overflowY: "hidden" }),
|
|
2874
2889
|
children: [
|
|
2875
|
-
hasSearch ? /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
hasSearch ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "fd-pop-search", children: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-magnifying-glass", style: { color: "var(--text-muted)", fontSize: 14 } }),
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2878
2893
|
"input",
|
|
2879
2894
|
{
|
|
2880
2895
|
autoFocus: true,
|
|
@@ -2887,15 +2902,15 @@ function Select({
|
|
|
2887
2902
|
}
|
|
2888
2903
|
}
|
|
2889
2904
|
),
|
|
2890
|
-
q ? /* @__PURE__ */ (0,
|
|
2905
|
+
q ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-body-sm fd-muted", children: visible.length }) : null
|
|
2891
2906
|
] }) : null,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "fd-pop-list", role: "listbox", "aria-multiselectable": multiple || void 0, ref: listRef, style: { maxHeight: Math.max(120, pos.maxH - (hasSearch ? 64 : 12) - (multiple ? 42 : 0)) }, children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "fd-pop-empty", children: [
|
|
2893
2908
|
'Nothing matches "',
|
|
2894
2909
|
q,
|
|
2895
2910
|
'".'
|
|
2896
|
-
] }) : groups.map((grp) => /* @__PURE__ */ (0,
|
|
2897
|
-
grp.g ? /* @__PURE__ */ (0,
|
|
2898
|
-
grp.items.map(({ o, i }) => /* @__PURE__ */ (0,
|
|
2911
|
+
] }) : groups.map((grp) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(React16.Fragment, { children: [
|
|
2912
|
+
grp.g ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "fd-pop-group", children: grp.g }) : null,
|
|
2913
|
+
grp.items.map(({ o, i }) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2899
2914
|
"button",
|
|
2900
2915
|
{
|
|
2901
2916
|
type: "button",
|
|
@@ -2907,21 +2922,21 @@ function Select({
|
|
|
2907
2922
|
onMouseEnter: () => setActive(i),
|
|
2908
2923
|
onClick: () => pick(o),
|
|
2909
2924
|
children: [
|
|
2910
|
-
multiple ? /* @__PURE__ */ (0,
|
|
2911
|
-
o.icon ? /* @__PURE__ */ (0,
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
2914
|
-
o.description ? /* @__PURE__ */ (0,
|
|
2925
|
+
multiple ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { "aria-hidden": "true", style: { flex: "none", display: "grid", placeItems: "center", width: 16, height: 16, borderRadius: 4, border: "1.5px solid " + (isOn(o.value) ? "var(--brand)" : "var(--border-strong, var(--border))"), background: isOn(o.value) ? "var(--brand)" : "var(--surface)", color: "#fff" }, children: isOn(o.value) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-check", style: { fontSize: 11 } }) : null }) : null,
|
|
2926
|
+
o.icon ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-opt-icon", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-" + o.icon }) }) : null,
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-opt-label", children: o.label }),
|
|
2929
|
+
o.description ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-opt-desc", children: o.description }) : null
|
|
2915
2930
|
] }),
|
|
2916
|
-
o.meta ? /* @__PURE__ */ (0,
|
|
2917
|
-
multiple ? null : /* @__PURE__ */ (0,
|
|
2931
|
+
o.meta ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-opt-meta", children: o.meta }) : null,
|
|
2932
|
+
multiple ? null : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-opt-check", children: o.value === value ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-check" }) : null })
|
|
2918
2933
|
]
|
|
2919
2934
|
},
|
|
2920
2935
|
String(o.value)
|
|
2921
2936
|
))
|
|
2922
2937
|
] }, grp.g || "_")) }),
|
|
2923
|
-
multiple ? /* @__PURE__ */ (0,
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
multiple ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "fd-row", style: { gap: 10, padding: "8px 12px", borderTop: "1px solid var(--border)" }, children: [
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2925
2940
|
"button",
|
|
2926
2941
|
{
|
|
2927
2942
|
type: "button",
|
|
@@ -2930,13 +2945,13 @@ function Select({
|
|
|
2930
2945
|
children: "Select all"
|
|
2931
2946
|
}
|
|
2932
2947
|
),
|
|
2933
|
-
/* @__PURE__ */ (0,
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { style: { flex: 1 } }),
|
|
2949
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
2935
2950
|
vals.length,
|
|
2936
2951
|
" of ",
|
|
2937
2952
|
opts.length
|
|
2938
2953
|
] }),
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2940
2955
|
"button",
|
|
2941
2956
|
{
|
|
2942
2957
|
type: "button",
|
|
@@ -2952,17 +2967,17 @@ function Select({
|
|
|
2952
2967
|
),
|
|
2953
2968
|
document.body
|
|
2954
2969
|
) : null,
|
|
2955
|
-
error ? /* @__PURE__ */ (0,
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2970
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "fd-field-error", children: [
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
2957
2972
|
error
|
|
2958
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
2973
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
2959
2974
|
] });
|
|
2960
2975
|
}
|
|
2961
2976
|
|
|
2962
2977
|
// src/components/forms/DatePicker.tsx
|
|
2963
2978
|
var React17 = __toESM(require("react"), 1);
|
|
2964
2979
|
var import_react_dom5 = require("react-dom");
|
|
2965
|
-
var
|
|
2980
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2966
2981
|
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2967
2982
|
var DOW = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2968
2983
|
var iso = (d) => d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
|
|
@@ -3061,9 +3076,9 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3061
3076
|
const startPad = new Date(y, m, 1).getDay();
|
|
3062
3077
|
const cells = [];
|
|
3063
3078
|
for (let i = 0; i < 42; i++) cells.push(new Date(y, m, i - startPad + 1));
|
|
3064
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
-
DOW.map((d) => /* @__PURE__ */ (0,
|
|
3066
|
-
cells.map((d, i) => /* @__PURE__ */ (0,
|
|
3079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "fd-cal-grid", style: { width: months > 1 ? 252 : "auto", flex: "none" }, onMouseLeave: () => setHover(null), children: [
|
|
3080
|
+
DOW.map((d) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-cal-dow", children: d }, d)),
|
|
3081
|
+
cells.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3067
3082
|
"button",
|
|
3068
3083
|
{
|
|
3069
3084
|
type: "button",
|
|
@@ -3077,20 +3092,20 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3077
3092
|
] });
|
|
3078
3093
|
};
|
|
3079
3094
|
const nextY = vm === 11 ? vy + 1 : vy, nextM = (vm + 1) % 12;
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3081
|
-
/* @__PURE__ */ (0,
|
|
3082
|
-
/* @__PURE__ */ (0,
|
|
3083
|
-
/* @__PURE__ */ (0,
|
|
3095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "fd-cal", style: { width: months > 1 && mode2 === "days" ? "auto" : void 0 }, children: [
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "fd-cal-head", children: [
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "fd-btn-icon", "aria-label": "Previous", onClick: () => mode2 === "years" ? setVy(vy - 12) : mode2 === "months" ? setVy(vy - 1) : nav(-1), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-caret-left" }) }),
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("button", { type: "button", className: "fd-cal-title", onClick: () => setMode(mode2 === "days" ? "months" : mode2 === "months" ? "years" : "days"), children: [
|
|
3084
3099
|
mode2 === "days" ? MONTHS[vm] + " " + vy : mode2 === "months" ? vy : vy - 5 + " \u2013 " + (vy + 6),
|
|
3085
|
-
/* @__PURE__ */ (0,
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-caret-down", style: { fontSize: 10, marginLeft: 6, color: "var(--text-muted)" } })
|
|
3086
3101
|
] }),
|
|
3087
|
-
months > 1 && mode2 === "days" ? /* @__PURE__ */ (0,
|
|
3088
|
-
/* @__PURE__ */ (0,
|
|
3102
|
+
months > 1 && mode2 === "days" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-cal-title", style: { cursor: "default", background: "none" }, children: MONTHS[nextM] + " " + nextY }) : null,
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "fd-btn-icon", "aria-label": "Next", onClick: () => mode2 === "years" ? setVy(vy + 12) : mode2 === "months" ? setVy(vy + 1) : nav(1), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-caret-right" }) })
|
|
3089
3104
|
] }),
|
|
3090
|
-
mode2 === "days" ? /* @__PURE__ */ (0,
|
|
3105
|
+
mode2 === "days" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: 18 }, children: [
|
|
3091
3106
|
monthGrid(vy, vm),
|
|
3092
3107
|
months > 1 ? monthGrid(nextY, nextM) : null
|
|
3093
|
-
] }) : mode2 === "months" ? /* @__PURE__ */ (0,
|
|
3108
|
+
] }) : mode2 === "months" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "fd-cal-grid-months", children: MONTHS.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3094
3109
|
"button",
|
|
3095
3110
|
{
|
|
3096
3111
|
type: "button",
|
|
@@ -3102,7 +3117,7 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3102
3117
|
children: m.slice(0, 3)
|
|
3103
3118
|
},
|
|
3104
3119
|
m
|
|
3105
|
-
)) }) : /* @__PURE__ */ (0,
|
|
3120
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "fd-cal-grid-months", children: Array.from({ length: 12 }, (_, i) => vy - 5 + i).map((y) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3106
3121
|
"button",
|
|
3107
3122
|
{
|
|
3108
3123
|
type: "button",
|
|
@@ -3115,8 +3130,8 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3115
3130
|
},
|
|
3116
3131
|
y
|
|
3117
3132
|
)) }),
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3133
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "fd-cal-foot", children: [
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3120
3135
|
"button",
|
|
3121
3136
|
{
|
|
3122
3137
|
type: "button",
|
|
@@ -3130,8 +3145,8 @@ function Calendar({ value, range = false, onPick, initialMonth, months = 1 }) {
|
|
|
3130
3145
|
children: "Today"
|
|
3131
3146
|
}
|
|
3132
3147
|
),
|
|
3133
|
-
/* @__PURE__ */ (0,
|
|
3134
|
-
range && sel.start ? /* @__PURE__ */ (0,
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { style: { flex: 1 } }),
|
|
3149
|
+
range && sel.start ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
3135
3150
|
fmt(sel.start),
|
|
3136
3151
|
sel.end ? " \u2192 " + fmt(sel.end) : " \u2192 pick an end"
|
|
3137
3152
|
] }) : null
|
|
@@ -3165,14 +3180,14 @@ function DatePicker({ label, help, error, required = false, disabled = false, ra
|
|
|
3165
3180
|
const toggle = () => {
|
|
3166
3181
|
if (!disabled) setOpen(!open);
|
|
3167
3182
|
};
|
|
3168
|
-
return /* @__PURE__ */ (0,
|
|
3169
|
-
label ? /* @__PURE__ */ (0,
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: ["fd-field", "fd-popfield", open ? "is-open" : "", className].filter(Boolean).join(" "), style, ref: rootRef, children: [
|
|
3184
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "fd-field-label", onClick: toggle, children: [
|
|
3170
3185
|
label,
|
|
3171
|
-
required ? /* @__PURE__ */ (0,
|
|
3186
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-field-req", children: "*" }) : null
|
|
3172
3187
|
] }) : null,
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3174
|
-
/* @__PURE__ */ (0,
|
|
3175
|
-
/* @__PURE__ */ (0,
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: ["fd-input", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" "), style: { cursor: disabled ? "not-allowed" : "pointer" }, onClick: toggle, ref: boxRef, children: [
|
|
3189
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-input-icon", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-calendar-blank", "aria-hidden": "true" }) }),
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3176
3191
|
"button",
|
|
3177
3192
|
{
|
|
3178
3193
|
type: "button",
|
|
@@ -3188,10 +3203,10 @@ function DatePicker({ label, help, error, required = false, disabled = false, ra
|
|
|
3188
3203
|
children: display || placeholder || (range ? "Pick a date range" : "Pick a date")
|
|
3189
3204
|
}
|
|
3190
3205
|
),
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3206
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-select-caret", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
|
|
3192
3207
|
] }),
|
|
3193
3208
|
open && pos ? (0, import_react_dom5.createPortal)(
|
|
3194
|
-
/* @__PURE__ */ (0,
|
|
3209
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "fd-pop" + (pos.up ? " is-up" : ""), ref: popRef, style: popStyle2(pos, { width: "max-content", minWidth: 0, zIndex: 130 }), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3195
3210
|
Calendar,
|
|
3196
3211
|
{
|
|
3197
3212
|
range,
|
|
@@ -3205,17 +3220,17 @@ function DatePicker({ label, help, error, required = false, disabled = false, ra
|
|
|
3205
3220
|
) }),
|
|
3206
3221
|
document.body
|
|
3207
3222
|
) : null,
|
|
3208
|
-
error ? /* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3223
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "fd-field-error", children: [
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
3210
3225
|
error
|
|
3211
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
3226
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
3212
3227
|
] });
|
|
3213
3228
|
}
|
|
3214
3229
|
|
|
3215
3230
|
// src/components/forms/TimePicker.tsx
|
|
3216
3231
|
var React18 = __toESM(require("react"), 1);
|
|
3217
3232
|
var import_react_dom6 = require("react-dom");
|
|
3218
|
-
var
|
|
3233
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3219
3234
|
var pad = (n) => String(n).padStart(2, "0");
|
|
3220
3235
|
function usePopPos3(open, ref, estH, estW) {
|
|
3221
3236
|
const [pos, setPos] = React18.useState(null);
|
|
@@ -3302,12 +3317,12 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
3302
3317
|
};
|
|
3303
3318
|
const handAngle = mode2 === "h" ? h12 % 12 * 30 : m * 6;
|
|
3304
3319
|
const minuteOff = mode2 === "m" && m % 5 !== 0;
|
|
3305
|
-
return /* @__PURE__ */ (0,
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
3308
|
-
/* @__PURE__ */ (0,
|
|
3309
|
-
/* @__PURE__ */ (0,
|
|
3310
|
-
/* @__PURE__ */ (0,
|
|
3320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { style: { padding: "4px 14px 14px" }, children: [
|
|
3321
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fd-clock-digits", children: [
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", className: "fd-clock-digit" + (mode2 === "h" ? " is-active" : ""), onClick: () => setMode("h"), children: pad(h12) }),
|
|
3323
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { style: { fontSize: 24, fontWeight: 700, color: "var(--text-muted)" }, children: ":" }),
|
|
3324
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", className: "fd-clock-digit" + (mode2 === "m" ? " is-active" : ""), onClick: () => setMode("m"), children: pad(m) }),
|
|
3325
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-stack", style: { gap: 3, marginLeft: 8 }, children: ["AM", "PM"].map((ap) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3311
3326
|
"button",
|
|
3312
3327
|
{
|
|
3313
3328
|
type: "button",
|
|
@@ -3318,13 +3333,13 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
3318
3333
|
ap
|
|
3319
3334
|
)) })
|
|
3320
3335
|
] }),
|
|
3321
|
-
/* @__PURE__ */ (0,
|
|
3322
|
-
/* @__PURE__ */ (0,
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3324
|
-
minuteOff ? /* @__PURE__ */ (0,
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fd-clock", ref: faceRef, onPointerDown: down, onPointerMove: move, onPointerUp: upH, children: [
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-clock-hand", style: { height: NR - (minuteOff ? 14 : 16), transform: "translateX(-50%) rotate(" + handAngle + "deg)", bottom: "50%" } }),
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-clock-pivot" }),
|
|
3339
|
+
minuteOff ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { style: { position: "absolute", left: "50%", top: "50%", width: 10, height: 10, margin: -5, borderRadius: "50%", border: "2px solid var(--brand)", background: "var(--surface)", transform: "rotate(" + handAngle + "deg) translateY(-" + (NR - 6) + "px)", transformOrigin: "center", pointerEvents: "none" } }) : null,
|
|
3325
3340
|
nums.map((n) => {
|
|
3326
3341
|
const a = angleOf(n) * Math.PI / 180;
|
|
3327
|
-
return /* @__PURE__ */ (0,
|
|
3342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3328
3343
|
"span",
|
|
3329
3344
|
{
|
|
3330
3345
|
className: "fd-clock-num" + (n === selNum || mode2 === "m" && n === Math.round(m / 5) * 5 % 60 && m % 5 === 0 ? " is-sel" : ""),
|
|
@@ -3335,7 +3350,7 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
3335
3350
|
);
|
|
3336
3351
|
})
|
|
3337
3352
|
] }),
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "fd-row", style: { justifyContent: "center", gap: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-body-sm fd-muted", children: mode2 === "h" ? "Pick the hour \u2014 drag or tap" : "Now the minutes" }) })
|
|
3339
3354
|
] });
|
|
3340
3355
|
}
|
|
3341
3356
|
function TimePicker({ label, help, error, required = false, disabled = false, value = "", onChange, placeholder = "Pick a time", className = "", style }) {
|
|
@@ -3369,14 +3384,14 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
3369
3384
|
const toggle = () => {
|
|
3370
3385
|
if (!disabled) setOpen(!open);
|
|
3371
3386
|
};
|
|
3372
|
-
return /* @__PURE__ */ (0,
|
|
3373
|
-
label ? /* @__PURE__ */ (0,
|
|
3387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: ["fd-field", "fd-popfield", open ? "is-open" : "", className].filter(Boolean).join(" "), style, ref: rootRef, children: [
|
|
3388
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "fd-field-label", onClick: toggle, children: [
|
|
3374
3389
|
label,
|
|
3375
|
-
required ? /* @__PURE__ */ (0,
|
|
3390
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-field-req", children: "*" }) : null
|
|
3376
3391
|
] }) : null,
|
|
3377
|
-
/* @__PURE__ */ (0,
|
|
3378
|
-
/* @__PURE__ */ (0,
|
|
3379
|
-
/* @__PURE__ */ (0,
|
|
3392
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: ["fd-input", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" "), style: { cursor: disabled ? "not-allowed" : "pointer" }, onClick: toggle, ref: boxRef, children: [
|
|
3393
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-input-icon", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { className: "ph ph-clock", "aria-hidden": "true" }) }),
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3380
3395
|
"button",
|
|
3381
3396
|
{
|
|
3382
3397
|
type: "button",
|
|
@@ -3391,13 +3406,13 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
3391
3406
|
children: disp() || placeholder
|
|
3392
3407
|
}
|
|
3393
3408
|
),
|
|
3394
|
-
/* @__PURE__ */ (0,
|
|
3409
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-select-caret", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
|
|
3395
3410
|
] }),
|
|
3396
3411
|
open && pos ? (0, import_react_dom6.createPortal)(
|
|
3397
|
-
/* @__PURE__ */ (0,
|
|
3398
|
-
/* @__PURE__ */ (0,
|
|
3399
|
-
/* @__PURE__ */ (0,
|
|
3400
|
-
/* @__PURE__ */ (0,
|
|
3412
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fd-pop" + (pos.up ? " is-up" : ""), ref: popRef, style: popStyle3(pos, { width: 262, minWidth: 0, zIndex: 130 }), children: [
|
|
3413
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ClockFace, { value: value || "09:00", onChange: (v) => onChange && onChange({ target: { value: v } }) }),
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fd-cal-foot", style: { margin: "0 14px 12px", paddingTop: 10 }, children: [
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3401
3416
|
"button",
|
|
3402
3417
|
{
|
|
3403
3418
|
type: "button",
|
|
@@ -3410,22 +3425,22 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
3410
3425
|
children: "Now"
|
|
3411
3426
|
}
|
|
3412
3427
|
),
|
|
3413
|
-
/* @__PURE__ */ (0,
|
|
3414
|
-
/* @__PURE__ */ (0,
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { style: { flex: 1 } }),
|
|
3429
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", className: "fd-btn fd-btn-primary fd-btn-sm", onClick: () => setOpen(false), children: "Done" })
|
|
3415
3430
|
] })
|
|
3416
3431
|
] }),
|
|
3417
3432
|
document.body
|
|
3418
3433
|
) : null,
|
|
3419
|
-
error ? /* @__PURE__ */ (0,
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3434
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "fd-field-error", children: [
|
|
3435
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
3421
3436
|
error
|
|
3422
|
-
] }) : help ? /* @__PURE__ */ (0,
|
|
3437
|
+
] }) : help ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
3423
3438
|
] });
|
|
3424
3439
|
}
|
|
3425
3440
|
|
|
3426
3441
|
// src/components/forms/Slider.tsx
|
|
3427
3442
|
var React19 = __toESM(require("react"), 1);
|
|
3428
|
-
var
|
|
3443
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3429
3444
|
function Slider({
|
|
3430
3445
|
label,
|
|
3431
3446
|
min = 0,
|
|
@@ -3442,15 +3457,15 @@ function Slider({
|
|
|
3442
3457
|
const [dragging, setDragging] = React19.useState(false);
|
|
3443
3458
|
const v = value === void 0 ? min : Number(value);
|
|
3444
3459
|
const pct = max === min ? 0 : (v - min) / (max - min) * 100;
|
|
3445
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
-
label ? /* @__PURE__ */ (0,
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3448
|
-
/* @__PURE__ */ (0,
|
|
3460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: ["fd-field", className].filter(Boolean).join(" "), children: [
|
|
3461
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "fd-field-label", children: label }),
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "fd-num", style: { color: "var(--text-2)" }, children: format(v) })
|
|
3449
3464
|
] }) : null,
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
3451
|
-
/* @__PURE__ */ (0,
|
|
3452
|
-
showChip && dragging ? /* @__PURE__ */ (0,
|
|
3453
|
-
/* @__PURE__ */ (0,
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "fd-slider", children: [
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "fd-slider-fill", style: { width: pct + "%" } }),
|
|
3467
|
+
showChip && dragging ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "fd-slider-chip", style: { left: pct + "%" }, children: format(v) }) : null,
|
|
3468
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3454
3469
|
"input",
|
|
3455
3470
|
{
|
|
3456
3471
|
type: "range",
|
|
@@ -3467,13 +3482,13 @@ function Slider({
|
|
|
3467
3482
|
}
|
|
3468
3483
|
)
|
|
3469
3484
|
] }),
|
|
3470
|
-
help ? /* @__PURE__ */ (0,
|
|
3485
|
+
help ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
3471
3486
|
] });
|
|
3472
3487
|
}
|
|
3473
3488
|
|
|
3474
3489
|
// src/components/forms/RangeSlider.tsx
|
|
3475
3490
|
var React20 = __toESM(require("react"), 1);
|
|
3476
|
-
var
|
|
3491
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3477
3492
|
function RangeSlider({
|
|
3478
3493
|
label,
|
|
3479
3494
|
min = 0,
|
|
@@ -3530,7 +3545,7 @@ function RangeSlider({
|
|
|
3530
3545
|
};
|
|
3531
3546
|
const thin = S.length > 7 ? Math.ceil(S.length / 5) : 1;
|
|
3532
3547
|
const pair = value || [S[0].value, S[S.length - 1].value];
|
|
3533
|
-
return /* @__PURE__ */ (0,
|
|
3548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3534
3549
|
RangeSlider,
|
|
3535
3550
|
{
|
|
3536
3551
|
...rest,
|
|
@@ -3578,23 +3593,23 @@ function RangeSlider({
|
|
|
3578
3593
|
};
|
|
3579
3594
|
const showChip = (i) => drag === i || focus === i;
|
|
3580
3595
|
const hasLabels = marks.some((m) => m.label);
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3582
|
-
label ? /* @__PURE__ */ (0,
|
|
3583
|
-
/* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: ["fd-field", className].filter(Boolean).join(" "), ...rest, children: [
|
|
3597
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
3598
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-field-label", children: label }),
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "fd-num", style: { color: "var(--text-2)" }, children: [
|
|
3585
3600
|
fmt2(a),
|
|
3586
3601
|
" \u2013 ",
|
|
3587
3602
|
fmt2(b)
|
|
3588
3603
|
] })
|
|
3589
3604
|
] }) : null,
|
|
3590
|
-
/* @__PURE__ */ (0,
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3593
|
-
marks.map((m) => /* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3595
|
-
m.label ? /* @__PURE__ */ (0,
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fd-range" + (hasLabels ? " has-labels" : ""), onPointerDown: onRailDown, children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-range-rail", ref: railRef }),
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-range-fill", style: { left: pct(a) + "%", width: pct(b) - pct(a) + "%" } }),
|
|
3608
|
+
marks.map((m) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(React20.Fragment, { children: [
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-range-mark" + (m.value >= a && m.value <= b ? " is-in" : ""), style: { left: pct(m.value) + "%" } }),
|
|
3610
|
+
m.label ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-range-mark-label", style: { left: pct(m.value) + "%" }, children: m.label }) : null
|
|
3596
3611
|
] }, m.value)),
|
|
3597
|
-
[a, b].map((v, i) => /* @__PURE__ */ (0,
|
|
3612
|
+
[a, b].map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3598
3613
|
"span",
|
|
3599
3614
|
{
|
|
3600
3615
|
className: "fd-range-thumb" + (drag === i ? " is-drag" : ""),
|
|
@@ -3609,18 +3624,18 @@ function RangeSlider({
|
|
|
3609
3624
|
onKeyDown: key(i),
|
|
3610
3625
|
onFocus: () => setFocus(i),
|
|
3611
3626
|
onBlur: () => setFocus(null),
|
|
3612
|
-
children: /* @__PURE__ */ (0,
|
|
3627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-range-chip", style: { opacity: showChip(i) ? 1 : void 0 }, children: fmt2(v) })
|
|
3613
3628
|
},
|
|
3614
3629
|
i
|
|
3615
3630
|
))
|
|
3616
3631
|
] }),
|
|
3617
|
-
help ? /* @__PURE__ */ (0,
|
|
3632
|
+
help ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "fd-field-help", children: help }) : null
|
|
3618
3633
|
] });
|
|
3619
3634
|
}
|
|
3620
3635
|
|
|
3621
3636
|
// src/components/forms/Dropzone.tsx
|
|
3622
3637
|
var React21 = __toESM(require("react"), 1);
|
|
3623
|
-
var
|
|
3638
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3624
3639
|
function Dropzone({
|
|
3625
3640
|
onFiles,
|
|
3626
3641
|
onReject,
|
|
@@ -3665,7 +3680,7 @@ function Dropzone({
|
|
|
3665
3680
|
if (rejected.length && onReject) onReject(rejected);
|
|
3666
3681
|
if (accepted.length && onFiles) onFiles(accepted);
|
|
3667
3682
|
};
|
|
3668
|
-
return /* @__PURE__ */ (0,
|
|
3683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3669
3684
|
"div",
|
|
3670
3685
|
{
|
|
3671
3686
|
className: ["fd-dropzone", over ? "is-over" : "", className].filter(Boolean).join(" "),
|
|
@@ -3676,10 +3691,10 @@ function Dropzone({
|
|
|
3676
3691
|
onDrop: drop,
|
|
3677
3692
|
children: [
|
|
3678
3693
|
children,
|
|
3679
|
-
over ? /* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3682
|
-
hint ? /* @__PURE__ */ (0,
|
|
3694
|
+
over ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "fd-dropzone-veil", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "fd-dropzone-card", children: [
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", { className: "ph ph-tray-arrow-down" }),
|
|
3696
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "fd-dropzone-label", children: label }),
|
|
3697
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "fd-dropzone-hint", children: hint }) : null
|
|
3683
3698
|
] }) }) : null
|
|
3684
3699
|
]
|
|
3685
3700
|
}
|
|
@@ -3698,8 +3713,8 @@ function FilePickButton({
|
|
|
3698
3713
|
children
|
|
3699
3714
|
}) {
|
|
3700
3715
|
const ref = React21.useRef(null);
|
|
3701
|
-
return /* @__PURE__ */ (0,
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(React21.Fragment, { children: [
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3703
3718
|
"button",
|
|
3704
3719
|
{
|
|
3705
3720
|
type: "button",
|
|
@@ -3708,10 +3723,10 @@ function FilePickButton({
|
|
|
3708
3723
|
"aria-label": label,
|
|
3709
3724
|
title: label,
|
|
3710
3725
|
onClick: () => ref.current && ref.current.click(),
|
|
3711
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3726
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" })
|
|
3712
3727
|
}
|
|
3713
3728
|
),
|
|
3714
|
-
/* @__PURE__ */ (0,
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3715
3730
|
"input",
|
|
3716
3731
|
{
|
|
3717
3732
|
ref,
|
|
@@ -3788,7 +3803,7 @@ function useStagedFiles(upload, opts) {
|
|
|
3788
3803
|
var DropzoneKit = { useStagedFiles };
|
|
3789
3804
|
|
|
3790
3805
|
// src/components/forms/FileGrid.tsx
|
|
3791
|
-
var
|
|
3806
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3792
3807
|
var truncateMiddle = (name, max = 34) => {
|
|
3793
3808
|
if (!name || name.length <= max) return name;
|
|
3794
3809
|
const ext = /\.[A-Za-z0-9]+$/.exec(name);
|
|
@@ -3797,7 +3812,7 @@ var truncateMiddle = (name, max = 34) => {
|
|
|
3797
3812
|
return head + "\u2026" + tail;
|
|
3798
3813
|
};
|
|
3799
3814
|
function Progress({ value }) {
|
|
3800
|
-
return /* @__PURE__ */ (0,
|
|
3815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-file-prog", role: "progressbar", "aria-valuenow": Math.round(value), "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-file-prog-fill", style: { width: Math.max(4, Math.min(100, value)) + "%" } }) });
|
|
3801
3816
|
}
|
|
3802
3817
|
function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false, className = "" }) {
|
|
3803
3818
|
if (!file) return null;
|
|
@@ -3806,8 +3821,8 @@ function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false,
|
|
|
3806
3821
|
const thumb = file.thumb && file.thumb.url || (image ? file.blobUrl || file.url : null);
|
|
3807
3822
|
const meta = file.meta || (file.size ? formatBytes(file.size) : "");
|
|
3808
3823
|
const clickable = !!onOpen && !uploading;
|
|
3809
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
-
/* @__PURE__ */ (0,
|
|
3824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: ["fd-file", compact3 ? "is-compact" : "", file.error ? "is-error" : "", uploading ? "is-uploading" : "", className].filter(Boolean).join(" "), children: [
|
|
3825
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3811
3826
|
"button",
|
|
3812
3827
|
{
|
|
3813
3828
|
type: "button",
|
|
@@ -3816,16 +3831,16 @@ function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false,
|
|
|
3816
3831
|
onClick: clickable ? () => onOpen(file) : void 0,
|
|
3817
3832
|
title: file.name + (meta ? " \xB7 " + meta : ""),
|
|
3818
3833
|
children: [
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
thumb ? /* @__PURE__ */ (0,
|
|
3821
|
-
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ (0,
|
|
3834
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-file-icon", children: [
|
|
3835
|
+
thumb ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("img", { src: thumb, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }),
|
|
3836
|
+
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-play fd-file-play", "aria-hidden": "true" }) : null
|
|
3822
3837
|
] }),
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3824
|
-
/* @__PURE__ */ (0,
|
|
3825
|
-
/* @__PURE__ */ (0,
|
|
3826
|
-
/* @__PURE__ */ (0,
|
|
3838
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-file-text", children: [
|
|
3839
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-file-name", children: truncateMiddle(file.name, compact3 ? 26 : 40) }),
|
|
3840
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-file-meta", children: file.error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-file-err", children: [
|
|
3841
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
3827
3842
|
file.error
|
|
3828
|
-
] }) : uploading ? /* @__PURE__ */ (0,
|
|
3843
|
+
] }) : uploading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-tabular", children: [
|
|
3829
3844
|
Math.round(file.progress),
|
|
3830
3845
|
"% uploaded"
|
|
3831
3846
|
] }) : meta })
|
|
@@ -3833,29 +3848,29 @@ function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false,
|
|
|
3833
3848
|
]
|
|
3834
3849
|
}
|
|
3835
3850
|
),
|
|
3836
|
-
uploading ? /* @__PURE__ */ (0,
|
|
3837
|
-
file.error && onRetry ? /* @__PURE__ */ (0,
|
|
3838
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
3851
|
+
uploading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Progress, { value: file.progress }) : null,
|
|
3852
|
+
file.error && onRetry ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-file-act", onClick: () => onRetry(file), "aria-label": "Retry upload of " + file.name, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
3853
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-file-act", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
3839
3854
|
] });
|
|
3840
3855
|
}
|
|
3841
3856
|
function FileTile({ file, onOpen, onRemove, maxHeight = 200, className = "" }) {
|
|
3842
3857
|
if (!file) return null;
|
|
3843
3858
|
const src = file.thumb && file.thumb.url || file.blobUrl || file.url;
|
|
3844
3859
|
const uploading = file.progress != null && file.progress < 100 && !file.error;
|
|
3845
|
-
return /* @__PURE__ */ (0,
|
|
3846
|
-
/* @__PURE__ */ (0,
|
|
3847
|
-
uploading ? /* @__PURE__ */ (0,
|
|
3848
|
-
file.error ? /* @__PURE__ */ (0,
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
3860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("figure", { className: ["fd-tile", uploading ? "is-uploading" : "", file.error ? "is-error" : "", className].filter(Boolean).join(" "), children: [
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-tile-btn", onClick: onOpen ? () => onOpen(file) : void 0, disabled: !onOpen, children: src ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("img", { src, alt: file.name || "", style: { maxHeight }, loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-tile-fallback", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }) }) }),
|
|
3862
|
+
uploading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Progress, { value: file.progress }) : null,
|
|
3863
|
+
file.error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("figcaption", { className: "fd-tile-err", children: [
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
3850
3865
|
file.error
|
|
3851
3866
|
] }) : null,
|
|
3852
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
3867
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-tile-x", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
3853
3868
|
] });
|
|
3854
3869
|
}
|
|
3855
3870
|
function FileStrip({ files = [], size = 68, onOpen, onRemove, onRetry, className = "" }) {
|
|
3856
3871
|
const list = files.filter(Boolean);
|
|
3857
3872
|
if (!list.length) return null;
|
|
3858
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: ["fd-filestrip", className].filter(Boolean).join(" "), style: { "--fd-cell": size + "px" }, children: list.map((f) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FileCell, { file: f, onOpen, onRemove, onRetry }, f.id || f.name)) });
|
|
3859
3874
|
}
|
|
3860
3875
|
var shortName = (name, keep = 5) => {
|
|
3861
3876
|
const s = String(name || "file");
|
|
@@ -3869,19 +3884,19 @@ function FileCell({ file, onOpen, onRemove, onRetry }) {
|
|
|
3869
3884
|
const image = isImage(file.mime, file.name);
|
|
3870
3885
|
const thumb = file.thumb && file.thumb.url || (image ? file.blobUrl || file.url : null);
|
|
3871
3886
|
const label = file.name + (file.size ? " \xB7 " + formatBytes(file.size) : "");
|
|
3872
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
-
/* @__PURE__ */ (0,
|
|
3874
|
-
thumb ? /* @__PURE__ */ (0,
|
|
3875
|
-
/* @__PURE__ */ (0,
|
|
3876
|
-
/* @__PURE__ */ (0,
|
|
3877
|
-
/* @__PURE__ */ (0,
|
|
3887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: ["fd-cell", file.error ? "is-error" : "", uploading ? "is-uploading" : ""].filter(Boolean).join(" "), title: file.error ? file.name + " \u2014 " + file.error : label, children: [
|
|
3888
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("button", { type: "button", className: "fd-cell-main", onClick: onOpen ? () => onOpen(file) : void 0, disabled: !onOpen || uploading, "aria-label": "Open " + file.name, children: [
|
|
3889
|
+
thumb ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("img", { src: thumb, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-cell-doc", children: [
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }),
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-cell-name", children: shortName(file.name) }),
|
|
3892
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-cell-size", children: file.meta || formatBytes(file.size) })
|
|
3878
3893
|
] }),
|
|
3879
|
-
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ (0,
|
|
3894
|
+
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-play fd-cell-play", "aria-hidden": "true" }) : null
|
|
3880
3895
|
] }),
|
|
3881
|
-
uploading ? /* @__PURE__ */ (0,
|
|
3882
|
-
file.error ? /* @__PURE__ */ (0,
|
|
3883
|
-
file.error && onRetry ? /* @__PURE__ */ (0,
|
|
3884
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
3896
|
+
uploading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Progress, { value: file.progress }) : null,
|
|
3897
|
+
file.error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-cell-err", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-warning-circle" }) }) : null,
|
|
3898
|
+
file.error && onRetry ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-cell-x is-retry", onClick: () => onRetry(file), "aria-label": "Retry upload of " + file.name, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
3899
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "fd-cell-x", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
3885
3900
|
] });
|
|
3886
3901
|
}
|
|
3887
3902
|
function FileGrid({ files = [], onOpen, onRemove, onRetry, tiles = true, maxHeight = 200, compact: compact3 = false, className = "" }) {
|
|
@@ -3889,15 +3904,15 @@ function FileGrid({ files = [], onOpen, onRemove, onRetry, tiles = true, maxHeig
|
|
|
3889
3904
|
if (!list.length) return null;
|
|
3890
3905
|
const pics = tiles ? list.filter((f) => isImage(f.mime, f.name)) : [];
|
|
3891
3906
|
const rest = list.filter((f) => pics.indexOf(f) === -1);
|
|
3892
|
-
return /* @__PURE__ */ (0,
|
|
3893
|
-
pics.length ? /* @__PURE__ */ (0,
|
|
3894
|
-
rest.length ? /* @__PURE__ */ (0,
|
|
3907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: ["fd-filegrid", className].filter(Boolean).join(" "), children: [
|
|
3908
|
+
pics.length ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "fd-filegrid-tiles", children: pics.map((f) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FileTile, { file: f, onOpen, onRemove, maxHeight }, f.id || f.name)) }) : null,
|
|
3909
|
+
rest.length ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "fd-filegrid-chips", children: rest.map((f) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FileChip, { file: f, onOpen, onRemove, onRetry, compact: compact3 }, f.id || f.name)) }) : null
|
|
3895
3910
|
] });
|
|
3896
3911
|
}
|
|
3897
3912
|
|
|
3898
3913
|
// src/components/forms/MarkdownEditor.tsx
|
|
3899
3914
|
var React22 = __toESM(require("react"), 1);
|
|
3900
|
-
var
|
|
3915
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3901
3916
|
var isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent || "");
|
|
3902
3917
|
var INLINE_RE = /(\*\*\*[^*\n]+\*\*\*|\*\*[^*\n]+\*\*|__[^_\n]+__|~~[^~\n]+~~|`[^`\n]+`|\*[^*\s][^*\n]*\*|(?<![A-Za-z0-9_])_[^_\s][^_\n]*_|\[[^\]\n]*\]\([^)\s\n]*\)|https?:\/\/\S+)/g;
|
|
3903
3918
|
function inlineParts(text) {
|
|
@@ -4321,8 +4336,8 @@ var MarkdownEditor = React22.forwardRef(function MarkdownEditor2({
|
|
|
4321
4336
|
api.replaceRange(s.start, s.end, text.replace(/\r\n?/g, "\n"));
|
|
4322
4337
|
};
|
|
4323
4338
|
const lh = 1.55;
|
|
4324
|
-
return /* @__PURE__ */ (0,
|
|
4325
|
-
/* @__PURE__ */ (0,
|
|
4339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: ["fd-rme-wrap", disabled ? "is-disabled" : "", className].filter(Boolean).join(" "), children: [
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4326
4341
|
"div",
|
|
4327
4342
|
{
|
|
4328
4343
|
ref: boxRef,
|
|
@@ -4355,7 +4370,7 @@ var MarkdownEditor = React22.forwardRef(function MarkdownEditor2({
|
|
|
4355
4370
|
}
|
|
4356
4371
|
}
|
|
4357
4372
|
),
|
|
4358
|
-
!value ? /* @__PURE__ */ (0,
|
|
4373
|
+
!value ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "fd-rme-ph", "aria-hidden": "true", children: placeholder }) : null
|
|
4359
4374
|
] });
|
|
4360
4375
|
});
|
|
4361
4376
|
|
|
@@ -5964,7 +5979,7 @@ var SessionKit = {
|
|
|
5964
5979
|
};
|
|
5965
5980
|
|
|
5966
5981
|
// src/components/platform/AccountMenu.tsx
|
|
5967
|
-
var
|
|
5982
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5968
5983
|
var DEFAULT_LINKS = [
|
|
5969
5984
|
{ id: "profile", label: "Your profile", icon: "user-circle", href: "../admin/index.html#profile" },
|
|
5970
5985
|
{ id: "preferences", label: "Preferences", icon: "sliders-horizontal", href: "../admin/index.html#preferences" }
|
|
@@ -5975,7 +5990,7 @@ var DEFAULT_ADMIN_LINKS = [
|
|
|
5975
5990
|
{ id: "flags", label: "Feature flags", icon: "toggle-right", href: "../admin/index.html#flags", perm: "flags.manage" }
|
|
5976
5991
|
];
|
|
5977
5992
|
function Item({ item, onPick }) {
|
|
5978
|
-
return /* @__PURE__ */ (0,
|
|
5993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5979
5994
|
"button",
|
|
5980
5995
|
{
|
|
5981
5996
|
type: "button",
|
|
@@ -5983,9 +5998,9 @@ function Item({ item, onPick }) {
|
|
|
5983
5998
|
className: "fd-acct-item",
|
|
5984
5999
|
onClick: () => onPick(item),
|
|
5985
6000
|
children: [
|
|
5986
|
-
/* @__PURE__ */ (0,
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
5988
|
-
item.badge ? /* @__PURE__ */ (0,
|
|
6001
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-" + item.icon, "aria-hidden": "true" }),
|
|
6002
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { style: { flex: 1 }, children: item.label }),
|
|
6003
|
+
item.badge ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge, { tone: "neutral", children: item.badge }) : null
|
|
5989
6004
|
]
|
|
5990
6005
|
}
|
|
5991
6006
|
);
|
|
@@ -6017,8 +6032,8 @@ function AccountMenu({
|
|
|
6017
6032
|
if (onSignOut) return onSignOut();
|
|
6018
6033
|
window.alert("Signed out. (Simulated \u2014 no auth provider is wired up.)");
|
|
6019
6034
|
};
|
|
6020
|
-
return /* @__PURE__ */ (0,
|
|
6021
|
-
/* @__PURE__ */ (0,
|
|
6035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
6022
6037
|
"button",
|
|
6023
6038
|
{
|
|
6024
6039
|
type: "button",
|
|
@@ -6030,32 +6045,32 @@ function AccountMenu({
|
|
|
6030
6045
|
onClick: () => setOpen((o) => !o),
|
|
6031
6046
|
...rest,
|
|
6032
6047
|
children: [
|
|
6033
|
-
/* @__PURE__ */ (0,
|
|
6034
|
-
/* @__PURE__ */ (0,
|
|
6048
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Avatar, { name: user.name, size: "sm" }),
|
|
6049
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true", style: { fontSize: 11, color: "var(--text-muted)" } })
|
|
6035
6050
|
]
|
|
6036
6051
|
}
|
|
6037
6052
|
),
|
|
6038
|
-
/* @__PURE__ */ (0,
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6040
|
-
/* @__PURE__ */ (0,
|
|
6041
|
-
/* @__PURE__ */ (0,
|
|
6042
|
-
/* @__PURE__ */ (0,
|
|
6043
|
-
/* @__PURE__ */ (0,
|
|
6053
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Popover, { open, anchorRef: ref, onClose: () => setOpen(false), placement: "bottom-end", width: 272, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { role: "menu", className: "fd-stack", style: { gap: 0 }, children: [
|
|
6054
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
6055
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Avatar, { name: user.name }),
|
|
6056
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "fd-stack", style: { gap: 1, minWidth: 0, flex: 1 }, children: [
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fd-body-sm", style: { fontWeight: 700 }, children: user.name }),
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fd-body-sm fd-muted fd-table-trunc", children: user.email })
|
|
6044
6059
|
] })
|
|
6045
6060
|
] }),
|
|
6046
|
-
showRoles && session.roles.length ? /* @__PURE__ */ (0,
|
|
6047
|
-
/* @__PURE__ */ (0,
|
|
6048
|
-
visibleAdmin.length ? /* @__PURE__ */ (0,
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
visibleAdmin.map((l) => /* @__PURE__ */ (0,
|
|
6061
|
+
showRoles && session.roles.length ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fd-row", style: { gap: 6, padding: "10px 14px", flexWrap: "wrap", borderBottom: "1px solid var(--border)" }, children: session.roles.map((r) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge, { tone: r.id === "owner" ? "success" : "neutral", children: r.name }, r.id)) }) : null,
|
|
6062
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fd-acct-group", children: links.map((l) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Item, { item: l, onPick: pick }, l.id)) }),
|
|
6063
|
+
visibleAdmin.length ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "fd-acct-group", style: { borderTop: "1px solid var(--border)" }, children: [
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fd-overline fd-muted", style: { padding: "8px 14px 4px", display: "block" }, children: "Administration" }),
|
|
6065
|
+
visibleAdmin.map((l) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Item, { item: l, onPick: pick }, l.id))
|
|
6051
6066
|
] }) : null,
|
|
6052
|
-
allowUserSwitch ? /* @__PURE__ */ (0,
|
|
6053
|
-
/* @__PURE__ */ (0,
|
|
6054
|
-
/* @__PURE__ */ (0,
|
|
6055
|
-
/* @__PURE__ */ (0,
|
|
6056
|
-
/* @__PURE__ */ (0,
|
|
6067
|
+
allowUserSwitch ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "fd-acct-group", style: { borderTop: "1px solid var(--border)" }, children: [
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { type: "button", role: "menuitem", className: "fd-acct-item", onClick: () => setSwitching((s) => !s), children: [
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-user-switch", "aria-hidden": "true" }),
|
|
6070
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { style: { flex: 1 }, children: "View as another member" }),
|
|
6071
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-caret-" + (switching ? "up" : "down"), "aria-hidden": "true", style: { fontSize: 11 } })
|
|
6057
6072
|
] }),
|
|
6058
|
-
switching ? /* @__PURE__ */ (0,
|
|
6073
|
+
switching ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fd-stack", style: { gap: 0, maxHeight: 208, overflowY: "auto" }, children: session.allUsers.filter((u) => u.status === "active").map((u) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
6059
6074
|
"button",
|
|
6060
6075
|
{
|
|
6061
6076
|
type: "button",
|
|
@@ -6067,20 +6082,20 @@ function AccountMenu({
|
|
|
6067
6082
|
setSwitching(false);
|
|
6068
6083
|
},
|
|
6069
6084
|
children: [
|
|
6070
|
-
/* @__PURE__ */ (0,
|
|
6071
|
-
/* @__PURE__ */ (0,
|
|
6072
|
-
/* @__PURE__ */ (0,
|
|
6073
|
-
/* @__PURE__ */ (0,
|
|
6085
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Avatar, { name: u.name, size: "sm" }),
|
|
6086
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "fd-stack", style: { gap: 0, flex: 1, minWidth: 0, alignItems: "flex-start" }, children: [
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { style: { fontWeight: u.id === user.id ? 700 : 500 }, children: u.name }),
|
|
6088
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "fd-muted", style: { fontSize: 11.5 }, children: u.roles.join(", ") })
|
|
6074
6089
|
] }),
|
|
6075
|
-
u.id === user.id ? /* @__PURE__ */ (0,
|
|
6090
|
+
u.id === user.id ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-check", "aria-hidden": "true", style: { color: "var(--ok-text)" } }) : null
|
|
6076
6091
|
]
|
|
6077
6092
|
},
|
|
6078
6093
|
u.id
|
|
6079
6094
|
)) }) : null
|
|
6080
6095
|
] }) : null,
|
|
6081
|
-
/* @__PURE__ */ (0,
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6083
|
-
/* @__PURE__ */ (0,
|
|
6096
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fd-acct-group", style: { borderTop: "1px solid var(--border)" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { type: "button", role: "menuitem", className: "fd-acct-item", "data-danger": "true", onClick: signOut, children: [
|
|
6097
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { className: "ph ph-sign-out", "aria-hidden": "true" }),
|
|
6098
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { style: { flex: 1 }, children: "Sign out" })
|
|
6084
6099
|
] }) })
|
|
6085
6100
|
] }) })
|
|
6086
6101
|
] });
|
|
@@ -6088,10 +6103,10 @@ function AccountMenu({
|
|
|
6088
6103
|
|
|
6089
6104
|
// src/components/platform/ApiSpecBrowser.tsx
|
|
6090
6105
|
var React25 = __toESM(require("react"), 1);
|
|
6091
|
-
var
|
|
6106
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6092
6107
|
var METHOD_TONE = { GET: "success", POST: "info", PATCH: "warning", PUT: "warning", DELETE: "danger" };
|
|
6093
6108
|
function Json({ obj }) {
|
|
6094
|
-
return /* @__PURE__ */ (0,
|
|
6109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("pre", { className: "fd-json", children: JSON.stringify(obj, null, 2) });
|
|
6095
6110
|
}
|
|
6096
6111
|
function Endpoint({ s, onRequest }) {
|
|
6097
6112
|
const [tried, setTried] = React25.useState(null);
|
|
@@ -6105,50 +6120,50 @@ function Endpoint({ s, onRequest }) {
|
|
|
6105
6120
|
setTried({ ms: Math.round((window.performance || Date).now() - t0), error: String(e && e.message || e) });
|
|
6106
6121
|
}
|
|
6107
6122
|
};
|
|
6108
|
-
return /* @__PURE__ */ (0,
|
|
6109
|
-
/* @__PURE__ */ (0,
|
|
6110
|
-
/* @__PURE__ */ (0,
|
|
6111
|
-
/* @__PURE__ */ (0,
|
|
6112
|
-
s.isList ? /* @__PURE__ */ (0,
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Card, { elevation: "flat", padded: false, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 0 }, children: [
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-row", style: { gap: 10, padding: "14px 18px", flexWrap: "wrap" }, children: [
|
|
6125
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Badge, { tone: METHOD_TONE[s.method] || "neutral", children: s.method }),
|
|
6126
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "fd-mono", style: { fontSize: 12.5, fontWeight: 600, color: "var(--text)", wordBreak: "break-all" }, children: s.path }),
|
|
6127
|
+
s.isList ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Badge, { tone: "neutral", icon: "rows", children: "Paged list" }) : null,
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { style: { flex: 1 } }),
|
|
6129
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
6115
6130
|
s.latency[0],
|
|
6116
6131
|
"\u2013",
|
|
6117
6132
|
s.latency[1],
|
|
6118
6133
|
"ms"
|
|
6119
6134
|
] }),
|
|
6120
|
-
/* @__PURE__ */ (0,
|
|
6135
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Button, { size: "sm", variant: "secondary", icon: "play", loading: tried === "busy", onClick: run, children: "Try it" })
|
|
6121
6136
|
] }),
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6123
|
-
/* @__PURE__ */ (0,
|
|
6124
|
-
/* @__PURE__ */ (0,
|
|
6125
|
-
/* @__PURE__ */ (0,
|
|
6126
|
-
s.usedBy && s.usedBy.length ? /* @__PURE__ */ (0,
|
|
6137
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 14, padding: "0 18px 16px" }, children: [
|
|
6138
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
6139
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-body-sm", style: { fontWeight: 700 }, children: s.title }),
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: s.purpose }),
|
|
6141
|
+
s.usedBy && s.usedBy.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap" }, children: s.usedBy.map((u) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Tag, { children: u }, u)) }) : null
|
|
6127
6142
|
] }),
|
|
6128
|
-
/* @__PURE__ */ (0,
|
|
6129
|
-
s.request ? /* @__PURE__ */ (0,
|
|
6130
|
-
/* @__PURE__ */ (0,
|
|
6131
|
-
/* @__PURE__ */ (0,
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(280px,1fr))", gap: 12, alignItems: "start" }, children: [
|
|
6144
|
+
s.request ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: "Request body" }),
|
|
6146
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Json, { obj: s.request })
|
|
6132
6147
|
] }) : null,
|
|
6133
|
-
s.query ? /* @__PURE__ */ (0,
|
|
6134
|
-
/* @__PURE__ */ (0,
|
|
6135
|
-
/* @__PURE__ */ (0,
|
|
6148
|
+
s.query ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: "Query" }),
|
|
6150
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Json, { obj: s.query })
|
|
6136
6151
|
] }) : null,
|
|
6137
|
-
/* @__PURE__ */ (0,
|
|
6138
|
-
/* @__PURE__ */ (0,
|
|
6139
|
-
/* @__PURE__ */ (0,
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
6153
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: "Response 200" }),
|
|
6154
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Json, { obj: s.response })
|
|
6140
6155
|
] })
|
|
6141
6156
|
] }),
|
|
6142
|
-
s.notes ? /* @__PURE__ */ (0,
|
|
6143
|
-
tried && tried !== "busy" ? /* @__PURE__ */ (0,
|
|
6144
|
-
/* @__PURE__ */ (0,
|
|
6145
|
-
/* @__PURE__ */ (0,
|
|
6146
|
-
/* @__PURE__ */ (0,
|
|
6157
|
+
s.notes ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Flag, { tone: "info", statement: "Implementation note", cost: s.notes, actions: null }) : null,
|
|
6158
|
+
tried && tried !== "busy" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: "Simulated response" }),
|
|
6161
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Badge, { tone: tried.error ? "danger" : "success", icon: "timer", children: [
|
|
6147
6162
|
tried.ms,
|
|
6148
6163
|
"ms"
|
|
6149
6164
|
] })
|
|
6150
6165
|
] }),
|
|
6151
|
-
/* @__PURE__ */ (0,
|
|
6166
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Json, { obj: tried.error ? { error: tried.error } : tried.data })
|
|
6152
6167
|
] }) : null
|
|
6153
6168
|
] })
|
|
6154
6169
|
] }) });
|
|
@@ -6176,49 +6191,49 @@ function ApiSpecBrowser({
|
|
|
6176
6191
|
const effGroups = groups && groups.length ? groups : [["All endpoints", spec.map((s) => s.id)]];
|
|
6177
6192
|
const methods = [...new Set(spec.map((s) => s.method))];
|
|
6178
6193
|
const listCount = spec.filter((s) => s.isList).length;
|
|
6179
|
-
return /* @__PURE__ */ (0,
|
|
6180
|
-
/* @__PURE__ */ (0,
|
|
6181
|
-
kicker ? /* @__PURE__ */ (0,
|
|
6182
|
-
/* @__PURE__ */ (0,
|
|
6183
|
-
lede ? /* @__PURE__ */ (0,
|
|
6194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 20, maxWidth: 1100 }, ...rest, children: [
|
|
6195
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
6196
|
+
kicker ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: kicker }) : null,
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { className: "fd-h1", style: { margin: 0 }, children: title }),
|
|
6198
|
+
lede ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: lede }) : null
|
|
6184
6199
|
] }),
|
|
6185
|
-
modules && modules.length ? /* @__PURE__ */ (0,
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6200
|
+
modules && modules.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 8 }, children: [
|
|
6201
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", children: "Filter by screen \u2014 every endpoint that screen depends on" }),
|
|
6202
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tag, { icon: "stack", selected: !mod, onClick: () => setMod(null), children: [
|
|
6189
6204
|
"All screens ",
|
|
6190
|
-
/* @__PURE__ */ (0,
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-mono", children: spec.length })
|
|
6191
6206
|
] }),
|
|
6192
|
-
modules.map((m) => /* @__PURE__ */ (0,
|
|
6207
|
+
modules.map((m) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tag, { icon: m.icon, selected: mod === m.id, onClick: () => setMod(mod === m.id ? null : m.id), children: [
|
|
6193
6208
|
m.label,
|
|
6194
6209
|
" ",
|
|
6195
|
-
/* @__PURE__ */ (0,
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-mono", children: m.endpoints.length })
|
|
6196
6211
|
] }, m.id))
|
|
6197
6212
|
] }),
|
|
6198
|
-
activeModule ? /* @__PURE__ */ (0,
|
|
6213
|
+
activeModule ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6199
6214
|
Flag,
|
|
6200
6215
|
{
|
|
6201
6216
|
tone: "info",
|
|
6202
6217
|
statement: activeModule.label + " calls " + activeModule.endpoints.length + " endpoints.",
|
|
6203
6218
|
cost: "Integration checklist for this screen: " + activeModule.endpoints.join(", ") + ". Wire these and the screen is done.",
|
|
6204
|
-
actions: /* @__PURE__ */ (0,
|
|
6219
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Button, { size: "sm", variant: "ghost", icon: "x", onClick: () => setMod(null), children: "Show all screens" })
|
|
6205
6220
|
}
|
|
6206
6221
|
) : null
|
|
6207
6222
|
] }) : null,
|
|
6208
|
-
sourceNote ? /* @__PURE__ */ (0,
|
|
6209
|
-
/* @__PURE__ */ (0,
|
|
6210
|
-
/* @__PURE__ */ (0,
|
|
6211
|
-
methods.map((m) => /* @__PURE__ */ (0,
|
|
6223
|
+
sourceNote ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Flag, { tone: "info", statement: "Design-first: this page is the spec.", cost: sourceNote, actions: null }) : null,
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-row", style: { gap: 10, flexWrap: "wrap" }, children: [
|
|
6225
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Input, { icon: "magnifying-glass", placeholder: "Find an endpoint, screen, or behavior", value: q, onChange: (e) => setQ(e.target.value), style: { width: 300 } }),
|
|
6226
|
+
methods.map((m) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tag, { selected: method === m, onClick: () => setMethod(method === m ? null : m), children: [
|
|
6212
6227
|
m,
|
|
6213
6228
|
" ",
|
|
6214
|
-
/* @__PURE__ */ (0,
|
|
6229
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-mono", children: spec.filter((s) => s.method === m).length })
|
|
6215
6230
|
] }, m)),
|
|
6216
|
-
listCount ? /* @__PURE__ */ (0,
|
|
6231
|
+
listCount ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tag, { icon: "rows", selected: listOnly, onClick: () => setListOnly(!listOnly), children: [
|
|
6217
6232
|
"Paged lists ",
|
|
6218
|
-
/* @__PURE__ */ (0,
|
|
6233
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-mono", children: listCount })
|
|
6219
6234
|
] }) : null,
|
|
6220
|
-
/* @__PURE__ */ (0,
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6235
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { style: { flex: 1 } }),
|
|
6236
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
6222
6237
|
hits.length,
|
|
6223
6238
|
" of ",
|
|
6224
6239
|
spec.length,
|
|
@@ -6226,23 +6241,23 @@ function ApiSpecBrowser({
|
|
|
6226
6241
|
listCount ? " \xB7 " + listCount + " paged" : ""
|
|
6227
6242
|
] })
|
|
6228
6243
|
] }),
|
|
6229
|
-
hits.length === 0 ? /* @__PURE__ */ (0,
|
|
6244
|
+
hits.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Card, { elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "fd-body-sm fd-muted", style: { margin: 0 }, children: "No endpoint matches those filters." }) }) : effGroups.map(([g, ids]) => {
|
|
6230
6245
|
const items = hits.filter((s) => ids.indexOf(s.id) >= 0);
|
|
6231
6246
|
if (!items.length) return null;
|
|
6232
|
-
return /* @__PURE__ */ (0,
|
|
6233
|
-
/* @__PURE__ */ (0,
|
|
6234
|
-
items.map((s) => /* @__PURE__ */ (0,
|
|
6247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-stack", style: { gap: 12 }, children: [
|
|
6248
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-label-lg", children: g }),
|
|
6249
|
+
items.map((s) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Endpoint, { s, onRequest }, s.id))
|
|
6235
6250
|
] }, g);
|
|
6236
6251
|
}),
|
|
6237
|
-
conventions && conventions.length ? /* @__PURE__ */ (0,
|
|
6238
|
-
/* @__PURE__ */ (0,
|
|
6239
|
-
/* @__PURE__ */ (0,
|
|
6252
|
+
conventions && conventions.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Card, { title: "Cross-cutting conventions", elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "fd-stack", style: { gap: 10 }, children: conventions.map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-row", style: { gap: 12, alignItems: "flex-start" }, children: [
|
|
6253
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-overline fd-muted", style: { width: 110, flex: "none", paddingTop: 2 }, children: k }),
|
|
6254
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-body-sm fd-secondary", style: { textWrap: "pretty" }, children: v })
|
|
6240
6255
|
] }, k)) }) }) : null,
|
|
6241
|
-
openQuestions && openQuestions.length ? /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6245
|
-
/* @__PURE__ */ (0,
|
|
6256
|
+
openQuestions && openQuestions.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Collapsible, { icon: "list-checks", title: "Open questions before implementation", subtitle: openQuestions.length + " unresolved", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "fd-stack", style: { gap: 8 }, children: openQuestions.map(([id, question, why]) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start", padding: "8px 0", borderTop: "1px solid var(--border)" }, children: [
|
|
6257
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Badge, { tone: "danger", children: id }),
|
|
6258
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-stack", style: { gap: 2, flex: 1 }, children: [
|
|
6259
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-body-sm", style: { fontWeight: 600 }, children: question }),
|
|
6260
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-body-sm fd-muted", children: why })
|
|
6246
6261
|
] })
|
|
6247
6262
|
] }, id)) }) }) : null
|
|
6248
6263
|
] });
|
|
@@ -6250,7 +6265,7 @@ function ApiSpecBrowser({
|
|
|
6250
6265
|
|
|
6251
6266
|
// src/components/platform/ProfilePage.tsx
|
|
6252
6267
|
var React26 = __toESM(require("react"), 1);
|
|
6253
|
-
var
|
|
6268
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6254
6269
|
var TIMEZONES = ["America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles", "America/Anchorage", "Pacific/Honolulu", "Europe/London", "Europe/Berlin"];
|
|
6255
6270
|
var NOTIFY = [
|
|
6256
6271
|
{ key: "planShared", label: "A plan is shared with me", detail: "Someone sends you a plan or a client link." },
|
|
@@ -6294,43 +6309,43 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6294
6309
|
{ id: "s2", device: "iPhone 15 \xB7 Safari", where: "Denver, CO", when: "2 hours ago" },
|
|
6295
6310
|
{ id: "s3", device: "Windows \xB7 Edge", where: "Chicago, IL", when: "Aug 12" }
|
|
6296
6311
|
];
|
|
6297
|
-
return /* @__PURE__ */ (0,
|
|
6298
|
-
/* @__PURE__ */ (0,
|
|
6299
|
-
/* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6301
|
-
/* @__PURE__ */ (0,
|
|
6312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 20, maxWidth: 860 }, ...rest, children: [
|
|
6313
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
6314
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-overline fd-muted", children: "Account" }),
|
|
6315
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { className: "fd-h1", style: { margin: 0 }, children: "Your profile" }),
|
|
6316
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: "How you appear to colleagues and clients across every flytedesk app, and what we send you." })
|
|
6302
6317
|
] }),
|
|
6303
|
-
/* @__PURE__ */ (0,
|
|
6304
|
-
/* @__PURE__ */ (0,
|
|
6305
|
-
/* @__PURE__ */ (0,
|
|
6306
|
-
/* @__PURE__ */ (0,
|
|
6307
|
-
/* @__PURE__ */ (0,
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Card, { elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-row", style: { gap: 16, flexWrap: "wrap", alignItems: "flex-start" }, children: [
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Avatar, { name: draft.name || user.name, size: "lg" }),
|
|
6320
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-stack", style: { gap: 4, flex: 1, minWidth: 200 }, children: [
|
|
6321
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-h3", style: { margin: 0 }, children: draft.name || user.name }),
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
6308
6323
|
draft.title || "No title set",
|
|
6309
6324
|
" \xB7 ",
|
|
6310
6325
|
user.team || "No team"
|
|
6311
6326
|
] }),
|
|
6312
|
-
/* @__PURE__ */ (0,
|
|
6313
|
-
session.roles.map((r) => /* @__PURE__ */ (0,
|
|
6314
|
-
user.sso ? /* @__PURE__ */ (0,
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap", paddingTop: 4 }, children: [
|
|
6328
|
+
session.roles.map((r) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Badge, { tone: r.id === "owner" ? "success" : "neutral", children: r.name }, r.id)),
|
|
6329
|
+
user.sso ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Badge, { tone: "info", icon: "shield-check", children: "SSO" }) : null
|
|
6315
6330
|
] })
|
|
6316
6331
|
] }),
|
|
6317
|
-
/* @__PURE__ */ (0,
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { variant: "secondary", size: "sm", icon: "image", children: "Change photo" })
|
|
6318
6333
|
] }) }),
|
|
6319
|
-
/* @__PURE__ */ (0,
|
|
6334
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6320
6335
|
Card,
|
|
6321
6336
|
{
|
|
6322
|
-
title: /* @__PURE__ */ (0,
|
|
6323
|
-
/* @__PURE__ */ (0,
|
|
6324
|
-
/* @__PURE__ */ (0,
|
|
6337
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Identity" }),
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-body-sm fd-muted", style: { fontWeight: 400 }, children: "Name and title appear on plans you share" })
|
|
6325
6340
|
] }),
|
|
6326
6341
|
elevation: "flat",
|
|
6327
|
-
children: /* @__PURE__ */ (0,
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
6330
|
-
/* @__PURE__ */ (0,
|
|
6342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-stack", style: { gap: 14 }, children: [
|
|
6343
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(220px,1fr))", gap: 14 }, children: [
|
|
6344
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Input, { label: "Full name", value: draft.name, onChange: (e) => set("name", e.target.value) }),
|
|
6345
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Input, { label: "Job title", value: draft.title, onChange: (e) => set("title", e.target.value), placeholder: "e.g. Senior media planner" })
|
|
6331
6346
|
] }),
|
|
6332
|
-
/* @__PURE__ */ (0,
|
|
6333
|
-
/* @__PURE__ */ (0,
|
|
6347
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(220px,1fr))", gap: 14 }, children: [
|
|
6348
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6334
6349
|
Input,
|
|
6335
6350
|
{
|
|
6336
6351
|
label: "Work email",
|
|
@@ -6340,9 +6355,9 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6340
6355
|
help: user.sso ? "Managed by your identity provider \u2014 change it there." : "Contact an administrator to change this."
|
|
6341
6356
|
}
|
|
6342
6357
|
),
|
|
6343
|
-
/* @__PURE__ */ (0,
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Input, { label: "Phone", value: draft.phone, onChange: (e) => set("phone", e.target.value), placeholder: "Optional" })
|
|
6344
6359
|
] }),
|
|
6345
|
-
/* @__PURE__ */ (0,
|
|
6360
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6346
6361
|
Textarea,
|
|
6347
6362
|
{
|
|
6348
6363
|
label: "Short bio",
|
|
@@ -6356,8 +6371,8 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6356
6371
|
] })
|
|
6357
6372
|
}
|
|
6358
6373
|
),
|
|
6359
|
-
/* @__PURE__ */ (0,
|
|
6360
|
-
/* @__PURE__ */ (0,
|
|
6374
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Card, { title: "Working preferences", elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(220px,1fr))", gap: 14 }, children: [
|
|
6375
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6361
6376
|
Select,
|
|
6362
6377
|
{
|
|
6363
6378
|
label: "Time zone",
|
|
@@ -6367,28 +6382,28 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6367
6382
|
help: "Flight dates and schedules render in this zone."
|
|
6368
6383
|
}
|
|
6369
6384
|
),
|
|
6370
|
-
/* @__PURE__ */ (0,
|
|
6385
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Select, { label: "Start of week", options: ["Monday", "Sunday"], placeholder: "Monday" })
|
|
6371
6386
|
] }) }),
|
|
6372
|
-
/* @__PURE__ */ (0,
|
|
6387
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6373
6388
|
Card,
|
|
6374
6389
|
{
|
|
6375
|
-
title: /* @__PURE__ */ (0,
|
|
6376
|
-
/* @__PURE__ */ (0,
|
|
6377
|
-
/* @__PURE__ */ (0,
|
|
6390
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
6391
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Notifications" }),
|
|
6392
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-body-sm fd-muted", style: { fontWeight: 400 }, children: "Email only for now \u2014 in-app notifications are on the roadmap" })
|
|
6378
6393
|
] }),
|
|
6379
6394
|
elevation: "flat",
|
|
6380
|
-
children: /* @__PURE__ */ (0,
|
|
6395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "fd-stack", style: { gap: 14 }, children: NOTIFY.map((n) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Switch, { checked: !!draft.notify[n.key], onChange: () => setNotify(n.key), label: n.label, description: n.detail }, n.key)) })
|
|
6381
6396
|
}
|
|
6382
6397
|
),
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6398
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6384
6399
|
Card,
|
|
6385
6400
|
{
|
|
6386
|
-
title: /* @__PURE__ */ (0,
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6401
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
6402
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Access" }),
|
|
6403
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-body-sm fd-muted", style: { fontWeight: 400 }, children: "What your roles grant you" })
|
|
6389
6404
|
] }),
|
|
6390
6405
|
elevation: "flat",
|
|
6391
|
-
action: /* @__PURE__ */ (0,
|
|
6406
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6392
6407
|
Button,
|
|
6393
6408
|
{
|
|
6394
6409
|
size: "sm",
|
|
@@ -6399,39 +6414,39 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6399
6414
|
}
|
|
6400
6415
|
),
|
|
6401
6416
|
children: [
|
|
6402
|
-
/* @__PURE__ */ (0,
|
|
6403
|
-
/* @__PURE__ */ (0,
|
|
6404
|
-
/* @__PURE__ */ (0,
|
|
6417
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-stack", style: { gap: 0 }, children: [
|
|
6418
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CardRow, { label: "Roles", children: session.roles.map((r) => r.name).join(", ") || "None" }),
|
|
6419
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(CardRow, { label: "Permissions", children: [
|
|
6405
6420
|
session.permissions.length,
|
|
6406
6421
|
" granted"
|
|
6407
6422
|
] }),
|
|
6408
|
-
/* @__PURE__ */ (0,
|
|
6423
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CardRow, { label: "Member since", children: user.joined || "\u2014" })
|
|
6409
6424
|
] }),
|
|
6410
|
-
/* @__PURE__ */ (0,
|
|
6425
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "fd-body-sm fd-muted", style: { margin: "12px 0 0" }, children: "You cannot change your own roles \u2014 that is the point of them. An administrator manages roles from Admin \u2192 Users." })
|
|
6411
6426
|
]
|
|
6412
6427
|
}
|
|
6413
6428
|
),
|
|
6414
|
-
showSessions ? /* @__PURE__ */ (0,
|
|
6429
|
+
showSessions ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6415
6430
|
Card,
|
|
6416
6431
|
{
|
|
6417
6432
|
title: "Signed-in devices",
|
|
6418
6433
|
elevation: "flat",
|
|
6419
|
-
action: /* @__PURE__ */ (0,
|
|
6420
|
-
children: /* @__PURE__ */ (0,
|
|
6421
|
-
/* @__PURE__ */ (0,
|
|
6422
|
-
/* @__PURE__ */ (0,
|
|
6423
|
-
/* @__PURE__ */ (0,
|
|
6424
|
-
/* @__PURE__ */ (0,
|
|
6434
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { size: "sm", variant: "ghost", icon: "sign-out", children: "Sign out everywhere" }),
|
|
6435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "fd-stack", style: { gap: 0 }, children: liveSessions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-row", style: { gap: 12, padding: "10px 0", borderTop: "1px solid var(--border)", flexWrap: "wrap" }, children: [
|
|
6436
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("i", { className: "ph ph-device-mobile", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
6437
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-stack", style: { gap: 1, flex: 1, minWidth: 160 }, children: [
|
|
6438
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-body-sm", style: { fontWeight: 600 }, children: s.device }),
|
|
6439
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
6425
6440
|
s.where,
|
|
6426
6441
|
" \xB7 ",
|
|
6427
6442
|
s.when
|
|
6428
6443
|
] })
|
|
6429
6444
|
] }),
|
|
6430
|
-
s.current ? /* @__PURE__ */ (0,
|
|
6445
|
+
s.current ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Badge, { tone: "success", dot: true, children: "This device" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { size: "sm", variant: "ghost", children: "Revoke" })
|
|
6431
6446
|
] }, s.id)) })
|
|
6432
6447
|
}
|
|
6433
6448
|
) : null,
|
|
6434
|
-
/* @__PURE__ */ (0,
|
|
6449
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fd-row", style: {
|
|
6435
6450
|
gap: 10,
|
|
6436
6451
|
flexWrap: "wrap",
|
|
6437
6452
|
position: "sticky",
|
|
@@ -6442,8 +6457,8 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6442
6457
|
border: "1px solid var(--border)",
|
|
6443
6458
|
boxShadow: "0 -4px 16px rgba(11,13,17,.06)"
|
|
6444
6459
|
}, children: [
|
|
6445
|
-
/* @__PURE__ */ (0,
|
|
6446
|
-
/* @__PURE__ */ (0,
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "fd-body-sm", style: { fontWeight: 600, flex: 1 }, children: saved ? "Saved." : dirty ? "Unsaved changes" : "No pending changes" }),
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6447
6462
|
Button,
|
|
6448
6463
|
{
|
|
6449
6464
|
size: "sm",
|
|
@@ -6456,7 +6471,7 @@ function ProfilePage({ user: userProp, onSave, onNavigate, sessions, showSession
|
|
|
6456
6471
|
children: "Discard"
|
|
6457
6472
|
}
|
|
6458
6473
|
),
|
|
6459
|
-
/* @__PURE__ */ (0,
|
|
6474
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { size: "sm", icon: "check", disabled: !dirty, loading: saving, onClick: save, children: "Save changes" })
|
|
6460
6475
|
] })
|
|
6461
6476
|
] });
|
|
6462
6477
|
}
|
|
@@ -6646,7 +6661,7 @@ var UseRuntimeMode = useRuntimeMode;
|
|
|
6646
6661
|
var UseFeatureStatus = useFeatureStatus;
|
|
6647
6662
|
|
|
6648
6663
|
// src/components/platform/RoadmapTimeline.tsx
|
|
6649
|
-
var
|
|
6664
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6650
6665
|
var STATUS = {
|
|
6651
6666
|
shipped: { tone: "success", icon: "check-circle", label: "Wired" },
|
|
6652
6667
|
next: { tone: "warning", icon: "traffic-cone", label: "Not wired" },
|
|
@@ -6661,45 +6676,45 @@ function RoadmapCard({ item, byKey, onOpenFlag }) {
|
|
|
6661
6676
|
const s = STATUS[item.status] || STATUS.planned;
|
|
6662
6677
|
const deps = (item.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
|
|
6663
6678
|
const blocking = deps.filter((d) => !d.implemented);
|
|
6664
|
-
return /* @__PURE__ */ (0,
|
|
6665
|
-
/* @__PURE__ */ (0,
|
|
6666
|
-
/* @__PURE__ */ (0,
|
|
6667
|
-
/* @__PURE__ */ (0,
|
|
6668
|
-
/* @__PURE__ */ (0,
|
|
6679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Card, { elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
6680
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
|
|
6681
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item.label }),
|
|
6682
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge, { tone: "neutral", icon: PROJECT_ICON[item.project] || "squares-four", children: item.project }),
|
|
6683
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge, { tone: s.tone, icon: s.icon, children: s.label })
|
|
6669
6684
|
] }),
|
|
6670
|
-
/* @__PURE__ */ (0,
|
|
6671
|
-
item.backend ? /* @__PURE__ */ (0,
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6685
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item.description }),
|
|
6686
|
+
item.backend ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-overline fd-muted", style: { width: 62, flex: "none", paddingTop: 2 }, children: "Backend" }),
|
|
6688
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item.backend })
|
|
6674
6689
|
] }) : null,
|
|
6675
|
-
/* @__PURE__ */ (0,
|
|
6676
|
-
item.effort ? /* @__PURE__ */ (0,
|
|
6677
|
-
/* @__PURE__ */ (0,
|
|
6690
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
6691
|
+
item.effort ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
6692
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("i", { className: "ph ph-hourglass-medium" }),
|
|
6678
6693
|
" ",
|
|
6679
6694
|
item.effort
|
|
6680
6695
|
] }) : null,
|
|
6681
|
-
/* @__PURE__ */ (0,
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
6696
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
|
|
6697
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("i", { className: "ph ph-user" }),
|
|
6683
6698
|
" ",
|
|
6684
6699
|
item.owner
|
|
6685
6700
|
] }),
|
|
6686
|
-
item.screen ? /* @__PURE__ */ (0,
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6688
|
-
/* @__PURE__ */ (0,
|
|
6701
|
+
item.screen ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
|
|
6702
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { style: { flex: 1 } }),
|
|
6703
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6689
6704
|
"button",
|
|
6690
6705
|
{
|
|
6691
6706
|
type: "button",
|
|
6692
6707
|
onClick: () => onOpenFlag && onOpenFlag(item.key),
|
|
6693
6708
|
style: { all: "unset", cursor: "pointer", display: "inline-flex", alignItems: "center", gap: 5 },
|
|
6694
|
-
children: /* @__PURE__ */ (0,
|
|
6709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item.key })
|
|
6695
6710
|
}
|
|
6696
6711
|
)
|
|
6697
6712
|
] }),
|
|
6698
|
-
deps.length ? /* @__PURE__ */ (0,
|
|
6699
|
-
/* @__PURE__ */ (0,
|
|
6700
|
-
deps.map((d) => /* @__PURE__ */ (0,
|
|
6713
|
+
deps.length ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-row", style: { gap: 6, flexWrap: "wrap", paddingTop: 6, borderTop: "1px solid var(--border)" }, children: [
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-overline fd-muted", style: { paddingTop: 3 }, children: "After" }),
|
|
6715
|
+
deps.map((d) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Tag, { icon: d.implemented ? "check" : "clock", children: d.label }, d.key))
|
|
6701
6716
|
] }) : null,
|
|
6702
|
-
blocking.length && !item.implemented ? /* @__PURE__ */ (0,
|
|
6717
|
+
blocking.length && !item.implemented ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
|
|
6703
6718
|
"Blocked until ",
|
|
6704
6719
|
blocking.map((d) => d.label).join(" and "),
|
|
6705
6720
|
" ",
|
|
@@ -6752,23 +6767,23 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
6752
6767
|
}, 0);
|
|
6753
6768
|
const nextPhase = items.find((i) => !i.implemented);
|
|
6754
6769
|
let lastPhase = null;
|
|
6755
|
-
return /* @__PURE__ */ (0,
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6759
|
-
/* @__PURE__ */ (0,
|
|
6770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-stack", style: { gap: 16, maxWidth: 1e3 }, children: [
|
|
6771
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
6772
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-overline fd-muted", children: "Architecture" }),
|
|
6773
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h1", { className: "fd-h1", style: { margin: 0 }, children: title }),
|
|
6774
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: lede || "Every screen and feature in these tools is already designed and working against a simulated backend. This is the plan for connecting them to the real one \u2014 so the only work described here is server work." })
|
|
6760
6775
|
] }),
|
|
6761
|
-
/* @__PURE__ */ (0,
|
|
6762
|
-
/* @__PURE__ */ (0,
|
|
6763
|
-
/* @__PURE__ */ (0,
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
6765
|
-
/* @__PURE__ */ (0,
|
|
6776
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-grid-stats is-thin", children: [
|
|
6777
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StatTile, { compact: true, label: "Wired", value: String(rm.shipped), sub: "of " + rm.items.length + " features" }),
|
|
6778
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StatTile, { compact: true, label: "Remaining", value: String(rm.remaining), sub: "backend work" }),
|
|
6779
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StatTile, { compact: true, label: "Est. effort", value: days ? days + " days" : "\u2014", sub: "sum of estimates, not calendar" }),
|
|
6780
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StatTile, { compact: true, label: "Up next", value: nextPhase ? "Phase " + nextPhase.phase : "\u2014", sub: nextPhase ? nextPhase.phaseName : "all wired" })
|
|
6766
6781
|
] }),
|
|
6767
|
-
/* @__PURE__ */ (0,
|
|
6768
|
-
/* @__PURE__ */ (0,
|
|
6769
|
-
/* @__PURE__ */ (0,
|
|
6770
|
-
/* @__PURE__ */ (0,
|
|
6771
|
-
/* @__PURE__ */ (0,
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-row", style: { gap: 10, flexWrap: "wrap" }, children: [
|
|
6783
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Input, { icon: "magnifying-glass", placeholder: "Find a feature or a piece of backend work", value: q, onChange: (e) => setQ(e.target.value), style: { width: 300 } }),
|
|
6784
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Select, { placeholder: "All projects", value: project, onChange: (e) => setProject(e.target.value), options: projects, style: { width: 190 } }),
|
|
6785
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { style: { flex: 1 } }),
|
|
6786
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6772
6787
|
Button,
|
|
6773
6788
|
{
|
|
6774
6789
|
size: "sm",
|
|
@@ -6782,7 +6797,7 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
6782
6797
|
}
|
|
6783
6798
|
)
|
|
6784
6799
|
] }),
|
|
6785
|
-
/* @__PURE__ */ (0,
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6786
6801
|
Flag,
|
|
6787
6802
|
{
|
|
6788
6803
|
tone: "info",
|
|
@@ -6791,51 +6806,51 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
6791
6806
|
actions: null
|
|
6792
6807
|
}
|
|
6793
6808
|
),
|
|
6794
|
-
/* @__PURE__ */ (0,
|
|
6795
|
-
/* @__PURE__ */ (0,
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fd-rm", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fd-rm-scroll", ref: scrollRef, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-rm-track", children: [
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-rm-spine", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-rm-spine-done", style: { height: items.length ? 100 * shippedShown / items.length + "%" : "0%" } }) }),
|
|
6796
6811
|
items.map((item, n) => {
|
|
6797
6812
|
const showPhase = item.phase !== lastPhase;
|
|
6798
6813
|
lastPhase = item.phase;
|
|
6799
6814
|
const inPhase = items.filter((i) => i.phase === item.phase).length;
|
|
6800
6815
|
const isBoundary = n === firstPending;
|
|
6801
|
-
return /* @__PURE__ */ (0,
|
|
6802
|
-
showPhase ? /* @__PURE__ */ (0,
|
|
6803
|
-
/* @__PURE__ */ (0,
|
|
6804
|
-
/* @__PURE__ */ (0,
|
|
6805
|
-
item.phase === 0 ? null : /* @__PURE__ */ (0,
|
|
6816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(React28.Fragment, { children: [
|
|
6817
|
+
showPhase ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-rm-era", children: [
|
|
6818
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-row", style: { gap: 8, flexWrap: "wrap", alignItems: "baseline" }, children: [
|
|
6819
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { style: { fontWeight: 700 }, children: item.phase === 0 ? "Shipped" : "Phase " + item.phase + " \u2014 " + item.phaseName }),
|
|
6820
|
+
item.phase === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
|
|
6806
6821
|
fmtDate(item.phaseStart),
|
|
6807
6822
|
" \u2013 ",
|
|
6808
6823
|
fmtDate(item.date)
|
|
6809
6824
|
] }),
|
|
6810
|
-
/* @__PURE__ */ (0,
|
|
6825
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { style: { opacity: 0.7, fontWeight: 400 }, children: [
|
|
6811
6826
|
"\xB7 ",
|
|
6812
6827
|
inPhase,
|
|
6813
6828
|
" feature",
|
|
6814
6829
|
inPhase === 1 ? "" : "s"
|
|
6815
6830
|
] })
|
|
6816
6831
|
] }),
|
|
6817
|
-
item.phaseWhy ? /* @__PURE__ */ (0,
|
|
6832
|
+
item.phaseWhy ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fd-rm-era-why", children: item.phaseWhy }) : null
|
|
6818
6833
|
] }) : null,
|
|
6819
|
-
isBoundary ? /* @__PURE__ */ (0,
|
|
6820
|
-
/* @__PURE__ */ (0,
|
|
6834
|
+
isBoundary ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fd-rm-now", ref: nowRef, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "fd-rm-now-pill", children: [
|
|
6835
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("i", { className: "ph ph-map-pin" }),
|
|
6821
6836
|
" You are here \u2014 everything above is wired"
|
|
6822
6837
|
] }) }) : null,
|
|
6823
|
-
/* @__PURE__ */ (0,
|
|
6824
|
-
/* @__PURE__ */ (0,
|
|
6825
|
-
/* @__PURE__ */ (0,
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-rm-row", children: [
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "fd-rm-dot " + (item.implemented ? "is-shipped" : item.status === "next" ? "is-next" : "") }),
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fd-rm-date", children: [
|
|
6826
6841
|
fmtDate(item.date),
|
|
6827
|
-
/* @__PURE__ */ (0,
|
|
6828
|
-
/* @__PURE__ */ (0,
|
|
6842
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("br", {}),
|
|
6843
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { style: { opacity: 0.75 }, children: item.implemented ? "shipped" : "phase " + item.phase })
|
|
6829
6844
|
] }),
|
|
6830
|
-
/* @__PURE__ */ (0,
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RoadmapCard, { item, byKey, onOpenFlag })
|
|
6831
6846
|
] })
|
|
6832
6847
|
] }, item.key);
|
|
6833
6848
|
}),
|
|
6834
|
-
!items.length ? /* @__PURE__ */ (0,
|
|
6849
|
+
!items.length ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fd-body-sm fd-muted", children: "Nothing matches that filter." }) : null
|
|
6835
6850
|
] }) }) }),
|
|
6836
|
-
/* @__PURE__ */ (0,
|
|
6851
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("p", { className: "fd-body-sm fd-muted", style: { margin: 0 }, children: [
|
|
6837
6852
|
"Derived from the feature-flag registry \u2014 each entry's status is its flag's ",
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
6853
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("code", { className: "fd-mono", children: "implemented" }),
|
|
6839
6854
|
" field, so this page cannot drift from what the apps actually do."
|
|
6840
6855
|
] })
|
|
6841
6856
|
] });
|
|
@@ -6844,7 +6859,7 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
6844
6859
|
// src/components/platform/ComingSoon.tsx
|
|
6845
6860
|
var React29 = __toESM(require("react"), 1);
|
|
6846
6861
|
var import_react_dom7 = require("react-dom");
|
|
6847
|
-
var
|
|
6862
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6848
6863
|
var BYPASS_STORE = "fd.soon.bypass.v1";
|
|
6849
6864
|
function readBypassed() {
|
|
6850
6865
|
try {
|
|
@@ -6874,35 +6889,35 @@ function useBypass(key) {
|
|
|
6874
6889
|
return [on, set];
|
|
6875
6890
|
}
|
|
6876
6891
|
function SoonCard({ label, detail, backend, eta, effort, onRoadmap, allowed, onBypass }) {
|
|
6877
|
-
return /* @__PURE__ */ (0,
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
6892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
6893
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "fd-soon-badge", children: [
|
|
6894
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" }),
|
|
6880
6895
|
label
|
|
6881
6896
|
] }),
|
|
6882
|
-
detail ? /* @__PURE__ */ (0,
|
|
6883
|
-
backend ? /* @__PURE__ */ (0,
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6897
|
+
detail ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "fd-soon-detail", children: detail }) : null,
|
|
6898
|
+
backend ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "fd-soon-backend", children: [
|
|
6899
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "fd-overline", children: "Needs" }),
|
|
6885
6900
|
" ",
|
|
6886
6901
|
backend
|
|
6887
6902
|
] }) : null,
|
|
6888
|
-
eta || effort || onRoadmap ? /* @__PURE__ */ (0,
|
|
6889
|
-
eta ? /* @__PURE__ */ (0,
|
|
6890
|
-
/* @__PURE__ */ (0,
|
|
6903
|
+
eta || effort || onRoadmap ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "fd-soon-meta", children: [
|
|
6904
|
+
eta ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-calendar-blank", "aria-hidden": "true" }),
|
|
6891
6906
|
" ",
|
|
6892
6907
|
eta
|
|
6893
6908
|
] }) : null,
|
|
6894
|
-
effort ? /* @__PURE__ */ (0,
|
|
6895
|
-
/* @__PURE__ */ (0,
|
|
6909
|
+
effort ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-hourglass-medium", "aria-hidden": "true" }),
|
|
6896
6911
|
" ",
|
|
6897
6912
|
effort
|
|
6898
6913
|
] }) : null,
|
|
6899
|
-
onRoadmap ? /* @__PURE__ */ (0,
|
|
6914
|
+
onRoadmap ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "fd-soon-link", onClick: onRoadmap, children: [
|
|
6900
6915
|
"See the roadmap ",
|
|
6901
|
-
/* @__PURE__ */ (0,
|
|
6916
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
6902
6917
|
] }) : null
|
|
6903
6918
|
] }) : null,
|
|
6904
|
-
allowed ? /* @__PURE__ */ (0,
|
|
6905
|
-
/* @__PURE__ */ (0,
|
|
6919
|
+
allowed ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "fd-soon-view", onClick: onBypass, children: [
|
|
6920
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-eye", "aria-hidden": "true" }),
|
|
6906
6921
|
" View and use it anyway"
|
|
6907
6922
|
] }) : null
|
|
6908
6923
|
] });
|
|
@@ -6962,9 +6977,9 @@ function ComingSoon({
|
|
|
6962
6977
|
const tip = [label, detail, backend ? "Needs " + backend : null, eta ? "ETA " + eta : null, effort].filter(Boolean).join(" \xB7 ");
|
|
6963
6978
|
if (inline) {
|
|
6964
6979
|
if (allowed && bypassed) {
|
|
6965
|
-
return /* @__PURE__ */ (0,
|
|
6980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: ["fd-soon-inline-on", className].filter(Boolean).join(" "), ...rest, children: [
|
|
6966
6981
|
children,
|
|
6967
|
-
/* @__PURE__ */ (0,
|
|
6982
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6968
6983
|
"button",
|
|
6969
6984
|
{
|
|
6970
6985
|
type: "button",
|
|
@@ -6972,12 +6987,12 @@ function ComingSoon({
|
|
|
6972
6987
|
title: "Unwired \u2014 writes go to the simulated backend. " + tip + " Click to re-blur.",
|
|
6973
6988
|
onClick: () => setBypassed(false),
|
|
6974
6989
|
"aria-label": "Re-blur this unwired feature",
|
|
6975
|
-
children: /* @__PURE__ */ (0,
|
|
6990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" })
|
|
6976
6991
|
}
|
|
6977
6992
|
)
|
|
6978
6993
|
] });
|
|
6979
6994
|
}
|
|
6980
|
-
return /* @__PURE__ */ (0,
|
|
6995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6981
6996
|
InlineSoon,
|
|
6982
6997
|
{
|
|
6983
6998
|
label,
|
|
@@ -6997,20 +7012,20 @@ function ComingSoon({
|
|
|
6997
7012
|
);
|
|
6998
7013
|
}
|
|
6999
7014
|
if (allowed && bypassed) {
|
|
7000
|
-
return /* @__PURE__ */ (0,
|
|
7001
|
-
/* @__PURE__ */ (0,
|
|
7002
|
-
/* @__PURE__ */ (0,
|
|
7003
|
-
/* @__PURE__ */ (0,
|
|
7015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 14 }, ...rest, children: [
|
|
7016
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "fd-soon-bar", role: "status", children: [
|
|
7017
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "fd-soon-badge", children: [
|
|
7018
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" }),
|
|
7004
7019
|
"Unwired feature \u2014 you are using it anyway"
|
|
7005
7020
|
] }),
|
|
7006
|
-
/* @__PURE__ */ (0,
|
|
7007
|
-
/* @__PURE__ */ (0,
|
|
7008
|
-
onRoadmap ? /* @__PURE__ */ (0,
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "fd-soon-bar-detail", children: "Every action here writes to the simulated backend, so nothing you do persists beyond this session." }),
|
|
7022
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "fd-soon-bar-actions", children: [
|
|
7023
|
+
onRoadmap ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "fd-soon-link", onClick: onRoadmap, children: [
|
|
7009
7024
|
"Roadmap ",
|
|
7010
|
-
/* @__PURE__ */ (0,
|
|
7025
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
7011
7026
|
] }) : null,
|
|
7012
|
-
/* @__PURE__ */ (0,
|
|
7013
|
-
/* @__PURE__ */ (0,
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "fd-soon-link", onClick: () => setBypassed(false), children: [
|
|
7028
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-eye-slash", "aria-hidden": "true" }),
|
|
7014
7029
|
" Re-blur"
|
|
7015
7030
|
] })
|
|
7016
7031
|
] })
|
|
@@ -7018,10 +7033,10 @@ function ComingSoon({
|
|
|
7018
7033
|
children
|
|
7019
7034
|
] });
|
|
7020
7035
|
}
|
|
7021
|
-
return /* @__PURE__ */ (0,
|
|
7022
|
-
/* @__PURE__ */ (0,
|
|
7023
|
-
/* @__PURE__ */ (0,
|
|
7024
|
-
/* @__PURE__ */ (0,
|
|
7036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: ["fd-soon", className].filter(Boolean).join(" "), style: minHeight ? { minHeight } : void 0, ...rest, children: [
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fd-soon-under", style: { filter: "blur(" + blur + "px) saturate(.62)" }, ...{ inert: "" }, "aria-hidden": "true", children }),
|
|
7038
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fd-soon-veil" }),
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "fd-soon-note", role: "note", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7025
7040
|
SoonCard,
|
|
7026
7041
|
{
|
|
7027
7042
|
label,
|
|
@@ -7058,7 +7073,7 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
7058
7073
|
React29.useEffect(() => () => {
|
|
7059
7074
|
if (close.current) clearTimeout(close.current);
|
|
7060
7075
|
}, []);
|
|
7061
|
-
return /* @__PURE__ */ (0,
|
|
7076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7062
7077
|
"span",
|
|
7063
7078
|
{
|
|
7064
7079
|
ref: anchor,
|
|
@@ -7069,8 +7084,8 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
7069
7084
|
onBlur: hide,
|
|
7070
7085
|
...rest,
|
|
7071
7086
|
children: [
|
|
7072
|
-
/* @__PURE__ */ (0,
|
|
7073
|
-
/* @__PURE__ */ (0,
|
|
7087
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "fd-soon-under", style: { filter: "blur(" + Math.min(blur, 1.1) + "px) saturate(.66)" }, ...{ inert: "" }, "aria-hidden": "true", children }),
|
|
7088
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7074
7089
|
"button",
|
|
7075
7090
|
{
|
|
7076
7091
|
type: "button",
|
|
@@ -7081,11 +7096,11 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
7081
7096
|
onFocus: show,
|
|
7082
7097
|
onBlur: hide,
|
|
7083
7098
|
onClick: () => open ? setOpen(false) : show(),
|
|
7084
|
-
children: /* @__PURE__ */ (0,
|
|
7099
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" })
|
|
7085
7100
|
}
|
|
7086
7101
|
),
|
|
7087
7102
|
open && pos ? (0, import_react_dom7.createPortal)(
|
|
7088
|
-
/* @__PURE__ */ (0,
|
|
7103
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7089
7104
|
"div",
|
|
7090
7105
|
{
|
|
7091
7106
|
className: "fd-soon-note fd-soon-hovercard",
|
|
@@ -7093,7 +7108,7 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
7093
7108
|
style: { position: "fixed", left: pos.left, top: pos.top, bottom: pos.bottom, width: pos.width },
|
|
7094
7109
|
onMouseEnter: show,
|
|
7095
7110
|
onMouseLeave: hide,
|
|
7096
|
-
children: /* @__PURE__ */ (0,
|
|
7111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7097
7112
|
SoonCard,
|
|
7098
7113
|
{
|
|
7099
7114
|
label,
|
|
@@ -7123,10 +7138,10 @@ function formatEta(iso2) {
|
|
|
7123
7138
|
var FormatEta = formatEta;
|
|
7124
7139
|
|
|
7125
7140
|
// src/components/platform/Gate.tsx
|
|
7126
|
-
var
|
|
7141
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7127
7142
|
function PermissionDenied({ permission, title, detail, compact: compact3 = false, className = "", ...rest }) {
|
|
7128
7143
|
const need = Array.isArray(permission) ? permission : [permission].filter(Boolean);
|
|
7129
|
-
return /* @__PURE__ */ (0,
|
|
7144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
7130
7145
|
"div",
|
|
7131
7146
|
{
|
|
7132
7147
|
className: ["fd-stack", className].filter(Boolean).join(" "),
|
|
@@ -7142,14 +7157,14 @@ function PermissionDenied({ permission, title, detail, compact: compact3 = false
|
|
|
7142
7157
|
},
|
|
7143
7158
|
...rest,
|
|
7144
7159
|
children: [
|
|
7145
|
-
/* @__PURE__ */ (0,
|
|
7146
|
-
/* @__PURE__ */ (0,
|
|
7147
|
-
/* @__PURE__ */ (0,
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
7161
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("i", { className: "ph ph-lock-simple", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
7162
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: compact3 ? "fd-label-lg" : "fd-h3", children: title || "You do not have access to this" })
|
|
7148
7163
|
] }),
|
|
7149
|
-
/* @__PURE__ */ (0,
|
|
7150
|
-
need.length ? /* @__PURE__ */ (0,
|
|
7151
|
-
/* @__PURE__ */ (0,
|
|
7152
|
-
need.map((p) => /* @__PURE__ */ (0,
|
|
7164
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: detail || "Your roles do not grant this. An administrator can change that from Admin \u2192 Users." }),
|
|
7165
|
+
need.length ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap" }, children: [
|
|
7166
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "fd-overline fd-muted", children: "Requires" }),
|
|
7167
|
+
need.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "fd-mono", style: {
|
|
7153
7168
|
fontSize: 11.5,
|
|
7154
7169
|
padding: "2px 7px",
|
|
7155
7170
|
borderRadius: 5,
|
|
@@ -7170,7 +7185,7 @@ function Gate({ perm, anyOf, role, silent = false, fallback, compact: compact3 =
|
|
|
7170
7185
|
if (ok) return children;
|
|
7171
7186
|
if (fallback !== void 0) return fallback;
|
|
7172
7187
|
if (silent) return null;
|
|
7173
|
-
return /* @__PURE__ */ (0,
|
|
7188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PermissionDenied, { permission: perm || anyOf, compact: compact3 });
|
|
7174
7189
|
}
|
|
7175
7190
|
function FeatureGate({
|
|
7176
7191
|
flag,
|
|
@@ -7191,7 +7206,7 @@ function FeatureGate({
|
|
|
7191
7206
|
if (!preview) return fallback;
|
|
7192
7207
|
const f = SessionKit.findFlag(flag) || {};
|
|
7193
7208
|
const missing = rt.missing || [];
|
|
7194
|
-
return /* @__PURE__ */ (0,
|
|
7209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7195
7210
|
ComingSoon,
|
|
7196
7211
|
{
|
|
7197
7212
|
label: label || (variant === "inline" ? f.label || "Not wired yet" : "Designed \u2014 backend not wired yet"),
|
|
@@ -7212,20 +7227,20 @@ function FeatureGate({
|
|
|
7212
7227
|
function PermissionHint({ perm, children }) {
|
|
7213
7228
|
SessionKit.useSession();
|
|
7214
7229
|
if (SessionKit.can(perm)) return children;
|
|
7215
|
-
return /* @__PURE__ */ (0,
|
|
7230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7216
7231
|
"span",
|
|
7217
7232
|
{
|
|
7218
7233
|
title: "Requires " + (Array.isArray(perm) ? perm.join(", ") : perm),
|
|
7219
7234
|
style: { display: "inline-flex", opacity: 0.45, cursor: "not-allowed" },
|
|
7220
7235
|
"aria-disabled": "true",
|
|
7221
|
-
children: /* @__PURE__ */ (0,
|
|
7236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { pointerEvents: "none" }, children })
|
|
7222
7237
|
}
|
|
7223
7238
|
);
|
|
7224
7239
|
}
|
|
7225
7240
|
|
|
7226
7241
|
// src/components/platform/ModeSwitch.tsx
|
|
7227
7242
|
var React30 = __toESM(require("react"), 1);
|
|
7228
|
-
var
|
|
7243
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7229
7244
|
function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog, onOpenSpec, summary }) {
|
|
7230
7245
|
const mode2 = useRuntimeMode();
|
|
7231
7246
|
const [open, setOpen] = React30.useState(false);
|
|
@@ -7252,8 +7267,8 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
7252
7267
|
RuntimeKit.setMode(next);
|
|
7253
7268
|
setOpen(false);
|
|
7254
7269
|
};
|
|
7255
|
-
return /* @__PURE__ */ (0,
|
|
7256
|
-
/* @__PURE__ */ (0,
|
|
7270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { style: { position: "relative", display: "inline-flex" }, ref, children: [
|
|
7271
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7257
7272
|
"button",
|
|
7258
7273
|
{
|
|
7259
7274
|
type: "button",
|
|
@@ -7263,29 +7278,29 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
7263
7278
|
title: test ? "Test mode \u2014 every response is simulated. Click to inspect requests or return to live mode." : "Live mode \u2014 incomplete features are shown under construction. Click for test mode.",
|
|
7264
7279
|
className: "fd-mode-btn" + (test ? " is-test" : "") + (open ? " is-open" : ""),
|
|
7265
7280
|
children: [
|
|
7266
|
-
/* @__PURE__ */ (0,
|
|
7267
|
-
test && requestCount ? /* @__PURE__ */ (0,
|
|
7281
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph " + (test ? "ph-flask" : "ph-lightning"), style: { fontSize: 17 } }),
|
|
7282
|
+
test && requestCount ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-mono fd-mode-count", children: requestCount > 99 ? "99+" : requestCount }, requestCount) : null
|
|
7268
7283
|
]
|
|
7269
7284
|
}
|
|
7270
7285
|
),
|
|
7271
|
-
open ? /* @__PURE__ */ (0,
|
|
7272
|
-
/* @__PURE__ */ (0,
|
|
7273
|
-
/* @__PURE__ */ (0,
|
|
7274
|
-
/* @__PURE__ */ (0,
|
|
7286
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-view-enter fd-mode-pop", children: [
|
|
7287
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
7288
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-badge " + (test ? "fd-badge-warning" : "fd-badge-neutral"), children: [
|
|
7289
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph " + (test ? "ph-flask" : "ph-lightning"), "aria-hidden": "true" }),
|
|
7275
7290
|
test ? "Test mode" : "Live mode"
|
|
7276
7291
|
] }),
|
|
7277
|
-
test ? /* @__PURE__ */ (0,
|
|
7292
|
+
test ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
7278
7293
|
requestCount,
|
|
7279
7294
|
" simulated request",
|
|
7280
7295
|
requestCount === 1 ? "" : "s"
|
|
7281
7296
|
] }) : null,
|
|
7282
|
-
/* @__PURE__ */ (0,
|
|
7283
|
-
test && onClearLog ? /* @__PURE__ */ (0,
|
|
7297
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { flex: 1 } }),
|
|
7298
|
+
test && onClearLog ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { type: "button", className: "fd-soon-link", onClick: onClearLog, children: "Clear" }) : null
|
|
7284
7299
|
] }),
|
|
7285
|
-
/* @__PURE__ */ (0,
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7288
|
-
/* @__PURE__ */ (0,
|
|
7300
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { style: { display: "block", padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
7301
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-body-sm fd-secondary", style: { display: "block", textWrap: "pretty" }, children: test ? "Every feature is usable and nothing is obstructed, but no response comes from a real service \u2014 nothing you do here persists. Use this to review and demo the design." : "This is what a user would see today. " + s.incomplete + " of " + s.total + " features depend on backend work that is not wired yet, so they render under construction." }),
|
|
7302
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-row", style: { gap: 8, marginTop: 10, flexWrap: "wrap" }, children: [
|
|
7303
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
7289
7304
|
s.endpointsWired,
|
|
7290
7305
|
" endpoint",
|
|
7291
7306
|
s.endpointsWired === 1 ? "" : "s",
|
|
@@ -7295,58 +7310,58 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
7295
7310
|
s.total,
|
|
7296
7311
|
" features complete"
|
|
7297
7312
|
] }),
|
|
7298
|
-
onOpenSpec ? /* @__PURE__ */ (0,
|
|
7299
|
-
/* @__PURE__ */ (0,
|
|
7300
|
-
/* @__PURE__ */ (0,
|
|
7313
|
+
onOpenSpec ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
7314
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { flex: 1 } }),
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("button", { type: "button", className: "fd-soon-link", onClick: () => {
|
|
7301
7316
|
setOpen(false);
|
|
7302
7317
|
onOpenSpec();
|
|
7303
7318
|
}, children: [
|
|
7304
7319
|
"API spec ",
|
|
7305
|
-
/* @__PURE__ */ (0,
|
|
7320
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
7306
7321
|
] })
|
|
7307
7322
|
] }) : null
|
|
7308
7323
|
] })
|
|
7309
7324
|
] }),
|
|
7310
|
-
/* @__PURE__ */ (0,
|
|
7311
|
-
/* @__PURE__ */ (0,
|
|
7312
|
-
/* @__PURE__ */ (0,
|
|
7313
|
-
/* @__PURE__ */ (0,
|
|
7314
|
-
/* @__PURE__ */ (0,
|
|
7315
|
-
/* @__PURE__ */ (0,
|
|
7325
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-mode-choice", children: [
|
|
7326
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("button", { type: "button", className: "fd-mode-opt" + (!test ? " is-on" : ""), onClick: () => go("live"), children: [
|
|
7327
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-lightning", "aria-hidden": "true" }),
|
|
7328
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-mode-opt-text", children: [
|
|
7329
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-mode-opt-title", children: "Live mode" }),
|
|
7330
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-mode-opt-desc", children: "Incomplete features under construction" })
|
|
7316
7331
|
] }),
|
|
7317
|
-
!test ? /* @__PURE__ */ (0,
|
|
7332
|
+
!test ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-check", "aria-hidden": "true" }) : null
|
|
7318
7333
|
] }),
|
|
7319
|
-
/* @__PURE__ */ (0,
|
|
7320
|
-
/* @__PURE__ */ (0,
|
|
7321
|
-
/* @__PURE__ */ (0,
|
|
7322
|
-
/* @__PURE__ */ (0,
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
7334
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("button", { type: "button", className: "fd-mode-opt" + (test ? " is-on" : ""), onClick: () => go("test"), children: [
|
|
7335
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-flask", "aria-hidden": "true" }),
|
|
7336
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-mode-opt-text", children: [
|
|
7337
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-mode-opt-title", children: "Test mode" }),
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-mode-opt-desc", children: "Everything usable, all data simulated" })
|
|
7324
7339
|
] }),
|
|
7325
|
-
test ? /* @__PURE__ */ (0,
|
|
7340
|
+
test ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-check", "aria-hidden": "true" }) : null
|
|
7326
7341
|
] })
|
|
7327
7342
|
] }),
|
|
7328
|
-
test && renderLog ? /* @__PURE__ */ (0,
|
|
7343
|
+
test && renderLog ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { display: "block", maxHeight: 340, overflowY: "auto", borderTop: "1px solid var(--border)" }, children: renderLog() }) : null
|
|
7329
7344
|
] }) : null
|
|
7330
7345
|
] });
|
|
7331
7346
|
}
|
|
7332
7347
|
function TestModeBar({ onExit }) {
|
|
7333
7348
|
const mode2 = useRuntimeMode();
|
|
7334
7349
|
if (mode2 !== "test") return null;
|
|
7335
|
-
return /* @__PURE__ */ (0,
|
|
7336
|
-
/* @__PURE__ */ (0,
|
|
7337
|
-
/* @__PURE__ */ (0,
|
|
7350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "fd-testbar", role: "status", children: [
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "fd-badge fd-badge-warning", children: [
|
|
7352
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-flask", "aria-hidden": "true" }),
|
|
7338
7353
|
"Test mode"
|
|
7339
7354
|
] }),
|
|
7340
|
-
/* @__PURE__ */ (0,
|
|
7341
|
-
/* @__PURE__ */ (0,
|
|
7342
|
-
/* @__PURE__ */ (0,
|
|
7355
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "fd-testbar-detail", children: "Every feature is unlocked and every response is simulated \u2014 nothing here persists." }),
|
|
7356
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("button", { type: "button", className: "fd-soon-link", onClick: () => onExit ? onExit() : RuntimeKit.setMode("live"), children: [
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { className: "ph ph-lightning", "aria-hidden": "true" }),
|
|
7343
7358
|
" Back to live mode"
|
|
7344
7359
|
] })
|
|
7345
7360
|
] });
|
|
7346
7361
|
}
|
|
7347
7362
|
|
|
7348
7363
|
// src/components/planner/ChannelMeta.tsx
|
|
7349
|
-
var
|
|
7364
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7350
7365
|
var CHANNEL_WEIGHTS = {
|
|
7351
7366
|
"OOH": 50,
|
|
7352
7367
|
"DOOH": 50,
|
|
@@ -7399,9 +7414,9 @@ function ChannelTag({ channel, size = "md", showLabel = true, dot = false, weigh
|
|
|
7399
7414
|
const m = ChannelMeta(channel);
|
|
7400
7415
|
const wt = channelWeightOf(channel || "");
|
|
7401
7416
|
if (dot) {
|
|
7402
|
-
return /* @__PURE__ */ (0,
|
|
7417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: ["fd-chan-dot", className].filter(Boolean).join(" "), title: m.name, style: { background: m.color }, ...rest });
|
|
7403
7418
|
}
|
|
7404
|
-
return /* @__PURE__ */ (0,
|
|
7419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
7405
7420
|
"span",
|
|
7406
7421
|
{
|
|
7407
7422
|
className: ["fd-chan", size === "sm" ? "fd-chan-sm" : "", className].filter(Boolean).join(" "),
|
|
@@ -7409,16 +7424,16 @@ function ChannelTag({ channel, size = "md", showLabel = true, dot = false, weigh
|
|
|
7409
7424
|
style: { "--chan": m.color },
|
|
7410
7425
|
...rest,
|
|
7411
7426
|
children: [
|
|
7412
|
-
/* @__PURE__ */ (0,
|
|
7413
|
-
showLabel ? /* @__PURE__ */ (0,
|
|
7414
|
-
weight ? /* @__PURE__ */ (0,
|
|
7427
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("i", { className: "ph ph-" + m.icon, "aria-hidden": "true" }),
|
|
7428
|
+
showLabel ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fd-chan-label", children: m.label }) : null,
|
|
7429
|
+
weight ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fd-chan-weight", children: wt || 0 }) : null
|
|
7415
7430
|
]
|
|
7416
7431
|
}
|
|
7417
7432
|
);
|
|
7418
7433
|
}
|
|
7419
7434
|
|
|
7420
7435
|
// src/components/planner/SaturationDistribution.tsx
|
|
7421
|
-
var
|
|
7436
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7422
7437
|
var BANDS2 = [
|
|
7423
7438
|
{ key: "weak", label: "Weak", n: 1, range: "< 50" },
|
|
7424
7439
|
{ key: "adequate", label: "Adequate", n: 2, range: "50\u2013100" },
|
|
@@ -7429,18 +7444,18 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
7429
7444
|
const grouped = BANDS2.map((b) => ({ ...b, items: campuses.filter((c) => c.band === b.key) }));
|
|
7430
7445
|
const tallest = Math.max(1, ...grouped.map((g) => g.items.length));
|
|
7431
7446
|
const floor = BANDS2.find((b) => b.key === floorBand) || BANDS2[0];
|
|
7432
|
-
return /* @__PURE__ */ (0,
|
|
7433
|
-
/* @__PURE__ */ (0,
|
|
7447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 16 }, children: [
|
|
7448
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { display: "grid", gridTemplateColumns: "repeat(4,1fr)", gap: 12, alignItems: "end" }, children: grouped.map((g) => {
|
|
7434
7449
|
const mark = "var(--csi-" + g.n + "-mark)";
|
|
7435
7450
|
const active = selectedBand === g.key;
|
|
7436
|
-
return /* @__PURE__ */ (0,
|
|
7451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
7437
7452
|
"button",
|
|
7438
7453
|
{
|
|
7439
7454
|
type: "button",
|
|
7440
7455
|
onClick: onSelectBand ? () => onSelectBand(active ? null : g.key) : void 0,
|
|
7441
7456
|
style: { display: "flex", flexDirection: "column", justifyContent: "flex-end", gap: 10, padding: 12, border: "1px solid " + (active ? "var(--border-strong)" : "var(--border)"), borderRadius: "var(--r-lg)", background: active ? "var(--surface-2)" : "var(--surface)", cursor: onSelectBand ? "pointer" : "default", textAlign: "left", minHeight: 190, transition: "background var(--dur-fast) var(--ease),border-color var(--dur-fast) var(--ease)" },
|
|
7442
7457
|
children: [
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7458
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { display: "flex", flexDirection: "column-reverse", gap: 4, minHeight: tallest * 24 }, children: loading ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-skel", style: { height: 16, borderRadius: 4 } }, i)) : g.items.map((c) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7444
7459
|
"span",
|
|
7445
7460
|
{
|
|
7446
7461
|
title: c.name + " \xB7 " + c.crp,
|
|
@@ -7449,13 +7464,13 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
7449
7464
|
},
|
|
7450
7465
|
c.name
|
|
7451
7466
|
)) }),
|
|
7452
|
-
/* @__PURE__ */ (0,
|
|
7453
|
-
/* @__PURE__ */ (0,
|
|
7454
|
-
/* @__PURE__ */ (0,
|
|
7467
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "fd-row", style: { gap: 8, alignItems: "baseline" }, children: [
|
|
7468
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-num-hero", style: { fontSize: 30, color: g.items.length ? "var(--text)" : "var(--text-disabled)" }, children: loading ? "\u2013" : g.items.length }),
|
|
7469
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-meter", style: { gap: 2, color: mark }, "aria-hidden": "true", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-meter-seg" + (i <= g.n ? " is-on" : ""), style: { width: 4, height: 9 } }, i)) })
|
|
7455
7470
|
] }),
|
|
7456
|
-
/* @__PURE__ */ (0,
|
|
7457
|
-
/* @__PURE__ */ (0,
|
|
7458
|
-
/* @__PURE__ */ (0,
|
|
7471
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "fd-stack", style: { gap: 1 }, children: [
|
|
7472
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-label-lg", children: g.label }),
|
|
7473
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "fd-body-sm fd-muted", style: { fontSize: 11.5 }, children: [
|
|
7459
7474
|
"CRP ",
|
|
7460
7475
|
g.range
|
|
7461
7476
|
] })
|
|
@@ -7465,10 +7480,10 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
7465
7480
|
g.key
|
|
7466
7481
|
);
|
|
7467
7482
|
}) }),
|
|
7468
|
-
floorBand ? /* @__PURE__ */ (0,
|
|
7469
|
-
/* @__PURE__ */ (0,
|
|
7470
|
-
/* @__PURE__ */ (0,
|
|
7471
|
-
/* @__PURE__ */ (0,
|
|
7483
|
+
floorBand ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderRadius: "var(--r-md)", background: "var(--surface-2)", border: "1px solid var(--border)", flexWrap: "wrap" }, children: [
|
|
7484
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-meter", style: { gap: 2, color: "var(--csi-" + floor.n + "-mark)" }, "aria-hidden": "true", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "fd-meter-seg" + (i <= floor.n ? " is-on" : ""), style: { width: 5, height: 12 } }, i)) }),
|
|
7485
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "fd-body-sm fd-secondary", style: { flex: 1, minWidth: 240 }, children: [
|
|
7486
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("strong", { style: { color: "var(--text)" }, children: [
|
|
7472
7487
|
"Plan floor ",
|
|
7473
7488
|
floorScore
|
|
7474
7489
|
] }),
|
|
@@ -7480,20 +7495,20 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
7480
7495
|
|
|
7481
7496
|
// src/components/planner/MixGap.tsx
|
|
7482
7497
|
var React31 = __toESM(require("react"), 1);
|
|
7483
|
-
var
|
|
7498
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7484
7499
|
function MixGap({ rows = [], loading = false, className = "" }) {
|
|
7485
7500
|
const max = Math.max(1, ...rows.flatMap((r) => [r.target, r.realized]));
|
|
7486
7501
|
const [hover, setHover] = React31.useState(null);
|
|
7487
7502
|
const toneOf = (gap) => gap >= -1 ? "ok" : gap >= -4 ? "warn" : "danger";
|
|
7488
7503
|
const TONE = { ok: "var(--ok-solid)", warn: "var(--warn-solid)", danger: "var(--danger-solid)" };
|
|
7489
|
-
return /* @__PURE__ */ (0,
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7491
|
-
[["On target", TONE.ok], ["Close", TONE.warn], ["Short", TONE.danger]].map(([l, c]) => /* @__PURE__ */ (0,
|
|
7492
|
-
/* @__PURE__ */ (0,
|
|
7504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 4 }, children: [
|
|
7505
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "fd-row", style: { gap: 16, justifyContent: "flex-end", paddingBottom: 6, flexWrap: "wrap" }, children: [
|
|
7506
|
+
[["On target", TONE.ok], ["Close", TONE.warn], ["Short", TONE.danger]].map(([l, c]) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
|
|
7507
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { width: 14, height: 9, borderRadius: 2, background: c } }),
|
|
7493
7508
|
l
|
|
7494
7509
|
] }, l)),
|
|
7495
|
-
/* @__PURE__ */ (0,
|
|
7496
|
-
/* @__PURE__ */ (0,
|
|
7510
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
|
|
7511
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { width: 3, height: 14, background: "var(--n-500)" } }),
|
|
7497
7512
|
"Target"
|
|
7498
7513
|
] })
|
|
7499
7514
|
] }),
|
|
@@ -7501,7 +7516,7 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
7501
7516
|
const gap = r.realized - r.target;
|
|
7502
7517
|
const tone = toneOf(gap);
|
|
7503
7518
|
const tip = "Realized " + r.realized + "% vs " + r.target + "% target" + (gap < -1 ? " \xB7 " + Math.abs(gap).toFixed(0) + " pts short" : gap > 1 ? " \xB7 " + gap.toFixed(0) + " pts over" : " \xB7 on target") + (r.note ? " \u2014 " + r.note : "");
|
|
7504
|
-
return /* @__PURE__ */ (0,
|
|
7519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
7505
7520
|
"div",
|
|
7506
7521
|
{
|
|
7507
7522
|
className: "fd-row",
|
|
@@ -7509,15 +7524,15 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
7509
7524
|
onMouseEnter: () => setHover(r.channel),
|
|
7510
7525
|
onMouseLeave: () => setHover(null),
|
|
7511
7526
|
children: [
|
|
7512
|
-
/* @__PURE__ */ (0,
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7514
|
-
/* @__PURE__ */ (0,
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7516
|
-
/* @__PURE__ */ (0,
|
|
7527
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { width: 128, flex: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ChannelTag, { channel: r.channel, size: "sm" }) }),
|
|
7528
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { position: "relative", flex: 1, height: 22, minWidth: 120 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "fd-skel", style: { position: "absolute", inset: "5px 0", borderRadius: 3 } }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
7529
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { position: "absolute", left: 0, top: 5, height: 12, width: r.realized / max * 100 + "%", background: TONE[tone], borderRadius: "2px 3px 3px 2px", transition: "width var(--dur-slow) var(--ease), background var(--dur-base) var(--ease)" } }),
|
|
7530
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { style: { position: "absolute", left: r.target / max * 100 + "%", top: 0, width: 3, height: 22, background: "var(--n-500)", borderRadius: 1 } }),
|
|
7531
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "fd-num", style: { position: "absolute", right: Math.max(r.realized, r.target) / max > 0.82 ? 0 : "auto", left: Math.max(r.realized, r.target) / max > 0.82 ? "auto" : "calc(" + Math.max(r.realized, r.target) / max * 100 + "% + 10px)", top: 2, fontSize: 12, color: "var(--text-muted)", whiteSpace: "nowrap", background: Math.max(r.realized, r.target) / max > 0.82 ? "var(--surface)" : "none", paddingLeft: 3 }, children: [
|
|
7517
7532
|
r.realized,
|
|
7518
7533
|
"%"
|
|
7519
7534
|
] }),
|
|
7520
|
-
hover === r.channel ? /* @__PURE__ */ (0,
|
|
7535
|
+
hover === r.channel ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "fd-tooltip", role: "tooltip", style: { position: "absolute", left: 0, right: "auto", bottom: 26, maxWidth: "min(340px, 100%)", whiteSpace: "normal", textAlign: "left", width: "max-content" }, children: tip }) : null
|
|
7521
7536
|
] }) })
|
|
7522
7537
|
]
|
|
7523
7538
|
},
|
|
@@ -7528,7 +7543,7 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
7528
7543
|
}
|
|
7529
7544
|
|
|
7530
7545
|
// src/components/planner/ChannelContribution.tsx
|
|
7531
|
-
var
|
|
7546
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7532
7547
|
var money = (n) => "$" + Math.round(n).toLocaleString();
|
|
7533
7548
|
function ChannelContribution({
|
|
7534
7549
|
channels = [],
|
|
@@ -7544,9 +7559,9 @@ function ChannelContribution({
|
|
|
7544
7559
|
const grand = total !== void 0 ? total : base + bonus;
|
|
7545
7560
|
const pct = (v) => grand ? v / grand * 100 : 0;
|
|
7546
7561
|
const spendTotal = channels.reduce((s, c) => s + Number(String(c.spend || 0).replace(/[^0-9.]/g, "")), 0);
|
|
7547
|
-
return /* @__PURE__ */ (0,
|
|
7548
|
-
loading ? /* @__PURE__ */ (0,
|
|
7549
|
-
channels.map((c) => /* @__PURE__ */ (0,
|
|
7562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 16 }, children: [
|
|
7563
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "fd-skel", style: { height: 34, borderRadius: "var(--r-sm)" } }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "fd-row", style: { height: 34, borderRadius: "var(--r-sm)", overflow: "hidden", gap: 2, background: "var(--surface-3)" }, children: [
|
|
7564
|
+
channels.map((c) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7550
7565
|
"span",
|
|
7551
7566
|
{
|
|
7552
7567
|
title: c.name + " \xB7 " + c.crp.toFixed(1) + " CRP",
|
|
@@ -7555,7 +7570,7 @@ function ChannelContribution({
|
|
|
7555
7570
|
},
|
|
7556
7571
|
c.name
|
|
7557
7572
|
)),
|
|
7558
|
-
bonus > 0 ? /* @__PURE__ */ (0,
|
|
7573
|
+
bonus > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7559
7574
|
"span",
|
|
7560
7575
|
{
|
|
7561
7576
|
title: "Surround-sound bonus +" + bonusPct + "%",
|
|
@@ -7564,18 +7579,18 @@ function ChannelContribution({
|
|
|
7564
7579
|
}
|
|
7565
7580
|
) : null
|
|
7566
7581
|
] }),
|
|
7567
|
-
showTable ? /* @__PURE__ */ (0,
|
|
7568
|
-
/* @__PURE__ */ (0,
|
|
7569
|
-
/* @__PURE__ */ (0,
|
|
7570
|
-
/* @__PURE__ */ (0,
|
|
7571
|
-
/* @__PURE__ */ (0,
|
|
7572
|
-
/* @__PURE__ */ (0,
|
|
7573
|
-
/* @__PURE__ */ (0,
|
|
7582
|
+
showTable ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("table", { className: "fd-table", style: { fontSize: "var(--body-sm-size)" }, children: [
|
|
7583
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tr", { children: [
|
|
7584
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { style: { width: "34%" }, children: "Channel" }),
|
|
7585
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { style: { width: "16%" }, children: "Weight" }),
|
|
7586
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { className: "is-num", style: { width: "16%" }, children: "Spend" }),
|
|
7587
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { className: "is-num", style: { width: "17%" }, children: "CRP" }),
|
|
7588
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { className: "is-num", style: { width: "17%" }, children: "Share" })
|
|
7574
7589
|
] }) }),
|
|
7575
|
-
/* @__PURE__ */ (0,
|
|
7576
|
-
channels.map((c) => /* @__PURE__ */ (0,
|
|
7577
|
-
/* @__PURE__ */ (0,
|
|
7578
|
-
/* @__PURE__ */ (0,
|
|
7590
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tbody", { children: [
|
|
7591
|
+
channels.map((c) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tr", { children: [
|
|
7592
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ChannelTag, { channel: c.name, size: "sm" }) }),
|
|
7593
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7579
7594
|
"span",
|
|
7580
7595
|
{
|
|
7581
7596
|
className: "fd-badge fd-badge-neutral",
|
|
@@ -7584,38 +7599,38 @@ function ChannelContribution({
|
|
|
7584
7599
|
children: "weight " + (channelWeightOf(c.name) || 0)
|
|
7585
7600
|
}
|
|
7586
7601
|
) }),
|
|
7587
|
-
/* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7589
|
-
/* @__PURE__ */ (0,
|
|
7602
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", children: c.spend }),
|
|
7603
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", children: c.crp.toFixed(1) }),
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("td", { className: "is-num", children: [
|
|
7590
7605
|
pct(c.crp).toFixed(0),
|
|
7591
7606
|
"%"
|
|
7592
7607
|
] })
|
|
7593
7608
|
] }, c.name)),
|
|
7594
|
-
bonus > 0 ? /* @__PURE__ */ (0,
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7596
|
-
/* @__PURE__ */ (0,
|
|
7609
|
+
bonus > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tr", { children: [
|
|
7610
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "fd-row", style: { gap: 9, fontWeight: 600 }, children: [
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { style: { width: 9, height: 9, borderRadius: 2, background: "repeating-linear-gradient(135deg,var(--csi-3-mark) 0 3px,var(--csi-2-mark) 3px 6px)", flex: "none" } }),
|
|
7597
7612
|
"Surround-sound bonus"
|
|
7598
7613
|
] }) }),
|
|
7599
|
-
/* @__PURE__ */ (0,
|
|
7614
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "fd-badge fd-badge-success", style: { height: 20, fontSize: 11 }, children: [
|
|
7600
7615
|
"+",
|
|
7601
7616
|
bonusPct,
|
|
7602
7617
|
"% of +",
|
|
7603
7618
|
bonusMax,
|
|
7604
7619
|
"%"
|
|
7605
7620
|
] }) }),
|
|
7606
|
-
/* @__PURE__ */ (0,
|
|
7607
|
-
/* @__PURE__ */ (0,
|
|
7608
|
-
/* @__PURE__ */ (0,
|
|
7621
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num fd-muted", children: "\u2014" }),
|
|
7622
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", children: bonus.toFixed(1) }),
|
|
7623
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("td", { className: "is-num", children: [
|
|
7609
7624
|
pct(bonus).toFixed(0),
|
|
7610
7625
|
"%"
|
|
7611
7626
|
] })
|
|
7612
7627
|
] }) : null,
|
|
7613
|
-
/* @__PURE__ */ (0,
|
|
7614
|
-
/* @__PURE__ */ (0,
|
|
7615
|
-
/* @__PURE__ */ (0,
|
|
7616
|
-
/* @__PURE__ */ (0,
|
|
7617
|
-
/* @__PURE__ */ (0,
|
|
7618
|
-
/* @__PURE__ */ (0,
|
|
7628
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("tr", { style: { background: "var(--surface-2)" }, children: [
|
|
7629
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { style: { fontWeight: 700 }, children: "Campus total" }),
|
|
7630
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", {}),
|
|
7631
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", style: { fontWeight: 700 }, children: money(spendTotal) }),
|
|
7632
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", style: { fontWeight: 700 }, children: grand.toFixed(1) }),
|
|
7633
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { className: "is-num", style: { fontWeight: 700 }, children: "100%" })
|
|
7619
7634
|
] })
|
|
7620
7635
|
] })
|
|
7621
7636
|
] }) : null
|
|
@@ -7624,7 +7639,7 @@ function ChannelContribution({
|
|
|
7624
7639
|
|
|
7625
7640
|
// src/components/planner/BudgetReallocator.tsx
|
|
7626
7641
|
var React32 = __toESM(require("react"), 1);
|
|
7627
|
-
var
|
|
7642
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7628
7643
|
var bandFor = (crp) => crp >= 200 ? "dominant" : crp >= 100 ? "strong" : crp >= 50 ? "adequate" : "weak";
|
|
7629
7644
|
function BudgetReallocator({
|
|
7630
7645
|
campus,
|
|
@@ -7655,24 +7670,24 @@ function BudgetReallocator({
|
|
|
7655
7670
|
setDraft(spend);
|
|
7656
7671
|
if (onCancel) onCancel();
|
|
7657
7672
|
};
|
|
7658
|
-
return /* @__PURE__ */ (0,
|
|
7673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
7659
7674
|
"div",
|
|
7660
7675
|
{
|
|
7661
7676
|
className: ["fd-stack", className].filter(Boolean).join(" "),
|
|
7662
7677
|
style: { gap: 14, padding: 18, border: "1px solid " + (dirty ? "var(--border-brand)" : "var(--border)"), borderRadius: "var(--r-lg)", background: dirty ? "var(--surface-brand)" : "var(--surface)", color: "var(--text)", transition: "background var(--dur-base) var(--ease),border-color var(--dur-base) var(--ease)" },
|
|
7663
7678
|
children: [
|
|
7664
|
-
/* @__PURE__ */ (0,
|
|
7665
|
-
/* @__PURE__ */ (0,
|
|
7666
|
-
/* @__PURE__ */ (0,
|
|
7667
|
-
dirty ? /* @__PURE__ */ (0,
|
|
7668
|
-
/* @__PURE__ */ (0,
|
|
7669
|
-
/* @__PURE__ */ (0,
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
7680
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fd-h4", style: { flex: 1, minWidth: 140 }, children: campus }),
|
|
7681
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CsiBadge, { band: nowBand, crp: Number(crp.toFixed(1)), size: "medium" }),
|
|
7682
|
+
dirty ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
7683
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("i", { className: "ph ph-arrow-right fd-muted", "aria-hidden": "true" }),
|
|
7684
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CsiBadge, { band: nextBand, crp: Number(nextCrp.toFixed(1)), size: "medium", preview: true })
|
|
7670
7685
|
] }) : null
|
|
7671
7686
|
] }),
|
|
7672
|
-
/* @__PURE__ */ (0,
|
|
7673
|
-
/* @__PURE__ */ (0,
|
|
7674
|
-
dirty ? /* @__PURE__ */ (0,
|
|
7675
|
-
/* @__PURE__ */ (0,
|
|
7687
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "fd-slider", children: [
|
|
7688
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fd-slider-fill", style: { width: pct + "%" } }),
|
|
7689
|
+
dirty ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fd-slider-chip", style: { left: pct + "%", background: delta < 0 ? "var(--danger-solid)" : "var(--ok-solid)" }, children: (delta < 0 ? "\u2212$" : "+$") + Math.abs(delta).toLocaleString() }) : null,
|
|
7690
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7676
7691
|
"input",
|
|
7677
7692
|
{
|
|
7678
7693
|
type: "range",
|
|
@@ -7688,13 +7703,13 @@ function BudgetReallocator({
|
|
|
7688
7703
|
}
|
|
7689
7704
|
)
|
|
7690
7705
|
] }),
|
|
7691
|
-
/* @__PURE__ */ (0,
|
|
7692
|
-
/* @__PURE__ */ (0,
|
|
7693
|
-
/* @__PURE__ */ (0,
|
|
7694
|
-
/* @__PURE__ */ (0,
|
|
7706
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
7707
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "fd-stack", style: { gap: 2, flex: 1, minWidth: 150 }, children: [
|
|
7708
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fd-num", style: { fontSize: 19, fontWeight: 700 }, children: "$" + draft.toLocaleString() }),
|
|
7709
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "fd-body-sm fd-muted", children: "Arrow keys step $100, shift+arrow $1,000. Escape reverts." })
|
|
7695
7710
|
] }),
|
|
7696
|
-
/* @__PURE__ */ (0,
|
|
7697
|
-
/* @__PURE__ */ (0,
|
|
7711
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { type: "button", className: "fd-btn fd-btn-ghost", disabled: !dirty, onClick: revert, children: "Cancel" }),
|
|
7712
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7698
7713
|
"button",
|
|
7699
7714
|
{
|
|
7700
7715
|
type: "button",
|
|
@@ -7713,7 +7728,7 @@ function BudgetReallocator({
|
|
|
7713
7728
|
}
|
|
7714
7729
|
|
|
7715
7730
|
// src/components/planner/SurroundSound.tsx
|
|
7716
|
-
var
|
|
7731
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7717
7732
|
var CATEGORIES = [
|
|
7718
7733
|
{ key: "ooh", label: "OOH", icon: "flag-banner", color: "var(--ch-ooh)" },
|
|
7719
7734
|
{ key: "transit", label: "Transit", icon: "bus", color: "var(--ch-transit)" },
|
|
@@ -7725,26 +7740,26 @@ var CATEGORIES = [
|
|
|
7725
7740
|
function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost, className = "" }) {
|
|
7726
7741
|
const earned = Math.max(0, Math.min(1, bonusPct / bonusMax));
|
|
7727
7742
|
const single = present.length <= 2;
|
|
7728
|
-
return /* @__PURE__ */ (0,
|
|
7729
|
-
/* @__PURE__ */ (0,
|
|
7743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 14 }, children: [
|
|
7744
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: CATEGORIES.map((c) => {
|
|
7730
7745
|
const on = present.includes(c.key);
|
|
7731
|
-
return /* @__PURE__ */ (0,
|
|
7746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
7732
7747
|
"span",
|
|
7733
7748
|
{
|
|
7734
7749
|
title: c.label + (on ? " \u2014 present" : " \u2014 not bought"),
|
|
7735
7750
|
style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 5, width: 62, padding: "10px 0", borderRadius: "var(--r-md)", border: "1px solid " + (on ? "var(--csi-2-edge)" : "var(--border)"), background: on ? "var(--csi-2-fill)" : "var(--surface-2)", color: on ? "var(--csi-2-text)" : "var(--text-disabled)" },
|
|
7736
7751
|
children: [
|
|
7737
|
-
/* @__PURE__ */ (0,
|
|
7738
|
-
/* @__PURE__ */ (0,
|
|
7752
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("i", { className: "ph ph-" + c.icon, style: { fontSize: 19, color: on ? c.color : "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
7753
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700 }, children: c.label })
|
|
7739
7754
|
]
|
|
7740
7755
|
},
|
|
7741
7756
|
c.key
|
|
7742
7757
|
);
|
|
7743
7758
|
}) }),
|
|
7744
|
-
/* @__PURE__ */ (0,
|
|
7745
|
-
/* @__PURE__ */ (0,
|
|
7746
|
-
/* @__PURE__ */ (0,
|
|
7747
|
-
/* @__PURE__ */ (0,
|
|
7759
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "fd-stack", style: { gap: 8 }, children: [
|
|
7760
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
7761
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "fd-label-lg", children: "Surround-sound bonus earned" }),
|
|
7762
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "fd-num", style: { color: single ? "var(--warn-text)" : "var(--csi-3-mark)", fontWeight: 700 }, children: [
|
|
7748
7763
|
"+",
|
|
7749
7764
|
bonusPct,
|
|
7750
7765
|
"% of +",
|
|
@@ -7752,8 +7767,8 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
7752
7767
|
"%"
|
|
7753
7768
|
] })
|
|
7754
7769
|
] }),
|
|
7755
|
-
/* @__PURE__ */ (0,
|
|
7756
|
-
/* @__PURE__ */ (0,
|
|
7770
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { style: { height: 8, borderRadius: "var(--r-xs)", background: "var(--surface-3)", overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { style: { height: "100%", width: earned * 100 + "%", background: "var(--csi-3-mark)", borderRadius: "inherit", transition: "width var(--dur-slow) var(--ease)" } }) }),
|
|
7771
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "fd-body-sm fd-secondary", style: { textWrap: "pretty" }, children: [
|
|
7757
7772
|
present.length,
|
|
7758
7773
|
" of 6 channel categories present.",
|
|
7759
7774
|
" ",
|
|
@@ -8182,7 +8197,7 @@ var React35 = __toESM(require("react"), 1);
|
|
|
8182
8197
|
|
|
8183
8198
|
// src/components/chat/ChatTurn.tsx
|
|
8184
8199
|
var React34 = __toESM(require("react"), 1);
|
|
8185
|
-
var
|
|
8200
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8186
8201
|
function JsonView({ value }) {
|
|
8187
8202
|
let text;
|
|
8188
8203
|
try {
|
|
@@ -8190,28 +8205,28 @@ function JsonView({ value }) {
|
|
|
8190
8205
|
} catch (e) {
|
|
8191
8206
|
text = String(value);
|
|
8192
8207
|
}
|
|
8193
|
-
return /* @__PURE__ */ (0,
|
|
8208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CodeBlock, { code: text, language: "json", collapseAfter: 18 });
|
|
8194
8209
|
}
|
|
8195
8210
|
function PacketCard({ packet, schema, render, onApply, applied }) {
|
|
8196
8211
|
if (!packet) return null;
|
|
8197
8212
|
const s = schema || {};
|
|
8198
8213
|
const invalid = packet.valid === false;
|
|
8199
8214
|
const title = s.heading || packet.type;
|
|
8200
|
-
return /* @__PURE__ */ (0,
|
|
8201
|
-
/* @__PURE__ */ (0,
|
|
8202
|
-
/* @__PURE__ */ (0,
|
|
8203
|
-
/* @__PURE__ */ (0,
|
|
8204
|
-
packet.repaired ? /* @__PURE__ */ (0,
|
|
8205
|
-
invalid ? /* @__PURE__ */ (0,
|
|
8215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("section", { className: "fdc-packet" + (invalid ? " is-invalid" : ""), "aria-label": title, children: [
|
|
8216
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("header", { className: "fdc-packet-head", children: [
|
|
8217
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-" + (s.icon || "package"), "aria-hidden": "true" }),
|
|
8218
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-packet-title", children: title }),
|
|
8219
|
+
packet.repaired ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-packet-badge", children: "Repaired" }) : null,
|
|
8220
|
+
invalid ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-packet-badge is-danger", children: "Invalid" }) : null
|
|
8206
8221
|
] }),
|
|
8207
|
-
invalid ? /* @__PURE__ */ (0,
|
|
8208
|
-
/* @__PURE__ */ (0,
|
|
8209
|
-
/* @__PURE__ */ (0,
|
|
8210
|
-
] }) : /* @__PURE__ */ (0,
|
|
8211
|
-
!invalid && onApply ? /* @__PURE__ */ (0,
|
|
8212
|
-
packet.repaired ? /* @__PURE__ */ (0,
|
|
8213
|
-
/* @__PURE__ */ (0,
|
|
8214
|
-
/* @__PURE__ */ (0,
|
|
8222
|
+
invalid ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-packet-alert", role: "alert", children: [
|
|
8223
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
8224
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: packet.error || "This result failed validation and can\u2019t be applied." })
|
|
8225
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "fdc-packet-body", children: render ? render(packet) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(JsonView, { value: packet.payload }) }),
|
|
8226
|
+
!invalid && onApply ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("footer", { className: "fdc-packet-foot", children: [
|
|
8227
|
+
packet.repaired ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-packet-note", children: "Corrected by the backend after a first attempt." }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {}),
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fd-btn fd-btn-primary fd-btn-sm", disabled: applied, onClick: () => onApply(packet), children: [
|
|
8229
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-" + (applied ? "check" : "arrow-square-in"), "aria-hidden": "true" }),
|
|
8215
8230
|
applied ? "Applied" : s.applyLabel || "Apply"
|
|
8216
8231
|
] })
|
|
8217
8232
|
] }) : null
|
|
@@ -8220,37 +8235,37 @@ function PacketCard({ packet, schema, render, onApply, applied }) {
|
|
|
8220
8235
|
function ThinkingBlock({ text, durationMs, streaming, defaultOpen = false }) {
|
|
8221
8236
|
const [open, setOpen] = React34.useState(defaultOpen);
|
|
8222
8237
|
if (!text) return null;
|
|
8223
|
-
return /* @__PURE__ */ (0,
|
|
8224
|
-
/* @__PURE__ */ (0,
|
|
8225
|
-
/* @__PURE__ */ (0,
|
|
8226
|
-
/* @__PURE__ */ (0,
|
|
8227
|
-
streaming ? /* @__PURE__ */ (0,
|
|
8228
|
-
/* @__PURE__ */ (0,
|
|
8229
|
-
/* @__PURE__ */ (0,
|
|
8230
|
-
/* @__PURE__ */ (0,
|
|
8238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-think" + (open ? " is-open" : ""), children: [
|
|
8239
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-think-head", onClick: () => setOpen((v) => !v), "aria-expanded": open, children: [
|
|
8240
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-brain", "aria-hidden": "true" }),
|
|
8241
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: streaming ? "Thinking" : durationMs ? "Thought for " + formatDuration(durationMs) : "Thought process" }),
|
|
8242
|
+
streaming ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "fdc-dots", "aria-hidden": "true", children: [
|
|
8243
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {}),
|
|
8244
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {}),
|
|
8245
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {})
|
|
8231
8246
|
] }) : null,
|
|
8232
|
-
/* @__PURE__ */ (0,
|
|
8247
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down"), "aria-hidden": "true" })
|
|
8233
8248
|
] }),
|
|
8234
|
-
open ? /* @__PURE__ */ (0,
|
|
8249
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "fdc-think-body", children: text }) : null
|
|
8235
8250
|
] });
|
|
8236
8251
|
}
|
|
8237
8252
|
function Citations({ items = [], onOpen }) {
|
|
8238
8253
|
const [open, setOpen] = React34.useState(false);
|
|
8239
8254
|
if (!items.length) return null;
|
|
8240
|
-
return /* @__PURE__ */ (0,
|
|
8241
|
-
/* @__PURE__ */ (0,
|
|
8242
|
-
/* @__PURE__ */ (0,
|
|
8243
|
-
/* @__PURE__ */ (0,
|
|
8255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-cites", children: [
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-cites-head", onClick: () => setOpen((v) => !v), "aria-expanded": open, children: [
|
|
8257
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-quotes", "aria-hidden": "true" }),
|
|
8258
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { children: [
|
|
8244
8259
|
items.length,
|
|
8245
8260
|
" source",
|
|
8246
8261
|
items.length === 1 ? "" : "s"
|
|
8247
8262
|
] }),
|
|
8248
|
-
/* @__PURE__ */ (0,
|
|
8263
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-caret-" + (open ? "up" : "down"), "aria-hidden": "true" })
|
|
8249
8264
|
] }),
|
|
8250
|
-
open ? /* @__PURE__ */ (0,
|
|
8251
|
-
/* @__PURE__ */ (0,
|
|
8252
|
-
c.url ? /* @__PURE__ */ (0,
|
|
8253
|
-
c.detail ? /* @__PURE__ */ (0,
|
|
8265
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("ol", { className: "fdc-cites-list", children: items.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { children: [
|
|
8266
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-cite-n fd-tabular", children: c.marker || i + 1 }),
|
|
8267
|
+
c.url ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("a", { href: c.url, target: "_blank", rel: "noopener noreferrer", onClick: onOpen ? (e) => onOpen(c, e) : void 0, children: c.title || c.url }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: c.title || "Source" }),
|
|
8268
|
+
c.detail ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-cite-detail", children: c.detail }) : null
|
|
8254
8269
|
] }, c.id || i)) }) : null
|
|
8255
8270
|
] });
|
|
8256
8271
|
}
|
|
@@ -8267,23 +8282,23 @@ function MessageBody({ message: m, ctx }) {
|
|
|
8267
8282
|
const clamped = !expanded && !m.streaming ? clampText(raw, ctx.maxVisibleChars) : null;
|
|
8268
8283
|
const body = clamped != null ? clamped : raw;
|
|
8269
8284
|
const showMd = ctx.markdown && !isUser;
|
|
8270
|
-
return /* @__PURE__ */ (0,
|
|
8271
|
-
m.thinking && ctx.showThinking ? /* @__PURE__ */ (0,
|
|
8272
|
-
m.steps && m.steps.length && ctx.showSteps ? /* @__PURE__ */ (0,
|
|
8273
|
-
body ? /* @__PURE__ */ (0,
|
|
8274
|
-
showMd ? /* @__PURE__ */ (0,
|
|
8275
|
-
m.streaming ? /* @__PURE__ */ (0,
|
|
8285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-body", children: [
|
|
8286
|
+
m.thinking && ctx.showThinking ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ThinkingBlock, { text: m.thinking, durationMs: m.thinkingMs, streaming: m.streaming && !m.text }) : null,
|
|
8287
|
+
m.steps && m.steps.length && ctx.showSteps ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(StepList, { steps: m.steps, defaultOpen: m.steps.some((s) => s.status === "running"), dense: true }) : null,
|
|
8288
|
+
body ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-text" + (isUser ? " is-user" : ""), children: [
|
|
8289
|
+
showMd ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Markdown, { source: body, headingOffset: 2, codeProps: { collapseAfter: 22 }, renderCitation: ctx.renderCitation }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "fdc-plain", children: body }),
|
|
8290
|
+
m.streaming ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-caret", "aria-hidden": "true" }) : null
|
|
8276
8291
|
] }) : null,
|
|
8277
|
-
clamped != null ? /* @__PURE__ */ (0,
|
|
8278
|
-
/* @__PURE__ */ (0,
|
|
8292
|
+
clamped != null ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-more", onClick: () => setExpanded(true), children: [
|
|
8293
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }),
|
|
8279
8294
|
"Show more",
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8281
|
-
] }) : expanded && ctx.maxVisibleChars && raw.length > ctx.maxVisibleChars ? /* @__PURE__ */ (0,
|
|
8282
|
-
/* @__PURE__ */ (0,
|
|
8295
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-more-len fd-tabular", children: raw.length < 2e3 ? raw.length.toLocaleString() + " characters" : Math.round(raw.length / 100) / 10 + "k characters" })
|
|
8296
|
+
] }) : expanded && ctx.maxVisibleChars && raw.length > ctx.maxVisibleChars ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-more", onClick: () => setExpanded(false), children: [
|
|
8297
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-caret-up", "aria-hidden": "true" }),
|
|
8283
8298
|
"Show less"
|
|
8284
8299
|
] }) : null,
|
|
8285
|
-
m.attachments && m.attachments.length ? /* @__PURE__ */ (0,
|
|
8286
|
-
m.packet ? /* @__PURE__ */ (0,
|
|
8300
|
+
m.attachments && m.attachments.length ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FileGrid, { files: m.attachments, onOpen: ctx.onOpenAttachment, tiles: true, maxHeight: ctx.attachmentHeight || 220, compact: ctx.narrow }) : null,
|
|
8301
|
+
m.packet ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8287
8302
|
PacketCard,
|
|
8288
8303
|
{
|
|
8289
8304
|
packet: m.packet,
|
|
@@ -8293,35 +8308,35 @@ function MessageBody({ message: m, ctx }) {
|
|
|
8293
8308
|
applied: ctx.appliedPackets && ctx.appliedPackets[m.id]
|
|
8294
8309
|
}
|
|
8295
8310
|
) : null,
|
|
8296
|
-
m.citations && m.citations.length ? /* @__PURE__ */ (0,
|
|
8297
|
-
m.working ? /* @__PURE__ */ (0,
|
|
8298
|
-
/* @__PURE__ */ (0,
|
|
8299
|
-
/* @__PURE__ */ (0,
|
|
8300
|
-
/* @__PURE__ */ (0,
|
|
8301
|
-
/* @__PURE__ */ (0,
|
|
8311
|
+
m.citations && m.citations.length ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Citations, { items: m.citations, onOpen: ctx.onOpenCitation }) : null,
|
|
8312
|
+
m.working ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-working", role: "status", children: [
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "fdc-dots", "aria-hidden": "true", children: [
|
|
8314
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {}),
|
|
8315
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {}),
|
|
8316
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", {})
|
|
8302
8317
|
] }),
|
|
8303
|
-
/* @__PURE__ */ (0,
|
|
8318
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "fdc-working-label", children: [
|
|
8304
8319
|
m.resumed ? "Resuming" : "Working",
|
|
8305
|
-
m.job && m.job.status ? /* @__PURE__ */ (0,
|
|
8320
|
+
m.job && m.job.status ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "fdc-working-job", children: [
|
|
8306
8321
|
" \xB7 ",
|
|
8307
8322
|
m.job.status
|
|
8308
8323
|
] }) : null,
|
|
8309
|
-
m.job && m.job.detail ? /* @__PURE__ */ (0,
|
|
8324
|
+
m.job && m.job.detail ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "fdc-working-job", children: [
|
|
8310
8325
|
" \xB7 ",
|
|
8311
8326
|
m.job.detail
|
|
8312
8327
|
] }) : null
|
|
8313
8328
|
] }),
|
|
8314
|
-
m.jobId ? /* @__PURE__ */ (0,
|
|
8329
|
+
m.jobId ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-working-id fd-mono", children: String(m.jobId).slice(0, 12) }) : null
|
|
8315
8330
|
] }) : null,
|
|
8316
|
-
m.stopped ? /* @__PURE__ */ (0,
|
|
8317
|
-
/* @__PURE__ */ (0,
|
|
8331
|
+
m.stopped ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-stopped", children: [
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-stop-circle", "aria-hidden": "true" }),
|
|
8318
8333
|
"Stopped"
|
|
8319
8334
|
] }) : null,
|
|
8320
|
-
m.error ? /* @__PURE__ */ (0,
|
|
8321
|
-
/* @__PURE__ */ (0,
|
|
8322
|
-
/* @__PURE__ */ (0,
|
|
8323
|
-
m.retryable && ctx.onRetry ? /* @__PURE__ */ (0,
|
|
8324
|
-
/* @__PURE__ */ (0,
|
|
8335
|
+
m.error ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-error", role: "alert", children: [
|
|
8336
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
8337
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-error-text", children: ctx.errorCopy ? ctx.errorCopy(m.error) : m.error }),
|
|
8338
|
+
m.retryable && ctx.onRetry ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-error-retry", onClick: ctx.onRetry, children: [
|
|
8339
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }),
|
|
8325
8340
|
"Retry"
|
|
8326
8341
|
] }) : null
|
|
8327
8342
|
] }) : null
|
|
@@ -8350,16 +8365,16 @@ function RunActions({ group, ctx }) {
|
|
|
8350
8365
|
const isAssistant = group.role === "assistant";
|
|
8351
8366
|
const fb = last.feedback;
|
|
8352
8367
|
if (!ctx.messageActions) return null;
|
|
8353
|
-
return /* @__PURE__ */ (0,
|
|
8354
|
-
/* @__PURE__ */ (0,
|
|
8355
|
-
/* @__PURE__ */ (0,
|
|
8356
|
-
/* @__PURE__ */ (0,
|
|
8368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-actions", role: "group", "aria-label": "Message actions", children: [
|
|
8369
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", className: "fdc-act" + (copied ? " is-done" : ""), onClick: () => copy(markdownToText(text)), "aria-label": "Copy message", children: [
|
|
8370
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
8371
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-act-label", children: copied ? "Copied" : "Copy" })
|
|
8357
8372
|
] }),
|
|
8358
|
-
isAssistant && ctx.onRetry ? /* @__PURE__ */ (0,
|
|
8359
|
-
group.role === "user" && ctx.onEdit ? /* @__PURE__ */ (0,
|
|
8360
|
-
isAssistant && ctx.onFeedback ? /* @__PURE__ */ (0,
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8362
|
-
/* @__PURE__ */ (0,
|
|
8373
|
+
isAssistant && ctx.onRetry ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { type: "button", className: "fdc-act", onClick: ctx.onRetry, "aria-label": "Retry this turn", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
8374
|
+
group.role === "user" && ctx.onEdit ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { type: "button", className: "fdc-act", onClick: () => ctx.onEdit(last), "aria-label": "Edit and resend", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-pencil-simple", "aria-hidden": "true" }) }) : null,
|
|
8375
|
+
isAssistant && ctx.onFeedback ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(React34.Fragment, { children: [
|
|
8376
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { type: "button", className: "fdc-act" + (fb === "up" ? " is-on" : ""), onClick: () => ctx.onFeedback(last.id, "up"), "aria-pressed": fb === "up", "aria-label": "Good response", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-thumbs-up", "aria-hidden": "true" }) }),
|
|
8377
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("button", { type: "button", className: "fdc-act" + (fb === "down" ? " is-on" : ""), onClick: () => ctx.onFeedback(last.id, "down"), "aria-pressed": fb === "down", "aria-label": "Bad response", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-thumbs-down", "aria-hidden": "true" }) })
|
|
8363
8378
|
] }) : null,
|
|
8364
8379
|
ctx.extraActions ? ctx.extraActions(group) : null
|
|
8365
8380
|
] });
|
|
@@ -8369,22 +8384,22 @@ function ChatTurn({ group, ctx }) {
|
|
|
8369
8384
|
const name = isUser ? ctx.userName : group.author || ctx.assistantName;
|
|
8370
8385
|
const avatar = isUser ? ctx.userAvatar : ctx.assistantAvatar;
|
|
8371
8386
|
const stamp = group.messages[0].timestamp;
|
|
8372
|
-
return /* @__PURE__ */ (0,
|
|
8373
|
-
/* @__PURE__ */ (0,
|
|
8374
|
-
ctx.showAvatars ? /* @__PURE__ */ (0,
|
|
8375
|
-
/* @__PURE__ */ (0,
|
|
8376
|
-
stamp ? /* @__PURE__ */ (0,
|
|
8377
|
-
group.messages.some((m) => m.model) ? /* @__PURE__ */ (0,
|
|
8387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("article", { className: "fdc-turn is-" + group.role, "aria-label": String(name) + (stamp ? " at " + formatClock(stamp) : ""), children: [
|
|
8388
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-turn-head", children: [
|
|
8389
|
+
ctx.showAvatars ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-avatar is-" + group.role, "aria-hidden": "true", children: avatar ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("img", { src: avatar, alt: "" }) : isUser ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-avatar-txt", children: (name || "You").slice(0, 1).toUpperCase() }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { className: "ph ph-" + (ctx.assistantIcon || "sparkle") }) }) : null,
|
|
8390
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-who", children: name }),
|
|
8391
|
+
stamp ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RelativeTime, { className: "fdc-when", value: stamp }) : null,
|
|
8392
|
+
group.messages.some((m) => m.model) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "fdc-turn-model", children: group.messages.find((m) => m.model).model }) : null
|
|
8378
8393
|
] }),
|
|
8379
|
-
/* @__PURE__ */ (0,
|
|
8380
|
-
group.messages.map((m) => /* @__PURE__ */ (0,
|
|
8381
|
-
/* @__PURE__ */ (0,
|
|
8394
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "fdc-turn-body", children: [
|
|
8395
|
+
group.messages.map((m) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "fdc-msg" + (m.pending ? " is-pending" : ""), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(MessageBody, { message: m, ctx }) }, m.id)),
|
|
8396
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RunActions, { group, ctx })
|
|
8382
8397
|
] })
|
|
8383
8398
|
] });
|
|
8384
8399
|
}
|
|
8385
8400
|
|
|
8386
8401
|
// src/components/chat/ChatTranscript.tsx
|
|
8387
|
-
var
|
|
8402
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8388
8403
|
var GROUP_WINDOW = 6e4;
|
|
8389
8404
|
var STICK_PX = 100;
|
|
8390
8405
|
function groupMessages(list) {
|
|
@@ -8417,25 +8432,25 @@ function dayLabel(key) {
|
|
|
8417
8432
|
}
|
|
8418
8433
|
function Suggestions({ items = [], onPick }) {
|
|
8419
8434
|
if (!items.length) return null;
|
|
8420
|
-
return /* @__PURE__ */ (0,
|
|
8435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fdc-suggest", children: items.map((s, i) => {
|
|
8421
8436
|
const it = typeof s === "string" ? { label: s, text: s } : s;
|
|
8422
|
-
return /* @__PURE__ */ (0,
|
|
8423
|
-
it.icon ? /* @__PURE__ */ (0,
|
|
8424
|
-
/* @__PURE__ */ (0,
|
|
8425
|
-
/* @__PURE__ */ (0,
|
|
8426
|
-
it.description ? /* @__PURE__ */ (0,
|
|
8437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("button", { type: "button", className: "fdc-suggest-item", onClick: () => onPick && onPick(it.text || it.label), children: [
|
|
8438
|
+
it.icon ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-" + it.icon, "aria-hidden": "true" }) : null,
|
|
8439
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "fdc-suggest-text", children: [
|
|
8440
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fdc-suggest-label", children: it.label }),
|
|
8441
|
+
it.description ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fdc-suggest-desc", children: it.description }) : null
|
|
8427
8442
|
] }),
|
|
8428
|
-
/* @__PURE__ */ (0,
|
|
8443
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-arrow-up-right fdc-suggest-go", "aria-hidden": "true" })
|
|
8429
8444
|
] }, it.id || i);
|
|
8430
8445
|
}) });
|
|
8431
8446
|
}
|
|
8432
8447
|
function LoadingTurns() {
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8434
|
-
/* @__PURE__ */ (0,
|
|
8435
|
-
/* @__PURE__ */ (0,
|
|
8436
|
-
/* @__PURE__ */ (0,
|
|
8437
|
-
/* @__PURE__ */ (0,
|
|
8438
|
-
/* @__PURE__ */ (0,
|
|
8448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fdc-skel", "aria-hidden": "true", children: [0, 1].map((i) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fdc-skel-turn", children: [
|
|
8449
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fd-skel fd-skel-circle", style: { width: 22, height: 22 } }),
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fdc-skel-lines", children: [
|
|
8451
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fd-skel", style: { width: i ? "62%" : "44%", height: 11 } }),
|
|
8452
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fd-skel", style: { width: i ? "94%" : "78%", height: 11 } }),
|
|
8453
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fd-skel", style: { width: i ? "71%" : "56%", height: 11 } })
|
|
8439
8454
|
] })
|
|
8440
8455
|
] }, i)) });
|
|
8441
8456
|
}
|
|
@@ -8494,36 +8509,36 @@ function ChatTranscript({
|
|
|
8494
8509
|
}, []);
|
|
8495
8510
|
const groups = React35.useMemo(() => groupMessages(messages), [messages]);
|
|
8496
8511
|
const empty = !messages.length && status === "ready";
|
|
8497
|
-
return /* @__PURE__ */ (0,
|
|
8498
|
-
/* @__PURE__ */ (0,
|
|
8499
|
-
status === "loading" || status === "resolving" ? /* @__PURE__ */ (0,
|
|
8500
|
-
status === "disconnected" ? /* @__PURE__ */ (0,
|
|
8501
|
-
/* @__PURE__ */ (0,
|
|
8502
|
-
/* @__PURE__ */ (0,
|
|
8503
|
-
/* @__PURE__ */ (0,
|
|
8504
|
-
ctx.onReconnect ? /* @__PURE__ */ (0,
|
|
8505
|
-
/* @__PURE__ */ (0,
|
|
8512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: ["fdc-scroll", className].filter(Boolean).join(" "), ref: scroller, onScroll, children: [
|
|
8513
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fdc-log", role: "log", "aria-label": "Conversation", children: [
|
|
8514
|
+
status === "loading" || status === "resolving" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(LoadingTurns, {}) : null,
|
|
8515
|
+
status === "disconnected" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fdc-dead", children: [
|
|
8516
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fdc-dead-icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-plugs", "aria-hidden": "true" }) }),
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "fdc-dead-title", children: ctx.deadTitle || "The assistant isn\u2019t reachable" }),
|
|
8518
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "fdc-dead-body", children: fatal === "chat_unavailable" ? "The service reported chat_unavailable. Nothing you type will be lost \u2014 reopen the panel once it\u2019s back." : "The thread couldn\u2019t be resolved" + (fatal ? " (" + fatal + ")" : "") + ". The composer stays disabled until it resolves." }),
|
|
8519
|
+
ctx.onReconnect ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("button", { type: "button", className: "fd-btn fd-btn-secondary fd-btn-sm", onClick: ctx.onReconnect, children: [
|
|
8520
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }),
|
|
8506
8521
|
"Try again"
|
|
8507
8522
|
] }) : null
|
|
8508
8523
|
] }) : null,
|
|
8509
|
-
empty ? renderEmpty ? renderEmpty() : /* @__PURE__ */ (0,
|
|
8510
|
-
/* @__PURE__ */ (0,
|
|
8511
|
-
/* @__PURE__ */ (0,
|
|
8512
|
-
emptyDescription ? /* @__PURE__ */ (0,
|
|
8513
|
-
/* @__PURE__ */ (0,
|
|
8524
|
+
empty ? renderEmpty ? renderEmpty() : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fdc-empty", children: [
|
|
8525
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "fdc-empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-" + emptyIcon, "aria-hidden": "true" }) }),
|
|
8526
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "fdc-empty-title", children: emptyTitle }),
|
|
8527
|
+
emptyDescription ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "fdc-empty-body", children: emptyDescription }) : null,
|
|
8528
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Suggestions, { items: suggestions, onPick })
|
|
8514
8529
|
] }) : null,
|
|
8515
8530
|
groups.map((g, i) => {
|
|
8516
8531
|
const prev = groups[i - 1];
|
|
8517
8532
|
const k = dayKey(g.messages[0].timestamp);
|
|
8518
8533
|
const showDay = !!k && (!prev || dayKey(prev.messages[0].timestamp) !== k);
|
|
8519
|
-
return /* @__PURE__ */ (0,
|
|
8520
|
-
showDay ? /* @__PURE__ */ (0,
|
|
8521
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(React35.Fragment, { children: [
|
|
8535
|
+
showDay ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "fdc-day", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: dayLabel(k) }) }) : null,
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ChatTurn, { group: g, ctx })
|
|
8522
8537
|
] }, g.key || i);
|
|
8523
8538
|
})
|
|
8524
8539
|
] }),
|
|
8525
|
-
pill ? /* @__PURE__ */ (0,
|
|
8526
|
-
/* @__PURE__ */ (0,
|
|
8540
|
+
pill ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("button", { type: "button", className: "fdc-pill", onClick: () => toBottom(true), children: [
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { className: "ph ph-arrow-down", "aria-hidden": "true" }),
|
|
8527
8542
|
pill,
|
|
8528
8543
|
" new message",
|
|
8529
8544
|
pill === 1 ? "" : "s"
|
|
@@ -8534,7 +8549,7 @@ var TranscriptKit = { groupMessages };
|
|
|
8534
8549
|
|
|
8535
8550
|
// src/components/chat/ChatComposer.tsx
|
|
8536
8551
|
var React36 = __toESM(require("react"), 1);
|
|
8537
|
-
var
|
|
8552
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8538
8553
|
function ChatComposer({
|
|
8539
8554
|
onSubmit,
|
|
8540
8555
|
onStop,
|
|
@@ -8637,7 +8652,7 @@ function ChatComposer({
|
|
|
8637
8652
|
description: it.description,
|
|
8638
8653
|
icon: it.icon,
|
|
8639
8654
|
meta: mention.meta,
|
|
8640
|
-
shortcut: slash.shortcut ? /* @__PURE__ */ (0,
|
|
8655
|
+
shortcut: slash.shortcut ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(KeyHint, { keys: slash.shortcut, size: "sm" }) : void 0,
|
|
8641
8656
|
onSelect: () => {
|
|
8642
8657
|
const insert = trigger.type === "slash" ? slash.immediate ? "/" + slash.id : "/" + slash.id + " " : "@" + (mention.value || mention.label) + " ";
|
|
8643
8658
|
editor.current && editor.current.replaceRange(trigger.from, trigger.to, insert);
|
|
@@ -8700,14 +8715,14 @@ function ChatComposer({
|
|
|
8700
8715
|
stopVoice.current = typeof res === "function" ? res : () => {
|
|
8701
8716
|
};
|
|
8702
8717
|
};
|
|
8703
|
-
return /* @__PURE__ */ (0,
|
|
8704
|
-
queue.length ? /* @__PURE__ */ (0,
|
|
8705
|
-
/* @__PURE__ */ (0,
|
|
8706
|
-
/* @__PURE__ */ (0,
|
|
8707
|
-
onRemoveQueued ? /* @__PURE__ */ (0,
|
|
8718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "fdc-composer" + (disabled ? " is-disabled" : "") + (narrow ? " is-narrow" : ""), children: [
|
|
8719
|
+
queue.length ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "fdc-queue", "aria-label": "Queued messages", children: queue.map((q) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "fdc-queue-row", children: [
|
|
8720
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-clock-countdown", "aria-hidden": "true" }),
|
|
8721
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "fdc-queue-text", children: q.text || (q.attachments ? q.attachments.length + " file(s)" : "") }),
|
|
8722
|
+
onRemoveQueued ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { type: "button", className: "fdc-queue-x", onClick: () => onRemoveQueued(q.id), "aria-label": "Remove queued message", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
8708
8723
|
] }, q.id)) }) : null,
|
|
8709
8724
|
sessionBar,
|
|
8710
|
-
/* @__PURE__ */ (0,
|
|
8725
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8711
8726
|
Dropzone,
|
|
8712
8727
|
{
|
|
8713
8728
|
className: "fdc-field",
|
|
@@ -8721,9 +8736,9 @@ function ChatComposer({
|
|
|
8721
8736
|
disabled: !fileUploadHandler || disabled,
|
|
8722
8737
|
label: "Drop to attach",
|
|
8723
8738
|
hint: acceptFiles ? acceptFiles.replace(/,/g, " \xB7 ") : void 0,
|
|
8724
|
-
children: /* @__PURE__ */ (0,
|
|
8725
|
-
staged.items.length ? /* @__PURE__ */ (0,
|
|
8726
|
-
/* @__PURE__ */ (0,
|
|
8739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { ref: wrap, className: "fdc-field-inner", children: [
|
|
8740
|
+
staged.items.length ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "fdc-staged", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FileStrip, { files: staged.items, size: narrow ? 60 : 68, onRemove: staged.remove, onRetry: staged.retry, onOpen: onOpenAttachment }) }) : null,
|
|
8741
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8727
8742
|
MarkdownEditor,
|
|
8728
8743
|
{
|
|
8729
8744
|
ref: editor,
|
|
@@ -8742,33 +8757,33 @@ function ChatComposer({
|
|
|
8742
8757
|
ariaLabel: "Message"
|
|
8743
8758
|
}
|
|
8744
8759
|
),
|
|
8745
|
-
/* @__PURE__ */ (0,
|
|
8746
|
-
fileUploadHandler ? /* @__PURE__ */ (0,
|
|
8747
|
-
voiceHandler ? /* @__PURE__ */ (0,
|
|
8760
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "fdc-tools", children: [
|
|
8761
|
+
fileUploadHandler ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FilePickButton, { onFiles: staged.add, onReject: (r) => flash(r[0].message), accept: acceptFiles, maxFileSize, label: "Attach files", icon: "plus" }) : null,
|
|
8762
|
+
voiceHandler ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { type: "button", className: "fd-attachbtn" + (listening ? " is-live" : ""), onClick: voice, "aria-pressed": listening, "aria-label": listening ? "Stop dictation" : "Dictate", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-" + (listening ? "waveform" : "microphone"), "aria-hidden": "true" }) }) : null,
|
|
8748
8763
|
toolbarExtras,
|
|
8749
|
-
/* @__PURE__ */ (0,
|
|
8750
|
-
maxLength && text.length > maxLength * 0.6 ? /* @__PURE__ */ (0,
|
|
8764
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "fdc-tools-gap" }),
|
|
8765
|
+
maxLength && text.length > maxLength * 0.6 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "fdc-count fd-tabular" + (text.length > maxLength * 0.95 ? " is-hot" : ""), children: [
|
|
8751
8766
|
text.length,
|
|
8752
8767
|
"/",
|
|
8753
8768
|
maxLength
|
|
8754
8769
|
] }) : null,
|
|
8755
|
-
busy ? /* @__PURE__ */ (0,
|
|
8756
|
-
/* @__PURE__ */ (0,
|
|
8757
|
-
/* @__PURE__ */ (0,
|
|
8758
|
-
] }) : /* @__PURE__ */ (0,
|
|
8759
|
-
/* @__PURE__ */ (0,
|
|
8760
|
-
/* @__PURE__ */ (0,
|
|
8770
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("button", { type: "button", className: "fdc-stop", onClick: onStop, "aria-label": "Stop generating", children: [
|
|
8771
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-stop-circle", "aria-hidden": "true" }),
|
|
8772
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: "Stop" })
|
|
8773
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("button", { type: "button", className: "fdc-send", onClick: submit, disabled: !canSend, "aria-label": "Send message", children: [
|
|
8774
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-paper-plane-right", "aria-hidden": "true" }),
|
|
8775
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "fdc-send-label", children: "Send" })
|
|
8761
8776
|
] })
|
|
8762
8777
|
] })
|
|
8763
8778
|
] })
|
|
8764
8779
|
}
|
|
8765
8780
|
),
|
|
8766
|
-
notice ? /* @__PURE__ */ (0,
|
|
8767
|
-
/* @__PURE__ */ (0,
|
|
8781
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "fdc-notice", role: "status", children: [
|
|
8782
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
8768
8783
|
notice
|
|
8769
8784
|
] }) : null,
|
|
8770
|
-
hint && !notice ? /* @__PURE__ */ (0,
|
|
8771
|
-
/* @__PURE__ */ (0,
|
|
8785
|
+
hint && !notice ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "fdc-hint", children: hint }) : null,
|
|
8786
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8772
8787
|
Popover,
|
|
8773
8788
|
{
|
|
8774
8789
|
open: menuOpen,
|
|
@@ -8782,12 +8797,12 @@ function ChatComposer({
|
|
|
8782
8797
|
returnFocus: false,
|
|
8783
8798
|
closeOnOutside: true,
|
|
8784
8799
|
label: trigger && trigger.type === "slash" ? "Commands" : "Mentions",
|
|
8785
|
-
children: /* @__PURE__ */ (0,
|
|
8800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8786
8801
|
Menu,
|
|
8787
8802
|
{
|
|
8788
8803
|
items: menuItems,
|
|
8789
8804
|
autoFocus: false,
|
|
8790
|
-
header: /* @__PURE__ */ (0,
|
|
8805
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "fd-pop-group", children: trigger && trigger.type === "slash" ? "Commands" : "Attach context" }),
|
|
8791
8806
|
onClose: () => setTrigger(null)
|
|
8792
8807
|
}
|
|
8793
8808
|
)
|
|
@@ -8798,7 +8813,7 @@ function ChatComposer({
|
|
|
8798
8813
|
|
|
8799
8814
|
// src/components/chat/ChatSessionBar.tsx
|
|
8800
8815
|
var React37 = __toESM(require("react"), 1);
|
|
8801
|
-
var
|
|
8816
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
8802
8817
|
var compact2 = meterFormats.compact;
|
|
8803
8818
|
function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extras }) {
|
|
8804
8819
|
const [open, setOpen] = React37.useState(false);
|
|
@@ -8817,9 +8832,9 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
8817
8832
|
if (stats && stats.runningTasks) bits.push(stats.runningTasks + " running task" + (stats.runningTasks === 1 ? "" : "s"));
|
|
8818
8833
|
if (cu) bits.push(pct + "% context");
|
|
8819
8834
|
const expandable = !!(cu || limits);
|
|
8820
|
-
return /* @__PURE__ */ (0,
|
|
8821
|
-
/* @__PURE__ */ (0,
|
|
8822
|
-
/* @__PURE__ */ (0,
|
|
8835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(React37.Fragment, { children: [
|
|
8836
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "fdc-bar", children: [
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
8823
8838
|
"button",
|
|
8824
8839
|
{
|
|
8825
8840
|
type: "button",
|
|
@@ -8830,16 +8845,16 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
8830
8845
|
"aria-expanded": expandable ? open : void 0,
|
|
8831
8846
|
"aria-label": expandable ? "Usage details" : void 0,
|
|
8832
8847
|
children: [
|
|
8833
|
-
cu ? /* @__PURE__ */ (0,
|
|
8834
|
-
/* @__PURE__ */ (0,
|
|
8835
|
-
expandable ? /* @__PURE__ */ (0,
|
|
8848
|
+
cu ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fdc-bar-mini", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SegmentedMeter, { total, segments: cu.segments, height: 4, showTotal: false }) }) : null,
|
|
8849
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fdc-bar-text", children: bits.join(" \xB7 ") }),
|
|
8850
|
+
expandable ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("i", { className: "ph ph-caret-right fdc-bar-caret", "aria-hidden": "true" }) : null
|
|
8836
8851
|
]
|
|
8837
8852
|
}
|
|
8838
8853
|
),
|
|
8839
8854
|
extras
|
|
8840
8855
|
] }),
|
|
8841
|
-
/* @__PURE__ */ (0,
|
|
8842
|
-
cu ? /* @__PURE__ */ (0,
|
|
8856
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Popover, { open, anchorRef: anchor, placement: "top-start", onClose: () => setOpen(false), minWidth: 330, maxHeight: 460, padded: true, label: "Usage", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "fdc-usage", children: [
|
|
8857
|
+
cu ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("section", { className: "fdc-usage-sec", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8843
8858
|
SegmentedMeter,
|
|
8844
8859
|
{
|
|
8845
8860
|
total,
|
|
@@ -8851,9 +8866,9 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
8851
8866
|
remainderLabel: "Free"
|
|
8852
8867
|
}
|
|
8853
8868
|
) }) : null,
|
|
8854
|
-
limits && limits.length ? /* @__PURE__ */ (0,
|
|
8855
|
-
/* @__PURE__ */ (0,
|
|
8856
|
-
/* @__PURE__ */ (0,
|
|
8869
|
+
limits && limits.length ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("section", { className: "fdc-usage-sec", children: [
|
|
8870
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h4", { className: "fdc-usage-h", children: "Usage limits" }),
|
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "fdc-usage-rows", children: limits.map((l) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8857
8872
|
QuotaRow,
|
|
8858
8873
|
{
|
|
8859
8874
|
label: l.label,
|
|
@@ -8863,32 +8878,32 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
8863
8878
|
l.id
|
|
8864
8879
|
)) })
|
|
8865
8880
|
] }) : null,
|
|
8866
|
-
stats ? /* @__PURE__ */ (0,
|
|
8867
|
-
stats.elapsedMs ? /* @__PURE__ */ (0,
|
|
8868
|
-
/* @__PURE__ */ (0,
|
|
8869
|
-
/* @__PURE__ */ (0,
|
|
8881
|
+
stats ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("section", { className: "fdc-usage-sec fdc-usage-stats", children: [
|
|
8882
|
+
stats.elapsedMs ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8883
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Session" }),
|
|
8884
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("b", { className: "fd-tabular", children: formatDuration(stats.elapsedMs) })
|
|
8870
8885
|
] }) : null,
|
|
8871
|
-
stats.tokens ? /* @__PURE__ */ (0,
|
|
8872
|
-
/* @__PURE__ */ (0,
|
|
8873
|
-
/* @__PURE__ */ (0,
|
|
8886
|
+
stats.tokens ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Tokens" }),
|
|
8888
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("b", { className: "fd-tabular", children: stats.tokens.toLocaleString() })
|
|
8874
8889
|
] }) : null,
|
|
8875
|
-
stats.costUsd != null ? /* @__PURE__ */ (0,
|
|
8876
|
-
/* @__PURE__ */ (0,
|
|
8877
|
-
/* @__PURE__ */ (0,
|
|
8890
|
+
stats.costUsd != null ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Cost" }),
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("b", { className: "fd-tabular", children: [
|
|
8878
8893
|
"$",
|
|
8879
8894
|
Number(stats.costUsd).toFixed(3)
|
|
8880
8895
|
] })
|
|
8881
8896
|
] }) : null,
|
|
8882
|
-
stats.turns ? /* @__PURE__ */ (0,
|
|
8883
|
-
/* @__PURE__ */ (0,
|
|
8884
|
-
/* @__PURE__ */ (0,
|
|
8897
|
+
stats.turns ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Turns" }),
|
|
8899
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("b", { className: "fd-tabular", children: stats.turns })
|
|
8885
8900
|
] }) : null
|
|
8886
8901
|
] }) : null,
|
|
8887
|
-
onClear ? /* @__PURE__ */ (0,
|
|
8902
|
+
onClear ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("footer", { className: "fdc-usage-foot", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("button", { type: "button", className: "fdc-usage-clear", onClick: () => {
|
|
8888
8903
|
setOpen(false);
|
|
8889
8904
|
onClear();
|
|
8890
8905
|
}, children: [
|
|
8891
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("i", { className: "ph ph-trash", "aria-hidden": "true" }),
|
|
8892
8907
|
"Clear conversation"
|
|
8893
8908
|
] }) }) : null
|
|
8894
8909
|
] }) })
|
|
@@ -8925,7 +8940,7 @@ function ModelControls({
|
|
|
8925
8940
|
disabled: m.disabled,
|
|
8926
8941
|
checked: m.id === (current2 && current2.id),
|
|
8927
8942
|
meta: m.meta,
|
|
8928
|
-
shortcut: m.shortcut ? /* @__PURE__ */ (0,
|
|
8943
|
+
shortcut: m.shortcut ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(KeyHint, { keys: m.shortcut, size: "sm" }) : void 0,
|
|
8929
8944
|
onSelect: () => onModelChange && onModelChange(m.id)
|
|
8930
8945
|
});
|
|
8931
8946
|
const items = [{ kind: "section", label: "Models" }].concat(flat.map(item));
|
|
@@ -8938,15 +8953,15 @@ function ModelControls({
|
|
|
8938
8953
|
items.push({ kind: "section", label: "Fast mode" });
|
|
8939
8954
|
items.push({
|
|
8940
8955
|
kind: "custom",
|
|
8941
|
-
render: () => /* @__PURE__ */ (0,
|
|
8942
|
-
/* @__PURE__ */ (0,
|
|
8943
|
-
/* @__PURE__ */ (0,
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
8956
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("label", { className: "fdc-switchrow", children: [
|
|
8957
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: fastModeLabel }),
|
|
8958
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("input", { type: "checkbox", className: "fd-sr", checked: !!fastMode, onChange: (e) => onFastModeChange(e.target.checked) }),
|
|
8959
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-switch-track" + (fastMode ? " is-on" : ""), "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-switch-thumb" }) })
|
|
8945
8960
|
] })
|
|
8946
8961
|
});
|
|
8947
8962
|
}
|
|
8948
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
-
/* @__PURE__ */ (0,
|
|
8963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(React37.Fragment, { children: [
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8950
8965
|
MenuButton,
|
|
8951
8966
|
{
|
|
8952
8967
|
items,
|
|
@@ -8957,7 +8972,7 @@ function ModelControls({
|
|
|
8957
8972
|
title: "Choose a model"
|
|
8958
8973
|
}
|
|
8959
8974
|
),
|
|
8960
|
-
effortLevels && effortLevels.length ? /* @__PURE__ */ (0,
|
|
8975
|
+
effortLevels && effortLevels.length ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8961
8976
|
MenuButton,
|
|
8962
8977
|
{
|
|
8963
8978
|
placement: "top-end",
|
|
@@ -8978,7 +8993,7 @@ function ModelControls({
|
|
|
8978
8993
|
}
|
|
8979
8994
|
|
|
8980
8995
|
// src/components/chat/AgentChatPanel.tsx
|
|
8981
|
-
var
|
|
8996
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8982
8997
|
var SURFACES = { sidebar: "is-sidebar", inline: "is-inline", page: "is-page", modal: "is-modal", sheet: "is-sheet" };
|
|
8983
8998
|
function AgentChatPanel({
|
|
8984
8999
|
/* required */
|
|
@@ -9132,7 +9147,7 @@ function AgentChatPanel({
|
|
|
9132
9147
|
onReconnect: engine.reload,
|
|
9133
9148
|
deadTitle: "The assistant isn\u2019t reachable"
|
|
9134
9149
|
};
|
|
9135
|
-
const sessionBar = /* @__PURE__ */ (0,
|
|
9150
|
+
const sessionBar = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9136
9151
|
ChatSessionBar,
|
|
9137
9152
|
{
|
|
9138
9153
|
sessionStats,
|
|
@@ -9141,7 +9156,7 @@ function AgentChatPanel({
|
|
|
9141
9156
|
onClear: engine.visible.length ? engine.clear : void 0
|
|
9142
9157
|
}
|
|
9143
9158
|
);
|
|
9144
|
-
const modelControls = /* @__PURE__ */ (0,
|
|
9159
|
+
const modelControls = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9145
9160
|
ModelControls,
|
|
9146
9161
|
{
|
|
9147
9162
|
models,
|
|
@@ -9156,7 +9171,7 @@ function AgentChatPanel({
|
|
|
9156
9171
|
narrow
|
|
9157
9172
|
}
|
|
9158
9173
|
);
|
|
9159
|
-
const threadMenu = threads && threads.length ? /* @__PURE__ */ (0,
|
|
9174
|
+
const threadMenu = threads && threads.length ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9160
9175
|
MenuButton,
|
|
9161
9176
|
{
|
|
9162
9177
|
variant: "ghost",
|
|
@@ -9183,7 +9198,7 @@ function AgentChatPanel({
|
|
|
9183
9198
|
})))
|
|
9184
9199
|
}
|
|
9185
9200
|
) : null;
|
|
9186
|
-
return /* @__PURE__ */ (0,
|
|
9201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
9187
9202
|
"aside",
|
|
9188
9203
|
{
|
|
9189
9204
|
className: ["fdc-panel", SURFACES[surface] || SURFACES.sidebar, narrow ? "is-narrow" : "", className].filter(Boolean).join(" "),
|
|
@@ -9194,7 +9209,7 @@ function AgentChatPanel({
|
|
|
9194
9209
|
},
|
|
9195
9210
|
"aria-label": title,
|
|
9196
9211
|
children: [
|
|
9197
|
-
surface === "sidebar" && resizable ? /* @__PURE__ */ (0,
|
|
9212
|
+
surface === "sidebar" && resizable ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9198
9213
|
"div",
|
|
9199
9214
|
{
|
|
9200
9215
|
className: "fdc-grip",
|
|
@@ -9209,20 +9224,20 @@ function AgentChatPanel({
|
|
|
9209
9224
|
}
|
|
9210
9225
|
}
|
|
9211
9226
|
) : null,
|
|
9212
|
-
showHeader ? /* @__PURE__ */ (0,
|
|
9213
|
-
/* @__PURE__ */ (0,
|
|
9214
|
-
/* @__PURE__ */ (0,
|
|
9215
|
-
/* @__PURE__ */ (0,
|
|
9216
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
9227
|
+
showHeader ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("header", { className: "fdc-head", children: [
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "fdc-head-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("i", { className: "ph ph-" + assistantIcon }) }),
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "fdc-head-titles", children: [
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "fdc-head-title", children: title }),
|
|
9231
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "fdc-head-sub", children: subtitle }) : null
|
|
9217
9232
|
] }),
|
|
9218
|
-
/* @__PURE__ */ (0,
|
|
9233
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "fdc-head-acts", children: [
|
|
9219
9234
|
headerActions,
|
|
9220
9235
|
threadMenu,
|
|
9221
|
-
onNewThread ? /* @__PURE__ */ (0,
|
|
9222
|
-
onClose ? /* @__PURE__ */ (0,
|
|
9236
|
+
onNewThread ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("button", { type: "button", className: "fdc-iconbtn", onClick: onNewThread, "aria-label": "New conversation", title: "New conversation", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("i", { className: "ph ph-plus", "aria-hidden": "true" }) }) : null,
|
|
9237
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("button", { type: "button", className: "fdc-iconbtn", onClick: onClose, "aria-label": "Close panel", title: "Close", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
9223
9238
|
] })
|
|
9224
9239
|
] }) : null,
|
|
9225
|
-
/* @__PURE__ */ (0,
|
|
9240
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9226
9241
|
ChatTranscript,
|
|
9227
9242
|
{
|
|
9228
9243
|
messages: engine.visible,
|
|
@@ -9237,7 +9252,7 @@ function AgentChatPanel({
|
|
|
9237
9252
|
renderEmpty
|
|
9238
9253
|
}
|
|
9239
9254
|
),
|
|
9240
|
-
/* @__PURE__ */ (0,
|
|
9255
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9241
9256
|
ChatComposer,
|
|
9242
9257
|
{
|
|
9243
9258
|
onSubmit: (text, atts) => engine.send(text, atts),
|
|
@@ -9664,6 +9679,8 @@ function createVersionStore(initialState, options) {
|
|
|
9664
9679
|
FileStrip,
|
|
9665
9680
|
FileTile,
|
|
9666
9681
|
Flag,
|
|
9682
|
+
FlytedeskBrand,
|
|
9683
|
+
FlytedeskMark,
|
|
9667
9684
|
FormatEta,
|
|
9668
9685
|
Gate,
|
|
9669
9686
|
IconButton,
|