Skip to content

Commit be95719

Browse files
Eduardo Vargas Torresdannify
andauthored
FIX 1084, 1085: Update docs + Add NoSearchResults illustration (#1086)
Co-authored-by: Danni <[email protected]>
1 parent 61d8633 commit be95719

File tree

3 files changed

+66
-19
lines changed

3 files changed

+66
-19
lines changed

packages/@react-spectrum/illustratedmessage/docs/IllustratedMessage.mdx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ keywords: [illustrated message]
2929

3030
<p>{docs.exports.IllustratedMessage.description}</p>
3131

32-
<HeaderInfo
33-
packageData={packageData}
34-
componentNames={['IllustratedMessage']} />
32+
<HeaderInfo packageData={packageData} componentNames={['IllustratedMessage']} />
3533

3634
## Example
3735

@@ -40,7 +38,7 @@ import NotFound from '@spectrum-icons/illustrations/NotFound';
4038

4139
<IllustratedMessage>
4240
<NotFound />
43-
<Heading>No Results</Heading>
41+
<Heading>No results</Heading>
4442
<Content>Try another search</Content>
4543
</IllustratedMessage>
4644
```
@@ -56,7 +54,7 @@ import Upload from '@spectrum-icons/illustrations/Upload';
5654

5755
<IllustratedMessage>
5856
<Upload />
59-
<Heading>Drag and Drop Your File</Heading>
57+
<Heading>Drag and Drop your file</Heading>
6058
<Content>Select a File from your computer<br /> or Search Adobe Stock</Content>
6159
</IllustratedMessage>
6260
```
@@ -83,10 +81,22 @@ If you pass an SVG in yourself, you'll need to ensure that the `role` prop is se
8381

8482
<PropTable component={docs.exports.IllustratedMessage} links={docs.links} />
8583

86-
## Example Illustrations
84+
## Example illustrations
8785

8886
The below examples make use of illustrations included in the [@spectrum-icons/illustrations](http://npmjs.com/@spectrum-icons/illustrations) package.
8987

88+
### No search results
89+
90+
```tsx example
91+
import NoSearchResults from '@spectrum-icons/illustrations/NoSearchResults';
92+
93+
<IllustratedMessage>
94+
<NoSearchResults />
95+
<Heading>No matching results</Heading>
96+
<Content>Try another search.</Content>
97+
</IllustratedMessage>
98+
```
99+
90100
### 403 Forbidden
91101

92102
```tsx example
@@ -99,7 +109,7 @@ import Unauthorized from '@spectrum-icons/illustrations/Unauthorized';
99109
</IllustratedMessage>
100110
```
101111

102-
### 404 Not Found
112+
### 404 Not found
103113

104114
```tsx example
105115
<IllustratedMessage>
@@ -109,7 +119,7 @@ import Unauthorized from '@spectrum-icons/illustrations/Unauthorized';
109119
</IllustratedMessage>
110120
```
111121

112-
### 500 Internal Server Error
122+
### 500 Internal server error
113123

114124
```tsx example
115125
import Error from '@spectrum-icons/illustrations/Error';
@@ -121,26 +131,26 @@ import Error from '@spectrum-icons/illustrations/Error';
121131
</IllustratedMessage>
122132
```
123133

124-
### 503 Service Unavailable
134+
### 503 Service unavailable
125135

126136
```tsx example
127137
import Unavailable from '@spectrum-icons/illustrations/Unavailable';
128138

129139
<IllustratedMessage>
130140
<Unavailable />
131-
<Heading>Error 503: Service Unavailable</Heading>
141+
<Heading>Error 503: Service unavailable</Heading>
132142
<Content>This page isn't working. Try a different page or try again later.</Content>
133143
</IllustratedMessage>
134144
```
135145

136-
### 504 Gateway Timeout
146+
### 504 Gateway timeout
137147

138148
```tsx example
139149
import Timeout from '@spectrum-icons/illustrations/Timeout';
140150

141151
<IllustratedMessage>
142152
<Timeout />
143-
<Heading>Error 504: Server Timeout</Heading>
153+
<Heading>Error 504: Server timeout</Heading>
144154
<Content>The server took too long. Please try again later.</Content>
145155
</IllustratedMessage>
146156
```

packages/@react-spectrum/illustratedmessage/stories/IllustratedMessage.stories.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Error from '@spectrum-icons/illustrations/src/Error';
1515
import {Heading} from '@react-spectrum/text';
1616
import {IllustratedMessage} from '../';
1717
import {Link} from '@react-spectrum/link';
18+
import NoSearchResults from '@spectrum-icons/illustrations/src/NoSearchResults';
1819
import NotFound from '@spectrum-icons/illustrations/src/NotFound';
1920
import React from 'react';
2021
import {storiesOf} from '@storybook/react';
@@ -27,11 +28,19 @@ storiesOf('IllustratedMessage', module)
2728
.add(
2829
'Not found',
2930
() => render({
30-
heading: 'Error 404: Page not found.',
31+
heading: 'Error 404: Page not found',
3132
description: 'This page isn’t available. Try checking the URL or visit a different page.',
3233
illustration: <NotFound />
3334
})
3435
)
36+
.add(
37+
'No search results',
38+
() => render({
39+
heading: 'No matching results',
40+
description: 'Try another search.',
41+
illustration: <NoSearchResults />
42+
})
43+
)
3544
.add(
3645
'Unauthorized',
3746
() => render({
@@ -78,12 +87,8 @@ storiesOf('IllustratedMessage', module)
7887
);
7988

8089
function render(props: any = {}) {
81-
let {
82-
illustration,
83-
heading,
84-
description,
85-
...otherProps
86-
} = props;
90+
let {illustration, heading, description, ...otherProps} = props;
91+
8792
return (
8893
<IllustratedMessage {...otherProps}>
8994
{description && <Content>{description}</Content>}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { getIllustrationProps, IllustrationProps } from "./utils";
2+
import React from "react";
3+
4+
export default function NoSearchResults(props: IllustrationProps) {
5+
return (
6+
<svg
7+
xmlns="http://www.w3.org/2000/svg"
8+
width="99.039"
9+
height="94.342"
10+
{...getIllustrationProps(props)}
11+
>
12+
<g
13+
fill="none"
14+
stroke-linecap="round"
15+
stroke-linejoin="round"
16+
>
17+
<path
18+
d="M93.113 88.415a5.38 5.38 0 0 1-7.61 0L58.862 61.773a1.018 1.018 0 0 1 0-1.44l6.17-6.169a1.018 1.018 0 0 1 1.439 0l26.643 26.643a5.38 5.38 0 0 1 0 7.608z"
19+
stroke-width="2.99955"
20+
></path>
21+
<path
22+
stroke-width="2"
23+
d="M59.969 59.838l-3.246-3.246M61.381 51.934l3.246 3.246M64.609 61.619l13.327 13.327"
24+
></path>
25+
<path
26+
d="M13.311 47.447A28.87 28.87 0 1 0 36.589 1.5c-10.318 0-20.141 5.083-24.7 13.46M2.121 38.734l15.536-15.536M17.657 38.734L2.121 23.198"
27+
stroke-width="3"
28+
></path>
29+
</g>
30+
</svg>
31+
);
32+
}

0 commit comments

Comments
 (0)