Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Forms.Card): remove outline when variant="basic" on Section containers when used in Wizard #4336

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
Expand Up @@ -38,7 +38,8 @@

&--variant-basic {
--border-color: transparent;
.dnb-card {
.dnb-card,
.dnb-card & .dnb-card {
--card-outline-color: transparent;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.dnb-forms-wizard-layout {
&__contents {
.dnb-card {
// Change the default outline color to match the StepIndicator v2.
// This is deprecated and can be removed when the StepIndicator v3 (without a sidebar) is released.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

--card-outline-color: var(--color-pistachio);
}
}
Expand Down
Loading