Skip to content

Commit 6e14f98

Browse files
committed
added showcase for “actions” in “Alert” component
1 parent d296268 commit 6e14f98

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

packages/components/tests/dummy/app/styles/app.scss

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
@import "./_typography";
55

6+
@import "./pages/db-alert";
67
@import "./pages/db-badge";
78
@import "./pages/db-breadcrumb";
89
@import "./pages/db-button";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// ALERT
2+
3+
.dummy-alert-sample-custom-actions__actions {
4+
display: flex;
5+
gap: 16px;
6+
align-items: center;
7+
}
8+
9+
.dummy-alert-sample-custom-actions__text {
10+
@include dummyFontFamily();
11+
@include dummyFontSize(0.8rem);
12+
display: block;
13+
color: #999;
14+
margin-top: 1rem;
15+
}

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

+43-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
/>
156156
<br />
157157
Below alert with no title, no description, does not appear in local dev (see error in console):
158-
<Hds::Alert @icon="meh" />
158+
{{! <Hds::Alert @icon="meh" /> }}
159159
<br />
160160
</section>
161161

@@ -177,4 +177,46 @@
177177

178178
<h4 class="dummy-h4">Color:</h4>
179179

180+
<h4 class="dummy-h4">Actions</h4>
181+
<span class="dummy-text-small">with actions passed as yielded components</span>
182+
<Hds::Alert
183+
@icon="alert-triangle"
184+
@title="This is the title"
185+
@description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
186+
>
187+
<:actions as |A|>
188+
<A.Button @text="Button" @size="small" @color="secondary" />
189+
<A.Button @icon="plus" @text="Button" @size="small" @color="tertiary" />
190+
<A.Link::Standalone @icon="plus" @text="Link" href="#" @size="small" @color="secondary" />
191+
</:actions>
192+
</Hds::Alert>
193+
<br />
194+
<span class="dummy-text-small">with content yielded in the "actions" named block</span>
195+
<Hds::Alert
196+
@icon="alert-triangle"
197+
@title="This is the title"
198+
@description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
199+
>
200+
<:actions>
201+
<DummyPlaceholder @text="generic content" @height="80" @background="#e1f5fe" />
202+
</:actions>
203+
</Hds::Alert>
204+
<br />
205+
<span class="dummy-text-small">with custom content yielded in the "actions" named block</span>
206+
<Hds::Alert
207+
@icon="alert-triangle"
208+
@title="This is the title"
209+
@description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
210+
>
211+
<:actions>
212+
<div>
213+
<div class="dummy-alert-sample-custom-actions__actions">
214+
<Hds::Button @text="Button" @size="small" @color="secondary" />
215+
<Hds::Link::Standalone @icon="plus" @text="Link text" href="#" @size="small" @color="secondary" />
216+
</div>
217+
<span class="dummy-alert-sample-custom-actions__text">This for example could be extra text, specific only for
218+
one special use case.</span>
219+
</div>
220+
</:actions>
221+
</Hds::Alert>
180222
</section>

0 commit comments

Comments
 (0)