Skip to content

Commit d775cc5

Browse files
committed
Add alpha page with examples
1 parent 9f650f2 commit d775cc5

File tree

7 files changed

+1942
-1637
lines changed

7 files changed

+1942
-1637
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Bleed
3+
description: Use to create a container that applies negative margins. This will allow content to Bleed into the surrounding layout.
4+
category: Structure
5+
keywords:
6+
- layout
7+
status:
8+
value: Alpha
9+
message: This component is in development. There could be breaking changes made to it in a non-major release of Polaris. Please use with caution.
10+
examples:
11+
- fileName: bleed-vertical.tsx
12+
title: Vertical
13+
description: >-
14+
Use to set bleed vertically.
15+
- fileName: bleed-horizontal.tsx
16+
title: Horizontal
17+
description: >-
18+
Use to set bleed horizontally.
19+
- fileName: bleed-specific-direction.tsx
20+
title: Specific direction
21+
description: >-
22+
Use to set bleed in a specific direction
23+
- fileName: bleed-all-directions.tsx
24+
title: All directions
25+
description: >-
26+
Use to set bleed in all directions
27+
---
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import {Bleed, Box, Text} from '@shopify/polaris';
3+
4+
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
5+
6+
const styles = {
7+
background: 'var(--p-background-selected)',
8+
borderRadius: 'var(--p-border-radius-05)',
9+
border: '1px solid var(--p-surface-dark)',
10+
padding: 'var(--p-space-4)',
11+
height: 'var(--p-space-12)',
12+
opacity: 0.7,
13+
};
14+
15+
function BleedAllDirectionsExample() {
16+
return (
17+
<div style={{width: '500px'}}>
18+
<Box background="surface" border="base" padding="4">
19+
<Bleed spacing="6">
20+
<div style={styles}>
21+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
22+
All directions
23+
</Text>
24+
</div>
25+
</Bleed>
26+
</Box>
27+
</div>
28+
);
29+
}
30+
31+
export default withPolarisExample(BleedAllDirectionsExample);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import {Bleed, Box, Text} from '@shopify/polaris';
3+
4+
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
5+
6+
const styles = {
7+
background: 'var(--p-background-selected)',
8+
borderRadius: 'var(--p-border-radius-05)',
9+
border: '1px solid var(--p-surface-dark)',
10+
padding: 'var(--p-space-4)',
11+
height: 'var(--p-space-12)',
12+
opacity: 0.7,
13+
};
14+
15+
function BleedHorizontalExample() {
16+
return (
17+
<div style={{width: '500px'}}>
18+
<Box background="surface" border="base" padding="4">
19+
<Bleed horizontal="6">
20+
<div style={styles}>
21+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
22+
horizontal
23+
</Text>
24+
</div>
25+
</Bleed>
26+
</Box>
27+
</div>
28+
);
29+
}
30+
31+
export default withPolarisExample(BleedHorizontalExample);
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import React from 'react';
2+
import {Bleed, Box, Text} from '@shopify/polaris';
3+
4+
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
5+
6+
const styles = {
7+
background: 'var(--p-background-selected)',
8+
borderRadius: 'var(--p-border-radius-05)',
9+
border: '1px solid var(--p-surface-dark)',
10+
padding: 'var(--p-space-4)',
11+
height: 'var(--p-space-12)',
12+
opacity: 0.7,
13+
};
14+
15+
function BleedSpecificDirectionExample() {
16+
return (
17+
<div style={{width: '500px'}}>
18+
<Box background="surface" border="base" padding="4">
19+
<Bleed top="6">
20+
<div style={styles}>
21+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
22+
top
23+
</Text>
24+
</div>
25+
</Bleed>
26+
</Box>
27+
<br />
28+
<Box background="surface" border="base" padding="4">
29+
<Bleed right="6">
30+
<div style={styles}>
31+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
32+
right
33+
</Text>
34+
</div>
35+
</Bleed>
36+
</Box>
37+
<br />
38+
<Box background="surface" border="base" padding="4">
39+
<Bleed left="6">
40+
<div style={styles}>
41+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
42+
left
43+
</Text>
44+
</div>
45+
</Bleed>
46+
</Box>
47+
<br />
48+
<Box background="surface" border="base" padding="4">
49+
<Bleed bottom="6">
50+
<div style={styles}>
51+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
52+
bottom
53+
</Text>
54+
</div>
55+
</Bleed>
56+
</Box>
57+
<br />
58+
</div>
59+
);
60+
}
61+
62+
export default withPolarisExample(BleedSpecificDirectionExample);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import {Bleed, Box, Text} from '@shopify/polaris';
3+
4+
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
5+
6+
const styles = {
7+
background: 'var(--p-background-selected)',
8+
borderRadius: 'var(--p-border-radius-05)',
9+
border: '1px solid var(--p-surface-dark)',
10+
padding: 'var(--p-space-4)',
11+
height: 'var(--p-space-12)',
12+
opacity: 0.7,
13+
};
14+
15+
function BleedVerticalExample() {
16+
return (
17+
<div style={{width: '500px'}}>
18+
<Box background="surface" border="base" padding="4">
19+
<Bleed vertical="6">
20+
<div style={styles}>
21+
<Text variant="bodySm" as="h3" alignment="center" fontWeight="bold">
22+
vertical
23+
</Text>
24+
</div>
25+
</Bleed>
26+
</Box>
27+
</div>
28+
);
29+
}
30+
31+
export default withPolarisExample(BleedVerticalExample);
25.3 KB
Loading

0 commit comments

Comments
 (0)