Skip to content

Commit dc93906

Browse files
committed
Add icon implementation with manual showcase
1 parent 3587aca commit dc93906

File tree

2 files changed

+24
-7
lines changed
  • packages/components

2 files changed

+24
-7
lines changed

packages/components/addon/components/hds/alert/index.hbs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
<div class={{this.classNames}} ...attributes role="alert">
2-
{{#if @icon}}
2+
{{#if (or @icon @color)}}
33
<div class="hds-alert__icon">
4-
<FlightIcon @name={{this.icon}} @size="24" @isInlineBlock={{false}} />
4+
{{#if @icon}}
5+
<FlightIcon @name={{@icon}} @size="24" @isInlineBlock={{false}} />
6+
{{else if (or (eq @color "neutral") (eq @color "highlight"))}}
7+
<FlightIcon @name="info" @size="24" @isInlineBlock={{false}} />
8+
{{else if (eq @color "success")}}
9+
<FlightIcon @name="check-circle" @size="24" @isInlineBlock={{false}} />
10+
{{else if (eq @color "warning")}}
11+
<FlightIcon @name="alert-triangle" @size="24" @isInlineBlock={{false}} />
12+
{{else if (eq @color "critical")}}
13+
<FlightIcon @name="alert-octagon" @size="24" @isInlineBlock={{false}} />
14+
{{/if}}
515
</div>
616
{{/if}}
717

packages/components/tests/dummy/app/templates/components/alert.hbs

+12-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142

143143
<Hds::Alert
144144
@color="neutral"
145-
@icon="alert-triangle"
146145
@title="Neutral! Alert w/title & description"
147146
@description="Your Intention settings are currently set to default allow. This
148147
means that this view will show connections to every service in your
@@ -154,7 +153,6 @@
154153

155154
<Hds::Alert
156155
@color="highlight"
157-
@icon="alert-triangle"
158156
@title="Highlight! Alert w/title & description"
159157
@description="Your Intention settings are currently set to default allow. This
160158
means that this view will show connections to every service in your
@@ -166,7 +164,6 @@
166164

167165
<Hds::Alert
168166
@color="success"
169-
@icon="alert-triangle"
170167
@title="Success! Alert w/title & description"
171168
@description="Your Intention settings are currently set to default allow. This
172169
means that this view will show connections to every service in your
@@ -178,7 +175,6 @@
178175

179176
<Hds::Alert
180177
@color="warning"
181-
@icon="alert-triangle"
182178
@title="Warning! Alert w/title & description"
183179
@description="Your Intention settings are currently set to default allow. This
184180
means that this view will show connections to every service in your
@@ -190,7 +186,6 @@
190186

191187
<Hds::Alert
192188
@color="critical"
193-
@icon="alert-triangle"
194189
@title="Critical! Alert w/title & description"
195190
@description="Your Intention settings are currently set to default allow. This
196191
means that this view will show connections to every service in your
@@ -200,6 +195,18 @@
200195
/>
201196
<br />
202197

198+
<Hds::Alert
199+
@color="critical"
200+
@icon="meh"
201+
@title="Critical! With special icon"
202+
@description="Your Intention settings are currently set to default allow. This
203+
means that this view will show connections to every service in your
204+
cluster. We recommend changing your Intention settings to default deny and
205+
creating specific Intentions for upstream and downstream services for this
206+
view to be useful."
207+
/>
208+
<br />
209+
203210
Other variations:
204211

205212
<Hds::Alert @color="critical" @icon="alert-triangle" @description="Description only please" />

0 commit comments

Comments
 (0)