Skip to content

Commit cc9dca4

Browse files
chazdeanlaurkim
andauthored
[Layout foundations] Add alpha page in style guide for Bleed (#7276)
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #7258 <!-- link to issue if one exists --> <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? Adds alpha page and examples for `Bleed` component <details> <summary>Bleed alpha page</summary> <img src="https://user-images.githubusercontent.com/59836805/192337493-298b15a6-6622-452f-89ac-d6a90110d25c.gif" alt="Bleed alpha page"> </details> <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> <!-- ℹ️ Delete the following for small / trivial changes --> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) <!-- Give as much information as needed to experiment with the component in the playground. --> <details> <summary>Copy-paste this code in <code>playground/Playground.tsx</code>:</summary> ```jsx import React from 'react'; import {Page} from '../src'; export function Playground() { return ( <Page title="Playground"> {/* Add the code you want to test in here */} </Page> ); } ``` </details> ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide Co-authored-by: Lo Kim <[email protected]>
1 parent a38b3ba commit cc9dca4

File tree

7 files changed

+608
-235
lines changed

7 files changed

+608
-235
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: Used to create a container that applies negative margins to allow content to extend 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)