Skip to content

Commit 7ee445d

Browse files
committed
🔥 Remove deprecated FlexBox.Item, Use Box
1 parent a5b6ac5 commit 7ee445d

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

‎src/flex-box/about.mdx

+10-9
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ order: -2
66

77
import { Playground } from 'docz'
88
import { PropsTable } from '../props-table'
9+
import { Box } from '../box'
910
import { FlexBox } from './index'
1011

1112
# FlexBox
1213

1314
## Description
1415

15-
Like [`Box`](#/box) component, but extended with [flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout) specific [prop styles](https://github.com/exah/pss/blob/master/docs/api.md#flex). `FlexBox.Item` is alias for `Box`
16+
Like [`Box`](#/box) component, but extended with [flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout) specific [prop styles](https://github.com/exah/pss/blob/master/docs/api.md#flex).
1617

1718

1819
## Usage
1920

2021
```js
21-
import { FlexBox } from 'pss-components'
22+
import { FlexBox, Box } from 'pss-components'
2223
```
2324

2425
```js
2526
<FlexBox>
26-
<FlexBox.Item>Item</FlexBox.Item>
27+
<Box>Item</Box>
2728
</FlexBox>
2829
```
2930

@@ -32,15 +33,15 @@ import { FlexBox } from 'pss-components'
3233

3334
<Playground>
3435
<FlexBox>
35-
<FlexBox.Item outline='debug' order={0}>
36+
<Box outline='debug' order={0}>
3637
Item
37-
</FlexBox.Item>
38-
<FlexBox.Item outline='debug' order={1} flex='1'>
38+
</Box>
39+
<Box outline='debug' order={1} flex='1'>
3940
Item
40-
</FlexBox.Item>
41-
<FlexBox.Item outline='debug' order={2}>
41+
</Box>
42+
<Box outline='debug' order={2}>
4243
Item
43-
</FlexBox.Item>
44+
</Box>
4445
</FlexBox>
4546
</Playground>
4647

‎src/flex-box/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ FlexBox.propTypes = {
3131
...Box.propTypes
3232
}
3333

34-
FlexBox.Item = Box // COMPAT
35-
3634
export {
3735
FlexBox
3836
}

‎test/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ test('Box', () => {
3535
test('FlexBox', () => {
3636
const result = renderJSON(
3737
<FlexBox tm width={(1 / 2)} justifyContent='space-between'>
38-
<FlexBox.Item>Item</FlexBox.Item>
39-
<FlexBox.Item mgx='auto'>Item</FlexBox.Item>
40-
<FlexBox.Item flex='0 1'>Item</FlexBox.Item>
38+
<Box>Item</Box>
39+
<Box mgx='auto'>Item</Box>
40+
<Box flex='0 1'>Item</Box>
4141
</FlexBox>
4242
)
4343

@@ -80,9 +80,9 @@ test('MediaObject', () => {
8080
describe('FlexGrid', () => {
8181
const renderFlexGridItems = (length, col) => initArr(length, (index) => (
8282
<FlexGrid.Item col={col} key={index}>
83-
<FlexGrid.Content>
83+
<Box>
8484
{col}
85-
</FlexGrid.Content>
85+
</Box>
8686
</FlexGrid.Item>
8787
))
8888

0 commit comments

Comments
 (0)