Skip to content

Commit 9d0e2dd

Browse files
committed
# Conflicts: # docs/app/Views/Theming.js # yarn.lock
2 parents b3d8eda + cc7d9ee commit 9d0e2dd

File tree

36 files changed

+1917
-772
lines changed

36 files changed

+1917
-772
lines changed

.prettierignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.github/
2+
3+
# editor configs
4+
.idea/
5+
.vscode/
6+
7+
8+
coverage/
9+
10+
dist/
11+
dll/
12+
docs/app/docgenInfo.json
13+
docs/app/menuInfo.jso
14+
docs/build/
15+
16+
package.json

.prettierrc.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"printWidth": 120,
4+
"tabWidth": 2,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"overrides": [
9+
{
10+
"files": ".prettierrc",
11+
"options": {
12+
"parser": "json"
13+
}
14+
},
15+
{
16+
"files": "*.{ts,tsx}",
17+
"options": {
18+
"semi": true
19+
}
20+
}
21+
]
22+
}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ See the [Documentation][2] for an introduction, usage information, and extensive
4646

4747
<img align="left" height="50" src="https://github.com/Semantic-Org/Semantic-UI-React/raw/master/docs/app/amazon-logo.png" />
4848
<img align="left" height="50" src="https://github.com/Semantic-Org/Semantic-UI-React/raw/master/docs/app/netflix-logo.png" />
49+
<img align="left" height="50" src="https://github.com/Semantic-Org/Semantic-UI-React/raw/master/docs/app/microsoft-logo.png" />
4950
<a href="https://github.com/Semantic-Org/Semantic-UI-React/edit/master/README.md">
5051
<img height="50" src="https://github.com/Semantic-Org/Semantic-UI-React/raw/master/docs/app/add-yours.png" />
5152
</a>
@@ -54,6 +55,7 @@ These great products are built on Semantic UI React. Add yours [here][22].
5455

