This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
fix(Avatar): Adding dark and contrast theme files for Avatar and Status Indicator. #373
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
335400f
Adding dark and contrast theme files for Avatar and Status Indicator.
bcalvery 47f3c9e
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery daf16d3
Making Avatar Status Indicator respond to theme change.
bcalvery 0a3b556
pass through styles variables and classes for icon in status indicator
bcalvery 15d9245
reverting changes for avatar example shorthand.
bcalvery c49005e
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery 6ec6b91
changing language for usage example.
bcalvery dfd47be
Merge branch 'master' of https://github.com/stardust-ui/react into fi…
bcalvery 48e7aa1
changes based on Roman's comments.
bcalvery a26b319
undoing unnecessary file changes
bcalvery afe1a99
remove duplication in theme variations
kuzhelov-ms 110fd79
Added changelog entries
bcalvery 75e1cb8
merge from master
bcalvery 0a813d5
Merge branch 'master' into fix/avatar-darktheme
bcalvery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
57 changes: 57 additions & 0 deletions
57
docs/src/examples/components/Avatar/Usage/AvatarUsageExample.shorthand.tsx
This file contains hidden or 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,57 @@ | ||
import React from 'react' | ||
import { Avatar } from '@stardust-ui/react' | ||
|
||
const status = { color: 'green', icon: 'check', title: 'Available' } | ||
|
||
const AvatarUsageExampleShorthand = () => ( | ||
<div> | ||
Correct: | ||
<div> | ||
<div style={{ backgroundColor: 'violet', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar | ||
name="John Doe (Software Developer)" | ||
status={status} | ||
variables={{ statusBorderColor: 'violet' }} | ||
/> | ||
</div> | ||
<div style={{ backgroundColor: 'yellowgreen', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar | ||
name="John Doe (Software Developer)" | ||
status={status} | ||
variables={{ statusBorderColor: 'yellowgreen' }} | ||
/> | ||
</div> | ||
<div style={{ backgroundColor: 'orangered', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar | ||
name="John Doe (Software Developer)" | ||
status={status} | ||
variables={{ statusBorderColor: 'orangered' }} | ||
/> | ||
</div> | ||
<div style={{ backgroundColor: 'cornflowerblue', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar | ||
name="John Doe (Software Developer)" | ||
status={status} | ||
variables={{ statusBorderColor: 'cornflowerblue' }} | ||
/> | ||
</div> | ||
</div> | ||
Incorrect (Border should not be visible, unless in Contrast theme): | ||
<div> | ||
<div style={{ backgroundColor: 'violet', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar name="John Doe (Software Developer)" status={status} /> | ||
</div> | ||
<div style={{ backgroundColor: 'yellowgreen', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar name="John Doe (Software Developer)" status={status} /> | ||
</div> | ||
<div style={{ backgroundColor: 'orangered', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar name="John Doe (Software Developer)" status={status} /> | ||
</div> | ||
<div style={{ backgroundColor: 'cornflowerblue', padding: '1rem', display: 'inline-block' }}> | ||
<Avatar name="John Doe (Software Developer)" status={status} /> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default AvatarUsageExampleShorthand |
This file contains hidden or 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,15 @@ | ||
import React from 'react' | ||
import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' | ||
|
||
const Usage = () => ( | ||
<ExampleSection title="Usage"> | ||
<ComponentExample | ||
title="Match Background Example" | ||
description="The status border for avatar should be set to match whatever background it is on." | ||
examplePath="components/Avatar/Usage/AvatarUsageExample" | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default Usage |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
58 changes: 3 additions & 55 deletions
58
src/themes/teams-dark/components/Button/buttonVariables.ts
This file contains hidden or 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
13 changes: 7 additions & 6 deletions
13
src/themes/teams-dark/components/Divider/dividerVariables.ts
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export default (siteVars: any) => { | ||
return { | ||
primaryColor: siteVars.brand06, | ||
textColor: siteVars.gray02, | ||
} | ||
} | ||
import { DividerVariables } from '../../../teams/components/Divider/dividerVariables' | ||
import { Partial } from 'types/utils' | ||
|
||
export default (siteVars: any): Partial<DividerVariables> => ({ | ||
primaryColor: siteVars.brand06, | ||
textColor: siteVars.gray02, | ||
}) |
This file contains hidden or 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 |
---|---|---|
@@ -1,23 +1,13 @@ | ||
export interface TextVariables { | ||
atMentionMeColor: string | ||
atMentionOtherColor: string | ||
disabledColor: string | ||
errorColor: string | ||
importantColor: string | ||
successColor: string | ||
timestampColor: string | ||
timestampHoverColor: string | ||
} | ||
import { TextVariables } from '../../../teams/components/Text/textVariables' | ||
import { Partial } from 'types/utils' | ||
|
||
export default (siteVariables): TextVariables => { | ||
return { | ||
atMentionMeColor: siteVariables.orange04, | ||
atMentionOtherColor: siteVariables.brand06, | ||
disabledColor: siteVariables.gray06, | ||
errorColor: siteVariables.red, | ||
importantColor: siteVariables.red, | ||
successColor: siteVariables.green04, | ||
timestampColor: siteVariables.gray04, | ||
timestampHoverColor: siteVariables.gray02, | ||
} | ||
} | ||
export default (siteVariables): Partial<TextVariables> => ({ | ||
atMentionMeColor: siteVariables.orange04, | ||
atMentionOtherColor: siteVariables.brand06, | ||
disabledColor: siteVariables.gray06, | ||
errorColor: siteVariables.red, | ||
importantColor: siteVariables.red, | ||
successColor: siteVariables.green04, | ||
timestampColor: siteVariables.gray04, | ||
timestampHoverColor: siteVariables.gray02, | ||
}) |
This file contains hidden or 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as Text } from './components/Text/textVariables' | ||
export { default as Avatar } from './components/Avatar/avatarVariables' | ||
export { default as Divider } from './components/Divider/dividerVariables' | ||
export { default as Text } from './components/Text/textVariables' |
6 changes: 6 additions & 0 deletions
6
src/themes/teams-high-contrast/components/Avatar/avatarVariables.ts
This file contains hidden or 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,6 @@ | ||
import { AvatarVariables } from '../../../teams/components/Avatar/avatarVariables' | ||
import { Partial } from 'types/utils' | ||
|
||
export default (siteVariables: any): Partial<AvatarVariables> => ({ | ||
statusBorderColor: siteVariables.black, | ||
}) |
15 changes: 8 additions & 7 deletions
15
src/themes/teams-high-contrast/components/Divider/dividerVariables.ts
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export default (siteVars: any) => { | ||
return { | ||
dividerColor: siteVars.white, | ||
textColor: siteVars.white, | ||
primaryColor: siteVars.white, | ||
} | ||
} | ||
import { DividerVariables } from '../../../teams/components/Divider/dividerVariables' | ||
import { Partial } from 'types/utils' | ||
|
||
export default (siteVars: any): Partial<DividerVariables> => ({ | ||
dividerColor: siteVars.white, | ||
textColor: siteVars.white, | ||
primaryColor: siteVars.white, | ||
}) |
34 changes: 12 additions & 22 deletions
34
src/themes/teams-high-contrast/components/Text/textVariables.ts
This file contains hidden or 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 |
---|---|---|
@@ -1,23 +1,13 @@ | ||
export interface TextVariables { | ||
atMentionMeColor: string | ||
atMentionOtherColor: string | ||
disabledColor: string | ||
errorColor: string | ||
importantColor: string | ||
successColor: string | ||
timestampColor: string | ||
timestampHoverColor: string | ||
} | ||
import { TextVariables } from '../../../teams/components/Text/textVariables' | ||
import { Partial } from 'types/utils' | ||
|
||
export default (siteVariables): TextVariables => { | ||
return { | ||
atMentionMeColor: siteVariables.accessibleYellow, | ||
atMentionOtherColor: siteVariables.accessibleYellow, | ||
disabledColor: siteVariables.accessibleGreen, | ||
errorColor: siteVariables.red, | ||
importantColor: siteVariables.red, | ||
successColor: siteVariables.green04, | ||
timestampColor: siteVariables.white, | ||
timestampHoverColor: siteVariables.white, | ||
} | ||
} | ||
export default (siteVariables): Partial<TextVariables> => ({ | ||
atMentionMeColor: siteVariables.accessibleYellow, | ||
atMentionOtherColor: siteVariables.accessibleYellow, | ||
disabledColor: siteVariables.accessibleGreen, | ||
errorColor: siteVariables.red, | ||
importantColor: siteVariables.red, | ||
successColor: siteVariables.green04, | ||
timestampColor: siteVariables.white, | ||
timestampHoverColor: siteVariables.white, | ||
}) |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
export default () => ({ | ||
statusBorderColor: 'white', | ||
export interface AvatarVariables { | ||
statusBorderColor: string | ||
statusBorderWidth: number | ||
} | ||
|
||
export default (siteVariables): AvatarVariables => ({ | ||
statusBorderColor: siteVariables.bodyBackground, | ||
statusBorderWidth: 2, | ||
}) |
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note for future: for all the components we have this section where examples that are rather theme-specific are provided. It is a clear indicator that we should think about mechanisms for theme developers to define custom docs section where theme-specific examples will be provided.