@tangle-network/sandbox-ui 0.10.0 → 0.10.2

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/chat.js CHANGED
@@ -8,13 +8,13 @@ import {
8
8
  MessageList,
9
9
  ThinkingIndicator,
10
10
  UserMessage
11
- } from "./chunk-JLKYXLFN.js";
11
+ } from "./chunk-WKSGQVLI.js";
12
12
  import "./chunk-54SQQMMM.js";
13
- import "./chunk-EXSOPXIY.js";
13
+ import "./chunk-QOL4ZB24.js";
14
14
  import "./chunk-HRMUF35V.js";
15
15
  import "./chunk-MT5FJ3ZT.js";
16
16
  import "./chunk-BX6AQMUS.js";
17
- import "./chunk-PLTZB5BC.js";
17
+ import "./chunk-ZNCEM5CD.js";
18
18
  import "./chunk-34I7UFSX.js";
19
19
  import "./chunk-T7HMZEVO.js";
20
20
  import "./chunk-ZMNSRDMH.js";
@@ -10,10 +10,10 @@ import {
10
10
  } from "./chunk-MA7YKRUP.js";
11
11
  import {
12
12
  ChatContainer
13
- } from "./chunk-JLKYXLFN.js";
13
+ } from "./chunk-WKSGQVLI.js";
14
14
  import {
15
15
  OpenUIArtifactRenderer
16
- } from "./chunk-PLTZB5BC.js";
16
+ } from "./chunk-ZNCEM5CD.js";
17
17
  import {
18
18
  FileArtifactPane,
19
19
  FileTree,
@@ -1656,6 +1656,536 @@ function CheckRow({ check }) {
1656
1656
  ] });
1657
1657
  }
1658
1658
 
