Skip to content

Commit

Permalink
chore: remove button example
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrekim committed Aug 22, 2023
1 parent 42d275c commit 223c809
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
FormRow,
} from '@dnb/eufemia/src'
import { SpacingElementProps } from '@dnb/eufemia/src/shared/types'
import { Provider, VisibilityByTheme } from '@dnb/eufemia/src/shared'
import { Provider } from '@dnb/eufemia/src/shared'
import { SpaceAllProps } from '@dnb/eufemia/src/components/space/Space'

const TestStyles = styled.div`
Expand Down Expand Up @@ -171,77 +171,6 @@ export const FormRowVertical = () => (
</TestStyles>
)

export const FormRowVerticalDirection = () => (
<TestStyles>
<ComponentBox
scope={{ VisibilityByTheme }}
data-visual-test="form-row-vertical-label-button"
>
{() => {
const CustomRow = styled(FormRow)`
.dnb-form-row__content .dnb-button {
align-self: flex-end;
transform: translateY(0.25rem); /* 4px down */
}
`
const CustomRowSbanken = styled(FormRow)`
.dnb-form-row__content .dnb-button {
align-self: flex-end;
}
`
return (
<>
<VisibilityByTheme hidden="sbanken">
<CustomRow
label={
<Space
element="span"
className="dnb-h--large"
top="0"
bottom="0"
>
Legend
</Space>
}
label_direction="vertical"
>
<Input
label="Vertical input label"
value="Input"
right="small"
/>
<Button text="Button" />
</CustomRow>
</VisibilityByTheme>
<VisibilityByTheme visible="sbanken">
<CustomRowSbanken
label={
<Space
element="span"
className="dnb-h--large"
top="0"
bottom="0"
>
Legend
</Space>
}
label_direction="vertical"
>
<Input
label="Vertical input label"
value="Input"
right="small"
/>
<Button text="Button" />
</CustomRowSbanken>
</VisibilityByTheme>
</>
)
}}
</ComponentBox>
</TestStyles>
)

export const FormRowNoWrap = () => (
<TestStyles>
<ComponentBox data-visual-test="form-row-horizontal-no_wrap">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ Only the labels are vertically aligned - while the input labels are still horizo

<FormRowVerticalAlignedLabels />

### Vertical direction

Vertical label direction in combination with a button

<FormRowVerticalDirection />

### Combine both vertical and horizontal FormRow's

<FormRowCombineVerticalAndHorizontal />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ describe.each(['ui', 'sbanken'])('FormRow for %s', (themeName) => {
expect(screenshot).toMatchImageSnapshot()
})

it('have to match vertical form-row label with a button', async () => {
const screenshot = await makeScreenshot({
selector: '[data-visual-test="form-row-vertical-label-button"]',
})
expect(screenshot).toMatchImageSnapshot()
})

it('have to match vertical form-row', async () => {
const screenshot = await makeScreenshot({
selector: '[data-visual-test="form-row-vertical"]',
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 223c809

Please sign in to comment.