Skip to content

Commit

Permalink
fix: Make Columns component grow in a flex container (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieyan authored May 7, 2021
1 parent 578d050 commit 17465df
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Reactist follows [semantic versioning](https://semver.org/) and doesn't introduce breaking changes (API-wise) in minor or patch releases. However, the appearance of a component might change in a minor or patch release so keep an eye on redesigns and make sure your app still looks and feels like you expect it.

## v9.2.0-beta.10

- [Fix] `Columns` component will now stretch within a flex container

## v9.2.0-beta.9

- [Docs] Upgraded all beta storybook docs to work with Storybook 6
Expand Down

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/6.9cf6b925.iframe.bundle.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/6.c5964faf.iframe.bundle.js.map

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

2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@



window['FRAMEWORK_OPTIONS'] = {};</script><script src="runtime~main.39f9346e.iframe.bundle.js"></script><script src="vendors~main.cd2fad6b.iframe.bundle.js"></script><script src="main.98cec5e9.iframe.bundle.js"></script></body></html>
window['FRAMEWORK_OPTIONS'] = {};</script><script src="runtime~main.233fc521.iframe.bundle.js"></script><script src="vendors~main.7a1034ee.iframe.bundle.js"></script><script src="main.10470b2d.iframe.bundle.js"></script></body></html>
1 change: 1 addition & 0 deletions docs/main.10470b2d.iframe.bundle.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/main.98cec5e9.iframe.bundle.js

This file was deleted.

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/vendors~main.7a1034ee.iframe.bundle.js.map

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

1 change: 0 additions & 1 deletion docs/vendors~main.cd2fad6b.iframe.bundle.js.map

This file was deleted.

27 changes: 27 additions & 0 deletions src/new-components/columns/columns.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
disableResponsiveProps,
} from '../storybook-helper'
import { Stack } from '../stack'
import { Box } from '../box'
import { Columns, Column } from './columns'

import type {
Expand Down Expand Up @@ -274,3 +275,29 @@ ResponsiveStory.argTypes = {
alignY: { control: false },
...disableResponsiveProps,
}

export function FlexChildStory(args: PartialProps<typeof Columns>) {
return (
<Wrapper title="As a flex child">
<Box display="flex" alignItems="center">
<Box>
<Placeholder label="Element outside of Columns" />
</Box>
<Columns {...args}>
{times(5).map((i) => (
<Column key={i}>
<Placeholder label={i + 1} height={50} />
</Column>
))}
</Columns>
</Box>
</Wrapper>
)
}

FlexChildStory.argTypes = {
space: selectSize('medium'),
align: { control: false },
alignY: { control: false },
...disableResponsiveProps,
}
1 change: 1 addition & 0 deletions src/new-components/columns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const Columns = forwardRefWithAs<ColumnsProps>(function Columns(
justifyContent={mapResponsiveProp(align, (align) =>
align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center',
)}
flexGrow={1}
ref={ref}
>
{children}
Expand Down

0 comments on commit 17465df

Please sign in to comment.