Skip to content

Commit 653d2a6

Browse files
authored
feat: add form components
* upgrade gatsby * WIP * WIP * format, lint tests * fix docs build
1 parent ed5ffc1 commit 653d2a6

File tree

236 files changed

+3602
-3219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+3602
-3219
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"react/no-string-refs": "off",
4646
"react/prefer-stateless-function": "off",
4747
"react/default-props-match-prop-types": "off",
48+
"import/no-named-as-default-member": "off",
4849
"react/jsx-filename-extension": [
4950
"error",
5051
{

V4-breaking-changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@
7979
### DropdownItem
8080

8181
* renamed from MenuItem to match upstream
82+
83+
84+
## Alert
85+
86+
- `onDismiss` renamed to `onClose`

karma.conf.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = config => {
99
files: ['test/index.js'],
1010

1111
preprocessors: {
12-
'test/index.js': ['webpack', 'sourcemap']
12+
'test/index.js': ['webpack', 'sourcemap'],
1313
},
1414

1515
webpack: {
@@ -23,45 +23,45 @@ module.exports = config => {
2323
loader: 'babel-loader',
2424
options: {
2525
cacheDirectory: true,
26-
envName: 'test'
27-
}
28-
}
29-
}
30-
]
26+
envName: 'test',
27+
},
28+
},
29+
},
30+
],
3131
},
3232
plugins: [
3333
new DefinePlugin({
34-
'process.env.NODE_ENV': JSON.stringify('test')
35-
})
34+
'process.env.NODE_ENV': JSON.stringify('test'),
35+
}),
3636
],
3737
devtool: 'cheap-module-inline-source-map',
38-
stats: 'minimal'
38+
stats: 'minimal',
3939
},
4040

4141
webpackMiddleware: {
42-
noInfo: true
42+
noInfo: true,
4343
},
4444

4545
reporters: ['mocha', 'coverage'],
4646

4747
mochaReporter: {
48-
output: 'autowatch'
48+
output: 'autowatch',
4949
},
5050

5151
coverageReporter: {
5252
type: 'lcov',
53-
dir: 'coverage'
53+
dir: 'coverage',
5454
},
5555

5656
customLaunchers: {
5757
ChromeCi: {
5858
base: 'Chrome',
59-
flags: ['--no-sandbox']
60-
}
59+
flags: ['--no-sandbox'],
60+
},
6161
},
6262

6363
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'],
6464

