Skip to content

Commit b3f275a

Browse files
author
Alexander Fedyashov
committed
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-React into refactor/modal-shorthand
2 parents a5195f5 + 46e1bfe commit b3f275a

File tree

135 files changed

+2413
-405
lines changed

Some content is hidden

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

135 files changed

+2413
-405
lines changed

CHANGELOG.md

+130-46
Large diffs are not rendered by default.

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!-- Logo -->
22
<p align="center">
3-
<a href="http://react.semantic-ui.com">
3+
<a href="https://react.semantic-ui.com">
44
<img height="128" width="128" src="https://github.com/Semantic-Org/Semantic-UI-React/raw/master/docs/app/logo.png">
55
</a>
66
</p>
77

88
<!-- Name -->
99
<h1 align="center">
10-
<a href="http://react.semantic-ui.com/">Semantic UI React</a>
10+
<a href="https://react.semantic-ui.com/">Semantic UI React</a>
1111
</h1>
1212

1313
<!-- Badges -->
@@ -44,6 +44,9 @@ See the [Documentation][2] for an introduction, usage information, and extensive
4444

4545
This is a listing of example projects and guides that will help you integrate Semantic UI React into your new or existing projects.
4646

47+
### [react-semantic.ui-starter][102]
48+
Production-ready, performance-first, optimized, robust, fully-featured boilerplate/example for your new Progressive Web App.
49+
4750
### [semantic-ui-react-todos][100]
4851
This example modifies the well-known [react-redux Todo List][101] to use Semantic UI components. There is also a write-up on the process in the project README.
4952

@@ -68,12 +71,14 @@ Here are some helpful links:
6871

6972
These great products are built on Semantic UI React. Add yours [here][22].
7073

