xv-webcomponents 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -45,7 +45,7 @@ xv-webcomponents-base/
45
45
 
46
46
  To install the package from npm:
47
47
  ```bash
48
- npm install @xv/webcomponents-base
48
+ npm install xv-webcomponents
49
49
  ```
50
50
 
51
51
  ---
@@ -1,3 +1,4 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class XvButton {
2
3
  el: HTMLElement;
3
4
  /** Button label */
@@ -10,7 +11,11 @@ export declare class XvButton {
10
11
  disabled: boolean;
11
12
  /** Automatically detected brand */
12
13
  detectedBrand: string;
14
+ /** Emits when the button is clicked */
15
+ buttonClick: EventEmitter<void>;
13
16
  private applyGlobalStyles;
17
+ /** Handle click only if not disabled */
18
+ private handleClick;
14
19
  componentWillLoad(): void;
15
20
  render(): any;
16
21
  }
@@ -24,24 +24,31 @@ export namespace Components {
24
24
  */
25
25
  "variant": 'accent' | 'primary' | 'secondary' | 'tertiary' | 'ghost';
26
26
  }
27
- interface XvCheckbox {
28
- }
29
27
  interface XvCheckboxV2 {
30
28
  }
31
29
  }
30
+ export interface XvButtonV2CustomEvent<T> extends CustomEvent<T> {
31
+ detail: T;
32
+ target: HTMLXvButtonV2Element;
33
+ }
32
34
  declare global {
35
+ interface HTMLXvButtonV2ElementEventMap {
36
+ "buttonClick": void;
37
+ }
33
38
  interface HTMLXvButtonV2Element extends Components.XvButtonV2, HTMLStencilElement {
39
+ addEventListener<K extends keyof HTMLXvButtonV2ElementEventMap>(type: K, listener: (this: HTMLXvButtonV2Element, ev: XvButtonV2CustomEvent<HTMLXvButtonV2ElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
40
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
41
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
42
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
43
+ removeEventListener<K extends keyof HTMLXvButtonV2ElementEventMap>(type: K, listener: (this: HTMLXvButtonV2Element, ev: XvButtonV2CustomEvent<HTMLXvButtonV2ElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
44
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
45
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
46
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
34
47
  }
35
48
  var HTMLXvButtonV2Element: {
36
49
  prototype: HTMLXvButtonV2Element;
37
50
  new (): HTMLXvButtonV2Element;
38
51
  };
39
- interface HTMLXvCheckboxElement extends Components.XvCheckbox, HTMLStencilElement {
40
- }
41
- var HTMLXvCheckboxElement: {
42
- prototype: HTMLXvCheckboxElement;
43
- new (): HTMLXvCheckboxElement;
44
- };
45
52
  interface HTMLXvCheckboxV2Element extends Components.XvCheckboxV2, HTMLStencilElement {
46
53
  }
47
54
  var HTMLXvCheckboxV2Element: {
@@ -50,7 +57,6 @@ declare global {
50
57
  };
51
58
  interface HTMLElementTagNameMap {
52
59
  "xv-button-v2": HTMLXvButtonV2Element;
53
- "xv-checkbox": HTMLXvCheckboxElement;
54
60
  "xv-checkbox-v2": HTMLXvCheckboxV2Element;
55
61
  }
56
62
  }
@@ -64,6 +70,10 @@ declare namespace LocalJSX {
64
70
  * Button label
65
71
  */
66
72
  "label"?: string;
73
+ /**
74
+ * Emits when the button is clicked
75
+ */
76
+ "onButtonClick"?: (event: XvButtonV2CustomEvent<void>) => void;
67
77
  /**
68
78
  * Size
69
79
  */
@@ -73,13 +83,10 @@ declare namespace LocalJSX {
73
83
  */
74
84
  "variant"?: 'accent' | 'primary' | 'secondary' | 'tertiary' | 'ghost';
75
85
  }
76
- interface XvCheckbox {
77
- }
78
86
  interface XvCheckboxV2 {
79
87
  }
80
88
  interface IntrinsicElements {
81
89
  "xv-button-v2": XvButtonV2;
82
- "xv-checkbox": XvCheckbox;
83
90
  "xv-checkbox-v2": XvCheckboxV2;
84
91
  }
85
92
  }
@@ -88,7 +95,6 @@ declare module "@stencil/core" {
88
95
  export namespace JSX {
89
96
  interface IntrinsicElements {
90
97
  "xv-button-v2": LocalJSX.XvButtonV2 & JSXBase.HTMLAttributes<HTMLXvButtonV2Element>;
91
- "xv-checkbox": LocalJSX.XvCheckbox & JSXBase.HTMLAttributes<HTMLXvCheckboxElement>;
92
98
  "xv-checkbox-v2": LocalJSX.XvCheckboxV2 & JSXBase.HTMLAttributes<HTMLXvCheckboxV2Element>;
93
99
  }
94
100
  }