Skip to content

Commit

Permalink
chore: adds Cards stories
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Nov 13, 2023
1 parent fff72da commit 988f3c4
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions packages/dnb-eufemia/src/components/card/stories/Card.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* @dnb/eufemia Component Story
*
*/

import React from 'react'

import { Field } from '../../../extensions/forms'
import { Card, Flex } from '../../'
import { Wrapper, Box } from 'storybook-utils/helpers'

export default {
title: 'Eufemia/Components/Card',
}

const AllFormFields = () => {
return (
<>
<Field.NationalIdentityNumber
path="/ssn"
label="NationalIdentityNumber"
/>
<Field.Email path="/email" label="Email" />
<Field.PhoneNumber path="/phone" label="PhoneNumber" />
<Field.BankAccountNumber
path="/bankaccount"
label="BankAccountNumber"
/>
<Field.Boolean path="/boolean" label="Boolean" />
<Field.Currency path="/currency" label="Currency" />
<Field.Date path="/data" label="Date" />
<Field.NationalIdentityNumber
path="/national"
label="NationalIdentityNumber"
/>
<Field.Number path="/number" label="Number" />
<Field.Option path="/option" label="Option" />
<Field.OrganizationNumber path="/org" label="OrganizationNumber" />
<Field.PostalCodeAndCity path="/postal" label="PostalCodeAndCity" />
<Field.SelectCountry path="/selectcountry" label="SelectCountry" />
<Field.Selection path="/selection" label="Selection" />
<Field.String path="/string" label="String" />
<Field.Toggle
path="/toggle"
valueOn="checked"
valueOff="unchecked"
label="Toggle"
/>
</>
)
}

export const CardSandbox = () => {
return (
<Wrapper>
<Box>
<Card>
<AllFormFields />
</Card>
</Box>
<Box>
<Card direction="horizontal">
<AllFormFields />
</Card>
</Box>
<Box>
<Card direction="vertical">
<AllFormFields />
</Card>
</Box>
<Box>
<Card>
<Flex.Horizontal>
<AllFormFields />
</Flex.Horizontal>
</Card>
</Box>
<Box>
<Card>
<Flex.Vertical>
<AllFormFields />
</Flex.Vertical>
</Card>
</Box>
<Box>
<Card stack>
<AllFormFields />
</Card>
</Box>
</Wrapper>
)
}

0 comments on commit 988f3c4

Please sign in to comment.