File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed
src/frontend/apps/impress/src/features/docs/doc-tree/components Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,19 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
87
87
: 'var(--c--theme--colors--greyscale-000)' } ;
88
88
}
89
89
90
+ & : focus-within .light-doc-item-actions {
91
+ display : flex;
92
+ background : var (--c--theme--colors--greyscale-100 );
93
+ }
94
+
90
95
.c__tree-view--node .isSelected {
91
96
.light-doc-item-actions {
92
97
background : var (--c--theme--colors--greyscale-100 );
93
98
}
94
99
}
95
100
96
- & : hover {
101
+ & : hover ,
102
+ & : focus-within {
97
103
background-color : var (--c--theme--colors--greyscale-100 );
98
104
border-radius : 4px ;
99
105
Original file line number Diff line number Diff line change @@ -189,7 +189,8 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
189
189
opacity : 1 ;
190
190
}
191
191
}
192
- & : hover {
192
+ & : hover ,
193
+ & : focus-within {
193
194
.doc-tree-root-item-actions {
194
195
opacity : 1 ;
195
196
}
Original file line number Diff line number Diff line change @@ -150,6 +150,25 @@ export const DocTreeItemActions = ({
150
150
$align = "center"
151
151
className = "--docs--doc-tree-item-actions"
152
152
$gap = "4px"
153
+ $css = { css `
154
+ & : focus-within {
155
+ opacity : 1 ;
156
+ visibility : visible;
157
+ }
158
+ button : focus-visible,
159
+ [role='button']: focus-visible {
160
+ outline : 2px solid var (--c--theme--colors--primary-500 );
161
+ outline-offset : 2px ;
162
+ background-color : var (--c--theme--colors--greyscale-050 );
163
+ border-radius : 4px ;
164
+ }
165
+ .icon-button : focus-visible {
166
+ outline : 2px solid var (--c--theme--colors--primary-500 );
167
+ outline-offset : 2px ;
168
+ background-color : var (--c--theme--colors--greyscale-050 );
169
+ border-radius : 4px ;
170
+ }
171
+ ` }
153
172
>
154
173
< DropdownMenu
155
174
options = { options }
@@ -166,6 +185,17 @@ export const DocTreeItemActions = ({
166
185
variant = "filled"
167
186
$theme = "primary"
168
187
$variation = "600"
188
+ className = "icon-button"
189
+ tabIndex = { 0 }
190
+ role = "button"
191
+ aria-label = { t ( 'More options' ) }
192
+ onKeyDown = { ( e ) => {
193
+ if ( e . key === 'Enter' || e . key === ' ' ) {
194
+ e . preventDefault ( ) ;
195
+ e . stopPropagation ( ) ;
196
+ onOpenChange ?.( ! isOpen ) ;
197
+ }
198
+ } }
169
199
/>
170
200
</ DropdownMenu >
171
201
{ doc . abilities . children_create && (
@@ -179,6 +209,7 @@ export const DocTreeItemActions = ({
179
209
} ) ;
180
210
} }
181
211
color = "primary"
212
+ aria-label = { t ( 'Add child document' ) }
182
213
>
183
214
< Icon
184
215
variant = "filled"
You can’t perform that action at this time.
0 commit comments