Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

fix(Chat): Adding dark and contrast theme files for Chat #652

Merged
merged 10 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Respect `defaultTabbable` element when `FocusZone` container gets focus @sophieH29 ([#637](https://github.com/stardust-ui/react/pull/637))
- Fix `FocusZone` - fix last breaking changes and make improvements for `Chat` usage @sophieH29 ([#614](https://github.com/stardust-ui/react/pull/614))
- Fix `defaultOpen` prop in the `Popup` component @mnajdova ([#659](https://github.com/stardust-ui/react/pull/659))
- Fix `Chat` - added themes values for dark and contrast @bcalvery ([#652](https://github.com/stardust-ui/react/pull/652))

### Features
- Add `color` prop to `Text` component @Bugaa92 ([#597](https://github.com/stardust-ui/react/pull/597))
Expand Down
2 changes: 2 additions & 0 deletions src/themes/teams-dark/componentVariables.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export { default as Button } from './components/Button/buttonVariables'
export { default as Chat } from './components/Chat/chatVariables'
export { default as ChatMessage } from './components/Chat/chatMessageVariables'
export { default as Divider } from './components/Divider/dividerVariables'
export { default as Header } from './components/Header/headerVariables'
export { default as Input } from './components/Input/inputVariables'
Expand Down
11 changes: 11 additions & 0 deletions src/themes/teams-dark/components/Chat/chatMessageVariables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ChatMessageVariables } from '../../../teams/components/Chat/chatMessageVariables'
import { Partial } from 'types/utils'

export default (siteVars: any): Partial<ChatMessageVariables> => {
return {
backgroundColor: siteVars.gray10,
backgroundColorMine: '#3B3C54',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this belong in site variables?

color: siteVars.white,
contentFocusOutlineColor: siteVars.brand,
}
}
8 changes: 8 additions & 0 deletions src/themes/teams-dark/components/Chat/chatVariables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ChatVariables } from '../../../teams/components/Chat/chatVariables'
import { Partial } from 'types/utils'

export default (siteVars: any): Partial<ChatVariables> => {
return {
backgroundColor: siteVars.black,
}
}
2 changes: 2 additions & 0 deletions src/themes/teams-high-contrast/componentVariables.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export { default as Avatar } from './components/Avatar/avatarVariables'
export { default as Button } from './components/Button/buttonVariables'
export { default as Chat } from './components/Chat/chatVariables'
export { default as ChatMessage } from './components/Chat/chatMessageVariables'
export { default as Divider } from './components/Divider/dividerVariables'
export { default as Header } from './components/Header/headerVariables'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ChatMessageVariables } from '../../../teams/components/Chat/chatMessageVariables'
import { Partial } from 'types/utils'

export default (siteVars: any): Partial<ChatMessageVariables> => {
return {
backgroundColor: siteVars.black,
backgroundColorMine: siteVars.black,
color: siteVars.white,
contentFocusOutlineColor: siteVars.yellow,
border: `1px solid ${siteVars.white}`,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ChatVariables } from '../../../teams/components/Chat/chatVariables'
import { Partial } from 'types/utils'

export default (siteVars: any): Partial<ChatVariables> => {
return {
backgroundColor: siteVars.black,
}
}
1 change: 1 addition & 0 deletions src/themes/teams/components/Chat/chatMessageStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const chatMessageStyles: ComponentSlotStylesInput<ChatMessageProps, ChatMessageV
display: 'inline-block',
padding: v.padding,
borderRadius: v.borderRadius,
border: v.border,
color: v.color,
backgroundColor: p.mine ? v.backgroundColorMine : v.backgroundColor,
maxWidth: v.width,
Expand Down
4 changes: 3 additions & 1 deletion src/themes/teams/components/Chat/chatMessageVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ export interface ChatMessageVariables {
padding: string
authorMargin: string
contentFocusOutlineColor: string
border: string
}

export default (siteVars): ChatMessageVariables => ({
width: '80%',
backgroundColor: siteVars.white,
backgroundColorMine: '#E0E0ED',
backgroundColorMine: '#E5E5F1',
borderRadius: '0.3rem',
color: 'rgb(64, 64, 64)',
padding: pxToRem(14),
authorMargin: pxToRem(10),
contentFocusOutlineColor: siteVars.brand,
border: 'none',
})