diff --git a/src/@optimizely/forms-react/src/components/elements/ChoiceElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/ChoiceElementBlock.tsx index 6388180..39e2e61 100644 --- a/src/@optimizely/forms-react/src/components/elements/ChoiceElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/ChoiceElementBlock.tsx @@ -1,6 +1,6 @@ import { Choice, equals, isNullOrEmpty } from "@optimizely/forms-sdk"; import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/FileUploadElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/FileUploadElementBlock.tsx index 87ad549..ecf0725 100644 --- a/src/@optimizely/forms-react/src/components/elements/FileUploadElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/FileUploadElementBlock.tsx @@ -1,6 +1,6 @@ import { FileUpload } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/ImageChoiceElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/ImageChoiceElementBlock.tsx index c948b38..0d87fae 100644 --- a/src/@optimizely/forms-react/src/components/elements/ImageChoiceElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/ImageChoiceElementBlock.tsx @@ -1,6 +1,6 @@ import { ImageChoice, equals, isNullOrEmpty } from "@optimizely/forms-sdk"; import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/NumberElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/NumberElementBlock.tsx index e7dfc94..c96736d 100644 --- a/src/@optimizely/forms-react/src/components/elements/NumberElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/NumberElementBlock.tsx @@ -1,6 +1,6 @@ import { Number } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ValidationMessage, ElementCaption } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/RangeElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/RangeElementBlock.tsx index 163555d..f7f33f9 100644 --- a/src/@optimizely/forms-react/src/components/elements/RangeElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/RangeElementBlock.tsx @@ -1,6 +1,6 @@ import { Range } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/SelectionElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/SelectionElementBlock.tsx index d6d29a9..3f467c3 100644 --- a/src/@optimizely/forms-react/src/components/elements/SelectionElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/SelectionElementBlock.tsx @@ -1,6 +1,6 @@ import { Selection, isNullOrEmpty } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/SubmitButtonElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/SubmitButtonElementBlock.tsx index c8aadf6..4526094 100644 --- a/src/@optimizely/forms-react/src/components/elements/SubmitButtonElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/SubmitButtonElementBlock.tsx @@ -1,7 +1,7 @@ import { SubmitButton, isNullOrEmpty } from "@optimizely/forms-sdk"; import React, { useMemo } from "react"; import { useElement } from "../../hooks/useElement"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; interface SubmitButtonElementBlockProps{ element: SubmitButton diff --git a/src/@optimizely/forms-react/src/components/elements/TextareaElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/TextareaElementBlock.tsx index 6536e8a..2d99580 100644 --- a/src/@optimizely/forms-react/src/components/elements/TextareaElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/TextareaElementBlock.tsx @@ -1,6 +1,6 @@ import { Textarea } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/TextboxElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/TextboxElementBlock.tsx index 0f416c1..b4e8c5f 100644 --- a/src/@optimizely/forms-react/src/components/elements/TextboxElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/TextboxElementBlock.tsx @@ -1,6 +1,6 @@ import { Textbox } from "@optimizely/forms-sdk"; import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage, DataList } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/elements/UrlElementBlock.tsx b/src/@optimizely/forms-react/src/components/elements/UrlElementBlock.tsx index d42c7fc..b0b6943 100644 --- a/src/@optimizely/forms-react/src/components/elements/UrlElementBlock.tsx +++ b/src/@optimizely/forms-react/src/components/elements/UrlElementBlock.tsx @@ -1,6 +1,6 @@ import { Url } from "@optimizely/forms-sdk" import React, { useMemo } from "react"; -import ElementWrapper from "../ElementWrapper"; +import ElementWrapper from "./shared/ElementWrapper"; import { useElement } from "../../hooks/useElement"; import { ElementCaption, ValidationMessage } from "./shared"; diff --git a/src/@optimizely/forms-react/src/components/ElementWrapper.tsx b/src/@optimizely/forms-react/src/components/elements/shared/ElementWrapper.tsx similarity index 93% rename from src/@optimizely/forms-react/src/components/ElementWrapper.tsx rename to src/@optimizely/forms-react/src/components/elements/shared/ElementWrapper.tsx index d39833e..ffb0d27 100644 --- a/src/@optimizely/forms-react/src/components/ElementWrapper.tsx +++ b/src/@optimizely/forms-react/src/components/elements/shared/ElementWrapper.tsx @@ -9,7 +9,7 @@ export interface ElementWrapperProps{ } export default function ElementWrapper(props: ElementWrapperProps){ - const failClass = props.validationResults?.some(r => !r.valid) ? "ValidationFail" : ""; + const failClass = props.validationResults?.some(r => !r.valid) ? "ValidationFail" : "ValidationSuccess"; return ( <>