@arc-lo/ui 0.3.0 → 0.3.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/index.cjs CHANGED
@@ -634,10 +634,16 @@ var Footer = react.forwardRef(
634
634
  }
635
635
  );
636
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" }) });
637
638
  var SubmitButton = react.forwardRef(
638
- ({ children, className, ...props }, ref) => {
639
+ ({ children, variant = "default", loadingLabel, className, ...props }, ref) => {
639
640
  const { value, isSubmitting, disabled } = usePromptBoxContext();
640
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");
641
647
  return /* @__PURE__ */ jsxRuntime.jsx(
642
648
  "button",
643
649
  {
@@ -646,11 +652,12 @@ var SubmitButton = react.forwardRef(
646
652
  disabled: isEmpty || isSubmitting || disabled,
647
653
  style: { backgroundColor: themeVars.accent, color: themeVars.accentFg },
648
654
  className: cn(
649
- "arclo-prompt-submit ml-auto rounded-xl px-4 py-2 text-sm font-medium 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",
650
657
  className
651
658
  ),
652
659
  ...props,
653
- children: children ?? (isSubmitting ? "Sending..." : "Send")
660
+ children: content
654
661
  }
655
662
  );
656
663
  }
@@ -1314,6 +1321,7 @@ Output.displayName = "ToolCall.Output";
1314
1321
  var chat_thread_exports = {};
1315
1322
  __export(chat_thread_exports, {
1316
1323
  AssistantMessage: () => AssistantMessage,
1324
+ Avatar: () => Avatar,
1317
1325
  Message: () => Message,
1318
1326
  Messages: () => Messages,
1319
1327
  Root: () => Root6,
@@ -1493,6 +1501,65 @@ var ScrollAnchor = react.forwardRef(
1493
1501
  }
1494
1502
  );
1495
1503
  ScrollAnchor.displayName = "ChatThread.ScrollAnchor";
1504
+ var Avatar = react.forwardRef(
1505
+ ({
1506
+ src,
1507
+ initials,
1508
+ icon,
1509
+ color,
1510
+ textColor,
1511
+ size = 28,
1512
+ className,
1513
+ style,
1514
+ ...props
1515
+ }, ref) => {
1516
+ const bg = color ?? themeVars.accent;
1517
+ const fg = textColor ?? themeVars.accentFg;
1518
+ if (src) {
1519
+ return /* @__PURE__ */ jsxRuntime.jsx(
1520
+ "div",
1521
+ {
1522
+ ref,
1523
+ className: cn(
1524
+ "arclo-chat-avatar shrink-0 overflow-hidden rounded-full",
1525
+ className
1526
+ ),
1527
+ style: { width: size, height: size, ...style },
1528
+ ...props,
1529
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1530
+ "img",
1531
+ {
1532
+ src,
1533
+ alt: initials ?? "Avatar",
1534
+ className: "h-full w-full object-cover"
1535
+ }
1536
+ )
1537
+ }
1538
+ );
1539
+ }
1540
+ return /* @__PURE__ */ jsxRuntime.jsx(
1541
+ "div",
1542
+ {
1543
+ ref,
1544
+ className: cn(
1545
+ "arclo-chat-avatar shrink-0 flex items-center justify-center rounded-full font-semibold",
1546
+ className
1547
+ ),
1548
+ style: {
1549
+ width: size,
1550
+ height: size,
1551
+ backgroundColor: bg,
1552
+ color: fg,
1553
+ fontSize: size * 0.4,
1554
+ ...style
1555
+ },
1556
+ ...props,
1557
+ children: icon ?? initials ?? "?"
1558
+ }
1559
+ );
1560
+ }
1561
+ );
1562
+ Avatar.displayName = "ChatThread.Avatar";
1496
1563
 
1497
1564
  // src/image-gen/index.ts
1498
1565
  var image_gen_exports = {};