File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,16 @@ const StyledItem = styled.div<{variant: ItemProps['variant']} & SxProp>`
5353
5454 @media (hover: hover) and (pointer: fine) {
5555 :hover {
56- background: ${ props =>
57- props . variant === 'danger' ? get ( 'colors.bg.danger' ) : get ( 'colors.selectMenu.tapHighlight' ) } ;
56+ background: ${ props => ( props . variant === 'danger' ? '#FFF0F2' : '#F0F3F5' ) } ;
5857 cursor: pointer;
5958 }
6059 }
6160
61+ &:focus {
62+ background: ${ props => ( props . variant === 'danger' ? '#FFDBE0' : '#E0E4E7' ) } ;
63+ outline: none;
64+ }
65+
6266 ${ sx }
6367`
6468
@@ -103,7 +107,7 @@ export function Item({
103107 ...props
104108} : Partial < ItemProps > ) : JSX . Element {
105109 return (
106- < StyledItem variant = { variant } { ...props } >
110+ < StyledItem tabIndex = { - 1 } variant = { variant } { ...props } >
107111 { LeadingVisual && (
108112 < LeadingVisualContainer >
109113 < LeadingVisual />
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ import {
1010 GearIcon
1111} from '@primer/octicons-react'
1212import { Meta } from '@storybook/react'
13- import React from 'react'
13+ import React , { useRef } from 'react'
1414import styled from 'styled-components'
1515import { ThemeProvider } from '..'
1616import { ActionList as _ActionList } from '../ActionList'
1717import { Header } from '../ActionList/Header'
1818import BaseStyles from '../BaseStyles'
19+ import { useFocusZone } from '../hooks/useFocusZone'
1920import sx from '../sx'
2021
2122const ActionList = Object . assign ( _ActionList , {
@@ -77,10 +78,13 @@ export function ActionsStory(): JSX.Element {
7778ActionsStory . storyName = 'Actions'
7879
7980export function SimpleListStory ( ) : JSX . Element {
81+ const containerRef = useRef ( null )
82+ useFocusZone ( { containerRef} )
83+
8084 return (
8185 < >
8286 < h1 > Simple List</ h1 >
83- < ErsatzOverlay >
87+ < ErsatzOverlay ref = { containerRef } >
8488 < ActionList
8589 items = { [
8690 { text : 'New file' } ,
You can’t perform that action at this time.
0 commit comments