Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add `menu` prop to `MenuItem` @mnajdova ([#539](https://github.com/stardust-ui/react/pull/539))
- Enable RTL for `FocusZone` @sophieH29 ([#646](https://github.com/stardust-ui/react/pull/646))

### Documentation
- Add more accessibility descriptions to components and behaviors @jurokapsiar ([#648](https://github.com/stardust-ui/react/pull/648))

<!--------------------------------[ v0.15.0 ]------------------------------- -->
## [v0.15.0](https://github.com/stardust-ui/react/tree/v0.15.0) (2018-12-17)
[Compare changes](https://github.com/stardust-ui/react/compare/v0.14.0...v0.15.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const ComponentDocAccessibility = ({ info }) => {
variables={{ color: 'black' }}
/>

{description && <p style={{ whiteSpace: 'pre-line' }}>{description}</p>}

{behaviorName && (
<p>
Default behavior:{' '}
Expand All @@ -45,8 +47,6 @@ const ComponentDocAccessibility = ({ info }) => {
))}
</p>
)}

{description && <p style={{ whiteSpace: 'pre-line' }}>{description}</p>}
</>
)
}
Expand Down
29 changes: 17 additions & 12 deletions docs/src/components/DocsBehaviorRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,31 @@ class DocsBehaviorRoot extends React.Component<any, any> {
</div>
</Grid.Column>
<div style={{ padding: '1em' }}>
<span> Description: </span>
<br />
{variation.description &&
variation.description.split('\n').map((splittedText, keyValue) => {
return (
{variation.description && (
<>
<strong>Description:</strong>
<br />
{variation.description.split('\n').map((splittedText, keyValue) => (
<span key={keyValue}>
{splittedText}
<br />
</span>
)
})}
{variation.specification &&
variation.specification.split('\n').map((splittedText, keyValue) => {
return (
))}
</>
)}
{variation.specification && (
<>
{variation.description && <br />}
<strong>Specification:</strong>
<br />
{variation.specification.split('\n').map((splittedText, keyValue) => (
<span key={keyValue}>
{splittedText}
<br />
</span>
)
})}
))}
</>
)}
</div>
</Grid.Row>
))}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export interface AccordionProps extends UIComponentProps, ChildrenComponentProps

/**
* An accordion allows users to toggle the display of sections of content.
* @accessibility
* Implements ARIA Accordion design pattern (keyboard navigation not yet supported).
* Consider using Tree if you intend to wrap Lists in an Accordion.
*/
class Accordion extends AutoControlledComponent<ReactProps<AccordionProps>, any> {
static displayName = 'Accordion'
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export interface DropdownState {
/**
* Dropdown allows user to select one or more values from a list of items.
* Can also be created with search capability.
* @accessibility
* Implements ARIA collapsible Listbox design pattern, uses aria-live to announce state changes.
*/
export default class Dropdown extends AutoControlledComponent<
Extendable<DropdownProps>,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export interface MenuState {

/**
* A menu displays grouped navigation actions.
* @accessibility
* Implements ARIA Menu, Toolbar or Tabs design pattern, depending on the behavior used.
*/
class Menu extends AutoControlledComponent<ReactProps<MenuProps>, MenuState> {
static displayName = 'Menu'
Expand Down
2 changes: 2 additions & 0 deletions src/components/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export interface RadioGroupProps extends UIComponentProps, ChildrenComponentProp

/**
* A radio group allows a user to select a value from a small set of options.
* @accessibility
* Implements ARIA Radio Group design pattern.
*/
class RadioGroup extends AutoControlledComponent<ReactProps<RadioGroupProps>, any> {
static displayName = 'RadioGroup'
Expand Down
1 change: 1 addition & 0 deletions src/lib/accessibility/Behaviors/Dialog/dialogBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import popupFocusTrapBehavior from '../Popup/popupFocusTrapBehavior'

/**
* @description
* Implements ARIA Dialog (Modal) design pattern.
* Adds role='button' to 'trigger' component's part, if it is not focusable element and no role attribute provided.
* Adds tabIndex='0' to 'trigger' component's part, if it is not tabbable element and no tabIndex attribute provided.
*
Expand Down
1 change: 1 addition & 0 deletions src/lib/accessibility/Behaviors/Menu/menuBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FocusZoneDirection } from '../../FocusZone'

/**
* @description
* Implements ARIA Menu design pattern.
* The 'menu' role is used to identify an element that creates a list of common actions or functions that a user can invoke.
*
* @specification
Expand Down
2 changes: 2 additions & 0 deletions src/lib/accessibility/Behaviors/Radio/radioGroupBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Accessibility } from '../../types'
import * as keyboardKey from 'keyboard-key'

/**
* @description
* Implements ARIA Radio Group design pattern.
* @specification
* Adds role='radiogroup'. This allows screen readers to handle the component as a radio group.
* Performs 'nextItem' action on ArrowDown, ArrowRight.
Expand Down
3 changes: 3 additions & 0 deletions src/lib/accessibility/Behaviors/Tab/tabListBehavior.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Accessibility, FocusZoneMode } from '../../types'

/**
* @description
* Implements ARIA Tabs design pattern.
* Child item components need to have tabBehavior assigned.
* @specification
* Adds role 'tablist' to 'root' component's part.
* Embeds FocusZone into component allowing arrow key navigation through the children of the component.
Expand Down
3 changes: 3 additions & 0 deletions src/lib/accessibility/Behaviors/Toolbar/toolbarBehavior.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Accessibility, FocusZoneMode } from '../../types'

/**
* @description
* Implements ARIA Toolbar design pattern.
* Child item components need to have toolbarButtonBehavior assigned.
* @specification
* Adds role 'toolbar' to 'root' component's part.
* Embeds FocusZone into component allowing arrow key navigation through the children of the component.
Expand Down