Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
docs: add and fix component descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Oct 25, 2018
1 parent 86a645f commit 1d5b3e8
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface ButtonGroupProps {
}

/**
* A button group.
* A button group presents multiple related actions.
*/
class ButtonGroup extends UIComponent<Extendable<ButtonGroupProps>, any> {
public static displayName = 'ButtonGroup'
Expand Down
3 changes: 3 additions & 0 deletions src/components/Chat/ChatItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export interface ChatItemProps {
variables?: ComponentVariablesInput
}

/**
* A chat item represents a single event in a chat.
*/
class ChatItem extends UIComponent<Extendable<ChatItemProps>, any> {
static className = 'ui-chat__item'

Expand Down
3 changes: 3 additions & 0 deletions src/components/Chat/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export interface ChatMessageProps {
variables?: ComponentVariablesInput
}

/**
* A chat message represents a single statement communicated to a user.
*/
class ChatMessage extends UIComponent<Extendable<ChatMessageProps>, any> {
static className = 'ui-chat__message'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface LabelProps {
}

/**
* A label displays content classification
* A label is used to classify content.
*/
class Label extends UIComponent<Extendable<LabelProps>, any> {
static displayName = 'Label'
Expand Down
3 changes: 3 additions & 0 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export interface LayoutProps {
variables?: ComponentVariablesInput
}

/**
* A layout is a utility for arranging the content of a component.
*/
class Layout extends UIComponent<Extendable<LayoutProps>, any> {
static className = 'ui-layout'

Expand Down
3 changes: 3 additions & 0 deletions src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export interface ListProps extends FocusContainerProps<ShorthandValue> {
variables?: ComponentVariablesInput
}

/**
* A list displays a group of related content.
*/
class List extends UIComponent<Extendable<ListProps>, FocusContainerState> {
static displayName = 'List'

Expand Down
3 changes: 3 additions & 0 deletions src/components/List/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export interface ListItemState {
isHovering: boolean
}

/**
* A list item contains a single piece of content within a list.
*/
class ListItem extends UIComponent<Extendable<ListItemProps>, ListItemState> {
static create: Function

Expand Down
3 changes: 3 additions & 0 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export interface MenuProps {
variables?: ComponentVariablesInput
}

/**
* A menu displays grouped navigation actions.
*/
class Menu extends AutoControlledComponent<Extendable<MenuProps>, any> {
static displayName = 'Menu'

Expand Down
3 changes: 3 additions & 0 deletions src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export interface MenuItemState {
[IsFromKeyboard.propertyName]: boolean
}

/**
* A menu item is an actionable navigation item within a menu.
*/
class MenuItem extends UIComponent<Extendable<MenuItemProps>, MenuItemState> {
static displayName = 'MenuItem'

Expand Down
1 change: 1 addition & 0 deletions src/components/RadioGroup/RadioGroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface RadioGroupItemState {
}

/**
* A single radio with a radio group.
* @accessibility
* Radio items need to be grouped in RadioGroup component to correctly handle accessibility.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/components/Segment/Segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface SegmentProps {
variables?: ComponentVariablesInput
}

/**
* A segment is used to create a grouping of related content.
*/
class Segment extends UIComponent<Extendable<SegmentProps>, any> {
static className = 'ui-segment'

Expand Down
2 changes: 1 addition & 1 deletion test/specs/commonTests/isConformant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export default (Component, options: Conformant = {}) => {
'forgot to use `getUnhandledProps` util to spread the `rest` props.',
)
}
const customHandler = eventTarget.prop([listenerName])
const customHandler = eventTarget.prop(listenerName)

if (customHandler) {
customHandler(eventShape)
Expand Down
4 changes: 1 addition & 3 deletions test/specs/components/RadioGroup/RadioGroup-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ const getShorthandItems = (props?: { disabledItem?: number }) => [
]

describe('RadioGroup', () => {
describe('isConformant', () => {
isConformant(RadioGroup)
})
isConformant(RadioGroup)

describe('accessibility', () => {
handlesAccessibility(RadioGroup, {
Expand Down
4 changes: 1 addition & 3 deletions test/specs/components/RadioGroup/RadioGroupItem-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { isConformant, handlesAccessibility } from 'test/specs/commonTests'
import RadioGroupItem from 'src/components/RadioGroup/RadioGroupItem'

describe('RadioGroupItem', () => {
describe('isConformant', () => {
isConformant(RadioGroupItem)
})
isConformant(RadioGroupItem)

describe('accessibility', () => {
handlesAccessibility(RadioGroupItem, {
Expand Down

0 comments on commit 1d5b3e8

Please sign in to comment.