@arbidocs/blocks 0.3.159 → 0.3.161

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 CHANGED
@@ -643,10 +643,10 @@ function DataTableBlock({ columns, rows, caption, emptyText, testId }) {
643
643
  ] });
644
644
  }
645
645
  var arbiTheme = agGridCommunity.themeQuartz.withParams({
646
- // Font settings
647
- fontFamily: {
648
- googleFont: "Nunito"
649
- },
646
+ // Font settings — inherit the host app's font. A googleFont here never
647
+ // loaded under the apps' CSP, so every grid silently fell back to the
648
+ // browser's default SERIF and read as unstyled.
649
+ fontFamily: "inherit",
650
650
  fontSize: 14,
651
651
  headerFontSize: 13,
652
652
  headerFontWeight: 600,
@@ -1039,6 +1039,42 @@ function GridView({
1039
1039
  }
1040
1040
  ) });
1041
1041
  }
1042
+ function UsageMeter({
1043
+ icon: Icon,
1044
+ label,
1045
+ value,
1046
+ pct: pct2,
1047
+ hint,
1048
+ className,
1049
+ testId
1050
+ }) {
1051
+ const clamped = Math.max(0, Math.min(100, pct2));
1052
+ const tone = clamped >= 100 ? "bg-destructive" : clamped >= 80 ? "bg-amber-500" : "bg-primary";
1053
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: react.cn("space-y-1.5", className), "data-testid": testId, children: [
1054
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 text-sm", children: [
1055
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-muted-foreground", children: [
1056
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-3.5 shrink-0" }),
1057
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate", children: [
1058
+ label,
1059
+ hint ? ` (${hint})` : ""
1060
+ ] })
1061
+ ] }),
1062
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium tabular-nums text-foreground", children: value })
1063
+ ] }),
1064
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(
1065
+ "div",
1066
+ {
1067
+ className: react.cn("h-full rounded-full transition-[width]", tone),
1068
+ style: { width: `${clamped}%` },
1069
+ role: "progressbar",
1070
+ "aria-valuenow": clamped,
1071
+ "aria-valuemin": 0,
1072
+ "aria-valuemax": 100,
1073
+ "aria-label": label
1074
+ }
1075
+ ) })
1076
+ ] });
1077
+ }
1042
1078
  function UploadDropzone({
1043
1079
  onFiles,
1044
1080
  accept,
@@ -1489,7 +1525,7 @@ function RecentActivityCard({
1489
1525
  {
1490
1526
  type: "button",
1491
1527
  onClick: onAction,
1492
- className: "group m-3 flex flex-1 cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border px-4 text-center transition-colors hover:border-primary/40 hover:bg-primary/5 focus-visible:border-primary/40 focus-visible:bg-primary/5 focus-visible:outline-none",
1528
+ className: "group m-3 flex flex-1 cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border px-4 text-center transition-colors hover:border-border hover:bg-accent/50 focus-visible:border-border focus-visible:bg-accent/50 focus-visible:outline-none",
1493
1529
  "data-testid": testId && `${testId}-empty-action`,
1494
1530
  children: [
1495
1531
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: ActionIcon ? /* @__PURE__ */ jsxRuntime.jsx(ActionIcon, { className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-5" }) }),
@@ -1515,11 +1551,10 @@ function RecentActivityCard({
1515
1551
  className: react.cn(
1516
1552
  "group relative flex items-center border-b border-border/60 transition-colors last:border-b-0",
1517
1553
  // A row is a link to somewhere, so hovering it has to look
1518
- // like one. A 40%-alpha accent wash was too faint to read as
1519
- // an affordance at all this is a definite tint plus an
1520
- // accent bar down the leading edge.
1521
- "hover:bg-primary/10 has-[button:focus-visible]:bg-primary/10",
1522
- "before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-primary before:opacity-0 before:transition-opacity hover:before:opacity-100"
1554
+ // like one but quietly: a neutral wash plus the title
1555
+ // turning primary. Loud primary tints and edge bars read as
1556
+ // selection chrome, not hover.
1557
+ "hover:bg-accent/60 has-[button:focus-visible]:bg-accent/60"
1523
1558
  ),
1524
1559
  children: [
1525
1560
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1555,6 +1590,253 @@ function RecentActivityCard({
1555
1590
  }
1556
1591
  );
1557
1592
  }
1593
+ function AskBar({
1594
+ onAsk,
1595
+ onSearch,
1596
+ suggestions = [],
1597
+ placeholder = "Ask anything\u2026",
1598
+ askLabel = "Ask",
1599
+ searchLabel = "Search",
1600
+ value,
1601
+ onValueChange,
1602
+ onInputKeyDown,
1603
+ menu,
1604
+ inputRef: externalInputRef,
1605
+ className,
1606
+ testId = "ask-bar"
1607
+ }) {
1608
+ const [innerText, setInnerText] = react$1.useState("");
1609
+ const text = value !== void 0 ? value : innerText;
1610
+ const setText = (next) => {
1611
+ onValueChange?.(next);
1612
+ if (value === void 0) setInnerText(next);
1613
+ };
1614
+ const localInputRef = react$1.useRef(null);
1615
+ const inputRef = externalInputRef ?? localInputRef;
1616
+ const submitTo = (handler) => {
1617
+ const question = text.trim();
1618
+ if (!question) return;
1619
+ handler(question);
1620
+ setText("");
1621
+ };
1622
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: react.cn("flex flex-col gap-2", className), "data-testid": testId, children: [
1623
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1624
+ menu,
1625
+ /* @__PURE__ */ jsxRuntime.jsxs(
1626
+ "form",
1627
+ {
1628
+ onSubmit: (e) => {
1629
+ e.preventDefault();
1630
+ submitTo(onAsk);
1631
+ },
1632
+ className: "flex h-12 items-center gap-1.5 rounded-md border border-border/50 bg-background pl-3 pr-1.5 transition-colors focus-within:border-border",
1633
+ children: [
1634
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "pointer-events-none size-4 shrink-0 text-muted-foreground" }),
1635
+ /* @__PURE__ */ jsxRuntime.jsx(
1636
+ "input",
1637
+ {
1638
+ ref: inputRef,
1639
+ type: "text",
1640
+ value: text,
1641
+ onChange: (e) => setText(e.target.value),
1642
+ onKeyDown: onInputKeyDown,
1643
+ placeholder,
1644
+ className: "h-8 min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground",
1645
+ "data-testid": testId && `${testId}-input`
1646
+ }
1647
+ ),
1648
+ onSearch && /* @__PURE__ */ jsxRuntime.jsx(
1649
+ react.Button,
1650
+ {
1651
+ type: "button",
1652
+ variant: "ghost",
1653
+ size: "sm",
1654
+ disabled: !text.trim(),
1655
+ onClick: () => submitTo(onSearch),
1656
+ className: "h-8 shrink-0 px-2.5 text-xs font-medium text-muted-foreground hover:text-foreground",
1657
+ "data-testid": testId && `${testId}-search`,
1658
+ children: searchLabel
1659
+ }
1660
+ ),
1661
+ /* @__PURE__ */ jsxRuntime.jsxs(
1662
+ react.Button,
1663
+ {
1664
+ type: "submit",
1665
+ size: "sm",
1666
+ disabled: !text.trim(),
1667
+ className: "h-8 shrink-0 px-3 text-xs font-medium",
1668
+ "data-testid": testId && `${testId}-submit`,
1669
+ children: [
1670
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-3.5" }),
1671
+ askLabel
1672
+ ]
1673
+ }
1674
+ )
1675
+ ]
1676
+ }
1677
+ )
1678
+ ] }),
1679
+ suggestions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5", children: suggestions.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
1680
+ "button",
1681
+ {
1682
+ type: "button",
1683
+ onClick: () => {
1684
+ setText(s);
1685
+ inputRef.current?.focus();
1686
+ },
1687
+ className: "rounded-full border border-border/50 bg-card px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent hover:text-foreground",
1688
+ "data-testid": testId && `${testId}-suggestion`,
1689
+ children: s
1690
+ },
1691
+ s
1692
+ )) })
1693
+ ] });
1694
+ }
1695
+ function ResumeStrip({
1696
+ items,
1697
+ caption = "Pick up where you left off",
1698
+ className,
1699
+ testId = "resume-strip"
1700
+ }) {
1701
+ if (items.length === 0) return null;
1702
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: react.cn("flex flex-col gap-1.5", className), "data-testid": testId, children: [
1703
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: caption }),
1704
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1705
+ "button",
1706
+ {
1707
+ type: "button",
1708
+ onClick: item.onClick,
1709
+ title: item.title,
1710
+ className: "group flex min-w-0 items-center gap-2 rounded-lg border border-border/50 bg-card py-2 pl-2.5 pr-3 shadow-sm transition-colors hover:border-border hover:bg-accent/50",
1711
+ "data-testid": testId && `${testId}-item`,
1712
+ children: [
1713
+ item.leading,
1714
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[14rem] truncate text-sm font-medium text-foreground group-hover:text-primary", children: item.title }),
1715
+ item.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: item.meta })
1716
+ ]
1717
+ },
1718
+ item.id
1719
+ )) })
1720
+ ] });
1721
+ }
1722
+ function SectionStrip({
1723
+ icon: Icon,
1724
+ title,
1725
+ count,
1726
+ onOpen,
1727
+ actions = [],
1728
+ groups,
1729
+ empty,
1730
+ className,
1731
+ testId = "section-strip"
1732
+ }) {
1733
+ const filledGroups = groups.filter((g) => g.rows.length > 0);
1734
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1735
+ "div",
1736
+ {
1737
+ className: react.cn("rounded-xl border border-border/60 bg-card p-2 shadow-sm", className),
1738
+ "data-testid": testId,
1739
+ children: [
1740
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
1741
+ /* @__PURE__ */ jsxRuntime.jsxs(
1742
+ "button",
1743
+ {
1744
+ type: "button",
1745
+ onClick: onOpen,
1746
+ disabled: !onOpen,
1747
+ className: "group flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-primary/10 disabled:cursor-default disabled:hover:bg-transparent",
1748
+ "data-testid": testId && `${testId}-open`,
1749
+ children: [
1750
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1751
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap text-sm font-semibold text-foreground", children: title }),
1752
+ count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count }),
1753
+ onOpen && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto size-4 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" })
1754
+ ]
1755
+ }
1756
+ ),
1757
+ actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
1758
+ react.Button,
1759
+ {
1760
+ variant: "ghost",
1761
+ size: "sm",
1762
+ className: "h-8 shrink-0 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",
1763
+ onClick: action.onClick,
1764
+ title: action.label,
1765
+ "data-testid": action.testId,
1766
+ children: [
1767
+ action.icon && /* @__PURE__ */ jsxRuntime.jsx(action.icon, { className: "size-3.5" }),
1768
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only @md:not-sr-only @md:ml-1.5", children: action.label })
1769
+ ]
1770
+ },
1771
+ action.label
1772
+ ))
1773
+ ] }),
1774
+ filledGroups.length === 0 ? empty ? /* @__PURE__ */ jsxRuntime.jsxs(
1775
+ "button",
1776
+ {
1777
+ type: "button",
1778
+ onClick: empty.onClick,
1779
+ className: "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-primary/5 hover:text-foreground",
1780
+ "data-testid": empty.testId,
1781
+ children: [
1782
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-3.5 shrink-0" }),
1783
+ empty.label
1784
+ ]
1785
+ }
1786
+ ) : null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-x-4 @2xl:grid-cols-2", children: filledGroups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1787
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 px-2 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: group.caption }),
1788
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { children: group.rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
1789
+ "button",
1790
+ {
1791
+ type: "button",
1792
+ onClick: row.onClick,
1793
+ title: row.title,
1794
+ className: "group flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-primary/10",
1795
+ "data-testid": group.rowTestId ?? (testId && `${testId}-row`),
1796
+ children: [
1797
+ row.leading,
1798
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-sm text-foreground group-hover:text-primary", children: row.title }),
1799
+ row.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground", children: row.meta })
1800
+ ]
1801
+ }
1802
+ ) }, row.id)) })
1803
+ ] }, group.caption)) })
1804
+ ]
1805
+ }
1806
+ );
1807
+ }
1808
+ function StartHero({
1809
+ title,
1810
+ subtitle,
1811
+ children,
1812
+ tile,
1813
+ footer,
1814
+ className,
1815
+ testId
1816
+ }) {
1817
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: react.cn("py-6", className), "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex max-w-2xl flex-col gap-5 text-center", children: [
1818
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1819
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: title }),
1820
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: subtitle })
1821
+ ] }),
1822
+ children,
1823
+ tile && /* @__PURE__ */ jsxRuntime.jsxs(
1824
+ "button",
1825
+ {
1826
+ type: "button",
1827
+ onClick: tile.onClick,
1828
+ className: "group flex cursor-pointer flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-border px-4 py-6 text-center transition-colors hover:border-border hover:bg-accent/50 focus-visible:border-border focus-visible:bg-accent/50 focus-visible:outline-none",
1829
+ "data-testid": tile.testId,
1830
+ children: [
1831
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(tile.icon, { className: "size-5" }) }),
1832
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: tile.label }),
1833
+ tile.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-relaxed text-muted-foreground", children: tile.description })
1834
+ ]
1835
+ }
1836
+ ),
1837
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: footer })
1838
+ ] }) });
1839
+ }
1558
1840
  var MAX_AVATARS = 3;
