Skip to content

Commit

Permalink
chore(tabs): update Tabs API descriptions (#723)
Browse files Browse the repository at this point in the history
revisions

- backtick component names for continuity
- use the word "child" instead of contained
- use the word "defines" instead of "sets"
  • Loading branch information
rossmoody committed Apr 17, 2020
1 parent b5910eb commit 40305b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions packages/tabs/src/elements/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ import { StyledTab } from '../styled';
import { useTabsContext } from '../utils/useTabsContext';

export interface ITabProps extends HTMLAttributes<HTMLDivElement> {
/**
* Disables the `Tab` and prevents user interaction
*/
disabled?: boolean;
/**
* A value to uniquely identify a Tab. Provided to the `onChange` event.
* Defines a value to uniquely identify the `Tab`. Provided to the `onChange` event in `Tabs`
*/
item?: any;
}

/**
* Accepts all `<div>` props
* Accepts all `<div>` props.
*/
export const Tab = React.forwardRef<HTMLDivElement, ITabProps>(
({ disabled, item, ...otherProps }, ref) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/tabs/src/elements/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { StyledTabList } from '../styled';
import { useTabsContext } from '../utils/useTabsContext';

/**
* Accepts all `<div>` props
* Accepts all `<div>` props.
*/
export const TabList = React.forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
(props, ref) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/tabs/src/elements/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { useTabsContext } from '../utils/useTabsContext';

export interface ITabPanelProps extends HTMLAttributes<HTMLDivElement> {
/**
* A value used to match a `TabPanel` with its associated Tab.
* Defines a value used to match a `TabPanel` with its associated `Tab`
*/
item?: any;
}

/**
* Accepts all `<div>` props
* Accepts all `<div>` props.
*/
export const TabPanel = React.forwardRef<HTMLDivElement, ITabPanelProps>(
({ item, ...otherProps }, ref) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/tabs/src/elements/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import { StyledTabs } from '../styled/StyledTabs';

export interface ITabsProps extends Partial<ThemeProps<DefaultTheme>> {
/**
* Toggles vertical selection mode of Tabs
* Displays child `Tab` components in a vertical orientation
*/
isVertical?: boolean;
/**
* Currently selected tab to display
* Sets the currently selected `Tab` to display
*/
selectedItem?: any;
/**
* Callback for when a tab has been selected by keyboard or mouse
* @param {String} selectedItem - The item of the selected tab
* Provides a callback function that returns the `selectedItem` when a `Tab` has been selected by keyboard or mouse
* @param {String} selectedItem The `item` value of the selected `Tab`
*/
onChange?: (updatedSelectedItem: any) => void;
}
Expand Down

0 comments on commit 40305b5

Please sign in to comment.