Skip to content

Commit afcfefd

Browse files
authored
Notice: replaced background icons with foreground icons (eBay#950)
1 parent c74d11c commit afcfefd

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

src/components/ebay-notice/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ Name | Type | Stateful | Required | Description
4848
--- | --- | --- | --- | ---
4949
`a11y-heading-tag` | String | No | Yes | used to specify the heading tag according to the notice's placement (default: `"h2"`)
5050

51+
### Additional attributes when type="window"
52+
53+
Name | Type | Stateful | Required | Description
54+
--- | --- | --- | --- | ---
55+
`fill-window` | Boolean | No | No | used to specify whether the notice should fill the full height of it's window/container (default: `false`)
56+
5157
### ebay-notice Events
5258

5359
Event | Description

src/components/ebay-notice/browser.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
{
44
"if-not-flag": "ebayui-no-skin",
55
"dependencies": [
6-
"@ebay/skin/notice"
6+
"@ebay/skin/notice",
7+
"@ebay/skin/icon/foreground"
78
]
89
},
10+
"../ebay-icon",
911
"require: marko-widgets",
1012
"require: ./index.js"
1113
]

src/components/ebay-notice/examples/11-window-notice/template.marko

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
<div class="demo1-container">
99
<ebay-notice
1010
type="window"
11-
a11y-heading-text="information">
12-
<ebay-notice-title>Congrats</ebay-notice-title>
11+
a11y-heading-text="Success!">
12+
<ebay-notice-title>Your first order has been placed!</ebay-notice-title>
1313
<ebay-notice-content>
14-
<p><strong>Congrats!</strong> You just listed <a href="#">"Spam and Eggs From the Cow's Perspective</a> (paperback)."</p>
15-
<p>You can check <a href="#">your listing</a> or <a href="#">sell another item</a></p>
14+
<p>You'll get a confirmation email soon. The rest of your items are now ready to checkout.</p>
1615
</ebay-notice-content>
17-
<ebay-button priority="none" size="large">Action Button</ebay-button>
16+
<ebay-button priority="none" size="large">Continue</ebay-button>
1817
</ebay-notice>
1918
</div>

src/components/ebay-notice/examples/12-window-notice-fill/template.marko

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
</style>
1010

1111
<div class="demo2-container">
12-
<ebay-notice type="window" fill>
13-
<ebay-notice-title>Congrats</ebay-notice-title>
12+
<ebay-notice type="window" a11y-heading-text="Success!" fill-window>
13+
<ebay-notice-title>Your first order has been placed!</ebay-notice-title>
1414
<ebay-notice-content>
15-
<p><strong>Congrats!</strong> You just listed <a href="#">"Spam and Eggs From the Cow's Perspective</a> (paperback)."</p>
16-
<p>You can check <a href="#">your listing</a> or <a href="#">sell another item</a></p>
15+
<p>You'll get a confirmation email soon. The rest of your items are now ready to checkout.</p>
1716
</ebay-notice-content>
18-
<ebay-button priority="none" size="large">Action Button</ebay-button>
17+
<ebay-button priority="none" size="large">Continue</ebay-button>
1918
</ebay-notice>
2019
</div>

src/components/ebay-notice/template.marko

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script marko-init>
22
var processHtmlAttributes = require("../../common/html-attributes");
3-
var ignoredAttributes = ["class", "style", "type", "fill", "status", "hidden", "a11yHeadingText", "a11yHeadingTag", "a11yCloseText", "dismissible", "content", "title"];
3+
var ignoredAttributes = ["class", "style", "type", "fillWindow", "status", "hidden", "a11yHeadingText", "a11yHeadingTag", "a11yCloseText", "dismissible", "content", "title"];
44
var itemIgnoredAttributes = ["class", "style"];
55
</script>
66
<var type=(data.type || "page")/>
@@ -27,24 +27,31 @@
2727
class=[
2828
"${type}-notice",
2929
!isLightGuidance && !isWindow ? "${type}-notice--${status}" : "",
30-
data.fill ? "${type}-notice--fill" : "",
30+
data.fillWindow ? "${type}-notice--fill" : "",
3131
data.class
3232
]>
3333
<if(!isLightGuidance)>
3434
<${isPage ? data.a11yHeadingTag || "h2" : "span"}
3535
class="${type}-notice__status"
3636
w-id="status">
3737
<if(isWindow && title && title.renderBody)>
38-
<span class="${type}-notice__icon" aria-label=data.a11yHeadingText role="img"/>
38+
<ebay-icon class="window-notice__icon" type="inline" name="confirmation-filled" aria-label=data.a11yHeadingText/>
3939
<span class=["${type}-notice__title", title.class]
4040
style=title.style
4141
${processHtmlAttributes(title, itemIgnoredAttributes)}
4242
w-body=title.renderBody/>
4343
</if>
4444
<else>
45-
<span aria-label=data.a11yHeadingText role="img"/>
45+
<if(status==="confirmation" || status==="celebration")>
46+
<ebay-icon type="inline" name="confirmation-filled" aria-label=data.a11yHeadingText/>
47+
</if>
48+
<if(status==="attention")>
49+
<ebay-icon type="inline" name="attention-filled" aria-label=data.a11yHeadingText/>
50+
</if>
51+
<if(status==="information")>
52+
<ebay-icon type="inline" name="information-filled" aria-label=data.a11yHeadingText/>
53+
</if>
4654
</else>
47-
4855
</>
4956
</if>
5057
<if(content && content.renderBody)>

src/components/ebay-notice/test/test.server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('notice', () => {
168168
});
169169

170170
it('renders fill window', async() => {
171-
const input = assign({}, mock.Window_Notice, { fill: true });
171+
const input = assign({}, mock.Window_Notice, { fillWindow: true });
172172
const { getByText } = await render(template, input);
173173
const container = getByText(input.content.renderBody.text).parentElement;
174174
expect(container).has.class('window-notice');

0 commit comments

Comments
 (0)