Skip to content

Commit

Permalink
style(typings): add new types
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fedyashov committed Jun 22, 2017
1 parent db426e5 commit 07a3a37
Show file tree
Hide file tree
Showing 59 changed files with 277 additions and 147 deletions.
2 changes: 1 addition & 1 deletion src/addons/Confirm/Confirm.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { SemanticShorthandItem } from '../../';
import { SemanticShorthandItem } from '../..';
import { ButtonProps } from '../../elements/Button';
import { ModalProps } from '../../modules/Modal';
import { ModalContentProps } from '../../modules/Modal/ModalContent';
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Breadcrumb/Breadcrumb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
SemanticShorthandCollection,
SemanticShorthandContent,
SemanticShorthandItem
} from '../../';
} from '../..';
import { IconProps } from '../../elements/Icon';
import { default as BreadcrumbDivider } from './BreadcrumbDivider';
import { default as BreadcrumbSection, BreadcrumbSectionProps } from './BreadcrumbSection';
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Breadcrumb/BreadcrumbDivider.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

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

export interface BreadcrumbDividerProps {
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Breadcrumb/BreadcrumbSection.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../../';
import { SemanticShorthandContent } from '../..';

export interface BreadcrumbSectionProps {
[key: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Menu/MenuHeader.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { SemanticShorthandContent } from '../../';
import { SemanticShorthandContent } from '../..';

export interface MenuHeaderProps {
[key: string]: any;
Expand Down
19 changes: 12 additions & 7 deletions src/collections/Message/Message.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
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 {
[key: string]: any;

/** An element type to render as (string or function). */
/** An element type to render as (string or function). */
as?: any;

/** A message can be formatted to attach itself to other content. */
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
6 changes: 4 additions & 2 deletions src/collections/Table/TableRow.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from 'react';
import { SemanticVERTICALALIGNMENTS } from '../..';

import { SemanticShorthandCollection, SemanticVERTICALALIGNMENTS } from '../..';
import { TableCellProps } from './TableCell';

export interface TableRowProps {
[key: string]: any;
Expand All @@ -14,7 +16,7 @@ export interface TableRowProps {
cellAs?: any;

/** Shorthand array of props for TableCell. */
cells?: any;
cells?: SemanticShorthandCollection<TableCellProps>;

/** Primary content. */
children?: React.ReactNode;
Expand Down
3 changes: 2 additions & 1 deletion src/elements/Button/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import {
SemanticCOLORS,
SemanticFLOATS,
SemanticShorthandContent,
SemanticSIZES
} from '../..';
import { default as ButtonContent } from './ButtonContent';
Expand Down Expand Up @@ -43,7 +44,7 @@ export interface ButtonProps {
compact?: boolean;

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

/** A button can show it is currently unable to be interacted with. */
disabled?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/elements/Header/HeaderSubheader.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 HeaderSubheaderProps {
[key: string]: any;
Expand All @@ -13,7 +14,7 @@ export interface HeaderSubheaderProps {
className?: string;

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

declare const HeaderSubHeader: React.StatelessComponent<HeaderSubheaderProps>;
Expand Down
6 changes: 4 additions & 2 deletions src/elements/Image/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import * as React from 'react';

import {
SemanticFLOATS,
SemanticShorthandItem,
SemanticSIZES,
SemanticVERTICALALIGNMENTS,
SemanticWIDTHS
} from '../..';
import { DimmerProps } from '../../modules/Dimmer';
import { LabelProps } from '../Label';
import ImageGroup from './ImageGroup';

Expand Down Expand Up @@ -37,7 +39,7 @@ export interface ImageProps {
disabled?: boolean;

/** Shorthand for Dimmer. */
dimmer?: any;
dimmer?: SemanticShorthandItem<DimmerProps>;

/** An image can sit to the left or right of other content. */
floated?: SemanticFLOATS;
Expand All @@ -58,7 +60,7 @@ export interface ImageProps {
inline?: boolean;

/** Shorthand for Label. */
label?: any | LabelProps;
label?: SemanticShorthandItem<LabelProps>;

/** An image may appear rounded or circular. */
shape?: 'rounded'|'circular';
Expand Down
14 changes: 10 additions & 4 deletions src/elements/Input/Input.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as React from 'react';
import { SemanticSIZES } from '../..';

import {
HtmlInputrops,
SemanticShorthandItem,
SemanticSIZES
} from '../..';
import { LabelProps } from '../Label/Label';

export interface InputProps {
[key: string]: any;
Expand Down Expand Up @@ -32,19 +38,19 @@ export interface InputProps {
focus?: boolean;

/** Optional Icon to display inside the Input. */
icon?: any | boolean;
icon?: any | SemanticShorthandItem<InputProps>;

/** An Icon can appear inside an Input on the left. */
iconPosition?: 'left';

/** Shorthand for creating the HTML Input. */
input?: any;
input?: SemanticShorthandItem<HtmlInputrops>;

/** Format to appear on dark backgrounds. */
inverted?: boolean;

/** Optional Label to display along side the Input. */
label?: any;
label?: SemanticShorthandItem<LabelProps>;

/** A Label can appear outside an Input on the left or right. */
labelPosition?: 'left' | 'right' | 'left corner' | 'right corner';
Expand Down
18 changes: 12 additions & 6 deletions src/elements/Label/Label.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as React from 'react';

import { SemanticCOLORS, SemanticSIZES } from '../..';
import { default as LabelDetail } from './LabelDetail';
import {
SemanticCOLORS,
SemanticShorthandContent,
SemanticShorthandItem,
SemanticSIZES
} from '../..';
import { IconProps } from '../Icon/Icon';
import { default as LabelDetail, LabelDetailProps } from './LabelDetail';
import { default as LabelGroup } from './LabelGroup';

export interface LabelProps {
Expand Down Expand Up @@ -32,13 +38,13 @@ export interface LabelProps {
color?: SemanticCOLORS;

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

/** A label can position itself in the corner of an element. */
corner?: boolean | 'left' | 'right';

/** Shorthand for LabelDetail. */
detail?: any;
detail?: SemanticShorthandItem<LabelDetailProps>;

/** Formats the label as a dot. */
empty?: any;
Expand All @@ -50,7 +56,7 @@ export interface LabelProps {
horizontal?: boolean;

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

/** A label can be formatted to emphasize an image or prop can be used as shorthand for Image. */
image?: any;
Expand All @@ -75,7 +81,7 @@ export interface LabelProps {
pointing?: boolean | 'above' | 'below' | 'left' | 'right';

/** Shorthand for Icon to appear as the last child and trigger onRemove. */
removeIcon?: any;
removeIcon?: SemanticShorthandItem<IconProps>;

/** A label can appear as a ribbon attaching itself to an element. */
ribbon?: boolean | 'right';
Expand Down
3 changes: 2 additions & 1 deletion src/elements/Label/LabelDetail.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 LabelDetailProps {
[key: string]: any;
Expand All @@ -13,7 +14,7 @@ export interface LabelDetailProps {
className?: string;

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

declare const LabelDetail: React.StatelessComponent<LabelDetailProps>;
Expand Down
Loading

0 comments on commit 07a3a37

Please sign in to comment.