Skip to content

Commit 709c23a

Browse files
authored
Merge branch 'master' into next
2 parents 935d0ff + 8514a30 commit 709c23a

File tree

16 files changed

+333
-1421
lines changed

16 files changed

+333
-1421
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": [
3-
"./build/preset-es2015",
3+
"./build/preset-env",
44
"react",
55
"stage-1"
66
],

CHANGELOG.md

+76-1,313
Large diffs are not rendered by default.

build/preset-env.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const env = process.env.NODE_ENV
2+
3+
const plugins = env === 'build' || env === 'build-es' ? [
4+
['filter-imports', {
5+
imports: {
6+
debug: ['default'],
7+
'../../lib': ['makeDebugger'],
8+
},
9+
}],
10+
] : []
11+
const browsers = [
12+
'last 8 versions',
13+
'safari > 8',
14+
'firefox > 23',
15+
'chrome > 24',
16+
'opera > 15',
17+
'not ie < 11',
18+
'not ie_mob <= 11',
19+
]
20+
21+
const envOptions = {
22+
targets: { browsers },
23+
}
24+
if (env === 'build-es') envOptions.modules = false
25+
26+
module.exports = {
27+
presets: [['env', envOptions]],
28+
plugins,
29+
}

build/preset-es2015.js

-17
This file was deleted.
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import React, { Component } from 'react'
2+
import _ from 'lodash'
3+
4+
const transitionTime = 200
5+
6+
class CarbonAd extends Component {
7+
state = {
8+
opacity: 1,
9+
}
10+
11+
componentDidMount() {
12+
this.lastPath = location.pathname
13+
14+
this.refresh()
15+
}
16+
17+
componentDidUpdate() {
18+
if (location.pathname !== this.lastPath) {
19+
this.lastPath = location.pathname
20+
this.refresh()
21+
}
22+
}
23+
24+
refresh = () => {
25+
this.setState({ opacity: 0 })
26+
27+
setTimeout(() => {
28+
_.invoke(window._carbonads, 'refresh')
29+
30+
setTimeout(() => {
31+
this.setState({ opacity: 1 })
32+
}, transitionTime)
33+
}, transitionTime)
34+
}
35+
36+
render() {
37+
const { opacity } = this.state
38+
39+
const style = {
40+
transition: `opacity ${transitionTime}ms`,
41+
minHeight: 173,
42+
opacity,
43+
}
44+
45+
return (
46+
<div style={style}>
47+
{/*
48+
Heads up!
49+
This script is loaded in index.html. The script requires the markup here to match in order to work.
50+
*/}
51+
<script
52+
async
53+
id='_carbonads_js'
54+
type='text/javascript'
55+
src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=reactsemanticuicom'
56+
/>
57+
</div>
58+
)
59+
}
60+
}
61+
62+
export default CarbonAd

docs/app/Components/Sidebar/Sidebar.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ import React, { Component } from 'react'
44
import { findDOMNode } from 'react-dom'
55
import { NavLink } from 'react-router-dom'
66
import { withRouter } from 'react-router'
7-
8-
import pkg from 'package.json'
9-
import { typeOrder, parentComponents, repoURL } from 'docs/app/utils'
10-
import { keyboardKey, META } from 'src/lib'
11-
import Logo from 'docs/app/Components/Logo/Logo'
127
import {
138
Menu,
149
Icon,
1510
Input,
16-
} from 'src'
11+
} from 'semantic-ui-react'
12+
13+
import CarbonAd from 'docs/app/Components/CarbonAd/CarbonAd'
14+
import Logo from 'docs/app/Components/Logo/Logo'
15+
import { typeOrder, parentComponents, repoURL } from 'docs/app/utils'
16+
import pkg from 'package.json'
17+
import { keyboardKey, META } from 'src/lib'
1718

1819
const getRoute = _meta => `/${_meta.type}s/${_.kebabCase(_meta.name)}`
1920

