This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Avatar component * reference images * readme * WW * updated props, accessible text via ScreanreaderText component * cleanup * story cleanup * test cleanup * CSS cleanup * story cleanup * reference images without the extra margins * Updating Avatar asset and link to Zeplin * Adding a rule to cover small badges also for small avatars * ref images for small badge size
- Loading branch information
P.J. Swesey
authored and
GitHub Enterprise
committed
Jun 1, 2017
1 parent
223e814
commit 2b935fc
Showing
38 changed files
with
797 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.68 KB
...ence/storybook_tests_Avatar_-_with_abbreviated_text_0_body_0_phone_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.5 KB
...erence/storybook_tests_Avatar_-_with_abbreviated_text_0_body_1_desktop_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.7 KB
...kstop/reference/storybook_tests_Avatar_-_with_badge_0_body_0_phone_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.3 KB
...ackstop/reference/storybook_tests_Avatar_-_with_badge_0_body_1_desktop_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.1 KB
...kstop/reference/storybook_tests_Avatar_-_with_image_0_body_0_phone_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.4 KB
...ackstop/reference/storybook_tests_Avatar_-_with_image_0_body_1_desktop_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.2 KB
...reference/storybook_tests_Avatar_-_with_soft_border_0_body_0_phone_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.8 KB
...p/reference/storybook_tests_Avatar_-_with_soft_border_0_body_1_desktop_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
...eference/storybook_tests_ScreenreaderText_-_default_0_body_0_phone_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.5 KB
.../reference/storybook_tests_ScreenreaderText_-_default_0_body_1_desktop_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
178 changes: 178 additions & 0 deletions
178
src/components/Avatar/__snapshots__/avatar.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Avatar /> accessible text with badge description matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME - BADGE | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> accessible text without badge description matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with abbreviated text matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageInitials="AB" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with additional className matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar TEST_CLASSNAME" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with badge content matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={1} | ||
/> | ||
<div | ||
className="y-avatar--badge y-avatar__size-xSmall--badge" | ||
> | ||
<Text> | ||
badge | ||
</Text> | ||
</div> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with image url matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with long abbreviated text and size XSMALL matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageInitials="A" | ||
presence={0} | ||
primaryText="" | ||
size={1} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with long abbreviated text matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageInitials="AB" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with size matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={5} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; | ||
|
||
exports[`<Avatar /> with soft border type matches its snapshot 1`] = ` | ||
<div | ||
className="y-avatar y-avatar__borderType-soft" | ||
> | ||
<Persona | ||
hidePersonaDetails={true} | ||
imageUrl="test.jpg" | ||
presence={0} | ||
primaryText="" | ||
size={3} | ||
/> | ||
<ScreenreaderText> | ||
NAME | ||
</ScreenreaderText> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.y-avatar { | ||
display: inline-block; | ||
position: relative; | ||
} | ||
|
||
.y-avatar--badge { | ||
position: absolute; | ||
height: 20px; | ||
width: 20px; | ||
bottom: -2px; | ||
right: -2px; | ||
overflow: hidden; | ||
border-radius: 50%; | ||
border: solid 2px #fff; | ||
} | ||
.y-avatar__size-small--badge, | ||
.y-avatar__size-xSmall--badge { | ||
height: 16px; | ||
width: 16px; | ||
} | ||
|
||
/* Fabric CSS overrides */ | ||
.y-avatar > .ms-Persona { | ||
margin: 0; | ||
} | ||
.y-avatar__borderType-soft .ms-Persona-imageArea, | ||
.y-avatar__borderType-soft .ms-Image { | ||
border-radius: 2px; | ||
} |
Oops, something went wrong.