Skip to content

Commit

Permalink
fix(Forms.Card): removes outline when used in Edit and ViewContainer …
Browse files Browse the repository at this point in the history
…in Wizard
  • Loading branch information
langz committed Nov 25, 2024
1 parent a6e3bc3 commit 29658c3
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import ComponentBox from '../../../../../../shared/tags/ComponentBox'
import { Flex, P } from '@dnb/eufemia/src'
import { Form, Field } from '@dnb/eufemia/src/extensions/forms'
import {
Form,
Field,
Wizard,
Value,
} from '@dnb/eufemia/src/extensions/forms'

export const BasicUsage = () => {
return (
Expand All @@ -19,3 +24,30 @@ export const BasicUsage = () => {
</ComponentBox>
)
}

export const UsageInWizard = () => {
return (
<ComponentBox data-visual-test="forms-card-in-wizard">
<Form.Handler>
<Wizard.Container>
<Wizard.Step>
<Form.Card>
<Form.Section>
<Form.Section.ViewContainer
title="In a Wizard"
variant="basic"
>
<Value.String defaultValue="Something" />
</Form.Section.ViewContainer>
<Form.Section.EditContainer variant="basic">
<Field.String defaultValue="Something" />
</Form.Section.EditContainer>
</Form.Section>
</Form.Card>
</Wizard.Step>
</Wizard.Container>
<Form.SubmitButton text="Happy coding!" />
</Form.Handler>
</ComponentBox>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ import * as Examples from './Examples'
## Demos

<Examples.BasicUsage />

<VisibleWhenVisualTest>
<Examples.UsageInWizard />
</VisibleWhenVisualTest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ describe('Form.Card', () => {
})
expect(screenshot).toMatchImageSnapshot()
})

it('have to match outset when used in wizard', async () => {
const screenshot = await makeScreenshot({
url,
selector: '[data-visual-test="forms-card-in-wizard"]',
})
expect(screenshot).toMatchImageSnapshot()
})
})

describe.each(['ui', 'sbanken'])(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.dnb-forms-wizard-layout {
&__contents {
.dnb-card {
// something with this adds outline
--card-outline-color: var(--color-pistachio);
}
}
Expand Down

0 comments on commit 29658c3

Please sign in to comment.