forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
skysuka
committed
Feb 15, 2019
1 parent
06842a4
commit cc436dd
Showing
46 changed files
with
764 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 无障碍 | ||
|
||
- order: 6 | ||
|
||
组件内置了部分支持无障碍, 但是额外需要开发者手动设置才能完整支持无障碍: 比如添加className="next-visually-hidden",使得badge能被读屏软件读取含义。 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 6 | ||
|
||
To Support accessibility, you can assign className="next-visually-hidden", which can make badge read by software like voiceover. | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { Badge, Icon } from '@alifd/next'; | ||
|
||
ReactDOM.render( | ||
<div> | ||
<Badge dot> | ||
<a href="#"><span className="next-visually-hidden">new mail</span></a> | ||
</Badge> | ||
</div>, mountNode); | ||
```` | ||
|
||
````css | ||
.next-badge { | ||
margin-right: 16px; | ||
} | ||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 无障碍 | ||
|
||
- order: 3 | ||
|
||
组件已支持无障碍。 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 3 | ||
|
||
Components already support accessibility. | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { Breadcrumb } from '@alifd/next'; | ||
|
||
ReactDOM.render( | ||
<Breadcrumb> | ||
<Breadcrumb.Item link="javascript:void(0);">Home</Breadcrumb.Item> | ||
<Breadcrumb.Item link="javascript:void(0);">Accessibility rule</Breadcrumb.Item> | ||
<Breadcrumb.Item link="javascript:void(0);">Accessibility practice</Breadcrumb.Item> | ||
</Breadcrumb>, | ||
mountNode); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 无障碍 | ||
|
||
- order: 3 | ||
|
||
组件内置了部分支持无障碍, 但是额外需要开发者手动设置才能完整支持无障碍: 给Collapse传入一个id, 组件会根据Collapse的id自动给每一个Panel生成Id。如果你想指定Panel的Id也可以, 给某个Panel传入Id属性,就会覆盖根据CollapseId生成的Id。 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 3 | ||
|
||
To Support accessibility, you shoud assign an id prop to Collapse and it will generate id for Panels. or you can assign an id prop to Panel to overwrite generated id. | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { Dropdown, Menu } from '@alifd/next'; | ||
|
||
const menu = ( | ||
<Menu> | ||
<Menu.Item>Option 1</Menu.Item> | ||
<Menu.Item>Option 2</Menu.Item> | ||
</Menu> | ||
); | ||
|
||
ReactDOM.render( | ||
<Dropdown trigger={<a>test accessibility dropdown</a>} afterOpen={() => console.log('after open')}> | ||
{menu} | ||
</Dropdown>, mountNode); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 无障碍 | ||
|
||
- order: 6 | ||
|
||
组件已支持无障碍 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 6 | ||
|
||
Components already support accessibility | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { Nav } from '@alifd/next'; | ||
|
||
|
||
const { Item, SubNav } = Nav; | ||
|
||
const header = <span className="a">Accessibility</span>; | ||
const footer = <a className="login-in" href="javascript:;">Login in</a>; | ||
|
||
ReactDOM.render( | ||
<Nav className="basic-nav" direction="hoz" type="primary" header={header} footer={footer} defaultSelectedKeys={['home']} triggerType="hover"> | ||
<Item key="Accessibility home">Home</Item> | ||
<SubNav label="Accessibility Component" selectable> | ||
<Item key="next">Next</Item> | ||
<Item key="mext">Mext</Item> | ||
</SubNav> | ||
<Item key="Accessibility document">Document</Item> | ||
</Nav> | ||
, mountNode); | ||
```` | ||
|
||
````css | ||
.basic-nav .fusion { | ||
margin: 8px 20px; | ||
width: 100px; | ||
color: #FFFFFF; | ||
font-size: 20px; | ||
} | ||
.basic-nav .login-in { | ||
margin: 0 20px; | ||
color: #FFFFFF; | ||
} | ||
.basic-nav .next-nav-item { | ||
width: 120px; | ||
} | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 无障碍 | ||
|
||
- order: 8 | ||
|
||
组件内置了部分支持无障碍, 但是额外需要开发者手动设置才能完整支持无障碍: 设置upBtnprops以及downBtnprops,使得读屏软件可以正确表达按键的具体功能。 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 8 | ||
|
||
The component is partially built to support accessibility, but requires additional developer manual Settings to fully support accessibility: upBtnprops and downBtnprops are set up to enable the screen reader to correctly express the specific functions of the buttons. | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { NumberPicker } from '@alifd/next'; | ||
|
||
function onChange(value, e) { | ||
console.log(value, e.type, e.triggerType); | ||
} | ||
|
||
ReactDOM.render( | ||
<div> | ||
<NumberPicker upBtnProps={{"aria-label":"increasing button"}} downBtnProps={{"aria-label":"decreasing button"}} defaultValue={0} type="inline" onChange={onChange}/> | ||
</div>, | ||
mountNode | ||
); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 无障碍 | ||
|
||
- order: 9 | ||
|
||
组件已支持无障碍 | ||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 9 | ||
|
||
Components already support accessibility | ||
::: | ||
|
||
--- | ||
|
||
````jsx | ||
import { Pagination } from '@alifd/next'; | ||
|
||
const change = function(value) { | ||
console.log(value); | ||
}; | ||
|
||
ReactDOM.render( | ||
<Pagination defaultCurrent={2} onChange={change} />, | ||
mountNode | ||
); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.