@runtypelabs/persona 3.7.0 → 3.8.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 +40 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -4
- package/dist/index.d.ts +43 -4
- package/dist/index.global.js +59 -59
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +40 -40
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +199 -24
- package/dist/theme-editor.d.cts +43 -4
- package/dist/theme-editor.d.ts +43 -4
- package/dist/theme-editor.js +199 -24
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +34 -0
- package/dist/theme-reference.d.ts +34 -0
- package/dist/widget.css +4 -0
- package/package.json +1 -1
- package/src/components/artifact-card.ts +1 -1
- package/src/components/header-builder.ts +3 -0
- package/src/components/launcher.ts +7 -2
- package/src/components/panel.ts +3 -1
- package/src/runtime/host-layout.test.ts +1 -1
- package/src/runtime/host-layout.ts +2 -1
- package/src/styles/widget.css +4 -0
- package/src/types/theme.ts +35 -0
- package/src/types.ts +9 -4
- package/src/ui.overlay-z-index.test.ts +34 -2
- package/src/ui.ts +88 -8
- package/src/utils/constants.ts +13 -0
- package/src/utils/dropdown.ts +2 -1
- package/src/utils/overlay-host-stacking.test.ts +61 -0
- package/src/utils/overlay-host-stacking.ts +38 -0
- package/src/utils/scroll-lock.test.ts +64 -0
- package/src/utils/scroll-lock.ts +62 -0
- package/src/utils/tokens.ts +63 -0
package/dist/theme-editor.js
CHANGED
|
@@ -299,7 +299,8 @@ var DEFAULT_COMPONENTS = {
|
|
|
299
299
|
borderRadius: "palette.radius.lg",
|
|
300
300
|
border: "palette.colors.gray.200",
|
|
301
301
|
shadow: "palette.shadows.sm"
|
|
302
|
-
}
|
|
302
|
+
},
|
|
303
|
+
border: "semantic.colors.border"
|
|
303
304
|
},
|
|
304
305
|
toolBubble: {
|
|
305
306
|
shadow: "palette.shadows.sm"
|
|
@@ -321,8 +322,30 @@ var DEFAULT_COMPONENTS = {
|
|
|
321
322
|
},
|
|
322
323
|
prose: {
|
|
323
324
|
fontFamily: "inherit"
|
|
325
|
+
},
|
|
326
|
+
codeBlock: {
|
|
327
|
+
background: "semantic.colors.container",
|
|
328
|
+
borderColor: "semantic.colors.border",
|
|
329
|
+
textColor: "inherit"
|
|
330
|
+
},
|
|
331
|
+
table: {
|
|
332
|
+
headerBackground: "semantic.colors.container",
|
|
333
|
+
borderColor: "semantic.colors.border"
|
|
334
|
+
},
|
|
335
|
+
hr: {
|
|
336
|
+
color: "semantic.colors.divider"
|
|
337
|
+
},
|
|
338
|
+
blockquote: {
|
|
339
|
+
borderColor: "palette.colors.gray.900",
|
|
340
|
+
background: "transparent",
|
|
341
|
+
textColor: "palette.colors.gray.500"
|
|
324
342
|
}
|
|
325
343
|
},
|
|
344
|
+
collapsibleWidget: {
|
|
345
|
+
container: "palette.colors.gray.50",
|
|
346
|
+
surface: "semantic.colors.surface",
|
|
347
|
+
border: "semantic.colors.border"
|
|
348
|
+
},
|
|
326
349
|
voice: {
|
|
327
350
|
recording: {
|
|
328
351
|
indicator: "palette.colors.error.500",
|
|
@@ -555,7 +578,7 @@ function createTheme(userConfig, options = {}) {
|
|
|
555
578
|
return theme;
|
|
556
579
|
}
|
|
557
580
|
function themeToCssVariables(theme) {
|
|
558
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa;
|
|
581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb;
|
|
559
582
|
const resolved = resolveTokens(theme);
|
|
560
583
|
const cssVars = {};
|
|
561
584
|
for (const [path, token] of Object.entries(resolved)) {
|
|
@@ -656,6 +679,19 @@ function themeToCssVariables(theme) {
|
|
|
656
679
|
if (mdProseFont && mdProseFont !== "inherit") {
|
|
657
680
|
cssVars["--persona-md-prose-font-family"] = mdProseFont;
|
|
658
681
|
}
|
|
682
|
+
cssVars["--persona-md-code-block-bg"] = (_La = cssVars["--persona-components-markdown-codeBlock-background"]) != null ? _La : cssVars["--persona-container"];
|
|
683
|
+
cssVars["--persona-md-code-block-border-color"] = (_Ma = cssVars["--persona-components-markdown-codeBlock-borderColor"]) != null ? _Ma : cssVars["--persona-border"];
|
|
684
|
+
cssVars["--persona-md-code-block-text-color"] = (_Na = cssVars["--persona-components-markdown-codeBlock-textColor"]) != null ? _Na : "inherit";
|
|
685
|
+
cssVars["--persona-md-table-header-bg"] = (_Oa = cssVars["--persona-components-markdown-table-headerBackground"]) != null ? _Oa : cssVars["--persona-container"];
|
|
686
|
+
cssVars["--persona-md-table-border-color"] = (_Pa = cssVars["--persona-components-markdown-table-borderColor"]) != null ? _Pa : cssVars["--persona-border"];
|
|
687
|
+
cssVars["--persona-md-hr-color"] = (_Qa = cssVars["--persona-components-markdown-hr-color"]) != null ? _Qa : cssVars["--persona-divider"];
|
|
688
|
+
cssVars["--persona-md-blockquote-border-color"] = (_Ra = cssVars["--persona-components-markdown-blockquote-borderColor"]) != null ? _Ra : cssVars["--persona-palette-colors-gray-900"];
|
|
689
|
+
cssVars["--persona-md-blockquote-bg"] = (_Sa = cssVars["--persona-components-markdown-blockquote-background"]) != null ? _Sa : "transparent";
|
|
690
|
+
cssVars["--persona-md-blockquote-text-color"] = (_Ta = cssVars["--persona-components-markdown-blockquote-textColor"]) != null ? _Ta : cssVars["--persona-palette-colors-gray-500"];
|
|
691
|
+
cssVars["--cw-container"] = (_Ua = cssVars["--persona-components-collapsibleWidget-container"]) != null ? _Ua : cssVars["--persona-surface"];
|
|
692
|
+
cssVars["--cw-surface"] = (_Va = cssVars["--persona-components-collapsibleWidget-surface"]) != null ? _Va : cssVars["--persona-surface"];
|
|
693
|
+
cssVars["--cw-border"] = (_Wa = cssVars["--persona-components-collapsibleWidget-border"]) != null ? _Wa : cssVars["--persona-border"];
|
|
694
|
+
cssVars["--persona-message-border"] = (_Xa = cssVars["--persona-components-message-border"]) != null ? _Xa : cssVars["--persona-border"];
|
|
659
695
|
const components = theme.components;
|
|
660
696
|
const iconBtn = components == null ? void 0 : components.iconButton;
|
|
661
697
|
if (iconBtn) {
|
|
@@ -702,23 +738,23 @@ function themeToCssVariables(theme) {
|
|
|
702
738
|
if (t.copyPadding) cssVars["--persona-artifact-toolbar-copy-padding"] = t.copyPadding;
|
|
703
739
|
if (t.copyMenuBackground) {
|
|
704
740
|
cssVars["--persona-artifact-toolbar-copy-menu-bg"] = t.copyMenuBackground;
|
|
705
|
-
cssVars["--persona-dropdown-bg"] = (
|
|
741
|
+
cssVars["--persona-dropdown-bg"] = (_Ya = cssVars["--persona-dropdown-bg"]) != null ? _Ya : t.copyMenuBackground;
|
|
706
742
|
}
|
|
707
743
|
if (t.copyMenuBorder) {
|
|
708
744
|
cssVars["--persona-artifact-toolbar-copy-menu-border"] = t.copyMenuBorder;
|
|
709
|
-
cssVars["--persona-dropdown-border"] = (
|
|
745
|
+
cssVars["--persona-dropdown-border"] = (_Za = cssVars["--persona-dropdown-border"]) != null ? _Za : t.copyMenuBorder;
|
|
710
746
|
}
|
|
711
747
|
if (t.copyMenuShadow) {
|
|
712
748
|
cssVars["--persona-artifact-toolbar-copy-menu-shadow"] = t.copyMenuShadow;
|
|
713
|
-
cssVars["--persona-dropdown-shadow"] = (
|
|
749
|
+
cssVars["--persona-dropdown-shadow"] = (__a = cssVars["--persona-dropdown-shadow"]) != null ? __a : t.copyMenuShadow;
|
|
714
750
|
}
|
|
715
751
|
if (t.copyMenuBorderRadius) {
|
|
716
752
|
cssVars["--persona-artifact-toolbar-copy-menu-radius"] = t.copyMenuBorderRadius;
|
|
717
|
-
cssVars["--persona-dropdown-radius"] = (
|
|
753
|
+
cssVars["--persona-dropdown-radius"] = (_$a = cssVars["--persona-dropdown-radius"]) != null ? _$a : t.copyMenuBorderRadius;
|
|
718
754
|
}
|
|
719
755
|
if (t.copyMenuItemHoverBackground) {
|
|
720
756
|
cssVars["--persona-artifact-toolbar-copy-menu-item-hover-bg"] = t.copyMenuItemHoverBackground;
|
|
721
|
-
cssVars["--persona-dropdown-item-hover-bg"] = (
|
|
757
|
+
cssVars["--persona-dropdown-item-hover-bg"] = (_ab = cssVars["--persona-dropdown-item-hover-bg"]) != null ? _ab : t.copyMenuItemHoverBackground;
|
|
722
758
|
}
|
|
723
759
|
if (t.iconBackground) cssVars["--persona-artifact-toolbar-icon-bg"] = t.iconBackground;
|
|
724
760
|
if (t.toolbarBorder) cssVars["--persona-artifact-toolbar-border"] = t.toolbarBorder;
|
|
@@ -738,7 +774,7 @@ function themeToCssVariables(theme) {
|
|
|
738
774
|
if (artifact == null ? void 0 : artifact.pane) {
|
|
739
775
|
const t = artifact.pane;
|
|
740
776
|
if (t.toolbarBackground) {
|
|
741
|
-
const toolbarBg = (
|
|
777
|
+
const toolbarBg = (_bb = resolveTokenValue(theme, t.toolbarBackground)) != null ? _bb : t.toolbarBackground;
|
|
742
778
|
cssVars["--persona-artifact-toolbar-bg"] = toolbarBg;
|
|
743
779
|
}
|
|
744
780
|
}
|
|
@@ -7694,6 +7730,70 @@ var statusCopy = {
|
|
|
7694
7730
|
connected: "Streaming\u2026",
|
|
7695
7731
|
error: "Offline"
|
|
7696
7732
|
};
|
|
7733
|
+
var DEFAULT_OVERLAY_Z_INDEX = 1e5;
|
|
7734
|
+
var PORTALED_OVERLAY_Z_INDEX = DEFAULT_OVERLAY_Z_INDEX + 1;
|
|
7735
|
+
|
|
7736
|
+
// src/utils/overlay-host-stacking.ts
|
|
7737
|
+
function syncOverlayHostStacking(host, zIndex = DEFAULT_OVERLAY_Z_INDEX) {
|
|
7738
|
+
const originalPosition = host.style.position;
|
|
7739
|
+
const originalZIndex = host.style.zIndex;
|
|
7740
|
+
const originalIsolation = host.style.isolation;
|
|
7741
|
+
const computed = getComputedStyle(host);
|
|
7742
|
+
const positionWasSet = computed.position === "static" || computed.position === "";
|
|
7743
|
+
if (positionWasSet) {
|
|
7744
|
+
host.style.position = "relative";
|
|
7745
|
+
}
|
|
7746
|
+
host.style.zIndex = String(zIndex);
|
|
7747
|
+
host.style.isolation = "isolate";
|
|
7748
|
+
return () => {
|
|
7749
|
+
if (positionWasSet) {
|
|
7750
|
+
host.style.position = originalPosition;
|
|
7751
|
+
}
|
|
7752
|
+
host.style.zIndex = originalZIndex;
|
|
7753
|
+
host.style.isolation = originalIsolation;
|
|
7754
|
+
};
|
|
7755
|
+
}
|
|
7756
|
+
|
|
7757
|
+
// src/utils/scroll-lock.ts
|
|
7758
|
+
var lockCount = 0;
|
|
7759
|
+
var savedState = null;
|
|
7760
|
+
function acquireScrollLock(doc = document) {
|
|
7761
|
+
var _a;
|
|
7762
|
+
lockCount++;
|
|
7763
|
+
if (lockCount === 1) {
|
|
7764
|
+
const body = doc.body;
|
|
7765
|
+
const win = (_a = doc.defaultView) != null ? _a : window;
|
|
7766
|
+
const scrollY = win.scrollY || doc.documentElement.scrollTop;
|
|
7767
|
+
savedState = {
|
|
7768
|
+
originalOverflow: body.style.overflow,
|
|
7769
|
+
originalPosition: body.style.position,
|
|
7770
|
+
originalTop: body.style.top,
|
|
7771
|
+
originalWidth: body.style.width,
|
|
7772
|
+
scrollY
|
|
7773
|
+
};
|
|
7774
|
+
body.style.overflow = "hidden";
|
|
7775
|
+
body.style.position = "fixed";
|
|
7776
|
+
body.style.top = `-${scrollY}px`;
|
|
7777
|
+
body.style.width = "100%";
|
|
7778
|
+
}
|
|
7779
|
+
let released = false;
|
|
7780
|
+
return () => {
|
|
7781
|
+
var _a2;
|
|
7782
|
+
if (released) return;
|
|
7783
|
+
released = true;
|
|
7784
|
+
lockCount = Math.max(0, lockCount - 1);
|
|
7785
|
+
if (lockCount === 0 && savedState) {
|
|
7786
|
+
const body = doc.body;
|
|
7787
|
+
const win = (_a2 = doc.defaultView) != null ? _a2 : window;
|
|
7788
|
+
body.style.overflow = savedState.originalOverflow;
|
|
7789
|
+
body.style.position = savedState.originalPosition;
|
|
7790
|
+
body.style.top = savedState.originalTop;
|
|
7791
|
+
body.style.width = savedState.originalWidth;
|
|
7792
|
+
win.scrollTo(0, savedState.scrollY);
|
|
7793
|
+
savedState = null;
|
|
7794
|
+
}
|
|
7795
|
+
};
|
|
7796
|
+
}
|
|
7697
7797
|
|
|
7698
7798
|
// src/utils/dock.ts
|
|
7699
7799
|
var DEFAULT_DOCK_CONFIG = {
|
|
@@ -7740,7 +7840,7 @@ var createLauncherButton = (config, onToggle) => {
|
|
|
7740
7840
|
`;
|
|
7741
7841
|
button.addEventListener("click", onToggle);
|
|
7742
7842
|
const update = (newConfig) => {
|
|
7743
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
7843
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
7744
7844
|
const launcher = (_a = newConfig.launcher) != null ? _a : {};
|
|
7745
7845
|
const dockedMode = isDockedMountMode(newConfig);
|
|
7746
7846
|
const titleEl = button.querySelector("[data-role='launcher-title']");
|
|
@@ -7851,13 +7951,16 @@ var createLauncherButton = (config, onToggle) => {
|
|
|
7851
7951
|
}
|
|
7852
7952
|
}
|
|
7853
7953
|
const positionClass = launcher.position && positionMap[launcher.position] ? positionMap[launcher.position] : positionMap["bottom-right"];
|
|
7854
|
-
const floatingBase = "persona-fixed persona-flex persona-items-center persona-gap-3 persona-rounded-launcher persona-bg-persona-surface persona-py-2.5 persona-pl-3 persona-pr-3 persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer
|
|
7954
|
+
const floatingBase = "persona-fixed persona-flex persona-items-center persona-gap-3 persona-rounded-launcher persona-bg-persona-surface persona-py-2.5 persona-pl-3 persona-pr-3 persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer";
|
|
7855
7955
|
const dockedBase = "persona-relative persona-mt-4 persona-mb-4 persona-mx-auto persona-flex persona-items-center persona-justify-center persona-rounded-launcher persona-bg-persona-surface persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer";
|
|
7856
7956
|
button.className = dockedMode ? dockedBase : `${floatingBase} ${positionClass}`;
|
|
7957
|
+
if (!dockedMode) {
|
|
7958
|
+
button.style.zIndex = String((_k = launcher.zIndex) != null ? _k : DEFAULT_OVERLAY_Z_INDEX);
|
|
7959
|
+
}
|
|
7857
7960
|
const defaultBorder = "1px solid var(--persona-border, #e5e7eb)";
|
|
7858
7961
|
const defaultShadow = "var(--persona-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1))";
|
|
7859
|
-
button.style.border = (
|
|
7860
|
-
button.style.boxShadow = (
|
|
7962
|
+
button.style.border = (_l = launcher.border) != null ? _l : defaultBorder;
|
|
7963
|
+
button.style.boxShadow = (_m = launcher.shadow) != null ? _m : defaultShadow;
|
|
7861
7964
|
if (dockedMode) {
|
|
7862
7965
|
button.style.width = "0";
|
|
7863
7966
|
button.style.minWidth = "0";
|
|
@@ -7869,7 +7972,7 @@ var createLauncherButton = (config, onToggle) => {
|
|
|
7869
7972
|
} else {
|
|
7870
7973
|
button.style.width = "";
|
|
7871
7974
|
button.style.minWidth = "";
|
|
7872
|
-
button.style.maxWidth = (
|
|
7975
|
+
button.style.maxWidth = (_n = launcher.collapsedMaxWidth) != null ? _n : "";
|
|
7873
7976
|
button.style.justifyContent = "";
|
|
7874
7977
|
button.style.padding = "";
|
|
7875
7978
|
button.style.overflow = "";
|
|
@@ -8039,6 +8142,7 @@ var buildHeader = (context) => {
|
|
|
8039
8142
|
portaledTooltip.appendChild(arrow);
|
|
8040
8143
|
const buttonRect = clearChatButton.getBoundingClientRect();
|
|
8041
8144
|
portaledTooltip.style.position = "fixed";
|
|
8145
|
+
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
8042
8146
|
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
8043
8147
|
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
8044
8148
|
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
@@ -8150,6 +8254,7 @@ var buildHeader = (context) => {
|
|
|
8150
8254
|
portaledTooltip.appendChild(arrow);
|
|
8151
8255
|
const buttonRect = closeButton.getBoundingClientRect();
|
|
8152
8256
|
portaledTooltip.style.position = "fixed";
|
|
8257
|
+
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
8153
8258
|
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
8154
8259
|
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
8155
8260
|
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
@@ -8211,7 +8316,7 @@ function createDropdownMenu(options) {
|
|
|
8211
8316
|
menu.setAttribute("data-persona-theme-zone", "dropdown");
|
|
8212
8317
|
if (portal) {
|
|
8213
8318
|
menu.style.position = "fixed";
|
|
8214
|
-
menu.style.zIndex =
|
|
8319
|
+
menu.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
8215
8320
|
} else {
|
|
8216
8321
|
menu.style.position = "absolute";
|
|
8217
8322
|
menu.style.top = "100%";
|
|
@@ -9054,7 +9159,7 @@ var buildComposer = (context) => {
|
|
|
9054
9159
|
|
|
9055
9160
|
// src/components/panel.ts
|
|
9056
9161
|
var createWrapper = (config) => {
|
|
9057
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
9162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9058
9163
|
const launcherEnabled = (_b = (_a = config == null ? void 0 : config.launcher) == null ? void 0 : _a.enabled) != null ? _b : true;
|
|
9059
9164
|
const dockedMode = isDockedMountMode(config);
|
|
9060
9165
|
if (dockedMode) {
|
|
@@ -9088,13 +9193,14 @@ var createWrapper = (config) => {
|
|
|
9088
9193
|
const position = launcher.position && positionMap[launcher.position] ? positionMap[launcher.position] : positionMap["bottom-right"];
|
|
9089
9194
|
const wrapper = createElement(
|
|
9090
9195
|
"div",
|
|
9091
|
-
`persona-widget-wrapper persona-fixed ${position} persona-
|
|
9196
|
+
`persona-widget-wrapper persona-fixed ${position} persona-transition`
|
|
9092
9197
|
);
|
|
9198
|
+
wrapper.style.zIndex = String((_g = (_f = config == null ? void 0 : config.launcher) == null ? void 0 : _f.zIndex) != null ? _g : DEFAULT_OVERLAY_Z_INDEX);
|
|
9093
9199
|
const panel = createElement(
|
|
9094
9200
|
"div",
|
|
9095
9201
|
"persona-widget-panel persona-relative persona-min-h-[320px]"
|
|
9096
9202
|
);
|
|
9097
|
-
const launcherWidth = (
|
|
9203
|
+
const launcherWidth = (_i = (_h = config == null ? void 0 : config.launcher) == null ? void 0 : _h.width) != null ? _i : config == null ? void 0 : config.launcherWidth;
|
|
9098
9204
|
const width = launcherWidth != null ? launcherWidth : "min(400px, calc(100vw - 24px))";
|
|
9099
9205
|
panel.style.width = width;
|
|
9100
9206
|
panel.style.maxWidth = width;
|
|
@@ -11316,7 +11422,7 @@ function renderDefaultArtifactCard(props, _context) {
|
|
|
11316
11422
|
const root = document.createElement("div");
|
|
11317
11423
|
root.className = "persona-flex persona-w-full persona-max-w-full persona-items-center persona-gap-3 persona-rounded-xl persona-px-4 persona-py-3";
|
|
11318
11424
|
root.style.border = "1px solid var(--persona-border, #e5e7eb)";
|
|
11319
|
-
root.style.backgroundColor = "var(--persona-
|
|
11425
|
+
root.style.backgroundColor = "var(--persona-surface, #ffffff)";
|
|
11320
11426
|
root.style.cursor = "pointer";
|
|
11321
11427
|
root.tabIndex = 0;
|
|
11322
11428
|
root.setAttribute("role", "button");
|
|
@@ -13597,6 +13703,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13597
13703
|
if (openPrevented === true) return;
|
|
13598
13704
|
event.preventDefault();
|
|
13599
13705
|
event.stopPropagation();
|
|
13706
|
+
artifactsPaneUserHidden = false;
|
|
13600
13707
|
session.selectArtifact(artifactId);
|
|
13601
13708
|
syncArtifactPane();
|
|
13602
13709
|
});
|
|
@@ -13814,7 +13921,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13814
13921
|
}
|
|
13815
13922
|
mount.appendChild(wrapper);
|
|
13816
13923
|
const applyFullHeightStyles = () => {
|
|
13817
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2;
|
|
13924
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
|
|
13818
13925
|
const dockedMode = isDockedMountMode(config);
|
|
13819
13926
|
const sidebarMode = (_b2 = (_a2 = config.launcher) == null ? void 0 : _a2.sidebarMode) != null ? _b2 : false;
|
|
13820
13927
|
const fullHeight = dockedMode || sidebarMode || ((_d2 = (_c2 = config.launcher) == null ? void 0 : _c2.fullHeight) != null ? _d2 : false);
|
|
@@ -13833,7 +13940,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13833
13940
|
const shouldGoFullscreen = mobileFullscreen && isMobileViewport && launcherEnabled;
|
|
13834
13941
|
const position = (_n2 = (_m2 = config.launcher) == null ? void 0 : _m2.position) != null ? _n2 : "bottom-left";
|
|
13835
13942
|
const isLeftSidebar = position === "bottom-left" || position === "top-left";
|
|
13836
|
-
const overlayZIndex = (_p2 = (_o2 = config.launcher) == null ? void 0 : _o2.zIndex) != null ? _p2 :
|
|
13943
|
+
const overlayZIndex = (_p2 = (_o2 = config.launcher) == null ? void 0 : _o2.zIndex) != null ? _p2 : DEFAULT_OVERLAY_Z_INDEX;
|
|
13837
13944
|
let defaultPanelBorder = sidebarMode || shouldGoFullscreen ? "none" : "1px solid var(--persona-border)";
|
|
13838
13945
|
let defaultPanelShadow = shouldGoFullscreen ? "none" : sidebarMode ? isLeftSidebar ? "var(--persona-palette-shadows-sidebar-left, 2px 0 12px rgba(0, 0, 0, 0.08))" : "var(--persona-palette-shadows-sidebar-right, -2px 0 12px rgba(0, 0, 0, 0.08))" : "var(--persona-palette-shadows-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25))";
|
|
13839
13946
|
if (dockedMode && !shouldGoFullscreen) {
|
|
@@ -14044,7 +14151,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14044
14151
|
if (!isInlineEmbed && !dockedMode) {
|
|
14045
14152
|
const maxHeightStyles = "max-height: -moz-available !important; max-height: stretch !important;";
|
|
14046
14153
|
const paddingStyles = sidebarMode ? "" : "padding-top: 1.25em !important;";
|
|
14047
|
-
const zIndexStyles = !sidebarMode
|
|
14154
|
+
const zIndexStyles = !sidebarMode ? `z-index: ${(_w2 = (_v2 = config.launcher) == null ? void 0 : _v2.zIndex) != null ? _w2 : DEFAULT_OVERLAY_Z_INDEX} !important;` : "";
|
|
14048
14155
|
wrapper.style.cssText += maxHeightStyles + paddingStyles + zIndexStyles;
|
|
14049
14156
|
}
|
|
14050
14157
|
};
|
|
@@ -14053,6 +14160,14 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14053
14160
|
applyArtifactLayoutCssVars(mount, config);
|
|
14054
14161
|
applyArtifactPaneAppearance(mount, config);
|
|
14055
14162
|
const destroyCallbacks = [];
|
|
14163
|
+
let teardownHostStacking = null;
|
|
14164
|
+
let releaseScrollLock = null;
|
|
14165
|
+
destroyCallbacks.push(() => {
|
|
14166
|
+
teardownHostStacking == null ? void 0 : teardownHostStacking();
|
|
14167
|
+
teardownHostStacking = null;
|
|
14168
|
+
releaseScrollLock == null ? void 0 : releaseScrollLock();
|
|
14169
|
+
releaseScrollLock = null;
|
|
14170
|
+
});
|
|
14056
14171
|
if (artifactPanelResizeObs) {
|
|
14057
14172
|
destroyCallbacks.push(() => {
|
|
14058
14173
|
artifactPanelResizeObs == null ? void 0 : artifactPanelResizeObs.disconnect();
|
|
@@ -14218,7 +14333,8 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14218
14333
|
container.appendChild(scrollToBottomButton);
|
|
14219
14334
|
}
|
|
14220
14335
|
updateScrollToBottomButtonOffset();
|
|
14221
|
-
|
|
14336
|
+
const hasOverflow = getScrollBottomOffset(body) > 0;
|
|
14337
|
+
scrollToBottomButton.style.display = autoFollow.isFollowing() || !hasOverflow ? "none" : "";
|
|
14222
14338
|
};
|
|
14223
14339
|
const pauseAutoScroll = () => {
|
|
14224
14340
|
if (!autoFollow.pause()) return;
|
|
@@ -14665,11 +14781,42 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14665
14781
|
}
|
|
14666
14782
|
};
|
|
14667
14783
|
const setOpenState = (nextOpen, source = "user") => {
|
|
14784
|
+
var _a2, _b2;
|
|
14668
14785
|
if (!launcherEnabled) return;
|
|
14669
14786
|
if (open === nextOpen) return;
|
|
14670
14787
|
const prevOpen = open;
|
|
14671
14788
|
open = nextOpen;
|
|
14672
14789
|
updateOpenState();
|
|
14790
|
+
const isViewportCovering = (() => {
|
|
14791
|
+
var _a3, _b3, _c2, _d2, _e2, _f2, _g2;
|
|
14792
|
+
const sm = (_b3 = (_a3 = config.launcher) == null ? void 0 : _a3.sidebarMode) != null ? _b3 : false;
|
|
14793
|
+
const ow = (_c2 = mount.ownerDocument.defaultView) != null ? _c2 : window;
|
|
14794
|
+
const mf = (_e2 = (_d2 = config.launcher) == null ? void 0 : _d2.mobileFullscreen) != null ? _e2 : true;
|
|
14795
|
+
const mb = (_g2 = (_f2 = config.launcher) == null ? void 0 : _f2.mobileBreakpoint) != null ? _g2 : 640;
|
|
14796
|
+
const isMobile = ow.innerWidth <= mb;
|
|
14797
|
+
const dockedMF = isDockedMountMode(config) && mf && isMobile;
|
|
14798
|
+
return sm || mf && isMobile && launcherEnabled || dockedMF;
|
|
14799
|
+
})();
|
|
14800
|
+
if (open && isViewportCovering) {
|
|
14801
|
+
if (!teardownHostStacking) {
|
|
14802
|
+
const root = mount.getRootNode();
|
|
14803
|
+
const hostEl = root instanceof ShadowRoot ? root.host : mount.closest(".persona-host");
|
|
14804
|
+
if (hostEl) {
|
|
14805
|
+
teardownHostStacking = syncOverlayHostStacking(
|
|
14806
|
+
hostEl,
|
|
14807
|
+
(_b2 = (_a2 = config.launcher) == null ? void 0 : _a2.zIndex) != null ? _b2 : DEFAULT_OVERLAY_Z_INDEX
|
|
14808
|
+
);
|
|
14809
|
+
}
|
|
14810
|
+
}
|
|
14811
|
+
if (!releaseScrollLock) {
|
|
14812
|
+
releaseScrollLock = acquireScrollLock(mount.ownerDocument);
|
|
14813
|
+
}
|
|
14814
|
+
} else if (!open) {
|
|
14815
|
+
teardownHostStacking == null ? void 0 : teardownHostStacking();
|
|
14816
|
+
teardownHostStacking = null;
|
|
14817
|
+
releaseScrollLock == null ? void 0 : releaseScrollLock();
|
|
14818
|
+
releaseScrollLock = null;
|
|
14819
|
+
}
|
|
14673
14820
|
if (open) {
|
|
14674
14821
|
recalcPanelHeight();
|
|
14675
14822
|
scheduleAutoScroll(true);
|
|
@@ -15361,7 +15508,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
15361
15508
|
}
|
|
15362
15509
|
}
|
|
15363
15510
|
const recalcPanelHeight = () => {
|
|
15364
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
|
|
15511
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2;
|
|
15365
15512
|
const dockedMode = isDockedMountMode(config);
|
|
15366
15513
|
const sidebarMode = (_b2 = (_a2 = config.launcher) == null ? void 0 : _a2.sidebarMode) != null ? _b2 : false;
|
|
15367
15514
|
const fullHeight = dockedMode || sidebarMode || ((_d2 = (_c2 = config.launcher) == null ? void 0 : _c2.fullHeight) != null ? _d2 : false);
|
|
@@ -15405,6 +15552,30 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
15405
15552
|
} finally {
|
|
15406
15553
|
updateScrollToBottomButtonOffset();
|
|
15407
15554
|
updateOpenState();
|
|
15555
|
+
if (open && launcherEnabled) {
|
|
15556
|
+
const ow = (_n2 = mount.ownerDocument.defaultView) != null ? _n2 : window;
|
|
15557
|
+
const isMobile = ow.innerWidth <= ((_p2 = (_o2 = config.launcher) == null ? void 0 : _o2.mobileBreakpoint) != null ? _p2 : 640);
|
|
15558
|
+
const sm = (_r2 = (_q2 = config.launcher) == null ? void 0 : _q2.sidebarMode) != null ? _r2 : false;
|
|
15559
|
+
const mf = (_t2 = (_s2 = config.launcher) == null ? void 0 : _s2.mobileFullscreen) != null ? _t2 : true;
|
|
15560
|
+
const dockedMF = isDockedMountMode(config) && mf && isMobile;
|
|
15561
|
+
const isVC = sm || mf && isMobile && launcherEnabled || dockedMF;
|
|
15562
|
+
if (isVC && !releaseScrollLock) {
|
|
15563
|
+
const root = mount.getRootNode();
|
|
15564
|
+
const hostEl = root instanceof ShadowRoot ? root.host : mount.closest(".persona-host");
|
|
15565
|
+
if (hostEl && !teardownHostStacking) {
|
|
15566
|
+
teardownHostStacking = syncOverlayHostStacking(
|
|
15567
|
+
hostEl,
|
|
15568
|
+
(_v2 = (_u2 = config.launcher) == null ? void 0 : _u2.zIndex) != null ? _v2 : DEFAULT_OVERLAY_Z_INDEX
|
|
15569
|
+
);
|
|
15570
|
+
}
|
|
15571
|
+
releaseScrollLock = acquireScrollLock(mount.ownerDocument);
|
|
15572
|
+
} else if (!isVC) {
|
|
15573
|
+
teardownHostStacking == null ? void 0 : teardownHostStacking();
|
|
15574
|
+
teardownHostStacking = null;
|
|
15575
|
+
releaseScrollLock == null ? void 0 : releaseScrollLock();
|
|
15576
|
+
releaseScrollLock = null;
|
|
15577
|
+
}
|
|
15578
|
+
}
|
|
15408
15579
|
}
|
|
15409
15580
|
};
|
|
15410
15581
|
recalcPanelHeight();
|
|
@@ -15491,6 +15662,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
15491
15662
|
clearChatButton.addEventListener("click", () => {
|
|
15492
15663
|
session.clearMessages();
|
|
15493
15664
|
messageCache.clear();
|
|
15665
|
+
resumeAutoScroll();
|
|
15494
15666
|
try {
|
|
15495
15667
|
localStorage.removeItem(DEFAULT_CHAT_HISTORY_STORAGE_KEY);
|
|
15496
15668
|
if (config.debug) {
|
|
@@ -15939,6 +16111,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
15939
16111
|
portaledTooltip.appendChild(arrow);
|
|
15940
16112
|
const buttonRect = closeButton.getBoundingClientRect();
|
|
15941
16113
|
portaledTooltip.style.position = "fixed";
|
|
16114
|
+
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
15942
16115
|
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
15943
16116
|
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
15944
16117
|
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
@@ -16090,6 +16263,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16090
16263
|
portaledTooltip.appendChild(arrow);
|
|
16091
16264
|
const buttonRect = clearChatButton.getBoundingClientRect();
|
|
16092
16265
|
portaledTooltip.style.position = "fixed";
|
|
16266
|
+
portaledTooltip.style.zIndex = String(PORTALED_OVERLAY_Z_INDEX);
|
|
16093
16267
|
portaledTooltip.style.left = `${buttonRect.left + buttonRect.width / 2}px`;
|
|
16094
16268
|
portaledTooltip.style.top = `${buttonRect.top - 8}px`;
|
|
16095
16269
|
portaledTooltip.style.transform = "translate(-50%, -100%)";
|
|
@@ -16496,6 +16670,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16496
16670
|
artifactsPaneUserHidden = false;
|
|
16497
16671
|
session.clearMessages();
|
|
16498
16672
|
messageCache.clear();
|
|
16673
|
+
resumeAutoScroll();
|
|
16499
16674
|
try {
|
|
16500
16675
|
localStorage.removeItem(DEFAULT_CHAT_HISTORY_STORAGE_KEY);
|
|
16501
16676
|
if (config.debug) {
|
|
@@ -17119,7 +17294,7 @@ var applyDockStyles = (shell, pushTrack, contentSlot, dockSlot, host, config, ex
|
|
|
17119
17294
|
dockSlot.style.minWidth = "0";
|
|
17120
17295
|
dockSlot.style.minHeight = "0";
|
|
17121
17296
|
dockSlot.style.overflow = "hidden";
|
|
17122
|
-
dockSlot.style.zIndex = String((_f = (_e = config == null ? void 0 : config.launcher) == null ? void 0 : _e.zIndex) != null ? _f :
|
|
17297
|
+
dockSlot.style.zIndex = String((_f = (_e = config == null ? void 0 : config.launcher) == null ? void 0 : _e.zIndex) != null ? _f : DEFAULT_OVERLAY_Z_INDEX);
|
|
17123
17298
|
dockSlot.style.transform = "none";
|
|
17124
17299
|
dockSlot.style.transition = "none";
|
|
17125
17300
|
dockSlot.style.pointerEvents = "auto";
|
package/dist/theme-reference.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var m=(o,e)=>{for(var a in e)t(o,a,{get:e[a],enumerable:!0})},g=(o,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!d.call(o,r)&&r!==a&&t(o,r,{get:()=>e[r],enumerable:!(s=c(e,r))||s.enumerable});return o};var u=o=>g(t({},"__esModule",{value:!0}),o);var h={};m(h,{THEME_EXAMPLES:()=>p,THEME_TOKEN_DOCS:()=>i,getThemeReference:()=>b});module.exports=u(h);var n={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"}},spacing:{0:"0px",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}};var i={overview:"Persona uses a three-layer design token system: palette \u2192 semantic \u2192 components. Most themes only need palette.colors overrides \u2014 semantic and component layers auto-derive from palette values. Config also accepts non-theme appearance options (launcher, sendButton, toolCall, etc.).",layers:{palette:{description:"Primitive design tokens. Override specific shades to change the entire widget feel.",colors:{description:"7 color scales, each with shades 50 (lightest) to 950 (darkest). Override only the shades you need.",scales:{gray:"Neutrals \u2014 backgrounds, text, borders. Key shades: 50 (lightest bg), 100 (secondary bg), 200 (borders), 500 (muted text), 900 (primary text).",primary:"Brand color \u2014 buttons, links, interactive elements. Key shades: 500 (default), 600 (hover).",accent:"Secondary highlight. Key shades: 500 (default), 600 (hover).",secondary:"Tertiary color scale.",success:"Positive feedback (default: green).",warning:"Caution feedback (default: yellow).",error:"Error/danger feedback (default: red)."}},radius:{description:"Border radius scale. Add custom keys like launcher, button.",defaults:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},typography:{fontFamily:"Three stacks: sans (system-ui), serif (Georgia), mono (ui-monospace). Override individual stack values.",fontSize:"Scale: xs (0.75rem), sm (0.875rem), base (1rem), lg (1.125rem), xl (1.25rem), 2xl (1.5rem), 3xl (1.875rem), 4xl (2.25rem).",fontWeight:"normal (400), medium (500), semibold (600), bold (700).",lineHeight:"tight (1.25), normal (1.5), relaxed (1.625)."},shadows:"Scale: none, sm, md, lg, xl, 2xl. Values are CSS box-shadow strings.",borders:"Scale: none, sm (1px solid), md (2px solid), lg (4px solid).",spacing:"Scale: 0 (0px), 1 (0.25rem), 2 (0.5rem), 3 (0.75rem), 4 (1rem), 5 (1.25rem), 6 (1.5rem), 8 (2rem), 10 (2.5rem), 12 (3rem), 16-64."},semantic:{description:'Design intent tokens. Auto-derived from palette by default. Override to redirect token resolution. Values are token reference strings like "palette.colors.primary.500".',colors:{primary:"palette.colors.primary.500 \u2014 Primary brand color.",secondary:"palette.colors.gray.500 \u2014 Secondary color.",accent:"palette.colors.primary.600 \u2014 Accent/interactive color.",surface:"palette.colors.gray.50 \u2014 Panel/card backgrounds.",background:"palette.colors.gray.50 \u2014 Page background.",container:"palette.colors.gray.100 \u2014 Container backgrounds.",text:"palette.colors.gray.900 \u2014 Primary text.",textMuted:"palette.colors.gray.500 \u2014 Muted/secondary text.",textInverse:"palette.colors.gray.50 \u2014 Text on dark backgrounds.",border:"palette.colors.gray.200 \u2014 Default border color.",divider:"palette.colors.gray.200 \u2014 Divider lines.",interactive:{default:"palette.colors.primary.500",hover:"palette.colors.primary.600",focus:"palette.colors.primary.700",active:"palette.colors.primary.800",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.primary.500"}},spacing:"xs (0.25rem), sm (0.5rem), md (1rem), lg (1.5rem), xl (2rem), 2xl (2.5rem).",typography:"fontFamily, fontSize, fontWeight, lineHeight \u2014 reference palette typography tokens."},components:{description:"UI element tokens. Rarely needed for basic theming. Override for fine-grained control. All values are token references or raw CSS strings.",button:{description:"Three variants: primary, secondary, ghost.",properties:"background, foreground, borderRadius, padding."},input:{description:"Message input field.",properties:"background, placeholder, borderRadius, padding, focus.border, focus.ring."},launcher:{description:"Floating launcher button.",properties:"size (60px), iconSize (28px), borderRadius, shadow."},panel:{description:"Chat panel container.",properties:"width, maxWidth (400px), height (600px), maxHeight, borderRadius, shadow."},header:{description:"Chat panel header.",properties:"background, border, borderRadius, padding, iconBackground, iconForeground, titleForeground, subtitleForeground, actionIconForeground, shadow, borderBottom."},message:{description:"Chat message bubbles.",user:"background, text, borderRadius, shadow.",assistant:"background, text, borderRadius, border (optional), shadow (optional)."},markdown:{description:"Markdown rendering in messages and artifact pane.",properties:"inlineCode (background, foreground), link.foreground, prose.fontFamily, heading.h1/h2 (fontSize, fontWeight)."},voice:"recording (indicator, background, border), processing (icon, background), speaking (icon).",approval:"requested (background, border, text), approve (background, foreground), deny (background, foreground).",attachment:"image (background, border).",scrollToBottom:"Floating scroll-to-bottom affordance shared by transcript and event stream: background, foreground, border, size, borderRadius, shadow, padding, gap, fontSize, iconSize.",toolBubble:"shadow \u2014 tool call row box-shadow.",reasoningBubble:"shadow \u2014 reasoning/thinking row box-shadow.",composer:"shadow \u2014 message input form box-shadow.",artifact:"toolbar (icon styling, copy menu), tab (background, active states), pane (background, toolbarBackground)."}},colorScheme:'"dark" merges darkTheme overrides on top of theme. "auto" detects system preference or <html class="dark">. "light" is default. colorScheme does NOT auto-invert colors \u2014 provide dark palette and semantic overrides yourself.',plugins:{description:"Plugins transform theme tokens before resolution. Use with createTheme().",available:{brandPlugin:'Auto-generates full color scales from a single brand hex: brandPlugin({ colors: { primary: "#7c3aed" } }).',accessibilityPlugin:"Enhanced focus indicators and disabled states.",highContrastPlugin:"Increased contrast for visual accessibility.",reducedMotionPlugin:"Disables all animations (sets transitions to 0ms).",animationsPlugin:"Adds transition and easing tokens."},usage:'createTheme(themeOverrides, { plugins: [brandPlugin({ colors: { primary: "#7c3aed" } })] })'},widgetConfig:{description:'Non-theme config options on the widget config object that affect appearance. These are siblings of "theme" in the config, not nested inside it.',launcher:{description:"Floating launcher button and panel positioning.",properties:{enabled:"Show/hide the launcher button.",title:"Header title text.",subtitle:"Header subtitle text.",position:'"bottom-right" | "bottom-left" | "top-right" | "top-left".',width:"Chat panel width (CSS value).",fullHeight:"Fill full height of container.",mountMode:'"floating" | "docked".',agentIconText:"Emoji/text for agent icon.",border:"Border style for launcher button.",shadow:"Box shadow for launcher button.",collapsedMaxWidth:"Max-width for launcher pill when panel closed."}},sendButton:{description:"Send button appearance.",properties:"backgroundColor, textColor, borderWidth, borderColor, paddingX, paddingY, iconText, iconName, size."},closeButton:{description:"Close button (on launcher config).",properties:"closeButtonSize, closeButtonColor, closeButtonBackgroundColor, closeButtonBorderWidth, closeButtonBorderColor, closeButtonBorderRadius."},clearChat:{description:"Clear chat button (on launcher.clearChat config).",properties:"enabled, iconColor, backgroundColor, borderWidth, borderColor, borderRadius, size."},scrollToBottom:{description:"Shared transcript + event-stream jump-to-latest affordance.",properties:'features.scrollToBottom.enabled, features.scrollToBottom.iconName, features.scrollToBottom.label (empty string renders icon-only). Defaults: enabled=true, iconName="arrow-down", label="".'},toolCall:{description:"Tool call display styling.",properties:"shadow, backgroundColor, borderColor, borderWidth, borderRadius, headerBackgroundColor, headerTextColor, headerPaddingX, headerPaddingY, contentBackgroundColor, contentTextColor, contentPaddingX, contentPaddingY, codeBlockBackgroundColor, codeBlockBorderColor, codeBlockTextColor, toggleTextColor, labelTextColor."},approval:{description:"Tool approval bubble styling and behavior. Set to false to disable.",properties:"backgroundColor, borderColor, titleColor, descriptionColor, approveButtonColor, approveButtonTextColor, denyButtonColor, denyButtonTextColor, parameterBackgroundColor, parameterTextColor, title, approveLabel, denyLabel."},copy:{description:"Widget text content.",properties:"showWelcomeCard (boolean), welcomeTitle, welcomeSubtitle, inputPlaceholder, sendButtonLabel."},voiceRecognition:{description:"Voice input configuration.",properties:"enabled, pauseDuration, iconColor, backgroundColor."},textToSpeech:{description:"Text-to-speech for assistant messages.",properties:'enabled, provider ("browser" | "runtype"), browserFallback, voice, rate, pitch.'},suggestionChips:"string[] \u2014 Suggested prompts shown to the user.",messageActions:{description:"Message action buttons (copy, upvote, downvote).",properties:'enabled, showCopy, showUpvote, showDownvote, visibility ("hover" | "always"), align ("left" | "center" | "right"), layout ("pill-inside" | "row-inside").'},attachments:{description:"File attachment configuration.",properties:"enabled, allowedTypes (string[]), maxFileSize (bytes), maxFiles, buttonIconName, buttonTooltipText."},markdown:{description:"Markdown rendering configuration.",properties:"options (gfm, breaks, headerIds, headerPrefix, pedantic, mangle, silent), disableDefaultStyles."},layout:{description:"Layout configuration.",showHeader:"boolean \u2014 show/hide the header section entirely.",showFooter:"boolean \u2014 show/hide the footer/composer section entirely.",contentMaxWidth:'CSS width value for centering content (e.g. "720px", "90ch").',header:'"default" | "minimal". Options: showIcon, showTitle, showSubtitle, showCloseButton, showClearChat.',messages:'"bubble" | "flat" | "minimal". Options: groupConsecutive, avatar (show, position, userAvatar, assistantAvatar), timestamp (show, position).'},statusIndicator:{description:"Status text shown below the composer.",properties:{visible:"Show/hide the status indicator.",align:'"left" | "center" | "right" \u2014 text alignment (default: "right").',idleText:'Text shown when idle (default: "Online").',idleLink:"URL to open when idle text is clicked (wraps text in a link).",connectingText:'Text shown while connecting (default: "Connecting\u2026").',connectedText:'Text shown while streaming (default: "Streaming\u2026").',errorText:'Text shown on error (default: "Offline").'}},features:{description:"Feature flags.",properties:"showReasoning (AI thinking steps), showToolCalls (tool invocations), artifacts (sidebar config)."}}},p={darkIndigo:{description:"Dark mode with indigo accent \u2014 override grays for dark backgrounds and semantic tokens for inverted text/surface",theme:{palette:{colors:{primary:{500:"#6366f1",600:"#4f46e5"},gray:{50:"#f1f5f9",100:"#1e293b",200:"#334155",500:"#94a3b8",900:"#0f172a",950:"#020617"}}},semantic:{colors:{surface:"palette.colors.gray.900",background:"palette.colors.gray.900",container:"palette.colors.gray.100",text:"palette.colors.gray.50",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.900",border:"palette.colors.gray.200"}}}},warmVintage:{description:"Warm sepia tones with serif font and subtle radius",theme:{palette:{colors:{primary:{500:"#b45309",600:"#92400e"},gray:{50:"#fef3c7",100:"#fef9c3",200:"#d6d3d1",500:"#78716c",900:"#44403c"}},radius:{sm:"0.125rem",md:"0.25rem",lg:"0.375rem"},typography:{fontFamily:{sans:'Georgia, Cambria, "Times New Roman", Times, serif'}}}}},neonCyberpunk:{description:"Neon on dark with monospace font \u2014 full semantic override for dark background",theme:{palette:{colors:{primary:{500:"#f0abfc",600:"#e879f9"},accent:{500:"#22d3ee",600:"#06b6d4"},gray:{50:"#f0abfc",100:"#1e0a3c",200:"#3b0764",500:"#c084fc",900:"#0c0a1a",950:"#050412"}},radius:{sm:"0",md:"0.25rem",lg:"0.375rem"},typography:{fontFamily:{sans:"ui-monospace, SFMono-Regular, Menlo, monospace"}}},semantic:{colors:{surface:"palette.colors.gray.900",background:"palette.colors.gray.950",container:"palette.colors.gray.100",text:"palette.colors.gray.50",textMuted:"palette.colors.gray.500",border:"palette.colors.gray.200"}}}},cleanRounded:{description:"Clean light theme with large radius and panel styling",theme:{palette:{radius:{sm:"6px",md:"8px",lg:"12px",launcher:"50px",button:"8px"}},components:{panel:{borderRadius:"16px",shadow:"palette.shadows.2xl"}}}}};function b(){return{tokenDocs:i,defaultColorPalette:n.colors,defaultRadius:n.radius,examples:p,sdkPresets:["shop","minimal","fullscreen"]}}0&&(module.exports={THEME_EXAMPLES,THEME_TOKEN_DOCS,getThemeReference});
|
|
1
|
+
"use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var m=(o,e)=>{for(var a in e)t(o,a,{get:e[a],enumerable:!0})},g=(o,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!d.call(o,r)&&r!==a&&t(o,r,{get:()=>e[r],enumerable:!(s=c(e,r))||s.enumerable});return o};var u=o=>g(t({},"__esModule",{value:!0}),o);var h={};m(h,{THEME_EXAMPLES:()=>i,THEME_TOKEN_DOCS:()=>p,getThemeReference:()=>b});module.exports=u(h);var n={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"}},spacing:{0:"0px",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}};var p={overview:"Persona uses a three-layer design token system: palette \u2192 semantic \u2192 components. Most themes only need palette.colors overrides \u2014 semantic and component layers auto-derive from palette values. Config also accepts non-theme appearance options (launcher, sendButton, toolCall, etc.).",layers:{palette:{description:"Primitive design tokens. Override specific shades to change the entire widget feel.",colors:{description:"7 color scales, each with shades 50 (lightest) to 950 (darkest). Override only the shades you need.",scales:{gray:"Neutrals \u2014 backgrounds, text, borders. Key shades: 50 (lightest bg), 100 (secondary bg), 200 (borders), 500 (muted text), 900 (primary text).",primary:"Brand color \u2014 buttons, links, interactive elements. Key shades: 500 (default), 600 (hover).",accent:"Secondary highlight. Key shades: 500 (default), 600 (hover).",secondary:"Tertiary color scale.",success:"Positive feedback (default: green).",warning:"Caution feedback (default: yellow).",error:"Error/danger feedback (default: red)."}},radius:{description:"Border radius scale. Add custom keys like launcher, button.",defaults:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},typography:{fontFamily:"Three stacks: sans (system-ui), serif (Georgia), mono (ui-monospace). Override individual stack values.",fontSize:"Scale: xs (0.75rem), sm (0.875rem), base (1rem), lg (1.125rem), xl (1.25rem), 2xl (1.5rem), 3xl (1.875rem), 4xl (2.25rem).",fontWeight:"normal (400), medium (500), semibold (600), bold (700).",lineHeight:"tight (1.25), normal (1.5), relaxed (1.625)."},shadows:"Scale: none, sm, md, lg, xl, 2xl. Values are CSS box-shadow strings.",borders:"Scale: none, sm (1px solid), md (2px solid), lg (4px solid).",spacing:"Scale: 0 (0px), 1 (0.25rem), 2 (0.5rem), 3 (0.75rem), 4 (1rem), 5 (1.25rem), 6 (1.5rem), 8 (2rem), 10 (2.5rem), 12 (3rem), 16-64."},semantic:{description:'Design intent tokens. Auto-derived from palette by default. Override to redirect token resolution. Values are token reference strings like "palette.colors.primary.500".',colors:{primary:"palette.colors.primary.500 \u2014 Primary brand color.",secondary:"palette.colors.gray.500 \u2014 Secondary color.",accent:"palette.colors.primary.600 \u2014 Accent/interactive color.",surface:"palette.colors.gray.50 \u2014 Panel/card backgrounds.",background:"palette.colors.gray.50 \u2014 Page background.",container:"palette.colors.gray.100 \u2014 Container backgrounds.",text:"palette.colors.gray.900 \u2014 Primary text.",textMuted:"palette.colors.gray.500 \u2014 Muted/secondary text.",textInverse:"palette.colors.gray.50 \u2014 Text on dark backgrounds.",border:"palette.colors.gray.200 \u2014 Default border color.",divider:"palette.colors.gray.200 \u2014 Divider lines.",interactive:{default:"palette.colors.primary.500",hover:"palette.colors.primary.600",focus:"palette.colors.primary.700",active:"palette.colors.primary.800",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.primary.500"}},spacing:"xs (0.25rem), sm (0.5rem), md (1rem), lg (1.5rem), xl (2rem), 2xl (2.5rem).",typography:"fontFamily, fontSize, fontWeight, lineHeight \u2014 reference palette typography tokens."},components:{description:"UI element tokens. Rarely needed for basic theming. Override for fine-grained control. All values are token references or raw CSS strings.",button:{description:"Three variants: primary, secondary, ghost.",properties:"background, foreground, borderRadius, padding."},input:{description:"Message input field.",properties:"background, placeholder, borderRadius, padding, focus.border, focus.ring."},launcher:{description:"Floating launcher button.",properties:"size (60px), iconSize (28px), borderRadius, shadow."},panel:{description:"Chat panel container.",properties:"width, maxWidth (400px), height (600px), maxHeight, borderRadius, shadow."},header:{description:"Chat panel header.",properties:"background, border, borderRadius, padding, iconBackground, iconForeground, titleForeground, subtitleForeground, actionIconForeground, shadow, borderBottom."},message:{description:"Chat message bubbles.",user:"background, text, borderRadius, shadow.",assistant:"background, text, borderRadius, border (optional), shadow (optional)."},markdown:{description:"Markdown rendering in messages and artifact pane.",properties:"inlineCode (background, foreground), link.foreground, prose.fontFamily, heading.h1/h2 (fontSize, fontWeight)."},voice:"recording (indicator, background, border), processing (icon, background), speaking (icon).",approval:"requested (background, border, text), approve (background, foreground), deny (background, foreground).",attachment:"image (background, border).",scrollToBottom:"Floating scroll-to-bottom affordance shared by transcript and event stream: background, foreground, border, size, borderRadius, shadow, padding, gap, fontSize, iconSize.",toolBubble:"shadow \u2014 tool call row box-shadow.",reasoningBubble:"shadow \u2014 reasoning/thinking row box-shadow.",composer:"shadow \u2014 message input form box-shadow.",artifact:"toolbar (icon styling, copy menu), tab (background, active states), pane (background, toolbarBackground)."}},colorScheme:'"dark" merges darkTheme overrides on top of theme. "auto" detects system preference or <html class="dark">. "light" is default. colorScheme does NOT auto-invert colors \u2014 provide dark palette and semantic overrides yourself.',plugins:{description:"Plugins transform theme tokens before resolution. Use with createTheme().",available:{brandPlugin:'Auto-generates full color scales from a single brand hex: brandPlugin({ colors: { primary: "#7c3aed" } }).',accessibilityPlugin:"Enhanced focus indicators and disabled states.",highContrastPlugin:"Increased contrast for visual accessibility.",reducedMotionPlugin:"Disables all animations (sets transitions to 0ms).",animationsPlugin:"Adds transition and easing tokens."},usage:'createTheme(themeOverrides, { plugins: [brandPlugin({ colors: { primary: "#7c3aed" } })] })'},widgetConfig:{description:'Non-theme config options on the widget config object that affect appearance. These are siblings of "theme" in the config, not nested inside it.',launcher:{description:"Floating launcher button and panel positioning.",properties:{enabled:"Show/hide the launcher button.",title:"Header title text.",subtitle:"Header subtitle text.",position:'"bottom-right" | "bottom-left" | "top-right" | "top-left".',width:"Chat panel width (CSS value).",fullHeight:"Fill full height of container.",mountMode:'"floating" | "docked".',agentIconText:"Emoji/text for agent icon.",border:"Border style for launcher button.",shadow:"Box shadow for launcher button.",collapsedMaxWidth:"Max-width for launcher pill when panel closed."}},sendButton:{description:"Send button appearance.",properties:"backgroundColor, textColor, borderWidth, borderColor, paddingX, paddingY, iconText, iconName, size."},closeButton:{description:"Close button (on launcher config).",properties:"closeButtonSize, closeButtonColor, closeButtonBackgroundColor, closeButtonBorderWidth, closeButtonBorderColor, closeButtonBorderRadius."},clearChat:{description:"Clear chat button (on launcher.clearChat config).",properties:"enabled, iconColor, backgroundColor, borderWidth, borderColor, borderRadius, size."},scrollToBottom:{description:"Shared transcript + event-stream jump-to-latest affordance.",properties:'features.scrollToBottom.enabled, features.scrollToBottom.iconName, features.scrollToBottom.label (empty string renders icon-only). Defaults: enabled=true, iconName="arrow-down", label="".'},toolCall:{description:"Tool call display styling.",properties:"shadow, backgroundColor, borderColor, borderWidth, borderRadius, headerBackgroundColor, headerTextColor, headerPaddingX, headerPaddingY, contentBackgroundColor, contentTextColor, contentPaddingX, contentPaddingY, codeBlockBackgroundColor, codeBlockBorderColor, codeBlockTextColor, toggleTextColor, labelTextColor."},approval:{description:"Tool approval bubble styling and behavior. Set to false to disable.",properties:"backgroundColor, borderColor, titleColor, descriptionColor, approveButtonColor, approveButtonTextColor, denyButtonColor, denyButtonTextColor, parameterBackgroundColor, parameterTextColor, title, approveLabel, denyLabel."},copy:{description:"Widget text content.",properties:"showWelcomeCard (boolean), welcomeTitle, welcomeSubtitle, inputPlaceholder, sendButtonLabel."},voiceRecognition:{description:"Voice input configuration.",properties:"enabled, pauseDuration, iconColor, backgroundColor."},textToSpeech:{description:"Text-to-speech for assistant messages.",properties:'enabled, provider ("browser" | "runtype"), browserFallback, voice, rate, pitch.'},suggestionChips:"string[] \u2014 Suggested prompts shown to the user.",messageActions:{description:"Message action buttons (copy, upvote, downvote).",properties:'enabled, showCopy, showUpvote, showDownvote, visibility ("hover" | "always"), align ("left" | "center" | "right"), layout ("pill-inside" | "row-inside").'},attachments:{description:"File attachment configuration.",properties:"enabled, allowedTypes (string[]), maxFileSize (bytes), maxFiles, buttonIconName, buttonTooltipText."},markdown:{description:"Markdown rendering configuration.",properties:"options (gfm, breaks, headerIds, headerPrefix, pedantic, mangle, silent), disableDefaultStyles."},layout:{description:"Layout configuration.",showHeader:"boolean \u2014 show/hide the header section entirely.",showFooter:"boolean \u2014 show/hide the footer/composer section entirely.",contentMaxWidth:'CSS width value for centering content (e.g. "720px", "90ch").',header:'"default" | "minimal". Options: showIcon, showTitle, showSubtitle, showCloseButton, showClearChat.',messages:'"bubble" | "flat" | "minimal". Options: groupConsecutive, avatar (show, position, userAvatar, assistantAvatar), timestamp (show, position).'},statusIndicator:{description:"Status text shown below the composer.",properties:{visible:"Show/hide the status indicator.",align:'"left" | "center" | "right" \u2014 text alignment (default: "right").',idleText:'Text shown when idle (default: "Online").',idleLink:"URL to open when idle text is clicked (wraps text in a link).",connectingText:'Text shown while connecting (default: "Connecting\u2026").',connectedText:'Text shown while streaming (default: "Streaming\u2026").',errorText:'Text shown on error (default: "Offline").'}},features:{description:"Feature flags.",properties:"showReasoning (AI thinking steps), showToolCalls (tool invocations), artifacts (sidebar config)."}}},i={darkIndigo:{description:"Dark mode with indigo accent \u2014 override grays for dark backgrounds and semantic tokens for inverted text/surface",theme:{palette:{colors:{primary:{500:"#6366f1",600:"#4f46e5"},gray:{50:"#f1f5f9",100:"#1e293b",200:"#334155",500:"#94a3b8",900:"#0f172a",950:"#020617"}}},semantic:{colors:{surface:"palette.colors.gray.900",background:"palette.colors.gray.900",container:"palette.colors.gray.100",text:"palette.colors.gray.50",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.900",border:"palette.colors.gray.200"}}}},warmVintage:{description:"Warm sepia tones with serif font and subtle radius",theme:{palette:{colors:{primary:{500:"#b45309",600:"#92400e"},gray:{50:"#fef3c7",100:"#fef9c3",200:"#d6d3d1",500:"#78716c",900:"#44403c"}},radius:{sm:"0.125rem",md:"0.25rem",lg:"0.375rem"},typography:{fontFamily:{sans:'Georgia, Cambria, "Times New Roman", Times, serif'}}}}},neonCyberpunk:{description:"Neon on dark with monospace font \u2014 full semantic override for dark background",theme:{palette:{colors:{primary:{500:"#f0abfc",600:"#e879f9"},accent:{500:"#22d3ee",600:"#06b6d4"},gray:{50:"#f0abfc",100:"#1e0a3c",200:"#3b0764",500:"#c084fc",900:"#0c0a1a",950:"#050412"}},radius:{sm:"0",md:"0.25rem",lg:"0.375rem"},typography:{fontFamily:{sans:"ui-monospace, SFMono-Regular, Menlo, monospace"}}},semantic:{colors:{surface:"palette.colors.gray.900",background:"palette.colors.gray.950",container:"palette.colors.gray.100",text:"palette.colors.gray.50",textMuted:"palette.colors.gray.500",border:"palette.colors.gray.200"}}}},cleanRounded:{description:"Clean light theme with large radius and panel styling",theme:{palette:{radius:{sm:"6px",md:"8px",lg:"12px",launcher:"50px",button:"8px"}},components:{panel:{borderRadius:"16px",shadow:"palette.shadows.2xl"}}}}};function b(){return{tokenDocs:p,defaultColorPalette:n.colors,defaultRadius:n.radius,examples:i,sdkPresets:["shop","minimal","fullscreen"]}}0&&(module.exports={THEME_EXAMPLES,THEME_TOKEN_DOCS,getThemeReference});
|
|
@@ -214,6 +214,17 @@ interface MessageTokens {
|
|
|
214
214
|
/** Assistant bubble box-shadow (token ref or raw CSS, e.g. `none`). */
|
|
215
215
|
shadow?: string;
|
|
216
216
|
};
|
|
217
|
+
/** Border color between messages in the thread. */
|
|
218
|
+
border?: TokenReference<'color'>;
|
|
219
|
+
}
|
|
220
|
+
/** Collapsible widget chrome (tool bubbles, reasoning bubbles, approval bubbles). */
|
|
221
|
+
interface CollapsibleWidgetTokens {
|
|
222
|
+
/** Background for content areas. */
|
|
223
|
+
container?: TokenReference<'color'>;
|
|
224
|
+
/** Background for code blocks inside collapsible sections. */
|
|
225
|
+
surface?: TokenReference<'color'>;
|
|
226
|
+
/** Border color for collapsible sections. */
|
|
227
|
+
border?: TokenReference<'color'>;
|
|
217
228
|
}
|
|
218
229
|
interface MarkdownTokens {
|
|
219
230
|
inlineCode: {
|
|
@@ -242,6 +253,27 @@ interface MarkdownTokens {
|
|
|
242
253
|
fontWeight?: string;
|
|
243
254
|
};
|
|
244
255
|
};
|
|
256
|
+
/** Fenced code block styling. */
|
|
257
|
+
codeBlock?: {
|
|
258
|
+
background?: TokenReference<'color'>;
|
|
259
|
+
borderColor?: TokenReference<'color'>;
|
|
260
|
+
textColor?: TokenReference<'color'>;
|
|
261
|
+
};
|
|
262
|
+
/** Table styling. */
|
|
263
|
+
table?: {
|
|
264
|
+
headerBackground?: TokenReference<'color'>;
|
|
265
|
+
borderColor?: TokenReference<'color'>;
|
|
266
|
+
};
|
|
267
|
+
/** Horizontal rule styling. */
|
|
268
|
+
hr?: {
|
|
269
|
+
color?: TokenReference<'color'>;
|
|
270
|
+
};
|
|
271
|
+
/** Blockquote styling. */
|
|
272
|
+
blockquote?: {
|
|
273
|
+
borderColor?: TokenReference<'color'>;
|
|
274
|
+
background?: TokenReference<'color'>;
|
|
275
|
+
textColor?: TokenReference<'color'>;
|
|
276
|
+
};
|
|
245
277
|
}
|
|
246
278
|
interface VoiceTokens {
|
|
247
279
|
recording: {
|
|
@@ -404,6 +436,8 @@ interface ComponentTokens {
|
|
|
404
436
|
tab?: ArtifactTabTokens;
|
|
405
437
|
pane?: ArtifactPaneTokens;
|
|
406
438
|
};
|
|
439
|
+
/** Collapsible widget chrome (tool/reasoning/approval bubbles). */
|
|
440
|
+
collapsibleWidget?: CollapsibleWidgetTokens;
|
|
407
441
|
}
|
|
408
442
|
interface PaletteExtras {
|
|
409
443
|
transitions?: Record<string, string>;
|