From 1f4b23b105a419f64c2d8f7ccfdafa980b093404 Mon Sep 17 00:00:00 2001 From: Anshuman Pandey <54475686+pandeymangg@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:14:15 +0530 Subject: [PATCH] fix: surveys package tailwind (#2827) Co-authored-by: Piyush Gupta --- packages/js/index.html | 2 +- packages/surveys/package.json | 4 +- .../src/components/buttons/BackButton.tsx | 2 +- .../src/components/buttons/SubmitButton.tsx | 2 +- .../general/AutoCloseProgressBar.tsx | 4 +- .../src/components/general/CalEmbed.tsx | 4 +- .../src/components/general/FileInput.tsx | 32 ++--- .../components/general/FormbricksBranding.tsx | 6 +- .../src/components/general/Headline.tsx | 8 +- .../src/components/general/HtmlBody.tsx | 2 +- .../src/components/general/LanguageSwitch.tsx | 10 +- .../src/components/general/LoadingSpinner.tsx | 14 ++- .../src/components/general/Progress.tsx | 4 +- .../src/components/general/QuestionMedia.tsx | 14 +-- .../components/general/RedirectCountdown.tsx | 2 +- .../general/ResponseErrorComponent.tsx | 18 +-- .../src/components/general/Subheader.tsx | 2 +- .../surveys/src/components/general/Survey.tsx | 13 +- .../components/general/SurveyCloseButton.tsx | 6 +- .../src/components/general/SurveyInline.tsx | 2 +- .../src/components/general/SurveyModal.tsx | 2 +- .../src/components/general/ThankYouCard.tsx | 14 +-- .../src/components/general/WelcomeCard.tsx | 26 ++-- .../components/questions/AddressQuestion.tsx | 8 +- .../src/components/questions/CTAQuestion.tsx | 6 +- .../src/components/questions/CalQuestion.tsx | 6 +- .../components/questions/ConsentQuestion.tsx | 10 +- .../src/components/questions/DateQuestion.tsx | 28 ++--- .../questions/FileUploadQuestion.tsx | 4 +- .../components/questions/MatrixQuestion.tsx | 25 ++-- .../questions/MultipleChoiceMultiQuestion.tsx | 36 +++--- .../MultipleChoiceSingleQuestion.tsx | 42 ++++--- .../src/components/questions/NPSQuestion.tsx | 28 +++-- .../components/questions/OpenTextQuestion.tsx | 10 +- .../questions/PictureSelectionQuestion.tsx | 26 ++-- .../components/questions/RatingQuestion.tsx | 114 +++++++++--------- .../components/wrappers/AutoCloseWrapper.tsx | 4 +- .../surveys/src/components/wrappers/Modal.tsx | 28 ++--- .../wrappers/ScrollableContainer.tsx | 11 +- .../wrappers/StackedCardsContainer.tsx | 4 +- packages/surveys/src/styles/global.css | 4 +- packages/surveys/tailwind.config.cjs | 1 + pnpm-lock.yaml | 41 +++++-- 43 files changed, 341 insertions(+), 288 deletions(-) diff --git a/packages/js/index.html b/packages/js/index.html index a41ae4e24d..1b92346ff5 100644 --- a/packages/js/index.html +++ b/packages/js/index.html @@ -7,7 +7,7 @@ e.parentNode.insertBefore(t, e), setTimeout(function () { formbricks.init({ - environmentId: "clxvg2bf40005m66n1mrqsi1d", + environmentId: "cly414cqm000cstwa5s8w0mg2", userId: "RANDOM_USER_ID", apiHost: "http://localhost:3000", }); diff --git a/packages/surveys/package.json b/packages/surveys/package.json index bbc7803557..cc799b03ab 100644 --- a/packages/surveys/package.json +++ b/packages/surveys/package.json @@ -37,13 +37,13 @@ }, "devDependencies": { "@calcom/embed-snippet": "1.3.0", - "@formbricks/lib": "workspace:*", "@formbricks/config-typescript": "workspace:*", + "@formbricks/eslint-config": "workspace:*", + "@formbricks/lib": "workspace:*", "@formbricks/types": "workspace:*", "@preact/preset-vite": "^2.8.2", "autoprefixer": "^10.4.19", "concurrently": "8.2.2", - "@formbricks/eslint-config": "workspace:*", "isomorphic-dompurify": "^2.12.0", "postcss": "^8.4.38", "preact": "^10.22.0", diff --git a/packages/surveys/src/components/buttons/BackButton.tsx b/packages/surveys/src/components/buttons/BackButton.tsx index 90597248bf..9db10026d7 100644 --- a/packages/surveys/src/components/buttons/BackButton.tsx +++ b/packages/surveys/src/components/buttons/BackButton.tsx @@ -13,7 +13,7 @@ export const BackButton = ({ onClick, backButtonLabel, tabIndex = 2 }: BackButto tabIndex={tabIndex} type={"button"} className={cn( - "border-back-button-border text-heading focus:ring-focus rounded-custom flex items-center border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2" + "fb-border-back-button-border fb-text-heading focus:fb-ring-focus fb-rounded-custom fb-flex fb-items-center fb-border fb-px-3 fb-py-3 fb-text-base fb-font-medium fb-leading-4 fb-shadow-sm hover:fb-opacity-90 focus:fb-outline-none focus:fb-ring-2 focus:fb-ring-offset-2" )} onClick={onClick}> {backButtonLabel || "Back"} diff --git a/packages/surveys/src/components/buttons/SubmitButton.tsx b/packages/surveys/src/components/buttons/SubmitButton.tsx index 20d48ac8eb..3d022db6e7 100644 --- a/packages/surveys/src/components/buttons/SubmitButton.tsx +++ b/packages/surveys/src/components/buttons/SubmitButton.tsx @@ -36,7 +36,7 @@ export const SubmitButton = ({ type={type} tabIndex={tabIndex} autoFocus={focus} - className="bg-brand border-submit-button-border text-on-brand focus:ring-focus rounded-custom flex items-center border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2" + className="fb-bg-brand fb-border-submit-button-border fb-text-on-brand focus:fb-ring-focus fb-rounded-custom fb-flex fb-items-center fb-border fb-px-3 fb-py-3 fb-text-base fb-font-medium fb-leading-4 fb-shadow-sm hover:fb-opacity-90 focus:fb-outline-none focus:fb-ring-2 focus:fb-ring-offset-2" onClick={onClick} disabled={disabled}> {buttonLabel || (isLastQuestion ? "Finish" : "Next")} diff --git a/packages/surveys/src/components/general/AutoCloseProgressBar.tsx b/packages/surveys/src/components/general/AutoCloseProgressBar.tsx index c42a40d707..140fe22754 100644 --- a/packages/surveys/src/components/general/AutoCloseProgressBar.tsx +++ b/packages/surveys/src/components/general/AutoCloseProgressBar.tsx @@ -4,10 +4,10 @@ interface AutoCloseProgressBarProps { export const AutoCloseProgressBar = ({ autoCloseTimeout }: AutoCloseProgressBarProps) => { return ( -
+
diff --git a/packages/surveys/src/components/general/CalEmbed.tsx b/packages/surveys/src/components/general/CalEmbed.tsx index 9dde053f47..94aab66b0e 100644 --- a/packages/surveys/src/components/general/CalEmbed.tsx +++ b/packages/surveys/src/components/general/CalEmbed.tsx @@ -48,8 +48,8 @@ export const CalEmbed = ({ question, onSuccessfulBooking }: CalEmbedProps) => { }, [cal, question.calUserName]); return ( -
-
+
+
); }; diff --git a/packages/surveys/src/components/general/FileInput.tsx b/packages/surveys/src/components/general/FileInput.tsx index 8e98dfe8e9..9b6f4d30e2 100644 --- a/packages/surveys/src/components/general/FileInput.tsx +++ b/packages/surveys/src/components/general/FileInput.tsx @@ -147,27 +147,29 @@ export const FileInput = ({ return (
+ className={`fb-items-left fb-bg-input-bg hover:fb-bg-input-bg-selected fb-border-border fb-relative fb-mt-3 fb-flex fb-w-full fb-flex-col fb-justify-center fb-rounded-lg fb-border-2 fb-border-dashed dark:fb-border-slate-600 dark:fb-bg-slate-700 dark:hover:fb-border-slate-500 dark:hover:fb-bg-slate-800`}>
{fileUrls?.map((file, index) => { const fileName = getOriginalFileNameFromUrl(file); return ( -
-
-
+
+
+
handleDeleteFile(index, e)}>
-
+
+ className="fb-text-heading fb-h-6"> -

+

{fileName}

@@ -193,8 +195,8 @@ export const FileInput = ({
{isUploading && ( -
-