From 3e29844e630e7702a6f07b938f5abbd864306d75 Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Mon, 4 Jul 2016 22:03:57 +0200 Subject: [PATCH 1/2] Update to react 15.2.0 --- components/autocomplete/Autocomplete.js | 6 +- components/avatar/Avatar.js | 3 +- components/dropdown/Dropdown.js | 2 +- components/list/ListItem.js | 12 +- components/ripple/Ripple.js | 1 + docs/package.json | 6 +- lib/app_bar/index.d.ts | 58 ------ lib/autocomplete/index.d.ts | 97 ---------- lib/avatar/index.d.ts | 57 ------ lib/button/index.d.ts | 124 ------------- lib/card/index.d.ts | 225 ------------------------ lib/checkbox/index.d.ts | 82 --------- lib/chip/index.d.ts | 68 ------- lib/date_picker/index.d.ts | 69 -------- lib/dialog/index.d.ts | 159 ----------------- lib/drawer/index.d.ts | 76 -------- lib/dropdown/Dropdown.js | 2 +- lib/dropdown/index.d.ts | 84 --------- lib/font_icon/index.d.ts | 44 ----- lib/hoc/ActivableRenderer.d.ts | 13 -- lib/identifiers.js | 1 + lib/input/Input.js | 31 ++++ lib/input/index.d.ts | 124 ------------- lib/layout/index.d.ts | 43 ----- lib/link/index.d.ts | 58 ------ lib/list/index.d.ts | 180 ------------------- lib/menu/index.d.ts | 150 ---------------- lib/navigation/index.d.ts | 58 ------ lib/overlay/index.d.ts | 51 ------ lib/progress_bar/index.d.ts | 71 -------- lib/radio/index.d.ts | 101 ----------- lib/ripple/index.d.ts | 20 --- lib/slider/index.d.ts | 74 -------- lib/snackbar/index.d.ts | 100 ----------- lib/switch/index.d.ts | 77 -------- lib/table/index.d.ts | 66 ------- lib/tabs/index.d.ts | 84 --------- lib/time_picker/index.d.ts | 61 ------- lib/tooltip/index.d.ts | 10 -- package.json | 14 +- spec/components/avatar.js | 2 +- 41 files changed, 61 insertions(+), 2503 deletions(-) delete mode 100644 lib/app_bar/index.d.ts delete mode 100644 lib/autocomplete/index.d.ts delete mode 100644 lib/avatar/index.d.ts delete mode 100644 lib/button/index.d.ts delete mode 100644 lib/card/index.d.ts delete mode 100644 lib/checkbox/index.d.ts delete mode 100644 lib/chip/index.d.ts delete mode 100644 lib/date_picker/index.d.ts delete mode 100644 lib/dialog/index.d.ts delete mode 100644 lib/drawer/index.d.ts delete mode 100644 lib/dropdown/index.d.ts delete mode 100644 lib/font_icon/index.d.ts delete mode 100644 lib/hoc/ActivableRenderer.d.ts delete mode 100644 lib/input/index.d.ts delete mode 100644 lib/layout/index.d.ts delete mode 100644 lib/link/index.d.ts delete mode 100644 lib/list/index.d.ts delete mode 100644 lib/menu/index.d.ts delete mode 100644 lib/navigation/index.d.ts delete mode 100644 lib/overlay/index.d.ts delete mode 100644 lib/progress_bar/index.d.ts delete mode 100644 lib/radio/index.d.ts delete mode 100644 lib/ripple/index.d.ts delete mode 100644 lib/slider/index.d.ts delete mode 100644 lib/snackbar/index.d.ts delete mode 100644 lib/switch/index.d.ts delete mode 100644 lib/table/index.d.ts delete mode 100644 lib/tabs/index.d.ts delete mode 100644 lib/time_picker/index.d.ts delete mode 100644 lib/tooltip/index.d.ts diff --git a/components/autocomplete/Autocomplete.js b/components/autocomplete/Autocomplete.js index a205fa16..587f4e86 100644 --- a/components/autocomplete/Autocomplete.js +++ b/components/autocomplete/Autocomplete.js @@ -270,7 +270,11 @@ const factory = (Chip, Input) => { } render () { - const {error, label, theme, ...other} = this.props; + const { + error, label, source, suggestionMatch, //eslint-disable-line no-unused-vars + selectedPosition, showSuggestionsWhenValueIsSet, //eslint-disable-line no-unused-vars + theme, ...other + } = this.props; const className = classnames(theme.autocomplete, { [theme.focus]: this.state.focus }, this.props.className); diff --git a/components/avatar/Avatar.js b/components/avatar/Avatar.js index baf0441e..24cf719a 100644 --- a/components/avatar/Avatar.js +++ b/components/avatar/Avatar.js @@ -1,11 +1,12 @@ import React, { PropTypes } from 'react'; +import classnames from 'classnames'; import { themr } from 'react-css-themr'; import { AVATAR } from '../identifiers.js'; import InjectFontIcon from '../font_icon/FontIcon.js'; const factory = (FontIcon) => { const Avatar = ({children, className, icon, image, theme, title, ...other}) => ( -
+
{children} {typeof image === 'string' ? : image} {typeof icon === 'string' ? : icon} diff --git a/components/dropdown/Dropdown.js b/components/dropdown/Dropdown.js index 1c69124b..d77a02c0 100644 --- a/components/dropdown/Dropdown.js +++ b/components/dropdown/Dropdown.js @@ -141,7 +141,7 @@ const factory = (Input) => { } render () { - const {template, theme, source, ...others} = this.props; + const {template, theme, source, allowBlank, auto, ...others} = this.props; //eslint-disable-line no-unused-vars const selected = this.getSelectedItem(); const className = classnames(theme.dropdown, { [theme.up]: this.state.up, diff --git a/components/list/ListItem.js b/components/list/ListItem.js index 2cea098d..f3bf537a 100644 --- a/components/list/ListItem.js +++ b/components/list/ListItem.js @@ -42,16 +42,20 @@ const factory = (ripple, ListItemLayout, ListItemContent) => { if (!React.isValidElement(child)) { return; } - if (child.props.listItemIgnore) { - children.ignored.push(child); + + const { listItemIgnore, ...rest } = child.props; + const strippedChild = { ...child, ...{ props: rest } }; + + if (listItemIgnore) { + children.ignored.push(strippedChild); return; } if (child.type === ListItemContent) { - children.itemContent = child; + children.itemContent = strippedChild; return; } const bucket = children.itemContent ? 'rightActions' : 'leftActions'; - children[bucket].push({...child, key: i}); + children[bucket].push({...strippedChild, key: i}); }); return children; diff --git a/components/ripple/Ripple.js b/components/ripple/Ripple.js index cabd88e9..125d7603 100644 --- a/components/ripple/Ripple.js +++ b/components/ripple/Ripple.js @@ -113,6 +113,7 @@ const rippleFactory = (options = {}) => { const { children, ripple, //eslint-disable-line no-unused-vars + onRippleEnded, //eslint-disable-line no-unused-vars rippleClassName: className, rippleCentered: centered, //eslint-disable-line no-unused-vars rippleSpread: spread, //eslint-disable-line no-unused-vars diff --git a/docs/package.json b/docs/package.json index eafc3413..f9234b2d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,9 +13,9 @@ "classnames": "^2.2.5", "codemirror": "^5.14.2", "history": "^2.1.1", - "react": "^15.0.2", - "react-css-themr": "^1.1.0", - "react-dom": "^15.0.2", + "react": "^15.2.0", + "react-css-themr": "^1.1.2", + "react-dom": "^15.2.0", "react-router": "^2.4.0" }, "devDependencies": { diff --git a/lib/app_bar/index.d.ts b/lib/app_bar/index.d.ts deleted file mode 100644 index 97e2fa34..00000000 --- a/lib/app_bar/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} - -export interface AppBarProps extends Props { - /** - * If true, the AppBar shows a shadow. - * @default false - */ - flat?: boolean, - /** - * Determine if the bar should have position fixed (true) or relative (false) - * @default false - */ - fixed?: boolean, -} -/** - * The app bar is a special kind of toolbar that�s used for branding, navigation, search, and actions. - * Usually it contains controls on the right and left side and a title with the current section or app name. - * You should give the content with children elements. - */ -export class AppBar extends React.Component { - render(): React.DOMElement; -} - -export default AppBar; \ No newline at end of file diff --git a/lib/autocomplete/index.d.ts b/lib/autocomplete/index.d.ts deleted file mode 100644 index 39452ebd..00000000 --- a/lib/autocomplete/index.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface AutocompleteProps extends Props, Conditional, Changeable> { - /** - * Sets the error string for the internal input element. - */ - error?: string, - /** - * The text string to use for the floating label element. - */ - label?: string, - /** - * If true, component can hold multiple values. - * @default true - */ - multiple?: boolean, - /** - * Object of key/values or array representing all items suggested. - */ - source: Object | Array, - /** - * If true, the list of suggestions will not be filtered when a value is selected, until the query is modified. - * @default false - */ - showSuggestionsWhenValueIsSet?: boolean, - /** - * Type of the input element. It can be a valid HTML5 input type - * @default text - */ - type?: string, - /** - * Value or array of values currently selected component.Current value of the input element. - */ - value?: string | Array, -} -/** - * An input field with a set of predeterminated labeled values. When it's focused it shows a list of hints that are filtered by label as the user types. - * They can be simple or multiple depending on the amount of values that can be selected. - * The opening direction is determined at opening time depending on the current position. - */ -export class Autocomplete extends React.Component { - render(): React.DOMElement; -} - -export default Autocomplete; \ No newline at end of file diff --git a/lib/avatar/index.d.ts b/lib/avatar/index.d.ts deleted file mode 100644 index c30e43bb..00000000 --- a/lib/avatar/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | React.ReactElement | React.ReactHTMLElement, -} -export interface AvatarProps extends Props, Iconic { - children?: any, - image?: string | React.ReactElement | React.ReactHTMLElement | React.ClassicComponent, - title?: string | boolean, -} -/** - * Avatars can be used to represent people. - * For personal avatars, offer personalization options. - * As users may choose not to personalize an avatar, provide delightful defaults. - * When used with a specific logo, avatars can also be used to represent brand. - */ -export class Avatar extends React.Component { - render(): React.DOMElement; -} - -export default Avatar; \ No newline at end of file diff --git a/lib/button/index.d.ts b/lib/button/index.d.ts deleted file mode 100644 index ff8c4fa9..00000000 --- a/lib/button/index.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} - -// Interface for components with icons -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | React.ReactElement | React.ReactHTMLElement, -} - -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that can be clicked - */ -export interface Clickable { - /** - * Callback called when the button is clicked. - */ - onClick?: Function -} -export interface ButtonProps extends Props, Clickable, Conditional, Iconic { - /** - * Indicates if the button should have accent color. - * @default false - */ - accent?: boolean, - /** - * If true, the button will have a flat look. - * @default false - */ - flat?: boolean, - /** - * If true, the button will have a floating look. - * @default false - */ - floating?: boolean, - /** - * If specified, the button will be rendered as an - */ - href?: string, - /** - * The text string to use for the name of the button. - */ - label?: string, - /** - * If true, component will be disabled and show a loading animation. - * @default false - */ - loading?: boolean, - /** - * To be used with floating button. If true the button will be smaller. - * @default false - */ - mini?: boolean, - /** - * Indicates if the button should have primary color. - * @default false - */ - primary?: boolean, - /** - * If true, the button will have a raised look. - * @default false - */ - raised?: boolean, - /** - * If true, component will have a ripple effect on click. - * @default true - */ - ripple?: boolean, -} -/** - * A button clearly communicates what action will occur when the user touches it. - * It consists of text, an image, or both, designed in accordance with your app’s color theme. - */ -export class Button extends React.Component { - render(): React.DOMElement; -} - -export class IconButton extends React.Component { - render(): React.DOMElement; -} - -export default Button; \ No newline at end of file diff --git a/lib/card/index.d.ts b/lib/card/index.d.ts deleted file mode 100644 index dc4f3a4b..00000000 --- a/lib/card/index.d.ts +++ /dev/null @@ -1,225 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} - -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that can be clicked - */ -export interface Clickable { - /** - * Callback called when the button is clicked. - */ - onClick?: Function -} -export interface ButtonProps extends Props, Clickable, Conditional, Iconic { - /** - * Indicates if the button should have accent color. - * @default false - */ - accent?: boolean, - /** - * If true, the button will have a flat look. - * @default false - */ - flat?: boolean, - /** - * If true, the button will have a floating look. - * @default false - */ - floating?: boolean, - /** - * If specified, the button will be rendered as an - */ - href?: string, - /** - * The text string to use for the name of the button. - */ - label?: string, - /** - * If true, component will be disabled and show a loading animation. - * @default false - */ - loading?: boolean, - /** - * To be used with floating button. If true the button will be smaller. - * @default false - */ - mini?: boolean, - /** - * Indicates if the button should have primary color. - * @default false - */ - primary?: boolean, - /** - * If true, the button will have a raised look. - * @default false - */ - raised?: boolean, - /** - * If true, component will have a ripple effect on click. - * @default true - */ - ripple?: boolean, -} -export interface CardProps extends Props, Clickable { - /** - * Child components, usually Card subcomponents. - */ - children?: any, - /** - * Increases the shadow depth to appear elevated. - */ - raised?: boolean, - /** - * Array of objects describing actions. These actions will be rendered as buttons and the object fields will be transferred to those. - * @default [] - */ - actions?: Array, - /** - * Sets HEX or RGBA color to add a colored layer to the heading. - */ - color?: string, - /** - * URL to set as a background image in the heading. - */ - image?: string, - - /** - * Type of the component to display general modifications. It can be 'wide' for a larger card, 'image' if it's an image card or 'event' which shows just a title on top. - */ - type?: string, -} -/** - * A Card is a piece of paper with unique related data that serves as an entry point to more detailed information. - * For example, a card could contain a photo, text, and a link about a single subject. - * Cards are composed of multiple subcomponents in React Toolbox. - * You can combine each of the subcomponents to create all different Material Design Cards given in the spec. - */ -export class Card extends React.Component { - render(): React.DOMElement; -} -export interface CardTitleProps extends Props { - avatar?: string | React.ReactElement | React.ReactHTMLElement | React.ClassicComponent, - /** - * Children to pass through the component. - */ - children?: any, - /** - * Sets a complementary smaller text under the title. - */ - subtitle?: string, - /** - * Sets the title of the card. - */ - title?: string | boolean, -} -/** - * A versatile title block that can be used in various places on the card, including the media area. - * This component can also display an avatar next to the title content. - */ -export class CardTitle extends React.Component { - render(): React.DOMElement; -} -export interface CardMediaProps extends Props { - /** - * Forces a ('wide' 16:9) or ('square' 1:1) aspect ratio respectively. - * Unset, the media area will have a flexible height. - * @default '' - */ - aspectRatio?: string, - /** - * Usually an image/video element or a component. - */ - children?: any, - /** - * Sets the background color - */ - color?: string, - /** - * Creates a dark overlay underneath the child components. - */ - contentOverlay?: boolean, - /** - * Can be used instead of children. Accepts an element or a URL string. - */ - image?: string | React.ReactElement | React.ReactHTMLElement | React.ClassicComponent, -} -/** - * Used for displaying media such as images or videos on a card. - * Can also be used with a solid background color instead of an image. - */ -export class CardMedia extends React.Component { - render(): React.DOMElement; -} -export interface CardTextProps extends Props { - /** - * Children to pass through the component. - */ - children?: any, -} -/** - * Basic card content container. - * Good for small descriptions or other supplementary text. - */ -export class CardText extends React.Component { - render(): React.DOMElement; -} -export interface CardActionsProps extends Props { - /** - * Children to pass through the component. - */ - children?: any, -} -/** - * This component is used as a container for supplemental card actions. - * Supplemental actions within the card are explicitly called out using icons, text, and UI controls, typically placed at the bottom of the card. - */ -export class CardActions extends React.Component { - render(): React.DOMElement; -} \ No newline at end of file diff --git a/lib/checkbox/index.d.ts b/lib/checkbox/index.d.ts deleted file mode 100644 index e266c3d2..00000000 --- a/lib/checkbox/index.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface CheckboxProps extends Props, Changeable, Conditional { - /** - * Value for the checkbox, can be true or false. - * @default false - */ - checked?: boolean, - /** - * Text label to attach next to the checkbox element. - */ - label?: string, - /** - * The name of the field to set in the input checkbox. - */ - name?: string, - /** - * Callback called when the checkbox is blurred. - */ - onBlur?: Function, - /** - * Callback called when the checkbox is focused - */ - onFocus?: Function, -} -export class Checkbox extends React.Component { - render(): React.DOMElement; -} - -export default Checkbox; \ No newline at end of file diff --git a/lib/chip/index.d.ts b/lib/chip/index.d.ts deleted file mode 100644 index 8c081ea2..00000000 --- a/lib/chip/index.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -export interface ChipProps extends Props { - /** - * Child components, usually Avatar and inline elements - */ - children?: React.ReactNode; - /** - * If true, the chip will be rendered with a delete icon. - */ - deletable?: boolean; - /** - * Callback to be invoked when the delete icon is clicked. - */ - onDeleteClick?: React.MouseEventHandler -} -/** - * Avatars can be used to represent people. - * For personal avatars, offer personalization options. - * As users may choose not to personalize an avatar, provide delightful defaults. - * When used with a specific logo, avatars can also be used to represent brand. - */ -export class Chip extends React.Component { - render(): React.ReactElement; -} - -export default Chip; \ No newline at end of file diff --git a/lib/date_picker/index.d.ts b/lib/date_picker/index.d.ts deleted file mode 100644 index b6a6425b..00000000 --- a/lib/date_picker/index.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface DatePickerProps extends Props, Changeable { - /** - * Date object with the maximum selectable date. - */ - maxDate?: Date, - /** - * Date object with the minimum selectable date. - */ - minDate?: Date, - /** - * The text string to use like a input placeholder. - */ - placeholder?: string, - /** - * Date object with the currently selected date. - */ - value?: Date, -} -export class DatePicker extends React.Component { - render(): React.DOMElement; -} - -export default DatePicker; \ No newline at end of file diff --git a/lib/dialog/index.d.ts b/lib/dialog/index.d.ts deleted file mode 100644 index 72118a06..00000000 --- a/lib/dialog/index.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} - -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that can be clicked - */ -export interface Clickable { - /** - * Callback called when the button is clicked. - */ - onClick?: Function -} -/** - * Properties of modal components (Drawer, Dialog) - */ -export interface Modal { - /** - * If true, the dialog will be active. - */ - active: boolean, - /** - * Callback called when the ESC key is pressed with the overlay active. - */ - onEscKeyDown?: Function, - /** - * Callback to be invoked when the dialog overlay is clicked. - */ - onOverlayClick?: Function, - /** - * Callback called when the mouse button is pressed on the overlay. - */ - onOverlayMouseDown?: Function, - /** - * Callback called when the mouse is moving over the overlay. - */ - onOverlayMouseMove?: Function, - /** - * Callback called when the mouse button is released over the overlay. - */ - onOverlayMouseUp?: Function, -} -export interface ButtonProps extends Props, Clickable, Conditional, Iconic { - /** - * Indicates if the button should have accent color. - * @default false - */ - accent?: boolean, - /** - * If true, the button will have a flat look. - * @default false - */ - flat?: boolean, - /** - * If true, the button will have a floating look. - * @default false - */ - floating?: boolean, - /** - * If specified, the button will be rendered as an - */ - href?: string, - /** - * The text string to use for the name of the button. - */ - label?: string, - /** - * If true, component will be disabled and show a loading animation. - * @default false - */ - loading?: boolean, - /** - * To be used with floating button. If true the button will be smaller. - * @default false - */ - mini?: boolean, - /** - * Indicates if the button should have primary color. - * @default false - */ - primary?: boolean, - /** - * If true, the button will have a raised look. - * @default false - */ - raised?: boolean, - /** - * If true, component will have a ripple effect on click. - * @default true - */ - ripple?: boolean, -} -export interface DialogProps extends Props, Modal { - /** - * An array of objects representing the buttons for the dialog navigation area. The properties will be transferred to the buttons. - * @default [] - */ - actions?: Array, - /** - * The text string to use as standar title of the dialog. - */ - title?: string | boolean, - /** - * Used to determine the size of the dialog. It can be small, normal or large. - * @default normal - */ - type?: string, -} -export class Dialog extends React.Component { - render(): React.DOMElement; -} - -export default Dialog; \ No newline at end of file diff --git a/lib/drawer/index.d.ts b/lib/drawer/index.d.ts deleted file mode 100644 index 478dec86..00000000 --- a/lib/drawer/index.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -/** - * Properties of modal components (Drawer, Dialog) - */ -export interface Modal { - /** - * If true, the dialog will be active. - */ - active: boolean, - /** - * Callback called when the ESC key is pressed with the overlay active. - */ - onEscKeyDown?: Function, - /** - * Callback to be invoked when the dialog overlay is clicked. - */ - onOverlayClick?: Function, - /** - * Callback called when the mouse button is pressed on the overlay. - */ - onOverlayMouseDown?: Function, - /** - * Callback called when the mouse is moving over the overlay. - */ - onOverlayMouseMove?: Function, - /** - * Callback called when the mouse button is released over the overlay. - */ - onOverlayMouseUp?: Function, -} -export interface DrawerProps extends Props, Modal { - /** - * Type of drawer. It can be 'left' or 'right' to display the drawer on the left or right side of the screen. - * @default left - */ - type?: string -} -export class Drawer extends React.Component { - render(): React.DOMElement; -} - -export default Drawer; \ No newline at end of file diff --git a/lib/dropdown/Dropdown.js b/lib/dropdown/Dropdown.js index ea2304b0..a2c0fb42 100644 --- a/lib/dropdown/Dropdown.js +++ b/lib/dropdown/Dropdown.js @@ -204,7 +204,7 @@ var factory = function factory(Input) { onMouseDown: this.handleMouseDown, readOnly: true, type: template && selected ? 'hidden' : null, - value: selected && selected.label + value: selected && selected.label ? selected.label : '' })), template && selected ? this.renderTemplateValue(selected) : null, _react2.default.createElement( diff --git a/lib/dropdown/index.d.ts b/lib/dropdown/index.d.ts deleted file mode 100644 index b9d90484..00000000 --- a/lib/dropdown/index.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} -export interface Option { - label: string, - value: T, -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} -export interface DropdownProps extends Props, Changeable, Conditional { - /** - * If true, the dropdown will open up or down depending on the position in the screen. - */ - auto?: boolean, - /** - * The text string to use for the floating label element. - */ - label?: string, - /** - * Array of data objects with the data to represent in the dropdown. - */ - source: Array>, - /** - * Callback function that returns a JSX template to represent the element. - */ - template?: Function, - /** - * Default value using JSON data. - */ - value: string, -} - -export class Dropdown extends React.Component { - render(): React.DOMElement; -} - -export default Dropdown; \ No newline at end of file diff --git a/lib/font_icon/index.d.ts b/lib/font_icon/index.d.ts deleted file mode 100644 index 8fc061fd..00000000 --- a/lib/font_icon/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} - -export interface FontIconProps extends Props { - value: string -} -export class FontIcon extends React.Component { - render(): React.DOMElement; -} - -export default FontIcon; \ No newline at end of file diff --git a/lib/hoc/ActivableRenderer.d.ts b/lib/hoc/ActivableRenderer.d.ts deleted file mode 100644 index ab73e065..00000000 --- a/lib/hoc/ActivableRenderer.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as React from 'react'; -export interface ActivableRendererOptions { - /** - * @default 500 - */ - delay?: number; -} -export interface ActivableRendererProps { - active: boolean; - children?: any; - delay?: number -} -export default function ActivableRendererFactory

(options?: ActivableRendererOptions): (componentClass: React.ComponentClass

) => React.ComponentClass

\ No newline at end of file diff --git a/lib/identifiers.js b/lib/identifiers.js index 5bc7ebe2..b301fbec 100644 --- a/lib/identifiers.js +++ b/lib/identifiers.js @@ -16,6 +16,7 @@ var INPUT = exports.INPUT = 'RTInput'; var LAYOUT = exports.LAYOUT = 'RTLayout'; var LINK = exports.LINK = 'RTLink'; var LIST = exports.LIST = 'RTList'; +var MENU = exports.MENU = 'RTMenu'; var NAVIGATION = exports.NAVIGATION = 'RTNavigation'; var OVERLAY = exports.OVERLAY = 'RTOverlay'; var PROGRESS_BAR = exports.PROGRESS_BAR = 'RTProgressBar'; diff --git a/lib/input/Input.js b/lib/input/Input.js index 27e7d9b0..02b397ee 100644 --- a/lib/input/Input.js +++ b/lib/input/Input.js @@ -53,11 +53,42 @@ var factory = function factory(FontIcon) { } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Input)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleChange = function (event) { + if (_this.props.multiline) { + _this.handleAutoresize(); + } if (_this.props.onChange) _this.props.onChange(event.target.value, event); + }, _this.handleAutoresize = function () { + var element = _this.refs.input; + // compute the height difference between inner height and outer height + var style = getComputedStyle(element, null); + var heightOffset = style.boxSizing === 'content-box' ? -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)) : parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); + + // resize the input to its content size + element.style.height = 'auto'; + element.style.height = element.scrollHeight + heightOffset + 'px'; }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(Input, [{ + key: 'componentDidMount', + value: function componentDidMount() { + window.addEventListener('resize', this.handleAutoresize); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (!this.props.multiline && nextProps.multiline) { + window.addEventListener('resize', this.handleAutoresize); + } else if (this.props.multiline && !nextProps.multiline) { + window.removeEventListener('resize', this.handleAutoresize); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + window.removeEventListener('resize', this.handleAutoresize); + } + }, { key: 'blur', value: function blur() { this.refs.input.blur(); diff --git a/lib/input/index.d.ts b/lib/input/index.d.ts deleted file mode 100644 index 67108330..00000000 --- a/lib/input/index.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} - -export interface InputProps extends Props, Conditional, Changeable, Iconic { - /** - * Give an error string to display under the field. - */ - error?: string, - /** - * Indicates if the label is floating in the input field or not. - * @default true - */ - floating?: boolean, - /** - * The text string to use for the floating label element. - */ - label?: string, - /** - * Specifies the maximum number of characters allowed in the component. - */ - maxLength?: number, - /** - * If true, a textarea element will be rendered. The textarea also grows and shrinks according to the number of lines. - * @default false - */ - multiline?: boolean, - /** - * Callback function that is fired when components is blurred. - */ - onBlur?: Function, - /** - * Callback function that is fired when components is focused. - */ - onFocus?: Function, - /** - * Callback function that is fired when a key is pressed down. - */ - onKeyDown?: Function, - /** - * Callback function that is fired when a key is pressed. - */ - onKeyPress?: Function, - /** - * Callback function that is fired when a key is released. - */ - onKeyUp?: Function, - /** - * If true, the html input has a required value. - * @default false - */ - required?: boolean, - /** - * Type of the input element. It can be a valid HTML5 input type - * @default text - */ - type?: string, - /** - * Current value of the input element. - */ - value?: string, -} -export class Input extends React.Component { - render(): React.DOMElement; -} - -export default Input; \ No newline at end of file diff --git a/lib/layout/index.d.ts b/lib/layout/index.d.ts deleted file mode 100644 index 60d32a09..00000000 --- a/lib/layout/index.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from 'react'; - -export interface LayoutProps { - className?:string -} - -export interface NavDrawerProps { - width?:'normal' | 'wide', - active?:boolean, - pinned?:boolean, - permanentAt?:'sm'|'md'|'lg'|'xl'|'xxl'|'xxxl', - onOverlayClick?:() => void, - scrollY?:boolean, - className?:string -} - -export interface PanelProps { - scrollY?:boolean, - className?:string -} - -export interface SidebarProps { - width?:'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'10'|'11'|'12'|'25'|'33'|'50'|'66'|'75'|'100' - pinned?:boolean, - scrollY?:boolean, - className?:string -} - -export class Layout extends React.Component { - render():React.DOMElement; -} - -export class NavDrawer extends React.Component { - render():React.DOMElement; -} - -export class Panel extends React.Component { - render():React.DOMElement; -} - -export class Sidebar extends React.Component { - render():React.DOMElement; -} \ No newline at end of file diff --git a/lib/link/index.d.ts b/lib/link/index.d.ts deleted file mode 100644 index 565f80e4..00000000 --- a/lib/link/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} - -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} -export interface LinkProps extends Props, Iconic { - href: string, - /** - * The text string used for the text content of the link. - */ - label: string, - /** - * Sets a count number useful to display in the page how many times was visited for example. - */ - count?: number, -} -export class Link extends React.Component { - render(): React.DOMElement; -} - -export default Link; \ No newline at end of file diff --git a/lib/list/index.d.ts b/lib/list/index.d.ts deleted file mode 100644 index 30501554..00000000 --- a/lib/list/index.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} -export interface Clickable { - /** - * Callback called when the button is clicked. - */ - onClick?: Function -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} - -export interface ListProps extends Props { - /** - * If true, each element in the list will have a ripple effect on click - * @default false - */ - ripple?: boolean, - /** - * If true, the elements in the list will display a hover effect and a pointer cursor. - * @default false - */ - selectable?: boolean, -} -export class List extends React.Component { - render(): React.DOMElement; -} -export interface ListItemProps extends Props, Conditional, Clickable { - /** - * A string URL to specify an avatar in the left side of the item. - */ - avatar?: string, - /** - * Main text of the item. Required. - */ - caption?: string, - /** - * An element that will be displayed as the item. If set, this will override `caption` and `legend`. - */ - itemContent?: React.ReactElement, - /** - * A list of elements that are placed on the left side of the item and after the avatar attribute. - */ - leftActions?: React.ReactElement[], - /** - * A string key of a font icon to display an icon in the left side of the item. - */ - leftIcon?: string, - /** - * Secondary text to display under the caption. - */ - legend?: string, - /** - * A list of elements that are placed on the right side of the item and after the rightIcon attribute. - */ - rightActions?: React.ReactElement[], - /** - * The same as the leftIcon but in this case the icon is displayed in the right side. - */ - rightIcon?: string, - /** - * If true, the item displays a ripple effect on click. By default it's inherited from the parent element. - * @default false - */ - ripple?: boolean, - /** - * If true, the elements in the list will display a hover effect and a pointer cursor. Inherited from the parent - * @default false - */ - selectable?: boolean, - /** - * In case you want to provide the item as a link, you can pass this property to specify the href. - */ - to?: string; -} -export class ListItem extends React.Component { - render(): React.DOMElement; -} -export interface ListCheckboxProps extends Props, Conditional, Changeable { - /** - * Main text of the item. Required. - */ - caption?: string, - /** - * If true the checkbox appears checked by default. - * @default false - */ - checked: boolean, - /** - * Secondary text to display under the caption. - */ - legend?: string, - /** - * Name for the checkbox input item. - */ - name?: string, - /** - * Callback called when the input element is blurred. - */ - onBlur?: Function, - /** - * Callback called when the input element is focused. - */ - onFocus?: Function, -} -export class ListCheckbox extends React.Component { - render(): React.DOMElement; -} -export interface ListSubHeaderProps extends Props { - /** - * List header caption. - */ - caption: string; -} -export class ListSubHeader extends React.Component { - render(): React.DOMElement; -} -export interface ListDividerProps extends Props { - /** - * Indicates if the divider should be full width or should leave a space on the left side. - */ - inset: boolean; -} -export class ListDivider extends React.Component { - render(): React.DOMElement; -} \ No newline at end of file diff --git a/lib/menu/index.d.ts b/lib/menu/index.d.ts deleted file mode 100644 index 54289548..00000000 --- a/lib/menu/index.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} - -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} -export interface MenuProps extends Props { - /** - * If true, the menu will be displayed as opened by default. - * @default false - */ - active?: boolean, - /** - * Callback that will be called when the menu is being hidden. - */ - onHide?: Function, - /** - * Callback that will be called when the menu is being shown. - */ - onShow?: Function, - /** - * If true the menu wrapper will show an outline with a soft shadow. - * @default true - */ - outline?: boolean, - /** - * Determine the position of the menu. - * With static value the menu will be always shown, auto means that the it will decide the opening direction based on the current position. - * To force a position use top-left, top-right, bottom-left, bottom-right. - * @default static - */ - position?: string, - /** - * If true, the menu items will show a ripple effect on click. - */ - ripple?: boolean, - /** - * If true, the menu will keep a value to highlight the active child item. - */ - selectable?: boolean, - /** - * Used for selectable menus and indicates the initial value so the child item with this value can be highlighted. - */ - value?: boolean, -} -export class Menu extends React.Component { - render(): React.DOMElement; -} -export interface IconMenuProps extends Props, Iconic { - /** - * If true, the icon will show a ripple when is clicked. - */ - iconRipple?: boolean, - /** - * Transferred to the Menu component. - * @default true - */ - menuRipple?: boolean, - /** - * Callback that will be called when the icon is clicked. - */ - onClick?: Function, - /** - * Callback that will be called when the menu is being hidden. - */ - onHide?: Function, - /** - * Callback that will be called when the menu is being shown. - */ - onShow?: Function, - /** - * Callback that will be called when a menu item is selected. - */ - onSelect?: Function, - /** - * Determine the position of the menu. This property is transferred to the inner Menu component. - * @default auto - */ - position?: string, - /** - * If true, the menu will keep a value to highlight the active child item. Transferred to the Menu - */ - selectable?: boolean, -} -export class IconMenu extends React.Component { - render(): React.DOMElement; -} -export interface MenuItemProps extends Props, Conditional, Iconic { - /** - * The text to include in the menu item. - */ - caption?: string, - /** - * If true, the item will show a ripple effect when it's clicked. Inherited from the parent. - */ - ripple?: boolean, - /** - * Transferred from the Menu component for selectable menus. Indicates if it's the current active option. - */ - selected?: boolean, -} -export class MenuItem extends React.Component { - render(): React.DOMElement; -} -export class MenuDivider extends React.Component { - render(): React.DOMElement; -} \ No newline at end of file diff --git a/lib/navigation/index.d.ts b/lib/navigation/index.d.ts deleted file mode 100644 index 6165fc76..00000000 --- a/lib/navigation/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -import { ButtonProps } from '../button' -import { LinkProps } from '../link' - -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} - -export interface NavigationProps extends Props { - /** - * Array of objects that represent buttons so the keys will be transferred as properties to those. - */ - actions?: Array, - /** - * Array of objects similar to actions but that will be rendered as component definition. - */ - routes?: Array, - /** - * Type of the navigation, it can be 'vertical' or 'horizontal'. - */ - type?: string, -} -export class Navigation extends React.Component { - render(): React.DOMElement; -} - -export default Navigation; \ No newline at end of file diff --git a/lib/overlay/index.d.ts b/lib/overlay/index.d.ts deleted file mode 100644 index b2d35b7f..00000000 --- a/lib/overlay/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface OverlayProps extends Props { - active?: boolean; - children?: any; - /** - * Sets a CSS class on the component. - */ - className?: string; - invisible?: boolean; - onClick?: Function; - onEscKeyDown?: Function -} -export class Overlay extends React.Component { - render(): React.DOMElement; -} - -export default Overlay; \ No newline at end of file diff --git a/lib/progress_bar/index.d.ts b/lib/progress_bar/index.d.ts deleted file mode 100644 index 44f44684..00000000 --- a/lib/progress_bar/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface ProgressBarProps extends Props { - /** - * Value of a secondary progress bar useful for buffering. - */ - buffer?: number, - /** - * Maximum value permitted. - */ - max?: number, // - /** - * minimum value permitted. - */ - min?: number, // - /** - * Mode of the progress bar, it can be determinate or indeterminate. - */ - mode?: string, // - /** - * If true, the circular progress bar will be changing its color. - */ - multicolor?: boolean, // - /** - * Type of the progress bar, it can be circular or linear. - * @default linear - */ - type?: string, - /** - * Value of the current progress. - */ - value?: number, -} -export class ProgressBar extends React.Component { - render(): React.DOMElement; -} - -export default ProgressBar; \ No newline at end of file diff --git a/lib/radio/index.d.ts b/lib/radio/index.d.ts deleted file mode 100644 index e0222005..00000000 --- a/lib/radio/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} - -export interface RadioGroupProps extends Props, Conditional, Changeable { - /** - * Name for the input element group. - */ - name?: string, - /** - * Default value selected in the radio group. - */ - value?: any, -} -export class RadioGroup extends React.Component { - render(): React.DOMElement; -} -export interface RadioButtonProps extends Props, Conditional { - /** - * If true, the input element will be selected by default. Transferred from the parent. - */ - checked?: boolean, - /** - * Label for the radio button. - */ - label?: string; - /** - * Name for the input element. - */ - name?: string, - /** - * Callback function that will be invoked when the input is blurred. - */ - onBlur?: Function, - /** - * Callback function that will be invoked when the value changes. - */ - onChange?: Function, - /** - * Callback function that will be invoked when the input is focused. - */ - onFocus?: Function, - /** - * Value for the radio button. - */ - value: any, -} -export class RadioButton extends React.Component { - render(): React.DOMElement; -} - -export default RadioButton; \ No newline at end of file diff --git a/lib/ripple/index.d.ts b/lib/ripple/index.d.ts deleted file mode 100644 index 78d4d73e..00000000 --- a/lib/ripple/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react'; - -export interface RippleProps { - centered?:boolean, - className?:boolean, - onRippleEnded:() => void, - spread?:number, - theme?:{ - ripple?:string, - rippleActive?:string, - rippleRestarting?:string, - rippleWrapper?:string - } -} - -export class Ripple extends React.Component { - render():React.DOMElement; -} - -export default Ripple; \ No newline at end of file diff --git a/lib/slider/index.d.ts b/lib/slider/index.d.ts deleted file mode 100644 index 89d9f884..00000000 --- a/lib/slider/index.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface SliderProps extends Props { - /** - * If true, an input is shown and the user can set the slider from keyboard value. - */ - editable?: boolean, - /** - * Maximum value permitted. - */ - max?: number, - /** - * Minimum value permitted. - */ - min?: number, - /** - * Callback function that will be invoked when the slider value changes. - */ - onChange?: Function, - /** - * If true, a pin with numeric value label is shown when the slider thumb is pressed. Use for settings for which users need to know the exact value of the setting. - */ - pinned?: boolean, - /** - * If true, the slider thumb snaps to tick marks evenly spaced based on the step property value. - */ - snaps?: boolean, - /** - * Amount to vary the value when the knob is moved or increase/decrease is called. - */ - step?: number, - /** - * Current value of the slider. - */ - value: number, -} -export class Slider extends React.Component { - render(): React.DOMElement; -} - -export default Slider; \ No newline at end of file diff --git a/lib/snackbar/index.d.ts b/lib/snackbar/index.d.ts deleted file mode 100644 index 6df9264f..00000000 --- a/lib/snackbar/index.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Iconic { - /** - * Value of the icon (See icon component). - */ - icon?: string | __React.ReactElement | __React.ReactHTMLElement, -} -export interface Modal { - /** - * If true, the dialog will be active. - */ - active: boolean, - /** - * Callback called when the ESC key is pressed with the overlay active. - */ - onEscKeyDown?: Function, - /** - * Callback to be invoked when the dialog overlay is clicked. - */ - onOverlayClick?: Function, - /** - * Callback called when the mouse button is pressed on the overlay. - */ - onOverlayMouseDown?: Function, - /** - * Callback called when the mouse is moving over the overlay. - */ - onOverlayMouseMove?: Function, - /** - * Callback called when the mouse button is released over the overlay. - */ - onOverlayMouseUp?: Function, -} - -export interface SnackbarProps extends Props, Modal, Iconic { - /** - * For the action component inside the Snackbar. - */ - action?: string, - /** - * Text to display in the content. - */ - label?: string, - /** - * Callback function that will be called when the button action is clicked. - */ - onClick?: Function, - /** - * Callback function when finish the set timeout. - */ - onTimeout?: Function, - /** - * amount of time after the Snackbar will be automatically hidden. - */ - timeout?: number, - /** - * Indicates the action type. Can be 'accept', 'warning' or 'cancel' - */ - type?: string, -} - -export class Snackbar extends React.Component { - render(): React.DOMElement; -} - -export default Snackbar; \ No newline at end of file diff --git a/lib/switch/index.d.ts b/lib/switch/index.d.ts deleted file mode 100644 index 4f57f3ab..00000000 --- a/lib/switch/index.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} -export interface SwitchProps extends Props, Conditional { - /** - * If true, the switch will be enabled. - */ - checked: boolean, - /** - * If true, component will be disabled. - */ - disabled?: boolean, - /** - * The text string to use for the floating label element. - */ - label?: string, - /** - * The text string used as name of the input. - */ - name?: string, - /** - * Callback function that is fired when when the switch is blurred. - */ - onBlur?: Function, - /** - * Callback function that is fired when the components's value changes. - */ - onChange?: Function, - /** - * Callback function fire when the switch is focused. - */ - onFocus?: Function, -} -export class Switch extends React.Component { - render(): React.DOMElement; -} - -export default Switch; \ No newline at end of file diff --git a/lib/table/index.d.ts b/lib/table/index.d.ts deleted file mode 100644 index 6893b2b7..00000000 --- a/lib/table/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface TableProps extends Props { - /** - * If true, component will show a heading using model field names. - */ - heading?: boolean, - /** - * Object describing the data model that represents each object in the source. - */ - model?: { [key: string]: string }, - /** - * Callback function that is fired when an item in a row changes. If set, rows are editable. - */ - onChange?: Function, - /** - * Callback function invoked when the row selection changes. - */ - onSelect?: Function, - /** - * Array of indexes of the items in the source that should appear as selected. - */ - selected?: Array, - /** - * Array of objects representing each item to show. - */ - source?: Array<{ [key: string]: any }>, -} -export class Table extends React.Component { - render(): React.DOMElement; -} - -export default Table; \ No newline at end of file diff --git a/lib/tabs/index.d.ts b/lib/tabs/index.d.ts deleted file mode 100644 index 39234948..00000000 --- a/lib/tabs/index.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -export interface Conditional { - /** - * If true, component will be disabled - * @default false - */ - disabled?: boolean -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} -export interface TabsProps extends Props, Changeable { - /** - * Current - */ - index: number, -} -export class Tabs extends React.Component { - render(): React.DOMElement; -} -export interface TabProps extends Props, Conditional { - /** - * If true, the current component is visible. - * @default false - */ - active?: boolean, - /** - * If true, the current component is not visible. - * @default false - */ - hidden?: boolean, - /** - * Label text for navigation header - */ - label?: string, - /** - * Callback function that is fired when the tab is activated. - */ - onActive?: Function, -} -export class Tab extends React.Component { - render(): React.DOMElement; -} \ No newline at end of file diff --git a/lib/time_picker/index.d.ts b/lib/time_picker/index.d.ts deleted file mode 100644 index 2a7a6291..00000000 --- a/lib/time_picker/index.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as React from 'react'; -export interface Props { - /** - * Sets a CSS class on the component. - */ - className?: string, - id?: string; - /** - * A key used to uniquely identify the element within an Array - */ - key?: string, - /** - * Inline style - */ - style?: any, - /** - * Tooltip text - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltip?: string, - /** - * Amount of time in miliseconds spent before the tooltip is visible. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipDelay?: number, - /** - * If true, the Tooltip hides after a click in the host component. - * APPLIES ONLY IF THE COMPONENT IS WRAPPED WITH Tooltip. - * @default true - * @see http://react-toolbox.com/#/components/tooltip - */ - tooltipHideOnClick?: boolean, -} -/** - * Properties of components that have values that can be changed (T is the type of the value) - */ -export interface Changeable { - /** - * Callback called when the picker value is changed. - * @param v Type of the value - */ - onChange?: (v: T) => void -} -export interface TimePickerProps extends Props, Changeable { - /** - * Format to display the clock. It can be 24hr or ampm. - * @default 24hr - */ - format?: string, - /** - * Datetime object with currrently selected time - */ - value?: Date, -} -export class TimePicker extends React.Component { - render(): React.DOMElement; -} - -export default TimePicker; \ No newline at end of file diff --git a/lib/tooltip/index.d.ts b/lib/tooltip/index.d.ts deleted file mode 100644 index 867412c2..00000000 --- a/lib/tooltip/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from 'react'; -export class TooltipComponent extends React.Component { - getDecoratedComponentInstance(): React.Component; -} - -export interface TooltipComponentClass

extends React.ComponentClass

{ - new (props?: P, context?: any): TooltipComponent; -} - -export default function Tooltip

(componentClass: React.ComponentClass

): TooltipComponentClass

; \ No newline at end of file diff --git a/package.json b/package.json index 056ae5be..1eaa85f1 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "dependencies": { "classnames": "^2.2.5", "core-js": "^2.4.0", - "react-css-themr": "^1.1.0" + "react-css-themr": "^1.1.2" }, "devDependencies": { "autoprefixer": "^6.3.6", @@ -75,11 +75,11 @@ "phantomjs-polyfill": "0.0.2", "phantomjs-prebuilt": "^2.1.7", "postcss-loader": "^0.9.1", - "react": "^15.0.2", - "react-addons-css-transition-group": "^15.0.2", + "react": "^15.2.0", + "react-addons-css-transition-group": "^15.2.0", "react-addons-test-utils": "^15.0.2", "react-docgen": "^2.8.2", - "react-dom": "^15.0.2", + "react-dom": "^15.2.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.2.4", @@ -114,8 +114,8 @@ "peerDependencies": { "classnames": "^2.2.0", "normalize.css": "^4.0.0", - "react": "^0.14 || ^15.0.1", - "react-addons-css-transition-group": "^0.14.0 || ^15.0.1", - "react-dom": "^0.14.0 || ^15.0.1" + "react": "^0.14 || ^15.2.0", + "react-addons-css-transition-group": "^0.14.0 || ^15.2.0", + "react-dom": "^0.14.0 || ^15.2.0" } } diff --git a/spec/components/avatar.js b/spec/components/avatar.js index 4cc1fc14..82eb22ae 100644 --- a/spec/components/avatar.js +++ b/spec/components/avatar.js @@ -9,7 +9,7 @@ const AvatarTest = () => ( }/> - + ); From f43dac68bedad8ff3c67abd7782587c61a6a0689 Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Mon, 4 Jul 2016 22:05:20 +0200 Subject: [PATCH 2/2] Latest build --- lib/autocomplete/Autocomplete.js | 10 ++++++++-- lib/avatar/Avatar.js | 6 +++++- lib/dropdown/Dropdown.js | 5 ++++- lib/list/ListItem.js | 16 ++++++++++++---- lib/ripple/Ripple.js | 4 +++- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/lib/autocomplete/Autocomplete.js b/lib/autocomplete/Autocomplete.js index 12076073..7d06285b 100644 --- a/lib/autocomplete/Autocomplete.js +++ b/lib/autocomplete/Autocomplete.js @@ -393,9 +393,15 @@ var factory = function factory(Chip, Input) { var _props = this.props; var error = _props.error; var label = _props.label; - var theme = _props.theme; + var source = _props.source; + var suggestionMatch = _props.suggestionMatch; + var //eslint-disable-line no-unused-vars + selectedPosition = _props.selectedPosition; + var showSuggestionsWhenValueIsSet = _props.showSuggestionsWhenValueIsSet; + var //eslint-disable-line no-unused-vars + theme = _props.theme; - var other = _objectWithoutProperties(_props, ['error', 'label', 'theme']); + var other = _objectWithoutProperties(_props, ['error', 'label', 'source', 'suggestionMatch', 'selectedPosition', 'showSuggestionsWhenValueIsSet', 'theme']); var className = (0, _classnames5.default)(theme.autocomplete, _defineProperty({}, theme.focus, this.state.focus), this.props.className); diff --git a/lib/avatar/Avatar.js b/lib/avatar/Avatar.js index 6fd7d525..43d28caa 100644 --- a/lib/avatar/Avatar.js +++ b/lib/avatar/Avatar.js @@ -11,6 +11,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + var _reactCssThemr = require('react-css-themr'); var _identifiers = require('../identifiers.js'); @@ -36,7 +40,7 @@ var factory = function factory(FontIcon) { return _react2.default.createElement( 'div', - _extends({ 'data-react-toolbox': 'avatar', className: theme.avatar + ' ' + className }, other), + _extends({ 'data-react-toolbox': 'avatar', className: (0, _classnames2.default)(theme.avatar, className) }, other), children, typeof image === 'string' ? _react2.default.createElement('img', { className: theme.image, src: image, title: title }) : image, typeof icon === 'string' ? _react2.default.createElement(FontIcon, { className: theme.letter, value: icon }) : icon, diff --git a/lib/dropdown/Dropdown.js b/lib/dropdown/Dropdown.js index a2c0fb42..ee3fa619 100644 --- a/lib/dropdown/Dropdown.js +++ b/lib/dropdown/Dropdown.js @@ -190,8 +190,11 @@ var factory = function factory(Input) { var template = _props.template; var theme = _props.theme; var source = _props.source; + var allowBlank = _props.allowBlank; + var auto = _props.auto; + + var others = _objectWithoutProperties(_props, ['template', 'theme', 'source', 'allowBlank', 'auto']); //eslint-disable-line no-unused-vars - var others = _objectWithoutProperties(_props, ['template', 'theme', 'source']); var selected = this.getSelectedItem(); var className = (0, _classnames4.default)(theme.dropdown, (_classnames2 = {}, _defineProperty(_classnames2, theme.up, this.state.up), _defineProperty(_classnames2, theme.active, this.state.active), _defineProperty(_classnames2, theme.disabled, this.props.disabled), _classnames2), this.props.className); diff --git a/lib/list/ListItem.js b/lib/list/ListItem.js index 17445402..363c17a8 100644 --- a/lib/list/ListItem.js +++ b/lib/list/ListItem.js @@ -74,16 +74,24 @@ var factory = function factory(ripple, ListItemLayout, ListItemContent) { if (!_react2.default.isValidElement(child)) { return; } - if (child.props.listItemIgnore) { - children.ignored.push(child); + + var _child$props = child.props; + var listItemIgnore = _child$props.listItemIgnore; + + var rest = _objectWithoutProperties(_child$props, ['listItemIgnore']); + + var strippedChild = _extends({}, child, { props: rest }); + + if (listItemIgnore) { + children.ignored.push(strippedChild); return; } if (child.type === ListItemContent) { - children.itemContent = child; + children.itemContent = strippedChild; return; } var bucket = children.itemContent ? 'rightActions' : 'leftActions'; - children[bucket].push(_extends({}, child, { key: i })); + children[bucket].push(_extends({}, strippedChild, { key: i })); }); return children; diff --git a/lib/ripple/Ripple.js b/lib/ripple/Ripple.js index 4ad0c99d..52fa97bf 100644 --- a/lib/ripple/Ripple.js +++ b/lib/ripple/Ripple.js @@ -166,11 +166,13 @@ var rippleFactory = function rippleFactory() { var _props2 = this.props; var children = _props2.children; var ripple = _props2.ripple; + var //eslint-disable-line no-unused-vars + onRippleEnded = _props2.onRippleEnded; var className = _props2.rippleClassName; var centered = _props2.rippleCentered; var spread = _props2.rippleSpread; - var other = _objectWithoutProperties(_props2, ['children', 'ripple', 'rippleClassName', 'rippleCentered', 'rippleSpread']); + var other = _objectWithoutProperties(_props2, ['children', 'ripple', 'onRippleEnded', 'rippleClassName', 'rippleCentered', 'rippleSpread']); var rippleClassName = (0, _classnames3.default)(this.props.theme.ripple, (_classnames = {}, _defineProperty(_classnames, this.props.theme.rippleActive, this.state.active), _defineProperty(_classnames, this.props.theme.rippleRestarting, this.state.restarting), _classnames), className);