Skip to content

Commit 000f656

Browse files
committed
Add SameHeight component and its Storybook examples
- Implement `SameHeight` component for flexible height alignment. - Integrate Storybook stories with centered layout configuration and documentation.
1 parent c05d42d commit 000f656

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type {Meta, StoryObj} from '@storybook/react-vite';
2+
3+
import SameHeight from './SameHeight';
4+
5+
const meta = {
6+
title: 'Organize/SameHeight',
7+
component: SameHeight,
8+
parameters: {
9+
layout: 'centered',
10+
docs: {
11+
description: {
12+
component: '依賴鄰居撐開的高度,關鍵為外層 align-items-stretch (此為預設值),需要跟著高度走得不可設定高度'
13+
},
14+
},
15+
},
16+
tags: ['autodocs'],
17+
args: {},
18+
} satisfies Meta<typeof SameHeight>;
19+
20+
export default meta;
21+
type Story = StoryObj<typeof meta>;
22+
23+
24+
25+
export const Primary: Story = {
26+
args: {},
27+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {Flex} from '@acrool/react-grid';
2+
3+
import Textarea from '@/components/forms/Textarea';
4+
import TextField from '@/components/forms/TextField';
5+
6+
7+
const SameHeight = () => {
8+
9+
return <Flex className="align-items-stretch">
10+
<div style={{backgroundColor: '#ccc', width: '100px'}}>
11+
<p>Left</p>
12+
<p>不可設定高度</p>
13+
</div>
14+
15+
<div style={{backgroundColor: 'red', height: '200px', width: '100px'}}>
16+
<p>Right</p>
17+
<p>200px</p>
18+
</div>
19+
</Flex>;
20+
};
21+
22+
export default SameHeight;
23+
24+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {default} from './SameHeight';

0 commit comments

Comments
 (0)