diff --git a/.babelrc b/.babelrc index 8f85e598f6..3162e1a075 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,3 @@ { - "optional": [ - "es7.objectRestSpread" - ] + "stage": 1 } diff --git a/docs/src/GettingStartedPage.js b/docs/src/GettingStartedPage.js index f19af4f741..883dff20e9 100644 --- a/docs/src/GettingStartedPage.js +++ b/docs/src/GettingStartedPage.js @@ -43,7 +43,12 @@ $ npm install react-bootstrap` codeText={ `var Alert = require('react-bootstrap/lib/Alert'); // or -var Alert = require('react-bootstrap').Alert;` +var Alert = require('react-bootstrap').Alert; + +// with ES6 modules +import Alert from 'react-bootstrap/lib/Alert'; +// or +import {Alert} from 'react-bootstrap';` } /> diff --git a/docs/src/ReactPlayground.js b/docs/src/ReactPlayground.js index 0b33a304a3..743bb65979 100644 --- a/docs/src/ReactPlayground.js +++ b/docs/src/ReactPlayground.js @@ -3,10 +3,10 @@ import * as modClassNames from 'classnames'; import * as modAccordion from '../../src/Accordion'; import * as modAlert from '../../src/Alert'; import * as modBadge from '../../src/Badge'; -import * as modmodButton from '../../src/Button'; +import * as modButton from '../../src/Button'; import * as modButtonGroup from '../../src/ButtonGroup'; import * as modButtonInput from '../../src/ButtonInput'; -import * as modmodButtonToolbar from '../../src/ButtonToolbar'; +import * as modButtonToolbar from '../../src/ButtonToolbar'; import * as modCollapsibleNav from '../../src/CollapsibleNav'; import * as modCollapsibleMixin from '../../src/CollapsibleMixin'; import * as modCarousel from '../../src/Carousel'; @@ -56,17 +56,17 @@ const React = modReact.default; const Accordion = modAccordion.default; const Alert = modAlert.default; const Badge = modBadge.default; -const Button = modmodButton.default; +const Button = modButton.default; const ButtonGroup = modButtonGroup.default; const ButtonInput = modButtonInput.default; -const ButtonToolbar = modmodButtonToolbar.default; +const ButtonToolbar = modButtonToolbar.default; const CollapsibleNav = modCollapsibleNav.default; const CollapsibleMixin = modCollapsibleMixin.default; const Carousel = modCarousel.default; const CarouselItem = modCarouselItem.default; const Col = modCol.default; const DropdownButton = modDropdownButton.default; -const FormControls = modFormControls.default; +const FormControls = modFormControls; const Glyphicon = modGlyphicon.default; const Grid = modGrid.default; const Input = modInput.default; diff --git a/src/FormControls/index.js b/src/FormControls/index.js index 5a7c16286e..ef0f49c381 100644 --- a/src/FormControls/index.js +++ b/src/FormControls/index.js @@ -1,5 +1 @@ -import Static from './Static'; - -export default { - Static -}; +export Static from './Static'; diff --git a/src/Input.js b/src/Input.js index f385c5607d..d08eac7b35 100644 --- a/src/Input.js +++ b/src/Input.js @@ -1,6 +1,6 @@ import React from 'react'; import InputBase from './InputBase'; -import FormControls from './FormControls'; +import * as FormControls from './FormControls'; import deprecationWarning from './utils/deprecationWarning'; class Input extends InputBase { diff --git a/src/index.js b/src/index.js index 814c690572..5167ae7474 100644 --- a/src/index.js +++ b/src/index.js @@ -1,115 +1,57 @@ -import Accordion from './Accordion'; -import Affix from './Affix'; -import AffixMixin from './AffixMixin'; -import Alert from './Alert'; -import BootstrapMixin from './BootstrapMixin'; -import Badge from './Badge'; -import Button from './Button'; -import ButtonGroup from './ButtonGroup'; -import ButtonInput from './ButtonInput'; -import ButtonToolbar from './ButtonToolbar'; -import CollapsibleNav from './CollapsibleNav'; -import Carousel from './Carousel'; -import CarouselItem from './CarouselItem'; -import Col from './Col'; -import CollapsibleMixin from './CollapsibleMixin'; -import DropdownButton from './DropdownButton'; -import DropdownMenu from './DropdownMenu'; -import DropdownStateMixin from './DropdownStateMixin'; -import FadeMixin from './FadeMixin'; -import FormControls from './FormControls'; -import Glyphicon from './Glyphicon'; -import Grid from './Grid'; -import Input from './Input'; -import Interpolate from './Interpolate'; -import Jumbotron from './Jumbotron'; -import Label from './Label'; -import ListGroup from './ListGroup'; -import ListGroupItem from './ListGroupItem'; -import MenuItem from './MenuItem'; -import Modal from './Modal'; -import Nav from './Nav'; -import Navbar from './Navbar'; -import NavItem from './NavItem'; -import ModalTrigger from './ModalTrigger'; -import OverlayTrigger from './OverlayTrigger'; -import OverlayMixin from './OverlayMixin'; -import PageHeader from './PageHeader'; -import Pagination from './Pagination'; -import Panel from './Panel'; -import PanelGroup from './PanelGroup'; -import PageItem from './PageItem'; -import Pager from './Pager'; -import Popover from './Popover'; -import ProgressBar from './ProgressBar'; -import Row from './Row'; -import SafeAnchor from './SafeAnchor'; -import SplitButton from './SplitButton'; -import SubNav from './SubNav'; -import TabbedArea from './TabbedArea'; -import Table from './Table'; -import TabPane from './TabPane'; -import Thumbnail from './Thumbnail'; -import Tooltip from './Tooltip'; -import utils from './utils'; -import Well from './Well'; -import styleMaps from './styleMaps'; +export Accordion from './Accordion'; +export Affix from './Affix'; +export AffixMixin from './AffixMixin'; +export Alert from './Alert'; +export Badge from './Badge'; +export BootstrapMixin from './BootstrapMixin'; +export Button from './Button'; +export ButtonGroup from './ButtonGroup'; +export ButtonInput from './ButtonInput'; +export ButtonToolbar from './ButtonToolbar'; +export Carousel from './Carousel'; +export CarouselItem from './CarouselItem'; +export Col from './Col'; +export CollapsibleMixin from './CollapsibleMixin'; +export CollapsibleNav from './CollapsibleNav'; +export DropdownButton from './DropdownButton'; +export DropdownMenu from './DropdownMenu'; +export DropdownStateMixin from './DropdownStateMixin'; +export FadeMixin from './FadeMixin'; +export Glyphicon from './Glyphicon'; +export Grid from './Grid'; +export Input from './Input'; +export Interpolate from './Interpolate'; +export Jumbotron from './Jumbotron'; +export Label from './Label'; +export ListGroup from './ListGroup'; +export ListGroupItem from './ListGroupItem'; +export MenuItem from './MenuItem'; +export Modal from './Modal'; +export ModalTrigger from './ModalTrigger'; +export Nav from './Nav'; +export Navbar from './Navbar'; +export NavItem from './NavItem'; +export OverlayMixin from './OverlayMixin'; +export OverlayTrigger from './OverlayTrigger'; +export PageHeader from './PageHeader'; +export PageItem from './PageItem'; +export Pager from './Pager'; +export Pagination from './Pagination'; +export Panel from './Panel'; +export PanelGroup from './PanelGroup'; +export Popover from './Popover'; +export ProgressBar from './ProgressBar'; +export Row from './Row'; +export SafeAnchor from './SafeAnchor'; +export SplitButton from './SplitButton'; +export styleMaps from './styleMaps'; +export SubNav from './SubNav'; +export TabbedArea from './TabbedArea'; +export Table from './Table'; +export TabPane from './TabPane'; +export Thumbnail from './Thumbnail'; +export Tooltip from './Tooltip'; +export Well from './Well'; -export default { - Accordion, - Affix, - AffixMixin, - Alert, - BootstrapMixin, - Badge, - Button, - ButtonGroup, - ButtonInput, - ButtonToolbar, - CollapsibleNav, - Carousel, - CarouselItem, - Col, - CollapsibleMixin, - DropdownButton, - DropdownMenu, - DropdownStateMixin, - FadeMixin, - FormControls, - Glyphicon, - Grid, - Input, - Interpolate, - Jumbotron, - Label, - ListGroup, - ListGroupItem, - MenuItem, - Modal, - Nav, - Navbar, - NavItem, - ModalTrigger, - OverlayTrigger, - OverlayMixin, - PageHeader, - Panel, - PanelGroup, - PageItem, - Pager, - Pagination, - Popover, - ProgressBar, - Row, - SafeAnchor, - SplitButton, - SubNav, - TabbedArea, - Table, - TabPane, - Thumbnail, - Tooltip, - utils, - Well, - styleMaps -}; +export * as FormControls from './FormControls'; +export * as utils from './utils'; diff --git a/src/utils/index.js b/src/utils/index.js index aad9066a10..f024432a7b 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,13 +1,5 @@ -import childrenValueInputValidation from './childrenValueInputValidation'; -import createChainedFunction from './createChainedFunction'; -import CustomPropTypes from './CustomPropTypes'; -import domUtils from './domUtils'; -import ValidComponentChildren from './ValidComponentChildren'; - -export default { - childrenValueInputValidation, - createChainedFunction, - CustomPropTypes, - domUtils, - ValidComponentChildren -}; +export childrenValueInputValidation from './childrenValueInputValidation'; +export createChainedFunction from './createChainedFunction'; +export CustomPropTypes from './CustomPropTypes'; +export domUtils from './domUtils'; +export ValidComponentChildren from './ValidComponentChildren'; diff --git a/test/FormControlsSpec.js b/test/FormControlsSpec.js index cc56ecd618..31c9941d30 100644 --- a/test/FormControlsSpec.js +++ b/test/FormControlsSpec.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; -import FormControls from '../src/FormControls'; +import * as FormControls from '../src/FormControls'; describe('Form Controls', function () { describe('Static', function () { diff --git a/tools/public-components.js b/tools/public-components.js index a030df7253..67fc67f0c7 100644 --- a/tools/public-components.js +++ b/tools/public-components.js @@ -1,5 +1,5 @@ import React from 'react'; -import index from '../src/index'; +import * as index from '../src/index'; let components = []; Object.keys(index).forEach(function (item) {