Files
web/packages/design-system/lib/components/RateCard/Points/Points.stories.tsx
Arvid Norlin 961e8aea91 Merged in fix/SW-1631-rate-terms-modal (pull request #1699)
fix(SW-1631): add rate terms modal

* fix(SW-1631): add rate terms modal


Approved-by: Simon.Emanuelsson
2025-04-02 09:36:53 +00:00

158 lines
3.4 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react'
import PointsRateCard from '.'
const meta: Meta<typeof PointsRateCard> = {
title: 'Components/RateCard/Points',
component: PointsRateCard,
decorators: [
(Story) => (
<div style={{ maxWidth: '400px' }}>
<Story />
</div>
),
],
argTypes: {
rateTitle: { control: 'text' },
paymentTerm: { control: 'text' },
bannerText: { control: 'text' },
rates: { control: 'object' },
selectedRate: { control: 'text' },
onRateSelect: { action: 'onRateSelect' },
isNotEnoughPoints: { control: 'boolean' },
notEnoughPointsText: { control: 'text' },
rateTermDetails: { control: 'object' },
},
}
export default meta
type Story = StoryObj<typeof PointsRateCard>
export const Default: Story = {
args: {
rateTitle: 'FREE CANCELLATION',
paymentTerm: 'PAY LATER',
bannerText: 'Reward night ∙ Breakfast included',
rates: [
{
points: '20000',
currency: 'PTS',
rateCode: 'REDNIGHT7',
},
{
points: '15000',
currency: 'PTS',
additionalPrice: {
price: '250',
currency: 'EUR',
},
rateCode: 'REDNIGHT7A',
},
{
points: '10000',
currency: 'PTS',
additionalPrice: {
price: '500',
currency: 'EUR',
},
rateCode: 'REDNIGHT7B',
},
],
selectedRate: undefined,
onRateSelect: (value) => console.log(value),
rateTermDetails: [
{
title: 'Rate definition 1',
terms: ['term 1', 'term 2', 'term 3'],
},
],
},
}
export const WithDisabledRates: Story = {
args: {
rateTitle: 'FREE CANCELLATION',
paymentTerm: 'PAY LATER',
bannerText: 'Reward night ∙ Breakfast included',
rates: [
{
points: '20000',
currency: 'PTS',
isDisabled: true,
rateCode: 'REDNIGHT7',
},
{
points: '15000',
currency: 'PTS',
isDisabled: true,
additionalPrice: {
price: '250',
currency: 'EUR',
},
rateCode: 'REDNIGHT7A',
},
{
points: '10000',
currency: 'PTS',
additionalPrice: {
price: '500',
currency: 'EUR',
},
rateCode: 'REDNIGHT7B',
},
],
selectedRate: '2',
onRateSelect: (value) => console.log(value),
rateTermDetails: [
{
title: 'Rate definition 1',
terms: ['term 1', 'term 2', 'term 3'],
},
],
},
}
export const NotEnoughPoints: Story = {
args: {
rateTitle: 'FREE CANCELLATION',
paymentTerm: 'PAY LATER',
bannerText: 'Reward night ∙ Breakfast included',
rates: [
{
points: '20000',
currency: 'PTS',
rateCode: 'REDNIGHT7',
},
{
points: '15000',
currency: 'PTS',
additionalPrice: {
price: '250',
currency: 'EUR',
},
rateCode: 'REDNIGHT7A',
},
{
points: '10000',
currency: 'PTS',
additionalPrice: {
price: '500',
currency: 'EUR',
},
rateCode: 'REDNIGHT7B',
},
],
selectedRate: undefined,
isNotEnoughPoints: true,
notEnoughPointsText: 'Not enough points',
onRateSelect: (value) => console.log(value),
rateTermDetails: [
{
title: 'Rate definition 1',
terms: ['term 1', 'term 2', 'term 3'],
},
],
},
}