Skip to content
This repository was archived by the owner on Jun 9, 2024. It is now read-only.

Commit f8bbfd1

Browse files
committed
feat(init): initialize Navbar, Callout and Button Group components
0 parents  commit f8bbfd1

33 files changed

+8421
-0
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
"react",
4+
"es2015",
5+
"stage-2"
6+
]
7+
}

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/node_modules
2+
/build
3+
/.idea
4+
*.log
5+

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": true,
9+
"jsxBracketSameLine": false,
10+
"parser": "babylon"
11+
}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Install Dependencies
2+
```
3+
yarn
4+
```
5+
6+
### Run Docs
7+
```
8+
yarn docs
9+
```
10+
11+
Visit [http://localhost:6060/](http://localhost:6060/)

__tests__/ButtonGroup.test.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react';
2+
import { renderToStaticMarkup } from 'react-dom/server';
3+
import { ButtonGroup } from '../src/index';
4+
import { Button } from '@blueprintjs/core';
5+
6+
describe('<ButtonGroup />', () => {
7+
it('renders basic <ButtonGroup />', () => {
8+
expect(renderToStaticMarkup(<ButtonGroup />)).toEqual(
9+
'<div class="pt-button-group"></div>'
10+
);
11+
});
12+
13+
it('renders basic <ButtonGroup /> with children', () => {
14+
expect(
15+
renderToStaticMarkup(
16+
<ButtonGroup>
17+
<Button text="home" />
18+
</ButtonGroup>
19+
)
20+
).toEqual(
21+
'<div class="pt-button-group"><button type="button" class="pt-button"><span>home</span></button></div>'
22+
);
23+
});
24+
25+
it('renders basic <ButtonGroup /> with props', () => {
26+
expect(renderToStaticMarkup(<ButtonGroup large />)).toEqual(
27+
'<div class="pt-button-group pt-large"></div>'
28+
);
29+
30+
expect(renderToStaticMarkup(<ButtonGroup minimal />)).toEqual(
31+
'<div class="pt-button-group pt-minimal"></div>'
32+
);
33+
34+
expect(renderToStaticMarkup(<ButtonGroup fill />)).toEqual(
35+
'<div class="pt-button-group pt-fill"></div>'
36+
);
37+
38+
expect(renderToStaticMarkup(<ButtonGroup vertical />)).toEqual(
39+
'<div class="pt-button-group pt-vertical"></div>'
40+
);
41+
42+
expect(renderToStaticMarkup(<ButtonGroup align="left" />)).toEqual(
43+
'<div class="pt-button-group pt-align-left"></div>'
44+
);
45+
});
46+
47+
});

__tests__/Callout.test.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import React from 'react';
2+
import { renderToStaticMarkup } from 'react-dom/server';
3+
import { Callout } from '../src/index';
4+
import { Intent, Classes } from '@blueprintjs/core';
5+
6+
describe('<Callout />', () => {
7+
it('renders basic <Callout />', () => {
8+
expect(renderToStaticMarkup(<Callout />)).toEqual(
9+
'<div class="pt-callout"></div>'
10+
);
11+
});
12+
13+
it('renders basic <Callout /> with props and children', () => {
14+
expect(
15+
renderToStaticMarkup(
16+
<Callout intent={Intent.PRIMARY} iconName="info-sign">
17+
<h5>Callout Heading</h5>
18+
Callout Content
19+
</Callout>
20+
)
21+
).toEqual(
22+
'<div class="pt-callout pt-intent-primary pt-icon-info-sign"><h5>Callout Heading</h5>Callout Content</div>'
23+
);
24+
});
25+
26+
it('renders basic <Callout /> with `intent` prop', () => {
27+
expect(renderToStaticMarkup(<Callout intent={0} />)).toEqual(
28+
'<div class="pt-callout pt-intent-primary"></div>'
29+
);
30+
31+
expect(renderToStaticMarkup(<Callout intent={1} />)).toEqual(
32+
'<div class="pt-callout pt-intent-success"></div>'
33+
);
34+
35+
expect(renderToStaticMarkup(<Callout intent={2} />)).toEqual(
36+
'<div class="pt-callout pt-intent-warning"></div>'
37+
);
38+
39+
expect(renderToStaticMarkup(<Callout intent={3} />)).toEqual(
40+
'<div class="pt-callout pt-intent-danger"></div>'
41+
);
42+
});
43+
44+
});

__tests__/Navbar.test.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React from 'react';
2+
import { renderToStaticMarkup } from 'react-dom/server';
3+
import {
4+
Navbar,
5+
NavbarDivider,
6+
NavbarGroup,
7+
NavbarHeading,
8+
} from '../src/index';
9+
10+
describe('<Navbar />', () => {
11+
it('renders basic <Navbar />', () => {
12+
expect(renderToStaticMarkup(<Navbar />)).toEqual(
13+
'<nav class="pt-navbar"></nav>'
14+
);
15+
});
16+
17+
it('renders basic <Navbar /> with props and children', () => {
18+
expect(
19+
renderToStaticMarkup(
20+
<Navbar fixed dark>
21+
<NavbarGroup>
22+
<NavbarDivider />
23+
</NavbarGroup>
24+
</Navbar>
25+
)
26+
).toEqual(
27+
'<nav class="pt-navbar pt-dark pt-fixed-top"><div class="pt-navbar-group pt-align-left"><span class="pt-navbar-divider"></span></div></nav>'
28+
);
29+
});
30+
31+
it('renders basic <NavbarDivider />', () => {
32+
expect(renderToStaticMarkup(<NavbarDivider />)).toEqual(
33+
'<span class="pt-navbar-divider"></span>'
34+
);
35+
});
36+
37+
it('renders basic <NavbarGroup />', () => {
38+
expect(renderToStaticMarkup(<NavbarGroup />)).toEqual(
39+
'<div class="pt-navbar-group pt-align-left"></div>'
40+
);
41+
});
42+
43+
it('renders basic <NavbarGroup /> with props and children', () => {
44+
expect(
45+
renderToStaticMarkup(
46+
<NavbarGroup align="right">
47+
<NavbarDivider />
48+
</NavbarGroup>
49+
)
50+
).toEqual(
51+
'<div class="pt-navbar-group pt-align-right"><span class="pt-navbar-divider"></span></div>'
52+
);
53+
});
54+
55+
it('renders basic <NavbarHeading />', () => {
56+
expect(renderToStaticMarkup(<NavbarHeading />)).toEqual(
57+
'<div class="pt-navbar-heading"></div>'
58+
);
59+
});
60+
61+
it('renders basic <NavbarHeading /> with children', () => {
62+
expect(
63+
renderToStaticMarkup(<NavbarHeading>Blueprint Components</NavbarHeading>)
64+
).toEqual('<div class="pt-navbar-heading">Blueprint Components</div>');
65+
});
66+
});

docs/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Blueprint Components
2+
3+
> The missing components for [Blueprint](http://blueprintjs.com/).
4+
>
5+
> **Note:** *[Blueprint](http://blueprintjs.com/) is a React-based UI toolkit for the web.*
6+
7+
## Getting Started
8+
9+
### Installation
10+
11+
```shell
12+
$ yarn add blueprint-components
13+
```

package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "bluprint-components",
3+
"version": "0.0.1",
4+
"main": "src/index.js",
5+
"description": "The missing components for Blueprint",
6+
"repository": "git@github.com:Landish/bluprint-components.git",
7+
"author": "Lado Lomidze <lado.lomidze@gmail.com> (https://ladolomidze.com/)",
8+
"license": "MIT",
9+
"config": {
10+
"commitizen": {
11+
"path": "cz-conventional-changelog"
12+
}
13+
},
14+
"lint-staged": {
15+
"{src,styleguide,__tests__}/**/*.{js,jsx,json}": [
16+
"prettier --write",
17+
"git add"
18+
]
19+
},
20+
"scripts": {
21+
"cz": "git-cz",
22+
"precommit": "lint-staged",
23+
"format": "prettier --write {src,styleguide,__tests__}/**/*.{js,jsx,json}",
24+
"test": "jest",
25+
"test:watch": "jest --watch",
26+
"docs": "styleguidist server",
27+
"docs:build": "styleguidist build"
28+
},
29+
"dependencies": {
30+
"@blueprintjs/core": "^1.28.0",
31+
"classnames": "^2.2.5",
32+
"prop-types": "^15.5.10",
33+
"react": "^15.6.1",
34+
"react-addons-css-transition-group": "^15.6.0",
35+
"react-dom": "^15.6.1"
36+
},
37+
"devDependencies": {
38+
"babel-preset-es2015": "^6.24.1",
39+
"babel-preset-react": "^6.24.1",
40+
"babel-preset-stage-2": "^6.24.1",
41+
"commitizen": "^2.9.6",
42+
"cz-conventional-changelog": "^2.0.0",
43+
"jest": "20",
44+
"lint-staged": "^4.2.1",
45+
"loaders": "^1.1.3",
46+
"prettier": "^1.7.0",
47+
"react-styleguidist": "^6.0.24",
48+
"webpack": "^3.6.0"
49+
}
50+
}

0 commit comments

Comments
 (0)