@primer/view-components 0.32.1-rc.afd2e09b → 0.33.0-rc.373abd68

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ declare global {
2
+ interface HTMLElementEventMap {
3
+ 'banner:dismiss': CustomEvent<void>;
4
+ }
5
+ }
1
6
  declare class XBannerElement extends HTMLElement {
2
7
  #private;
3
8
  titleText: HTMLElement;
@@ -17,15 +17,16 @@ let XBannerElement = class XBannerElement extends HTMLElement {
17
17
  _XBannerElement_instances.add(this);
18
18
  }
19
19
  dismiss() {
20
- const parentElement = this.parentElement;
21
- if (!parentElement)
22
- return;
23
20
  if (__classPrivateFieldGet(this, _XBannerElement_instances, "a", _XBannerElement_dismissScheme_get) === 'remove') {
21
+ const parentElement = this.parentElement;
22
+ if (!parentElement)
23
+ return;
24
24
  parentElement.removeChild(this);
25
25
  }
26
26
  else {
27
27
  this.hide();
28
28
  }
29
+ this.dispatchEvent(new CustomEvent('banner:dismiss'));
29
30
  }
30
31
  show() {
31
32
  this.style.setProperty('display', 'initial');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.32.1-rc.afd2e09b",
3
+ "version": "0.33.0-rc.373abd68",
4
4
  "description": "ViewComponents for the Primer Design System",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",