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
143 lines
2.8 KiB
TypeScript
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.',
|
|
},
|
|
},
|
|
}
|