Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: card story page breaking #2492

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions packages/blade/src/components/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,53 +466,3 @@ CardWithoutPadding.parameters = {
disable: true,
},
};

// Hidden example. It is reused in motion stories
export const InternalCardExample = React.forwardRef((_, ref) => {
return (
<Card
ref={ref as never}
backgroundColor="surface.background.gray.intense"
borderRadius="medium"
elevation="lowRaised"
padding="spacing.7"
width="300px"
marginRight="spacing.6"
href="https://razorpay.com"
>
<CardHeader marginBottom="spacing.4" paddingBottom="spacing.4">
<CardHeaderLeading
prefix={<CardHeaderIcon icon={CheckCircleIcon} />}
subtitle="Share payment link via an email, SMS, messenger, chatbot etc."
suffix={<CardHeaderCounter value={12} />}
title="Payment Links"
/>
<CardHeaderTrailing visual={<CardHeaderBadge color="positive">NEW</CardHeaderBadge>} />
</CardHeader>
<CardBody>
<Text position="relative" zIndex={1}>
Create Razorpay Payments Links and share them with your customers from the Razorpay
Dashboard or using APIs and start accepting payments. Check the advantages, payment
methods, international currency support and more.
</Text>
</CardBody>
<CardFooter marginTop="spacing.4" paddingTop="spacing.4">
<CardFooterTrailing
actions={{
primary: {
accessibilityLabel: undefined,
icon: undefined,
iconPosition: undefined,
isDisabled: false,
isLoading: false,
// eslint-disable-next-line @typescript-eslint/no-empty-function
onClick: () => {},
text: 'Learn More',
type: undefined,
},
}}
/>
</CardFooter>
</Card>
);
});
65 changes: 65 additions & 0 deletions packages/blade/src/components/Card/InternalCardExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Hidden example. It is used in motion stories
import React from 'react';
import {
CardBody,
Card,
CardFooter,
CardFooterTrailing,
CardHeader,
CardHeaderLeading,
CardHeaderTrailing,
CardHeaderIcon,
CardHeaderCounter,
CardHeaderBadge,
} from '.';
import { Text } from '~components/Typography';
import { CheckCircleIcon } from '~components/Icons';

export const InternalCardExample = React.forwardRef((_, ref) => {
tewarig marked this conversation as resolved.
Show resolved Hide resolved
return (
<Card
ref={ref as never}
backgroundColor="surface.background.gray.intense"
borderRadius="medium"
elevation="lowRaised"
padding="spacing.7"
width="300px"
marginRight="spacing.6"
href="https://razorpay.com"
>
<CardHeader marginBottom="spacing.4" paddingBottom="spacing.4">
<CardHeaderLeading
prefix={<CardHeaderIcon icon={CheckCircleIcon} />}
subtitle="Share payment link via an email, SMS, messenger, chatbot etc."
suffix={<CardHeaderCounter value={12} />}
title="Payment Links"
/>
<CardHeaderTrailing visual={<CardHeaderBadge color="positive">NEW</CardHeaderBadge>} />
</CardHeader>
<CardBody>
<Text position="relative" zIndex={1}>
Create Razorpay Payments Links and share them with your customers from the Razorpay
Dashboard or using APIs and start accepting payments. Check the advantages, payment
methods, international currency support and more.
</Text>
</CardBody>
<CardFooter marginTop="spacing.4" paddingTop="spacing.4">
<CardFooterTrailing
actions={{
primary: {
accessibilityLabel: undefined,
icon: undefined,
iconPosition: undefined,
isDisabled: false,
isLoading: false,
// eslint-disable-next-line @typescript-eslint/no-empty-function
onClick: () => {},
text: 'Learn More',
type: undefined,
},
}}
/>
</CardFooter>
</Card>
);
});
2 changes: 1 addition & 1 deletion packages/blade/src/components/Fade/Fade.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { Title } from '@storybook/addon-docs';
import StoryRouter from 'storybook-react-router';
import { InternalCardExample } from '../Card/Card.stories';
import { InternalCardExample } from '../Card/InternalCardExample';
import { Fade } from './';
import type { FadeProps } from './';
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper';
Expand Down
2 changes: 1 addition & 1 deletion packages/blade/src/components/Move/Move.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { Title } from '@storybook/addon-docs';
import StoryRouter from 'storybook-react-router';
import { InternalCardExample } from '../Card/Card.stories';
import { InternalCardExample } from '../Card/InternalCardExample';
import { Move } from './';
import type { MoveProps } from './';
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper';
Expand Down
2 changes: 1 addition & 1 deletion packages/blade/src/components/Scale/Scale.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { Title } from '@storybook/addon-docs';
import { InternalCardExample } from '../Card/Card.stories';
import { InternalCardExample } from '../Card/InternalCardExample';
import qrCodesImage from './docs-qrcodes.svg';
import { Scale } from './';
import type { ScaleProps } from './';
Expand Down
2 changes: 1 addition & 1 deletion packages/blade/src/components/Slide/Slide.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { Title } from '@storybook/addon-docs';
import StoryRouter from 'storybook-react-router';
import { InternalCardExample } from '../Card/Card.stories';
import { InternalCardExample } from '../Card/InternalCardExample';
import { Slide } from './';
import type { SlideProps } from './';
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { Title } from '@storybook/addon-docs';
import StoryRouter from 'storybook-react-router';
import { InternalCardExample } from '../Card/Card.stories';
import { InternalCardExample } from '../Card/InternalCardExample';
import { Stagger } from './';
import type { StaggerProps } from './';
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper';
Expand Down
Loading