Skip to content

Commit fcb2c69

Browse files
authored
Merge pull request #39 from SanthoshRaju91/feature/es-ulist
Feature/es ulist
2 parents ded4110 + 7213ba7 commit fcb2c69

File tree

20 files changed

+2903
-849
lines changed

20 files changed

+2903
-849
lines changed

addon/components/es-ulist.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import Component from '@ember/component';
22
import layout from '../templates/components/es-ulist';
3+
import { computed } from '@ember/object';
34

45
export default Component.extend({
56
layout,
67
classNames: ['es-ulist'],
78

89
//accessibility support
9-
ariaDescribedby: null,
10-
ariaLabel: null,
10+
ariaDescribedby: computed.alias('list.id'),
11+
ariaLabel: computed.alias('list.name'),
12+
listItems: computed.alias('list.items'),
1113
ariaRole: 'group',
12-
title: null,
14+
title: computed.alias('list.name'),
1315

1416
itemUrl: null, //think about this, there has to be something better to name it.
1517
imageUrl: null,

addon/components/es-ulist/image.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Component from '@ember/component';
2+
import layout from '../../templates/components/es-ulist/image';
3+
import { computed } from '@ember/object';
4+
5+
export default Component.extend({
6+
layout,
7+
8+
classNames: ['es-ulist-image'],
9+
10+
isIconLeft: computed('placement', function() {
11+
return (this.get('placement') !== 'right');
12+
}),
13+
14+
height: computed('imgHeight', function() {
15+
return this.get('imgHeight') || 50;
16+
}),
17+
18+
width: computed('imgWidth', function() {
19+
return this.get('imgWidth') || 50;
20+
})
21+
});

addon/components/es-ulist/link.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Component from '@ember/component';
2+
import layout from '../../templates/components/es-ulist/link';
3+
import { computed } from '@ember/object';
4+
5+
export default Component.extend({
6+
layout,
7+
tagName: '',
8+
9+
isBlocked: computed('isNonBlock', function() {
10+
return this.get('isNonBlock') || false;
11+
})
12+
});

addon/components/es-ulist/text.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Component from '@ember/component';
2+
import layout from '../../templates/components/es-ulist/text';
3+
import { computed } from '@ember/object';
4+
5+
export default Component.extend({
6+
layout,
7+
tagName: '',
8+
9+
isBlocked: computed('isNonBlock', function() {
10+
return !this.get('isNonBlock');
11+
})
12+
});

addon/styles/_es-ulist.scss

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,82 @@
66
justify-content: center;
77
// margin-left: 0;
88
padding-left: 0;
9-
li {
10-
display: inline-block;
11-
justify-content: center;
12-
a {
13-
padding: 5px;
14-
display: block;
15-
img {
9+
10+
ul {
11+
margin: 0;
12+
padding: 0;
13+
li {
14+
justify-content: center;
15+
list-style: none;
16+
17+
a {
18+
padding: 5px;
1619
display: block;
17-
margin: 0 auto;
20+
img {
21+
display: block;
22+
margin: 0 auto;
23+
}
24+
}
25+
}
26+
}
27+
}
28+
29+
.es-ulist-text {
30+
color: $orange;
31+
padding: 5px 0px;
32+
}
33+
34+
.link-text {
35+
a {
36+
color: $orange;
37+
padding: 5px 0px;
38+
text-decoration: none;
39+
40+
&:hover {
41+
opacity: .8;
42+
}
43+
}
44+
45+
&.inline {
46+
a {
47+
display: inline;
48+
}
49+
}
50+
}
51+
52+
.es-ulist-image {
53+
padding: 5px 0px;
54+
55+
.image {
56+
border-radius: 50%;
57+
background-size: cover;
58+
background-repeat: no-repeat;
59+
background-position: 50% 50%;
60+
object-fit: cover;
61+
}
62+
63+
.es-ulist-text {
64+
color: $orange;
65+
position: relative;
66+
top: -1em;
67+
}
68+
69+
.image-left {
70+
.es-ulist-text {
71+
padding-left: 5px;
72+
}
73+
74+
.link-text {
75+
a {
76+
position: relative;
77+
top: -1em;
1878
}
1979
}
2080
}
81+
82+
.image-right {
83+
.image {
84+
padding-left: 5px;
85+
}
86+
}
2187
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
{{yield}}
1+
<div>
2+
{{es-heading headingText=title tagName="h3" class="title"}}
3+
4+
<ul aria-describedby="{{ariaDescribedby}}">
5+
{{#each listItems as |item|}}
6+
<li>
7+
{{yield item}}
8+
</li>
9+
{{/each}}
10+
</ul>
11+
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{#if isIconLeft}}
2+
<div class="flex image-left">
3+
{{#if isIcon}}
4+
<i class="icons {{item.src}}"></i>
5+
{{else}}
6+
<img src="{{item.src}}" alt="Image src" width="{{width}}" height="{{height}}" class="image"/>
7+
{{/if}}
8+
{{yield item}}
9+
</div>
10+
{{else}}
11+
<div class="flex image-right">
12+
{{yield item}}
13+
{{#if isIcon}}
14+
<i class="icons {{item.src}}"></i>
15+
{{else}}
16+
<img src="{{item.src}}" alt="Image src" width="{{width}}" height="{{height}}" class="image"/>
17+
{{/if}}
18+
</div>
19+
{{/if}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{#if isExternal}}
2+
{{#if isBlocked}}
3+
<div class="link-text">
4+
<a href="{{item.route}}" target="__blank">{{item.text}}</a>
5+
</div>
6+
{{else}}
7+
<span class="link-text inline">
8+
<a href="{{item.route}}" target="__blank">{{item.text}}</a>
9+
</span>
10+
{{/if}}
11+
{{else}}
12+
{{#if isBlocked}}
13+
<div class="link-text">
14+
{{#link-to item.route}}
15+
{{item.text}}
16+
{{/link-to}}
17+
</div>
18+
{{else}}
19+
<span class="link-text inline">
20+
{{#link-to item.route}}
21+
{{item.text}}
22+
{{/link-to}}
23+
</span>
24+
{{/if}}
25+
26+
{{/if}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{#if isBlocked}}
2+
<div class="es-ulist-text">
3+
{{item.text}}
4+
</div>
5+
{{else}}
6+
<span class="es-ulist-text">
7+
{{item.text}}
8+
</span>
9+
{{/if}}

app/components/es-ulist/image.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from 'ember-styleguide/components/es-ulist/image';

0 commit comments

Comments
 (0)