Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d4f986e
toolbar changes to correct vocus state
bcalvery Sep 30, 2019
cc93bbe
adding correct circular button focus
bcalvery Oct 1, 2019
69e9117
toolbar menu item focus added
bcalvery Oct 1, 2019
38f4c87
fixing buttonVariables bugs in hc and dark
bcalvery Oct 1, 2019
dfeac2c
adding keyboard focus indicator to listItem
bcalvery Oct 1, 2019
b5e0a35
merge from master
bcalvery Oct 1, 2019
9b5af7a
Merge branch 'master' of https://github.com/stardust-ui/react into fe…
bcalvery Oct 4, 2019
20a6d9d
update changelog
bcalvery Oct 4, 2019
b2603b4
Merge branch 'master' of https://github.com/stardust-ui/react into fe…
bcalvery Oct 4, 2019
0a3884e
Merge branch 'master' of https://github.com/stardust-ui/react into fe…
bcalvery Oct 7, 2019
a44afcc
merge from master
bcalvery Oct 14, 2019
a064c12
resolving hover not showing
bcalvery Oct 14, 2019
16db4be
Merge branch 'feat/add-focus-toolbar-icons' of https://github.com/sta…
bcalvery Oct 14, 2019
05b6744
removing active visuals from focus in Button
bcalvery Oct 15, 2019
59d9b64
merge from master
bcalvery Oct 15, 2019
a15dda0
fix small errors in dark and contrast buttons
bcalvery Oct 15, 2019
7164d5f
fixing contrast theme for button
bcalvery Oct 15, 2019
33ba3de
reording styles to reduce changes
bcalvery Oct 15, 2019
efd56b3
hide button shadow only on press
bcalvery Oct 16, 2019
36a4566
adding background none for primary button press
bcalvery Oct 16, 2019
67b201d
refactoring button styles and variables to use Color Scheme
bcalvery Oct 17, 2019
7849153
Merge branch 'master' of https://github.com/stardust-ui/react into fe…
bcalvery Oct 17, 2019
956fef4
merge from master
bcalvery Oct 21, 2019
1a86434
Merge branch 'master' of https://github.com/microsoft/fluent-ui-react…
bcalvery Oct 22, 2019
b6d2db2
changing dropdown style to make dropdownMoveFocusOnTab test pass
bcalvery Oct 23, 2019
5e038c2
Merge branch 'master' of https://github.com/microsoft/fluent-ui-react…
bcalvery Oct 23, 2019
0efb0e5
fix changelog automerge problem
bcalvery Oct 24, 2019
cf6a8c1
merge from master
bcalvery Oct 24, 2019
3632709
Merge branch 'master' of https://github.com/microsoft/fluent-ui-react…
bcalvery Oct 24, 2019
ecf3c2b
add zIndex for getBorderFocus to help border apear on top of neighbors
bcalvery Oct 25, 2019
52900b6
Merge branch 'master' of https://github.com/microsoft/fluent-ui-react…
bcalvery Oct 25, 2019
b6c995f
fixing contrast theme disabled button styles
bcalvery Oct 25, 2019
4ebd08b
fix erroneous left and right borders on toolbar menuitem focus
bcalvery Oct 25, 2019
2c14b56
un-nesting active state from focus state in button
bcalvery Oct 25, 2019
ee5a0cb
removing unused button darktheme file
bcalvery Oct 25, 2019
3b723db
Merge branch 'master' of https://github.com/microsoft/fluent-ui-react…
bcalvery Oct 28, 2019
ed0b081
removing unused focus variables from toolbar
bcalvery Oct 29, 2019
7a3f3c5
simplifying when selectors have only borderFocusStyles and no other s…
bcalvery Oct 29, 2019
b107ca0
update changelog entry
bcalvery Oct 29, 2019
e72b613
reformatting high contrast button styles to move contrast only variab…
bcalvery Oct 29, 2019
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 @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixes
- Update `call-missed-line` icon in Teams theme @codepretty ([#2059](https://github.com/stardust-ui/react/pull/2059))
- Show debug panel correctly for components with no owner @miroslavstastny ([#2055](https://github.com/stardust-ui/react/pull/2055))
- Update `listItem`, `button`, `toolbar`, `toolbarMenu` to use `getBorderFocusStyles` in the Teams theme @bcalvery ([#2011](https://github.com/stardust-ui/react/pull/2011))
- Correctly handle empty key actions in RTL @miroslavstastny ([#2060](https://github.com/stardust-ui/react/pull/2060))
- Accessibility improvements for `tree` and `splitButton` @kolaps33 ([#2032](https://github.com/stardust-ui/react/pull/2032))
- Update color scheme values in Teams theme @codepretty ([#2063](https://github.com/stardust-ui/react/pull/2063))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,25 @@ const ButtonUsageExampleShorthand = () => (
<Provider
theme={{
componentVariables: {
Button: siteVariables => ({
color: siteVariables.colors.brand[600],
colorHover: siteVariables.colors.brand[300],
colorFocus: siteVariables.colors.brand[900],
backgroundColor: '#252424', // no mapping color - tried - siteVariables.colors.grey[750]
backgroundColorActive: siteVariables.colors.brand[200],
backgroundColorHover: siteVariables.colors.brand[50],
backgroundColorFocus: siteVariables.colors.brand[200],
borderColor: siteVariables.colors.brand[200],
borderColorHover: siteVariables.colors.brand[300],
Button: siteVars => ({
color: siteVars.colorScheme.brand.foreground,
colorHover: siteVars.colorScheme.brand.foreground,
colorFocus: siteVars.colorScheme.default.foreground,
colorDisabled: siteVars.colorScheme.brandForegroundDisabled,
backgroundColor: siteVars.colorScheme.default.background,
backgroundColorActive: siteVars.colorScheme.brandBorderPressed,
backgroundColorHover: siteVars.colorScheme.brand.backgroundHover1,
backgroundColorFocus: siteVars.colorScheme.default.background,
backgroundColorDisabled: siteVars.colorScheme.brand.backgroundDisabled,
borderColor: siteVars.colorScheme.brandBorder2,
borderColorHover: siteVars.colorScheme.brandBorderHover,
}),
},
}}
>
<Button content="Tinted Button" />
<Button content="Tinted Button" /> <Button disabled content="Tinted Button Disabled" />
</Provider>
This button's styling is only applicable to dark theme.
<br />
<br />
<Provider
theme={{
componentVariables: {
Button: siteVariables => ({
color: siteVariables.colors.brand[600],
colorHover: siteVariables.colors.brand[600],
colorFocus: siteVariables.colors.brand[900],
backgroundColor: siteVariables.colors.white,
backgroundColorActive: siteVariables.colors.brand[200],
backgroundColorHover: siteVariables.colors.brand[50],
backgroundColorFocus: siteVariables.colors.brand[200],
borderColor: siteVariables.colors.brand[200],
borderColorHover: siteVariables.colors.brand[300],
}),
},
}}
>
<Button content="Tinted Button" />
</Provider>
This button's styling is only applicable to light theme.
This button's styling is using color scheme variables.
</div>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { default as Attachment } from './components/Attachment/attachmentVariables'
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 Dialog } from './components/Dialog/dialogVariables'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ListItemVariables } from '../../../teams/components/List/listItemVariables'

export default (siteVars: any): Partial<ListItemVariables> => ({
selectedFocusOutlineColor: siteVars.colors.brand[600],
selectableFocusHoverBackgroundColor: siteVars.colors.grey[500],
selectedBackgroundColor: siteVars.colors.grey[500],
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as Attachment } from './components/Attachment/attachmentStyles'
export { default as Button } from './components/Button/buttonStyles'
export { default as MenuItem } from './components/Menu/menuItemStyles'
export { default as Alert } from './components/Alert/alertStyles'
export { default as Dialog } from './components/Dialog/dialogStyles'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { ComponentSlotStylesPrepared, ICSSInJSStyle } from '../../../types'
import { ButtonProps } from '../../../../components/Button/Button'
import { ButtonVariables } from '../../../teams/components/Button/buttonVariables'
import { ButtonHighContrastVariables } from './buttonVariables'

const buttonStyles: ComponentSlotStylesPrepared<
ButtonProps,
ButtonVariables & ButtonHighContrastVariables
> = {
root: ({ props: p, variables: v, theme: { siteVariables } }): ICSSInJSStyle => {
return {
// rectangular button defaults
...(!p.text && {
':focus-visible': {
backgroundColor: v.backgroundColorFocus,
color: v.colorHover,
borderColor: 'transparent',

'&:hover': {
color: v.colorHover,
backgroundColor: v.backgroundColorHover,
borderColor: 'transparent',
},
},
}),

// Overrides for "primary" buttons
...(p.primary &&
!p.text && {
':focus-visible': {
backgroundColor: v.primaryBackgroundColorFocus,

'&:hover': {
color: v.primaryColorHover,
backgroundColor: v.primaryBackgroundColorHover,
},
},
}),
}
},
}

export default buttonStyles
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
import { ButtonVariables } from '../../../teams/components/Button/buttonVariables'

export default (siteVars: any): Partial<ButtonVariables> => {
export interface ButtonHighContrastVariables {
backgroundColorFocus: string
primaryBackgroundColorFocus: string
}

export default (siteVars: any): Partial<ButtonVariables> & ButtonHighContrastVariables => {
return {
color: siteVars.colors.white,
backgroundColor: 'transparent',
backgroundColorActive: siteVars.accessibleYellow,
backgroundColorHover: siteVars.accessibleYellow,
backgroundColorFocus: siteVars.accessibleYellow,
backgroundColorActive: siteVars.colors.white,
backgroundColorFocus: siteVars.accessibleCyan,
borderColorActive: siteVars.colors.white,
backgroundColorDisabled: siteVars.accessibleGreen,
borderColor: siteVars.colors.white,
borderColorHover: 'transparent',

primaryColor: siteVars.colors.black,
primaryColorHover: siteVars.colors.black,
primaryColorFocus: siteVars.colors.black,
primaryBackgroundColor: siteVars.colors.white,
primaryBackgroundColorActive: siteVars.accessibleYellow,
primaryBackgroundColorHover: siteVars.accessibleYellow,
primaryBackgroundColorFocus: siteVars.accessibleYellow,
primaryBorderColor: siteVars.colors.white,

circularColor: siteVars.colors.white,
circularColorActive: siteVars.colors.black,
circularBackgroundColor: siteVars.colors.black,
circularBackgroundColorActive: siteVars.accessibleYellow,
circularBackgroundColorHover: siteVars.accessibleYellow,
circularBackgroundColorFocus: siteVars.accessibleYellow,
circularBorderColor: siteVars.colors.white,
circularBorderColorHover: siteVars.colors.white,
circularBorderColorFocus: siteVars.colors.white,
primaryBackgroundColorActive: siteVars.colors.white,
primaryBackgroundColorFocus: siteVars.accessibleCyan,

boxShadow: 'none',
primaryBoxShadow: 'none',
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ export default (siteVars: any): Partial<ToolbarVariables> => ({
extendColorScheme(siteVars.colorScheme, {
default: {
foregroundHover: siteVars.colorScheme.brand.foregroundHover,
borderFocus: undefined,
foregroundActive: siteVars.accessibleYellow,
backgroundFocus: siteVars.colorScheme.default.backgroundHover,

menuItemForegroundHover: siteVars.colorScheme.default.foregroundHover,
menuItemBackgroundHover: siteVars.colorScheme.default.backgroundHover,
menuItemForegroundFocus: siteVars.colorScheme.default.foregroundHover,
menuItemBackgroundFocus: siteVars.colorScheme.default.backgroundHover,
},
}),
toolbarColorAreas,
Expand Down
67 changes: 33 additions & 34 deletions packages/react/src/themes/teams/components/Button/buttonStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =

const borderFocusStyles = getBorderFocusStyles({
siteVariables,
borderPadding: borderWidth,
...(p.circular && {
borderRadius: v.circularBorderRadius,
focusOuterBorderColor: v.circularBorderColorFocus,
borderPadding: pxToRem(4),
}),
})

Expand Down Expand Up @@ -54,15 +54,25 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =
borderColor: v.borderColorHover,
},

':active': {
color: v.colorActive,
backgroundColor: v.backgroundColorActive,
borderColor: v.borderColorActive,
boxShadow: 'none',
},

':focus': {
...borderFocusStyles[':focus'],
boxShadow: 'none',
':active': { backgroundColor: v.backgroundColorActive },
},

':focus-visible': {
...borderFocusStyles[':focus-visible'],
color: v.colorFocus,
backgroundColor: v.backgroundColorFocus,
borderColor: v.borderColor,
borderWidth,

':hover': {
borderColor: v.borderColorHover,
},
},

...(p.size === 'small' && {
Expand All @@ -75,31 +85,11 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =
!p.text && {
minWidth: v.height,
padding: 0,
color: v.circularColor,
backgroundColor: v.circularBackgroundColor,
borderColor: v.circularBorderColor,
borderRadius: v.circularBorderRadius,

...(p.size === 'small' && {
minWidth: v.sizeSmallHeight,
}),

':hover': {
color: v.circularColorActive,
backgroundColor: v.circularBackgroundColorHover,
borderColor: v.circularBorderColorHover,
},

':focus': {
...borderFocusStyles[':focus'],
boxShadow: 'none',
':active': { backgroundColor: v.circularBackgroundColorActive },
},
':focus-visible': {
...borderFocusStyles[':focus-visible'],
color: v.circularColorActive,
backgroundColor: v.circularBackgroundColorFocus,
},
}),

// text button defaults
Expand All @@ -121,6 +111,7 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =
boxShadow: 'none',
...borderFocusStyles[':focus'],
},

':focus-visible': {
...borderFocusStyles[':focus-visible'],
...getIconFillOrOutlineStyles({ outline: false }),
Expand All @@ -137,22 +128,24 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =
color: v.primaryColor,
backgroundColor: v.primaryBackgroundColor,
borderColor: v.primaryBorderColor,
boxShadow: siteVariables.shadowLevel1Dark,
boxShadow: v.primaryBoxShadow,

':hover': {
color: v.primaryColorHover,
backgroundColor: v.primaryBackgroundColorHover,
':active': {
backgroundColor: v.primaryBackgroundColorActive,
boxShadow: 'none',
},

':focus': {
...borderFocusStyles[':focus'],
boxShadow: 'none',
':active': { backgroundColor: v.primaryBackgroundColorActive },
},

':focus-visible': {
...borderFocusStyles[':focus-visible'],
color: v.primaryColorFocus,
backgroundColor: v.primaryBackgroundColorFocus,
},

':hover': {
color: v.primaryColorHover,
backgroundColor: v.primaryBackgroundColorHover,
},
}),

Expand All @@ -178,6 +171,12 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonProps, ButtonVariables> =
':hover': {
backgroundColor: v.backgroundColorDisabled,
},
...(p.primary && {
backgroundColor: v.primaryBackgroundColorDisabled,
':hover': {
backgroundColor: v.primaryBackgroundColorDisabled,
},
}),
}),
}),

Expand Down
Loading