@@ -188,6 +189,9 @@ class Sidebar extends Component {
188189
<small><em>{pkg.version}</em></small>
189190
</strong>
190191
</Menu.Item>
192+
<Menu.Item>
193+
<CarbonAd />
194+
</Menu.Item>
191195
<Menu.Item>
192196
<Menu.Header>Getting Started</Menu.Header>
193197
<Menu.Menu>
@@ -203,10 +207,10 @@ class Sidebar extends Component {
203207
<Menu.Item as={NavLink} to='/layouts' activeClassName='active'>
204208
Layouts
205209
</Menu.Item>
206-
<Menu.Item as='a' href={repoURL}>
210+
<Menu.Item as='a' href={repoURL} target='_blank' rel='noopener noreferrer'>
207211
<Icon name='github' /> GitHub
208212
</Menu.Item>
209-
<Menu.Item as='a' href={`${repoURL}/blob/master/CHANGELOG.md`}>
213+
<Menu.Item as='a' href={`${repoURL}/blob/master/CHANGELOG.md`} target='_blank' rel='noopener noreferrer'>
210214
<Icon name='file text outline' /> CHANGELOG
211215
</Menu.Item>
212216
</Menu.Menu>

docs/app/index.ejs

+38-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
}
2424
})()
2525
</script>
26+
<!-- Heads up! -->
27+
<!-- This script is loaded in CarbonAds.js. The script requires the markup here to match in order to work. -->
28+
<script
29+
async
30+
type='text/javascript'
31+
src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=reactsemanticuicom'>
32+
</script>
2633
</head>
2734
<body class="dimmed dimmable">
2835
<div id="docs-loading-dimmer" class="ui active page dimmer">
@@ -162,6 +169,36 @@
162169
.docs-icon-set-column:hover > .icon {
163170
transform: scale(1.5);
164171
}
165-
</style>
172+
173+
/* Carbon Ads */
174+
#carbonads {
175+
display: block;
176+
}
177+
178+
#carbonads span {
179+
display: block;
180+
}
181+
182+
.carbon-img {
183+
display: block;
184+
}
185+
186+
.carbon-img img {
187+
display: block;
188+
}
189+
190+
.carbon-text {
191+
display: block;
192+
margin-top: 1em;
193+
}
194+
195+
.carbon-poweredby {
196+
display: block;
197+
margin-top: 0.5em;
198+
font-size: 0.8em;
199+
color: #ffffff;
200+
opacity: 0.5;
201+
}
202+
</style>
166203
</body>
167204
</html>

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "semantic-ui-react",
3-
"version": "0.78.3",
3+
"version": "0.79.0",
44
"description": "The official Semantic-UI-React integration.",
55
"jsnext:main": "dist/es/index.js",
66
"main": "dist/commonjs/index.js",
@@ -23,7 +23,7 @@
2323
"build:umd": "cross-env NODE_ENV=build gulp umd",
2424
"build:docs-toc": "doctoc ./.github/CONTRIBUTING.md --github --maxlevel 4",
2525
"build:docs-cname": "echo react.semantic-ui.com > docs/build/CNAME",
26-
"build:changelog": "github_changelog_generator --max-issues 1000",
26+
"build:changelog": "github_changelog_generator --no-issues --no-unreleased --release-branch master --since-tag $(git describe --abbrev=0 --tags $(git rev-parse HEAD~400))",
2727
"deploy:changelog": "git add CHANGELOG.md && git commit -m 'docs(changelog): update changelog [ci skip]' && git push",
2828
"predeploy:docs": "cross-env NODE_ENV=production yarn build:docs && yarn build:docs-cname",
2929
"deploy:docs": "gh-pages -d docs/build -m 'deploy docs [ci skip]'",
@@ -72,10 +72,10 @@
7272
"babel-plugin-filter-imports": "^1.0.3",
7373
"babel-plugin-istanbul": "^4.1.4",
7474
"babel-plugin-lodash": "^3.2.11",
75-
"babel-plugin-transform-react-handled-props": "^0.2.5",
75+
"babel-plugin-transform-react-handled-props": "^0.3.1",
7676
"babel-plugin-transform-react-remove-prop-types": "^0.4.8",
7777
"babel-plugin-transform-runtime": "^6.23.0",
78-
"babel-preset-es2015": "^6.24.1",
78+
"babel-preset-env": "^1.6.1",
7979
"babel-preset-react": "^6.24.1",
8080
"babel-preset-stage-1": "^6.24.1",
8181
"babel-register": "^6.24.1",

