From 98ee978b2b0ed6872ca1f6c1c433a1320c3d93f8 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Fri, 6 Mar 2015 16:08:52 -0700 Subject: [PATCH] [changed] Source to ES6 using Babel and Webpack A lot has happened since this projects inception and newer tools are available that can facilitate a better development environment. This work gives the project structure a facelift to meet the current trends of the broader React community. - Source cleanup - Rename all js files to *.js - Use [Babel](http://babeljs.io/) for our es6 -> es5 transpilation - Update all js to es6 standards - src - test - docs - doc examples - ie8 visual test - [ESLint](http://eslint.org/) all .js files - Build - Use [Webpack](http://webpack.github.io/) - This should provide more control on how we build our pre-concatenated and minified releases. - Drop Grunt, use npm scripts and shell scripts where needed. - Promise based release process (faster) - Update README to explain how to run. - Test - Single karma config file - Not dependent on building src to disk to run, use [karma-webpack](https://github.com/webpack/karma-webpack) which will build the src in memory. - Better test watcher that re-runs tests when changing src files. Current watcher only runs if test files change. - Fail on linting errors - Pull `es5-shim` from npm - Docs - Pull `bootstrap` from npm - Pull `codemirror` from npm - Use in browser Babel transformer for doc examples - Consolidate package.json deps and scripts to repo root. Leads to less confusion on how to run the docs locally. - Update README for local setup. --- .editorconfig | 18 + .eslintrc | 32 + .gitignore | 18 +- .jshintrc | 15 - .npmignore | 8 +- .travis.yml | 2 + CONTRIBUTING.md | 17 + Gruntfile.js | 217 - README.md | 19 +- docs/.gitignore-template | 11 - docs/README.docs.md | 10 + docs/README.md | 58 +- docs/build.js | 50 +- docs/client.js | 20 +- docs/examples/.eslintrc | 52 + docs/examples/AlertAutoDismissable.js | 18 +- docs/examples/AlertBasic.js | 12 +- docs/examples/AlertDismissable.js | 21 +- docs/examples/Badge.js | 4 +- docs/examples/ButtonActive.js | 14 +- docs/examples/ButtonBlock.js | 16 +- docs/examples/ButtonDisabled.js | 14 +- docs/examples/ButtonGroupBasic.js | 16 +- docs/examples/ButtonGroupJustified.js | 22 +- docs/examples/ButtonGroupNested.js | 22 +- docs/examples/ButtonGroupSizes.js | 66 +- docs/examples/ButtonGroupVertical.js | 42 +- docs/examples/ButtonLoading.js | 28 +- docs/examples/ButtonSizes.js | 42 +- docs/examples/ButtonTagTypes.js | 6 +- docs/examples/ButtonToolbarBasic.js | 38 +- docs/examples/ButtonTypes.js | 38 +- docs/examples/CarouselControlled.js | 81 +- docs/examples/CarouselUncontrolled.js | 52 +- docs/examples/CollapsableNav.js | 42 +- docs/examples/CollapsableParagraph.js | 10 +- docs/examples/DropdownButtonBasic.js | 24 +- docs/examples/DropdownButtonNoCaret.js | 24 +- docs/examples/DropdownButtonSizes.js | 64 +- docs/examples/Glyphicon.js | 20 +- docs/examples/GridBasic.js | 42 +- docs/examples/Input.js | 44 +- docs/examples/InputAddons.js | 30 +- docs/examples/InputHorizontal.js | 14 +- docs/examples/InputTypes.js | 42 +- docs/examples/InputValidation.js | 14 +- docs/examples/InputWrapper.js | 24 +- docs/examples/Jumbotron.js | 8 +- docs/examples/Label.js | 4 +- docs/examples/LabelVariations.js | 18 +- docs/examples/ListGroupActive.js | 14 +- docs/examples/ListGroupDefault.js | 14 +- docs/examples/ListGroupHeader.js | 14 +- docs/examples/ListGroupLinked.js | 14 +- docs/examples/ListGroupStyle.js | 16 +- docs/examples/ModalContained.js | 17 +- docs/examples/ModalOverlayMixin.js | 32 +- docs/examples/ModalStatic.js | 38 +- docs/examples/ModalTrigger.js | 66 +- docs/examples/NavBasic.js | 14 +- docs/examples/NavDropdown.js | 40 +- docs/examples/NavJustified.js | 42 +- docs/examples/NavStacked.js | 14 +- docs/examples/NavbarBasic.js | 30 +- docs/examples/NavbarCollapsable.js | 30 +- docs/examples/PageHeader.js | 4 +- docs/examples/PagerAligned.js | 14 +- docs/examples/PagerDefault.js | 14 +- docs/examples/PagerDisabled.js | 14 +- docs/examples/PanelBasic.js | 12 +- docs/examples/PanelContextual.js | 52 +- docs/examples/PanelGroupAccordion.js | 10 +- docs/examples/PanelGroupControlled.js | 32 +- docs/examples/PanelGroupUncontrolled.js | 8 +- docs/examples/PanelListGroupFill.js | 22 +- docs/examples/PanelWithFooter.js | 12 +- docs/examples/PanelWithHeading.js | 28 +- docs/examples/PopoverBasic.js | 18 +- docs/examples/PopoverPositioned.js | 34 +- docs/examples/PopoverPositionedContained.js | 34 +- docs/examples/ProgressBarAnimated.js | 8 +- docs/examples/ProgressBarBasic.js | 8 +- docs/examples/ProgressBarContextual.js | 18 +- docs/examples/ProgressBarScreenreaderLabel.js | 8 +- docs/examples/ProgressBarStacked.js | 16 +- docs/examples/ProgressBarStriped.js | 18 +- docs/examples/ProgressBarWithLabel.js | 8 +- docs/examples/SplitButtonBasic.js | 24 +- docs/examples/SplitButtonDropup.js | 46 +- docs/examples/SplitButtonRight.js | 20 +- docs/examples/TabbedAreaControlled.js | 36 +- docs/examples/TabbedAreaNoAnimation.js | 14 +- docs/examples/TabbedAreaUncontrolled.js | 14 +- docs/examples/TableBasic.js | 64 +- docs/examples/TableResponsive.js | 90 +- docs/examples/TooltipBasic.js | 18 +- docs/examples/TooltipInCopy.js | 27 +- docs/examples/TooltipPositioned.js | 34 +- docs/examples/Well.js | 4 +- docs/examples/WellSizes.js | 8 +- docs/package.json | 33 - docs/server.js | 60 +- docs/src/CodeMirror.client.js | 12 + docs/src/CodeMirror.css | 15 + docs/src/CodeMirror.js | 4 + docs/src/ComponentsPage.js | 546 +- docs/src/GettingStartedPage.js | 100 +- docs/src/HomePage.js | 13 +- docs/src/NavMain.js | 36 +- docs/src/NotFoundPage.js | 22 +- docs/src/PageFooter.js | 34 +- docs/src/PageHeader.js | 16 +- docs/src/ReactPlayground.js | 191 +- docs/src/Root.js | 74 +- docs/src/Routes.js | 31 +- docs/src/Samples.js | 89 + docs/vendor/JSXTransformer.js | 13858 ---------------- docs/vendor/bootstrap/bootstrap.css | 5 - docs/vendor/bootstrap/docs.css | 6 - docs/vendor/codemirror/codemirror.css | 239 - docs/vendor/codemirror/codemirror.js | 6047 ------- docs/vendor/codemirror/javascript.js | 425 - docs/vendor/codemirror/solarized.css | 173 - docs/vendor/codemirror/syntax.css | 409 - .../fonts/glyphicons-halflings-regular.eot | Bin 14079 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 228 - .../fonts/glyphicons-halflings-regular.ttf | Bin 29512 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 16448 -> 0 bytes ie8/README.md | 11 +- ie8/index.html | 2 +- ie8/server.js | 41 + ie8/src.js | 145 +- karma.ci.js | 33 - karma.conf.js | 53 + karma.dev.js | 32 - package.json | 70 +- register-babel.js | 4 + run-babel | 9 + src/Accordion.js | 14 + src/Accordion.jsx | 14 - src/Affix.js | 26 + src/Affix.jsx | 23 - src/AffixMixin.js | 30 +- src/{Alert.jsx => Alert.js} | 26 +- src/{Badge.jsx => Badge.js} | 18 +- src/BootstrapMixin.js | 22 +- src/{Button.jsx => Button.js} | 48 +- src/{ButtonGroup.jsx => ButtonGroup.js} | 18 +- src/ButtonToolbar.js | 28 + src/ButtonToolbar.jsx | 30 - src/{Carousel.jsx => Carousel.js} | 86 +- src/{CarouselItem.jsx => CarouselItem.js} | 29 +- src/{Col.jsx => Col.js} | 26 +- src/CollapsableMixin.js | 82 +- src/{CollapsableNav.jsx => CollapsableNav.js} | 51 +- src/{DropdownButton.jsx => DropdownButton.js} | 53 +- src/{DropdownMenu.jsx => DropdownMenu.js} | 22 +- src/DropdownStateMixin.js | 22 +- src/FadeMixin.js | 25 +- src/{Glyphicon.jsx => Glyphicon.js} | 19 +- src/{Grid.jsx => Grid.js} | 16 +- src/{Input.jsx => Input.js} | 79 +- src/Interpolate.js | 34 +- src/{Jumbotron.jsx => Jumbotron.js} | 11 +- src/Label.js | 26 + src/Label.jsx | 27 - src/ListGroup.js | 25 + src/ListGroup.jsx | 28 - src/{ListGroupItem.jsx => ListGroupItem.js} | 35 +- src/{MenuItem.jsx => MenuItem.js} | 21 +- src/{Modal.jsx => Modal.js} | 66 +- src/{ModalTrigger.jsx => ModalTrigger.js} | 25 +- src/{Nav.jsx => Nav.js} | 42 +- src/{NavItem.jsx => NavItem.js} | 27 +- src/{Navbar.jsx => Navbar.js} | 64 +- src/OverlayMixin.js | 24 +- src/{OverlayTrigger.jsx => OverlayTrigger.js} | 72 +- src/{PageHeader.jsx => PageHeader.js} | 11 +- src/{PageItem.jsx => PageItem.js} | 17 +- src/{Pager.jsx => Pager.js} | 17 +- src/{Panel.jsx => Panel.js} | 54 +- src/{PanelGroup.jsx => PanelGroup.js} | 36 +- src/Popover.js | 59 + src/Popover.jsx | 58 - src/{ProgressBar.jsx => ProgressBar.js} | 45 +- src/{Row.jsx => Row.js} | 14 +- src/{SplitButton.jsx => SplitButton.js} | 35 +- src/{SubNav.jsx => SubNav.js} | 40 +- src/{TabPane.jsx => TabPane.js} | 26 +- src/{TabbedArea.jsx => TabbedArea.js} | 47 +- src/{Table.jsx => Table.js} | 14 +- src/Tooltip.js | 50 + src/Tooltip.jsx | 48 - src/Well.js | 25 + src/Well.jsx | 25 - src/constants.js | 2 +- src/main.js | 99 + src/utils/CustomPropTypes.js | 10 +- src/utils/EventListener.js | 4 +- src/utils/Object.assign.js | 16 +- src/utils/TransitionEvents.js | 20 +- src/utils/ValidComponentChildren.js | 16 +- src/utils/createChainedFunction.js | 6 +- src/utils/domUtils.js | 21 +- test/.eslintrc | 14 + test/{AlertSpec.jsx => AlertSpec.js} | 26 +- test/{BadgeSpec.jsx => BadgeSpec.js} | 20 +- ...rapMixinSpec.jsx => BootstrapMixinSpec.js} | 50 +- ...ButtonGroupSpec.jsx => ButtonGroupSpec.js} | 18 +- test/{ButtonSpec.jsx => ButtonSpec.js} | 56 +- ...onToolbarSpec.jsx => ButtonToolbarSpec.js} | 14 +- test/{CarouselSpec.jsx => CarouselSpec.js} | 16 +- test/{ColSpec.jsx => ColSpec.js} | 20 +- ...eMixinSpec.jsx => CollapsableMixinSpec.js} | 66 +- test/CollapsableNavSpec.jsx | 76 +- ...opTypesSpec.jsx => CustomPropTypesSpec.js} | 8 +- ...wnButtonSpec.jsx => DropdownButtonSpec.js} | 46 +- ...opdownMenuSpec.jsx => DropdownMenuSpec.js} | 48 +- test/{FadeMixinSpec.jsx => FadeMixinSpec.js} | 33 +- test/{GlyphiconSpec.jsx => GlyphiconSpec.js} | 10 +- test/{InputSpec.jsx => InputSpec.js} | 94 +- test/{JumbotronSpec.jsx => JumbotronSpec.js} | 13 +- test/{LabelSpec.jsx => LabelSpec.js} | 14 +- ...GroupItemSpec.jsx => ListGroupItemSpec.js} | 50 +- test/{ListGroupSpec.jsx => ListGroupSpec.js} | 18 +- test/{MenuItemSpec.jsx => MenuItemSpec.js} | 39 +- test/{ModalSpec.jsx => ModalSpec.js} | 50 +- test/{NavItemSpec.jsx => NavItemSpec.js} | 36 +- test/{NavSpec.jsx => NavSpec.js} | 42 +- test/{NavbarSpec.jsx => NavbarSpec.js} | 69 +- ...erlayMixinSpec.jsx => OverlayMixinSpec.js} | 18 +- .../{PageHeaderSpec.jsx => PageHeaderSpec.js} | 12 +- test/{PageItemSpec.jsx => PageItemSpec.js} | 32 +- test/{PagerSpec.jsx => PagerSpec.js} | 22 +- .../{PanelGroupSpec.jsx => PanelGroupSpec.js} | 22 +- test/{PanelSpec.jsx => PanelSpec.js} | 76 +- ...ProgressBarSpec.jsx => ProgressBarSpec.js} | 82 +- ...SplitButtonSpec.jsx => SplitButtonSpec.js} | 48 +- test/{TabPaneSpec.jsx => TabPaneSpec.js} | 12 +- .../{TabbedAreaSpec.jsx => TabbedAreaSpec.js} | 64 +- test/{TableSpec.jsx => TableSpec.js} | 20 +- test/{WellSpec.jsx => WellSpec.js} | 21 +- test/index.js | 3 + test/vendor/es5-shim.js | 1377 -- tools/amd/.gitignore-template | 0 tools/amd/LICENSE | 21 - tools/amd/README.md | 5 +- tools/amd/bower.json | 2 +- tools/amd/build.js | 40 + tools/amd/index.js | 57 - tools/build.js | 42 + tools/cjs/LICENSE | 21 - tools/cjs/README.md | 12 - tools/cjs/main.js | 51 - tools/cjs/package.json | 28 - tools/dist/build.js | 17 + tools/lib/build.js | 16 + tools/release | 4 + tools/release-scripts/changelog.js | 9 + tools/release-scripts/pre-conditions.js | 26 + tools/release-scripts/release.js | 87 + tools/release-scripts/repo-release.js | 28 + tools/release-scripts/tag-and-publish.js | 11 + tools/release-scripts/test.js | 23 + tools/release-scripts/version-bump.js | 41 + tools/release/exec-series.js | 22 - tools/release/spawn-command.js | 18 - tools/release/tasks.js | 235 - tools/vendor/almond.js | 330 - tools/wrap.end | 11 - tools/wrap.start | 10 - webpack.config.js | 5 + webpack.docs.js | 4 + webpack/docs.config.js | 2 + webpack/strategies/development.js | 13 + webpack/strategies/docs.js | 55 + webpack/strategies/ie8.js | 26 + webpack/strategies/index.js | 13 + webpack/strategies/optimize.js | 15 + webpack/strategies/test.js | 18 + webpack/test.config.js | 3 + webpack/webpack.config.js | 63 + 282 files changed, 4527 insertions(+), 27536 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintrc delete mode 100644 .jshintrc delete mode 100644 Gruntfile.js delete mode 100644 docs/.gitignore-template create mode 100644 docs/README.docs.md mode change 100755 => 100644 docs/build.js create mode 100644 docs/examples/.eslintrc delete mode 100644 docs/package.json create mode 100644 docs/src/CodeMirror.client.js create mode 100644 docs/src/CodeMirror.css create mode 100644 docs/src/CodeMirror.js create mode 100644 docs/src/Samples.js delete mode 100644 docs/vendor/JSXTransformer.js delete mode 100644 docs/vendor/bootstrap/bootstrap.css delete mode 100644 docs/vendor/bootstrap/docs.css delete mode 100644 docs/vendor/codemirror/codemirror.css delete mode 100644 docs/vendor/codemirror/codemirror.js delete mode 100644 docs/vendor/codemirror/javascript.js delete mode 100644 docs/vendor/codemirror/solarized.css delete mode 100644 docs/vendor/codemirror/syntax.css delete mode 100644 docs/vendor/fonts/glyphicons-halflings-regular.eot delete mode 100644 docs/vendor/fonts/glyphicons-halflings-regular.svg delete mode 100644 docs/vendor/fonts/glyphicons-halflings-regular.ttf delete mode 100644 docs/vendor/fonts/glyphicons-halflings-regular.woff create mode 100644 ie8/server.js delete mode 100644 karma.ci.js create mode 100644 karma.conf.js delete mode 100644 karma.dev.js create mode 100644 register-babel.js create mode 100755 run-babel create mode 100644 src/Accordion.js delete mode 100644 src/Accordion.jsx create mode 100644 src/Affix.js delete mode 100644 src/Affix.jsx rename src/{Alert.jsx => Alert.js} (66%) rename src/{Badge.jsx => Badge.js} (58%) rename src/{Button.jsx => Button.js} (57%) rename src/{ButtonGroup.jsx => ButtonGroup.js} (61%) create mode 100644 src/ButtonToolbar.js delete mode 100644 src/ButtonToolbar.jsx rename src/{Carousel.jsx => Carousel.js} (76%) rename src/{CarouselItem.jsx => CarouselItem.js} (77%) rename src/{Col.jsx => Col.js} (80%) rename src/{CollapsableNav.jsx => CollapsableNav.js} (63%) rename src/{DropdownButton.jsx => DropdownButton.js} (68%) rename src/{DropdownMenu.jsx => DropdownMenu.js} (59%) rename src/{Glyphicon.jsx => Glyphicon.js} (54%) rename src/{Grid.jsx => Grid.js} (55%) rename src/{Input.jsx => Input.js} (80%) rename src/{Jumbotron.jsx => Jumbotron.js} (50%) create mode 100644 src/Label.js delete mode 100644 src/Label.jsx create mode 100644 src/ListGroup.js delete mode 100644 src/ListGroup.jsx rename src/{ListGroupItem.jsx => ListGroupItem.js} (67%) rename src/{MenuItem.jsx => MenuItem.js} (79%) rename src/{Modal.jsx => Modal.js} (74%) rename src/{ModalTrigger.jsx => ModalTrigger.js} (59%) rename src/{Nav.jsx => Nav.js} (69%) rename src/{NavItem.jsx => NavItem.js} (74%) rename src/{Navbar.jsx => Navbar.js} (73%) rename src/{OverlayTrigger.jsx => OverlayTrigger.js} (76%) rename src/{PageHeader.jsx => PageHeader.js} (51%) rename src/{PageItem.jsx => PageItem.js} (80%) rename src/{Pager.jsx => Pager.js} (55%) rename src/{Panel.jsx => Panel.js} (79%) rename src/{PanelGroup.jsx => PanelGroup.js} (68%) create mode 100644 src/Popover.js delete mode 100644 src/Popover.jsx rename src/{ProgressBar.jsx => ProgressBar.js} (72%) rename src/{Row.jsx => Row.js} (56%) rename src/{SplitButton.jsx => SplitButton.js} (76%) rename src/{SubNav.jsx => SubNav.js} (73%) rename src/{TabPane.jsx => TabPane.js} (74%) rename src/{TabbedArea.jsx => TabbedArea.js} (76%) rename src/{Table.jsx => Table.js} (78%) create mode 100644 src/Tooltip.js delete mode 100644 src/Tooltip.jsx create mode 100644 src/Well.js delete mode 100644 src/Well.jsx create mode 100644 src/main.js create mode 100644 test/.eslintrc rename test/{AlertSpec.jsx => AlertSpec.js} (71%) rename test/{BadgeSpec.jsx => BadgeSpec.js} (66%) rename test/{BootstrapMixinSpec.jsx => BootstrapMixinSpec.js} (78%) rename test/{ButtonGroupSpec.jsx => ButtonGroupSpec.js} (70%) rename test/{ButtonSpec.jsx => ButtonSpec.js} (74%) rename test/{ButtonToolbarSpec.jsx => ButtonToolbarSpec.js} (57%) rename test/{CarouselSpec.jsx => CarouselSpec.js} (83%) rename test/{ColSpec.jsx => ColSpec.js} (68%) rename test/{CollapsableMixinSpec.jsx => CollapsableMixinSpec.js} (75%) rename test/{CustomPropTypesSpec.jsx => CustomPropTypesSpec.js} (81%) rename test/{DropdownButtonSpec.jsx => DropdownButtonSpec.js} (84%) rename test/{DropdownMenuSpec.jsx => DropdownMenuSpec.js} (70%) rename test/{FadeMixinSpec.jsx => FadeMixinSpec.js} (65%) rename test/{GlyphiconSpec.jsx => GlyphiconSpec.js} (52%) rename test/{InputSpec.jsx => InputSpec.js} (76%) rename test/{JumbotronSpec.jsx => JumbotronSpec.js} (59%) rename test/{LabelSpec.jsx => LabelSpec.js} (63%) rename test/{ListGroupItemSpec.jsx => ListGroupItemSpec.js} (54%) rename test/{ListGroupSpec.jsx => ListGroupSpec.js} (57%) rename test/{MenuItemSpec.jsx => MenuItemSpec.js} (72%) rename test/{ModalSpec.jsx => ModalSpec.js} (62%) rename test/{NavItemSpec.jsx => NavItemSpec.js} (74%) rename test/{NavSpec.jsx => NavSpec.js} (75%) rename test/{NavbarSpec.jsx => NavbarSpec.js} (65%) rename test/{OverlayMixinSpec.jsx => OverlayMixinSpec.js} (78%) rename test/{PageHeaderSpec.jsx => PageHeaderSpec.js} (59%) rename test/{PageItemSpec.jsx => PageItemSpec.js} (75%) rename test/{PagerSpec.jsx => PagerSpec.js} (74%) rename test/{PanelGroupSpec.jsx => PanelGroupSpec.js} (62%) rename test/{PanelSpec.jsx => PanelSpec.js} (73%) rename test/{ProgressBarSpec.jsx => ProgressBarSpec.js} (70%) rename test/{SplitButtonSpec.jsx => SplitButtonSpec.js} (84%) rename test/{TabPaneSpec.jsx => TabPaneSpec.js} (59%) rename test/{TabbedAreaSpec.jsx => TabbedAreaSpec.js} (72%) rename test/{TableSpec.jsx => TableSpec.js} (69%) rename test/{WellSpec.jsx => WellSpec.js} (53%) create mode 100644 test/index.js delete mode 100755 test/vendor/es5-shim.js delete mode 100644 tools/amd/.gitignore-template delete mode 100644 tools/amd/LICENSE create mode 100644 tools/amd/build.js delete mode 100644 tools/amd/index.js create mode 100644 tools/build.js delete mode 100644 tools/cjs/LICENSE delete mode 100644 tools/cjs/README.md delete mode 100644 tools/cjs/main.js delete mode 100644 tools/cjs/package.json create mode 100644 tools/dist/build.js create mode 100644 tools/lib/build.js create mode 100755 tools/release create mode 100644 tools/release-scripts/changelog.js create mode 100644 tools/release-scripts/pre-conditions.js create mode 100644 tools/release-scripts/release.js create mode 100644 tools/release-scripts/repo-release.js create mode 100644 tools/release-scripts/tag-and-publish.js create mode 100644 tools/release-scripts/test.js create mode 100644 tools/release-scripts/version-bump.js delete mode 100644 tools/release/exec-series.js delete mode 100644 tools/release/spawn-command.js delete mode 100644 tools/release/tasks.js delete mode 100644 tools/vendor/almond.js delete mode 100644 tools/wrap.end delete mode 100644 tools/wrap.start create mode 100644 webpack.config.js create mode 100644 webpack.docs.js create mode 100644 webpack/docs.config.js create mode 100644 webpack/strategies/development.js create mode 100644 webpack/strategies/docs.js create mode 100644 webpack/strategies/ie8.js create mode 100644 webpack/strategies/index.js create mode 100644 webpack/strategies/optimize.js create mode 100644 webpack/strategies/test.js create mode 100644 webpack/test.config.js create mode 100644 webpack/webpack.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..9df53e05d9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +[*.js] +charset = utf-8 +indent_style = space +indent_size = 2 + +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000000..98191b02e3 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,32 @@ +{ + "env": { + "browser": true, + "node": true + }, + "ecmaFeatures": { + "jsx": true + }, + "parser": "babel-eslint", + "plugins": [ + "react" + ], + "rules": { + "comma-spacing": 1, + "key-spacing": 0, + "no-underscore-dangle": 0, + "no-unused-vars": [1, { "vars": "all", "args": "none" }], + "no-undef": 1, + "no-var": 2, + "quotes": [1, "single", "avoid-escape"], + "react/display-name": 0, + "react/jsx-uses-react": 1, + "react/no-did-mount-set-state": 1, + "react/no-did-update-set-state": 1, + "react/no-multi-comp": 1, + "react/prop-types": 1, + "react/react-in-jsx-scope": 1, + "react/self-closing-comp": 1, + "react/wrap-multilines": 1, + "strict": 0 + } +} diff --git a/.gitignore b/.gitignore index 2844552a01..def3fca632 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,14 @@ *~ -node_modules .DS_Store npm-debug.log -test_bundle.js -test-built/* -.idea -transpiled/* -docs/*.html -docs/assets/bundle.js -cjs/* -amd/* +node_modules +amd/ +!tools/amd/ +lib/ +!tools/lib/ +dist/ +!tools/dist/ +docs-built/ ie8/bundle.js -lib/* tmp-bower-repo/ tmp-docs-repo/ diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index c2c20e2903..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": false, - "noarg": true, - "sub": true, - "undef": true, - "unused": true, - "boss": true, - "eqnull": true, - "node": true, - "esnext": true -} diff --git a/.npmignore b/.npmignore index 67c137bab6..2044f1129f 100644 --- a/.npmignore +++ b/.npmignore @@ -1,11 +1,11 @@ node_modules/ docs/ +docs-built/ test-built/ test/ tools/ .gitignore .travis.yml -Gruntfile.js -karma.ci.js -karma.dev.js -test_bundle.js +karma.conf.js +tmp-docs-repo/ +tmp-bower-repo/ diff --git a/.travis.yml b/.travis.yml index 777b8a6b35..9ccb608f70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,3 +2,5 @@ sudo: false language: node_js node_js: - "0.10" + - "0.12" + - "iojs" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c08022dbdf..de1309cb80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,10 +3,27 @@ We welcome community support with both pull requests and reporting bugs. Please don't hesitate to jump in. +## Current Issues + +Feel free to tackle any currently open +[issue](https://github.com/react-bootstrap/react-bootstrap/issues). The issues +tagged with "help wanted" are especially open. + ## Tests All commits that fix bugs or add features need a test. +## Code Style + +Please adhere to the current code styling. We have included an `.editorconfig` +at the repo's root to facilitate uniformity regardless of your editor. See the +[editor config site](http://editorconfig.org/) for integration details. + +We use [ESLint](http://eslint.org/) for all JavaScript Linting. There should be +no linting errors and no new warnings for new work. You are welcome to configure +your editor to use ESLint or the `npm test` command will run unit tests and the +linter. + ## Commit Subjects for Public API Changes If your patch **changes the API or fixes a bug** please use one of the following diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index bcce4c838f..0000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,217 +0,0 @@ -module.exports = function (grunt) { - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - amdwrap: { - src: { - expand: true, - cwd: 'src/', - src: ['**/*.js'], - dest: 'amd/lib' - }, - transpiled: { - expand: true, - cwd: 'transpiled/', - src: ['**/*.js'], - dest: 'amd/lib' - } - }, - - copy: { - amd: { - files: [ - { - src: ['**/*'], - dest: 'amd/', - cwd: 'tools/amd', - expand: true - }, - { - src: ['.gitignore-template'], - dest: 'amd/', - cwd: 'tools/amd', - expand: true - } - ] - }, - cjs: { - files: [ - { - expand: true, - cwd: 'transpiled/', - src: ['**/*.js'], - dest: 'lib/' - }, - { - expand: true, - cwd: 'src/', - src: ['**/*.js'], - dest: 'lib/' - }, - { - src: ['**/*'], - dest: 'lib/', - cwd: 'tools/cjs', - expand: true - } - ] - }, - options: { - process: function (content, srcpath) { - return grunt.template.process(content); - } - } - }, - - react: { - options: { - harmony: true - }, - src: { - files: [ - { - expand: true, - cwd: 'src', - src: ['**/*.jsx'], - dest: 'transpiled', - ext: '.js' - } - ] - }, - test: { - files: [ - { - expand: true, - cwd: 'test', - src: ['**/*.jsx'], - dest: 'test-built', - ext: '.js' - } - ] - } - }, - - clean: { - transpiled: ['transpiled'], - cjs: ['lib'], - amd: ['amd'], - test: ['test-built'] - }, - - watch: { - all: { - files: [ - 'src/**/*.jsx', - 'src/**/*.js', - 'test/**/*.jsx', - 'test/**/*.js' - ], - tasks: ['build'], - options: { - spawn: false - } - } - }, - - browserify: { - test: { - files: { - 'test_bundle.js': ['test-built/**/*.js'] - }, - options: { - transform: ['envify'], - verbose: true - } - } - }, - - requirejs: { - dev: { - // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js - options: { - baseUrl: "amd", - paths: { - "react-bootstrap": "./index", - almond: "../tools/vendor/almond" - }, - packages: [ - { name: 'react', location: '../node_modules/react', main: './react' }, - { name: 'classnames', location: '../node_modules/classnames', main: './index' } - ], - include: ["almond", "react-bootstrap"], - exclude: ["react"], - out: "amd/react-bootstrap.js", - cjsTranslate: true, - wrap: { - startFile: "tools/wrap.start", - endFile: "tools/wrap.end" - }, - rawText: { - 'react': 'define({});' - }, - optimize: "none" - } - } - }, - - uglify: { - options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' - }, - build: { - src: 'amd/<%= pkg.name %>.js', - dest: 'amd/<%= pkg.name %>.min.js' - } - }, - - karma: { - unit: { - configFile: 'karma.ci.js' - }, - dev: { - configFile: 'karma.dev.js' - } - }, - - }); - - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks("grunt-amd-wrap"); - grunt.loadNpmTasks('grunt-react'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-browserify'); - grunt.loadNpmTasks('grunt-contrib-requirejs'); - grunt.loadNpmTasks('grunt-karma'); - - grunt.registerTask('build', [ - 'clean:amd', - 'clean:cjs', - 'clean:test', - 'react:src', - 'react:test', - 'amdwrap', - 'copy', - 'browserify:test', - 'requirejs:dev', - 'uglify:build', - 'clean:transpiled' - ]); - - grunt.registerTask('test', [ - 'build', - 'karma:unit' - ]); - - grunt.registerTask('test-watch', [ - 'build', - 'karma:dev' - ]); - - require('./tools/release/tasks')(grunt); - - grunt.registerTask('default', ['build']); - -}; diff --git a/README.md b/README.md index a453755c92..00d869b5ee 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ [Bootstrap 3](http://getbootstrap.com) components built with [React](http://facebook.github.io/react/) -[![Build Status](https://travis-ci.org/react-bootstrap/react-bootstrap.svg?branch=master)](https://travis-ci.org/react-bootstrap/react-bootstrap) [![NPM version](https://badge.fury.io/js/react-bootstrap.svg)](http://badge.fury.io/js/react-bootstrap) [![Bower version](https://badge.fury.io/bo/react-bootstrap.svg)](http://badge.fury.io/bo/react-bootstrap) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-bootstrap/react-bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/react-bootstrap/react-bootstrap.svg)](https://travis-ci.org/react-bootstrap/react-bootstrap) [![NPM version](https://badge.fury.io/js/react-bootstrap.svg)](http://badge.fury.io/js/react-bootstrap) [![Bower version](https://badge.fury.io/bo/react-bootstrap.svg)](http://badge.fury.io/bo/react-bootstrap) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-bootstrap/react-bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Under active development - APIs will change. ## Docs -A [docs site](http://react-bootstrap.github.io) with live editable examples is a work in progress +See the [documentation](http://react-bootstrap.github.io) with live editable examples. ### Bootstrap Version @@ -25,10 +25,15 @@ and many [contributors](https://github.com/react-bootstrap/react-bootstrap/graph - [react-router-bootstrap](https://github.com/mtscout6/react-router-bootstrap) - Integration with [react-router](https://github.com/rackt/react-router). -## Contributions +## Local Setup + +- Install the dependencies with `npm install` +- Run tests `npm test` +- Run tests in watch mode `npm run test-watch` +- Run the docs site in development mode with `npm run docs`. This will watch + for file changes as you work. Simply refresh the page to see the updates. +- Build with `npm run build` -Yes please! +## Contributions -- Run `npm install`, `npm run test-watch` to run tests while you develop (however this hides any build errors, you can see these with `grunt build`) -- Review the [contributing guidelines](https://github.com/react-bootstrap/react-bootstrap/blob/master/CONTRIBUTING.md) -- See [issues](https://github.com/stevoland/react-bootstrap/issues) for some ideas +Yes please! See the [contributing guidelines](https://github.com/react-bootstrap/react-bootstrap/blob/master/CONTRIBUTING.md) for details. diff --git a/docs/.gitignore-template b/docs/.gitignore-template deleted file mode 100644 index 43edecbb22..0000000000 --- a/docs/.gitignore-template +++ /dev/null @@ -1,11 +0,0 @@ -*~ -node_modules/ -.DS_Store -npm-debug.log -.idea -examples/ -src/ -build.js -client.js -server.js -package.json diff --git a/docs/README.docs.md b/docs/README.docs.md new file mode 100644 index 0000000000..afb8a84de0 --- /dev/null +++ b/docs/README.docs.md @@ -0,0 +1,10 @@ +# React Bootstrap Documentation Website + +This website is single page app built on +[React](http://facebook.github.io/react/), with styles and structure taken from +the [Bootstrap](http://getbootstrap.com/) docs website. The app is statically +generated to HTML via node and then hosted it by pushing HTML to [GitHub +Pages](http://pages.github.com/). + +Source can be found in the +[react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) repo. diff --git a/docs/README.md b/docs/README.md index 086f05f799..3d071c5440 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,50 +1,20 @@ # React Bootstrap Documentation Website -This website is single page app built on [React](http://facebook.github.io/react/), with styles and structure taken from the [Bootstrap](http://getbootstrap.com/) docs website. -The app is statically generated to HTML via node and then hosted it by pushing HTML to [GitHub Pages](http://pages.github.com/). +This website is single page app built on +[React](http://facebook.github.io/react/), with styles and structure taken from +the [Bootstrap](http://getbootstrap.com/) docs website. The app is statically +generated to HTML via node and then hosted it by pushing HTML to [GitHub +Pages](http://pages.github.com/). -## Installation +## Development -If you are working on the site, you will want to install and run a local copy of it. +From the repository root run `npm run docs` and navigate your browser to +`http://localhost:4000`. This will start an express base node server with +webpack-dev middleware that will watch your file changes and recompile all the +static assets needed to generate the site. -### Dependencies +## Production -All dependencies are installed with npm, just: - -```sh -$ cd react-bootstrap/docs -$ npm install -``` - -You must have previously run `grunt build` and `npm install` from the main directory. - -### Instructions - -#### Development - -The site uses React bootstrap components, so first make sure you've installed and built the project (via `grunt`). Then: - -```sh -$ cd react-bootstrap/docs -$ npm start -$ open http://localhost:4000/ -``` - -This will start an express based node server which will generate static html content and the js bundle on request. After making any modifications the server should restart and regenerate any necessary files on the next request. - -#### Production - -This site is statically published on github pages, to do this the static assets need to be generated. - -```sh -$ cd react-bootstrap/docs -$ npm run build -``` - -To test the static files you can use the included express based static file server. - -```sh -$ cd react-bootstrap/docs -$ npm run start-prod -$ open http://localhost:4000/ -``` \ No newline at end of file +This site is statically published on github pages, to do this the static assets +need to be generated. You can simulate a similar experience with `npm run +docs-prod` and navigating your browser to `http://localhost:4000` diff --git a/docs/build.js b/docs/build.js old mode 100755 new mode 100644 index dbde01a273..9a94cbbc2e --- a/docs/build.js +++ b/docs/build.js @@ -1,23 +1,39 @@ -'use strict'; +import React from 'react'; +import path from 'path'; +import Router from 'react-router'; +import routes from './src/Routes'; +import Root from './src/Root'; +import fsp from 'fs-promise'; +import { exec, spawn } from 'child-process-promise'; -var fs = require('fs'); -var path = require('path'); +const repoRoot = path.resolve(__dirname, '../'); +const docsBuilt = path.join(repoRoot, 'docs-built'); -require('node-jsx').install(); +const license = path.join(repoRoot, 'LICENSE'); +const readmeSrc = path.join(__dirname, 'README.docs.md'); +const readmeDest = path.join(docsBuilt, 'README.md'); -var React = require('react'); -var routes = require('./src/Routes'); -var Router = require('react-router'); +export default function BuildDocs() { + console.log('Building: '.cyan + 'docs'.green); -var Root = require('./src/Root'); + return exec(`rm -rf ${docsBuilt}`) + .then(() => fsp.mkdir(docsBuilt)) + .then(() => { + let writes = Root + .getPages() + .map(fileName => new Promise((resolve, reject) => { + Router.run(routes, '/' + fileName, Handler => { + let RootHTML = React.renderToString(React.createElement(Handler)); + let write = fsp.writeFile(path.join(docsBuilt, fileName), RootHTML); + resolve(write); + }); + })); -Root.getPages() - .forEach(function (fileName) { - - Router.run(routes, '/' + fileName, function (Handler) { - var RootHTML = React.renderToString(React.createElement(Handler)); - - fs.writeFileSync( - path.join(__dirname, fileName), RootHTML); + return Promise.all(writes.concat([ + exec(`webpack --config webpack.docs.js -p --bail`), + exec(`cp ${license} ${docsBuilt}`), + exec(`cp ${readmeSrc} ${readmeDest}`) + ])); }) - }); \ No newline at end of file + .then(() => console.log('Built: '.cyan + 'docs'.green)); +} diff --git a/docs/client.js b/docs/client.js index 733668d326..8d742135ca 100644 --- a/docs/client.js +++ b/docs/client.js @@ -1,15 +1,19 @@ -'use strict'; +import from 'bootstrap/less/bootstrap.less'; +import from 'bootstrap/docs/assets/css/_src/docs.css'; +import from './assets/style.css'; -var React = require('react'); -var Router = require('react-router'); -var routes = require('./src/Routes'); +import from './assets/carousel.png'; +import from './assets/logo.png'; +import React from 'react'; +import Router from 'react-router'; +import routes from './src/Routes'; + +// TODO: Move this to Webpack // For React devtools window.React = React; -Router.run(routes, Router.RefreshLocation, function (Handler) { +Router.run(routes, Router.RefreshLocation, Handler => { React.render( React.createElement(Handler, window.INITIAL_PROPS), document); -}) - - +}); diff --git a/docs/examples/.eslintrc b/docs/examples/.eslintrc new file mode 100644 index 0000000000..558f5a24c4 --- /dev/null +++ b/docs/examples/.eslintrc @@ -0,0 +1,52 @@ +{ + "rules": { + "no-alert": 0, + "react/react-in-jsx-scope": 0 + }, + "globals": { + "mountNode", + "React", + "classSet", + "Accordion", + "Alert", + "Badge", + "Button", + "ButtonGroup", + "ButtonToolbar", + "CollapsableNav", + "CollapsableMixin", + "Carousel", + "CarouselItem", + "Col", + "DropdownButton", + "Glyphicon", + "Grid", + "Input", + "Jumbotron", + "Label", + "ListGroup", + "ListGroupItem", + "Nav", + "Navbar", + "NavItem", + "MenuItem", + "Modal", + "ModalTrigger", + "OverlayTrigger", + "OverlayMixin", + "PageHeader", + "PageItem", + "Pager", + "Panel", + "PanelGroup", + "Popover", + "ProgressBar", + "Row", + "SplitButton", + "TabbedArea", + "Table", + "TabPane", + "Tooltip", + "Well" + } +} diff --git a/docs/examples/AlertAutoDismissable.js b/docs/examples/AlertAutoDismissable.js index bbe0c94105..e2c2aa6537 100644 --- a/docs/examples/AlertAutoDismissable.js +++ b/docs/examples/AlertAutoDismissable.js @@ -1,32 +1,32 @@ -var AlertAutoDismissable = React.createClass({ - getInitialState: function() { +const AlertAutoDismissable = React.createClass({ + getInitialState() { return { alertVisible: false }; }, - render: function() { + render() { if (this.state.alertVisible) { return ( - +

Oh snap! You got an error!

But this will hide after 2 seconds.

- ); + ); } return ( - ); + ); }, - handleAlertDismiss: function() { + handleAlertDismiss() { this.setState({alertVisible: false}); }, - handleAlertShow: function() { + handleAlertShow() { this.setState({alertVisible: true}); } }); -React.render(, mountNode); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/AlertBasic.js b/docs/examples/AlertBasic.js index 75da80f88c..d760ccdf50 100644 --- a/docs/examples/AlertBasic.js +++ b/docs/examples/AlertBasic.js @@ -1,7 +1,7 @@ -var alertInstance = ( - - Holy guacamole! Best check yo self, you're not looking too good. - - ); +const alertInstance = ( + + Holy guacamole! Best check yo self, you're not looking too good. + +); -React.render(alertInstance, mountNode); \ No newline at end of file +React.render(alertInstance, mountNode); diff --git a/docs/examples/AlertDismissable.js b/docs/examples/AlertDismissable.js index 9ccc0048e1..6c8d7342c3 100644 --- a/docs/examples/AlertDismissable.js +++ b/docs/examples/AlertDismissable.js @@ -1,36 +1,37 @@ -var AlertDismissable = React.createClass({ - getInitialState: function() { +const AlertDismissable = React.createClass({ + getInitialState() { return { alertVisible: true }; }, - render: function() { + render() { if (this.state.alertVisible) { return ( - +

Oh snap! You got an error!

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

- or + + or

- ); + ); } return ( - ); + ); }, - handleAlertDismiss: function() { + handleAlertDismiss() { this.setState({alertVisible: false}); }, - handleAlertShow: function() { + handleAlertShow() { this.setState({alertVisible: true}); } }); -React.render(, mountNode); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/Badge.js b/docs/examples/Badge.js index 751445a75a..5ff6bdf7ea 100644 --- a/docs/examples/Badge.js +++ b/docs/examples/Badge.js @@ -1,5 +1,5 @@ -var badgeInstance = ( +const badgeInstance = (

Badges 42

); -React.render(badgeInstance, mountNode); \ No newline at end of file +React.render(badgeInstance, mountNode); diff --git a/docs/examples/ButtonActive.js b/docs/examples/ButtonActive.js index 224291e870..3faf267ad3 100644 --- a/docs/examples/ButtonActive.js +++ b/docs/examples/ButtonActive.js @@ -1,8 +1,8 @@ -var buttonsInstance = ( - - - - - ); +const buttonsInstance = ( + + + + +); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/ButtonBlock.js b/docs/examples/ButtonBlock.js index 6ac435eef4..8a222c6c7b 100644 --- a/docs/examples/ButtonBlock.js +++ b/docs/examples/ButtonBlock.js @@ -1,10 +1,10 @@ -var wellStyles = {maxWidth: 400, margin: '0 auto 10px'}; +const wellStyles = {maxWidth: 400, margin: '0 auto 10px'}; -var buttonsInstance = ( -
- - -
- ); +const buttonsInstance = ( +
+ + +
+); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/ButtonDisabled.js b/docs/examples/ButtonDisabled.js index f7b346d547..b7baf70abc 100644 --- a/docs/examples/ButtonDisabled.js +++ b/docs/examples/ButtonDisabled.js @@ -1,8 +1,8 @@ -var buttonsInstance = ( - - - - - ); +const buttonsInstance = ( + + + + +); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/ButtonGroupBasic.js b/docs/examples/ButtonGroupBasic.js index 3651d8c5b8..68d0014637 100644 --- a/docs/examples/ButtonGroupBasic.js +++ b/docs/examples/ButtonGroupBasic.js @@ -1,9 +1,9 @@ -var buttonGroupInstance = ( - - - - - - ); +const buttonGroupInstance = ( + + + + + +); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonGroupJustified.js b/docs/examples/ButtonGroupJustified.js index 663cb9fd25..989cf46ddf 100644 --- a/docs/examples/ButtonGroupJustified.js +++ b/docs/examples/ButtonGroupJustified.js @@ -1,12 +1,12 @@ -var buttonGroupInstance = ( - - - - - Dropdown link - Dropdown link - - - ); +const buttonGroupInstance = ( + + + + + Dropdown link + Dropdown link + + +); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonGroupNested.js b/docs/examples/ButtonGroupNested.js index 3f40c20b02..e1a9e1eb9d 100644 --- a/docs/examples/ButtonGroupNested.js +++ b/docs/examples/ButtonGroupNested.js @@ -1,12 +1,12 @@ -var buttonGroupInstance = ( - - - - - Dropdown link - Dropdown link - - - ); +const buttonGroupInstance = ( + + + + + Dropdown link + Dropdown link + + +); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonGroupSizes.js b/docs/examples/ButtonGroupSizes.js index bfe6fe08f6..4377cb3d9c 100644 --- a/docs/examples/ButtonGroupSizes.js +++ b/docs/examples/ButtonGroupSizes.js @@ -1,37 +1,37 @@ -var buttonGroupInstance = ( -
- - - - - - - +const buttonGroupInstance = ( +
+ + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - -
- ); + + + + + + + +
+); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonGroupVertical.js b/docs/examples/ButtonGroupVertical.js index e4055a5533..9453906974 100644 --- a/docs/examples/ButtonGroupVertical.js +++ b/docs/examples/ButtonGroupVertical.js @@ -1,22 +1,22 @@ -var buttonGroupInstance = ( - - - - - Dropdown link - Dropdown link - - - - - Dropdown link - Dropdown link - - - Dropdown link - Dropdown link - - - ); +const buttonGroupInstance = ( + + + + + Dropdown link + Dropdown link + + + + + Dropdown link + Dropdown link + + + Dropdown link + Dropdown link + + +); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonLoading.js b/docs/examples/ButtonLoading.js index 09fca2dc3f..ac7797b0ed 100644 --- a/docs/examples/ButtonLoading.js +++ b/docs/examples/ButtonLoading.js @@ -1,31 +1,31 @@ -var LoadingButton = React.createClass({ - getInitialState: function() { +const LoadingButton = React.createClass({ + getInitialState() { return { isLoading: false }; }, - render: function() { - var isLoading = this.state.isLoading; + render() { + let isLoading = this.state.isLoading; return ( - - ); + + ); }, - handleClick: function() { + handleClick() { this.setState({isLoading: true}); // This probably where you would have an `ajax` call - setTimeout(function() { + setTimeout(() => { // Completed of async action, set loading state back this.setState({isLoading: false}); - }.bind(this), 2000); + }, 2000); } }); diff --git a/docs/examples/ButtonSizes.js b/docs/examples/ButtonSizes.js index 48919286b2..41b18b0d11 100644 --- a/docs/examples/ButtonSizes.js +++ b/docs/examples/ButtonSizes.js @@ -1,22 +1,22 @@ -var buttonsInstance = ( -
- - - - - - - - - - - - - - - - -
- ); +const buttonsInstance = ( +
+ + + + + + + + + + + + + + + + +
+); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/ButtonTagTypes.js b/docs/examples/ButtonTagTypes.js index b447ee5c6d..8b7b4862a3 100644 --- a/docs/examples/ButtonTagTypes.js +++ b/docs/examples/ButtonTagTypes.js @@ -1,8 +1,8 @@ -var buttonsInstance = ( +const buttonsInstance = ( - + ); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/ButtonToolbarBasic.js b/docs/examples/ButtonToolbarBasic.js index c5351db625..8e2d828fa9 100644 --- a/docs/examples/ButtonToolbarBasic.js +++ b/docs/examples/ButtonToolbarBasic.js @@ -1,22 +1,22 @@ -var buttonGroupInstance = ( - - - - - - - +const buttonGroupInstance = ( + + + + + + + - - - - - + + + + + - - - - - ); + + + + +); -React.render(buttonGroupInstance, mountNode); \ No newline at end of file +React.render(buttonGroupInstance, mountNode); diff --git a/docs/examples/ButtonTypes.js b/docs/examples/ButtonTypes.js index 35b22d2f49..84839aa31a 100644 --- a/docs/examples/ButtonTypes.js +++ b/docs/examples/ButtonTypes.js @@ -1,26 +1,26 @@ -var buttonsInstance = ( - - {/* Standard button */} - +const buttonsInstance = ( + + {/* Standard button */} + - {/* Provides extra visual weight and identifies the primary action in a set of buttons */} - + {/* Provides extra visual weight and identifies the primary action in a set of buttons */} + - {/* Indicates a successful or positive action */} - + {/* Indicates a successful or positive action */} + - {/* Contextual button for informational alert messages */} - + {/* Contextual button for informational alert messages */} + - {/* Indicates caution should be taken with this action */} - + {/* Indicates caution should be taken with this action */} + - {/* Indicates a dangerous or potentially negative action */} - + {/* Indicates a dangerous or potentially negative action */} + - {/* Deemphasize a button by making it look like a link while maintaining button behavior */} - - - ); + {/* Deemphasize a button by making it look like a link while maintaining button behavior */} + + +); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/CarouselControlled.js b/docs/examples/CarouselControlled.js index d5a8ac329d..2670a6de3a 100644 --- a/docs/examples/CarouselControlled.js +++ b/docs/examples/CarouselControlled.js @@ -1,41 +1,46 @@ -var index = 0; -var direction = null; +const ControlledCarousel = React.createClass({ + getInitialState() { + return { + index: 0, + direction: null + }; + }, -function renderCarousel () { - var carouselInstance = ( - - - 900x500 -
-

First slide label

-

Nulla vitae elit libero, a pharetra augue mollis interdum.

-
-
- - 900x500 -
-

Second slide label

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
- - 900x500 -
-

Third slide label

-

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

-
-
-
- ); + handleSelect(selectedIndex, selectedDirection) { + alert('selected=' + selectedIndex + ', direction=' + selectedDirection); + this.setState({ + index: selectedIndex, + direction: selectedDirection + }); + }, - React.render(carouselInstance, mountNode); -} + render() { + return ( + + + 900x500 +
+

First slide label

+

Nulla vitae elit libero, a pharetra augue mollis interdum.

+
+
+ + 900x500 +
+

Second slide label

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+
+
+ + 900x500 +
+

Third slide label

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

+
+
+
+ ); + } +}); -function handleSelect (selectedIndex, selectedDirection) { - alert('selected=' + selectedIndex + ', direction=' + selectedDirection); - index = selectedIndex; - direction = selectedDirection; - renderCarousel(); -} - -renderCarousel(); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/CarouselUncontrolled.js b/docs/examples/CarouselUncontrolled.js index d34672eab3..23e5ce60d0 100644 --- a/docs/examples/CarouselUncontrolled.js +++ b/docs/examples/CarouselUncontrolled.js @@ -1,27 +1,27 @@ -var carouselInstance = ( - - - 900x500 -
-

First slide label

-

Nulla vitae elit libero, a pharetra augue mollis interdum.

-
-
- - 900x500 -
-

Second slide label

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
- - 900x500 -
-

Third slide label

-

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

-
-
-
- ); +const carouselInstance = ( + + + 900x500 +
+

First slide label

+

Nulla vitae elit libero, a pharetra augue mollis interdum.

+
+
+ + 900x500 +
+

Second slide label

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+
+
+ + 900x500 +
+

Third slide label

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

+
+
+
+); -React.render(carouselInstance, mountNode); \ No newline at end of file +React.render(carouselInstance, mountNode); diff --git a/docs/examples/CollapsableNav.js b/docs/examples/CollapsableNav.js index 7211b1342d..87824bb989 100644 --- a/docs/examples/CollapsableNav.js +++ b/docs/examples/CollapsableNav.js @@ -1,23 +1,23 @@ -var navbarInstance = ( - - {/* This is the eventKey referenced */} - - - - - ); +const navbarInstance = ( + + {/* This is the eventKey referenced */} + + + + +); React.render(navbarInstance, mountNode); diff --git a/docs/examples/CollapsableParagraph.js b/docs/examples/CollapsableParagraph.js index 5725be5baf..8ab37508ef 100644 --- a/docs/examples/CollapsableParagraph.js +++ b/docs/examples/CollapsableParagraph.js @@ -1,4 +1,4 @@ -var CollapsableParagraph = React.createClass({ +const CollapsableParagraph = React.createClass({ mixins: [CollapsableMixin], getCollapsableDOMNode: function(){ @@ -15,12 +15,12 @@ var CollapsableParagraph = React.createClass({ }, render: function(){ - var styles = this.getCollapsableClassSet(); - var text = this.isExpanded() ? 'Hide' : 'Show'; + let styles = this.getCollapsableClassSet(); + let text = this.isExpanded() ? 'Hide' : 'Show'; return (
-
+
{this.props.children}
@@ -28,7 +28,7 @@ var CollapsableParagraph = React.createClass({ } }); -var panelInstance = ( +const panelInstance = ( Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. diff --git a/docs/examples/DropdownButtonBasic.js b/docs/examples/DropdownButtonBasic.js index c35217a85b..66fb3ef4de 100644 --- a/docs/examples/DropdownButtonBasic.js +++ b/docs/examples/DropdownButtonBasic.js @@ -1,19 +1,19 @@ -var BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger', 'Link']; +const BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger', 'Link']; function renderDropdownButton (title, i) { return ( - - Action - Another action - Something else here - - Separated link - - ); + + Action + Another action + Something else here + + Separated link + + ); } -var buttonsInstance = ( - {BUTTONS.map(renderDropdownButton)} - ); +const buttonsInstance = ( + {BUTTONS.map(renderDropdownButton)} +); React.render(buttonsInstance, mountNode); diff --git a/docs/examples/DropdownButtonNoCaret.js b/docs/examples/DropdownButtonNoCaret.js index 23327bf0b5..381127b542 100644 --- a/docs/examples/DropdownButtonNoCaret.js +++ b/docs/examples/DropdownButtonNoCaret.js @@ -1,13 +1,13 @@ -var buttonInstance = ( - - - Action - Another action - Something else here - - Separated link - - - ); +const buttonInstance = ( + + + Action + Another action + Something else here + + Separated link + + +); -React.render(buttonInstance, mountNode); \ No newline at end of file +React.render(buttonInstance, mountNode); diff --git a/docs/examples/DropdownButtonSizes.js b/docs/examples/DropdownButtonSizes.js index 4298e8de5a..9aeb15920d 100644 --- a/docs/examples/DropdownButtonSizes.js +++ b/docs/examples/DropdownButtonSizes.js @@ -1,35 +1,35 @@ -var buttonsInstance = ( -
- - - Action - Another action - Something else here - - Separated link - - +const buttonsInstance = ( +
+ + + Action + Another action + Something else here + + Separated link + + - - - Action - Another action - Something else here - - Separated link - - + + + Action + Another action + Something else here + + Separated link + + - - - Action - Another action - Something else here - - Separated link - - -
- ); + + + Action + Another action + Something else here + + Separated link + + +
+); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/Glyphicon.js b/docs/examples/Glyphicon.js index 0736a35f69..cc0d3fa2ce 100644 --- a/docs/examples/Glyphicon.js +++ b/docs/examples/Glyphicon.js @@ -1,22 +1,22 @@ -var glyphInstance = ( +const glyphInstance = (
- - - - + + + + - - - - + + + +
); -React.render(glyphInstance, mountNode); \ No newline at end of file +React.render(glyphInstance, mountNode); diff --git a/docs/examples/GridBasic.js b/docs/examples/GridBasic.js index 4931b5c581..6f6f063234 100644 --- a/docs/examples/GridBasic.js +++ b/docs/examples/GridBasic.js @@ -1,25 +1,25 @@ -var navInstance = ( - - - <{'Col xs={12} md={8}'} /> - <{'Col xs={6} md={4}'} /> - +const navInstance = ( + + + <{'Col xs={12} md={8}'} /> + <{'Col xs={6} md={4}'} /> + - - <{'Col xs={6} md={4}'} /> - <{'Col xs={6} md={4}'} /> - <{'Col xs={6} md={4}'} /> - + + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + - - <{'Col xs={6} xsOffset={6}'} /> - + + <{'Col xs={6} xsOffset={6}'} /> + - - <{'Col md={6} mdPush={6}'} /> - <{'Col md={6} mdPull={6}'} /> - - - ); + + <{'Col md={6} mdPush={6}'} /> + <{'Col md={6} mdPull={6}'} /> + + +); -React.render(navInstance, mountNode); \ No newline at end of file +React.render(navInstance, mountNode); diff --git a/docs/examples/Input.js b/docs/examples/Input.js index 2218bf0a21..b9c4437ff8 100644 --- a/docs/examples/Input.js +++ b/docs/examples/Input.js @@ -1,18 +1,18 @@ -var ExampleInput = React.createClass({ - getInitialState: function() { +const ExampleInput = React.createClass({ + getInitialState() { return { value: '' }; }, - validationState: function() { - var length = this.state.value.length; - if (length > 10) return 'success'; - else if (length > 5) return 'warning'; - else if (length > 0) return 'error'; + validationState() { + let length = this.state.value.length; + if (length > 10) { return 'success'; } + else if (length > 5) { return 'warning'; } + else if (length > 0) { return 'error'; } }, - handleChange: function() { + handleChange() { // This could also be done using ReactLink: // http://facebook.github.io/react/docs/two-way-binding-helpers.html this.setState({ @@ -20,21 +20,21 @@ var ExampleInput = React.createClass({ }); }, - render: function() { + render() { return ( - + ); } }); diff --git a/docs/examples/InputAddons.js b/docs/examples/InputAddons.js index 80de4379d9..4f93eb59ab 100644 --- a/docs/examples/InputAddons.js +++ b/docs/examples/InputAddons.js @@ -1,14 +1,20 @@ -var inputAddonsInstance = ( -
- - - - } /> - Before} /> - - Item - } /> -
- ); +const innerGlyphicon = ; +const innerButton = ; +const innerDropdown = ( + + Item + +); + +const inputAddonsInstance = ( +
+ + + + + + +
+); React.render(inputAddonsInstance, mountNode); diff --git a/docs/examples/InputHorizontal.js b/docs/examples/InputHorizontal.js index 53086147cf..80ef6627b0 100644 --- a/docs/examples/InputHorizontal.js +++ b/docs/examples/InputHorizontal.js @@ -1,9 +1,9 @@ -var inputHorizontalInstance = ( -
- - - -
- ); +const inputHorizontalInstance = ( +
+ + + +
+); React.render(inputHorizontalInstance, mountNode); diff --git a/docs/examples/InputTypes.js b/docs/examples/InputTypes.js index edb6dca7f9..965c6623c1 100644 --- a/docs/examples/InputTypes.js +++ b/docs/examples/InputTypes.js @@ -1,23 +1,23 @@ -var inputTypeInstance = ( -
- - - - - - - - - - - - - - - - - -
- ); +const inputTypeInstance = ( +
+ + + + + + + + + + + + + + + + + +
+); React.render(inputTypeInstance, mountNode); diff --git a/docs/examples/InputValidation.js b/docs/examples/InputValidation.js index 1781645a94..9ec927ba47 100644 --- a/docs/examples/InputValidation.js +++ b/docs/examples/InputValidation.js @@ -1,9 +1,9 @@ -var inputValidationInstance = ( -
- - - -
- ); +const inputValidationInstance = ( +
+ + + +
+); React.render(inputValidationInstance, mountNode); diff --git a/docs/examples/InputWrapper.js b/docs/examples/InputWrapper.js index 57fa0039bc..ba305b2e55 100644 --- a/docs/examples/InputWrapper.js +++ b/docs/examples/InputWrapper.js @@ -1,14 +1,14 @@ -var inputWrapperInstance = ( - - - - - - - - - - - ); +const inputWrapperInstance = ( + + + + + + + + + + +); React.render(inputWrapperInstance, mountNode); diff --git a/docs/examples/Jumbotron.js b/docs/examples/Jumbotron.js index e1dc5e3403..05f74d694f 100644 --- a/docs/examples/Jumbotron.js +++ b/docs/examples/Jumbotron.js @@ -1,9 +1,9 @@ -var jumbotronInstance = ( +const jumbotronInstance = (

Hello, world!

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

-

+

- ); +); -React.render(jumbotronInstance, mountNode); \ No newline at end of file +React.render(jumbotronInstance, mountNode); diff --git a/docs/examples/Label.js b/docs/examples/Label.js index f949938fc3..5828481984 100644 --- a/docs/examples/Label.js +++ b/docs/examples/Label.js @@ -1,4 +1,4 @@ -var labelInstance = ( +const labelInstance = (

Label

Label

@@ -9,4 +9,4 @@ var labelInstance = (
); -React.render(labelInstance, mountNode); \ No newline at end of file +React.render(labelInstance, mountNode); diff --git a/docs/examples/LabelVariations.js b/docs/examples/LabelVariations.js index a8e8896a5f..5cf2b5b888 100644 --- a/docs/examples/LabelVariations.js +++ b/docs/examples/LabelVariations.js @@ -1,12 +1,12 @@ -var labelVariationInstance = ( +const labelVariationInstance = (
- - - - - - +   +   +   +   +   +
- ); +); -React.render(labelVariationInstance, mountNode); \ No newline at end of file +React.render(labelVariationInstance, mountNode); diff --git a/docs/examples/ListGroupActive.js b/docs/examples/ListGroupActive.js index 3e8e85abcc..f9442f9af6 100644 --- a/docs/examples/ListGroupActive.js +++ b/docs/examples/ListGroupActive.js @@ -1,9 +1,9 @@ -var listgroupInstance = ( - - Link 1 - Link 2 - Link 3 - - ); +const listgroupInstance = ( + + Link 1 + Link 2 + Link 3 + +); React.render(listgroupInstance, mountNode); diff --git a/docs/examples/ListGroupDefault.js b/docs/examples/ListGroupDefault.js index 0d0477876f..d4fa198608 100644 --- a/docs/examples/ListGroupDefault.js +++ b/docs/examples/ListGroupDefault.js @@ -1,9 +1,9 @@ -var listgroupInstance = ( - - Item 1 - Item 2 - ... - - ); +const listgroupInstance = ( + + Item 1 + Item 2 + ... + +); React.render(listgroupInstance, mountNode); diff --git a/docs/examples/ListGroupHeader.js b/docs/examples/ListGroupHeader.js index 8751ec6140..fc2861a4ea 100644 --- a/docs/examples/ListGroupHeader.js +++ b/docs/examples/ListGroupHeader.js @@ -1,9 +1,9 @@ -var listgroupInstance = ( - - Some body text - Linked item - Danger styling - - ); +const listgroupInstance = ( + + Some body text + Linked item + Danger styling + +); React.render(listgroupInstance, mountNode); diff --git a/docs/examples/ListGroupLinked.js b/docs/examples/ListGroupLinked.js index c67e087364..794795c0bb 100644 --- a/docs/examples/ListGroupLinked.js +++ b/docs/examples/ListGroupLinked.js @@ -1,9 +1,9 @@ -var listgroupInstance = ( - - Link 1 - Link 2 - ... - - ); +const listgroupInstance = ( + + Link 1 + Link 2 + ... + +); React.render(listgroupInstance, mountNode); diff --git a/docs/examples/ListGroupStyle.js b/docs/examples/ListGroupStyle.js index a67e7b2f7f..4dc7351088 100644 --- a/docs/examples/ListGroupStyle.js +++ b/docs/examples/ListGroupStyle.js @@ -1,10 +1,10 @@ -var listgroupInstance = ( - - Success - Info - Warning - Danger - - ); +const listgroupInstance = ( + + Success + Info + Warning + Danger + +); React.render(listgroupInstance, mountNode); diff --git a/docs/examples/ModalContained.js b/docs/examples/ModalContained.js index 8747c2eef7..316b170d60 100644 --- a/docs/examples/ModalContained.js +++ b/docs/examples/ModalContained.js @@ -9,15 +9,14 @@ * } */ - -var ContainedModal = React.createClass({ - render: function() { +const ContainedModal = React.createClass({ + render() { return ( - -
+ +
Elit est explicabo ipsum eaque dolorem blanditiis doloribus sed id ipsam, beatae, rem fuga id earum? Inventore et facilis obcaecati.
-
+
@@ -25,12 +24,12 @@ var ContainedModal = React.createClass({ } }); -var Trigger = React.createClass({ - render: function() { +const Trigger = React.createClass({ + render() { return (
} container={this}> - +
); diff --git a/docs/examples/ModalOverlayMixin.js b/docs/examples/ModalOverlayMixin.js index 15890fc1af..09856deddb 100644 --- a/docs/examples/ModalOverlayMixin.js +++ b/docs/examples/ModalOverlayMixin.js @@ -1,43 +1,43 @@ // Our custom component is managing whether the Modal is visible -var CustomModalTrigger = React.createClass({ +const CustomModalTrigger = React.createClass({ mixins: [OverlayMixin], - getInitialState: function () { + getInitialState() { return { isModalOpen: false }; }, - handleToggle: function () { + handleToggle() { this.setState({ isModalOpen: !this.state.isModalOpen }); }, - render: function () { + render() { return ( - + ); }, // This is called by the `OverlayMixin` when this component // is mounted or updated and the return value is appended to the body. - renderOverlay: function () { + renderOverlay() { if (!this.state.isModalOpen) { return ; } return ( - -
- This modal is controlled by our custom trigger component. -
-
- -
-
- ); + +
+ This modal is controlled by our custom trigger component. +
+
+ +
+
+ ); } }); -React.render(, mountNode); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/ModalStatic.js b/docs/examples/ModalStatic.js index 7b11bf193f..d5b12b91b0 100644 --- a/docs/examples/ModalStatic.js +++ b/docs/examples/ModalStatic.js @@ -1,24 +1,24 @@ function handleHide() { - alert('Close me!') + alert('Close me!'); } -var modalInstance = ( -
- -
- One fine body... -
-
- - -
-
-
- ); +const modalInstance = ( +
+ +
+ One fine body... +
+
+ + +
+
+
+); React.render(modalInstance, mountNode); diff --git a/docs/examples/ModalTrigger.js b/docs/examples/ModalTrigger.js index 6cfcff4c00..c1d0f8a8c0 100644 --- a/docs/examples/ModalTrigger.js +++ b/docs/examples/ModalTrigger.js @@ -1,42 +1,42 @@ -var MyModal = React.createClass({ - render: function() { +const MyModal = React.createClass({ + render() { return ( - -
-

Text in a modal

-

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

+ +
+

Text in a modal

+

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

-

Popover in a modal

-

TODO

+

Popover in a modal

+

TODO

-

Tooltips in a modal

-

TODO

+

Tooltips in a modal

+

TODO

-
+
-

Overflowing text to show scroll behavior

-

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

-

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

-

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

-

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

-

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

-

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

-

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

-

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

-

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

-
-
- -
-
- ); +

Overflowing text to show scroll behavior

+

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

+

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

+

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

+

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

+

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

+

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

+
+
+ +
+
+ ); } }); -var overlayTriggerInstance = ( - }> - - - ); +const overlayTriggerInstance = ( + }> + + +); -React.render(overlayTriggerInstance, mountNode); \ No newline at end of file +React.render(overlayTriggerInstance, mountNode); diff --git a/docs/examples/NavBasic.js b/docs/examples/NavBasic.js index b3f49f0d8a..7be936f6e4 100644 --- a/docs/examples/NavBasic.js +++ b/docs/examples/NavBasic.js @@ -2,12 +2,12 @@ function handleSelect (selectedKey) { alert('selected ' + selectedKey); } -var navInstance = ( - - ); +const navInstance = ( + +); React.render(navInstance, mountNode); diff --git a/docs/examples/NavDropdown.js b/docs/examples/NavDropdown.js index e9e09259ab..7bdaa9e05a 100644 --- a/docs/examples/NavDropdown.js +++ b/docs/examples/NavDropdown.js @@ -1,20 +1,24 @@ -function handleSelect (selectedKey) { - alert('selected ' + selectedKey); -} +const NavDropdown = React.createClass({ + handleSelect(selectedKey) { + alert('selected ' + selectedKey); + }, -var navInstance = ( - - ); + render() { + return ( + + ); + } +}); -React.render(navInstance, mountNode); +React.render(, mountNode); diff --git a/docs/examples/NavJustified.js b/docs/examples/NavJustified.js index e44f580231..7478e89515 100644 --- a/docs/examples/NavJustified.js +++ b/docs/examples/NavJustified.js @@ -1,21 +1,25 @@ -function handleSelect (selectedKey) { - alert('selected ' + selectedKey); -} +const NavJustified = React.createClass({ + handleSelect(selectedKey) { + alert('selected ' + selectedKey); + }, -var navInstance = ( -
- -
- -
- ); + render() { + return ( +
+ +
+ +
+ ); + } +}); -React.render(navInstance, mountNode); +React.render(, mountNode); diff --git a/docs/examples/NavStacked.js b/docs/examples/NavStacked.js index dabace3084..3f8b615cd4 100644 --- a/docs/examples/NavStacked.js +++ b/docs/examples/NavStacked.js @@ -2,12 +2,12 @@ function handleSelect (selectedKey) { alert('selected ' + selectedKey); } -var navInstance = ( - - ); +const navInstance = ( + +); React.render(navInstance, mountNode); diff --git a/docs/examples/NavbarBasic.js b/docs/examples/NavbarBasic.js index 972b8def31..756b6634b7 100644 --- a/docs/examples/NavbarBasic.js +++ b/docs/examples/NavbarBasic.js @@ -1,17 +1,17 @@ -var navbarInstance = ( - - - - ); +const navbarInstance = ( + + + +); React.render(navbarInstance, mountNode); diff --git a/docs/examples/NavbarCollapsable.js b/docs/examples/NavbarCollapsable.js index e079825065..35b9564cf1 100644 --- a/docs/examples/NavbarCollapsable.js +++ b/docs/examples/NavbarCollapsable.js @@ -1,17 +1,17 @@ -var navbarInstance = ( - - - - ); +const navbarInstance = ( + + + +); React.render(navbarInstance, mountNode); diff --git a/docs/examples/PageHeader.js b/docs/examples/PageHeader.js index 1063020db3..243d829e46 100644 --- a/docs/examples/PageHeader.js +++ b/docs/examples/PageHeader.js @@ -1,5 +1,5 @@ -var pageHeaderInstance = ( +const pageHeaderInstance = ( Example page header Subtext for header ); -React.render(pageHeaderInstance, mountNode); \ No newline at end of file +React.render(pageHeaderInstance, mountNode); diff --git a/docs/examples/PagerAligned.js b/docs/examples/PagerAligned.js index 7f1220b128..baac751b20 100644 --- a/docs/examples/PagerAligned.js +++ b/docs/examples/PagerAligned.js @@ -1,8 +1,8 @@ -var pagerInstance = ( - - ← Previous Page - Next Page → - - ); +const pagerInstance = ( + + ← Previous Page + Next Page → + +); -React.render(pagerInstance, mountNode); \ No newline at end of file +React.render(pagerInstance, mountNode); diff --git a/docs/examples/PagerDefault.js b/docs/examples/PagerDefault.js index cab4455a49..b1e1929461 100644 --- a/docs/examples/PagerDefault.js +++ b/docs/examples/PagerDefault.js @@ -1,8 +1,8 @@ -var pagerInstance = ( - - Previous - Next - - ); +const pagerInstance = ( + + Previous + Next + +); -React.render(pagerInstance, mountNode); \ No newline at end of file +React.render(pagerInstance, mountNode); diff --git a/docs/examples/PagerDisabled.js b/docs/examples/PagerDisabled.js index d9debe9730..8d9ba74085 100644 --- a/docs/examples/PagerDisabled.js +++ b/docs/examples/PagerDisabled.js @@ -1,8 +1,8 @@ -var pagerInstance = ( - - ← Previous - Next → - - ); +const pagerInstance = ( + + ← Previous + Next → + +); -React.render(pagerInstance, mountNode); \ No newline at end of file +React.render(pagerInstance, mountNode); diff --git a/docs/examples/PanelBasic.js b/docs/examples/PanelBasic.js index e8364e3b42..7b94f28c10 100644 --- a/docs/examples/PanelBasic.js +++ b/docs/examples/PanelBasic.js @@ -1,7 +1,7 @@ -var panelInstance = ( - - Basic panel example - - ); +const panelInstance = ( + + Basic panel example + +); -React.render(panelInstance, mountNode); \ No newline at end of file +React.render(panelInstance, mountNode); diff --git a/docs/examples/PanelContextual.js b/docs/examples/PanelContextual.js index d69b2e72af..f404a17836 100644 --- a/docs/examples/PanelContextual.js +++ b/docs/examples/PanelContextual.js @@ -1,33 +1,33 @@ -var title = ( -

Panel title

- ); +const title = ( +

Panel title

+); -var panelsInstance = ( -
- - Panel content - +const panelsInstance = ( +
+ + Panel content + - - Panel content - + + Panel content + - - Panel content - + + Panel content + - - Panel content - + + Panel content + - - Panel content - + + Panel content + - - Panel content - -
- ); + + Panel content + +
+); -React.render(panelsInstance, mountNode); \ No newline at end of file +React.render(panelsInstance, mountNode); diff --git a/docs/examples/PanelGroupAccordion.js b/docs/examples/PanelGroupAccordion.js index 468bab033d..74ecc70e84 100644 --- a/docs/examples/PanelGroupAccordion.js +++ b/docs/examples/PanelGroupAccordion.js @@ -1,15 +1,15 @@ -var accordionInstance = ( +const accordionInstance = ( - + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. - + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. - + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. ); -React.render(accordionInstance, mountNode); \ No newline at end of file +React.render(accordionInstance, mountNode); diff --git a/docs/examples/PanelGroupControlled.js b/docs/examples/PanelGroupControlled.js index 73a94ae7d0..054b52176d 100644 --- a/docs/examples/PanelGroupControlled.js +++ b/docs/examples/PanelGroupControlled.js @@ -1,16 +1,22 @@ -var renderedInstance; +const ControlledPanelGroup = React.createClass({ + getInitialState() { + return { + activeKey: 1 + }; + }, -function handleSelect (selectedKey) { - renderedInstance.setProps({ - activeKey: selectedKey - }); -} + handleSelect(activeKey) { + this.setState({ activeKey }); + }, -var panelGroupInstance = ( - - Panel 1 content - Panel 2 content - -); + render() { + return ( + + Panel 1 content + Panel 2 content + + ); + } +}); -renderedInstance = React.render(panelGroupInstance, mountNode); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/PanelGroupUncontrolled.js b/docs/examples/PanelGroupUncontrolled.js index abb0e0d5f0..6513d22d33 100644 --- a/docs/examples/PanelGroupUncontrolled.js +++ b/docs/examples/PanelGroupUncontrolled.js @@ -1,8 +1,8 @@ -var panelGroupInstance = ( +const panelGroupInstance = ( - Panel 1 content - Panel 2 content + Panel 1 content + Panel 2 content ); -React.render(panelGroupInstance, mountNode); \ No newline at end of file +React.render(panelGroupInstance, mountNode); diff --git a/docs/examples/PanelListGroupFill.js b/docs/examples/PanelListGroupFill.js index cda253fb33..20cd1f2104 100644 --- a/docs/examples/PanelListGroupFill.js +++ b/docs/examples/PanelListGroupFill.js @@ -1,13 +1,13 @@ -var panelInstance = ( - - Some default panel content here. - - Item 1 - Item 2 - - - Some more panel content here. - - ); +const panelInstance = ( + + Some default panel content here. + + Item 1 + Item 2 + + + Some more panel content here. + +); React.render(panelInstance, mountNode); diff --git a/docs/examples/PanelWithFooter.js b/docs/examples/PanelWithFooter.js index 2ae3dd6b6e..642fc991f2 100644 --- a/docs/examples/PanelWithFooter.js +++ b/docs/examples/PanelWithFooter.js @@ -1,7 +1,7 @@ -var panelInstance = ( - - Panel content - - ); +const panelInstance = ( + + Panel content + +); -React.render(panelInstance, mountNode); \ No newline at end of file +React.render(panelInstance, mountNode); diff --git a/docs/examples/PanelWithHeading.js b/docs/examples/PanelWithHeading.js index 1422797b23..62cd89fb1c 100644 --- a/docs/examples/PanelWithHeading.js +++ b/docs/examples/PanelWithHeading.js @@ -1,16 +1,16 @@ -var title = ( -

Panel title

- ); +const title = ( +

Panel title

+); -var panelsInstance = ( -
- - Panel content - - - Panel content - -
- ); +const panelsInstance = ( +
+ + Panel content + + + Panel content + +
+); -React.render(panelsInstance, mountNode); \ No newline at end of file +React.render(panelsInstance, mountNode); diff --git a/docs/examples/PopoverBasic.js b/docs/examples/PopoverBasic.js index 0d9178add1..919f68be6f 100644 --- a/docs/examples/PopoverBasic.js +++ b/docs/examples/PopoverBasic.js @@ -1,11 +1,9 @@ -var holderStyle = {height: 120}; +const popoverInstance = ( +
+ + And here's some amazing content. It's very engaging. right? + +
+); -var popoverInstance = ( -
- - And here's some amazing content. It's very engaging. right? - -
- ); - -React.render(popoverInstance, mountNode); \ No newline at end of file +React.render(popoverInstance, mountNode); diff --git a/docs/examples/PopoverPositioned.js b/docs/examples/PopoverPositioned.js index 2eee7eb9dc..a7cad7571b 100644 --- a/docs/examples/PopoverPositioned.js +++ b/docs/examples/PopoverPositioned.js @@ -1,18 +1,18 @@ -var positionerInstance = ( - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - - ); +const positionerInstance = ( + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +); -React.render(positionerInstance, mountNode); \ No newline at end of file +React.render(positionerInstance, mountNode); diff --git a/docs/examples/PopoverPositionedContained.js b/docs/examples/PopoverPositionedContained.js index 5e8c3a8143..beabf48d5c 100644 --- a/docs/examples/PopoverPositionedContained.js +++ b/docs/examples/PopoverPositionedContained.js @@ -1,18 +1,18 @@ -var positionerInstance = ( - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - - ); +const positionerInstance = ( + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +); -React.render(positionerInstance, mountNode); \ No newline at end of file +React.render(positionerInstance, mountNode); diff --git a/docs/examples/ProgressBarAnimated.js b/docs/examples/ProgressBarAnimated.js index 8796d212e1..0f37928087 100644 --- a/docs/examples/ProgressBarAnimated.js +++ b/docs/examples/ProgressBarAnimated.js @@ -1,5 +1,5 @@ -var progressInstance = ( - - ); +const progressInstance = ( + +); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarBasic.js b/docs/examples/ProgressBarBasic.js index 0679319c6e..e99d1f2580 100644 --- a/docs/examples/ProgressBarBasic.js +++ b/docs/examples/ProgressBarBasic.js @@ -1,5 +1,5 @@ -var progressInstance = ( - - ); +const progressInstance = ( + +); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarContextual.js b/docs/examples/ProgressBarContextual.js index d9624cca1a..dd6e73f382 100644 --- a/docs/examples/ProgressBarContextual.js +++ b/docs/examples/ProgressBarContextual.js @@ -1,10 +1,10 @@ -var progressInstance = ( -
- - - - -
- ); +const progressInstance = ( +
+ + + + +
+); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarScreenreaderLabel.js b/docs/examples/ProgressBarScreenreaderLabel.js index ac58b9b793..598cb08608 100644 --- a/docs/examples/ProgressBarScreenreaderLabel.js +++ b/docs/examples/ProgressBarScreenreaderLabel.js @@ -1,5 +1,5 @@ -var progressInstance = ( - - ); +const progressInstance = ( + +); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarStacked.js b/docs/examples/ProgressBarStacked.js index b7d474f87f..0da3b2abc1 100644 --- a/docs/examples/ProgressBarStacked.js +++ b/docs/examples/ProgressBarStacked.js @@ -1,9 +1,9 @@ -var progressInstance = ( - - - - - - ); +const progressInstance = ( + + + + + +); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarStriped.js b/docs/examples/ProgressBarStriped.js index ee32b96ff7..b3d93c46d8 100644 --- a/docs/examples/ProgressBarStriped.js +++ b/docs/examples/ProgressBarStriped.js @@ -1,10 +1,10 @@ -var progressInstance = ( -
- - - - -
- ); +const progressInstance = ( +
+ + + + +
+); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/ProgressBarWithLabel.js b/docs/examples/ProgressBarWithLabel.js index 487cb33cc4..65be52045f 100644 --- a/docs/examples/ProgressBarWithLabel.js +++ b/docs/examples/ProgressBarWithLabel.js @@ -1,5 +1,5 @@ -var progressInstance = ( - - ); +const progressInstance = ( + +); -React.render(progressInstance, mountNode); \ No newline at end of file +React.render(progressInstance, mountNode); diff --git a/docs/examples/SplitButtonBasic.js b/docs/examples/SplitButtonBasic.js index 84fe13edd6..4507b39a6a 100644 --- a/docs/examples/SplitButtonBasic.js +++ b/docs/examples/SplitButtonBasic.js @@ -1,19 +1,19 @@ -var BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger']; +const BUTTONS = ['Default', 'Primary', 'Success', 'Info', 'Warning', 'Danger']; function renderDropdownButton (title, i) { return ( - - Action - Another action - Something else here - - Separated link - - ); + + Action + Another action + Something else here + + Separated link + + ); } -var buttonsInstance = ( - {BUTTONS.map(renderDropdownButton)} - ); +const buttonsInstance = ( + {BUTTONS.map(renderDropdownButton)} +); React.render(buttonsInstance, mountNode); diff --git a/docs/examples/SplitButtonDropup.js b/docs/examples/SplitButtonDropup.js index 95a6a5f960..abfe5cfe0f 100644 --- a/docs/examples/SplitButtonDropup.js +++ b/docs/examples/SplitButtonDropup.js @@ -1,25 +1,25 @@ -var buttonsInstance = ( -
- - - Action - Another action - Something else here - - Separated link - - +const buttonsInstance = ( +
+ + + Action + Another action + Something else here + + Separated link + + - - - Action - Another action - Something else here - - Separated link - - -
- ); + + + Action + Another action + Something else here + + Separated link + + +
+); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/SplitButtonRight.js b/docs/examples/SplitButtonRight.js index b3dabc3f0f..b9254720a5 100644 --- a/docs/examples/SplitButtonRight.js +++ b/docs/examples/SplitButtonRight.js @@ -1,11 +1,11 @@ -var buttonsInstance = ( - - Action - Another action - Something else here - - Separated link - - ); +const buttonsInstance = ( + + Action + Another action + Something else here + + Separated link + +); -React.render(buttonsInstance, mountNode); \ No newline at end of file +React.render(buttonsInstance, mountNode); diff --git a/docs/examples/TabbedAreaControlled.js b/docs/examples/TabbedAreaControlled.js index 358ea6db3f..82bf84f400 100644 --- a/docs/examples/TabbedAreaControlled.js +++ b/docs/examples/TabbedAreaControlled.js @@ -1,19 +1,23 @@ -var key = 1; +const ControlledTabArea = React.createClass({ + getInitialState() { + return { + key: 1 + }; + }, -function renderTabbedArea () { - var tabbedAreaInstance = ( - - TabPane 1 content - TabPane 2 content - - ); - React.render(tabbedAreaInstance, mountNode); -} + handleSelect(key) { + alert('selected ' + key); + this.setState({key}); + }, -function handleSelect (selectedKey) { - alert('selected ' + selectedKey); - key = selectedKey; - renderTabbedArea(); -} + render() { + return ( + + TabPane 1 content + TabPane 2 content + + ); + } +}); -renderTabbedArea(); \ No newline at end of file +React.render(, mountNode); diff --git a/docs/examples/TabbedAreaNoAnimation.js b/docs/examples/TabbedAreaNoAnimation.js index a5b965b5a5..e4d4b7a323 100644 --- a/docs/examples/TabbedAreaNoAnimation.js +++ b/docs/examples/TabbedAreaNoAnimation.js @@ -1,8 +1,8 @@ -var tabbedAreaInstance = ( - - TabPane 1 content - TabPane 2 content - - ); +const tabbedAreaInstance = ( + + TabPane 1 content + TabPane 2 content + +); -React.render(tabbedAreaInstance, mountNode); \ No newline at end of file +React.render(tabbedAreaInstance, mountNode); diff --git a/docs/examples/TabbedAreaUncontrolled.js b/docs/examples/TabbedAreaUncontrolled.js index db1019f487..c22c7ad9c5 100644 --- a/docs/examples/TabbedAreaUncontrolled.js +++ b/docs/examples/TabbedAreaUncontrolled.js @@ -1,8 +1,8 @@ -var tabbedAreaInstance = ( - - TabPane 1 content - TabPane 2 content - - ); +const tabbedAreaInstance = ( + + TabPane 1 content + TabPane 2 content + +); -React.render(tabbedAreaInstance, mountNode); \ No newline at end of file +React.render(tabbedAreaInstance, mountNode); diff --git a/docs/examples/TableBasic.js b/docs/examples/TableBasic.js index 0dc4e09059..e99d8fdf27 100644 --- a/docs/examples/TableBasic.js +++ b/docs/examples/TableBasic.js @@ -1,33 +1,33 @@ -var tableInstance = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
- ); +const tableInstance = ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
+); -React.render(tableInstance, mountNode); \ No newline at end of file +React.render(tableInstance, mountNode); diff --git a/docs/examples/TableResponsive.js b/docs/examples/TableResponsive.js index a3136be7d2..1c2f8e33cc 100644 --- a/docs/examples/TableResponsive.js +++ b/docs/examples/TableResponsive.js @@ -1,46 +1,46 @@ -var tableInstance = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Table headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
- ); +const tableInstance = ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Table headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
+); -React.render(tableInstance, mountNode); \ No newline at end of file +React.render(tableInstance, mountNode); diff --git a/docs/examples/TooltipBasic.js b/docs/examples/TooltipBasic.js index 8c712fb70b..f2df4f4a66 100644 --- a/docs/examples/TooltipBasic.js +++ b/docs/examples/TooltipBasic.js @@ -1,11 +1,9 @@ -var holderStyle = {height: 50}; +const tooltipInstance = ( +
+ + Holy guacamole! Check this info. + +
+); -var tooltipInstance = ( -
- - Holy guacamole! Check this info. - -
- ); - -React.render(tooltipInstance, mountNode); \ No newline at end of file +React.render(tooltipInstance, mountNode); diff --git a/docs/examples/TooltipInCopy.js b/docs/examples/TooltipInCopy.js index 1db707f98b..36400ed271 100644 --- a/docs/examples/TooltipInCopy.js +++ b/docs/examples/TooltipInCopy.js @@ -1,20 +1,19 @@ -var LinkWithTooltip = React.createClass({ - render: function () { - var tooltip = {this.props.tooltip}; +const LinkWithTooltip = React.createClass({ + render() { + let tooltip = {this.props.tooltip}; + return ( - - {this.props.children} - - ); + + {this.props.children} + + ); } }); -var pStyle = {marginBottom: 0}; - -var copyInstance = ( -

- Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel Another tooltip} href="#">have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. -

- ); +const copyInstance = ( +

+ Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel Another tooltip} href='#'>have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. +

+); React.render(copyInstance, mountNode); diff --git a/docs/examples/TooltipPositioned.js b/docs/examples/TooltipPositioned.js index 5d43f85ee6..cedb961fa9 100644 --- a/docs/examples/TooltipPositioned.js +++ b/docs/examples/TooltipPositioned.js @@ -1,18 +1,18 @@ -var positionerInstance = ( - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - Holy guacamole! Check this info.}> - - - - ); +const positionerInstance = ( + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +); -React.render(positionerInstance, mountNode); \ No newline at end of file +React.render(positionerInstance, mountNode); diff --git a/docs/examples/Well.js b/docs/examples/Well.js index 153cf23a0a..31caabf770 100644 --- a/docs/examples/Well.js +++ b/docs/examples/Well.js @@ -1,5 +1,5 @@ -var wellInstance = ( +const wellInstance = ( Look I'm in a well! ); -React.render(wellInstance, mountNode); \ No newline at end of file +React.render(wellInstance, mountNode); diff --git a/docs/examples/WellSizes.js b/docs/examples/WellSizes.js index 8cc222b419..80bb223539 100644 --- a/docs/examples/WellSizes.js +++ b/docs/examples/WellSizes.js @@ -1,8 +1,8 @@ -var wellInstance = ( +const wellInstance = (
- Look I'm in a large well! - Look I'm in a small well! + Look I'm in a large well! + Look I'm in a small well!
); -React.render(wellInstance, mountNode); \ No newline at end of file +React.render(wellInstance, mountNode); diff --git a/docs/package.json b/docs/package.json deleted file mode 100644 index d83d3b9196..0000000000 --- a/docs/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "react-bootstrap-docs", - "version": "0.0.0", - "description": "React Bootstrap docs site", - "main": "./server.js", - "browser": "./client.js", - "browserify": { - "transform": [ - "reactify", - "brfs", - "envify" - ] - }, - "devDependencies": { - "express": "~3.4.8", - "node-jsx": "~0.12.0", - "reactify": "~0.15.2", - "brfs": "~1.0.0", - "envify": "~1.2.0", - "browserify": "~3.26.0", - "connect-browserify": "~1.0.0", - "uglify-js": "^2.3.6", - "supervisor": "~0.5.7" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "supervisor -w .,../lib -i node_modules server.js", - "build": "node build.js && browserify client.js | uglifyjs -cm 2>/dev/null > ./assets/bundle.js", - "start-prod": "NODE_ENV=production node server.js" - }, - "author": "", - "license": "MIT" -} diff --git a/docs/server.js b/docs/server.js index 244e93d0fb..6093bc0565 100644 --- a/docs/server.js +++ b/docs/server.js @@ -1,42 +1,46 @@ -'use strict'; - -var express = require('express'); - - -var development = process.env.NODE_ENV !== 'production'; -var app = express(); +import React from 'react'; +import express from 'express'; +import path from 'path'; +import url from 'url'; +import webpack from 'webpack'; +import webpackMiddleware from 'webpack-dev-middleware'; +import webpackConfigBuilder from '../webpack/webpack.config'; +import Router from 'react-router'; +import routes from './src/Routes'; + +const development = process.env.NODE_ENV !== 'production'; +let app = express(); if (development) { - var React = require('react'); - var path = require('path'); - var url = require('url'); - var browserify = require('connect-browserify'); - var nodejsx = require('node-jsx').install(); + let webpackConfig = webpackConfigBuilder({ + development: development, + docs: true + }); + let publicPath = webpackConfig.output.publicPath; - var routes = require('./src/Routes'); - var Router = require('react-router'); + webpackConfig.output.path = '/'; + webpackConfig.output.publicPath = undefined; app = app - .get('/assets/bundle.js', browserify('./client', {debug: true, watch: false})) - .use('/assets', express.static(path.join(__dirname, 'assets'))) - .use('/vendor', express.static(path.join(__dirname, 'vendor'))) + .use(webpackMiddleware(webpack(webpackConfig), { + noInfo: false, + publicPath: publicPath, + stats: { + colors: true + } + })) .use(function renderApp(req, res) { - var fileName = url.parse(req.url).pathname; - - Router.run(routes, req.url, function (Handler) { - var RootHTML = React.renderToString(React.createElement(Handler)); - - res.send(RootHTML); - }) - - + Router.run(routes, req.url, Handler => { + let html = React.renderToString(); + res.send(html); + }); }); } else { app = app - .use(express.static(__dirname)); + .use(express.static(path.join(__dirname, '../docs-built'))); } app .listen(4000, function () { console.log('Server started at http://localhost:4000'); - }); \ No newline at end of file + }); diff --git a/docs/src/CodeMirror.client.js b/docs/src/CodeMirror.client.js new file mode 100644 index 0000000000..aa52214e94 --- /dev/null +++ b/docs/src/CodeMirror.client.js @@ -0,0 +1,12 @@ +import CodeMirror from 'codemirror'; +import from 'codemirror/mode/javascript/javascript'; + +import from 'codemirror/theme/solarized.css'; +import from 'codemirror/lib/codemirror.css'; +//import from '../vendor/codemirror/syntax.css'; +import from './CodeMirror.css'; + +export default { + IS_NODE: false, + CodeMirror +} diff --git a/docs/src/CodeMirror.css b/docs/src/CodeMirror.css new file mode 100644 index 0000000000..04bfdce4d5 --- /dev/null +++ b/docs/src/CodeMirror.css @@ -0,0 +1,15 @@ +.cm-s-solarized.CodeMirror { + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +.highlight, .code-toggle.open { + background-color: #fdf6e3; +} + +.cm-s-solarized .cm-comment { color: #93a1a1; } + +.CodeMirror, .CodeMirror-scroll { + height: auto; +} diff --git a/docs/src/CodeMirror.js b/docs/src/CodeMirror.js new file mode 100644 index 0000000000..a318163149 --- /dev/null +++ b/docs/src/CodeMirror.js @@ -0,0 +1,4 @@ +export default { + IS_NODE: true, + CodeMirror: {} +} diff --git a/docs/src/ComponentsPage.js b/docs/src/ComponentsPage.js index 315f8a8019..ed47b8ad17 100644 --- a/docs/src/ComponentsPage.js +++ b/docs/src/ComponentsPage.js @@ -1,27 +1,27 @@ -'use strict'; +/* eslint no-path-concat: 0 */ -var React = require('react'); -var fs = require('fs'); +import React from 'react'; -var Affix = require('../../lib/Affix'); -var Nav = require('../../lib/Nav'); -var SubNav = require('../../lib/SubNav'); -var NavItem = require('../../lib/NavItem'); +import Affix from '../../src/Affix'; +import Nav from '../../src/Nav'; +import SubNav from '../../src/SubNav'; +import NavItem from '../../src/NavItem'; -var NavMain = require('./NavMain'); -var PageHeader = require('./PageHeader'); -var PageFooter = require('./PageFooter'); -var ReactPlayground = require('./ReactPlayground'); +import NavMain from './NavMain'; +import PageHeader from './PageHeader'; +import PageFooter from './PageFooter'; +import ReactPlayground from './ReactPlayground'; +import Samples from './Samples'; -var ComponentsPage = React.createClass({ - getInitialState: function () { +const ComponentsPage = React.createClass({ + getInitialState() { return { activeNavItemHref: null, navOffsetTop: null }; }, - handleNavItemSelect: function (key, href) { + handleNavItemSelect(key, href) { this.setState({ activeNavItemHref: href }); @@ -29,8 +29,8 @@ var ComponentsPage = React.createClass({ window.location = href; }, - componentDidMount: function () { - var elem = this.refs.sideNav.getDOMNode(), + componentDidMount() { + let elem = this.refs.sideNav.getDOMNode(), domUtils = Affix.domUtils, sideNavOffsetTop = domUtils.getOffset(elem).top, sideNavMarginTop = parseInt(domUtils.getComputedStyles(elem.firstChild).marginTop, 10), @@ -42,321 +42,321 @@ var ComponentsPage = React.createClass({ }); }, - render: function () { + render() { return (
- + + title='Components' + subTitle='' /> -
-
-
+
+
+
{/* Buttons */} -
-

Buttons Button

-

Options

+
+

Buttons Button

+

Options

Use any of the available button style types to quickly create a styled button. Just modify the bsStyle prop.

- -
+ +

Button spacing

Because React doesn't output newlines between elements, buttons on the same line are displayed flush against each other. To preserve the spacing between multiple inline buttons, wrap your button group in {''}.

-

Sizes

-

Fancy larger or smaller buttons? Add bsSize="large", bsSize="small", or bsSize="xsmall" for additional sizes.

- +

Sizes

+

Fancy larger or smaller buttons? Add bsSize='large', bsSize='small', or bsSize='xsmall' for additional sizes.

+

Create block level buttons—those that span the full width of a parent— by adding the block prop.

- + -

Active state

+

Active state

To set a buttons active state simply set the components active prop.

- + -

Disabled state

+

Disabled state

Make buttons look unclickable by fading them back 50%. To do this add the disabled attribute to buttons.

- + -
+

Event handler functionality not impacted

This prop will only change the {'

-

Button tags

+

Button tags

The DOM element tag is choosen automaticly for you based on the props you supply. Passing a href will result in the button using a {''} element otherwise a {'

{/* Button Groups */} -
-

Button groups ButtonGroup, ButtonToolbar

-

Group a series of buttons together on a single line with the button group.

+
+

Button groups ButtonGroup, ButtonToolbar

+

Group a series of buttons together on a single line with the button group.

-

Basic example

+

Basic example

Wrap a series of {'