Skip to content

Commit 0c98cd2

Browse files
authored
Merge pull request #814 from lalithkarikelli/surf2153
feat(choice tile): new component specs
2 parents 6075de7 + 5daabc3 commit 0c98cd2

File tree

3 files changed

+69
-21
lines changed

3 files changed

+69
-21
lines changed

docs/components/icon/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h2 id="status-icons">Status Icons</h2>
6464

6565
<div class="example">
6666
<div>
67-
<hx-icon type="info-circle" style="color: #296CDC" class="size-2x"></hx-icon>
67+
<hx-icon type="information" style="color: #296CDC" class="size-2x"></hx-icon>
6868
<hx-icon type="ok" style="color: #008B38" class="size-2x"></hx-icon>
6969
<hx-icon type="warning" style="color: #ffc749" class="size-2x"></hx-icon>
7070
<hx-icon type="critical" style="color: #D6251F" class="size-2x"></hx-icon>
@@ -74,7 +74,7 @@ <h2 id="status-icons">Status Icons</h2>
7474

7575
<footer>
7676
{% code 'html' %}
77-
<hx-icon type="info-circle" style="color: #296CDC"></hx-icon>
77+
<hx-icon type="information" style="color: #296CDC"></hx-icon>
7878
<hx-icon type="ok" style="color: #008B38"></hx-icon>
7979
<hx-icon type="warning" style="color: #ffc749"></hx-icon>
8080
<hx-icon type="critical" style="color: #D6251F"></hx-icon>

src/scss/components/choice-tile/_index.scss

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ hx-tile {
1818
font-size: 1rem;
1919
font-weight: 700;
2020
margin-bottom: 0;
21+
color: $gray-700;
22+
line-height: 24px;
23+
text-align: center;
2124
}
2225

2326
> p {
2427
font-size: 0.75rem;
28+
color: $gray-700;
2529
}
2630

2731
&.hxSm {
@@ -115,7 +119,7 @@ label.hxChoice > input + hx-tile {
115119
cursor: pointer;
116120

117121
.hx-tile-icon {
118-
color: $gray-700;
122+
color: $gray-400;
119123
}
120124
}
121125

@@ -130,15 +134,23 @@ label.hxChoice > input:focus + hx-tile {
130134

131135
// ========== CHECKED ==========
132136
label.hxChoice > input:checked + hx-tile {
133-
border-color: $cyan-900;
134-
color: $cyan-900;
137+
border: 1px solid $purple-300;
138+
color: $gray-0;
139+
140+
> hx-icon {
141+
color: $purple-300;
142+
}
135143

136144
.hx-tile-icon {
137-
color: $cyan-900;
145+
color: $purple-300;
146+
}
147+
148+
> header {
149+
color: $purple-300;
138150
}
139151

140152
> p {
141-
color: $gray-900;
153+
color: $gray-950;
142154
}
143155

144156
// DEPRECATED: remove in v1.0.0
@@ -163,6 +175,14 @@ label.hxChoice > input[invalid] + hx-tile {
163175
.hx-tile-icon {
164176
color: inherit;
165177
}
178+
179+
> header {
180+
color: inherit;
181+
}
182+
183+
hx-icon[type="checkmark"] {
184+
color: inherit;
185+
}
166186
}
167187

168188
label.hxChoice > input[invalid] + hx-tile:hover {
@@ -179,17 +199,21 @@ label.hxChoice > input[disabled] + hx-tile:hover {
179199
@include hxChoiceTile--disabled;
180200

181201
> p {
182-
color: inherit;
202+
color: $gray-500;
183203
}
184204

185205
// DEPRECATED: remove in v1.0.0
186206
hx-tile-description {
187-
color: inherit;
207+
color: $gray-500;
188208
}
189209

190-
hx-icon {
210+
> header {
191211
color: $gray-500;
192212
}
213+
214+
hx-icon {
215+
color: $gray-400;
216+
}
193217
}
194218

195219
// DEPRECATED: remove in v1.0.0

src/scss/components/choice-tile/mixins/_hxChoiceTile.scss

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55
// ========== Default ==========
66
@mixin hxChoiceTile($pseudo-state: null) {
77
@if $pseudo-state == focus {
8-
box-shadow: $focus-glow;
8+
box-shadow: 0 0 4px rgba($purple-700, 0.5);
99
}
1010
@else if $pseudo-state == hover {
11-
background-color: $cyan-50;
12-
border-color: $cyan-500;
11+
background-color: $gray-0;
12+
border: 1px solid $purple-700;
13+
14+
> header {
15+
color: $purple-700;
16+
}
17+
18+
> p {
19+
color: $gray-950;
20+
}
21+
22+
.hx-tile-icon {
23+
color: $purple-700;
24+
}
1325
}
1426
}
1527

@@ -26,25 +38,37 @@
2638
// ========== Invalid ==========
2739
@mixin hxChoiceTile--invalid($pseudo-state: null) {
2840
@if $pseudo-state == focus {
29-
box-shadow: $focus-glow-invalid;
41+
box-shadow: 0 0 4px rgba($red-status-500, 0.5);
3042
}
3143
@else if $pseudo-state == hover {
32-
background-color: $red-100;
33-
border-color: $red-900;
44+
background-color: $red-status-100;
45+
border-color: $red-status-500;
3446
color: $gray-900;
47+
48+
> header {
49+
color: inherit;
50+
}
3551
}
3652
@else {
37-
border-color: $red-900;
53+
border-color: $red-status-500;
3854
border-width: 2px;
39-
color: $red-900;
55+
color: $red-status-500;
56+
}
57+
58+
.hx-tile-icon {
59+
color: $red-status-500;
4060
}
4161
}
4262

4363
// ========== Disabled ==========
4464
@mixin hxChoiceTile--disabled {
45-
background-color: $gray-25;
46-
border-color: $gray-300;
65+
background-color: $gray-0;
66+
border-color: $gray-400;
4767
border-width: 1px;
48-
color: $gray-700;
68+
color: $gray-500;
4969
cursor: not-allowed;
70+
71+
> header {
72+
color: inherit;
73+
}
5074
}

0 commit comments

Comments
 (0)