-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add @role for elements #190
base: master
Are you sure you want to change the base?
Changes from all commits
1046aa5
fe03732
bf73d5e
79327d6
3618d69
3a2a700
abe1343
f54e27e
4879c55
e08308f
2d6c8f7
3351367
3da6536
3f42304
8b61e61
2b6c163
3b57dd0
00451dd
759f77c
c7c952f
f8612f9
63f53db
5be33d7
4575dc2
0d5c37a
0518431
9b1d727
a438072
07e0ae6
41fa93b
5e4d7b6
5454fe7
fd40714
5d25d0d
c56b79e
cb5d880
a33b942
373a873
2cc765e
ecf1fa6
9232b03
b17e486
112d15b
2a9986b
d074981
2dc4df0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ export const Grid: FC<GridProps> = ({gutter = 20, columns = 12, layout = columns | |
const rowBlocksCount: number = columns / layoutSum * layoutLength | ||
|
||
return ( | ||
<Flex wrap="wrap"> | ||
<Flex wrap="wrap" role="section" aria-label="grid"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. есть роль grid и опять label один для всех и не понятно зачем он тут |
||
{Children.map(elements, (child: ReactNode, index: number) => ( | ||
<FlexItem | ||
key={index} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,7 +200,7 @@ export const Icon: FC<IconProps> = ({ | |
size = 6, | ||
color = '#000', | ||
}) => ( | ||
<Svg width={size} height={size} viewBox="0 0 24 24" focusable="false"> | ||
<Svg width={size} height={size} viewBox="0 0 24 24" focusable="false" role="img" alt={name}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. как я понял тут |
||
<Path d={IconPaths[name]} fill={color}/> | ||
</Svg> | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ export const BasicInput: FunctionComponent<BasicInputProps> = (props) => { | |
onBlur: props.onBlur, | ||
onKeyDown: props.onKeyDown, | ||
onKeyUp: props.onKeyUp, | ||
role: 'textbox', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. перед хендлерами |
||
} | ||
return ( | ||
props.mask ? ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ export interface LinkControlProps { | |
onFocus?: () => void | ||
onBlur?: () => void | ||
href?: string | ||
title?: string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. зачем? |
||
target?: string | ||
download?: string | boolean | ||
rel?: string | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ interface SvgProps { | |
transition?: string | ||
transform?: string | ||
transformOrigin?: string | ||
alt?: string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. как выше писал, возможно |
||
} | ||
|
||
export const SvgNonProps = ['width', 'height', 'animation', 'transition', 'transform', 'transformOrigin'] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ const BlockAccordionIndent: { | |
|
||
export const BlockAccordion: FunctionComponent<BlockAccordionProps<BlockAccordionItemModel>> = ({items, indent = 'm', tabIndex = 0, opened, onChange}) => ( | ||
<AccordionControl<BlockAccordionItemModel> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. лишняя строчка |
||
items={items} | ||
opened={opened} | ||
onChange={onChange} | ||
|
@@ -35,6 +36,8 @@ export const BlockAccordion: FunctionComponent<BlockAccordionProps<BlockAccordio | |
{renderProps.items.map((item, index) => ( | ||
<Card | ||
key={index} | ||
role="region" | ||
aria-label={typeof item.title === 'string' ? item.title : undefined} | ||
s={ | ||
item.hovered || item.focused | ||
? '0 0 16px 0 rgba(0, 0, 0, 0.12)' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import React, {FC} from 'react' | ||
|
||
import {Flex, FlexItem} from '@qiwi/pijma-core' | ||
import {Flex, FlexItem, Box} from '@qiwi/pijma-core' | ||
import {HeaderMenuItem, HeaderMenuItemProps} from './HeaderMenuItem' | ||
|
||
export interface HeaderMenuProps { | ||
children: HeaderMenuItemProps[] | ||
} | ||
|
||
export const HeaderMenu: FC<HeaderMenuProps> = (props) => ( | ||
<Flex height={1} width={1} justify="flex-start"> | ||
{props.children.map((item, i) => ( | ||
<FlexItem key={i} ml={i > 0 ? 6 : 0}> | ||
<HeaderMenuItem | ||
{...item} | ||
/> | ||
</FlexItem> | ||
))} | ||
</Flex> | ||
<Box as="nav" height={1} width={1}> | ||
<Flex height={1} width={1} justify="flex-start" role="menubar"> | ||
{props.children.map((item, i) => ( | ||
<FlexItem key={i} ml={i > 0 ? 6 : 0}> | ||
<HeaderMenuItem | ||
{...item} | ||
/> | ||
</FlexItem> | ||
))} | ||
</Flex> | ||
</Box> | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Атрибут aria-label создаёт текстовую метку текущего элемента в случае отсутствия видимого текста описания элемента.
зачем тут простоblock
всегда?