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: fix args for Image stories #1119

Merged
merged 2 commits into from
Mar 18, 2024
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
18 changes: 9 additions & 9 deletions packages/caldera-online/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions packages/caldera/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions packages/plasma-asdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions packages/plasma-b2c/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/plasma-b2c/src/components/Image/Image.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { StoryObj, Meta } from '@storybook/react';
import { InSpacingDecorator, disableProps } from '@salutejs/plasma-sb-utils';

import { Image, Ratio } from '.';
import { Image } from '.';
import type { ImageProps } from '.';

const meta: Meta<ImageProps> = {
Expand All @@ -22,23 +22,23 @@ const meta: Meta<ImageProps> = {
type: 'select',
},
},
...disableProps(['height', 'customRatio']),
...disableProps(['src', 'alt', 'customRatio']),
},
};

export default meta;

export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
export const Default: StoryObj<ImageProps> = {
args: {
base: 'div',
src: './images/320_320_9.jpg',
alt: 'картинка для примера фоном',
width: '200px',
height: '200px',
},
render: ({ base, ratio, ...args }) => (
render: (args) => (
<div style={{ maxWidth: '10rem' }}>
<Image style={{ position: 'relative' }} {...args} />
<Image {...args} />
</div>
),
};
4 changes: 2 additions & 2 deletions packages/plasma-new-hope/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/plasma-new-hope/src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'react';

import type { RootProps } from '../../engines';

import { StyledDivImg, StyledImg, base } from './Image.styles';
import { StyledDivImg, StyledImg, base as baseCSS } from './Image.styles';
import type { ImageProps } from './Image.types';
import { ratios } from './Image.utils';

Expand Down Expand Up @@ -51,7 +51,7 @@ export const imageConfig = {
name: 'Image',
tag: 'div',
layout: imageRoot,
base,
base: baseCSS,
variations: {},
defaults: {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';

import { Image } from './Image';
import type { ImageProps, Ratio } from './Image';
import type { ImageProps } from './Image';

const bases = ['div', 'img'];

Expand All @@ -26,13 +26,13 @@ const meta: Meta<ImageProps> = {
type: 'select',
},
},
...disableProps(['view', 'src', 'alt', 'customRatio']),
...disableProps(['src', 'alt', 'customRatio']),
},
};

export default meta;

export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
export const Default: StoryObj<typeof Image> = {
args: {
base: 'div',
src: './images/320_320_9.jpg',
Expand All @@ -42,7 +42,7 @@ export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
},
render: (args) => (
<div style={{ maxWidth: '10rem' }}>
<Image style={{ position: 'relative' }} {...args} />
<Image {...args} />
</div>
),
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const meta: Meta<ImageProps> = {
type: 'select',
},
},
...disableProps(['view', 'src', 'alt', 'customRatio']),
...disableProps(['src', 'alt', 'customRatio']),
},
};

Expand All @@ -42,7 +42,7 @@ export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
},
render: (args) => (
<div style={{ maxWidth: '10rem' }}>
<Image style={{ position: 'relative' }} {...args} />
<Image {...args} />
</div>
),
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const meta: Meta<ImageProps> = {
type: 'select',
},
},
...disableProps(['view', 'src', 'alt', 'customRatio']),
...disableProps(['src', 'alt', 'customRatio']),
},
};

Expand All @@ -42,7 +42,7 @@ export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
},
render: (args) => (
<div style={{ maxWidth: '10rem' }}>
<Image style={{ position: 'relative' }} {...args} />
<Image {...args} />
</div>
),
};
18 changes: 9 additions & 9 deletions packages/plasma-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/plasma-web/src/components/Image/Image.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const meta: Meta<ImageProps> = {
type: 'select',
},
},
...disableProps(['height', 'customRatio']),
...disableProps(['src', 'alt', 'customRatio']),
},
};

Expand All @@ -36,9 +36,9 @@ export const Default: StoryObj<ImageProps & { ratio: Ratio }> = {
width: '200px',
height: '200px',
},
render: ({ base, ratio, ...args }) => (
render: (args) => (
<div style={{ maxWidth: '10rem' }}>
<Image style={{ position: 'relative' }} {...args} />
<Image {...args} />
</div>
),
};
Loading
Loading