Files
web/packages/design-system/lib/components/RateCard/Code.stories.tsx
Tobias Johansson 0e2192be0f Merged in feat/new-rate-cards (pull request #1600)
feat(SW-1435): Added RateCard component to design system

* feat(SW-1435): Added new component: RateCard to design system

* feat: added reward night points rate card

* fix: set svg icon color to "currentColor" to make them more reusable

* fix: added click handler for info icon

* fix: added selectedRate


Approved-by: Arvid Norlin
2025-03-25 10:41:43 +00:00

143 lines
2.8 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react'
import { RateCard } from './RateCard'
const meta: Meta<typeof RateCard> = {
title: 'Components/RateCard/Code',
component: RateCard,
decorators: [
(Story) => (
<div style={{ maxWidth: '400px' }}>
<Story />
</div>
),
],
argTypes: {
title: { control: 'text' },
},
}
export default meta
type Story = StoryObj<typeof RateCard>
export const Default: Story = {
args: {
variant: 'Code',
title: 'FREE CANCELLATION / PAY LATER',
bannerText: 'Campaign ∙ Breakfast excluded',
rate: {
label: "Valentine's Special",
price: '1989',
unit: 'EUR/night',
},
approximateRate: {
price: '1989 EUR',
label: 'Approx.',
},
},
}
export const Voucher: Story = {
args: {
variant: 'Code',
title: 'FREE CANCELLATION / PAY LATER',
bannerText: 'VOG ∙ Breakfast included',
rate: {
label: 'Promotional name here',
price: '1',
unit: 'VOUCHER',
},
},
}
export const CorporateCheck: Story = {
args: {
variant: 'Code',
title: 'FREE CANCELLATION / PAY LATER',
bannerText: 'VOG ∙ Breakfast included',
rate: {
label: 'Promotional name here',
price: '2cc + 800',
unit: 'SEK',
},
approximateRate: {
price: '76 EUR',
label: 'Approx.',
},
},
}
export const DNumberDefault: Story = {
args: {
variant: 'Code',
title: 'FREE CANCELLATION / PAY LATER',
bannerText: 'D0043148 ∙ Breakfast included',
rate: {
label: 'Helsinki Partners Oy',
price: '1989',
unit: 'EUR/NIGHT',
},
approximateRate: {
price: '76 EUR',
label: 'Approx.',
},
},
}
export const DNumberHighlightedRate: Story = {
args: {
variant: 'Code',
title: 'FREE CANCELLATION / PAY LATER',
bannerText: 'D0043148 ∙ Breakfast included',
rate: {
label: 'Helsinki Partners Oy',
price: '198',
unit: 'EUR/NIGHT',
},
approximateRate: {
price: '76 EUR',
label: 'Approx.',
},
isHighlightedRate: true,
},
}
export const LNumberDefault: Story = {
args: {
variant: 'Code',
title: 'NON-REFUNDABLE / PAY NOW',
bannerText: 'L0043148 ∙ Breakfast included',
rate: {
label: 'Nordic Team Travel',
price: '198',
unit: 'EUR/NIGHT',
},
approximateRate: {
price: '76 EUR',
label: 'Approx.',
},
},
}
export const LNumberStrikethrough: Story = {
args: {
variant: 'Code',
title: 'NON-REFUNDABLE / PAY NOW',
bannerText: 'L0043148 ∙ Breakfast included',
rate: {
label: 'Nordic Team Travel',
price: '198',
unit: 'EUR/NIGHT',
},
comparisonRate: {
price: '249',
unit: 'EUR/NIGHT',
},
approximateRate: {
price: '230/218 EUR',
label: 'Approx.',
},
},
}