From acf073b1a9e8d772dd95d8b980568c6885cf85dc Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Fri, 8 Jul 2022 14:19:55 -0400 Subject: [PATCH 1/4] feat: adding d2l-navigation-button-icon component --- test/button.test.js | 25 ++++++++----------------- test/link.test.js | 3 +++ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/test/button.test.js b/test/button.test.js index ae9501f4..f749211b 100644 --- a/test/button.test.js +++ b/test/button.test.js @@ -37,37 +37,28 @@ describe('Buttons', () => { }); }); - }); - - describe('d2l-navigation-button-close', () => { - - describe('accessibility', () => { - it('should pass all aXe tests', async() => { - const el = await fixture(html``); - await expect(el).to.be.accessible(); - }); - }); - - describe('constructor', () => { - it('should construct', () => { - runConstructor('d2l-navigation-button-close'); + describe('events', () => { + it('should trigger click event', async() => { + const el = await fixture(html``); + setTimeout(() => el.shadowRoot.querySelector('button').click()); + await oneEvent(el, 'click'); }); }); }); - describe('d2l-navigation-notification-icon', () => { + describe('d2l-navigation-button-close', () => { describe('accessibility', () => { it('should pass all aXe tests', async() => { - const el = await fixture(html``); + const el = await fixture(html``); await expect(el).to.be.accessible(); }); }); describe('constructor', () => { it('should construct', () => { - runConstructor('d2l-navigation-notification-icon'); + runConstructor('d2l-navigation-button-close'); }); }); diff --git a/test/link.test.js b/test/link.test.js index 0f0bc044..071a23df 100644 --- a/test/link.test.js +++ b/test/link.test.js @@ -3,7 +3,10 @@ import '../d2l-navigation-link-back.js'; import '../d2l-navigation-link-icon.js'; import '../d2l-navigation-link-image.js'; import { expect, fixture, html, oneEvent } from '@open-wc/testing'; +<<<<<<< HEAD import { getComposedActiveElement } from '@brightspace-ui/core/helpers/focus.js'; +======= +>>>>>>> edbb243 (feat: adding d2l-navigation-button-icon component) import { runConstructor } from '@brightspace-ui/core/tools/constructor-test-helper.js'; describe('Links', () => { From b5eb09a49d721a7ca33d15004ccdc5ae9fbeb148 Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Fri, 8 Jul 2022 15:02:35 -0400 Subject: [PATCH 2/4] switch link-icon to use tooltip as well --- test/link.test.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/link.test.js b/test/link.test.js index 071a23df..0f0bc044 100644 --- a/test/link.test.js +++ b/test/link.test.js @@ -3,10 +3,7 @@ import '../d2l-navigation-link-back.js'; import '../d2l-navigation-link-icon.js'; import '../d2l-navigation-link-image.js'; import { expect, fixture, html, oneEvent } from '@open-wc/testing'; -<<<<<<< HEAD import { getComposedActiveElement } from '@brightspace-ui/core/helpers/focus.js'; -======= ->>>>>>> edbb243 (feat: adding d2l-navigation-button-icon component) import { runConstructor } from '@brightspace-ui/core/tools/constructor-test-helper.js'; describe('Links', () => { From 8375fb08ba073841203a820efae499fc30fac72c Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Fri, 8 Jul 2022 15:10:33 -0400 Subject: [PATCH 3/4] move test --- test/button.test.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/test/button.test.js b/test/button.test.js index f749211b..ae9501f4 100644 --- a/test/button.test.js +++ b/test/button.test.js @@ -37,14 +37,6 @@ describe('Buttons', () => { }); }); - describe('events', () => { - it('should trigger click event', async() => { - const el = await fixture(html``); - setTimeout(() => el.shadowRoot.querySelector('button').click()); - await oneEvent(el, 'click'); - }); - }); - }); describe('d2l-navigation-button-close', () => { @@ -64,6 +56,23 @@ describe('Buttons', () => { }); + describe('d2l-navigation-notification-icon', () => { + + describe('accessibility', () => { + it('should pass all aXe tests', async() => { + const el = await fixture(html``); + await expect(el).to.be.accessible(); + }); + }); + + describe('constructor', () => { + it('should construct', () => { + runConstructor('d2l-navigation-notification-icon'); + }); + }); + + }); + describe('d2l-navigation-button-icon', () => { describe('accessibility', () => { From 0e2c9271283d0d6c95ee3a190e69759dc4b22666 Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Fri, 8 Jul 2022 15:34:43 -0400 Subject: [PATCH 4/4] feat: removing unused navigation-button-close component --- README.md | 1 - d2l-navigation-button-close.js | 75 ------------------ demo/button-link.html | 9 --- demo/immersive-fullscreen.html | 1 - demo/immersive-normal.html | 2 - package.json | 1 - test/button.test.js | 18 ----- test/button.visual-diff.html | 4 - test/button.visual-diff.js | 1 - .../d2l-navigation-button-close-focus.png | Bin 1010 -> 0 bytes .../d2l-navigation-button-close-hover.png | Bin 1010 -> 0 bytes .../d2l-navigation-button-close-normal.png | Bin 793 -> 0 bytes 12 files changed, 112 deletions(-) delete mode 100644 d2l-navigation-button-close.js delete mode 100644 test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-focus.png delete mode 100644 test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-hover.png delete mode 100644 test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-normal.png diff --git a/README.md b/README.md index 9b17a7bd..d8d5299f 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,6 @@ Please note that overridding the `left` slot will prevent the Back link from dis
One Button - Two Button
diff --git a/d2l-navigation-button-close.js b/d2l-navigation-button-close.js deleted file mode 100644 index 1405c751..00000000 --- a/d2l-navigation-button-close.js +++ /dev/null @@ -1,75 +0,0 @@ - -import './d2l-navigation-button-notification-icon.js'; -import '@brightspace-ui/button/d2l-button-behavior.js'; -import '@brightspace-ui/polymer-behaviors/d2l-focusable-behavior.js'; -import '@brightspace-ui/localize-behavior/d2l-localize-behavior.js'; - -import { PolymerElement, html } from '@polymer/polymer/polymer-element.js'; -import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; -/** -`d2l-navigation-button-close` -Polymer-based web component for buttons used in the navigational header. -This button contains an X icon. - -@demo demo/d2l-navigation-button.html d2l-navigation-button-close -*/ -class D2LNavigationButtonClose extends mixinBehaviors([D2L.PolymerBehaviors.Button.Behavior, - D2L.PolymerBehaviors.FocusableBehavior, - D2L.PolymerBehaviors.LocalizeBehavior], PolymerElement) { - - static get properties() { - return { - resources: { - value: function() { - return { - 'ar': { 'close': 'إغلاق' }, - 'de': { 'close': 'Schließen' }, - 'en': { 'close': 'Close' }, - 'es': { 'close': 'Cerrar' }, - 'fi': { 'close': 'Sulje' }, - 'fr': { 'close': 'Fermer' }, - 'ja': { 'close': '閉じる' }, - 'ko': { 'close': '닫기' }, - 'nb': { 'close': 'Lukk' }, - 'nl': { 'close': 'Sluiten' }, - 'pt': { 'close': 'Fechar' }, - 'sv': { 'close': 'Stäng' }, - 'tr': { 'close': 'Kapat' }, - 'zh': { 'close': '关闭' }, - 'ar-SA': { 'close': 'إغلاق' }, - 'de-DE': { 'close': 'Schließen' }, - 'es-MX': { 'close': 'Cerrar' }, - 'fr-CA': { 'close': 'Fermer' }, - 'ja-JP': { 'close': '閉じる' }, - 'ko-KR': { 'close': '닫기' }, - 'nb-NO': { 'close': 'Lukk' }, - 'nl-NL': { 'close': 'Sluiten' }, - 'pt-BR': { 'close': 'Fechar' }, - 'sv-SE': { 'close': 'Stäng' }, - 'tr-TR': { 'close': 'Kapat' }, - 'zh-CN': { 'close': '关闭' }, - 'zh-TW': { 'close': '關閉' } - }; - } - } - }; - } - static get template() { - const template = html` - - - `; - template.setAttribute('strip-whitespace', ''); - return template; - } -} - -customElements.define('d2l-navigation-button-close', D2LNavigationButtonClose); diff --git a/demo/button-link.html b/demo/button-link.html index 5c185b25..08828548 100644 --- a/demo/button-link.html +++ b/demo/button-link.html @@ -6,7 +6,6 @@ import '@brightspace-ui/core/components/demo/demo-page.js'; import '@brightspace-ui/core/components/icons/icon.js'; import '../d2l-navigation-button.js'; - import '../d2l-navigation-button-close.js'; import '../d2l-navigation-button-icon.js'; import '../d2l-navigation-button-notification-icon.js'; import '../d2l-navigation-link.js'; @@ -55,13 +54,6 @@

d2l-navigation-button-icon / d2l-navigation-link-icon

-

d2l-navigation-button-close

- -
- -
-
-

d2l-navigation-button-notification-icon

@@ -107,7 +99,6 @@

Combined

Settings -
diff --git a/demo/immersive-fullscreen.html b/demo/immersive-fullscreen.html index 607683db..d658b6e2 100644 --- a/demo/immersive-fullscreen.html +++ b/demo/immersive-fullscreen.html @@ -6,7 +6,6 @@ import '@brightspace-ui/core/components/demo/demo-page.js'; import '../components/d2l-navigation-iterator/d2l-navigation-iterator.js'; import '../d2l-navigation-button.js'; - import '../d2l-navigation-button-close.js'; import '../d2l-navigation-immersive.js'; d2l-navigation-immersive demo diff --git a/demo/immersive-normal.html b/demo/immersive-normal.html index 52d65848..587e5c90 100644 --- a/demo/immersive-normal.html +++ b/demo/immersive-normal.html @@ -5,7 +5,6 @@ d2l-navigation-immersive demo @@ -30,7 +29,6 @@
One Button - Two Button
diff --git a/package.json b/package.json index 48d1b9d8..2de7dcc7 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "/components", "/lang", "d2l-navigation-band.js", - "d2l-navigation-button-close.js", "d2l-navigation-button-icon.js", "d2l-navigation-button-notification-icon.js", "d2l-navigation-button.js", diff --git a/test/button.test.js b/test/button.test.js index ae9501f4..34bcd8ea 100644 --- a/test/button.test.js +++ b/test/button.test.js @@ -1,5 +1,4 @@ import '../d2l-navigation-button.js'; -import '../d2l-navigation-button-close.js'; import '../d2l-navigation-button-icon.js'; import '../d2l-navigation-button-notification-icon.js'; import { expect, fixture, html, oneEvent } from '@open-wc/testing'; @@ -39,23 +38,6 @@ describe('Buttons', () => { }); - describe('d2l-navigation-button-close', () => { - - describe('accessibility', () => { - it('should pass all aXe tests', async() => { - const el = await fixture(html``); - await expect(el).to.be.accessible(); - }); - }); - - describe('constructor', () => { - it('should construct', () => { - runConstructor('d2l-navigation-button-close'); - }); - }); - - }); - describe('d2l-navigation-notification-icon', () => { describe('accessibility', () => { diff --git a/test/button.visual-diff.html b/test/button.visual-diff.html index 5fa74d29..a23b74bb 100644 --- a/test/button.visual-diff.html +++ b/test/button.visual-diff.html @@ -9,7 +9,6 @@ import '@brightspace-ui/core/components/icons/icon.js'; import '@brightspace-ui/core/components/typography/typography.js'; import '../../d2l-navigation-button.js'; - import '../../d2l-navigation-button-close.js'; import '../../d2l-navigation-button-icon.js'; import '../../d2l-navigation-button-notification-icon.js'; import { forceFocusVisible } from '@brightspace-ui/core/helpers/focus.js'; @@ -23,9 +22,6 @@
-
- -
diff --git a/test/button.visual-diff.js b/test/button.visual-diff.js index 437fbf61..859de57a 100644 --- a/test/button.visual-diff.js +++ b/test/button.visual-diff.js @@ -27,7 +27,6 @@ describe('d2l-navigation-button', () => { [ { category: 'default', tests: ['normal', 'hover', 'focus'] }, { category: 'disabled', tests: ['normal', 'hover', 'focus'] }, - { category: 'close', tests: ['normal', 'hover', 'focus'] }, { category: 'icon-text', tests: ['normal', 'hover', 'focus'] }, { category: 'icon-text-disabled', tests: ['normal', 'hover', 'focus'] }, { category: 'icon-text-hidden', rectSelector: 'icon-text-hidden-container', tests: ['normal', 'hover', 'focus'] }, diff --git a/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-focus.png b/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-focus.png deleted file mode 100644 index cdbd09f50fb84fb5c3421cad2e2763a946e6f600..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1010 zcmeAS@N?(olHy`uVBq!ia0vp^K0sW-!3HEFYD6XgDaPU;cPEB*=VV?oFfgz2ba4!+ znDh4bd2f+Knd2YN?~r=Z@8A>@=zQ?NE|Dfx7NIf@>#8%&Ua^P220T=}^ooDO{snI* zxZ9?gb1HA#UGZT|LMO6#4j- zm1ll%?Y?pQVUFWM@$$EZ32*(xie z=;D(FlU-ZyOqOnzcx9DoBlkP}(>s^{^+{L9^7-W-^Q(c!t`i-#*}Y?jc+fdiW{+$3@jl-b zZCJjOJ(+oV(BGIWgRk0eznsM3BZR+;nYQf-bb9_sY|$Y#v1{LB=PXL&e*L?HYxawn zJBL2Gojhr|hF@TM+_VjUUVTVP*MIu)&9e<>FUw@+mGU2*`)T2N+dXy-OHVSce!lS^ zSM{%7exG7#;@$X!XqFLQ?)x@(s&jROc`(J(eWcA|v1T z#B~>Hk{J8U*KNC4lgudj=1cCv)&|y;lI$xQQ5q2rZQmz-UDVpbno{%m?4s5-)+06| zZ&tlxo%JoVo(agUsHsxVES8?GuXEtBjn2!rnWxmn9#l4*SoHH46Vr?x%Urn`xj7hk z7#4|~KfmnfJe^N`)3%hZcvi(R(`|7mh7I>l~Ky6`!1*F zmrr`f5mPVqwS4BjLlHXHC*Q6*#k1y~^vequj2N>^UI_@zDmI8#o)vImPSeeK=|EF> z&RqR)-h7s@!S%^O^E0j;(ljCk;7j?qRJ~E3-?`}5+^%o`fSH)V)78&qol`;+0ONJs{r~^~ diff --git a/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-hover.png b/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-hover.png deleted file mode 100644 index cdbd09f50fb84fb5c3421cad2e2763a946e6f600..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1010 zcmeAS@N?(olHy`uVBq!ia0vp^K0sW-!3HEFYD6XgDaPU;cPEB*=VV?oFfgz2ba4!+ znDh4bd2f+Knd2YN?~r=Z@8A>@=zQ?NE|Dfx7NIf@>#8%&Ua^P220T=}^ooDO{snI* zxZ9?gb1HA#UGZT|LMO6#4j- zm1ll%?Y?pQVUFWM@$$EZ32*(xie z=;D(FlU-ZyOqOnzcx9DoBlkP}(>s^{^+{L9^7-W-^Q(c!t`i-#*}Y?jc+fdiW{+$3@jl-b zZCJjOJ(+oV(BGIWgRk0eznsM3BZR+;nYQf-bb9_sY|$Y#v1{LB=PXL&e*L?HYxawn zJBL2Gojhr|hF@TM+_VjUUVTVP*MIu)&9e<>FUw@+mGU2*`)T2N+dXy-OHVSce!lS^ zSM{%7exG7#;@$X!XqFLQ?)x@(s&jROc`(J(eWcA|v1T z#B~>Hk{J8U*KNC4lgudj=1cCv)&|y;lI$xQQ5q2rZQmz-UDVpbno{%m?4s5-)+06| zZ&tlxo%JoVo(agUsHsxVES8?GuXEtBjn2!rnWxmn9#l4*SoHH46Vr?x%Urn`xj7hk z7#4|~KfmnfJe^N`)3%hZcvi(R(`|7mh7I>l~Ky6`!1*F zmrr`f5mPVqwS4BjLlHXHC*Q6*#k1y~^vequj2N>^UI_@zDmI8#o)vImPSeeK=|EF> z&RqR)-h7s@!S%^O^E0j;(ljCk;7j?qRJ~E3-?`}5+^%o`fSH)V)78&qol`;+0ONJs{r~^~ diff --git a/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-normal.png b/test/screenshots/ci/golden/d2l-navigation-button/d2l-navigation-button-close-normal.png deleted file mode 100644 index 2df045151ef09bf4ef95587809bab930f2c1afe3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcmeAS@N?(olHy`uVBq!ia0vp^K0sW-!3HEFYD6XgDaPU;cPEB*=VV?oFfd*Aba4!+ znDh3wqra4+MEl3-%jW02>`Zx@(zL|A*L`bUUzDYi%<77*YV%t1kItN@pu6dv-R{rl zcuxMe)KlC1uPO0a>f2ni*}W@|)q2)4AD?z0fvK63N6lacO&B{HZ1v{7Eiu{VXt|~R z=AGouX4^B*%rx4|tfX!~esnXnH||CKxnF;`Y*@Z`_TOvzZ;pQrJ&|fxQf|NT`_otZ zvmbAsSSvrDHCFwH^_!>XU$NCu8Tm6RW6Svsuih=qJ$O)0|J>Smk*Vw3omL-yCEgkvH>W%<-F~|N$=kEF!?&nK zY&W-)H_H2Mpuc5GMA|v&>lZRsZaky(=8N;frwyrMFEg%)>Wb@Z?npnmEyFT#rmI~| z@RmCp&Yaoj7JD}5JGWkVyW&6AQ@p3oJp6EX%l!RnQ!`4J9y0Q_;9vdw^BOJHX_1c@ zm0Z1hQ>Ps~vQ;yRFCtB{Vdl)QRf%`+jb?x z^T4b(50ZHlZ;R9}_wTnZRcCsizxZ4CFTTYQ_a@&qb7ju1o^Xy=mn-7>N@u@}cL@vK zOm;5V+0;5O{b|E9wr8e)ynCN9J+syH?G%&Av6}5ZbBdYcY%7~A(V9nA8tqfpSN3GQ zQrn)tUf=P0_cs2|v(mTDy|YdC)Me{?hxcol^e-=u*~c>T+_T;7H`~;go(?uydCm9R m+KU^f)jX=op-Doy5g-4m`uc$h!SjG=ox#)9&t;ucLK6V9OJSS<