diff --git a/CHANGELOG.md b/CHANGELOG.md index cebe705115..7926a3db16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Fixes +- Update `ChatMessage` styles in Teams themes @layershifter ([#1246](https://github.com/stardust-ui/react/pull/1246)) + ## [v0.29.0](https://github.com/stardust-ui/react/tree/v0.29.0) (2019-04-24) [Compare changes](https://github.com/stardust-ui/react/compare/v0.28.1...v0.29.0) diff --git a/docs/src/examples/components/Chat/Content/ChatExampleReactionGroup.shorthand.tsx b/docs/src/examples/components/Chat/Content/ChatExampleReactionGroup.shorthand.tsx index 26b9f56973..37cde2b7f2 100644 --- a/docs/src/examples/components/Chat/Content/ChatExampleReactionGroup.shorthand.tsx +++ b/docs/src/examples/components/Chat/Content/ChatExampleReactionGroup.shorthand.tsx @@ -1,7 +1,10 @@ import { Avatar, Chat } from '@stardust-ui/react' import * as React from 'react' -const reactions = [{ icon: 'thumbs up', content: '1K' }, { icon: 'thumbs down', content: 5 }] +const reactions = [ + { key: 'up', icon: 'thumbs up', content: '1K' }, + { key: 'down', icon: 'thumbs down', content: 5 }, +] const items = [ { @@ -27,7 +30,7 @@ const items = [ message: { content: ( , ChatMessageS timestamp: customPropTypes.itemShorthand, onBlur: PropTypes.func, onFocus: PropTypes.func, - reactionGroup: customPropTypes.itemShorthand, + reactionGroup: PropTypes.oneOfType([ + customPropTypes.collectionShorthand, + customPropTypes.itemShorthand, + ]), reactionGroupPosition: PropTypes.oneOf(['start', 'end']), } diff --git a/packages/react/src/themes/teams-dark/components/Chat/chatMessageVariables.ts b/packages/react/src/themes/teams-dark/components/Chat/chatMessageVariables.ts index ddaaf3413d..d2992cbc40 100644 --- a/packages/react/src/themes/teams-dark/components/Chat/chatMessageVariables.ts +++ b/packages/react/src/themes/teams-dark/components/Chat/chatMessageVariables.ts @@ -4,6 +4,8 @@ export default (siteVars: any): Partial => { return { backgroundColor: siteVars.gray10, backgroundColorMine: '#3B3C54', + authorColor: siteVars.gray02, // will be gray[250] with new palette + contentColor: siteVars.colors.white, color: siteVars.colors.white, contentFocusOutlineColor: siteVars.brand, hasMentionNubbinColor: siteVars.naturalColors.orange[900], // orange[300] when the new palette pr is checked in diff --git a/packages/react/src/themes/teams-high-contrast/components/Chat/chatMessageVariables.ts b/packages/react/src/themes/teams-high-contrast/components/Chat/chatMessageVariables.ts index 6727b67b4a..f70cd1a335 100644 --- a/packages/react/src/themes/teams-high-contrast/components/Chat/chatMessageVariables.ts +++ b/packages/react/src/themes/teams-high-contrast/components/Chat/chatMessageVariables.ts @@ -4,6 +4,8 @@ export default (siteVars: any): Partial => { return { backgroundColor: siteVars.black, backgroundColorMine: siteVars.black, + authorColor: siteVars.white, + contentColor: siteVars.white, color: siteVars.white, contentFocusOutlineColor: siteVars.colors.yellow[900], // Red flag (should this be accessibleYellow?) border: `1px solid ${siteVars.white}`, diff --git a/packages/react/src/themes/teams/components/Chat/chatMessageStyles.ts b/packages/react/src/themes/teams/components/Chat/chatMessageStyles.ts index e256e151ca..a84ca800bb 100644 --- a/packages/react/src/themes/teams/components/Chat/chatMessageStyles.ts +++ b/packages/react/src/themes/teams/components/Chat/chatMessageStyles.ts @@ -93,6 +93,7 @@ const chatMessageStyles: ComponentSlotStylesInput< author: ({ props: p, variables: v }): ICSSInJSStyle => ({ ...((p.mine || p.attached === 'bottom' || p.attached === true) && screenReaderContainerStyles), + color: v.authorColor, marginRight: v.authorMarginRight, marginBottom: v.headerMarginBottom, fontWeight: v.authorFontWeight, @@ -109,6 +110,7 @@ const chatMessageStyles: ComponentSlotStylesInput< }), content: ({ props: p, variables: v }): ICSSInJSStyle => ({ + color: v.contentColor, display: 'block', '& a:focus': { outline: 'none', diff --git a/packages/react/src/themes/teams/components/Chat/chatMessageVariables.ts b/packages/react/src/themes/teams/components/Chat/chatMessageVariables.ts index f206b873d0..39485ffd5f 100644 --- a/packages/react/src/themes/teams/components/Chat/chatMessageVariables.ts +++ b/packages/react/src/themes/teams/components/Chat/chatMessageVariables.ts @@ -11,8 +11,10 @@ export interface ChatMessageVariables { offset: string padding: string authorMarginRight: string + authorColor: string authorFontWeight: number headerMarginBottom: string + contentColor: string contentFocusOutlineColor: string border: string badgeShadow: string @@ -37,8 +39,10 @@ export default (siteVars): ChatMessageVariables => ({ offset: pxToRem(100), padding: pxToRem(16), authorMarginRight: pxToRem(12), - authorFontWeight: siteVars.fontWeightBold, + authorColor: siteVars.gray02, // will be gray[500] with new palette + authorFontWeight: siteVars.fontWeightRegular, headerMarginBottom: pxToRem(2), + contentColor: '#252423', // will be gray[750] with new palette contentFocusOutlineColor: siteVars.colors.primary[500], border: 'none', badgeShadow: siteVars.shadowLevel1Darker,