├── .babelrc
├── .gitignore
├── .idea
└── workspace.xml
├── .npmignore
├── .travis.yml
├── LICENSE
├── README.md
├── docs
└── index.html
├── doczrc.js
├── lib
├── components
│ ├── Alert
│ │ ├── Alert.js
│ │ ├── AlertClose.js
│ │ └── index.js
│ ├── Badge
│ │ ├── Badge.js
│ │ └── index.js
│ ├── Button
│ │ ├── Button.js
│ │ └── index.js
│ ├── Card
│ │ ├── Card.js
│ │ ├── CardBody.js
│ │ ├── CardFooter.js
│ │ ├── CardHeader.js
│ │ ├── CardTitle.js
│ │ └── index.js
│ ├── Container
│ │ ├── Container.js
│ │ └── index.js
│ ├── Divider
│ │ ├── Divider.js
│ │ └── index.js
│ ├── Drop
│ │ ├── Drop.js
│ │ ├── DropContainer.js
│ │ └── index.js
│ ├── Dropdown
│ │ ├── Dropdown.js
│ │ └── index.js
│ ├── Flex
│ │ ├── Flex.js
│ │ └── index.js
│ ├── Form
│ │ ├── Form.js
│ │ ├── FormControls.js
│ │ ├── FormFieldset.js
│ │ ├── FormLegend.js
│ │ └── index.js
│ ├── Grid
│ │ ├── Grid.js
│ │ ├── GridItem.js
│ │ └── index.js
│ ├── Input
│ │ ├── Input.js
│ │ ├── InputCheckbox.js
│ │ ├── InputLabel.js
│ │ ├── InputRadio.js
│ │ ├── InputTextarea.js
│ │ └── index.js
│ ├── Label
│ │ ├── Label.js
│ │ └── index.js
│ ├── Margin
│ │ ├── Margin.js
│ │ └── index.js
│ ├── Modal
│ │ └── Modal.js
│ ├── Progress
│ │ ├── Progress.js
│ │ └── index.js
│ ├── Select
│ │ ├── Select.js
│ │ ├── SelectOption.js
│ │ └── index.js
│ ├── Spinner
│ │ ├── Spinner.js
│ │ └── index.js
│ ├── Tab
│ │ ├── Tab.js
│ │ ├── TabItem.js
│ │ └── index.js
│ ├── Table
│ │ ├── Table.js
│ │ ├── TableBody.js
│ │ ├── TableCaption.js
│ │ ├── TableCell.js
│ │ ├── TableFooter.js
│ │ ├── TableHead.js
│ │ ├── TableRow.js
│ │ └── index.js
│ └── Tooltip
│ │ ├── Tooltip.js
│ │ └── index.js
└── index.js
├── netlify.toml
├── package-lock.json
├── package.json
├── src
├── components
│ ├── Alert
│ │ ├── Alert.js
│ │ ├── Alert.mdx
│ │ ├── AlertClose.js
│ │ └── index.js
│ ├── Badge
│ │ ├── Badge.js
│ │ ├── Badge.mdx
│ │ └── index.js
│ ├── Breadcrumb
│ │ ├── Breadcrumb.js
│ │ ├── Breadcrumb.mdx
│ │ ├── BreadcrumbItem.js
│ │ └── index.js
│ ├── Button
│ │ ├── Button.js
│ │ ├── Button.mdx
│ │ ├── ButtonGroup.js
│ │ └── index.js
│ ├── Card
│ │ ├── Card.js
│ │ ├── Card.mdx
│ │ ├── CardBody.js
│ │ ├── CardFooter.js
│ │ ├── CardHeader.js
│ │ ├── CardTitle.js
│ │ └── index.js
│ ├── Container
│ │ ├── Container.js
│ │ ├── Container.mdx
│ │ └── index.js
│ ├── Divider
│ │ ├── Divider.js
│ │ ├── Divider.mdx
│ │ └── index.js
│ ├── Drop
│ │ ├── Drop.js
│ │ ├── Drop.mdx
│ │ ├── DropContainer.js
│ │ └── index.js
│ ├── Dropdown
│ │ ├── Dropdown.js
│ │ ├── Dropdown.mdx
│ │ ├── DropdownContainer.js
│ │ └── index.js
│ ├── Flex
│ │ ├── Flex.js
│ │ ├── Flex.mdx
│ │ └── index.js
│ ├── Form
│ │ ├── Form.js
│ │ ├── Form.mdx
│ │ ├── FormControls.js
│ │ ├── FormFieldset.js
│ │ ├── FormLegend.js
│ │ └── index.js
│ ├── Grid
│ │ ├── Grid.js
│ │ ├── Grid.mdx
│ │ ├── GridItem.js
│ │ └── index.js
│ ├── Input
│ │ ├── Input.js
│ │ ├── Input.mdx
│ │ ├── InputCheckbox.js
│ │ ├── InputLabel.js
│ │ ├── InputRadio.js
│ │ ├── InputTextarea.js
│ │ └── index.js
│ ├── Label
│ │ ├── Label.js
│ │ ├── Label.mdx
│ │ └── index.js
│ ├── Link
│ │ ├── Link.js
│ │ ├── Link.mdx
│ │ └── index.js
│ ├── List
│ │ ├── List.js
│ │ ├── List.mdx
│ │ ├── ListItem.js
│ │ └── index.js
│ ├── Margin
│ │ ├── Margin.js
│ │ ├── Margin.mdx
│ │ └── index.js
│ ├── Modal
│ │ └── Modal.js
│ ├── Nav
│ │ ├── Nav.js
│ │ ├── Nav.mdx
│ │ ├── NavDivider.js
│ │ ├── NavHeader.js
│ │ ├── NavItem.js
│ │ └── index.js
│ ├── Navbar
│ │ ├── Navbar.js
│ │ ├── Navbar.mdx
│ │ └── index.js
│ ├── Placeholder
│ │ ├── Placeholder.js
│ │ ├── Placeholder.mdx
│ │ └── index.js
│ ├── Progress
│ │ ├── Progress.js
│ │ ├── Progress.mdx
│ │ └── index.js
│ ├── Select
│ │ ├── Select.js
│ │ ├── Select.mdx
│ │ ├── SelectOption.js
│ │ └── index.js
│ ├── Spinner
│ │ ├── Spinner.js
│ │ ├── Spinner.mdx
│ │ └── index.js
│ ├── Tab
│ │ ├── Tab.js
│ │ ├── Tab.mdx
│ │ ├── TabItem.js
│ │ └── index.js
│ ├── Table
│ │ ├── Table.js
│ │ ├── Table.mdx
│ │ ├── TableBody.js
│ │ ├── TableCaption.js
│ │ ├── TableCell.js
│ │ ├── TableFooter.js
│ │ ├── TableHead.js
│ │ ├── TableRow.js
│ │ └── index.js
│ ├── Tooltip
│ │ ├── Tooltip.js
│ │ ├── Tooltip.mdx
│ │ └── index.js
│ └── Width
│ │ ├── Width.js
│ │ ├── Width.mdx
│ │ └── index.js
├── index.js
└── index.mdx
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "react",
5 | "stage-1"
6 | ],
7 | "plugins": [
8 | "transform-class-properties"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | lib
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | coverage
8 | .coverage
9 | .nyc_output
10 | node_modules/
11 | jspm_packages/
12 | .npm
13 | .yarn-integrity
14 | .docz/
15 | .netlify/
16 | .idea/
17 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .coverage
2 | *.mdx
3 | docs
4 | src
5 | test
6 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 |
3 | language: node_js
4 |
5 | node_js:
6 | - node
7 |
8 | before_install:
9 | - npm i -g npm@latest
10 |
11 | script:
12 | - npm run bundle
13 |
14 | notifications:
15 | email:
16 | on_success: never
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Ompmega
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # React UIkit · [](https://travis-ci.com/ompmega/react-uikit)
4 | UIkit components for ReactJS.
5 |
6 | ## Getting Started
7 | - Install UIkit [here](https://github.com/uikit/uikit#getting-started)
8 | - Install React UIkit using `yarn add react-uikit` or `npm install react-uikit`
9 |
10 | ## Documentation
11 | * [React UIkit Docs](https://react-uikit.ompmega.com)
12 | * [UIkit Docs](https://getuikit.com/docs/introduction)
13 |
14 | ## License
15 | MIT
16 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ title }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/doczrc.js:
--------------------------------------------------------------------------------
1 | import { babel } from 'docz-plugin-babel6'
2 |
3 | export default {
4 | title: 'react-uikit',
5 | indexHtml: './docs/index.html',
6 | plugins: [babel()],
7 | themeConfig: {
8 | logo: {
9 | src: 'https://cdn-std.dprcdn.net/files/acc_649651/giLUIa?download',
10 | width: 170,
11 | },
12 | },
13 | }
14 |
--------------------------------------------------------------------------------
/lib/components/Alert/AlertClose.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var AlertClose = function AlertClose(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-alert-close');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className,
30 | 'data-uk-close': ''
31 | }, rest));
32 | };
33 |
34 | AlertClose.defaultProps = {
35 | component: 'a'
36 | };
37 |
38 | exports.default = AlertClose;
--------------------------------------------------------------------------------
/lib/components/Alert/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.AlertClose = undefined;
7 |
8 | var _Alert = require('./Alert');
9 |
10 | var _Alert2 = _interopRequireDefault(_Alert);
11 |
12 | var _AlertClose2 = require('./AlertClose');
13 |
14 | var _AlertClose3 = _interopRequireDefault(_AlertClose2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Alert2.default;
19 | exports.AlertClose = _AlertClose3.default;
--------------------------------------------------------------------------------
/lib/components/Badge/Badge.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var Badge = function Badge(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-badge');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | Badge.defaultProps = {
34 | component: 'span'
35 | };
36 |
37 | exports.default = Badge;
--------------------------------------------------------------------------------
/lib/components/Badge/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Badge = require('./Badge');
8 |
9 | var _Badge2 = _interopRequireDefault(_Badge);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Badge2.default;
--------------------------------------------------------------------------------
/lib/components/Button/Button.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _ButtonGroup = require('./ButtonGroup');
22 |
23 | var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
24 |
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26 |
27 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28 |
29 | 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; }
30 |
31 | var Button = function Button(props) {
32 | var _classNames;
33 |
34 | var customClassName = props.className,
35 | component = props.component,
36 | variant = props.variant,
37 | small = props.small,
38 | large = props.large,
39 | href = props.href,
40 | type = props.type,
41 | block = props.block,
42 | size = props.size,
43 | rest = _objectWithoutProperties(props, ['className', 'component', 'variant', 'small', 'large', 'href', 'type', 'block', 'size']);
44 |
45 | var className = (0, _classnames2.default)(customClassName, 'uk-button', (_classNames = {}, _defineProperty(_classNames, 'uk-button-' + variant, variant), _defineProperty(_classNames, 'uk-button-small', small || size === 'small'), _defineProperty(_classNames, 'uk-button-large', large || size === 'large'), _defineProperty(_classNames, 'uk-width-1-1', block), _classNames));
46 |
47 | if (!!href) return _react2.default.createElement('a', _extends({
48 | href: href,
49 | className: className
50 | }, rest));
51 |
52 | if (component === 'button') return _react2.default.createElement('button', _extends({
53 | type: type,
54 | className: className
55 | }, rest));
56 |
57 | return _react2.default.createElement(component, _extends({
58 | className: className
59 | }, rest));
60 | };
61 |
62 | Button.propTypes = {
63 | variant: _propTypes2.default.oneOf(['default', 'primary', 'secondary', 'danger', 'text', 'link']),
64 | size: _propTypes2.default.oneOf(['small', 'large']),
65 | small: _propTypes2.default.bool,
66 | large: _propTypes2.default.bool,
67 | block: _propTypes2.default.bool
68 | };
69 |
70 | Button.defaultProps = {
71 | component: 'button',
72 | type: 'button',
73 | variant: 'default',
74 | small: false,
75 | large: false,
76 | block: false
77 |
78 | // Sub-components
79 | };Button.Group = _ButtonGroup2.default;
80 |
81 | exports.default = Button;
--------------------------------------------------------------------------------
/lib/components/Button/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.ButtonGroup = undefined;
7 |
8 | var _Button = require('./Button');
9 |
10 | var _Button2 = _interopRequireDefault(_Button);
11 |
12 | var _ButtonGroup2 = require('./ButtonGroup');
13 |
14 | var _ButtonGroup3 = _interopRequireDefault(_ButtonGroup2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Button2.default;
19 | exports.ButtonGroup = _ButtonGroup3.default;
--------------------------------------------------------------------------------
/lib/components/Card/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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _CardTitle = require('./CardTitle');
22 |
23 | var _CardTitle2 = _interopRequireDefault(_CardTitle);
24 |
25 | var _CardBody = require('./CardBody');
26 |
27 | var _CardBody2 = _interopRequireDefault(_CardBody);
28 |
29 | var _CardHeader = require('./CardHeader');
30 |
31 | var _CardHeader2 = _interopRequireDefault(_CardHeader);
32 |
33 | var _CardFooter = require('./CardFooter');
34 |
35 | var _CardFooter2 = _interopRequireDefault(_CardFooter);
36 |
37 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38 |
39 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
40 |
41 | 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; }
42 |
43 | var Card = function Card(props) {
44 | var _classNames;
45 |
46 | var customClassName = props.className,
47 | component = props.component,
48 | variant = props.variant,
49 | body = props.body,
50 | rest = _objectWithoutProperties(props, ['className', 'component', 'variant', 'body']);
51 |
52 | var className = (0, _classnames2.default)(customClassName, 'uk-card', (_classNames = {}, _defineProperty(_classNames, 'uk-card-' + variant, !!variant), _defineProperty(_classNames, 'uk-card-body', body), _classNames));
53 |
54 | return _react2.default.createElement(component, _extends({
55 | className: className
56 | }, rest));
57 | };
58 |
59 | Card.propTypes = {
60 | variant: _propTypes2.default.oneOf(['default', 'primary', 'secondary']),
61 | body: _propTypes2.default.bool
62 | };
63 |
64 | Card.defaultProps = {
65 | component: 'div',
66 | variant: 'default',
67 | body: false
68 |
69 | // Sub-components
70 | };Card.Title = _CardTitle2.default;
71 | Card.Body = _CardBody2.default;
72 | Card.Header = _CardHeader2.default;
73 | Card.Footer = _CardFooter2.default;
74 |
75 | exports.default = Card;
--------------------------------------------------------------------------------
/lib/components/Card/CardBody.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var CardBody = function CardBody(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-card-body');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | CardBody.defaultProps = {
34 | component: 'div'
35 | };
36 |
37 | exports.default = CardBody;
--------------------------------------------------------------------------------
/lib/components/Card/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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var CardFooter = function CardFooter(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-card-footer');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | CardFooter.defaultProps = {
34 | component: 'div'
35 | };
36 |
37 | exports.default = CardFooter;
--------------------------------------------------------------------------------
/lib/components/Card/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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var CardHeader = function CardHeader(props) {
26 | var customClassName = props.className,
27 | component = props.component,
28 | rest = _objectWithoutProperties(props, ['className', 'component']);
29 |
30 | var className = (0, _classnames2.default)(customClassName, 'uk-card-header');
31 |
32 | return _react2.default.createElement(component, _extends({
33 | className: className
34 | }, rest));
35 | };
36 |
37 | CardHeader.defaultProps = {
38 | component: 'div'
39 | };
40 |
41 | exports.default = CardHeader;
--------------------------------------------------------------------------------
/lib/components/Card/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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var CardTitle = function CardTitle(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-card-title');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | CardTitle.defaultProps = {
34 | component: 'h3'
35 | };
36 |
37 | exports.default = CardTitle;
--------------------------------------------------------------------------------
/lib/components/Card/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.CardFooter = exports.CardHeader = exports.CardBody = exports.CardTitle = undefined;
7 |
8 | var _Card = require('./Card');
9 |
10 | var _Card2 = _interopRequireDefault(_Card);
11 |
12 | var _CardTitle2 = require('./CardTitle');
13 |
14 | var _CardTitle3 = _interopRequireDefault(_CardTitle2);
15 |
16 | var _CardBody2 = require('./CardBody');
17 |
18 | var _CardBody3 = _interopRequireDefault(_CardBody2);
19 |
20 | var _CardHeader2 = require('./CardHeader');
21 |
22 | var _CardHeader3 = _interopRequireDefault(_CardHeader2);
23 |
24 | var _CardFooter2 = require('./CardFooter');
25 |
26 | var _CardFooter3 = _interopRequireDefault(_CardFooter2);
27 |
28 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29 |
30 | exports.default = _Card2.default;
31 | exports.CardTitle = _CardTitle3.default;
32 | exports.CardBody = _CardBody3.default;
33 | exports.CardHeader = _CardHeader3.default;
34 | exports.CardFooter = _CardFooter3.default;
--------------------------------------------------------------------------------
/lib/components/Container/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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var Container = function Container(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-container');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | Container.defaultProps = {
34 | component: 'div'
35 | };
36 |
37 | exports.default = Container;
--------------------------------------------------------------------------------
/lib/components/Container/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Container = require('./Container');
8 |
9 | var _Container2 = _interopRequireDefault(_Container);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Container2.default;
--------------------------------------------------------------------------------
/lib/components/Divider/Divider.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var Divider = function Divider(props) {
26 | var customClassName = props.className,
27 | component = props.component,
28 | icon = props.icon,
29 | small = props.small,
30 | rest = _objectWithoutProperties(props, ['className', 'component', 'icon', 'small']);
31 |
32 | var className = (0, _classnames2.default)(customClassName, {
33 | 'uk-divider-icon': icon,
34 | 'uk-divider-small': small
35 | });
36 |
37 | return _react2.default.createElement(component, _extends({
38 | className: className
39 | }, rest));
40 | };
41 |
42 | Divider.propTypes = {
43 | icon: _propTypes2.default.bool,
44 | small: _propTypes2.default.bool
45 | };
46 |
47 | Divider.defaultProps = {
48 | component: 'hr',
49 | icon: false,
50 | small: false
51 | };
52 |
53 | exports.default = Divider;
--------------------------------------------------------------------------------
/lib/components/Divider/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Divider = require('./Divider');
8 |
9 | var _Divider2 = _interopRequireDefault(_Divider);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Divider2.default;
--------------------------------------------------------------------------------
/lib/components/Drop/DropContainer.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var DropContainer = function DropContainer(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-inline');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | DropContainer.defaultProps = {
34 | component: 'div'
35 | };
36 |
37 | exports.default = DropContainer;
--------------------------------------------------------------------------------
/lib/components/Drop/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.DropContainer = undefined;
7 |
8 | var _Drop = require('./Drop');
9 |
10 | var _Drop2 = _interopRequireDefault(_Drop);
11 |
12 | var _DropContainer2 = require('./DropContainer');
13 |
14 | var _DropContainer3 = _interopRequireDefault(_DropContainer2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Drop2.default;
19 | exports.DropContainer = _DropContainer3.default;
--------------------------------------------------------------------------------
/lib/components/Dropdown/Dropdown.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _react = require('react');
8 |
9 | var _react2 = _interopRequireDefault(_react);
10 |
11 | var _uikit = require('uikit');
12 |
13 | var _uikit2 = _interopRequireDefault(_uikit);
14 |
15 | var _Drop2 = require('../Drop/Drop');
16 |
17 | var _Drop3 = _interopRequireDefault(_Drop2);
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 Dropdown = function (_Drop) {
28 | _inherits(Dropdown, _Drop);
29 |
30 | function Dropdown() {
31 | var _ref;
32 |
33 | var _temp, _this, _ret;
34 |
35 | _classCallCheck(this, Dropdown);
36 |
37 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
38 | args[_key] = arguments[_key];
39 | }
40 |
41 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call.apply(_ref, [this].concat(args))), _this), _this.registerComponent = function () {
42 | _this.component = _uikit2.default.dropdown(_this.node, _this.getOptions());
43 | }, _temp), _possibleConstructorReturn(_this, _ret);
44 | }
45 |
46 | return Dropdown;
47 | }(_Drop3.default);
48 |
49 | // Sub-component
50 |
51 |
52 | Dropdown.Container = _Drop3.default.Container;
53 |
54 | exports.default = Dropdown;
--------------------------------------------------------------------------------
/lib/components/Dropdown/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.DropdownContainer = undefined;
7 |
8 | var _Dropdown = require('./Dropdown');
9 |
10 | var _Dropdown2 = _interopRequireDefault(_Dropdown);
11 |
12 | var _DropContainer = require('../Drop/DropContainer');
13 |
14 | var _DropContainer2 = _interopRequireDefault(_DropContainer);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Dropdown2.default;
19 | exports.DropdownContainer = _DropContainer2.default;
--------------------------------------------------------------------------------
/lib/components/Flex/Flex.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 | var Flex = function Flex(props) {
28 | var component = props.component,
29 | customClassName = props.className,
30 | inline = props.inline,
31 | align = props.align,
32 | rest = _objectWithoutProperties(props, ['component', 'className', 'inline', 'align']);
33 |
34 | var className = (0, _classnames2.default)(customClassName, _defineProperty({
35 | 'uk-flex': !inline,
36 | 'uk-flex-inline': inline
37 | }, 'uk-flex-' + align, !!align));
38 |
39 | return _react2.default.createElement(component, _extends({
40 | className: className
41 | }, rest));
42 | };
43 |
44 | Flex.propTypes = {
45 | inline: _propTypes2.default.bool,
46 | align: _propTypes2.default.oneOf(['left', 'center', 'right', 'between', 'around', 'stretch', 'top', 'middle', 'bottom'])
47 | };
48 |
49 | Flex.defaultProps = {
50 | component: 'div',
51 | inline: false
52 | };
53 |
54 | exports.default = Flex;
--------------------------------------------------------------------------------
/lib/components/Flex/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Flex = require('./Flex');
8 |
9 | var _Flex2 = _interopRequireDefault(_Flex);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Flex2.default;
--------------------------------------------------------------------------------
/lib/components/Form/Form.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _FormFieldset = require('./FormFieldset');
22 |
23 | var _FormFieldset2 = _interopRequireDefault(_FormFieldset);
24 |
25 | var _FormLegend = require('./FormLegend');
26 |
27 | var _FormLegend2 = _interopRequireDefault(_FormLegend);
28 |
29 | var _FormControls = require('./FormControls');
30 |
31 | var _FormControls2 = _interopRequireDefault(_FormControls);
32 |
33 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34 |
35 | 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; }
36 |
37 | var Form = function Form(props) {
38 | var customClassName = props.className,
39 | stacked = props.stacked,
40 | horizontal = props.horizontal,
41 | rest = _objectWithoutProperties(props, ['className', 'stacked', 'horizontal']);
42 |
43 | var className = (0, _classnames2.default)(customClassName, {
44 | 'uk-form-stacked': stacked,
45 | 'uk-form-horizontal': horizontal
46 | });
47 |
48 | return _react2.default.createElement('form', _extends({
49 | className: className
50 | }, rest));
51 | };
52 |
53 | Form.propTypes = {
54 | onSubmit: _propTypes2.default.any,
55 | method: _propTypes2.default.oneOf(['get', 'post']),
56 | action: _propTypes2.default.string,
57 | stacked: _propTypes2.default.bool,
58 | horizontal: _propTypes2.default.bool
59 | };
60 |
61 | Form.defaultProps = {
62 | stacked: false,
63 | horizontal: false
64 |
65 | // Sub-components
66 | };Form.Fieldset = _FormFieldset2.default;
67 | Form.Legend = _FormLegend2.default;
68 | Form.Controls = _FormControls2.default;
69 |
70 | exports.default = Form;
--------------------------------------------------------------------------------
/lib/components/Form/FormControls.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var FormControls = function FormControls(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | rest = _objectWithoutProperties(props, ['className', 'component']);
25 |
26 | var className = (0, _classnames2.default)(customClassName, 'uk-form-controls');
27 |
28 | return _react2.default.createElement(component, _extends({
29 | className: className
30 | }, rest));
31 | };
32 |
33 | FormControls.defaultProps = {
34 | component: 'div'
35 | };
36 |
37 | exports.default = FormControls;
--------------------------------------------------------------------------------
/lib/components/Form/FormFieldset.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var FormFieldset = function FormFieldset(props) {
22 | var customClassName = props.className,
23 | rest = _objectWithoutProperties(props, ['className']);
24 |
25 | var className = (0, _classnames2.default)(customClassName, 'uk-fieldset');
26 |
27 | return _react2.default.createElement('fieldset', _extends({
28 | className: className
29 | }, rest));
30 | };
31 |
32 | exports.default = FormFieldset;
--------------------------------------------------------------------------------
/lib/components/Form/FormLegend.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _classnames = require('classnames');
14 |
15 | var _classnames2 = _interopRequireDefault(_classnames);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var FormLegend = function FormLegend(props) {
22 | var customClassName = props.className,
23 | rest = _objectWithoutProperties(props, ['className']);
24 |
25 | var className = (0, _classnames2.default)(customClassName, 'uk-legend');
26 |
27 | return _react2.default.createElement('legend', _extends({
28 | className: className
29 | }, rest));
30 | };
31 |
32 | exports.default = FormLegend;
--------------------------------------------------------------------------------
/lib/components/Form/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.FormControls = exports.FormLegend = exports.FormFieldset = undefined;
7 |
8 | var _Form = require('./Form');
9 |
10 | var _Form2 = _interopRequireDefault(_Form);
11 |
12 | var _FormFieldset2 = require('./FormFieldset');
13 |
14 | var _FormFieldset3 = _interopRequireDefault(_FormFieldset2);
15 |
16 | var _FormLegend2 = require('./FormLegend');
17 |
18 | var _FormLegend3 = _interopRequireDefault(_FormLegend2);
19 |
20 | var _FormControls2 = require('./FormControls');
21 |
22 | var _FormControls3 = _interopRequireDefault(_FormControls2);
23 |
24 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25 |
26 | exports.default = _Form2.default;
27 | exports.FormFieldset = _FormFieldset3.default;
28 | exports.FormLegend = _FormLegend3.default;
29 | exports.FormControls = _FormControls3.default;
--------------------------------------------------------------------------------
/lib/components/Grid/Grid.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 _react = require('react');
12 |
13 | var _react2 = _interopRequireDefault(_react);
14 |
15 | var _propTypes = require('prop-types');
16 |
17 | var _propTypes2 = _interopRequireDefault(_propTypes);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | var _uikit = require('uikit');
24 |
25 | var _uikit2 = _interopRequireDefault(_uikit);
26 |
27 | var _GridItem = require('./GridItem');
28 |
29 | var _GridItem2 = _interopRequireDefault(_GridItem);
30 |
31 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32 |
33 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
34 |
35 | 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; }
36 |
37 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
38 |
39 | 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; }
40 |
41 | 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; }
42 |
43 | var widthSizes = ['1-1', '1-2', '1-3', '2-3', '1-4', '3-4', '1-5', '4-5', '1-6', '5-6', 'auto', 'expand'];
44 |
45 | var Grid = function (_React$Component) {
46 | _inherits(Grid, _React$Component);
47 |
48 | function Grid() {
49 | var _ref;
50 |
51 | var _temp, _this, _ret;
52 |
53 | _classCallCheck(this, Grid);
54 |
55 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
56 | args[_key] = arguments[_key];
57 | }
58 |
59 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Grid.__proto__ || Object.getPrototypeOf(Grid)).call.apply(_ref, [this].concat(args))), _this), _this.setRef = function (ref) {
60 | return _this.node = ref;
61 | }, _temp), _possibleConstructorReturn(_this, _ret);
62 | }
63 |
64 | _createClass(Grid, [{
65 | key: 'componentDidMount',
66 | value: function componentDidMount() {
67 | this.component = _uikit2.default.grid(this.node);
68 | }
69 | }, {
70 | key: 'render',
71 | value: function render() {
72 | var _classNames;
73 |
74 | var _props = this.props,
75 | customClassName = _props.className,
76 | component = _props.component,
77 | gutter = _props.gutter,
78 | divider = _props.divider,
79 | match = _props.match,
80 | xs = _props.xs,
81 | sm = _props.sm,
82 | md = _props.md,
83 | lg = _props.lg,
84 | xl = _props.xl,
85 | rest = _objectWithoutProperties(_props, ['className', 'component', 'gutter', 'divider', 'match', 'xs', 'sm', 'md', 'lg', 'xl']);
86 |
87 | var className = (0, _classnames2.default)(customClassName, (_classNames = {}, _defineProperty(_classNames, 'uk-grid-' + gutter, gutter), _defineProperty(_classNames, 'uk-grid-divider', divider), _defineProperty(_classNames, 'uk-grid-match', match), _defineProperty(_classNames, 'uk-child-width-' + xs, !!xs), _defineProperty(_classNames, 'uk-child-width-' + sm + '@s', !!sm), _defineProperty(_classNames, 'uk-child-width-' + md + '@m', !!md), _defineProperty(_classNames, 'uk-child-width-' + lg + '@l', !!lg), _defineProperty(_classNames, 'uk-child-width-' + xl + '@xl', !!xl), _classNames));
88 |
89 | return _react2.default.createElement(component, _extends({
90 | ref: this.setRef,
91 | className: className
92 | }, rest));
93 | }
94 | }]);
95 |
96 | return Grid;
97 | }(_react2.default.Component);
98 |
99 | Grid.propTypes = {
100 | className: _propTypes2.default.string,
101 | gutter: _propTypes2.default.string,
102 | divider: _propTypes2.default.bool,
103 | match: _propTypes2.default.bool,
104 | xs: _propTypes2.default.oneOf(widthSizes),
105 | sm: _propTypes2.default.oneOf(widthSizes),
106 | md: _propTypes2.default.oneOf(widthSizes),
107 | lg: _propTypes2.default.oneOf(widthSizes),
108 | xl: _propTypes2.default.oneOf(widthSizes)
109 | };
110 | Grid.defaultProps = {
111 | component: 'div',
112 | className: '',
113 | gutter: 'medium',
114 | divider: false,
115 | match: false
116 | };
117 |
118 |
119 | Grid.Item = _GridItem2.default;
120 |
121 | exports.default = Grid;
--------------------------------------------------------------------------------
/lib/components/Grid/GridItem.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _react = require('react');
8 |
9 | var _react2 = _interopRequireDefault(_react);
10 |
11 | var _Width2 = require('../Width/Width');
12 |
13 | var _Width3 = _interopRequireDefault(_Width2);
14 |
15 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16 |
17 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18 |
19 | 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; }
20 |
21 | 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; }
22 |
23 | var GridItem = function (_Width) {
24 | _inherits(GridItem, _Width);
25 |
26 | function GridItem() {
27 | _classCallCheck(this, GridItem);
28 |
29 | return _possibleConstructorReturn(this, (GridItem.__proto__ || Object.getPrototypeOf(GridItem)).apply(this, arguments));
30 | }
31 |
32 | return GridItem;
33 | }(_Width3.default);
34 |
35 | exports.default = GridItem;
--------------------------------------------------------------------------------
/lib/components/Grid/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.GridItem = undefined;
7 |
8 | var _Grid = require('./Grid');
9 |
10 | var _Grid2 = _interopRequireDefault(_Grid);
11 |
12 | var _GridItem2 = require('./GridItem');
13 |
14 | var _GridItem3 = _interopRequireDefault(_GridItem2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Grid2.default;
19 | exports.GridItem = _GridItem3.default;
--------------------------------------------------------------------------------
/lib/components/Input/Input.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _InputLabel = require('./InputLabel');
22 |
23 | var _InputLabel2 = _interopRequireDefault(_InputLabel);
24 |
25 | var _InputCheckbox = require('./InputCheckbox');
26 |
27 | var _InputCheckbox2 = _interopRequireDefault(_InputCheckbox);
28 |
29 | var _InputRadio = require('./InputRadio');
30 |
31 | var _InputRadio2 = _interopRequireDefault(_InputRadio);
32 |
33 | var _InputTextarea = require('./InputTextarea');
34 |
35 | var _InputTextarea2 = _interopRequireDefault(_InputTextarea);
36 |
37 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38 |
39 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
40 |
41 | 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; }
42 |
43 | var Input = function Input(props) {
44 | var customClassName = props.className,
45 | size = props.size,
46 | rest = _objectWithoutProperties(props, ['className', 'size']);
47 |
48 | var className = (0, _classnames2.default)(customClassName, 'uk-input', _defineProperty({}, 'uk-form-' + size, !!size));
49 |
50 | return _react2.default.createElement('input', _extends({
51 | className: className
52 | }, rest));
53 | };
54 |
55 | Input.propTypes = {
56 | placeholder: _propTypes2.default.string,
57 | value: _propTypes2.default.any,
58 | disabled: _propTypes2.default.bool,
59 | size: _propTypes2.default.oneOf(['small', 'large'])
60 | };
61 |
62 | Input.defaultProps = {
63 | disabled: false
64 |
65 | // Sub-components
66 | };Input.Label = _InputLabel2.default;
67 | Input.Checkbox = _InputCheckbox2.default;
68 | Input.Radio = _InputRadio2.default;
69 | Input.Textarea = _InputTextarea2.default;
70 |
71 | exports.default = Input;
--------------------------------------------------------------------------------
/lib/components/Input/InputCheckbox.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var InputCheckbox = function InputCheckbox(props) {
26 | var customClassName = props.className,
27 | children = props.children,
28 | rest = _objectWithoutProperties(props, ['className', 'children']);
29 |
30 | var className = (0, _classnames2.default)(customClassName, 'uk-checkbox');
31 |
32 | return _react2.default.createElement('input', _extends({
33 | className: className,
34 | type: 'checkbox'
35 | }, rest));
36 | };
37 |
38 | InputCheckbox.propTypes = {
39 | name: _propTypes2.default.string,
40 | checked: _propTypes2.default.bool
41 | };
42 |
43 | exports.default = InputCheckbox;
--------------------------------------------------------------------------------
/lib/components/Input/InputLabel.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var InputLabel = function InputLabel(props) {
26 | var customClassName = props.className,
27 | component = props.component,
28 | rest = _objectWithoutProperties(props, ['className', 'component']);
29 |
30 | var isElement = _react2.default.isValidElement(props.children[0]);
31 |
32 | var className = (0, _classnames2.default)(customClassName, {
33 | 'uk-form-label': !isElement
34 | });
35 |
36 | return _react2.default.createElement(component, _extends({
37 | className: className
38 | }, rest));
39 | };
40 |
41 | InputLabel.propTypes = {
42 | htmlFor: _propTypes2.default.string
43 | };
44 |
45 | InputLabel.defaultProps = {
46 | component: 'label'
47 | };
48 |
49 | exports.default = InputLabel;
--------------------------------------------------------------------------------
/lib/components/Input/InputRadio.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var InputRadio = function InputRadio(props) {
26 | var customClassName = props.className,
27 | children = props.children,
28 | rest = _objectWithoutProperties(props, ['className', 'children']);
29 |
30 | var className = (0, _classnames2.default)(customClassName, 'uk-radio');
31 |
32 | return _react2.default.createElement('input', _extends({
33 | className: className,
34 | type: 'radio'
35 | }, rest));
36 | };
37 |
38 | InputRadio.propTypes = {
39 | name: _propTypes2.default.string.isRequired
40 | };
41 |
42 | exports.default = InputRadio;
--------------------------------------------------------------------------------
/lib/components/Input/InputTextarea.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var InputTextarea = function InputTextarea(props) {
26 | var customClassName = props.className,
27 | rows = props.rows,
28 | rest = _objectWithoutProperties(props, ['className', 'rows']);
29 |
30 | var className = (0, _classnames2.default)(customClassName, 'uk-textarea');
31 |
32 | return _react2.default.createElement('textarea', _extends({
33 | className: className,
34 | rows: rows
35 | }, rest));
36 | };
37 |
38 | InputTextarea.propTypes = {
39 | rows: _propTypes2.default.number,
40 | placeholder: _propTypes2.default.string,
41 | value: _propTypes2.default.any
42 | };
43 |
44 | InputTextarea.defaultProps = {
45 | rows: 4
46 | };
47 |
48 | exports.default = InputTextarea;
--------------------------------------------------------------------------------
/lib/components/Input/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.InputTextarea = exports.InputRadio = exports.InputCheckbox = exports.InputLabel = undefined;
7 |
8 | var _Input = require('./Input');
9 |
10 | var _Input2 = _interopRequireDefault(_Input);
11 |
12 | var _InputLabel2 = require('./InputLabel');
13 |
14 | var _InputLabel3 = _interopRequireDefault(_InputLabel2);
15 |
16 | var _InputCheckbox2 = require('./InputCheckbox');
17 |
18 | var _InputCheckbox3 = _interopRequireDefault(_InputCheckbox2);
19 |
20 | var _InputRadio2 = require('./InputRadio');
21 |
22 | var _InputRadio3 = _interopRequireDefault(_InputRadio2);
23 |
24 | var _InputTextarea2 = require('./InputTextarea');
25 |
26 | var _InputTextarea3 = _interopRequireDefault(_InputTextarea2);
27 |
28 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29 |
30 | exports.default = _Input2.default;
31 | exports.InputLabel = _InputLabel3.default;
32 | exports.InputCheckbox = _InputCheckbox3.default;
33 | exports.InputRadio = _InputRadio3.default;
34 | exports.InputTextarea = _InputTextarea3.default;
--------------------------------------------------------------------------------
/lib/components/Label/Label.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 | var Label = function Label(props) {
28 | var customClassName = props.className,
29 | component = props.component,
30 | variant = props.variant,
31 | rest = _objectWithoutProperties(props, ['className', 'component', 'variant']);
32 |
33 | var className = (0, _classnames2.default)(customClassName, 'uk-label', _defineProperty({}, 'uk-label-' + variant, !!variant));
34 |
35 | return _react2.default.createElement(component, _extends({
36 | className: className
37 | }, rest));
38 | };
39 |
40 | Label.propTypes = {
41 | variant: _propTypes2.default.oneOf(['primary', 'success', 'warning', 'danger'])
42 | };
43 |
44 | Label.defaultProps = {
45 | component: 'span'
46 | };
47 |
48 | exports.default = Label;
--------------------------------------------------------------------------------
/lib/components/Label/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Label = require('./Label');
8 |
9 | var _Label2 = _interopRequireDefault(_Label);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Label2.default;
--------------------------------------------------------------------------------
/lib/components/Margin/Margin.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var Margin = function Margin(props) {
26 | var customClassName = props.className,
27 | component = props.component,
28 | dynamic = props.dynamic,
29 | rest = _objectWithoutProperties(props, ['className', 'component', 'dynamic']);
30 |
31 | var className = (0, _classnames2.default)(customClassName, 'uk-margin');
32 |
33 | return _react2.default.createElement(component, _extends({
34 | className: className
35 | }, dynamic ? { 'uk-margin': '' } : undefined, rest));
36 | };
37 |
38 | Margin.propTypes = {
39 | dynamic: _propTypes2.default.bool
40 | };
41 |
42 | Margin.defaultProps = {
43 | component: 'div',
44 | dynamic: false
45 | };
46 |
47 | exports.default = Margin;
--------------------------------------------------------------------------------
/lib/components/Margin/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Margin = require('./Margin');
8 |
9 | var _Margin2 = _interopRequireDefault(_Margin);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Margin2.default;
--------------------------------------------------------------------------------
/lib/components/Modal/Modal.js:
--------------------------------------------------------------------------------
1 | /*import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { Portal } from 'react-portal'
4 | import _ from 'lodash'
5 | import classNames from 'classnames'
6 |
7 | class Modal extends React.Component {
8 |
9 | state = {
10 | isOpen: false
11 | }
12 |
13 | static propTypes = {
14 | open: PropTypes.bool
15 | }
16 |
17 | static defaultProps = {
18 | open: false
19 | }
20 |
21 | setRef = ref => this.node = ref
22 |
23 | handleClose = () => {
24 | setTimeout(() => {
25 | this.props.open = false
26 | }, 300)
27 | }
28 |
29 | render() {
30 | const { open } = this.props
31 |
32 | const className = classNames('uk-modal', {
33 | 'uk-open': open
34 | })
35 |
36 | const style = {
37 | display: 'block'
38 | }
39 |
40 | return (
41 |
45 |
49 |
50 |
51 | )
52 | }
53 | }
54 |
55 | export default Modal
56 | */
57 | "use strict";
--------------------------------------------------------------------------------
/lib/components/Progress/Progress.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var Progress = function Progress(props) {
26 | var customClassName = props.className,
27 | children = props.children,
28 | rest = _objectWithoutProperties(props, ['className', 'children']);
29 |
30 | var className = (0, _classnames2.default)(customClassName, 'uk-progress');
31 |
32 | return _react2.default.createElement('progress', _extends({
33 | className: className
34 | }, rest));
35 | };
36 |
37 | Progress.propTypes = {
38 | value: _propTypes2.default.number,
39 | max: _propTypes2.default.number
40 | };
41 |
42 | Progress.defaultProps = {
43 | value: 0,
44 | max: 100
45 | };
46 |
47 | exports.default = Progress;
--------------------------------------------------------------------------------
/lib/components/Progress/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Progress = require('./Progress');
8 |
9 | var _Progress2 = _interopRequireDefault(_Progress);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Progress2.default;
--------------------------------------------------------------------------------
/lib/components/Select/Select.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _SelectOption = require('./SelectOption');
22 |
23 | var _SelectOption2 = _interopRequireDefault(_SelectOption);
24 |
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26 |
27 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28 |
29 | 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; }
30 |
31 | var Select = function Select(props) {
32 | var _classNames;
33 |
34 | var customClassName = props.className,
35 | size = props.size,
36 | blank = props.blank,
37 | rest = _objectWithoutProperties(props, ['className', 'size', 'blank']);
38 |
39 | var className = (0, _classnames2.default)(customClassName, 'uk-select', (_classNames = {}, _defineProperty(_classNames, 'uk-form-' + size, !!size), _defineProperty(_classNames, 'uk-form-blank', blank), _classNames));
40 |
41 | return _react2.default.createElement('select', _extends({
42 | className: className
43 | }, rest));
44 | };
45 |
46 | Select.propTypes = {
47 | size: _propTypes2.default.oneOf(['large', 'small']),
48 | blank: _propTypes2.default.bool
49 | };
50 |
51 | Select.defaultProps = {
52 | blank: false
53 |
54 | // Sub-components
55 | };Select.Option = _SelectOption2.default;
56 |
57 | exports.default = Select;
--------------------------------------------------------------------------------
/lib/components/Select/SelectOption.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var SelectOption = function SelectOption(props) {
22 | var className = props.className,
23 | value = props.value,
24 | rest = _objectWithoutProperties(props, ['className', 'value']);
25 |
26 | return _react2.default.createElement('option', _extends({
27 | value: value
28 | }, rest));
29 | };
30 |
31 | SelectOption.propTypes = {
32 | children: _propTypes2.default.string,
33 | value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
34 | name: _propTypes2.default.string
35 | };
36 |
37 | SelectOption.defaultProps = {
38 | value: ''
39 | };
40 |
41 | exports.default = SelectOption;
--------------------------------------------------------------------------------
/lib/components/Select/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.SelectOption = undefined;
7 |
8 | var _Select = require('./Select');
9 |
10 | var _Select2 = _interopRequireDefault(_Select);
11 |
12 | var _SelectOption2 = require('./SelectOption');
13 |
14 | var _SelectOption3 = _interopRequireDefault(_SelectOption2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Select2.default;
19 | exports.SelectOption = _SelectOption3.default;
--------------------------------------------------------------------------------
/lib/components/Spinner/Spinner.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var Progress = function Progress(props) {
22 | var customClassName = props.className,
23 | component = props.component,
24 | ratio = props.ratio,
25 | children = props.children,
26 | rest = _objectWithoutProperties(props, ['className', 'component', 'ratio', 'children']);
27 |
28 | return _react2.default.createElement(component, _extends({
29 | 'uk-spinner': ''
30 | }, rest));
31 | };
32 |
33 | Progress.propTypes = {
34 | ratio: _propTypes2.default.number
35 | };
36 |
37 | Progress.defaultProps = {
38 | component: 'div'
39 | };
40 |
41 | exports.default = Progress;
--------------------------------------------------------------------------------
/lib/components/Spinner/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Spinner = require('./Spinner');
8 |
9 | var _Spinner2 = _interopRequireDefault(_Spinner);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Spinner2.default;
--------------------------------------------------------------------------------
/lib/components/Tab/Tab.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 _react = require('react');
12 |
13 | var _react2 = _interopRequireDefault(_react);
14 |
15 | var _propTypes = require('prop-types');
16 |
17 | var _propTypes2 = _interopRequireDefault(_propTypes);
18 |
19 | var _classnames = require('classnames');
20 |
21 | var _classnames2 = _interopRequireDefault(_classnames);
22 |
23 | var _uikit = require('uikit');
24 |
25 | var _uikit2 = _interopRequireDefault(_uikit);
26 |
27 | var _TabItem = require('./TabItem');
28 |
29 | var _TabItem2 = _interopRequireDefault(_TabItem);
30 |
31 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32 |
33 | 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; }
34 |
35 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
36 |
37 | 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; }
38 |
39 | 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; }
40 |
41 | var Tab = function (_React$Component) {
42 | _inherits(Tab, _React$Component);
43 |
44 | function Tab() {
45 | var _ref;
46 |
47 | var _temp, _this, _ret;
48 |
49 | _classCallCheck(this, Tab);
50 |
51 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
52 | args[_key] = arguments[_key];
53 | }
54 |
55 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Tab.__proto__ || Object.getPrototypeOf(Tab)).call.apply(_ref, [this].concat(args))), _this), _this.setRef = function (ref) {
56 | return _this.node = ref;
57 | }, _temp), _possibleConstructorReturn(_this, _ret);
58 | }
59 |
60 | _createClass(Tab, [{
61 | key: 'componentDidMount',
62 | value: function componentDidMount() {
63 | this.component = _uikit2.default.tab(this.node);
64 | }
65 | }, {
66 | key: 'componentWillUnmount',
67 | value: function componentWillUnmount() {
68 | this.component.$destroy();
69 | }
70 | }, {
71 | key: 'render',
72 | value: function render() {
73 | var _props = this.props,
74 | customClassName = _props.className,
75 | bottom = _props.bottom,
76 | rest = _objectWithoutProperties(_props, ['className', 'bottom']);
77 |
78 | var className = (0, _classnames2.default)(customClassName, {
79 | 'uk-tab-bottom': bottom
80 | });
81 |
82 | return _react2.default.createElement(this.props.component, _extends({
83 | ref: this.setRef,
84 | className: className
85 | }, rest), this.props.children);
86 | }
87 | }]);
88 |
89 | return Tab;
90 | }(_react2.default.Component);
91 |
92 | // Sub-components
93 |
94 |
95 | Tab.propTypes = {
96 | bottom: _propTypes2.default.bool
97 | };
98 | Tab.defaultProps = {
99 | component: 'ul',
100 | bottom: false
101 | };
102 | Tab.Item = _TabItem2.default;
103 |
104 | exports.default = Tab;
--------------------------------------------------------------------------------
/lib/components/Tab/TabItem.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22 |
23 | 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; }
24 |
25 | var TabItem = function TabItem(props) {
26 | var customClassName = props.className,
27 | component = props.component,
28 | disabled = props.disabled,
29 | rest = _objectWithoutProperties(props, ['className', 'component', 'disabled']);
30 |
31 | var className = (0, _classnames2.default)(customClassName, {
32 | 'uk-disabled': disabled
33 | });
34 |
35 | return _react2.default.createElement(
36 | 'li',
37 | {
38 | className: className },
39 | _react2.default.createElement(component, _extends({}, rest))
40 | );
41 | };
42 |
43 | TabItem.propTypes = {
44 | disabled: _propTypes2.default.bool
45 | };
46 |
47 | TabItem.defaultProps = {
48 | component: 'a',
49 | disabled: false
50 | };
51 |
52 | exports.default = TabItem;
--------------------------------------------------------------------------------
/lib/components/Tab/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.TabItem = undefined;
7 |
8 | var _Tab = require('./Tab');
9 |
10 | var _Tab2 = _interopRequireDefault(_Tab);
11 |
12 | var _TabItem2 = require('./TabItem');
13 |
14 | var _TabItem3 = _interopRequireDefault(_TabItem2);
15 |
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 |
18 | exports.default = _Tab2.default;
19 | exports.TabItem = _TabItem3.default;
--------------------------------------------------------------------------------
/lib/components/Table/Table.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | var _classnames = require('classnames');
18 |
19 | var _classnames2 = _interopRequireDefault(_classnames);
20 |
21 | var _TableCaption = require('./TableCaption');
22 |
23 | var _TableCaption2 = _interopRequireDefault(_TableCaption);
24 |
25 | var _TableHead = require('./TableHead');
26 |
27 | var _TableHead2 = _interopRequireDefault(_TableHead);
28 |
29 | var _TableBody = require('./TableBody');
30 |
31 | var _TableBody2 = _interopRequireDefault(_TableBody);
32 |
33 | var _TableFooter = require('./TableFooter');
34 |
35 | var _TableFooter2 = _interopRequireDefault(_TableFooter);
36 |
37 | var _TableRow = require('./TableRow');
38 |
39 | var _TableRow2 = _interopRequireDefault(_TableRow);
40 |
41 | var _TableCell = require('./TableCell');
42 |
43 | var _TableCell2 = _interopRequireDefault(_TableCell);
44 |
45 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46 |
47 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
48 |
49 | 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; }
50 |
51 | var Table = function Table(props) {
52 | var customClassName = props.className,
53 | divider = props.divider,
54 | striped = props.striped,
55 | hover = props.hover,
56 | size = props.size,
57 | rest = _objectWithoutProperties(props, ['className', 'divider', 'striped', 'hover', 'size']);
58 |
59 | var className = (0, _classnames2.default)(customClassName, 'uk-table', _defineProperty({
60 | 'uk-table-divider': divider,
61 | 'uk-table-striped': striped,
62 | 'uk-table-hover': hover
63 | }, 'uk-table-' + size, size && size !== 'default'));
64 |
65 | return _react2.default.createElement('table', _extends({
66 | className: className
67 | }, rest));
68 | };
69 |
70 | Table.propTypes = {
71 | divider: _propTypes2.default.bool,
72 | striped: _propTypes2.default.bool,
73 | hover: _propTypes2.default.bool,
74 | size: _propTypes2.default.oneOf(['small', 'default', 'large'])
75 | };
76 |
77 | Table.defaultProps = {
78 | divider: false,
79 | striped: false,
80 | hover: false,
81 | size: 'default'
82 |
83 | // Sub-components
84 | };Table.Caption = _TableCaption2.default;
85 | Table.Head = _TableHead2.default;
86 | Table.Body = _TableBody2.default;
87 | Table.Footer = _TableFooter2.default;
88 | Table.Row = _TableRow2.default;
89 | Table.Cell = _TableCell2.default;
90 |
91 | exports.default = Table;
--------------------------------------------------------------------------------
/lib/components/Table/TableBody.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14 |
15 | 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; }
16 |
17 | var TableBody = function TableBody(props) {
18 | var children = props.children,
19 | rest = _objectWithoutProperties(props, ['children']);
20 |
21 | var childrenWithOriginProp = _react2.default.Children.map(children, function (child) {
22 | return _react2.default.cloneElement(child, { origin: 'TableBody' });
23 | });
24 |
25 | return _react2.default.createElement('tbody', _extends({
26 | children: childrenWithOriginProp
27 | }, rest));
28 | };
29 |
30 | exports.default = TableBody;
--------------------------------------------------------------------------------
/lib/components/Table/TableCaption.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _react = require('react');
8 |
9 | var _react2 = _interopRequireDefault(_react);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | 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; }
14 |
15 | var TableCaption = function TableCaption(props) {
16 | var rest = _objectWithoutProperties(props, []);
17 |
18 | return _react2.default.createElement('caption', rest);
19 | };
20 |
21 | exports.default = TableCaption;
--------------------------------------------------------------------------------
/lib/components/Table/TableCell.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _react = require('react');
8 |
9 | var _react2 = _interopRequireDefault(_react);
10 |
11 | var _propTypes = require('prop-types');
12 |
13 | var _propTypes2 = _interopRequireDefault(_propTypes);
14 |
15 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16 |
17 | 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; }
18 |
19 | var TableCell = function TableCell(props) {
20 | var origin = props.origin,
21 | rest = _objectWithoutProperties(props, ['origin']);
22 |
23 | if (origin === 'TableHead') return _react2.default.createElement('th', rest);
24 |
25 | return _react2.default.createElement('td', rest);
26 | };
27 |
28 | TableCell.propTypes = {
29 | origin: _propTypes2.default.string.isRequired
30 | };
31 |
32 | exports.default = TableCell;
--------------------------------------------------------------------------------
/lib/components/Table/TableFooter.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14 |
15 | 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; }
16 |
17 | var TableFooter = function TableFooter(props) {
18 | var children = props.children,
19 | rest = _objectWithoutProperties(props, ['children']);
20 |
21 | var childrenWithOriginProp = _react2.default.Children.map(children, function (child) {
22 | return _react2.default.cloneElement(child, { origin: 'TableFooter' });
23 | });
24 |
25 | return _react2.default.createElement('tfoot', _extends({
26 | children: childrenWithOriginProp
27 | }, rest));
28 | };
29 |
30 | exports.default = TableFooter;
--------------------------------------------------------------------------------
/lib/components/Table/TableHead.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14 |
15 | 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; }
16 |
17 | var TableHead = function TableHead(props) {
18 | var children = props.children,
19 | rest = _objectWithoutProperties(props, ['children']);
20 |
21 | var childrenWithOriginProp = _react2.default.Children.map(children, function (child) {
22 | return _react2.default.cloneElement(child, { origin: 'TableHead' });
23 | });
24 |
25 | return _react2.default.createElement('thead', _extends({
26 | children: childrenWithOriginProp
27 | }, rest));
28 | };
29 |
30 | exports.default = TableHead;
--------------------------------------------------------------------------------
/lib/components/Table/TableRow.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 _react = require('react');
10 |
11 | var _react2 = _interopRequireDefault(_react);
12 |
13 | var _propTypes = require('prop-types');
14 |
15 | var _propTypes2 = _interopRequireDefault(_propTypes);
16 |
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | 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; }
20 |
21 | var TableRow = function TableRow(props) {
22 | var origin = props.origin,
23 | children = props.children,
24 | rest = _objectWithoutProperties(props, ['origin', 'children']);
25 |
26 | var childrenWithOriginProp = _react2.default.Children.map(children, function (child) {
27 | return _react2.default.cloneElement(child, { origin: origin });
28 | });
29 |
30 | return _react2.default.createElement('tr', _extends({
31 | children: childrenWithOriginProp
32 | }, rest));
33 | };
34 |
35 | TableRow.propTypes = {
36 | origin: _propTypes2.default.string.isRequired
37 | };
38 |
39 | exports.default = TableRow;
--------------------------------------------------------------------------------
/lib/components/Table/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.TableCell = exports.TableRow = exports.TableFooter = exports.TableBody = exports.TableHead = exports.TableCaption = undefined;
7 |
8 | var _Table = require('./Table');
9 |
10 | var _Table2 = _interopRequireDefault(_Table);
11 |
12 | var _TableCaption2 = require('./TableCaption');
13 |
14 | var _TableCaption3 = _interopRequireDefault(_TableCaption2);
15 |
16 | var _TableHead2 = require('./TableHead');
17 |
18 | var _TableHead3 = _interopRequireDefault(_TableHead2);
19 |
20 | var _TableBody2 = require('./TableBody');
21 |
22 | var _TableBody3 = _interopRequireDefault(_TableBody2);
23 |
24 | var _TableFooter2 = require('./TableFooter');
25 |
26 | var _TableFooter3 = _interopRequireDefault(_TableFooter2);
27 |
28 | var _TableRow2 = require('./TableRow');
29 |
30 | var _TableRow3 = _interopRequireDefault(_TableRow2);
31 |
32 | var _TableCell2 = require('./TableCell');
33 |
34 | var _TableCell3 = _interopRequireDefault(_TableCell2);
35 |
36 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37 |
38 | exports.default = _Table2.default;
39 | exports.TableCaption = _TableCaption3.default;
40 | exports.TableHead = _TableHead3.default;
41 | exports.TableBody = _TableBody3.default;
42 | exports.TableFooter = _TableFooter3.default;
43 | exports.TableRow = _TableRow3.default;
44 | exports.TableCell = _TableCell3.default;
--------------------------------------------------------------------------------
/lib/components/Tooltip/Tooltip.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 _react = require('react');
12 |
13 | var _react2 = _interopRequireDefault(_react);
14 |
15 | var _reactDom = require('react-dom');
16 |
17 | var _reactDom2 = _interopRequireDefault(_reactDom);
18 |
19 | var _propTypes = require('prop-types');
20 |
21 | var _propTypes2 = _interopRequireDefault(_propTypes);
22 |
23 | var _uikit = require('uikit');
24 |
25 | var _uikit2 = _interopRequireDefault(_uikit);
26 |
27 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28 |
29 | 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; }
30 |
31 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
32 |
33 | 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; }
34 |
35 | 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; }
36 |
37 | var Tooltip = function (_React$Component) {
38 | _inherits(Tooltip, _React$Component);
39 |
40 | function Tooltip() {
41 | _classCallCheck(this, Tooltip);
42 |
43 | return _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).apply(this, arguments));
44 | }
45 |
46 | _createClass(Tooltip, [{
47 | key: 'componentDidMount',
48 | value: function componentDidMount() {
49 | var _props = this.props,
50 | pos = _props.position,
51 | duration = _props.duration,
52 | delay = _props.delay,
53 | animation = _props.animation;
54 |
55 |
56 | var options = _extends({ pos: pos, duration: duration, delay: delay, animation: animation }, this.props.options);
57 |
58 | this.component = _uikit2.default.tooltip(_reactDom2.default.findDOMNode(this), options);
59 | }
60 | }, {
61 | key: 'componentWillUnmount',
62 | value: function componentWillUnmount() {
63 | this.component.$destroy();
64 | }
65 | }, {
66 | key: 'render',
67 | value: function render() {
68 | var _props2 = this.props,
69 | title = _props2.title,
70 | children = _props2.children,
71 | position = _props2.position,
72 | options = _props2.options,
73 | duration = _props2.duration,
74 | animation = _props2.animation,
75 | rest = _objectWithoutProperties(_props2, ['title', 'children', 'position', 'options', 'duration', 'animation']);
76 |
77 | return _react2.default.cloneElement(children, _extends({
78 | title: title
79 | }, rest));
80 | }
81 | }]);
82 |
83 | return Tooltip;
84 | }(_react2.default.Component);
85 |
86 | Tooltip.propTypes = {
87 | title: _propTypes2.default.string.isRequired,
88 | options: _propTypes2.default.object,
89 | children: _propTypes2.default.node.isRequired,
90 | position: _propTypes2.default.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
91 | duration: _propTypes2.default.number,
92 | delay: _propTypes2.default.number,
93 | animation: _propTypes2.default.string
94 | };
95 | Tooltip.defaultProps = {
96 | options: {},
97 | position: 'top',
98 | duration: 100,
99 | animation: 'uk-animation-scale-up'
100 | /*onBeforeShow: f=>f,
101 | onShow: f=>f,
102 | onShown: f=>f,
103 | onBeforeHide: f=>f,
104 | onHide: f=>f,
105 | onHidden: f=>f,*/
106 |
107 |
108 | /*_events = {
109 | 'beforeshow': () => this.props.onBeforeShow(),
110 | 'show': () => this.props.onShow(),
111 | 'shown': () => this.props.onShown(),
112 | 'beforehide': () => this.props.onBeforeHide(),
113 | 'hide': () => this.props.onHide(),
114 | 'hidden': () => this.props.onHidden(),
115 | }*/
116 |
117 | };
118 | exports.default = Tooltip;
--------------------------------------------------------------------------------
/lib/components/Tooltip/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 |
7 | var _Tooltip = require('./Tooltip');
8 |
9 | var _Tooltip2 = _interopRequireDefault(_Tooltip);
10 |
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12 |
13 | exports.default = _Tooltip2.default;
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [Settings]
2 | ID = "react-uikit"
3 |
4 | [build]
5 | publish = ".docz/dist/"
6 | command = "rm -rf .docz && npm run build"
7 |
8 | [[redirects]]
9 | from = "/*"
10 | to = "/index.html"
11 | status = 200
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-uikit",
3 | "version": "0.0.8",
4 | "description": "UIkit components for ReactJS",
5 | "repository": "https://github.com/ompmega/react-uikit.git",
6 | "author": "Daniel Ramirez (https://github.com/drmzio)",
7 | "license": "MIT",
8 | "homepage": "https://react-uikit.ompmega.com",
9 | "bugs": "https://github.com/ompmega/react-uikit/issues",
10 | "keywords": [
11 | "react",
12 | "react-component",
13 | "uikit",
14 | "react-uikit",
15 | "ecosystem-react"
16 | ],
17 | "main": "lib",
18 | "scripts": {
19 | "bundle": "babel ./src --out-dir ./lib",
20 | "dev": "docz dev",
21 | "build": "docz build"
22 | },
23 | "peerDependencies": {
24 | "react": "^16.0.0",
25 | "react-dom": "^16.0.0",
26 | "uikit": "^3.*"
27 | },
28 | "dependencies": {
29 | "classnames": "latest",
30 | "lodash": "^4.17.10",
31 | "react-portal": "^4.1.5"
32 | },
33 | "devDependencies": {
34 | "@svgr/cli": "^2.1.0",
35 | "babel-cli": "^6.26.0",
36 | "babel-core": "^6.26.3",
37 | "babel-eslint": "^8.2.3",
38 | "babel-jest": "^22.4.4",
39 | "babel-loader": "^7.1.4",
40 | "babel-plugin-inline-import": "^2.0.6",
41 | "babel-plugin-react-transform": "^3.0.0",
42 | "babel-plugin-styled-components": "^1.5.1",
43 | "babel-plugin-transform-class-properties": "^6.24.1",
44 | "babel-plugin-transform-decorators-legacy": "^1.3.5",
45 | "babel-polyfill": "^6.26.0",
46 | "babel-preset-es2015": "^6.24.1",
47 | "babel-preset-react": "^6.24.1",
48 | "babel-preset-stage-0": "^6.24.1",
49 | "babel-preset-stage-1": "^6.24.1",
50 | "docz": "^0.5.2",
51 | "docz-core": "^0.5.2",
52 | "docz-plugin-babel6": "latest",
53 | "prop-types": "^15.6.2",
54 | "react": "^16.4.2",
55 | "react-dom": "^16.4.2",
56 | "uikit": "^3.0.0-rc.11"
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/components/Alert/Alert.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 | import UIkit from 'uikit'
5 |
6 | import AlertClose from './AlertClose'
7 |
8 | class Alert extends React.Component {
9 |
10 | static propTypes = {
11 | closable: PropTypes.bool,
12 | variant: PropTypes.oneOf([
13 | 'primary', 'success', 'warning', 'danger'
14 | ]),
15 | close: PropTypes.bool,
16 | }
17 |
18 | static defaultProps = {
19 | component: 'div',
20 | closable: false,
21 | onBeforeHide: f=>f,
22 | onHide: f=>f,
23 | close: false,
24 | }
25 |
26 | _events = {
27 | 'beforehide': () => this.props.onBeforeHide(),
28 | 'hide': () => this.props.onHide(),
29 | }
30 |
31 | setRef = (ref) => this.node = ref
32 |
33 | componentDidMount() {
34 | this.component = UIkit.alert(this.node)
35 |
36 | // Bind UIkit events to this component
37 | Object.keys(this._events).map(eventName => {
38 | UIkit.util.on(this.node, eventName, this._events[eventName])
39 | })
40 | }
41 |
42 | componentWillUnmount() {
43 | this.component.$destroy()
44 | }
45 |
46 | componentWillReceiveProps(newProps) {
47 | if (newProps.close)
48 | this.component.close()
49 | }
50 |
51 | render() {
52 | const {
53 | className: customClassName,
54 | component,
55 | closable,
56 | children,
57 | variant,
58 | close,
59 | ...rest
60 | } = this.props
61 |
62 | const className = classNames(customClassName, 'uk-alert', {
63 | [`uk-alert-${variant}`]: !!variant
64 | })
65 |
66 | // Appends close button if `closable` is set.
67 | let childrenNodes = []
68 | React.Children.forEach(children, child => {
69 | if (typeof child === 'object' && closable) {
70 | if (child.type.displayName !== 'AlertClose')
71 | childrenNodes.push(child)
72 | } else {
73 | childrenNodes.push(child)
74 | }
75 | })
76 |
77 | if (closable) {
78 | childrenNodes = [
79 | ,
80 | ...childrenNodes
81 | ]
82 | }
83 |
84 | return React.createElement(component, {
85 | ref: this.setRef,
86 | className: className,
87 | ...rest
88 | }, childrenNodes)
89 | }
90 | }
91 |
92 | // Sub-components
93 | Alert.Close = AlertClose
94 |
95 | export default Alert
96 |
--------------------------------------------------------------------------------
/src/components/Alert/Alert.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Alert
3 | route: /docs/alert
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Alert from './Alert'
9 |
10 | # Alert
11 | ### Display success, warning and error messages.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `Alert.Close` | Add a close button to your alert. |
16 |
17 | ## Usage
18 |
19 |
20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
21 |
22 |
23 |
24 | ---
25 |
26 | ## Closable
27 | You may add either the `` component or the `closable` prop to make it closable.
28 |
29 |
30 |
31 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
32 |
33 |
34 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
35 |
36 |
37 |
38 | ---
39 |
40 | ## Style variations
41 |
42 |
43 |
44 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
45 |
46 |
47 |
48 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
49 |
50 |
51 |
52 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
53 |
54 |
55 |
56 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
57 |
58 |
59 |
60 | ---
61 |
62 | ## Component props
63 |
64 | ### Alert
65 |
66 |
67 | ---
68 |
69 | ## Events
70 |
71 | ### Alert
72 | | UIkit event | Component event prop |
73 | |-|-|
74 | | beforehide | `onBeforeHide` |
75 | | hide | `onHide` |
76 |
--------------------------------------------------------------------------------
/src/components/Alert/AlertClose.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const AlertClose = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-alert-close')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | 'data-uk-close': '',
16 | ...rest
17 | })
18 | }
19 |
20 | AlertClose.defaultProps = {
21 | component: 'a'
22 | }
23 |
24 | export default AlertClose
25 |
--------------------------------------------------------------------------------
/src/components/Alert/index.js:
--------------------------------------------------------------------------------
1 | import Alert from './Alert'
2 | export default Alert
3 |
4 | export AlertClose from './AlertClose'
5 |
--------------------------------------------------------------------------------
/src/components/Badge/Badge.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const Badge = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-badge')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | Badge.defaultProps = {
20 | component: 'span'
21 | }
22 |
23 | export default Badge
24 |
--------------------------------------------------------------------------------
/src/components/Badge/Badge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Badge
3 | route: /docs/badge
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Badge from './Badge'
9 |
10 | # Badge
11 | ### Easily create nice looking notification badges.
12 |
13 | ## Usage
14 |
15 | 1
16 | 100
17 |
18 |
--------------------------------------------------------------------------------
/src/components/Badge/index.js:
--------------------------------------------------------------------------------
1 | import Badge from './Badge'
2 |
3 | export default Badge
4 |
--------------------------------------------------------------------------------
/src/components/Breadcrumb/Breadcrumb.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | import BreadcrumbItem from './BreadcrumbItem'
5 |
6 | const Breadcrumb = (props) => {
7 | const {
8 | className: customClassName,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-breadcrumb')
13 |
14 | return (
15 |
18 | )
19 | }
20 |
21 | // Sub-components
22 | Breadcrumb.Item = BreadcrumbItem
23 |
24 | export default Breadcrumb
25 |
--------------------------------------------------------------------------------
/src/components/Breadcrumb/Breadcrumb.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Breadcrumb
3 | route: /docs/breadcrumb
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Breadcrumb from './Breadcrumb'
9 | import Link from '../Link'
10 |
11 | # Breadcrumb
12 | ### Create breadcrumbs to show users their location within a website.
13 |
14 | | Sub-component | Description |
15 | |-|-|
16 | | `Breadcrumb.Item` | The breadcrumb item. |
17 |
18 | ## Usage
19 |
20 |
21 |
22 | Item
23 |
24 |
25 | Item
26 |
27 |
28 | Disabled
29 |
30 | Active
31 |
32 |
33 |
34 | ---
35 |
36 | ## Component props
37 | ### Breadcrumb.Item
38 |
39 |
--------------------------------------------------------------------------------
/src/components/Breadcrumb/BreadcrumbItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const BreadcrumbItem = (props) => {
6 | const {
7 | className: customClassName,
8 | disabled,
9 | active,
10 | children,
11 | ...rest
12 | } = props
13 |
14 | const className = classNames(customClassName, {
15 | 'uk-disabled': disabled
16 | }) || undefined
17 |
18 | return (
19 |
22 | {active ? (
23 | {children}
24 | ) : children}
25 |
26 | )
27 | }
28 |
29 | BreadcrumbItem.propTypes = {
30 | disabled: PropTypes.bool,
31 | active: PropTypes.bool
32 | }
33 |
34 | BreadcrumbItem.defaultProps = {
35 | disabled: false,
36 | active: false
37 | }
38 |
39 | export default BreadcrumbItem
40 |
--------------------------------------------------------------------------------
/src/components/Breadcrumb/index.js:
--------------------------------------------------------------------------------
1 | import Breadcrumb from './Breadcrumb'
2 | export default Breadcrumb
3 |
4 | export BreadcrumbItem from './BreadcrumbItem'
5 |
--------------------------------------------------------------------------------
/src/components/Button/Button.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import ButtonGroup from './ButtonGroup'
6 |
7 | const Button = (props) => {
8 | const {
9 | className: customClassName,
10 | component,
11 | variant,
12 | small,
13 | large,
14 | href,
15 | type,
16 | block,
17 | size,
18 | ...rest
19 | } = props
20 |
21 | const className = classNames(customClassName, 'uk-button', {
22 | [`uk-button-${variant}`]: variant,
23 | 'uk-button-small': small || size === 'small',
24 | 'uk-button-large': large || size === 'large',
25 | 'uk-width-1-1': block,
26 | })
27 |
28 | if (!!href) return (
29 |
33 | )
34 |
35 | if (component === 'button') return (
36 |
40 | )
41 |
42 | return React.createElement(component, {
43 | className: className,
44 | ...rest
45 | })
46 | }
47 |
48 | Button.propTypes = {
49 | variant: PropTypes.oneOf([
50 | 'default', 'primary', 'secondary', 'danger', 'text', 'link'
51 | ]),
52 | size: PropTypes.oneOf([
53 | 'small', 'large'
54 | ]),
55 | small: PropTypes.bool,
56 | large: PropTypes.bool,
57 | block: PropTypes.bool
58 | }
59 |
60 | Button.defaultProps = {
61 | component: 'button',
62 | type: 'button',
63 | variant: 'default',
64 | small: false,
65 | large: false,
66 | block: false
67 | }
68 |
69 | // Sub-components
70 | Button.Group = ButtonGroup
71 |
72 | export default Button
73 |
--------------------------------------------------------------------------------
/src/components/Button/Button.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Button
3 | route: /docs/button
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable, Link as _Link } from 'docz'
8 | import Button from './Button'
9 | import Margin from '../Margin'
10 |
11 | # Button
12 | ### Easily create nice looking buttons, which come in different styles.
13 |
14 | ## Usage
15 |
16 |
17 |
18 |
19 |
20 |
21 | #### Pro-tip:
22 | Adding the `href` prop to any button will convert to `a` element automatically.
23 |
24 | ---
25 |
26 | ## Style variations
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | ---
38 |
39 | ## Size modifiers
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | ---
57 |
58 | ## Width modifiers
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | ---
68 |
69 | ## Group
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | ---
103 |
104 | ## With React Router
105 | Learn more about the [React Router](https://reacttraining.com/react-router/) library.
106 |
107 |
108 |
109 |
110 |
111 | ---
112 |
113 | ## Component props
114 | ### Button
115 |
116 |
--------------------------------------------------------------------------------
/src/components/Button/ButtonGroup.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const ButtonGroup = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-button-group')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | ButtonGroup.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default ButtonGroup
24 |
--------------------------------------------------------------------------------
/src/components/Button/index.js:
--------------------------------------------------------------------------------
1 | import Button from './Button'
2 | export default Button
3 |
4 | export ButtonGroup from './ButtonGroup'
5 |
--------------------------------------------------------------------------------
/src/components/Card/Card.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import CardTitle from './CardTitle'
6 | import CardBody from './CardBody'
7 | import CardHeader from './CardHeader'
8 | import CardFooter from './CardFooter'
9 |
10 | const Card = (props) => {
11 | const {
12 | className: customClassName,
13 | component,
14 | variant,
15 | body,
16 | ...rest
17 | } = props
18 |
19 | const className = classNames(customClassName, 'uk-card', {
20 | [`uk-card-${variant}`]: !!variant,
21 | 'uk-card-body': body
22 | })
23 |
24 | return React.createElement(component, {
25 | className: className,
26 | ...rest
27 | })
28 | }
29 |
30 | Card.propTypes = {
31 | variant: PropTypes.oneOf([
32 | 'default', 'primary', 'secondary'
33 | ]),
34 | body: PropTypes.bool
35 | }
36 |
37 | Card.defaultProps = {
38 | component: 'div',
39 | variant: 'default',
40 | body: false
41 | }
42 |
43 |
44 | // Sub-components
45 | Card.Title = CardTitle
46 | Card.Body = CardBody
47 | Card.Header = CardHeader
48 | Card.Footer = CardFooter
49 |
50 | export default Card
51 |
--------------------------------------------------------------------------------
/src/components/Card/Card.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Card
3 | route: /docs/card
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Card from './Card'
9 |
10 | # Card
11 | ### Create layout boxes with different styles.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `Card.Title` | The card title. |
16 | | `Card.Body` | The card body. |
17 | | `Card.Header` | The card header. |
18 | | `Card.Footer` | The card footer. |
19 |
20 | ## Usage
21 |
22 |
23 | Default
24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
25 |
26 |
27 |
28 | ---
29 |
30 | ## Style variations
31 |
32 |
33 | Default
34 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
35 |
36 |
37 | Primary
38 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
39 |
40 |
41 | Secondary
42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
43 |
44 |
45 |
46 | ---
47 |
48 | ## Header & Footer
49 |
50 |
51 |
52 | Default
53 |
54 |
55 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
56 |
57 | Footer
58 |
59 |
60 |
61 | ---
62 |
63 | ## Component props
64 | #### Card
65 |
66 |
--------------------------------------------------------------------------------
/src/components/Card/CardBody.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const CardBody = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-card-body')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | CardBody.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default CardBody
24 |
--------------------------------------------------------------------------------
/src/components/Card/CardFooter.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const CardFooter = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-card-footer')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | CardFooter.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default CardFooter
24 |
--------------------------------------------------------------------------------
/src/components/Card/CardHeader.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const CardHeader = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-card-header')
13 |
14 | return React.createElement(component, {
15 | className: className,
16 | ...rest
17 | })
18 | }
19 |
20 | CardHeader.defaultProps = {
21 | component: 'div'
22 | }
23 |
24 | export default CardHeader
25 |
--------------------------------------------------------------------------------
/src/components/Card/CardTitle.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const CardTitle = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-card-title')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | CardTitle.defaultProps = {
20 | component: 'h3'
21 | }
22 |
23 | export default CardTitle
24 |
--------------------------------------------------------------------------------
/src/components/Card/index.js:
--------------------------------------------------------------------------------
1 | import Card from './Card'
2 | export default Card
3 |
4 | export CardTitle from './CardTitle'
5 | export CardBody from './CardBody'
6 | export CardHeader from './CardHeader'
7 | export CardFooter from './CardFooter'
8 |
--------------------------------------------------------------------------------
/src/components/Container/Container.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const Container = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-container')
12 |
13 | return React.createElement(component, {
14 | className,
15 | ...rest
16 | })
17 | }
18 |
19 | Container.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default Container
24 |
--------------------------------------------------------------------------------
/src/components/Container/Container.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Container
3 | route: /docs/container
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Container from './Container'
9 |
10 | # Container
11 | ### Center your page content.
12 |
13 | ## Usage
14 |
15 |
16 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/components/Container/index.js:
--------------------------------------------------------------------------------
1 | import Container from './Container'
2 |
3 | export default Container
4 |
--------------------------------------------------------------------------------
/src/components/Divider/Divider.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const Divider = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | icon,
10 | small,
11 | ...rest
12 | } = props
13 |
14 | const className = classNames(customClassName, {
15 | 'uk-divider-icon': icon,
16 | 'uk-divider-small': small
17 | })
18 |
19 | return React.createElement(component, {
20 | className: className,
21 | ...rest
22 | })
23 | }
24 |
25 | Divider.propTypes = {
26 | icon: PropTypes.bool,
27 | small: PropTypes.bool
28 | }
29 |
30 | Divider.defaultProps = {
31 | component: 'hr',
32 | icon: false,
33 | small: false
34 | }
35 |
36 | export default Divider
37 |
--------------------------------------------------------------------------------
/src/components/Divider/Divider.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Divider
3 | route: /docs/divider
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Divider from './Divider'
9 |
10 | # Divider
11 | ### Create dividers to separate content and apply different styles to them.
12 |
13 | ## Usage
14 |
15 |
16 |
17 |
18 | ---
19 |
20 | ## Divider icon
21 |
22 |
23 |
24 |
25 | ---
26 |
27 | ## Divider small
28 |
29 |
30 |
31 |
32 | ---
33 |
34 | ## Component props
35 | ### Divider
36 |
37 |
--------------------------------------------------------------------------------
/src/components/Divider/index.js:
--------------------------------------------------------------------------------
1 | import Divider from './Divider'
2 |
3 | export default Divider
4 |
--------------------------------------------------------------------------------
/src/components/Drop/Drop.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 | import UIkit from 'uikit'
5 |
6 | import DropContainer from './DropContainer'
7 |
8 | class Drop extends React.Component {
9 |
10 | static propTypes = {
11 | mode: PropTypes.oneOf([
12 | 'click', 'hover'
13 | ]),
14 | position: PropTypes.oneOf([
15 | 'bottom-left', 'bottom-center', 'bottom-right', 'bottom-justify',
16 | 'top-left', 'top-center', 'top-right', 'top-justify',
17 | 'left-top', 'left-center', 'left-bottom',
18 | 'right-top', 'right-center', 'right-bottom'
19 | ]),
20 | offset: PropTypes.number,
21 | delayHide: PropTypes.number,
22 | duration: PropTypes.number,
23 | navbar: PropTypes.bool
24 | }
25 |
26 | static defaultProps = {
27 | component: 'div',
28 | mode: 'hover',
29 | position: 'bottom-left',
30 | offset: 0,
31 | delayHide: 800,
32 | duration: 200,
33 | navbar: false,
34 | onBeforeShow: f=>f,
35 | onShow: f=>f,
36 | onShown: f=>f,
37 | onBeforeHide: f=>f,
38 | onHide: f=>f,
39 | onHidden: f=>f,
40 | onToggle: f=>f,
41 | onStack: f=>f,
42 | }
43 |
44 | _events = {
45 | 'toggle': () => this.props.onToggle(),
46 | 'stack': () => this.props.onStack(),
47 | 'beforeshow': () => this.props.onBeforeShow(),
48 | 'show': () => this.props.onShow(),
49 | 'shown': () => this.props.onShown(),
50 | 'beforehide': () => this.props.onBeforeHide(),
51 | 'hide': () => this.props.onHide(),
52 | 'hidden': () => this.props.onHidden(),
53 | }
54 |
55 | setRef = (ref) => this.node = ref
56 |
57 | getOptions = () => {
58 | const {
59 | mode,
60 | position,
61 | offset,
62 | delayHide,
63 | duration
64 | } = this.props
65 |
66 | return {
67 | mode: mode,
68 | pos: position,
69 | offset: offset,
70 | 'delay-hide': delayHide,
71 | duration: duration
72 | }
73 | }
74 |
75 | registerComponent = () => {
76 | this.component = UIkit.drop(this.node, this.getOptions())
77 | }
78 |
79 | componentDidMount() {
80 | this.registerComponent()
81 |
82 | // Bind UIkit events to this component
83 | Object.keys(this._events).forEach(eventName => {
84 | UIkit.util.on(this.node, eventName, this._events[eventName])
85 | })
86 | }
87 |
88 | componentWillUnmount() {
89 | this.component.$destroy()
90 | }
91 |
92 | render() {
93 | const {
94 | className: customClassName,
95 | component,
96 | mode,
97 | position,
98 | duration,
99 | delayHide,
100 | offset,
101 | navbar,
102 | ...rest
103 | } = this.props
104 |
105 | const className = classNames(customClassName, {
106 | 'uk-navbar-dropdown': navbar
107 | })
108 |
109 | return React.createElement(component, {
110 | ref: this.setRef,
111 | className: className,
112 | ...rest
113 | })
114 | }
115 | }
116 |
117 | // Sub-components
118 | Drop.Container = DropContainer
119 |
120 | export default Drop
121 |
--------------------------------------------------------------------------------
/src/components/Drop/Drop.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Drop
3 | route: /docs/drop
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Drop from './Drop'
9 | import Card from '../Card'
10 | import Button from '../Button'
11 |
12 | # Drop
13 | ### Position any element in relation to another element.
14 |
15 | | Sub-component | Description |
16 | |-|-|
17 | | `Drop.Container` | This is the container for the drop. |
18 |
19 | ## Usage
20 |
21 |
22 |
23 |
24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
25 |
26 |
27 |
28 |
29 |
30 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
31 |
32 |
33 |
34 |
35 | ---
36 |
37 | ## Position
38 |
39 |
40 |
41 |
42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
43 |
44 |
45 |
46 |
47 |
48 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
49 |
50 |
51 |
52 |
53 |
54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
55 |
56 |
57 |
58 |
59 | ---
60 |
61 | ## Offset
62 |
63 |
64 |
65 |
66 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
67 |
68 |
69 |
70 |
71 | ---
72 |
73 | ## Component props
74 | ### Drop
75 |
76 |
77 | ---
78 |
79 | ## Events
80 | ### Drop
81 |
82 | | UIkit event | Component event prop |
83 | |-|-|
84 | | toggle | `onToggle` |
85 | | stack | `onStack` |
86 | | beforeshow | `onBeforeShow` |
87 | | show | `onShow` |
88 | | shown | `onShown` |
89 | | beforehide | `onBeforeHide` |
90 | | hide | `onHide` |
91 | | hidden | `onHidden` |
92 |
--------------------------------------------------------------------------------
/src/components/Drop/DropContainer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const DropContainer = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-inline')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | DropContainer.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default DropContainer
24 |
--------------------------------------------------------------------------------
/src/components/Drop/index.js:
--------------------------------------------------------------------------------
1 | import Drop from './Drop'
2 | export default Drop
3 |
4 | export DropContainer from './DropContainer'
5 |
--------------------------------------------------------------------------------
/src/components/Dropdown/Dropdown.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import UIkit from 'uikit'
3 |
4 | import Drop from '../Drop/Drop'
5 |
6 | class Dropdown extends Drop {
7 | registerComponent = () => {
8 | this.component = UIkit.dropdown(this.node, this.getOptions())
9 | }
10 | }
11 |
12 | // Sub-component
13 | Dropdown.Container = Drop.Container
14 |
15 | export default Dropdown
16 |
--------------------------------------------------------------------------------
/src/components/Dropdown/Dropdown.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Dropdown
3 | route: /docs/dropdown
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Dropdown from './Dropdown'
9 | import Button from '../Button'
10 | import Nav from '../Nav'
11 | import Link from '../Link'
12 |
13 | # Dropdown
14 | ### Defines different styles for a toggleable dropdown.
15 |
16 | | Sub-component | Description |
17 | |-|-|
18 | | `Dropdown.Container` | This is the container for the dropdown. |
19 |
20 | ## Usage
21 |
22 |
23 |
24 |
25 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
26 |
27 |
28 |
29 |
30 |
31 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
32 |
33 |
34 |
35 |
36 | ---
37 |
38 | ## Position
39 |
40 |
41 |
42 |
43 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
44 |
45 |
46 |
47 |
48 |
49 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
50 |
51 |
52 |
53 |
54 |
55 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
56 |
57 |
58 |
59 |
60 | ---
61 |
62 | ## Offset
63 |
64 |
65 |
66 |
67 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
68 |
69 |
70 |
71 |
72 | ---
73 |
74 | ## Nav in dropdown
75 |
76 |
77 |
78 |
79 |
98 |
99 |
100 |
101 |
102 | ---
103 |
104 | ## Component props
105 | ### Dropdown
106 |
107 |
108 | ---
109 |
110 | ## Events
111 | ### Dropdown
112 |
113 | | UIkit event | Component event prop |
114 | |-|-|
115 | | toggle | `onToggle` |
116 | | stack | `onStack` |
117 | | beforeshow | `onBeforeShow` |
118 | | show | `onShow` |
119 | | shown | `onShown` |
120 | | beforehide | `onBeforeHide` |
121 | | hide | `onHide` |
122 | | hidden | `onHidden` |
123 |
--------------------------------------------------------------------------------
/src/components/Dropdown/DropdownContainer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Drop from '../Drop/Drop'
4 |
5 | export default Drop.Container
6 |
--------------------------------------------------------------------------------
/src/components/Dropdown/index.js:
--------------------------------------------------------------------------------
1 | import Dropdown from './Dropdown'
2 |
3 | export default Dropdown
4 | export DropdownContainer from '../Drop/DropContainer'
5 |
--------------------------------------------------------------------------------
/src/components/Flex/Flex.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const Flex = (props) => {
6 | const {
7 | component,
8 | className: customClassName,
9 | inline,
10 | align,
11 | ...rest
12 | } = props
13 |
14 | const className = classNames(customClassName, {
15 | 'uk-flex': !inline,
16 | 'uk-flex-inline': inline,
17 | [`uk-flex-${align}`]: !!align
18 | })
19 |
20 | return React.createElement(component, {
21 | className,
22 | ...rest
23 | })
24 | }
25 |
26 | Flex.propTypes = {
27 | inline: PropTypes.bool,
28 | align: PropTypes.oneOf([
29 | 'left', 'center', 'right', 'between', 'around',
30 | 'stretch', 'top', 'middle', 'bottom'
31 | ])
32 | }
33 |
34 | Flex.defaultProps = {
35 | component: 'div',
36 | inline: false
37 | }
38 |
39 | export default Flex
40 |
--------------------------------------------------------------------------------
/src/components/Flex/Flex.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Flex
3 | route: /docs/flex
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Flex from './Flex'
9 | import Card from '../Card'
10 |
11 | # Flex
12 | ### Utilize the power of flexbox to create a wide range of layouts.
13 |
14 | ## Usage
15 |
16 |
17 | Item 1
18 | Item 2
19 | Item 3
20 |
21 |
22 |
23 | ---
24 |
25 | ## Horizontal alignment
26 |
27 |
28 | Item 1
29 | Item 2
30 | Item 3
31 |
32 |
33 |
34 | ---
35 |
36 | ## Vertical alignment
37 |
38 |
39 | Item 1
40 | Item 2
...
41 | Item 3
...
...
42 |
43 |
44 |
45 | ---
46 |
47 | ## Component props
48 | ### Flex
49 |
50 |
--------------------------------------------------------------------------------
/src/components/Flex/index.js:
--------------------------------------------------------------------------------
1 | import Flex from './Flex'
2 |
3 | export default Flex
4 |
--------------------------------------------------------------------------------
/src/components/Form/Form.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import FormFieldset from './FormFieldset'
6 | import FormLegend from './FormLegend'
7 | import FormControls from './FormControls'
8 |
9 | const Form = (props) => {
10 | const {
11 | className: customClassName,
12 | stacked,
13 | horizontal,
14 | ...rest
15 | } = props
16 |
17 | const className = classNames(customClassName, {
18 | 'uk-form-stacked': stacked,
19 | 'uk-form-horizontal': horizontal
20 | })
21 |
22 | return (
23 |
26 | )
27 | }
28 |
29 | Form.propTypes = {
30 | onSubmit: PropTypes.any,
31 | method: PropTypes.oneOf([
32 | 'get', 'post'
33 | ]),
34 | action: PropTypes.string,
35 | stacked: PropTypes.bool,
36 | horizontal: PropTypes.bool
37 | }
38 |
39 | Form.defaultProps = {
40 | stacked: false,
41 | horizontal: false
42 | }
43 |
44 | // Sub-components
45 | Form.Fieldset = FormFieldset
46 | Form.Legend = FormLegend
47 | Form.Controls = FormControls
48 |
49 | export default Form
50 |
--------------------------------------------------------------------------------
/src/components/Form/Form.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Form
3 | route: /docs/form
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Form from './Form'
9 | import Input from '../Input'
10 | import Button from '../Button'
11 | import Margin from '../Margin'
12 | import Card from '../Card'
13 | import Select from '../Select'
14 |
15 | # Form
16 | ### Easily create nice looking forms with different styles and layouts.
17 |
18 | | Sub-component | Description |
19 | |-|-|
20 | | `Form.Fieldset` | The form fieldset. |
21 | | `Form.Legend` | The form legend. |
22 | | `Form.Controls` | The form controls. |
23 |
24 | ## Usage
25 |
26 |
28 | Form
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | ---
44 |
45 | ## Layout
46 | ### Stacked form
47 |
48 |
89 |
90 |
91 | ### Horizontal form
92 |
93 |
134 |
135 |
136 | ---
137 |
138 | ## Component props
139 | ### Form
140 |
141 |
--------------------------------------------------------------------------------
/src/components/Form/FormControls.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const FormControls = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-form-controls')
12 |
13 | return React.createElement(component, {
14 | className: className,
15 | ...rest
16 | })
17 | }
18 |
19 | FormControls.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default FormControls
24 |
--------------------------------------------------------------------------------
/src/components/Form/FormFieldset.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const FormFieldset = (props) => {
5 | const {
6 | className: customClassName,
7 | ...rest
8 | } = props
9 |
10 | const className = classNames(customClassName, 'uk-fieldset')
11 |
12 | return (
13 |
16 | )
17 | }
18 |
19 | export default FormFieldset
20 |
--------------------------------------------------------------------------------
/src/components/Form/FormLegend.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const FormLegend = (props) => {
5 | const {
6 | className: customClassName,
7 | ...rest
8 | } = props
9 |
10 | const className = classNames(customClassName, 'uk-legend')
11 |
12 | return (
13 |
16 | )
17 | }
18 |
19 | export default FormLegend
20 |
--------------------------------------------------------------------------------
/src/components/Form/index.js:
--------------------------------------------------------------------------------
1 | import Form from './Form'
2 | export default Form
3 |
4 | export FormFieldset from './FormFieldset'
5 | export FormLegend from './FormLegend'
6 | export FormControls from './FormControls'
7 |
--------------------------------------------------------------------------------
/src/components/Grid/Grid.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 | import UIkit from 'uikit'
5 |
6 | import GridItem from './GridItem'
7 |
8 | const widthSizes = [
9 | '1-1',
10 | '1-2',
11 | '1-3', '2-3',
12 | '1-4', '3-4',
13 | '1-5', '4-5',
14 | '1-6', '5-6',
15 | 'auto', 'expand'
16 | ]
17 |
18 | class Grid extends React.Component {
19 |
20 | static propTypes = {
21 | className: PropTypes.string,
22 | gutter: PropTypes.string,
23 | divider: PropTypes.bool,
24 | match: PropTypes.bool,
25 | xs: PropTypes.oneOf(widthSizes),
26 | sm: PropTypes.oneOf(widthSizes),
27 | md: PropTypes.oneOf(widthSizes),
28 | lg: PropTypes.oneOf(widthSizes),
29 | xl: PropTypes.oneOf(widthSizes),
30 | }
31 |
32 | static defaultProps = {
33 | component: 'div',
34 | className: '',
35 | gutter: 'medium',
36 | divider: false,
37 | match: false
38 | }
39 |
40 | setRef = ref => this.node = ref
41 |
42 | componentDidMount() {
43 | this.component = UIkit.grid(this.node)
44 | }
45 |
46 | render() {
47 | const {
48 | className: customClassName,
49 | component,
50 | gutter,
51 | divider,
52 | match,
53 | xs, sm, md, lg, xl,
54 | ...rest
55 | } = this.props
56 |
57 | const className = classNames(customClassName, {
58 | [`uk-grid-${gutter}`]: gutter,
59 | 'uk-grid-divider': divider,
60 | 'uk-grid-match': match,
61 | /* Child widths */
62 | [`uk-child-width-${xs}`]: !!xs,
63 | [`uk-child-width-${sm}@s`]: !!sm,
64 | [`uk-child-width-${md}@m`]: !!md,
65 | [`uk-child-width-${lg}@l`]: !!lg,
66 | [`uk-child-width-${xl}@xl`]: !!xl,
67 | })
68 |
69 | return React.createElement(component, {
70 | ref: this.setRef,
71 | className: className,
72 | ...rest
73 | })
74 | }
75 | }
76 |
77 | Grid.Item = GridItem
78 |
79 | export default Grid
80 |
--------------------------------------------------------------------------------
/src/components/Grid/Grid.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Grid (WIP)
3 | route: /docs/grid
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Grid from './Grid'
9 | import Card from '../Card'
10 |
11 | # Grid
12 | ### Create a fully responsive, fluid and nestable grid layout.
13 |
14 | > This component is incomplete.
15 |
16 | | Sub-component | Description |
17 | |-|-|
18 | | `Grid.Item` | The item/column for the grid. Extends the `Width` component. |
19 |
20 | ## Usage
21 |
22 |
23 |
24 | Item
25 |
26 |
27 | Item
28 |
29 |
30 | Item
31 |
32 |
33 |
34 |
35 | ---
36 |
37 | ## Component props
38 | ### Grid
39 |
40 |
41 | ### Grid.Item
42 |
43 |
--------------------------------------------------------------------------------
/src/components/Grid/GridItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Width from '../Width/Width'
4 |
5 | class GridItem extends Width {}
6 |
7 | export default GridItem
8 |
--------------------------------------------------------------------------------
/src/components/Grid/index.js:
--------------------------------------------------------------------------------
1 | import Grid from './Grid'
2 | export default Grid
3 |
4 | export GridItem from './GridItem'
5 |
--------------------------------------------------------------------------------
/src/components/Input/Input.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import InputLabel from './InputLabel'
6 | import InputCheckbox from './InputCheckbox'
7 | import InputRadio from './InputRadio'
8 | import InputTextarea from './InputTextarea'
9 |
10 | const Input = (props) => {
11 | const {
12 | className: customClassName,
13 | size,
14 | ...rest
15 | } = props
16 |
17 | const className = classNames(customClassName, 'uk-input', {
18 | [`uk-form-${size}`]: !!size
19 | })
20 |
21 | return (
22 |
25 | )
26 | }
27 |
28 | Input.propTypes = {
29 | placeholder: PropTypes.string,
30 | value: PropTypes.any,
31 | disabled: PropTypes.bool,
32 | size: PropTypes.oneOf([
33 | 'small', 'large'
34 | ])
35 | }
36 |
37 | Input.defaultProps = {
38 | disabled: false
39 | }
40 |
41 | // Sub-components
42 | Input.Label = InputLabel
43 | Input.Checkbox = InputCheckbox
44 | Input.Radio = InputRadio
45 | Input.Textarea = InputTextarea
46 |
47 | export default Input
48 |
--------------------------------------------------------------------------------
/src/components/Input/Input.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Input
3 | route: /docs/input
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Input from './Input'
9 | import Margin from '../Margin'
10 |
11 | # Input
12 | ### Easily build forms with various inputs.
13 |
14 | | Sub-component | Description |
15 | |-|-|
16 | | `Input.Label` | The input label. |
17 | | `Input.Checkbox` | The input checkbox. |
18 | | `Input.Radio` | The input radio. |
19 | | `Input.Textarea` | The input textarea. |
20 |
21 | ## Usage
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | Checkbox A
32 |
33 |
34 | Checkbox B
35 |
36 |
37 |
38 | Radio A
39 |
40 |
41 | Radio B
42 |
43 |
44 |
45 | ---
46 |
47 | ## Sizes
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | ---
61 |
62 | ## Component props
63 | ### Input
64 |
65 |
66 | ### Input.Label
67 |
68 |
69 | ### Input.Checkbox
70 |
71 |
72 | ### Input.Radio
73 |
74 |
75 | ### Input.Textarea
76 |
77 |
--------------------------------------------------------------------------------
/src/components/Input/InputCheckbox.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const InputCheckbox = (props) => {
6 | const {
7 | className: customClassName,
8 | children,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-checkbox')
13 |
14 | return (
15 |
19 | )
20 | }
21 |
22 | InputCheckbox.propTypes = {
23 | name: PropTypes.string,
24 | checked: PropTypes.bool
25 | }
26 |
27 | export default InputCheckbox
28 |
--------------------------------------------------------------------------------
/src/components/Input/InputLabel.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const InputLabel = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | ...rest
10 | } = props
11 |
12 | const isElement = React.isValidElement(props.children[0])
13 |
14 | const className = classNames(customClassName, {
15 | 'uk-form-label': !isElement
16 | })
17 |
18 | return React.createElement(component, {
19 | className: className,
20 | ...rest
21 | })
22 | }
23 |
24 | InputLabel.propTypes = {
25 | htmlFor: PropTypes.string
26 | }
27 |
28 | InputLabel.defaultProps = {
29 | component: 'label'
30 | }
31 |
32 | export default InputLabel
33 |
--------------------------------------------------------------------------------
/src/components/Input/InputRadio.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const InputRadio = (props) => {
6 | const {
7 | className: customClassName,
8 | children,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-radio')
13 |
14 | return (
15 |
19 | )
20 | }
21 |
22 | InputRadio.propTypes = {
23 | name: PropTypes.string.isRequired
24 | }
25 |
26 | export default InputRadio
27 |
--------------------------------------------------------------------------------
/src/components/Input/InputTextarea.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const InputTextarea = (props) => {
6 | const {
7 | className: customClassName,
8 | rows,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-textarea')
13 |
14 | return (
15 |
19 | )
20 | }
21 |
22 | InputTextarea.propTypes = {
23 | rows: PropTypes.number,
24 | placeholder: PropTypes.string,
25 | value: PropTypes.any
26 | }
27 |
28 | InputTextarea.defaultProps = {
29 | rows: 4
30 | }
31 |
32 | export default InputTextarea
33 |
--------------------------------------------------------------------------------
/src/components/Input/index.js:
--------------------------------------------------------------------------------
1 | import Input from './Input'
2 | export default Input
3 |
4 | export InputLabel from './InputLabel'
5 | export InputCheckbox from './InputCheckbox'
6 | export InputRadio from './InputRadio'
7 | export InputTextarea from './InputTextarea'
8 |
--------------------------------------------------------------------------------
/src/components/Label/Label.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const Label = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | variant,
10 | ...rest
11 | } = props
12 |
13 | const className = classNames(customClassName, 'uk-label', {
14 | [`uk-label-${variant}`]: !!variant
15 | })
16 |
17 | return React.createElement(component, {
18 | className: className,
19 | ...rest
20 | })
21 | }
22 |
23 | Label.propTypes = {
24 | variant: PropTypes.oneOf([
25 | 'primary', 'success', 'warning', 'danger'
26 | ])
27 | }
28 |
29 | Label.defaultProps = {
30 | component: 'span'
31 | }
32 |
33 | export default Label
34 |
--------------------------------------------------------------------------------
/src/components/Label/Label.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Label
3 | route: /docs/label
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Label from './Label'
9 |
10 | # Label
11 | ### Indicate important notes and highlight parts of your content.
12 |
13 | ## Usage
14 |
15 |
16 |
17 |
18 | ---
19 |
20 | ## Style variations
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | ---
29 |
30 | ## Component props
31 | ### Label
32 |
33 |
--------------------------------------------------------------------------------
/src/components/Label/index.js:
--------------------------------------------------------------------------------
1 | import Label from './Label'
2 |
3 | export default Label
4 |
--------------------------------------------------------------------------------
/src/components/Link/Link.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | let customProps = {}
6 |
7 | const Link = (props) => {
8 | const {
9 | className: customClassName,
10 | component,
11 | muted,
12 | voided,
13 | heading,
14 | reset,
15 | ...rest
16 | } = props
17 |
18 | const className = classNames(customClassName, {
19 | 'uk-link-muted': muted,
20 | 'uk-link-heading': heading,
21 | 'uk-link-reset': reset
22 | }) || undefined
23 |
24 | switch (component) {
25 | case 'a':
26 | customProps = {
27 | ...customProps,
28 | href: voided ? 'javascript:;' : props.href || '#',
29 | role: voided ? 'button' : undefined
30 | }
31 | break
32 | case 'button':
33 | customProps = {
34 | ...customProps,
35 | type: props.type || 'button'
36 | }
37 | default:
38 | // Nothing
39 | }
40 |
41 | return React.createElement(component, {
42 | className: className,
43 | ...customProps,
44 | ...rest
45 | })
46 | }
47 |
48 | Link.propTypes = {
49 | muted: PropTypes.bool,
50 | voided: PropTypes.bool,
51 | heading: PropTypes.bool,
52 | reset: PropTypes.bool,
53 | }
54 |
55 | Link.defaultProps = {
56 | component: 'a',
57 | muted: false,
58 | voided: false,
59 | heading: false,
60 | reset: false,
61 | }
62 |
63 | export default Link
64 |
--------------------------------------------------------------------------------
/src/components/Link/Link.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Link
3 | route: /docs/link
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable, Link as _Link } from 'docz'
8 | import Link from './Link'
9 |
10 | # Link
11 | ### Define different styles to integrate links into specific content.
12 |
13 | ## Usage
14 |
15 |
16 | Link
17 | Link
18 |
19 |
20 | ---
21 |
22 | ## Muted
23 |
24 |
25 | Link
26 |
27 |
28 | ---
29 |
30 | ## Voided
31 | Use the `voided` prop for links that perform JavaScript but don't go anywhere.
32 |
33 |
34 | Link
35 |
36 |
37 | ---
38 |
39 | ## Link heading
40 |
41 |
42 | Heading
43 |
44 |
45 | ---
46 |
47 | ## Link reset
48 |
49 |
50 | Link
51 | Heading
52 |
53 |
54 | ---
55 |
56 | ## With React Router
57 | Learn more about the [React Router](https://reacttraining.com/react-router/) library.
58 |
59 |
60 | Link with React Router
61 |
62 |
63 | ---
64 |
65 | ## Component props
66 | ### Link
67 |
68 |
--------------------------------------------------------------------------------
/src/components/Link/index.js:
--------------------------------------------------------------------------------
1 | import Link from './Link'
2 | export default Link
3 |
--------------------------------------------------------------------------------
/src/components/List/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import ListItem from './ListItem'
6 |
7 | const List = (props) => {
8 | const {
9 | className: customClassName,
10 | bullet,
11 | divider,
12 | striped,
13 | large,
14 | ...rest
15 | } = props
16 |
17 | const className = classNames(customClassName, 'uk-list', {
18 | 'uk-list-bullet': bullet,
19 | 'uk-list-divider': divider,
20 | 'uk-list-striped': striped,
21 | 'uk-list-large': large
22 | })
23 |
24 | return (
25 |
28 | )
29 | }
30 |
31 | List.propTypes = {
32 | bullet: PropTypes.bool,
33 | divider: PropTypes.bool,
34 | striped: PropTypes.bool,
35 | large: PropTypes.bool,
36 | }
37 |
38 | List.defaultProps = {
39 | bullet: false,
40 | divider: false,
41 | striped: false,
42 | large: false,
43 | }
44 |
45 | // Sub-components
46 | List.Item = ListItem
47 |
48 | export default List
49 |
--------------------------------------------------------------------------------
/src/components/List/List.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: List
3 | route: /docs/list
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import List from './List'
9 |
10 | # List
11 | ### Easily create nice looking lists, which come in different styles.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `List.Item` | The list item. |
16 |
17 | ## Usage
18 |
19 |
20 |
21 | List item 1
22 | List item 2
23 | List item 3
24 |
25 |
26 |
27 | ---
28 |
29 | ## Bullet modifier
30 |
31 |
32 |
33 | List item 1
34 | List item 2
35 | List item 3
36 |
37 |
38 |
39 | ---
40 |
41 | ## Divider modifier
42 |
43 |
44 |
45 | List item 1
46 | List item 2
47 | List item 3
48 |
49 |
50 |
51 | ---
52 |
53 | ## Striped modifier
54 |
55 |
56 |
57 | List item 1
58 | List item 2
59 | List item 3
60 |
61 |
62 |
63 | ---
64 |
65 | ## Large modifier
66 |
67 |
68 |
69 | List item 1
70 | List item 2
71 | List item 3
72 |
73 |
74 |
75 | ---
76 |
77 | ## Component props
78 |
79 | ### List
80 |
81 |
--------------------------------------------------------------------------------
/src/components/List/ListItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const ListItem = (props) => {
5 | const {
6 | className: customClassName,
7 | ...rest
8 | } = props
9 |
10 | const className = classNames(customClassName) || undefined
11 |
12 | return (
13 |
16 | )
17 | }
18 |
19 | export default ListItem
20 |
--------------------------------------------------------------------------------
/src/components/List/index.js:
--------------------------------------------------------------------------------
1 | import List from './List'
2 | export default List
3 |
4 | export ListItem from './ListItem'
5 |
--------------------------------------------------------------------------------
/src/components/Margin/Margin.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const Margin = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | dynamic,
10 | ...rest
11 | } = props
12 |
13 | const className = classNames(customClassName, 'uk-margin')
14 |
15 | return React.createElement(component, {
16 | className: className,
17 | ...dynamic ? { 'uk-margin' : '' } : undefined,
18 | ...rest
19 | })
20 | }
21 |
22 | Margin.propTypes = {
23 | dynamic: PropTypes.bool
24 | }
25 |
26 | Margin.defaultProps = {
27 | component: 'div',
28 | dynamic: false
29 | }
30 |
31 | export default Margin
32 |
--------------------------------------------------------------------------------
/src/components/Margin/Margin.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Margin
3 | route: /docs/margin
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Margin from './Margin'
9 | import Card from '../Card'
10 |
11 | # Margin
12 | ### A collection of utility classes to add spacing between elements.
13 |
14 | ## Usage
15 |
16 |
17 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
18 |
19 |
20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
21 |
22 |
23 |
24 | ---
25 |
26 | ## Component props
27 | ### Margin
28 |
29 |
--------------------------------------------------------------------------------
/src/components/Margin/index.js:
--------------------------------------------------------------------------------
1 | import Margin from './Margin'
2 |
3 | export default Margin
4 |
--------------------------------------------------------------------------------
/src/components/Modal/Modal.js:
--------------------------------------------------------------------------------
1 | /*import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { Portal } from 'react-portal'
4 | import _ from 'lodash'
5 | import classNames from 'classnames'
6 |
7 | class Modal extends React.Component {
8 |
9 | state = {
10 | isOpen: false
11 | }
12 |
13 | static propTypes = {
14 | open: PropTypes.bool
15 | }
16 |
17 | static defaultProps = {
18 | open: false
19 | }
20 |
21 | setRef = ref => this.node = ref
22 |
23 | handleClose = () => {
24 | setTimeout(() => {
25 | this.props.open = false
26 | }, 300)
27 | }
28 |
29 | render() {
30 | const { open } = this.props
31 |
32 | const className = classNames('uk-modal', {
33 | 'uk-open': open
34 | })
35 |
36 | const style = {
37 | display: 'block'
38 | }
39 |
40 | return (
41 |
45 |
49 |
50 |
51 | )
52 | }
53 | }
54 |
55 | export default Modal
56 | */
57 |
--------------------------------------------------------------------------------
/src/components/Nav/Nav.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import NavItem from './NavItem'
6 | import NavHeader from './NavHeader'
7 | import NavDivider from './NavDivider'
8 |
9 | const Nav = (props) => {
10 | const {
11 | className: customClassName,
12 | navbar,
13 | ...rest
14 | } = props
15 |
16 | const className = classNames(customClassName, {
17 | 'uk-nav': !navbar,
18 | 'uk-nav-default': !navbar,
19 | 'uk-navbar-nav': navbar
20 | })
21 |
22 | return (
23 |
26 | )
27 | }
28 |
29 | Nav.propTypes = {
30 | navbar: PropTypes.bool
31 | }
32 |
33 | Nav.defaultProps = {
34 | navbar: false
35 | }
36 |
37 | // Sub-components
38 | Nav.Item = NavItem
39 | Nav.Header = NavHeader
40 | Nav.Divider = NavDivider
41 |
42 | export default Nav
43 |
--------------------------------------------------------------------------------
/src/components/Nav/Nav.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Nav
3 | route: /docs/nav
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Nav from './Nav'
9 | import Link from '../Link'
10 |
11 | # Nav
12 | ### Defines different styles for list navigations.
13 |
14 | | Sub-component | Description |
15 | |-|-|
16 | | `Nav.Item` | The item for the nav. |
17 | | `Nav.Header` | The header for the nav. |
18 | | `Nav.Divider` | The divider for the nav. |
19 |
20 | ## Usage
21 |
22 |
33 |
34 |
35 | ---
36 |
37 | ## Header & Divider
38 |
39 |
52 |
53 |
54 | ---
55 |
56 | ## Component props
57 |
58 | ### Nav.Item
59 |
60 |
--------------------------------------------------------------------------------
/src/components/Nav/NavDivider.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const NavDivider = (props) => {
5 | const {
6 | className: customClassName,
7 | children,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-nav-divider')
12 |
13 | return (
14 |
17 | )
18 | }
19 |
20 | export default NavDivider
21 |
--------------------------------------------------------------------------------
/src/components/Nav/NavHeader.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const NavItem = (props) => {
5 | const {
6 | className: customClassName,
7 | ...rest
8 | } = props
9 |
10 | const className = classNames(customClassName, 'uk-nav-header')
11 |
12 | return (
13 |
16 | )
17 | }
18 |
19 | export default NavItem
20 |
--------------------------------------------------------------------------------
/src/components/Nav/NavItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const NavItem = (props) => {
6 | const {
7 | className: customClassName,
8 | active,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames({
13 | 'uk-active': active
14 | }) || undefined
15 |
16 | return (
17 |
20 | )
21 | }
22 |
23 | NavItem.propTypes = {
24 | active: PropTypes.bool
25 | }
26 |
27 | NavItem.defaultProps = {
28 | active: false
29 | }
30 |
31 | export default NavItem
32 |
--------------------------------------------------------------------------------
/src/components/Nav/index.js:
--------------------------------------------------------------------------------
1 | import Nav from './Nav'
2 | export default Nav
3 |
4 | export NavItem from './NavItem'
5 | export NavHeader from './NavHeader'
6 | export NavDivider from './NavDivider'
7 |
--------------------------------------------------------------------------------
/src/components/Navbar/Navbar.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 | import UIkit from 'uikit'
5 |
6 | class Navbar extends React.Component {
7 | static defaultProps = {
8 | component: 'nav'
9 | }
10 |
11 | setRef = ref => this.node = ref
12 |
13 | componentDidMount() {
14 | this.component = UIkit.navbar(this.node)
15 | }
16 |
17 | componentWillUnmount() {
18 | this.component.$destroy()
19 | }
20 |
21 | render() {
22 | const {
23 | className: customClassName,
24 | component,
25 | ...rest
26 | } = this.props
27 |
28 | const className = classNames(customClassName, 'uk-navbar-container')
29 |
30 | return React.createElement(component, {
31 | ref: this.setRef,
32 | className: className,
33 | ...rest
34 | })
35 | }
36 | }
37 |
38 | const NavbarBlock = (props) => {
39 | const {
40 | className: customClassName,
41 | component,
42 | align,
43 | ...rest
44 | } = props
45 |
46 | const className = classNames(customClassName, {
47 | [`uk-navbar-${align}`]: !!align
48 | })
49 |
50 | return React.createElement(component, {
51 | className: className,
52 | ...rest
53 | })
54 | }
55 | NavbarBlock.propTypes = {
56 | align: PropTypes.oneOf([
57 | 'left', 'center', 'right'
58 | ])
59 | }
60 | NavbarBlock.defaultProps = {
61 | component: 'div',
62 | align: 'left'
63 | }
64 |
65 | Navbar.Block = NavbarBlock
66 |
67 | export default Navbar
68 |
--------------------------------------------------------------------------------
/src/components/Navbar/Navbar.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Navbar
3 | route: /docs/navbar
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Navbar from './Navbar'
9 | import Nav from '../Nav'
10 | import Link from '../Link'
11 | import Dropdown from '../Dropdown'
12 |
13 | # Navbar
14 | ### Create a navigation bar that can be used for your main site navigation.
15 |
16 | | Sub-component | Description |
17 | |-|-|
18 | | `Navbar.Block` | The inner block for the navbar. |
19 |
20 | ## Usage
21 |
22 |
23 |
24 |
25 |
49 |
50 |
51 |
52 |
53 | ---
54 |
55 | ## Multiple navigations
56 |
57 |
58 |
59 |
60 |
61 |
62 | Active
63 |
64 |
65 | Parent
66 |
67 |
68 |
69 | Active
70 |
71 |
72 | Item
73 |
74 |
75 | Item
76 |
77 |
78 |
79 |
80 |
81 | Item
82 |
83 |
84 |
85 |
86 |
87 |
88 | Active
89 |
90 |
91 | Parent
92 |
93 |
94 |
95 | Active
96 |
97 |
98 | Item
99 |
100 |
101 | Item
102 |
103 |
104 |
105 |
106 |
107 | Item
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/src/components/Navbar/index.js:
--------------------------------------------------------------------------------
1 | import Navbar from './Navbar'
2 | export default Navbar
3 |
--------------------------------------------------------------------------------
/src/components/Placeholder/Placeholder.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import classNames from 'classnames'
3 |
4 | const Placeholder = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ...rest
9 | } = props
10 |
11 | const className = classNames(customClassName, 'uk-placeholder')
12 |
13 | return React.createElement(component, {
14 | className,
15 | ...rest
16 | })
17 | }
18 |
19 | Placeholder.defaultProps = {
20 | component: 'div'
21 | }
22 |
23 | export default Placeholder
24 |
--------------------------------------------------------------------------------
/src/components/Placeholder/Placeholder.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Placeholder
3 | route: /docs/placeholder
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Placeholder from './Placeholder'
9 |
10 | # Placeholder
11 | ### Create a placeholder space that can be used for uploading files via drag and drop.
12 |
13 | ## Usage
14 |
15 |
16 | Lorem ipsum dolor sit amet, consectetur adipiscing elit.
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/components/Placeholder/index.js:
--------------------------------------------------------------------------------
1 | import Placeholder from './Placeholder'
2 | export default Placeholder
3 |
--------------------------------------------------------------------------------
/src/components/Progress/Progress.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const Progress = (props) => {
6 | const {
7 | className: customClassName,
8 | children,
9 | ...rest
10 | } = props
11 |
12 | const className = classNames(customClassName, 'uk-progress')
13 |
14 | return (
15 |
18 | )
19 | }
20 |
21 | Progress.propTypes = {
22 | value: PropTypes.number,
23 | max: PropTypes.number
24 | }
25 |
26 | Progress.defaultProps = {
27 | value: 0,
28 | max: 100
29 | }
30 |
31 | export default Progress
32 |
--------------------------------------------------------------------------------
/src/components/Progress/Progress.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Progress
3 | route: /docs/progress
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Progress from './Progress'
9 |
10 | # Progress
11 | ### Defines progress bars that indicate how far along a process is.
12 |
13 | ## Usage
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ---
23 |
24 | ## Component props
25 | ### Progress
26 |
27 |
--------------------------------------------------------------------------------
/src/components/Progress/index.js:
--------------------------------------------------------------------------------
1 | import Progress from './Progress'
2 |
3 | export default Progress
4 |
--------------------------------------------------------------------------------
/src/components/Select/Select.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import SelectOption from './SelectOption'
6 |
7 | const Select = (props) => {
8 | const {
9 | className: customClassName,
10 | size,
11 | blank,
12 | ...rest
13 | } = props
14 |
15 | const className = classNames(
16 | customClassName,
17 | 'uk-select',
18 | {
19 | [`uk-form-${size}`]: !!size,
20 | 'uk-form-blank': blank
21 |
22 | }
23 | )
24 |
25 | return (
26 |
29 | )
30 | }
31 |
32 | Select.propTypes = {
33 | size: PropTypes.oneOf([
34 | 'large', 'small'
35 | ]),
36 | blank: PropTypes.bool
37 | }
38 |
39 | Select.defaultProps = {
40 | blank: false
41 | }
42 |
43 | // Sub-components
44 | Select.Option = SelectOption
45 |
46 | export default Select
47 |
--------------------------------------------------------------------------------
/src/components/Select/Select.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Select
3 | route: /docs/select
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Select from './Select'
9 |
10 | # Select
11 | ### Collect user provided information from a list of options.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `Select.Option` | The select option. |
16 |
17 | ## Usage
18 |
19 |
20 |
26 |
27 |
28 | ---
29 |
30 | ## Size modifiers
31 |
32 |
33 |
39 |
45 |
46 |
47 | ---
48 |
49 | ## Blank modifier
50 |
51 |
52 |
58 |
59 |
60 | ---
61 |
62 | ## Component props
63 | ### Select
64 |
65 |
66 | ### Select.Option
67 |
68 |
--------------------------------------------------------------------------------
/src/components/Select/SelectOption.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | const SelectOption = (props) => {
5 | const {
6 | className,
7 | value,
8 | ...rest
9 | } = props
10 |
11 | return (
12 |
15 | )
16 | }
17 |
18 | SelectOption.propTypes = {
19 | children: PropTypes.string,
20 | value: PropTypes.oneOfType([
21 | PropTypes.string,
22 | PropTypes.number
23 | ]),
24 | name: PropTypes.string
25 | }
26 |
27 | SelectOption.defaultProps = {
28 | value: ''
29 | }
30 |
31 | export default SelectOption
32 |
--------------------------------------------------------------------------------
/src/components/Select/index.js:
--------------------------------------------------------------------------------
1 | import Select from './Select'
2 | export default Select
3 |
4 | export SelectOption from './SelectOption'
5 |
--------------------------------------------------------------------------------
/src/components/Spinner/Spinner.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | const Progress = (props) => {
5 | const {
6 | className: customClassName,
7 | component,
8 | ratio,
9 | children,
10 | ...rest
11 | } = props
12 |
13 | return React.createElement(component, {
14 | 'uk-spinner': '',
15 | ...rest
16 | })
17 | }
18 |
19 | Progress.propTypes = {
20 | ratio: PropTypes.number
21 | }
22 |
23 | Progress.defaultProps = {
24 | component: 'div'
25 | }
26 |
27 | export default Progress
28 |
--------------------------------------------------------------------------------
/src/components/Spinner/Spinner.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Spinner (WIP)
3 | route: /docs/spinner
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Spinner from './Spinner'
9 |
10 | # Spinner
11 | ### Create an animated loading spinner.
12 |
13 | > This component is incomplete.
14 |
15 | ## Usage
16 |
17 |
18 |
19 |
20 | ---
21 |
22 | ## Component props
23 | ### Spinner
24 |
25 |
--------------------------------------------------------------------------------
/src/components/Spinner/index.js:
--------------------------------------------------------------------------------
1 | import Spinner from './Spinner'
2 |
3 | export default Spinner
4 |
--------------------------------------------------------------------------------
/src/components/Tab/Tab.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 | import UIkit from 'uikit'
5 |
6 | import TabItem from './TabItem'
7 |
8 | class Tab extends React.Component {
9 |
10 | static propTypes = {
11 | bottom: PropTypes.bool
12 | }
13 |
14 | static defaultProps = {
15 | component: 'ul',
16 | bottom: false
17 | }
18 |
19 | setRef = ref => this.node = ref
20 |
21 | componentDidMount() {
22 | this.component = UIkit.tab(this.node)
23 | }
24 |
25 | componentWillUnmount() {
26 | this.component.$destroy()
27 | }
28 |
29 | render() {
30 | const {
31 | className: customClassName,
32 | bottom,
33 | ...rest
34 | } = this.props
35 |
36 | const className = classNames(customClassName, {
37 | 'uk-tab-bottom': bottom
38 | })
39 |
40 | return React.createElement(
41 | this.props.component,
42 | {
43 | ref: this.setRef,
44 | className,
45 | ...rest
46 | },
47 | this.props.children
48 | )
49 | }
50 | }
51 |
52 | // Sub-components
53 | Tab.Item = TabItem
54 |
55 | export default Tab
56 |
--------------------------------------------------------------------------------
/src/components/Tab/Tab.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Tab
3 | route: /docs/tab
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Tab from './Tab'
9 |
10 | # Tab
11 | ### Create a tabbed navigation with different styles.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `Tab.Item` | The tab item. |
16 |
17 | ## Usage
18 |
19 |
20 | Left
21 | Item
22 | Item
23 | Disabled
24 |
25 |
26 |
27 | ---
28 |
29 | ## Component props
30 | #### Tab
31 |
32 |
33 | #### Tab.Item
34 |
35 |
--------------------------------------------------------------------------------
/src/components/Tab/TabItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const TabItem = (props) => {
6 | const {
7 | className: customClassName,
8 | component,
9 | disabled,
10 | ...rest
11 | } = props
12 |
13 | const className = classNames(customClassName, {
14 | 'uk-disabled': disabled
15 | })
16 |
17 | return (
18 |
20 | {React.createElement(component, {
21 | ...rest
22 | })}
23 |
24 | )
25 | }
26 |
27 | TabItem.propTypes = {
28 | disabled: PropTypes.bool
29 | }
30 |
31 | TabItem.defaultProps = {
32 | component: 'a',
33 | disabled: false
34 | }
35 |
36 | export default TabItem
37 |
--------------------------------------------------------------------------------
/src/components/Tab/index.js:
--------------------------------------------------------------------------------
1 | import Tab from './Tab'
2 | export default Tab
3 |
4 | export TabItem from './TabItem'
5 |
--------------------------------------------------------------------------------
/src/components/Table/Table.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | import TableCaption from './TableCaption'
6 | import TableHead from './TableHead'
7 | import TableBody from './TableBody'
8 | import TableFooter from './TableFooter'
9 | import TableRow from './TableRow'
10 | import TableCell from './TableCell'
11 |
12 | const Table = (props) => {
13 | const {
14 | className: customClassName,
15 | divider,
16 | striped,
17 | hover,
18 | size,
19 | ...rest
20 | } = props
21 |
22 | const className = classNames(customClassName, 'uk-table', {
23 | 'uk-table-divider': divider,
24 | 'uk-table-striped': striped,
25 | 'uk-table-hover': hover,
26 | [`uk-table-${size}`]: size && size !== 'default'
27 | })
28 |
29 | return (
30 |
33 | )
34 | }
35 |
36 | Table.propTypes = {
37 | divider: PropTypes.bool,
38 | striped: PropTypes.bool,
39 | hover: PropTypes.bool,
40 | size: PropTypes.oneOf([
41 | 'small', 'default', 'large'
42 | ]),
43 | }
44 |
45 | Table.defaultProps = {
46 | divider: false,
47 | striped: false,
48 | hover: false,
49 | size: 'default'
50 | }
51 |
52 | // Sub-components
53 | Table.Caption = TableCaption
54 | Table.Head = TableHead
55 | Table.Body = TableBody
56 | Table.Footer = TableFooter
57 | Table.Row = TableRow
58 | Table.Cell = TableCell
59 |
60 | export default Table
61 |
--------------------------------------------------------------------------------
/src/components/Table/Table.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Table
3 | route: /docs/table
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Table from './Table'
9 |
10 | # Table
11 | ### Easily create nice looking tables, which come in different styles.
12 |
13 | | Sub-component | Description |
14 | |-|-|
15 | | `Table.Caption` | The caption for the table. |
16 | | `Table.Head` | The table head ``. |
17 | | `Table.Body` | The table body ``. |
18 | | `Table.Footer` | The table footer ``. |
19 | | `Table.Row` | The table row ``. |
20 | | `Table.Cell` | The table cell `` or ` | `. |
21 |
22 | ## Usage
23 |
24 |
25 | Table Caption
26 |
27 |
28 | Table Heading
29 | Table Heading
30 | Table Heading
31 |
32 |
33 |
34 |
35 | Table Footer
36 | Table Footer
37 | Table Footer
38 |
39 |
40 |
41 |
42 | Table Data
43 | Table Data
44 | Table Data
45 |
46 |
47 | Table Data
48 | Table Data
49 | Table Data
50 |
51 |
52 |
53 |
54 |
55 | ---
56 |
57 | ## Divider modifier
58 |
59 | Enable the table divider modifier using the `divider` prop.
60 |
61 |
62 |
63 |
64 |
65 | Table Heading
66 | Table Heading
67 | Table Heading
68 |
69 |
70 |
71 |
72 | Table Data
73 | Table Data
74 | Table Data
75 |
76 |
77 | Table Data
78 | Table Data
79 | Table Data
80 |
81 |
82 | Table Data
83 | Table Data
84 | Table Data
85 |
86 |
87 |
88 |
89 |
90 | ---
91 |
92 | ## Striped modifier
93 |
94 | Enable the table striped modifier using the `striped` prop.
95 |
96 |
97 |
98 |
99 |
100 | Table Heading
101 | Table Heading
102 | Table Heading
103 |
104 |
105 |
106 |
107 | Table Data
108 | Table Data
109 | Table Data
110 |
111 |
112 | Table Data
113 | Table Data
114 | Table Data
115 |
116 |
117 | Table Data
118 | Table Data
119 | Table Data
120 |
121 |
122 |
123 |
124 |
125 | ---
126 |
127 | ## Hover modifier
128 |
129 | Enable the table hover modifier using the `hover` prop.
130 |
131 |
132 |
133 |
134 |
135 | Table Heading
136 | Table Heading
137 | Table Heading
138 |
139 |
140 |
141 |
142 | Table Data
143 | Table Data
144 | Table Data
145 |
146 |
147 | Table Data
148 | Table Data
149 | Table Data
150 |
151 |
152 | Table Data
153 | Table Data
154 | Table Data
155 |
156 |
157 |
158 |
159 |
160 | ---
161 |
162 | ## Size modifiers
163 |
164 |
165 |
166 |
167 | Table Heading
168 | Table Heading
169 | Table Heading
170 |
171 |
172 |
173 |
174 | Table Data
175 | Table Data
176 | Table Data
177 |
178 |
179 | Table Data
180 | Table Data
181 | Table Data
182 |
183 |
184 | Table Data
185 | Table Data
186 | Table Data
187 |
188 |
189 |
190 |
191 |
192 | ---
193 |
194 | ## Component props
195 | ### Table
196 |
197 |
--------------------------------------------------------------------------------
/src/components/Table/TableBody.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const TableBody = (props) => {
4 | const {
5 | children,
6 | ...rest
7 | } = props
8 |
9 | const childrenWithOriginProp = React.Children.map(children, child => {
10 | return React.cloneElement(child, { origin: 'TableBody' })
11 | })
12 |
13 | return (
14 | |
17 | )
18 | }
19 |
20 | export default TableBody
21 |
--------------------------------------------------------------------------------
/src/components/Table/TableCaption.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const TableCaption = (props) => {
4 | const {
5 | ...rest
6 | } = props
7 |
8 | return (
9 |
11 | )
12 | }
13 |
14 | export default TableCaption
15 |
--------------------------------------------------------------------------------
/src/components/Table/TableCell.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | const TableCell = (props) => {
5 | const {
6 | origin,
7 | ...rest
8 | } = props
9 |
10 | if (origin === 'TableHead')
11 | return (
12 | |
13 | )
14 |
15 | return (
16 | |
17 | )
18 | }
19 |
20 | TableCell.propTypes = {
21 | origin: PropTypes.string.isRequired
22 | }
23 |
24 | export default TableCell
25 |
--------------------------------------------------------------------------------
/src/components/Table/TableFooter.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const TableFooter = (props) => {
4 | const {
5 | children,
6 | ...rest
7 | } = props
8 |
9 | const childrenWithOriginProp = React.Children.map(children, child => {
10 | return React.cloneElement(child, { origin: 'TableFooter' })
11 | })
12 |
13 | return (
14 |
17 | )
18 | }
19 |
20 | export default TableFooter
21 |
--------------------------------------------------------------------------------
/src/components/Table/TableHead.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const TableHead = (props) => {
4 | const {
5 | children,
6 | ...rest
7 | } = props
8 |
9 | const childrenWithOriginProp = React.Children.map(children, child => {
10 | return React.cloneElement(child, { origin: 'TableHead' })
11 | })
12 |
13 | return (
14 |
17 | )
18 | }
19 |
20 | export default TableHead
21 |
--------------------------------------------------------------------------------
/src/components/Table/TableRow.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | const TableRow = (props) => {
5 | const {
6 | origin,
7 | children,
8 | ...rest
9 | } = props
10 |
11 | const childrenWithOriginProp = React.Children.map(children, child => {
12 | return React.cloneElement(child, { origin: origin })
13 | })
14 |
15 | return (
16 |
19 | )
20 | }
21 |
22 | TableRow.propTypes = {
23 | origin: PropTypes.string.isRequired
24 | }
25 |
26 | export default TableRow
27 |
--------------------------------------------------------------------------------
/src/components/Table/index.js:
--------------------------------------------------------------------------------
1 | import Table from './Table'
2 | export default Table
3 |
4 | export TableCaption from './TableCaption'
5 | export TableHead from './TableHead'
6 | export TableBody from './TableBody'
7 | export TableFooter from './TableFooter'
8 | export TableRow from './TableRow'
9 | export TableCell from './TableCell'
10 |
--------------------------------------------------------------------------------
/src/components/Tooltip/Tooltip.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import PropTypes from 'prop-types'
4 | import UIkit from 'uikit'
5 |
6 | class Tooltip extends React.Component {
7 |
8 | static propTypes = {
9 | title: PropTypes.string.isRequired,
10 | options: PropTypes.object,
11 | children: PropTypes.node.isRequired,
12 | position: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
13 | duration: PropTypes.number,
14 | delay: PropTypes.number,
15 | animation: PropTypes.string,
16 | }
17 |
18 | static defaultProps = {
19 | options: {},
20 | position: 'top',
21 | duration: 100,
22 | animation: 'uk-animation-scale-up',
23 | /*onBeforeShow: f=>f,
24 | onShow: f=>f,
25 | onShown: f=>f,
26 | onBeforeHide: f=>f,
27 | onHide: f=>f,
28 | onHidden: f=>f,*/
29 | }
30 |
31 | /*_events = {
32 | 'beforeshow': () => this.props.onBeforeShow(),
33 | 'show': () => this.props.onShow(),
34 | 'shown': () => this.props.onShown(),
35 | 'beforehide': () => this.props.onBeforeHide(),
36 | 'hide': () => this.props.onHide(),
37 | 'hidden': () => this.props.onHidden(),
38 | }*/
39 |
40 | componentDidMount() {
41 | const {
42 | position: pos,
43 | duration,
44 | delay,
45 | animation
46 | } = this.props
47 |
48 | const options = {
49 | ...{ pos, duration, delay, animation },
50 | ...this.props.options,
51 | }
52 |
53 | this.component = UIkit.tooltip(ReactDOM.findDOMNode(this), options)
54 | }
55 |
56 | componentWillUnmount() {
57 | this.component.$destroy();
58 | }
59 |
60 | render() {
61 | const {
62 | title,
63 | children,
64 | position,
65 | options,
66 | duration,
67 | animation,
68 | ...rest
69 | } = this.props
70 |
71 | return React.cloneElement(children, {
72 | title: title,
73 | ...rest
74 | })
75 | }
76 | }
77 |
78 | export default Tooltip
79 |
--------------------------------------------------------------------------------
/src/components/Tooltip/Tooltip.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Tooltip
3 | route: /docs/tooltip
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Tooltip from './Tooltip'
9 | import Button from '../Button'
10 | import Margin from '../Margin'
11 |
12 | # Tooltip
13 | ### Easily create a nice looking tooltip.
14 |
15 | ## Usage
16 |
17 |
18 |
19 |
20 |
21 |
22 | ---
23 |
24 | ## Alignments
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | ---
55 |
56 | ## Delay
57 |
58 |
59 |
60 |
61 |
62 |
63 | ---
64 |
65 | ## Component props
66 | ### Tooltip
67 |
68 |
69 | #### Note:
70 | You may pass options through the `options` prop as an object, but doing so will overwrite the current props.
71 |
72 | ---
73 |
74 | ## Events
75 | ### Tooltip
76 |
77 | #### Note:
78 | Events are triggered on the `document` rather than on the component. To listen for events, use the `UIkit.util.on` utility function as shown in the [official docs](https://getuikit.com/docs/tooltip#javascript).
79 |
--------------------------------------------------------------------------------
/src/components/Tooltip/index.js:
--------------------------------------------------------------------------------
1 | import Tooltip from './Tooltip'
2 |
3 | export default Tooltip
4 |
--------------------------------------------------------------------------------
/src/components/Width/Width.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import classNames from 'classnames'
4 |
5 | const widthSizes = [
6 | '1-1',
7 | '1-2',
8 | '1-3', '2-3',
9 | '1-4', '3-4',
10 | '1-5', '4-5',
11 | '1-6', '5-6',
12 | 'auto', 'expand'
13 | ]
14 |
15 | const fixedSizes = [
16 | 'small', 'medium', 'large', 'xlarge', 'xxlarge'
17 | ]
18 |
19 | class Width extends React.Component {
20 |
21 | static propTypes = {
22 | xs: PropTypes.oneOf(widthSizes),
23 | sm: PropTypes.oneOf(widthSizes),
24 | md: PropTypes.oneOf(widthSizes),
25 | lg: PropTypes.oneOf(widthSizes),
26 | xl: PropTypes.oneOf(widthSizes),
27 | fixed: PropTypes.oneOf(fixedSizes),
28 | }
29 |
30 | static defaultProps = {
31 | component: 'div'
32 | }
33 |
34 | render() {
35 | const {
36 | className: customClassName,
37 | component,
38 | xs, sm, md, lg, xl,
39 | fixed,
40 | ...rest
41 | } = this.props
42 |
43 | const className = classNames(customClassName, {
44 | [`uk-width-${xs}`]: !!xs && !fixed,
45 | [`uk-width-${sm}@s`]: !!sm && !fixed,
46 | [`uk-width-${md}@m`]: !!md && !fixed,
47 | [`uk-width-${lg}@l`]: !!lg && !fixed,
48 | [`uk-width-${xl}@xl`]: !!xl && !fixed,
49 | [`uk-width-${fixed}`]: !!fixed
50 | }) || undefined
51 |
52 | return React.createElement(component, {
53 | className: className,
54 | ...rest
55 | })
56 | }
57 | }
58 |
59 | export default Width
60 |
--------------------------------------------------------------------------------
/src/components/Width/Width.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Width
3 | route: /docs/width
4 | menu: Components
5 | ---
6 |
7 | import { Playground, PropsTable } from 'docz'
8 | import Width from './Width'
9 | import Grid from '../Grid'
10 | import Card from '../Card'
11 | import Margin from '../Margin'
12 |
13 | # Width
14 | ### Define the width of elements for different viewport sizes.
15 |
16 | ## Usage
17 |
18 |
19 |
20 |
21 | 1-3
22 |
23 |
24 | 1-3
25 |
26 |
27 | 1-3
28 |
29 |
30 | 1-2
31 |
32 |
33 | 1-2
34 |
35 |
36 | 1-4
37 |
38 |
39 | 3-4
40 |
41 |
42 |
43 |
44 | ---
45 |
46 | ## Auto & Expand
47 |
48 |
49 |
50 |
51 | Auto
52 |
53 |
54 | Expand
55 |
56 |
57 |
58 |
59 | ---
60 |
61 | ## Equal child widths
62 | Just apply the responsive size props to the `Grid` component instead.
63 |
64 |
65 |
66 |
67 | Item
68 |
69 |
70 | Item
71 |
72 |
73 | Item
74 |
75 |
76 | Item
77 |
78 |
79 | Item
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | Item
88 |
89 |
90 | Item
91 |
92 |
93 | Item
94 |
95 |
96 | Item
97 |
98 |
99 | Item
100 |
101 |
102 |
103 |
104 | ---
105 |
106 | ## Fixed width
107 | The fixed width classes do not utilize the response breakpoints, just use the `fixed` prop instead.
108 |
109 |
110 |
111 |
112 | Small
113 |
114 |
115 | Medium
116 |
117 |
118 | Large
119 |
120 |
121 | X Large
122 |
123 |
124 | XX Large
125 |
126 |
127 |
128 |
129 | ---
130 |
131 | ## Component props
132 | ### Width
133 |
134 |
--------------------------------------------------------------------------------
/src/components/Width/index.js:
--------------------------------------------------------------------------------
1 | import Width from './Width'
2 | export default Width
3 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | export { default as UikAlert, UikAlertClose } from './components/Alert'
2 | export { default as Badge } from './components/Badge'
3 | export { default as Breadcrumb, BreadcrumbItem } from './components/Breadcrumb'
4 | export { default as Button, ButtonGroup } from './components/Button'
5 | export { default as Card, CardHeader, CardBody, CardFooter, CardTitle } from './components/Card'
6 | export { default as Container } from './components/Container'
7 | export { default as Divider } from './components/Divider'
8 | export { default as Drop, DropContainer } from './components/Drop'
9 | export { default as Dropdown, DropdownContainer } from './components/Dropdown'
10 | export { default as Flex } from './components/Flex'
11 | export { default as Form, FormLegend, FormFieldset, FormControls } from './components/Form'
12 | export { default as Grid, GridItem } from './components/Grid'
13 | export { default as Input, InputTextarea, InputRadio, InputCheckbox, InputLabel } from './components/Input'
14 | export { default as Label } from './components/Label'
15 | export { default as Link } from './components/Link'
16 | export { default as List, ListItem } from './components/List'
17 | export { default as Margin } from './components/Margin'
18 | export { default as Nav, NavHeader, NavItem, NavDivider } from './components/Nav'
19 | export { default as Placeholder } from './components/Placeholder'
20 | export { default as Progress } from './components/Progress'
21 | export { default as Select, SelectOption } from './components/Select'
22 | export { default as Spinner } from './components/Spinner'
23 | export { default as Tab, TabItem } from './components/Tab'
24 | export { default as Table, TableCaption, TableBody, TableCell, TableFooter, TableHead, TableRow } from './components/Table'
25 | export { default as Tooltip } from './components/Tooltip'
26 |
--------------------------------------------------------------------------------
/src/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Getting Started
3 | route: /
4 | order: 1
5 | ---
6 |
7 | import { Link } from 'docz'
8 |
9 | # Getting started
10 |
11 | ## Installation
12 | - Install UIkit [here](https://github.com/uikit/uikit#getting-started)
13 | - Install React UIkit using `yarn add react-uikit` or `npm install react-uikit`
14 |
15 | Learn more about using UIkit on [GitHub](https://github.com/uikit/uikit#getting-started).
16 |
17 | ## Available components
18 | * Alert
19 | * Badge
20 | * Breadcrumb
21 | * Button
22 | * Card
23 | * Container
24 | * Divider
25 | * Drop
26 | * Dropdown
27 | * Flex
28 | * Form
29 | * Grid
30 | * Input
31 | * Label
32 | * Link
33 | * List
34 | * Margin
35 | * Nav
36 | * Progress
37 | * Select
38 | * Spinner
39 | * Tab
40 | * Table
41 | * Tooltip
42 | * Width
43 |
--------------------------------------------------------------------------------