1659
+ // src/workspace/task-board.tsx
1660
+ import { useMemo as useMemo5 } from "react";
1661
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1662
+ function TaskBoard({
1663
+ items,
1664
+ columns,
1665
+ className,
1666
+ onMoveItem,
1667
+ onClickItem,
1668
+ renderItemMeta,
1669
+ renderColumnAction,
1670
+ renderBadge,
1671
+ columnEmptyState,
1672
+ header,
1673
+ renderColumnBody,
1674
+ renderItemWrapper
1675
+ }) {
1676
+ const grouped = useMemo5(() => {
1677
+ const map = /* @__PURE__ */ new Map();
1678
+ for (const col of columns) map.set(col.id, []);
1679
+ for (const item of items) {
1680
+ const list = map.get(item.status);
1681
+ if (list) list.push(item);
1682
+ else map.get(columns[columns.length - 1]?.id)?.push(item);
1683
+ }
1684
+ return map;
1685
+ }, [items, columns]);
1686
+ return /* @__PURE__ */ jsxs11("div", { className: cn("flex flex-1 flex-col overflow-hidden", className), children: [
1687
+ header,
1688
+ /* @__PURE__ */ jsx11("div", { className: "flex flex-1 gap-3 overflow-x-auto p-4", children: columns.map((col) => {
1689
+ const colItems = grouped.get(col.id) ?? [];
1690
+ const itemCards = /* @__PURE__ */ jsxs11(Fragment2, { children: [
1691
+ colItems.length === 0 && columnEmptyState,
1692
+ colItems.map((item, index) => {
1693
+ const card = /* @__PURE__ */ jsxs11(
1694
+ "button",
1695
+ {
1696
+ type: "button",
1697
+ onClick: () => onClickItem?.(item),
1698
+ className: "group w-full rounded-lg border border-border bg-card p-3 text-left transition-colors hover:border-accent/50",
1699
+ children: [
1700
+ /* @__PURE__ */ jsx11("p", { className: "text-sm font-medium text-foreground", children: item.title }),
1701
+ item.description && /* @__PURE__ */ jsx11("p", { className: "mt-1 text-xs text-muted-foreground line-clamp-2", children: item.description }),
1702
+ (item.priority || item.tags?.length) && /* @__PURE__ */ jsxs11("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
1703
+ item.priority && (renderBadge ? renderBadge(item.priority, "priority") : /* @__PURE__ */ jsx11("span", { className: "rounded-full border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: item.priority })),
1704
+ item.tags?.map(
1705
+ (tag) => renderBadge ? /* @__PURE__ */ jsx11("span", { children: renderBadge(tag, "tag") }, tag) : /* @__PURE__ */ jsx11(
1706
+ "span",
1707
+ {
1708
+ className: "rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",
1709
+ children: tag
1710
+ },
1711
+ tag
1712
+ )
1713
+ )
1714
+ ] }),
1715
+ renderItemMeta?.(item)
1716
+ ]
1717
+ },
1718
+ item.id
1719
+ );
1720
+ return renderItemWrapper ? /* @__PURE__ */ jsx11("span", { children: renderItemWrapper(item, index, card) }, item.id) : card;
1721
+ })
1722
+ ] });
1723
+ const columnBody = /* @__PURE__ */ jsx11("div", { className: "flex flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2 min-h-[80px]", children: renderColumnBody ? renderColumnBody(col.id, itemCards, colItems) : itemCards });
1724
+ return /* @__PURE__ */ jsxs11(
1725
+ "div",
1726
+ {
1727
+ className: cn(
1728
+ "flex w-72 shrink-0 flex-col rounded-xl border border-border bg-card/50 border-t-2",
1729
+ col.accent ?? "border-t-muted-foreground/30"
1730
+ ),
1731
+ children: [
1732
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between px-4 py-3", children: [
1733
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
1734
+ /* @__PURE__ */ jsx11("h3", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: col.label }),
1735
+ /* @__PURE__ */ jsx11("span", { className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground", children: colItems.length })
1736
+ ] }),
1737
+ renderColumnAction?.(col)
1738
+ ] }),
1739
+ columnBody
1740
+ ]
1741
+ },
1742
+ col.id
1743
+ );
1744
+ }) })
1745
+ ] });
1746
+ }
1747
+
1748
+ // src/workspace/calendar-view.tsx
1749
+ import { useState as useState6, useMemo as useMemo6 } from "react";
1750
+ import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1751
+ function toDateKey(d) {
1752
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
1753
+ }
1754
+ function getMonthDays(year, month) {
1755
+ const first = new Date(year, month, 1);
1756
+ const startDay = first.getDay();
1757
+ const days = [];
1758
+ for (let i = startDay - 1; i >= 0; i--) {
1759
+ const d = new Date(year, month, -i);
1760
+ days.push({ date: d, key: toDateKey(d), inMonth: false });
1761
+ }
1762
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1763
+ for (let i = 1; i <= daysInMonth; i++) {
1764
+ const d = new Date(year, month, i);
1765
+ days.push({ date: d, key: toDateKey(d), inMonth: true });
1766
+ }
1767
+ const remaining = 7 - days.length % 7;
1768
+ if (remaining < 7) {
1769
+ for (let i = 1; i <= remaining; i++) {
1770
+ const d = new Date(year, month + 1, i);
1771
+ days.push({ date: d, key: toDateKey(d), inMonth: false });
1772
+ }
1773
+ }
1774
+ return days;
1775
+ }
1776
+ function CalendarView({
1777
+ events,
1778
+ className,
1779
+ month: controlledMonth,
1780
+ year: controlledYear,
1781
+ onMonthChange,
1782
+ selectedDay: controlledSelectedDay,
1783
+ onSelectDay,
1784
+ onDoubleClickDay,
1785
+ renderEventChip,
1786
+ renderDayDetail,
1787
+ headerLeft,
1788
+ headerRight,
1789
+ showDayPanel = true
1790
+ }) {
1791
+ const today = /* @__PURE__ */ new Date();
1792
+ const todayKey = toDateKey(today);
1793
+ const [internalMonth, setInternalMonth] = useState6({
1794
+ year: today.getFullYear(),
1795
+ month: today.getMonth()
1796
+ });
1797
+ const [internalSelectedDay, setInternalSelectedDay] = useState6(
1798
+ todayKey
1799
+ );
1800
+ const viewYear = controlledYear ?? internalMonth.year;
1801
+ const viewMonth = controlledMonth ?? internalMonth.month;
1802
+ const selectedDay = controlledSelectedDay ?? internalSelectedDay;
1803
+ function setMonth(y, m) {
1804
+ if (onMonthChange) onMonthChange(y, m);
1805
+ else setInternalMonth({ year: y, month: m });
1806
+ }
1807
+ function selectDay(key) {
1808
+ if (onSelectDay) onSelectDay(key);
1809
+ else setInternalSelectedDay(key);
1810
+ }
1811
+ function prevMonth() {
1812
+ const m = viewMonth === 0 ? 11 : viewMonth - 1;
1813
+ const y = viewMonth === 0 ? viewYear - 1 : viewYear;
1814
+ setMonth(y, m);
1815
+ }
1816
+ function nextMonth() {
1817
+ const m = viewMonth === 11 ? 0 : viewMonth + 1;
1818
+ const y = viewMonth === 11 ? viewYear + 1 : viewYear;
1819
+ setMonth(y, m);
1820
+ }
1821
+ const eventsByDate = useMemo6(() => {
1822
+ const map = {};
1823
+ for (const evt of events) {
1824
+ const d = typeof evt.startAt === "string" ? evt.startAt.slice(0, 10) : toDateKey(evt.startAt);
1825
+ if (!map[d]) map[d] = [];
1826
+ map[d].push(evt);
1827
+ }
1828
+ return map;
1829
+ }, [events]);
1830
+ const monthDays = useMemo6(
1831
+ () => getMonthDays(viewYear, viewMonth),
1832
+ [viewYear, viewMonth]
1833
+ );
1834
+ const monthLabel = new Date(viewYear, viewMonth).toLocaleString("en-US", {
1835
+ month: "long",
1836
+ year: "numeric"
1837
+ });
1838
+ const selectedDayEvents = selectedDay ? eventsByDate[selectedDay] ?? [] : [];
1839
+ return /* @__PURE__ */ jsxs12("div", { className: cn("flex flex-1 min-h-0 overflow-hidden", className), children: [
1840
+ /* @__PURE__ */ jsxs12("div", { className: "flex-1 flex flex-col overflow-hidden border-r border-border", children: [
1841
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between border-b border-border px-4 py-2.5 shrink-0", children: [
1842
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1843
+ headerLeft,
1844
+ /* @__PURE__ */ jsx12(
1845
+ "button",
1846
+ {
1847
+ type: "button",
1848
+ onClick: prevMonth,
1849
+ className: "h-7 w-7 rounded-md hover:bg-muted flex items-center justify-center text-muted-foreground",
1850
+ children: /* @__PURE__ */ jsx12("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx12("path", { d: "m15 18-6-6 6-6" }) })
1851
+ }
1852
+ ),
1853
+ /* @__PURE__ */ jsx12("span", { className: "text-sm font-semibold text-foreground min-w-[160px] text-center", children: monthLabel }),
1854
+ /* @__PURE__ */ jsx12(
1855
+ "button",
1856
+ {
1857
+ type: "button",
1858
+ onClick: nextMonth,
1859
+ className: "h-7 w-7 rounded-md hover:bg-muted flex items-center justify-center text-muted-foreground",
1860
+ children: /* @__PURE__ */ jsx12("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx12("path", { d: "m9 18 6-6-6-6" }) })
1861
+ }
1862
+ ),
1863
+ /* @__PURE__ */ jsx12(
1864
+ "button",
1865
+ {
1866
+ type: "button",
1867
+ onClick: () => {
1868
+ setMonth(today.getFullYear(), today.getMonth());
1869
+ selectDay(todayKey);
1870
+ },
1871
+ className: "h-7 px-2 rounded-md border border-border text-xs font-medium text-muted-foreground hover:text-foreground",
1872
+ children: "Today"
1873
+ }
1874
+ )
1875
+ ] }),
1876
+ headerRight
1877
+ ] }),
1878
+ /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-7 border-b border-border shrink-0", children: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((d) => /* @__PURE__ */ jsx12(
1879
+ "div",
1880
+ {
1881
+ className: "px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground text-center",
1882
+ children: d
1883
+ },
1884
+ d
1885
+ )) }),
1886
+ /* @__PURE__ */ jsx12("div", { className: "flex-1 grid grid-cols-7 auto-rows-fr overflow-y-auto", children: monthDays.map(({ date, key, inMonth }) => {
1887
+ const dayEvents = eventsByDate[key] ?? [];
1888
+ const isToday = key === todayKey;
1889
+ const isSelected = key === selectedDay;
1890
+ return /* @__PURE__ */ jsxs12(
1891
+ "button",
1892
+ {
1893
+ type: "button",
1894
+ onClick: () => selectDay(key),
1895
+ onDoubleClick: () => onDoubleClickDay?.(key),
1896
+ className: cn(
1897
+ "flex flex-col items-start p-1.5 border-b border-r border-border text-left transition-colors min-h-[72px]",
1898
+ !inMonth && "bg-muted/30",
1899
+ isSelected && "bg-primary/5 ring-1 ring-inset ring-primary/20",
1900
+ !isSelected && "hover:bg-muted/50"
1901
+ ),
1902
+ children: [
1903
+ /* @__PURE__ */ jsx12(
1904
+ "span",
1905
+ {
1906
+ className: cn(
1907
+ "text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full mb-0.5",
1908
+ isToday && "bg-primary text-primary-foreground",
1909
+ !isToday && !inMonth && "text-muted-foreground/50",
1910
+ !isToday && inMonth && "text-foreground"
1911
+ ),
1912
+ children: date.getDate()
1913
+ }
1914
+ ),
1915
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-0.5 w-full", children: [
1916
+ dayEvents.slice(0, 3).map(
1917
+ (evt) => renderEventChip ? /* @__PURE__ */ jsx12("span", { children: renderEventChip(evt) }, evt.id) : /* @__PURE__ */ jsx12(
1918
+ "div",
1919
+ {
1920
+ className: "w-full truncate text-[9px] px-1 py-0.5 rounded bg-primary/10 text-primary",
1921
+ title: evt.title,
1922
+ children: evt.title
1923
+ },
1924
+ evt.id
1925
+ )
1926
+ ),
1927
+ dayEvents.length > 3 && /* @__PURE__ */ jsxs12("span", { className: "text-[9px] text-muted-foreground px-1", children: [
1928
+ "+",
1929
+ dayEvents.length - 3,
1930
+ " more"
1931
+ ] })
1932
+ ] })
1933
+ ]
1934
+ },
1935
+ key
1936
+ );
1937
+ }) })
1938
+ ] }),
1939
+ showDayPanel && /* @__PURE__ */ jsx12("div", { className: "w-80 shrink-0 flex flex-col overflow-hidden", children: renderDayDetail ? renderDayDetail(selectedDay ?? todayKey, selectedDayEvents) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
1940
+ /* @__PURE__ */ jsxs12("div", { className: "px-4 py-3 border-b border-border shrink-0", children: [
1941
+ /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: selectedDay === todayKey ? "Today" : selectedDay ? (/* @__PURE__ */ new Date(selectedDay + "T00:00:00")).toLocaleDateString(
1942
+ "en-US",
1943
+ { weekday: "long", month: "long", day: "numeric" }
1944
+ ) : "Select a day" }),
1945
+ /* @__PURE__ */ jsxs12("p", { className: "text-xs text-muted-foreground", children: [
1946
+ selectedDayEvents.length,
1947
+ " event",
1948
+ selectedDayEvents.length !== 1 ? "s" : ""
1949
+ ] })
1950
+ ] }),
1951
+ /* @__PURE__ */ jsxs12("div", { className: "flex-1 overflow-y-auto p-2 space-y-2", children: [
1952
+ selectedDayEvents.length === 0 && /* @__PURE__ */ jsx12("div", { className: "px-2 py-8 text-center", children: /* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground", children: "No events this day" }) }),
1953
+ selectedDayEvents.map((evt) => /* @__PURE__ */ jsxs12(
1954
+ "div",
1955
+ {
1956
+ className: "rounded-lg border border-border bg-card p-3",
1957
+ children: [
1958
+ /* @__PURE__ */ jsx12("p", { className: "text-sm font-medium text-foreground", children: evt.title }),
1959
+ evt.type && /* @__PURE__ */ jsx12("span", { className: "mt-1 inline-block rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground", children: evt.type })
1960
+ ]
1961
+ },
1962
+ evt.id
1963
+ ))
1964
+ ] })
1965
+ ] }) })
1966
+ ] });
1967
+ }
1968
+
1969
+ // src/workspace/approval-queue.tsx
1970
+ import { useState as useState7, useMemo as useMemo7 } from "react";
1971
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1972
+ function ApprovalQueue({
1973
+ items,
1974
+ className,
1975
+ onApprove,
1976
+ onReject,
1977
+ renderItemDetail,
1978
+ renderTypeBadge,
1979
+ renderStats,
1980
+ canResolve = true,
1981
+ header,
1982
+ emptyState,
1983
+ showResolved: controlledShowResolved
1984
+ }) {
1985
+ const [rejectingId, setRejectingId] = useState7(null);
1986
+ const [rejectReason, setRejectReason] = useState7("");
1987
+ const [showResolved, setShowResolved] = useState7(controlledShowResolved ?? false);
1988
+ const pending = useMemo7(
1989
+ () => items.filter((a) => a.status === "pending"),
1990
+ [items]
1991
+ );
1992
+ const resolved = useMemo7(
1993
+ () => items.filter((a) => a.status !== "pending"),
1994
+ [items]
1995
+ );
1996
+ const stats = useMemo7(() => {
1997
+ const map = {};
1998
+ for (const item of items) {
1999
+ if (!map[item.type])
2000
+ map[item.type] = { type: item.type, approved: 0, rejected: 0, total: 0, rate: 0 };
2001
+ map[item.type].total++;
2002
+ if (item.status === "approved" || item.status === "executed")
2003
+ map[item.type].approved++;
2004
+ if (item.status === "rejected") map[item.type].rejected++;
2005
+ }
2006
+ for (const s of Object.values(map)) {
2007
+ s.rate = s.total > 0 ? Math.round(s.approved / s.total * 100) : 0;
2008
+ }
2009
+ return Object.values(map);
2010
+ }, [items]);
2011
+ if (items.length === 0) {
2012
+ return /* @__PURE__ */ jsx13("div", { className: cn("flex-1 flex items-center justify-center", className), children: emptyState ?? /* @__PURE__ */ jsx13("div", { className: "text-center py-20", children: /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: "No proposals yet" }) }) });
2013
+ }
2014
+ return /* @__PURE__ */ jsx13("div", { className: cn("flex-1 overflow-y-auto", className), children: /* @__PURE__ */ jsxs13("div", { className: "max-w-3xl mx-auto p-6", children: [
2015
+ header,
2016
+ stats.length > 0 && /* @__PURE__ */ jsx13("div", { className: "flex gap-3 mb-6 flex-wrap", children: renderStats ? renderStats(stats) : stats.map((s) => /* @__PURE__ */ jsxs13(
2017
+ "div",
2018
+ {
2019
+ className: "flex-1 min-w-[120px] rounded-lg border border-border bg-card p-3",
2020
+ children: [
2021
+ /* @__PURE__ */ jsx13("div", { className: "flex items-center gap-2 mb-1", children: renderTypeBadge ? renderTypeBadge(s.type) : /* @__PURE__ */ jsx13("span", { className: "rounded-full border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: s.type }) }),
2022
+ /* @__PURE__ */ jsx13("div", { className: "flex items-baseline gap-1", children: /* @__PURE__ */ jsxs13("span", { className: "text-xl font-semibold text-foreground", children: [
2023
+ s.rate,
2024
+ "%"
2025
+ ] }) }),
2026
+ /* @__PURE__ */ jsxs13("p", { className: "text-[10px] text-muted-foreground", children: [
2027
+ s.approved,
2028
+ "/",
2029
+ s.total,
2030
+ " approved"
2031
+ ] })
2032
+ ]
2033
+ },
2034
+ s.type
2035
+ )) }),
2036
+ pending.length > 0 && /* @__PURE__ */ jsxs13("section", { className: "mb-8", children: [
2037
+ /* @__PURE__ */ jsxs13("h3", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3", children: [
2038
+ "Pending (",
2039
+ pending.length,
2040
+ ")"
2041
+ ] }),
2042
+ /* @__PURE__ */ jsx13("div", { className: "space-y-3", children: pending.map((item) => /* @__PURE__ */ jsxs13(
2043
+ "div",
2044
+ {
2045
+ className: "rounded-lg border border-primary/20 bg-card p-4",
2046
+ children: [
2047
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3", children: [
2048
+ /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
2049
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 mb-1", children: [
2050
+ /* @__PURE__ */ jsx13("h4", { className: "text-sm font-medium text-foreground", children: item.title }),
2051
+ renderTypeBadge ? renderTypeBadge(item.type) : /* @__PURE__ */ jsx13("span", { className: "rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground", children: item.type })
2052
+ ] }),
2053
+ item.description && /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground line-clamp-2", children: item.description }),
2054
+ renderItemDetail?.(item)
2055
+ ] }),
2056
+ canResolve && /* @__PURE__ */ jsxs13("div", { className: "flex gap-1.5 shrink-0", children: [
2057
+ /* @__PURE__ */ jsx13(
2058
+ "button",
2059
+ {
2060
+ type: "button",
2061
+ onClick: () => onApprove?.(item),
2062
+ className: "h-8 px-3 rounded-md border border-border text-xs font-medium text-emerald-500 hover:bg-emerald-500/10 hover:border-emerald-500/30 transition-colors",
2063
+ children: "Approve"
2064
+ }
2065
+ ),
2066
+ /* @__PURE__ */ jsx13(
2067
+ "button",
2068
+ {
2069
+ type: "button",
2070
+ onClick: () => {
2071
+ setRejectingId(
2072
+ rejectingId === item.id ? null : item.id
2073
+ );
2074
+ setRejectReason("");
2075
+ },
2076
+ className: "h-8 px-3 rounded-md border border-border text-xs font-medium text-destructive hover:bg-destructive/10 hover:border-destructive/30 transition-colors",
2077
+ children: "Reject"
2078
+ }
2079
+ )
2080
+ ] })
2081
+ ] }),
2082
+ rejectingId === item.id && /* @__PURE__ */ jsxs13("div", { className: "mt-3 border-t border-border pt-3", children: [
2083
+ /* @__PURE__ */ jsx13(
2084
+ "textarea",
2085
+ {
2086
+ placeholder: "Why are you rejecting this?",
2087
+ value: rejectReason,
2088
+ onChange: (e) => setRejectReason(e.target.value),
2089
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 mb-2",
2090
+ rows: 2
2091
+ }
2092
+ ),
2093
+ /* @__PURE__ */ jsxs13("div", { className: "flex gap-2 justify-end", children: [
2094
+ /* @__PURE__ */ jsx13(
2095
+ "button",
2096
+ {
2097
+ type: "button",
2098
+ onClick: () => {
2099
+ setRejectingId(null);
2100
+ setRejectReason("");
2101
+ },
2102
+ className: "h-7 px-3 rounded-md text-xs text-muted-foreground hover:text-foreground",
2103
+ children: "Cancel"
2104
+ }
2105
+ ),
2106
+ /* @__PURE__ */ jsx13(
2107
+ "button",
2108
+ {
2109
+ type: "button",
2110
+ onClick: () => {
2111
+ onReject?.(item, rejectReason.trim() || void 0);
2112
+ setRejectingId(null);
2113
+ setRejectReason("");
2114
+ },
2115
+ className: "h-7 px-3 rounded-md bg-destructive text-destructive-foreground text-xs font-medium",
2116
+ children: "Submit Rejection"
2117
+ }
2118
+ )
2119
+ ] })
2120
+ ] })
2121
+ ]
2122
+ },
2123
+ item.id
2124
+ )) })
2125
+ ] }),
2126
+ resolved.length > 0 && /* @__PURE__ */ jsxs13("section", { children: [
2127
+ /* @__PURE__ */ jsxs13(
2128
+ "button",
2129
+ {
2130
+ type: "button",
2131
+ onClick: () => setShowResolved(!showResolved),
2132
+ className: "flex items-center gap-2 text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3 hover:text-foreground transition-colors",
2133
+ children: [
2134
+ /* @__PURE__ */ jsx13(
2135
+ "svg",
2136
+ {
2137
+ width: "12",
2138
+ height: "12",
2139
+ viewBox: "0 0 24 24",
2140
+ fill: "none",
2141
+ stroke: "currentColor",
2142
+ strokeWidth: "2",
2143
+ className: cn(
2144
+ "transition-transform",
2145
+ showResolved && "rotate-180"
2146
+ ),
2147
+ children: /* @__PURE__ */ jsx13("path", { d: "m6 9 6 6 6-6" })
2148
+ }
2149
+ ),
2150
+ "Resolved (",
2151
+ resolved.length,
2152
+ ")"
2153
+ ]
2154
+ }
2155
+ ),
2156
+ showResolved && /* @__PURE__ */ jsx13("div", { className: "space-y-2", children: resolved.map((item) => /* @__PURE__ */ jsxs13(
2157
+ "div",
2158
+ {
2159
+ className: "rounded-lg border border-border bg-card p-4 opacity-60",
2160
+ children: [
2161
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 mb-1", children: [
2162
+ /* @__PURE__ */ jsx13("h4", { className: "text-sm font-medium text-foreground", children: item.title }),
2163
+ renderTypeBadge?.(item.type),
2164
+ /* @__PURE__ */ jsx13(
2165
+ "span",
2166
+ {
2167
+ className: cn(
2168
+ "rounded-full px-2 py-0.5 text-[10px] font-medium",
2169
+ item.status === "approved" && "bg-emerald-500/10 text-emerald-500",
2170
+ item.status === "rejected" && "bg-destructive/10 text-destructive",
2171
+ item.status === "executed" && "bg-primary/10 text-primary"
2172
+ ),
2173
+ children: item.status
2174
+ }
2175
+ )
2176
+ ] }),
2177
+ item.meta?.rejectionReason != null && /* @__PURE__ */ jsxs13("p", { className: "mt-1 text-xs text-destructive", children: [
2178
+ "Reason: ",
2179
+ String(item.meta.rejectionReason)
2180
+ ] })
2181
+ ]
2182
+ },
2183
+ item.id
2184
+ )) })
2185
+ ] })
2186
+ ] }) });
2187
+ }
2188
+
1659
2189
  export {
1660
2190
  WorkspaceLayout,
1661
2191
  DirectoryPane,
@@ -1667,5 +2197,8 @@ export {
1667
2197
  SessionActivityMonitor,
1668
2198
  SandboxWorkbench,
1669
2199
  AgentWorkbench,
1670
- AuditResults
2200
+ AuditResults,
2201
+ TaskBoard,
2202
+ CalendarView,
2203
+ ApprovalQueue
1671
2204
  };