diff --git a/packages/core/src/block/Block.tsx b/packages/core/src/block/Block.tsx index c8c20c709..01d5487bf 100644 --- a/packages/core/src/block/Block.tsx +++ b/packages/core/src/block/Block.tsx @@ -13,6 +13,8 @@ export interface BlockProps { export const Block: FC = (props) => ( = (props) => = ({ + checked, disabled, icon, label, @@ -24,6 +27,9 @@ export const OptionFieldItem: React.FunctionComponent = ({ reverse, }) => ( = ({gutter = 20, columns = 12, layout = columns const rowBlocksCount: number = columns / layoutSum * layoutLength return ( - + {Children.map(elements, (child: ReactNode, index: number) => ( = ({ size = 6, color = '#000', }) => ( - + ) diff --git a/packages/core/src/image/Image.tsx b/packages/core/src/image/Image.tsx index ac11ccb24..07106e94e 100644 --- a/packages/core/src/image/Image.tsx +++ b/packages/core/src/image/Image.tsx @@ -36,6 +36,7 @@ export const Image: FC = ({ children={(renderProps) => ( renderProps.loaded ? ( = (props) => { onBlur: props.onBlur, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, + role: 'textbox', } return ( props.mask ? ( diff --git a/packages/core/src/link/LinkControl.tsx b/packages/core/src/link/LinkControl.tsx index 1522d3684..c5bec5822 100644 --- a/packages/core/src/link/LinkControl.tsx +++ b/packages/core/src/link/LinkControl.tsx @@ -7,6 +7,7 @@ export interface LinkControlProps { onFocus?: () => void onBlur?: () => void href?: string + title?: string target?: string download?: string | boolean rel?: string diff --git a/packages/core/src/primitive/Svg.ts b/packages/core/src/primitive/Svg.ts index 1870e6bae..ec1fdb491 100644 --- a/packages/core/src/primitive/Svg.ts +++ b/packages/core/src/primitive/Svg.ts @@ -9,6 +9,7 @@ interface SvgProps { transition?: string transform?: string transformOrigin?: string + alt?: string } export const SvgNonProps = ['width', 'height', 'animation', 'transition', 'transform', 'transformOrigin'] diff --git a/packages/desktop/src/block-accordion/BlockAccordion.tsx b/packages/desktop/src/block-accordion/BlockAccordion.tsx index 649519f73..87b53a28a 100644 --- a/packages/desktop/src/block-accordion/BlockAccordion.tsx +++ b/packages/desktop/src/block-accordion/BlockAccordion.tsx @@ -27,6 +27,7 @@ const BlockAccordionIndent: { export const BlockAccordion: FunctionComponent> = ({items, indent = 'm', tabIndex = 0, opened, onChange}) => ( + items={items} opened={opened} onChange={onChange} @@ -35,6 +36,8 @@ export const BlockAccordion: FunctionComponent ( ]: export const BlockContent: FC = ({indent = 'm', children}) => ( diff --git a/packages/desktop/src/breadcrumbs/Breadcrumbs.md b/packages/desktop/src/breadcrumbs/Breadcrumbs.md index c8130c797..e6b031bed 100644 --- a/packages/desktop/src/breadcrumbs/Breadcrumbs.md +++ b/packages/desktop/src/breadcrumbs/Breadcrumbs.md @@ -1,6 +1,7 @@ ```jsx = ({children}) => ( - - {children.map((item, i) => ( - - {i > 0 ? ( - - - • - - ­ - - ) : ( - null - )} - - - ))} - +export const Breadcrumbs: FC = ({title, children}) => ( + + + {children.map((item, i) => ( + + {i > 0 ? ( + + + • + + ­ + + ) : ( + null + )} + + + ))} + + ) diff --git a/packages/desktop/src/button/Button.tsx b/packages/desktop/src/button/Button.tsx index 211c62996..8e4a077aa 100644 --- a/packages/desktop/src/button/Button.tsx +++ b/packages/desktop/src/button/Button.tsx @@ -1,4 +1,4 @@ -import React, {FunctionComponent, ReactElement, Fragment} from 'react' +import React, {FunctionComponent, Fragment, ReactElement} from 'react' import { ButtonControl, @@ -165,6 +165,8 @@ export const Button: FunctionComponent = (props) => ( onBlur={props.onBlur} children={(renderProps) => ( , any> -> = props => ( + > = props => ( props.stub ? ( ( extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/desktop/src/checkbox/Checkbox.tsx b/packages/desktop/src/checkbox/Checkbox.tsx index 840637741..c0bba02c2 100644 --- a/packages/desktop/src/checkbox/Checkbox.tsx +++ b/packages/desktop/src/checkbox/Checkbox.tsx @@ -23,6 +23,7 @@ const Checkbox: FunctionComponent = props => ( onKeyDown={renderProps.onKeyDown} children={( = (props) => ( - - {props.children.map((item, i) => ( - 0 ? 6 : 0}> - - - ))} - + + + {props.children.map((item, i) => ( + 0 ? 6 : 0}> + + + ))} + + ) diff --git a/packages/desktop/src/header-menu/HeaderMenuItem.tsx b/packages/desktop/src/header-menu/HeaderMenuItem.tsx index d1014a0b0..c8c1a18ff 100644 --- a/packages/desktop/src/header-menu/HeaderMenuItem.tsx +++ b/packages/desktop/src/header-menu/HeaderMenuItem.tsx @@ -1,6 +1,6 @@ import React, {FC} from 'react' -import {LinkControl, Lnk, Flex, Pos, Card} from '@qiwi/pijma-core' +import {Card, Flex, LinkControl, Lnk, Pos} from '@qiwi/pijma-core' import {Text} from '../typography/Text' export interface HeaderMenuItemProps { @@ -35,6 +35,8 @@ export const HeaderMenuItem: FC = (props) => ( cursor="pointer" tabIndex={props.tabIndex} href={props.href} + role="menuitem" + aria-label={props.title} target={props.target} download={props.download} rel={props.rel} diff --git a/packages/desktop/src/link/BlockLink.tsx b/packages/desktop/src/link/BlockLink.tsx index 519b3c8c2..6a464222d 100644 --- a/packages/desktop/src/link/BlockLink.tsx +++ b/packages/desktop/src/link/BlockLink.tsx @@ -1,6 +1,6 @@ import React, {FC} from 'react' -import {LinkControl, RenderChild, Lnk, Card} from '@qiwi/pijma-core' +import {Card, LinkControl, Lnk, RenderChild} from '@qiwi/pijma-core' export interface BlockLinkProps { onClick?: (href?: string, target?: string, download?: string | boolean, rel?: string) => void @@ -28,11 +28,13 @@ export const BlockLink: FC = (props) => ( onFocus={props.onFocus} onBlur={props.onBlur} href={props.href} + title={props.title} target={props.target} download={props.download} rel={props.rel} children={(renderProps) => ( = (props) => ( ]: number} = { } export const List: FunctionComponent = ({type, size = 'm', children}) => ( - + {children.map((item, index) => ( 0 ? ItemIndent[type] : 0}> {type === 'number' ? ( diff --git a/packages/desktop/src/modal/SimpleModal.tsx b/packages/desktop/src/modal/SimpleModal.tsx index 4771c9082..7245ad2a5 100644 --- a/packages/desktop/src/modal/SimpleModal.tsx +++ b/packages/desktop/src/modal/SimpleModal.tsx @@ -97,10 +97,12 @@ const SimpleModal: FunctionComponent = (props) => ( )} children={( - + {props.closable && props.onHide ? ( = (props) => ( = ({icon, title, children}) => ( - + = ({logo, error, title, content, footer}) => ( - + = props => ( onClick={props.onClick} children={renderProps => ( ( diff --git a/packages/desktop/src/radio-field/RadioFieldOptionModel.ts b/packages/desktop/src/radio-field/RadioFieldOptionModel.ts index e7422a2b1..a811b28b3 100644 --- a/packages/desktop/src/radio-field/RadioFieldOptionModel.ts +++ b/packages/desktop/src/radio-field/RadioFieldOptionModel.ts @@ -3,6 +3,6 @@ import {ReactNode} from 'react' import {OptionModel} from '@qiwi/pijma-core' export default interface RadioFieldOptionModel extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/desktop/src/switch-field/SwitchField.tsx b/packages/desktop/src/switch-field/SwitchField.tsx index 1ac9bdc7d..8c16d95e9 100644 --- a/packages/desktop/src/switch-field/SwitchField.tsx +++ b/packages/desktop/src/switch-field/SwitchField.tsx @@ -71,6 +71,7 @@ const SwitchField: FunctionComponent< onBlur={props.onBlur} children={(renderProps) => ( ( extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/desktop/src/switch/Switch.tsx b/packages/desktop/src/switch/Switch.tsx index b6afe3d3e..68e507aa1 100644 --- a/packages/desktop/src/switch/Switch.tsx +++ b/packages/desktop/src/switch/Switch.tsx @@ -50,6 +50,7 @@ export const Switch: FunctionComponent = props => ( onKeyDown={renderProps.onKeyDown} children={( ( 0 ? '0 -1px 0 #e6e6e6' diff --git a/packages/mobile/src/block-content/BlockContent.tsx b/packages/mobile/src/block-content/BlockContent.tsx index 200b04a43..22a565a26 100644 --- a/packages/mobile/src/block-content/BlockContent.tsx +++ b/packages/mobile/src/block-content/BlockContent.tsx @@ -13,6 +13,8 @@ const BlockContentIdent: { [indent in NonNullable]: export const BlockContent: FC = ({indent = 'm', children}) => ( diff --git a/packages/mobile/src/breadcrumbs/Breadcrumbs.md b/packages/mobile/src/breadcrumbs/Breadcrumbs.md index c8130c797..e6b031bed 100644 --- a/packages/mobile/src/breadcrumbs/Breadcrumbs.md +++ b/packages/mobile/src/breadcrumbs/Breadcrumbs.md @@ -1,6 +1,7 @@ ```jsx = ({children}) => ( - - {children.map((item, i) => ( - - {i > 0 ? ( - - - • - - ­ - - ) : ( - null - )} - - - ))} - +export const Breadcrumbs: FC = ({title, children}) => ( + + + {children.map((item, i) => ( + + {i > 0 ? ( + + + • + + ­ + + ) : ( + null + )} + + + ))} + + ) diff --git a/packages/mobile/src/button/Button.tsx b/packages/mobile/src/button/Button.tsx index beae2b94a..62d246550 100644 --- a/packages/mobile/src/button/Button.tsx +++ b/packages/mobile/src/button/Button.tsx @@ -1,4 +1,4 @@ -import React, {FunctionComponent, ReactElement, Fragment} from 'react' +import React, {FunctionComponent, Fragment, ReactElement} from 'react' import { ButtonControl, @@ -155,6 +155,8 @@ export const Button: FunctionComponent = (props) => ( onBlur={props.onBlur} children={(renderProps) => ( , any> -> = props => ( + > = props => ( props.stub ? ( ( extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/mobile/src/checkbox/Checkbox.tsx b/packages/mobile/src/checkbox/Checkbox.tsx index 840637741..c0bba02c2 100644 --- a/packages/mobile/src/checkbox/Checkbox.tsx +++ b/packages/mobile/src/checkbox/Checkbox.tsx @@ -23,6 +23,7 @@ const Checkbox: FunctionComponent = props => ( onKeyDown={renderProps.onKeyDown} children={( void @@ -28,11 +28,13 @@ export const BlockLink: FC = (props) => ( onFocus={props.onFocus} onBlur={props.onBlur} href={props.href} + title={props.title} target={props.target} download={props.download} rel={props.rel} children={(renderProps) => ( = (props) => ( = (props) => ( mr={2} shrink={0} > - + - + = (props) => ( ]: number} = { } export const List: FunctionComponent = ({type, size = 'm', children}) => ( - + {children.map((item, index) => ( 0 ? ItemIndent[type] : 0}> {type === 'number' ? ( diff --git a/packages/mobile/src/modal/SimpleModal.tsx b/packages/mobile/src/modal/SimpleModal.tsx index 9b07dadba..428f17199 100644 --- a/packages/mobile/src/modal/SimpleModal.tsx +++ b/packages/mobile/src/modal/SimpleModal.tsx @@ -83,10 +83,12 @@ const SimpleModal: FunctionComponent = (props) => ( )} children={( - + {props.closable && props.onHide ? ( = ({icon, title, children}) => ( - + > = ({logo, error, title, content, footer}) => ( - + = ({ onChange={onChange} children={renderProps => ( = props => ( onClick={props.onClick} children={renderProps => ( ( diff --git a/packages/mobile/src/radio-field/RadioFieldOptionModel.ts b/packages/mobile/src/radio-field/RadioFieldOptionModel.ts index e7422a2b1..a811b28b3 100644 --- a/packages/mobile/src/radio-field/RadioFieldOptionModel.ts +++ b/packages/mobile/src/radio-field/RadioFieldOptionModel.ts @@ -3,6 +3,6 @@ import {ReactNode} from 'react' import {OptionModel} from '@qiwi/pijma-core' export default interface RadioFieldOptionModel extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/mobile/src/switch-field/SwitchField.tsx b/packages/mobile/src/switch-field/SwitchField.tsx index 1ac9bdc7d..8c16d95e9 100644 --- a/packages/mobile/src/switch-field/SwitchField.tsx +++ b/packages/mobile/src/switch-field/SwitchField.tsx @@ -71,6 +71,7 @@ const SwitchField: FunctionComponent< onBlur={props.onBlur} children={(renderProps) => ( ( extends OptionModel { - label: ReactNode + label: string description?: ReactNode } diff --git a/packages/mobile/src/switch/Switch.tsx b/packages/mobile/src/switch/Switch.tsx index b6afe3d3e..68e507aa1 100644 --- a/packages/mobile/src/switch/Switch.tsx +++ b/packages/mobile/src/switch/Switch.tsx @@ -50,6 +50,7 @@ export const Switch: FunctionComponent = props => ( onKeyDown={renderProps.onKeyDown} children={( ]: string } = { export const Text: FunctionComponent = ({display, compact, size, bold, color, decoration, transform, transition, align, clamp, children}) => (