1559
1841
  function WorkspaceCard({
1560
1842
  name,
@@ -5523,6 +5805,7 @@ Object.defineProperty(exports, "toRedlineMarkdown", {
5523
5805
  exports.AgentsPanel = AgentsPanel;
5524
5806
  exports.AppHeader = AppHeader;
5525
5807
  exports.AppShell = AppShell;
5808
+ exports.AskBar = AskBar;
5526
5809
  exports.AssetThumb = AssetThumb;
5527
5810
  exports.CitationEditor = CitationEditor;
5528
5811
  exports.ConnectionProvider = ConnectionProvider;
@@ -5540,11 +5823,15 @@ exports.ModuleManager = ModuleManager;
5540
5823
  exports.PageHeader = PageHeader;
5541
5824
  exports.PageRenderer = PageRenderer;
5542
5825
  exports.RecentActivityCard = RecentActivityCard;
5826
+ exports.ResumeStrip = ResumeStrip;
5543
5827
  exports.Section = Section;
5828
+ exports.SectionStrip = SectionStrip;
5829
+ exports.StartHero = StartHero;
5544
5830
  exports.StatGroup = StatGroup;
5545
5831
  exports.StudioEditor = StudioEditor;
5546
5832
  exports.Toolbar = Toolbar;
5547
5833
  exports.UploadDropzone = UploadDropzone;
5834
+ exports.UsageMeter = UsageMeter;
5548
5835
  exports.VerticalBuilder = VerticalBuilder;
5549
5836
  exports.WidgetPlaceholder = WidgetPlaceholder;
5550
5837
  exports.WorkspaceCard = WorkspaceCard;