+
{questionChoices.map((choice, idx) => (
diff --git a/packages/surveys/src/components/MultipleChoiceSingleQuestion.tsx b/packages/surveys/src/components/questions/MultipleChoiceSingleQuestion.tsx
similarity index 78%
rename from packages/surveys/src/components/MultipleChoiceSingleQuestion.tsx
rename to packages/surveys/src/components/questions/MultipleChoiceSingleQuestion.tsx
index 6ca989c3c8..d6d3179ffc 100644
--- a/packages/surveys/src/components/MultipleChoiceSingleQuestion.tsx
+++ b/packages/surveys/src/components/questions/MultipleChoiceSingleQuestion.tsx
@@ -1,11 +1,11 @@
+import { BackButton } from "@/components/buttons/BackButton";
+import SubmitButton from "@/components/buttons/SubmitButton";
+import Headline from "@/components/general/Headline";
+import Subheader from "@/components/general/Subheader";
+import { cn, shuffleQuestions } from "@/lib/utils";
import { TResponseData } from "@formbricks/types/responses";
import type { TSurveyMultipleChoiceSingleQuestion } from "@formbricks/types/surveys";
-import { useMemo, useRef, useState, useEffect } from "preact/hooks";
-import { cn, shuffleQuestions } from "../lib/utils";
-import { BackButton } from "./BackButton";
-import Headline from "./Headline";
-import Subheader from "./Subheader";
-import SubmitButton from "./SubmitButton";
+import { useEffect, useMemo, useRef, useState } from "preact/hooks";
interface MultipleChoiceSingleProps {
question: TSurveyMultipleChoiceSingleQuestion;
@@ -15,7 +15,6 @@ interface MultipleChoiceSingleProps {
onBack: () => void;
isFirstQuestion: boolean;
isLastQuestion: boolean;
- brandColor: string;
}
export default function MultipleChoiceSingleQuestion({
@@ -26,7 +25,6 @@ export default function MultipleChoiceSingleQuestion({
onBack,
isFirstQuestion,
isLastQuestion,
- brandColor,
}: MultipleChoiceSingleProps) {
const [otherSelected, setOtherSelected] = useState(
!!value && !question.choices.find((c) => c.label === value)
@@ -73,8 +71,9 @@ export default function MultipleChoiceSingleQuestion({
-
+
{question.lowerLabel}
{question.upperLabel}
@@ -101,7 +99,6 @@ export default function NPSQuestion({
tabIndex={12}
buttonLabel={question.buttonLabel}
isLastQuestion={isLastQuestion}
- brandColor={brandColor}
onClick={() => {}}
/>
)}
diff --git a/packages/surveys/src/components/OpenTextQuestion.tsx b/packages/surveys/src/components/questions/OpenTextQuestion.tsx
similarity index 83%
rename from packages/surveys/src/components/OpenTextQuestion.tsx
rename to packages/surveys/src/components/questions/OpenTextQuestion.tsx
index 5bc5098bcb..d9e51dc2a4 100644
--- a/packages/surveys/src/components/OpenTextQuestion.tsx
+++ b/packages/surveys/src/components/questions/OpenTextQuestion.tsx
@@ -1,9 +1,9 @@
+import { BackButton } from "@/components/buttons/BackButton";
+import SubmitButton from "@/components/buttons/SubmitButton";
+import Headline from "@/components/general/Headline";
+import Subheader from "@/components/general/Subheader";
import { TResponseData } from "@formbricks/types/responses";
import type { TSurveyOpenTextQuestion } from "@formbricks/types/surveys";
-import { BackButton } from "./BackButton";
-import Headline from "./Headline";
-import Subheader from "./Subheader";
-import SubmitButton from "./SubmitButton";
import { useCallback } from "react";
interface OpenTextQuestionProps {
@@ -14,7 +14,6 @@ interface OpenTextQuestionProps {
onBack: () => void;
isFirstQuestion: boolean;
isLastQuestion: boolean;
- brandColor: string;
autoFocus?: boolean;
}
@@ -26,7 +25,6 @@ export default function OpenTextQuestion({
onBack,
isFirstQuestion,
isLastQuestion,
- brandColor,
autoFocus = true,
}: OpenTextQuestionProps) {
const handleInputChange = (inputValue: string) => {
@@ -76,6 +74,7 @@ export default function OpenTextQuestion({
type={question.inputType}
onInput={(e) => handleInputChange(e.currentTarget.value)}
autoFocus={autoFocus}
+ className="border-border bg-survey-bg focus:border-border-highlight block w-full rounded-md border p-2 shadow-sm focus:outline-none focus:ring-0 sm:text-sm"
onKeyDown={(e) => {
if (e.key === "Enter" && isInputEmpty(value as string)) {
e.preventDefault(); // Prevent form submission
@@ -85,9 +84,6 @@ export default function OpenTextQuestion({
}}
pattern={question.inputType === "phone" ? "[+][0-9 ]+" : ".*"}
title={question.inputType === "phone" ? "Enter a valid phone number" : undefined}
- className={`block w-full rounded-md border
- border-slate-100
- bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:outline-none focus:ring-0 sm:text-sm`}
/>
) : (
+ />
)}
@@ -120,12 +115,7 @@ export default function OpenTextQuestion({
/>
)}
-
{}}
- />
+ {}} />
);
diff --git a/packages/surveys/src/components/PictureSelectionQuestion.tsx b/packages/surveys/src/components/questions/PictureSelectionQuestion.tsx
similarity index 79%
rename from packages/surveys/src/components/PictureSelectionQuestion.tsx
rename to packages/surveys/src/components/questions/PictureSelectionQuestion.tsx
index b48d24f7ed..2eadad9c6d 100644
--- a/packages/surveys/src/components/PictureSelectionQuestion.tsx
+++ b/packages/surveys/src/components/questions/PictureSelectionQuestion.tsx
@@ -1,11 +1,11 @@
+import { BackButton } from "@/components/buttons/BackButton";
+import SubmitButton from "@/components/buttons/SubmitButton";
+import Headline from "@/components/general/Headline";
+import Subheader from "@/components/general/Subheader";
+import { cn } from "@/lib/utils";
import { TResponseData } from "@formbricks/types/responses";
import type { TSurveyPictureSelectionQuestion } from "@formbricks/types/surveys";
import { useEffect } from "preact/hooks";
-import { cn } from "../lib/utils";
-import { BackButton } from "./BackButton";
-import Headline from "./Headline";
-import Subheader from "./Subheader";
-import SubmitButton from "./SubmitButton";
interface PictureSelectionProps {
question: TSurveyPictureSelectionQuestion;
@@ -15,7 +15,6 @@ interface PictureSelectionProps {
onBack: () => void;
isFirstQuestion: boolean;
isLastQuestion: boolean;
- brandColor: string;
}
export default function PictureSelectionQuestion({
@@ -26,7 +25,6 @@ export default function PictureSelectionQuestion({
onBack,
isFirstQuestion,
isLastQuestion,
- brandColor,
}: PictureSelectionProps) {
const addItem = (item: string) => {
let values: string[] = [];
@@ -95,7 +93,7 @@ export default function PictureSelectionQuestion({