Skip to content

Commit

Permalink
⚡ Add maxWidth and maxHeight bubble them props
Browse files Browse the repository at this point in the history
Closes #458
  • Loading branch information
baptisteArno committed Nov 14, 2023
1 parent c59df18 commit 74dd169
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/docs/docs/embed/html-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Here is an example:
theme: {
button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' },
previewMessage: { backgroundColor: '#ffffff', textColor: 'black' },
chatWindow: { backgroundColor: '#ffffff' },
chatWindow: { backgroundColor: '#ffffff', maxWidth: '100%' },
},
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.16",
"version": "0.2.17",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/embeds/js/src/features/bubble/components/Bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ export const Bubble = (props: BubbleProps) => {
part="bot"
style={{
height: 'calc(100% - 80px)',
'max-height': props.theme?.chatWindow?.maxHeight ?? '704px',
'max-width': props.theme?.chatWindow?.maxWidth ?? '400px',
transition:
'transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out',
'transform-origin':
Expand All @@ -170,7 +172,7 @@ export const Bubble = (props: BubbleProps) => {
'z-index': 42424242,
}}
class={
'fixed rounded-lg w-full sm:w-[400px] max-h-[704px]' +
'fixed rounded-lg w-full' +
(isBotOpened() ? ' opacity-1' : ' opacity-0 pointer-events-none') +
(props.theme?.button?.size === 'large'
? ' bottom-24'
Expand Down
2 changes: 2 additions & 0 deletions packages/embeds/js/src/features/bubble/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type BubbleTheme = {

export type ChatWindowTheme = {
backgroundColor?: string
maxWidth?: string
maxHeight?: string
}

export type ButtonTheme = {
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.16",
"version": "0.2.17",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.16",
"version": "0.2.17",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

4 comments on commit 74dd169

@vercel
Copy link

@vercel vercel bot commented on 74dd169 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 74dd169 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 74dd169 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 74dd169 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app
docs.typebot.io

Please sign in to comment.