@arc-lo/ui 0.2.1 → 0.3.1

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
@@ -32,6 +32,8 @@ function cn(...inputs) {
32
32
  // src/lib/theme.ts
33
33
  var themeVars = {
34
34
  accent: "var(--arclo-accent, #6C5CE7)",
35
+ accentFg: "var(--arclo-accent-fg, #ffffff)",
36
+ accentBright: "var(--arclo-accent-bright, rgb(167,139,250))",
35
37
  surface: "var(--arclo-surface, #ffffff)",
36
38
  surfaceSecondary: "var(--arclo-surface-secondary, #f9fafb)",
37
39
  border: "var(--arclo-border, #e5e7eb)",
@@ -39,7 +41,9 @@ var themeVars = {
39
41
  textSecondary: "var(--arclo-text-secondary, #6b7280)",
40
42
  textMuted: "var(--arclo-text-muted, #9ca3af)",
41
43
  error: "var(--arclo-error, #ef4444)",
42
- errorSurface: "var(--arclo-error-surface, #fef2f2)"};
44
+ errorSurface: "var(--arclo-error-surface, #fef2f2)",
45
+ radius: "var(--arclo-radius, 0.75rem)"
46
+ };
43
47
  function chunkText(text, mode) {
44
48
  switch (mode) {
45
49
  case "char":
@@ -539,9 +543,13 @@ var Chip = react.forwardRef(
539
543
  {
540
544
  ref,
541
545
  className: cn(
542
- "arclo-prompt-chip inline-flex items-center gap-1.5 rounded-lg bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-600",
546
+ "arclo-prompt-chip inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium",
543
547
  className
544
548
  ),
549
+ style: {
550
+ backgroundColor: themeVars.surfaceSecondary,
551
+ color: themeVars.textSecondary
552
+ },
545
553
  ...props,
546
554
  children: [
547
555
  children,
@@ -595,8 +603,12 @@ var Input = react.forwardRef(
595
603
  disabled: disabled || isSubmitting,
596
604
  rows: minRows,
597
605
  placeholder: "Ask anything...",
606
+ style: {
607
+ scrollbarWidth: "none",
608
+ color: themeVars.text
609
+ },
598
610
  className: cn(
599
- "arclo-prompt-input w-full resize-none bg-transparent px-4 py-3 text-[15px] leading-relaxed outline-none placeholder:text-gray-400 [scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300",
611
+ "arclo-prompt-input w-full resize-none bg-transparent px-4 py-3 text-[15px] leading-relaxed outline-none",
600
612
  className
601
613
  ),
602
614
  ...props
@@ -622,23 +634,30 @@ var Footer = react.forwardRef(
622
634
  }
623
635
  );
624
636
  Footer.displayName = "PromptBox.Footer";
637
+ var ArrowUpIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 19V5M5 12l7-7 7 7" }) });
625
638
  var SubmitButton = react.forwardRef(
626
- ({ children, className, ...props }, ref) => {
639
+ ({ children, variant = "default", loadingLabel, className, ...props }, ref) => {
627
640
  const { value, isSubmitting, disabled } = usePromptBoxContext();
628
641
  const isEmpty = !value.trim();
642
+ const isIcon = variant === "icon";
643
+ const content = children ?? (isIcon ? isSubmitting ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, {}) : variant === "icon-text" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
644
+ isSubmitting ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, {}),
645
+ isSubmitting ? loadingLabel ?? "Sending..." : "Send"
646
+ ] }) : isSubmitting ? loadingLabel ?? "Sending..." : "Send");
629
647
  return /* @__PURE__ */ jsxRuntime.jsx(
630
648
  "button",
631
649
  {
632
650
  ref,
633
651
  type: "submit",
634
652
  disabled: isEmpty || isSubmitting || disabled,
635
- style: { backgroundColor: themeVars.accent },
653
+ style: { backgroundColor: themeVars.accent, color: themeVars.accentFg },
636
654
  className: cn(
637
- "arclo-prompt-submit ml-auto rounded-xl px-4 py-2 text-sm font-medium text-white transition-all hover:brightness-90 disabled:opacity-25 cursor-pointer disabled:cursor-default",
655
+ "arclo-prompt-submit ml-auto transition-all hover:brightness-90 disabled:opacity-25 cursor-pointer disabled:cursor-default",
656
+ isIcon ? "rounded-xl p-2" : "rounded-xl px-4 py-2 text-sm font-medium",
638
657
  className
639
658
  ),
640
659
  ...props,
641
- children: children ?? (isSubmitting ? "Sending..." : "Send")
660
+ children: content
642
661
  }
643
662
  );
644
663
  }
@@ -1330,9 +1349,13 @@ var Messages = react.forwardRef(
1330
1349
  {
1331
1350
  ref,
1332
1351
  className: cn(
1333
- "arclo-chat-messages flex-1 overflow-y-auto space-y-4 p-4 [scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300",
1352
+ "arclo-chat-messages flex-1 overflow-y-auto space-y-4 p-4",
1334
1353
  className
1335
1354
  ),
1355
+ style: {
1356
+ scrollbarWidth: "thin",
1357
+ scrollbarColor: `var(--arclo-border, #e5e7eb) transparent`
1358
+ },
1336
1359
  ...props,
1337
1360
  children
1338
1361
  }
@@ -1413,9 +1436,9 @@ var Message = react.forwardRef(
1413
1436
  ),
1414
1437
  style: isUser ? {
1415
1438
  backgroundColor: themeVars.accent,
1416
- color: "#ffffff"
1439
+ color: themeVars.accentFg
1417
1440
  } : {
1418
- backgroundColor: themeVars.surfaceSecondary,
1441
+ backgroundColor: themeVars.surface,
1419
1442
  color: themeVars.text,
1420
1443
  border: `1px solid ${themeVars.border}`
1421
1444
  },
@@ -1450,8 +1473,14 @@ var ScrollAnchor = react.forwardRef(
1450
1473
  react.useEffect(() => {
1451
1474
  const el = innerRef.current;
1452
1475
  if (!el) return;
1476
+ const scrollParent = el.closest(".arclo-chat-messages");
1453
1477
  const observer = new MutationObserver(() => {
1454
- el.scrollIntoView({ behavior: "smooth", block: "end" });
1478
+ if (scrollParent) {
1479
+ scrollParent.scrollTo({
1480
+ top: scrollParent.scrollHeight,
1481
+ behavior: "smooth"
1482
+ });
1483
+ }
1455
1484
  });
1456
1485
  const parent = el.parentElement;
1457
1486
  if (parent) {
@@ -1471,171 +1500,995 @@ var ScrollAnchor = react.forwardRef(
1471
1500
  }
1472
1501
  );
1473
1502
  ScrollAnchor.displayName = "ChatThread.ScrollAnchor";
1474
- var levelConfig = {
1475
- high: {
1476
- label: "High confidence",
1477
- classes: "bg-emerald-50 text-emerald-700 border-emerald-200"
1478
- },
1479
- medium: {
1480
- label: "Medium confidence",
1481
- classes: "bg-amber-50 text-amber-700 border-amber-200"
1482
- },
1483
- low: {
1484
- label: "Low confidence",
1485
- classes: "bg-red-50 text-red-700 border-red-200"
1486
- },
1487
- unknown: {
1488
- label: "Confidence unknown",
1489
- classes: "bg-gray-50 text-gray-500 border-gray-200"
1503
+
1504
+ // src/image-gen/index.ts
1505
+ var image_gen_exports = {};
1506
+ __export(image_gen_exports, {
1507
+ Download: () => Download,
1508
+ ErrorFallback: () => ErrorFallback2,
1509
+ Overlay: () => Overlay,
1510
+ Placeholder: () => Placeholder,
1511
+ Preview: () => Preview,
1512
+ Progress: () => Progress,
1513
+ Retry: () => Retry,
1514
+ Root: () => Root7,
1515
+ Toolbar: () => Toolbar2
1516
+ });
1517
+ var ImageGenContext = react.createContext(null);
1518
+ function useImageGenContext() {
1519
+ const ctx = react.useContext(ImageGenContext);
1520
+ if (!ctx) {
1521
+ throw new Error(
1522
+ "useImageGenContext must be used within <ImageGen.Root>"
1523
+ );
1490
1524
  }
1491
- };
1492
- var ConfidenceBadge = react.forwardRef(
1493
- ({ level, label, variant = "badge", className, ...props }, ref) => {
1494
- const config = levelConfig[level];
1495
- const displayLabel = label ?? config.label;
1496
- if (variant === "dot") {
1497
- return /* @__PURE__ */ jsxRuntime.jsx(
1498
- "span",
1499
- {
1500
- ref,
1501
- role: "status",
1502
- "aria-label": displayLabel,
1503
- title: displayLabel,
1504
- className: cn(
1505
- "arclo-confidence-dot inline-block h-2.5 w-2.5 shrink-0 rounded-full",
1506
- level === "high" && "bg-emerald-500",
1507
- level === "medium" && "bg-amber-500",
1508
- level === "low" && "bg-red-500",
1509
- level === "unknown" && "bg-gray-400",
1510
- className
1511
- ),
1512
- ...props
1513
- }
1514
- );
1515
- }
1516
- if (variant === "inline") {
1517
- return /* @__PURE__ */ jsxRuntime.jsx(
1518
- "span",
1519
- {
1520
- ref,
1521
- role: "status",
1522
- className: cn(
1523
- "arclo-confidence-inline text-xs italic",
1524
- level === "high" && "text-emerald-600",
1525
- level === "medium" && "text-amber-600",
1526
- level === "low" && "text-red-600",
1527
- level === "unknown" && "text-gray-400",
1528
- className
1529
- ),
1530
- ...props,
1531
- children: displayLabel
1532
- }
1533
- );
1534
- }
1525
+ return ctx;
1526
+ }
1527
+ var Root7 = react.forwardRef(
1528
+ ({
1529
+ state,
1530
+ src,
1531
+ alt,
1532
+ aspectRatio = "1/1",
1533
+ prompt,
1534
+ onRetry,
1535
+ onDownload,
1536
+ blurReveal = true,
1537
+ children,
1538
+ className,
1539
+ ...props
1540
+ }, ref) => {
1541
+ const ctx = {
1542
+ state,
1543
+ src,
1544
+ alt,
1545
+ aspectRatio,
1546
+ prompt,
1547
+ onRetry,
1548
+ onDownload,
1549
+ blurReveal
1550
+ };
1551
+ return /* @__PURE__ */ jsxRuntime.jsx(ImageGenContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
1552
+ "div",
1553
+ {
1554
+ ref,
1555
+ "data-state": state,
1556
+ style: { position: "relative" },
1557
+ className: cn("arclo-image-gen", className),
1558
+ ...props,
1559
+ children
1560
+ }
1561
+ ) });
1562
+ }
1563
+ );
1564
+ Root7.displayName = "ImageGen.Root";
1565
+ var Placeholder = react.forwardRef(
1566
+ ({ className, ...props }, ref) => {
1567
+ const { state, src, aspectRatio } = useImageGenContext();
1568
+ const visible = state === "idle" || state === "pending" || state === "generating" && !src;
1569
+ if (!visible) return null;
1535
1570
  return /* @__PURE__ */ jsxRuntime.jsxs(
1536
- "span",
1571
+ "div",
1537
1572
  {
1538
1573
  ref,
1539
1574
  role: "status",
1540
- className: cn(
1541
- "arclo-confidence-badge inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium",
1542
- config.classes,
1543
- className
1544
- ),
1575
+ "aria-label": "Loading image",
1576
+ style: {
1577
+ aspectRatio,
1578
+ backgroundColor: themeVars.surfaceSecondary,
1579
+ borderRadius: themeVars.radius,
1580
+ overflow: "hidden",
1581
+ position: "relative"
1582
+ },
1583
+ className: cn("arclo-image-gen-placeholder", className),
1545
1584
  ...props,
1546
1585
  children: [
1547
1586
  /* @__PURE__ */ jsxRuntime.jsx(
1548
- "span",
1587
+ "div",
1549
1588
  {
1550
- className: cn(
1551
- "h-2 w-2 shrink-0 rounded-full",
1552
- level === "high" && "bg-emerald-500",
1553
- level === "medium" && "bg-amber-500",
1554
- level === "low" && "bg-red-500",
1555
- level === "unknown" && "bg-gray-400"
1556
- )
1589
+ dangerouslySetInnerHTML: {
1590
+ __html: `<style>
1591
+ @keyframes arclo-shimmer {
1592
+ 0% { transform: translateX(-100%); }
1593
+ 100% { transform: translateX(100%); }
1594
+ }
1595
+ </style>`
1596
+ }
1557
1597
  }
1558
1598
  ),
1559
- displayLabel
1599
+ /* @__PURE__ */ jsxRuntime.jsx(
1600
+ "div",
1601
+ {
1602
+ style: {
1603
+ position: "absolute",
1604
+ inset: 0,
1605
+ background: `linear-gradient(90deg, transparent 0%, ${themeVars.border} 50%, transparent 100%)`,
1606
+ animation: "arclo-shimmer 1.5s ease-in-out infinite"
1607
+ }
1608
+ }
1609
+ )
1560
1610
  ]
1561
1611
  }
1562
1612
  );
1563
1613
  }
1564
1614
  );
1565
- ConfidenceBadge.displayName = "ConfidenceBadge";
1566
- var CitationInline = react.forwardRef(
1567
- ({
1568
- index,
1569
- href,
1570
- sourceTitle,
1571
- preview,
1572
- variant = "superscript",
1573
- className,
1574
- ...props
1575
- }, ref) => {
1576
- const [showPreview, setShowPreview] = react.useState(false);
1577
- const label = variant === "bracket" ? `[${index}]` : `${index}`;
1578
- const Tag = href ? "a" : "span";
1579
- const linkProps = href ? { href, target: "_blank", rel: "noopener noreferrer" } : {};
1580
- return /* @__PURE__ */ jsxRuntime.jsxs(
1581
- "span",
1615
+ Placeholder.displayName = "ImageGen.Placeholder";
1616
+ var Preview = react.forwardRef(
1617
+ ({ className, style, ...props }, ref) => {
1618
+ const { state, src, alt, aspectRatio, blurReveal } = useImageGenContext();
1619
+ if (!src) return null;
1620
+ const isDone = state === "done";
1621
+ const blurValue = blurReveal && !isDone ? "blur(20px)" : "blur(0)";
1622
+ return /* @__PURE__ */ jsxRuntime.jsx(
1623
+ "img",
1582
1624
  {
1583
1625
  ref,
1584
- className: cn("arclo-citation relative inline-block", className),
1585
- onMouseEnter: () => setShowPreview(true),
1586
- onMouseLeave: () => setShowPreview(false),
1626
+ src,
1627
+ alt: alt ?? "",
1628
+ "data-state": state,
1629
+ style: {
1630
+ aspectRatio,
1631
+ width: "100%",
1632
+ display: "block",
1633
+ borderRadius: themeVars.radius,
1634
+ objectFit: "cover",
1635
+ filter: blurValue,
1636
+ transition: "filter 0.6s ease-out",
1637
+ ...style
1638
+ },
1639
+ className: cn("arclo-image-gen-preview", className),
1640
+ ...props
1641
+ }
1642
+ );
1643
+ }
1644
+ );
1645
+ Preview.displayName = "ImageGen.Preview";
1646
+ var Progress = react.forwardRef(
1647
+ ({ progress, className, ...props }, ref) => {
1648
+ const { state } = useImageGenContext();
1649
+ if (state !== "pending" && state !== "generating") return null;
1650
+ const isIndeterminate = progress === void 0;
1651
+ return /* @__PURE__ */ jsxRuntime.jsx(
1652
+ "div",
1653
+ {
1654
+ ref,
1655
+ role: "progressbar",
1656
+ "aria-valuenow": isIndeterminate ? void 0 : progress,
1657
+ "aria-valuemin": 0,
1658
+ "aria-valuemax": 100,
1659
+ style: {
1660
+ position: "absolute",
1661
+ bottom: 0,
1662
+ left: 0,
1663
+ right: 0,
1664
+ height: "3px",
1665
+ backgroundColor: themeVars.surfaceSecondary,
1666
+ borderRadius: "0 0 3px 3px",
1667
+ overflow: "hidden"
1668
+ },
1669
+ className: cn("arclo-image-gen-progress", className),
1587
1670
  ...props,
1588
- children: [
1671
+ children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1589
1672
  /* @__PURE__ */ jsxRuntime.jsx(
1590
- Tag,
1673
+ "div",
1591
1674
  {
1592
- ...linkProps,
1593
- className: cn(
1594
- "arclo-citation-trigger transition-colors cursor-pointer",
1595
- variant === "superscript" && "align-super text-[0.65em] text-blue-600 hover:text-blue-800",
1596
- variant === "bracket" && "text-sm text-blue-600 hover:text-blue-800",
1597
- variant === "pill" && "inline-flex h-5 w-5 items-center justify-center rounded-full bg-blue-100 text-[0.6rem] font-medium text-blue-700 hover:bg-blue-200"
1598
- ),
1599
- "aria-label": sourceTitle ? `Source: ${sourceTitle}` : `Citation ${index}`,
1600
- children: label
1675
+ dangerouslySetInnerHTML: {
1676
+ __html: `<style>
1677
+ @keyframes arclo-progress-shimmer {
1678
+ 0% { transform: translateX(-100%); }
1679
+ 100% { transform: translateX(200%); }
1680
+ }
1681
+ </style>`
1682
+ }
1601
1683
  }
1602
1684
  ),
1603
- preview && showPreview && /* @__PURE__ */ jsxRuntime.jsxs(
1685
+ /* @__PURE__ */ jsxRuntime.jsx(
1604
1686
  "div",
1605
1687
  {
1606
- role: "tooltip",
1607
- className: "arclo-citation-preview absolute bottom-full left-1/2 z-50 mb-2 w-64 -translate-x-1/2 rounded-lg border border-gray-200 bg-white p-3 text-sm shadow-lg",
1688
+ style: {
1689
+ width: "40%",
1690
+ height: "100%",
1691
+ backgroundColor: themeVars.accent,
1692
+ animation: "arclo-progress-shimmer 1.2s ease-in-out infinite"
1693
+ }
1694
+ }
1695
+ )
1696
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
1697
+ "div",
1698
+ {
1699
+ style: {
1700
+ width: `${Math.min(100, Math.max(0, progress))}%`,
1701
+ height: "100%",
1702
+ backgroundColor: themeVars.accent,
1703
+ transition: "width 0.3s ease-out"
1704
+ }
1705
+ }
1706
+ )
1707
+ }
1708
+ );
1709
+ }
1710
+ );
1711
+ Progress.displayName = "ImageGen.Progress";
1712
+ var stateLabels = {
1713
+ idle: "Waiting",
1714
+ pending: "Preparing...",
1715
+ generating: "Generating...",
1716
+ done: "Done",
1717
+ error: "Error"
1718
+ };
1719
+ var Overlay = react.forwardRef(
1720
+ ({ label, className, ...props }, ref) => {
1721
+ const { state } = useImageGenContext();
1722
+ if (state !== "pending" && state !== "generating") return null;
1723
+ const displayLabel = label ?? stateLabels[state];
1724
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1725
+ "div",
1726
+ {
1727
+ ref,
1728
+ style: {
1729
+ position: "absolute",
1730
+ inset: 0,
1731
+ display: "flex",
1732
+ flexDirection: "column",
1733
+ alignItems: "center",
1734
+ justifyContent: "center",
1735
+ gap: "8px",
1736
+ backgroundColor: "rgba(0, 0, 0, 0.4)",
1737
+ borderRadius: themeVars.radius,
1738
+ color: "#ffffff"
1739
+ },
1740
+ className: cn("arclo-image-gen-overlay", className),
1741
+ ...props,
1742
+ children: [
1743
+ /* @__PURE__ */ jsxRuntime.jsxs(
1744
+ "svg",
1745
+ {
1746
+ width: "24",
1747
+ height: "24",
1748
+ viewBox: "0 0 24 24",
1749
+ fill: "none",
1750
+ style: { animation: "spin 1s linear infinite" },
1608
1751
  children: [
1609
- sourceTitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 font-medium text-gray-900", children: sourceTitle }),
1610
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-600", children: preview }),
1611
- href && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 truncate text-xs text-blue-500", children: href }),
1612
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-white" })
1752
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` }),
1753
+ /* @__PURE__ */ jsxRuntime.jsx(
1754
+ "circle",
1755
+ {
1756
+ cx: "12",
1757
+ cy: "12",
1758
+ r: "10",
1759
+ stroke: "currentColor",
1760
+ strokeWidth: "3",
1761
+ strokeDasharray: "31.4 31.4",
1762
+ strokeLinecap: "round"
1763
+ }
1764
+ )
1613
1765
  ]
1614
1766
  }
1615
- )
1767
+ ),
1768
+ displayLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "14px", fontWeight: 500 }, children: displayLabel })
1616
1769
  ]
1617
1770
  }
1618
1771
  );
1619
1772
  }
1620
1773
  );
1621
- CitationInline.displayName = "CitationInline";
1622
- var CitationGroup = react.forwardRef(
1623
- ({ children, className, ...props }, ref) => {
1624
- return /* @__PURE__ */ jsxRuntime.jsx(
1625
- "span",
1774
+ Overlay.displayName = "ImageGen.Overlay";
1775
+ var ErrorFallback2 = react.forwardRef(
1776
+ ({ message = "Failed to generate image.", className, ...props }, ref) => {
1777
+ const { state, onRetry } = useImageGenContext();
1778
+ if (state !== "error") return null;
1779
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1780
+ "div",
1626
1781
  {
1627
1782
  ref,
1628
- className: cn("arclo-citation-group inline-flex gap-0.5", className),
1783
+ role: "alert",
1784
+ style: {
1785
+ borderColor: themeVars.error,
1786
+ backgroundColor: themeVars.errorSurface,
1787
+ color: themeVars.error
1788
+ },
1789
+ className: cn(
1790
+ "arclo-image-gen-error rounded-lg border p-4 text-sm",
1791
+ className
1792
+ ),
1629
1793
  ...props,
1630
- children
1794
+ children: [
1795
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: message }),
1796
+ onRetry && /* @__PURE__ */ jsxRuntime.jsx(
1797
+ "button",
1798
+ {
1799
+ type: "button",
1800
+ onClick: onRetry,
1801
+ style: { color: themeVars.error },
1802
+ className: "mt-2 underline cursor-pointer",
1803
+ children: "Try again"
1804
+ }
1805
+ )
1806
+ ]
1631
1807
  }
1632
1808
  );
1633
1809
  }
1634
1810
  );
1635
- CitationGroup.displayName = "CitationGroup";
1636
- var typeConfig = {
1637
- safety: {
1638
- icon: "\u{1F6E1}",
1811
+ ErrorFallback2.displayName = "ImageGen.ErrorFallback";
1812
+ var Toolbar2 = react.forwardRef(
1813
+ ({ children, className, ...props }, ref) => {
1814
+ const { state } = useImageGenContext();
1815
+ if (state !== "done") return null;
1816
+ return /* @__PURE__ */ jsxRuntime.jsx(
1817
+ "div",
1818
+ {
1819
+ ref,
1820
+ className: cn(
1821
+ "arclo-image-gen-toolbar mt-2 flex items-center gap-2 animate-in fade-in duration-150",
1822
+ className
1823
+ ),
1824
+ ...props,
1825
+ children
1826
+ }
1827
+ );
1828
+ }
1829
+ );
1830
+ Toolbar2.displayName = "ImageGen.Toolbar";
1831
+ var Download = react.forwardRef(
1832
+ ({ children, className, ...props }, ref) => {
1833
+ const { onDownload } = useImageGenContext();
1834
+ return /* @__PURE__ */ jsxRuntime.jsx(
1835
+ "button",
1836
+ {
1837
+ ref,
1838
+ type: "button",
1839
+ onClick: onDownload,
1840
+ style: {
1841
+ backgroundColor: themeVars.accent,
1842
+ color: themeVars.accentFg,
1843
+ borderRadius: themeVars.radius
1844
+ },
1845
+ className: cn(
1846
+ "arclo-image-gen-download px-3 py-1.5 text-sm cursor-pointer",
1847
+ className
1848
+ ),
1849
+ ...props,
1850
+ children: children ?? "Download"
1851
+ }
1852
+ );
1853
+ }
1854
+ );
1855
+ Download.displayName = "ImageGen.Download";
1856
+ var Retry = react.forwardRef(
1857
+ ({ children, className, ...props }, ref) => {
1858
+ const { onRetry } = useImageGenContext();
1859
+ return /* @__PURE__ */ jsxRuntime.jsx(
1860
+ "button",
1861
+ {
1862
+ ref,
1863
+ type: "button",
1864
+ onClick: onRetry,
1865
+ style: {
1866
+ borderColor: themeVars.border,
1867
+ color: themeVars.text,
1868
+ borderRadius: themeVars.radius,
1869
+ borderWidth: "1px",
1870
+ borderStyle: "solid"
1871
+ },
1872
+ className: cn(
1873
+ "arclo-image-gen-retry px-3 py-1.5 text-sm cursor-pointer",
1874
+ className
1875
+ ),
1876
+ ...props,
1877
+ children: children ?? "Retry"
1878
+ }
1879
+ );
1880
+ }
1881
+ );
1882
+ Retry.displayName = "ImageGen.Retry";
1883
+
1884
+ // src/video-gen/index.ts
1885
+ var video_gen_exports = {};
1886
+ __export(video_gen_exports, {
1887
+ ErrorFallback: () => ErrorFallback3,
1888
+ Placeholder: () => Placeholder2,
1889
+ PlayButton: () => PlayButton,
1890
+ Player: () => Player,
1891
+ Progress: () => Progress2,
1892
+ Root: () => Root8,
1893
+ StageLabel: () => StageLabel,
1894
+ Thumbnail: () => Thumbnail,
1895
+ Toolbar: () => Toolbar3
1896
+ });
1897
+ var VideoGenContext = react.createContext(null);
1898
+ function useVideoGenContext() {
1899
+ const ctx = react.useContext(VideoGenContext);
1900
+ if (!ctx) {
1901
+ throw new Error(
1902
+ "useVideoGenContext must be used within <VideoGen.Root>"
1903
+ );
1904
+ }
1905
+ return ctx;
1906
+ }
1907
+ var Root8 = react.forwardRef(
1908
+ ({
1909
+ state,
1910
+ src = null,
1911
+ poster = null,
1912
+ progress,
1913
+ aspectRatio = "16/9",
1914
+ duration = null,
1915
+ prompt,
1916
+ onRetry,
1917
+ onDownload,
1918
+ onPlay,
1919
+ children,
1920
+ className,
1921
+ style,
1922
+ ...props
1923
+ }, ref) => {
1924
+ const ctx = {
1925
+ state,
1926
+ src,
1927
+ poster,
1928
+ progress,
1929
+ aspectRatio,
1930
+ duration,
1931
+ prompt,
1932
+ onRetry,
1933
+ onDownload,
1934
+ onPlay
1935
+ };
1936
+ return /* @__PURE__ */ jsxRuntime.jsx(VideoGenContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
1937
+ "div",
1938
+ {
1939
+ ref,
1940
+ "data-state": state,
1941
+ className: cn("arclo-video-gen relative overflow-hidden", className),
1942
+ style: {
1943
+ aspectRatio,
1944
+ borderRadius: themeVars.radius,
1945
+ ...style
1946
+ },
1947
+ ...props,
1948
+ children
1949
+ }
1950
+ ) });
1951
+ }
1952
+ );
1953
+ Root8.displayName = "VideoGen.Root";
1954
+ var Placeholder2 = react.forwardRef(
1955
+ ({ className, ...props }, ref) => {
1956
+ const { state, poster } = useVideoGenContext();
1957
+ const id = react.useId().replace(/:/g, "");
1958
+ const visible = (state === "idle" || state === "queued" || state === "processing") && !poster;
1959
+ if (!visible) return null;
1960
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1961
+ "div",
1962
+ {
1963
+ ref,
1964
+ role: "status",
1965
+ "aria-label": "Preparing video",
1966
+ className: cn(
1967
+ "arclo-video-gen-placeholder absolute inset-0 flex items-center justify-center",
1968
+ className
1969
+ ),
1970
+ style: { backgroundColor: themeVars.surfaceSecondary },
1971
+ ...props,
1972
+ children: [
1973
+ /* @__PURE__ */ jsxRuntime.jsx(
1974
+ "style",
1975
+ {
1976
+ dangerouslySetInnerHTML: {
1977
+ __html: `
1978
+ @keyframes arclo-vg-shimmer-${id} {
1979
+ 0% { background-position: -200% 0; }
1980
+ 100% { background-position: 200% 0; }
1981
+ }`
1982
+ }
1983
+ }
1984
+ ),
1985
+ /* @__PURE__ */ jsxRuntime.jsx(
1986
+ "div",
1987
+ {
1988
+ className: "absolute inset-0",
1989
+ style: {
1990
+ background: `linear-gradient(90deg, transparent 0%, ${themeVars.border} 50%, transparent 100%)`,
1991
+ backgroundSize: "200% 100%",
1992
+ animation: `arclo-vg-shimmer-${id} 2s ease-in-out infinite`,
1993
+ opacity: 0.5
1994
+ }
1995
+ }
1996
+ ),
1997
+ /* @__PURE__ */ jsxRuntime.jsxs(
1998
+ "svg",
1999
+ {
2000
+ width: "48",
2001
+ height: "48",
2002
+ viewBox: "0 0 24 24",
2003
+ fill: "none",
2004
+ stroke: "currentColor",
2005
+ strokeWidth: "1.5",
2006
+ strokeLinecap: "round",
2007
+ strokeLinejoin: "round",
2008
+ style: { color: themeVars.textMuted, position: "relative", zIndex: 1 },
2009
+ children: [
2010
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 11v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" }),
2011
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 11V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4" }),
2012
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 11h16" }),
2013
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 5l2 6" }),
2014
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 5l2 6" }),
2015
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5l2 6" })
2016
+ ]
2017
+ }
2018
+ )
2019
+ ]
2020
+ }
2021
+ );
2022
+ }
2023
+ );
2024
+ Placeholder2.displayName = "VideoGen.Placeholder";
2025
+ var Thumbnail = react.forwardRef(
2026
+ ({ className, style: styleProp, ...props }, ref) => {
2027
+ const { state, poster } = useVideoGenContext();
2028
+ const visible = poster && (state === "processing" || state === "rendering" || state === "done");
2029
+ if (!visible) return null;
2030
+ return /* @__PURE__ */ jsxRuntime.jsx(
2031
+ "img",
2032
+ {
2033
+ ref,
2034
+ src: poster,
2035
+ alt: "Video thumbnail",
2036
+ className: cn(
2037
+ "arclo-video-gen-thumbnail absolute inset-0 h-full w-full object-cover",
2038
+ className
2039
+ ),
2040
+ style: {
2041
+ borderRadius: themeVars.radius,
2042
+ ...styleProp
2043
+ },
2044
+ ...props
2045
+ }
2046
+ );
2047
+ }
2048
+ );
2049
+ Thumbnail.displayName = "VideoGen.Thumbnail";
2050
+ var Player = react.forwardRef(
2051
+ ({ className, style: styleProp, autoPlay, loop, muted, ...props }, ref) => {
2052
+ const { state, src, poster } = useVideoGenContext();
2053
+ if (state !== "done" || !src) return null;
2054
+ return /* @__PURE__ */ jsxRuntime.jsx(
2055
+ "video",
2056
+ {
2057
+ ref,
2058
+ src,
2059
+ poster: poster ?? void 0,
2060
+ controls: true,
2061
+ autoPlay,
2062
+ loop,
2063
+ muted,
2064
+ className: cn(
2065
+ "arclo-video-gen-player absolute inset-0 h-full w-full object-contain",
2066
+ className
2067
+ ),
2068
+ style: {
2069
+ borderRadius: themeVars.radius,
2070
+ backgroundColor: themeVars.surface,
2071
+ ...styleProp
2072
+ },
2073
+ ...props
2074
+ }
2075
+ );
2076
+ }
2077
+ );
2078
+ Player.displayName = "VideoGen.Player";
2079
+ var Progress2 = react.forwardRef(
2080
+ ({ className, ...props }, ref) => {
2081
+ const { state, progress } = useVideoGenContext();
2082
+ const id = react.useId().replace(/:/g, "");
2083
+ const visible = state === "queued" || state === "processing" || state === "rendering";
2084
+ if (!visible) return null;
2085
+ const isDeterminate = progress != null;
2086
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2087
+ "div",
2088
+ {
2089
+ ref,
2090
+ role: "progressbar",
2091
+ "aria-valuenow": isDeterminate ? progress : void 0,
2092
+ "aria-valuemin": 0,
2093
+ "aria-valuemax": 100,
2094
+ className: cn(
2095
+ "arclo-video-gen-progress absolute bottom-0 left-0 right-0 h-1",
2096
+ className
2097
+ ),
2098
+ style: { backgroundColor: `color-mix(in srgb, ${themeVars.accent} 20%, transparent)` },
2099
+ ...props,
2100
+ children: [
2101
+ /* @__PURE__ */ jsxRuntime.jsx(
2102
+ "style",
2103
+ {
2104
+ dangerouslySetInnerHTML: {
2105
+ __html: `
2106
+ @keyframes arclo-vg-indeterminate-${id} {
2107
+ 0% { transform: translateX(-100%); }
2108
+ 100% { transform: translateX(400%); }
2109
+ }`
2110
+ }
2111
+ }
2112
+ ),
2113
+ /* @__PURE__ */ jsxRuntime.jsx(
2114
+ "div",
2115
+ {
2116
+ className: "h-full",
2117
+ style: isDeterminate ? {
2118
+ width: `${Math.min(100, Math.max(0, progress))}%`,
2119
+ backgroundColor: themeVars.accent,
2120
+ transition: "width 0.3s ease"
2121
+ } : {
2122
+ width: "25%",
2123
+ backgroundColor: themeVars.accent,
2124
+ animation: `arclo-vg-indeterminate-${id} 1.5s ease-in-out infinite`
2125
+ }
2126
+ }
2127
+ )
2128
+ ]
2129
+ }
2130
+ );
2131
+ }
2132
+ );
2133
+ Progress2.displayName = "VideoGen.Progress";
2134
+ function getAutoLabel(state, progress) {
2135
+ switch (state) {
2136
+ case "idle":
2137
+ return "";
2138
+ case "queued":
2139
+ return "Queued...";
2140
+ case "processing":
2141
+ return progress != null ? `Processing ${Math.round(progress)}%` : "Processing...";
2142
+ case "rendering":
2143
+ return progress != null ? `Rendering ${Math.round(progress)}%` : "Rendering...";
2144
+ case "done":
2145
+ return "Complete";
2146
+ case "error":
2147
+ return "Failed";
2148
+ default:
2149
+ return "";
2150
+ }
2151
+ }
2152
+ var StageLabel = react.forwardRef(
2153
+ ({ label, className, ...props }, ref) => {
2154
+ const { state, progress } = useVideoGenContext();
2155
+ const id = react.useId().replace(/:/g, "");
2156
+ const displayLabel = label ?? getAutoLabel(state, progress);
2157
+ const isActive = state === "queued" || state === "processing" || state === "rendering";
2158
+ if (!displayLabel) return null;
2159
+ const accentColor = themeVars.accent;
2160
+ const brightColor = themeVars.accentBright;
2161
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2162
+ "span",
2163
+ {
2164
+ ref,
2165
+ "data-state": state,
2166
+ className: cn(
2167
+ "arclo-video-gen-stage-label text-sm font-medium",
2168
+ className
2169
+ ),
2170
+ style: { color: accentColor },
2171
+ ...props,
2172
+ children: [
2173
+ /* @__PURE__ */ jsxRuntime.jsx(
2174
+ "style",
2175
+ {
2176
+ dangerouslySetInnerHTML: {
2177
+ __html: `
2178
+ @keyframes arclo-vg-sweep-${id} {
2179
+ 0%, 100% { color: ${accentColor}; opacity: 0.5; }
2180
+ 50% { color: ${brightColor}; opacity: 1; }
2181
+ }`
2182
+ }
2183
+ }
2184
+ ),
2185
+ isActive ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-label": displayLabel, children: displayLabel.split("").map((char, i) => /* @__PURE__ */ jsxRuntime.jsx(
2186
+ "span",
2187
+ {
2188
+ style: {
2189
+ display: "inline-block",
2190
+ animation: `arclo-vg-sweep-${id} 1.5s ease-in-out infinite`,
2191
+ animationDelay: `${i * 0.08}s`
2192
+ },
2193
+ children: char === " " ? "\xA0" : char
2194
+ },
2195
+ i
2196
+ )) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: displayLabel })
2197
+ ]
2198
+ }
2199
+ );
2200
+ }
2201
+ );
2202
+ StageLabel.displayName = "VideoGen.StageLabel";
2203
+ var ErrorFallback3 = react.forwardRef(
2204
+ ({ message = "Video generation failed.", className, ...props }, ref) => {
2205
+ const { state, onRetry } = useVideoGenContext();
2206
+ if (state !== "error") return null;
2207
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2208
+ "div",
2209
+ {
2210
+ ref,
2211
+ role: "alert",
2212
+ className: cn(
2213
+ "arclo-video-gen-error absolute inset-0 flex flex-col items-center justify-center gap-2 p-4 text-sm",
2214
+ className
2215
+ ),
2216
+ style: {
2217
+ backgroundColor: themeVars.errorSurface,
2218
+ color: themeVars.error,
2219
+ borderRadius: themeVars.radius
2220
+ },
2221
+ ...props,
2222
+ children: [
2223
+ /* @__PURE__ */ jsxRuntime.jsxs(
2224
+ "svg",
2225
+ {
2226
+ width: "24",
2227
+ height: "24",
2228
+ viewBox: "0 0 24 24",
2229
+ fill: "none",
2230
+ stroke: "currentColor",
2231
+ strokeWidth: "2",
2232
+ strokeLinecap: "round",
2233
+ strokeLinejoin: "round",
2234
+ children: [
2235
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
2236
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
2237
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
2238
+ ]
2239
+ }
2240
+ ),
2241
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: message }),
2242
+ onRetry && /* @__PURE__ */ jsxRuntime.jsx(
2243
+ "button",
2244
+ {
2245
+ type: "button",
2246
+ onClick: onRetry,
2247
+ className: "mt-1 underline cursor-pointer",
2248
+ style: { color: themeVars.error },
2249
+ children: "Try again"
2250
+ }
2251
+ )
2252
+ ]
2253
+ }
2254
+ );
2255
+ }
2256
+ );
2257
+ ErrorFallback3.displayName = "VideoGen.ErrorFallback";
2258
+ var Toolbar3 = react.forwardRef(
2259
+ ({ children, className, ...props }, ref) => {
2260
+ const { state } = useVideoGenContext();
2261
+ if (state !== "done") return null;
2262
+ return /* @__PURE__ */ jsxRuntime.jsx(
2263
+ "div",
2264
+ {
2265
+ ref,
2266
+ className: cn(
2267
+ "arclo-video-gen-toolbar absolute bottom-4 right-4 flex items-center gap-2 animate-in fade-in duration-150",
2268
+ className
2269
+ ),
2270
+ ...props,
2271
+ children
2272
+ }
2273
+ );
2274
+ }
2275
+ );
2276
+ Toolbar3.displayName = "VideoGen.Toolbar";
2277
+ var PlayButton = react.forwardRef(
2278
+ ({ className, children, ...props }, ref) => {
2279
+ const { state, onPlay, src } = useVideoGenContext();
2280
+ react.useRef(null);
2281
+ const visible = state === "done" && src;
2282
+ if (!visible) return null;
2283
+ const handleClick = () => {
2284
+ if (onPlay) {
2285
+ onPlay();
2286
+ } else {
2287
+ const root = ref?.current?.closest(
2288
+ ".arclo-video-gen"
2289
+ );
2290
+ const video = root?.querySelector("video");
2291
+ if (video) {
2292
+ video.play();
2293
+ }
2294
+ }
2295
+ };
2296
+ return /* @__PURE__ */ jsxRuntime.jsx(
2297
+ "button",
2298
+ {
2299
+ ref,
2300
+ type: "button",
2301
+ "aria-label": "Play video",
2302
+ onClick: handleClick,
2303
+ className: cn(
2304
+ "arclo-video-gen-play-button absolute inset-0 m-auto flex h-16 w-16 items-center justify-center rounded-full cursor-pointer transition-transform hover:scale-110",
2305
+ className
2306
+ ),
2307
+ style: {
2308
+ backgroundColor: themeVars.accent,
2309
+ color: themeVars.accentFg
2310
+ },
2311
+ ...props,
2312
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
2313
+ "svg",
2314
+ {
2315
+ width: "28",
2316
+ height: "28",
2317
+ viewBox: "0 0 24 24",
2318
+ fill: "currentColor",
2319
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5v14l11-7z" })
2320
+ }
2321
+ )
2322
+ }
2323
+ );
2324
+ }
2325
+ );
2326
+ PlayButton.displayName = "VideoGen.PlayButton";
2327
+ var levelConfig = {
2328
+ high: {
2329
+ label: "High confidence",
2330
+ classes: "bg-emerald-50 text-emerald-700 border-emerald-200"
2331
+ },
2332
+ medium: {
2333
+ label: "Medium confidence",
2334
+ classes: "bg-amber-50 text-amber-700 border-amber-200"
2335
+ },
2336
+ low: {
2337
+ label: "Low confidence",
2338
+ classes: "bg-red-50 text-red-700 border-red-200"
2339
+ },
2340
+ unknown: {
2341
+ label: "Confidence unknown",
2342
+ classes: "bg-gray-50 text-gray-500 border-gray-200"
2343
+ }
2344
+ };
2345
+ var ConfidenceBadge = react.forwardRef(
2346
+ ({ level, label, variant = "badge", className, ...props }, ref) => {
2347
+ const config = levelConfig[level];
2348
+ const displayLabel = label ?? config.label;
2349
+ if (variant === "dot") {
2350
+ return /* @__PURE__ */ jsxRuntime.jsx(
2351
+ "span",
2352
+ {
2353
+ ref,
2354
+ role: "status",
2355
+ "aria-label": displayLabel,
2356
+ title: displayLabel,
2357
+ className: cn(
2358
+ "arclo-confidence-dot inline-block h-2.5 w-2.5 shrink-0 rounded-full",
2359
+ level === "high" && "bg-emerald-500",
2360
+ level === "medium" && "bg-amber-500",
2361
+ level === "low" && "bg-red-500",
2362
+ level === "unknown" && "bg-gray-400",
2363
+ className
2364
+ ),
2365
+ ...props
2366
+ }
2367
+ );
2368
+ }
2369
+ if (variant === "inline") {
2370
+ return /* @__PURE__ */ jsxRuntime.jsx(
2371
+ "span",
2372
+ {
2373
+ ref,
2374
+ role: "status",
2375
+ className: cn(
2376
+ "arclo-confidence-inline text-xs italic",
2377
+ level === "high" && "text-emerald-600",
2378
+ level === "medium" && "text-amber-600",
2379
+ level === "low" && "text-red-600",
2380
+ level === "unknown" && "text-gray-400",
2381
+ className
2382
+ ),
2383
+ ...props,
2384
+ children: displayLabel
2385
+ }
2386
+ );
2387
+ }
2388
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2389
+ "span",
2390
+ {
2391
+ ref,
2392
+ role: "status",
2393
+ className: cn(
2394
+ "arclo-confidence-badge inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium",
2395
+ config.classes,
2396
+ className
2397
+ ),
2398
+ ...props,
2399
+ children: [
2400
+ /* @__PURE__ */ jsxRuntime.jsx(
2401
+ "span",
2402
+ {
2403
+ className: cn(
2404
+ "h-2 w-2 shrink-0 rounded-full",
2405
+ level === "high" && "bg-emerald-500",
2406
+ level === "medium" && "bg-amber-500",
2407
+ level === "low" && "bg-red-500",
2408
+ level === "unknown" && "bg-gray-400"
2409
+ )
2410
+ }
2411
+ ),
2412
+ displayLabel
2413
+ ]
2414
+ }
2415
+ );
2416
+ }
2417
+ );
2418
+ ConfidenceBadge.displayName = "ConfidenceBadge";
2419
+ var CitationInline = react.forwardRef(
2420
+ ({
2421
+ index,
2422
+ href,
2423
+ sourceTitle,
2424
+ preview,
2425
+ variant = "superscript",
2426
+ className,
2427
+ ...props
2428
+ }, ref) => {
2429
+ const [showPreview, setShowPreview] = react.useState(false);
2430
+ const label = variant === "bracket" ? `[${index}]` : `${index}`;
2431
+ const Tag = href ? "a" : "span";
2432
+ const linkProps = href ? { href, target: "_blank", rel: "noopener noreferrer" } : {};
2433
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2434
+ "span",
2435
+ {
2436
+ ref,
2437
+ className: cn("arclo-citation relative inline-block", className),
2438
+ onMouseEnter: () => setShowPreview(true),
2439
+ onMouseLeave: () => setShowPreview(false),
2440
+ ...props,
2441
+ children: [
2442
+ /* @__PURE__ */ jsxRuntime.jsx(
2443
+ Tag,
2444
+ {
2445
+ ...linkProps,
2446
+ className: cn(
2447
+ "arclo-citation-trigger transition-colors cursor-pointer",
2448
+ variant === "superscript" && "align-super text-[0.65em] text-blue-600 hover:text-blue-800",
2449
+ variant === "bracket" && "text-sm text-blue-600 hover:text-blue-800",
2450
+ variant === "pill" && "inline-flex h-5 w-5 items-center justify-center rounded-full bg-blue-100 text-[0.6rem] font-medium text-blue-700 hover:bg-blue-200"
2451
+ ),
2452
+ "aria-label": sourceTitle ? `Source: ${sourceTitle}` : `Citation ${index}`,
2453
+ children: label
2454
+ }
2455
+ ),
2456
+ preview && showPreview && /* @__PURE__ */ jsxRuntime.jsxs(
2457
+ "div",
2458
+ {
2459
+ role: "tooltip",
2460
+ className: "arclo-citation-preview absolute bottom-full left-1/2 z-50 mb-2 w-64 -translate-x-1/2 rounded-lg border border-gray-200 bg-white p-3 text-sm shadow-lg",
2461
+ children: [
2462
+ sourceTitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 font-medium text-gray-900", children: sourceTitle }),
2463
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-600", children: preview }),
2464
+ href && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 truncate text-xs text-blue-500", children: href }),
2465
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-white" })
2466
+ ]
2467
+ }
2468
+ )
2469
+ ]
2470
+ }
2471
+ );
2472
+ }
2473
+ );
2474
+ CitationInline.displayName = "CitationInline";
2475
+ var CitationGroup = react.forwardRef(
2476
+ ({ children, className, ...props }, ref) => {
2477
+ return /* @__PURE__ */ jsxRuntime.jsx(
2478
+ "span",
2479
+ {
2480
+ ref,
2481
+ className: cn("arclo-citation-group inline-flex gap-0.5", className),
2482
+ ...props,
2483
+ children
2484
+ }
2485
+ );
2486
+ }
2487
+ );
2488
+ CitationGroup.displayName = "CitationGroup";
2489
+ var typeConfig = {
2490
+ safety: {
2491
+ icon: "\u{1F6E1}",
1639
2492
  defaultReason: "I can't help with that request for safety reasons.",
1640
2493
  accent: "border-red-200 bg-red-50"
1641
2494
  },
@@ -2632,59 +3485,94 @@ var CodeBlock = react.forwardRef(
2632
3485
  "arclo-code-block overflow-hidden rounded-xl border",
2633
3486
  className
2634
3487
  ),
2635
- style: { backgroundColor: "#1e1e2e", borderColor: "#313244" },
3488
+ style: {
3489
+ backgroundColor: themeVars.surfaceSecondary,
3490
+ borderColor: themeVars.border
3491
+ },
2636
3492
  ...props,
2637
3493
  children: [
2638
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2", style: { borderBottom: "1px solid #313244" }, children: [
2639
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium uppercase tracking-wider", style: { color: "#a6adc8" }, children: language ?? "code" }),
2640
- /* @__PURE__ */ jsxRuntime.jsx(
2641
- "button",
2642
- {
2643
- type: "button",
2644
- onClick: handleCopy,
2645
- className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] transition-colors cursor-pointer",
2646
- style: { color: "#a6adc8" },
2647
- children: copied ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2648
- /* @__PURE__ */ jsxRuntime.jsx(
2649
- "svg",
2650
- {
2651
- className: "h-3.5 w-3.5 text-emerald-400",
2652
- viewBox: "0 0 24 24",
2653
- fill: "none",
2654
- stroke: "currentColor",
2655
- strokeWidth: "2",
2656
- strokeLinecap: "round",
2657
- strokeLinejoin: "round",
2658
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
2659
- }
2660
- ),
2661
- "Copied"
2662
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2663
- /* @__PURE__ */ jsxRuntime.jsxs(
2664
- "svg",
2665
- {
2666
- className: "h-3.5 w-3.5",
2667
- viewBox: "0 0 24 24",
2668
- fill: "none",
2669
- stroke: "currentColor",
2670
- strokeWidth: "2",
2671
- strokeLinecap: "round",
2672
- strokeLinejoin: "round",
2673
- children: [
2674
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2675
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2676
- ]
2677
- }
2678
- ),
2679
- "Copy"
2680
- ] })
2681
- }
2682
- )
2683
- ] }),
2684
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto [scrollbar-width:thin] [scrollbar-color:theme(colors.gray.700)_transparent] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-700", style: { maxHeight }, children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "p-4 text-[13px] leading-relaxed", children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono", style: { color: "#cdd6f4" }, children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
2685
- showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-4 inline-block w-8 shrink-0 select-none text-right", style: { color: "#585b70" }, children: i + 1 }),
2686
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: line || "\n" })
2687
- ] }, i)) }) }) })
3494
+ /* @__PURE__ */ jsxRuntime.jsxs(
3495
+ "div",
3496
+ {
3497
+ className: "flex items-center justify-between px-4 py-2",
3498
+ style: { borderBottom: `1px solid ${themeVars.border}` },
3499
+ children: [
3500
+ /* @__PURE__ */ jsxRuntime.jsx(
3501
+ "span",
3502
+ {
3503
+ className: "text-[11px] font-medium uppercase tracking-wider",
3504
+ style: { color: themeVars.textMuted },
3505
+ children: language ?? "code"
3506
+ }
3507
+ ),
3508
+ /* @__PURE__ */ jsxRuntime.jsx(
3509
+ "button",
3510
+ {
3511
+ type: "button",
3512
+ onClick: handleCopy,
3513
+ className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] transition-colors cursor-pointer",
3514
+ style: { color: themeVars.textMuted },
3515
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3516
+ /* @__PURE__ */ jsxRuntime.jsx(
3517
+ "svg",
3518
+ {
3519
+ className: "h-3.5 w-3.5",
3520
+ style: { color: "#10b981" },
3521
+ viewBox: "0 0 24 24",
3522
+ fill: "none",
3523
+ stroke: "currentColor",
3524
+ strokeWidth: "2",
3525
+ strokeLinecap: "round",
3526
+ strokeLinejoin: "round",
3527
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
3528
+ }
3529
+ ),
3530
+ "Copied"
3531
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3532
+ /* @__PURE__ */ jsxRuntime.jsxs(
3533
+ "svg",
3534
+ {
3535
+ className: "h-3.5 w-3.5",
3536
+ viewBox: "0 0 24 24",
3537
+ fill: "none",
3538
+ stroke: "currentColor",
3539
+ strokeWidth: "2",
3540
+ strokeLinecap: "round",
3541
+ strokeLinejoin: "round",
3542
+ children: [
3543
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
3544
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
3545
+ ]
3546
+ }
3547
+ ),
3548
+ "Copy"
3549
+ ] })
3550
+ }
3551
+ )
3552
+ ]
3553
+ }
3554
+ ),
3555
+ /* @__PURE__ */ jsxRuntime.jsx(
3556
+ "div",
3557
+ {
3558
+ className: "overflow-auto [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full",
3559
+ style: {
3560
+ maxHeight,
3561
+ scrollbarColor: `${themeVars.border} transparent`
3562
+ },
3563
+ children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "p-4 text-[13px] leading-relaxed", children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono", style: { color: themeVars.text }, children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
3564
+ showLineNumbers && /* @__PURE__ */ jsxRuntime.jsx(
3565
+ "span",
3566
+ {
3567
+ className: "mr-4 inline-block w-8 shrink-0 select-none text-right",
3568
+ style: { color: themeVars.textMuted },
3569
+ children: i + 1
3570
+ }
3571
+ ),
3572
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: line || "\n" })
3573
+ ] }, i)) }) })
3574
+ }
3575
+ )
2688
3576
  ]
2689
3577
  }
2690
3578
  );
@@ -2968,6 +3856,7 @@ exports.ConfidenceBadge = ConfidenceBadge;
2968
3856
  exports.ConversationBranch = ConversationBranch;
2969
3857
  exports.FeedbackBar = feedback_bar_exports;
2970
3858
  exports.FileAttachment = FileAttachment;
3859
+ exports.ImageGen = image_gen_exports;
2971
3860
  exports.MarkdownRenderer = MarkdownRenderer;
2972
3861
  exports.ModelSelector = ModelSelector;
2973
3862
  exports.PromptBox = prompt_box_exports;
@@ -2980,6 +3869,7 @@ exports.ThinkingBlock = thinking_block_exports;
2980
3869
  exports.TokenUsage = TokenUsage;
2981
3870
  exports.ToolCall = tool_call_exports;
2982
3871
  exports.TopicCard = TopicCard;
3872
+ exports.VideoGen = video_gen_exports;
2983
3873
  exports.useStreamingText = useStreamingText;
2984
3874
  //# sourceMappingURL=index.cjs.map
2985
3875
  //# sourceMappingURL=index.cjs.map