-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathBox.stories.tsx
More file actions
69 lines (63 loc) · 1.67 KB
/
Box.stories.tsx
File metadata and controls
69 lines (63 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import type { Meta, StoryObj } from '@storybook/react';
import { CanvasFullLayout } from '../../storybook/constants';
import { createStoryParameters } from '../../testing/storybook/createStoryParameters';
import { Avatar } from '../Avatar/Avatar';
import { Flex } from '../Flex/Flex';
import { Box, type BoxProps } from './Box';
const story: Meta<BoxProps> = {
title: 'Layout/Box',
component: Box,
parameters: createStoryParameters('Box', CanvasFullLayout),
tags: ['Раскладка'],
};
export default story;
type Story = StoryObj<BoxProps>;
export const Playground: Story = {
args: {},
render: (args) => (
<Box padding="system" {...args} style={{ background: 'grey' }}>
{Array.from({ length: 5 }, (_, index) => {
return <Avatar key={index} />;
})}
</Box>
),
decorators: [
(Component) => (
<div style={{ background: 'pink', width: '80%', height: 500, border: '1px dotted red' }}>
<Component />
</div>
),
],
};
export const MultipleBoxes: Story = {
render: () => (
<Flex>
<Box flexGrow={1}>1</Box>
<Box>2</Box>
<Box>3</Box>
</Flex>
),
decorators: [
(Component) => (
<div style={{ width: '80%', height: 500, border: '1px dotted red' }}>
<Component />
</div>
),
],
};
export const AbsoluteBox: Story = {
render: () => (
<Box position="relative" blockSize={400}>
<Box position="absolute" insetInlineEnd={0} inlineSize={50} padding="4xl">
TEXT TEXT TEXT
</Box>
</Box>
),
decorators: [
(Component) => (
<div style={{ width: '80%', height: 500, border: '1px dotted red' }}>
<Component />
</div>
),
],
};