src/addons/Pagination/Pagination.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface PaginationProps {
77
[key: string]: any;
88

99
/** A pagination item can have an aria label. */
10-
ariaLabel?: string;
10+
'aria-label'?: string;
1111

1212
/** Initial activePage value. */
1313
defaultActivePage?: number | string;

src/addons/Pagination/Pagination.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import PaginationItem from './PaginationItem'
1818
export default class Pagination extends Component {
1919
static propTypes = {
2020
/** A pagination item can have an aria label. */
21-
ariaLabel: PropTypes.string,
21+
'aria-label': PropTypes.string,
2222

2323
/** Initial activePage value. */
2424
defaultActivePage: PropTypes.oneOfType([
@@ -82,24 +82,24 @@ export default class Pagination extends Component {
8282
]
8383

8484
static defaultProps = {
85-
ariaLabel: 'Pagination Navigation',
85+
'aria-label': 'Pagination Navigation',
8686
boundaryRange: 1,
8787
ellipsisItem: '...',
8888
firstItem: {
89-
ariaLabel: 'First item',
89+
'aria-label': 'First item',
9090
content: '«',
9191
},
9292
lastItem: {
93-
ariaLabel: 'Last item',
93+
'aria-label': 'Last item',
9494
content: '»',
9595
},
9696
nextItem: {
97-
ariaLabel: 'Next item',
97+
'aria-label': 'Next item',
9898
content: '⟩',
9999
},
100100
pageItem: {},
101101
prevItem: {
102-
ariaLabel: 'Previous item',
102+
'aria-label': 'Previous item',
103103
content: '⟨',
104104
},
105105
siblingRange: 1,
@@ -133,7 +133,7 @@ export default class Pagination extends Component {
133133
})
134134

135135
render() {
136-
const { ariaLabel, boundaryRange, siblingRange, totalPages } = this.props
136+
const { 'aria-label': ariaLabel, boundaryRange, siblingRange, totalPages } = this.props
137137
const { activePage } = this.state
138138

139139
const items = createPaginationItems({ activePage, boundaryRange, siblingRange, totalPages })

src/addons/Pagination/PaginationItem.d.ts

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export interface PaginationItemProps {
66
/** A pagination item can be active. */
77
active?: boolean;
88

9-
/** A pagination item can have an aria label. */
10-
ariaLabel?: string;
11-
129
/** A pagination item can be disabled. */
1310
disabled?: boolean;
1411

src/addons/Pagination/PaginationItem.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class PaginationItem extends Component {
1717
/** A pagination item can be active. */
1818
active: PropTypes.bool,
1919

20-
/** A pagination item can have an aria label. */
21-
ariaLabel: PropTypes.string,
22-
2320
/** A pagination item can be disabled. */
2421
disabled: PropTypes.bool,
2522

@@ -73,15 +70,14 @@ class PaginationItem extends Component {
7370
})
7471

7572
render() {
76-
const { active, ariaLabel, type } = this.props
73+
const { active, type } = this.props
7774
const disabled = this.props.disabled || type === 'ellipsisItem'
7875

7976
return MenuItem.create(this.props, {
8077
defaultProps: {
8178
active,
8279
disabled,
8380
'aria-current': active,
84-
'aria-label': ariaLabel,
8581
onClick: this.handleClick,
8682
onKeyDown: this.handleKeyDown,
8783
tabIndex: disabled ? -1 : 0,

src/modules/Checkbox/Checkbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export default class Checkbox extends Component {
226226
useKeyOnly(indeterminate, 'indeterminate'),
227227
// auto apply fitted class to compact white space when there is no label
228228
// https://semantic-ui.com/modules/checkbox.html#fitted
229-
useKeyOnly(!label, 'fitted'),
229+
useKeyOnly(_.isNil(label), 'fitted'),
230230
useKeyOnly(radio, 'radio'),
231231
useKeyOnly(readOnly, 'read-only'),
232232
useKeyOnly(slider, 'slider'),

0 commit comments

Comments
 (0)