Skip to content

Commit

Permalink
components: Do not export View and remove it from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed May 7, 2021
1 parent 54e9162 commit 457b18a
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 96 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/flex/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const _default = () => {
<View>Item</View>
</Flex>
<Flex direction={ [ 'column', 'row' ] } gap={ 3 }>
<View css={ { width: '180px' } }>Item</View>
<View style={ { width: '180px' } }>Item</View>
<FlexItem isBlock>
<View>Item</View>
</FlexItem>
Expand Down
11 changes: 7 additions & 4 deletions packages/components/src/grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
## Usage

```jsx
import { __experimentalGrid as Grid, __experimentalView as View } from '@wordpress/components';
import {
__experimentalGrid as Grid,
__experimentalText as Text
} from '@wordpress/components';

function Example() {
return (
<Grid columns={ 3 }>
<View>Code</View>
<View>is</View>
<View>Poetry</View>
<Text>Code</Text>
<Text>is</Text>
<Text>Poetry</Text>
</Grid>
);
}
Expand Down
11 changes: 7 additions & 4 deletions packages/components/src/grid/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import useGrid from './hook';
*
* @example
* ```jsx
* import { __experimentalGrid as Grid, __experimentalView as View } from `@wordpress/components`;
* import {
* __experimentalGrid as Grid,
* __experimentalText as Text
* } from `@wordpress/components`;
*
* function Example() {
* return (
* <Grid columns={ 3 }>
* <View>Code</View>
* <View>is</View>
* <View>Poetry</View>
* <Text>Code</Text>
* <Text>is</Text>
* <Text>Poetry</Text>
* </Grid>
* );
* }
Expand Down
37 changes: 9 additions & 28 deletions packages/components/src/h-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@
import {
__experimentalHStack as HStack,
__experimentalText as Text,
__experimentalView as View,
} from '@wordpress/components';

function Example() {
return (
<HStack>
<View>
<Text>Code</Text>
</View>
<View>
<Text>is</Text>
</View>
<View>
<Text>Poetry</Text>
</View>
<Text>Code</Text>
<Text>is</Text>
<Text>Poetry</Text>
</HStack>
);
}
Expand Down Expand Up @@ -93,21 +86,16 @@ import {
__experimentalHStack as HStack,
__experimentalSpacer as Spacer,
__experimentalText as Text,
__experimentalView as View,
} from '@wordpress/components';

function Example() {
return (
<HStack>
<View>
<Text>Code</Text>
</View>
<Text>Code</Text>
<Spacer>
<Text>is</Text>
<Text>is</Text>
</Spacer>
<View>
<Text>Poetry</Text>
</View>
<Text>Poetry</Text>
</HStack>
);
}
Expand All @@ -120,22 +108,15 @@ import {
__experimentalHStack as HStack,
__experimentalSpacer as Spacer,
__experimentalText as Text,
__experimentalView as View,
} from '@wordpress/components';

function Example() {
return (
<HStack>
<View>
<Text>Code</Text>
</View>
<Text>Code</Text>
<Spacer />
<View>
<Text>is</Text>
</View>
<View>
<Text>Poetry</Text>
</View>
<Text>is</Text>
<Text>Poetry</Text>
</HStack>
);
}
Expand Down
13 changes: 3 additions & 10 deletions packages/components/src/h-stack/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@ import { useHStack } from './hook';
* import {
* __experimentalHStack as HStack,
* __experimentalText as Text,
* __experimentalView as View,
* } from `@wordpress/components`;
*
* function Example() {
* return (
* <HStack>
* <View>
* <Text>Code</Text>
* </View>
* <View>
* <Text>is</Text>
* </View>
* <View>
* <Text>Poetry</Text>
* </View>
* <Text>Code</Text>
* <Text>is</Text>
* <Text>Poetry</Text>
* </HStack>
* );
* }
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/heading/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ export interface HeadingProps extends Omit< TextProps, 'size' > {
*
* @example
* ```jsx
* import { Heading, View } from `@wordpress/components`
* import { __experimentalHeading as Heading } from `@wordpress/components`
*
* function Example() {
* return (
* <View>
* <div>
* <Heading level="1">Code is Poetry</Heading>
* <Heading level="2">Code is Poetry</Heading>
* <Heading level="3">Code is Poetry</Heading>
* <Heading level="4">Code is Poetry</Heading>
* <Heading level="5">Code is Poetry</Heading>
* <Heading level="6">Code is Poetry</Heading>
* </View>
* </div>
* );
* }
* ```
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export {
export { default as TreeSelect } from './tree-select';
export { Truncate as __experimentalTruncate } from './truncate';
export { default as __experimentalUnitControl } from './unit-control';
export { View as __experimentalView } from './view';
export { VisuallyHidden } from './visually-hidden';
export { VStack as __experimentalVStack } from './v-stack';
export { default as IsolatedEventContainer } from './isolated-event-container';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function Card( props, forwardedRef ) {

return (
<View { ...otherProps } ref={ forwardedRef }>
<View css={ styles.Content }>{ children }</View>
<View className={ styles.Content }>{ children }</View>
<Elevation
className={ elevationClassName }
isInteractive={ false }
Expand Down
6 changes: 2 additions & 4 deletions packages/components/src/ui/popover/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ function Popover( props, forwardedRef ) {
*
* @example
* ```jsx
* import { Button, Popover, View, Text } from `@wordpress/components/ui`;
* import { Button, Popover, Text } from `@wordpress/components/ui`;
* function Example() {
* return (
* <Popover trigger={ <Button>Popover</Button> }>
* <View>
* <Text>Code is Poetry</Text>
* </View>
* <Text>Code is Poetry</Text>
* </Popover>
* );
* }
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/ui/scrollable/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { useScrollable } from './hook';
*
* @example
* ```jsx
* import { Scrollable, View } from `@wordpress/components/ui`;
* import { Scrollable } from `@wordpress/components/ui`;
* function Example() {
* return (
* <Scrollable style={ { maxHeight: 200 } }>
* <View style={ { height: 500 } }>...</View>
* <div style={ { height: 500 } }>...</div>
* </Scrollable>
* );
* }
Expand Down
37 changes: 9 additions & 28 deletions packages/components/src/v-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@
```jsx
import {
__experimentalText as Text,
__experimentalView as View
__experimentalVStack as VStack,
} from '@wordpress/components';

function Example() {
return (
<VStack>
<View>
<Text>Code</Text>
</View>
<View>
<Text>is</Text>
</View>
<View>
<Text>Poetry</Text>
</View>
<Text>Code</Text>
<Text>is</Text>
<Text>Poetry</Text>
</VStack>
);
}
Expand Down Expand Up @@ -92,22 +85,17 @@ When a `Spacer` is used within an `VStack`, the `Spacer` adaptively expands to t
import {
__experimentalSpacer as Spacer,
__experimentalText as Text,
__experimentalView as View
__experimentalVStack as VStack,
} from '@wordpress/components';

function Example() {
return (
<VStack>
<View>
<Text>Code</Text>
</View>
<Text>Code</Text>
<Spacer>
<Text>is</Text>
<Text>is</Text>
</Spacer>
<View>
<Text>Poetry</Text>
</View>
<Text>Poetry</Text>
</VStack>
);
}
Expand All @@ -119,23 +107,16 @@ function Example() {
import {
__experimentalSpacer as Spacer,
__experimentalText as Text,
__experimentalView as View
__experimentalVStack as VStack,
} from '@wordpress/components';

function Example() {
return (
<VStack>
<View>
<Text>Code</Text>
</View>
<Text>Code</Text>
<Spacer />
<View>
<Text>is</Text>
</View>
<View>
<Text>Poetry</Text>
</View>
<Text>is</Text>
<Text>Poetry</Text>
</VStack>
);
}
Expand Down
13 changes: 3 additions & 10 deletions packages/components/src/v-stack/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,15 @@ import { useVStack } from './hook';
* ```jsx
* import {
* __experimentalText as Text,
* __experimentalView as View,
* __experimentalVStack as VStack,
* } from `@wordpress/components`;
*
* function Example() {
* return (
* <VStack>
* <View>
* <Text>Code</Text>
* </View>
* <View>
* <Text>is</Text>
* </View>
* <View>
* <Text>Poetry</Text>
* </View>
* <Text>Code</Text>
* <Text>is</Text>
* <Text>Poetry</Text>
* </VStack>
* );
* }
Expand Down

0 comments on commit 457b18a

Please sign in to comment.