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

fix: (menu & menuitem): vertical menu theming updates #934

Merged
merged 49 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
82d12b6
Spacing updates for vertical menu module
Feb 12, 2019
03dec4e
Moving styles into appropriate file
Feb 13, 2019
b0d046f
Focus styles & theming experiments
Feb 14, 2019
edef38a
Themeing
Feb 18, 2019
a6af9f4
Menu, menuitem high contrast theme colors
Feb 18, 2019
f85aad2
More theming
Feb 18, 2019
1942b06
Theming
Feb 18, 2019
bf3643d
Vertical menu theming - colors
Feb 19, 2019
1741409
Cleanup + dark theme focus
Feb 19, 2019
bc9b4fa
Removing duplicate menu variables
Feb 20, 2019
42a053e
Reverting unintended changes to Status component styling
Feb 20, 2019
a845ae8
No non-unique react elements
Feb 20, 2019
2e3468d
Prettier fix
Feb 20, 2019
7a6b6c0
Reverting unintended change to package.json
jaanus03 Feb 21, 2019
d4b524d
Streamlining menu variable names
jaanus03 Feb 21, 2019
52d5b19
Reverting yarn.lock to latest
jaanus03 Feb 21, 2019
9708414
Renaming HC theme variables
jaanus03 Feb 22, 2019
a10e314
PR feedback
jaanus03 Feb 22, 2019
b77b1a3
Pointing vertical menu focus state
jaanus03 Feb 22, 2019
53a2dae
Removing duplicate variables
jaanus03 Feb 25, 2019
5fa203c
Removing boxShadow from non submenu vertical menus
jaanus03 Feb 25, 2019
5c54e41
Focus background color update
jaanus03 Feb 25, 2019
cac5132
HC theme colors update
jaanus03 Feb 26, 2019
00c9388
Vertical menu divider & border updates
jaanus03 Feb 26, 2019
e846854
Dark & HC theme divider & vertical menu border styles
jaanus03 Feb 26, 2019
d6003df
Primary menu item focus update
jaanus03 Feb 26, 2019
38f13ba
Vertical & pointing menu cleanup
Feb 27, 2019
2cdfb6e
Double border for accessibility
Feb 27, 2019
99f1890
Removing vertical menu 2px border from HC & Dark theme
Feb 27, 2019
a2ca164
Changelog entry
Feb 28, 2019
db15f4a
PR Feedback
Mar 1, 2019
426f05c
Changelog entry change
Mar 1, 2019
8671cb1
PR feedback
Mar 4, 2019
79aa92f
PR Feedback - outline property fix
Mar 4, 2019
937e3b5
Removing duplicate menubutton
Mar 4, 2019
12d14e2
Changelog entry change
Mar 4, 2019
79b207f
HC style variable update
Mar 4, 2019
f5c5396
PR Feedback
Mar 4, 2019
e277cfa
Conflict resolution
Mar 5, 2019
e6ed80b
Fixing spacing issue of divider in vertical menu
Mar 5, 2019
36012de
Fixing the sidebar recent background color change
Mar 5, 2019
20d5d9a
Reverting accidental import
Mar 5, 2019
37ca2d0
Updating Sidebar color
Mar 5, 2019
26515d5
Changelog entry
Mar 5, 2019
f044faa
Added back newline at the end of yarn.lock
Mar 5, 2019
0ec5c5d
PR feedback
Mar 5, 2019
2a3e28e
Yarn.lock revert
Mar 5, 2019
f87d3c0
isInSubmenu --> inSubmenu variable rename
Mar 5, 2019
3a4c45b
Merge branch 'master' into jaanusp/vertical-menu-updates-453393
jaanus03 Mar 5, 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 @@ -35,6 +35,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Close previous `Popup` on enter key @jongsue ([#985](https://github.com/stardust-ui/react/pull/985))
- Fixed color of the `timestamp` in `ChatMessages` marked as `mine` in Teams theme @mnajdova ([#1010](https://github.com/stardust-ui/react/pull/1010))
- Updated table `Icon` & search `Icon` ([#1011](https://github.com/stardust-ui/react/pull/1011))
- Improve `Menu` styling, vertical menu in Teams theme ([#934](https://github.com/stardust-ui/react/pull/934))
jaanus03 marked this conversation as resolved.
Show resolved Hide resolved

### Features
- Add `delay` prop for `Loader` component @layershifter ([#969](https://github.com/stardust-ui/react/pull/969))
Expand Down
5 changes: 5 additions & 0 deletions docs/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ class Sidebar extends React.Component<any, any> {
paddingRight: '0em',
paddingTop: '0em',
paddingBottom: '0em',
background: '#201f1f',
}

const menuSectionStyles: ICSSInJSStyle = {
fontWeight: fontWeightBold,
margin: '0 0 .5rem',
padding: '0 1.2857rem',
background: '#201f1f',
color: 'white',
':hover': {
background: 'none',
Expand All @@ -157,6 +159,7 @@ class Sidebar extends React.Component<any, any> {
fontSize: '0.85714286em',
fontWeight: 400,
color: '#ffffff80',
background: '#201f1f',
':hover': {
color: 'white',
backgroundColor: 'none',
Expand All @@ -170,11 +173,13 @@ class Sidebar extends React.Component<any, any> {
const dividerStyles: ICSSInJSStyle = {
marginTop: '.5em',
paddingBottom: '.5em',
background: '#201f1f',
}

const navBarStyles: ICSSInJSStyle = {
color: '#ffffff80',
padding: '0px',
backgroundColor: '#201f1f',
}

const logoStyles: ICSSInJSStyle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,58 @@ const items = [
'aria-label': 'Book Tool',
},
{
key: 'menuButton',
key: 'menuButton2',
icon: {
name: 'more',
outline: true,
},
accessibility: toolbarButtonBehavior,
'aria-label': 'More options',
indicator: false,
menu: [
{ key: '1', content: 'item1' },
{
key: '2',
content: 'item2',
},
{
key: '3',
content: 'item3',
menu: [{ key: '1', content: 'item3.1' }, { key: '2', content: 'item3.2' }],
},
],
menu: {
items: [
{
key: '5',
content: 'item1',
icon: {
name: 'bookmark',
outline: true,
},
},
{
key: 'divider',
kind: 'divider',
},
{
key: '6',
content: 'item2',
icon: {
name: 'mark-as-unread',
outline: true,
},
},
{
key: '7',
content: 'item3',
icon: {
name: 'translation',
outline: true,
},
},
{
key: 'divider2',
kind: 'divider',
},
{
key: '8',
content: 'item3',
icon: {
name: 'trash-can',
outline: true,
},
jaanus03 marked this conversation as resolved.
Show resolved Hide resolved
},
],
},
},
]

Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class Menu extends AutoControlledComponent<ReactProps<MenuProps>, MenuState> {
vertical,
variables,
styles: styles.divider,
inSubmenu: submenu,
mnajdova marked this conversation as resolved.
Show resolved Hide resolved
},
})
}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Menu/MenuDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface MenuDividerProps
vertical?: boolean
primary?: boolean
secondary?: boolean
isInSubMenu?: boolean
jaanus03 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand All @@ -52,6 +53,7 @@ class MenuDivider extends UIComponent<ReactProps<MenuDividerProps>> {
primary: PropTypes.bool,
secondary: PropTypes.bool,
vertical: PropTypes.bool,
isInSubMenu: PropTypes.bool,
jaanus03 marked this conversation as resolved.
Show resolved Hide resolved
}

renderComponent({ ElementType, classes, unhandledProps, accessibility }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
export interface MenuVariables {
color: string
}

export default (siteVars: any): MenuVariables => {
return {
color: siteVars.colors.white,
jaanus03 marked this conversation as resolved.
Show resolved Hide resolved
}
}
import { pxToRem } from '../../../../lib'
import { MenuVariables } from '../../../teams/components/Menu/menuVariables'

export default (siteVars: any): Partial<MenuVariables> => ({
verticalBorderColor: siteVars.black,

focusedBorder: `solid ${pxToRem(1)} ${siteVars.colors.white}`,
focusedBackgroundColor: 'transparent',

hoverBackgroundColor: siteVars.gray08,

activeColor: siteVars.colors.white,
activeBackgroundColor: siteVars.gray08,

verticalBackgroundColor: siteVars.gray10,
})
5 changes: 0 additions & 5 deletions packages/react/src/themes/teams-dark/siteVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export const red = '#d74654' // no mapping color
export const red08 = '#4f232b' // no mapping color
export const green04 = naturalColors.lightGreen[900]

//
// SHADOW LEVELS
//
export const shadowLevel1 = '0 .2rem .4rem -.075rem rgba(255, 255, 255, 0.1)'

//
// SEMANTIC ASSIGNMENTS
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
import { ComponentSlotStylesInput, ICSSInJSStyle } from '../../../types'
import { MenuVariables } from './menuVariables'
import { MenuVariables } from '../../../teams/components/Menu/menuVariables'
import { MenuItemProps, MenuItemState } from '../../../../components/Menu/MenuItem'

type MenuItemPropsAndState = MenuItemProps & MenuItemState

const menuItemStyles: ComponentSlotStylesInput<MenuItemPropsAndState, MenuVariables> = {
wrapper: ({ props, variables }): ICSSInJSStyle => {
const { iconOnly, isFromKeyboard } = props
wrapper: ({ props: p, variables: v }): ICSSInJSStyle => {
const { iconOnly, isFromKeyboard, vertical, active, underlined, primary } = p

return {
...(iconOnly && {
// focus styles
':hover': {
color: v.activeColor,
...(!active && {
background: v.focusedBackgroundColor,
}),
},

...(active && {
background: v.activeBackgroundColor,
color: v.activeColor,
}),

...((iconOnly || vertical) && {
...(isFromKeyboard && {
color: variables.activeColor,
background: variables.activeBackgroundColor,
color: v.activeColor,
background: v.focusedBackgroundColor,
}),

...(active && {
color: v.activeColor,
background: v.activeBackgroundColor,
}),

// hover styles
':hover': {
color: variables.activeColor,
background: variables.activeBackgroundColor,
color: v.activeColor,
background: v.focusedBackgroundColor,
},
}),

...((underlined || primary) && {
...(!active && {
':hover': {
color: v.color,
},
}),
}),
}
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
export interface MenuVariables {
color: string
activeColor: string
activeBackgroundColor: string
}
import { MenuVariables } from '../../../teams/components/Menu/menuVariables'

export default (siteVars: any): MenuVariables => {
return {
color: siteVars.white,
activeColor: siteVars.black,
activeBackgroundColor: siteVars.accessibleYellow,
}
}
export default (siteVars: any): Partial<MenuVariables> => ({
color: siteVars.white,
activeColor: siteVars.black,
focusedBackgroundColor: siteVars.accessibleYellow,
activeBackgroundColor: siteVars.accessibleCyan,

verticalBackgroundColor: siteVars.colors.black,
})
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const menuDividerStyles: ComponentSlotStylesInput<MenuDividerProps, MenuVariable
...(!p.vertical && {
alignSelf: 'stretch',
}),
...(p.vertical &&
p.inSubmenu && {
margin: '8px 0',
}),
}
},
}
Expand Down
Loading