diff --git a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/Examples.tsx b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/Examples.tsx index 82a58740665..0d361e5b333 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/Examples.tsx +++ b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/Examples.tsx @@ -1,6 +1,6 @@ import ComponentBox from '../../../../../../shared/tags/ComponentBox' -import { Field, Form } from '@dnb/eufemia/src/extensions/forms' import { createRequest } from '../SubmitIndicator/Examples' +import { Field, Form, Wizard } from '@dnb/eufemia/src/extensions/forms' import { Button } from '@dnb/eufemia/src' const request = createRequest() @@ -72,3 +72,49 @@ export const SuccessMessage = () => { ) } + +export const WithAWizard = () => { + const request = createRequest() + return ( + + {() => { + // myFormId can be anything, as long as it's a unique instance + const myFormId = () => null + + return ( + { + await request(1000) + Form.Status.setStatus(myFormId, 'success') + }} + > + + { + await request(1000) + }} + > + + + + + + + + + + + + + + + + ) + }} + + ) +} diff --git a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/demos.mdx b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/demos.mdx index ef05da36b48..40073d16691 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/demos.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Form/Status/demos.mdx @@ -14,3 +14,7 @@ import * as Examples from './Examples' ### Success message + +### With a Wizard + + diff --git a/packages/dnb-eufemia/src/extensions/forms/Form/Status/stories/Status.stories.tsx b/packages/dnb-eufemia/src/extensions/forms/Form/Status/stories/Status.stories.tsx index 561683a5e32..e417057fe5b 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Form/Status/stories/Status.stories.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Form/Status/stories/Status.stories.tsx @@ -40,17 +40,22 @@ export function BothStatuses() { ) } -export function InWizard() { +export function WithAWizard() { return ( { - console.log('data', data) + onSubmit={async (data) => { + await new Promise((r) => setTimeout(r, 1000)) Form.Status.setStatus('test', 'success') + console.log('data', data) }} > - + { + await new Promise((r) => setTimeout(r, 1000)) + }} + >