& {
+ buttonSize: ButtonTheme['size']
previewMessageTheme?: PreviewMessageTheme
onClick: () => void
onCloseClick: () => void
@@ -19,8 +24,12 @@ export const PreviewMessage = (props: PreviewMessageProps) => {
return (
props.onClick()}
- class="fixed bottom-20 right-4 max-w-[256px] rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4"
+ class={
+ 'fixed right-5 max-w-[256px] rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4' +
+ (props.buttonSize === 'large' ? ' bottom-24' : ' bottom-20')
+ }
style={{
'background-color':
props.previewMessageTheme?.backgroundColor ?? defaultBackgroundColor,
diff --git a/packages/embeds/js/src/features/bubble/types.ts b/packages/embeds/js/src/features/bubble/types.ts
index b95eb1202..903803018 100644
--- a/packages/embeds/js/src/features/bubble/types.ts
+++ b/packages/embeds/js/src/features/bubble/types.ts
@@ -14,6 +14,7 @@ export type ChatWindowTheme = {
}
export type ButtonTheme = {
+ size?: 'medium' | 'large'
backgroundColor?: string
iconColor?: string
customIconSrc?: string
diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json
index 67767ec6c..b100e3358 100644
--- a/packages/embeds/react/package.json
+++ b/packages/embeds/react/package.json
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
- "version": "0.0.31",
+ "version": "0.0.32",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/packages/embeds/react/src/Bubble.tsx b/packages/embeds/react/src/Bubble.tsx
index 26b1e7d18..16cad8309 100644
--- a/packages/embeds/react/src/Bubble.tsx
+++ b/packages/embeds/react/src/Bubble.tsx
@@ -9,7 +9,7 @@ declare global {
'typebot-bubble': React.DetailedHTMLProps<
React.HTMLAttributes,
HTMLElement
- > & { class?: string }
+ >
}
}
}
diff --git a/packages/embeds/react/src/stories/assets/index.css b/packages/embeds/react/src/stories/assets/index.css
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/packages/embeds/react/src/stories/assets/index.css
@@ -0,0 +1 @@
+
diff --git a/packages/embeds/react/src/stories/bubble.stories.tsx b/packages/embeds/react/src/stories/bubble.stories.tsx
index d345c5f49..446293281 100644
--- a/packages/embeds/react/src/stories/bubble.stories.tsx
+++ b/packages/embeds/react/src/stories/bubble.stories.tsx
@@ -9,6 +9,7 @@ import {
} from '@typebot.io/js'
import { useState } from 'react'
import { leadGenerationTypebot } from './assets/leadGenerationTypebot'
+import './assets/index.css'
export const Default = () => {
const [name, setName] = useState('John')
@@ -47,6 +48,7 @@ export const Default = () => {
button: {
backgroundColor: '#FF7537',
iconColor: 'white',
+ size: 'large',
},
}}
isPreview