├── .prettierignore
├── .eslintignore
├── .babelrc
├── example
└── src
│ ├── images
│ ├── Sofia Acey.jpg
│ ├── Joseph Barish.jpg
│ └── Sarah Benson.jpg
│ ├── .gitignore
│ ├── Home.js
│ ├── images.js
│ ├── example.js
│ ├── sections
│ ├── Section.js
│ ├── Example.js
│ ├── Modals.js
│ ├── Navigation.js
│ ├── Grid.js
│ ├── Highlight.js
│ ├── ChartCard.js
│ ├── Submenus.js
│ ├── Cards.js
│ ├── SlidingSidebar.js
│ ├── FooterBar.js
│ ├── Navbar.js
│ ├── MediaCard.js
│ ├── Lists.js
│ ├── TableCard.js
│ ├── BaseCard.js
│ ├── RichTextCard.js
│ ├── SummaryCard.js
│ ├── ListSearch.js
│ ├── FileCard.js
│ ├── ListDetail.js
│ ├── FormCard.js
│ └── DoubleNavbar.js
│ ├── index.html
│ ├── About.js
│ ├── App.js
│ ├── example.less
│ └── Documentation.js
├── .editorconfig
├── src
├── CardBody.js
├── index.js
├── List.js
├── Cards.js
├── CardTitle.js
├── CardFooter.js
├── CardHeader.js
├── SummaryItem.js
├── ChartCanvas.js
├── ListGroupItemText.js
├── Container.js
├── ListGroupItemHeader.js
└── Card.js
├── .gitignore
├── bower.json
├── package-scripts.js
├── .eslintrc.js
├── README.md
├── rollup.config.js
├── webpack.config.js
├── lib
├── index.js
├── CardBody.js
├── List.js
├── Cards.js
├── Card.js
├── CardTitle.js
├── Container.js
├── CardFooter.js
├── CardHeader.js
├── SummaryItem.js
├── ChartCanvas.js
├── ListGroupItemText.js
└── ListGroupItemHeader.js
├── package.json
└── dist
├── react-bootcards.min.js
├── react-bootcards.es.js
└── react-bootcards.js
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist/
2 | example/dist/
3 | lib/
4 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | lib/*
2 | dist/*
3 | coverage/*
4 | example/dist/*
5 | node_modules/*
6 | bower_components/*
7 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "ignore": ["node-modules/**", "src/index.umd.js"],
3 | "presets": [ "env", "stage-0", "react"]
4 | }
5 |
--------------------------------------------------------------------------------
/example/src/images/Sofia Acey.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kobanyan/react-bootcards/HEAD/example/src/images/Sofia Acey.jpg
--------------------------------------------------------------------------------
/example/src/images/Joseph Barish.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kobanyan/react-bootcards/HEAD/example/src/images/Joseph Barish.jpg
--------------------------------------------------------------------------------
/example/src/images/Sarah Benson.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kobanyan/react-bootcards/HEAD/example/src/images/Sarah Benson.jpg
--------------------------------------------------------------------------------
/example/src/.gitignore:
--------------------------------------------------------------------------------
1 | ## This file is here to ensure it is included in the gh-pages branch,
2 | ## when `gulp deploy` is used to push updates to the demo site.
3 |
4 | # Dependency directory
5 | node_modules
6 |
7 | #
8 | example
9 |
--------------------------------------------------------------------------------
/example/src/Home.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | class Home extends React.Component {
4 | constructor(props) {
5 | super(props);
6 | }
7 |
8 | render() {
9 | return
Home
;
10 | }
11 | }
12 |
13 | export default Home;
14 |
--------------------------------------------------------------------------------
/example/src/images.js:
--------------------------------------------------------------------------------
1 | import sofia from './images/Sofia Acey.jpg';
2 | import joseph from './images/Joseph Barish.jpg';
3 | import sarah from './images/Sarah Benson.jpg';
4 |
5 | const images = {
6 | sofia,
7 | joseph,
8 | sarah
9 | };
10 |
11 | export default images;
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs
2 | # editorconfig.org
3 | root = true
4 |
5 | [*]
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = false
9 | insert_final_newline = true
10 | indent_style = space
11 | indent_size = 2
12 |
13 | [*.json]
14 | indent_style = space
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/example/src/example.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { BrowserRouter as Router } from 'react-router-dom';
4 |
5 | import App from './App';
6 |
7 | import 'highlight.js/styles/github.css';
8 | import './example.less';
9 |
10 | ReactDOM.render(
11 |
12 |
13 | ,
14 | document.getElementById('root')
15 | );
16 |
--------------------------------------------------------------------------------
/src/CardBody.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Panel } from 'react-bootstrap';
4 |
5 | class CardBody extends React.Component {
6 | render() {
7 | return {this.props.children} ;
8 | }
9 | }
10 |
11 | CardBody.propTypes = {
12 | children: PropTypes.node
13 | };
14 |
15 | export default CardBody;
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Coverage tools
11 | lib-cov
12 | coverage
13 | coverage.html
14 | .cover*
15 |
16 | # Dependency directory
17 | node_modules
18 |
19 | # Example build directory
20 | example/dist
21 | .publish
22 |
23 | # Editor and other tmp files
24 | *.swp
25 | *.un~
26 | *.iml
27 | *.ipr
28 | *.iws
29 | *.sublime-*
30 | .idea/
31 | *.DS_Store
32 |
--------------------------------------------------------------------------------
/example/src/sections/Section.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class Section extends React.Component {
6 | render() {
7 | return (
8 |
12 | {this.props.children}
13 |
14 | );
15 | }
16 | }
17 |
18 | Section.propTypes = {
19 | children: PropTypes.node,
20 | className: PropTypes.string
21 | };
22 |
23 | export default Section;
24 |
--------------------------------------------------------------------------------
/example/src/sections/Example.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class Example extends React.Component {
6 | render() {
7 | const classes = {
8 | 'bs-example': true,
9 | 'bs-example-type': true
10 | };
11 | return (
12 |
16 | {this.props.children}
17 |
18 | );
19 | }
20 | }
21 |
22 | Example.propTypes = {
23 | children: PropTypes.node,
24 | className: PropTypes.string
25 | };
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-bootcards",
3 | "version": "0.2.0",
4 | "description": "react-bootcards",
5 | "main": "dist/react-bootcards.min.js",
6 | "homepage": "https://github.com/kobanyan/react-bootcards",
7 | "authors": [
8 | "kobanyan"
9 | ],
10 | "moduleType": [
11 | "amd",
12 | "globals",
13 | "node"
14 | ],
15 | "keywords": [
16 | "react",
17 | "react-component",
18 | "bootstrap",
19 | "bootcards"
20 | ],
21 | "license": "MIT",
22 | "ignore": [
23 | ".editorconfig",
24 | ".gitignore",
25 | "package.json",
26 | "src",
27 | "node_modules",
28 | "example",
29 | "test"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import Container from './Container';
2 | import Cards from './Cards';
3 | import List from './List';
4 | import ListGroupItemHeader from './ListGroupItemHeader';
5 | import ListGroupItemText from './ListGroupItemText';
6 | import Card from './Card';
7 | import CardHeader from './CardHeader';
8 | import CardTitle from './CardTitle';
9 | import CardFooter from './CardFooter';
10 | import CardBody from './CardBody';
11 | import SummaryItem from './SummaryItem';
12 | import ChartCanvas from './ChartCanvas';
13 |
14 | export {
15 | Container,
16 | Cards,
17 | List,
18 | ListGroupItemHeader,
19 | ListGroupItemText,
20 | Card,
21 | CardHeader,
22 | CardTitle,
23 | CardFooter,
24 | CardBody,
25 | SummaryItem,
26 | ChartCanvas
27 | };
28 |
--------------------------------------------------------------------------------
/src/List.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 | import { Col } from 'react-bootstrap';
5 |
6 | class List extends React.Component {
7 | constructor(props) {
8 | super(props);
9 | }
10 |
11 | render() {
12 | const { listClassName, className, ...props } = this.props;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | List.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | listClassName: PropTypes.string
25 | };
26 |
27 | List.defaultProps = {
28 | listClassName: 'bootcards-list'
29 | };
30 |
31 | export default List;
32 |
--------------------------------------------------------------------------------
/src/Cards.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 | import { Col } from 'react-bootstrap';
5 |
6 | class Cards extends React.Component {
7 | constructor(props) {
8 | super(props);
9 | }
10 |
11 | render() {
12 | const { cardsClassName, className, ...props } = this.props;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | Cards.propTypes = {
22 | cardsClassName: PropTypes.string,
23 | children: PropTypes.node,
24 | className: PropTypes.string
25 | };
26 |
27 | Cards.defaultProps = {
28 | cardsClassName: 'bootcards-cards'
29 | };
30 |
31 | export default Cards;
32 |
--------------------------------------------------------------------------------
/package-scripts.js:
--------------------------------------------------------------------------------
1 | const npsUtils = require('nps-utils');
2 | const series = npsUtils.series;
3 | const rimraf = npsUtils.rimraf;
4 | const concurrent = npsUtils.concurrent;
5 |
6 | module.exports = {
7 | scripts: {
8 | build: {
9 | description: 'clean dist directory and run all builds',
10 | default: series(
11 | rimraf('dist'),
12 | rimraf('lib'),
13 | concurrent.nps('build.rollup', 'build.babel')
14 | ),
15 | rollup: 'rollup --config',
16 | babel: 'babel src -d lib'
17 | },
18 | publish: {
19 | default: series(
20 | rimraf('example/dist'),
21 | 'webpack --progress -p',
22 | 'cp example/src/.gitignore example/dist/.gitignore',
23 | 'gh-pages -d example/dist'
24 | )
25 | }
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/src/CardTitle.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class CardTitle extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, titleClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | CardTitle.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | titleClassName: PropTypes.string
26 | };
27 |
28 | CardTitle.defaultProps = {
29 | componentClass: 'h3',
30 | titleClassName: 'panel-title'
31 | };
32 |
33 | export default CardTitle;
34 |
--------------------------------------------------------------------------------
/src/CardFooter.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class CardFooter extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, footerClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | CardFooter.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | footerClassName: PropTypes.string
26 | };
27 |
28 | CardFooter.defaultProps = {
29 | componentClass: 'div',
30 | footerClassName: 'panel-footer'
31 | };
32 |
33 | export default CardFooter;
34 |
--------------------------------------------------------------------------------
/src/CardHeader.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class CardHeader extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, headerClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | CardHeader.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | headerClassName: PropTypes.string
26 | };
27 |
28 | CardHeader.defaultProps = {
29 | componentClass: 'div',
30 | headerClassName: 'panel-heading'
31 | };
32 |
33 | export default CardHeader;
34 |
--------------------------------------------------------------------------------
/example/src/sections/Modals.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Alert } from 'react-bootstrap';
3 |
4 | import Section from './Section';
5 |
6 | class Modals extends React.Component {
7 | render() {
8 | return (
9 |
10 | Modals
11 |
12 | Sometimes, you'll want to put something like a form or an important
13 | message in a modal, obscuring the other content completely.
14 |
15 |
16 | The markup is quite similar to Cards, with a header, body, and footer.
17 |
18 |
19 | Remember to wrap buttons in the header of your modals in <div
20 | className="btn-group"> or your buttons might not work.
21 |
22 |
23 | );
24 | }
25 | }
26 |
27 | export default Modals;
28 |
--------------------------------------------------------------------------------
/src/SummaryItem.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class SummaryItem extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, itemClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | SummaryItem.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | itemClassName: PropTypes.string
26 | };
27 |
28 | SummaryItem.defaultProps = {
29 | componentClass: 'a',
30 | itemClassName: 'bootcards-summary-item'
31 | };
32 |
33 | export default SummaryItem;
34 |
--------------------------------------------------------------------------------
/example/src/sections/Navigation.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 |
5 | class Navigation extends React.Component {
6 | render() {
7 | return (
8 |
9 | Navigation
10 |
11 | Bootcards offers 3 navigation methods: the Navbar, Footer Bar, or
12 | Sliding Sidebar.
13 |
14 |
15 | What you use will depend on the needs of your app, and the number of
16 | top-level navigation items. Apps with fewer items would suit using
17 | footer navigation on mobile, as they're always accessible, but footer
18 | navigation may be impractical for apps with many top level navigation
19 | items as it can only fit 4 on phones.
20 |
21 |
22 | );
23 | }
24 | }
25 |
26 | export default Navigation;
27 |
--------------------------------------------------------------------------------
/src/ChartCanvas.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class ChartCanvas extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, canvasClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | ChartCanvas.propTypes = {
22 | canvasClassName: PropTypes.string,
23 | children: PropTypes.node,
24 | className: PropTypes.string,
25 | componentClass: PropTypes.string
26 | };
27 |
28 | ChartCanvas.defaultProps = {
29 | componentClass: 'div',
30 | canvasClassName: 'bootcards-chart-canvas'
31 | };
32 |
33 | export default ChartCanvas;
34 |
--------------------------------------------------------------------------------
/example/src/sections/Grid.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 |
5 | class Grid extends React.Component {
6 | render() {
7 | return (
8 |
9 | Grid System
10 |
11 | Bootcards builds on Twitter Bootstrap's grid system to allow separate
12 | column scrolling in touchscreen devices.
13 |
14 |
15 | The 2 main top-level columns are .bootcards-list (which
16 | is used to navigate your app) and .bootcards-cards (which
17 | contains your app's content). In desktop browsers, these will behave
18 | like regular bootstrap columns, but on touchscreen devices the user
19 | will be able to scroll them separately.
20 |
21 |
22 | );
23 | }
24 | }
25 |
26 | export default Grid;
27 |
--------------------------------------------------------------------------------
/src/ListGroupItemText.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class ListGroupItemText extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, textClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | ListGroupItemText.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | textClassName: PropTypes.string
26 | };
27 |
28 | ListGroupItemText.defaultProps = {
29 | componentClass: 'p',
30 | textClassName: 'list-group-item-text'
31 | };
32 |
33 | export default ListGroupItemText;
34 |
--------------------------------------------------------------------------------
/src/Container.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class Container extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const {
12 | componentClass,
13 | headingClassName,
14 | className,
15 | ...props
16 | } = this.props;
17 | const Component = componentClass;
18 | return (
19 |
20 | {this.props.children}
21 |
22 | );
23 | }
24 | }
25 |
26 | Container.propTypes = {
27 | children: PropTypes.node,
28 | className: PropTypes.string,
29 | componentClass: PropTypes.string,
30 | headingClassName: PropTypes.string
31 | };
32 |
33 | Container.defaultProps = {
34 | componentClass: 'div',
35 | headingClassName: 'container'
36 | };
37 |
38 | export default Container;
39 |
--------------------------------------------------------------------------------
/src/ListGroupItemHeader.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 |
5 | class ListGroupItemHeader extends React.Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | const { componentClass, headerClassName, className, ...props } = this.props;
12 | const Component = componentClass;
13 | return (
14 |
15 | {this.props.children}
16 |
17 | );
18 | }
19 | }
20 |
21 | ListGroupItemHeader.propTypes = {
22 | children: PropTypes.node,
23 | className: PropTypes.string,
24 | componentClass: PropTypes.string,
25 | headerClassName: PropTypes.string
26 | };
27 |
28 | ListGroupItemHeader.defaultProps = {
29 | componentClass: 'h4',
30 | headerClassName: 'list-group-item-heading'
31 | };
32 |
33 | export default ListGroupItemHeader;
34 |
--------------------------------------------------------------------------------
/src/Card.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 | import { Panel } from 'react-bootstrap';
5 |
6 | class Card extends React.Component {
7 | constructor(props) {
8 | super(props);
9 | }
10 |
11 | render() {
12 | const { cardStyle, ...props } = this.props;
13 | const cardClassName =
14 | cardStyle === 'default' ? null : `bootcards-${cardStyle}`;
15 | return (
16 |
17 | {this.props.children}
18 |
19 | );
20 | }
21 | }
22 |
23 | Card.propTypes = {
24 | cardStyle: PropTypes.oneOf([
25 | 'default',
26 | 'chart',
27 | 'summary',
28 | 'media',
29 | 'file',
30 | 'richtext'
31 | ]),
32 | children: PropTypes.node,
33 | className: PropTypes.string
34 | };
35 |
36 | Card.defaultProps = {
37 | cardStyle: 'default'
38 | };
39 |
40 | export default Card;
41 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parserOptions: {
3 | ecmaVersion: 6,
4 | sourceType: 'module',
5 | ecmaFeatures: {
6 | experimentalObjectRestSpread: true,
7 | jsx: true
8 | }
9 | },
10 | env: {
11 | browser: true,
12 | es6: true,
13 | node: true
14 | },
15 | plugins: ['react'],
16 | rules: {
17 | curly: [2, 'multi-line'],
18 | 'jsx-quotes': 1,
19 | 'no-shadow': 0,
20 | 'no-trailing-spaces': 0,
21 | 'no-underscore-dangle': 0,
22 | 'no-unused-expressions': 0,
23 | 'object-curly-spacing': [1, 'always'],
24 | quotes: [2, 'single', 'avoid-escape'],
25 | 'react/jsx-boolean-value': 1,
26 | 'react/jsx-no-undef': 1,
27 | 'react/jsx-uses-react': 1,
28 | 'react/jsx-uses-vars': 1,
29 | 'react/jsx-wrap-multilines': 1,
30 | 'react/no-did-mount-set-state': 1,
31 | 'react/no-did-update-set-state': 1,
32 | 'react/no-unknown-property': 1,
33 | 'react/prop-types': 1,
34 | 'react/react-in-jsx-scope': 1,
35 | 'react/self-closing-comp': 1,
36 | 'react/sort-comp': 1,
37 | 'react/sort-prop-types': 1,
38 | semi: 2,
39 | strict: 0
40 | }
41 | };
42 |
--------------------------------------------------------------------------------
/example/src/sections/Highlight.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom';
4 | import classNames from 'classnames';
5 | import hljs from 'highlight.js';
6 |
7 | class Highlight extends React.Component {
8 | componentDidMount() {
9 | this.highlightCode();
10 | }
11 |
12 | componentDidUpdate() {
13 | this.highlightCode();
14 | }
15 |
16 | highlightCode() {
17 | let domNode = ReactDOM.findDOMNode(this);
18 | let nodes = domNode.querySelectorAll('pre code');
19 | if (nodes.length > 0) {
20 | for (let i = 0; i < nodes.length; i++) {
21 | hljs.highlightBlock(nodes[i]);
22 | }
23 | }
24 | }
25 |
26 | render() {
27 | const { className, highlightClassName, ...props } = this.props;
28 | return (
29 |
30 |
31 | {this.props.children}
32 |
33 |
34 | );
35 | }
36 | }
37 |
38 | Highlight.propTypes = {
39 | children: PropTypes.node,
40 | className: PropTypes.string,
41 | highlightClassName: PropTypes.string
42 | };
43 |
44 | Highlight.defaultProps = {
45 | highlightClassName: 'xml'
46 | };
47 |
48 | export default Highlight;
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-bootcards
2 |
3 | [Bootcards](http://bootcards.org/) components built with [React](http://facebook.github.io/react/)
4 |
5 | [](https://badge.fury.io/js/react-bootcards)
6 | [](https://david-dm.org/kobanyan/react-bootcards)
7 | [](https://david-dm.org/kobanyan/react-bootcards#info=devDependencies)
8 | [](https://david-dm.org/kobanyan/react-bootcards#info=peerDependencies)
9 |
10 | ## Demo & Examples
11 |
12 | Live demo: [kobanyan.github.io/react-bootcards](http://kobanyan.github.io/react-bootcards/)
13 |
14 | To build the examples locally, run:
15 |
16 | ```
17 | yarn install
18 | yarn start
19 | ```
20 |
21 | Then open [`localhost:8000`](http://localhost:8000) in a browser.
22 |
23 |
24 | ## Installation
25 |
26 | The easiest way to use react-bootcards is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), etc).
27 |
28 | You can also use the standalone build by including `dist/react-bootcards.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable.
29 |
30 | ```
31 | npm install react-bootcards --save
32 | ```
33 |
34 | or
35 |
36 | ```
37 | yarn add react-bootcards
38 | ```
39 |
40 |
41 | ## License
42 |
43 | MIT License
44 |
--------------------------------------------------------------------------------
/example/src/sections/ChartCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | Card,
4 | CardHeader,
5 | CardTitle,
6 | ChartCanvas,
7 | CardFooter
8 | } from 'react-bootcards';
9 |
10 | import Section from './Section';
11 | import Example from './Example';
12 |
13 | class ChartCard extends React.Component {
14 | componentDidMount() {
15 | Morris.Bar({
16 | element: 'barChart',
17 | data: [
18 | { person: 'Guy Bardsley', sales: 550 },
19 | { person: 'Adam Callahan', sales: 1500 },
20 | { person: 'Arlo Geist', sales: 3750 },
21 | { person: 'Sheila Hutchins', sales: 3500 }
22 | ],
23 | xkey: 'person',
24 | ykeys: ['sales'],
25 | labels: ['Sales'],
26 | hideHover: 'auto',
27 | resize: true
28 | });
29 | }
30 |
31 | render() {
32 | return (
33 |
34 | Chart Cards
35 | Chart cards contain charts powered by Morris.js.
36 |
37 | These can be used with Table cards in order to toggle between a chart
38 | view and the raw data.
39 |
40 |
41 |
42 |
43 | Chart Card Heading
44 |
45 |
46 |
47 | Built with Bootcards - Base Card
48 |
49 |
50 |
51 |
52 | );
53 | }
54 | }
55 |
56 | export default ChartCard;
57 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import babel from 'rollup-plugin-babel';
2 | import resolve from 'rollup-plugin-node-resolve';
3 | import uglify from 'rollup-plugin-uglify';
4 | import { minify } from 'uglify-es';
5 |
6 | const name = 'react-bootcards';
7 | const path = 'dist/react-bootcards';
8 | const globals = {
9 | classnames: 'classNames',
10 | 'prop-types': 'PropTypes',
11 | 'react-dom': 'ReactDOM',
12 | 'react-bootstrap': 'ReactBootstrap',
13 | react: 'React'
14 | };
15 | const external = Object.keys(globals);
16 | const babelOptions = production => {
17 | let result = {
18 | babelrc: false,
19 | presets: [['env', { modules: false }], 'stage-0', 'react'],
20 | plugins: ['external-helpers']
21 | };
22 | if (production) {
23 | result.plugins.push('transform-react-remove-prop-types');
24 | }
25 | return result;
26 | };
27 |
28 | export default [
29 | {
30 | input: 'src/index.js',
31 | output: {
32 | file: path + '.es.js',
33 | format: 'es'
34 | },
35 | external: external,
36 | plugins: [babel(babelOptions(false))]
37 | },
38 | {
39 | input: 'src/index.js',
40 | output: {
41 | name: name,
42 | file: path + '.js',
43 | format: 'umd'
44 | },
45 | globals: globals,
46 | external: external,
47 | plugins: [babel(babelOptions(false)), resolve()]
48 | },
49 | {
50 | input: 'src/index.js',
51 | output: {
52 | name: name,
53 | file: path + '.min.js',
54 | format: 'umd'
55 | },
56 | globals: globals,
57 | external: external,
58 | plugins: [babel(babelOptions(true)), resolve(), uglify({}, minify)]
59 | }
60 | ];
61 |
--------------------------------------------------------------------------------
/example/src/sections/Submenus.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 | import Highlight from './Highlight';
5 |
6 | class Submenus extends React.Component {
7 | render() {
8 | return (
9 |
34 | );
35 | }
36 | }
37 |
38 | export default Submenus;
39 |
--------------------------------------------------------------------------------
/example/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Bootcards documentation
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/example/src/About.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Row, Well } from 'react-bootstrap';
3 |
4 | class About extends React.Component {
5 | constructor(props) {
6 | super(props);
7 | }
8 |
9 | render() {
10 | return (
11 |
12 |
13 |
14 | Bootcards is an open source project created by{' '}
15 |
16 | @markleusink
17 | ,{' '}
18 |
19 | @sives
20 | {' '}
21 | and{' '}
22 |
23 | @jackherbert
24 | {' '}
25 | and sponsored by{' '}
26 |
27 | Teamstudio
28 | .
29 |
30 |
31 | It was originally released on Monday April 14th 2014. It was created
32 | to meet Teamstudio's need for a modular user interface framework
33 | that could be used to build enterprise mobile apps very quickly. By
34 | building on top of Bootstrap, Bootcards takes advantage of
35 | Bootstrap's great capabilities, whilst adding support for the{' '}
36 |
40 | Cards design pattern
41 | .
42 |
43 |
44 |
45 | );
46 | }
47 | }
48 |
49 | export default About;
50 |
--------------------------------------------------------------------------------
/example/src/sections/Cards.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Panel, Button } from 'react-bootstrap';
3 | import { CardHeader, CardTitle, CardBody, CardFooter } from 'react-bootcards';
4 |
5 | import Section from './Section';
6 | import Example from './Example';
7 |
8 | class Cards extends React.Component {
9 | render() {
10 | return (
11 |
12 | Cards
13 |
14 | Cards are the core of Bootcards, and contain your app's content.
15 | Different Cards are available for different types of content (text,
16 | tables, forms, charts, media, files, etc).
17 |
18 |
19 | Cards are based on the same markup as Bootstrap's .panel.
20 | Each card can have a .panel-heading,{' '}
21 | .panel-body and a .panel-footer. All of
22 | these are optional, so just use whichever parts your app needs. You
23 | can even use multiple headers or footers (e.g. if you needed separate
24 | footer areas separated by a divider).
25 |
26 |
27 |
28 |
29 | Card Title
30 |
31 |
32 | Button
33 |
34 |
35 |
36 | Card content...
37 |
38 |
39 | Card footer...
40 |
41 |
42 |
43 |
44 | );
45 | }
46 | }
47 |
48 | export default Cards;
49 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 | const path = require('path');
3 | const HtmlWebpackPlugin = require('html-webpack-plugin');
4 | const ExtractTextPlugin = require('extract-text-webpack-plugin');
5 |
6 | module.exports = {
7 | context: path.resolve(__dirname, 'example/src'),
8 | entry: {
9 | example: './example.js'
10 | },
11 | output: {
12 | path: path.resolve(__dirname, 'example/dist'),
13 | filename: '[name].js',
14 | publicPath: '/'
15 | },
16 | devServer: {
17 | contentBase: path.resolve(__dirname, 'example/src'),
18 | port: 8000
19 | },
20 | module: {
21 | rules: [
22 | {
23 | test: /\.js$/,
24 | exclude: [/node_modules/],
25 | use: [
26 | {
27 | loader: 'babel-loader',
28 | options: { presets: ['env'] }
29 | }
30 | ]
31 | },
32 | {
33 | test: /\.(less|css)$/,
34 | use: ExtractTextPlugin.extract({
35 | fallback: 'style-loader',
36 | use: ['css-loader', 'less-loader']
37 | })
38 | },
39 | {
40 | test: /\.jpg$/,
41 | use: [
42 | {
43 | loader: 'url-loader'
44 | }
45 | ]
46 | },
47 | {
48 | test: /\.html$/,
49 | use: [
50 | {
51 | loader: 'html-loader'
52 | }
53 | ]
54 | }
55 | ]
56 | },
57 | resolve: {
58 | alias: {
59 | 'react-bootcards': path.resolve(__dirname, 'src/index')
60 | }
61 | },
62 | plugins: [
63 | new webpack.optimize.CommonsChunkPlugin({
64 | name: 'common',
65 | filename: 'common.js',
66 | minChunk: 2
67 | }),
68 | new HtmlWebpackPlugin({
69 | filename: 'index.html',
70 | inject: false,
71 | template: path.resolve(__dirname, 'example/src/index.html')
72 | }),
73 | new ExtractTextPlugin('example.css')
74 | ]
75 | };
76 |
--------------------------------------------------------------------------------
/example/src/sections/SlidingSidebar.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 | import Highlight from './Highlight';
5 |
6 | class SlidingSidebar extends React.Component {
7 | render() {
8 | return (
9 |
43 | );
44 | }
45 | }
46 |
47 | export default SlidingSidebar;
48 |
--------------------------------------------------------------------------------
/example/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Link, Route } from 'react-router-dom';
3 | import { Navbar, Nav, NavItem } from 'react-bootstrap';
4 | import { LinkContainer } from 'react-router-bootstrap';
5 | import { Container } from 'react-bootcards';
6 | import Home from './Home';
7 | import Documentation from './Documentation';
8 | import About from './About';
9 |
10 | class App extends React.Component {
11 | render() {
12 | return (
13 |
14 |
15 |
16 |
17 |
18 | Bootcards
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | Home
27 |
28 |
29 |
30 |
31 |
32 |
33 | Documentation
34 |
35 |
36 |
37 |
38 |
39 |
40 | About
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
55 |
56 | );
57 | }
58 | }
59 |
60 | export default App;
61 |
--------------------------------------------------------------------------------
/example/src/sections/FooterBar.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 | import Highlight from './Highlight';
5 |
6 | class FooterBar extends React.Component {
7 | render() {
8 | return (
9 |
37 | );
38 | }
39 | }
40 |
41 | export default FooterBar;
42 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.ChartCanvas = exports.SummaryItem = exports.CardBody = exports.CardFooter = exports.CardTitle = exports.CardHeader = exports.Card = exports.ListGroupItemText = exports.ListGroupItemHeader = exports.List = exports.Cards = exports.Container = undefined;
7 |
8 | var _Container = require('./Container');
9 |
10 | var _Container2 = _interopRequireDefault(_Container);
11 |
12 | var _Cards = require('./Cards');
13 |
14 | var _Cards2 = _interopRequireDefault(_Cards);
15 |
16 | var _List = require('./List');
17 |
18 | var _List2 = _interopRequireDefault(_List);
19 |
20 | var _ListGroupItemHeader = require('./ListGroupItemHeader');
21 |
22 | var _ListGroupItemHeader2 = _interopRequireDefault(_ListGroupItemHeader);
23 |
24 | var _ListGroupItemText = require('./ListGroupItemText');
25 |
26 | var _ListGroupItemText2 = _interopRequireDefault(_ListGroupItemText);
27 |
28 | var _Card = require('./Card');
29 |
30 | var _Card2 = _interopRequireDefault(_Card);
31 |
32 | var _CardHeader = require('./CardHeader');
33 |
34 | var _CardHeader2 = _interopRequireDefault(_CardHeader);
35 |
36 | var _CardTitle = require('./CardTitle');
37 |
38 | var _CardTitle2 = _interopRequireDefault(_CardTitle);
39 |
40 | var _CardFooter = require('./CardFooter');
41 |
42 | var _CardFooter2 = _interopRequireDefault(_CardFooter);
43 |
44 | var _CardBody = require('./CardBody');
45 |
46 | var _CardBody2 = _interopRequireDefault(_CardBody);
47 |
48 | var _SummaryItem = require('./SummaryItem');
49 |
50 | var _SummaryItem2 = _interopRequireDefault(_SummaryItem);
51 |
52 | var _ChartCanvas = require('./ChartCanvas');
53 |
54 | var _ChartCanvas2 = _interopRequireDefault(_ChartCanvas);
55 |
56 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57 |
58 | exports.Container = _Container2.default;
59 | exports.Cards = _Cards2.default;
60 | exports.List = _List2.default;
61 | exports.ListGroupItemHeader = _ListGroupItemHeader2.default;
62 | exports.ListGroupItemText = _ListGroupItemText2.default;
63 | exports.Card = _Card2.default;
64 | exports.CardHeader = _CardHeader2.default;
65 | exports.CardTitle = _CardTitle2.default;
66 | exports.CardFooter = _CardFooter2.default;
67 | exports.CardBody = _CardBody2.default;
68 | exports.SummaryItem = _SummaryItem2.default;
69 | exports.ChartCanvas = _ChartCanvas2.default;
--------------------------------------------------------------------------------
/lib/CardBody.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8 |
9 | var _propTypes = require('prop-types');
10 |
11 | var _propTypes2 = _interopRequireDefault(_propTypes);
12 |
13 | var _react = require('react');
14 |
15 | var _react2 = _interopRequireDefault(_react);
16 |
17 | var _reactBootstrap = require('react-bootstrap');
18 |
19 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20 |
21 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22 |
23 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24 |
25 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
26 |
27 | var CardBody = function (_React$Component) {
28 | _inherits(CardBody, _React$Component);
29 |
30 | function CardBody() {
31 | _classCallCheck(this, CardBody);
32 |
33 | return _possibleConstructorReturn(this, (CardBody.__proto__ || Object.getPrototypeOf(CardBody)).apply(this, arguments));
34 | }
35 |
36 | _createClass(CardBody, [{
37 | key: 'render',
38 | value: function render() {
39 | return _react2.default.createElement(
40 | _reactBootstrap.Panel.Body,
41 | this.props,
42 | this.props.children
43 | );
44 | }
45 | }]);
46 |
47 | return CardBody;
48 | }(_react2.default.Component);
49 |
50 | CardBody.propTypes = {
51 | children: _propTypes2.default.node
52 | };
53 |
54 | exports.default = CardBody;
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-bootcards",
3 | "version": "0.2.0",
4 | "description": "react-bootcards",
5 | "main": "lib/index.js",
6 | "jsnext:main": "dist/react-bootcards.es.js",
7 | "module": "dist/react-bootcards.es.js",
8 | "author": "kobanyan",
9 | "homepage": "https://github.com/kobanyan/react-bootcards",
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/kobanyan/react-bootcards.git"
13 | },
14 | "bugs": {
15 | "url": "https://github.com/kobanyan/react-bootcards/issues"
16 | },
17 | "dependencies": {
18 | "classnames": "^2.2.6",
19 | "prop-types": "^15.6.2"
20 | },
21 | "devDependencies": {
22 | "babel-cli": "^6.26.0",
23 | "babel-core": "^6.26.0",
24 | "babel-loader": "^7.1.1",
25 | "babel-plugin-external-helpers": "^6.22.0",
26 | "babel-plugin-transform-react-remove-prop-types": "^0.4.8",
27 | "babel-preset-env": "^1.6.1",
28 | "babel-preset-react": "^6.24.1",
29 | "babel-preset-stage-0": "^6.24.1",
30 | "babel-register": "^6.26.0",
31 | "cross-env": "^5.0.5",
32 | "css-loader": "^0.28.7",
33 | "eslint": "^4.6.1",
34 | "eslint-plugin-react": "^7.3.0",
35 | "extract-text-webpack-plugin": "^3.0.0",
36 | "gh-pages": "^1.1.0",
37 | "highlight.js": "^9.12.0",
38 | "html-loader": "^0.5.1",
39 | "html-webpack-plugin": "^2.30.1",
40 | "husky": "^0.14.3",
41 | "less": "^2.7.2",
42 | "less-loader": "^4.0.5",
43 | "less-plugin-clean-css": "^1.5.1",
44 | "lint-staged": "^4.3.0",
45 | "nps": "^5.7.1",
46 | "nps-utils": "^1.3.0",
47 | "prettier": "^1.13.7",
48 | "react": "^16.4.1",
49 | "react-bootstrap": "^0.32.1",
50 | "react-dom": "^16.4.1",
51 | "react-router-bootstrap": "^0.24.4",
52 | "react-router-dom": "^4.3.1",
53 | "rollup": "^0.49.2",
54 | "rollup-plugin-babel": "^3.0.2",
55 | "rollup-plugin-commonjs": "^8.2.0",
56 | "rollup-plugin-node-resolve": "^3.0.0",
57 | "rollup-plugin-uglify": "^2.0.1",
58 | "style-loader": "^0.18.2",
59 | "uglify-es": "^3.0.28",
60 | "url-loader": "^1.0.1",
61 | "webpack": "^3.5.5",
62 | "webpack-dev-server": "^2.7.1"
63 | },
64 | "peerDependencies": {
65 | "react": "^16.0",
66 | "react-dom": "^16.0",
67 | "react-bootstrap": "^0.24"
68 | },
69 | "scripts": {
70 | "build": "nps build",
71 | "lint": "eslint .",
72 | "deploy": "cross-env NODE_ENV=production nps publish",
73 | "start": "webpack-dev-server --progress",
74 | "precommit": "lint-staged"
75 | },
76 | "keywords": [
77 | "react",
78 | "react-component",
79 | "bootstrap",
80 | "bootcards"
81 | ],
82 | "lint-staged": {
83 | "*.js": [
84 | "prettier --single-quote --write",
85 | "eslint"
86 | ]
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/example/src/sections/Navbar.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import Section from './Section';
4 | import Highlight from './Highlight';
5 |
6 | class Navbar extends React.Component {
7 | render() {
8 | return (
9 |
10 | Navbar
11 |
12 | The Bootcards Navbar is the main navigation system for desktop
13 | browsers.
14 |
15 |
16 | On desktop, it uses Bootstrap's default .navbar-fixed-top{' '}
17 | styles and shows all the top level navigation items.
18 |
19 |
20 | On mobile devices, there isn't enough space for these items, so the
21 | Bootstrap Navbar is replaced with a simpler, more native version with
22 | only a Title and limited space for other functions (e.g. a Back button
23 | or Menu button). These buttons are hidden from desktop browsers, which
24 | don't need them.
25 |
26 |
27 |
28 | In addition to the Navbar, you'll also need to implement one of the
29 | other navigation structures below (Footer Bar or Sliding Sidebar) to
30 | allow mobile users to navigate your app.
31 |
32 |
33 |
34 | {
35 | ''
36 | }
37 |
38 |
39 | );
40 | }
41 | }
42 |
43 | export default Navbar;
44 |
--------------------------------------------------------------------------------
/example/src/sections/MediaCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ButtonGroup, Button } from 'react-bootstrap';
3 | import {
4 | Card,
5 | CardHeader,
6 | CardTitle,
7 | CardBody,
8 | CardFooter
9 | } from 'react-bootcards';
10 |
11 | import Section from './Section';
12 | import Highlight from './Highlight';
13 | import Example from './Example';
14 |
15 | class MediaCard extends React.Component {
16 | render() {
17 | return (
18 |
63 | );
64 | }
65 | }
66 |
67 | export default MediaCard;
68 |
--------------------------------------------------------------------------------
/example/src/sections/Lists.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ListGroup, ListGroupItem } from 'react-bootstrap';
3 | import {
4 | List,
5 | Card,
6 | ListGroupItemHeader,
7 | ListGroupItemText
8 | } from 'react-bootcards';
9 |
10 | import Section from './Section';
11 | import Highlight from './Highlight';
12 | import Example from './Example';
13 |
14 | import images from '../images';
15 |
16 | class Lists extends React.Component {
17 | render() {
18 | return (
19 |
57 | );
58 | }
59 | }
60 |
61 | export default Lists;
62 |
--------------------------------------------------------------------------------
/example/src/sections/TableCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Table } from 'react-bootstrap';
3 | import { Card, CardHeader, CardTitle, CardFooter } from 'react-bootcards';
4 |
5 | import Section from './Section';
6 | import Highlight from './Highlight';
7 | import Example from './Example';
8 |
9 | class TableCard extends React.Component {
10 | render() {
11 | return (
12 |
13 | Table Cards
14 | Table Cards display tabular data.
15 |
16 | You can use the same table classes as Bootstrap, e.g. the{' '}
17 | .table-hover and .active classes used in
18 | this example.
19 |
20 |
21 | Wrap wider tables in a{' '}
22 | <div class="table-responsive"> so they'll be able
23 | to scroll horizontally in narrower browsers such as mobiles, and not
24 | be cut off.
25 |
26 |
27 |
28 |
29 | Table Card Title
30 |
31 |
32 |
33 |
34 | Name
35 | Forecast
36 | Quota
37 |
38 |
39 |
40 |
41 | Guy Bardsley
42 | 2750
43 | 4000
44 |
45 |
46 | Adam Callahan
47 | 3300
48 | 4000
49 |
50 |
51 |
52 | Total
53 |
54 |
55 | 6050
56 |
57 |
58 | 8000
59 |
60 |
61 |
62 |
63 |
64 | Built with Bootcards - Table Card
65 |
66 |
67 |
68 |
69 | {
70 | '\n \n Table Card Title \n \n \n \n \n Name \n Forecast \n Quota \n \n \n \n \n Guy Bardsley \n 2750 \n 4000 \n \n \n Adam Callahan \n 3300 \n 4000 \n \n \n \n Total \n \n \n 6050 \n \n \n 8000 \n \n \n \n
\n \n Built with Bootcards - Table Card \n \n \n'
71 | }
72 |
73 |
74 | );
75 | }
76 | }
77 |
78 | export default TableCard;
79 |
--------------------------------------------------------------------------------
/example/src/sections/BaseCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Button, ListGroup, ListGroupItem } from 'react-bootstrap';
3 | import {
4 | Card,
5 | CardHeader,
6 | CardTitle,
7 | CardFooter,
8 | ListGroupItemHeader,
9 | ListGroupItemText
10 | } from 'react-bootcards';
11 |
12 | import Section from './Section';
13 | import Highlight from './Highlight';
14 | import Example from './Example';
15 |
16 | class BaseCard extends React.Component {
17 | render() {
18 | return (
19 |
20 | Base Cards
21 |
22 | Base Cards display a list of information separated by dividers.
23 |
24 |
25 | Replace the default .panel-body with a{' '}
26 | .list-group.
27 |
28 |
29 |
30 |
31 | Base Card Title
32 |
33 |
34 | Edit
35 |
36 |
37 |
38 |
39 | Name
40 | John Smith
41 |
42 |
43 | Occupation
44 | Web Developer
45 |
46 |
47 |
48 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
49 | Nullam mauris tellus, vehicula ut tellus id, suscipit dapibus
50 | tortor. Integer viverra turpis ac fringilla hendrerit. Sed
51 | faucibus posuere felis et pellentesque. Cras varius tortor
52 | vitae molestie tempor. Proin ut viverra elit, ac gravida
53 | tortor.
54 |
55 |
56 |
57 |
58 | Built with Bootcards - Base Card
59 |
60 |
61 |
62 |
63 | {
64 | '\n \n Base Card Title \n \n \n Edit\n \n \n \n \n Name \n John Smith \n \n \n Occupation \n Web Developer \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Nullam mauris tellus, vehicula ut tellus id, suscipit dapibus\n tortor. Integer viverra turpis ac fringilla hendrerit. Sed\n faucibus posuere felis et pellentesque. Cras varius tortor\n vitae molestie tempor. Proin ut viverra elit, ac gravida\n tortor.\n \n \n \n \n Built with Bootcards - Base Card \n \n \n'
65 | }
66 |
67 |
68 | );
69 | }
70 | }
71 |
72 | export default BaseCard;
73 |
--------------------------------------------------------------------------------
/lib/List.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | var _reactBootstrap = require('react-bootstrap');
24 |
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26 |
27 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
28 |
29 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30 |
31 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
32 |
33 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
34 |
35 | var List = function (_React$Component) {
36 | _inherits(List, _React$Component);
37 |
38 | function List(props) {
39 | _classCallCheck(this, List);
40 |
41 | return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, props));
42 | }
43 |
44 | _createClass(List, [{
45 | key: 'render',
46 | value: function render() {
47 | var _props = this.props,
48 | listClassName = _props.listClassName,
49 | className = _props.className,
50 | props = _objectWithoutProperties(_props, ['listClassName', 'className']);
51 |
52 | return _react2.default.createElement(
53 | _reactBootstrap.Col,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, listClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return List;
61 | }(_react2.default.Component);
62 |
63 | List.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | listClassName: _propTypes2.default.string
67 | };
68 |
69 | List.defaultProps = {
70 | listClassName: 'bootcards-list'
71 | };
72 |
73 | exports.default = List;
--------------------------------------------------------------------------------
/lib/Cards.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | var _reactBootstrap = require('react-bootstrap');
24 |
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26 |
27 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
28 |
29 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30 |
31 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
32 |
33 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
34 |
35 | var Cards = function (_React$Component) {
36 | _inherits(Cards, _React$Component);
37 |
38 | function Cards(props) {
39 | _classCallCheck(this, Cards);
40 |
41 | return _possibleConstructorReturn(this, (Cards.__proto__ || Object.getPrototypeOf(Cards)).call(this, props));
42 | }
43 |
44 | _createClass(Cards, [{
45 | key: 'render',
46 | value: function render() {
47 | var _props = this.props,
48 | cardsClassName = _props.cardsClassName,
49 | className = _props.className,
50 | props = _objectWithoutProperties(_props, ['cardsClassName', 'className']);
51 |
52 | return _react2.default.createElement(
53 | _reactBootstrap.Col,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, cardsClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return Cards;
61 | }(_react2.default.Component);
62 |
63 | Cards.propTypes = {
64 | cardsClassName: _propTypes2.default.string,
65 | children: _propTypes2.default.node,
66 | className: _propTypes2.default.string
67 | };
68 |
69 | Cards.defaultProps = {
70 | cardsClassName: 'bootcards-cards'
71 | };
72 |
73 | exports.default = Cards;
--------------------------------------------------------------------------------
/lib/Card.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | var _reactBootstrap = require('react-bootstrap');
24 |
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26 |
27 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
28 |
29 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30 |
31 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
32 |
33 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
34 |
35 | var Card = function (_React$Component) {
36 | _inherits(Card, _React$Component);
37 |
38 | function Card(props) {
39 | _classCallCheck(this, Card);
40 |
41 | return _possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).call(this, props));
42 | }
43 |
44 | _createClass(Card, [{
45 | key: 'render',
46 | value: function render() {
47 | var _props = this.props,
48 | cardStyle = _props.cardStyle,
49 | props = _objectWithoutProperties(_props, ['cardStyle']);
50 |
51 | var cardClassName = cardStyle === 'default' ? null : 'bootcards-' + cardStyle;
52 | return _react2.default.createElement(
53 | _reactBootstrap.Panel,
54 | _extends({}, props, { className: (0, _classnames2.default)(props.className, cardClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return Card;
61 | }(_react2.default.Component);
62 |
63 | Card.propTypes = {
64 | cardStyle: _propTypes2.default.oneOf(['default', 'chart', 'summary', 'media', 'file', 'richtext']),
65 | children: _propTypes2.default.node,
66 | className: _propTypes2.default.string
67 | };
68 |
69 | Card.defaultProps = {
70 | cardStyle: 'default'
71 | };
72 |
73 | exports.default = Card;
--------------------------------------------------------------------------------
/lib/CardTitle.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var CardTitle = function (_React$Component) {
34 | _inherits(CardTitle, _React$Component);
35 |
36 | function CardTitle(props) {
37 | _classCallCheck(this, CardTitle);
38 |
39 | return _possibleConstructorReturn(this, (CardTitle.__proto__ || Object.getPrototypeOf(CardTitle)).call(this, props));
40 | }
41 |
42 | _createClass(CardTitle, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | titleClassName = _props.titleClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'titleClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, titleClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return CardTitle;
61 | }(_react2.default.Component);
62 |
63 | CardTitle.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | titleClassName: _propTypes2.default.string
68 | };
69 |
70 | CardTitle.defaultProps = {
71 | componentClass: 'h3',
72 | titleClassName: 'panel-title'
73 | };
74 |
75 | exports.default = CardTitle;
--------------------------------------------------------------------------------
/lib/Container.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var Container = function (_React$Component) {
34 | _inherits(Container, _React$Component);
35 |
36 | function Container(props) {
37 | _classCallCheck(this, Container);
38 |
39 | return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));
40 | }
41 |
42 | _createClass(Container, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | headingClassName = _props.headingClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'headingClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, headingClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return Container;
61 | }(_react2.default.Component);
62 |
63 | Container.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | headingClassName: _propTypes2.default.string
68 | };
69 |
70 | Container.defaultProps = {
71 | componentClass: 'div',
72 | headingClassName: 'container'
73 | };
74 |
75 | exports.default = Container;
--------------------------------------------------------------------------------
/lib/CardFooter.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var CardFooter = function (_React$Component) {
34 | _inherits(CardFooter, _React$Component);
35 |
36 | function CardFooter(props) {
37 | _classCallCheck(this, CardFooter);
38 |
39 | return _possibleConstructorReturn(this, (CardFooter.__proto__ || Object.getPrototypeOf(CardFooter)).call(this, props));
40 | }
41 |
42 | _createClass(CardFooter, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | footerClassName = _props.footerClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'footerClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, footerClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return CardFooter;
61 | }(_react2.default.Component);
62 |
63 | CardFooter.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | footerClassName: _propTypes2.default.string
68 | };
69 |
70 | CardFooter.defaultProps = {
71 | componentClass: 'div',
72 | footerClassName: 'panel-footer'
73 | };
74 |
75 | exports.default = CardFooter;
--------------------------------------------------------------------------------
/lib/CardHeader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var CardHeader = function (_React$Component) {
34 | _inherits(CardHeader, _React$Component);
35 |
36 | function CardHeader(props) {
37 | _classCallCheck(this, CardHeader);
38 |
39 | return _possibleConstructorReturn(this, (CardHeader.__proto__ || Object.getPrototypeOf(CardHeader)).call(this, props));
40 | }
41 |
42 | _createClass(CardHeader, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | headerClassName = _props.headerClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, headerClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return CardHeader;
61 | }(_react2.default.Component);
62 |
63 | CardHeader.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | headerClassName: _propTypes2.default.string
68 | };
69 |
70 | CardHeader.defaultProps = {
71 | componentClass: 'div',
72 | headerClassName: 'panel-heading'
73 | };
74 |
75 | exports.default = CardHeader;
--------------------------------------------------------------------------------
/lib/SummaryItem.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var SummaryItem = function (_React$Component) {
34 | _inherits(SummaryItem, _React$Component);
35 |
36 | function SummaryItem(props) {
37 | _classCallCheck(this, SummaryItem);
38 |
39 | return _possibleConstructorReturn(this, (SummaryItem.__proto__ || Object.getPrototypeOf(SummaryItem)).call(this, props));
40 | }
41 |
42 | _createClass(SummaryItem, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | itemClassName = _props.itemClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'itemClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, itemClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return SummaryItem;
61 | }(_react2.default.Component);
62 |
63 | SummaryItem.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | itemClassName: _propTypes2.default.string
68 | };
69 |
70 | SummaryItem.defaultProps = {
71 | componentClass: 'a',
72 | itemClassName: 'bootcards-summary-item'
73 | };
74 |
75 | exports.default = SummaryItem;
--------------------------------------------------------------------------------
/lib/ChartCanvas.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var ChartCanvas = function (_React$Component) {
34 | _inherits(ChartCanvas, _React$Component);
35 |
36 | function ChartCanvas(props) {
37 | _classCallCheck(this, ChartCanvas);
38 |
39 | return _possibleConstructorReturn(this, (ChartCanvas.__proto__ || Object.getPrototypeOf(ChartCanvas)).call(this, props));
40 | }
41 |
42 | _createClass(ChartCanvas, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | canvasClassName = _props.canvasClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'canvasClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, canvasClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return ChartCanvas;
61 | }(_react2.default.Component);
62 |
63 | ChartCanvas.propTypes = {
64 | canvasClassName: _propTypes2.default.string,
65 | children: _propTypes2.default.node,
66 | className: _propTypes2.default.string,
67 | componentClass: _propTypes2.default.string
68 | };
69 |
70 | ChartCanvas.defaultProps = {
71 | componentClass: 'div',
72 | canvasClassName: 'bootcards-chart-canvas'
73 | };
74 |
75 | exports.default = ChartCanvas;
--------------------------------------------------------------------------------
/lib/ListGroupItemText.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var ListGroupItemText = function (_React$Component) {
34 | _inherits(ListGroupItemText, _React$Component);
35 |
36 | function ListGroupItemText(props) {
37 | _classCallCheck(this, ListGroupItemText);
38 |
39 | return _possibleConstructorReturn(this, (ListGroupItemText.__proto__ || Object.getPrototypeOf(ListGroupItemText)).call(this, props));
40 | }
41 |
42 | _createClass(ListGroupItemText, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | textClassName = _props.textClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'textClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, textClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return ListGroupItemText;
61 | }(_react2.default.Component);
62 |
63 | ListGroupItemText.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | textClassName: _propTypes2.default.string
68 | };
69 |
70 | ListGroupItemText.defaultProps = {
71 | componentClass: 'p',
72 | textClassName: 'list-group-item-text'
73 | };
74 |
75 | exports.default = ListGroupItemText;
--------------------------------------------------------------------------------
/lib/ListGroupItemHeader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8 |
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | var _react = require('react');
16 |
17 | var _react2 = _interopRequireDefault(_react);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24 |
25 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26 |
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28 |
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30 |
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
32 |
33 | var ListGroupItemHeader = function (_React$Component) {
34 | _inherits(ListGroupItemHeader, _React$Component);
35 |
36 | function ListGroupItemHeader(props) {
37 | _classCallCheck(this, ListGroupItemHeader);
38 |
39 | return _possibleConstructorReturn(this, (ListGroupItemHeader.__proto__ || Object.getPrototypeOf(ListGroupItemHeader)).call(this, props));
40 | }
41 |
42 | _createClass(ListGroupItemHeader, [{
43 | key: 'render',
44 | value: function render() {
45 | var _props = this.props,
46 | componentClass = _props.componentClass,
47 | headerClassName = _props.headerClassName,
48 | className = _props.className,
49 | props = _objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
50 |
51 | var Component = componentClass;
52 | return _react2.default.createElement(
53 | Component,
54 | _extends({}, props, { className: (0, _classnames2.default)(className, headerClassName) }),
55 | this.props.children
56 | );
57 | }
58 | }]);
59 |
60 | return ListGroupItemHeader;
61 | }(_react2.default.Component);
62 |
63 | ListGroupItemHeader.propTypes = {
64 | children: _propTypes2.default.node,
65 | className: _propTypes2.default.string,
66 | componentClass: _propTypes2.default.string,
67 | headerClassName: _propTypes2.default.string
68 | };
69 |
70 | ListGroupItemHeader.defaultProps = {
71 | componentClass: 'h4',
72 | headerClassName: 'list-group-item-heading'
73 | };
74 |
75 | exports.default = ListGroupItemHeader;
--------------------------------------------------------------------------------
/example/src/example.less:
--------------------------------------------------------------------------------
1 | body {
2 | margin-top: 20px;
3 | }
4 |
5 | /*docs menu*/
6 | .docs-menu li > a {
7 | padding: 5px 15px !important;
8 | border-radius: 0;
9 | }
10 | .docs-menu li.active > a {
11 | padding-left: 13px !important;
12 | font-weight: 700;
13 | color: #000;
14 | background-color: rgba(0, 0, 0, 0);
15 | border-left: 2px solid #000;
16 | }
17 | .docs-menu li > a:hover,
18 | .docs-menu li.active > a:hover {
19 | padding-left: 14px !important;
20 | color: #000;
21 | background-color: rgba(0, 0, 0, 0);
22 | border-left: 1px solid #000;
23 | background: none;
24 | }
25 | .bootcards-documentation-list .list-group-item-heading,
26 | .bootcards-documentation-list .list-group-item-text {
27 | margin: 0;
28 | }
29 | .docs-menu li.sub > a,
30 | .docs-menu li.active.sub > a {
31 | padding-left: 25px !important;
32 | padding-top: 3px !important;
33 | padding-bottom: 3px !important;
34 | }
35 | .docs-menu li.active.sub > a {
36 | padding-left: 23px !important;
37 | }
38 | .docs-menu li.sub > a:hover,
39 | .docs-menu li.sub.active > a:hover {
40 | padding-left: 24px !important;
41 | }
42 | .bs-docs-section {
43 | padding-bottom: 20px;
44 | border-bottom: 1px solid #eee;
45 | margin-bottom: 20px;
46 | padding-top: 60px;
47 | margin-top: -40px;
48 | }
49 | .bs-docs-section:first-child {
50 | padding-top: 0;
51 | margin-top: 0;
52 | }
53 | .bs-docs-section:last-child {
54 | padding-bottom: 0;
55 | border-bottom: 0;
56 | margin-bottom: 0;
57 | }
58 | .bs-docs-section > *:first-child {
59 | margin-top: 0;
60 | }
61 | .bs-docs-section p.lead {
62 | margin-bottom: 10px;
63 | }
64 |
65 | /* Bootstrap Documentation styles */
66 | .bs-example {
67 | position: relative;
68 | padding: 45px 15px 15px;
69 | margin: 0 -15px 15px;
70 | background-color: #fafafa;
71 | box-shadow: inset 0 3px 6px rgba(0,0,0,.05);
72 | border-color: #e5e5e5 #eee #eee;
73 | border-style: solid;
74 | border-width: 1px 0;
75 | margin-top: 20px;
76 | }
77 | @media (min-width: 768px) {
78 | .bs-example {
79 | margin-left: 0;
80 | margin-right: 0;
81 | background-color: #fff;
82 | border-width: 1px;
83 | border-color: #ddd;
84 | border-radius: 4px 4px 0 0;
85 | box-shadow: none;
86 | }
87 | }
88 | .bs-example:after {
89 | content: "Example";
90 | position: absolute;
91 | top: 15px;
92 | left: 15px;
93 | font-size: 12px;
94 | font-weight: 700;
95 | color: #bbb;
96 | text-transform: uppercase;
97 | letter-spacing: 1px;
98 | }
99 | .bs-example-type .table td {
100 | padding: 15px 0;
101 | border-color: #eee;
102 | }
103 | .bs-example-type .table tr:first-child td {
104 | border-top: 0;
105 | }
106 | .bs-example>p:last-child,
107 | .bs-example>ul:last-child,
108 | .bs-example>ol:last-child,
109 | .bs-example>blockquote:last-child,
110 | .bs-example>.form-control:last-child,
111 | .bs-example>.table:last-child,
112 | .bs-example>.navbar:last-child,
113 | .bs-example>.jumbotron:last-child,
114 | .bs-example>.alert:last-child,
115 | .bs-example>.panel:last-child,
116 | .bs-example>.list-group:last-child,
117 | .bs-example>.well:last-child,
118 | .bs-example>.progress:last-child,
119 | .bs-example>.table-responsive:last-child>.table {
120 | margin-bottom: 0;
121 | }
122 | .bs-example+.highlight {
123 | margin: -15px -15px 15px;
124 | border-radius: 0;
125 | border-width: 0 0 1px;
126 | }
127 | .highlight {
128 | padding: 0;
129 | margin-bottom: 14px;
130 | background-color: #f7f7f9;
131 | border: 1px solid #e1e1e8;
132 | border-radius: 4px;
133 | }
134 | @media (min-width: 768px) {
135 | .bs-example+.highlight {
136 | margin-top: -16px;
137 | margin-left: 0;
138 | margin-right: 0;
139 | border-width: 1px;
140 | border-bottom-left-radius: 4px;
141 | border-bottom-right-radius: 4px;
142 | }
143 | }
144 | .highlight pre {
145 | padding: 0;
146 | margin-top: 0;
147 | margin-bottom: 0;
148 | background-color: transparent;
149 | border: 0;
150 | white-space: nowrap;
151 | }
152 |
--------------------------------------------------------------------------------
/example/src/sections/RichTextCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | Card,
4 | CardHeader,
5 | CardTitle,
6 | CardBody,
7 | CardFooter
8 | } from 'react-bootcards';
9 |
10 | import Section from './Section';
11 | import Highlight from './Highlight';
12 | import Example from './Example';
13 |
14 | class RichTextCard extends React.Component {
15 | render() {
16 | return (
17 |
18 | Rich Text Cards
19 |
20 | Rich Text Cards are designed for longer passages of text, which may
21 | include various heading levels, paragraphs and lists.
22 |
23 |
24 | They have more padding around the .panel-content to help
25 | readability.
26 |
27 |
28 |
29 |
30 | Rich Text Card Heading
31 |
32 |
33 |
34 | Lead body copy vivamus sagittis lacus vel augue laoreet rutrum
35 | faucibus dolor auctor. Duis mollis, est non commodo luctus.
36 |
37 | Heading 1
38 | Heading 2
39 | Heading 3
40 | Heading 4
41 | Heading 5
42 | Heading 6
43 |
44 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
45 | lobortis pretium nisl. Etiam at vestibulum purus, sit amet
46 | blandit mi. Duis enim lectus, tempus nec varius sed,
47 | sollicitudin quis velit. Fusce quis sem porttitor, euismod ante
48 | vitae, ultricies erat.
49 |
50 |
51 | Duis cursus dui et turpis gravida sollicitudin.
52 |
53 | Donec eget mauris feugiat, euismod purus nec, feugiat neque.
54 |
55 |
56 | Nunc erat est, molestie eget magna in, consectetur euismod
57 | lorem.
58 |
59 |
60 |
61 | Sed luctus congue orci quis tempus.
62 | Praesent in viverra lorem.
63 |
64 | Suspendisse augue lacus, porta quis imperdiet at, posuere vel
65 | nulla.
66 |
67 |
68 |
69 |
70 | Built with Bootcards - Rich Text Card
71 |
72 |
73 |
74 |
75 | {
76 | '\n \n Rich Text Card Heading \n \n \n \n Lead body copy vivamus sagittis lacus vel augue laoreet rutrum\n faucibus dolor auctor. Duis mollis, est non commodo luctus.\n
\n Heading 1 \n Heading 2 \n Heading 3 \n Heading 4 \n Heading 5 \n Heading 6 \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla\n lobortis pretium nisl. Etiam at vestibulum purus, sit amet\n blandit mi. Duis enim lectus, tempus nec varius sed,\n sollicitudin quis velit. Fusce quis sem porttitor, euismod ante\n vitae, ultricies erat.\n
\n \n Duis cursus dui et turpis gravida sollicitudin. \n \n Donec eget mauris feugiat, euismod purus nec, feugiat neque.\n \n \n Nunc erat est, molestie eget magna in, consectetur euismod\n lorem.\n \n \n \n Sed luctus congue orci quis tempus. \n Praesent in viverra lorem. \n \n Suspendisse augue lacus, porta quis imperdiet at, posuere vel\n nulla.\n \n \n \n \n Built with Bootcards - Rich Text Card \n \n \n'
77 | }
78 |
79 |
80 | );
81 | }
82 | }
83 |
84 | export default RichTextCard;
85 |
--------------------------------------------------------------------------------
/example/src/sections/SummaryCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Row, Col, Label } from 'react-bootstrap';
3 | import {
4 | Card,
5 | CardHeader,
6 | CardTitle,
7 | CardBody,
8 | CardFooter,
9 | SummaryItem
10 | } from 'react-bootcards';
11 |
12 | import Section from './Section';
13 | import Highlight from './Highlight';
14 | import Example from './Example';
15 |
16 | class SummaryCard extends React.Component {
17 | render() {
18 | return (
19 |
20 | Summary Cards
21 |
22 | Summary cards can be used on dashboards, etc to highlight important
23 | pieces of data in your app.
24 |
25 |
26 |
27 |
28 | Summay Card Heading
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Contacts 432
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | Companies 98
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Notes 54
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | Files 65
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | Tasks 109
69 |
70 |
71 |
72 |
73 |
74 |
75 | Built with Bootcards - Summary Card
76 |
77 |
78 |
79 |
80 | {
81 | '\n \n Summay Card Heading \n \n \n \n \n \n \n \n Contacts 432 \n \n \n \n \n \n \n \n Companies 98 \n \n \n \n \n \n \n \n Notes 54 \n \n \n \n \n \n \n \n Files 65 \n \n \n \n \n \n \n \n Tasks 109 \n \n \n \n
\n \n \n Built with Bootcards - Summary Card \n \n \n'
82 | }
83 |
84 |
85 | );
86 | }
87 | }
88 |
89 | export default SummaryCard;
90 |
--------------------------------------------------------------------------------
/example/src/sections/ListSearch.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | ListGroup,
4 | ListGroupItem,
5 | Row,
6 | Col,
7 | FormGroup,
8 | FormControl,
9 | Button
10 | } from 'react-bootstrap';
11 | import {
12 | List,
13 | Card,
14 | CardBody,
15 | ListGroupItemHeader,
16 | ListGroupItemText
17 | } from 'react-bootcards';
18 |
19 | import Section from './Section';
20 | import Highlight from './Highlight';
21 | import Example from './Example';
22 |
23 | import images from '../images';
24 |
25 | class ListSearch extends React.Component {
26 | render() {
27 | return (
28 |
89 | );
90 | }
91 | }
92 |
93 | export default ListSearch;
94 |
--------------------------------------------------------------------------------
/example/src/sections/FileCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ListGroup, ListGroupItem, ButtonGroup, Button } from 'react-bootstrap';
3 | import {
4 | Card,
5 | CardHeader,
6 | CardTitle,
7 | CardFooter,
8 | ListGroupItemHeader,
9 | ListGroupItemText
10 | } from 'react-bootcards';
11 |
12 | import Section from './Section';
13 | import Highlight from './Highlight';
14 | import Example from './Example';
15 |
16 | class FileCard extends React.Component {
17 | render() {
18 | return (
19 |
20 | File Cards
21 |
22 | File Cards are intended to show information and functions for
23 | non-media file formats (PDFs, Word documents, spreadsheets, etc).
24 |
25 |
26 |
27 |
28 | File Card Heading
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | File Name Goes Here
37 |
38 |
39 | PDF
40 |
41 |
42 | 3.2Mb
43 |
44 |
45 |
46 |
47 | Added by John Smith on 5 March 2014
48 |
49 |
50 |
51 |
52 | MediaFile card description lorem ipsum dolor sit amet,
53 | consectetur adipiscing elit. Vestibulum commodo, nulla ut
54 | porta interdum, mi mi venenatis felis, vitae pellentesque ante
55 | eros at enim.
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Download
65 |
66 |
67 |
68 |
69 |
70 | Favorite
71 |
72 |
73 |
74 |
75 |
76 | Email
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {
85 | '\n \n File Card Heading \n \n \n \n \n \n \n \n File Name Goes Here \n \n \n PDF \n \n \n 3.2Mb \n \n \n \n \n Added by John Smith on 5 March 2014 \n \n \n \n \n MediaFile card description lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Vestibulum commodo, nulla ut\n porta interdum, mi mi venenatis felis, vitae pellentesque ante\n eros at enim.\n \n \n \n \n \n \n \n \n Download\n \n \n \n \n \n Favorite\n \n \n \n \n \n Email\n \n \n \n \n \n'
86 | }
87 |
88 |
89 | );
90 | }
91 | }
92 |
93 | export default FileCard;
94 |
--------------------------------------------------------------------------------
/example/src/sections/ListDetail.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ListGroup, ListGroupItem, Row, Col } from 'react-bootstrap';
3 | import {
4 | List,
5 | Card,
6 | ListGroupItemHeader,
7 | ListGroupItemText
8 | } from 'react-bootcards';
9 |
10 | import Section from './Section';
11 | import Highlight from './Highlight';
12 | import Example from './Example';
13 |
14 | class ListDetail extends React.Component {
15 | render() {
16 | return (
17 |
18 | Detailed Lists
19 |
20 | Detailed Lists can be used when you need to show more information for
21 | each entry.
22 |
23 |
24 | You can use Bootstrap .col-* <div>s
25 | within each .list-group-item to show more pieces of
26 | information in whatever format you like, and respond to different
27 | device widths.
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Alparvis Ltd
38 | London, UK
39 |
40 |
41 | Contractor
42 | $12,000 Revenue YTD
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | Camion Corp
51 | Tokyo, Japan
52 |
53 |
54 | Customer
55 | $75,000 Revenue YTD
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Derenden Systems
65 |
66 | Albuquerque, USA
67 |
68 |
69 | Supplier
70 | $1.3m Revenue YTD
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | {
80 | '\n \n \n \n \n \n \n Alparvis Ltd \n London, UK \n \n \n Contractor \n $12,000 Revenue YTD \n \n
\n \n \n \n \n \n Camion Corp \n Tokyo, Japan \n \n \n Customer \n $75,000 Revenue YTD \n \n
\n \n \n \n \n \n \n Derenden Systems\n \n Albuquerque, USA \n \n \n Supplier \n $1.3m Revenue YTD \n \n
\n \n \n \n
\n'
81 | }
82 |
83 |
84 | );
85 | }
86 | }
87 |
88 | export default ListDetail;
89 |
--------------------------------------------------------------------------------
/example/src/sections/FormCard.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | ButtonGroup,
4 | Button,
5 | FormGroup,
6 | ControlLabel,
7 | FormControl,
8 | Col
9 | } from 'react-bootstrap';
10 | import {
11 | Card,
12 | CardHeader,
13 | CardTitle,
14 | CardBody,
15 | CardFooter
16 | } from 'react-bootcards';
17 |
18 | import Section from './Section';
19 | import Highlight from './Highlight';
20 | import Example from './Example';
21 |
22 | class FormCard extends React.Component {
23 | render() {
24 | return (
25 |
97 | );
98 | }
99 | }
100 |
101 | export default FormCard;
102 |
--------------------------------------------------------------------------------
/example/src/sections/DoubleNavbar.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Navbar, Nav, NavDropdown, MenuItem, NavItem } from 'react-bootstrap';
3 |
4 | import Section from './Section';
5 | import Highlight from './Highlight';
6 |
7 | class DoubleNavbar extends React.Component {
8 | render() {
9 | return (
10 |
11 | Double Navbar
12 |
13 | The Double Navbar is meant for desktop and allows you to have two rows
14 | of menu options.
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Bootcards Starter
24 |
25 |
26 |
27 |
28 | ,
33 | Languages
34 | ]}
35 | >
36 | Deutsch
37 | English
38 | Espanol
39 |
40 |
41 |
42 | Login
43 |
44 |
45 |
46 | ,
51 | Home
52 | ]}
53 | >
54 |
55 | Action
56 |
57 |
58 | Another action
59 |
60 |
61 | Something else here
62 |
63 |
64 |
65 | Separated link
66 |
67 |
68 |
69 |
70 | Portfolio
71 |
72 |
73 |
74 | Blog
75 |
76 |
77 |
78 |
79 |
80 |
81 | Set class="has-bootcards-navbar-double" on the body
82 | element to deal with the increased height of the navbar.
83 |
84 |
85 | {
86 | '\n \n \n \n \n \n Bootcards Starter\n \n \n \n \n ,\n Languages \n ]}\n >\n Deutsch \n English \n Espanol \n \n \n \n Login \n \n \n \n ,\n Home \n ]}\n >\n \n Action\n \n \n Another action\n \n \n Something else here\n \n \n \n Separated link\n \n \n \n \n Portfolio \n \n \n \n Blog \n \n \n \n \n'
87 | }
88 |
89 |
90 | );
91 | }
92 | }
93 |
94 | export default DoubleNavbar;
95 |
--------------------------------------------------------------------------------
/example/src/Documentation.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Nav, NavItem, Row, Col } from 'react-bootstrap';
3 | import { Cards, Card, CardBody } from 'react-bootcards';
4 |
5 | import Grid from './sections/Grid';
6 | import Navigation from './sections/Navigation';
7 | import SecNavbar from './sections/Navbar';
8 | import DoubleNavbar from './sections/DoubleNavbar';
9 | import FooterBar from './sections/FooterBar';
10 | import SlidingSidebar from './sections/SlidingSidebar';
11 | import Submenus from './sections/Submenus';
12 | import Lists from './sections/Lists';
13 | import ListDetail from './sections/ListDetail';
14 | import ListSearch from './sections/ListSearch';
15 | import SecCards from './sections/Cards';
16 | import BaseCard from './sections/BaseCard';
17 | import FormCard from './sections/FormCard';
18 | import TableCard from './sections/TableCard';
19 | import ChartCard from './sections/ChartCard';
20 | import SummaryCard from './sections/SummaryCard';
21 | import MediaCard from './sections/MediaCard';
22 | import FileCard from './sections/FileCard';
23 | import RichTextCard from './sections/RichTextCard';
24 | import Modals from './sections/Modals';
25 |
26 | class Documentation extends React.Component {
27 | constructor(props) {
28 | super(props);
29 | this.state = {
30 | selectedDocsMenu: 'doc-grid'
31 | };
32 | }
33 |
34 | handleDocsMenuSelect(eventKey) {
35 | this.setState({ selectedDocsMenu: eventKey });
36 | window.location.hash = eventKey;
37 | }
38 |
39 | render() {
40 | return (
41 |
42 |
43 |
44 |
50 |
51 | Grid System
52 |
53 |
58 | Navigation
59 |
60 |
61 | Navbar
62 |
63 |
68 | Double Navbar
69 |
70 |
75 | Footer Bar
76 |
77 |
82 | Sliding Sidebar
83 |
84 |
85 | Lists
86 |
87 |
92 | Detailed Lists
93 |
94 |
99 | List Search & List Actions
100 |
101 |
102 | Cards
103 |
104 |
109 | Base Cards
110 |
111 |
116 | Form Cards
117 |
118 |
123 | Table Cards
124 |
125 |
130 | Chart Cards
131 |
132 |
137 | Summary Cards
138 |
139 |
144 | Media Cards
145 |
146 |
151 | File Cards
152 |
153 |
158 | Rich Text Cards
159 |
160 |
161 | Modals
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | );
194 | }
195 | }
196 |
197 | export default Documentation;
198 |
--------------------------------------------------------------------------------
/dist/react-bootcards.min.js:
--------------------------------------------------------------------------------
1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react"),require("classnames"),require("react-bootstrap")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","classnames","react-bootstrap"],t):t(e["react-bootcards"]={},e.PropTypes,e.React,e.classNames,e.ReactBootstrap)}(this,function(e,t,r,n,a){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t,r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n;!function(){function e(e){this.value=e}function t(t){var r,n;function a(r,n){try{var o=t[r](n),l=o.value;l instanceof e?Promise.resolve(l.value).then(function(e){a("next",e)},function(e){a("throw",e)}):s(o.done?"return":"normal",o.value)}catch(e){s("throw",e)}}function s(e,t){switch(e){case"return":r.resolve({value:t,done:!0});break;case"throw":r.reject(t);break;default:r.resolve({value:t,done:!1})}(r=r.next)?a(r.key,r.arg):n=null}this._invoke=function(e,t){return new Promise(function(s,o){var l={key:e,arg:t,resolve:s,reject:o,next:null};n?n=n.next=l:(r=n=l,a(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}();var s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,t){for(var r=0;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.headingClassName,s=e.className,o=i(e,["componentClass","headingClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);p.defaultProps={componentClass:"div",headingClassName:"container"};var m=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.cardsClassName,s=e.className,o=i(e,["cardsClassName","className"]);return r.createElement(a.Col,l({},o,{className:n(s,t)}),this.props.children)}}]),t}(r.Component);m.defaultProps={cardsClassName:"bootcards-cards"};var f=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.listClassName,s=e.className,o=i(e,["listClassName","className"]);return r.createElement(a.Col,l({},o,{className:n(s,t)}),this.props.children)}}]),t}(r.Component);f.defaultProps={listClassName:"bootcards-list"};var h=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.headerClassName,s=e.className,o=i(e,["componentClass","headerClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);h.defaultProps={componentClass:"h4",headerClassName:"list-group-item-heading"};var d=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.textClassName,s=e.className,o=i(e,["componentClass","textClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);d.defaultProps={componentClass:"p",textClassName:"list-group-item-text"};var C=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.cardStyle,s=i(e,["cardStyle"]),o="default"===t?null:"bootcards-"+t;return r.createElement(a.Panel,l({},s,{className:n(s.className,o)}),this.props.children)}}]),t}(r.Component);C.defaultProps={cardStyle:"default"};var y=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.headerClassName,s=e.className,o=i(e,["componentClass","headerClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);y.defaultProps={componentClass:"div",headerClassName:"panel-heading"};var v=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.titleClassName,s=e.className,o=i(e,["componentClass","titleClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);v.defaultProps={componentClass:"h3",titleClassName:"panel-title"};var N=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.footerClassName,s=e.className,o=i(e,["componentClass","footerClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);N.defaultProps={componentClass:"div",footerClassName:"panel-footer"};var _=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return c(t,e),o(t,[{key:"render",value:function(){return r.createElement(a.Panel.Body,this.props,this.props.children)}}]),t}(r.Component),b=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.itemClassName,s=e.className,o=i(e,["componentClass","itemClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);b.defaultProps={componentClass:"a",itemClassName:"bootcards-summary-item"};var O=function(e){function t(e){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return c(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=e.componentClass,a=e.canvasClassName,s=e.className,o=i(e,["componentClass","canvasClassName","className"]),c=t;return r.createElement(c,l({},o,{className:n(s,a)}),this.props.children)}}]),t}(r.Component);O.defaultProps={componentClass:"div",canvasClassName:"bootcards-chart-canvas"},e.Container=p,e.Cards=m,e.List=f,e.ListGroupItemHeader=h,e.ListGroupItemText=d,e.Card=C,e.CardHeader=y,e.CardTitle=v,e.CardFooter=N,e.CardBody=_,e.SummaryItem=b,e.ChartCanvas=O,Object.defineProperty(e,"__esModule",{value:!0})});
2 |
--------------------------------------------------------------------------------
/dist/react-bootcards.es.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import classNames from 'classnames';
4 | import { Col, Panel } from 'react-bootstrap';
5 |
6 | var asyncGenerator = function () {
7 | function AwaitValue(value) {
8 | this.value = value;
9 | }
10 |
11 | function AsyncGenerator(gen) {
12 | var front, back;
13 |
14 | function send(key, arg) {
15 | return new Promise(function (resolve, reject) {
16 | var request = {
17 | key: key,
18 | arg: arg,
19 | resolve: resolve,
20 | reject: reject,
21 | next: null
22 | };
23 |
24 | if (back) {
25 | back = back.next = request;
26 | } else {
27 | front = back = request;
28 | resume(key, arg);
29 | }
30 | });
31 | }
32 |
33 | function resume(key, arg) {
34 | try {
35 | var result = gen[key](arg);
36 | var value = result.value;
37 |
38 | if (value instanceof AwaitValue) {
39 | Promise.resolve(value.value).then(function (arg) {
40 | resume("next", arg);
41 | }, function (arg) {
42 | resume("throw", arg);
43 | });
44 | } else {
45 | settle(result.done ? "return" : "normal", result.value);
46 | }
47 | } catch (err) {
48 | settle("throw", err);
49 | }
50 | }
51 |
52 | function settle(type, value) {
53 | switch (type) {
54 | case "return":
55 | front.resolve({
56 | value: value,
57 | done: true
58 | });
59 | break;
60 |
61 | case "throw":
62 | front.reject(value);
63 | break;
64 |
65 | default:
66 | front.resolve({
67 | value: value,
68 | done: false
69 | });
70 | break;
71 | }
72 |
73 | front = front.next;
74 |
75 | if (front) {
76 | resume(front.key, front.arg);
77 | } else {
78 | back = null;
79 | }
80 | }
81 |
82 | this._invoke = send;
83 |
84 | if (typeof gen.return !== "function") {
85 | this.return = undefined;
86 | }
87 | }
88 |
89 | if (typeof Symbol === "function" && Symbol.asyncIterator) {
90 | AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
91 | return this;
92 | };
93 | }
94 |
95 | AsyncGenerator.prototype.next = function (arg) {
96 | return this._invoke("next", arg);
97 | };
98 |
99 | AsyncGenerator.prototype.throw = function (arg) {
100 | return this._invoke("throw", arg);
101 | };
102 |
103 | AsyncGenerator.prototype.return = function (arg) {
104 | return this._invoke("return", arg);
105 | };
106 |
107 | return {
108 | wrap: function (fn) {
109 | return function () {
110 | return new AsyncGenerator(fn.apply(this, arguments));
111 | };
112 | },
113 | await: function (value) {
114 | return new AwaitValue(value);
115 | }
116 | };
117 | }();
118 |
119 |
120 |
121 |
122 |
123 | var classCallCheck = function (instance, Constructor) {
124 | if (!(instance instanceof Constructor)) {
125 | throw new TypeError("Cannot call a class as a function");
126 | }
127 | };
128 |
129 | var createClass = function () {
130 | function defineProperties(target, props) {
131 | for (var i = 0; i < props.length; i++) {
132 | var descriptor = props[i];
133 | descriptor.enumerable = descriptor.enumerable || false;
134 | descriptor.configurable = true;
135 | if ("value" in descriptor) descriptor.writable = true;
136 | Object.defineProperty(target, descriptor.key, descriptor);
137 | }
138 | }
139 |
140 | return function (Constructor, protoProps, staticProps) {
141 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
142 | if (staticProps) defineProperties(Constructor, staticProps);
143 | return Constructor;
144 | };
145 | }();
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | var _extends = Object.assign || function (target) {
154 | for (var i = 1; i < arguments.length; i++) {
155 | var source = arguments[i];
156 |
157 | for (var key in source) {
158 | if (Object.prototype.hasOwnProperty.call(source, key)) {
159 | target[key] = source[key];
160 | }
161 | }
162 | }
163 |
164 | return target;
165 | };
166 |
167 |
168 |
169 | var inherits = function (subClass, superClass) {
170 | if (typeof superClass !== "function" && superClass !== null) {
171 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
172 | }
173 |
174 | subClass.prototype = Object.create(superClass && superClass.prototype, {
175 | constructor: {
176 | value: subClass,
177 | enumerable: false,
178 | writable: true,
179 | configurable: true
180 | }
181 | });
182 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
183 | };
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | var objectWithoutProperties = function (obj, keys) {
194 | var target = {};
195 |
196 | for (var i in obj) {
197 | if (keys.indexOf(i) >= 0) continue;
198 | if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
199 | target[i] = obj[i];
200 | }
201 |
202 | return target;
203 | };
204 |
205 | var possibleConstructorReturn = function (self, call) {
206 | if (!self) {
207 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
208 | }
209 |
210 | return call && (typeof call === "object" || typeof call === "function") ? call : self;
211 | };
212 |
213 | var Container = function (_React$Component) {
214 | inherits(Container, _React$Component);
215 |
216 | function Container(props) {
217 | classCallCheck(this, Container);
218 | return possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));
219 | }
220 |
221 | createClass(Container, [{
222 | key: 'render',
223 | value: function render() {
224 | var _props = this.props,
225 | componentClass = _props.componentClass,
226 | headingClassName = _props.headingClassName,
227 | className = _props.className,
228 | props = objectWithoutProperties(_props, ['componentClass', 'headingClassName', 'className']);
229 |
230 | var Component = componentClass;
231 | return React.createElement(
232 | Component,
233 | _extends({}, props, { className: classNames(className, headingClassName) }),
234 | this.props.children
235 | );
236 | }
237 | }]);
238 | return Container;
239 | }(React.Component);
240 |
241 | Container.propTypes = {
242 | children: PropTypes.node,
243 | className: PropTypes.string,
244 | componentClass: PropTypes.string,
245 | headingClassName: PropTypes.string
246 | };
247 |
248 | Container.defaultProps = {
249 | componentClass: 'div',
250 | headingClassName: 'container'
251 | };
252 |
253 | var Cards = function (_React$Component) {
254 | inherits(Cards, _React$Component);
255 |
256 | function Cards(props) {
257 | classCallCheck(this, Cards);
258 | return possibleConstructorReturn(this, (Cards.__proto__ || Object.getPrototypeOf(Cards)).call(this, props));
259 | }
260 |
261 | createClass(Cards, [{
262 | key: 'render',
263 | value: function render() {
264 | var _props = this.props,
265 | cardsClassName = _props.cardsClassName,
266 | className = _props.className,
267 | props = objectWithoutProperties(_props, ['cardsClassName', 'className']);
268 |
269 | return React.createElement(
270 | Col,
271 | _extends({}, props, { className: classNames(className, cardsClassName) }),
272 | this.props.children
273 | );
274 | }
275 | }]);
276 | return Cards;
277 | }(React.Component);
278 |
279 | Cards.propTypes = {
280 | cardsClassName: PropTypes.string,
281 | children: PropTypes.node,
282 | className: PropTypes.string
283 | };
284 |
285 | Cards.defaultProps = {
286 | cardsClassName: 'bootcards-cards'
287 | };
288 |
289 | var List = function (_React$Component) {
290 | inherits(List, _React$Component);
291 |
292 | function List(props) {
293 | classCallCheck(this, List);
294 | return possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, props));
295 | }
296 |
297 | createClass(List, [{
298 | key: 'render',
299 | value: function render() {
300 | var _props = this.props,
301 | listClassName = _props.listClassName,
302 | className = _props.className,
303 | props = objectWithoutProperties(_props, ['listClassName', 'className']);
304 |
305 | return React.createElement(
306 | Col,
307 | _extends({}, props, { className: classNames(className, listClassName) }),
308 | this.props.children
309 | );
310 | }
311 | }]);
312 | return List;
313 | }(React.Component);
314 |
315 | List.propTypes = {
316 | children: PropTypes.node,
317 | className: PropTypes.string,
318 | listClassName: PropTypes.string
319 | };
320 |
321 | List.defaultProps = {
322 | listClassName: 'bootcards-list'
323 | };
324 |
325 | var ListGroupItemHeader = function (_React$Component) {
326 | inherits(ListGroupItemHeader, _React$Component);
327 |
328 | function ListGroupItemHeader(props) {
329 | classCallCheck(this, ListGroupItemHeader);
330 | return possibleConstructorReturn(this, (ListGroupItemHeader.__proto__ || Object.getPrototypeOf(ListGroupItemHeader)).call(this, props));
331 | }
332 |
333 | createClass(ListGroupItemHeader, [{
334 | key: 'render',
335 | value: function render() {
336 | var _props = this.props,
337 | componentClass = _props.componentClass,
338 | headerClassName = _props.headerClassName,
339 | className = _props.className,
340 | props = objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
341 |
342 | var Component = componentClass;
343 | return React.createElement(
344 | Component,
345 | _extends({}, props, { className: classNames(className, headerClassName) }),
346 | this.props.children
347 | );
348 | }
349 | }]);
350 | return ListGroupItemHeader;
351 | }(React.Component);
352 |
353 | ListGroupItemHeader.propTypes = {
354 | children: PropTypes.node,
355 | className: PropTypes.string,
356 | componentClass: PropTypes.string,
357 | headerClassName: PropTypes.string
358 | };
359 |
360 | ListGroupItemHeader.defaultProps = {
361 | componentClass: 'h4',
362 | headerClassName: 'list-group-item-heading'
363 | };
364 |
365 | var ListGroupItemText = function (_React$Component) {
366 | inherits(ListGroupItemText, _React$Component);
367 |
368 | function ListGroupItemText(props) {
369 | classCallCheck(this, ListGroupItemText);
370 | return possibleConstructorReturn(this, (ListGroupItemText.__proto__ || Object.getPrototypeOf(ListGroupItemText)).call(this, props));
371 | }
372 |
373 | createClass(ListGroupItemText, [{
374 | key: 'render',
375 | value: function render() {
376 | var _props = this.props,
377 | componentClass = _props.componentClass,
378 | textClassName = _props.textClassName,
379 | className = _props.className,
380 | props = objectWithoutProperties(_props, ['componentClass', 'textClassName', 'className']);
381 |
382 | var Component = componentClass;
383 | return React.createElement(
384 | Component,
385 | _extends({}, props, { className: classNames(className, textClassName) }),
386 | this.props.children
387 | );
388 | }
389 | }]);
390 | return ListGroupItemText;
391 | }(React.Component);
392 |
393 | ListGroupItemText.propTypes = {
394 | children: PropTypes.node,
395 | className: PropTypes.string,
396 | componentClass: PropTypes.string,
397 | textClassName: PropTypes.string
398 | };
399 |
400 | ListGroupItemText.defaultProps = {
401 | componentClass: 'p',
402 | textClassName: 'list-group-item-text'
403 | };
404 |
405 | var Card = function (_React$Component) {
406 | inherits(Card, _React$Component);
407 |
408 | function Card(props) {
409 | classCallCheck(this, Card);
410 | return possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).call(this, props));
411 | }
412 |
413 | createClass(Card, [{
414 | key: 'render',
415 | value: function render() {
416 | var _props = this.props,
417 | cardStyle = _props.cardStyle,
418 | props = objectWithoutProperties(_props, ['cardStyle']);
419 |
420 | var cardClassName = cardStyle === 'default' ? null : 'bootcards-' + cardStyle;
421 | return React.createElement(
422 | Panel,
423 | _extends({}, props, { className: classNames(props.className, cardClassName) }),
424 | this.props.children
425 | );
426 | }
427 | }]);
428 | return Card;
429 | }(React.Component);
430 |
431 | Card.propTypes = {
432 | cardStyle: PropTypes.oneOf(['default', 'chart', 'summary', 'media', 'file', 'richtext']),
433 | children: PropTypes.node,
434 | className: PropTypes.string
435 | };
436 |
437 | Card.defaultProps = {
438 | cardStyle: 'default'
439 | };
440 |
441 | var CardHeader = function (_React$Component) {
442 | inherits(CardHeader, _React$Component);
443 |
444 | function CardHeader(props) {
445 | classCallCheck(this, CardHeader);
446 | return possibleConstructorReturn(this, (CardHeader.__proto__ || Object.getPrototypeOf(CardHeader)).call(this, props));
447 | }
448 |
449 | createClass(CardHeader, [{
450 | key: 'render',
451 | value: function render() {
452 | var _props = this.props,
453 | componentClass = _props.componentClass,
454 | headerClassName = _props.headerClassName,
455 | className = _props.className,
456 | props = objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
457 |
458 | var Component = componentClass;
459 | return React.createElement(
460 | Component,
461 | _extends({}, props, { className: classNames(className, headerClassName) }),
462 | this.props.children
463 | );
464 | }
465 | }]);
466 | return CardHeader;
467 | }(React.Component);
468 |
469 | CardHeader.propTypes = {
470 | children: PropTypes.node,
471 | className: PropTypes.string,
472 | componentClass: PropTypes.string,
473 | headerClassName: PropTypes.string
474 | };
475 |
476 | CardHeader.defaultProps = {
477 | componentClass: 'div',
478 | headerClassName: 'panel-heading'
479 | };
480 |
481 | var CardTitle = function (_React$Component) {
482 | inherits(CardTitle, _React$Component);
483 |
484 | function CardTitle(props) {
485 | classCallCheck(this, CardTitle);
486 | return possibleConstructorReturn(this, (CardTitle.__proto__ || Object.getPrototypeOf(CardTitle)).call(this, props));
487 | }
488 |
489 | createClass(CardTitle, [{
490 | key: 'render',
491 | value: function render() {
492 | var _props = this.props,
493 | componentClass = _props.componentClass,
494 | titleClassName = _props.titleClassName,
495 | className = _props.className,
496 | props = objectWithoutProperties(_props, ['componentClass', 'titleClassName', 'className']);
497 |
498 | var Component = componentClass;
499 | return React.createElement(
500 | Component,
501 | _extends({}, props, { className: classNames(className, titleClassName) }),
502 | this.props.children
503 | );
504 | }
505 | }]);
506 | return CardTitle;
507 | }(React.Component);
508 |
509 | CardTitle.propTypes = {
510 | children: PropTypes.node,
511 | className: PropTypes.string,
512 | componentClass: PropTypes.string,
513 | titleClassName: PropTypes.string
514 | };
515 |
516 | CardTitle.defaultProps = {
517 | componentClass: 'h3',
518 | titleClassName: 'panel-title'
519 | };
520 |
521 | var CardFooter = function (_React$Component) {
522 | inherits(CardFooter, _React$Component);
523 |
524 | function CardFooter(props) {
525 | classCallCheck(this, CardFooter);
526 | return possibleConstructorReturn(this, (CardFooter.__proto__ || Object.getPrototypeOf(CardFooter)).call(this, props));
527 | }
528 |
529 | createClass(CardFooter, [{
530 | key: 'render',
531 | value: function render() {
532 | var _props = this.props,
533 | componentClass = _props.componentClass,
534 | footerClassName = _props.footerClassName,
535 | className = _props.className,
536 | props = objectWithoutProperties(_props, ['componentClass', 'footerClassName', 'className']);
537 |
538 | var Component = componentClass;
539 | return React.createElement(
540 | Component,
541 | _extends({}, props, { className: classNames(className, footerClassName) }),
542 | this.props.children
543 | );
544 | }
545 | }]);
546 | return CardFooter;
547 | }(React.Component);
548 |
549 | CardFooter.propTypes = {
550 | children: PropTypes.node,
551 | className: PropTypes.string,
552 | componentClass: PropTypes.string,
553 | footerClassName: PropTypes.string
554 | };
555 |
556 | CardFooter.defaultProps = {
557 | componentClass: 'div',
558 | footerClassName: 'panel-footer'
559 | };
560 |
561 | var CardBody = function (_React$Component) {
562 | inherits(CardBody, _React$Component);
563 |
564 | function CardBody() {
565 | classCallCheck(this, CardBody);
566 | return possibleConstructorReturn(this, (CardBody.__proto__ || Object.getPrototypeOf(CardBody)).apply(this, arguments));
567 | }
568 |
569 | createClass(CardBody, [{
570 | key: 'render',
571 | value: function render() {
572 | return React.createElement(
573 | Panel.Body,
574 | this.props,
575 | this.props.children
576 | );
577 | }
578 | }]);
579 | return CardBody;
580 | }(React.Component);
581 |
582 | CardBody.propTypes = {
583 | children: PropTypes.node
584 | };
585 |
586 | var SummaryItem = function (_React$Component) {
587 | inherits(SummaryItem, _React$Component);
588 |
589 | function SummaryItem(props) {
590 | classCallCheck(this, SummaryItem);
591 | return possibleConstructorReturn(this, (SummaryItem.__proto__ || Object.getPrototypeOf(SummaryItem)).call(this, props));
592 | }
593 |
594 | createClass(SummaryItem, [{
595 | key: 'render',
596 | value: function render() {
597 | var _props = this.props,
598 | componentClass = _props.componentClass,
599 | itemClassName = _props.itemClassName,
600 | className = _props.className,
601 | props = objectWithoutProperties(_props, ['componentClass', 'itemClassName', 'className']);
602 |
603 | var Component = componentClass;
604 | return React.createElement(
605 | Component,
606 | _extends({}, props, { className: classNames(className, itemClassName) }),
607 | this.props.children
608 | );
609 | }
610 | }]);
611 | return SummaryItem;
612 | }(React.Component);
613 |
614 | SummaryItem.propTypes = {
615 | children: PropTypes.node,
616 | className: PropTypes.string,
617 | componentClass: PropTypes.string,
618 | itemClassName: PropTypes.string
619 | };
620 |
621 | SummaryItem.defaultProps = {
622 | componentClass: 'a',
623 | itemClassName: 'bootcards-summary-item'
624 | };
625 |
626 | var ChartCanvas = function (_React$Component) {
627 | inherits(ChartCanvas, _React$Component);
628 |
629 | function ChartCanvas(props) {
630 | classCallCheck(this, ChartCanvas);
631 | return possibleConstructorReturn(this, (ChartCanvas.__proto__ || Object.getPrototypeOf(ChartCanvas)).call(this, props));
632 | }
633 |
634 | createClass(ChartCanvas, [{
635 | key: 'render',
636 | value: function render() {
637 | var _props = this.props,
638 | componentClass = _props.componentClass,
639 | canvasClassName = _props.canvasClassName,
640 | className = _props.className,
641 | props = objectWithoutProperties(_props, ['componentClass', 'canvasClassName', 'className']);
642 |
643 | var Component = componentClass;
644 | return React.createElement(
645 | Component,
646 | _extends({}, props, { className: classNames(className, canvasClassName) }),
647 | this.props.children
648 | );
649 | }
650 | }]);
651 | return ChartCanvas;
652 | }(React.Component);
653 |
654 | ChartCanvas.propTypes = {
655 | canvasClassName: PropTypes.string,
656 | children: PropTypes.node,
657 | className: PropTypes.string,
658 | componentClass: PropTypes.string
659 | };
660 |
661 | ChartCanvas.defaultProps = {
662 | componentClass: 'div',
663 | canvasClassName: 'bootcards-chart-canvas'
664 | };
665 |
666 | export { Container, Cards, List, ListGroupItemHeader, ListGroupItemText, Card, CardHeader, CardTitle, CardFooter, CardBody, SummaryItem, ChartCanvas };
667 |
--------------------------------------------------------------------------------
/dist/react-bootcards.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('prop-types'), require('react'), require('classnames'), require('react-bootstrap')) :
3 | typeof define === 'function' && define.amd ? define(['exports', 'prop-types', 'react', 'classnames', 'react-bootstrap'], factory) :
4 | (factory((global['react-bootcards'] = {}),global.PropTypes,global.React,global.classNames,global.ReactBootstrap));
5 | }(this, (function (exports,PropTypes,React,classNames,reactBootstrap) { 'use strict';
6 |
7 | PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes;
8 | React = React && React.hasOwnProperty('default') ? React['default'] : React;
9 | classNames = classNames && classNames.hasOwnProperty('default') ? classNames['default'] : classNames;
10 |
11 | var asyncGenerator = function () {
12 | function AwaitValue(value) {
13 | this.value = value;
14 | }
15 |
16 | function AsyncGenerator(gen) {
17 | var front, back;
18 |
19 | function send(key, arg) {
20 | return new Promise(function (resolve, reject) {
21 | var request = {
22 | key: key,
23 | arg: arg,
24 | resolve: resolve,
25 | reject: reject,
26 | next: null
27 | };
28 |
29 | if (back) {
30 | back = back.next = request;
31 | } else {
32 | front = back = request;
33 | resume(key, arg);
34 | }
35 | });
36 | }
37 |
38 | function resume(key, arg) {
39 | try {
40 | var result = gen[key](arg);
41 | var value = result.value;
42 |
43 | if (value instanceof AwaitValue) {
44 | Promise.resolve(value.value).then(function (arg) {
45 | resume("next", arg);
46 | }, function (arg) {
47 | resume("throw", arg);
48 | });
49 | } else {
50 | settle(result.done ? "return" : "normal", result.value);
51 | }
52 | } catch (err) {
53 | settle("throw", err);
54 | }
55 | }
56 |
57 | function settle(type, value) {
58 | switch (type) {
59 | case "return":
60 | front.resolve({
61 | value: value,
62 | done: true
63 | });
64 | break;
65 |
66 | case "throw":
67 | front.reject(value);
68 | break;
69 |
70 | default:
71 | front.resolve({
72 | value: value,
73 | done: false
74 | });
75 | break;
76 | }
77 |
78 | front = front.next;
79 |
80 | if (front) {
81 | resume(front.key, front.arg);
82 | } else {
83 | back = null;
84 | }
85 | }
86 |
87 | this._invoke = send;
88 |
89 | if (typeof gen.return !== "function") {
90 | this.return = undefined;
91 | }
92 | }
93 |
94 | if (typeof Symbol === "function" && Symbol.asyncIterator) {
95 | AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
96 | return this;
97 | };
98 | }
99 |
100 | AsyncGenerator.prototype.next = function (arg) {
101 | return this._invoke("next", arg);
102 | };
103 |
104 | AsyncGenerator.prototype.throw = function (arg) {
105 | return this._invoke("throw", arg);
106 | };
107 |
108 | AsyncGenerator.prototype.return = function (arg) {
109 | return this._invoke("return", arg);
110 | };
111 |
112 | return {
113 | wrap: function (fn) {
114 | return function () {
115 | return new AsyncGenerator(fn.apply(this, arguments));
116 | };
117 | },
118 | await: function (value) {
119 | return new AwaitValue(value);
120 | }
121 | };
122 | }();
123 |
124 |
125 |
126 |
127 |
128 | var classCallCheck = function (instance, Constructor) {
129 | if (!(instance instanceof Constructor)) {
130 | throw new TypeError("Cannot call a class as a function");
131 | }
132 | };
133 |
134 | var createClass = function () {
135 | function defineProperties(target, props) {
136 | for (var i = 0; i < props.length; i++) {
137 | var descriptor = props[i];
138 | descriptor.enumerable = descriptor.enumerable || false;
139 | descriptor.configurable = true;
140 | if ("value" in descriptor) descriptor.writable = true;
141 | Object.defineProperty(target, descriptor.key, descriptor);
142 | }
143 | }
144 |
145 | return function (Constructor, protoProps, staticProps) {
146 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
147 | if (staticProps) defineProperties(Constructor, staticProps);
148 | return Constructor;
149 | };
150 | }();
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 | var _extends = Object.assign || function (target) {
159 | for (var i = 1; i < arguments.length; i++) {
160 | var source = arguments[i];
161 |
162 | for (var key in source) {
163 | if (Object.prototype.hasOwnProperty.call(source, key)) {
164 | target[key] = source[key];
165 | }
166 | }
167 | }
168 |
169 | return target;
170 | };
171 |
172 |
173 |
174 | var inherits = function (subClass, superClass) {
175 | if (typeof superClass !== "function" && superClass !== null) {
176 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
177 | }
178 |
179 | subClass.prototype = Object.create(superClass && superClass.prototype, {
180 | constructor: {
181 | value: subClass,
182 | enumerable: false,
183 | writable: true,
184 | configurable: true
185 | }
186 | });
187 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
188 | };
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 | var objectWithoutProperties = function (obj, keys) {
199 | var target = {};
200 |
201 | for (var i in obj) {
202 | if (keys.indexOf(i) >= 0) continue;
203 | if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
204 | target[i] = obj[i];
205 | }
206 |
207 | return target;
208 | };
209 |
210 | var possibleConstructorReturn = function (self, call) {
211 | if (!self) {
212 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
213 | }
214 |
215 | return call && (typeof call === "object" || typeof call === "function") ? call : self;
216 | };
217 |
218 | var Container = function (_React$Component) {
219 | inherits(Container, _React$Component);
220 |
221 | function Container(props) {
222 | classCallCheck(this, Container);
223 | return possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));
224 | }
225 |
226 | createClass(Container, [{
227 | key: 'render',
228 | value: function render() {
229 | var _props = this.props,
230 | componentClass = _props.componentClass,
231 | headingClassName = _props.headingClassName,
232 | className = _props.className,
233 | props = objectWithoutProperties(_props, ['componentClass', 'headingClassName', 'className']);
234 |
235 | var Component = componentClass;
236 | return React.createElement(
237 | Component,
238 | _extends({}, props, { className: classNames(className, headingClassName) }),
239 | this.props.children
240 | );
241 | }
242 | }]);
243 | return Container;
244 | }(React.Component);
245 |
246 | Container.propTypes = {
247 | children: PropTypes.node,
248 | className: PropTypes.string,
249 | componentClass: PropTypes.string,
250 | headingClassName: PropTypes.string
251 | };
252 |
253 | Container.defaultProps = {
254 | componentClass: 'div',
255 | headingClassName: 'container'
256 | };
257 |
258 | var Cards = function (_React$Component) {
259 | inherits(Cards, _React$Component);
260 |
261 | function Cards(props) {
262 | classCallCheck(this, Cards);
263 | return possibleConstructorReturn(this, (Cards.__proto__ || Object.getPrototypeOf(Cards)).call(this, props));
264 | }
265 |
266 | createClass(Cards, [{
267 | key: 'render',
268 | value: function render() {
269 | var _props = this.props,
270 | cardsClassName = _props.cardsClassName,
271 | className = _props.className,
272 | props = objectWithoutProperties(_props, ['cardsClassName', 'className']);
273 |
274 | return React.createElement(
275 | reactBootstrap.Col,
276 | _extends({}, props, { className: classNames(className, cardsClassName) }),
277 | this.props.children
278 | );
279 | }
280 | }]);
281 | return Cards;
282 | }(React.Component);
283 |
284 | Cards.propTypes = {
285 | cardsClassName: PropTypes.string,
286 | children: PropTypes.node,
287 | className: PropTypes.string
288 | };
289 |
290 | Cards.defaultProps = {
291 | cardsClassName: 'bootcards-cards'
292 | };
293 |
294 | var List = function (_React$Component) {
295 | inherits(List, _React$Component);
296 |
297 | function List(props) {
298 | classCallCheck(this, List);
299 | return possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, props));
300 | }
301 |
302 | createClass(List, [{
303 | key: 'render',
304 | value: function render() {
305 | var _props = this.props,
306 | listClassName = _props.listClassName,
307 | className = _props.className,
308 | props = objectWithoutProperties(_props, ['listClassName', 'className']);
309 |
310 | return React.createElement(
311 | reactBootstrap.Col,
312 | _extends({}, props, { className: classNames(className, listClassName) }),
313 | this.props.children
314 | );
315 | }
316 | }]);
317 | return List;
318 | }(React.Component);
319 |
320 | List.propTypes = {
321 | children: PropTypes.node,
322 | className: PropTypes.string,
323 | listClassName: PropTypes.string
324 | };
325 |
326 | List.defaultProps = {
327 | listClassName: 'bootcards-list'
328 | };
329 |
330 | var ListGroupItemHeader = function (_React$Component) {
331 | inherits(ListGroupItemHeader, _React$Component);
332 |
333 | function ListGroupItemHeader(props) {
334 | classCallCheck(this, ListGroupItemHeader);
335 | return possibleConstructorReturn(this, (ListGroupItemHeader.__proto__ || Object.getPrototypeOf(ListGroupItemHeader)).call(this, props));
336 | }
337 |
338 | createClass(ListGroupItemHeader, [{
339 | key: 'render',
340 | value: function render() {
341 | var _props = this.props,
342 | componentClass = _props.componentClass,
343 | headerClassName = _props.headerClassName,
344 | className = _props.className,
345 | props = objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
346 |
347 | var Component = componentClass;
348 | return React.createElement(
349 | Component,
350 | _extends({}, props, { className: classNames(className, headerClassName) }),
351 | this.props.children
352 | );
353 | }
354 | }]);
355 | return ListGroupItemHeader;
356 | }(React.Component);
357 |
358 | ListGroupItemHeader.propTypes = {
359 | children: PropTypes.node,
360 | className: PropTypes.string,
361 | componentClass: PropTypes.string,
362 | headerClassName: PropTypes.string
363 | };
364 |
365 | ListGroupItemHeader.defaultProps = {
366 | componentClass: 'h4',
367 | headerClassName: 'list-group-item-heading'
368 | };
369 |
370 | var ListGroupItemText = function (_React$Component) {
371 | inherits(ListGroupItemText, _React$Component);
372 |
373 | function ListGroupItemText(props) {
374 | classCallCheck(this, ListGroupItemText);
375 | return possibleConstructorReturn(this, (ListGroupItemText.__proto__ || Object.getPrototypeOf(ListGroupItemText)).call(this, props));
376 | }
377 |
378 | createClass(ListGroupItemText, [{
379 | key: 'render',
380 | value: function render() {
381 | var _props = this.props,
382 | componentClass = _props.componentClass,
383 | textClassName = _props.textClassName,
384 | className = _props.className,
385 | props = objectWithoutProperties(_props, ['componentClass', 'textClassName', 'className']);
386 |
387 | var Component = componentClass;
388 | return React.createElement(
389 | Component,
390 | _extends({}, props, { className: classNames(className, textClassName) }),
391 | this.props.children
392 | );
393 | }
394 | }]);
395 | return ListGroupItemText;
396 | }(React.Component);
397 |
398 | ListGroupItemText.propTypes = {
399 | children: PropTypes.node,
400 | className: PropTypes.string,
401 | componentClass: PropTypes.string,
402 | textClassName: PropTypes.string
403 | };
404 |
405 | ListGroupItemText.defaultProps = {
406 | componentClass: 'p',
407 | textClassName: 'list-group-item-text'
408 | };
409 |
410 | var Card = function (_React$Component) {
411 | inherits(Card, _React$Component);
412 |
413 | function Card(props) {
414 | classCallCheck(this, Card);
415 | return possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).call(this, props));
416 | }
417 |
418 | createClass(Card, [{
419 | key: 'render',
420 | value: function render() {
421 | var _props = this.props,
422 | cardStyle = _props.cardStyle,
423 | props = objectWithoutProperties(_props, ['cardStyle']);
424 |
425 | var cardClassName = cardStyle === 'default' ? null : 'bootcards-' + cardStyle;
426 | return React.createElement(
427 | reactBootstrap.Panel,
428 | _extends({}, props, { className: classNames(props.className, cardClassName) }),
429 | this.props.children
430 | );
431 | }
432 | }]);
433 | return Card;
434 | }(React.Component);
435 |
436 | Card.propTypes = {
437 | cardStyle: PropTypes.oneOf(['default', 'chart', 'summary', 'media', 'file', 'richtext']),
438 | children: PropTypes.node,
439 | className: PropTypes.string
440 | };
441 |
442 | Card.defaultProps = {
443 | cardStyle: 'default'
444 | };
445 |
446 | var CardHeader = function (_React$Component) {
447 | inherits(CardHeader, _React$Component);
448 |
449 | function CardHeader(props) {
450 | classCallCheck(this, CardHeader);
451 | return possibleConstructorReturn(this, (CardHeader.__proto__ || Object.getPrototypeOf(CardHeader)).call(this, props));
452 | }
453 |
454 | createClass(CardHeader, [{
455 | key: 'render',
456 | value: function render() {
457 | var _props = this.props,
458 | componentClass = _props.componentClass,
459 | headerClassName = _props.headerClassName,
460 | className = _props.className,
461 | props = objectWithoutProperties(_props, ['componentClass', 'headerClassName', 'className']);
462 |
463 | var Component = componentClass;
464 | return React.createElement(
465 | Component,
466 | _extends({}, props, { className: classNames(className, headerClassName) }),
467 | this.props.children
468 | );
469 | }
470 | }]);
471 | return CardHeader;
472 | }(React.Component);
473 |
474 | CardHeader.propTypes = {
475 | children: PropTypes.node,
476 | className: PropTypes.string,
477 | componentClass: PropTypes.string,
478 | headerClassName: PropTypes.string
479 | };
480 |
481 | CardHeader.defaultProps = {
482 | componentClass: 'div',
483 | headerClassName: 'panel-heading'
484 | };
485 |
486 | var CardTitle = function (_React$Component) {
487 | inherits(CardTitle, _React$Component);
488 |
489 | function CardTitle(props) {
490 | classCallCheck(this, CardTitle);
491 | return possibleConstructorReturn(this, (CardTitle.__proto__ || Object.getPrototypeOf(CardTitle)).call(this, props));
492 | }
493 |
494 | createClass(CardTitle, [{
495 | key: 'render',
496 | value: function render() {
497 | var _props = this.props,
498 | componentClass = _props.componentClass,
499 | titleClassName = _props.titleClassName,
500 | className = _props.className,
501 | props = objectWithoutProperties(_props, ['componentClass', 'titleClassName', 'className']);
502 |
503 | var Component = componentClass;
504 | return React.createElement(
505 | Component,
506 | _extends({}, props, { className: classNames(className, titleClassName) }),
507 | this.props.children
508 | );
509 | }
510 | }]);
511 | return CardTitle;
512 | }(React.Component);
513 |
514 | CardTitle.propTypes = {
515 | children: PropTypes.node,
516 | className: PropTypes.string,
517 | componentClass: PropTypes.string,
518 | titleClassName: PropTypes.string
519 | };
520 |
521 | CardTitle.defaultProps = {
522 | componentClass: 'h3',
523 | titleClassName: 'panel-title'
524 | };
525 |
526 | var CardFooter = function (_React$Component) {
527 | inherits(CardFooter, _React$Component);
528 |
529 | function CardFooter(props) {
530 | classCallCheck(this, CardFooter);
531 | return possibleConstructorReturn(this, (CardFooter.__proto__ || Object.getPrototypeOf(CardFooter)).call(this, props));
532 | }
533 |
534 | createClass(CardFooter, [{
535 | key: 'render',
536 | value: function render() {
537 | var _props = this.props,
538 | componentClass = _props.componentClass,
539 | footerClassName = _props.footerClassName,
540 | className = _props.className,
541 | props = objectWithoutProperties(_props, ['componentClass', 'footerClassName', 'className']);
542 |
543 | var Component = componentClass;
544 | return React.createElement(
545 | Component,
546 | _extends({}, props, { className: classNames(className, footerClassName) }),
547 | this.props.children
548 | );
549 | }
550 | }]);
551 | return CardFooter;
552 | }(React.Component);
553 |
554 | CardFooter.propTypes = {
555 | children: PropTypes.node,
556 | className: PropTypes.string,
557 | componentClass: PropTypes.string,
558 | footerClassName: PropTypes.string
559 | };
560 |
561 | CardFooter.defaultProps = {
562 | componentClass: 'div',
563 | footerClassName: 'panel-footer'
564 | };
565 |
566 | var CardBody = function (_React$Component) {
567 | inherits(CardBody, _React$Component);
568 |
569 | function CardBody() {
570 | classCallCheck(this, CardBody);
571 | return possibleConstructorReturn(this, (CardBody.__proto__ || Object.getPrototypeOf(CardBody)).apply(this, arguments));
572 | }
573 |
574 | createClass(CardBody, [{
575 | key: 'render',
576 | value: function render() {
577 | return React.createElement(
578 | reactBootstrap.Panel.Body,
579 | this.props,
580 | this.props.children
581 | );
582 | }
583 | }]);
584 | return CardBody;
585 | }(React.Component);
586 |
587 | CardBody.propTypes = {
588 | children: PropTypes.node
589 | };
590 |
591 | var SummaryItem = function (_React$Component) {
592 | inherits(SummaryItem, _React$Component);
593 |
594 | function SummaryItem(props) {
595 | classCallCheck(this, SummaryItem);
596 | return possibleConstructorReturn(this, (SummaryItem.__proto__ || Object.getPrototypeOf(SummaryItem)).call(this, props));
597 | }
598 |
599 | createClass(SummaryItem, [{
600 | key: 'render',
601 | value: function render() {
602 | var _props = this.props,
603 | componentClass = _props.componentClass,
604 | itemClassName = _props.itemClassName,
605 | className = _props.className,
606 | props = objectWithoutProperties(_props, ['componentClass', 'itemClassName', 'className']);
607 |
608 | var Component = componentClass;
609 | return React.createElement(
610 | Component,
611 | _extends({}, props, { className: classNames(className, itemClassName) }),
612 | this.props.children
613 | );
614 | }
615 | }]);
616 | return SummaryItem;
617 | }(React.Component);
618 |
619 | SummaryItem.propTypes = {
620 | children: PropTypes.node,
621 | className: PropTypes.string,
622 | componentClass: PropTypes.string,
623 | itemClassName: PropTypes.string
624 | };
625 |
626 | SummaryItem.defaultProps = {
627 | componentClass: 'a',
628 | itemClassName: 'bootcards-summary-item'
629 | };
630 |
631 | var ChartCanvas = function (_React$Component) {
632 | inherits(ChartCanvas, _React$Component);
633 |
634 | function ChartCanvas(props) {
635 | classCallCheck(this, ChartCanvas);
636 | return possibleConstructorReturn(this, (ChartCanvas.__proto__ || Object.getPrototypeOf(ChartCanvas)).call(this, props));
637 | }
638 |
639 | createClass(ChartCanvas, [{
640 | key: 'render',
641 | value: function render() {
642 | var _props = this.props,
643 | componentClass = _props.componentClass,
644 | canvasClassName = _props.canvasClassName,
645 | className = _props.className,
646 | props = objectWithoutProperties(_props, ['componentClass', 'canvasClassName', 'className']);
647 |
648 | var Component = componentClass;
649 | return React.createElement(
650 | Component,
651 | _extends({}, props, { className: classNames(className, canvasClassName) }),
652 | this.props.children
653 | );
654 | }
655 | }]);
656 | return ChartCanvas;
657 | }(React.Component);
658 |
659 | ChartCanvas.propTypes = {
660 | canvasClassName: PropTypes.string,
661 | children: PropTypes.node,
662 | className: PropTypes.string,
663 | componentClass: PropTypes.string
664 | };
665 |
666 | ChartCanvas.defaultProps = {
667 | componentClass: 'div',
668 | canvasClassName: 'bootcards-chart-canvas'
669 | };
670 |
671 | exports.Container = Container;
672 | exports.Cards = Cards;
673 | exports.List = List;
674 | exports.ListGroupItemHeader = ListGroupItemHeader;
675 | exports.ListGroupItemText = ListGroupItemText;
676 | exports.Card = Card;
677 | exports.CardHeader = CardHeader;
678 | exports.CardTitle = CardTitle;
679 | exports.CardFooter = CardFooter;
680 | exports.CardBody = CardBody;
681 | exports.SummaryItem = SummaryItem;
682 | exports.ChartCanvas = ChartCanvas;
683 |
684 | Object.defineProperty(exports, '__esModule', { value: true });
685 |
686 | })));
687 |
--------------------------------------------------------------------------------