74+
- Netflix's Edge Developer Experience team's numerous [internal apps](https://github.com/Semantic-Org/Semantic-UI-React/issues/1604)
7175
- http://stoplight.io
7276
- https://roadmap.space
7377
- https://edabit.com
7478
- https://blackship.com
7579
- http://www.brewhousesolutions.com
7680
- https://www.lifebot.fr
81+
- https://www.stackforge.co
7782

7883
## Voice Your Opinion
7984

@@ -113,7 +118,7 @@ Once you change the flag, you need to refresh your browser to see the changes in
113118
|-----------------|-----------------|-----------------|-----------------|--------------------|
114119
| ✓ Button | ✓ Breadcrumb | ✓ Advertisement | ✓ Accordion | Form Validation |
115120
| ✓ Container | ✓ Form | ✓ Card | ✓ Checkbox | *API (NA)* |
116-
| ✓ Divider | ✓ Grid | ✓ Comment | ✓ Dimmer | *Visibility (NA)* |
121+
| ✓ Divider | ✓ Grid | ✓ Comment | ✓ Dimmer | Visibility (NA) |
117122
| ✓ Flag | ✓ Menu | ✓ Feed | ✓ Dropdown | |
118123
| ✓ Header | ✓ Message | ✓ Item | ✓ Embed | |
119124
| ✓ Icon | ✓ Table | ✓ Statistic | ✓ Modal | |
@@ -176,7 +181,7 @@ Big thanks to our [contributors][20], especially:
176181
- @layershifter for bringing momentum and continual support
177182

178183
[1]: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/.github/CONTRIBUTING.md
179-
[2]: http://react.semantic-ui.com/
184+
[2]: https://react.semantic-ui.com/
180185
[3]: https://facebook.github.io/react/
181186
[4]: https://github.com/Semantic-Org/Semantic-UI-React/labels/help%20wanted
182187
[5]: https://semantic-ui.com/
@@ -197,10 +202,11 @@ Big thanks to our [contributors][20], especially:
197202
[20]: https://github.com/Semantic-Org/Semantic-UI-React/graphs/contributors
198203
[21]: https://github.com/Semantic-Org/Semantic-UI-React/labels/good%20first%20contribution
199204
[22]: https://github.com/Semantic-Org/Semantic-UI-React/edit/master/README.md
200-
[23]: http://react.semantic-ui.com/usage#css
205+
[23]: https://react.semantic-ui.com/usage#css
201206
[24]: https://github.com/Semantic-Org/Semantic-UI-React/issues/802#issuecomment-258990274
202207
[25]: http://learnsemantic.com/themes/creating.html
203208
[26]: https://github.com/Semantic-Org/Semantic-UI-Meteor
204209
<!-- Examples -->
205210
[100]: https://github.com/wyc/semantic-ui-react-todos
206211
[101]: https://github.com/reactjs/redux/tree/master/examples/todos
212+
[102]: https://github.com/Metnew/react-semantic.ui-starter

circle.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ test:
1111
pre:
1212
- npm run lint
1313
- npm run tsd:lint
14+
- npm run tsd:test
1415
post:
1516
- bash <(curl -s https://codecov.io/bash)

docs/app/404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<!-- Hack to redirect SPA routes back to the index.html -->
5-
<meta http-equiv="refresh" content="0;URL='http://react.semantic-ui.com'" />
5+
<meta http-equiv="refresh" content="0;URL='https://react.semantic-ui.com'" />
66
<script>sessionStorage.redirect = location.href</script>
77
</head>
88
<body></body>

docs/app/Components/ComponentDoc/ComponentExample.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ComponentExample extends Component {
103103
e.preventDefault()
104104
this.setHashAndScroll()
105105

106-
copyToClipboard(this.anchorName)
106+
copyToClipboard(location.href)
107107
this.setState({ copiedDirectLink: true })
108108

109109
setTimeout(() => this.setState({ copiedDirectLink: false }), 1000)
@@ -138,7 +138,7 @@ class ComponentExample extends Component {
138138
resetJSX = () => {
139139
const { sourceCode } = this.state
140140
const original = this.getOriginalSourceCode()
141-
if (sourceCode !== original && confirm('Loose your changes?')) { // eslint-disable-line no-alert
141+
if (sourceCode !== original && confirm('Lose your changes?')) { // eslint-disable-line no-alert
142142
this.setState({ sourceCode: original })
143143
this.renderSourceCode()
144144
}

docs/app/Components/ComponentDoc/ComponentProps.js

+11-35
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
33
import React, { Component } from 'react'
44

55
import { Header, Icon, Popup, Table } from 'src'
6-
import { SUI } from 'src/lib'
76

87
const extraDescriptionStyle = {
98
color: '#666',
@@ -113,43 +112,22 @@ export default class ComponentProps extends Component {
113112
)
114113
}
115114

116-
expandEnums = (value) => {
117-
const parts = value.split('.')
118-
if (parts[0] === 'SUI') {
119-
return SUI[parts[1]]
120-
}
121-
return value
122-
}
123-
124-
renderEnums = (item) => {
125-
if (item.type !== '{enum}') return
115+
renderEnums = ({ name, type, value }) => {
116+
if (type !== '{enum}' || !value) return
126117

127118
const { showEnumsFor } = this.state
128119
const truncateAt = 10
129-
130-
if (!item.value) return null
131-
132-
const values = [].concat(item.value).reduce((accumulator, v) => {
133-
return accumulator.concat(this.expandEnums(_.trim(v.value || v, '.\'')))
134-
}, [])
135-
136-
const valueElements = _.map(values, val => <span key={val}><code>{val}</code> </span>)
120+
const valueElements = _.map(value, val => <span key={val}><code>{val}</code> </span>)
137121

138122
// show all if there are few
139-
if (values.length < truncateAt) {
140-
return (
141-
<Extra title='Enums:' inline>
142-
{valueElements}
143-
</Extra>
144-
)
145-
}
123+
if (value.length < truncateAt) return <Extra title='Enums:' inline>{valueElements}</Extra>
146124

147125
// add button to show more when there are many values and it is not toggled
148-
if (!showEnumsFor[item.name]) {
126+
if (!showEnumsFor[name]) {
149127
return (
150128
<Extra title='Enums:' inline>
151-
<a style={{ cursor: 'pointer' }} onClick={this.toggleEnumsFor(item.name)}>
152-
Show all {values.length}
129+
<a style={{ cursor: 'pointer' }} onClick={this.toggleEnumsFor(name)}>
130+
Show all {value.length}
153131
</a>
154132
<div>{valueElements.slice(0, truncateAt - 1)}...</div>
155133
</Extra>
@@ -159,9 +137,7 @@ export default class ComponentProps extends Component {
159137
// add "show more" button when there are many
160138
return (
161139
<Extra title='Enums:' inline>
162-
<a style={{ cursor: 'pointer' }} onClick={this.toggleEnumsFor(item.name)}>
163-
Show less
164-
</a>
140+
<a style={{ cursor: 'pointer' }} onClick={this.toggleEnumsFor(name)}>Show less</a>
165141
<div>{valueElements}</div>
166142
</Extra>
167143
)
@@ -170,9 +146,9 @@ export default class ComponentProps extends Component {
170146
renderRow = item => {
171147
return (
172148
<Table.Row key={item.name}>
173-
<Table.Cell>{this.renderName(item)}{this.renderRequired(item)}</Table.Cell>
174-
<Table.Cell>{this.renderDefaultValue(item)}</Table.Cell>
175-
<Table.Cell>{item.type}</Table.Cell>
149+
<Table.Cell collapsing>{this.renderName(item)}{this.renderRequired(item)}</Table.Cell>
150+
<Table.Cell collapsing>{this.renderDefaultValue(item)}</Table.Cell>
151+
<Table.Cell collapsing>{item.type}</Table.Cell>
176152
<Table.Cell>
177153
{item.description && <p>{item.description}</p>}
178154
{this.renderFunctionSignature(item)}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React, { Component } from 'react'
2+
import { Button, Checkbox, Divider, Grid, Segment, Visibility } from 'semantic-ui-react'
3+
import Wireframe from '../Wireframe'
4+
5+
export default class VisibilityExample extends Component {
6+
state = {
7+
continuous: false,
8+
log: [],
9+
once: true,
10+
}
11+
12+
updateLog = eventName => () => this.setState({ log: [eventName, ...this.state.log] })
13+
14+
clearLog = () => this.setState({ log: [] })
15+
16+
toggleOnce = () => this.setState({ once: !this.state.once })
17+
18+
toggleContinuous = () => this.setState({ continuous: !this.state.continuous })
19+
20+
render() {
21+
const { continuous, log, once } = this.state
22+
23+
return (
24+
<Grid columns={2}>
25+
<Grid.Column>
26+
<Visibility
27+
continuous={continuous}
28+
once={once}
29+
onTopVisible={this.updateLog('onTopVisible')}
30+
onTopPassed={this.updateLog('onTopPassed')}
31+
onBottomVisible={this.updateLog('onBottomVisible')}
32+
onBottomPassed={this.updateLog('onBottomPassed')}
33+
onTopVisibleReverse={this.updateLog('onTopVisibleReverse')}
34+
onTopPassedReverse={this.updateLog('onTopPassedReverse')}
35+
onBottomVisibleReverse={this.updateLog('onBottomVisibleReverse')}
36+
onBottomPassedReverse={this.updateLog('onBottomPassedReverse')}
37+
onPassing={this.updateLog('onPassing')}
38+
onPassingReverse={this.updateLog('onPassingReverse')}
39+
onOnScreen={this.updateLog('onOnScreen')}
40+
onOffScreen={this.updateLog('onOffScreen')}
41+
>
42+
<Wireframe />
43+
</Visibility>
44+
</Grid.Column>
45+
46+
<Grid.Column>
47+
<Segment.Group>
48+
<Segment>
49+
<Button floated='right' onClick={this.clearLog}>Clear</Button>
50+
<Checkbox checked={once} label='Once' onChange={this.toggleOnce} toggle />
51+
<Divider />
52+
<Checkbox checked={continuous} label='Continuous' onChange={this.toggleContinuous} toggle />
53+
</Segment>
54+
<Segment>Event Log</Segment>
55+
<Segment>
56+
<pre style={{ height: 300, overflowY: 'scroll' }}>
57+
{log.map((e, i) => <p key={i}>{e} fired</p>)}
58+
</pre>
59+
</Segment>
60+
</Segment.Group>
61+
</Grid.Column>
62+
</Grid>
63+
)
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import React, { Component } from 'react'
2+
import { Button, Checkbox, Divider, Grid, Segment, Visibility } from 'semantic-ui-react'
3+
import Wireframe from '../Wireframe'
4+
5+
class VisibilityExample extends Component {
6+
state = {
7+
continuous: false,
8+
log: [],
9+
once: true,
10+
}
11+
12+
updateLog = eventName => () => this.setState({ log: [eventName, ...this.state.log] })
13+
14+
clearLog = () => this.setState({ log: [] })
15+
16+
toggleOnce = () => this.setState({ once: !this.state.once })
17+
18+
toggleContinuous = () => this.setState({ continuous: !this.state.continuous })
19+
20+
render() {
21+
const { continuous, log, once } = this.state
22+
23+
return (
24+
<Grid columns={2}>
25+
<Grid.Column>
26+
<Visibility
27+
continuous={continuous}
28+
once={once}
29+
onPassed={{
30+
10: this.updateLog('10px'),
31+
100: this.updateLog('100px'),
32+
500: this.updateLog('500px'),
33+
'10%': this.updateLog('10%'),
34+
'25%': this.updateLog('25%'),
35+
'80%': this.updateLog('80%'),
36+
}}
37+
>
38+
<Wireframe />
39+
</Visibility>
40+
</Grid.Column>
41+
42+
<Grid.Column>
43+
<Segment.Group>
44+
<Segment>
45+
<Button floated='right' onClick={this.clearLog}>Clear</Button>
46+
<Checkbox checked={once} label='Once' onChange={this.toggleOnce} toggle />
47+
<Divider />
48+
<Checkbox checked={continuous} label='Continuous' onChange={this.toggleContinuous} toggle />
49+
</Segment>
50+
<Segment>Event Log</Segment>
51+
<Segment>
52+
<pre style={{ height: 300, overflowY: 'scroll' }}>
53+
{log.map((e, i) => <p key={i}>{e} fired</p>)}
54+
</pre>
55+
</Segment>
56+
</Segment.Group>
57+
</Grid.Column>
58+
</Grid>
59+
)
60+
}
61+
}
62+
63+
export default VisibilityExample
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
3+
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
4+
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
5+
6+
const VisibilityExample = () => (
7+
<ExampleSection title='Settings'>
8+
<ComponentExample
9+
title='Callback frequency'
10+
description='You can change the callback frequency with `once` and `continuous` settings'
11+
examplePath='behaviors/Visibility/Settings/CallbackFrequencyExample'
12+
/>
13+
<ComponentExample
14+
title='Grouped callbacks'
15+
description='You can specify callbacks that occur after different percentages or pixels of an element are passed'
16+
examplePath='behaviors/Visibility/Settings/GroupedCallbacksExample'
17+
/>
18+
</ExampleSection>
19+
)
20+
21+
export default VisibilityExample

0 commit comments

Comments
 (0)