@runtypelabs/persona 2.0.0 → 2.1.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.
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.global.js +69 -69
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/widget.css +13 -0
- package/package.json +1 -1
- package/src/styles/widget.css +13 -0
- package/src/types/theme.ts +22 -0
- package/src/types.ts +24 -0
- package/src/utils/migration.ts +42 -1
- package/src/utils/theme.test.ts +33 -1
- package/src/utils/theme.ts +8 -0
- package/src/utils/tokens.ts +19 -0
package/dist/index.d.cts
CHANGED
|
@@ -814,6 +814,28 @@ type AgentWidgetTheme = {
|
|
|
814
814
|
* @default "16px"
|
|
815
815
|
*/
|
|
816
816
|
panelBorderRadius?: string;
|
|
817
|
+
/**
|
|
818
|
+
* Box-shadow for user message bubbles (bubble message layout).
|
|
819
|
+
* @example "none" | "0 1px 2px rgba(0,0,0,0.05)"
|
|
820
|
+
*/
|
|
821
|
+
messageUserShadow?: string;
|
|
822
|
+
/**
|
|
823
|
+
* Box-shadow for assistant message bubbles (bubble message layout).
|
|
824
|
+
* Overrides the default subtle assistant shadow when set.
|
|
825
|
+
*/
|
|
826
|
+
messageAssistantShadow?: string;
|
|
827
|
+
/**
|
|
828
|
+
* Box-shadow for tool-call / function-call rows.
|
|
829
|
+
*/
|
|
830
|
+
toolBubbleShadow?: string;
|
|
831
|
+
/**
|
|
832
|
+
* Box-shadow for reasoning (“thinking”) rows.
|
|
833
|
+
*/
|
|
834
|
+
reasoningBubbleShadow?: string;
|
|
835
|
+
/**
|
|
836
|
+
* Box-shadow on the composer (input) container.
|
|
837
|
+
*/
|
|
838
|
+
composerShadow?: string;
|
|
817
839
|
};
|
|
818
840
|
type AgentWidgetDockConfig = {
|
|
819
841
|
/**
|
|
@@ -1208,6 +1230,8 @@ type AgentWidgetApprovalConfig = {
|
|
|
1208
1230
|
}, decision: 'approved' | 'denied') => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
1209
1231
|
};
|
|
1210
1232
|
type AgentWidgetToolCallConfig = {
|
|
1233
|
+
/** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
|
|
1234
|
+
shadow?: string;
|
|
1211
1235
|
backgroundColor?: string;
|
|
1212
1236
|
borderColor?: string;
|
|
1213
1237
|
borderWidth?: string;
|
|
@@ -4303,6 +4327,8 @@ interface MessageTokens {
|
|
|
4303
4327
|
background: TokenReference<'color'>;
|
|
4304
4328
|
text: TokenReference<'color'>;
|
|
4305
4329
|
borderRadius: TokenReference<'radius'>;
|
|
4330
|
+
/** User bubble box-shadow (token ref or raw CSS, e.g. `none`). */
|
|
4331
|
+
shadow?: string;
|
|
4306
4332
|
};
|
|
4307
4333
|
assistant: {
|
|
4308
4334
|
background: TokenReference<'color'>;
|
|
@@ -4371,6 +4397,20 @@ interface AttachmentTokens {
|
|
|
4371
4397
|
border: TokenReference<'color'>;
|
|
4372
4398
|
};
|
|
4373
4399
|
}
|
|
4400
|
+
/** Tool-call row chrome (collapsible tool bubbles). */
|
|
4401
|
+
interface ToolBubbleTokens {
|
|
4402
|
+
/** Box-shadow for tool bubbles (token ref or raw CSS, e.g. `none`). */
|
|
4403
|
+
shadow: string;
|
|
4404
|
+
}
|
|
4405
|
+
/** Reasoning / “thinking” row chrome. */
|
|
4406
|
+
interface ReasoningBubbleTokens {
|
|
4407
|
+
shadow: string;
|
|
4408
|
+
}
|
|
4409
|
+
/** Composer (message input) chrome. */
|
|
4410
|
+
interface ComposerChromeTokens {
|
|
4411
|
+
/** Box-shadow on the composer form (raw CSS, e.g. `none`). */
|
|
4412
|
+
shadow: string;
|
|
4413
|
+
}
|
|
4374
4414
|
interface ComponentTokens {
|
|
4375
4415
|
button: ButtonTokens;
|
|
4376
4416
|
input: InputTokens;
|
|
@@ -4383,6 +4423,9 @@ interface ComponentTokens {
|
|
|
4383
4423
|
voice: VoiceTokens;
|
|
4384
4424
|
approval: ApprovalTokens;
|
|
4385
4425
|
attachment: AttachmentTokens;
|
|
4426
|
+
toolBubble: ToolBubbleTokens;
|
|
4427
|
+
reasoningBubble: ReasoningBubbleTokens;
|
|
4428
|
+
composer: ComposerChromeTokens;
|
|
4386
4429
|
}
|
|
4387
4430
|
interface PaletteExtras {
|
|
4388
4431
|
transitions?: Record<string, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -814,6 +814,28 @@ type AgentWidgetTheme = {
|
|
|
814
814
|
* @default "16px"
|
|
815
815
|
*/
|
|
816
816
|
panelBorderRadius?: string;
|
|
817
|
+
/**
|
|
818
|
+
* Box-shadow for user message bubbles (bubble message layout).
|
|
819
|
+
* @example "none" | "0 1px 2px rgba(0,0,0,0.05)"
|
|
820
|
+
*/
|
|
821
|
+
messageUserShadow?: string;
|
|
822
|
+
/**
|
|
823
|
+
* Box-shadow for assistant message bubbles (bubble message layout).
|
|
824
|
+
* Overrides the default subtle assistant shadow when set.
|
|
825
|
+
*/
|
|
826
|
+
messageAssistantShadow?: string;
|
|
827
|
+
/**
|
|
828
|
+
* Box-shadow for tool-call / function-call rows.
|
|
829
|
+
*/
|
|
830
|
+
toolBubbleShadow?: string;
|
|
831
|
+
/**
|
|
832
|
+
* Box-shadow for reasoning (“thinking”) rows.
|
|
833
|
+
*/
|
|
834
|
+
reasoningBubbleShadow?: string;
|
|
835
|
+
/**
|
|
836
|
+
* Box-shadow on the composer (input) container.
|
|
837
|
+
*/
|
|
838
|
+
composerShadow?: string;
|
|
817
839
|
};
|
|
818
840
|
type AgentWidgetDockConfig = {
|
|
819
841
|
/**
|
|
@@ -1208,6 +1230,8 @@ type AgentWidgetApprovalConfig = {
|
|
|
1208
1230
|
}, decision: 'approved' | 'denied') => Promise<Response | ReadableStream<Uint8Array> | void>;
|
|
1209
1231
|
};
|
|
1210
1232
|
type AgentWidgetToolCallConfig = {
|
|
1233
|
+
/** Box-shadow for tool-call bubbles; overrides `theme.toolBubbleShadow` when set. */
|
|
1234
|
+
shadow?: string;
|
|
1211
1235
|
backgroundColor?: string;
|
|
1212
1236
|
borderColor?: string;
|
|
1213
1237
|
borderWidth?: string;
|
|
@@ -4303,6 +4327,8 @@ interface MessageTokens {
|
|
|
4303
4327
|
background: TokenReference<'color'>;
|
|
4304
4328
|
text: TokenReference<'color'>;
|
|
4305
4329
|
borderRadius: TokenReference<'radius'>;
|
|
4330
|
+
/** User bubble box-shadow (token ref or raw CSS, e.g. `none`). */
|
|
4331
|
+
shadow?: string;
|
|
4306
4332
|
};
|
|
4307
4333
|
assistant: {
|
|
4308
4334
|
background: TokenReference<'color'>;
|
|
@@ -4371,6 +4397,20 @@ interface AttachmentTokens {
|
|
|
4371
4397
|
border: TokenReference<'color'>;
|
|
4372
4398
|
};
|
|
4373
4399
|
}
|
|
4400
|
+
/** Tool-call row chrome (collapsible tool bubbles). */
|
|
4401
|
+
interface ToolBubbleTokens {
|
|
4402
|
+
/** Box-shadow for tool bubbles (token ref or raw CSS, e.g. `none`). */
|
|
4403
|
+
shadow: string;
|
|
4404
|
+
}
|
|
4405
|
+
/** Reasoning / “thinking” row chrome. */
|
|
4406
|
+
interface ReasoningBubbleTokens {
|
|
4407
|
+
shadow: string;
|
|
4408
|
+
}
|
|
4409
|
+
/** Composer (message input) chrome. */
|
|
4410
|
+
interface ComposerChromeTokens {
|
|
4411
|
+
/** Box-shadow on the composer form (raw CSS, e.g. `none`). */
|
|
4412
|
+
shadow: string;
|
|
4413
|
+
}
|
|
4374
4414
|
interface ComponentTokens {
|
|
4375
4415
|
button: ButtonTokens;
|
|
4376
4416
|
input: InputTokens;
|
|
@@ -4383,6 +4423,9 @@ interface ComponentTokens {
|
|
|
4383
4423
|
voice: VoiceTokens;
|
|
4384
4424
|
approval: ApprovalTokens;
|
|
4385
4425
|
attachment: AttachmentTokens;
|
|
4426
|
+
toolBubble: ToolBubbleTokens;
|
|
4427
|
+
reasoningBubble: ReasoningBubbleTokens;
|
|
4428
|
+
composer: ComposerChromeTokens;
|
|
4386
4429
|
}
|
|
4387
4430
|
interface PaletteExtras {
|
|
4388
4431
|
transitions?: Record<string, string>;
|