Skip to content

Commit

Permalink
馃悰 (theme) Fix progress bar background color
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 11, 2024
1 parent 408aeb4 commit 51bf5b6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NumberInput } from '@/components/inputs'
import { FormLabel, HStack } from '@chakra-ui/react'
import { ProgressBar } from '@typebot.io/schemas'
import {
defaultProgressBarBackgroundColor,
defaultProgressBarColor,
defaultProgressBarIsEnabled,
defaultProgressBarPlacement,
Expand Down Expand Up @@ -38,6 +39,9 @@ export const ProgressBarForm = ({
const updateThickness = (thickness?: number) =>
onProgressBarChange({ ...progressBar, thickness })

const updateBackgroundColor = (backgroundColor: string) =>
onProgressBarChange({ ...progressBar, backgroundColor })

return (
<SwitchWithRelatedSettings
label={'Enable progress bar?'}
Expand All @@ -53,6 +57,17 @@ export const ProgressBarForm = ({
items={progressBarPlacements}
/>

<HStack justifyContent="space-between">
<FormLabel mb="0" mr="0">
Background color:
</FormLabel>
<ColorPicker
defaultValue={
progressBar?.backgroundColor ?? defaultProgressBarBackgroundColor
}
onColorChange={updateBackgroundColor}
/>
</HStack>
<HStack justifyContent="space-between">
<FormLabel mb="0" mr="0">
Color:
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.67",
"version": "0.2.68",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/src/assets/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ select option {

.typebot-progress-bar-container {
background-color: rgba(
var(--typebot-button-bg-rgb),
var(--typebot-progress-bar-bg-rgb),
calc(var(--selectable-alpha-ratio) * 0.12)
);

Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/src/utils/setCssVariablesValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const cssVariableNames = {
progressBar: {
position: '--typebot-progress-bar-position',
color: '--typebot-progress-bar-color',
colorRgb: '--typebot-progress-bar-color-rgb',
colorRgb: '--typebot-progress-bar-bg-rgb',
height: '--typebot-progress-bar-height',
top: '--typebot-progress-bar-top',
bottom: '--typebot-progress-bar-bottom',
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.67",
"version": "0.2.68",
"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.67",
"version": "0.2.68",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 51bf5b6

Please sign in to comment.