65-
singleRun: env.CONTINUOUS_INTEGRATION === 'true'
65+
singleRun: env.CONTINUOUS_INTEGRATION === 'true',
6666
});
6767
};

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
]
3636
},
3737
"prettier": {
38-
"singleQuote": true
38+
"singleQuote": true,
39+
"trailingComma": "all"
3940
},
4041
"files": [
4142
"CHANGELOG.md",
@@ -73,6 +74,7 @@
7374
"babel-plugin-add-module-exports": "^0.2.1",
7475
"babel-plugin-dev-expression": "^0.2.1",
7576
"babel-plugin-istanbul": "^4.1.5",
77+
"babel-loader": "^8.0.0-beta.2",
7678
"chai": "^3.5.0",
7779
"chalk": "^2.3.2",
7880
"codecov": "^2.2.0",
@@ -106,17 +108,16 @@
106108
"lodash": "^4.17.10",
107109
"mocha": "^5.2.0",
108110
"prettier": "^1.12.1",
109-
"react": "^16.3.2",
110-
"react-dom": "^16.3.2",
111-
"react-test-renderer": "^16.3.2",
111+
"react": "^16.4.1",
112+
"react-dom": "^16.4.1",
113+
"react-test-renderer": "^16.4.1",
112114
"release-script": "^1.0.2",
113115
"sinon": "^2.3.2",
114116
"sinon-chai": "^2.8.0",
115117
"webpack": "^4.4.1"
116118
},
117119
"dependencies": {
118120
"@babel/runtime": "^7.0.0-beta.42",
119-
"babel-loader": "^8.0.0-beta.2",
120121
"classnames": "^2.2.5",
121122
"dom-helpers": "^3.2.0",
122123
"invariant": "^2.2.3",
@@ -125,10 +126,11 @@
125126
"prop-types": "^15.6.1",
126127
"prop-types-extra": "^1.1.0",
127128
"react-overlays": "^1.0.0-beta.6",
129+
"react-context-toolbox": "^1.1.0",
128130
"react-prop-types": "^0.4.0",
129131
"react-transition-group": "^2.3.1",
130132
"uncontrollable": "^6.0.0",
131-
"warning": "^3.0.0"
133+
"warning": "^4.0.1"
132134
},
133135
"release-script": {
134136
"bowerRepo": "[email protected]:react-bootstrap/react-bootstrap-bower.git",

src/Alert.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class Alert extends React.Component {
5555
closeLabel: PropTypes.string,
5656

5757
/** A `react-transition-group` Transition component used to animate the Alert on dismissal. */
58-
transition: elementType
58+
transition: elementType,
5959
};
6060

6161
static defaultProps = {
6262
show: true,
6363
transition: Fade,
64-
closeLabel: 'Close alert'
64+
closeLabel: 'Close alert',
6565
};
6666

6767
handleClose = e => {
@@ -90,7 +90,7 @@ class Alert extends React.Component {
9090
className,
9191
bsPrefix,
9292
variant && `${bsPrefix}-${variant}`,
93-
dismissible && `${bsPrefix}-dismissible`
93+
dismissible && `${bsPrefix}-dismissible`,
9494
)}
9595
>
9696
{dismissible && (
@@ -113,18 +113,18 @@ class Alert extends React.Component {
113113
const DecoratedAlert = uncontrollable(
114114
createBootstrapComponent(Alert, 'alert'),
115115
{
116-
show: 'onClose'
117-
}
116+
show: 'onClose',
117+
},
118118
);
119119

120120
const DivStyledAsH4 = divWithClassName('h4');
121121

122122
DecoratedAlert.Link = createWithBsPrefix('alert-link', {
123-
Component: SafeAnchor
123+
Component: SafeAnchor,
124124
});
125125

126126
DecoratedAlert.Heading = createWithBsPrefix('alert-heading', {
127-
Component: DivStyledAsH4
127+
Component: DivStyledAsH4,
128128
});
129129

130130
export default DecoratedAlert;

src/Badge.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class Badge extends React.Component {
2020
* Add the `pill` modifier to make badges more rounded with
2121
* some additional horizontal padding
2222
*/
23-
pill: PropTypes.bool.isRequired
23+
pill: PropTypes.bool.isRequired,
2424
};
2525

2626
static defaultProps = {
27-
pill: false
27+
pill: false,
2828
};
2929

3030
render() {
@@ -37,7 +37,7 @@ class Badge extends React.Component {
3737
className,
3838
bsPrefix,
3939
pill && `${bsPrefix}-pill`,
40-
variant && `${bsPrefix}-${variant}`
40+
variant && `${bsPrefix}-${variant}`,
4141
)}
4242
/>
4343
);

src/Breadcrumb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class Breadcrumb extends React.Component {
2222
*/
2323
listProps: PropTypes.object,
2424

25-
as: elementType
25+
as: elementType,
2626
};
2727

2828
static defaultProps = {
2929
label: 'breadcrumb',
3030
listProps: {},
31-
as: 'nav'
31+
as: 'nav',
3232
};
3333

3434
render() {

src/BreadcrumbItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class BreadcrumbItem extends React.Component {
3030
*/
3131
target: PropTypes.string,
3232

33-
as: elementType
33+
as: elementType,
3434
};
3535

3636
static defaultProps = {
3737
active: false,
38-
as: 'li'
38+
as: 'li',
3939
};
4040

4141
render() {

src/Button.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ class Button extends React.Component {
5555
*/
5656
type: PropTypes.oneOf(['button', 'reset', 'submit', null]),
5757

58-
as: elementType
58+
as: elementType,
5959
};
6060

6161
static defaultProps = {
6262
variant: 'primary',
6363
active: false,
6464
disabled: false,
65-
type: 'button'
65+
type: 'button',
6666
};
6767

6868
render() {
@@ -84,7 +84,7 @@ class Button extends React.Component {
8484
active && 'active',
8585
`${bsPrefix}-${variant}`,
8686
block && `${bsPrefix}-block`,
87-
size && `${bsPrefix}-${size}`
87+
size && `${bsPrefix}-${size}`,
8888
);
8989

9090
if (props.href) {

src/ButtonGroup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ class ButtonGroup extends React.Component {
3636
*/
3737
role: PropTypes.string,
3838

39-
as: elementType
39+
as: elementType,
4040
};
4141

4242
static defaultProps = {
4343
vertical: false,
4444
toggle: false,
4545
role: 'group',
46-
as: 'div'
46+
as: 'div',
4747
};
4848

4949
render() {
@@ -67,7 +67,7 @@ class ButtonGroup extends React.Component {
6767
className,
6868
baseClass,
6969
size && `${bsPrefix}-${size}`,
70-
toggle && `${bsPrefix}-toggle`
70+
toggle && `${bsPrefix}-toggle`,
7171
)}
7272
/>
7373
);

src/ButtonToolbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class ButtonToolbar extends React.Component {
1616
* "toolbar" role is correct. An `aria-label` or `aria-labelledby`
1717
* prop is also recommended.
1818
*/
19-
role: PropTypes.string
19+
role: PropTypes.string,
2020
};
2121

2222
static defaultProps = {
23-
role: 'toolbar'
23+
role: 'toolbar',
2424
};
2525

2626
render() {

src/Card.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ class Card extends React.Component {
4545
*/
4646
body: PropTypes.bool,
4747

48-
as: elementType
48+
as: elementType,
4949
};
5050

5151
static defaultProps = {
5252
as: 'div',
53-
body: false
53+
body: false,
5454
};
5555

5656
static getDerivedStateFromProps({ bsPrefix }) {
5757
return {
5858
cardContext: {
59-
cardHeaderBsPrefix: `${bsPrefix}-header`
60-
}
59+
cardHeaderBsPrefix: `${bsPrefix}-header`,
60+
},
6161
};
6262
}
6363

@@ -81,7 +81,7 @@ class Card extends React.Component {
8181
bsPrefix,
8282
bg && `bg-${bg}`,
8383
text && `text-${text}`,
84-
border && `border-${border}`
84+
border && `border-${border}`,
8585
);
8686

8787
return (
@@ -100,18 +100,18 @@ const DivStyledAsH6 = divWithClassName('h6');
100100
const DecoratedCard = createBootstrapComponent(Card, 'card');
101101
DecoratedCard.Img = CardImg;
102102
DecoratedCard.Title = createWithBsPrefix('card-title', {
103-
Component: DivStyledAsH5
103+
Component: DivStyledAsH5,
104104
});
105105
DecoratedCard.Subtitle = createWithBsPrefix('card-subtitle', {
106-
Component: DivStyledAsH6
106+
Component: DivStyledAsH6,
107107
});
108108

109109
DecoratedCard.Body = CardBody;
110110
DecoratedCard.Link = createWithBsPrefix('card-link', {
111-
Component: 'a'
111+
Component: 'a',
112112
});
113113
DecoratedCard.Text = createWithBsPrefix('card-text', {
114-
Component: 'p'
114+
Component: 'p',
115115
});
116116
DecoratedCard.Header = createWithBsPrefix('card-header');
117117
DecoratedCard.Footer = createWithBsPrefix('card-footer');

src/CardImg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class CardImg extends React.Component {
2020
*/
2121
variant: PropTypes.oneOf(['top', 'bottom', null]),
2222

23-
as: elementType
23+
as: elementType,
2424
};
2525

2626
static defaultProps = {
2727
as: 'img',
28-
variant: null
28+
variant: null,
2929
};
3030

3131
render() {

0 commit comments

Comments
 (0)