@aginies/ui 0.1.0 → 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 +1555 -1271
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -6
- package/dist/index.d.ts +98 -6
- package/dist/index.js +1364 -1089
- package/dist/index.js.map +1 -1
- package/dist/styles.css +65 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2483,16 +2483,16 @@ var hash = (s) => {
|
|
|
2483
2483
|
};
|
|
2484
2484
|
var STATUS_LABEL = { online: "Online", busy: "Busy", away: "Away", offline: "Offline" };
|
|
2485
2485
|
function Avatar({ src, name = "", kind = "person", size = "md", icon, product, status, labels, className, style, ...rest }) {
|
|
2486
|
-
const
|
|
2486
|
+
const px2 = SIZES[size] || SIZES.md;
|
|
2487
2487
|
const l = { ...STATUS_LABEL, ...labels };
|
|
2488
2488
|
const isPerson = kind === "person";
|
|
2489
2489
|
const ground = "agn-avatar--g" + (hash(name) % 4 + 1);
|
|
2490
2490
|
let body;
|
|
2491
2491
|
if (src) body = /* @__PURE__ */ jsx41("img", { className: "agn-avatar__img", src, alt: "" });
|
|
2492
|
-
else if (product) body = /* @__PURE__ */ jsx41(ProductIcon, { product, size: Math.round(
|
|
2493
|
-
else if (icon || !name) body = /* @__PURE__ */ jsx41(Icon, { name: icon || (isPerson ? "user" : kind === "agent" ? "bot" : "server"), size: Math.round(
|
|
2492
|
+
else if (product) body = /* @__PURE__ */ jsx41(ProductIcon, { product, size: Math.round(px2 * 0.6) });
|
|
2493
|
+
else if (icon || !name) body = /* @__PURE__ */ jsx41(Icon, { name: icon || (isPerson ? "user" : kind === "agent" ? "bot" : "server"), size: Math.round(px2 * 0.55) });
|
|
2494
2494
|
else body = /* @__PURE__ */ jsx41("span", { className: "agn-avatar__initials", children: initialsOf(name) });
|
|
2495
|
-
return /* @__PURE__ */ jsxs37("span", { className: cx("agn-avatar", "agn-avatar--" + size, isPerson ? "agn-avatar--person" : "agn-avatar--square", kind === "agent" && "agn-avatar--agent", !src && !product && ground, className), style: { "--agn-avatar-size":
|
|
2495
|
+
return /* @__PURE__ */ jsxs37("span", { className: cx("agn-avatar", "agn-avatar--" + size, isPerson ? "agn-avatar--person" : "agn-avatar--square", kind === "agent" && "agn-avatar--agent", !src && !product && ground, className), style: { "--agn-avatar-size": px2 + "px", ...style }, role: "img", "aria-label": name ? name + (status ? ", " + l[status] : "") : void 0, "aria-hidden": name ? void 0 : true, title: name || void 0, ...rest, children: [
|
|
2496
2496
|
body,
|
|
2497
2497
|
status && /* @__PURE__ */ jsx41("span", { className: cx("agn-avatar__status", "agn-avatar__status--" + status), "aria-hidden": "true" })
|
|
2498
2498
|
] });
|
|
@@ -2528,11 +2528,11 @@ function Tag({ tone = "neutral", dot, icon, as: Comp = "span", children, classNa
|
|
|
2528
2528
|
import React44 from "react";
|
|
2529
2529
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2530
2530
|
function BlockIcon({ icon = "box", product, tone = "signal", color, size = "md", title, children, className, style, ...rest }) {
|
|
2531
|
-
const
|
|
2532
|
-
const glyph = Math.round(
|
|
2531
|
+
const px2 = size === "sm" ? 20 : size === "lg" ? 32 : size === "xl" ? 40 : 24;
|
|
2532
|
+
const glyph = Math.round(px2 * 0.58);
|
|
2533
2533
|
return (
|
|
2534
2534
|
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label is set only together with role=img (both keyed on title); the rule cannot see the conditional role
|
|
2535
|
-
/* @__PURE__ */ jsx43("span", { className: cx("agn-block-icon", "agn-block-icon--" + tone, size !== "md" && "agn-block-icon--" + size, color && "agn-block-icon--brand", className), style: { "--agn-block-size":
|
|
2535
|
+
/* @__PURE__ */ jsx43("span", { className: cx("agn-block-icon", "agn-block-icon--" + tone, size !== "md" && "agn-block-icon--" + size, color && "agn-block-icon--brand", className), style: { "--agn-block-size": px2 + "px", ...color ? { "--agn-brand": color } : null, ...style }, role: title ? "img" : void 0, "aria-label": title, "aria-hidden": title ? void 0 : true, ...rest, children: children || (product ? /* @__PURE__ */ jsx43(ProductIcon, { product, size: glyph }) : /* @__PURE__ */ jsx43(Icon, { name: icon, size: glyph, strokeWidth: px2 <= 24 ? 2 : 1.75 })) })
|
|
2536
2536
|
);
|
|
2537
2537
|
}
|
|
2538
2538
|
|
|
@@ -3720,73 +3720,346 @@ function ToolbarSeparator({ className, ...rest }) {
|
|
|
3720
3720
|
}
|
|
3721
3721
|
|
|
3722
3722
|
// src/layout/PageLayout.jsx
|
|
3723
|
+
import React64 from "react";
|
|
3724
|
+
|
|
3725
|
+
// src/feedback/SidePanel.jsx
|
|
3726
|
+
import React63 from "react";
|
|
3727
|
+
|
|
3728
|
+
// src/layout/responsive.js
|
|
3723
3729
|
import React62 from "react";
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3730
|
+
var BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280, "2xl": 1536 };
|
|
3731
|
+
var BREAKPOINT_ORDER = ["base", "sm", "md", "lg", "xl", "2xl"];
|
|
3732
|
+
function breakpointFor(width) {
|
|
3733
|
+
let name = "base";
|
|
3734
|
+
for (const k of BREAKPOINT_ORDER.slice(1)) if (width >= BREAKPOINTS[k]) name = k;
|
|
3735
|
+
return name;
|
|
3736
|
+
}
|
|
3737
|
+
function toPx(bp) {
|
|
3738
|
+
return typeof bp === "number" ? bp : BREAKPOINTS[bp] != null ? BREAKPOINTS[bp] : 0;
|
|
3739
|
+
}
|
|
3740
|
+
function atLeast(a, b) {
|
|
3741
|
+
return BREAKPOINT_ORDER.indexOf(a) >= BREAKPOINT_ORDER.indexOf(b);
|
|
3742
|
+
}
|
|
3743
|
+
var useIsoLayoutEffect = typeof window !== "undefined" ? React62.useLayoutEffect : React62.useEffect;
|
|
3744
|
+
function useElementWidth(ref) {
|
|
3745
|
+
const [w, setW] = React62.useState(null);
|
|
3746
|
+
useIsoLayoutEffect(() => {
|
|
3747
|
+
const el = ref.current;
|
|
3748
|
+
if (!el) return void 0;
|
|
3749
|
+
const read2 = () => {
|
|
3750
|
+
const n = el.offsetWidth;
|
|
3751
|
+
setW((p) => p === n ? p : n);
|
|
3752
|
+
};
|
|
3753
|
+
read2();
|
|
3754
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
3755
|
+
const ro = new ResizeObserver(read2);
|
|
3756
|
+
ro.observe(el);
|
|
3757
|
+
return () => ro.disconnect();
|
|
3758
|
+
}, [ref]);
|
|
3759
|
+
return w;
|
|
3760
|
+
}
|
|
3761
|
+
function useBreakpoint(ref) {
|
|
3762
|
+
const w = useElementWidth(ref);
|
|
3763
|
+
return w == null ? null : breakpointFor(w);
|
|
3764
|
+
}
|
|
3765
|
+
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]';
|
|
3766
|
+
function useOverlayFocus(ref, open, onClose) {
|
|
3767
|
+
const closeRef = React62.useRef(onClose);
|
|
3768
|
+
closeRef.current = onClose;
|
|
3769
|
+
React62.useEffect(() => {
|
|
3770
|
+
if (!open) return void 0;
|
|
3771
|
+
const el = ref.current;
|
|
3772
|
+
if (!el) return void 0;
|
|
3773
|
+
const prev = typeof document !== "undefined" ? document.activeElement : null;
|
|
3774
|
+
if (!el.contains(document.activeElement)) el.focus({ preventScroll: true });
|
|
3775
|
+
const onKey = (e) => {
|
|
3776
|
+
if (e.key === "Escape") {
|
|
3777
|
+
if (closeRef.current) {
|
|
3778
|
+
e.stopPropagation();
|
|
3779
|
+
closeRef.current();
|
|
3780
|
+
}
|
|
3781
|
+
return;
|
|
3782
|
+
}
|
|
3783
|
+
if (e.key !== "Tab" || !el.contains(document.activeElement)) return;
|
|
3784
|
+
const f = Array.from(el.querySelectorAll(FOCUSABLE)).filter((n) => n.offsetParent !== null || n === document.activeElement);
|
|
3785
|
+
if (!f.length) {
|
|
3786
|
+
e.preventDefault();
|
|
3787
|
+
el.focus({ preventScroll: true });
|
|
3788
|
+
return;
|
|
3789
|
+
}
|
|
3790
|
+
const first = f[0], last = f[f.length - 1];
|
|
3791
|
+
if (e.shiftKey && (document.activeElement === first || document.activeElement === el)) {
|
|
3792
|
+
e.preventDefault();
|
|
3793
|
+
last.focus();
|
|
3794
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
3795
|
+
e.preventDefault();
|
|
3796
|
+
first.focus();
|
|
3797
|
+
}
|
|
3798
|
+
};
|
|
3799
|
+
el.addEventListener("keydown", onKey);
|
|
3800
|
+
return () => {
|
|
3801
|
+
el.removeEventListener("keydown", onKey);
|
|
3802
|
+
const a = document.activeElement;
|
|
3803
|
+
if (prev && prev.focus && document.contains(prev) && (!a || a === document.body || el.contains(a))) prev.focus({ preventScroll: true });
|
|
3804
|
+
};
|
|
3805
|
+
}, [open, ref]);
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3808
|
+
// src/feedback/SidePanel.jsx
|
|
3809
|
+
import { Fragment as Fragment8, jsx as jsx61, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
3810
|
+
function SidePanel({ open = true, onClose, title, eyebrow, subtitle, tabs, actions, footer, size = "md", width, mode = "overlay", scrim = true, children, labels, className, style, ...rest }) {
|
|
3811
|
+
const L = { close: "Close", ...labels };
|
|
3812
|
+
const id = React63.useMemo(() => uid("panel-title"), []);
|
|
3813
|
+
const ref = React63.useRef(null);
|
|
3814
|
+
const overlay = mode === "overlay";
|
|
3815
|
+
useOverlayFocus(ref, open && overlay, onClose);
|
|
3816
|
+
if (!open) return null;
|
|
3817
|
+
const panel = /* @__PURE__ */ jsxs56("aside", { ref, className: cx("agn-panel", "agn-panel--" + size, "agn-panel--" + mode, className), "aria-labelledby": title ? id : void 0, role: overlay ? "dialog" : void 0, "aria-modal": overlay || void 0, tabIndex: overlay ? -1 : void 0, style: width != null ? { width: typeof width === "number" ? width + "px" : width, ...style } : style, ...rest, children: [
|
|
3818
|
+
/* @__PURE__ */ jsxs56("header", { className: "agn-panel__head", children: [
|
|
3819
|
+
/* @__PURE__ */ jsxs56("div", { className: "agn-panel__heading", children: [
|
|
3820
|
+
eyebrow && /* @__PURE__ */ jsx61("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: eyebrow }),
|
|
3821
|
+
title && /* @__PURE__ */ jsx61("h2", { id, className: "agn-panel__title", children: title }),
|
|
3822
|
+
subtitle && /* @__PURE__ */ jsx61("div", { className: "agn-panel__subtitle", children: subtitle })
|
|
3823
|
+
] }),
|
|
3824
|
+
/* @__PURE__ */ jsxs56("div", { className: "agn-panel__actions", children: [
|
|
3825
|
+
actions,
|
|
3826
|
+
onClose && /* @__PURE__ */ jsx61(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose })
|
|
3827
|
+
] })
|
|
3828
|
+
] }),
|
|
3829
|
+
tabs && /* @__PURE__ */ jsx61("div", { className: "agn-panel__tabs", children: tabs }),
|
|
3830
|
+
/* @__PURE__ */ jsx61("div", { className: "agn-panel__body", children }),
|
|
3831
|
+
footer && /* @__PURE__ */ jsx61("footer", { className: "agn-panel__foot", children: footer })
|
|
3733
3832
|
] });
|
|
3833
|
+
if (!overlay || !scrim) return panel;
|
|
3834
|
+
return /* @__PURE__ */ jsxs56(Fragment8, { children: [
|
|
3835
|
+
/* @__PURE__ */ jsx61("div", { className: "agn-panel-scrim", "aria-hidden": "true", onClick: onClose }),
|
|
3836
|
+
panel
|
|
3837
|
+
] });
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
// src/layout/PageLayout.jsx
|
|
3841
|
+
import { jsx as jsx62, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
3842
|
+
var PageLayoutContext = React64.createContext(null);
|
|
3843
|
+
function usePageLayout() {
|
|
3844
|
+
return React64.useContext(PageLayoutContext);
|
|
3845
|
+
}
|
|
3846
|
+
var WIDTHS = { reading: "var(--content-reading)", default: "var(--content-max)", wide: "var(--content-wide)", full: "none" };
|
|
3847
|
+
var DEFAULT_LABELS32 = { openNav: "Open navigation", closeNav: "Close navigation", openPanel: "Show details", closePanel: "Hide details", navigation: "Navigation", details: "Details" };
|
|
3848
|
+
var useIso = typeof window !== "undefined" ? React64.useLayoutEffect : React64.useEffect;
|
|
3849
|
+
function useControllable(value, onChange, initial) {
|
|
3850
|
+
const [own, setOwn] = React64.useState(initial);
|
|
3851
|
+
const controlled = value !== void 0;
|
|
3852
|
+
const v = controlled ? value : own;
|
|
3853
|
+
const set = React64.useCallback((n) => {
|
|
3854
|
+
if (!controlled) setOwn(n);
|
|
3855
|
+
if (onChange) onChange(n);
|
|
3856
|
+
}, [controlled, onChange]);
|
|
3857
|
+
return [v, set];
|
|
3858
|
+
}
|
|
3859
|
+
function PageLayout({ header, navigation, sidePanel, sidePanelWidth, width = "default", maxWidth, flush, sidebarMode = "auto", panelMode = "auto", sidebarOpen: sidebarOpenProp, onSidebarOpenChange, panelOpen: panelOpenProp, onPanelOpenChange, bar, labels, as: Comp = "div", children, className, style, ...rest }) {
|
|
3860
|
+
const L = { ...DEFAULT_LABELS32, ...labels };
|
|
3861
|
+
const ref = React64.useRef(null);
|
|
3862
|
+
const navRef = React64.useRef(null);
|
|
3863
|
+
const panelRef = React64.useRef(null);
|
|
3864
|
+
const [bp, setBp] = React64.useState(null);
|
|
3865
|
+
useIso(() => {
|
|
3866
|
+
const el = ref.current;
|
|
3867
|
+
if (!el) return void 0;
|
|
3868
|
+
const read2 = () => {
|
|
3869
|
+
const b2 = breakpointFor(el.offsetWidth);
|
|
3870
|
+
setBp((p) => p === b2 ? p : b2);
|
|
3871
|
+
};
|
|
3872
|
+
read2();
|
|
3873
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
3874
|
+
const ro = new ResizeObserver(read2);
|
|
3875
|
+
ro.observe(el);
|
|
3876
|
+
return () => ro.disconnect();
|
|
3877
|
+
}, []);
|
|
3878
|
+
const b = bp || "xl";
|
|
3879
|
+
const sidebar = !navigation ? null : sidebarMode !== "auto" ? sidebarMode : atLeast(b, "xl") ? "docked" : atLeast(b, "lg") ? "rail" : "overlay";
|
|
3880
|
+
const panel = !sidePanel ? null : panelMode !== "auto" ? panelMode : atLeast(b, "lg") ? "docked" : "overlay";
|
|
3881
|
+
const narrow = !atLeast(b, "md");
|
|
3882
|
+
const [railExpanded, setRailExpanded] = React64.useState(false);
|
|
3883
|
+
React64.useEffect(() => {
|
|
3884
|
+
if (sidebar !== "rail") setRailExpanded(false);
|
|
3885
|
+
}, [sidebar]);
|
|
3886
|
+
const [sidebarOpen, setSidebarOpen] = useControllable(sidebarOpenProp, onSidebarOpenChange, false);
|
|
3887
|
+
const [panelOpen, setPanelOpen] = useControllable(panelOpenProp, onPanelOpenChange, false);
|
|
3888
|
+
const hadPanel = React64.useRef(!!sidePanel);
|
|
3889
|
+
React64.useEffect(() => {
|
|
3890
|
+
if (sidePanel && !hadPanel.current && panel === "overlay") setPanelOpen(true);
|
|
3891
|
+
hadPanel.current = !!sidePanel;
|
|
3892
|
+
}, [sidePanel, panel, setPanelOpen]);
|
|
3893
|
+
const drawerOpen = sidebar === "overlay" && !!sidebarOpen;
|
|
3894
|
+
const sheetOpen = panel === "overlay" && !!panelOpen;
|
|
3895
|
+
const closeSidebar = React64.useCallback(() => setSidebarOpen(false), [setSidebarOpen]);
|
|
3896
|
+
const closePanel = React64.useCallback(() => setPanelOpen(false), [setPanelOpen]);
|
|
3897
|
+
useOverlayFocus(navRef, drawerOpen, closeSidebar);
|
|
3898
|
+
useOverlayFocus(panelRef, sheetOpen, closePanel);
|
|
3899
|
+
const ctx = React64.useMemo(() => ({
|
|
3900
|
+
bp: b,
|
|
3901
|
+
sidebar,
|
|
3902
|
+
panel,
|
|
3903
|
+
railExpanded,
|
|
3904
|
+
setRailExpanded,
|
|
3905
|
+
sidebarOpen: drawerOpen,
|
|
3906
|
+
openSidebar: () => setSidebarOpen(true),
|
|
3907
|
+
closeSidebar,
|
|
3908
|
+
panelOpen: sheetOpen,
|
|
3909
|
+
openPanel: () => setPanelOpen(true),
|
|
3910
|
+
closePanel
|
|
3911
|
+
}), [b, sidebar, panel, railExpanded, drawerOpen, sheetOpen, setSidebarOpen, setPanelOpen, closeSidebar, closePanel]);
|
|
3912
|
+
const panelNode = React64.isValidElement(sidePanel) && sidePanel.type === SidePanel && sidePanel.props.mode == null ? React64.cloneElement(sidePanel, { mode: "docked" }) : sidePanel;
|
|
3913
|
+
const showBar = bar !== false && (sidebar === "overlay" || panel === "overlay");
|
|
3914
|
+
const max = maxWidth != null ? typeof maxWidth === "number" ? maxWidth + "px" : maxWidth : WIDTHS[width] || WIDTHS.default;
|
|
3915
|
+
return /* @__PURE__ */ jsx62(PageLayoutContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs57(
|
|
3916
|
+
Comp,
|
|
3917
|
+
{
|
|
3918
|
+
ref,
|
|
3919
|
+
className: cx("agn-page", header && "agn-page--with-header", navigation && "agn-page--with-nav", sidePanel && "agn-page--with-panel", flush && "agn-page--flush", narrow && "agn-page--narrow", className),
|
|
3920
|
+
"data-bp": bp || void 0,
|
|
3921
|
+
"data-sidebar": sidebar || void 0,
|
|
3922
|
+
"data-panel": panel || void 0,
|
|
3923
|
+
style: { "--agn-page-max": max, "--agn-page-panel-w": typeof sidePanelWidth === "number" ? sidePanelWidth + "px" : sidePanelWidth, ...style },
|
|
3924
|
+
...rest,
|
|
3925
|
+
children: [
|
|
3926
|
+
header && /* @__PURE__ */ jsx62("div", { className: "agn-page__header", children: header }),
|
|
3927
|
+
showBar && /* @__PURE__ */ jsxs57("div", { className: "agn-page__bar", children: [
|
|
3928
|
+
sidebar === "overlay" && /* @__PURE__ */ jsx62(ButtonIcon, { icon: "menu", size: "sm", label: L.openNav, "aria-expanded": drawerOpen, onClick: () => setSidebarOpen(!sidebarOpen) }),
|
|
3929
|
+
/* @__PURE__ */ jsx62("span", { className: "agn-page__bar-main", children: bar != null && bar !== true ? bar : /* @__PURE__ */ jsx62(AginiesMark, { size: 20 }) }),
|
|
3930
|
+
panel === "overlay" && /* @__PURE__ */ jsx62(ButtonIcon, { icon: sheetOpen ? "panel-right-close" : "panel-right-open", size: "sm", label: sheetOpen ? L.closePanel : L.openPanel, "aria-expanded": sheetOpen, onClick: () => setPanelOpen(!panelOpen) })
|
|
3931
|
+
] }),
|
|
3932
|
+
/* @__PURE__ */ jsxs57("div", { className: "agn-page__body", children: [
|
|
3933
|
+
navigation && /* @__PURE__ */ jsx62(
|
|
3934
|
+
"div",
|
|
3935
|
+
{
|
|
3936
|
+
ref: navRef,
|
|
3937
|
+
className: cx("agn-page__nav", sidebar === "overlay" && "agn-page__nav--drawer", drawerOpen && "agn-page__nav--open"),
|
|
3938
|
+
tabIndex: sidebar === "overlay" ? -1 : void 0,
|
|
3939
|
+
role: drawerOpen ? "dialog" : void 0,
|
|
3940
|
+
"aria-modal": drawerOpen || void 0,
|
|
3941
|
+
"aria-label": drawerOpen ? L.navigation : void 0,
|
|
3942
|
+
children: navigation
|
|
3943
|
+
}
|
|
3944
|
+
),
|
|
3945
|
+
/* @__PURE__ */ jsx62("main", { className: "agn-page__main", children: /* @__PURE__ */ jsx62("div", { className: "agn-page__content", children }) }),
|
|
3946
|
+
sidePanel && /* @__PURE__ */ jsx62(
|
|
3947
|
+
"aside",
|
|
3948
|
+
{
|
|
3949
|
+
ref: panelRef,
|
|
3950
|
+
className: cx("agn-page__panel", panel === "overlay" && "agn-page__panel--sheet", sheetOpen && "agn-page__panel--open"),
|
|
3951
|
+
tabIndex: panel === "overlay" ? -1 : void 0,
|
|
3952
|
+
role: sheetOpen ? "dialog" : void 0,
|
|
3953
|
+
"aria-modal": sheetOpen || void 0,
|
|
3954
|
+
"aria-label": sheetOpen ? L.details : void 0,
|
|
3955
|
+
children: panelNode
|
|
3956
|
+
}
|
|
3957
|
+
),
|
|
3958
|
+
(drawerOpen || sheetOpen) && /* @__PURE__ */ jsx62("div", { className: "agn-page__scrim", "aria-hidden": "true", onClick: () => {
|
|
3959
|
+
closeSidebar();
|
|
3960
|
+
closePanel();
|
|
3961
|
+
} })
|
|
3962
|
+
] })
|
|
3963
|
+
]
|
|
3964
|
+
}
|
|
3965
|
+
) });
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3968
|
+
// src/layout/Grid.jsx
|
|
3969
|
+
import React65 from "react";
|
|
3970
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3971
|
+
var GAPS = { none: "0px", sm: "var(--space-3)", md: "var(--space-4)", lg: "var(--grid-gap)" };
|
|
3972
|
+
var px = (v) => typeof v === "number" ? v + "px" : v;
|
|
3973
|
+
function Grid({ min, columns, gap = "lg", rowGap, align, dense, as: Comp = "div", children, className, style, ...rest }) {
|
|
3974
|
+
const s = { ...style };
|
|
3975
|
+
if (min != null) s["--agn-grid-min"] = px(min);
|
|
3976
|
+
if (columns != null) s["--agn-grid-cols"] = columns;
|
|
3977
|
+
if (gap != null) s["--agn-grid-gap"] = GAPS[gap] || px(gap);
|
|
3978
|
+
if (rowGap != null) s["--agn-grid-row-gap"] = GAPS[rowGap] || px(rowGap);
|
|
3979
|
+
return /* @__PURE__ */ jsx63(Comp, { className: cx("agn-grid", min != null && "agn-grid--auto", dense && "agn-grid--dense", align && "agn-grid--align-" + align, className), style: s, ...rest, children });
|
|
3980
|
+
}
|
|
3981
|
+
function resolve(span) {
|
|
3982
|
+
const out = {};
|
|
3983
|
+
let cur = 12;
|
|
3984
|
+
for (const k of BREAKPOINT_ORDER) {
|
|
3985
|
+
const v = span && typeof span === "object" ? span[k] : k === "base" ? span : void 0;
|
|
3986
|
+
if (v != null) cur = v === "full" ? "var(--agn-grid-cols, var(--grid-columns))" : v;
|
|
3987
|
+
out[k] = cur;
|
|
3988
|
+
}
|
|
3989
|
+
return out;
|
|
3990
|
+
}
|
|
3991
|
+
function GridItem({ span = 12, start, rowSpan, as: Comp = "div", children, className, style, ...rest }) {
|
|
3992
|
+
const r = resolve(span);
|
|
3993
|
+
const s = { ...style };
|
|
3994
|
+
for (const k of BREAKPOINT_ORDER) s["--agn-span-" + k] = r[k];
|
|
3995
|
+
if (start != null) s.gridColumnStart = start;
|
|
3996
|
+
if (rowSpan != null) s.gridRow = "span " + rowSpan;
|
|
3997
|
+
return /* @__PURE__ */ jsx63(Comp, { className: cx("agn-grid__item", className), style: s, ...rest, children });
|
|
3734
3998
|
}
|
|
3735
3999
|
|
|
3736
4000
|
// src/layout/Room.jsx
|
|
3737
|
-
import
|
|
3738
|
-
import { jsx as
|
|
3739
|
-
var
|
|
4001
|
+
import React66, { useState as useState9, useLayoutEffect, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
4002
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4003
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? useLayoutEffect : useEffect3;
|
|
3740
4004
|
function Room({ theme, padding = "lg", as: Comp = "section", children, className, ...rest }) {
|
|
3741
4005
|
const ref = useRef3(null);
|
|
3742
4006
|
const [auto, setAuto] = useState9("dark");
|
|
3743
|
-
|
|
4007
|
+
useIsoLayoutEffect2(() => {
|
|
3744
4008
|
if (theme || !ref.current) return;
|
|
3745
4009
|
const anc = ref.current.parentElement && ref.current.parentElement.closest("[data-theme]");
|
|
3746
4010
|
const t = anc ? anc.getAttribute("data-theme") : "light";
|
|
3747
4011
|
setAuto(t === "dark" ? "light" : "dark");
|
|
3748
4012
|
}, [theme]);
|
|
3749
|
-
return /* @__PURE__ */
|
|
4013
|
+
return /* @__PURE__ */ jsx64(Comp, { ref, "data-theme": theme || auto, className: cx("agn-room", "agn-root", "agn-room--pad-" + padding, className), ...rest, children });
|
|
3750
4014
|
}
|
|
3751
4015
|
|
|
3752
4016
|
// src/navigation/GlobalHeader.jsx
|
|
3753
|
-
import
|
|
3754
|
-
import { jsx as
|
|
3755
|
-
var
|
|
4017
|
+
import React67 from "react";
|
|
4018
|
+
import { jsx as jsx65, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4019
|
+
var DEFAULT_LABELS33 = { search: "Search", searchHint: "Search agents, runs, approvals\u2026", notifications: "Notifications", apps: "Products", user: "Account" };
|
|
3756
4020
|
function GlobalHeader({ product, tone = "panel", search = true, onSearch, shortcut = "\u2318K", actions, user, onUserClick, notifications, onNotifications, onApps, brand, left, labels, className, ...rest }) {
|
|
3757
|
-
const l = { ...
|
|
4021
|
+
const l = { ...DEFAULT_LABELS33, ...labels };
|
|
3758
4022
|
const u = typeof user === "string" ? { name: user } : user;
|
|
3759
|
-
return /* @__PURE__ */
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
onApps && /* @__PURE__ */
|
|
3762
|
-
brand || /* @__PURE__ */
|
|
4023
|
+
return /* @__PURE__ */ jsxs58("header", { className: cx("agn-gheader", "agn-gheader--" + tone, className), ...rest, children: [
|
|
4024
|
+
/* @__PURE__ */ jsxs58("div", { className: "agn-gheader__brand", children: [
|
|
4025
|
+
onApps && /* @__PURE__ */ jsx65(ButtonIcon, { icon: "grip", label: l.apps, onClick: onApps, className: "agn-gheader__apps" }),
|
|
4026
|
+
brand || /* @__PURE__ */ jsx65(AginiesLogo, { size: 22, product })
|
|
3763
4027
|
] }),
|
|
3764
|
-
left && /* @__PURE__ */
|
|
3765
|
-
search && /* @__PURE__ */
|
|
3766
|
-
/* @__PURE__ */
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
shortcut && /* @__PURE__ */
|
|
4028
|
+
left && /* @__PURE__ */ jsx65("div", { className: "agn-gheader__left", children: left }),
|
|
4029
|
+
search && /* @__PURE__ */ jsxs58("button", { type: "button", className: "agn-gheader__search agn-focus", onClick: onSearch, "aria-label": l.search, "aria-keyshortcuts": shortcut === "\u2318K" ? "Meta+K Control+K" : void 0, children: [
|
|
4030
|
+
/* @__PURE__ */ jsx65(Icon, { name: "search", size: 14 }),
|
|
4031
|
+
/* @__PURE__ */ jsx65("span", { className: "agn-gheader__search-hint", children: l.searchHint }),
|
|
4032
|
+
shortcut && /* @__PURE__ */ jsx65("kbd", { className: "agn-gheader__kbd", children: shortcut })
|
|
3769
4033
|
] }),
|
|
3770
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsxs58("div", { className: "agn-gheader__actions", children: [
|
|
3771
4035
|
actions,
|
|
3772
|
-
(notifications != null || onNotifications) && /* @__PURE__ */
|
|
3773
|
-
/* @__PURE__ */
|
|
3774
|
-
notifications > 0 && /* @__PURE__ */
|
|
4036
|
+
(notifications != null || onNotifications) && /* @__PURE__ */ jsxs58("span", { className: "agn-gheader__notif", children: [
|
|
4037
|
+
/* @__PURE__ */ jsx65(ButtonIcon, { icon: "bell", label: l.notifications + (notifications ? " (" + notifications + ")" : ""), onClick: onNotifications }),
|
|
4038
|
+
notifications > 0 && /* @__PURE__ */ jsx65(Badge, { tone: "bad", solid: true, size: "sm", count: notifications, className: "agn-gheader__notif-count" })
|
|
3775
4039
|
] }),
|
|
3776
|
-
u && /* @__PURE__ */
|
|
4040
|
+
u && /* @__PURE__ */ jsx65("button", { type: "button", className: "agn-gheader__user agn-focus", onClick: onUserClick, "aria-label": l.user + ": " + (u.name || ""), children: /* @__PURE__ */ jsx65(Avatar, { size: "sm", name: u.name, src: u.src }) })
|
|
3777
4041
|
] })
|
|
3778
4042
|
] });
|
|
3779
4043
|
}
|
|
3780
4044
|
|
|
3781
4045
|
// src/navigation/VerticalNavigation.jsx
|
|
3782
|
-
import
|
|
3783
|
-
import { jsx as
|
|
3784
|
-
var
|
|
3785
|
-
function VerticalNavigation({ groups = [], active, onChange, collapsed, onCollapse, product, search, switcher, footer, tree, width, resizable, minWidth = 180, maxWidth = 400, onResize, logoHref, labels, className, style, ...rest }) {
|
|
3786
|
-
const l = { ...
|
|
3787
|
-
const
|
|
3788
|
-
const
|
|
3789
|
-
const
|
|
4046
|
+
import React68 from "react";
|
|
4047
|
+
import { jsx as jsx66, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4048
|
+
var DEFAULT_LABELS34 = { search: "Search", collapse: "Collapse sidebar", expand: "Expand sidebar", navigation: "Main navigation", resize: "Resize sidebar", close: "Close navigation" };
|
|
4049
|
+
function VerticalNavigation({ groups = [], active, onChange, collapsed: collapsedProp, onCollapse: onCollapseProp, mode: modeProp, product, search, switcher, footer, tree, width, resizable, minWidth = 180, maxWidth = 400, onResize, logoHref, labels, className, style, ...rest }) {
|
|
4050
|
+
const l = { ...DEFAULT_LABELS34, ...labels };
|
|
4051
|
+
const page = React68.useContext(PageLayoutContext);
|
|
4052
|
+
const mode = modeProp || page && page.sidebar || "docked";
|
|
4053
|
+
const drawer = mode === "overlay" || mode === "drawer";
|
|
4054
|
+
const rail = mode === "rail";
|
|
4055
|
+
const collapsed = drawer ? false : rail ? !!collapsedProp || !(page && page.railExpanded) : collapsedProp;
|
|
4056
|
+
const onCollapse = drawer ? null : rail ? (next) => {
|
|
4057
|
+
if (page) page.setRailExpanded(!next);
|
|
4058
|
+
if (onCollapseProp) onCollapseProp(next);
|
|
4059
|
+
} : onCollapseProp;
|
|
4060
|
+
const navRef = React68.useRef(null);
|
|
4061
|
+
const [dragW, setDragW] = React68.useState(null);
|
|
4062
|
+
const [resizing, setResizing] = React68.useState(false);
|
|
3790
4063
|
const w = dragW != null ? dragW : width;
|
|
3791
4064
|
const clampW = (v) => Math.round(Math.max(minWidth, Math.min(maxWidth, v)));
|
|
3792
4065
|
const commit = (v) => {
|
|
@@ -3832,26 +4105,27 @@ function VerticalNavigation({ groups = [], active, onChange, collapsed, onCollap
|
|
|
3832
4105
|
const n = items[(i + (e.key === "ArrowDown" ? 1 : -1) + items.length) % items.length];
|
|
3833
4106
|
n.focus();
|
|
3834
4107
|
};
|
|
3835
|
-
return /* @__PURE__ */
|
|
3836
|
-
/* @__PURE__ */
|
|
3837
|
-
logoHref ? /* @__PURE__ */
|
|
3838
|
-
|
|
4108
|
+
return /* @__PURE__ */ jsxs59("nav", { ref: navRef, className: cx("agn-sidebar", collapsed && "agn-sidebar--collapsed", rail && "agn-sidebar--rail", drawer && "agn-sidebar--drawer", resizable && !collapsed && !drawer && "agn-sidebar--resizable", resizing && "agn-sidebar--resizing", className), style: rootStyle, "aria-label": l.navigation, ...rest, children: [
|
|
4109
|
+
/* @__PURE__ */ jsxs59("div", { className: "agn-sidebar__top", children: [
|
|
4110
|
+
logoHref ? /* @__PURE__ */ jsx66("a", { href: logoHref, className: "agn-sidebar__logo agn-focus", children: collapsed ? /* @__PURE__ */ jsx66(AginiesMark, { size: 22 }) : /* @__PURE__ */ jsx66(AginiesLogo, { size: 20, product }) }) : /* @__PURE__ */ jsx66("span", { className: "agn-sidebar__logo", children: collapsed ? /* @__PURE__ */ jsx66(AginiesMark, { size: 22 }) : /* @__PURE__ */ jsx66(AginiesLogo, { size: 20, product }) }),
|
|
4111
|
+
drawer && page && /* @__PURE__ */ jsx66("button", { type: "button", className: "agn-sidebar__collapse agn-focus", "aria-label": l.close, title: l.close, onClick: page.closeSidebar, children: /* @__PURE__ */ jsx66(Icon, { name: "x", size: 16 }) }),
|
|
4112
|
+
onCollapse && /* @__PURE__ */ jsx66("button", { type: "button", className: "agn-sidebar__collapse agn-focus", "aria-label": collapsed ? l.expand : l.collapse, title: collapsed ? l.expand : l.collapse, "aria-expanded": !collapsed, onClick: () => onCollapse(!collapsed), children: /* @__PURE__ */ jsx66(Icon, { name: collapsed ? "panel-left-open" : "panel-left-close", size: 16 }) })
|
|
3839
4113
|
] }),
|
|
3840
|
-
search && /* @__PURE__ */
|
|
3841
|
-
/* @__PURE__ */
|
|
3842
|
-
/* @__PURE__ */
|
|
3843
|
-
search.shortcut && /* @__PURE__ */
|
|
4114
|
+
search && /* @__PURE__ */ jsxs59("button", { type: "button", className: "agn-sidebar__search agn-focus", onClick: search.onClick, title: collapsed ? search.label || l.search : void 0, "aria-label": search.label || l.search, children: [
|
|
4115
|
+
/* @__PURE__ */ jsx66(Icon, { name: "search", size: 14 }),
|
|
4116
|
+
/* @__PURE__ */ jsx66("span", { className: "agn-sidebar__search-label", children: search.placeholder || search.label || l.search }),
|
|
4117
|
+
search.shortcut && /* @__PURE__ */ jsx66("kbd", { className: "agn-sidebar__kbd", children: search.shortcut })
|
|
3844
4118
|
] }),
|
|
3845
|
-
/* @__PURE__ */
|
|
3846
|
-
tree && !collapsed && /* @__PURE__ */
|
|
4119
|
+
/* @__PURE__ */ jsxs59("div", { className: "agn-sidebar__scroll", onKeyDown: onKey, children: [
|
|
4120
|
+
tree && !collapsed && /* @__PURE__ */ jsx66("div", { className: "agn-sidebar__tree", children: tree }),
|
|
3847
4121
|
groups.map((g, gi) => (
|
|
3848
4122
|
// biome-ignore lint/a11y/useSemanticElements: a labelled role=group is the intended semantics for this cluster; <fieldset> brings form semantics, a legend and UA chrome it does not want
|
|
3849
|
-
/* @__PURE__ */
|
|
3850
|
-
g.label && /* @__PURE__ */
|
|
3851
|
-
/* @__PURE__ */
|
|
4123
|
+
/* @__PURE__ */ jsxs59("div", { className: "agn-sidebar__group", role: "group", "aria-label": g.label, children: [
|
|
4124
|
+
g.label && /* @__PURE__ */ jsx66("div", { className: "agn-sidebar__eyebrow agn-eyebrow agn-eyebrow--quiet", "aria-hidden": collapsed ? true : void 0, children: collapsed ? /* @__PURE__ */ jsx66("span", { className: "agn-sidebar__eyebrow-rule" }) : g.label }),
|
|
4125
|
+
/* @__PURE__ */ jsx66("ul", { className: "agn-sidebar__list", children: g.items.map((it) => {
|
|
3852
4126
|
const isActive = active === it.id;
|
|
3853
4127
|
const Comp = it.href ? "a" : "button";
|
|
3854
|
-
return /* @__PURE__ */
|
|
4128
|
+
return /* @__PURE__ */ jsx66("li", { children: /* @__PURE__ */ jsxs59(Comp, { href: it.href, type: Comp === "button" ? "button" : void 0, className: cx("agn-nav-item", isActive && "agn-nav-item--active", it.disabled && "agn-nav-item--disabled"), "aria-current": isActive ? "page" : void 0, title: collapsed ? it.label : void 0, disabled: Comp === "button" ? it.disabled : void 0, "aria-disabled": it.disabled && Comp === "a" ? true : void 0, tabIndex: it.disabled && Comp === "a" ? -1 : void 0, onClick: (e) => {
|
|
3855
4129
|
if (it.disabled) {
|
|
3856
4130
|
e.preventDefault();
|
|
3857
4131
|
return;
|
|
@@ -3860,30 +4134,31 @@ function VerticalNavigation({ groups = [], active, onChange, collapsed, onCollap
|
|
|
3860
4134
|
if (!it.href) e.preventDefault();
|
|
3861
4135
|
onChange(it.id, it);
|
|
3862
4136
|
}
|
|
4137
|
+
if (drawer && page) page.closeSidebar();
|
|
3863
4138
|
}, children: [
|
|
3864
|
-
/* @__PURE__ */
|
|
3865
|
-
/* @__PURE__ */
|
|
3866
|
-
it.count != null && !collapsed && /* @__PURE__ */
|
|
3867
|
-
it.count != null && collapsed && /* @__PURE__ */
|
|
4139
|
+
/* @__PURE__ */ jsx66("span", { className: "agn-nav-item__icon", children: /* @__PURE__ */ jsx66(Icon, { name: it.icon || "circle", size: 16 }) }),
|
|
4140
|
+
/* @__PURE__ */ jsx66("span", { className: "agn-nav-item__label", children: it.label }),
|
|
4141
|
+
it.count != null && !collapsed && /* @__PURE__ */ jsx66(Badge, { size: "sm", tone: it.countTone || "neutral", count: it.count, className: "agn-nav-item__count" }),
|
|
4142
|
+
it.count != null && collapsed && /* @__PURE__ */ jsx66("span", { className: "agn-nav-item__dot", "aria-hidden": "true" })
|
|
3868
4143
|
] }) }, it.id);
|
|
3869
4144
|
}) })
|
|
3870
4145
|
] }, g.id || gi)
|
|
3871
4146
|
))
|
|
3872
4147
|
] }),
|
|
3873
|
-
(footer || switcher) && /* @__PURE__ */
|
|
4148
|
+
(footer || switcher) && /* @__PURE__ */ jsxs59("div", { className: "agn-sidebar__bottom", children: [
|
|
3874
4149
|
footer,
|
|
3875
4150
|
switcher
|
|
3876
4151
|
] }),
|
|
3877
|
-
resizable && !collapsed && /* @__PURE__ */
|
|
4152
|
+
resizable && !collapsed && !drawer && /* @__PURE__ */ jsx66("div", { className: "agn-sidebar__resize", role: "separator", "aria-orientation": "vertical", "aria-label": l.resize, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, "aria-valuenow": typeof w === "number" ? w : void 0, tabIndex: 0, onPointerDown: onHandleDown, onKeyDown: onHandleKey })
|
|
3878
4153
|
] });
|
|
3879
4154
|
}
|
|
3880
4155
|
|
|
3881
4156
|
// src/navigation/Tabs.jsx
|
|
3882
|
-
import
|
|
3883
|
-
import { jsx as
|
|
3884
|
-
var
|
|
4157
|
+
import React69, { useState as useState10, useRef as useRef4, useMemo as useMemo2 } from "react";
|
|
4158
|
+
import { jsx as jsx67, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
4159
|
+
var DEFAULT_LABELS35 = { close: "Close" };
|
|
3885
4160
|
function Tabs({ items = [], active, defaultActive, onChange, variant = "line", size = "md", actions, panel = true, closable, onClose, labels, children, className, panelClassName, ...rest }) {
|
|
3886
|
-
const L = { ...
|
|
4161
|
+
const L = { ...DEFAULT_LABELS35, ...labels };
|
|
3887
4162
|
const canClose = (it) => !!onClose && !it.disabled && (it.closable != null ? it.closable : !!closable);
|
|
3888
4163
|
const [local, setLocal] = useState10(defaultActive != null ? defaultActive : items[0] && items[0].id);
|
|
3889
4164
|
const cur = active !== void 0 ? active : local;
|
|
@@ -3916,43 +4191,43 @@ function Tabs({ items = [], active, defaultActive, onChange, variant = "line", s
|
|
|
3916
4191
|
};
|
|
3917
4192
|
const current = items.find((i) => i.id === cur);
|
|
3918
4193
|
const content = current && current.content != null ? current.content : children;
|
|
3919
|
-
return /* @__PURE__ */
|
|
3920
|
-
/* @__PURE__ */
|
|
3921
|
-
/* @__PURE__ */
|
|
4194
|
+
return /* @__PURE__ */ jsxs60("div", { className: cx("agn-tabs", "agn-tabs--" + variant, size !== "md" && "agn-tabs--" + size, className), ...rest, children: [
|
|
4195
|
+
/* @__PURE__ */ jsxs60("div", { className: "agn-tabs__bar", children: [
|
|
4196
|
+
/* @__PURE__ */ jsx67("div", { className: "agn-tabs__list", role: "tablist", "aria-orientation": variant === "vertical" ? "vertical" : "horizontal", ref: listRef, onKeyDown: onKey, children: items.map((it) => {
|
|
3922
4197
|
const sel = it.id === cur;
|
|
3923
|
-
const tab = /* @__PURE__ */
|
|
3924
|
-
it.icon && /* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
3926
|
-
it.count != null && /* @__PURE__ */
|
|
4198
|
+
const tab = /* @__PURE__ */ jsxs60("button", { type: "button", role: "tab", "data-tab": it.id, id: id + "-" + it.id, "aria-selected": sel, "aria-controls": panel ? id + "-p" : void 0, "aria-disabled": it.disabled || void 0, tabIndex: sel ? 0 : -1, className: cx("agn-tab", sel && "agn-tab--active", it.disabled && "agn-tab--disabled", canClose(it) && "agn-tab--closable"), onClick: () => select(it), disabled: it.disabled, children: [
|
|
4199
|
+
it.icon && /* @__PURE__ */ jsx67(Icon, { name: it.icon, size: 14 }),
|
|
4200
|
+
/* @__PURE__ */ jsx67("span", { className: "agn-tab__label", children: it.label }),
|
|
4201
|
+
it.count != null && /* @__PURE__ */ jsx67(Badge, { size: "sm", tone: sel ? "signal" : "neutral", count: it.count })
|
|
3927
4202
|
] }, it.id);
|
|
3928
4203
|
if (!canClose(it)) return tab;
|
|
3929
|
-
return /* @__PURE__ */
|
|
4204
|
+
return /* @__PURE__ */ jsxs60("span", { className: "agn-tabs__item", role: "presentation", children: [
|
|
3930
4205
|
tab,
|
|
3931
|
-
/* @__PURE__ */
|
|
4206
|
+
/* @__PURE__ */ jsx67("button", { type: "button", className: "agn-tab__close agn-focus", tabIndex: -1, "aria-label": L.close + " " + (typeof it.label === "string" ? it.label : ""), title: L.close, onClick: (e) => {
|
|
3932
4207
|
e.stopPropagation();
|
|
3933
4208
|
onClose(it.id, it);
|
|
3934
|
-
}, children: /* @__PURE__ */
|
|
4209
|
+
}, children: /* @__PURE__ */ jsx67(Icon, { name: "x", size: 12 }) })
|
|
3935
4210
|
] }, it.id);
|
|
3936
4211
|
}) }),
|
|
3937
|
-
actions && /* @__PURE__ */
|
|
4212
|
+
actions && /* @__PURE__ */ jsx67("div", { className: "agn-tabs__actions", children: actions })
|
|
3938
4213
|
] }),
|
|
3939
|
-
panel && content != null && /* @__PURE__ */
|
|
4214
|
+
panel && content != null && /* @__PURE__ */ jsx67("div", { className: cx("agn-tabs__panel", panelClassName), role: "tabpanel", id: id + "-p", "aria-labelledby": current ? id + "-" + current.id : void 0, tabIndex: 0, children: content })
|
|
3940
4215
|
] });
|
|
3941
4216
|
}
|
|
3942
4217
|
|
|
3943
4218
|
// src/navigation/GlobalNavigation.jsx
|
|
3944
|
-
import
|
|
3945
|
-
import { Fragment as
|
|
3946
|
-
var
|
|
4219
|
+
import React70 from "react";
|
|
4220
|
+
import { Fragment as Fragment9, jsx as jsx68, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
4221
|
+
var DEFAULT_LABELS36 = { navigation: "Product navigation", more: "More" };
|
|
3947
4222
|
function GlobalNavigation({ items = [], active, onChange, maxVisible, labels, className, ...rest }) {
|
|
3948
|
-
const l = { ...
|
|
3949
|
-
const rootRef =
|
|
3950
|
-
const measureRef =
|
|
3951
|
-
const moreRef =
|
|
3952
|
-
const [fit, setFit] =
|
|
3953
|
-
const [open, setOpen] =
|
|
4223
|
+
const l = { ...DEFAULT_LABELS36, ...labels };
|
|
4224
|
+
const rootRef = React70.useRef(null);
|
|
4225
|
+
const measureRef = React70.useRef(null);
|
|
4226
|
+
const moreRef = React70.useRef(null);
|
|
4227
|
+
const [fit, setFit] = React70.useState(items.length);
|
|
4228
|
+
const [open, setOpen] = React70.useState(false);
|
|
3954
4229
|
const cap = maxVisible != null ? Math.min(maxVisible, items.length) : items.length;
|
|
3955
|
-
|
|
4230
|
+
React70.useLayoutEffect(() => {
|
|
3956
4231
|
const root = rootRef.current, meas = measureRef.current;
|
|
3957
4232
|
if (!root || !meas) return void 0;
|
|
3958
4233
|
const calc = () => {
|
|
@@ -3980,7 +4255,7 @@ function GlobalNavigation({ items = [], active, onChange, maxVisible, labels, cl
|
|
|
3980
4255
|
ro.observe(meas);
|
|
3981
4256
|
return () => ro.disconnect();
|
|
3982
4257
|
}, [items, cap]);
|
|
3983
|
-
|
|
4258
|
+
React70.useEffect(() => {
|
|
3984
4259
|
if (!open) return void 0;
|
|
3985
4260
|
const close = (e) => {
|
|
3986
4261
|
if (moreRef.current && !moreRef.current.contains(e.target)) setOpen(false);
|
|
@@ -4026,21 +4301,21 @@ function GlobalNavigation({ items = [], active, onChange, maxVisible, labels, cl
|
|
|
4026
4301
|
els[(i + d + els.length) % els.length].focus();
|
|
4027
4302
|
}
|
|
4028
4303
|
};
|
|
4029
|
-
const body = (it, menu) => /* @__PURE__ */
|
|
4030
|
-
it.icon && /* @__PURE__ */
|
|
4031
|
-
/* @__PURE__ */
|
|
4032
|
-
it.count != null && /* @__PURE__ */
|
|
4304
|
+
const body = (it, menu) => /* @__PURE__ */ jsxs61(Fragment9, { children: [
|
|
4305
|
+
it.icon && /* @__PURE__ */ jsx68(Icon, { name: it.icon, size: menu ? 14 : 15, className: "agn-gnav__icon" }),
|
|
4306
|
+
/* @__PURE__ */ jsx68("span", { className: "agn-gnav__label", children: it.label }),
|
|
4307
|
+
it.count != null && /* @__PURE__ */ jsx68(Badge, { size: "sm", tone: it.countTone || (it.id === active ? "signal" : "neutral"), count: it.count })
|
|
4033
4308
|
] });
|
|
4034
4309
|
const renderItem = (it, measure) => {
|
|
4035
4310
|
const Comp = it.href ? "a" : "button";
|
|
4036
4311
|
const isActive = it.id === active;
|
|
4037
|
-
return /* @__PURE__ */
|
|
4312
|
+
return /* @__PURE__ */ jsx68(Comp, { href: it.href, type: Comp === "button" ? "button" : void 0, className: cx("agn-gnav__item", "agn-focus", isActive && "agn-gnav__item--active", it.disabled && "agn-gnav__item--disabled"), "aria-current": !measure && isActive ? "page" : void 0, disabled: Comp === "button" ? it.disabled : void 0, "aria-disabled": it.disabled && Comp === "a" ? true : void 0, tabIndex: measure ? -1 : it.disabled && Comp === "a" ? -1 : void 0, onClick: measure ? void 0 : (e) => pick(e, it), children: body(it) });
|
|
4038
4313
|
};
|
|
4039
|
-
return /* @__PURE__ */
|
|
4040
|
-
/* @__PURE__ */
|
|
4041
|
-
visible.map((it) => /* @__PURE__ */
|
|
4042
|
-
hidden.length > 0 && /* @__PURE__ */
|
|
4043
|
-
/* @__PURE__ */
|
|
4314
|
+
return /* @__PURE__ */ jsxs61("nav", { ref: rootRef, className: cx("agn-gnav", className), "aria-label": l.navigation, onKeyDown: onKey, ...rest, children: [
|
|
4315
|
+
/* @__PURE__ */ jsxs61("ul", { className: "agn-gnav__list", children: [
|
|
4316
|
+
visible.map((it) => /* @__PURE__ */ jsx68("li", { children: renderItem(it) }, it.id)),
|
|
4317
|
+
hidden.length > 0 && /* @__PURE__ */ jsxs61("li", { ref: moreRef, className: "agn-gnav__more", children: [
|
|
4318
|
+
/* @__PURE__ */ jsxs61("button", { type: "button", className: cx("agn-gnav__item", "agn-focus", hiddenActive && "agn-gnav__item--active"), "aria-haspopup": "menu", "aria-expanded": open, onClick: () => setOpen(!open), onKeyDown: (e) => {
|
|
4044
4319
|
if (e.key === "ArrowDown") {
|
|
4045
4320
|
e.preventDefault();
|
|
4046
4321
|
setOpen(true);
|
|
@@ -4050,66 +4325,66 @@ function GlobalNavigation({ items = [], active, onChange, maxVisible, labels, cl
|
|
|
4050
4325
|
}, 0);
|
|
4051
4326
|
}
|
|
4052
4327
|
}, children: [
|
|
4053
|
-
/* @__PURE__ */
|
|
4054
|
-
/* @__PURE__ */
|
|
4328
|
+
/* @__PURE__ */ jsx68("span", { className: "agn-gnav__label", children: hiddenActive ? hidden.find((it) => it.id === active).label : l.more }),
|
|
4329
|
+
/* @__PURE__ */ jsx68(Icon, { name: "chevron-down", size: 14 })
|
|
4055
4330
|
] }),
|
|
4056
|
-
open && /* @__PURE__ */
|
|
4331
|
+
open && /* @__PURE__ */ jsx68("div", { className: "agn-gnav__menu", role: "menu", "aria-label": l.more, onKeyDown: onMenuKey, children: hidden.map((it) => {
|
|
4057
4332
|
const Comp = it.href ? "a" : "button";
|
|
4058
|
-
return /* @__PURE__ */
|
|
4333
|
+
return /* @__PURE__ */ jsxs61(Comp, { role: "menuitem", href: it.href, type: Comp === "button" ? "button" : void 0, className: cx("agn-gnav__menu-item", it.id === active && "agn-gnav__menu-item--active"), "aria-current": it.id === active ? "page" : void 0, "aria-disabled": it.disabled || void 0, tabIndex: -1, onClick: (e) => pick(e, it), children: [
|
|
4059
4334
|
body(it, true),
|
|
4060
|
-
it.id === active && /* @__PURE__ */
|
|
4335
|
+
it.id === active && /* @__PURE__ */ jsx68(Icon, { name: "check", size: 14, className: "agn-gnav__check" })
|
|
4061
4336
|
] }, it.id);
|
|
4062
4337
|
}) })
|
|
4063
4338
|
] })
|
|
4064
4339
|
] }),
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
items.map((it) => /* @__PURE__ */
|
|
4067
|
-
/* @__PURE__ */
|
|
4068
|
-
/* @__PURE__ */
|
|
4069
|
-
/* @__PURE__ */
|
|
4340
|
+
/* @__PURE__ */ jsxs61("div", { ref: measureRef, className: "agn-gnav__measure", "aria-hidden": "true", children: [
|
|
4341
|
+
items.map((it) => /* @__PURE__ */ jsx68(React70.Fragment, { children: renderItem(it, true) }, it.id)),
|
|
4342
|
+
/* @__PURE__ */ jsxs61("span", { className: "agn-gnav__item", children: [
|
|
4343
|
+
/* @__PURE__ */ jsx68("span", { className: "agn-gnav__label", children: l.more }),
|
|
4344
|
+
/* @__PURE__ */ jsx68(Icon, { name: "chevron-down", size: 14 })
|
|
4070
4345
|
] })
|
|
4071
4346
|
] })
|
|
4072
4347
|
] });
|
|
4073
4348
|
}
|
|
4074
4349
|
|
|
4075
4350
|
// src/navigation/Breadcrumbs.jsx
|
|
4076
|
-
import
|
|
4077
|
-
import { jsx as
|
|
4078
|
-
var
|
|
4351
|
+
import React71 from "react";
|
|
4352
|
+
import { jsx as jsx69, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
4353
|
+
var DEFAULT_LABELS37 = { nav: "Breadcrumb", more: "Show hidden path" };
|
|
4079
4354
|
function Breadcrumbs({ items = [], max = 4, labels, className, ...rest }) {
|
|
4080
|
-
const l = { ...
|
|
4081
|
-
const [open, setOpen] =
|
|
4355
|
+
const l = { ...DEFAULT_LABELS37, ...labels };
|
|
4356
|
+
const [open, setOpen] = React71.useState(false);
|
|
4082
4357
|
let list = items;
|
|
4083
4358
|
let hidden = [];
|
|
4084
4359
|
if (!open && items.length > max) {
|
|
4085
4360
|
hidden = items.slice(1, items.length - (max - 2));
|
|
4086
4361
|
list = [items[0], { ellipsis: true }, ...items.slice(items.length - (max - 2))];
|
|
4087
4362
|
}
|
|
4088
|
-
return /* @__PURE__ */
|
|
4363
|
+
return /* @__PURE__ */ jsx69("nav", { className: cx("agn-crumbs", className), "aria-label": l.nav, ...rest, children: /* @__PURE__ */ jsx69("ol", { className: "agn-crumbs__list", children: list.map((it, i) => {
|
|
4089
4364
|
const last = i === list.length - 1;
|
|
4090
4365
|
let node;
|
|
4091
|
-
if (it.ellipsis) node = /* @__PURE__ */
|
|
4092
|
-
else if (last) node = /* @__PURE__ */
|
|
4093
|
-
it.icon && /* @__PURE__ */
|
|
4366
|
+
if (it.ellipsis) node = /* @__PURE__ */ jsx69("button", { type: "button", className: "agn-crumbs__more agn-focus", "aria-label": l.more, title: hidden.map((h) => h.label).join(" / "), onClick: () => setOpen(true), children: /* @__PURE__ */ jsx69(Icon, { name: "ellipsis", size: 14 }) });
|
|
4367
|
+
else if (last) node = /* @__PURE__ */ jsxs62("span", { className: "agn-crumbs__current", "aria-current": "page", children: [
|
|
4368
|
+
it.icon && /* @__PURE__ */ jsx69(Icon, { name: it.icon, size: 14 }),
|
|
4094
4369
|
it.label
|
|
4095
4370
|
] });
|
|
4096
|
-
else node = /* @__PURE__ */
|
|
4097
|
-
it.icon && /* @__PURE__ */
|
|
4371
|
+
else node = /* @__PURE__ */ jsxs62("a", { className: "agn-crumbs__link agn-focus", href: it.href || "#", onClick: it.onClick, children: [
|
|
4372
|
+
it.icon && /* @__PURE__ */ jsx69(Icon, { name: it.icon, size: 14 }),
|
|
4098
4373
|
it.label
|
|
4099
4374
|
] });
|
|
4100
|
-
return /* @__PURE__ */
|
|
4375
|
+
return /* @__PURE__ */ jsxs62("li", { className: "agn-crumbs__item", children: [
|
|
4101
4376
|
node,
|
|
4102
|
-
!last && /* @__PURE__ */
|
|
4377
|
+
!last && /* @__PURE__ */ jsx69(Icon, { name: "chevron-right", size: 12, className: "agn-crumbs__sep" })
|
|
4103
4378
|
] }, i);
|
|
4104
4379
|
}) }) });
|
|
4105
4380
|
}
|
|
4106
4381
|
|
|
4107
4382
|
// src/navigation/Path.jsx
|
|
4108
|
-
import
|
|
4109
|
-
import { jsx as
|
|
4110
|
-
var
|
|
4383
|
+
import React72 from "react";
|
|
4384
|
+
import { jsx as jsx70, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
4385
|
+
var DEFAULT_LABELS38 = { stage: "Stage", done: "done", current: "current", upcoming: "upcoming", lost: "Closed" };
|
|
4111
4386
|
function Path({ steps = [], current, onChange, compact, lost, labels, className, ...rest }) {
|
|
4112
|
-
const l = { ...
|
|
4387
|
+
const l = { ...DEFAULT_LABELS38, ...labels };
|
|
4113
4388
|
const list = steps.map((s) => typeof s === "string" ? { id: s, label: s } : s);
|
|
4114
4389
|
const ci = list.findIndex((s) => s.id === current);
|
|
4115
4390
|
const stateOf = (i) => lost ? i < ci ? "done" : i === ci ? "lost" : "upcoming" : i < ci ? "done" : i === ci ? "current" : "upcoming";
|
|
@@ -4117,12 +4392,12 @@ function Path({ steps = [], current, onChange, compact, lost, labels, className,
|
|
|
4117
4392
|
const cur = list[ci];
|
|
4118
4393
|
return (
|
|
4119
4394
|
// biome-ignore lint/a11y/useSemanticElements: a labelled role=group is the intended semantics for this cluster; <fieldset> brings form semantics, a legend and UA chrome it does not want
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
/* @__PURE__ */
|
|
4122
|
-
/* @__PURE__ */
|
|
4123
|
-
/* @__PURE__ */
|
|
4124
|
-
/* @__PURE__ */
|
|
4125
|
-
/* @__PURE__ */
|
|
4395
|
+
/* @__PURE__ */ jsxs63("div", { className: cx("agn-path", "agn-path--compact", lost && "agn-path--lost", className), role: "group", "aria-label": l.stage, ...rest, children: [
|
|
4396
|
+
/* @__PURE__ */ jsx70("div", { className: "agn-path__bar", "aria-hidden": "true", children: list.map((s, i) => /* @__PURE__ */ jsx70("span", { className: cx("agn-path__seg", "agn-path__seg--" + stateOf(i)) }, s.id)) }),
|
|
4397
|
+
/* @__PURE__ */ jsxs63("div", { className: "agn-path__caption", children: [
|
|
4398
|
+
/* @__PURE__ */ jsx70("span", { className: "agn-path__caption-label", children: l.stage }),
|
|
4399
|
+
/* @__PURE__ */ jsx70("span", { className: "agn-path__caption-value", children: lost ? l.lost : cur ? cur.label : "" }),
|
|
4400
|
+
/* @__PURE__ */ jsxs63("span", { className: "agn-path__caption-count agn-num", children: [
|
|
4126
4401
|
Math.max(ci, 0) + 1,
|
|
4127
4402
|
"/",
|
|
4128
4403
|
list.length
|
|
@@ -4131,14 +4406,14 @@ function Path({ steps = [], current, onChange, compact, lost, labels, className,
|
|
|
4131
4406
|
] })
|
|
4132
4407
|
);
|
|
4133
4408
|
}
|
|
4134
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ jsx70("ol", { className: cx("agn-path", lost && "agn-path--lost", className), "aria-label": l.stage, ...rest, children: list.map((s, i) => {
|
|
4135
4410
|
const st = stateOf(i);
|
|
4136
4411
|
const Comp = onChange ? "button" : "span";
|
|
4137
|
-
return /* @__PURE__ */
|
|
4138
|
-
st === "done" && /* @__PURE__ */
|
|
4139
|
-
st === "lost" && /* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4141
|
-
/* @__PURE__ */
|
|
4412
|
+
return /* @__PURE__ */ jsx70("li", { className: cx("agn-path__step", "agn-path__step--" + st), "aria-current": st === "current" ? "step" : void 0, children: /* @__PURE__ */ jsxs63(Comp, { type: onChange ? "button" : void 0, className: "agn-path__inner agn-focus-inset", onClick: onChange ? () => onChange(s.id, s) : void 0, title: s.label + " \xB7 " + (st === "lost" ? l.lost : l[st]), children: [
|
|
4413
|
+
st === "done" && /* @__PURE__ */ jsx70(Icon, { name: "check", size: 12 }),
|
|
4414
|
+
st === "lost" && /* @__PURE__ */ jsx70(Icon, { name: "x", size: 12 }),
|
|
4415
|
+
/* @__PURE__ */ jsx70("span", { className: "agn-path__label", children: s.label }),
|
|
4416
|
+
/* @__PURE__ */ jsxs63("span", { className: "agn-sr", children: [
|
|
4142
4417
|
", ",
|
|
4143
4418
|
st === "lost" ? l.lost : l[st]
|
|
4144
4419
|
] })
|
|
@@ -4147,46 +4422,59 @@ function Path({ steps = [], current, onChange, compact, lost, labels, className,
|
|
|
4147
4422
|
}
|
|
4148
4423
|
|
|
4149
4424
|
// src/navigation/ProgressIndicator.jsx
|
|
4150
|
-
import
|
|
4151
|
-
import { jsx as
|
|
4152
|
-
var
|
|
4425
|
+
import React73 from "react";
|
|
4426
|
+
import { jsx as jsx71, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
4427
|
+
var DEFAULT_LABELS39 = { step: "Step", done: "done", current: "current", upcoming: "upcoming", error: "needs attention", of: "of" };
|
|
4153
4428
|
function ProgressIndicator({ steps = [], current = 0, onStepClick, vertical, errorSteps = [], labels, className, ...rest }) {
|
|
4154
|
-
const l = { ...
|
|
4429
|
+
const l = { ...DEFAULT_LABELS39, ...labels };
|
|
4155
4430
|
const list = steps.map((s) => typeof s === "string" ? { label: s } : s);
|
|
4156
|
-
return /* @__PURE__ */
|
|
4431
|
+
return /* @__PURE__ */ jsx71("ol", { className: cx("agn-pind", vertical ? "agn-pind--vertical" : "agn-pind--horizontal", className), "aria-label": l.step + " " + (current + 1) + " " + l.of + " " + list.length, ...rest, children: list.map((s, i) => {
|
|
4157
4432
|
const err = errorSteps.includes(i);
|
|
4158
4433
|
const st = err ? "error" : i < current ? "done" : i === current ? "current" : "upcoming";
|
|
4159
4434
|
const clickable = onStepClick && (i <= current || err);
|
|
4160
4435
|
const Comp = clickable ? "button" : "div";
|
|
4161
|
-
return /* @__PURE__ */
|
|
4162
|
-
/* @__PURE__ */
|
|
4163
|
-
/* @__PURE__ */
|
|
4164
|
-
/* @__PURE__ */
|
|
4165
|
-
/* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ jsxs64("li", { className: cx("agn-pind__step", "agn-pind__step--" + st), "aria-current": st === "current" ? "step" : void 0, children: [
|
|
4437
|
+
/* @__PURE__ */ jsxs64(Comp, { type: clickable ? "button" : void 0, className: cx("agn-pind__inner", clickable && "agn-focus"), onClick: clickable ? () => onStepClick(i, s) : void 0, children: [
|
|
4438
|
+
/* @__PURE__ */ jsx71("span", { className: "agn-pind__marker agn-num", "aria-hidden": "true", children: st === "done" ? /* @__PURE__ */ jsx71(Icon, { name: "check", size: 12 }) : st === "error" ? /* @__PURE__ */ jsx71(Icon, { name: "triangle-alert", size: 12 }) : i + 1 }),
|
|
4439
|
+
/* @__PURE__ */ jsxs64("span", { className: "agn-pind__text", children: [
|
|
4440
|
+
/* @__PURE__ */ jsxs64("span", { className: "agn-pind__label", children: [
|
|
4166
4441
|
s.label,
|
|
4167
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ jsxs64("span", { className: "agn-sr", children: [
|
|
4168
4443
|
", ",
|
|
4169
4444
|
l[st]
|
|
4170
4445
|
] })
|
|
4171
4446
|
] }),
|
|
4172
|
-
s.description && vertical && /* @__PURE__ */
|
|
4447
|
+
s.description && vertical && /* @__PURE__ */ jsx71("span", { className: "agn-pind__desc", children: s.description })
|
|
4173
4448
|
] })
|
|
4174
4449
|
] }),
|
|
4175
|
-
i < list.length - 1 && /* @__PURE__ */
|
|
4450
|
+
i < list.length - 1 && /* @__PURE__ */ jsx71("span", { className: "agn-pind__line", "aria-hidden": "true" })
|
|
4176
4451
|
] }, i);
|
|
4177
4452
|
}) });
|
|
4178
4453
|
}
|
|
4179
4454
|
|
|
4180
4455
|
// src/navigation/SplitView.jsx
|
|
4181
|
-
import
|
|
4182
|
-
import { Fragment as
|
|
4183
|
-
var
|
|
4184
|
-
function SplitView({ items = [], selected, onSelect, renderItem, title, count, headerActions, listWidth, minWidth = 240, maxWidth = 560, resizable = true, collapsible, labels, children, className, style, ...rest }) {
|
|
4185
|
-
const l = { ...
|
|
4456
|
+
import React74, { useState as useState11, useRef as useRef5 } from "react";
|
|
4457
|
+
import { Fragment as Fragment10, jsx as jsx72, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
4458
|
+
var DEFAULT_LABELS40 = { resize: "Resize list", empty: "Select an item", collapse: "Hide list", expand: "Show list", back: "Back to list" };
|
|
4459
|
+
function SplitView({ items = [], selected, onSelect, renderItem, title, count, headerActions, listWidth, minWidth = 240, maxWidth = 560, resizable = true, collapsible, stackBelow = "md", defaultStackedView = "list", onStackedViewChange, onBack, labels, children, className, style, ...rest }) {
|
|
4460
|
+
const l = { ...DEFAULT_LABELS40, ...labels };
|
|
4186
4461
|
const [w, setW] = useState11(listWidth);
|
|
4187
4462
|
const [open, setOpen] = useState11(true);
|
|
4188
4463
|
const ref = useRef5(null);
|
|
4189
4464
|
const listRef = useRef5(null);
|
|
4465
|
+
const width = useElementWidth(ref);
|
|
4466
|
+
const stacked = width != null && stackBelow !== false && width < toPx(stackBelow);
|
|
4467
|
+
const narrow = width != null && width < toPx("lg");
|
|
4468
|
+
const [view, setViewState] = useState11(defaultStackedView);
|
|
4469
|
+
const setView = (v) => {
|
|
4470
|
+
setViewState(v);
|
|
4471
|
+
if (onStackedViewChange) onStackedViewChange(v);
|
|
4472
|
+
};
|
|
4473
|
+
const pick = (it) => {
|
|
4474
|
+
if (onSelect) onSelect(it);
|
|
4475
|
+
if (stacked) setView("detail");
|
|
4476
|
+
};
|
|
4477
|
+
const showDetail = stacked && view === "detail";
|
|
4190
4478
|
const startDrag = (e) => {
|
|
4191
4479
|
e.preventDefault();
|
|
4192
4480
|
const start = e.clientX;
|
|
@@ -4221,49 +4509,58 @@ function SplitView({ items = [], selected, onSelect, renderItem, title, count, h
|
|
|
4221
4509
|
if (el) el.focus();
|
|
4222
4510
|
}
|
|
4223
4511
|
};
|
|
4224
|
-
return /* @__PURE__ */
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
-
(title || headerActions || collapsible) && /* @__PURE__ */
|
|
4227
|
-
/* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ jsxs65("div", { ref, className: cx("agn-split", !open && !stacked && "agn-split--collapsed", narrow && "agn-split--narrow", stacked && "agn-split--stacked", stacked && (showDetail ? "agn-split--show-detail" : "agn-split--show-list"), className), style: { "--agn-split-w": w != null ? typeof w === "number" ? w + "px" : w : void 0, ...style }, ...rest, children: [
|
|
4513
|
+
/* @__PURE__ */ jsxs65("div", { ref: listRef, className: "agn-split__list", "aria-hidden": !stacked && !open || showDetail || void 0, children: [
|
|
4514
|
+
(title || headerActions || collapsible) && /* @__PURE__ */ jsxs65("div", { className: "agn-split__head", children: [
|
|
4515
|
+
/* @__PURE__ */ jsxs65("span", { className: "agn-split__title", children: [
|
|
4228
4516
|
title,
|
|
4229
|
-
count != null && /* @__PURE__ */
|
|
4517
|
+
count != null && /* @__PURE__ */ jsx72("span", { className: "agn-split__count agn-num", children: count })
|
|
4230
4518
|
] }),
|
|
4231
|
-
/* @__PURE__ */
|
|
4519
|
+
/* @__PURE__ */ jsx72("span", { className: "agn-split__head-actions", children: headerActions })
|
|
4232
4520
|
] }),
|
|
4233
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__PURE__ */ jsx72("ul", { className: "agn-split__items", role: "listbox", "aria-label": typeof title === "string" ? title : void 0, onKeyDown: onListKey, children: items.map((it) => {
|
|
4234
4522
|
const sel = it.id === selected;
|
|
4235
4523
|
return (
|
|
4236
4524
|
// biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: listbox option on li inside the ul listbox above; focusable with Enter/Space and arrows
|
|
4237
4525
|
// biome-ignore lint/a11y/useSemanticElements: listbox option on li inside the ul listbox above; focusable with Enter/Space and arrows
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
if (
|
|
4526
|
+
/* @__PURE__ */ jsx72("li", { role: "option", "aria-selected": sel, "data-item": it.id, tabIndex: sel || !selected && items[0] === it ? 0 : -1, className: cx("agn-split__item", "agn-focus-inset", sel && "agn-split__item--selected"), onKeyDown: (e) => {
|
|
4527
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
4240
4528
|
e.preventDefault();
|
|
4241
|
-
|
|
4529
|
+
pick(it);
|
|
4242
4530
|
}
|
|
4243
|
-
}, onClick: () =>
|
|
4244
|
-
it.icon && /* @__PURE__ */
|
|
4245
|
-
/* @__PURE__ */
|
|
4246
|
-
/* @__PURE__ */
|
|
4247
|
-
it.subtitle && /* @__PURE__ */
|
|
4531
|
+
}, onClick: () => pick(it), children: renderItem ? renderItem(it, sel) : /* @__PURE__ */ jsxs65(Fragment10, { children: [
|
|
4532
|
+
it.icon && /* @__PURE__ */ jsx72(Icon, { name: it.icon, size: 16, className: "agn-split__item-icon" }),
|
|
4533
|
+
/* @__PURE__ */ jsxs65("span", { className: "agn-split__item-main", children: [
|
|
4534
|
+
/* @__PURE__ */ jsx72("span", { className: "agn-split__item-title", children: it.title }),
|
|
4535
|
+
it.subtitle && /* @__PURE__ */ jsx72("span", { className: "agn-split__item-sub", children: it.subtitle })
|
|
4248
4536
|
] }),
|
|
4249
|
-
it.meta && /* @__PURE__ */
|
|
4537
|
+
it.meta && /* @__PURE__ */ jsx72("span", { className: "agn-split__item-meta", children: it.meta })
|
|
4250
4538
|
] }) }, it.id)
|
|
4251
4539
|
);
|
|
4252
4540
|
}) })
|
|
4253
4541
|
] }),
|
|
4254
|
-
resizable && open && /* @__PURE__ */
|
|
4255
|
-
collapsible && /* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4542
|
+
resizable && open && !stacked && /* @__PURE__ */ jsx72("div", { className: "agn-split__divider agn-focus", role: "separator", "aria-orientation": "vertical", "aria-label": l.resize, "aria-valuenow": typeof w === "number" ? Math.round(w) : void 0, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, tabIndex: 0, onPointerDown: startDrag, onKeyDown: onDividerKey }),
|
|
4543
|
+
collapsible && !stacked && /* @__PURE__ */ jsx72("button", { type: "button", className: "agn-split__toggle agn-focus", "aria-label": open ? l.collapse : l.expand, "aria-expanded": open, onClick: () => setOpen(!open), children: /* @__PURE__ */ jsx72(Icon, { name: open ? "panel-left-close" : "panel-left-open", size: 14 }) }),
|
|
4544
|
+
/* @__PURE__ */ jsxs65("div", { className: "agn-split__detail", "aria-hidden": stacked && !showDetail || void 0, children: [
|
|
4545
|
+
showDetail && /* @__PURE__ */ jsx72("div", { className: "agn-split__back", children: /* @__PURE__ */ jsxs65("button", { type: "button", className: "agn-split__back-btn agn-focus", onClick: () => {
|
|
4546
|
+
setView("list");
|
|
4547
|
+
if (onBack) onBack();
|
|
4548
|
+
}, children: [
|
|
4549
|
+
/* @__PURE__ */ jsx72(Icon, { name: "arrow-left", size: 14 }),
|
|
4550
|
+
l.back
|
|
4551
|
+
] }) }),
|
|
4552
|
+
children != null ? children : /* @__PURE__ */ jsx72("div", { className: "agn-split__empty", children: l.empty })
|
|
4553
|
+
] })
|
|
4257
4554
|
] });
|
|
4258
4555
|
}
|
|
4259
4556
|
|
|
4260
4557
|
// src/navigation/AppLauncher.jsx
|
|
4261
|
-
import
|
|
4262
|
-
import { jsx as
|
|
4558
|
+
import React75 from "react";
|
|
4559
|
+
import { jsx as jsx73, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
4263
4560
|
var ALL = ["platform", "hub", "dialog", "voice", "vision", "code", "workforce"];
|
|
4264
|
-
var
|
|
4561
|
+
var DEFAULT_LABELS41 = { title: "Products", current: "current", switchProduct: "Switch product" };
|
|
4265
4562
|
function AppLauncher({ products = ALL, current, onOpen, hrefs = {}, descriptions = {}, inline, labels, className, ...rest }) {
|
|
4266
|
-
const l = { ...
|
|
4563
|
+
const l = { ...DEFAULT_LABELS41, ...labels };
|
|
4267
4564
|
const list = products.map((p) => typeof p === "string" ? { id: p } : p);
|
|
4268
4565
|
const onKey = (e) => {
|
|
4269
4566
|
const cells = Array.from(e.currentTarget.querySelectorAll(".agn-launcher__item"));
|
|
@@ -4276,130 +4573,130 @@ function AppLauncher({ products = ALL, current, onOpen, hrefs = {}, descriptions
|
|
|
4276
4573
|
const n = cells[Math.max(0, Math.min(cells.length - 1, i + d))];
|
|
4277
4574
|
if (n) n.focus();
|
|
4278
4575
|
};
|
|
4279
|
-
return /* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4576
|
+
return /* @__PURE__ */ jsxs66("div", { className: cx("agn-launcher", inline && "agn-launcher--inline", className), role: "menu", "aria-label": l.title, onKeyDown: onKey, ...rest, children: [
|
|
4577
|
+
/* @__PURE__ */ jsx73("div", { className: "agn-launcher__title agn-eyebrow agn-eyebrow--quiet", children: l.title }),
|
|
4578
|
+
/* @__PURE__ */ jsx73("div", { className: "agn-launcher__grid", children: list.map((p) => {
|
|
4282
4579
|
const id = p.id;
|
|
4283
4580
|
const name = p.name || PRODUCT_NAMES[id] || id;
|
|
4284
4581
|
const short = name.replace(/ Aginies$/, "");
|
|
4285
4582
|
const isCur = current === id;
|
|
4286
4583
|
const Comp = hrefs[id] || p.href ? "a" : "button";
|
|
4287
|
-
return /* @__PURE__ */
|
|
4584
|
+
return /* @__PURE__ */ jsxs66(Comp, { role: "menuitem", href: p.href || hrefs[id], type: Comp === "button" ? "button" : void 0, className: cx("agn-launcher__item", "agn-focus", isCur && "agn-launcher__item--current"), "aria-current": isCur ? "true" : void 0, onClick: onOpen ? (e) => {
|
|
4288
4585
|
if (Comp === "button") e.preventDefault();
|
|
4289
4586
|
onOpen(id, p);
|
|
4290
4587
|
} : void 0, children: [
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
/* @__PURE__ */
|
|
4293
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ jsx73(ProductIcon, { product: id, boxed: true, size: 22 }),
|
|
4589
|
+
/* @__PURE__ */ jsxs66("span", { className: "agn-launcher__text", children: [
|
|
4590
|
+
/* @__PURE__ */ jsxs66("span", { className: "agn-launcher__name", children: [
|
|
4294
4591
|
short,
|
|
4295
|
-
isCur && /* @__PURE__ */
|
|
4592
|
+
isCur && /* @__PURE__ */ jsxs66("span", { className: "agn-sr", children: [
|
|
4296
4593
|
", ",
|
|
4297
4594
|
l.current
|
|
4298
4595
|
] })
|
|
4299
4596
|
] }),
|
|
4300
|
-
(p.description || descriptions[id]) && /* @__PURE__ */
|
|
4597
|
+
(p.description || descriptions[id]) && /* @__PURE__ */ jsx73("span", { className: "agn-launcher__desc", children: p.description || descriptions[id] })
|
|
4301
4598
|
] }),
|
|
4302
|
-
isCur && /* @__PURE__ */
|
|
4599
|
+
isCur && /* @__PURE__ */ jsx73(Icon, { name: "check", size: 14, className: "agn-launcher__check" })
|
|
4303
4600
|
] }, id);
|
|
4304
4601
|
}) })
|
|
4305
4602
|
] });
|
|
4306
4603
|
}
|
|
4307
4604
|
function AppLauncherTrigger({ product = "platform", name, icon, meta, collapsed, open, labels, className, ...rest }) {
|
|
4308
|
-
const l = { ...
|
|
4605
|
+
const l = { ...DEFAULT_LABELS41, ...labels };
|
|
4309
4606
|
const label = name || (PRODUCT_NAMES[product] || product).replace(/ Aginies$/, "");
|
|
4310
|
-
return /* @__PURE__ */
|
|
4311
|
-
/* @__PURE__ */
|
|
4312
|
-
/* @__PURE__ */
|
|
4607
|
+
return /* @__PURE__ */ jsxs66("button", { type: "button", className: cx("agn-nav-item", "agn-launcher-trigger", "agn-focus", collapsed && "agn-launcher-trigger--collapsed", className), "aria-haspopup": "menu", "aria-expanded": open != null ? !!open : void 0, title: collapsed ? l.switchProduct + ": " + label + (typeof meta === "string" ? " \xB7 " + meta : "") : l.switchProduct, ...rest, children: [
|
|
4608
|
+
/* @__PURE__ */ jsx73("span", { className: "agn-nav-item__icon", children: icon ? /* @__PURE__ */ jsx73(Icon, { name: icon, size: 16 }) : /* @__PURE__ */ jsx73(ProductIcon, { product, size: 16 }) }),
|
|
4609
|
+
/* @__PURE__ */ jsxs66("span", { className: "agn-nav-item__label", children: [
|
|
4313
4610
|
label,
|
|
4314
|
-
meta && !collapsed && /* @__PURE__ */
|
|
4611
|
+
meta && !collapsed && /* @__PURE__ */ jsx73("span", { className: "agn-launcher-trigger__meta", children: meta })
|
|
4315
4612
|
] }),
|
|
4316
|
-
!collapsed && /* @__PURE__ */
|
|
4613
|
+
!collapsed && /* @__PURE__ */ jsx73(Icon, { name: "chevrons-up-down", size: 14, className: "agn-launcher-trigger__chevron" })
|
|
4317
4614
|
] });
|
|
4318
4615
|
}
|
|
4319
4616
|
AppLauncher.Trigger = AppLauncherTrigger;
|
|
4320
4617
|
|
|
4321
4618
|
// src/navigation/PageHeader.jsx
|
|
4322
|
-
import
|
|
4323
|
-
import { jsx as
|
|
4324
|
-
var
|
|
4619
|
+
import React76 from "react";
|
|
4620
|
+
import { jsx as jsx74, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
4621
|
+
var DEFAULT_LABELS42 = { back: "Back" };
|
|
4325
4622
|
function PageHeader({ eyebrow, title, description, actions, meta, tabs, back, media: media2, breadcrumbs, labels, as: Comp = "header", className, ...rest }) {
|
|
4326
|
-
const l = { ...
|
|
4623
|
+
const l = { ...DEFAULT_LABELS42, ...labels };
|
|
4327
4624
|
const b = back && typeof back === "object" ? back : back ? { label: l.back, onClick: typeof back === "function" ? back : void 0 } : null;
|
|
4328
|
-
return /* @__PURE__ */
|
|
4329
|
-
breadcrumbs && /* @__PURE__ */
|
|
4330
|
-
b && /* @__PURE__ */
|
|
4625
|
+
return /* @__PURE__ */ jsxs67(Comp, { className: cx("agn-pageheader", tabs && "agn-pageheader--tabs", className), ...rest, children: [
|
|
4626
|
+
breadcrumbs && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__crumbs", children: breadcrumbs }),
|
|
4627
|
+
b && /* @__PURE__ */ jsxs67("a", { className: "agn-pageheader__back agn-focus", href: b.href || "#", onClick: b.onClick ? (e) => {
|
|
4331
4628
|
if (!b.href) e.preventDefault();
|
|
4332
4629
|
b.onClick(e);
|
|
4333
4630
|
} : void 0, children: [
|
|
4334
|
-
/* @__PURE__ */
|
|
4631
|
+
/* @__PURE__ */ jsx74(Icon, { name: "arrow-left", size: 14 }),
|
|
4335
4632
|
b.label || l.back
|
|
4336
4633
|
] }),
|
|
4337
|
-
/* @__PURE__ */
|
|
4338
|
-
media2 && /* @__PURE__ */
|
|
4339
|
-
/* @__PURE__ */
|
|
4340
|
-
eyebrow && /* @__PURE__ */
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
description && /* @__PURE__ */
|
|
4634
|
+
/* @__PURE__ */ jsxs67("div", { className: "agn-pageheader__row", children: [
|
|
4635
|
+
media2 && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__media", children: media2 }),
|
|
4636
|
+
/* @__PURE__ */ jsxs67("div", { className: "agn-pageheader__text", children: [
|
|
4637
|
+
eyebrow && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__eyebrow agn-eyebrow", children: eyebrow }),
|
|
4638
|
+
/* @__PURE__ */ jsx74("h1", { className: "agn-pageheader__title", children: title }),
|
|
4639
|
+
description && /* @__PURE__ */ jsx74("p", { className: "agn-pageheader__desc", children: description })
|
|
4343
4640
|
] }),
|
|
4344
|
-
actions && /* @__PURE__ */
|
|
4641
|
+
actions && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__actions", children: actions })
|
|
4345
4642
|
] }),
|
|
4346
|
-
meta && /* @__PURE__ */
|
|
4347
|
-
tabs && /* @__PURE__ */
|
|
4643
|
+
meta && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__meta", children: meta }),
|
|
4644
|
+
tabs && /* @__PURE__ */ jsx74("div", { className: "agn-pageheader__tabs", children: tabs })
|
|
4348
4645
|
] });
|
|
4349
4646
|
}
|
|
4350
4647
|
|
|
4351
4648
|
// src/navigation/BuilderHeader.jsx
|
|
4352
|
-
import
|
|
4353
|
-
import { Fragment as
|
|
4354
|
-
var
|
|
4649
|
+
import React77 from "react";
|
|
4650
|
+
import { Fragment as Fragment11, jsx as jsx75, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
4651
|
+
var DEFAULT_LABELS43 = { back: "Back to agents", deploy: "Deploy", versions: "Versions", saving: "Saving\u2026", saved: "Saved", draft: "Draft \u2014 not deployed", rename: "Rename" };
|
|
4355
4652
|
function BuilderHeader({ name, version, status, onBack, backHref, onDeploy, deployDisabled, deploying, onVersions, onRename, saving, saved, draft, actions, left, labels, className, ...rest }) {
|
|
4356
|
-
const l = { ...
|
|
4653
|
+
const l = { ...DEFAULT_LABELS43, ...labels };
|
|
4357
4654
|
const st = typeof status === "string" ? { label: status } : status;
|
|
4358
|
-
return /* @__PURE__ */
|
|
4359
|
-
/* @__PURE__ */
|
|
4360
|
-
backHref && !onBack ? /* @__PURE__ */
|
|
4655
|
+
return /* @__PURE__ */ jsxs68("header", { className: cx("agn-builder", className), ...rest, children: [
|
|
4656
|
+
/* @__PURE__ */ jsxs68("div", { className: "agn-builder__left", children: [
|
|
4657
|
+
backHref && !onBack ? /* @__PURE__ */ jsx75("a", { className: "agn-btn agn-btn--icon agn-btn--ghost", href: backHref, "aria-label": l.back, title: l.back, children: /* @__PURE__ */ jsx75(Icon, { name: "arrow-left", size: 16 }) }) : onBack && /* @__PURE__ */ jsx75(ButtonIcon, { icon: "arrow-left", label: l.back, onClick: onBack }),
|
|
4361
4658
|
left,
|
|
4362
|
-
/* @__PURE__ */
|
|
4363
|
-
/* @__PURE__ */
|
|
4364
|
-
onRename && /* @__PURE__ */
|
|
4659
|
+
/* @__PURE__ */ jsxs68("div", { className: "agn-builder__name-wrap", children: [
|
|
4660
|
+
/* @__PURE__ */ jsx75("span", { className: "agn-builder__name", children: name }),
|
|
4661
|
+
onRename && /* @__PURE__ */ jsx75(ButtonIcon, { icon: "pencil", label: l.rename, size: "xs", onClick: onRename, className: "agn-builder__rename" })
|
|
4365
4662
|
] }),
|
|
4366
|
-
version && /* @__PURE__ */
|
|
4367
|
-
st && /* @__PURE__ */
|
|
4368
|
-
draft && /* @__PURE__ */
|
|
4369
|
-
/* @__PURE__ */
|
|
4663
|
+
version && /* @__PURE__ */ jsx75(Tag, { children: version }),
|
|
4664
|
+
st && /* @__PURE__ */ jsx75(Tag, { tone: st.tone || "neutral", dot: st.dot, icon: st.icon, children: st.label }),
|
|
4665
|
+
draft && /* @__PURE__ */ jsxs68("span", { className: "agn-builder__draft", children: [
|
|
4666
|
+
/* @__PURE__ */ jsx75(Icon, { name: "circle-dashed", size: 12 }),
|
|
4370
4667
|
typeof draft === "string" ? draft : l.draft
|
|
4371
4668
|
] })
|
|
4372
4669
|
] }),
|
|
4373
|
-
/* @__PURE__ */
|
|
4374
|
-
(saving || saved) && /* @__PURE__ */
|
|
4375
|
-
/* @__PURE__ */
|
|
4670
|
+
/* @__PURE__ */ jsxs68("div", { className: "agn-builder__right", children: [
|
|
4671
|
+
(saving || saved) && /* @__PURE__ */ jsx75("span", { className: "agn-builder__save", role: "status", children: saving ? /* @__PURE__ */ jsxs68(Fragment11, { children: [
|
|
4672
|
+
/* @__PURE__ */ jsx75(Icon, { name: "loader-circle", size: 12, className: "agn-builder__spin" }),
|
|
4376
4673
|
l.saving
|
|
4377
|
-
] }) : /* @__PURE__ */
|
|
4378
|
-
/* @__PURE__ */
|
|
4674
|
+
] }) : /* @__PURE__ */ jsxs68(Fragment11, { children: [
|
|
4675
|
+
/* @__PURE__ */ jsx75(Icon, { name: "check", size: 12 }),
|
|
4379
4676
|
l.saved
|
|
4380
4677
|
] }) }),
|
|
4381
4678
|
actions,
|
|
4382
|
-
onVersions && /* @__PURE__ */
|
|
4383
|
-
onDeploy && /* @__PURE__ */
|
|
4679
|
+
onVersions && /* @__PURE__ */ jsx75(Button, { variant: "ghost", icon: "history", onClick: onVersions, children: l.versions }),
|
|
4680
|
+
onDeploy && /* @__PURE__ */ jsx75(Button, { variant: "primary", icon: "rocket", onClick: onDeploy, disabled: deployDisabled, loading: deploying, children: l.deploy })
|
|
4384
4681
|
] })
|
|
4385
4682
|
] });
|
|
4386
4683
|
}
|
|
4387
4684
|
|
|
4388
4685
|
// src/navigation/BrandBand.jsx
|
|
4389
|
-
import
|
|
4390
|
-
import { jsx as
|
|
4686
|
+
import React78 from "react";
|
|
4687
|
+
import { jsx as jsx76, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
4391
4688
|
function BrandBand({ height = "md", glow = "top-right", align = "start", as: Comp = "section", children, className, style, ...rest }) {
|
|
4392
4689
|
const named = { sm: "160px", md: "280px", lg: "420px", full: "100vh" };
|
|
4393
4690
|
const h = named[height] || height;
|
|
4394
|
-
return /* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4396
|
-
/* @__PURE__ */
|
|
4691
|
+
return /* @__PURE__ */ jsx76(Comp, { className: cx("agn-band", "agn-band--glow-" + glow, "agn-band--align-" + align, className), style: { minHeight: h, ...style }, ...rest, children: /* @__PURE__ */ jsxs69(Room, { padding: "none", className: "agn-band__room", children: [
|
|
4692
|
+
/* @__PURE__ */ jsx76("div", { className: "agn-band__glow", "aria-hidden": "true" }),
|
|
4693
|
+
/* @__PURE__ */ jsx76("div", { className: "agn-band__content", children })
|
|
4397
4694
|
] }) });
|
|
4398
4695
|
}
|
|
4399
4696
|
|
|
4400
4697
|
// src/navigation/Accordion.jsx
|
|
4401
|
-
import
|
|
4402
|
-
import { jsx as
|
|
4698
|
+
import React79, { useState as useState12, useMemo as useMemo3 } from "react";
|
|
4699
|
+
import { jsx as jsx77, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
4403
4700
|
function Accordion({ items = [], multiple, defaultOpen, open, onChange, boxed, className, ...rest }) {
|
|
4404
4701
|
const [local, setLocal] = useState12(() => new Set(defaultOpen || []));
|
|
4405
4702
|
const cur = open ? new Set(open) : local;
|
|
@@ -4412,19 +4709,19 @@ function Accordion({ items = [], multiple, defaultOpen, open, onChange, boxed, c
|
|
|
4412
4709
|
if (!open) setLocal(n);
|
|
4413
4710
|
onChange && onChange(Array.from(n));
|
|
4414
4711
|
};
|
|
4415
|
-
return /* @__PURE__ */
|
|
4712
|
+
return /* @__PURE__ */ jsx77("div", { className: cx("agn-accordion", boxed && "agn-accordion--boxed", className), ...rest, children: items.map((it) => {
|
|
4416
4713
|
const isOpen = cur.has(it.id);
|
|
4417
|
-
return /* @__PURE__ */
|
|
4418
|
-
/* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4420
|
-
/* @__PURE__ */
|
|
4421
|
-
it.icon && /* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4423
|
-
it.meta && /* @__PURE__ */
|
|
4714
|
+
return /* @__PURE__ */ jsxs70("div", { className: cx("agn-accordion__item", isOpen && "agn-accordion__item--open"), children: [
|
|
4715
|
+
/* @__PURE__ */ jsxs70("h3", { className: "agn-accordion__heading", children: [
|
|
4716
|
+
/* @__PURE__ */ jsxs70("button", { type: "button", id: id + "-" + it.id + "-h", className: "agn-accordion__trigger agn-focus-inset", "aria-expanded": isOpen, "aria-controls": id + "-" + it.id + "-p", onClick: () => toggle(it.id), disabled: it.disabled, children: [
|
|
4717
|
+
/* @__PURE__ */ jsx77(Icon, { name: "chevron-right", size: 14, className: cx("agn-accordion__chev", isOpen && "agn-accordion__chev--open") }),
|
|
4718
|
+
it.icon && /* @__PURE__ */ jsx77(Icon, { name: it.icon, size: 16, className: "agn-accordion__icon" }),
|
|
4719
|
+
/* @__PURE__ */ jsx77("span", { className: "agn-accordion__label", children: it.label }),
|
|
4720
|
+
it.meta && /* @__PURE__ */ jsx77("span", { className: "agn-accordion__meta", children: it.meta })
|
|
4424
4721
|
] }),
|
|
4425
|
-
it.actions && /* @__PURE__ */
|
|
4722
|
+
it.actions && /* @__PURE__ */ jsx77("span", { className: "agn-accordion__actions", children: it.actions })
|
|
4426
4723
|
] }),
|
|
4427
|
-
/* @__PURE__ */
|
|
4724
|
+
/* @__PURE__ */ jsx77("section", { id: id + "-" + it.id + "-p", "aria-labelledby": id + "-" + it.id + "-h", className: "agn-accordion__panel", hidden: !isOpen, children: it.content })
|
|
4428
4725
|
] }, it.id);
|
|
4429
4726
|
}) });
|
|
4430
4727
|
}
|
|
@@ -4436,25 +4733,25 @@ function ExpandableSection({ title, open, defaultOpen = true, onToggle, actions,
|
|
|
4436
4733
|
if (open === void 0) setLocal(!isOpen);
|
|
4437
4734
|
onToggle && onToggle(!isOpen);
|
|
4438
4735
|
};
|
|
4439
|
-
return /* @__PURE__ */
|
|
4440
|
-
/* @__PURE__ */
|
|
4441
|
-
/* @__PURE__ */
|
|
4442
|
-
/* @__PURE__ */
|
|
4443
|
-
/* @__PURE__ */
|
|
4444
|
-
count != null && /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsxs70("section", { className: cx("agn-xsection", isOpen && "agn-xsection--open", className), ...rest, children: [
|
|
4737
|
+
/* @__PURE__ */ jsxs70("h3", { className: "agn-xsection__heading", children: [
|
|
4738
|
+
/* @__PURE__ */ jsxs70("button", { type: "button", id: id + "-h", className: "agn-xsection__trigger agn-focus", "aria-expanded": isOpen, "aria-controls": id + "-p", onClick: toggle, children: [
|
|
4739
|
+
/* @__PURE__ */ jsx77(Icon, { name: "chevron-right", size: 14, className: cx("agn-accordion__chev", isOpen && "agn-accordion__chev--open") }),
|
|
4740
|
+
/* @__PURE__ */ jsx77("span", { className: "agn-xsection__title", children: title }),
|
|
4741
|
+
count != null && /* @__PURE__ */ jsx77("span", { className: "agn-xsection__count agn-num", children: count })
|
|
4445
4742
|
] }),
|
|
4446
|
-
actions && /* @__PURE__ */
|
|
4743
|
+
actions && /* @__PURE__ */ jsx77("span", { className: "agn-xsection__actions", children: actions })
|
|
4447
4744
|
] }),
|
|
4448
|
-
/* @__PURE__ */
|
|
4745
|
+
/* @__PURE__ */ jsx77("section", { id: id + "-p", "aria-labelledby": id + "-h", className: "agn-xsection__panel", hidden: !isOpen, children })
|
|
4449
4746
|
] });
|
|
4450
4747
|
}
|
|
4451
4748
|
|
|
4452
4749
|
// src/navigation/Carousel.jsx
|
|
4453
|
-
import
|
|
4454
|
-
import { jsx as
|
|
4455
|
-
var
|
|
4750
|
+
import React80, { useState as useState13, useEffect as useEffect4, useRef as useRef6 } from "react";
|
|
4751
|
+
import { jsx as jsx78, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
4752
|
+
var DEFAULT_LABELS44 = { prev: "Previous", next: "Next", goTo: "Go to slide", of: "of" };
|
|
4456
4753
|
function Carousel({ slides = [], index, defaultIndex = 0, onChange, autoPlay, interval = 6e3, loop = true, labels, className, ...rest }) {
|
|
4457
|
-
const l = { ...
|
|
4754
|
+
const l = { ...DEFAULT_LABELS44, ...labels };
|
|
4458
4755
|
const [local, setLocal] = useState13(defaultIndex);
|
|
4459
4756
|
const cur = index !== void 0 ? index : local;
|
|
4460
4757
|
const [paused, setPaused] = useState13(false);
|
|
@@ -4474,7 +4771,7 @@ function Carousel({ slides = [], index, defaultIndex = 0, onChange, autoPlay, in
|
|
|
4474
4771
|
const s = slides[cur];
|
|
4475
4772
|
return (
|
|
4476
4773
|
// biome-ignore lint/a11y/useSemanticElements: APG carousel: role=region with aria-roledescription; the consumer names it through rest, and the tag is kept so existing refs and selectors hold
|
|
4477
|
-
/* @__PURE__ */
|
|
4774
|
+
/* @__PURE__ */ jsxs71("div", { ref, className: cx("agn-carousel", className), role: "region", "aria-roledescription": "carousel", onMouseEnter: () => setPaused(true), onMouseLeave: () => setPaused(false), onFocus: () => setPaused(true), onBlur: () => setPaused(false), onKeyDown: (e) => {
|
|
4478
4775
|
if (e.key === "ArrowRight") {
|
|
4479
4776
|
e.preventDefault();
|
|
4480
4777
|
go(cur + 1);
|
|
@@ -4484,73 +4781,73 @@ function Carousel({ slides = [], index, defaultIndex = 0, onChange, autoPlay, in
|
|
|
4484
4781
|
go(cur - 1);
|
|
4485
4782
|
}
|
|
4486
4783
|
}, ...rest, children: [
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
s.media && /* @__PURE__ */
|
|
4490
|
-
s.icon && !s.media && /* @__PURE__ */
|
|
4491
|
-
/* @__PURE__ */
|
|
4492
|
-
s.eyebrow && /* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
s.description && /* @__PURE__ */
|
|
4495
|
-
s.action && /* @__PURE__ */
|
|
4784
|
+
/* @__PURE__ */ jsx78("div", { className: "agn-carousel__viewport", children: s && // biome-ignore lint/a11y/useSemanticElements: APG carousel: each slide is a group with aria-roledescription=slide
|
|
4785
|
+
/* @__PURE__ */ jsxs71("div", { className: "agn-carousel__slide", role: "group", "aria-roledescription": "slide", "aria-label": cur + 1 + " " + l.of + " " + n, children: [
|
|
4786
|
+
s.media && /* @__PURE__ */ jsx78("div", { className: "agn-carousel__media", children: s.media }),
|
|
4787
|
+
s.icon && !s.media && /* @__PURE__ */ jsx78("div", { className: "agn-carousel__icon", children: /* @__PURE__ */ jsx78(Icon, { name: s.icon, size: 24, strokeWidth: 1.75 }) }),
|
|
4788
|
+
/* @__PURE__ */ jsxs71("div", { className: "agn-carousel__text", children: [
|
|
4789
|
+
s.eyebrow && /* @__PURE__ */ jsx78("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: s.eyebrow }),
|
|
4790
|
+
/* @__PURE__ */ jsx78("div", { className: "agn-carousel__title", children: s.title }),
|
|
4791
|
+
s.description && /* @__PURE__ */ jsx78("div", { className: "agn-carousel__desc", children: s.description }),
|
|
4792
|
+
s.action && /* @__PURE__ */ jsx78("div", { className: "agn-carousel__action", children: s.action })
|
|
4496
4793
|
] })
|
|
4497
4794
|
] }) }),
|
|
4498
|
-
n > 1 && /* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */
|
|
4500
|
-
/* @__PURE__ */
|
|
4501
|
-
/* @__PURE__ */
|
|
4795
|
+
n > 1 && /* @__PURE__ */ jsxs71("div", { className: "agn-carousel__controls", children: [
|
|
4796
|
+
/* @__PURE__ */ jsx78("button", { type: "button", className: "agn-carousel__arrow agn-focus", "aria-label": l.prev, onClick: () => go(cur - 1), disabled: !loop && cur === 0, children: /* @__PURE__ */ jsx78(Icon, { name: "chevron-left", size: 16 }) }),
|
|
4797
|
+
/* @__PURE__ */ jsx78("div", { className: "agn-carousel__dots", role: "tablist", children: slides.map((_, i) => /* @__PURE__ */ jsx78("button", { type: "button", role: "tab", "aria-selected": i === cur, "aria-label": l.goTo + " " + (i + 1), className: cx("agn-carousel__dot", i === cur && "agn-carousel__dot--active"), onClick: () => go(i) }, i)) }),
|
|
4798
|
+
/* @__PURE__ */ jsx78("button", { type: "button", className: "agn-carousel__arrow agn-focus", "aria-label": l.next, onClick: () => go(cur + 1), disabled: !loop && cur === n - 1, children: /* @__PURE__ */ jsx78(Icon, { name: "chevron-right", size: 16 }) })
|
|
4502
4799
|
] })
|
|
4503
4800
|
] })
|
|
4504
4801
|
);
|
|
4505
4802
|
}
|
|
4506
4803
|
|
|
4507
4804
|
// src/navigation/SetupAssistant.jsx
|
|
4508
|
-
import
|
|
4509
|
-
import { jsx as
|
|
4510
|
-
var
|
|
4805
|
+
import React81 from "react";
|
|
4806
|
+
import { jsx as jsx79, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
4807
|
+
var DEFAULT_LABELS45 = { progress: "completed", done: "Done", optional: "optional" };
|
|
4511
4808
|
function SetupAssistant({ title, description, steps = [], bare, labels, className, ...rest }) {
|
|
4512
|
-
const l = { ...
|
|
4809
|
+
const l = { ...DEFAULT_LABELS45, ...labels };
|
|
4513
4810
|
const done = steps.filter((s) => s.done).length;
|
|
4514
4811
|
const pct2 = steps.length ? Math.round(done / steps.length * 100) : 0;
|
|
4515
4812
|
const nextIdx = steps.findIndex((s) => !s.done);
|
|
4516
|
-
return /* @__PURE__ */
|
|
4517
|
-
/* @__PURE__ */
|
|
4518
|
-
(title || description) && /* @__PURE__ */
|
|
4519
|
-
title && /* @__PURE__ */
|
|
4520
|
-
description && /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsxs72("section", { className: cx("agn-setup", bare && "agn-setup--bare", !title && !description && "agn-setup--untitled", className), ...rest, children: [
|
|
4814
|
+
/* @__PURE__ */ jsxs72("header", { className: "agn-setup__head", children: [
|
|
4815
|
+
(title || description) && /* @__PURE__ */ jsxs72("div", { className: "agn-setup__text", children: [
|
|
4816
|
+
title && /* @__PURE__ */ jsx79("h2", { className: "agn-setup__title", children: title }),
|
|
4817
|
+
description && /* @__PURE__ */ jsx79("p", { className: "agn-setup__desc", children: description })
|
|
4521
4818
|
] }),
|
|
4522
|
-
/* @__PURE__ */
|
|
4523
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsxs72("div", { className: "agn-setup__progress", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": steps.length, "aria-valuenow": done, "aria-valuetext": done + " / " + steps.length + " " + l.progress, children: [
|
|
4820
|
+
/* @__PURE__ */ jsxs72("span", { className: "agn-setup__progress-text agn-num", children: [
|
|
4524
4821
|
done,
|
|
4525
4822
|
"/",
|
|
4526
4823
|
steps.length,
|
|
4527
4824
|
" ",
|
|
4528
4825
|
l.progress
|
|
4529
4826
|
] }),
|
|
4530
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ jsx79("span", { className: "agn-setup__bar", children: /* @__PURE__ */ jsx79("span", { className: "agn-setup__fill", style: { width: pct2 + "%" } }) })
|
|
4531
4828
|
] })
|
|
4532
4829
|
] }),
|
|
4533
|
-
/* @__PURE__ */
|
|
4830
|
+
/* @__PURE__ */ jsx79("ol", { className: "agn-setup__steps", children: steps.map((s, i) => {
|
|
4534
4831
|
const isNext = i === nextIdx;
|
|
4535
|
-
return /* @__PURE__ */
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
/* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4832
|
+
return /* @__PURE__ */ jsxs72("li", { className: cx("agn-setup__step", s.done && "agn-setup__step--done", isNext && "agn-setup__step--next"), children: [
|
|
4833
|
+
/* @__PURE__ */ jsx79("span", { className: "agn-setup__marker agn-num", "aria-hidden": "true", children: s.done ? /* @__PURE__ */ jsx79(Icon, { name: "check", size: 14 }) : i + 1 }),
|
|
4834
|
+
/* @__PURE__ */ jsxs72("div", { className: "agn-setup__body", children: [
|
|
4835
|
+
/* @__PURE__ */ jsxs72("div", { className: "agn-setup__step-title", children: [
|
|
4539
4836
|
s.title,
|
|
4540
|
-
s.optional && /* @__PURE__ */
|
|
4541
|
-
s.done && /* @__PURE__ */
|
|
4837
|
+
s.optional && /* @__PURE__ */ jsx79("span", { className: "agn-setup__optional", children: l.optional }),
|
|
4838
|
+
s.done && /* @__PURE__ */ jsxs72("span", { className: "agn-sr", children: [
|
|
4542
4839
|
" \u2014 ",
|
|
4543
4840
|
l.done
|
|
4544
4841
|
] })
|
|
4545
4842
|
] }),
|
|
4546
|
-
s.description && /* @__PURE__ */
|
|
4843
|
+
s.description && /* @__PURE__ */ jsx79("div", { className: "agn-setup__step-desc", children: s.description })
|
|
4547
4844
|
] }),
|
|
4548
|
-
/* @__PURE__ */
|
|
4549
|
-
s.time && !s.done && /* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4845
|
+
/* @__PURE__ */ jsxs72("div", { className: "agn-setup__side", children: [
|
|
4846
|
+
s.time && !s.done && /* @__PURE__ */ jsxs72("span", { className: "agn-setup__time", children: [
|
|
4847
|
+
/* @__PURE__ */ jsx79(Icon, { name: "clock", size: 12 }),
|
|
4551
4848
|
s.time
|
|
4552
4849
|
] }),
|
|
4553
|
-
!s.done && s.action && (typeof s.action === "string" ? /* @__PURE__ */
|
|
4850
|
+
!s.done && s.action && (typeof s.action === "string" ? /* @__PURE__ */ jsx79(Button, { size: "sm", variant: isNext ? "primary" : "neutral", onClick: s.onAction, href: s.href, as: s.href ? "a" : "button", children: s.action }) : s.action)
|
|
4554
4851
|
] })
|
|
4555
4852
|
] }, s.id || i);
|
|
4556
4853
|
}) })
|
|
@@ -4558,19 +4855,19 @@ function SetupAssistant({ title, description, steps = [], bare, labels, classNam
|
|
|
4558
4855
|
}
|
|
4559
4856
|
|
|
4560
4857
|
// src/navigation/WelcomeMat.jsx
|
|
4561
|
-
import
|
|
4562
|
-
import { jsx as
|
|
4563
|
-
var
|
|
4858
|
+
import React82, { useMemo as useMemo4 } from "react";
|
|
4859
|
+
import { jsx as jsx80, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
4860
|
+
var DEFAULT_LABELS46 = { done: "done", skip: "Skip for now", progress: "completed" };
|
|
4564
4861
|
function WelcomeMat({ title, subtitle, steps = [], onStep, footer, onSkip, brand, labels, className, ...rest }) {
|
|
4565
|
-
const l = { ...
|
|
4862
|
+
const l = { ...DEFAULT_LABELS46, ...labels };
|
|
4566
4863
|
const done = steps.filter((s) => s.done).length;
|
|
4567
4864
|
const titleId = useMemo4(() => uid("agn-welcome"), []);
|
|
4568
|
-
return /* @__PURE__ */
|
|
4569
|
-
/* @__PURE__ */
|
|
4570
|
-
brand || /* @__PURE__ */
|
|
4571
|
-
/* @__PURE__ */
|
|
4572
|
-
subtitle && /* @__PURE__ */
|
|
4573
|
-
steps.length > 0 && /* @__PURE__ */
|
|
4865
|
+
return /* @__PURE__ */ jsxs73("section", { className: cx("agn-welcome", className), "aria-labelledby": titleId, ...rest, children: [
|
|
4866
|
+
/* @__PURE__ */ jsxs73("div", { className: "agn-welcome__brand", children: [
|
|
4867
|
+
brand || /* @__PURE__ */ jsx80(AginiesMark, { size: 40, decorative: true }),
|
|
4868
|
+
/* @__PURE__ */ jsx80("h2", { id: titleId, className: "agn-welcome__title", children: title }),
|
|
4869
|
+
subtitle && /* @__PURE__ */ jsx80("p", { className: "agn-welcome__subtitle", children: subtitle }),
|
|
4870
|
+
steps.length > 0 && /* @__PURE__ */ jsxs73("div", { className: "agn-welcome__progress agn-num", children: [
|
|
4574
4871
|
done,
|
|
4575
4872
|
"/",
|
|
4576
4873
|
steps.length,
|
|
@@ -4578,76 +4875,76 @@ function WelcomeMat({ title, subtitle, steps = [], onStep, footer, onSkip, brand
|
|
|
4578
4875
|
l.progress
|
|
4579
4876
|
] })
|
|
4580
4877
|
] }),
|
|
4581
|
-
/* @__PURE__ */
|
|
4582
|
-
/* @__PURE__ */
|
|
4878
|
+
/* @__PURE__ */ jsxs73("div", { className: "agn-welcome__steps", children: [
|
|
4879
|
+
/* @__PURE__ */ jsx80("ol", { className: "agn-welcome__list", children: steps.map((s, i) => {
|
|
4583
4880
|
const Comp = onStep && !s.done ? "button" : "div";
|
|
4584
|
-
return /* @__PURE__ */
|
|
4585
|
-
/* @__PURE__ */
|
|
4586
|
-
/* @__PURE__ */
|
|
4587
|
-
/* @__PURE__ */
|
|
4881
|
+
return /* @__PURE__ */ jsx80("li", { children: /* @__PURE__ */ jsxs73(Comp, { type: Comp === "button" ? "button" : void 0, className: cx("agn-welcome__step", s.done && "agn-welcome__step--done", Comp === "button" && "agn-focus"), onClick: Comp === "button" ? () => onStep(s, i) : void 0, children: [
|
|
4882
|
+
/* @__PURE__ */ jsx80("span", { className: cx("agn-welcome__icon", s.done && "agn-welcome__icon--done"), children: /* @__PURE__ */ jsx80(Icon, { name: s.done ? "check" : s.icon || "circle", size: 16 }) }),
|
|
4883
|
+
/* @__PURE__ */ jsxs73("span", { className: "agn-welcome__text", children: [
|
|
4884
|
+
/* @__PURE__ */ jsxs73("span", { className: "agn-welcome__step-title", children: [
|
|
4588
4885
|
s.title,
|
|
4589
|
-
s.done && /* @__PURE__ */
|
|
4886
|
+
s.done && /* @__PURE__ */ jsxs73("span", { className: "agn-sr", children: [
|
|
4590
4887
|
", ",
|
|
4591
4888
|
l.done
|
|
4592
4889
|
] })
|
|
4593
4890
|
] }),
|
|
4594
|
-
s.description && /* @__PURE__ */
|
|
4891
|
+
s.description && /* @__PURE__ */ jsx80("span", { className: "agn-welcome__step-desc", children: s.description })
|
|
4595
4892
|
] }),
|
|
4596
|
-
Comp === "button" && /* @__PURE__ */
|
|
4893
|
+
Comp === "button" && /* @__PURE__ */ jsx80(Icon, { name: "arrow-right", size: 14, className: "agn-welcome__arrow" })
|
|
4597
4894
|
] }) }, s.id || i);
|
|
4598
4895
|
}) }),
|
|
4599
|
-
(footer || onSkip) && /* @__PURE__ */
|
|
4896
|
+
(footer || onSkip) && /* @__PURE__ */ jsxs73("div", { className: "agn-welcome__footer", children: [
|
|
4600
4897
|
footer,
|
|
4601
|
-
onSkip && /* @__PURE__ */
|
|
4898
|
+
onSkip && /* @__PURE__ */ jsx80("button", { type: "button", className: "agn-btn agn-btn--link agn-focus", onClick: onSkip, children: l.skip })
|
|
4602
4899
|
] })
|
|
4603
4900
|
] })
|
|
4604
4901
|
] });
|
|
4605
4902
|
}
|
|
4606
4903
|
|
|
4607
4904
|
// src/navigation/MobileTabBar.jsx
|
|
4608
|
-
import
|
|
4609
|
-
import { jsx as
|
|
4610
|
-
var
|
|
4905
|
+
import React83 from "react";
|
|
4906
|
+
import { jsx as jsx81, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
4907
|
+
var DEFAULT_LABELS47 = { navigation: "Main navigation" };
|
|
4611
4908
|
function MobileTabBar({ items = [], active, onChange, labels, className, ...rest }) {
|
|
4612
|
-
const l = { ...
|
|
4909
|
+
const l = { ...DEFAULT_LABELS47, ...labels };
|
|
4613
4910
|
const list = items.slice(0, 5);
|
|
4614
|
-
return /* @__PURE__ */
|
|
4911
|
+
return /* @__PURE__ */ jsx81("nav", { className: cx("agn-tabbar", className), "aria-label": l.navigation, ...rest, children: list.map((it) => {
|
|
4615
4912
|
const sel = it.id === active;
|
|
4616
4913
|
const Comp = it.href ? "a" : "button";
|
|
4617
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ jsxs74(Comp, { href: it.href, type: Comp === "button" ? "button" : void 0, className: cx("agn-tabbar__item", "agn-focus-inset", sel && "agn-tabbar__item--active"), "aria-current": sel ? "page" : void 0, onClick: (e) => {
|
|
4618
4915
|
if (onChange) {
|
|
4619
4916
|
if (!it.href) e.preventDefault();
|
|
4620
4917
|
onChange(it.id, it);
|
|
4621
4918
|
}
|
|
4622
4919
|
}, children: [
|
|
4623
|
-
/* @__PURE__ */
|
|
4624
|
-
/* @__PURE__ */
|
|
4625
|
-
it.badge != null && /* @__PURE__ */
|
|
4920
|
+
/* @__PURE__ */ jsxs74("span", { className: "agn-tabbar__icon", children: [
|
|
4921
|
+
/* @__PURE__ */ jsx81(Icon, { name: it.icon, size: 20, strokeWidth: sel ? 2.25 : 1.75 }),
|
|
4922
|
+
it.badge != null && /* @__PURE__ */ jsx81(Badge, { tone: "bad", solid: true, size: "sm", count: typeof it.badge === "number" ? it.badge : void 0, className: "agn-tabbar__badge", children: typeof it.badge === "number" ? void 0 : it.badge })
|
|
4626
4923
|
] }),
|
|
4627
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ jsx81("span", { className: "agn-tabbar__label", children: it.label })
|
|
4628
4925
|
] }, it.id);
|
|
4629
4926
|
}) });
|
|
4630
4927
|
}
|
|
4631
4928
|
|
|
4632
4929
|
// src/navigation/Pagination.jsx
|
|
4633
|
-
import
|
|
4634
|
-
import { jsx as
|
|
4635
|
-
var
|
|
4930
|
+
import React84 from "react";
|
|
4931
|
+
import { jsx as jsx82, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
4932
|
+
var DEFAULT_LABELS48 = { of: "of", perPage: "per page", prev: "Previous page", next: "Next page", first: "First page", last: "Last page", page: "Page", pageSize: "Rows per page" };
|
|
4636
4933
|
function Pagination({ page = 1, pageSize = 25, total = 0, onChange, onPageSizeChange, pageSizes = [10, 25, 50, 100], compact, showEdges, locale, labels, className, ...rest }) {
|
|
4637
|
-
const l = { ...
|
|
4934
|
+
const l = { ...DEFAULT_LABELS48, ...labels };
|
|
4638
4935
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
4639
4936
|
const p = Math.min(Math.max(1, page), pages);
|
|
4640
4937
|
const from = total === 0 ? 0 : (p - 1) * pageSize + 1;
|
|
4641
4938
|
const to = Math.min(total, p * pageSize);
|
|
4642
4939
|
const nf = new Intl.NumberFormat(locale || void 0);
|
|
4643
4940
|
const go = (n) => onChange && onChange(Math.min(Math.max(1, n), pages));
|
|
4644
|
-
return /* @__PURE__ */
|
|
4645
|
-
!compact && onPageSizeChange && /* @__PURE__ */
|
|
4646
|
-
/* @__PURE__ */
|
|
4647
|
-
/* @__PURE__ */
|
|
4648
|
-
/* @__PURE__ */
|
|
4941
|
+
return /* @__PURE__ */ jsxs75("nav", { className: cx("agn-pagination", compact && "agn-pagination--compact", className), "aria-label": l.page, ...rest, children: [
|
|
4942
|
+
!compact && onPageSizeChange && /* @__PURE__ */ jsxs75("label", { className: "agn-pagination__size", children: [
|
|
4943
|
+
/* @__PURE__ */ jsx82("span", { className: "agn-sr", children: l.pageSize }),
|
|
4944
|
+
/* @__PURE__ */ jsx82("select", { className: "agn-pagination__select agn-focus", value: pageSize, onChange: (e) => onPageSizeChange(Number(e.target.value)), children: pageSizes.map((s) => /* @__PURE__ */ jsx82("option", { value: s, children: s }, s)) }),
|
|
4945
|
+
/* @__PURE__ */ jsx82("span", { className: "agn-pagination__size-label", children: l.perPage })
|
|
4649
4946
|
] }),
|
|
4650
|
-
/* @__PURE__ */
|
|
4947
|
+
/* @__PURE__ */ jsxs75("span", { className: "agn-pagination__range agn-num", "aria-live": "polite", children: [
|
|
4651
4948
|
nf.format(from),
|
|
4652
4949
|
"\u2013",
|
|
4653
4950
|
nf.format(to),
|
|
@@ -4656,50 +4953,50 @@ function Pagination({ page = 1, pageSize = 25, total = 0, onChange, onPageSizeCh
|
|
|
4656
4953
|
" ",
|
|
4657
4954
|
nf.format(total)
|
|
4658
4955
|
] }),
|
|
4659
|
-
/* @__PURE__ */
|
|
4660
|
-
showEdges && /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
!compact && /* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsxs75("span", { className: "agn-pagination__nav", children: [
|
|
4957
|
+
showEdges && /* @__PURE__ */ jsx82("button", { type: "button", className: "agn-pagination__btn agn-focus", "aria-label": l.first, onClick: () => go(1), disabled: p <= 1, children: /* @__PURE__ */ jsx82(Icon, { name: "chevrons-left", size: 14 }) }),
|
|
4958
|
+
/* @__PURE__ */ jsx82("button", { type: "button", className: "agn-pagination__btn agn-focus", "aria-label": l.prev, onClick: () => go(p - 1), disabled: p <= 1, children: /* @__PURE__ */ jsx82(Icon, { name: "chevron-left", size: 14 }) }),
|
|
4959
|
+
!compact && /* @__PURE__ */ jsxs75("span", { className: "agn-pagination__page agn-num", children: [
|
|
4663
4960
|
nf.format(p),
|
|
4664
4961
|
" / ",
|
|
4665
4962
|
nf.format(pages)
|
|
4666
4963
|
] }),
|
|
4667
|
-
/* @__PURE__ */
|
|
4668
|
-
showEdges && /* @__PURE__ */
|
|
4964
|
+
/* @__PURE__ */ jsx82("button", { type: "button", className: "agn-pagination__btn agn-focus", "aria-label": l.next, onClick: () => go(p + 1), disabled: p >= pages, children: /* @__PURE__ */ jsx82(Icon, { name: "chevron-right", size: 14 }) }),
|
|
4965
|
+
showEdges && /* @__PURE__ */ jsx82("button", { type: "button", className: "agn-pagination__btn agn-focus", "aria-label": l.last, onClick: () => go(pages), disabled: p >= pages, children: /* @__PURE__ */ jsx82(Icon, { name: "chevrons-right", size: 14 }) })
|
|
4669
4966
|
] })
|
|
4670
4967
|
] });
|
|
4671
4968
|
}
|
|
4672
4969
|
|
|
4673
4970
|
// src/navigation/Stepper.jsx
|
|
4674
|
-
import
|
|
4675
|
-
import { jsx as
|
|
4676
|
-
var
|
|
4971
|
+
import React85 from "react";
|
|
4972
|
+
import { jsx as jsx83, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
4973
|
+
var DEFAULT_LABELS49 = { done: "done", current: "in progress", upcoming: "upcoming", error: "failed", step: "Step", of: "of" };
|
|
4677
4974
|
function Stepper({ steps = [], current = 0, vertical, size = "md", errorSteps = [], labels, className, ...rest }) {
|
|
4678
|
-
const l = { ...
|
|
4975
|
+
const l = { ...DEFAULT_LABELS49, ...labels };
|
|
4679
4976
|
const list = steps.map((s) => typeof s === "string" ? { label: s } : s);
|
|
4680
|
-
return /* @__PURE__ */
|
|
4977
|
+
return /* @__PURE__ */ jsx83("ol", { className: cx("agn-stepper", vertical ? "agn-stepper--vertical" : "agn-stepper--horizontal", size !== "md" && "agn-stepper--" + size, className), "aria-label": l.step + " " + (current + 1) + " " + l.of + " " + list.length, ...rest, children: list.map((s, i) => {
|
|
4681
4978
|
const st = errorSteps.includes(i) || s.error ? "error" : i < current ? "done" : i === current ? "current" : "upcoming";
|
|
4682
|
-
return /* @__PURE__ */
|
|
4683
|
-
/* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4685
|
-
/* @__PURE__ */
|
|
4979
|
+
return /* @__PURE__ */ jsxs76("li", { className: cx("agn-stepper__step", "agn-stepper__step--" + st), "aria-current": st === "current" ? "step" : void 0, children: [
|
|
4980
|
+
/* @__PURE__ */ jsx83("span", { className: "agn-stepper__marker", "aria-hidden": "true", children: st === "done" ? /* @__PURE__ */ jsx83(Icon, { name: "check", size: 12 }) : st === "error" ? /* @__PURE__ */ jsx83(Icon, { name: "x", size: 12 }) : st === "current" ? /* @__PURE__ */ jsx83("span", { className: "agn-stepper__pulse" }) : null }),
|
|
4981
|
+
/* @__PURE__ */ jsxs76("span", { className: "agn-stepper__text", children: [
|
|
4982
|
+
/* @__PURE__ */ jsxs76("span", { className: "agn-stepper__label", children: [
|
|
4686
4983
|
s.label,
|
|
4687
|
-
/* @__PURE__ */
|
|
4984
|
+
/* @__PURE__ */ jsxs76("span", { className: "agn-sr", children: [
|
|
4688
4985
|
", ",
|
|
4689
4986
|
l[st]
|
|
4690
4987
|
] })
|
|
4691
4988
|
] }),
|
|
4692
|
-
s.description && /* @__PURE__ */
|
|
4693
|
-
s.meta && /* @__PURE__ */
|
|
4989
|
+
s.description && /* @__PURE__ */ jsx83("span", { className: "agn-stepper__desc", children: s.description }),
|
|
4990
|
+
s.meta && /* @__PURE__ */ jsx83("span", { className: "agn-stepper__meta", children: s.meta })
|
|
4694
4991
|
] }),
|
|
4695
|
-
i < list.length - 1 && /* @__PURE__ */
|
|
4992
|
+
i < list.length - 1 && /* @__PURE__ */ jsx83("span", { className: "agn-stepper__line", "aria-hidden": "true" })
|
|
4696
4993
|
] }, i);
|
|
4697
4994
|
}) });
|
|
4698
4995
|
}
|
|
4699
4996
|
|
|
4700
4997
|
// src/feedback/AginiesLoader.jsx
|
|
4701
|
-
import
|
|
4702
|
-
import { jsx as
|
|
4998
|
+
import React86 from "react";
|
|
4999
|
+
import { jsx as jsx84, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
4703
5000
|
var SIZE = { page: 96, region: 40, inline: 16 };
|
|
4704
5001
|
function AginiesLoader({ tier = "region", variant = "orbit", label, showLabel, labels, className, ...rest }) {
|
|
4705
5002
|
const L = { loading: "Loading", ...labels };
|
|
@@ -4708,23 +5005,23 @@ function AginiesLoader({ tier = "region", variant = "orbit", label, showLabel, l
|
|
|
4708
5005
|
const visible = showLabel != null ? showLabel : tier === "page";
|
|
4709
5006
|
return (
|
|
4710
5007
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
4711
|
-
/* @__PURE__ */
|
|
4712
|
-
/* @__PURE__ */
|
|
4713
|
-
tier === "page" && /* @__PURE__ */
|
|
4714
|
-
visible ? /* @__PURE__ */
|
|
5008
|
+
/* @__PURE__ */ jsxs77(Tag2, { className: cx("agn-loader", "agn-loader--" + tier, "agn-loader--" + variant, className), role: "status", "aria-busy": "true", "aria-live": "polite", ...rest, children: [
|
|
5009
|
+
/* @__PURE__ */ jsx84("span", { className: "agn-loader__mark", children: /* @__PURE__ */ jsx84(AginiesMark, { size: SIZE[tier] || SIZE.region, decorative: true }) }),
|
|
5010
|
+
tier === "page" && /* @__PURE__ */ jsx84("span", { className: "agn-loader__word", children: "Aginies" }),
|
|
5011
|
+
visible ? /* @__PURE__ */ jsx84("span", { className: "agn-loader__label", children: text }) : /* @__PURE__ */ jsx84("span", { className: "agn-sr", children: text })
|
|
4715
5012
|
] })
|
|
4716
5013
|
);
|
|
4717
5014
|
}
|
|
4718
5015
|
|
|
4719
5016
|
// src/feedback/Skeleton.jsx
|
|
4720
|
-
import
|
|
4721
|
-
import { jsx as
|
|
4722
|
-
var
|
|
5017
|
+
import React87 from "react";
|
|
5018
|
+
import { jsx as jsx85, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
5019
|
+
var WIDTHS2 = ["72%", "48%", "60%", "36%", "82%", "54%"];
|
|
4723
5020
|
function Skeleton({ shape = "text", lines = 3, width, height, className, style, ...rest }) {
|
|
4724
5021
|
if (shape === "text") {
|
|
4725
|
-
return /* @__PURE__ */
|
|
5022
|
+
return /* @__PURE__ */ jsx85("div", { className: cx("agn-skeleton-text", className), style: { width, ...style }, "aria-hidden": "true", ...rest, children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx85("span", { className: "agn-skeleton agn-skeleton--line", style: lines > 1 && i === lines - 1 ? { width: "62%" } : void 0 }, i)) });
|
|
4726
5023
|
}
|
|
4727
|
-
return /* @__PURE__ */
|
|
5024
|
+
return /* @__PURE__ */ jsx85("span", { className: cx("agn-skeleton", "agn-skeleton--" + shape, className), style: { width, height, ...style }, "aria-hidden": "true", ...rest });
|
|
4728
5025
|
}
|
|
4729
5026
|
function PageSkeleton({ header = true, rows = 6, columns = 4, labels, className, ...rest }) {
|
|
4730
5027
|
const L = { loading: "Loading page", ...labels };
|
|
@@ -4732,96 +5029,96 @@ function PageSkeleton({ header = true, rows = 6, columns = 4, labels, className,
|
|
|
4732
5029
|
const grid = { gridTemplateColumns: cols.map((i) => i === 0 ? "2fr" : "1fr").join(" ") };
|
|
4733
5030
|
return (
|
|
4734
5031
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
4735
|
-
/* @__PURE__ */
|
|
4736
|
-
/* @__PURE__ */
|
|
4737
|
-
header && /* @__PURE__ */
|
|
4738
|
-
/* @__PURE__ */
|
|
4739
|
-
/* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ jsxs78("div", { className: cx("agn-page-skeleton", className), role: "status", "aria-busy": "true", ...rest, children: [
|
|
5033
|
+
/* @__PURE__ */ jsx85("span", { className: "agn-sr", children: L.loading }),
|
|
5034
|
+
header && /* @__PURE__ */ jsxs78("div", { className: "agn-page-skeleton__header", "aria-hidden": "true", children: [
|
|
5035
|
+
/* @__PURE__ */ jsxs78("div", { children: [
|
|
5036
|
+
/* @__PURE__ */ jsx85(Skeleton, { shape: "line", width: 88, height: 8 }),
|
|
5037
|
+
/* @__PURE__ */ jsx85(Skeleton, { shape: "rect", width: 236, height: 22, style: { marginTop: 10 } })
|
|
4741
5038
|
] }),
|
|
4742
|
-
/* @__PURE__ */
|
|
5039
|
+
/* @__PURE__ */ jsx85(Skeleton, { shape: "rect", width: 108, height: "var(--control-h)" })
|
|
4743
5040
|
] }),
|
|
4744
|
-
/* @__PURE__ */
|
|
4745
|
-
/* @__PURE__ */
|
|
4746
|
-
Array.from({ length: rows }, (_, r) => /* @__PURE__ */
|
|
5041
|
+
/* @__PURE__ */ jsxs78("div", { className: "agn-page-skeleton__table", "aria-hidden": "true", children: [
|
|
5042
|
+
/* @__PURE__ */ jsx85("div", { className: "agn-page-skeleton__row agn-page-skeleton__row--head", style: grid, children: cols.map((c) => /* @__PURE__ */ jsx85(Skeleton, { shape: "line", width: "46%", height: 8 }, c)) }),
|
|
5043
|
+
Array.from({ length: rows }, (_, r) => /* @__PURE__ */ jsx85("div", { className: "agn-page-skeleton__row", style: grid, children: cols.map((c) => /* @__PURE__ */ jsx85(Skeleton, { shape: "line", width: WIDTHS2[(r + c) % WIDTHS2.length] }, c)) }, r))
|
|
4747
5044
|
] })
|
|
4748
5045
|
] })
|
|
4749
5046
|
);
|
|
4750
5047
|
}
|
|
4751
5048
|
|
|
4752
5049
|
// src/feedback/Alert.jsx
|
|
4753
|
-
import
|
|
4754
|
-
import { jsx as
|
|
5050
|
+
import React88 from "react";
|
|
5051
|
+
import { jsx as jsx86, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
4755
5052
|
var TONE_ICON = { info: "info", ok: "circle-check", warn: "triangle-alert", bad: "circle-alert", neutral: "info", signal: "info" };
|
|
4756
5053
|
function Alert({ tone = "info", icon, title, children, actions, onDismiss, labels, className, ...rest }) {
|
|
4757
5054
|
const L = { dismiss: "Dismiss", ...labels };
|
|
4758
|
-
return /* @__PURE__ */
|
|
4759
|
-
/* @__PURE__ */
|
|
4760
|
-
/* @__PURE__ */
|
|
4761
|
-
title && /* @__PURE__ */
|
|
4762
|
-
children != null && /* @__PURE__ */
|
|
4763
|
-
actions && /* @__PURE__ */
|
|
5055
|
+
return /* @__PURE__ */ jsxs79("div", { className: cx("agn-alert", "agn-alert--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
|
|
5056
|
+
/* @__PURE__ */ jsx86(Icon, { name: icon || TONE_ICON[tone] || "info", size: 16, className: "agn-alert__icon" }),
|
|
5057
|
+
/* @__PURE__ */ jsxs79("div", { className: "agn-alert__body", children: [
|
|
5058
|
+
title && /* @__PURE__ */ jsx86("div", { className: "agn-alert__title", children: title }),
|
|
5059
|
+
children != null && /* @__PURE__ */ jsx86("div", { className: "agn-alert__text", children }),
|
|
5060
|
+
actions && /* @__PURE__ */ jsx86("div", { className: "agn-alert__actions", children: actions })
|
|
4764
5061
|
] }),
|
|
4765
|
-
onDismiss && /* @__PURE__ */
|
|
5062
|
+
onDismiss && /* @__PURE__ */ jsx86(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-alert__close" })
|
|
4766
5063
|
] });
|
|
4767
5064
|
}
|
|
4768
5065
|
|
|
4769
5066
|
// src/feedback/Toast.jsx
|
|
4770
|
-
import
|
|
4771
|
-
import { jsx as
|
|
5067
|
+
import React89 from "react";
|
|
5068
|
+
import { jsx as jsx87, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
4772
5069
|
function Toast({ tone = "ok", title, children, action, onDismiss, duration, labels, className, ...rest }) {
|
|
4773
5070
|
const L = { dismiss: "Dismiss", ...labels };
|
|
4774
|
-
|
|
5071
|
+
React89.useEffect(() => {
|
|
4775
5072
|
if (!duration || !onDismiss) return;
|
|
4776
5073
|
const t = setTimeout(onDismiss, duration);
|
|
4777
5074
|
return () => clearTimeout(t);
|
|
4778
5075
|
}, [duration, onDismiss]);
|
|
4779
|
-
return /* @__PURE__ */
|
|
4780
|
-
/* @__PURE__ */
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
title && /* @__PURE__ */
|
|
4783
|
-
children != null && /* @__PURE__ */
|
|
4784
|
-
action && /* @__PURE__ */
|
|
5076
|
+
return /* @__PURE__ */ jsxs80("div", { className: cx("agn-toast", "agn-toast--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
|
|
5077
|
+
/* @__PURE__ */ jsx87(Icon, { name: TONE_ICON[tone] || "info", size: 16, className: "agn-toast__icon" }),
|
|
5078
|
+
/* @__PURE__ */ jsxs80("div", { className: "agn-toast__body", children: [
|
|
5079
|
+
title && /* @__PURE__ */ jsx87("div", { className: "agn-toast__title", children: title }),
|
|
5080
|
+
children != null && /* @__PURE__ */ jsx87("div", { className: "agn-toast__text", children }),
|
|
5081
|
+
action && /* @__PURE__ */ jsx87("div", { className: "agn-toast__action", children: action })
|
|
4785
5082
|
] }),
|
|
4786
|
-
onDismiss && /* @__PURE__ */
|
|
5083
|
+
onDismiss && /* @__PURE__ */ jsx87(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-toast__close" })
|
|
4787
5084
|
] });
|
|
4788
5085
|
}
|
|
4789
5086
|
function ToastContainer({ position = "bottom-right", static: isStatic, contained, children, className, ...rest }) {
|
|
4790
5087
|
const st = isStatic || position === "static";
|
|
4791
|
-
return /* @__PURE__ */
|
|
5088
|
+
return /* @__PURE__ */ jsx87("div", { className: cx("agn-toasts", !st && "agn-toasts--" + position, st && "agn-toasts--static", contained && !st && "agn-toasts--contained", className), "aria-live": "polite", ...rest, children });
|
|
4792
5089
|
}
|
|
4793
5090
|
function useToasts({ duration = 5e3, max = 3 } = {}) {
|
|
4794
|
-
const [live, setLive] =
|
|
4795
|
-
const [tick, setTick] =
|
|
4796
|
-
const queue =
|
|
4797
|
-
const timers =
|
|
4798
|
-
const dismiss =
|
|
5091
|
+
const [live, setLive] = React89.useState([]);
|
|
5092
|
+
const [tick, setTick] = React89.useState(0);
|
|
5093
|
+
const queue = React89.useRef([]);
|
|
5094
|
+
const timers = React89.useRef({});
|
|
5095
|
+
const dismiss = React89.useCallback((id) => {
|
|
4799
5096
|
clearTimeout(timers.current[id]);
|
|
4800
5097
|
delete timers.current[id];
|
|
4801
5098
|
setLive((l) => l.filter((t) => t.id !== id));
|
|
4802
5099
|
}, []);
|
|
4803
|
-
|
|
5100
|
+
React89.useEffect(() => {
|
|
4804
5101
|
const room = max - live.length;
|
|
4805
5102
|
if (room > 0 && queue.current.length) {
|
|
4806
5103
|
const take = queue.current.splice(0, room);
|
|
4807
5104
|
setLive((l) => l.concat(take));
|
|
4808
5105
|
}
|
|
4809
5106
|
}, [live, max, tick]);
|
|
4810
|
-
|
|
5107
|
+
React89.useEffect(() => {
|
|
4811
5108
|
live.forEach((t) => {
|
|
4812
5109
|
const ms = t.duration == null ? duration : t.duration;
|
|
4813
5110
|
if (timers.current[t.id] || !ms) return;
|
|
4814
5111
|
timers.current[t.id] = setTimeout(() => dismiss(t.id), ms);
|
|
4815
5112
|
});
|
|
4816
5113
|
}, [live, duration, dismiss]);
|
|
4817
|
-
|
|
4818
|
-
const push =
|
|
5114
|
+
React89.useEffect(() => () => Object.values(timers.current).forEach(clearTimeout), []);
|
|
5115
|
+
const push = React89.useCallback((toast) => {
|
|
4819
5116
|
const t = { id: uid("toast"), tone: "ok", ...toast };
|
|
4820
5117
|
queue.current.push(t);
|
|
4821
5118
|
setTick((n) => n + 1);
|
|
4822
5119
|
return t.id;
|
|
4823
5120
|
}, []);
|
|
4824
|
-
const clear =
|
|
5121
|
+
const clear = React89.useCallback(() => {
|
|
4825
5122
|
queue.current = [];
|
|
4826
5123
|
Object.values(timers.current).forEach(clearTimeout);
|
|
4827
5124
|
timers.current = {};
|
|
@@ -4831,39 +5128,39 @@ function useToasts({ duration = 5e3, max = 3 } = {}) {
|
|
|
4831
5128
|
}
|
|
4832
5129
|
|
|
4833
5130
|
// src/feedback/ScopedNotification.jsx
|
|
4834
|
-
import
|
|
4835
|
-
import { jsx as
|
|
5131
|
+
import React90 from "react";
|
|
5132
|
+
import { jsx as jsx88, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
4836
5133
|
function ScopedNotification({ tone = "neutral", icon, children, action, className, ...rest }) {
|
|
4837
|
-
return /* @__PURE__ */
|
|
4838
|
-
/* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
action && /* @__PURE__ */
|
|
5134
|
+
return /* @__PURE__ */ jsxs81("div", { className: cx("agn-scoped", "agn-scoped--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
|
|
5135
|
+
/* @__PURE__ */ jsx88(Icon, { name: icon || TONE_ICON[tone] || "info", size: 14, className: "agn-scoped__icon" }),
|
|
5136
|
+
/* @__PURE__ */ jsx88("div", { className: "agn-scoped__text", children }),
|
|
5137
|
+
action && /* @__PURE__ */ jsx88("div", { className: "agn-scoped__action", children: action })
|
|
4841
5138
|
] });
|
|
4842
5139
|
}
|
|
4843
5140
|
|
|
4844
5141
|
// src/feedback/Notification.jsx
|
|
4845
|
-
import
|
|
4846
|
-
import { jsx as
|
|
5142
|
+
import React91 from "react";
|
|
5143
|
+
import { jsx as jsx89, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
4847
5144
|
var initials2 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
|
|
4848
5145
|
function Notification({ title, message, time, unread, avatar, icon, object, onClick, as, labels, className, ...rest }) {
|
|
4849
5146
|
const NL = { unread: "unread", ...labels };
|
|
4850
5147
|
const Tag2 = as || (onClick ? "button" : "div");
|
|
4851
|
-
return /* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
avatar ? /* @__PURE__ */
|
|
4854
|
-
/* @__PURE__ */
|
|
4855
|
-
/* @__PURE__ */
|
|
5148
|
+
return /* @__PURE__ */ jsxs82(Tag2, { type: Tag2 === "button" ? "button" : void 0, className: cx("agn-notif", unread && "agn-notif--unread", onClick && "agn-notif--clickable agn-focus-inset", className), onClick, ...rest, children: [
|
|
5149
|
+
/* @__PURE__ */ jsx89("span", { className: "agn-notif__dot", "aria-hidden": "true" }),
|
|
5150
|
+
avatar ? /* @__PURE__ */ jsx89("span", { className: "agn-notif__avatar", "aria-hidden": "true", children: initials2(avatar) }) : /* @__PURE__ */ jsx89("span", { className: "agn-notif__tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx89(Icon, { name: icon || "bell", size: 16 }) }),
|
|
5151
|
+
/* @__PURE__ */ jsxs82("span", { className: "agn-notif__body", children: [
|
|
5152
|
+
/* @__PURE__ */ jsxs82("span", { className: "agn-notif__title", children: [
|
|
4856
5153
|
title,
|
|
4857
|
-
unread && /* @__PURE__ */
|
|
5154
|
+
unread && /* @__PURE__ */ jsxs82("span", { className: "agn-sr", children: [
|
|
4858
5155
|
" (",
|
|
4859
5156
|
NL.unread,
|
|
4860
5157
|
")"
|
|
4861
5158
|
] })
|
|
4862
5159
|
] }),
|
|
4863
|
-
message && /* @__PURE__ */
|
|
4864
|
-
object && /* @__PURE__ */
|
|
5160
|
+
message && /* @__PURE__ */ jsx89("span", { className: "agn-notif__msg", children: message }),
|
|
5161
|
+
object && /* @__PURE__ */ jsx89("span", { className: "agn-notif__object", children: object })
|
|
4865
5162
|
] }),
|
|
4866
|
-
time && /* @__PURE__ */
|
|
5163
|
+
time && /* @__PURE__ */ jsx89("span", { className: "agn-notif__time", children: time })
|
|
4867
5164
|
] });
|
|
4868
5165
|
}
|
|
4869
5166
|
function dayLabel(date, L, locale) {
|
|
@@ -4889,36 +5186,36 @@ function NotificationList({ title, items = [], children, onMarkAll, locale = "tr
|
|
|
4889
5186
|
g.items.push(it);
|
|
4890
5187
|
});
|
|
4891
5188
|
const unread = items.filter((i) => i.unread).length;
|
|
4892
|
-
return /* @__PURE__ */
|
|
4893
|
-
header && /* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ jsxs82("section", { className: cx("agn-notif-list", bare && "agn-notif-list--bare", className), "aria-label": title || L.title, ...rest, children: [
|
|
5190
|
+
header && /* @__PURE__ */ jsxs82("header", { className: "agn-notif-list__head", children: [
|
|
5191
|
+
/* @__PURE__ */ jsxs82("h3", { className: "agn-notif-list__title", children: [
|
|
4895
5192
|
title || L.title,
|
|
4896
|
-
unread > 0 && /* @__PURE__ */
|
|
5193
|
+
unread > 0 && /* @__PURE__ */ jsx89("span", { className: "agn-notif-list__count", children: unread })
|
|
4897
5194
|
] }),
|
|
4898
|
-
onMarkAll && /* @__PURE__ */
|
|
5195
|
+
onMarkAll && /* @__PURE__ */ jsx89(Button, { variant: "link", size: "sm", onClick: onMarkAll, children: L.markAll })
|
|
4899
5196
|
] }),
|
|
4900
|
-
/* @__PURE__ */
|
|
4901
|
-
groups.map((g) => /* @__PURE__ */
|
|
4902
|
-
g.key && /* @__PURE__ */
|
|
5197
|
+
/* @__PURE__ */ jsxs82("div", { className: "agn-notif-list__body", children: [
|
|
5198
|
+
groups.map((g) => /* @__PURE__ */ jsxs82("div", { className: "agn-notif-list__group", children: [
|
|
5199
|
+
g.key && /* @__PURE__ */ jsx89("div", { className: "agn-eyebrow agn-eyebrow--quiet agn-notif-list__day", children: g.key }),
|
|
4903
5200
|
g.items.map((it, i) => {
|
|
4904
5201
|
const { id, day: _day, date: _date, ...p } = it;
|
|
4905
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ jsx89(Notification, { labels: { unread: L.unread }, ...p }, id || i);
|
|
4906
5203
|
})
|
|
4907
5204
|
] }, g.key || "all")),
|
|
4908
5205
|
children,
|
|
4909
|
-
!items.length && !children && /* @__PURE__ */
|
|
5206
|
+
!items.length && !children && /* @__PURE__ */ jsx89("div", { className: "agn-notif-list__empty", children: L.empty })
|
|
4910
5207
|
] })
|
|
4911
5208
|
] });
|
|
4912
5209
|
}
|
|
4913
5210
|
|
|
4914
5211
|
// src/feedback/Modal.jsx
|
|
4915
|
-
import
|
|
4916
|
-
import { jsx as
|
|
4917
|
-
var
|
|
5212
|
+
import React92 from "react";
|
|
5213
|
+
import { jsx as jsx90, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
5214
|
+
var FOCUSABLE2 = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
4918
5215
|
function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } = {}) {
|
|
4919
|
-
const closeRef =
|
|
5216
|
+
const closeRef = React92.useRef(onClose);
|
|
4920
5217
|
closeRef.current = onClose;
|
|
4921
|
-
|
|
5218
|
+
React92.useEffect(() => {
|
|
4922
5219
|
if (!open) return;
|
|
4923
5220
|
const previous = document.activeElement;
|
|
4924
5221
|
const onKey = (e) => {
|
|
@@ -4928,7 +5225,7 @@ function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } =
|
|
|
4928
5225
|
return;
|
|
4929
5226
|
}
|
|
4930
5227
|
if (e.key !== "Tab" || !ref.current) return;
|
|
4931
|
-
const f = Array.from(ref.current.querySelectorAll(
|
|
5228
|
+
const f = Array.from(ref.current.querySelectorAll(FOCUSABLE2));
|
|
4932
5229
|
if (!f.length) {
|
|
4933
5230
|
e.preventDefault();
|
|
4934
5231
|
ref.current.focus();
|
|
@@ -4949,7 +5246,7 @@ function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } =
|
|
|
4949
5246
|
const t = setTimeout(() => {
|
|
4950
5247
|
const el = ref.current;
|
|
4951
5248
|
if (!el || !autoFocus) return;
|
|
4952
|
-
const target = el.querySelector("[data-autofocus]") || Array.from(el.querySelectorAll(
|
|
5249
|
+
const target = el.querySelector("[data-autofocus]") || Array.from(el.querySelectorAll(FOCUSABLE2)).find((x) => !x.hasAttribute("data-dialog-close")) || el;
|
|
4953
5250
|
target.focus();
|
|
4954
5251
|
}, 20);
|
|
4955
5252
|
return () => {
|
|
@@ -4962,99 +5259,99 @@ function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } =
|
|
|
4962
5259
|
}
|
|
4963
5260
|
function Modal({ open, onClose, title, description, size = "md", footer, children, hideClose, scrimClose = true, labels, className, bodyClassName, ...rest }) {
|
|
4964
5261
|
const L = { close: "Close", ...labels };
|
|
4965
|
-
const ref =
|
|
4966
|
-
const ids =
|
|
5262
|
+
const ref = React92.useRef(null);
|
|
5263
|
+
const ids = React92.useMemo(() => ({ t: uid("modal-title"), d: uid("modal-desc") }), []);
|
|
4967
5264
|
useDialog(open, onClose, ref);
|
|
4968
5265
|
if (!open) return null;
|
|
4969
5266
|
return (
|
|
4970
5267
|
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only convenience; Esc closes the dialog from the keyboard
|
|
4971
|
-
/* @__PURE__ */
|
|
5268
|
+
/* @__PURE__ */ jsx90("div", { className: "agn-scrim", onMouseDown: (e) => {
|
|
4972
5269
|
if (scrimClose && e.target === e.currentTarget && onClose) onClose();
|
|
4973
|
-
}, children: /* @__PURE__ */
|
|
4974
|
-
(title || !hideClose) && /* @__PURE__ */
|
|
4975
|
-
/* @__PURE__ */
|
|
4976
|
-
title && /* @__PURE__ */
|
|
4977
|
-
description && /* @__PURE__ */
|
|
5270
|
+
}, children: /* @__PURE__ */ jsxs83("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-modal", "agn-modal--" + size, className), ...rest, children: [
|
|
5271
|
+
(title || !hideClose) && /* @__PURE__ */ jsxs83("header", { className: "agn-modal__head", children: [
|
|
5272
|
+
/* @__PURE__ */ jsxs83("div", { className: "agn-modal__heading", children: [
|
|
5273
|
+
title && /* @__PURE__ */ jsx90("h2", { id: ids.t, className: "agn-modal__title", children: title }),
|
|
5274
|
+
description && /* @__PURE__ */ jsx90("p", { id: ids.d, className: "agn-modal__desc", children: description })
|
|
4978
5275
|
] }),
|
|
4979
|
-
!hideClose && /* @__PURE__ */
|
|
5276
|
+
!hideClose && /* @__PURE__ */ jsx90(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "", className: "agn-modal__close" })
|
|
4980
5277
|
] }),
|
|
4981
|
-
/* @__PURE__ */
|
|
4982
|
-
footer && /* @__PURE__ */
|
|
5278
|
+
/* @__PURE__ */ jsx90("div", { className: cx("agn-modal__body", bodyClassName), children }),
|
|
5279
|
+
footer && /* @__PURE__ */ jsx90("footer", { className: "agn-modal__foot", children: footer })
|
|
4983
5280
|
] }) })
|
|
4984
5281
|
);
|
|
4985
5282
|
}
|
|
4986
5283
|
var PROMPT_ICON = { bad: "trash-2", warn: "triangle-alert", info: "info", ok: "circle-check" };
|
|
4987
5284
|
function Prompt({ open, onClose, onConfirm, title, children, consequence, tone = "warn", icon, confirmLabel, cancelLabel, loading: loading2, labels, className, ...rest }) {
|
|
4988
5285
|
const L = { confirm: "Confirm", cancel: "Cancel", ...labels };
|
|
4989
|
-
const ref =
|
|
4990
|
-
const ids =
|
|
5286
|
+
const ref = React92.useRef(null);
|
|
5287
|
+
const ids = React92.useMemo(() => ({ t: uid("prompt-title"), d: uid("prompt-desc") }), []);
|
|
4991
5288
|
useDialog(open, onClose, ref);
|
|
4992
5289
|
if (!open) return null;
|
|
4993
|
-
return /* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
/* @__PURE__ */
|
|
4998
|
-
/* @__PURE__ */
|
|
5290
|
+
return /* @__PURE__ */ jsx90("div", { className: "agn-scrim", children: /* @__PURE__ */ jsxs83("div", { ref, role: "alertdialog", "aria-modal": "true", "aria-labelledby": ids.t, "aria-describedby": ids.d, tabIndex: -1, className: cx("agn-modal agn-modal--sm agn-prompt", "agn-prompt--" + tone, className), ...rest, children: [
|
|
5291
|
+
/* @__PURE__ */ jsxs83("div", { className: "agn-prompt__body", children: [
|
|
5292
|
+
/* @__PURE__ */ jsx90("span", { className: "agn-prompt__icon", children: /* @__PURE__ */ jsx90(Icon, { name: icon || PROMPT_ICON[tone] || "info", size: 20 }) }),
|
|
5293
|
+
/* @__PURE__ */ jsxs83("div", { children: [
|
|
5294
|
+
/* @__PURE__ */ jsx90("h2", { id: ids.t, className: "agn-modal__title", children: title }),
|
|
5295
|
+
/* @__PURE__ */ jsxs83("div", { id: ids.d, className: "agn-prompt__text", children: [
|
|
4999
5296
|
children,
|
|
5000
|
-
consequence && /* @__PURE__ */
|
|
5297
|
+
consequence && /* @__PURE__ */ jsx90("p", { className: "agn-prompt__consequence", children: consequence })
|
|
5001
5298
|
] })
|
|
5002
5299
|
] })
|
|
5003
5300
|
] }),
|
|
5004
|
-
/* @__PURE__ */
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
/* @__PURE__ */
|
|
5301
|
+
/* @__PURE__ */ jsxs83("footer", { className: "agn-modal__foot", children: [
|
|
5302
|
+
/* @__PURE__ */ jsx90(Button, { onClick: onClose, disabled: loading2, children: cancelLabel || L.cancel }),
|
|
5303
|
+
/* @__PURE__ */ jsx90(Button, { variant: tone === "bad" ? "destructive" : "primary", onClick: onConfirm, loading: loading2, "data-autofocus": "", children: confirmLabel || L.confirm })
|
|
5007
5304
|
] })
|
|
5008
5305
|
] }) });
|
|
5009
5306
|
}
|
|
5010
5307
|
|
|
5011
5308
|
// src/feedback/Sheet.jsx
|
|
5012
|
-
import
|
|
5013
|
-
import { jsx as
|
|
5309
|
+
import React93 from "react";
|
|
5310
|
+
import { jsx as jsx91, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
5014
5311
|
function Sheet({ open, onClose, title, description, footer, children, hideClose, scrimClose = true, contained, maxHeight, labels, className, style, ...rest }) {
|
|
5015
5312
|
const L = { close: "Close", ...labels };
|
|
5016
|
-
const ref =
|
|
5017
|
-
const ids =
|
|
5313
|
+
const ref = React93.useRef(null);
|
|
5314
|
+
const ids = React93.useMemo(() => ({ t: uid("sheet-title"), d: uid("sheet-desc") }), []);
|
|
5018
5315
|
useDialog(open, onClose, ref, { lockScroll: !contained });
|
|
5019
5316
|
if (!open) return null;
|
|
5020
5317
|
return (
|
|
5021
5318
|
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only convenience; Esc closes the dialog from the keyboard
|
|
5022
|
-
/* @__PURE__ */
|
|
5319
|
+
/* @__PURE__ */ jsx91("div", { className: cx("agn-sheet-scrim", contained && "agn-sheet-scrim--contained"), onMouseDown: (e) => {
|
|
5023
5320
|
if (scrimClose && e.target === e.currentTarget && onClose) onClose();
|
|
5024
|
-
}, children: /* @__PURE__ */
|
|
5025
|
-
/* @__PURE__ */
|
|
5026
|
-
(title || !hideClose) && /* @__PURE__ */
|
|
5027
|
-
/* @__PURE__ */
|
|
5028
|
-
title && /* @__PURE__ */
|
|
5029
|
-
description && /* @__PURE__ */
|
|
5321
|
+
}, children: /* @__PURE__ */ jsxs84("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-sheet", className), style: maxHeight != null ? { maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight, ...style } : style, ...rest, children: [
|
|
5322
|
+
/* @__PURE__ */ jsx91("span", { className: "agn-sheet__handle", "aria-hidden": "true" }),
|
|
5323
|
+
(title || !hideClose) && /* @__PURE__ */ jsxs84("header", { className: "agn-sheet__head", children: [
|
|
5324
|
+
/* @__PURE__ */ jsxs84("div", { className: "agn-sheet__heading", children: [
|
|
5325
|
+
title && /* @__PURE__ */ jsx91("h2", { id: ids.t, className: "agn-sheet__title", children: title }),
|
|
5326
|
+
description && /* @__PURE__ */ jsx91("p", { id: ids.d, className: "agn-sheet__desc", children: description })
|
|
5030
5327
|
] }),
|
|
5031
|
-
!hideClose && /* @__PURE__ */
|
|
5328
|
+
!hideClose && /* @__PURE__ */ jsx91(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "" })
|
|
5032
5329
|
] }),
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
footer && /* @__PURE__ */
|
|
5330
|
+
/* @__PURE__ */ jsx91("div", { className: "agn-sheet__body", children }),
|
|
5331
|
+
footer && /* @__PURE__ */ jsx91("footer", { className: "agn-sheet__foot", children: footer })
|
|
5035
5332
|
] }) })
|
|
5036
5333
|
);
|
|
5037
5334
|
}
|
|
5038
5335
|
|
|
5039
5336
|
// src/feedback/Popover.jsx
|
|
5040
|
-
import
|
|
5041
|
-
import { jsx as
|
|
5337
|
+
import React94 from "react";
|
|
5338
|
+
import { jsx as jsx92, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
5042
5339
|
function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, placement = "bottom-start", arrow = false, title, footer, children, width = 288, hideClose, static: isStatic, labels, className, ...rest }) {
|
|
5043
5340
|
const L = { close: "Close", ...labels };
|
|
5044
|
-
const [own, setOwn] =
|
|
5341
|
+
const [own, setOwn] = React94.useState(defaultOpen);
|
|
5045
5342
|
const controlled = openProp != null;
|
|
5046
5343
|
const open = controlled ? openProp : own;
|
|
5047
|
-
const wrap =
|
|
5048
|
-
const pop =
|
|
5049
|
-
const byUser =
|
|
5050
|
-
const id =
|
|
5344
|
+
const wrap = React94.useRef(null);
|
|
5345
|
+
const pop = React94.useRef(null);
|
|
5346
|
+
const byUser = React94.useRef(false);
|
|
5347
|
+
const id = React94.useMemo(() => uid("pop"), []);
|
|
5051
5348
|
const set = (v) => {
|
|
5052
5349
|
if (!controlled) setOwn(v);
|
|
5053
5350
|
onOpenChange && onOpenChange(v);
|
|
5054
5351
|
};
|
|
5055
|
-
const setRef =
|
|
5352
|
+
const setRef = React94.useRef(set);
|
|
5056
5353
|
setRef.current = set;
|
|
5057
|
-
|
|
5354
|
+
React94.useEffect(() => {
|
|
5058
5355
|
if (!open || isStatic) return;
|
|
5059
5356
|
const down = (e) => {
|
|
5060
5357
|
if (wrap.current && !wrap.current.contains(e.target)) setRef.current(false);
|
|
@@ -5077,18 +5374,18 @@ function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, p
|
|
|
5077
5374
|
document.removeEventListener("keydown", key);
|
|
5078
5375
|
};
|
|
5079
5376
|
}, [open]);
|
|
5080
|
-
const layer = /* @__PURE__ */
|
|
5081
|
-
arrow && !isStatic && /* @__PURE__ */
|
|
5082
|
-
(title || !hideClose) && /* @__PURE__ */
|
|
5083
|
-
title && /* @__PURE__ */
|
|
5084
|
-
!hideClose && /* @__PURE__ */
|
|
5377
|
+
const layer = /* @__PURE__ */ jsxs85("div", { ref: pop, id, role: "dialog", "aria-label": typeof title === "string" ? title : void 0, tabIndex: -1, className: cx("agn-pop", isStatic ? "agn-pop--static" : "agn-pop--" + placement, arrow && "agn-pop--arrow", className), style: { width }, ...rest, children: [
|
|
5378
|
+
arrow && !isStatic && /* @__PURE__ */ jsx92("span", { className: "agn-pop__arrow", "aria-hidden": "true" }),
|
|
5379
|
+
(title || !hideClose) && /* @__PURE__ */ jsxs85("div", { className: "agn-pop__head", children: [
|
|
5380
|
+
title && /* @__PURE__ */ jsx92("div", { className: "agn-pop__title", children: title }),
|
|
5381
|
+
!hideClose && /* @__PURE__ */ jsx92(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: () => set(false), className: "agn-pop__close" })
|
|
5085
5382
|
] }),
|
|
5086
|
-
/* @__PURE__ */
|
|
5087
|
-
footer && /* @__PURE__ */
|
|
5383
|
+
/* @__PURE__ */ jsx92("div", { className: "agn-pop__body", children }),
|
|
5384
|
+
footer && /* @__PURE__ */ jsx92("div", { className: "agn-pop__foot", children: footer })
|
|
5088
5385
|
] });
|
|
5089
5386
|
if (isStatic) return layer;
|
|
5090
|
-
return /* @__PURE__ */
|
|
5091
|
-
trigger &&
|
|
5387
|
+
return /* @__PURE__ */ jsxs85("span", { className: "agn-pop-wrap", ref: wrap, children: [
|
|
5388
|
+
trigger && React94.cloneElement(trigger, { onClick: (e) => {
|
|
5092
5389
|
trigger.props.onClick && trigger.props.onClick(e);
|
|
5093
5390
|
byUser.current = !open;
|
|
5094
5391
|
set(!open);
|
|
@@ -5098,13 +5395,13 @@ function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, p
|
|
|
5098
5395
|
}
|
|
5099
5396
|
|
|
5100
5397
|
// src/feedback/Tooltip.jsx
|
|
5101
|
-
import
|
|
5102
|
-
import { jsx as
|
|
5398
|
+
import React95 from "react";
|
|
5399
|
+
import { jsx as jsx93, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
5103
5400
|
function Tooltip({ content, kbd, placement = "top", delay = 400, open: openProp, children, className, ...rest }) {
|
|
5104
|
-
const [own, setOwn] =
|
|
5401
|
+
const [own, setOwn] = React95.useState(false);
|
|
5105
5402
|
const open = openProp != null ? openProp : own;
|
|
5106
|
-
const timer =
|
|
5107
|
-
const id =
|
|
5403
|
+
const timer = React95.useRef(null);
|
|
5404
|
+
const id = React95.useMemo(() => uid("tip"), []);
|
|
5108
5405
|
const show2 = () => {
|
|
5109
5406
|
clearTimeout(timer.current);
|
|
5110
5407
|
timer.current = setTimeout(() => setOwn(true), delay);
|
|
@@ -5113,119 +5410,88 @@ function Tooltip({ content, kbd, placement = "top", delay = 400, open: openProp,
|
|
|
5113
5410
|
clearTimeout(timer.current);
|
|
5114
5411
|
setOwn(false);
|
|
5115
5412
|
};
|
|
5116
|
-
|
|
5117
|
-
|
|
5413
|
+
React95.useEffect(() => () => clearTimeout(timer.current), []);
|
|
5414
|
+
React95.useEffect(() => {
|
|
5118
5415
|
if (!open) return;
|
|
5119
5416
|
const k = (e) => e.key === "Escape" && hide();
|
|
5120
5417
|
document.addEventListener("keydown", k);
|
|
5121
5418
|
return () => document.removeEventListener("keydown", k);
|
|
5122
5419
|
}, [open]);
|
|
5123
|
-
const child =
|
|
5420
|
+
const child = React95.Children.only(children);
|
|
5124
5421
|
return (
|
|
5125
5422
|
// biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only listens: hover and focus bubble up from the focusable trigger it wraps; it is not itself operable
|
|
5126
|
-
/* @__PURE__ */
|
|
5127
|
-
|
|
5128
|
-
open && /* @__PURE__ */
|
|
5423
|
+
/* @__PURE__ */ jsxs86("span", { className: cx("agn-tip-wrap", className), onMouseEnter: show2, onMouseLeave: hide, onFocus: show2, onBlur: hide, ...rest, children: [
|
|
5424
|
+
React95.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] }),
|
|
5425
|
+
open && /* @__PURE__ */ jsxs86("span", { role: "tooltip", id, className: cx("agn-tip", "agn-tip--" + placement), children: [
|
|
5129
5426
|
content,
|
|
5130
|
-
kbd && /* @__PURE__ */
|
|
5427
|
+
kbd && /* @__PURE__ */ jsx93("kbd", { className: "agn-tip__kbd", children: kbd })
|
|
5131
5428
|
] })
|
|
5132
5429
|
] })
|
|
5133
5430
|
);
|
|
5134
5431
|
}
|
|
5135
5432
|
|
|
5136
5433
|
// src/feedback/Spinner.jsx
|
|
5137
|
-
import
|
|
5138
|
-
import { jsx as
|
|
5434
|
+
import React96 from "react";
|
|
5435
|
+
import { jsx as jsx94, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
5139
5436
|
var PX = { xs: 12, sm: 16, md: 20, lg: 32 };
|
|
5140
5437
|
function Spinner({ size = "md", tone = "signal", label, cover, labels, className, ...rest }) {
|
|
5141
5438
|
const L = { loading: "Loading", ...labels };
|
|
5142
|
-
const
|
|
5143
|
-
const svg = /* @__PURE__ */
|
|
5144
|
-
/* @__PURE__ */
|
|
5145
|
-
/* @__PURE__ */
|
|
5439
|
+
const px2 = PX[size] || PX.md;
|
|
5440
|
+
const svg = /* @__PURE__ */ jsxs87("svg", { className: "agn-spinner__svg", width: px2, height: px2, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
5441
|
+
/* @__PURE__ */ jsx94("circle", { className: "agn-spinner__track", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5" }),
|
|
5442
|
+
/* @__PURE__ */ jsx94("circle", { className: "agn-spinner__arc", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5", strokeLinecap: "round", strokeDasharray: "18 42" })
|
|
5146
5443
|
] });
|
|
5147
5444
|
return (
|
|
5148
5445
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
5149
|
-
/* @__PURE__ */
|
|
5446
|
+
/* @__PURE__ */ jsxs87("span", { className: cx("agn-spinner", "agn-spinner--" + size, "agn-spinner--" + tone, cover && "agn-spinner--cover", className), role: "status", "aria-busy": "true", ...rest, children: [
|
|
5150
5447
|
svg,
|
|
5151
|
-
label ? /* @__PURE__ */
|
|
5448
|
+
label ? /* @__PURE__ */ jsx94("span", { className: "agn-spinner__label", children: label }) : /* @__PURE__ */ jsx94("span", { className: "agn-sr", children: L.loading })
|
|
5152
5449
|
] })
|
|
5153
5450
|
);
|
|
5154
5451
|
}
|
|
5155
5452
|
|
|
5156
5453
|
// src/feedback/ProgressBar.jsx
|
|
5157
|
-
import
|
|
5158
|
-
import { jsx as
|
|
5454
|
+
import React97 from "react";
|
|
5455
|
+
import { jsx as jsx95, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
5159
5456
|
function ProgressBar({ value = 0, max = 100, indeterminate, tone = "signal", size = "md", label, showValue, valueText, labels, className, ...rest }) {
|
|
5160
5457
|
const L = { working: "Working", ...labels };
|
|
5161
|
-
const id =
|
|
5458
|
+
const id = React97.useMemo(() => uid("progress"), []);
|
|
5162
5459
|
const pct2 = Math.max(0, Math.min(100, value / (max || 1) * 100));
|
|
5163
5460
|
const text = valueText != null ? valueText : Math.round(pct2) + "%";
|
|
5164
|
-
return /* @__PURE__ */
|
|
5165
|
-
(label || showValue) && /* @__PURE__ */
|
|
5166
|
-
label && /* @__PURE__ */
|
|
5167
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
5461
|
+
return /* @__PURE__ */ jsxs88("div", { className: cx("agn-progress", "agn-progress--" + size, "agn-progress--" + tone, indeterminate && "agn-progress--indeterminate", className), ...rest, children: [
|
|
5462
|
+
(label || showValue) && /* @__PURE__ */ jsxs88("div", { className: "agn-progress__row", children: [
|
|
5463
|
+
label && /* @__PURE__ */ jsx95("span", { id, className: "agn-progress__label", children: label }),
|
|
5464
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx95("span", { className: "agn-progress__value agn-num", children: text })
|
|
5168
5465
|
] }),
|
|
5169
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ jsx95("div", { className: "agn-progress__track", role: "progressbar", "aria-labelledby": label ? id : void 0, "aria-label": !label ? L.working : void 0, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": indeterminate ? void 0 : value, "aria-valuetext": indeterminate ? L.working : text, children: /* @__PURE__ */ jsx95("div", { className: "agn-progress__fill", style: indeterminate ? void 0 : { width: pct2 + "%" } }) })
|
|
5170
5467
|
] });
|
|
5171
5468
|
}
|
|
5172
5469
|
|
|
5173
5470
|
// src/feedback/ProgressRing.jsx
|
|
5174
|
-
import
|
|
5175
|
-
import { jsx as
|
|
5471
|
+
import React98 from "react";
|
|
5472
|
+
import { jsx as jsx96, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
5176
5473
|
function ProgressRing({ value = 0, max = 100, size = 64, strokeWidth = 6, tone = "signal", showValue = true, valueText, label, children, className, ...rest }) {
|
|
5177
5474
|
const pct2 = Math.max(0, Math.min(100, value / (max || 1) * 100));
|
|
5178
5475
|
const r = (size - strokeWidth) / 2, c = 2 * Math.PI * r;
|
|
5179
5476
|
const text = valueText != null ? valueText : Math.round(pct2) + "%";
|
|
5180
|
-
return /* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
5182
|
-
/* @__PURE__ */
|
|
5183
|
-
/* @__PURE__ */
|
|
5184
|
-
/* @__PURE__ */
|
|
5477
|
+
return /* @__PURE__ */ jsxs89("div", { className: cx("agn-ring", "agn-ring--" + tone, className), style: { width: size }, ...rest, children: [
|
|
5478
|
+
/* @__PURE__ */ jsxs89("div", { className: "agn-ring__box", style: { width: size, height: size }, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value, "aria-valuetext": text, "aria-label": typeof label === "string" ? label : void 0, children: [
|
|
5479
|
+
/* @__PURE__ */ jsxs89("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": "true", children: [
|
|
5480
|
+
/* @__PURE__ */ jsx96("circle", { className: "agn-ring__track", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none" }),
|
|
5481
|
+
/* @__PURE__ */ jsx96("circle", { className: "agn-ring__arc", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none", strokeLinecap: pct2 > 0 && pct2 < 100 ? "round" : "butt", strokeDasharray: c, strokeDashoffset: c * (1 - pct2 / 100), transform: `rotate(-90 ${size / 2} ${size / 2})` })
|
|
5185
5482
|
] }),
|
|
5186
|
-
/* @__PURE__ */
|
|
5187
|
-
] }),
|
|
5188
|
-
label && /* @__PURE__ */ jsx94("div", { className: "agn-ring__label", children: label })
|
|
5189
|
-
] });
|
|
5190
|
-
}
|
|
5191
|
-
|
|
5192
|
-
// src/feedback/SidePanel.jsx
|
|
5193
|
-
import React96 from "react";
|
|
5194
|
-
import { jsx as jsx95, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
5195
|
-
function SidePanel({ open = true, onClose, title, eyebrow, subtitle, tabs, actions, footer, size = "md", width, mode = "overlay", children, labels, className, style, ...rest }) {
|
|
5196
|
-
const L = { close: "Close", ...labels };
|
|
5197
|
-
const id = React96.useMemo(() => uid("panel-title"), []);
|
|
5198
|
-
React96.useEffect(() => {
|
|
5199
|
-
if (!open || mode !== "overlay" || !onClose) return;
|
|
5200
|
-
const k = (e) => e.key === "Escape" && onClose();
|
|
5201
|
-
document.addEventListener("keydown", k);
|
|
5202
|
-
return () => document.removeEventListener("keydown", k);
|
|
5203
|
-
}, [open, mode, onClose]);
|
|
5204
|
-
if (!open) return null;
|
|
5205
|
-
return /* @__PURE__ */ jsxs89("aside", { className: cx("agn-panel", "agn-panel--" + size, "agn-panel--" + mode, className), "aria-labelledby": title ? id : void 0, style: width != null ? { width: typeof width === "number" ? width + "px" : width, ...style } : style, ...rest, children: [
|
|
5206
|
-
/* @__PURE__ */ jsxs89("header", { className: "agn-panel__head", children: [
|
|
5207
|
-
/* @__PURE__ */ jsxs89("div", { className: "agn-panel__heading", children: [
|
|
5208
|
-
eyebrow && /* @__PURE__ */ jsx95("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: eyebrow }),
|
|
5209
|
-
title && /* @__PURE__ */ jsx95("h2", { id, className: "agn-panel__title", children: title }),
|
|
5210
|
-
subtitle && /* @__PURE__ */ jsx95("div", { className: "agn-panel__subtitle", children: subtitle })
|
|
5211
|
-
] }),
|
|
5212
|
-
/* @__PURE__ */ jsxs89("div", { className: "agn-panel__actions", children: [
|
|
5213
|
-
actions,
|
|
5214
|
-
onClose && /* @__PURE__ */ jsx95(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose })
|
|
5215
|
-
] })
|
|
5483
|
+
/* @__PURE__ */ jsx96("div", { className: "agn-ring__center", style: { fontSize: Math.max(11, Math.round(size * 0.24)) }, children: children != null ? children : showValue ? /* @__PURE__ */ jsx96("span", { className: "agn-ring__value agn-num", children: text }) : null })
|
|
5216
5484
|
] }),
|
|
5217
|
-
|
|
5218
|
-
/* @__PURE__ */ jsx95("div", { className: "agn-panel__body", children }),
|
|
5219
|
-
footer && /* @__PURE__ */ jsx95("footer", { className: "agn-panel__foot", children: footer })
|
|
5485
|
+
label && /* @__PURE__ */ jsx96("div", { className: "agn-ring__label", children: label })
|
|
5220
5486
|
] });
|
|
5221
5487
|
}
|
|
5222
5488
|
|
|
5223
5489
|
// src/feedback/DockedComposer.jsx
|
|
5224
|
-
import
|
|
5225
|
-
import { Fragment as
|
|
5490
|
+
import React99 from "react";
|
|
5491
|
+
import { Fragment as Fragment12, jsx as jsx97, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
5226
5492
|
function DockedComposer({ title, icon = "pen-line", minimized: minProp, defaultMinimized = false, onMinimize, onClose, toolbar, footer, children, side = "right", static: isStatic, labels, className, ...rest }) {
|
|
5227
5493
|
const L = { minimize: "Minimise", restore: "Restore", close: "Close", ...labels };
|
|
5228
|
-
const [own, setOwn] =
|
|
5494
|
+
const [own, setOwn] = React99.useState(defaultMinimized);
|
|
5229
5495
|
const min = minProp != null ? minProp : own;
|
|
5230
5496
|
const toggle = () => {
|
|
5231
5497
|
const v = !min;
|
|
@@ -5234,18 +5500,18 @@ function DockedComposer({ title, icon = "pen-line", minimized: minProp, defaultM
|
|
|
5234
5500
|
};
|
|
5235
5501
|
return /* @__PURE__ */ jsxs90("section", { className: cx("agn-composer", "agn-composer--" + side, min && "agn-composer--min", isStatic && "agn-composer--static", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
|
|
5236
5502
|
/* @__PURE__ */ jsxs90("header", { className: "agn-composer__head", children: [
|
|
5237
|
-
/* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx97(Icon, { name: icon, size: 16, className: "agn-composer__icon" }),
|
|
5504
|
+
/* @__PURE__ */ jsx97("h3", { className: "agn-composer__title", children: title }),
|
|
5239
5505
|
/* @__PURE__ */ jsxs90("div", { className: "agn-composer__ctl", children: [
|
|
5240
|
-
/* @__PURE__ */
|
|
5241
|
-
onClose && /* @__PURE__ */
|
|
5506
|
+
/* @__PURE__ */ jsx97(ButtonIcon, { icon: min ? "chevron-up" : "minus", label: min ? L.restore : L.minimize, size: "xs", onClick: toggle, "aria-expanded": !min }),
|
|
5507
|
+
onClose && /* @__PURE__ */ jsx97(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: onClose })
|
|
5242
5508
|
] })
|
|
5243
5509
|
] }),
|
|
5244
|
-
!min && /* @__PURE__ */ jsxs90(
|
|
5245
|
-
/* @__PURE__ */
|
|
5510
|
+
!min && /* @__PURE__ */ jsxs90(Fragment12, { children: [
|
|
5511
|
+
/* @__PURE__ */ jsx97("div", { className: "agn-composer__body", children }),
|
|
5246
5512
|
(toolbar || footer) && /* @__PURE__ */ jsxs90("footer", { className: "agn-composer__foot", children: [
|
|
5247
|
-
/* @__PURE__ */
|
|
5248
|
-
/* @__PURE__ */
|
|
5513
|
+
/* @__PURE__ */ jsx97("div", { className: "agn-composer__tools", children: toolbar }),
|
|
5514
|
+
/* @__PURE__ */ jsx97("div", { className: "agn-composer__actions", children: footer })
|
|
5249
5515
|
] })
|
|
5250
5516
|
] })
|
|
5251
5517
|
] });
|
|
@@ -5253,22 +5519,22 @@ function DockedComposer({ title, icon = "pen-line", minimized: minProp, defaultM
|
|
|
5253
5519
|
function DockedUtilityBar({ items = [], active, onChange, panel, static: isStatic, labels, className, ...rest }) {
|
|
5254
5520
|
const L = { utilities: "Utilities", ...labels };
|
|
5255
5521
|
return /* @__PURE__ */ jsxs90("div", { className: cx("agn-utility", isStatic && "agn-utility--static", className), ...rest, children: [
|
|
5256
|
-
active && panel && /* @__PURE__ */
|
|
5257
|
-
/* @__PURE__ */
|
|
5258
|
-
/* @__PURE__ */
|
|
5259
|
-
/* @__PURE__ */
|
|
5260
|
-
it.badge != null && /* @__PURE__ */
|
|
5522
|
+
active && panel && /* @__PURE__ */ jsx97("section", { className: "agn-utility__panel", "aria-label": (items.find((i) => i.id === active) || {}).label, children: panel }),
|
|
5523
|
+
/* @__PURE__ */ jsx97("div", { className: "agn-utility__bar", role: "toolbar", "aria-label": L.utilities, children: items.map((it) => /* @__PURE__ */ jsxs90("button", { type: "button", className: cx("agn-utility__item", it.id === active && "agn-utility__item--active"), "aria-pressed": it.id === active, onClick: () => onChange && onChange(it.id === active ? null : it.id), children: [
|
|
5524
|
+
/* @__PURE__ */ jsx97(Icon, { name: it.icon || "panel-bottom", size: 14 }),
|
|
5525
|
+
/* @__PURE__ */ jsx97("span", { children: it.label }),
|
|
5526
|
+
it.badge != null && /* @__PURE__ */ jsx97("span", { className: "agn-utility__badge agn-num", children: it.badge })
|
|
5261
5527
|
] }, it.id)) })
|
|
5262
5528
|
] });
|
|
5263
5529
|
}
|
|
5264
5530
|
|
|
5265
5531
|
// src/feedback/Publisher.jsx
|
|
5266
|
-
import
|
|
5267
|
-
import { jsx as
|
|
5532
|
+
import React100 from "react";
|
|
5533
|
+
import { jsx as jsx98, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
5268
5534
|
function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSubmit, onAttach, onMention, submitLabel, expanded: expProp, labels, className, ...rest }) {
|
|
5269
5535
|
const L = { placeholder: "Write a note\u2026", submit: "Post", attach: "Attach file", mention: "Mention someone", ...labels };
|
|
5270
|
-
const [own, setOwn] =
|
|
5271
|
-
const [focus, setFocus] =
|
|
5536
|
+
const [own, setOwn] = React100.useState(defaultValue);
|
|
5537
|
+
const [focus, setFocus] = React100.useState(false);
|
|
5272
5538
|
const val = value != null ? value : own;
|
|
5273
5539
|
const expanded = expProp != null ? expProp : focus || val.length > 0;
|
|
5274
5540
|
const name = typeof user === "string" ? user : user && user.name;
|
|
@@ -5278,9 +5544,9 @@ function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSu
|
|
|
5278
5544
|
if (value == null) setOwn("");
|
|
5279
5545
|
};
|
|
5280
5546
|
return /* @__PURE__ */ jsxs91("div", { className: cx("agn-publisher", expanded && "agn-publisher--open", className), ...rest, children: [
|
|
5281
|
-
name && /* @__PURE__ */
|
|
5547
|
+
name && /* @__PURE__ */ jsx98("span", { className: "agn-publisher__avatar", "aria-hidden": "true", children: initials2(name) }),
|
|
5282
5548
|
/* @__PURE__ */ jsxs91("div", { className: "agn-publisher__field", children: [
|
|
5283
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ jsx98(
|
|
5284
5550
|
"textarea",
|
|
5285
5551
|
{
|
|
5286
5552
|
className: "agn-publisher__input",
|
|
@@ -5304,26 +5570,26 @@ function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSu
|
|
|
5304
5570
|
),
|
|
5305
5571
|
expanded && /* @__PURE__ */ jsxs91("div", { className: "agn-publisher__bar", children: [
|
|
5306
5572
|
/* @__PURE__ */ jsxs91("div", { className: "agn-publisher__tools", children: [
|
|
5307
|
-
/* @__PURE__ */
|
|
5308
|
-
/* @__PURE__ */
|
|
5573
|
+
/* @__PURE__ */ jsx98(ButtonIcon, { icon: "paperclip", label: L.attach, size: "sm", onClick: onAttach }),
|
|
5574
|
+
/* @__PURE__ */ jsx98(ButtonIcon, { icon: "at-sign", label: L.mention, size: "sm", onClick: onMention })
|
|
5309
5575
|
] }),
|
|
5310
|
-
/* @__PURE__ */
|
|
5576
|
+
/* @__PURE__ */ jsx98(Button, { variant: "primary", size: "sm", disabled: !val.trim(), onClick: submit, children: submitLabel || L.submit })
|
|
5311
5577
|
] })
|
|
5312
5578
|
] })
|
|
5313
5579
|
] });
|
|
5314
5580
|
}
|
|
5315
5581
|
|
|
5316
5582
|
// src/feedback/EmptyState.jsx
|
|
5317
|
-
import
|
|
5318
|
-
import { jsx as
|
|
5583
|
+
import React101 from "react";
|
|
5584
|
+
import { jsx as jsx99, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
5319
5585
|
function EmptyState({ illustration, icon, product, title, children, action, secondary, compact, className, ...rest }) {
|
|
5320
5586
|
return (
|
|
5321
5587
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
5322
5588
|
/* @__PURE__ */ jsxs92("div", { className: cx("agn-empty", compact && "agn-empty--compact", className), role: "status", ...rest, children: [
|
|
5323
|
-
illustration ? /* @__PURE__ */
|
|
5589
|
+
illustration ? /* @__PURE__ */ jsx99("div", { className: "agn-empty__art", children: illustration }) : (icon || product) && /* @__PURE__ */ jsx99("span", { className: "agn-empty__icon", children: product ? /* @__PURE__ */ jsx99(ProductIcon, { product, size: compact ? 20 : 24 }) : /* @__PURE__ */ jsx99(Icon, { name: icon, size: compact ? 18 : 22 }) }),
|
|
5324
5590
|
/* @__PURE__ */ jsxs92("div", { className: "agn-empty__body", children: [
|
|
5325
|
-
title && /* @__PURE__ */
|
|
5326
|
-
children != null && /* @__PURE__ */
|
|
5591
|
+
title && /* @__PURE__ */ jsx99("h4", { className: "agn-empty__title", children: title }),
|
|
5592
|
+
children != null && /* @__PURE__ */ jsx99("p", { className: "agn-empty__text", children }),
|
|
5327
5593
|
(action || secondary) && /* @__PURE__ */ jsxs92("div", { className: "agn-empty__actions", children: [
|
|
5328
5594
|
action,
|
|
5329
5595
|
secondary
|
|
@@ -5334,27 +5600,27 @@ function EmptyState({ illustration, icon, product, title, children, action, seco
|
|
|
5334
5600
|
}
|
|
5335
5601
|
|
|
5336
5602
|
// src/chat/ChatThread.jsx
|
|
5337
|
-
import
|
|
5338
|
-
import { jsx as
|
|
5603
|
+
import React102 from "react";
|
|
5604
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
5339
5605
|
function ChatThread({ children, stickToBottom = true, userSide = "start", maxHeight, labels, className, style, ...rest }) {
|
|
5340
5606
|
const L = { thread: "Conversation", ...labels };
|
|
5341
|
-
const ref =
|
|
5342
|
-
|
|
5607
|
+
const ref = React102.useRef(null);
|
|
5608
|
+
React102.useEffect(() => {
|
|
5343
5609
|
if (stickToBottom && ref.current) ref.current.scrollTop = ref.current.scrollHeight;
|
|
5344
5610
|
}, [children, stickToBottom]);
|
|
5345
|
-
return /* @__PURE__ */
|
|
5611
|
+
return /* @__PURE__ */ jsx100("div", { ref, className: cx("agn-chat", "agn-chat--user-" + userSide, className), role: "log", "aria-live": "polite", "aria-label": L.thread, style: { maxHeight, ...style }, ...rest, children });
|
|
5346
5612
|
}
|
|
5347
5613
|
function ChatDivider({ variant = "day", children, labels, className, ...rest }) {
|
|
5348
5614
|
const L = { newMessages: "New messages", ...labels };
|
|
5349
|
-
return /* @__PURE__ */
|
|
5615
|
+
return /* @__PURE__ */ jsx100("div", { className: cx("agn-chat__divider", "agn-chat__divider--" + variant, className), ...rest, children: /* @__PURE__ */ jsx100("span", { children: children != null ? children : variant === "new" ? L.newMessages : null }) });
|
|
5350
5616
|
}
|
|
5351
5617
|
|
|
5352
5618
|
// src/chat/ChatMessage.jsx
|
|
5353
|
-
import
|
|
5619
|
+
import React106 from "react";
|
|
5354
5620
|
|
|
5355
5621
|
// src/chat/ChatMarkdown.jsx
|
|
5356
|
-
import
|
|
5357
|
-
import { jsx as
|
|
5622
|
+
import React103 from "react";
|
|
5623
|
+
import { jsx as jsx101, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
5358
5624
|
var INLINE = /(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(__[^_\n]+__)|(\*[^*\n]+\*)|(\b_[^_\n]+_\b)|(\[[^\]\n]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+)/g;
|
|
5359
5625
|
var safeHref = (u) => /^(https?:|mailto:|tel:|\/|#)/i.test(u) ? u : "#";
|
|
5360
5626
|
function renderInline(text, depth = 0) {
|
|
@@ -5364,13 +5630,13 @@ function renderInline(text, depth = 0) {
|
|
|
5364
5630
|
while (m = re.exec(text)) {
|
|
5365
5631
|
if (m.index > last) out.push(text.slice(last, m.index));
|
|
5366
5632
|
const s = m[0];
|
|
5367
|
-
if (m[1]) out.push(/* @__PURE__ */
|
|
5368
|
-
else if (m[2] || m[3]) out.push(/* @__PURE__ */
|
|
5369
|
-
else if (m[4] || m[5]) out.push(/* @__PURE__ */
|
|
5633
|
+
if (m[1]) out.push(/* @__PURE__ */ jsx101("code", { className: "agn-md__code", children: s.slice(1, -1) }, k++));
|
|
5634
|
+
else if (m[2] || m[3]) out.push(/* @__PURE__ */ jsx101("strong", { children: depth < 2 ? renderInline(s.slice(2, -2), depth + 1) : s.slice(2, -2) }, k++));
|
|
5635
|
+
else if (m[4] || m[5]) out.push(/* @__PURE__ */ jsx101("em", { children: depth < 2 ? renderInline(s.slice(1, -1), depth + 1) : s.slice(1, -1) }, k++));
|
|
5370
5636
|
else if (m[6]) {
|
|
5371
5637
|
const mm = /^\[([^\]]+)\]\(([^)\s]+)\)/.exec(s);
|
|
5372
|
-
out.push(/* @__PURE__ */
|
|
5373
|
-
} else if (m[7]) out.push(/* @__PURE__ */
|
|
5638
|
+
out.push(/* @__PURE__ */ jsx101("a", { href: safeHref(mm[2]), target: "_blank", rel: "noopener noreferrer", children: mm[1] }, k++));
|
|
5639
|
+
} else if (m[7]) out.push(/* @__PURE__ */ jsx101("a", { href: safeHref(s), target: "_blank", rel: "noopener noreferrer", children: s }, k++));
|
|
5374
5640
|
last = m.index + s.length;
|
|
5375
5641
|
}
|
|
5376
5642
|
if (last < text.length) out.push(text.slice(last));
|
|
@@ -5440,41 +5706,41 @@ function parseBlocks(src) {
|
|
|
5440
5706
|
return blocks;
|
|
5441
5707
|
}
|
|
5442
5708
|
function withBreaks(text) {
|
|
5443
|
-
return text.split("\n").flatMap((l, i) => i ? [/* @__PURE__ */
|
|
5709
|
+
return text.split("\n").flatMap((l, i) => i ? [/* @__PURE__ */ jsx101("br", {}, "b" + i), ...renderInline(l)] : renderInline(l));
|
|
5444
5710
|
}
|
|
5445
5711
|
function renderBlock(b, i) {
|
|
5446
5712
|
switch (b.type) {
|
|
5447
5713
|
case "code":
|
|
5448
|
-
return /* @__PURE__ */
|
|
5714
|
+
return /* @__PURE__ */ jsx101("pre", { className: "agn-md__pre", "data-lang": b.lang || void 0, children: /* @__PURE__ */ jsx101("code", { children: b.text }) }, i);
|
|
5449
5715
|
case "h": {
|
|
5450
5716
|
const Tag2 = "h" + Math.min(6, b.level + 2);
|
|
5451
|
-
return /* @__PURE__ */
|
|
5717
|
+
return /* @__PURE__ */ jsx101(Tag2, { className: "agn-md__h agn-md__h--" + b.level, children: renderInline(b.text) }, i);
|
|
5452
5718
|
}
|
|
5453
5719
|
case "hr":
|
|
5454
|
-
return /* @__PURE__ */
|
|
5720
|
+
return /* @__PURE__ */ jsx101("hr", { className: "agn-md__hr" }, i);
|
|
5455
5721
|
case "quote":
|
|
5456
|
-
return /* @__PURE__ */
|
|
5722
|
+
return /* @__PURE__ */ jsx101("blockquote", { className: "agn-md__quote", children: b.blocks.map(renderBlock) }, i);
|
|
5457
5723
|
case "table":
|
|
5458
|
-
return /* @__PURE__ */
|
|
5459
|
-
/* @__PURE__ */
|
|
5460
|
-
/* @__PURE__ */
|
|
5724
|
+
return /* @__PURE__ */ jsx101("div", { className: "agn-md__table-wrap", children: /* @__PURE__ */ jsxs93("table", { className: "agn-md__table", children: [
|
|
5725
|
+
/* @__PURE__ */ jsx101("thead", { children: /* @__PURE__ */ jsx101("tr", { children: b.head.map((c, j) => /* @__PURE__ */ jsx101("th", { style: { textAlign: b.aligns[j] }, children: renderInline(c) }, j)) }) }),
|
|
5726
|
+
/* @__PURE__ */ jsx101("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ jsx101("tr", { children: b.head.map((_, j) => /* @__PURE__ */ jsx101("td", { style: { textAlign: b.aligns[j] }, children: renderInline(r[j] || "") }, j)) }, ri)) })
|
|
5461
5727
|
] }) }, i);
|
|
5462
5728
|
case "list": {
|
|
5463
5729
|
const Tag2 = b.ordered ? "ol" : "ul";
|
|
5464
|
-
return /* @__PURE__ */
|
|
5730
|
+
return /* @__PURE__ */ jsx101(Tag2, { className: "agn-md__list", children: b.items.map((t, j) => /* @__PURE__ */ jsx101("li", { children: withBreaks(t) }, j)) }, i);
|
|
5465
5731
|
}
|
|
5466
5732
|
default:
|
|
5467
|
-
return /* @__PURE__ */
|
|
5733
|
+
return /* @__PURE__ */ jsx101("p", { className: "agn-md__p", children: withBreaks(b.text) }, i);
|
|
5468
5734
|
}
|
|
5469
5735
|
}
|
|
5470
5736
|
function ChatMarkdown({ source, className, ...rest }) {
|
|
5471
|
-
const blocks =
|
|
5472
|
-
return /* @__PURE__ */
|
|
5737
|
+
const blocks = React103.useMemo(() => parseBlocks(source), [source]);
|
|
5738
|
+
return /* @__PURE__ */ jsx101("div", { className: cx("agn-md", className), ...rest, children: blocks.map(renderBlock) });
|
|
5473
5739
|
}
|
|
5474
5740
|
|
|
5475
5741
|
// src/chat/ToolCallCard.jsx
|
|
5476
|
-
import
|
|
5477
|
-
import { jsx as
|
|
5742
|
+
import React104 from "react";
|
|
5743
|
+
import { jsx as jsx102, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
5478
5744
|
var STATUS = { running: { icon: "loader-circle", tone: "info", label: "Running" }, ok: { icon: "check", tone: "ok", label: "Done" }, bad: { icon: "circle-x", tone: "bad", label: "Failed" }, pending: { icon: "clock", tone: "neutral", label: "Pending" } };
|
|
5479
5745
|
var show = (v) => v == null ? "" : typeof v === "string" ? v : JSON.stringify(v, null, 2);
|
|
5480
5746
|
var formatDuration = (ms, locale = "tr-TR") => ms == null ? "" : ms < 1e3 ? Math.round(ms) + " ms" : ms < 6e4 ? (ms / 1e3).toLocaleString(locale, { maximumFractionDigits: 1 }) + " s" : Math.floor(ms / 6e4) + ":" + String(Math.round(ms % 6e4 / 1e3)).padStart(2, "0");
|
|
@@ -5483,32 +5749,32 @@ function ToolCallCard({ name, status = "ok", duration, input, output, summary, o
|
|
|
5483
5749
|
const s = STATUS[status] || STATUS.ok;
|
|
5484
5750
|
return /* @__PURE__ */ jsxs94("details", { className: cx("agn-tool", "agn-tool--" + status, className), open: open != null ? open : defaultOpen || void 0, onToggle: (e) => onToggle && onToggle(e.currentTarget.open), ...rest, children: [
|
|
5485
5751
|
/* @__PURE__ */ jsxs94("summary", { className: "agn-tool__head agn-focus", children: [
|
|
5486
|
-
/* @__PURE__ */
|
|
5487
|
-
/* @__PURE__ */
|
|
5488
|
-
/* @__PURE__ */
|
|
5489
|
-
summary && /* @__PURE__ */
|
|
5752
|
+
/* @__PURE__ */ jsx102(Icon, { name: "chevron-right", size: 14, className: "agn-tool__caret" }),
|
|
5753
|
+
/* @__PURE__ */ jsx102(Icon, { name: "wrench", size: 14, className: "agn-tool__icon" }),
|
|
5754
|
+
/* @__PURE__ */ jsx102("span", { className: "agn-tool__name", children: name }),
|
|
5755
|
+
summary && /* @__PURE__ */ jsx102("span", { className: "agn-tool__summary", children: summary }),
|
|
5490
5756
|
/* @__PURE__ */ jsxs94("span", { className: cx("agn-tool__status", "agn-tool__status--" + s.tone), children: [
|
|
5491
|
-
/* @__PURE__ */
|
|
5757
|
+
/* @__PURE__ */ jsx102(Icon, { name: s.icon, size: 11, className: status === "running" ? "agn-tool__spin" : void 0 }),
|
|
5492
5758
|
L[status] || s.label
|
|
5493
5759
|
] }),
|
|
5494
|
-
duration != null && /* @__PURE__ */
|
|
5760
|
+
duration != null && /* @__PURE__ */ jsx102("span", { className: "agn-tool__duration agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
|
|
5495
5761
|
] }),
|
|
5496
5762
|
/* @__PURE__ */ jsxs94("div", { className: "agn-tool__body", children: [
|
|
5497
5763
|
input != null && /* @__PURE__ */ jsxs94("div", { className: "agn-tool__section", children: [
|
|
5498
|
-
/* @__PURE__ */
|
|
5499
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ jsx102("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.input }),
|
|
5765
|
+
/* @__PURE__ */ jsx102("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ jsx102("code", { children: show(input) }) })
|
|
5500
5766
|
] }),
|
|
5501
5767
|
output != null && /* @__PURE__ */ jsxs94("div", { className: "agn-tool__section", children: [
|
|
5502
|
-
/* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5768
|
+
/* @__PURE__ */ jsx102("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.output }),
|
|
5769
|
+
/* @__PURE__ */ jsx102("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ jsx102("code", { children: show(output) }) })
|
|
5504
5770
|
] })
|
|
5505
5771
|
] })
|
|
5506
5772
|
] });
|
|
5507
5773
|
}
|
|
5508
5774
|
|
|
5509
5775
|
// src/chat/StreamingIndicator.jsx
|
|
5510
|
-
import
|
|
5511
|
-
import { jsx as
|
|
5776
|
+
import React105 from "react";
|
|
5777
|
+
import { jsx as jsx103, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
5512
5778
|
function StreamingIndicator({ label, dots = true, inline, labels, className, ...rest }) {
|
|
5513
5779
|
const L = { thinking: "Thinking\u2026", ...labels };
|
|
5514
5780
|
const Tag2 = inline ? "span" : "div";
|
|
@@ -5516,84 +5782,84 @@ function StreamingIndicator({ label, dots = true, inline, labels, className, ...
|
|
|
5516
5782
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
5517
5783
|
/* @__PURE__ */ jsxs95(Tag2, { className: cx("agn-streaming", inline && "agn-streaming--inline", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
5518
5784
|
dots && /* @__PURE__ */ jsxs95("span", { className: "agn-streaming__dots", "aria-hidden": "true", children: [
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5521
|
-
/* @__PURE__ */
|
|
5785
|
+
/* @__PURE__ */ jsx103("i", {}),
|
|
5786
|
+
/* @__PURE__ */ jsx103("i", {}),
|
|
5787
|
+
/* @__PURE__ */ jsx103("i", {})
|
|
5522
5788
|
] }),
|
|
5523
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ jsx103("span", { className: "agn-streaming__text", children: label || L.thinking })
|
|
5524
5790
|
] })
|
|
5525
5791
|
);
|
|
5526
5792
|
}
|
|
5527
5793
|
|
|
5528
5794
|
// src/chat/ChatMessage.jsx
|
|
5529
|
-
import { jsx as
|
|
5795
|
+
import { jsx as jsx104, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
5530
5796
|
var TICK = { sending: "clock", sent: "check", delivered: "check-check", read: "check-check", failed: "circle-alert" };
|
|
5531
5797
|
var initials3 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
|
|
5532
5798
|
function Structured({ data, onAction }) {
|
|
5533
5799
|
const act = (a) => onAction && onAction(a.value != null ? a.value : a.label, a);
|
|
5534
5800
|
return /* @__PURE__ */ jsxs96("div", { className: "agn-msg__structured", children: [
|
|
5535
5801
|
data.image && /* @__PURE__ */ jsxs96("figure", { className: "agn-msg__figure", children: [
|
|
5536
|
-
/* @__PURE__ */
|
|
5537
|
-
data.image.caption && /* @__PURE__ */
|
|
5802
|
+
/* @__PURE__ */ jsx104("img", { className: "agn-msg__image", src: data.image.src, alt: data.image.alt || "" }),
|
|
5803
|
+
data.image.caption && /* @__PURE__ */ jsx104("figcaption", { children: data.image.caption })
|
|
5538
5804
|
] }),
|
|
5539
|
-
data.cards && data.cards.length > 0 && /* @__PURE__ */
|
|
5540
|
-
c.image && /* @__PURE__ */
|
|
5805
|
+
data.cards && data.cards.length > 0 && /* @__PURE__ */ jsx104("div", { className: "agn-msg__cards", children: data.cards.map((c, i) => /* @__PURE__ */ jsxs96("div", { className: "agn-msg__card", children: [
|
|
5806
|
+
c.image && /* @__PURE__ */ jsx104("img", { className: "agn-msg__card-image", src: c.image, alt: c.imageAlt || "" }),
|
|
5541
5807
|
/* @__PURE__ */ jsxs96("div", { className: "agn-msg__card-body", children: [
|
|
5542
|
-
/* @__PURE__ */
|
|
5543
|
-
c.text && /* @__PURE__ */
|
|
5544
|
-
c.actions && /* @__PURE__ */
|
|
5808
|
+
/* @__PURE__ */ jsx104("div", { className: "agn-msg__card-title", children: c.title }),
|
|
5809
|
+
c.text && /* @__PURE__ */ jsx104("div", { className: "agn-msg__card-text", children: c.text }),
|
|
5810
|
+
c.actions && /* @__PURE__ */ jsx104("div", { className: "agn-msg__card-actions", children: c.actions.map((a, j) => /* @__PURE__ */ jsx104(Button, { size: "xs", variant: a.variant || "neutral", onClick: () => act(a), children: a.label }, j)) })
|
|
5545
5811
|
] })
|
|
5546
5812
|
] }, i)) }),
|
|
5547
|
-
data.table && /* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5549
|
-
/* @__PURE__ */
|
|
5813
|
+
data.table && /* @__PURE__ */ jsx104("div", { className: "agn-msg__table-wrap", children: /* @__PURE__ */ jsxs96("table", { className: "agn-msg__table", children: [
|
|
5814
|
+
/* @__PURE__ */ jsx104("thead", { children: /* @__PURE__ */ jsx104("tr", { children: data.table.columns.map((c, i) => /* @__PURE__ */ jsx104("th", { children: c }, i)) }) }),
|
|
5815
|
+
/* @__PURE__ */ jsx104("tbody", { children: data.table.rows.map((r, i) => /* @__PURE__ */ jsx104("tr", { children: r.map((v, j) => /* @__PURE__ */ jsx104("td", { children: v }, j)) }, i)) })
|
|
5550
5816
|
] }) }),
|
|
5551
|
-
data.buttons && data.buttons.length > 0 && /* @__PURE__ */
|
|
5817
|
+
data.buttons && data.buttons.length > 0 && /* @__PURE__ */ jsx104("div", { className: "agn-msg__buttons", children: data.buttons.map((b, i) => /* @__PURE__ */ jsx104(Button, { size: "sm", variant: b.variant || "neutral", icon: b.icon, onClick: () => act(b), children: b.label }, i)) })
|
|
5552
5818
|
] });
|
|
5553
5819
|
}
|
|
5554
5820
|
function ChatMessage({ role = "agent", name, time, status, avatar, children, markdown = true, structured, sources, tools, streaming, onAction, labels, className, ...rest }) {
|
|
5555
5821
|
const L = { sending: "Sending", sent: "Sent", delivered: "Delivered", read: "Read", failed: "Not delivered", sources: "Sources", tools: "tool calls", tool: "tool call", agent: "Agent", you: "You", ...labels };
|
|
5556
5822
|
if (role === "system") return /* @__PURE__ */ jsxs96("div", { className: cx("agn-msg agn-msg--system", className), ...rest, children: [
|
|
5557
|
-
/* @__PURE__ */
|
|
5558
|
-
time && /* @__PURE__ */
|
|
5823
|
+
/* @__PURE__ */ jsx104("span", { className: "agn-msg__system", children }),
|
|
5824
|
+
time && /* @__PURE__ */ jsx104("span", { className: "agn-msg__time", children: time })
|
|
5559
5825
|
] });
|
|
5560
|
-
const body = typeof children === "string" && markdown ? /* @__PURE__ */
|
|
5561
|
-
const side = role === "agent" ? /* @__PURE__ */
|
|
5826
|
+
const body = typeof children === "string" && markdown ? /* @__PURE__ */ jsx104(ChatMarkdown, { source: children }) : children;
|
|
5827
|
+
const side = role === "agent" ? /* @__PURE__ */ jsx104("span", { className: "agn-msg__tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx104(Icon, { name: "bot", size: 14 }) }) : role === "human-agent" || avatar ? /* @__PURE__ */ jsx104("span", { className: "agn-msg__avatar", "aria-hidden": "true", children: typeof avatar === "string" ? initials3(avatar) : avatar || initials3(name) }) : null;
|
|
5562
5828
|
return /* @__PURE__ */ jsxs96("div", { className: cx("agn-msg", "agn-msg--" + role, streaming && "agn-msg--streaming", className), ...rest, children: [
|
|
5563
|
-
side && /* @__PURE__ */
|
|
5829
|
+
side && /* @__PURE__ */ jsx104("div", { className: "agn-msg__side", children: side }),
|
|
5564
5830
|
/* @__PURE__ */ jsxs96("div", { className: "agn-msg__col", children: [
|
|
5565
|
-
(name || role === "agent") && /* @__PURE__ */
|
|
5831
|
+
(name || role === "agent") && /* @__PURE__ */ jsx104("div", { className: "agn-msg__name", children: name || L.agent }),
|
|
5566
5832
|
/* @__PURE__ */ jsxs96("div", { className: "agn-msg__bubble", children: [
|
|
5567
5833
|
body,
|
|
5568
|
-
streaming && (children == null || children === "" ? /* @__PURE__ */
|
|
5834
|
+
streaming && (children == null || children === "" ? /* @__PURE__ */ jsx104(StreamingIndicator, { inline: true }) : /* @__PURE__ */ jsx104("span", { className: "agn-msg__cursor", "aria-hidden": "true" }))
|
|
5569
5835
|
] }),
|
|
5570
|
-
structured && /* @__PURE__ */
|
|
5836
|
+
structured && /* @__PURE__ */ jsx104(Structured, { data: structured, onAction }),
|
|
5571
5837
|
tools && tools.length > 0 && /* @__PURE__ */ jsxs96("details", { className: "agn-msg__tools", children: [
|
|
5572
5838
|
/* @__PURE__ */ jsxs96("summary", { className: "agn-msg__tools-head agn-focus", children: [
|
|
5573
|
-
/* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5839
|
+
/* @__PURE__ */ jsx104(Icon, { name: "chevron-right", size: 12, className: "agn-msg__tools-caret" }),
|
|
5840
|
+
/* @__PURE__ */ jsx104(Icon, { name: "wrench", size: 12 }),
|
|
5575
5841
|
tools.length,
|
|
5576
5842
|
" ",
|
|
5577
5843
|
tools.length === 1 ? L.tool : L.tools
|
|
5578
5844
|
] }),
|
|
5579
|
-
/* @__PURE__ */
|
|
5845
|
+
/* @__PURE__ */ jsx104("div", { className: "agn-msg__tools-body", children: tools.map((t, i) => /* @__PURE__ */ jsx104(ToolCallCard, { ...t }, t.id || i)) })
|
|
5580
5846
|
] }),
|
|
5581
5847
|
sources && sources.length > 0 && /* @__PURE__ */ jsxs96("div", { className: "agn-msg__sources", children: [
|
|
5582
|
-
/* @__PURE__ */
|
|
5583
|
-
/* @__PURE__ */
|
|
5584
|
-
/* @__PURE__ */
|
|
5848
|
+
/* @__PURE__ */ jsx104("span", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.sources }),
|
|
5849
|
+
/* @__PURE__ */ jsx104("ul", { className: "agn-msg__source-list", children: sources.map((s, i) => /* @__PURE__ */ jsx104("li", { children: s.href ? /* @__PURE__ */ jsxs96("a", { className: "agn-msg__source", href: s.href, target: "_blank", rel: "noopener noreferrer", children: [
|
|
5850
|
+
/* @__PURE__ */ jsx104(Icon, { name: s.icon || "file-text", size: 11 }),
|
|
5585
5851
|
s.label
|
|
5586
5852
|
] }) : /* @__PURE__ */ jsxs96("span", { className: "agn-msg__source", children: [
|
|
5587
|
-
/* @__PURE__ */
|
|
5853
|
+
/* @__PURE__ */ jsx104(Icon, { name: s.icon || "file-text", size: 11 }),
|
|
5588
5854
|
s.label
|
|
5589
5855
|
] }) }, i)) })
|
|
5590
5856
|
] }),
|
|
5591
5857
|
(time || status) && /* @__PURE__ */ jsxs96("div", { className: "agn-msg__meta", children: [
|
|
5592
|
-
time && /* @__PURE__ */
|
|
5858
|
+
time && /* @__PURE__ */ jsx104("span", { className: "agn-msg__time", children: time }),
|
|
5593
5859
|
status && TICK[status] && /* @__PURE__ */ jsxs96("span", { className: cx("agn-msg__tick", "agn-msg__tick--" + status), title: L[status], children: [
|
|
5594
|
-
/* @__PURE__ */
|
|
5595
|
-
/* @__PURE__ */
|
|
5596
|
-
status === "failed" && /* @__PURE__ */
|
|
5860
|
+
/* @__PURE__ */ jsx104(Icon, { name: TICK[status], size: 12 }),
|
|
5861
|
+
/* @__PURE__ */ jsx104("span", { className: "agn-sr", children: L[status] }),
|
|
5862
|
+
status === "failed" && /* @__PURE__ */ jsx104("span", { className: "agn-msg__tick-text", children: L.failed })
|
|
5597
5863
|
] })
|
|
5598
5864
|
] })
|
|
5599
5865
|
] })
|
|
@@ -5601,8 +5867,8 @@ function ChatMessage({ role = "agent", name, time, status, avatar, children, mar
|
|
|
5601
5867
|
}
|
|
5602
5868
|
|
|
5603
5869
|
// src/chat/ChatEvent.jsx
|
|
5604
|
-
import
|
|
5605
|
-
import { jsx as
|
|
5870
|
+
import React107 from "react";
|
|
5871
|
+
import { jsx as jsx105, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
5606
5872
|
var EVENT_KINDS = {
|
|
5607
5873
|
"handoff-requested": { icon: "hand", tone: "warn", label: "Handoff requested" },
|
|
5608
5874
|
"handoff-accepted": { icon: "user-check", tone: "ok", label: "Handoff accepted" },
|
|
@@ -5617,24 +5883,24 @@ function ChatEvent({ kind = "info", tone, icon, time, children, className, ...re
|
|
|
5617
5883
|
return (
|
|
5618
5884
|
// biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
|
|
5619
5885
|
/* @__PURE__ */ jsxs97("div", { className: cx("agn-chat-event", "agn-chat-event--" + (tone || k.tone), className), role: "status", ...rest, children: [
|
|
5620
|
-
/* @__PURE__ */
|
|
5621
|
-
/* @__PURE__ */
|
|
5622
|
-
time && /* @__PURE__ */
|
|
5886
|
+
/* @__PURE__ */ jsx105(Icon, { name: icon || k.icon, size: 12 }),
|
|
5887
|
+
/* @__PURE__ */ jsx105("span", { className: "agn-chat-event__text", children: children != null ? children : k.label }),
|
|
5888
|
+
time && /* @__PURE__ */ jsx105("span", { className: "agn-chat-event__time", children: time })
|
|
5623
5889
|
] })
|
|
5624
5890
|
);
|
|
5625
5891
|
}
|
|
5626
5892
|
|
|
5627
5893
|
// src/chat/ChatSuggestions.jsx
|
|
5628
|
-
import
|
|
5629
|
-
import { jsx as
|
|
5894
|
+
import React108 from "react";
|
|
5895
|
+
import { jsx as jsx106, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
5630
5896
|
function ChatSuggestions({ items = [], onPick, row, labels, className, ...rest }) {
|
|
5631
5897
|
const L = { suggestions: "Suggestions", ...labels };
|
|
5632
5898
|
return (
|
|
5633
5899
|
// biome-ignore lint/a11y/useSemanticElements: a labelled role=group is the intended semantics for this cluster; <fieldset> brings form semantics, a legend and UA chrome it does not want
|
|
5634
|
-
/* @__PURE__ */
|
|
5900
|
+
/* @__PURE__ */ jsx106("div", { className: cx("agn-chat-suggest", row && "agn-chat-suggest--row", className), role: "group", "aria-label": L.suggestions, ...rest, children: items.map((s, i) => {
|
|
5635
5901
|
const item = typeof s === "string" ? { label: s } : s;
|
|
5636
5902
|
return /* @__PURE__ */ jsxs98("button", { type: "button", className: "agn-chat-suggest__chip agn-focus", onClick: () => onPick && onPick(item.value != null ? item.value : item.label, item), children: [
|
|
5637
|
-
item.icon && /* @__PURE__ */
|
|
5903
|
+
item.icon && /* @__PURE__ */ jsx106(Icon, { name: item.icon, size: 12 }),
|
|
5638
5904
|
item.label
|
|
5639
5905
|
] }, i);
|
|
5640
5906
|
}) })
|
|
@@ -5642,17 +5908,17 @@ function ChatSuggestions({ items = [], onPick, row, labels, className, ...rest }
|
|
|
5642
5908
|
}
|
|
5643
5909
|
|
|
5644
5910
|
// src/chat/ChatComposer.jsx
|
|
5645
|
-
import
|
|
5646
|
-
import { Fragment as
|
|
5911
|
+
import React109 from "react";
|
|
5912
|
+
import { Fragment as Fragment13, jsx as jsx107, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
5647
5913
|
var fmtSize2 = (b) => b >= 1048576 ? (b / 1048576).toFixed(1) + " MB" : b >= 1024 ? Math.round(b / 1024) + " KB" : b + " B";
|
|
5648
5914
|
function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, streaming, disabled, placeholder, attach = true, maxFiles = 5, maxFileSize = 10 * 1048576, files = [], onAttach, onRemoveFile, voice = "off", onDictate, onHandsFree, footnote, toolbar, header, maxRows = 8, labels, className, ...rest }) {
|
|
5649
5915
|
const L = { placeholder: "Message the agent\u2026", send: "Send", stop: "Stop", attach: "Attach files", attachHint: "Up to 5 files, 10 MB each", dictate: "Dictate", handsFree: "Hands-free voice", listening: "Listening\u2026", speaking: "Speaking\u2026", remove: "Remove", tooMany: "You can attach up to 5 files.", tooLarge: "Each file must be under 10 MB.", ...labels };
|
|
5650
|
-
const [own, setOwn] =
|
|
5651
|
-
const [err, setErr] =
|
|
5916
|
+
const [own, setOwn] = React109.useState(defaultValue);
|
|
5917
|
+
const [err, setErr] = React109.useState(null);
|
|
5652
5918
|
const val = value != null ? value : own;
|
|
5653
|
-
const ta =
|
|
5654
|
-
const file =
|
|
5655
|
-
const id =
|
|
5919
|
+
const ta = React109.useRef(null);
|
|
5920
|
+
const file = React109.useRef(null);
|
|
5921
|
+
const id = React109.useMemo(() => uid("chatbox"), []);
|
|
5656
5922
|
const grow = () => {
|
|
5657
5923
|
const el = ta.current;
|
|
5658
5924
|
if (!el) return;
|
|
@@ -5660,7 +5926,7 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
|
|
|
5660
5926
|
const line = parseFloat(getComputedStyle(el).lineHeight) || 20;
|
|
5661
5927
|
el.style.height = Math.min(el.scrollHeight, line * maxRows + 16) + "px";
|
|
5662
5928
|
};
|
|
5663
|
-
|
|
5929
|
+
React109.useEffect(grow, [val, maxRows]);
|
|
5664
5930
|
const set = (v) => {
|
|
5665
5931
|
if (value == null) setOwn(v);
|
|
5666
5932
|
onChange && onChange(v);
|
|
@@ -5691,14 +5957,14 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
|
|
|
5691
5957
|
const canSend = streaming || !disabled && (val.trim().length > 0 || files.length > 0);
|
|
5692
5958
|
return /* @__PURE__ */ jsxs99("div", { className: cx("agn-chatbox", disabled && "agn-chatbox--disabled", className), ...rest, children: [
|
|
5693
5959
|
/* @__PURE__ */ jsxs99("div", { className: "agn-chatbox__box", children: [
|
|
5694
|
-
header && /* @__PURE__ */
|
|
5695
|
-
files.length > 0 && /* @__PURE__ */
|
|
5696
|
-
/* @__PURE__ */
|
|
5697
|
-
/* @__PURE__ */
|
|
5698
|
-
f.size != null && /* @__PURE__ */
|
|
5699
|
-
onRemoveFile && /* @__PURE__ */
|
|
5960
|
+
header && /* @__PURE__ */ jsx107("div", { className: "agn-chatbox__header", children: header }),
|
|
5961
|
+
files.length > 0 && /* @__PURE__ */ jsx107("ul", { className: "agn-chatbox__files", children: files.map((f, i) => /* @__PURE__ */ jsxs99("li", { className: "agn-chatbox__file", children: [
|
|
5962
|
+
/* @__PURE__ */ jsx107(Icon, { name: "paperclip", size: 11 }),
|
|
5963
|
+
/* @__PURE__ */ jsx107("span", { className: "agn-chatbox__file-name", children: f.name }),
|
|
5964
|
+
f.size != null && /* @__PURE__ */ jsx107("span", { className: "agn-chatbox__file-size", children: fmtSize2(f.size) }),
|
|
5965
|
+
onRemoveFile && /* @__PURE__ */ jsx107("button", { type: "button", className: "agn-chatbox__file-x", "aria-label": L.remove + " " + f.name, onClick: () => onRemoveFile(f, i), children: /* @__PURE__ */ jsx107(Icon, { name: "x", size: 11 }) })
|
|
5700
5966
|
] }, i)) }),
|
|
5701
|
-
/* @__PURE__ */
|
|
5967
|
+
/* @__PURE__ */ jsx107(
|
|
5702
5968
|
"textarea",
|
|
5703
5969
|
{
|
|
5704
5970
|
ref: ta,
|
|
@@ -5720,51 +5986,51 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
|
|
|
5720
5986
|
),
|
|
5721
5987
|
/* @__PURE__ */ jsxs99("div", { className: "agn-chatbox__bar", children: [
|
|
5722
5988
|
/* @__PURE__ */ jsxs99("div", { className: "agn-chatbox__tools", children: [
|
|
5723
|
-
attach && /* @__PURE__ */ jsxs99(
|
|
5724
|
-
/* @__PURE__ */
|
|
5725
|
-
/* @__PURE__ */
|
|
5989
|
+
attach && /* @__PURE__ */ jsxs99(Fragment13, { children: [
|
|
5990
|
+
/* @__PURE__ */ jsx107("input", { ref: file, type: "file", multiple: true, className: "agn-sr", tabIndex: -1, "aria-hidden": "true", onChange: pick }),
|
|
5991
|
+
/* @__PURE__ */ jsx107(ButtonIcon, { icon: "paperclip", label: L.attach + " \xB7 " + L.attachHint, size: "sm", disabled, onClick: () => file.current && file.current.click() })
|
|
5726
5992
|
] }),
|
|
5727
|
-
voice !== "off" && /* @__PURE__ */ jsxs99(
|
|
5728
|
-
/* @__PURE__ */
|
|
5729
|
-
/* @__PURE__ */
|
|
5993
|
+
voice !== "off" && /* @__PURE__ */ jsxs99(Fragment13, { children: [
|
|
5994
|
+
/* @__PURE__ */ jsx107(ButtonIcon, { icon: "mic", label: L.dictate, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "listening" && "agn-chatbox__voice--on"), "aria-pressed": voice === "listening", onClick: onDictate }),
|
|
5995
|
+
/* @__PURE__ */ jsx107(ButtonIcon, { icon: "audio-lines", label: L.handsFree, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "speaking" && "agn-chatbox__voice--on"), "aria-pressed": voice === "speaking", onClick: onHandsFree }),
|
|
5730
5996
|
(voice === "listening" || voice === "speaking") && /* @__PURE__ */ jsxs99("span", { className: "agn-chatbox__voice-state", role: "status", children: [
|
|
5731
|
-
/* @__PURE__ */
|
|
5997
|
+
/* @__PURE__ */ jsx107("span", { className: "agn-chatbox__voice-dot", "aria-hidden": "true" }),
|
|
5732
5998
|
voice === "listening" ? L.listening : L.speaking
|
|
5733
5999
|
] })
|
|
5734
6000
|
] }),
|
|
5735
|
-
toolbar && /* @__PURE__ */
|
|
5736
|
-
err && /* @__PURE__ */
|
|
6001
|
+
toolbar && /* @__PURE__ */ jsx107("div", { className: "agn-chatbox__toolbar", children: toolbar }),
|
|
6002
|
+
err && /* @__PURE__ */ jsx107("span", { className: "agn-chatbox__error", role: "alert", children: err })
|
|
5737
6003
|
] }),
|
|
5738
|
-
/* @__PURE__ */
|
|
6004
|
+
/* @__PURE__ */ jsx107(ButtonIcon, { icon: streaming ? "square" : "arrow-up", label: streaming ? L.stop : L.send, variant: streaming ? "destructive-text" : "primary", size: "sm", disabled: !canSend, onClick: send, className: "agn-chatbox__send" })
|
|
5739
6005
|
] })
|
|
5740
6006
|
] }),
|
|
5741
|
-
footnote && /* @__PURE__ */
|
|
6007
|
+
footnote && /* @__PURE__ */ jsx107("div", { className: "agn-chatbox__footnote", children: footnote })
|
|
5742
6008
|
] });
|
|
5743
6009
|
}
|
|
5744
6010
|
|
|
5745
6011
|
// src/chat/TranscriptPanel.jsx
|
|
5746
|
-
import
|
|
5747
|
-
import { jsx as
|
|
6012
|
+
import React110 from "react";
|
|
6013
|
+
import { jsx as jsx108, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
5748
6014
|
var VERDICT_ICON = { ok: "circle-check", bad: "circle-x", warn: "triangle-alert", neutral: "info", info: "info" };
|
|
5749
6015
|
function TranscriptPanel({ title, meta, turns = [], verdict, selected, onSelect, maxHeight = 420, locale = "tr-TR", labels, className, ...rest }) {
|
|
5750
6016
|
const L = { agent: "Agent", customer: "Customer", system: "System", judge: "Judge", latency: "latency", flagged: "Flagged", empty: "No turns", ...labels };
|
|
5751
6017
|
const Row = onSelect ? "button" : "div";
|
|
5752
6018
|
return /* @__PURE__ */ jsxs100("section", { className: cx("agn-transcript", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
|
|
5753
6019
|
(title || meta) && /* @__PURE__ */ jsxs100("header", { className: "agn-transcript__head", children: [
|
|
5754
|
-
title && /* @__PURE__ */
|
|
5755
|
-
meta && /* @__PURE__ */
|
|
6020
|
+
title && /* @__PURE__ */ jsx108("h3", { className: "agn-transcript__title", children: title }),
|
|
6021
|
+
meta && /* @__PURE__ */ jsx108("div", { className: "agn-transcript__meta", children: meta })
|
|
5756
6022
|
] }),
|
|
5757
6023
|
verdict && /* @__PURE__ */ jsxs100("div", { className: cx("agn-transcript__verdict", "agn-transcript__verdict--" + (verdict.tone || "neutral")), children: [
|
|
5758
|
-
/* @__PURE__ */
|
|
6024
|
+
/* @__PURE__ */ jsx108(Icon, { name: VERDICT_ICON[verdict.tone] || "info", size: 14 }),
|
|
5759
6025
|
/* @__PURE__ */ jsxs100("span", { className: "agn-transcript__verdict-label", children: [
|
|
5760
6026
|
L.judge,
|
|
5761
6027
|
" \xB7 ",
|
|
5762
6028
|
verdict.label
|
|
5763
6029
|
] }),
|
|
5764
|
-
verdict.score != null && /* @__PURE__ */
|
|
5765
|
-
verdict.summary && /* @__PURE__ */
|
|
5766
|
-
verdict.dimensions && /* @__PURE__ */
|
|
5767
|
-
/* @__PURE__ */
|
|
6030
|
+
verdict.score != null && /* @__PURE__ */ jsx108("span", { className: "agn-transcript__verdict-score agn-num", children: verdict.score }),
|
|
6031
|
+
verdict.summary && /* @__PURE__ */ jsx108("span", { className: "agn-transcript__verdict-text", children: verdict.summary }),
|
|
6032
|
+
verdict.dimensions && /* @__PURE__ */ jsx108("ul", { className: "agn-transcript__dims", children: verdict.dimensions.map((d, i) => /* @__PURE__ */ jsxs100("li", { className: cx("agn-transcript__dim", d.pass ? "agn-transcript__dim--ok" : "agn-transcript__dim--bad"), children: [
|
|
6033
|
+
/* @__PURE__ */ jsx108(Icon, { name: d.pass ? "check" : "x", size: 10 }),
|
|
5768
6034
|
d.name
|
|
5769
6035
|
] }, i)) })
|
|
5770
6036
|
] }),
|
|
@@ -5772,31 +6038,31 @@ function TranscriptPanel({ title, meta, turns = [], verdict, selected, onSelect,
|
|
|
5772
6038
|
turns.map((t, i) => {
|
|
5773
6039
|
const n = t.n != null ? t.n : i + 1;
|
|
5774
6040
|
const sel = selected != null && selected === (t.id != null ? t.id : n);
|
|
5775
|
-
return /* @__PURE__ */
|
|
5776
|
-
/* @__PURE__ */
|
|
5777
|
-
/* @__PURE__ */
|
|
6041
|
+
return /* @__PURE__ */ jsx108("li", { className: cx("agn-transcript__turn", "agn-transcript__turn--" + (t.speaker || "agent"), t.flagged && "agn-transcript__turn--flagged", sel && "agn-transcript__turn--selected"), children: /* @__PURE__ */ jsxs100(Row, { type: onSelect ? "button" : void 0, className: "agn-transcript__row agn-focus-inset", "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(t.id != null ? t.id : n, t) : void 0, children: [
|
|
6042
|
+
/* @__PURE__ */ jsx108("span", { className: "agn-transcript__n agn-num", children: String(n).padStart(2, "0") }),
|
|
6043
|
+
/* @__PURE__ */ jsx108("span", { className: "agn-transcript__speaker", children: t.name || L[t.speaker] || t.speaker }),
|
|
5778
6044
|
/* @__PURE__ */ jsxs100("span", { className: "agn-transcript__text", children: [
|
|
5779
6045
|
t.text,
|
|
5780
|
-
t.note && /* @__PURE__ */
|
|
6046
|
+
t.note && /* @__PURE__ */ jsx108("span", { className: "agn-transcript__note", children: t.note })
|
|
5781
6047
|
] }),
|
|
5782
6048
|
/* @__PURE__ */ jsxs100("span", { className: "agn-transcript__right", children: [
|
|
5783
6049
|
t.flagged && /* @__PURE__ */ jsxs100("span", { className: "agn-transcript__flag", children: [
|
|
5784
|
-
/* @__PURE__ */
|
|
6050
|
+
/* @__PURE__ */ jsx108(Icon, { name: "flag", size: 11 }),
|
|
5785
6051
|
L.flagged
|
|
5786
6052
|
] }),
|
|
5787
|
-
t.latencyMs != null && /* @__PURE__ */
|
|
5788
|
-
t.time && /* @__PURE__ */
|
|
6053
|
+
t.latencyMs != null && /* @__PURE__ */ jsx108("span", { className: "agn-transcript__latency agn-num", title: L.latency, children: formatDuration(t.latencyMs, locale) }),
|
|
6054
|
+
t.time && /* @__PURE__ */ jsx108("span", { className: "agn-transcript__time agn-num", children: t.time })
|
|
5789
6055
|
] })
|
|
5790
6056
|
] }) }, t.id != null ? t.id : n);
|
|
5791
6057
|
}),
|
|
5792
|
-
!turns.length && /* @__PURE__ */
|
|
6058
|
+
!turns.length && /* @__PURE__ */ jsx108("li", { className: "agn-transcript__empty", children: L.empty })
|
|
5793
6059
|
] })
|
|
5794
6060
|
] });
|
|
5795
6061
|
}
|
|
5796
6062
|
|
|
5797
6063
|
// src/widgets/ApprovalCard.jsx
|
|
5798
|
-
import
|
|
5799
|
-
import { Fragment as
|
|
6064
|
+
import React111 from "react";
|
|
6065
|
+
import { Fragment as Fragment14, jsx as jsx109, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
5800
6066
|
var STATUS2 = { pending: { tone: "warn", icon: "pause", label: "Paused \xB7 approval" }, approved: { tone: "ok", icon: "circle-check", label: "Approved" }, rejected: { tone: "bad", icon: "circle-x", label: "Rejected" }, queued: { tone: "neutral", icon: "clock", label: "Queued" } };
|
|
5801
6067
|
function Field({ f, value, onChange, disabled, id }) {
|
|
5802
6068
|
const set = (v) => onChange && onChange(f.key, v);
|
|
@@ -5804,93 +6070,93 @@ function Field({ f, value, onChange, disabled, id }) {
|
|
|
5804
6070
|
switch (f.type) {
|
|
5805
6071
|
case "boolean":
|
|
5806
6072
|
return /* @__PURE__ */ jsxs101("label", { className: "agn-approval__check", children: [
|
|
5807
|
-
/* @__PURE__ */
|
|
5808
|
-
/* @__PURE__ */
|
|
6073
|
+
/* @__PURE__ */ jsx109("input", { type: "checkbox", checked: !!value, onChange: (e) => set(e.target.checked), ...common }),
|
|
6074
|
+
/* @__PURE__ */ jsx109("span", { children: f.label })
|
|
5809
6075
|
] });
|
|
5810
6076
|
case "number":
|
|
5811
|
-
return /* @__PURE__ */
|
|
6077
|
+
return /* @__PURE__ */ jsx109("input", { className: "agn-approval__input agn-num", type: "number", value: value == null ? "" : value, min: f.min, max: f.max, step: f.step, placeholder: f.placeholder, onChange: (e) => set(e.target.value === "" ? null : Number(e.target.value)), ...common });
|
|
5812
6078
|
case "json":
|
|
5813
|
-
return /* @__PURE__ */
|
|
6079
|
+
return /* @__PURE__ */ jsx109("textarea", { className: "agn-approval__input agn-approval__input--json", rows: 4, value: typeof value === "string" ? value : value == null ? "" : JSON.stringify(value, null, 2), spellCheck: false, onChange: (e) => set(e.target.value), ...common });
|
|
5814
6080
|
case "select":
|
|
5815
6081
|
return /* @__PURE__ */ jsxs101("select", { className: "agn-approval__input", value: value == null ? "" : value, onChange: (e) => set(e.target.value), ...common, children: [
|
|
5816
|
-
f.placeholder && /* @__PURE__ */
|
|
6082
|
+
f.placeholder && /* @__PURE__ */ jsx109("option", { value: "", children: f.placeholder }),
|
|
5817
6083
|
(f.options || []).map((o) => {
|
|
5818
6084
|
const opt = typeof o === "string" ? { value: o, label: o } : o;
|
|
5819
|
-
return /* @__PURE__ */
|
|
6085
|
+
return /* @__PURE__ */ jsx109("option", { value: opt.value, children: opt.label }, opt.value);
|
|
5820
6086
|
})
|
|
5821
6087
|
] });
|
|
5822
6088
|
default:
|
|
5823
|
-
return /* @__PURE__ */
|
|
6089
|
+
return /* @__PURE__ */ jsx109("input", { className: "agn-approval__input", type: "text", value: value == null ? "" : value, placeholder: f.placeholder, onChange: (e) => set(e.target.value), ...common });
|
|
5824
6090
|
}
|
|
5825
6091
|
}
|
|
5826
6092
|
function ApprovalCard({ agent, runId, tenant, requestedAt, requester, reason, proposal = [], fields = [], values: valProp, onChange, status = "pending", queuePosition, decidedBy, decidedAt, onApprove, onReject, onAsk, onAlways, actions, variant = "approval", loading: loading2, compact, labels, className, ...rest }) {
|
|
5827
6093
|
const perm = variant === "permission";
|
|
5828
6094
|
const L = { eyebrow: perm ? "Permission request" : "Human approval", allowOnce: "Allow once", always: "Always allow", deny: "Deny", reason: "Why the agent stopped", proposes: "Agent proposes", decision: "Your decision", approve: "Approve", reject: "Reject", ask: "Ask the agent", queued: "Queued", ahead: "ahead", by: "by", pending: "Paused \xB7 approval", approved: "Approved", rejected: "Rejected", ...labels };
|
|
5829
|
-
const [own, setOwn] =
|
|
6095
|
+
const [own, setOwn] = React111.useState(() => Object.fromEntries(fields.map((f) => [f.key, f.value])));
|
|
5830
6096
|
const values = valProp || own;
|
|
5831
6097
|
const change = (k, v) => {
|
|
5832
6098
|
if (!valProp) setOwn((o) => ({ ...o, [k]: v }));
|
|
5833
6099
|
onChange && onChange(k, v, { ...values, [k]: v });
|
|
5834
6100
|
};
|
|
5835
|
-
const id =
|
|
6101
|
+
const id = React111.useMemo(() => uid("approval"), []);
|
|
5836
6102
|
const s = STATUS2[status] || STATUS2.pending;
|
|
5837
6103
|
const open = status === "pending";
|
|
5838
6104
|
const decide = (fn) => () => fn && fn(values);
|
|
5839
6105
|
return /* @__PURE__ */ jsxs101("section", { className: cx("agn-approval", "agn-approval--" + status, perm && "agn-approval--permission", compact && "agn-approval--compact", className), "aria-labelledby": id + "-t", ...rest, children: [
|
|
5840
6106
|
/* @__PURE__ */ jsxs101("header", { className: "agn-approval__head", children: [
|
|
5841
6107
|
/* @__PURE__ */ jsxs101("div", { className: "agn-approval__heading", children: [
|
|
5842
|
-
/* @__PURE__ */
|
|
5843
|
-
/* @__PURE__ */
|
|
5844
|
-
/* @__PURE__ */
|
|
6108
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-eyebrow", children: L.eyebrow }),
|
|
6109
|
+
/* @__PURE__ */ jsx109("h3", { id: id + "-t", className: "agn-approval__title", children: agent }),
|
|
6110
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-approval__meta", children: [runId, tenant, requestedAt].filter(Boolean).map((x, i) => /* @__PURE__ */ jsx109("span", { children: x }, i)) })
|
|
5845
6111
|
] }),
|
|
5846
6112
|
!perm && /* @__PURE__ */ jsxs101("span", { className: cx("agn-approval__status", "agn-approval__status--" + s.tone), children: [
|
|
5847
|
-
/* @__PURE__ */
|
|
6113
|
+
/* @__PURE__ */ jsx109(Icon, { name: s.icon, size: 12 }),
|
|
5848
6114
|
status === "queued" && queuePosition != null ? `${L.queued} (${queuePosition} ${L.ahead})` : L[status] || s.label
|
|
5849
6115
|
] })
|
|
5850
6116
|
] }),
|
|
5851
6117
|
reason && /* @__PURE__ */ jsxs101("div", { className: "agn-approval__reason", role: "note", children: [
|
|
5852
|
-
/* @__PURE__ */
|
|
6118
|
+
/* @__PURE__ */ jsx109(Icon, { name: "triangle-alert", size: 16 }),
|
|
5853
6119
|
/* @__PURE__ */ jsxs101("div", { children: [
|
|
5854
|
-
/* @__PURE__ */
|
|
5855
|
-
/* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-approval__reason-label", children: L.reason }),
|
|
6121
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-approval__reason-text", children: reason })
|
|
5856
6122
|
] })
|
|
5857
6123
|
] }),
|
|
5858
6124
|
proposal.length > 0 && /* @__PURE__ */ jsxs101("div", { className: "agn-approval__section", children: [
|
|
5859
|
-
/* @__PURE__ */
|
|
5860
|
-
/* @__PURE__ */
|
|
5861
|
-
/* @__PURE__ */
|
|
5862
|
-
/* @__PURE__ */
|
|
6125
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.proposes }),
|
|
6126
|
+
/* @__PURE__ */ jsx109("dl", { className: "agn-approval__kv", children: proposal.map((p, i) => /* @__PURE__ */ jsxs101("div", { className: "agn-approval__kv-row", children: [
|
|
6127
|
+
/* @__PURE__ */ jsx109("dt", { children: p.label }),
|
|
6128
|
+
/* @__PURE__ */ jsx109("dd", { className: p.mono ? "agn-mono" : void 0, children: p.value })
|
|
5863
6129
|
] }, i)) })
|
|
5864
6130
|
] }),
|
|
5865
6131
|
fields.length > 0 && /* @__PURE__ */ jsxs101("div", { className: "agn-approval__section", children: [
|
|
5866
|
-
/* @__PURE__ */
|
|
5867
|
-
/* @__PURE__ */
|
|
6132
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.decision }),
|
|
6133
|
+
/* @__PURE__ */ jsx109("div", { className: "agn-approval__form", children: fields.map((f) => /* @__PURE__ */ jsxs101("div", { className: cx("agn-approval__field", f.type === "boolean" && "agn-approval__field--check"), children: [
|
|
5868
6134
|
f.type !== "boolean" && /* @__PURE__ */ jsxs101("label", { className: "agn-approval__label", htmlFor: id + "-" + f.key, children: [
|
|
5869
6135
|
f.label,
|
|
5870
|
-
f.required && /* @__PURE__ */
|
|
6136
|
+
f.required && /* @__PURE__ */ jsx109("span", { "aria-hidden": "true", children: " *" })
|
|
5871
6137
|
] }),
|
|
5872
|
-
/* @__PURE__ */
|
|
5873
|
-
f.help && /* @__PURE__ */
|
|
6138
|
+
/* @__PURE__ */ jsx109(Field, { f, id: id + "-" + f.key, value: values[f.key], onChange: change, disabled: !open || loading2 }),
|
|
6139
|
+
f.help && /* @__PURE__ */ jsx109("div", { id: id + "-" + f.key + "-help", className: "agn-approval__help", children: f.help })
|
|
5874
6140
|
] }, f.key)) })
|
|
5875
6141
|
] }),
|
|
5876
6142
|
/* @__PURE__ */ jsxs101("footer", { className: "agn-approval__foot", children: [
|
|
5877
|
-
open && actions && actions.map((a, i) => /* @__PURE__ */
|
|
5878
|
-
open && !actions && perm && /* @__PURE__ */ jsxs101(
|
|
5879
|
-
/* @__PURE__ */
|
|
5880
|
-
/* @__PURE__ */
|
|
5881
|
-
/* @__PURE__ */
|
|
6143
|
+
open && actions && actions.map((a, i) => /* @__PURE__ */ jsx109(Button, { variant: a.variant || "neutral", icon: a.icon, loading: a.loading, disabled: loading2 || a.disabled, onClick: () => a.onClick && a.onClick(values), children: a.label }, a.id || i)),
|
|
6144
|
+
open && !actions && perm && /* @__PURE__ */ jsxs101(Fragment14, { children: [
|
|
6145
|
+
/* @__PURE__ */ jsx109(Button, { variant: "primary", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.allowOnce }),
|
|
6146
|
+
/* @__PURE__ */ jsx109(Button, { variant: "neutral", icon: "check-check", disabled: loading2, onClick: decide(onAlways), children: L.always }),
|
|
6147
|
+
/* @__PURE__ */ jsx109(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.deny })
|
|
5882
6148
|
] }),
|
|
5883
|
-
open && !actions && !perm && /* @__PURE__ */ jsxs101(
|
|
5884
|
-
/* @__PURE__ */
|
|
5885
|
-
/* @__PURE__ */
|
|
5886
|
-
onAsk && /* @__PURE__ */
|
|
6149
|
+
open && !actions && !perm && /* @__PURE__ */ jsxs101(Fragment14, { children: [
|
|
6150
|
+
/* @__PURE__ */ jsx109(Button, { variant: "success", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.approve }),
|
|
6151
|
+
/* @__PURE__ */ jsx109(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.reject }),
|
|
6152
|
+
onAsk && /* @__PURE__ */ jsx109(Button, { variant: "neutral", icon: "message-square", disabled: loading2, onClick: decide(onAsk), children: L.ask })
|
|
5887
6153
|
] }),
|
|
5888
6154
|
status === "queued" && /* @__PURE__ */ jsxs101("span", { className: "agn-approval__note", children: [
|
|
5889
|
-
/* @__PURE__ */
|
|
6155
|
+
/* @__PURE__ */ jsx109(Icon, { name: "clock", size: 14 }),
|
|
5890
6156
|
queuePosition != null ? `${L.queued} (${queuePosition} ${L.ahead})` : L.queued
|
|
5891
6157
|
] }),
|
|
5892
6158
|
(status === "approved" || status === "rejected") && /* @__PURE__ */ jsxs101("span", { className: cx("agn-approval__note", "agn-approval__note--" + s.tone), children: [
|
|
5893
|
-
/* @__PURE__ */
|
|
6159
|
+
/* @__PURE__ */ jsx109(Icon, { name: s.icon, size: 14 }),
|
|
5894
6160
|
L[status],
|
|
5895
6161
|
decidedBy && ` ${L.by} ${decidedBy}`,
|
|
5896
6162
|
decidedAt && /* @__PURE__ */ jsxs101("span", { className: "agn-approval__note-time agn-num", children: [
|
|
@@ -5903,11 +6169,11 @@ function ApprovalCard({ agent, runId, tenant, requestedAt, requester, reason, pr
|
|
|
5903
6169
|
}
|
|
5904
6170
|
|
|
5905
6171
|
// src/widgets/RunTimeline.jsx
|
|
5906
|
-
import
|
|
6172
|
+
import React113 from "react";
|
|
5907
6173
|
|
|
5908
6174
|
// src/widgets/RunStatus.jsx
|
|
5909
|
-
import
|
|
5910
|
-
import { jsx as
|
|
6175
|
+
import React112 from "react";
|
|
6176
|
+
import { jsx as jsx110, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
5911
6177
|
var RUN_STATUS = {
|
|
5912
6178
|
queued: { tone: "neutral", icon: "clock", label: "Queued" },
|
|
5913
6179
|
running: { tone: "info", icon: "loader-circle", label: "Running", spin: true },
|
|
@@ -5925,7 +6191,7 @@ function RunStatus({ status = "queued", detail, since, size = "md", labels, clas
|
|
|
5925
6191
|
const s = RUN_STATUS[status] || RUN_STATUS.queued;
|
|
5926
6192
|
return /* @__PURE__ */ jsxs102("span", { className: cx("agn-run-status", "agn-run-status--" + s.tone, size !== "md" && "agn-run-status--" + size, className), ...rest, children: [
|
|
5927
6193
|
/* @__PURE__ */ jsxs102("span", { className: "agn-run-status__tag", children: [
|
|
5928
|
-
/* @__PURE__ */
|
|
6194
|
+
/* @__PURE__ */ jsx110(Icon, { name: s.icon, size: size === "sm" ? 11 : 12, className: s.spin ? "agn-run-status__spin" : void 0 }),
|
|
5929
6195
|
L[status] || s.label,
|
|
5930
6196
|
detail && /* @__PURE__ */ jsxs102("span", { className: "agn-run-status__detail", children: [
|
|
5931
6197
|
" \xB7 ",
|
|
@@ -5958,14 +6224,14 @@ var fmtClock = (s) => {
|
|
|
5958
6224
|
var initials4 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
|
|
5959
6225
|
|
|
5960
6226
|
// src/widgets/RunTimeline.jsx
|
|
5961
|
-
import { jsx as
|
|
6227
|
+
import { jsx as jsx111, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
5962
6228
|
function ticks(total, n = 4) {
|
|
5963
6229
|
const step = total / n;
|
|
5964
6230
|
return Array.from({ length: n + 1 }, (_, i) => i * step);
|
|
5965
6231
|
}
|
|
5966
6232
|
function useTickCount(ref) {
|
|
5967
|
-
const [n, setN] =
|
|
5968
|
-
|
|
6233
|
+
const [n, setN] = React113.useState(4);
|
|
6234
|
+
React113.useEffect(() => {
|
|
5969
6235
|
const el = ref.current;
|
|
5970
6236
|
if (!el || typeof ResizeObserver === "undefined") return void 0;
|
|
5971
6237
|
const ro = new ResizeObserver((es) => {
|
|
@@ -5983,15 +6249,15 @@ function RunTimeline({ steps = [], total: totalProp, selected, onSelect, showCos
|
|
|
5983
6249
|
const total = totalProp || Math.max(1, ...steps.map((s) => (s.start || 0) + (s.duration || 0)));
|
|
5984
6250
|
const Row = onSelect ? "button" : "div";
|
|
5985
6251
|
const sumCost = steps.reduce((a, s) => a + (s.cost || 0), 0), sumTok = steps.reduce((a, s) => a + (s.tokens || 0), 0);
|
|
5986
|
-
const scaleRef =
|
|
6252
|
+
const scaleRef = React113.useRef(null);
|
|
5987
6253
|
const tickN = useTickCount(scaleRef);
|
|
5988
6254
|
const cols = cx("agn-rt__grid", !showTokens && "agn-rt__grid--no-tokens", !showCost && "agn-rt__grid--no-cost");
|
|
5989
6255
|
return /* @__PURE__ */ jsxs103("div", { className: cx("agn-rt", className), role: "table", "aria-label": L.step + "s", ...rest, children: [
|
|
5990
6256
|
/* @__PURE__ */ jsxs103("div", { className: cx("agn-rt__head", cols), role: "row", children: [
|
|
5991
|
-
/* @__PURE__ */
|
|
5992
|
-
/* @__PURE__ */
|
|
5993
|
-
showTokens && /* @__PURE__ */
|
|
5994
|
-
showCost && /* @__PURE__ */
|
|
6257
|
+
/* @__PURE__ */ jsx111("span", { role: "columnheader", children: L.step }),
|
|
6258
|
+
/* @__PURE__ */ jsx111("span", { role: "columnheader", className: "agn-rt__scale", ref: scaleRef, children: ticks(total, tickN).map((t, i) => /* @__PURE__ */ jsx111("span", { className: "agn-rt__tick agn-num", style: { left: t / total * 100 + "%" }, children: formatDuration(t, locale) }, i)) }),
|
|
6259
|
+
showTokens && /* @__PURE__ */ jsx111("span", { role: "columnheader", className: "agn-rt__num", children: L.tokens }),
|
|
6260
|
+
showCost && /* @__PURE__ */ jsx111("span", { role: "columnheader", className: "agn-rt__num", children: L.cost })
|
|
5995
6261
|
] }),
|
|
5996
6262
|
steps.map((s, i) => {
|
|
5997
6263
|
const st = RUN_STATUS[s.status] || RUN_STATUS.completed;
|
|
@@ -6000,30 +6266,30 @@ function RunTimeline({ steps = [], total: totalProp, selected, onSelect, showCos
|
|
|
6000
6266
|
const left = (s.start || 0) / total * 100, width = Math.max(0.6, (s.duration || 0) / total * 100);
|
|
6001
6267
|
return /* @__PURE__ */ jsxs103(Row, { type: onSelect ? "button" : void 0, role: "row", className: cx("agn-rt__row", cols, "agn-rt__row--" + st.tone, sel && "agn-rt__row--selected", "agn-focus-inset"), "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(id, s) : void 0, children: [
|
|
6002
6268
|
/* @__PURE__ */ jsxs103("span", { role: "cell", className: "agn-rt__name", children: [
|
|
6003
|
-
/* @__PURE__ */
|
|
6269
|
+
/* @__PURE__ */ jsx111("span", { className: "agn-rt__n agn-num", children: String(i + 1).padStart(2, "0") }),
|
|
6004
6270
|
/* @__PURE__ */ jsxs103("span", { className: "agn-rt__label", children: [
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
s.kind && /* @__PURE__ */
|
|
6271
|
+
/* @__PURE__ */ jsx111("span", { className: "agn-rt__title", children: s.name }),
|
|
6272
|
+
s.kind && /* @__PURE__ */ jsx111("span", { className: "agn-rt__kind", children: s.kind })
|
|
6007
6273
|
] }),
|
|
6008
|
-
/* @__PURE__ */
|
|
6274
|
+
/* @__PURE__ */ jsx111(Icon, { name: st.icon, size: 12, className: cx("agn-rt__icon", st.spin && "agn-rt__spin"), title: st.label })
|
|
6009
6275
|
] }),
|
|
6010
|
-
/* @__PURE__ */
|
|
6011
|
-
showTokens && /* @__PURE__ */
|
|
6012
|
-
showCost && /* @__PURE__ */
|
|
6276
|
+
/* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__track", children: /* @__PURE__ */ jsx111("span", { className: "agn-rt__bar", style: { left: left + "%", width: width + "%" }, children: /* @__PURE__ */ jsx111("span", { className: "agn-rt__dur agn-num", children: formatDuration(s.duration || 0, locale) }) }) }),
|
|
6277
|
+
showTokens && /* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__num", children: s.tokens != null ? fmtInt(s.tokens, locale) : "\u2013" }),
|
|
6278
|
+
showCost && /* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__num", children: s.cost != null ? fmtMoney(s.cost, locale, currency) : "\u2013" })
|
|
6013
6279
|
] }, id);
|
|
6014
6280
|
}),
|
|
6015
6281
|
/* @__PURE__ */ jsxs103("div", { className: cx("agn-rt__foot", cols), role: "row", children: [
|
|
6016
|
-
/* @__PURE__ */
|
|
6017
|
-
/* @__PURE__ */
|
|
6018
|
-
showTokens && /* @__PURE__ */
|
|
6019
|
-
showCost && /* @__PURE__ */
|
|
6282
|
+
/* @__PURE__ */ jsx111("span", { role: "cell", children: L.total }),
|
|
6283
|
+
/* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__total agn-num", children: formatDuration(total, locale) }),
|
|
6284
|
+
showTokens && /* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__num", children: fmtInt(sumTok, locale) }),
|
|
6285
|
+
showCost && /* @__PURE__ */ jsx111("span", { role: "cell", className: "agn-rt__num", children: fmtMoney(sumCost, locale, currency) })
|
|
6020
6286
|
] })
|
|
6021
6287
|
] });
|
|
6022
6288
|
}
|
|
6023
6289
|
|
|
6024
6290
|
// src/widgets/TraceSpans.jsx
|
|
6025
|
-
import
|
|
6026
|
-
import { jsx as
|
|
6291
|
+
import React114 from "react";
|
|
6292
|
+
import { jsx as jsx112, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
6027
6293
|
var SPAN_KINDS = ["llm", "tool", "http", "workflow", "db", "other"];
|
|
6028
6294
|
function flatten3(spans, depth = 0, out = [], collapsed) {
|
|
6029
6295
|
spans.forEach((s, i) => {
|
|
@@ -6035,9 +6301,9 @@ function flatten3(spans, depth = 0, out = [], collapsed) {
|
|
|
6035
6301
|
}
|
|
6036
6302
|
function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale = "tr-TR", labels, className, ...rest }) {
|
|
6037
6303
|
const L = { spans: "Spans", collapse: "Collapse", expand: "Expand", error: "error", ...labels };
|
|
6038
|
-
const [collapsed, setCollapsed] =
|
|
6039
|
-
const rows =
|
|
6040
|
-
const all =
|
|
6304
|
+
const [collapsed, setCollapsed] = React114.useState(() => /* @__PURE__ */ new Set());
|
|
6305
|
+
const rows = React114.useMemo(() => flatten3(spans, 0, [], collapsed), [spans, collapsed]);
|
|
6306
|
+
const all = React114.useMemo(() => flatten3(spans, 0, [], /* @__PURE__ */ new Set()), [spans]);
|
|
6041
6307
|
const total = totalProp || Math.max(1, ...all.map((s) => (s.start || 0) + (s.duration || 0)));
|
|
6042
6308
|
const toggle = (id) => setCollapsed((c) => {
|
|
6043
6309
|
const n = new Set(c);
|
|
@@ -6045,8 +6311,8 @@ function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale =
|
|
|
6045
6311
|
return n;
|
|
6046
6312
|
});
|
|
6047
6313
|
const Row = onSelect ? "button" : "div";
|
|
6048
|
-
const treeRef =
|
|
6049
|
-
const [focusId, setFocusId] =
|
|
6314
|
+
const treeRef = React114.useRef(null);
|
|
6315
|
+
const [focusId, setFocusId] = React114.useState(null);
|
|
6050
6316
|
const focusIdx = Math.max(0, rows.findIndex((r) => r.id === (focusId != null ? focusId : selected)));
|
|
6051
6317
|
const focusAt = (i) => {
|
|
6052
6318
|
const n = Math.max(0, Math.min(rows.length - 1, i));
|
|
@@ -6096,33 +6362,33 @@ function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale =
|
|
|
6096
6362
|
}
|
|
6097
6363
|
};
|
|
6098
6364
|
return /* @__PURE__ */ jsxs104("div", { ref: treeRef, className: cx("agn-spans", className), role: "tree", "aria-label": L.spans, ...rest, children: [
|
|
6099
|
-
/* @__PURE__ */
|
|
6365
|
+
/* @__PURE__ */ jsx112("div", { className: "agn-spans__scale", "aria-hidden": "true", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ jsx112("span", { className: "agn-spans__tick agn-num", style: { left: f * 100 + "%" }, children: formatDuration(total * f, locale) }, f)) }),
|
|
6100
6366
|
rows.map((s, i) => {
|
|
6101
6367
|
const sel = selected != null && selected === s.id;
|
|
6102
6368
|
const kind = SPAN_KINDS.includes(s.kind) ? s.kind : "other";
|
|
6103
6369
|
const left = (s.start || 0) / total * 100, width = Math.max(0.5, (s.duration || 0) / total * 100);
|
|
6104
6370
|
return /* @__PURE__ */ jsxs104("div", { role: "treeitem", "aria-level": s.depth + 1, "aria-expanded": s.hasChildren ? !collapsed.has(s.id) : void 0, "aria-selected": onSelect ? sel : void 0, "data-index": i, tabIndex: i === focusIdx ? 0 : -1, onKeyDown: (e) => onKey(e, s, i), onFocus: () => setFocusId(s.id), className: cx("agn-spans__row", "agn-focus-inset", "agn-spans__row--" + kind, s.status === "bad" && "agn-spans__row--bad", sel && "agn-spans__row--selected"), children: [
|
|
6105
6371
|
/* @__PURE__ */ jsxs104("span", { className: "agn-spans__name", style: { paddingLeft: s.depth * 16 }, children: [
|
|
6106
|
-
s.hasChildren ? /* @__PURE__ */
|
|
6372
|
+
s.hasChildren ? /* @__PURE__ */ jsx112("button", { type: "button", className: "agn-spans__caret", tabIndex: -1, "aria-label": collapsed.has(s.id) ? L.expand : L.collapse, onClick: () => toggle(s.id), children: /* @__PURE__ */ jsx112(Icon, { name: "chevron-right", size: 12, className: cx(!collapsed.has(s.id) && "agn-spans__caret--open") }) }) : /* @__PURE__ */ jsx112("span", { className: "agn-spans__caret agn-spans__caret--leaf" }),
|
|
6107
6373
|
/* @__PURE__ */ jsxs104(Row, { type: onSelect ? "button" : void 0, tabIndex: onSelect ? -1 : void 0, className: "agn-spans__label", onClick: onSelect ? () => onSelect(s.id, s) : void 0, children: [
|
|
6108
|
-
/* @__PURE__ */
|
|
6109
|
-
s.service && /* @__PURE__ */
|
|
6374
|
+
/* @__PURE__ */ jsx112("span", { className: "agn-spans__title", children: s.name }),
|
|
6375
|
+
s.service && /* @__PURE__ */ jsx112("span", { className: "agn-spans__service", children: s.service }),
|
|
6110
6376
|
s.status === "bad" && /* @__PURE__ */ jsxs104("span", { className: "agn-spans__err", children: [
|
|
6111
|
-
/* @__PURE__ */
|
|
6377
|
+
/* @__PURE__ */ jsx112(Icon, { name: "circle-x", size: 11 }),
|
|
6112
6378
|
L.error
|
|
6113
6379
|
] })
|
|
6114
6380
|
] })
|
|
6115
6381
|
] }),
|
|
6116
|
-
/* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6382
|
+
/* @__PURE__ */ jsx112("span", { className: "agn-spans__track", children: /* @__PURE__ */ jsx112("span", { className: "agn-spans__bar", style: { left: left + "%", width: width + "%" } }) }),
|
|
6383
|
+
/* @__PURE__ */ jsx112("span", { className: "agn-spans__dur agn-num", children: formatDuration(s.duration || 0, locale) })
|
|
6118
6384
|
] }, s.id);
|
|
6119
6385
|
})
|
|
6120
6386
|
] });
|
|
6121
6387
|
}
|
|
6122
6388
|
|
|
6123
6389
|
// src/widgets/AgentRunCard.jsx
|
|
6124
|
-
import
|
|
6125
|
-
import { jsx as
|
|
6390
|
+
import React115 from "react";
|
|
6391
|
+
import { jsx as jsx113, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
6126
6392
|
var TRIGGER = { manual: { icon: "play", label: "Manual" }, webhook: { icon: "webhook", label: "Webhook" }, schedule: { icon: "calendar-clock", label: "Schedule" }, call: { icon: "phone", label: "Phone call" }, chat: { icon: "message-square", label: "Chat" }, api: { icon: "code", label: "API" } };
|
|
6127
6393
|
var BAR_TONE = { running: "signal", completed: "ok", failed: "bad", paused: "warn", cancelled: "neutral", queued: "neutral" };
|
|
6128
6394
|
function AgentRunCard({ agent, product = "platform", runId, tenant, trigger = "manual", status = "queued", since, started, duration, steps, cost, tokens, selected, onStop, onRetry, onOpen, locale = "tr-TR", currency = "TRY", labels, className, ...rest }) {
|
|
@@ -6130,53 +6396,53 @@ function AgentRunCard({ agent, product = "platform", runId, tenant, trigger = "m
|
|
|
6130
6396
|
const t = TRIGGER[trigger] || TRIGGER.manual;
|
|
6131
6397
|
return /* @__PURE__ */ jsxs105("article", { className: cx("agn-run-card", "agn-run-card--" + status, selected && "agn-run-card--selected", className), ...rest, children: [
|
|
6132
6398
|
/* @__PURE__ */ jsxs105("header", { className: "agn-run-card__head", children: [
|
|
6133
|
-
/* @__PURE__ */
|
|
6399
|
+
/* @__PURE__ */ jsx113("span", { className: "agn-run-card__icon", children: /* @__PURE__ */ jsx113(ProductIcon, { product, size: 16 }) }),
|
|
6134
6400
|
/* @__PURE__ */ jsxs105("div", { className: "agn-run-card__heading", children: [
|
|
6135
|
-
/* @__PURE__ */
|
|
6136
|
-
runId && /* @__PURE__ */
|
|
6401
|
+
/* @__PURE__ */ jsx113("h3", { className: "agn-run-card__title", children: agent }),
|
|
6402
|
+
runId && /* @__PURE__ */ jsx113("span", { className: "agn-run-card__id", children: runId })
|
|
6137
6403
|
] }),
|
|
6138
|
-
/* @__PURE__ */
|
|
6404
|
+
/* @__PURE__ */ jsx113(RunStatus, { status, since, size: "sm" })
|
|
6139
6405
|
] }),
|
|
6140
6406
|
/* @__PURE__ */ jsxs105("div", { className: "agn-run-card__meta", children: [
|
|
6141
6407
|
/* @__PURE__ */ jsxs105("span", { children: [
|
|
6142
|
-
/* @__PURE__ */
|
|
6408
|
+
/* @__PURE__ */ jsx113(Icon, { name: t.icon, size: 12 }),
|
|
6143
6409
|
L[trigger] || t.label
|
|
6144
6410
|
] }),
|
|
6145
6411
|
started && /* @__PURE__ */ jsxs105("span", { children: [
|
|
6146
|
-
/* @__PURE__ */
|
|
6412
|
+
/* @__PURE__ */ jsx113(Icon, { name: "clock", size: 12 }),
|
|
6147
6413
|
started
|
|
6148
6414
|
] }),
|
|
6149
6415
|
tenant && /* @__PURE__ */ jsxs105("span", { children: [
|
|
6150
|
-
/* @__PURE__ */
|
|
6416
|
+
/* @__PURE__ */ jsx113(Icon, { name: "building-2", size: 12 }),
|
|
6151
6417
|
tenant
|
|
6152
6418
|
] })
|
|
6153
6419
|
] }),
|
|
6154
|
-
steps && steps.total > 0 && /* @__PURE__ */
|
|
6420
|
+
steps && steps.total > 0 && /* @__PURE__ */ jsx113(ProgressBar, { size: "sm", tone: BAR_TONE[status] || "neutral", value: steps.done || 0, max: steps.total, label: L.steps, showValue: true, valueText: `${steps.done || 0} / ${steps.total}` }),
|
|
6155
6421
|
/* @__PURE__ */ jsxs105("dl", { className: "agn-run-card__stats", children: [
|
|
6156
6422
|
duration != null && /* @__PURE__ */ jsxs105("div", { children: [
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
/* @__PURE__ */
|
|
6423
|
+
/* @__PURE__ */ jsx113("dt", { children: L.duration }),
|
|
6424
|
+
/* @__PURE__ */ jsx113("dd", { className: "agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
|
|
6159
6425
|
] }),
|
|
6160
6426
|
cost != null && /* @__PURE__ */ jsxs105("div", { children: [
|
|
6161
|
-
/* @__PURE__ */
|
|
6162
|
-
/* @__PURE__ */
|
|
6427
|
+
/* @__PURE__ */ jsx113("dt", { children: L.cost }),
|
|
6428
|
+
/* @__PURE__ */ jsx113("dd", { className: "agn-num", children: fmtMoney(cost, locale, currency) })
|
|
6163
6429
|
] }),
|
|
6164
6430
|
tokens != null && /* @__PURE__ */ jsxs105("div", { children: [
|
|
6165
|
-
/* @__PURE__ */
|
|
6166
|
-
/* @__PURE__ */
|
|
6431
|
+
/* @__PURE__ */ jsx113("dt", { children: L.tokens }),
|
|
6432
|
+
/* @__PURE__ */ jsx113("dd", { className: "agn-num", children: fmtInt(tokens, locale) })
|
|
6167
6433
|
] })
|
|
6168
6434
|
] }),
|
|
6169
6435
|
(onStop || onRetry || onOpen) && /* @__PURE__ */ jsxs105("footer", { className: "agn-run-card__foot", children: [
|
|
6170
|
-
onStop && (status === "running" || status === "paused" || status === "queued") && /* @__PURE__ */
|
|
6171
|
-
onRetry && (status === "failed" || status === "cancelled") && /* @__PURE__ */
|
|
6172
|
-
onOpen && /* @__PURE__ */
|
|
6436
|
+
onStop && (status === "running" || status === "paused" || status === "queued") && /* @__PURE__ */ jsx113(Button, { size: "sm", variant: "destructive-text", icon: "square", onClick: onStop, children: L.stop }),
|
|
6437
|
+
onRetry && (status === "failed" || status === "cancelled") && /* @__PURE__ */ jsx113(Button, { size: "sm", icon: "rotate-ccw", onClick: onRetry, children: L.retry }),
|
|
6438
|
+
onOpen && /* @__PURE__ */ jsx113(Button, { size: "sm", variant: "ghost", iconRight: "arrow-right", onClick: onOpen, className: "agn-run-card__open", children: L.open })
|
|
6173
6439
|
] })
|
|
6174
6440
|
] });
|
|
6175
6441
|
}
|
|
6176
6442
|
|
|
6177
6443
|
// src/widgets/CostBars.jsx
|
|
6178
|
-
import
|
|
6179
|
-
import { jsx as
|
|
6444
|
+
import React116 from "react";
|
|
6445
|
+
import { jsx as jsx114, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
6180
6446
|
function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "tr-TR", max: maxProp, showValues = true, showTokens = false, colorBy = "index", sort, labels, className, ...rest }) {
|
|
6181
6447
|
const L = { costs: "Costs", tokens: "tokens", ...labels };
|
|
6182
6448
|
const list = sort === "desc" ? [...items].sort((a, b) => (b.value || 0) - (a.value || 0)) : items;
|
|
@@ -6185,12 +6451,12 @@ function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "t
|
|
|
6185
6451
|
return (
|
|
6186
6452
|
// biome-ignore lint/a11y/noRedundantRoles: explicit role=list keeps list semantics in Safari/VoiceOver, which drops them for list-style: none
|
|
6187
6453
|
// biome-ignore lint/a11y/useSemanticElements: explicit role=list keeps list semantics in Safari/VoiceOver, which drops them for list-style: none
|
|
6188
|
-
/* @__PURE__ */
|
|
6454
|
+
/* @__PURE__ */ jsx114("ul", { className: cx("agn-costbars", className), role: "list", "aria-label": L.costs, ...rest, children: list.map((it, i) => /* @__PURE__ */ jsxs106("li", { className: cx("agn-costbars__row", it.tone && "agn-costbars__row--" + it.tone), children: [
|
|
6189
6455
|
/* @__PURE__ */ jsxs106("span", { className: "agn-costbars__label", title: typeof it.label === "string" ? it.label : void 0, children: [
|
|
6190
6456
|
it.label,
|
|
6191
|
-
it.sub && /* @__PURE__ */
|
|
6457
|
+
it.sub && /* @__PURE__ */ jsx114("span", { className: "agn-costbars__sub", children: it.sub })
|
|
6192
6458
|
] }),
|
|
6193
|
-
/* @__PURE__ */
|
|
6459
|
+
/* @__PURE__ */ jsx114("span", { className: "agn-costbars__track", "aria-hidden": "true", children: /* @__PURE__ */ jsx114("span", { className: cx("agn-costbars__fill", colorBy === "index" && "agn-costbars__fill--" + (i % 6 + 1)), style: { width: Math.min(100, (it.value || 0) / max * 100) + "%" } }) }),
|
|
6194
6460
|
showValues && /* @__PURE__ */ jsxs106("span", { className: "agn-costbars__value agn-num", children: [
|
|
6195
6461
|
fmt(it.value || 0),
|
|
6196
6462
|
showTokens && it.tokens != null && /* @__PURE__ */ jsxs106("span", { className: "agn-costbars__tokens", children: [
|
|
@@ -6204,8 +6470,8 @@ function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "t
|
|
|
6204
6470
|
}
|
|
6205
6471
|
|
|
6206
6472
|
// src/widgets/CanvasBlock.jsx
|
|
6207
|
-
import
|
|
6208
|
-
import { jsx as
|
|
6473
|
+
import React117 from "react";
|
|
6474
|
+
import { jsx as jsx115, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
6209
6475
|
var SIDES = ["top", "right", "bottom", "left"];
|
|
6210
6476
|
var portSide = (v, dflt) => v === true ? dflt : SIDES.includes(v) ? v : null;
|
|
6211
6477
|
var STATE_ICON = { running: ["loader-circle", true], error: ["circle-alert"], done: ["circle-check"], waiting: ["circle-dashed"], disabled: ["eye-off"] };
|
|
@@ -6215,32 +6481,32 @@ function CanvasBlock({ name, kind, icon = "box", product, rows = [], state = "de
|
|
|
6215
6481
|
const inSide = ports && portSide(ports.in, "left"), outSide = ports && portSide(ports.out, "right");
|
|
6216
6482
|
const si = STATE_ICON[state];
|
|
6217
6483
|
return /* @__PURE__ */ jsxs107(Tag2, { type: onSelect ? "button" : void 0, className: cx("agn-block", "agn-block--" + state, className), style: { width: 250, ...style }, "aria-pressed": onSelect ? state === "selected" : void 0, onClick: onSelect, ...rest, children: [
|
|
6218
|
-
actions.length > 0 && /* @__PURE__ */
|
|
6484
|
+
actions.length > 0 && /* @__PURE__ */ jsx115("span", { className: "agn-block__bar", role: "toolbar", children: actions.map((a, i) => /* @__PURE__ */ jsx115(ButtonIcon, { icon: a.icon, label: a.label, size: "xs", variant: a.variant || "ghost", onClick: (e) => {
|
|
6219
6485
|
e.stopPropagation();
|
|
6220
6486
|
a.onClick && a.onClick(e);
|
|
6221
6487
|
} }, i)) }),
|
|
6222
6488
|
/* @__PURE__ */ jsxs107("span", { className: "agn-block__head", children: [
|
|
6223
|
-
/* @__PURE__ */
|
|
6489
|
+
/* @__PURE__ */ jsx115("span", { className: "agn-block__icon", children: product ? /* @__PURE__ */ jsx115(ProductIcon, { product, size: 16 }) : /* @__PURE__ */ jsx115(Icon, { name: icon, size: 16 }) }),
|
|
6224
6490
|
/* @__PURE__ */ jsxs107("span", { className: "agn-block__heading", children: [
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
kind && /* @__PURE__ */
|
|
6491
|
+
/* @__PURE__ */ jsx115("span", { className: "agn-block__name", title: typeof name === "string" ? name : void 0, children: name }),
|
|
6492
|
+
kind && /* @__PURE__ */ jsx115("span", { className: "agn-block__kind", children: kind })
|
|
6227
6493
|
] }),
|
|
6228
6494
|
si && /* @__PURE__ */ jsxs107("span", { className: "agn-block__state", children: [
|
|
6229
|
-
/* @__PURE__ */
|
|
6230
|
-
/* @__PURE__ */
|
|
6495
|
+
/* @__PURE__ */ jsx115(Icon, { name: si[0], size: 14, className: si[1] ? "agn-block__spin" : void 0, title: L[state] }),
|
|
6496
|
+
/* @__PURE__ */ jsx115("span", { className: "agn-sr", children: L[state] })
|
|
6231
6497
|
] })
|
|
6232
6498
|
] }),
|
|
6233
|
-
rows.length > 0 && /* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6235
|
-
/* @__PURE__ */
|
|
6499
|
+
rows.length > 0 && /* @__PURE__ */ jsx115("span", { className: "agn-block__rows", children: rows.map((r, i) => /* @__PURE__ */ jsxs107("span", { className: "agn-block__row", children: [
|
|
6500
|
+
/* @__PURE__ */ jsx115("span", { className: "agn-block__k", children: r.label }),
|
|
6501
|
+
/* @__PURE__ */ jsx115("span", { className: cx("agn-block__v", r.mono !== false && "agn-mono"), children: r.value })
|
|
6236
6502
|
] }, i)) }),
|
|
6237
6503
|
next && /* @__PURE__ */ jsxs107("span", { className: "agn-block__next", children: [
|
|
6238
|
-
/* @__PURE__ */
|
|
6239
|
-
/* @__PURE__ */
|
|
6504
|
+
/* @__PURE__ */ jsx115(Icon, { name: "corner-down-right", size: 12 }),
|
|
6505
|
+
/* @__PURE__ */ jsx115("span", { className: "agn-block__next-label", children: L.next }),
|
|
6240
6506
|
next
|
|
6241
6507
|
] }),
|
|
6242
|
-
inSide && /* @__PURE__ */
|
|
6243
|
-
outSide && /* @__PURE__ */
|
|
6508
|
+
inSide && /* @__PURE__ */ jsx115("span", { className: cx("agn-block__port", "agn-block__port--in", "agn-block__port--" + inSide), "aria-hidden": "true" }),
|
|
6509
|
+
outSide && /* @__PURE__ */ jsx115("span", { className: cx("agn-block__port", "agn-block__port--out", "agn-block__port--" + outSide), "aria-hidden": "true" })
|
|
6244
6510
|
] });
|
|
6245
6511
|
}
|
|
6246
6512
|
var horiz = (s) => s === "left" || s === "right";
|
|
@@ -6276,25 +6542,25 @@ function CanvasEdge({ from, to, fromSide = "right", toSide = "left", state = "de
|
|
|
6276
6542
|
onClick(e);
|
|
6277
6543
|
}
|
|
6278
6544
|
} : void 0, ...rest, children: [
|
|
6279
|
-
/* @__PURE__ */
|
|
6280
|
-
/* @__PURE__ */
|
|
6281
|
-
arrow && /* @__PURE__ */
|
|
6545
|
+
/* @__PURE__ */ jsx115("path", { className: "agn-edge__hit", d }),
|
|
6546
|
+
/* @__PURE__ */ jsx115("path", { className: "agn-edge__path", d }),
|
|
6547
|
+
arrow && /* @__PURE__ */ jsx115("path", { className: "agn-edge__arrow", d: ah }),
|
|
6282
6548
|
label && /* @__PURE__ */ jsxs107("g", { className: "agn-edge__label", transform: `translate(${mx},${my})`, children: [
|
|
6283
|
-
/* @__PURE__ */
|
|
6284
|
-
/* @__PURE__ */
|
|
6549
|
+
/* @__PURE__ */ jsx115("rect", { x: -String(label).length * 3.4 - 6, y: -9, width: String(label).length * 6.8 + 12, height: 18, rx: 4 }),
|
|
6550
|
+
/* @__PURE__ */ jsx115("text", { textAnchor: "middle", dominantBaseline: "central", children: label })
|
|
6285
6551
|
] })
|
|
6286
6552
|
] })
|
|
6287
6553
|
);
|
|
6288
6554
|
}
|
|
6289
6555
|
|
|
6290
6556
|
// src/widgets/Canvas.jsx
|
|
6291
|
-
import
|
|
6292
|
-
import { jsx as
|
|
6557
|
+
import React118 from "react";
|
|
6558
|
+
import { jsx as jsx116, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
6293
6559
|
var clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
6294
6560
|
function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange, pan: panProp, defaultPan = { x: 0, y: 0 }, onPanChange, minZoom = 0.25, maxZoom = 2, grid = true, controls = true, interactive = true, overlay, labels, className, style, ...rest }) {
|
|
6295
6561
|
const L = { canvas: "Agent canvas", zoomIn: "Zoom in", zoomOut: "Zoom out", reset: "Reset view", ...labels };
|
|
6296
|
-
const [zLocal, setZLocal] =
|
|
6297
|
-
const [pLocal, setPLocal] =
|
|
6562
|
+
const [zLocal, setZLocal] = React118.useState(defaultZoom);
|
|
6563
|
+
const [pLocal, setPLocal] = React118.useState(defaultPan);
|
|
6298
6564
|
const z = zoomProp != null ? zoomProp : zLocal;
|
|
6299
6565
|
const p = panProp || pLocal;
|
|
6300
6566
|
const setZ = (v) => {
|
|
@@ -6306,7 +6572,7 @@ function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange
|
|
|
6306
6572
|
if (!panProp) setPLocal(v);
|
|
6307
6573
|
onPanChange && onPanChange(v);
|
|
6308
6574
|
};
|
|
6309
|
-
const drag =
|
|
6575
|
+
const drag = React118.useRef(null);
|
|
6310
6576
|
const onPointerDown = (e) => {
|
|
6311
6577
|
if (!interactive || e.button !== 0) return;
|
|
6312
6578
|
if (e.target.closest(".agn-block, button, a, input, textarea, select, .agn-edge--clickable, .agn-canvas__controls")) return;
|
|
@@ -6350,12 +6616,12 @@ function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange
|
|
|
6350
6616
|
const bg = grid ? { backgroundSize: gs + "px " + gs + "px", backgroundPosition: p.x + "px " + p.y + "px" } : null;
|
|
6351
6617
|
return /* @__PURE__ */ jsxs108("div", { className: cx("agn-canvas", grid && "agn-canvas--grid", interactive && "agn-canvas--interactive", className), style: { ...bg, ...style }, role: "application", "aria-roledescription": "canvas", "aria-label": L.canvas, tabIndex: interactive ? 0 : void 0, onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp, onWheel, onKeyDown, ...rest, children: [
|
|
6352
6618
|
/* @__PURE__ */ jsxs108("div", { className: "agn-canvas__layer", style: { transform: `translate(${p.x}px, ${p.y}px) scale(${z})` }, children: [
|
|
6353
|
-
edges && /* @__PURE__ */
|
|
6619
|
+
edges && /* @__PURE__ */ jsx116("svg", { className: "agn-canvas__edges", "aria-hidden": "true", children: edges }),
|
|
6354
6620
|
children
|
|
6355
6621
|
] }),
|
|
6356
6622
|
overlay,
|
|
6357
6623
|
controls && /* @__PURE__ */ jsxs108("div", { className: "agn-canvas__controls", role: "toolbar", "aria-label": L.canvas, children: [
|
|
6358
|
-
/* @__PURE__ */
|
|
6624
|
+
/* @__PURE__ */ jsx116(ButtonIcon, { icon: "minus", label: L.zoomOut, size: "sm", variant: "ghost", onClick: () => setZ(z / 1.2), disabled: z <= minZoom }),
|
|
6359
6625
|
/* @__PURE__ */ jsxs108("button", { type: "button", className: "agn-canvas__zoom agn-num agn-focus", onClick: () => {
|
|
6360
6626
|
setZ(1);
|
|
6361
6627
|
setP({ x: 0, y: 0 });
|
|
@@ -6363,25 +6629,25 @@ function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange
|
|
|
6363
6629
|
Math.round(z * 100),
|
|
6364
6630
|
"%"
|
|
6365
6631
|
] }),
|
|
6366
|
-
/* @__PURE__ */
|
|
6632
|
+
/* @__PURE__ */ jsx116(ButtonIcon, { icon: "plus", label: L.zoomIn, size: "sm", variant: "ghost", onClick: () => setZ(z * 1.2), disabled: z >= maxZoom })
|
|
6367
6633
|
] })
|
|
6368
6634
|
] });
|
|
6369
6635
|
}
|
|
6370
6636
|
|
|
6371
6637
|
// src/widgets/CanvasNote.jsx
|
|
6372
|
-
import
|
|
6373
|
-
import { jsx as
|
|
6638
|
+
import React119 from "react";
|
|
6639
|
+
import { jsx as jsx117, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
6374
6640
|
function CanvasNote({ title, children, author, time, tone = "warn", width = 220, onEdit, onDelete, labels, className, style, ...rest }) {
|
|
6375
6641
|
const L = { edit: "Edit note", delete: "Delete note", ...labels };
|
|
6376
6642
|
return /* @__PURE__ */ jsxs109("div", { className: cx("agn-note", "agn-note--" + tone, className), style: { width, ...style }, ...rest, children: [
|
|
6377
6643
|
(title || onEdit || onDelete) && /* @__PURE__ */ jsxs109("div", { className: "agn-note__head", children: [
|
|
6378
|
-
title && /* @__PURE__ */
|
|
6644
|
+
title && /* @__PURE__ */ jsx117("span", { className: "agn-note__title", children: title }),
|
|
6379
6645
|
/* @__PURE__ */ jsxs109("span", { className: "agn-note__ctl", children: [
|
|
6380
|
-
onEdit && /* @__PURE__ */
|
|
6381
|
-
onDelete && /* @__PURE__ */
|
|
6646
|
+
onEdit && /* @__PURE__ */ jsx117(ButtonIcon, { icon: "pencil", label: L.edit, size: "xs", onClick: onEdit }),
|
|
6647
|
+
onDelete && /* @__PURE__ */ jsx117(ButtonIcon, { icon: "x", label: L.delete, size: "xs", onClick: onDelete })
|
|
6382
6648
|
] })
|
|
6383
6649
|
] }),
|
|
6384
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ jsx117("div", { className: "agn-note__body", children }),
|
|
6385
6651
|
(author || time) && /* @__PURE__ */ jsxs109("div", { className: "agn-note__foot", children: [
|
|
6386
6652
|
author,
|
|
6387
6653
|
author && time && " \xB7 ",
|
|
@@ -6391,8 +6657,8 @@ function CanvasNote({ title, children, author, time, tone = "warn", width = 220,
|
|
|
6391
6657
|
}
|
|
6392
6658
|
|
|
6393
6659
|
// src/widgets/QueueCard.jsx
|
|
6394
|
-
import
|
|
6395
|
-
import { jsx as
|
|
6660
|
+
import React120 from "react";
|
|
6661
|
+
import { jsx as jsx118, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
6396
6662
|
var CHANNEL = { whatsapp: { icon: "message-circle", label: "WhatsApp" }, voice: { icon: "phone", label: "Voice" }, web: { icon: "globe", label: "Web chat" }, email: { icon: "mail", label: "E-mail" } };
|
|
6397
6663
|
var OWNER = { bot: { icon: "bot", label: "Bot" }, agent: { icon: null, label: "Agent" }, queue: { icon: "users", label: "Queue" } };
|
|
6398
6664
|
function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sla, owner = { kind: "queue" }, unread, selected, onClick, tenant, labels, className, ...rest }) {
|
|
@@ -6401,27 +6667,27 @@ function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sl
|
|
|
6401
6667
|
const ow = OWNER[owner.kind] || OWNER.queue;
|
|
6402
6668
|
const Tag2 = onClick ? "button" : "div";
|
|
6403
6669
|
return /* @__PURE__ */ jsxs110(Tag2, { type: onClick ? "button" : void 0, className: cx("agn-queue", "agn-queue--" + channel, unread && "agn-queue--unread", selected && "agn-queue--selected", onClick && "agn-queue--clickable agn-focus-inset", className), "aria-pressed": onClick ? !!selected : void 0, onClick, ...rest, children: [
|
|
6404
|
-
/* @__PURE__ */
|
|
6670
|
+
/* @__PURE__ */ jsx118("span", { className: "agn-queue__channel", title: L[channel] || ch.label, children: /* @__PURE__ */ jsx118(Icon, { name: ch.icon, size: 16 }) }),
|
|
6405
6671
|
/* @__PURE__ */ jsxs110("span", { className: "agn-queue__body", children: [
|
|
6406
6672
|
/* @__PURE__ */ jsxs110("span", { className: "agn-queue__top", children: [
|
|
6407
|
-
/* @__PURE__ */
|
|
6673
|
+
/* @__PURE__ */ jsx118("span", { className: "agn-queue__name", children: customer }),
|
|
6408
6674
|
unread > 0 && /* @__PURE__ */ jsxs110("span", { className: "agn-queue__unread agn-num", children: [
|
|
6409
|
-
/* @__PURE__ */
|
|
6410
|
-
/* @__PURE__ */
|
|
6675
|
+
/* @__PURE__ */ jsx118("span", { "aria-hidden": "true", children: unread }),
|
|
6676
|
+
/* @__PURE__ */ jsx118("span", { className: "agn-sr", children: unread + " " + L.unread })
|
|
6411
6677
|
] }),
|
|
6412
|
-
tenant && /* @__PURE__ */
|
|
6678
|
+
tenant && /* @__PURE__ */ jsx118("span", { className: "agn-queue__tenant", children: tenant })
|
|
6413
6679
|
] }),
|
|
6414
|
-
phone && /* @__PURE__ */
|
|
6415
|
-
preview && /* @__PURE__ */
|
|
6680
|
+
phone && /* @__PURE__ */ jsx118("span", { className: "agn-queue__phone agn-num", children: phone }),
|
|
6681
|
+
preview && /* @__PURE__ */ jsx118("span", { className: "agn-queue__preview", children: preview })
|
|
6416
6682
|
] }),
|
|
6417
6683
|
/* @__PURE__ */ jsxs110("span", { className: "agn-queue__side", children: [
|
|
6418
6684
|
waiting && /* @__PURE__ */ jsxs110("span", { className: "agn-queue__wait agn-num", children: [
|
|
6419
|
-
/* @__PURE__ */
|
|
6685
|
+
/* @__PURE__ */ jsx118(Icon, { name: "timer", size: 11 }),
|
|
6420
6686
|
waiting
|
|
6421
6687
|
] }),
|
|
6422
|
-
sla && /* @__PURE__ */
|
|
6688
|
+
sla && /* @__PURE__ */ jsx118("span", { className: cx("agn-queue__sla", "agn-queue__sla--" + (sla.tone || "neutral")), children: sla.label }),
|
|
6423
6689
|
/* @__PURE__ */ jsxs110("span", { className: cx("agn-queue__owner", "agn-queue__owner--" + owner.kind), children: [
|
|
6424
|
-
owner.kind === "agent" ? /* @__PURE__ */
|
|
6690
|
+
owner.kind === "agent" ? /* @__PURE__ */ jsx118("span", { className: "agn-queue__owner-avatar", children: initials4(owner.name || "") }) : /* @__PURE__ */ jsx118(Icon, { name: ow.icon, size: 11 }),
|
|
6425
6691
|
owner.name || L[owner.kind] || ow.label
|
|
6426
6692
|
] })
|
|
6427
6693
|
] })
|
|
@@ -6429,17 +6695,17 @@ function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sl
|
|
|
6429
6695
|
}
|
|
6430
6696
|
|
|
6431
6697
|
// src/widgets/CallCard.jsx
|
|
6432
|
-
import
|
|
6433
|
-
import { Fragment as
|
|
6698
|
+
import React121 from "react";
|
|
6699
|
+
import { Fragment as Fragment15, jsx as jsx119, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
6434
6700
|
var STATE = { ringing: { tone: "info", icon: "phone-incoming", label: "Ringing" }, "in-call": { tone: "ok", icon: "phone-call", label: "In call" }, "on-hold": { tone: "warn", icon: "pause", label: "On hold" }, ended: { tone: "neutral", icon: "phone-off", label: "Ended" } };
|
|
6435
6701
|
var WAVE = [0.3, 0.55, 0.8, 0.45, 0.95, 0.6, 0.35, 0.7, 0.5, 0.9, 0.4, 0.65, 0.85, 0.3, 0.6, 0.75, 0.45, 0.9, 0.55, 0.35];
|
|
6436
6702
|
function CallCard({ number, name, direction = "inbound", state = "ringing", seconds = 0, live, agent, tenant, onAnswer, onDecline, onHold, onResume, onTransfer, onHangup, onCallBack, labels, className, ...rest }) {
|
|
6437
6703
|
const L = { answer: "Answer", decline: "Decline", hold: "Hold", resume: "Resume", transfer: "Transfer", hangup: "Hang up", callBack: "Call back", inbound: "Inbound", outbound: "Outbound", ...Object.fromEntries(Object.entries(STATE).map(([k, v]) => [k, v.label])), ...labels };
|
|
6438
|
-
const [elapsed, setElapsed] =
|
|
6439
|
-
|
|
6704
|
+
const [elapsed, setElapsed] = React121.useState(seconds);
|
|
6705
|
+
React121.useEffect(() => {
|
|
6440
6706
|
setElapsed(seconds);
|
|
6441
6707
|
}, [seconds]);
|
|
6442
|
-
|
|
6708
|
+
React121.useEffect(() => {
|
|
6443
6709
|
if (!live || state !== "in-call") return;
|
|
6444
6710
|
const t = setInterval(() => setElapsed((e) => e + 1), 1e3);
|
|
6445
6711
|
return () => clearInterval(t);
|
|
@@ -6447,59 +6713,59 @@ function CallCard({ number, name, direction = "inbound", state = "ringing", seco
|
|
|
6447
6713
|
const s = STATE[state] || STATE.ringing;
|
|
6448
6714
|
return /* @__PURE__ */ jsxs111("article", { className: cx("agn-call", "agn-call--" + state, className), "aria-label": (name || number) + " \xB7 " + (L[state] || s.label), ...rest, children: [
|
|
6449
6715
|
/* @__PURE__ */ jsxs111("header", { className: "agn-call__head", children: [
|
|
6450
|
-
/* @__PURE__ */
|
|
6716
|
+
/* @__PURE__ */ jsx119("span", { className: "agn-call__dir", title: L[direction], children: /* @__PURE__ */ jsx119(Icon, { name: direction === "outbound" ? "phone-outgoing" : "phone-incoming", size: 16 }) }),
|
|
6451
6717
|
/* @__PURE__ */ jsxs111("div", { className: "agn-call__who", children: [
|
|
6452
|
-
name && /* @__PURE__ */
|
|
6453
|
-
/* @__PURE__ */
|
|
6718
|
+
name && /* @__PURE__ */ jsx119("div", { className: "agn-call__name", children: name }),
|
|
6719
|
+
/* @__PURE__ */ jsx119("div", { className: "agn-call__number agn-num", children: number })
|
|
6454
6720
|
] }),
|
|
6455
6721
|
/* @__PURE__ */ jsxs111("span", { className: cx("agn-call__state", "agn-call__state--" + s.tone), children: [
|
|
6456
|
-
/* @__PURE__ */
|
|
6722
|
+
/* @__PURE__ */ jsx119(Icon, { name: s.icon, size: 12, className: state === "ringing" ? "agn-call__ring" : void 0 }),
|
|
6457
6723
|
L[state] || s.label
|
|
6458
6724
|
] })
|
|
6459
6725
|
] }),
|
|
6460
6726
|
/* @__PURE__ */ jsxs111("div", { className: "agn-call__body", children: [
|
|
6461
|
-
/* @__PURE__ */
|
|
6462
|
-
/* @__PURE__ */
|
|
6727
|
+
/* @__PURE__ */ jsx119("div", { className: "agn-call__time agn-num", role: "timer", "aria-live": "off", children: fmtClock(elapsed) }),
|
|
6728
|
+
/* @__PURE__ */ jsx119("div", { className: "agn-call__wave", "aria-hidden": "true", children: WAVE.map((v, i) => /* @__PURE__ */ jsx119("span", { className: "agn-call__bar", style: { "--agn-h": v, "--agn-i": i } }, i)) })
|
|
6463
6729
|
] }),
|
|
6464
6730
|
(agent || tenant) && /* @__PURE__ */ jsxs111("div", { className: "agn-call__meta", children: [
|
|
6465
6731
|
agent && /* @__PURE__ */ jsxs111("span", { children: [
|
|
6466
|
-
/* @__PURE__ */
|
|
6732
|
+
/* @__PURE__ */ jsx119(Icon, { name: "headset", size: 12 }),
|
|
6467
6733
|
agent
|
|
6468
6734
|
] }),
|
|
6469
6735
|
tenant && /* @__PURE__ */ jsxs111("span", { children: [
|
|
6470
|
-
/* @__PURE__ */
|
|
6736
|
+
/* @__PURE__ */ jsx119(Icon, { name: "building-2", size: 12 }),
|
|
6471
6737
|
tenant
|
|
6472
6738
|
] })
|
|
6473
6739
|
] }),
|
|
6474
6740
|
/* @__PURE__ */ jsxs111("footer", { className: "agn-call__foot", children: [
|
|
6475
|
-
state === "ringing" && /* @__PURE__ */ jsxs111(
|
|
6476
|
-
onAnswer && /* @__PURE__ */
|
|
6477
|
-
onDecline && /* @__PURE__ */
|
|
6741
|
+
state === "ringing" && /* @__PURE__ */ jsxs111(Fragment15, { children: [
|
|
6742
|
+
onAnswer && /* @__PURE__ */ jsx119(Button, { variant: "success", size: "sm", icon: "phone", onClick: onAnswer, children: L.answer }),
|
|
6743
|
+
onDecline && /* @__PURE__ */ jsx119(Button, { variant: "destructive-text", size: "sm", icon: "phone-off", onClick: onDecline, children: L.decline })
|
|
6478
6744
|
] }),
|
|
6479
|
-
state === "in-call" && /* @__PURE__ */ jsxs111(
|
|
6480
|
-
onHold && /* @__PURE__ */
|
|
6481
|
-
onTransfer && /* @__PURE__ */
|
|
6482
|
-
onHangup && /* @__PURE__ */
|
|
6745
|
+
state === "in-call" && /* @__PURE__ */ jsxs111(Fragment15, { children: [
|
|
6746
|
+
onHold && /* @__PURE__ */ jsx119(Button, { size: "sm", icon: "pause", onClick: onHold, children: L.hold }),
|
|
6747
|
+
onTransfer && /* @__PURE__ */ jsx119(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
|
|
6748
|
+
onHangup && /* @__PURE__ */ jsx119(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
|
|
6483
6749
|
] }),
|
|
6484
|
-
state === "on-hold" && /* @__PURE__ */ jsxs111(
|
|
6485
|
-
onResume && /* @__PURE__ */
|
|
6486
|
-
onTransfer && /* @__PURE__ */
|
|
6487
|
-
onHangup && /* @__PURE__ */
|
|
6750
|
+
state === "on-hold" && /* @__PURE__ */ jsxs111(Fragment15, { children: [
|
|
6751
|
+
onResume && /* @__PURE__ */ jsx119(Button, { variant: "primary", size: "sm", icon: "play", onClick: onResume, children: L.resume }),
|
|
6752
|
+
onTransfer && /* @__PURE__ */ jsx119(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
|
|
6753
|
+
onHangup && /* @__PURE__ */ jsx119(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
|
|
6488
6754
|
] }),
|
|
6489
|
-
state === "ended" && onCallBack && /* @__PURE__ */
|
|
6755
|
+
state === "ended" && onCallBack && /* @__PURE__ */ jsx119(Button, { size: "sm", icon: "phone-outgoing", onClick: onCallBack, children: L.callBack })
|
|
6490
6756
|
] })
|
|
6491
6757
|
] });
|
|
6492
6758
|
}
|
|
6493
6759
|
|
|
6494
6760
|
// src/dashboard/KpiWidget.jsx
|
|
6495
|
-
import
|
|
6496
|
-
import { jsx as
|
|
6497
|
-
var
|
|
6761
|
+
import React122 from "react";
|
|
6762
|
+
import { jsx as jsx120, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
6763
|
+
var DEFAULT_LABELS50 = { options: "Options", trend: "Trend" };
|
|
6498
6764
|
function KpiWidget({ label, value, delta, invert, sub, icon, spark, sparkTone, sparkColor = 1, menuItems, onMenuSelect, plain, size = "md", labels, className, ...rest }) {
|
|
6499
|
-
const L = { ...
|
|
6500
|
-
const chart = spark && spark.length > 1 ? /* @__PURE__ */
|
|
6501
|
-
const stat = /* @__PURE__ */
|
|
6502
|
-
const menu = menuItems && menuItems.length ? /* @__PURE__ */
|
|
6765
|
+
const L = { ...DEFAULT_LABELS50, ...labels };
|
|
6766
|
+
const chart = spark && spark.length > 1 ? /* @__PURE__ */ jsx120(Sparkline, { data: spark, width: 128, height: 28, area: true, tone: sparkTone, color: sparkColor, "aria-label": L.trend + ": " + spark.join(", ") }) : null;
|
|
6767
|
+
const stat = /* @__PURE__ */ jsx120(Stat, { label, value, delta, invert, sub, icon, size, chart });
|
|
6768
|
+
const menu = menuItems && menuItems.length ? /* @__PURE__ */ jsx120("div", { className: "agn-kpi__menu", children: /* @__PURE__ */ jsx120(Menu, { align: "right", items: menuItems, onSelect: onMenuSelect, trigger: /* @__PURE__ */ jsx120(ButtonIcon, { icon: "ellipsis", label: L.options, size: "xs", variant: "ghost" }) }) }) : null;
|
|
6503
6769
|
if (plain) return /* @__PURE__ */ jsxs112("div", { className: cx("agn-kpi", "agn-kpi--plain", menu && "agn-kpi--menu", className), ...rest, children: [
|
|
6504
6770
|
stat,
|
|
6505
6771
|
menu
|
|
@@ -6510,16 +6776,16 @@ function KpiWidget({ label, value, delta, invert, sub, icon, spark, sparkTone, s
|
|
|
6510
6776
|
] });
|
|
6511
6777
|
}
|
|
6512
6778
|
function KpiRow({ items = [], children, label, className, ...rest }) {
|
|
6513
|
-
return /* @__PURE__ */
|
|
6779
|
+
return /* @__PURE__ */ jsx120("div", { className: cx("agn-kpi-row", className), role: "group", "aria-label": label, ...rest, children: children || items.map((it, i) => /* @__PURE__ */ jsx120(KpiWidget, { plain: true, ...it }, it.id || i)) });
|
|
6514
6780
|
}
|
|
6515
6781
|
|
|
6516
6782
|
// src/dashboard/ChartCard.jsx
|
|
6517
|
-
import
|
|
6518
|
-
import { Fragment as
|
|
6519
|
-
var
|
|
6783
|
+
import React123 from "react";
|
|
6784
|
+
import { Fragment as Fragment16, jsx as jsx121, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
6785
|
+
var DEFAULT_LABELS51 = { period: "Period", loading: "Loading chart", empty: "No data for this period", emptyHint: "Pick another period, or wait for the agent to receive traffic." };
|
|
6520
6786
|
function ChartCard({ title, icon, unit, periods, period, defaultPeriod, onPeriodChange, type = "line", series, data, categories = [], height = 160, format = (v) => String(v), legend = true, headline, state, footnote, actions, viewAll, labels, className, ...rest }) {
|
|
6521
|
-
const L = { ...
|
|
6522
|
-
const [own, setOwn] =
|
|
6787
|
+
const L = { ...DEFAULT_LABELS51, ...labels };
|
|
6788
|
+
const [own, setOwn] = React123.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
|
|
6523
6789
|
const per = period !== void 0 ? period : own;
|
|
6524
6790
|
const setPer = (v) => {
|
|
6525
6791
|
if (period === void 0) setOwn(v);
|
|
@@ -6528,37 +6794,37 @@ function ChartCard({ title, icon, unit, periods, period, defaultPeriod, onPeriod
|
|
|
6528
6794
|
const ser = series || [{ name: typeof title === "string" ? title : "", values: data || [] }];
|
|
6529
6795
|
const empty = state === "empty" || state !== "loading" && !ser.some((s) => s.values && s.values.length);
|
|
6530
6796
|
const plainTitle = typeof title === "string" ? title + (unit ? " (" + unit + ")" : "") : void 0;
|
|
6531
|
-
const head = /* @__PURE__ */ jsxs113(
|
|
6797
|
+
const head = /* @__PURE__ */ jsxs113(Fragment16, { children: [
|
|
6532
6798
|
title,
|
|
6533
|
-
unit && /* @__PURE__ */
|
|
6799
|
+
unit && /* @__PURE__ */ jsx121("span", { className: "agn-chart-card__unit", children: unit })
|
|
6534
6800
|
] });
|
|
6535
|
-
const right = (periods || actions) && /* @__PURE__ */ jsxs113(
|
|
6536
|
-
periods && /* @__PURE__ */
|
|
6801
|
+
const right = (periods || actions) && /* @__PURE__ */ jsxs113(Fragment16, { children: [
|
|
6802
|
+
periods && /* @__PURE__ */ jsx121(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }),
|
|
6537
6803
|
actions
|
|
6538
6804
|
] });
|
|
6539
6805
|
let body;
|
|
6540
6806
|
if (state === "loading") body = /* @__PURE__ */ jsxs113("div", { className: "agn-chart-card__loading", role: "status", "aria-busy": "true", children: [
|
|
6541
|
-
/* @__PURE__ */
|
|
6542
|
-
/* @__PURE__ */
|
|
6543
|
-
/* @__PURE__ */
|
|
6807
|
+
/* @__PURE__ */ jsx121("span", { className: "agn-sr", children: L.loading }),
|
|
6808
|
+
/* @__PURE__ */ jsx121(Skeleton, { shape: "rect", width: "100%", height }),
|
|
6809
|
+
/* @__PURE__ */ jsx121(Skeleton, { shape: "line", width: "40%" })
|
|
6544
6810
|
] });
|
|
6545
|
-
else if (empty) body = /* @__PURE__ */
|
|
6546
|
-
else body = /* @__PURE__ */
|
|
6811
|
+
else if (empty) body = /* @__PURE__ */ jsx121("div", { className: "agn-chart-card__empty", style: { minHeight: height }, children: /* @__PURE__ */ jsx121(EmptyState, { compact: true, icon: "chart-no-axes-column", title: L.empty, children: L.emptyHint }) });
|
|
6812
|
+
else body = /* @__PURE__ */ jsx121(MiniChart, { type: type === "stacked" ? "bar" : type, stacked: type === "stacked", series: ser, labels: categories, height, legend, format, title: plainTitle });
|
|
6547
6813
|
return /* @__PURE__ */ jsxs113(Card, { title: head, icon, actions: right, viewAll, className: cx("agn-chart-card", className), ...rest, children: [
|
|
6548
|
-
headline && state !== "loading" && !empty && /* @__PURE__ */
|
|
6549
|
-
/* @__PURE__ */
|
|
6550
|
-
footnote && /* @__PURE__ */
|
|
6814
|
+
headline && state !== "loading" && !empty && /* @__PURE__ */ jsx121(Stat, { size: "sm", className: "agn-chart-card__headline", ...headline }),
|
|
6815
|
+
/* @__PURE__ */ jsx121("div", { className: "agn-chart-card__plot", children: body }),
|
|
6816
|
+
footnote && /* @__PURE__ */ jsx121("p", { className: "agn-chart-card__foot", children: footnote })
|
|
6551
6817
|
] });
|
|
6552
6818
|
}
|
|
6553
6819
|
|
|
6554
6820
|
// src/dashboard/TaskListWidget.jsx
|
|
6555
|
-
import
|
|
6556
|
-
import { jsx as
|
|
6821
|
+
import React124 from "react";
|
|
6822
|
+
import { jsx as jsx122, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
6557
6823
|
var PRI = { high: { tone: "bad", icon: "chevrons-up" }, medium: { tone: "warn", icon: "chevron-up" }, low: { tone: "neutral", icon: "chevron-down" } };
|
|
6558
|
-
var
|
|
6824
|
+
var DEFAULT_LABELS52 = { title: "Tasks", add: "Add task", empty: "No open tasks", emptyHint: "Tasks assigned to you appear here.", overdue: "Overdue", due: "Due", high: "High", medium: "Medium", low: "Low", viewAll: "View all" };
|
|
6559
6825
|
function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone, viewAll, labels, className, ...rest }) {
|
|
6560
|
-
const L = { ...
|
|
6561
|
-
const [map, setMap] =
|
|
6826
|
+
const L = { ...DEFAULT_LABELS52, ...labels };
|
|
6827
|
+
const [map, setMap] = React124.useState({});
|
|
6562
6828
|
const isDone = (t) => t.id in map ? map[t.id] : !!t.done;
|
|
6563
6829
|
const toggle = (t, v) => {
|
|
6564
6830
|
setMap({ ...map, [t.id]: v });
|
|
@@ -6566,7 +6832,7 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
|
|
|
6566
6832
|
};
|
|
6567
6833
|
const list = hideDone ? tasks.filter((t) => !isDone(t)) : tasks;
|
|
6568
6834
|
const open = tasks.filter((t) => !isDone(t)).length;
|
|
6569
|
-
return /* @__PURE__ */
|
|
6835
|
+
return /* @__PURE__ */ jsx122(
|
|
6570
6836
|
Card,
|
|
6571
6837
|
{
|
|
6572
6838
|
title: title || L.title,
|
|
@@ -6574,21 +6840,21 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
|
|
|
6574
6840
|
count: open,
|
|
6575
6841
|
viewAll,
|
|
6576
6842
|
labels: { viewAll: L.viewAll },
|
|
6577
|
-
actions: onAdd && /* @__PURE__ */
|
|
6843
|
+
actions: onAdd && /* @__PURE__ */ jsx122(Button, { variant: "ghost", size: "sm", icon: "plus", onClick: onAdd, children: L.add }),
|
|
6578
6844
|
padding: "none",
|
|
6579
6845
|
className: cx("agn-tasks", className),
|
|
6580
6846
|
...rest,
|
|
6581
|
-
children: list.length === 0 ? /* @__PURE__ */
|
|
6847
|
+
children: list.length === 0 ? /* @__PURE__ */ jsx122("div", { className: "agn-tasks__empty", children: /* @__PURE__ */ jsx122(EmptyState, { compact: true, icon: "list-checks", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ jsx122("ul", { className: "agn-tasks__list", children: list.map((t) => {
|
|
6582
6848
|
const d = isDone(t);
|
|
6583
6849
|
const p = PRI[t.priority];
|
|
6584
6850
|
return /* @__PURE__ */ jsxs114("li", { className: cx("agn-tasks__item", d && "agn-tasks__item--done"), children: [
|
|
6585
|
-
/* @__PURE__ */
|
|
6851
|
+
/* @__PURE__ */ jsx122(Checkbox, { checked: d, onChange: (v) => toggle(t, v), "aria-label": typeof t.title === "string" ? t.title : void 0 }),
|
|
6586
6852
|
/* @__PURE__ */ jsxs114("div", { className: "agn-tasks__main", children: [
|
|
6587
|
-
onOpen ? /* @__PURE__ */
|
|
6853
|
+
onOpen ? /* @__PURE__ */ jsx122("button", { type: "button", className: "agn-tasks__title agn-tasks__title--link agn-focus", onClick: () => onOpen(t), children: t.title }) : /* @__PURE__ */ jsx122("span", { className: "agn-tasks__title", children: t.title }),
|
|
6588
6854
|
(t.related || t.due) && /* @__PURE__ */ jsxs114("span", { className: "agn-tasks__meta", children: [
|
|
6589
|
-
t.related && /* @__PURE__ */
|
|
6855
|
+
t.related && /* @__PURE__ */ jsx122("span", { className: "agn-tasks__related", children: t.related }),
|
|
6590
6856
|
t.due && /* @__PURE__ */ jsxs114("span", { className: cx("agn-tasks__due", t.overdue && !d && "agn-tasks__due--overdue"), children: [
|
|
6591
|
-
/* @__PURE__ */
|
|
6857
|
+
/* @__PURE__ */ jsx122(Icon, { name: t.overdue && !d ? "circle-alert" : "calendar", size: 12 }),
|
|
6592
6858
|
t.overdue && !d ? L.overdue + " \xB7 " : /* @__PURE__ */ jsxs114("span", { className: "agn-sr", children: [
|
|
6593
6859
|
L.due,
|
|
6594
6860
|
" "
|
|
@@ -6597,8 +6863,8 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
|
|
|
6597
6863
|
] })
|
|
6598
6864
|
] })
|
|
6599
6865
|
] }),
|
|
6600
|
-
p && /* @__PURE__ */
|
|
6601
|
-
t.owner && /* @__PURE__ */
|
|
6866
|
+
p && /* @__PURE__ */ jsx122(Tag, { tone: d ? "neutral" : p.tone, icon: p.icon, className: "agn-tasks__priority", children: L[t.priority] }),
|
|
6867
|
+
t.owner && /* @__PURE__ */ jsx122(Avatar, { size: "xs", name: t.owner, kind: t.ownerKind || "person", className: "agn-tasks__owner" })
|
|
6602
6868
|
] }, t.id);
|
|
6603
6869
|
}) })
|
|
6604
6870
|
}
|
|
@@ -6606,14 +6872,14 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
|
|
|
6606
6872
|
}
|
|
6607
6873
|
|
|
6608
6874
|
// src/dashboard/AiInsightWidget.jsx
|
|
6609
|
-
import
|
|
6610
|
-
import { jsx as
|
|
6611
|
-
var
|
|
6875
|
+
import React125 from "react";
|
|
6876
|
+
import { jsx as jsx123, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
6877
|
+
var DEFAULT_LABELS53 = { generated: "AI-generated", evidence: "Evidence", apply: "Apply", dismiss: "Dismiss", helpful: "Was this helpful?", yes: "Helpful", no: "Not helpful", thanks: "Thanks for the feedback", applied: "Applied", dismissed: "Dismissed", confidence: "confidence", check: "Check the evidence before you apply it." };
|
|
6612
6878
|
function AiInsightWidget({ title, children, evidence = [], confidence, model, time, status: statusProp, onApply, onDismiss, applyLabel, feedback: fbProp, onFeedback, labels, className, ...rest }) {
|
|
6613
|
-
const L = { ...
|
|
6614
|
-
const [own, setOwn] =
|
|
6879
|
+
const L = { ...DEFAULT_LABELS53, ...labels };
|
|
6880
|
+
const [own, setOwn] = React125.useState("open");
|
|
6615
6881
|
const status = statusProp || own;
|
|
6616
|
-
const [fbOwn, setFb] =
|
|
6882
|
+
const [fbOwn, setFb] = React125.useState(null);
|
|
6617
6883
|
const fb = fbProp !== void 0 ? fbProp : fbOwn;
|
|
6618
6884
|
const vote = (v) => {
|
|
6619
6885
|
const next = fb === v ? null : v;
|
|
@@ -6621,20 +6887,20 @@ function AiInsightWidget({ title, children, evidence = [], confidence, model, ti
|
|
|
6621
6887
|
onFeedback && onFeedback(next);
|
|
6622
6888
|
};
|
|
6623
6889
|
const meta = [confidence != null ? Math.round(confidence * 100) + "% " + L.confidence : null, model, time].filter(Boolean);
|
|
6624
|
-
return /* @__PURE__ */ jsxs115(Card, { icon: "sparkles", title: L.generated, as: "div", actions: meta.length > 0 && /* @__PURE__ */
|
|
6625
|
-
title && /* @__PURE__ */
|
|
6626
|
-
children && /* @__PURE__ */
|
|
6890
|
+
return /* @__PURE__ */ jsxs115(Card, { icon: "sparkles", title: L.generated, as: "div", actions: meta.length > 0 && /* @__PURE__ */ jsx123("span", { className: "agn-insight__meta", children: meta.map((m, i) => /* @__PURE__ */ jsx123("span", { children: m }, i)) }), className: cx("agn-insight", "agn-insight--" + status, className), ...rest, children: [
|
|
6891
|
+
title && /* @__PURE__ */ jsx123("h4", { className: "agn-insight__title", children: title }),
|
|
6892
|
+
children && /* @__PURE__ */ jsx123("div", { className: "agn-insight__text", children }),
|
|
6627
6893
|
evidence.length > 0 && /* @__PURE__ */ jsxs115("div", { className: "agn-insight__evidence", children: [
|
|
6628
|
-
/* @__PURE__ */
|
|
6629
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsx123("div", { className: "agn-insight__label", children: L.evidence }),
|
|
6895
|
+
/* @__PURE__ */ jsx123("ol", { className: "agn-insight__list", children: evidence.map((e, i) => {
|
|
6630
6896
|
const src = e.source && (typeof e.source === "string" ? { label: e.source } : e.source);
|
|
6631
6897
|
const SrcTag = src && src.href ? "a" : "span";
|
|
6632
6898
|
return /* @__PURE__ */ jsxs115("li", { className: "agn-insight__item", children: [
|
|
6633
|
-
/* @__PURE__ */
|
|
6899
|
+
/* @__PURE__ */ jsx123("span", { className: "agn-insight__n agn-num", "aria-hidden": "true", children: i + 1 }),
|
|
6634
6900
|
/* @__PURE__ */ jsxs115("div", { className: "agn-insight__item-main", children: [
|
|
6635
|
-
/* @__PURE__ */
|
|
6901
|
+
/* @__PURE__ */ jsx123("span", { className: "agn-insight__claim", children: e.text }),
|
|
6636
6902
|
src && /* @__PURE__ */ jsxs115(SrcTag, { className: "agn-insight__source", href: src.href, children: [
|
|
6637
|
-
/* @__PURE__ */
|
|
6903
|
+
/* @__PURE__ */ jsx123(Icon, { name: src.icon || "file-text", size: 12 }),
|
|
6638
6904
|
src.label
|
|
6639
6905
|
] })
|
|
6640
6906
|
] })
|
|
@@ -6643,30 +6909,30 @@ function AiInsightWidget({ title, children, evidence = [], confidence, model, ti
|
|
|
6643
6909
|
] }),
|
|
6644
6910
|
/* @__PURE__ */ jsxs115("div", { className: "agn-insight__foot", children: [
|
|
6645
6911
|
status === "open" ? /* @__PURE__ */ jsxs115("div", { className: "agn-insight__actions", children: [
|
|
6646
|
-
/* @__PURE__ */
|
|
6912
|
+
/* @__PURE__ */ jsx123(Button, { size: "sm", variant: "neutral", icon: "check", onClick: () => {
|
|
6647
6913
|
setOwn("applied");
|
|
6648
6914
|
onApply && onApply();
|
|
6649
6915
|
}, children: applyLabel || L.apply }),
|
|
6650
|
-
/* @__PURE__ */
|
|
6916
|
+
/* @__PURE__ */ jsx123(Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
6651
6917
|
setOwn("dismissed");
|
|
6652
6918
|
onDismiss && onDismiss();
|
|
6653
6919
|
}, children: L.dismiss })
|
|
6654
|
-
] }) : /* @__PURE__ */
|
|
6920
|
+
] }) : /* @__PURE__ */ jsx123(Tag, { tone: status === "applied" ? "ok" : "neutral", icon: status === "applied" ? "circle-check" : "x", children: L[status] || status }),
|
|
6655
6921
|
/* @__PURE__ */ jsxs115("div", { className: "agn-insight__feedback", role: "group", "aria-label": L.helpful, children: [
|
|
6656
|
-
/* @__PURE__ */
|
|
6657
|
-
/* @__PURE__ */
|
|
6658
|
-
/* @__PURE__ */
|
|
6922
|
+
/* @__PURE__ */ jsx123("span", { className: "agn-insight__ask", "aria-live": "polite", children: fb ? L.thanks : L.helpful }),
|
|
6923
|
+
/* @__PURE__ */ jsx123(ButtonIcon, { icon: "thumbs-up", label: L.yes, size: "xs", "aria-pressed": fb === "up", className: cx(fb === "up" && "agn-insight__thumb--on"), onClick: () => vote("up") }),
|
|
6924
|
+
/* @__PURE__ */ jsx123(ButtonIcon, { icon: "thumbs-down", label: L.no, size: "xs", "aria-pressed": fb === "down", className: cx(fb === "down" && "agn-insight__thumb--on"), onClick: () => vote("down") })
|
|
6659
6925
|
] })
|
|
6660
6926
|
] })
|
|
6661
6927
|
] });
|
|
6662
6928
|
}
|
|
6663
6929
|
|
|
6664
6930
|
// src/dashboard/FilterBar.jsx
|
|
6665
|
-
import
|
|
6666
|
-
import { jsx as
|
|
6667
|
-
var
|
|
6931
|
+
import React126 from "react";
|
|
6932
|
+
import { jsx as jsx124, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
6933
|
+
var DEFAULT_LABELS54 = { search: "Search\u2026", searchLabel: "Search", filters: "Quick filters", more: "More filters", views: "Saved view", active: "Filters", clear: "Clear all", remove: "Remove filter" };
|
|
6668
6934
|
function useCtl(value, def, cb) {
|
|
6669
|
-
const [own, setOwn] =
|
|
6935
|
+
const [own, setOwn] = React126.useState(def);
|
|
6670
6936
|
const v = value !== void 0 ? value : own;
|
|
6671
6937
|
return [v, (x) => {
|
|
6672
6938
|
if (value === void 0) setOwn(x);
|
|
@@ -6674,7 +6940,7 @@ function useCtl(value, def, cb) {
|
|
|
6674
6940
|
}];
|
|
6675
6941
|
}
|
|
6676
6942
|
function FilterBar({ search, defaultSearch = "", onSearch, chips = [], chipValue, defaultChipValue = [], onChipChange, moreFilters = [], onMoreFilter, moreOpen, onMoreOpenChange, views = [], view, defaultView = null, onViewChange, active, defaultActive = [], onActiveChange, onClear, right, labels, className, ...rest }) {
|
|
6677
|
-
const L = { ...
|
|
6943
|
+
const L = { ...DEFAULT_LABELS54, ...labels };
|
|
6678
6944
|
const [q, setQ] = useCtl(search, defaultSearch, onSearch);
|
|
6679
6945
|
const [cv, setCv] = useCtl(chipValue, defaultChipValue, onChipChange);
|
|
6680
6946
|
const [vw, setVw] = useCtl(view, defaultView, onViewChange);
|
|
@@ -6692,74 +6958,74 @@ function FilterBar({ search, defaultSearch = "", onSearch, chips = [], chipValue
|
|
|
6692
6958
|
};
|
|
6693
6959
|
return /* @__PURE__ */ jsxs116("div", { className: cx("agn-filterbar", className), ...rest, children: [
|
|
6694
6960
|
/* @__PURE__ */ jsxs116("div", { className: "agn-filterbar__row", children: [
|
|
6695
|
-
/* @__PURE__ */
|
|
6696
|
-
chips.length > 0 && /* @__PURE__ */
|
|
6697
|
-
moreFilters.length > 0 && /* @__PURE__ */
|
|
6698
|
-
/* @__PURE__ */
|
|
6699
|
-
views.length > 0 && /* @__PURE__ */
|
|
6961
|
+
/* @__PURE__ */ jsx124(Input, { icon: "search", value: q, onChange: (e) => setQ(e.target.value), onClear: q ? () => setQ("") : void 0, placeholder: L.search, "aria-label": L.searchLabel, className: "agn-filterbar__search" }),
|
|
6962
|
+
chips.length > 0 && /* @__PURE__ */ jsx124(ChipGroup, { multiple: true, options: chips, value: cv, onChange: setCv, label: L.filters }),
|
|
6963
|
+
moreFilters.length > 0 && /* @__PURE__ */ jsx124(Menu, { items: moreFilters, open: moreOpen, onOpenChange: onMoreOpenChange, searchable: moreFilters.length > 7, onSelect: add, trigger: /* @__PURE__ */ jsx124(Button, { variant: "ghost", icon: "list-filter", children: L.more }) }),
|
|
6964
|
+
/* @__PURE__ */ jsx124("span", { className: "agn-filterbar__spacer" }),
|
|
6965
|
+
views.length > 0 && /* @__PURE__ */ jsx124(Combobox, { options: views, value: vw, onChange: setVw, icon: "bookmark", placeholder: L.views, className: "agn-filterbar__views" }),
|
|
6700
6966
|
right
|
|
6701
6967
|
] }),
|
|
6702
6968
|
(act.length > 0 || any) && /* @__PURE__ */ jsxs116("div", { className: "agn-filterbar__active", children: [
|
|
6703
|
-
/* @__PURE__ */
|
|
6704
|
-
act.length > 0 && /* @__PURE__ */
|
|
6705
|
-
/* @__PURE__ */
|
|
6969
|
+
/* @__PURE__ */ jsx124("span", { className: "agn-filterbar__label", children: L.active }),
|
|
6970
|
+
act.length > 0 && /* @__PURE__ */ jsx124(PillContainer, { bare: true, children: act.map((a) => /* @__PURE__ */ jsx124(Pill, { size: "sm", label: a.label, icon: a.icon, labels: { remove: L.remove }, onRemove: () => setAct(act.filter((x) => x.key !== a.key)) }, a.key)) }),
|
|
6971
|
+
/* @__PURE__ */ jsx124(Button, { variant: "link", size: "sm", onClick: clearAll, children: L.clear })
|
|
6706
6972
|
] })
|
|
6707
6973
|
] });
|
|
6708
6974
|
}
|
|
6709
6975
|
|
|
6710
6976
|
// src/dashboard/RecordSummaryWidget.jsx
|
|
6711
|
-
import
|
|
6712
|
-
import { jsx as
|
|
6713
|
-
var
|
|
6977
|
+
import React127 from "react";
|
|
6978
|
+
import { jsx as jsx125, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
6979
|
+
var DEFAULT_LABELS55 = { open: "Open record", stage: "Stage" };
|
|
6714
6980
|
function RecordSummaryWidget({ object, title, subtitle, media: media2, avatar, icon = "bot", product, status, fields = [], stages, stage, lost, pathCompact, actions = [], onOpen, labels, className, ...rest }) {
|
|
6715
|
-
const L = { ...
|
|
6716
|
-
const mediaNode = media2 || (avatar ? /* @__PURE__ */
|
|
6981
|
+
const L = { ...DEFAULT_LABELS55, ...labels };
|
|
6982
|
+
const mediaNode = media2 || (avatar ? /* @__PURE__ */ jsx125(Avatar, { size: "lg", name: avatar }) : /* @__PURE__ */ jsx125(BlockIcon, { size: "xl", icon, product }));
|
|
6717
6983
|
const st = status && (typeof status === "string" ? { label: status } : status);
|
|
6718
6984
|
return /* @__PURE__ */ jsxs117(Card, { padding: "md", as: "div", className: cx("agn-record", className), ...rest, children: [
|
|
6719
6985
|
/* @__PURE__ */ jsxs117("div", { className: "agn-record__head", children: [
|
|
6720
6986
|
mediaNode,
|
|
6721
6987
|
/* @__PURE__ */ jsxs117("div", { className: "agn-record__heading", children: [
|
|
6722
|
-
object && /* @__PURE__ */
|
|
6723
|
-
/* @__PURE__ */
|
|
6724
|
-
subtitle && /* @__PURE__ */
|
|
6988
|
+
object && /* @__PURE__ */ jsx125("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: object }),
|
|
6989
|
+
/* @__PURE__ */ jsx125("h3", { className: "agn-record__title", children: title }),
|
|
6990
|
+
subtitle && /* @__PURE__ */ jsx125("div", { className: "agn-record__sub", children: subtitle })
|
|
6725
6991
|
] }),
|
|
6726
6992
|
/* @__PURE__ */ jsxs117("div", { className: "agn-record__side", children: [
|
|
6727
|
-
st && /* @__PURE__ */
|
|
6728
|
-
onOpen && /* @__PURE__ */
|
|
6993
|
+
st && /* @__PURE__ */ jsx125(Tag, { tone: st.tone, dot: st.dot, icon: st.icon, children: st.label }),
|
|
6994
|
+
onOpen && /* @__PURE__ */ jsx125(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
|
|
6729
6995
|
] })
|
|
6730
6996
|
] }),
|
|
6731
|
-
fields.length > 0 && /* @__PURE__ */
|
|
6732
|
-
stages && stages.length > 0 && /* @__PURE__ */
|
|
6733
|
-
actions.length > 0 && /* @__PURE__ */
|
|
6997
|
+
fields.length > 0 && /* @__PURE__ */ jsx125(SummaryDetail, { fields, dense: true, className: "agn-record__fields" }),
|
|
6998
|
+
stages && stages.length > 0 && /* @__PURE__ */ jsx125(Path, { steps: stages, current: stage, lost, compact: pathCompact, labels: { stage: L.stage, ...L.path || {} }, className: "agn-record__path" }),
|
|
6999
|
+
actions.length > 0 && /* @__PURE__ */ jsx125("div", { className: "agn-record__actions", children: actions.map((a, i) => /* @__PURE__ */ jsx125(Button, { size: "sm", variant: a.variant || (i === 0 ? "neutral" : "ghost"), icon: a.icon, onClick: a.onClick, disabled: a.disabled, children: a.label }, a.label || i)) })
|
|
6734
7000
|
] });
|
|
6735
7001
|
}
|
|
6736
7002
|
|
|
6737
7003
|
// src/dashboard/TeamWorkloadWidget.jsx
|
|
6738
|
-
import
|
|
6739
|
-
import { Fragment as
|
|
6740
|
-
var
|
|
7004
|
+
import React128 from "react";
|
|
7005
|
+
import { Fragment as Fragment17, jsx as jsx126, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
7006
|
+
var DEFAULT_LABELS56 = { title: "Team workload", over: "Over capacity", overCount: "over capacity", unit: "tasks", load: "workload", viewAll: "View all" };
|
|
6741
7007
|
function TeamWorkloadWidget({ members = [], title, unit, overAt = 1, onMember, viewAll, labels, className, ...rest }) {
|
|
6742
|
-
const L = { ...
|
|
7008
|
+
const L = { ...DEFAULT_LABELS56, ...labels };
|
|
6743
7009
|
const u = unit || L.unit;
|
|
6744
7010
|
const rows = members.map((m) => ({ ...m, ratio: m.value / (m.capacity || 1) }));
|
|
6745
7011
|
const overN = rows.filter((r) => r.ratio > overAt).length;
|
|
6746
|
-
return /* @__PURE__ */
|
|
7012
|
+
return /* @__PURE__ */ jsx126(Card, { title: title || L.title, icon: "users", viewAll, labels: { viewAll: L.viewAll }, actions: overN > 0 && /* @__PURE__ */ jsxs118(Tag, { tone: "warn", icon: "triangle-alert", children: [
|
|
6747
7013
|
overN,
|
|
6748
7014
|
" ",
|
|
6749
7015
|
L.overCount
|
|
6750
|
-
] }), className: cx("agn-workload", className), ...rest, children: /* @__PURE__ */
|
|
7016
|
+
] }), className: cx("agn-workload", className), ...rest, children: /* @__PURE__ */ jsx126("ul", { className: "agn-workload__list", children: rows.map((m, i) => {
|
|
6751
7017
|
const over = m.ratio > overAt;
|
|
6752
7018
|
const text = m.value + " / " + m.capacity + " " + u;
|
|
6753
7019
|
return /* @__PURE__ */ jsxs118("li", { className: cx("agn-workload__row", over && "agn-workload__row--over"), children: [
|
|
6754
|
-
/* @__PURE__ */
|
|
7020
|
+
/* @__PURE__ */ jsx126(Avatar, { size: "sm", name: m.name, kind: m.kind || "person", status: m.status }),
|
|
6755
7021
|
/* @__PURE__ */ jsxs118("div", { className: "agn-workload__who", children: [
|
|
6756
|
-
onMember ? /* @__PURE__ */
|
|
6757
|
-
m.role && /* @__PURE__ */
|
|
7022
|
+
onMember ? /* @__PURE__ */ jsx126("button", { type: "button", className: "agn-workload__name agn-workload__name--link agn-focus", onClick: () => onMember(m), children: m.name }) : /* @__PURE__ */ jsx126("span", { className: "agn-workload__name", children: m.name }),
|
|
7023
|
+
m.role && /* @__PURE__ */ jsx126("span", { className: "agn-workload__role", children: m.role })
|
|
6758
7024
|
] }),
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
6761
|
-
/* @__PURE__ */
|
|
6762
|
-
/* @__PURE__ */
|
|
7025
|
+
/* @__PURE__ */ jsx126(ProgressBar, { className: "agn-workload__bar", size: "sm", value: Math.min(m.value, m.capacity), max: m.capacity, tone: over ? "warn" : "signal", valueText: text, labels: { working: m.name + " " + L.load } }),
|
|
7026
|
+
/* @__PURE__ */ jsx126("span", { className: "agn-workload__value agn-num", children: text }),
|
|
7027
|
+
/* @__PURE__ */ jsx126("span", { className: "agn-workload__flag", children: over && /* @__PURE__ */ jsxs118(Fragment17, { children: [
|
|
7028
|
+
/* @__PURE__ */ jsx126(Icon, { name: "triangle-alert", size: 12 }),
|
|
6763
7029
|
L.over
|
|
6764
7030
|
] }) })
|
|
6765
7031
|
] }, m.id || m.name || i);
|
|
@@ -6767,14 +7033,14 @@ function TeamWorkloadWidget({ members = [], title, unit, overAt = 1, onMember, v
|
|
|
6767
7033
|
}
|
|
6768
7034
|
|
|
6769
7035
|
// src/dashboard/ActivityWidget.jsx
|
|
6770
|
-
import
|
|
6771
|
-
import { jsx as
|
|
7036
|
+
import React129 from "react";
|
|
7037
|
+
import { jsx as jsx127, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
6772
7038
|
var KINDS = { runs: ["run", "step", "agent", "deploy", "error", "success"], approvals: ["approval", "handoff", "warn"], conversations: ["call", "message", "email"], notes: ["note", "edit", "event"] };
|
|
6773
|
-
var
|
|
7039
|
+
var DEFAULT_LABELS57 = { title: "Activity", filter: "Activity type", all: "All", runs: "Runs", approvals: "Approvals", conversations: "Conversations", notes: "Notes", empty: "No activity of this type", emptyHint: "Pick another type to see more.", viewAll: "View all", show: "Show details", hide: "Hide details" };
|
|
6774
7040
|
function ActivityWidget({ items = [], types, type, defaultType = "all", onTypeChange, title, max, compact = true, viewAll, labels, className, ...rest }) {
|
|
6775
|
-
const L = { ...
|
|
7041
|
+
const L = { ...DEFAULT_LABELS57, ...labels };
|
|
6776
7042
|
const opts = types || [{ value: "all", label: L.all }, ...Object.keys(KINDS).map((k) => ({ value: k, label: L[k], kinds: KINDS[k] }))];
|
|
6777
|
-
const [own, setOwn] =
|
|
7043
|
+
const [own, setOwn] = React129.useState(defaultType);
|
|
6778
7044
|
const t = type !== void 0 ? type : own;
|
|
6779
7045
|
const set = (v) => {
|
|
6780
7046
|
if (type === void 0) setOwn(v);
|
|
@@ -6783,42 +7049,42 @@ function ActivityWidget({ items = [], types, type, defaultType = "all", onTypeCh
|
|
|
6783
7049
|
const cur = opts.find((o) => o.value === t);
|
|
6784
7050
|
const shown = (cur && cur.kinds ? items.filter((it) => cur.kinds.includes(it.kind)) : items).slice(0, max || void 0);
|
|
6785
7051
|
return /* @__PURE__ */ jsxs119(Card, { title: title || L.title, icon: "history", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-activity-w", className), ...rest, children: [
|
|
6786
|
-
/* @__PURE__ */
|
|
6787
|
-
shown.length ? /* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsx127("div", { className: "agn-activity-w__filter", children: /* @__PURE__ */ jsx127(SegmentedControl, { size: "sm", options: opts.map((o) => ({ label: o.label, value: o.value })), value: t, onChange: set, label: L.filter }) }),
|
|
7053
|
+
shown.length ? /* @__PURE__ */ jsx127(ActivityTimeline, { items: shown, compact, labels: { show: L.show, hide: L.hide } }) : /* @__PURE__ */ jsx127(EmptyState, { compact: true, icon: "history", title: L.empty, children: L.emptyHint })
|
|
6788
7054
|
] });
|
|
6789
7055
|
}
|
|
6790
7056
|
|
|
6791
7057
|
// src/dashboard/QuickActions.jsx
|
|
6792
|
-
import
|
|
6793
|
-
import { jsx as
|
|
6794
|
-
var
|
|
7058
|
+
import React130 from "react";
|
|
7059
|
+
import { jsx as jsx128, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
7060
|
+
var DEFAULT_LABELS58 = { title: "Quick actions" };
|
|
6795
7061
|
function QuickActions({ actions = [], onAction, columns, minTile = 168, title, labels, className, style, ...rest }) {
|
|
6796
|
-
const L = { ...
|
|
7062
|
+
const L = { ...DEFAULT_LABELS58, ...labels };
|
|
6797
7063
|
const gridStyle = columns ? { gridTemplateColumns: "repeat(" + columns + ", minmax(0, 1fr))" } : { "--agn-quick-min": minTile + "px" };
|
|
6798
|
-
const grid = /* @__PURE__ */
|
|
7064
|
+
const grid = /* @__PURE__ */ jsx128("div", { className: cx("agn-quick", !title && className), role: "group", "aria-label": title || L.title, style: title ? gridStyle : { ...gridStyle, ...style }, ...title ? {} : rest, children: actions.map((a, i) => /* @__PURE__ */ jsxs120("button", { type: "button", className: "agn-quick__tile agn-focus", disabled: a.disabled, onClick: () => {
|
|
6799
7065
|
a.onClick && a.onClick(a);
|
|
6800
7066
|
onAction && onAction(a);
|
|
6801
7067
|
}, children: [
|
|
6802
7068
|
/* @__PURE__ */ jsxs120("span", { className: "agn-quick__top", children: [
|
|
6803
|
-
/* @__PURE__ */
|
|
6804
|
-
a.shortcut && /* @__PURE__ */
|
|
6805
|
-
a.badge != null && /* @__PURE__ */
|
|
7069
|
+
/* @__PURE__ */ jsx128(BlockIcon, { icon: a.icon, product: a.product, tone: a.tone || "signal", size: "lg" }),
|
|
7070
|
+
a.shortcut && /* @__PURE__ */ jsx128(Kbd, { size: "sm", keys: Array.isArray(a.shortcut) ? a.shortcut : String(a.shortcut).split(" "), className: "agn-quick__kbd" }),
|
|
7071
|
+
a.badge != null && /* @__PURE__ */ jsx128(Badge, { count: a.badge, solid: true, size: "sm", className: "agn-quick__badge" })
|
|
6806
7072
|
] }),
|
|
6807
|
-
/* @__PURE__ */
|
|
6808
|
-
a.description && /* @__PURE__ */
|
|
7073
|
+
/* @__PURE__ */ jsx128("span", { className: "agn-quick__label", children: a.label }),
|
|
7074
|
+
a.description && /* @__PURE__ */ jsx128("span", { className: "agn-quick__desc", children: a.description })
|
|
6809
7075
|
] }, a.id || a.label || i)) });
|
|
6810
7076
|
if (!title) return grid;
|
|
6811
|
-
return /* @__PURE__ */
|
|
7077
|
+
return /* @__PURE__ */ jsx128(Card, { title, icon: "zap", padding: "sm", className: cx("agn-quick-card", className), style, ...rest, children: grid });
|
|
6812
7078
|
}
|
|
6813
7079
|
|
|
6814
7080
|
// src/dashboard/NotificationsWidget.jsx
|
|
6815
|
-
import
|
|
6816
|
-
import { jsx as
|
|
6817
|
-
var
|
|
7081
|
+
import React131 from "react";
|
|
7082
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
7083
|
+
var DEFAULT_LABELS59 = { title: "Notifications", markAll: "Mark all as read", today: "Today", yesterday: "Yesterday", empty: "You are all caught up", viewAll: "View all" };
|
|
6818
7084
|
function NotificationsWidget({ items = [], title, onMarkAll, onItem, max, locale, viewAll, labels, className, ...rest }) {
|
|
6819
|
-
const L = { ...
|
|
6820
|
-
const [readAll, setReadAll] =
|
|
6821
|
-
const [read2, setRead] =
|
|
7085
|
+
const L = { ...DEFAULT_LABELS59, ...labels };
|
|
7086
|
+
const [readAll, setReadAll] = React131.useState(false);
|
|
7087
|
+
const [read2, setRead] = React131.useState({});
|
|
6822
7088
|
const list = items.slice(0, max || void 0).map((it, i) => {
|
|
6823
7089
|
const key = it.id || String(i);
|
|
6824
7090
|
const open = onItem || it.onClick;
|
|
@@ -6829,41 +7095,41 @@ function NotificationsWidget({ items = [], title, onMarkAll, onItem, max, locale
|
|
|
6829
7095
|
} : void 0 };
|
|
6830
7096
|
});
|
|
6831
7097
|
const anyUnread = list.some((i) => i.unread);
|
|
6832
|
-
return /* @__PURE__ */
|
|
7098
|
+
return /* @__PURE__ */ jsx129(Card, { as: "div", padding: "none", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-notifs-w", className), ...rest, children: /* @__PURE__ */ jsx129(NotificationList, { bare: true, title: title || L.title, items: list, locale, onMarkAll: anyUnread ? () => {
|
|
6833
7099
|
setReadAll(true);
|
|
6834
7100
|
onMarkAll && onMarkAll();
|
|
6835
7101
|
} : void 0, labels: { title: L.title, markAll: L.markAll, today: L.today, yesterday: L.yesterday, empty: L.empty } }) });
|
|
6836
7102
|
}
|
|
6837
7103
|
|
|
6838
7104
|
// src/dashboard/AgentFlowWidget.jsx
|
|
6839
|
-
import
|
|
6840
|
-
import { Fragment as
|
|
7105
|
+
import React132 from "react";
|
|
7106
|
+
import { Fragment as Fragment18, jsx as jsx130, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
6841
7107
|
var STATE2 = { done: "default", running: "running", error: "error", waiting: "default", upcoming: "default" };
|
|
6842
7108
|
var CAP_ICON = { done: "check", running: "loader-circle", error: "circle-alert", waiting: "pause", upcoming: "minus" };
|
|
6843
|
-
var
|
|
7109
|
+
var DEFAULT_LABELS60 = { flow: "Agent steps", done: "Done", running: "Running", error: "Failed", waiting: "Waiting", upcoming: "Not reached", live: "live runs", liveOne: "live run", open: "Open in builder" };
|
|
6844
7110
|
function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWidth = 160, gap = 24, onOpen, labels, className, ...rest }) {
|
|
6845
|
-
const L = { ...
|
|
7111
|
+
const L = { ...DEFAULT_LABELS60, ...labels };
|
|
6846
7112
|
const reached = (s) => s && s.state && s.state !== "upcoming";
|
|
6847
7113
|
const edgeState = (s) => s.state === "running" || s.state === "waiting" ? "running" : reached(s) ? "active" : "deleted";
|
|
6848
|
-
const head = /* @__PURE__ */ jsxs121(
|
|
7114
|
+
const head = /* @__PURE__ */ jsxs121(Fragment18, { children: [
|
|
6849
7115
|
title || agent,
|
|
6850
|
-
version && /* @__PURE__ */
|
|
7116
|
+
version && /* @__PURE__ */ jsx130("span", { className: "agn-flow__version", children: version })
|
|
6851
7117
|
] });
|
|
6852
|
-
const actions = (liveRuns != null || onOpen) && /* @__PURE__ */ jsxs121(
|
|
7118
|
+
const actions = (liveRuns != null || onOpen) && /* @__PURE__ */ jsxs121(Fragment18, { children: [
|
|
6853
7119
|
liveRuns != null && /* @__PURE__ */ jsxs121(Tag, { tone: liveRuns > 0 ? "signal" : "neutral", dot: liveRuns > 0, children: [
|
|
6854
7120
|
liveRuns,
|
|
6855
7121
|
" ",
|
|
6856
7122
|
liveRuns === 1 ? L.liveOne : L.live
|
|
6857
7123
|
] }),
|
|
6858
|
-
onOpen && /* @__PURE__ */
|
|
7124
|
+
onOpen && /* @__PURE__ */ jsx130(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
|
|
6859
7125
|
] });
|
|
6860
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx130(Card, { title: head, icon: "route", actions, padding: "none", className: cx("agn-flow-w", className), ...rest, children: /* @__PURE__ */ jsx130("div", { className: "agn-flow", role: "list", "aria-label": L.flow, children: steps.map((s, i) => {
|
|
6861
7127
|
const st = s.state || "upcoming";
|
|
6862
7128
|
const caption = st === "upcoming" ? L.upcoming : (s.runs != null ? s.runs + " \xB7 " : "") + L[st];
|
|
6863
|
-
return /* @__PURE__ */ jsxs121(
|
|
6864
|
-
i > 0 && /* @__PURE__ */
|
|
7129
|
+
return /* @__PURE__ */ jsxs121(React132.Fragment, { children: [
|
|
7130
|
+
i > 0 && /* @__PURE__ */ jsx130("svg", { className: "agn-flow__edge", width: gap, height: 16, viewBox: "0 0 " + gap + " 16", "aria-hidden": "true", children: /* @__PURE__ */ jsx130(CanvasEdge, { from: { x: 2, y: 8 }, to: { x: gap - 3, y: 8 }, state: edgeState(s) }) }),
|
|
6865
7131
|
/* @__PURE__ */ jsxs121("div", { className: "agn-flow__step", role: "listitem", "aria-current": st === "running" ? "step" : void 0, style: { width: blockWidth }, children: [
|
|
6866
|
-
/* @__PURE__ */
|
|
7132
|
+
/* @__PURE__ */ jsx130(
|
|
6867
7133
|
CanvasBlock,
|
|
6868
7134
|
{
|
|
6869
7135
|
name: s.name,
|
|
@@ -6878,7 +7144,7 @@ function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWid
|
|
|
6878
7144
|
}
|
|
6879
7145
|
),
|
|
6880
7146
|
/* @__PURE__ */ jsxs121("span", { className: cx("agn-flow__caption", "agn-flow__caption--" + st), children: [
|
|
6881
|
-
/* @__PURE__ */
|
|
7147
|
+
/* @__PURE__ */ jsx130(Icon, { name: CAP_ICON[st], size: 12, className: st === "running" ? "agn-flow__spin" : void 0 }),
|
|
6882
7148
|
caption
|
|
6883
7149
|
] })
|
|
6884
7150
|
] })
|
|
@@ -6887,12 +7153,12 @@ function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWid
|
|
|
6887
7153
|
}
|
|
6888
7154
|
|
|
6889
7155
|
// src/dashboard/LeaderboardWidget.jsx
|
|
6890
|
-
import
|
|
6891
|
-
import { Fragment as
|
|
6892
|
-
var
|
|
7156
|
+
import React133 from "react";
|
|
7157
|
+
import { Fragment as Fragment19, jsx as jsx131, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
7158
|
+
var DEFAULT_LABELS61 = { title: "Leaderboard", period: "Period", rank: "Rank", name: "Name", value: "Value", change: "Change", up: "up", down: "down", flat: "no change", viewAll: "View all" };
|
|
6893
7159
|
function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultPeriod, onPeriodChange, format = (v) => String(v), deltaFormat = (v) => (v > 0 ? "+" : "") + v, invert, highlight, max, sort = true, viewAll, labels, className, ...rest }) {
|
|
6894
|
-
const L = { ...
|
|
6895
|
-
const [own, setOwn] =
|
|
7160
|
+
const L = { ...DEFAULT_LABELS61, ...labels };
|
|
7161
|
+
const [own, setOwn] = React133.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
|
|
6896
7162
|
const per = period !== void 0 ? period : own;
|
|
6897
7163
|
const setPer = (v) => {
|
|
6898
7164
|
if (period === void 0) setOwn(v);
|
|
@@ -6900,32 +7166,32 @@ function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultP
|
|
|
6900
7166
|
};
|
|
6901
7167
|
const list = (sort ? [...rows].sort((a, b) => invert ? a.value - b.value : b.value - a.value) : rows).slice(0, max || void 0);
|
|
6902
7168
|
const top = Math.max(...list.map((r) => r.value), 1);
|
|
6903
|
-
return /* @__PURE__ */ jsxs122(Card, { title: title || L.title, icon: "list-ordered", viewAll, labels: { viewAll: L.viewAll }, actions: periods && /* @__PURE__ */
|
|
7169
|
+
return /* @__PURE__ */ jsxs122(Card, { title: title || L.title, icon: "list-ordered", viewAll, labels: { viewAll: L.viewAll }, actions: periods && /* @__PURE__ */ jsx131(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }), className: cx("agn-leader", className), ...rest, children: [
|
|
6904
7170
|
/* @__PURE__ */ jsxs122("div", { className: "agn-leader__head", "aria-hidden": "true", children: [
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
/* @__PURE__ */
|
|
6907
|
-
/* @__PURE__ */
|
|
6908
|
-
/* @__PURE__ */
|
|
7171
|
+
/* @__PURE__ */ jsx131("span", { children: "#" }),
|
|
7172
|
+
/* @__PURE__ */ jsx131("span", { children: L.name }),
|
|
7173
|
+
/* @__PURE__ */ jsx131("span", { className: "agn-leader__head-value", children: metric || L.value }),
|
|
7174
|
+
/* @__PURE__ */ jsx131("span", { children: L.change })
|
|
6909
7175
|
] }),
|
|
6910
|
-
/* @__PURE__ */
|
|
7176
|
+
/* @__PURE__ */ jsx131("ol", { className: "agn-leader__list", children: list.map((r, i) => {
|
|
6911
7177
|
const d = r.delta;
|
|
6912
7178
|
const dir = d == null || d === 0 ? "flat" : d > 0 ? "up" : "down";
|
|
6913
7179
|
const good = dir === "flat" ? null : dir === "up" !== !!invert;
|
|
6914
7180
|
return /* @__PURE__ */ jsxs122("li", { className: cx("agn-leader__row", highlight != null && (r.id === highlight || r.name === highlight) && "agn-leader__row--hl"), children: [
|
|
6915
|
-
/* @__PURE__ */
|
|
7181
|
+
/* @__PURE__ */ jsx131("span", { className: "agn-leader__rank agn-num", children: i + 1 }),
|
|
6916
7182
|
/* @__PURE__ */ jsxs122("span", { className: "agn-leader__who", children: [
|
|
6917
|
-
/* @__PURE__ */
|
|
7183
|
+
/* @__PURE__ */ jsx131(Avatar, { size: "sm", name: r.name, kind: r.kind || "agent", product: r.product, icon: r.icon }),
|
|
6918
7184
|
/* @__PURE__ */ jsxs122("span", { className: "agn-leader__text", children: [
|
|
6919
|
-
/* @__PURE__ */
|
|
6920
|
-
r.sub && /* @__PURE__ */
|
|
7185
|
+
/* @__PURE__ */ jsx131("span", { className: "agn-leader__name", children: r.name }),
|
|
7186
|
+
r.sub && /* @__PURE__ */ jsx131("span", { className: "agn-leader__sub", children: r.sub })
|
|
6921
7187
|
] })
|
|
6922
7188
|
] }),
|
|
6923
7189
|
/* @__PURE__ */ jsxs122("span", { className: "agn-leader__measure", children: [
|
|
6924
|
-
/* @__PURE__ */
|
|
6925
|
-
/* @__PURE__ */
|
|
7190
|
+
/* @__PURE__ */ jsx131("span", { className: "agn-leader__bar", "aria-hidden": "true", children: /* @__PURE__ */ jsx131("span", { className: "agn-leader__fill", style: { width: Math.max(2, r.value / top * 100) + "%" } }) }),
|
|
7191
|
+
/* @__PURE__ */ jsx131("span", { className: "agn-leader__value agn-num", children: format(r.value) })
|
|
6926
7192
|
] }),
|
|
6927
|
-
/* @__PURE__ */
|
|
6928
|
-
/* @__PURE__ */
|
|
7193
|
+
/* @__PURE__ */ jsx131("span", { className: cx("agn-leader__delta", "agn-leader__delta--" + (good == null ? "flat" : good ? "ok" : "bad")), children: d != null && /* @__PURE__ */ jsxs122(Fragment19, { children: [
|
|
7194
|
+
/* @__PURE__ */ jsx131(Icon, { name: dir === "up" ? "arrow-up-right" : dir === "down" ? "arrow-down-right" : "minus", size: 12 }),
|
|
6929
7195
|
/* @__PURE__ */ jsxs122("span", { className: "agn-sr", children: [
|
|
6930
7196
|
L[dir],
|
|
6931
7197
|
" "
|
|
@@ -6938,14 +7204,14 @@ function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultP
|
|
|
6938
7204
|
}
|
|
6939
7205
|
|
|
6940
7206
|
// src/dashboard/AgendaWidget.jsx
|
|
6941
|
-
import
|
|
6942
|
-
import { Fragment as
|
|
7207
|
+
import React134 from "react";
|
|
7208
|
+
import { Fragment as Fragment20, jsx as jsx132, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
6943
7209
|
var KIND_ICON2 = { run: "play", review: "user-check", call: "phone", maintenance: "wrench", deploy: "rocket", meeting: "users" };
|
|
6944
|
-
var
|
|
7210
|
+
var DEFAULT_LABELS62 = { title: "Today", add: "Schedule a run", empty: "Nothing scheduled", emptyHint: "Scheduled runs and reviews for this day appear here.", now: "Now", done: "Done", live: "Live", soon: "in {n} min", allDay: "All day", run: "Scheduled run", review: "Review", call: "Call", maintenance: "Maintenance", deploy: "Deploy", meeting: "Meeting", viewAll: "Open calendar" };
|
|
6945
7211
|
var toDate3 = (d) => d instanceof Date ? d : new Date(d);
|
|
6946
7212
|
var sameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
6947
7213
|
function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, onAdd, max, viewAll, labels, className, ...rest }) {
|
|
6948
|
-
const L = { ...
|
|
7214
|
+
const L = { ...DEFAULT_LABELS62, ...labels };
|
|
6949
7215
|
locale = /^en$/i.test(locale) ? "en-GB" : locale;
|
|
6950
7216
|
const nowD = now ? toDate3(now) : /* @__PURE__ */ new Date();
|
|
6951
7217
|
const day = date ? toDate3(date) : nowD;
|
|
@@ -6958,42 +7224,42 @@ function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, o
|
|
|
6958
7224
|
}).filter((e) => sameDay2(e._s, day)).sort((a, b) => a.allDay ? -1 : b.allDay ? 1 : a._s - b._s).slice(0, max || void 0);
|
|
6959
7225
|
const showNow = sameDay2(day, nowD);
|
|
6960
7226
|
const nowAt = showNow ? list.findIndex((e) => !e.allDay && !e._past && !e._live) : -1;
|
|
6961
|
-
const actions = /* @__PURE__ */ jsxs123(
|
|
6962
|
-
/* @__PURE__ */
|
|
6963
|
-
onAdd && /* @__PURE__ */
|
|
7227
|
+
const actions = /* @__PURE__ */ jsxs123(Fragment20, { children: [
|
|
7228
|
+
/* @__PURE__ */ jsx132("span", { className: "agn-agenda__date agn-num", children: dayText }),
|
|
7229
|
+
onAdd && /* @__PURE__ */ jsx132(ButtonIcon, { icon: "calendar-plus", label: L.add, size: "sm", onClick: onAdd })
|
|
6964
7230
|
] });
|
|
6965
|
-
const nowLine = /* @__PURE__ */
|
|
7231
|
+
const nowLine = /* @__PURE__ */ jsx132("li", { className: "agn-agenda__now", "aria-hidden": "true", children: /* @__PURE__ */ jsxs123("span", { className: "agn-agenda__now-label agn-num", children: [
|
|
6966
7232
|
L.now,
|
|
6967
7233
|
" ",
|
|
6968
7234
|
tm(nowD)
|
|
6969
7235
|
] }) }, "now");
|
|
6970
|
-
return /* @__PURE__ */
|
|
7236
|
+
return /* @__PURE__ */ jsx132(Card, { title: title || L.title, icon: "calendar-days", actions, viewAll, labels: { viewAll: L.viewAll }, padding: "none", className: cx("agn-agenda", className), ...rest, children: list.length === 0 ? /* @__PURE__ */ jsx132("div", { className: "agn-agenda__empty", children: /* @__PURE__ */ jsx132(EmptyState, { compact: true, icon: "calendar", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ jsxs123("ol", { className: "agn-agenda__list", children: [
|
|
6971
7237
|
list.map((e, i) => {
|
|
6972
7238
|
const mins = Math.round((e._s - nowD) / 6e4);
|
|
6973
7239
|
const Title = onEvent ? "button" : "span";
|
|
6974
|
-
return /* @__PURE__ */ jsxs123(
|
|
7240
|
+
return /* @__PURE__ */ jsxs123(React134.Fragment, { children: [
|
|
6975
7241
|
i === nowAt && nowLine,
|
|
6976
7242
|
/* @__PURE__ */ jsxs123("li", { className: cx("agn-agenda__item", "agn-agenda__item--" + (e.tone || "signal"), e._past && "agn-agenda__item--past", e._live && "agn-agenda__item--live"), children: [
|
|
6977
|
-
/* @__PURE__ */
|
|
7243
|
+
/* @__PURE__ */ jsx132("span", { className: "agn-agenda__time agn-num", children: e.allDay ? L.allDay : /* @__PURE__ */ jsxs123(Fragment20, { children: [
|
|
6978
7244
|
tm(e._s),
|
|
6979
|
-
/* @__PURE__ */
|
|
7245
|
+
/* @__PURE__ */ jsx132("span", { className: "agn-agenda__end", children: tm(e._e) })
|
|
6980
7246
|
] }) }),
|
|
6981
|
-
/* @__PURE__ */
|
|
7247
|
+
/* @__PURE__ */ jsx132("span", { className: "agn-agenda__bar", "aria-hidden": "true" }),
|
|
6982
7248
|
/* @__PURE__ */ jsxs123("span", { className: "agn-agenda__main", children: [
|
|
6983
|
-
/* @__PURE__ */
|
|
7249
|
+
/* @__PURE__ */ jsx132(Title, { type: onEvent ? "button" : void 0, className: cx("agn-agenda__title", onEvent && "agn-agenda__title--link agn-focus"), onClick: onEvent ? () => onEvent(e) : void 0, children: e.title }),
|
|
6984
7250
|
/* @__PURE__ */ jsxs123("span", { className: "agn-agenda__meta", children: [
|
|
6985
7251
|
e.kind && /* @__PURE__ */ jsxs123("span", { className: "agn-agenda__kind", children: [
|
|
6986
|
-
/* @__PURE__ */
|
|
7252
|
+
/* @__PURE__ */ jsx132(Icon, { name: KIND_ICON2[e.kind] || "circle", size: 12 }),
|
|
6987
7253
|
L[e.kind] || e.kind
|
|
6988
7254
|
] }),
|
|
6989
|
-
e.tenant && /* @__PURE__ */
|
|
6990
|
-
e.meta && /* @__PURE__ */
|
|
7255
|
+
e.tenant && /* @__PURE__ */ jsx132("span", { className: "agn-agenda__tenant", children: e.tenant }),
|
|
7256
|
+
e.meta && /* @__PURE__ */ jsx132("span", { children: e.meta })
|
|
6991
7257
|
] })
|
|
6992
7258
|
] }),
|
|
6993
|
-
/* @__PURE__ */
|
|
6994
|
-
/* @__PURE__ */
|
|
7259
|
+
/* @__PURE__ */ jsx132("span", { className: "agn-agenda__status", children: e._live ? /* @__PURE__ */ jsx132(Tag, { tone: "signal", dot: true, children: L.live }) : e._past ? /* @__PURE__ */ jsxs123("span", { className: "agn-agenda__done", children: [
|
|
7260
|
+
/* @__PURE__ */ jsx132(Icon, { name: "check", size: 12 }),
|
|
6995
7261
|
L.done
|
|
6996
|
-
] }) : showNow && mins > 0 && mins <= 60 ? /* @__PURE__ */
|
|
7262
|
+
] }) : showNow && mins > 0 && mins <= 60 ? /* @__PURE__ */ jsx132("span", { className: "agn-agenda__soon agn-num", children: L.soon.replace("{n}", mins) }) : null })
|
|
6997
7263
|
] })
|
|
6998
7264
|
] }, e.id || i);
|
|
6999
7265
|
}),
|
|
@@ -7002,30 +7268,30 @@ function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, o
|
|
|
7002
7268
|
}
|
|
7003
7269
|
|
|
7004
7270
|
// src/dashboard/OnboardingWidget.jsx
|
|
7005
|
-
import
|
|
7006
|
-
import { jsx as
|
|
7007
|
-
var
|
|
7271
|
+
import React135 from "react";
|
|
7272
|
+
import { jsx as jsx133 } from "react/jsx-runtime";
|
|
7273
|
+
var DEFAULT_LABELS63 = { title: "Get started", hide: "Hide", complete: "Setup complete", completeHint: "Every step is done. You can hide this card.", progress: "completed", done: "Done", optional: "optional" };
|
|
7008
7274
|
function OnboardingWidget({ title, heading, description, steps = [], onDismiss, labels, className, ...rest }) {
|
|
7009
|
-
const L = { ...
|
|
7275
|
+
const L = { ...DEFAULT_LABELS63, ...labels };
|
|
7010
7276
|
const all = steps.length > 0 && steps.every((s) => s.done);
|
|
7011
|
-
return /* @__PURE__ */
|
|
7277
|
+
return /* @__PURE__ */ jsx133(Card, { title: title || L.title, icon: "rocket", actions: onDismiss && /* @__PURE__ */ jsx133(ButtonIcon, { icon: "x", label: L.hide, size: "xs", onClick: onDismiss }), className: cx("agn-onboard", className), ...rest, children: all ? /* @__PURE__ */ jsx133(EmptyState, { compact: true, icon: "circle-check", title: L.complete, children: L.completeHint }) : /* @__PURE__ */ jsx133(SetupAssistant, { bare: true, title: heading, description, steps, labels: { progress: L.progress, done: L.done, optional: L.optional } }) });
|
|
7012
7278
|
}
|
|
7013
7279
|
|
|
7014
7280
|
// src/dashboard/CommentsWidget.jsx
|
|
7015
|
-
import
|
|
7016
|
-
import { jsx as
|
|
7017
|
-
var
|
|
7018
|
-
var withMentions = (text) => typeof text !== "string" ? text : text.split(/(@[\p{L}\p{N}_.-]+)/u).map((p, i) => p.startsWith("@") && p.length > 1 ? /* @__PURE__ */
|
|
7281
|
+
import React136 from "react";
|
|
7282
|
+
import { jsx as jsx134, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
7283
|
+
var DEFAULT_LABELS64 = { title: "Comments", placeholder: "Add a comment \u2014 @ mentions a teammate", submit: "Comment", empty: "No comments yet", emptyHint: "Start the thread; mention a teammate with @.", now: "now", reply: "Reply", like: "Like", liked: "Liked", attach: "Attach file", mention: "Mention someone", resolved: "Resolved" };
|
|
7284
|
+
var withMentions = (text) => typeof text !== "string" ? text : text.split(/(@[\p{L}\p{N}_.-]+)/u).map((p, i) => p.startsWith("@") && p.length > 1 ? /* @__PURE__ */ jsx134("span", { className: "agn-comments__mention", children: p }, i) : p);
|
|
7019
7285
|
function CommentsWidget({ comments = [], user, onSubmit, onLike, onReply, title, maxHeight = 360, labels, className, ...rest }) {
|
|
7020
|
-
const L = { ...
|
|
7021
|
-
const [added, setAdded] =
|
|
7286
|
+
const L = { ...DEFAULT_LABELS64, ...labels };
|
|
7287
|
+
const [added, setAdded] = React136.useState([]);
|
|
7022
7288
|
const all = [...comments, ...added];
|
|
7023
7289
|
const submit = (v) => {
|
|
7024
7290
|
if (onSubmit) onSubmit(v);
|
|
7025
7291
|
else setAdded([...added, { id: "local-" + added.length, author: user || "", time: L.now, text: v }]);
|
|
7026
7292
|
};
|
|
7027
7293
|
return /* @__PURE__ */ jsxs124(Card, { title: title || L.title, icon: "message-square", count: all.length, padding: "none", className: cx("agn-comments", className), ...rest, children: [
|
|
7028
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ jsx134("div", { className: "agn-comments__list", style: { maxHeight }, children: all.length === 0 ? /* @__PURE__ */ jsx134(EmptyState, { compact: true, icon: "message-square", title: L.empty, children: L.emptyHint }) : /* @__PURE__ */ jsx134(Feed, { children: all.map((c, i) => /* @__PURE__ */ jsx134(
|
|
7029
7295
|
FeedPost,
|
|
7030
7296
|
{
|
|
7031
7297
|
author: c.author,
|
|
@@ -7040,12 +7306,12 @@ function CommentsWidget({ comments = [], user, onSubmit, onLike, onReply, title,
|
|
|
7040
7306
|
onLike: onLike ? () => onLike(c) : void 0,
|
|
7041
7307
|
onReply: onReply ? () => onReply(c) : void 0,
|
|
7042
7308
|
labels: { reply: L.reply, like: L.like, liked: L.liked },
|
|
7043
|
-
actions: c.resolved ? /* @__PURE__ */
|
|
7309
|
+
actions: c.resolved ? /* @__PURE__ */ jsx134(Tag, { tone: "ok", icon: "circle-check", children: L.resolved }) : void 0,
|
|
7044
7310
|
children: withMentions(c.text)
|
|
7045
7311
|
},
|
|
7046
7312
|
c.id || i
|
|
7047
7313
|
)) }) }),
|
|
7048
|
-
/* @__PURE__ */
|
|
7314
|
+
/* @__PURE__ */ jsx134("div", { className: "agn-comments__composer", children: /* @__PURE__ */ jsx134(Publisher, { user, placeholder: L.placeholder, submitLabel: L.submit, onSubmit: submit, labels: { placeholder: L.placeholder, submit: L.submit, attach: L.attach, mention: L.mention } }) })
|
|
7049
7315
|
] });
|
|
7050
7316
|
}
|
|
7051
7317
|
export {
|
|
@@ -7066,6 +7332,7 @@ export {
|
|
|
7066
7332
|
ApprovalCard,
|
|
7067
7333
|
Avatar,
|
|
7068
7334
|
AvatarGroup,
|
|
7335
|
+
BREAKPOINTS,
|
|
7069
7336
|
Badge,
|
|
7070
7337
|
BlockIcon,
|
|
7071
7338
|
BrandBand,
|
|
@@ -7127,6 +7394,8 @@ export {
|
|
|
7127
7394
|
Gantt,
|
|
7128
7395
|
GlobalHeader,
|
|
7129
7396
|
GlobalNavigation,
|
|
7397
|
+
Grid,
|
|
7398
|
+
GridItem,
|
|
7130
7399
|
Heatmap,
|
|
7131
7400
|
Icon,
|
|
7132
7401
|
Illustration,
|
|
@@ -7148,6 +7417,7 @@ export {
|
|
|
7148
7417
|
PRODUCT_NAMES,
|
|
7149
7418
|
PageHeader,
|
|
7150
7419
|
PageLayout,
|
|
7420
|
+
PageLayoutContext,
|
|
7151
7421
|
PageSkeleton,
|
|
7152
7422
|
Pagination,
|
|
7153
7423
|
Path,
|
|
@@ -7211,6 +7481,7 @@ export {
|
|
|
7211
7481
|
VerticalNavigation,
|
|
7212
7482
|
VisualPicker,
|
|
7213
7483
|
WelcomeMat,
|
|
7484
|
+
breakpointFor,
|
|
7214
7485
|
cx,
|
|
7215
7486
|
defaultSwatches,
|
|
7216
7487
|
diffLines,
|
|
@@ -7230,7 +7501,11 @@ export {
|
|
|
7230
7501
|
smoothStepPath,
|
|
7231
7502
|
timeSlots,
|
|
7232
7503
|
tokenize,
|
|
7504
|
+
useBreakpoint,
|
|
7233
7505
|
useDialog,
|
|
7506
|
+
useElementWidth,
|
|
7507
|
+
useOverlayFocus,
|
|
7508
|
+
usePageLayout,
|
|
7234
7509
|
useTheme,
|
|
7235
7510
|
useToasts
|
|
7236
7511
|
};
|