Skip to content

Commit f75fdd8

Browse files
committed
[Typography foundations] Deprecate existing typography components on polaris.shopify.com (#6915)
1 parent d0e5017 commit f75fdd8

24 files changed

+173
-262
lines changed

.changeset/grumpy-donuts-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': minor
3+
---
4+
5+
Deprecated `DisplayText`, `Heading`, `Subheading`, `Caption`, `TextStyle`, and `VisuallyHidden` pages and removed examples

polaris.shopify.com/content/components/caption/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ keywords:
1515
- time text
1616
- compact text
1717
- small text
18-
examples:
19-
- fileName: caption-default.tsx
20-
title: Default
21-
description: Use to provide details in situations where content is compact and space is tight.
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+
2230
---
2331

2432
## Best practices

polaris.shopify.com/content/components/display-text/index.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,41 @@ keywords:
2323
- visual story telling
2424
- visual storytelling
2525
- visual statements
26-
examples:
27-
- fileName: display-text-extra-large.tsx
28-
title: Extra large
29-
description: Use this size sparingly and never multiple times on the same page.
30-
- fileName: display-text-large.tsx
31-
title: Large
32-
description: Use for display text that’s more important than the medium size, but less important than extra large.
33-
- fileName: display-text-medium.tsx
34-
title: Medium
35-
description: Use for display text that’s more important than the small size, but less important than large.
36-
- fileName: display-text-small.tsx
37-
title: Small
38-
description: Use for text that would otherwise use body text, but that needs to scale with other display text.
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+
3961
---
4062

4163
## Best practices

polaris.shopify.com/content/components/heading/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ keywords:
1414
- section headings
1515
- heading text
1616
- heading font
17-
examples:
18-
- fileName: heading-default.tsx
19-
title: Default
20-
description: Use for the title of each top-level page section.
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+
2129
---
2230

2331
## Best practices

polaris.shopify.com/content/components/subheading/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ keywords:
1010
- titles of sub-sections
1111
- subsection titles
1212
- titles of subsections
13-
examples:
14-
- fileName: subheading-default.tsx
15-
title: Default
16-
description: Used for the title of any sub-sections in top-level page sections.
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+
1725
---
1826

1927
## Best practices

polaris.shopify.com/content/components/text-style/index.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,55 @@ keywords:
1919
- decrease
2020
- input
2121
- fields
22-
examples:
23-
- fileName: text-style-subdued.tsx
24-
title: Subdued
25-
description: Use to de-emphasize a piece of text that is less important to merchants than other nearby text. May also be used to indicate when normal content is absent, for example, “No supplier listed”. Don’t use only for aesthetic effect.
26-
- fileName: text-style-strong.tsx
27-
title: Strong
28-
description: Use to mark text representing user input, or to emphasize the totals row in a price table.
29-
- fileName: text-style-positive.tsx
30-
title: Positive
31-
description: Use in combination with a symbol showing an increasing value to indicate an upward trend.
32-
- fileName: text-style-negative.tsx
33-
title: Negative
34-
description: Use in combination with a symbol showing a decreasing value to indicate a downward trend.
35-
- fileName: text-style-warning.tsx
36-
title: Warning
37-
description: Use to denote something that needs attention, or that merchants need to take action on.
38-
- fileName: text-style-code.tsx
39-
title: Code
40-
description: Use to display inline snippets of code or code-like text.
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+
4171
---
4272

4373
## Best practices

polaris.shopify.com/content/components/visually-hidden/index.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ keywords:
1717
- accessibility
1818
- a11y
1919
- assistive technology
20-
examples:
21-
- fileName: visually-hidden-default.tsx
22-
title: Default
23-
description: Always provide a heading for a major page section such as a card. In rare cases the heading is visually redundant and the meaning is conveyed by context. Rather than omit the heading, wrap the heading in the visually hidden component.
24-
- fileName: visually-hidden-table-headers.tsx
25-
title: Table headers
26-
description: Whenever one or more table columns has no need for a visible header, hide the header content rather than omitting it. Note that due to browser quirks the visually hidden component must go inside each `<th>`.
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="bodySm" as="h2">Title and description</Text>
32+
```
33+
2734
---
2835

2936
## Best practices

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ const Components = ({
5656
<Longform>
5757
<Markdown text={description} />
5858
{typedStatus && <StatusBanner status={typedStatus} />}
59-
<ComponentExamples examples={examples} />
60-
{propsForComponent && <PropsTable props={propsForComponent} />}
59+
{Boolean(examples.length) && <ComponentExamples examples={examples} />}
60+
{propsForComponent && typedStatus?.value !== 'deprecated' && (
61+
<PropsTable props={propsForComponent} />
62+
)}
6163
<Markdown text={readme.body} />
6264
</Longform>
6365
</Layout>

polaris.shopify.com/pages/examples/caption-default.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

polaris.shopify.com/pages/examples/display-text-extra-large.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)