5556
- Netflix's Edge Developer Experience team's numerous [internal apps](https://github.com/Semantic-Org/Semantic-UI-React/issues/1604)
5657
- Amazon Publishing — the full-service publisher of Amazon — [APub.com](https://amazonpublishing.amazon.com)
58+
- Microsoft's [Teams](https://products.office.com/en-US/microsoft-teams/group-chat-software) prototyping
5759
- https://gitconnected.com - The community for developers and software engineers
5860
- http://stoplight.io
5961
- https://roadmap.space

docs/app/Components/CarbonAd/CarbonAd.js

+18-44
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,35 @@
1-
import React, { Component } from 'react'
21
import _ from 'lodash'
2+
import React, { Component } from 'react'
33

4-
const transitionTime = 200
4+
const style = { minHeight: 173 }
55

66
class CarbonAd extends Component {
7-
state = {
8-
opacity: 1,
9-
}
10-
117
componentDidMount() {
12-
this.lastPath = location.pathname
8+
this.lastHref = location.href
139

14-
this.refresh()
15-
}
10+
const script = document.createElement('script')
11+
script.async = true
12+
script.id = '_carbonads_js'
13+
script.type = 'text/javascript'
14+
script.src = '//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=reactsemanticuicom'
1615

17-
componentDidUpdate() {
18-
if (location.pathname !== this.lastPath) {
19-
this.lastPath = location.pathname
20-
this.refresh()
21-
}
16+
this.ifRef(ref => ref.appendChild(script))
2217
}
2318

24-
refresh = () => {
25-
this.setState({ opacity: 0 })
26-
27-
setTimeout(() => {
19+
componentWillUpdate() {
20+
if (location.href !== this.lastHref) {
21+
this.lastHref = location.href
2822
_.invoke(window._carbonads, 'refresh')
23+
}
24+
}
2925

30-
setTimeout(() => {
31-
this.setState({ opacity: 1 })
32-
}, transitionTime)
33-
}, transitionTime)
26+
ifRef = (cb) => {
27+
const ref = document.querySelector('#docs-carbonads')
28+
if (ref) cb(ref)
3429
}
3530

3631
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-
)
32+
return <div id='docs-carbonads' style={style} />
5933
}
6034
}
6135

docs/app/Components/ComponentDoc/ComponentExample/ComponentExample.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class ComponentExample extends Component {
200200
// which can be rendered in this ComponentExample's render() method
201201

202202
// rewrite imports to const statements against the UPPERCASE module names
203-
const imports = _.get(/(^import[\s\S]*from[\s\S]*['"]\n)/.exec(sourceCode), '[1]', '')
203+
const imports = _.get(/(^[\s\S])*import[\s\S]*from[\s\S]*['"]\n/.exec(sourceCode), '[0]', '')
204204
.replace(/[\s\n]+/g, ' ') // normalize spaces and make one line
205205
.replace(/ import/g, '\nimport') // one import per line
206206
.split('\n') // split lines

docs/app/Components/Sidebar/Sidebar.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ class Sidebar extends Component {
189189
<small><em>{pkg.version}</em></small>
190190
</strong>
191191
</Menu.Item>
192-
<Menu.Item>
193-
<CarbonAd />
194-
</Menu.Item>
195192
<Menu.Item>
196193
<Menu.Header>Getting Started</Menu.Header>
197194
<Menu.Menu>
@@ -216,10 +213,13 @@ class Sidebar extends Component {
216213
</Menu.Menu>
217214
</Menu.Item>
218215
<Menu.Item>
216+
<CarbonAd />
217+
</Menu.Item>
218+
<Menu.Item active>
219219
<Input
220220
className='transparent inverted icon'
221221
icon='search'
222-
placeholder='Start typing...'
222+
placeholder='Search components...'
223223
value={query}
224224
onChange={this.handleSearchChange}
225225
onKeyDown={this.handleSearchKeyDown}

docs/app/Examples/collections/Table/Types/TableExampleStriped.js renamed to docs/app/Examples/collections/Table/Types/TableExampleCelledStriped.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Icon, Table } from 'semantic-ui-react'
33

4-
const TableExampleStriped = () => (
4+
const TableExampleCelledStriped = () => (
55
<Table celled striped>
66
<Table.Header>
77
<Table.Row>
@@ -15,7 +15,9 @@ const TableExampleStriped = () => (
1515
<Icon name='folder' /> node_modules
1616
</Table.Cell>
1717
<Table.Cell>Initial commit</Table.Cell>
18-
<Table.Cell collapsing textAlign='right'>10 hours ago</Table.Cell>
18+
<Table.Cell collapsing textAlign='right'>
19+
10 hours ago
20+
</Table.Cell>
1921
</Table.Row>
2022
<Table.Row>
2123
<Table.Cell>
@@ -49,4 +51,4 @@ const TableExampleStriped = () => (
4951
</Table>
5052
)
5153

52-
export default TableExampleStriped
54+
export default TableExampleCelledStriped

docs/app/Examples/collections/Table/Types/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Types = () => (
1212
/>
1313
<ComponentExample examplePath='collections/Table/Types/TableExamplePadded' />
1414
<ComponentExample examplePath='collections/Table/Types/TableExampleCollapsing' />
15-
<ComponentExample examplePath='collections/Table/Types/TableExampleStriped' />
15+
<ComponentExample examplePath='collections/Table/Types/TableExampleCelledStriped' />
1616

1717
<ComponentExample
1818
title='Definition'

docs/app/Examples/elements/List/ContentVariations/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const ListContentVariations = () => (
1313

1414
<ComponentExample
1515
title='Floated'
16-
description='An list, or an element inside a list can be floated left or right'
16+
description='A list, or an element inside a list can be floated left or right'
1717
examplePath='elements/List/ContentVariations/ListExampleFloated'
1818
/>
1919
<ComponentExample examplePath='elements/List/ContentVariations/ListExampleFloatedHorizontal' />

docs/app/Examples/elements/List/Variations/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
55
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
66

77
const ListVariations = () => (
8-
<ExampleSection title='Types'>
8+
<ExampleSection title='Variations'>
99
<ComponentExample
1010
title='Horizontal'
1111
description='A list can be formatted to have items appear horizontally'

docs/app/Layouts/GridLayout.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const GridLayout = () => (
8282
<Header as='h3'>Text Container</Header>
8383
<p>
8484
Sometimes you just need to put a single column of centered text on a page. A <code>text container</code> is
85-
a special type of container optimized for a single flowing column of text, like this instructions on this page.
85+
a special type of container optimized for a single flowing column of text, like these instructions on this page.
8686
</p>
8787
<p>Text containers <b>do not need to use grids</b> and help simplify basic page layouts.</p>
8888

@@ -204,7 +204,7 @@ const GridLayout = () => (
204204

205205
<Divider horizontal section>Vertically Divided Grid</Divider>
206206

207-
<Grid divided='verticallly'>
207+
<Grid divided='vertically'>
208208
<Grid.Row>
209209
<Grid.Column width={4} />
210210
<Grid.Column width={4} />

docs/app/Views/Theming.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ const LayoutsExample = () => (
2525
content='Learn more about theming'
2626
labelPosition='right'
2727
href='https://semantic-ui.com/usage/theming.html'
28-
icon='external alternate'
28+
icon='external'
2929
target='_blank'
3030
/>
3131
<Button
3232
content='Creating themes'
3333
labelPosition='right'
3434
href='http://learnsemantic.com/themes/creating.html'
35-
icon='external alternate'
35+
icon='external'
3636
target='_blank'
3737
/>
3838

docs/app/Views/Usage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Usage = () => (
7474
<Header as='h3'>Content Delivery Network (CDN)</Header>
7575
<p>
7676
You can use the default Semantic UI stylesheet by including a Semantic UI CDN link in your
77-
<em>index.html</em> file.
77+
<em> index.html</em> file.
7878
</p>
7979
<p>
8080
This is the quickest way to get started with Semantic UI React. You won't be able to use

docs/app/amazon-logo.png

-20 KB
Loading

docs/app/index.ejs

-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
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>
3326
</head>
3427
<body class="dimmed dimmable">
3528
<div id="docs-loading-dimmer" class="ui active page dimmer">

docs/app/microsoft-logo.png

6.77 KB
Loading

package.json

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "semantic-ui-react",
3-
"version": "0.79.0",
3+
"version": "0.79.1",
44
"description": "The official Semantic-UI-React integration.",
55
"jsnext:main": "dist/es/index.js",
66
"main": "dist/commonjs/index.js",
@@ -24,12 +24,13 @@
2424
"build:docs-toc": "doctoc ./.github/CONTRIBUTING.md --github --maxlevel 4",
2525
"build:docs-cname": "echo react.semantic-ui.com > docs/build/CNAME",
2626
"build:changelog": "github_changelog_generator --no-issues --no-unreleased --release-branch master --since-tag $(git describe --abbrev=0 --tags $(git rev-parse HEAD~400))",
27-
"deploy:changelog": "git add CHANGELOG.md && git commit -m 'docs(changelog): update changelog [ci skip]' && git push",
2827
"predeploy:docs": "cross-env NODE_ENV=production yarn build:docs && yarn build:docs-cname",
2928
"deploy:docs": "gh-pages -d docs/build -m 'deploy docs [ci skip]'",
30-
"postdeploy:docs": "yarn build:changelog && yarn deploy:changelog",
3129
"lint": "cross-env NODE_ENV=production eslint .",
3230
"lint:fix": "yarn lint --fix",
31+
"prettier": "prettier --list-different \"**/*.{js,jsx,ts,tsx}\"",
32+
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
33+
"precommit": "lint-staged",
3334
"prerelease": "yarn lint && yarn tsd:lint && yarn tsd:test && yarn test && cross-env NODE_ENV=production yarn build",
3435
"postrelease": "yarn deploy:docs",
3536
"release:major": "yarn prerelease && ta-script npm/release major && yarn postrelease",
@@ -46,6 +47,18 @@
4647
"tsd:lint:fix": "yarn tsd:lint --fix",
4748
"tsd:test": "yarn tsd && tsc -p ./ && rm test/typings.js"
4849
},
50+
"lint-staged": {
51+
"**/*.{js,jsx}": [
52+
"prettier --write",
53+
"eslint --fix",
54+
"git add"
55+
],
56+
"**/*.{ts,tsx}": [
57+
"prettier --write",
58+
"tslint --fix",
59+
"git add"
60+
]
61+
},
4962
"repository": {
5063
"type": "git",
5164
"url": "git+ssh://github.com/Semantic-Org/Semantic-UI-React.git"
@@ -108,6 +121,7 @@
108121
"gulp-rename": "^1.2.2",
109122
"gulp-util": "^3.0.8",
110123
"html-webpack-plugin": "^2.30.1",
124+
"husky": "^0.14.3",
111125
"imports-loader": "^0.7.1",
112126
"js-beautify": "^1.6.14",
113127
"json-loader": "^0.5.7",
@@ -119,8 +133,10 @@
119133
"karma-mocha-reporter": "^2.2.3",
120134
"karma-webpack-with-fast-source-maps": "^1.10.2",
121135
"leven": "^2.1.0",
136+
"lint-staged": "^7.0.2",
122137
"mocha": "^3.5.0",
123138
"node-sass": "^4.5.3",
139+
"prettier": "1.12.0",
124140
"puppeteer": "^0.10.1",
125141
"raw-loader": "^0.5.1",
126142
"react": "^16.0.0",

src/addons/Responsive/Responsive.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export interface ResponsiveProps {
1212
/** Fires callbacks immediately after mount. */
1313
fireOnMount?: boolean;
1414

15+
/**
16+
* Called to get width of screen. Defaults to using `window.innerWidth` when in a browser;
17+
* otherwise, assumes a width of 0.
18+
*/
19+
getWidth?: () => number;
20+
1521
/** The maximum width at which content will be displayed. */
1622
maxWidth?: number | string;
1723

0 commit comments

Comments
 (0)