Skip to content

Commit cae7084

Browse files
author
Josh Habdas
committed
Segment groups
1 parent 8b130fd commit cae7084

11 files changed

Lines changed: 60 additions & 29 deletions

docs/app/Examples/elements/Segment/Groups/SegmentGroupsExamples.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,6 @@ export default class SegmentGroupsExamples extends Component {
1111
description='A group of segments can be formatted to appear together.'
1212
examplePath='elements/Segment/Groups/SegmentSegmentsExample'
1313
/>
14-
<ComponentExample
15-
title='Nested Segments'
16-
description='A group of segments can be nested in another group of segments.'
17-
examplePath='elements/Segment/Groups/SegmentNestedSegmentsExample'
18-
/>
19-
<ComponentExample
20-
title='Horizontal Segments'
21-
description='A segment group can appear horizontally.'
22-
examplePath='elements/Segment/Groups/SegmentHorizontalSegmentsExample'
23-
/>
24-
<ComponentExample
25-
title='Raised Segments'
26-
description='A group of segments can be stacked.'
27-
examplePath='elements/Segment/Groups/SegmentRaisedSegmentsExample'
28-
/>
29-
<ComponentExample
30-
title='Stacked Segments'
31-
description='A vertical segment formats content to be aligned as part of a vertical group.'
32-
examplePath='elements/Segment/Groups/SegmentStackedSegmentsExample'
33-
/>
34-
<ComponentExample
35-
title='Piled Segments'
36-
description='A vertical segment formats content to be aligned as part of a vertical group.'
37-
examplePath='elements/Segment/Groups/SegmentPiledSegmentsExample'
38-
/>
3914
</ExampleSection>
4015
);
4116
}

docs/app/Examples/elements/Segment/Groups/SegmentHorizontalSegmentsExample.js

Whitespace-only changes.

docs/app/Examples/elements/Segment/Groups/SegmentNestedSegmentsExample.js

Whitespace-only changes.

docs/app/Examples/elements/Segment/Groups/SegmentPiledSegmentsExample.js

Whitespace-only changes.

docs/app/Examples/elements/Segment/Groups/SegmentRaisedSegmentsExample.js

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React, {Component} from 'react';
2+
import {Segment} from 'stardust';
3+
4+
// TODO: File card to create a Segments wrapper component with appropriate classNames
5+
export default class SegmentSegmentsExample extends Component {
6+
render() {
7+
return (
8+
<div className='ui segments'>
9+
<Segment>Top</Segment>
10+
<Segment>Middle</Segment>
11+
<Segment>Middle</Segment>
12+
<Segment>Middle</Segment>
13+
<Segment>Bottom</Segment>
14+
</div>
15+
);
16+
}
17+
}

docs/app/Examples/elements/Segment/Groups/SegmentStackedSegmentsExample.js

Whitespace-only changes.

docs/app/Examples/elements/Segment/SegmentExamples.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React, {Component} from 'react';
22
import SegmentTypesExamples from './Types/SegmentTypesExamples';
3+
import SegmentGroupsExamples from './Groups/SegmentGroupsExamples';
34
// import SegmentStatesExamples from './Types/SegmentStatesExamples';
4-
// import SegmentGroupsExamples from './Content/SegmentGroupsExamples';
55
// import SegmentVariationsExamples from './Variations/SegmentVariationsExamples';
66

77
export default class SegmentExamples extends Component {
88
render() {
99
return (
1010
<div>
1111
<SegmentTypesExamples />
12+
<SegmentGroupsExamples />
1213

1314
</div>
1415
);

docs/app/Examples/elements/Segment/Types/SegmentPiledExample.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import {Segment} from 'stardust';
33

44
export default class SegmentPiledExample extends Component {
55
render() {
6-
return (
7-
<Segment className='piled'>Pellentesque habitant morbi tristique senectus.</Segment>
8-
);
6+
return <Segment className='piled'>Pellentesque habitant morbi tristique senectus.</Segment>;
97
}
108
}

src/elements/Segment/Segments.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, {Component, PropTypes} from 'react';
2+
import classNames from 'classnames';
3+
import META from 'src/utils/Meta';
4+
5+
export default class Segment extends Component {
6+
static propTypes = {
7+
children: PropTypes.node,
8+
className: PropTypes.string,
9+
};
10+
11+
static _meta = {
12+
library: META.library.semanticUI,
13+
name: 'Segments',
14+
type: META.type.element,
15+
};
16+
17+
render() {
18+
const classes = classNames(
19+
'sd-segments',
20+
'ui',
21+
this.props.className,
22+
'segments'
23+
);
24+
25+
return (
26+
<div {...this.props} className={classes}>
27+
{this.props.children}
28+
</div>
29+
);
30+
}
31+
}

0 commit comments

Comments
 (0)