-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tech: Move DetailsList to ProductCard folder (#4698)
<!-- PR title: tech / Move DetailsList to ProductCard folder --> ## Describe your changes Subj <!-- What changes are made? If there are many changes, a list might be a good format. If it makes sense, add screenshots and/or screen recordings here. --> ## Justify why they are needed Co-locate ProductDetails components ## Checklist before requesting a review - [x] I have performed a self-review of my code
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
86 changes: 86 additions & 0 deletions
86
apps/store/src/components/ProductCard/DetailsList/DetailsList.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { type ComponentProps } from 'react' | ||
import { Badge, Text, yStack } from 'ui' | ||
import { CurrencyCode } from '@/services/graphql/graphql' | ||
import { Price } from '../../Price' | ||
import { DetailsList } from './DetailsList' | ||
|
||
type Controls = ComponentProps<typeof DetailsList.Root> | ||
|
||
const meta: Meta<Controls> = { | ||
title: 'Components / Product Card / DetailsList', | ||
component: DetailsList.Root, | ||
parameters: { | ||
design: { | ||
allowFullscreen: true, | ||
type: 'figma', | ||
url: 'https://www.figma.com/file/5kmmDdh6StpXzbEfr7WevV/Hedvig-UI-Kit?type=design&node-id=16269-14623&t=KfZGhlcQELqgimtF-1', | ||
}, | ||
}, | ||
} | ||
export default meta | ||
|
||
type Story = StoryObj<Controls> | ||
|
||
export const Default: Story = { | ||
render: () => ( | ||
<div style={{ maxWidth: '400px' }}> | ||
<DetailsList.Root> | ||
<DetailsList.Item> | ||
<DetailsList.Label> | ||
Homeowner insurance{' '} | ||
<Badge size="tiny" color="pinkFill1"> | ||
Max | ||
</Badge> | ||
</DetailsList.Label> | ||
<DetailsList.Value>379 kr/mo</DetailsList.Value> | ||
</DetailsList.Item> | ||
|
||
<DetailsList.Item> | ||
<DetailsList.Label>Extended travel 60 days</DetailsList.Label> | ||
<DetailsList.Value>79 kr/mo</DetailsList.Value> | ||
</DetailsList.Item> | ||
</DetailsList.Root> | ||
</div> | ||
), | ||
} | ||
|
||
export const Large: Story = { | ||
render: () => ( | ||
<div style={{ maxWidth: '400px' }}> | ||
<Text size="lg">Details</Text> | ||
<DetailsList.Root size="lg"> | ||
<DetailsList.Item> | ||
<DetailsList.Label>Home type</DetailsList.Label> | ||
<DetailsList.Value>Homeowner</DetailsList.Value> | ||
</DetailsList.Item> | ||
|
||
<DetailsList.Item> | ||
<DetailsList.Label>Address</DetailsList.Label> | ||
<DetailsList.Value>Bellmansgatan 19A</DetailsList.Value> | ||
</DetailsList.Item> | ||
|
||
<DetailsList.Item> | ||
<DetailsList.Label>Zip code</DetailsList.Label> | ||
<DetailsList.Value>118 47</DetailsList.Value> | ||
</DetailsList.Item> | ||
</DetailsList.Root> | ||
</div> | ||
), | ||
} | ||
|
||
export const TotalPrice: Story = { | ||
render: () => ( | ||
<div style={{ maxWidth: '400px' }}> | ||
<DetailsList.Root size="lg"> | ||
<DetailsList.Item> | ||
<DetailsList.Label>Total</DetailsList.Label> | ||
<DetailsList.Value className={yStack({ alignItems: 'flex-end' })}> | ||
<Price currencyCode={CurrencyCode.Sek} reducedAmount={300} amount={379} /> | ||
<Text size="sm">-20% for 3 months, then 379 kr/mo</Text> | ||
</DetailsList.Value> | ||
</DetailsList.Item> | ||
</DetailsList.Root> | ||
</div> | ||
), | ||
} |
File renamed without changes.