@nymbalhq/web-components 0.0.0-stage → 1.0.0
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/dist/index.d.ts +110 -0
- package/dist/index.js +1113 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -3
- package/src/tokens/tokens.css +48 -0
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { NymbalClient } from '@nymbalhq/sdk';
|
|
2
|
+
|
|
3
|
+
declare function registerClient(client: NymbalClient): void;
|
|
4
|
+
declare function getClient(): NymbalClient;
|
|
5
|
+
|
|
6
|
+
declare const HTMLElementBase$1: {
|
|
7
|
+
new (): HTMLElement;
|
|
8
|
+
prototype: HTMLElement;
|
|
9
|
+
};
|
|
10
|
+
declare abstract class NymbalElement extends HTMLElementBase$1 {
|
|
11
|
+
private _unsubs;
|
|
12
|
+
private _renderQueued;
|
|
13
|
+
protected get client(): NymbalClient;
|
|
14
|
+
protected subscribeToStore(store: {
|
|
15
|
+
subscribe(fn: () => void): () => void;
|
|
16
|
+
}): void;
|
|
17
|
+
protected requestRender(): void;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
protected abstract setup(): void;
|
|
21
|
+
protected abstract render(): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare function injectStyles(tagName: string, css: string): void;
|
|
25
|
+
|
|
26
|
+
declare class NymbalAddToCart extends NymbalElement {
|
|
27
|
+
static get observedAttributes(): string[];
|
|
28
|
+
private button;
|
|
29
|
+
protected setup(): void;
|
|
30
|
+
protected render(): void;
|
|
31
|
+
attributeChangedCallback(): void;
|
|
32
|
+
private handleClick;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class NymbalCartDrawer extends NymbalElement {
|
|
36
|
+
static get observedAttributes(): string[];
|
|
37
|
+
private readonly handleItemAdded;
|
|
38
|
+
private readonly handleMiniCartClicked;
|
|
39
|
+
protected setup(): void;
|
|
40
|
+
disconnectedCallback(): void;
|
|
41
|
+
open(): void;
|
|
42
|
+
close(): void;
|
|
43
|
+
toggle(): void;
|
|
44
|
+
protected render(): void;
|
|
45
|
+
attributeChangedCallback(): void;
|
|
46
|
+
private esc;
|
|
47
|
+
private formatPrice;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class NymbalMiniCart extends NymbalElement {
|
|
51
|
+
protected setup(): void;
|
|
52
|
+
protected render(): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare class NymbalVariantSelector extends NymbalElement {
|
|
56
|
+
static get observedAttributes(): string[];
|
|
57
|
+
protected setup(): void;
|
|
58
|
+
protected render(): void;
|
|
59
|
+
attributeChangedCallback(): void;
|
|
60
|
+
private getOptionGroups;
|
|
61
|
+
private esc;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class NymbalQuantitySelector extends NymbalElement {
|
|
65
|
+
static get observedAttributes(): string[];
|
|
66
|
+
private _value;
|
|
67
|
+
protected setup(): void;
|
|
68
|
+
protected render(): void;
|
|
69
|
+
attributeChangedCallback(name: string): void;
|
|
70
|
+
private emitChange;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare class NymbalSearchBar extends NymbalElement {
|
|
74
|
+
static get observedAttributes(): string[];
|
|
75
|
+
private debounceTimer;
|
|
76
|
+
private selectedIndex;
|
|
77
|
+
protected setup(): void;
|
|
78
|
+
protected render(): void;
|
|
79
|
+
private select;
|
|
80
|
+
attributeChangedCallback(): void;
|
|
81
|
+
disconnectedCallback(): void;
|
|
82
|
+
/** Escapes a value for both text and quoted-attribute contexts. */
|
|
83
|
+
private esc;
|
|
84
|
+
private formatPrice;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare class NymbalProductFilter extends NymbalElement {
|
|
88
|
+
static get observedAttributes(): string[];
|
|
89
|
+
protected setup(): void;
|
|
90
|
+
protected render(): void;
|
|
91
|
+
attributeChangedCallback(): void;
|
|
92
|
+
private getFacets;
|
|
93
|
+
private esc;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const HTMLElementBase: {
|
|
97
|
+
new (): HTMLElement;
|
|
98
|
+
prototype: HTMLElement;
|
|
99
|
+
};
|
|
100
|
+
declare class NymbalToast extends HTMLElementBase {
|
|
101
|
+
static get observedAttributes(): string[];
|
|
102
|
+
connectedCallback(): void;
|
|
103
|
+
show(message: string, type?: 'success' | 'error' | 'warning' | 'info'): void;
|
|
104
|
+
private dismiss;
|
|
105
|
+
static showGlobal(message: string, type?: 'success' | 'error' | 'warning' | 'info'): void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare function registerComponents(): void;
|
|
109
|
+
|
|
110
|
+
export { NymbalAddToCart, NymbalCartDrawer, NymbalElement, NymbalMiniCart, NymbalProductFilter, NymbalQuantitySelector, NymbalSearchBar, NymbalToast, NymbalVariantSelector, getClient, injectStyles, registerClient, registerComponents };
|