Skip to content

Commit d2e02b9

Browse files
committed
feat(Image): update to v1 API
1 parent 5534c7e commit d2e02b9

31 files changed

Lines changed: 704 additions & 25 deletions

config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ config = Object.assign({}, config, {
5252
// ----------------------------------
5353
// Compiler Configuration
5454
// ----------------------------------
55-
compiler_devtool: __DEV__ && 'eval-cheap-module-source-map' || __STAGING__ && 'source-map',
55+
compiler_devtool: __DEV__ && 'eval-cheap-module-source-map'
56+
|| __TEST__ && 'cheap-module-source-map'
57+
|| __STAGING__ && 'source-map',
5658
compiler_hash_type: __PROD__ ? 'chunkhash' : 'hash',
5759
compiler_inline_manifest: false,
5860
compiler_fail_on_warning: __TEST__ || __PROD__,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image.png'
5+
6+
const ImageImageExample = () => (
7+
<div>
8+
<Image.Group size='tiny'>
9+
<Image src={src} />
10+
<Image src={src} />
11+
<Image src={src} />
12+
<Image src={src} />
13+
</Image.Group>
14+
<br />
15+
<Image.Group size='small'>
16+
<Image src={src} />
17+
<Image src={src} />
18+
<Image src={src} />
19+
<Image src={src} />
20+
</Image.Group>
21+
</div>
22+
)
23+
24+
export default ImageImageExample
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react'
2+
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
3+
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
4+
5+
const ImageTypesExamples = () => (
6+
<ExampleSection title='Groups'>
7+
<ComponentExample
8+
title='Size'
9+
description='A group of images can be formatted to have the same size'
10+
examplePath='elements/Image/Groups/ImageGroupSizeExample'
11+
/>
12+
</ExampleSection>
13+
)
14+
15+
export default ImageTypesExamples
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image.png'
5+
6+
const ImageDisabledExample = () => (
7+
<Image src={src} size='small' disabled />
8+
)
9+
10+
export default ImageDisabledExample
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image.png'
5+
6+
const ImageHiddenExample = () => (
7+
<Image src={src} size='small' hidden />
8+
)
9+
10+
export default ImageHiddenExample
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react'
2+
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
3+
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
4+
5+
const ImageStatesExamples = () => (
6+
<ExampleSection title='States'>
7+
<ComponentExample
8+
title='Hidden'
9+
description='An image can be hidden'
10+
examplePath='elements/Image/States/ImageHiddenExample'
11+
/>
12+
<ComponentExample
13+
title='Disabled'
14+
description='An image can show that it is disabled and cannot be selected'
15+
examplePath='elements/Image/States/ImageDisabledExample'
16+
/>
17+
</ExampleSection>
18+
)
19+
20+
export default ImageStatesExamples
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image-text.png'
5+
6+
const ImageHrefExample = () => (
7+
<Image src={src} size='small' href='http://google.com' target='_blank' />
8+
)
9+
10+
export default ImageHrefExample
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image.png'
5+
6+
const ImageImageExample = () => (
7+
<Image src={src} size='small' />
8+
)
9+
10+
export default ImageImageExample
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image-text.png'
5+
6+
class ImageOnClickExample extends Component {
7+
handleClick = () => this.setState({})
8+
9+
render() {
10+
const { didClick } = this.state
11+
12+
return (
13+
<div>
14+
<Image src={src} size='small' onClick={this.handleClick} />
15+
{didClick && (
16+
<p>Captured image click!</p>
17+
)}
18+
</div>
19+
)
20+
}
21+
}
22+
23+
export default ImageOnClickExample
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image } from 'stardust'
3+
4+
const src = 'http://semantic-ui.com/images/wireframe/image.png'
5+
6+
const ImageImageExample = () => (
7+
<Image src={src} size='small' wrapped />
8+
)
9+
10+
export default ImageImageExample

0 commit comments

Comments
 (0)