@runtypelabs/persona 4.3.0 → 4.4.0

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.
@@ -2769,6 +2769,12 @@ type AgentWidgetLauncherConfig = {
2769
2769
  agentIconText?: string;
2770
2770
  agentIconName?: string;
2771
2771
  agentIconHidden?: boolean;
2772
+ /**
2773
+ * Background color for the agent icon circle in the launcher button. Accepts
2774
+ * any CSS color value. When set, overrides the default primary-color
2775
+ * background (the `persona-bg-persona-primary` utility).
2776
+ */
2777
+ agentIconBackgroundColor?: string;
2772
2778
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
2773
2779
  /**
2774
2780
  * Controls how the launcher panel is mounted relative to the host page.
@@ -2769,6 +2769,12 @@ type AgentWidgetLauncherConfig = {
2769
2769
  agentIconText?: string;
2770
2770
  agentIconName?: string;
2771
2771
  agentIconHidden?: boolean;
2772
+ /**
2773
+ * Background color for the agent icon circle in the launcher button. Accepts
2774
+ * any CSS color value. When set, overrides the default primary-color
2775
+ * background (the `persona-bg-persona-primary` utility).
2776
+ */
2777
+ agentIconBackgroundColor?: string;
2772
2778
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
2773
2779
  /**
2774
2780
  * Controls how the launcher panel is mounted relative to the host page.
package/dist/widget.css CHANGED
@@ -1745,6 +1745,9 @@
1745
1745
  /* Make message bubble position relative for overlay positioning */
1746
1746
  .persona-message-bubble {
1747
1747
  position: relative;
1748
+ /* Break long unbreakable tokens (e.g. URLs, package names) so they wrap
1749
+ inside the bubble's max-width instead of overflowing horizontally. */
1750
+ overflow-wrap: break-word;
1748
1751
  }
1749
1752
 
1750
1753
  /* Fade-in animation for action buttons */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/persona",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -64,7 +64,17 @@ export const createLauncherButton = (
64
64
  const iconSize = launcher.agentIconSize ?? "40px";
65
65
  icon.style.height = iconSize;
66
66
  icon.style.width = iconSize;
67
-
67
+
68
+ // Optional custom background color for the agent icon circle. When set,
69
+ // override the default primary-color background; otherwise restore it.
70
+ if (launcher.agentIconBackgroundColor) {
71
+ icon.style.backgroundColor = launcher.agentIconBackgroundColor;
72
+ icon.classList.remove("persona-bg-persona-primary");
73
+ } else {
74
+ icon.style.backgroundColor = "";
75
+ icon.classList.add("persona-bg-persona-primary");
76
+ }
77
+
68
78
  // Clear existing content
69
79
  icon.innerHTML = "";
70
80
 
@@ -279,9 +279,11 @@ const buildComposerBarPanel = (
279
279
  const introCard = createNode(
280
280
  "div",
281
281
  {
282
- className: "persona-rounded-2xl persona-bg-persona-surface persona-p-6",
282
+ className: "persona-rounded-2xl persona-p-6",
283
283
  attrs: { "data-persona-intro-card": "" },
284
284
  style: {
285
+ background:
286
+ "var(--persona-intro-card-bg, var(--persona-surface, #ffffff))",
285
287
  boxShadow:
286
288
  "var(--persona-intro-card-shadow, 0 5px 15px rgba(15, 23, 42, 0.08))",
287
289
  },
@@ -413,16 +415,18 @@ export const buildPanel = (config?: AgentWidgetConfig, showClose = true): PanelE
413
415
  config?.copy?.welcomeSubtitle ??
414
416
  "Ask anything about your account or products.",
415
417
  });
416
- // Box-shadow flows through the themable `components.introCard.shadow` token
417
- // (--persona-intro-card-shadow). Docked mode keeps a flat look by default;
418
- // floating mode falls back to the legacy `persona-shadow-sm` value when no
419
- // token is set.
418
+ // Background and box-shadow flow through the themable `components.introCard`
419
+ // tokens (--persona-intro-card-bg / --persona-intro-card-shadow), each
420
+ // falling back to its legacy value (`--persona-surface` / `persona-shadow-sm`)
421
+ // when no token is set. Docked mode keeps a flat shadow by default.
420
422
  const introCard = createNode(
421
423
  "div",
422
424
  {
423
- className: "persona-rounded-2xl persona-bg-persona-surface persona-p-6",
425
+ className: "persona-rounded-2xl persona-p-6",
424
426
  attrs: { "data-persona-intro-card": "" },
425
427
  style: {
428
+ background:
429
+ "var(--persona-intro-card-bg, var(--persona-surface, #ffffff))",
426
430
  boxShadow: isDockedMountMode(config)
427
431
  ? "none"
428
432
  : "var(--persona-intro-card-shadow, 0 5px 15px rgba(15, 23, 42, 0.08))",
@@ -1745,6 +1745,9 @@
1745
1745
  /* Make message bubble position relative for overlay positioning */
1746
1746
  .persona-message-bubble {
1747
1747
  position: relative;
1748
+ /* Break long unbreakable tokens (e.g. URLs, package names) so they wrap
1749
+ inside the bubble's max-width instead of overflowing horizontally. */
1750
+ overflow-wrap: break-word;
1748
1751
  }
1749
1752
 
1750
1753
  /* Fade-in animation for action buttons */
package/src/types.ts CHANGED
@@ -1609,6 +1609,12 @@ export type AgentWidgetLauncherConfig = {
1609
1609
  agentIconText?: string;
1610
1610
  agentIconName?: string;
1611
1611
  agentIconHidden?: boolean;
1612
+ /**
1613
+ * Background color for the agent icon circle in the launcher button. Accepts
1614
+ * any CSS color value. When set, overrides the default primary-color
1615
+ * background (the `persona-bg-persona-primary` utility).
1616
+ */
1617
+ agentIconBackgroundColor?: string;
1612
1618
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
1613
1619
  /**
1614
1620
  * Controls how the launcher panel is mounted relative to the host page.