diff --git a/src/components/sandbox/Sandbox.css b/src/components/sandbox/Sandbox.css index 017ba6f83..6b0dc6444 100644 --- a/src/components/sandbox/Sandbox.css +++ b/src/components/sandbox/Sandbox.css @@ -1,5 +1,8 @@ .sandbox-note { color: #666; + margin-top: var(--goa-space-m); + margin-bottom: var(--goa-space-2xl); + font: var(--goa-typography-body-s); } .sandbox-render { diff --git a/src/components/sandbox/Sandbox.tsx b/src/components/sandbox/Sandbox.tsx index 59e7902b6..afe38e897 100644 --- a/src/components/sandbox/Sandbox.tsx +++ b/src/components/sandbox/Sandbox.tsx @@ -1,4 +1,6 @@ import { ReactElement, ReactNode, useContext, useEffect, useState } from "react"; +import { GoabCallout } from "@abgov/react-components"; +import { GoabCalloutType } from "@abgov/ui-components-common"; import SandboxProperties from "./SandboxProperties"; import { CodeSnippet } from "@components/code-snippet/CodeSnippet"; @@ -22,7 +24,7 @@ type Serializer = (el: any, properties: ComponentBinding[]) => string; interface SandboxProps { properties?: ComponentBinding[]; formItemProperties?: ComponentBinding[]; - note?: string; + note?: string | { type?: GoabCalloutType; heading?: string; content: string }; fullWidth?: boolean; onChange?: (bindings: ComponentBinding[], props: Record) => void; onChangeFormItemBindings?: (bindings: ComponentBinding[], props: Record) => void; @@ -140,7 +142,21 @@ export const Sandbox = (props: SandboxProps) => { )} - {props.note && (
{props.note}
)} + {props.note && + (typeof props.note === "string" ? ( +

{props.note}

+ ) : ( + + {props.note.content} + + ))} ); }; diff --git a/src/examples/modal/ModalWarnUserDeadlineExample.tsx b/src/examples/modal/ModalWarnUserDeadlineExample.tsx index a911b3966..ffb42a4a3 100644 --- a/src/examples/modal/ModalWarnUserDeadlineExample.tsx +++ b/src/examples/modal/ModalWarnUserDeadlineExample.tsx @@ -8,7 +8,12 @@ export const ModalWarnUserDeadlineExample = () => { const {version} = useContext(LanguageVersionContext); const [warnCalloutModalOpen, setWarnCalloutModalOpen] = useState(); return ( - + setWarnCalloutModalOpen(true)}> Save for later