From 3cfdb8179e3503b67665a3338356bd6bbf6edb92 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 31 Mar 2023 08:45:42 +0200 Subject: [PATCH] :wheelchair: (js) Add "large" bubble button size and part attr Closes #411 --- packages/embeds/js/package.json | 2 +- .../src/features/bubble/components/Bubble.tsx | 7 +++++-- .../bubble/components/BubbleButton.tsx | 21 +++++++++++++------ .../bubble/components/PreviewMessage.tsx | 13 ++++++++++-- .../embeds/js/src/features/bubble/types.ts | 1 + packages/embeds/react/package.json | 2 +- packages/embeds/react/src/Bubble.tsx | 2 +- .../embeds/react/src/stories/assets/index.css | 1 + .../react/src/stories/bubble.stories.tsx | 2 ++ 9 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 packages/embeds/react/src/stories/assets/index.css diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index 78e721c94..539b0ec8f 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.0.31", + "version": "0.0.32", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/features/bubble/components/Bubble.tsx b/packages/embeds/js/src/features/bubble/components/Bubble.tsx index 72344cb8b..dc58ec291 100644 --- a/packages/embeds/js/src/features/bubble/components/Bubble.tsx +++ b/packages/embeds/js/src/features/bubble/components/Bubble.tsx @@ -122,6 +122,7 @@ export const Bubble = (props: BubbleProps) => { @@ -132,6 +133,7 @@ export const Bubble = (props: BubbleProps) => { isBotOpened={isBotOpened()} />
{ 'z-index': 42424242, }} class={ - 'fixed bottom-20 sm:right-4 rounded-lg w-full sm:w-[400px] max-h-[704px] ' + - (isBotOpened() ? 'opacity-1' : 'opacity-0 pointer-events-none') + 'fixed sm:right-5 rounded-lg w-full sm:w-[400px] max-h-[704px]' + + (isBotOpened() ? ' opacity-1' : ' opacity-0 pointer-events-none') + + (props.theme?.button?.size === 'large' ? ' bottom-24' : ' bottom-20') } > diff --git a/packages/embeds/js/src/features/bubble/components/BubbleButton.tsx b/packages/embeds/js/src/features/bubble/components/BubbleButton.tsx index aa85e7146..e47d3cb20 100644 --- a/packages/embeds/js/src/features/bubble/components/BubbleButton.tsx +++ b/packages/embeds/js/src/features/bubble/components/BubbleButton.tsx @@ -13,9 +13,11 @@ const defaultIconColor = 'white' export const BubbleButton = (props: Props) => { return (