Skip to content

Commit

Permalink
style(typings): add new types (#1782)
Browse files Browse the repository at this point in the history
* style(typings): add new types

* style(typings): add new types

* style(typings): add new types
  • Loading branch information
layershifter authored and levithomason committed Jul 16, 2017
1 parent 2b906ed commit 164f750
Show file tree
Hide file tree
Showing 89 changed files with 484 additions and 202 deletions.
13 changes: 9 additions & 4 deletions src/addons/Confirm/Confirm.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import * as React from 'react';

import { SemanticShorthandItem } from '../..';
import { ButtonProps } from '../../elements/Button';
import { ModalProps } from '../../modules/Modal';
import { ModalContentProps } from '../../modules/Modal/ModalContent';
import { ModalHeaderProps } from '../../modules/Modal/ModalHeader';

export interface ConfirmProps extends ModalProps {
[key: string]: any;

/** The cancel button text. */
cancelButton?: any;
cancelButton?: SemanticShorthandItem<ButtonProps>;

/** The OK button text. */
confirmButton?: any;
confirmButton?: SemanticShorthandItem<ButtonProps>;

/** The ModalContent text. */
content?: any;
content?: SemanticShorthandItem<ModalContentProps>;

/** The ModalHeader text. */
header?: any;
header?: SemanticShorthandItem<ModalHeaderProps>;

/**
* Called when the Modal is closed without clicking confirm.
Expand Down
14 changes: 10 additions & 4 deletions src/collections/Breadcrumb/Breadcrumb.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as React from 'react';

import {
SemanticShorthandCollection,
SemanticShorthandContent,
SemanticShorthandItem
} from '../..';
import { IconProps } from '../../elements/Icon';
import { default as BreadcrumbDivider } from './BreadcrumbDivider';
import { default as BreadcrumbSection } from './BreadcrumbSection';
import { default as BreadcrumbSection, BreadcrumbSectionProps } from './BreadcrumbSection';

export interface BreadcrumbProps {
[key: string]: any;
Expand All @@ -16,15 +22,15 @@ export interface BreadcrumbProps {
className?: string;

/** Shorthand for primary content of the Breadcrumb.Divider. */
divider?: React.ReactNode;
divider?: SemanticShorthandContent;

/** For use with the sections prop. Render as an `Icon` component with `divider` class instead of a `div` in
* Breadcrumb.Divider.
*/
icon?: any;
icon?: SemanticShorthandItem<IconProps>;

/** Shorthand array of props for Breadcrumb.Section. */
sections?: Array<any>;
sections?: SemanticShorthandCollection<BreadcrumbSectionProps>;

/** Size of Breadcrumb */
size?: 'mini' | 'tiny' | 'small' | 'large' | 'big' | 'huge' | 'massive';
Expand Down
7 changes: 5 additions & 2 deletions src/collections/Breadcrumb/BreadcrumbDivider.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as React from 'react';

import { SemanticShorthandContent, SemanticShorthandItem } from '../..';
import { IconProps } from '../../elements/Icon';

export interface BreadcrumbDividerProps {
[key: string]: any;

Expand All @@ -13,10 +16,10 @@ export interface BreadcrumbDividerProps {
className?: string;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;

/** Render as an `Icon` component with `divider` class instead of a `div`. */
icon?: any;
icon?: SemanticShorthandItem<IconProps>;
}

declare const BreadcrumbDivider: React.StatelessComponent<BreadcrumbDividerProps>;
Expand Down
3 changes: 2 additions & 1 deletion src/collections/Breadcrumb/BreadcrumbSection.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../..';

export interface BreadcrumbSectionProps {
[key: string]: any;
Expand All @@ -16,7 +17,7 @@ export interface BreadcrumbSectionProps {
className?: string;

/** Shorthand for primary content. */
content?: any;
content?: SemanticShorthandContent;

/** Render as an `a` tag instead of a `div` and adds the href attribute. */
href?: string;
Expand Down
5 changes: 5 additions & 0 deletions src/collections/Form/FormButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from 'react';

import { SemanticShorthandItem } from '../..';
import { ButtonProps } from '../../elements/Button';
import { LabelProps } from '../../elements/Label';
import { FormFieldProps } from './FormField';

export interface FormButtonProps extends FormFieldProps, ButtonProps {
Expand All @@ -11,6 +13,9 @@ export interface FormButtonProps extends FormFieldProps, ButtonProps {

/** A FormField control prop. */
control?: any;

/** Shorthand for a Label. */
label?: SemanticShorthandItem<LabelProps>;
}

declare const FormButton: React.StatelessComponent<FormButtonProps>;
Expand Down
8 changes: 6 additions & 2 deletions src/collections/Form/FormField.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as React from 'react';
import { SemanticWIDTHS } from '../..';
import {
HtmlLabelProps,
SemanticShorthandItem,
SemanticWIDTHS
} from '../..';

export interface FormFieldProps {
[key: string]: any;
Expand Down Expand Up @@ -30,7 +34,7 @@ export interface FormFieldProps {
inline?: boolean;

/** Mutually exclusive with children. */
label?: any;
label?: SemanticShorthandItem<HtmlLabelProps>;

/** A field can show that input is mandatory. Requires a label. */
required?: any;
Expand Down
5 changes: 5 additions & 0 deletions src/collections/Form/FormInput.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from 'react';

import { SemanticShorthandItem } from '../..';
import { LabelProps } from '../../elements/Label';
import { InputProps } from '../../elements/Input';
import { FormFieldProps } from './FormField';

Expand All @@ -11,6 +13,9 @@ export interface FormInputProps extends FormFieldProps, InputProps {

/** A FormField control prop. */
control?: any;

/** Shorthand for a Label. */
label?: SemanticShorthandItem<LabelProps>;
}

declare const FormInput: React.StatelessComponent<FormInputProps>;
Expand Down
8 changes: 6 additions & 2 deletions src/collections/Menu/Menu.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import * as React from 'react';

import { SemanticCOLORS, SemanticWIDTHS } from '../..';
import {
SemanticCOLORS,
SemanticShorthandCollection,
SemanticWIDTHS
} from '../..';
import { default as MenuHeader } from './MenuHeader';
import { default as MenuItem, MenuItemProps } from './MenuItem';
import { default as MenuMenu } from './MenuMenu';
Expand Down Expand Up @@ -51,7 +55,7 @@ export interface MenuProps {
inverted?: boolean;

/** Shorthand array of props for Menu. */
items?: Array<any>;
items?: SemanticShorthandCollection<MenuItemProps>;

/**
* onClick handler for MenuItem. Mutually exclusive with children.
Expand Down
3 changes: 2 additions & 1 deletion src/collections/Menu/MenuHeader.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../..';

export interface MenuHeaderProps {
[key: string]: any;
Expand All @@ -13,7 +14,7 @@ export interface MenuHeaderProps {
className?: string;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;
}

declare const MenuHeader: React.ComponentClass<MenuHeaderProps>;
Expand Down
12 changes: 9 additions & 3 deletions src/collections/Menu/MenuItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as React from 'react';
import { SemanticCOLORS } from '../..';

import {
SemanticCOLORS,
SemanticShorthandContent,
SemanticShorthandItem
} from '../..';
import { IconProps } from '../../elements/Icon';

export interface MenuItemProps {
[key: string]: any;
Expand All @@ -20,7 +26,7 @@ export interface MenuItemProps {
color?: SemanticCOLORS;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;

/** A menu item can be disabled. */
disabled?: boolean;
Expand All @@ -32,7 +38,7 @@ export interface MenuItemProps {
header?: boolean;

/** MenuItem can be only icon. */
icon?: any | boolean;
icon?: boolean | SemanticShorthandItem<IconProps>;

/** MenuItem index inside Menu. */
index?: number;
Expand Down
17 changes: 11 additions & 6 deletions src/collections/Message/Message.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import * as React from 'react';

import { SemanticCOLORS } from '../..';
import {
SemanticCOLORS,
SemanticShorthandCollection,
SemanticShorthandContent,
SemanticShorthandItem
} from '../..';
import { default as MessageContent } from './MessageContent';
import { default as MessageHeader } from './MessageHeader';
import { default as MessageItem } from './MessageItem';
import { default as MessageHeader, MessageHeaderProps } from './MessageHeader';
import { default as MessageItem, MessageItemProps } from './MessageItem';
import { default as MessageList } from './MessageList';

export interface MessageProps {
Expand All @@ -28,7 +33,7 @@ export interface MessageProps {
compact?: boolean;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;

/** A message may be formatted to display a negative message. Same as `negative`. */
error?: boolean;
Expand All @@ -37,7 +42,7 @@ export interface MessageProps {
floating?: boolean;

/** Shorthand for MessageHeader. */
header?: any;
header?: SemanticShorthandItem<MessageHeaderProps>;

/** A message can be hidden. */
hidden?: boolean;
Expand All @@ -49,7 +54,7 @@ export interface MessageProps {
info?: boolean;

/** Array shorthand items for the MessageList. Mutually exclusive with children. */
list?: any;
list?: SemanticShorthandCollection<MessageItemProps>;

/** A message may be formatted to display a negative message. Same as `error`. */
negative?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/collections/Message/MessageHeader.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../..';

export interface MessageHeaderProps {
[key: string]: any;
Expand All @@ -13,7 +14,7 @@ export interface MessageHeaderProps {
className?: string;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;
}

declare const MessageHeader: React.StatelessComponent<MessageHeaderProps>;
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Message/MessageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MessageHeader.propTypes = {
className: PropTypes.string,

/** Shorthand for primary content. */
content: customPropTypes.itemShorthand,
content: customPropTypes.contentShorthand,
}

MessageHeader.create = createShorthandFactory(MessageHeader, val => ({ content: val }))
Expand Down
3 changes: 2 additions & 1 deletion src/collections/Message/MessageItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../..';

export interface MessageItemProps {
[key: string]: any;
Expand All @@ -13,7 +14,7 @@ export interface MessageItemProps {
className?: string;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;
}

declare const MessageItem: React.StatelessComponent<MessageItemProps>;
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Message/MessageItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MessageItem.propTypes = {
className: PropTypes.string,

/** Shorthand for primary content. */
content: customPropTypes.itemShorthand,
content: customPropTypes.contentShorthand,
}

MessageItem.defaultProps = {
Expand Down
5 changes: 4 additions & 1 deletion src/collections/Message/MessageList.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as React from 'react';

import { SemanticShorthandCollection } from '../..';
import { MessageItemProps } from './MessageItem';

export interface MessageListProps {
[key: string]: any;

Expand All @@ -13,7 +16,7 @@ export interface MessageListProps {
className?: string;

/** Shorthand Message.Items. */
items?: Array<any>;
items?: SemanticShorthandCollection<MessageItemProps>;
}

declare const MessageList: React.StatelessComponent<MessageListProps>;
Expand Down
7 changes: 4 additions & 3 deletions src/collections/Table/Table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';

import {
SemanticCOLORS,
SemanticShorthandItem,
SemanticVERTICALALIGNMENTS,
SemanticWIDTHS
} from '../..';
Expand All @@ -10,7 +11,7 @@ import { default as TableCell } from './TableCell';
import { default as TableFooter } from './TableFooter';
import { default as TableHeader } from './TableHeader';
import { default as TableHeaderCell } from './TableHeaderCell';
import { default as TableRow } from './TableRow';
import { default as TableRow, TableRowProps } from './TableRow';

export interface TableProps {
[key: string]: any;
Expand Down Expand Up @@ -54,10 +55,10 @@ export interface TableProps {
fixed?: boolean;

/** Shorthand for a TableRow to be placed within Table.Footer. */
footerRow?: any;
footerRow?: SemanticShorthandItem<TableRowProps>;

/** Shorthand for a TableRow to be placed within Table.Header. */
headerRow?: any;
headerRow?: SemanticShorthandItem<TableRowProps>;

/** A table's colors can be inverted. */
inverted?: boolean;
Expand Down
8 changes: 6 additions & 2 deletions src/collections/Table/TableCell.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import * as React from 'react';

import {
SemanticShorthandContent,
SemanticShorthandItem,
SemanticVERTICALALIGNMENTS,
SemanticWIDTHS
} from '../..';
import { IconProps } from '../../elements/Icon';

export interface TableCellProps {
[key: string]: any;
Expand All @@ -23,7 +27,7 @@ export interface TableCellProps {
collapsing?: boolean;

/** Shorthand for primary content. */
content?: React.ReactNode;
content?: SemanticShorthandContent;

/** A cell can be disabled. */
disabled?: boolean;
Expand All @@ -32,7 +36,7 @@ export interface TableCellProps {
error?: boolean;

/** Add an Icon by name, props object, or pass an <Icon /> */
icon?: any;
icon?: SemanticShorthandItem<IconProps>;

/** A cell may let a user know whether a value is bad. */
negative?: boolean;
Expand Down
Loading

0 comments on commit 164f750

Please sign in to comment.