Skip to content

Commit

Permalink
Adds default props to JSDoc (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
harbify committed Mar 22, 2018
1 parent 206728a commit e1acb38
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 16 deletions.
5 changes: 4 additions & 1 deletion src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const AVATAR_IMAGES = Object.keys(avatars).map(
);

export interface Props {
/** Size of avatar */
/**
* Size of avatar
* @default 'medium'
*/
size?: Size;
/** The name of the person */
name?: string;
Expand Down
10 changes: 8 additions & 2 deletions src/components/DisplayText/DisplayText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import * as styles from './DisplayText.scss';
export type Size = 'small' | 'medium' | 'large' | 'extraLarge';

export interface Props {
/** Name of element to use for text */
/**
* Name of element to use for text
* @default 'p'
*/
element?: HeadingTagName;
/** Size of the text */
/**
* Size of the text
* @default 'medium'
*/
size?: Size;
/** Content to display */
children?: React.ReactNode;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {HeadingTagName} from '../../types';
import * as styles from './Heading.scss';

export interface Props {
/** The element name to use for the heading */
/**
* The element name to use for the heading
* @default 'h2'
*/
element?: HeadingTagName;
/** The content to display inside the heading */
children?: React.ReactNode;
Expand Down
5 changes: 4 additions & 1 deletion src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import Item from './Item';
export type Type = 'bullet' | 'number';

export interface Props {
/** Type of list to display */
/**
* Type of list to display
* @default 'bullet'
*/
type?: Type;
/** List item elements */
children?: React.ReactNode;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export interface Props {
active: boolean;
/** The element to activate the Popover */
activator: React.ReactElement<any>;
/** The element type to wrap the activator with */
/**
* The element type to wrap the activator with
* @default 'div'
*/
activatorWrapper?: string;
/** Prevent automatic focus of the first field on activation */
preventAutofocus?: boolean;
Expand Down
10 changes: 8 additions & 2 deletions src/components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import * as styles from './ProgressBar.scss';
export type Size = 'small' | 'medium' | 'large';

export interface Props {
/** The progression of certain tasks */
/**
* The progression of certain tasks
* @default 0
*/
progress?: number;
/** Size of progressbar */
/**
* Size of progressbar
* @default 'medium'
*/
size?: Size;
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/SkeletonBodyText/SkeletonBodyText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import * as React from 'react';
import * as styles from './SkeletonBodyText.scss';

export interface Props {
/** Number of lines to display */
/**
* Number of lines to display
* @default 3
*/
lines?: number;
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/SkeletonDisplayText/SkeletonDisplayText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import * as styles from './SkeletonDisplayText.scss';
export type Size = 'small' | 'medium' | 'large' | 'extraLarge';

export interface Props {
/** Size of the text */
/**
* Size of the text
* @default 'medium'
*/
size?: Size;
}

Expand Down
10 changes: 8 additions & 2 deletions src/components/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ export type Size = 'small' | 'large';
const COLORS_FOR_LARGE_SPINNER = ['teal', 'inkLightest'];

export interface Props {
/** Color of spinner */
/**
* Color of spinner
* @default 'teal'
*/
color?: Color;
/** Size of spinner */
/**
* Size of spinner
* @default 'large'
*/
size?: Size;
/** Accessible label for the spinner */
accessibilityLabel?: string;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Subheading/Subheading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {HeadingTagName} from '../../types';
import * as styles from './Subheading.scss';

export interface Props {
/** The element name to use for the subheading */
/**
* The element name to use for the subheading
* @default 'h3'
*/
element?: HeadingTagName;
/** Text to display in subheading */
children?: React.ReactNode;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Thumbnail/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import * as styles from './Thumbnail.scss';
export type Size = 'small' | 'medium' | 'large';

export interface Props {
/** Size of thumbnail */
/**
* Size of thumbnail
* @default 'medium'
*/
size?: Size;
/** URL for the image */
source: string;
Expand Down
10 changes: 8 additions & 2 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ export interface Props {
light?: boolean;
/** Toggle whether the tooltip is visible */
active?: boolean;
/** The direction the tooltip tries to display */
/**
* The direction the tooltip tries to display
* @default 'below'
*/
preferredPosition?: PreferredPosition;
/** The element type to wrap the activator in */
/**
* The element type to wrap the activator in
* @default 'span'
*/
activatorWrapper?: string;
}

Expand Down

0 comments on commit e1acb38

Please sign in to comment.