@xbrain-swe/nova-chat-widget 0.1.6 → 0.1.7

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
@@ -1523,6 +1523,7 @@ function XbNovaChat({
1523
1523
  backdropStyle,
1524
1524
  defaultOpen = false,
1525
1525
  idleText = "AI\uC5D0\uAC8C \uC774 \uCC28 \uBB3C\uC5B4\uBCF4\uAE30",
1526
+ avatarSize = 28,
1526
1527
  onVerdictAction
1527
1528
  }) {
1528
1529
  const { auth, trackRegistry, factsRegistry, visitorId, clientActionHandlers, theme } = useXbNovaInternal();
@@ -1530,6 +1531,7 @@ function XbNovaChat({
1530
1531
  "--xbnova-accent-1": theme.accentFrom,
1531
1532
  "--xbnova-accent-2": theme.accentTo
1532
1533
  };
1534
+ const headerAvatarSize = Math.min(36, Math.max(24, Math.round(avatarSize * 0.8)));
1533
1535
  const avatarGradientStyle = {
1534
1536
  background: "linear-gradient(135deg, var(--xbnova-accent-1), var(--xbnova-accent-2))"
1535
1537
  };
@@ -1678,7 +1680,8 @@ function XbNovaChat({
1678
1680
  Avatar,
1679
1681
  {
1680
1682
  branding: onboarding?.branding,
1681
- className: "h-7 w-7 text-[11px] shadow-md",
1683
+ size: avatarSize,
1684
+ className: "shadow-md",
1682
1685
  gradient: avatarGradientStyle
1683
1686
  }
1684
1687
  )
@@ -1726,7 +1729,8 @@ function XbNovaChat({
1726
1729
  Avatar,
1727
1730
  {
1728
1731
  branding: onboarding?.branding,
1729
- className: "h-6 w-6 shrink-0 text-[10px]",
1732
+ size: headerAvatarSize,
1733
+ className: "shrink-0",
1730
1734
  gradient: avatarGradientStyle
1731
1735
  }
1732
1736
  ),
@@ -1844,9 +1848,11 @@ function XbNovaChat({
1844
1848
  }
1845
1849
  function Avatar({
1846
1850
  branding,
1847
- className,
1851
+ size,
1852
+ className = "",
1848
1853
  gradient
1849
1854
  }) {
1855
+ const box = { width: size, height: size };
1850
1856
  const logoUrl = branding?.logo_url?.trim() ?? "";
1851
1857
  const [failedUrl, setFailedUrl] = (0, import_react9.useState)("");
1852
1858
  if (logoUrl && failedUrl !== logoUrl) {
@@ -1856,6 +1862,7 @@ function Avatar({
1856
1862
  src: logoUrl,
1857
1863
  alt: "",
1858
1864
  onError: () => setFailedUrl(logoUrl),
1865
+ style: box,
1859
1866
  className: `${className} flex-none rounded-full bg-white object-cover`
1860
1867
  }
1861
1868
  );
@@ -1864,8 +1871,8 @@ function Avatar({
1864
1871
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1865
1872
  "span",
1866
1873
  {
1867
- className: `${className} flex items-center justify-center rounded-full font-bold text-white`,
1868
- style: gradient,
1874
+ className: `${className} flex flex-none items-center justify-center rounded-full font-bold text-white`,
1875
+ style: { ...gradient, ...box, fontSize: Math.max(10, Math.round(size * 0.4)) },
1869
1876
  children: text
1870
1877
  }
1871
1878
  );