Skip to content

Commit 1333261

Browse files
authored
Re-add deprecated typography docs (#8206)
### WHY are these changes introduced? Re-adds the deprecated typography docs and images on the style guide so that users can still reference them. The `get-props` script had to be updated to resolve build errors. It was failing since the component files no longer existed in `polaris-react/src/components`. ### WHAT is this pull request doing? - Re-add dep components images - Re-add dep component pages - ~Adds new `deprecatedComponents` array to the `get-props` file and if the parsed file matches any of the elements, return empty object~ - If component status is deprecated, props table is not rendered on component page <!-- ℹ️ 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 - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 0f0dca0 commit 1333261

File tree

14 files changed

+256
-0
lines changed

14 files changed

+256
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Caption
3+
description: Caption text size is smaller than the recommended size for general reading. On web, it should be used only in a graph or as a timestamp for a list item. On Android and iOS, it can also be used as help text or as other kinds of secondary text for list items.
4+
category: Titles and text
5+
keywords:
6+
- labels
7+
- text
8+
- microcopy
9+
- typographic
10+
- graph
11+
- timestamp
12+
- smaller text
13+
- smallest text
14+
- smaller than reading size text
15+
- time text
16+
- compact text
17+
- small text
18+
status:
19+
value: Deprecated
20+
message: This component is no longer supported. Please use the Text component instead.
21+
---
22+
23+
## Mapping to the Text component
24+
25+
```diff
26+
- <Caption>Received April 21, 2017</Caption>
27+
+ <Text variant="bodySm" as="p">Received April 21, 2017</Text>
28+
```
29+
30+
---
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Display text
3+
description: Display styles make a bold visual statement. Use them to create impact when the main goal is visual storytelling. For example, use display text to convince or reassure merchants such as in marketing content or to capture attention during onboarding.
4+
category: Titles and text
5+
keywords:
6+
- DisplayText
7+
- announcement text
8+
- greeting text
9+
- marketing text
10+
- title text
11+
- biggest text
12+
- bigger text
13+
- big text
14+
- large text
15+
- larger text
16+
- largest text
17+
- strong text
18+
- bold text
19+
- bold statements
20+
- extra large display text
21+
- medium and large display text
22+
- small display text
23+
- visual story telling
24+
- visual storytelling
25+
- visual statements
26+
status:
27+
value: Deprecated
28+
message: This component is no longer supported. Please use the Text component instead.
29+
---
30+
31+
## Mapping to the Text component
32+
33+
### Small
34+
35+
```diff
36+
- <DisplayText size="small">Sales this year</DisplayText>
37+
+ <Text variant="headingLg" as="p">Sales this year</Text>
38+
```
39+
40+
### Medium
41+
42+
```diff
43+
- <DisplayText size="medium">Sales this year</DisplayText>
44+
+ <Text variant="headingXl" as="p">Sales this year</Text>
45+
```
46+
47+
### Large
48+
49+
```diff
50+
- <DisplayText size="large">Sales this year</DisplayText>
51+
+ <Text variant="heading2xl" as="p">Sales this year</Text>
52+
```
53+
54+
### Extra large
55+
56+
```diff
57+
- <DisplayText size="extraLarge">Sales this year</DisplayText>
58+
+ <Text variant="heading4xl" as="p">Sales this year</Text>
59+
```
60+
61+
---
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Heading
3+
description: Headings are used as the titles of each major section of a page in the interface. For example, [card components](https://polaris.shopify.com/components/card) generally use headings as their title.
4+
category: Titles and text
5+
keywords:
6+
- titles
7+
- text
8+
- microcopy
9+
- conversational
10+
- typographic
11+
- card headings
12+
- card titles
13+
- section titles
14+
- section headings
15+
- heading text
16+
- heading font
17+
status:
18+
value: Deprecated
19+
message: This component is no longer supported. Please use the Text component instead.
20+
---
21+
22+
## Mapping to the Text component
23+
24+
```diff
25+
- <Heading>Online store dashboard</Heading>
26+
+ <Text variant="headingMd" as="h2">Online store dashboard</Text>
27+
```
28+
29+
---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Subheading
3+
description: Subheadings are used for the title of any sub-sections in top-level page sections.
4+
category: Titles and text
5+
keywords:
6+
- title bar
7+
- top-level
8+
- description
9+
- sub-section titles
10+
- titles of sub-sections
11+
- subsection titles
12+
- titles of subsections
13+
status:
14+
value: Deprecated
15+
message: This component is no longer supported. Please use the Text component instead.
16+
---
17+
18+
## Mapping to the Text component
19+
20+
```diff
21+
- <Subheading>Accounts</Subheading>
22+
+ <Text variant="headingXs" as="h3">Accounts</Text>
23+
```
24+
25+
---
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Text style
3+
description: Text style enhances text with additional visual meaning. For example, using subdued text to de-emphasize it from its surrounding text.
4+
category: Titles and text
5+
keywords:
6+
- TextStyle
7+
- typographic
8+
- subdued
9+
- strong
10+
- negative
11+
- warning
12+
- positive
13+
- cues
14+
- enhancements
15+
- type
16+
- bold
17+
- dollar
18+
- increase
19+
- decrease
20+
- input
21+
- fields
22+
status:
23+
value: Deprecated
24+
message: This component is no longer supported. Please use the Text component instead.
25+
---
26+
27+
## Mapping to the Text component
28+
29+
### Subdued
30+
31+
```diff
32+
- <TextStyle variation="subdued">No supplier listed</TextStyle>
33+
+ <Text variant="bodyMd" as="span" color="subdued">No supplier listed</Text>
34+
```
35+
36+
### Strong
37+
38+
```diff
39+
- <TextStyle variation="strong">No supplier listed</TextStyle>
40+
+ <Text variant="bodyMd" as="span" fontWeight="semibold">No supplier listed</Text>
41+
```
42+
43+
### Positive
44+
45+
```diff
46+
- <TextStyle variation="positive">No supplier listed</TextStyle>
47+
+ <Text variant="bodyMd" as="span" color="success">No supplier listed</Text>
48+
```
49+
50+
### Negative
51+
52+
```diff
53+
- <TextStyle variation="negative">No supplier listed</TextStyle>
54+
+ <Text variant="bodyMd" as="span" color="critical">No supplier listed</Text>
55+
```
56+
57+
### Warning
58+
59+
```diff
60+
- <TextStyle variation="warning">No supplier listed</TextStyle>
61+
+ <Text variant="bodyMd" as="span" color="warning">No supplier listed</Text>
62+
```
63+
64+
### Code
65+
66+
```diff
67+
- <TextStyle variation="code">No supplier listed</TextStyle>
68+
+ <Text variant="bodyMd" as="span"><InlineCode>No supplier listed</InlineCode></Text>
69+
```
70+
71+
---
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Visually hidden
3+
description: Use when an element needs to be available to assistive technology (for example, a screen reader) but otherwise hidden.
4+
category: Titles and text
5+
keywords:
6+
- VisuallyHidden
7+
- screen readers
8+
- hidden but available for screen readers
9+
- visually hidden headings
10+
- hide
11+
- hidden headings
12+
- hidden text
13+
- visually hidden table headers
14+
- visually hidden headers
15+
- hidden table headers
16+
- hidden table headings
17+
- accessibility
18+
- a11y
19+
- assistive technology
20+
status:
21+
value: Deprecated
22+
message: This component is no longer supported. Please use the Text component instead.
23+
---
24+
25+
## Mapping to the Text component
26+
27+
```diff
28+
- <VisuallyHidden>
29+
- <Heading>Title and description</Heading>
30+
- </VisuallyHidden>
31+
+ <Text visuallyHidden variant="headingMd" as="h2">Title and description</Text>
32+
```
33+
34+
---

polaris.shopify.com/pages/components/[component].tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const getStaticProps: GetStaticProps<
126126
allType,
127127
propName,
128128
`polaris-react/src/components/${componentDirName}/${componentDirName}.tsx`,
129+
data.frontMatter.status?.value || '',
129130
);
130131

131132
const props: Props = {
13.8 KB
Loading
22.8 KB
Loading
12.4 KB
Loading

0 commit comments

Comments
 (0)