@nectary/components 0.8.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.
Files changed (132) hide show
  1. package/accordion/index.d.ts +21 -0
  2. package/accordion/index.js +118 -0
  3. package/accordion-item/index.d.ts +33 -0
  4. package/accordion-item/index.js +139 -0
  5. package/alert/index.d.ts +26 -0
  6. package/alert/index.js +91 -0
  7. package/alert-button/index.d.ts +23 -0
  8. package/alert-button/index.js +62 -0
  9. package/alert-close/index.d.ts +22 -0
  10. package/alert-close/index.js +41 -0
  11. package/button/index.d.ts +32 -0
  12. package/button/index.js +100 -0
  13. package/checkbox/index.d.ts +29 -0
  14. package/checkbox/index.js +134 -0
  15. package/help-tooltip/index.d.ts +15 -0
  16. package/help-tooltip/index.js +80 -0
  17. package/icon/cancel/index.d.ts +11 -0
  18. package/icon/cancel/index.js +4 -0
  19. package/icon/close/index.d.ts +11 -0
  20. package/icon/close/index.js +4 -0
  21. package/icon/create-icon-class.d.ts +308 -0
  22. package/icon/create-icon-class.js +53 -0
  23. package/icon/east/index.d.ts +11 -0
  24. package/icon/east/index.js +4 -0
  25. package/icon/help-outline/index.d.ts +11 -0
  26. package/icon/help-outline/index.js +4 -0
  27. package/icon/more-horiz/index.d.ts +11 -0
  28. package/icon/more-horiz/index.js +4 -0
  29. package/icon/more-vert/index.d.ts +11 -0
  30. package/icon/more-vert/index.js +4 -0
  31. package/icon/north/index.d.ts +11 -0
  32. package/icon/north/index.js +4 -0
  33. package/icon/north-east/index.d.ts +11 -0
  34. package/icon/north-east/index.js +4 -0
  35. package/icon/north-west/index.d.ts +11 -0
  36. package/icon/north-west/index.js +4 -0
  37. package/icon/open-in-new/index.d.ts +11 -0
  38. package/icon/open-in-new/index.js +4 -0
  39. package/icon/south/index.d.ts +11 -0
  40. package/icon/south/index.js +4 -0
  41. package/icon/south-east/index.d.ts +11 -0
  42. package/icon/south-east/index.js +4 -0
  43. package/icon/south-west/index.d.ts +11 -0
  44. package/icon/south-west/index.js +4 -0
  45. package/icon/types.d.ts +7 -0
  46. package/icon/types.js +1 -0
  47. package/icon/west/index.d.ts +11 -0
  48. package/icon/west/index.js +4 -0
  49. package/icon-branded/barchart-down/index.d.ts +11 -0
  50. package/icon-branded/barchart-down/index.js +4 -0
  51. package/icon-branded/barchart-up/index.d.ts +11 -0
  52. package/icon-branded/barchart-up/index.js +4 -0
  53. package/icon-branded/campaigns/index.d.ts +11 -0
  54. package/icon-branded/campaigns/index.js +4 -0
  55. package/icon-branded/chatbot/index.d.ts +11 -0
  56. package/icon-branded/chatbot/index.js +4 -0
  57. package/icon-branded/contact/index.d.ts +11 -0
  58. package/icon-branded/contact/index.js +4 -0
  59. package/icon-branded/create-icon-class.d.ts +309 -0
  60. package/icon-branded/create-icon-class.js +61 -0
  61. package/icon-branded/home/index.d.ts +11 -0
  62. package/icon-branded/home/index.js +4 -0
  63. package/icon-branded/multiple-channels/index.d.ts +11 -0
  64. package/icon-branded/multiple-channels/index.js +4 -0
  65. package/icon-branded/rocket/index.d.ts +11 -0
  66. package/icon-branded/rocket/index.js +4 -0
  67. package/icon-branded/settings/index.d.ts +11 -0
  68. package/icon-branded/settings/index.js +4 -0
  69. package/icon-branded/types.d.ts +9 -0
  70. package/icon-branded/types.js +1 -0
  71. package/icon-branded/user/index.d.ts +11 -0
  72. package/icon-branded/user/index.js +4 -0
  73. package/icon-branded/users/index.d.ts +11 -0
  74. package/icon-branded/users/index.js +4 -0
  75. package/index.d.ts +56 -0
  76. package/index.js +56 -0
  77. package/input/index.d.ts +35 -0
  78. package/input/index.js +203 -0
  79. package/link/index.d.ts +30 -0
  80. package/link/index.js +118 -0
  81. package/logo/create-logo-class.d.ts +309 -0
  82. package/logo/create-logo-class.js +63 -0
  83. package/logo/sinch-icon/index.d.ts +11 -0
  84. package/logo/sinch-icon/index.js +4 -0
  85. package/logo/sinch-icon-wordmark/index.d.ts +11 -0
  86. package/logo/sinch-icon-wordmark/index.js +4 -0
  87. package/logo/types.d.ts +9 -0
  88. package/logo/types.js +1 -0
  89. package/package.json +34 -0
  90. package/radio/index.d.ts +19 -0
  91. package/radio/index.js +185 -0
  92. package/radio-option/index.d.ts +28 -0
  93. package/radio-option/index.js +134 -0
  94. package/readme.md +172 -0
  95. package/select/index.d.ts +37 -0
  96. package/select/index.js +492 -0
  97. package/select-option/index.d.ts +27 -0
  98. package/select-option/index.js +107 -0
  99. package/spinner/index.d.ts +21 -0
  100. package/spinner/index.js +23 -0
  101. package/table/index.d.ts +13 -0
  102. package/table/index.js +18 -0
  103. package/table-body/index.d.ts +13 -0
  104. package/table-body/index.js +18 -0
  105. package/table-cell/index.d.ts +20 -0
  106. package/table-cell/index.js +27 -0
  107. package/table-head/index.d.ts +13 -0
  108. package/table-head/index.js +18 -0
  109. package/table-head-cell/index.d.ts +24 -0
  110. package/table-head-cell/index.js +74 -0
  111. package/table-head-sort/index.d.ts +25 -0
  112. package/table-head-sort/index.js +92 -0
  113. package/table-row/index.d.ts +17 -0
  114. package/table-row/index.js +26 -0
  115. package/tabs/index.d.ts +19 -0
  116. package/tabs/index.js +181 -0
  117. package/tabs-option/index.d.ts +28 -0
  118. package/tabs-option/index.js +129 -0
  119. package/tag/index.d.ts +27 -0
  120. package/tag/index.js +79 -0
  121. package/tag-close/index.d.ts +24 -0
  122. package/tag-close/index.js +70 -0
  123. package/textarea/index.d.ts +35 -0
  124. package/textarea/index.js +201 -0
  125. package/theme.css +112 -0
  126. package/toggle/index.d.ts +31 -0
  127. package/toggle/index.js +144 -0
  128. package/tooltip/index.d.ts +26 -0
  129. package/tooltip/index.js +68 -0
  130. package/types.d.ts +3 -0
  131. package/utils.d.ts +31 -0
  132. package/utils.js +146 -0
@@ -0,0 +1,309 @@
1
+ export declare const createLogoClass: (templateHTML: string) => {
2
+ new (): {
3
+ $svg: SVGElement;
4
+ size: number;
5
+ inverted: boolean;
6
+ connectedCallback(): void;
7
+ attributeChangedCallback(name: string, _: string | null, newVal: string | null): void;
8
+ accessKey: string;
9
+ readonly accessKeyLabel: string;
10
+ autocapitalize: string;
11
+ dir: string;
12
+ draggable: boolean;
13
+ hidden: boolean;
14
+ innerText: string;
15
+ lang: string;
16
+ readonly offsetHeight: number;
17
+ readonly offsetLeft: number;
18
+ readonly offsetParent: Element | null;
19
+ readonly offsetTop: number;
20
+ readonly offsetWidth: number;
21
+ outerText: string;
22
+ spellcheck: boolean;
23
+ title: string;
24
+ translate: boolean;
25
+ attachInternals(): ElementInternals;
26
+ click(): void;
27
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
28
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
29
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
30
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
31
+ readonly attributes: NamedNodeMap;
32
+ readonly classList: DOMTokenList;
33
+ className: string;
34
+ readonly clientHeight: number;
35
+ readonly clientLeft: number;
36
+ readonly clientTop: number;
37
+ readonly clientWidth: number;
38
+ id: string;
39
+ readonly localName: string;
40
+ readonly namespaceURI: string | null;
41
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
42
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
43
+ outerHTML: string;
44
+ readonly ownerDocument: Document;
45
+ readonly part: DOMTokenList;
46
+ readonly prefix: string | null;
47
+ readonly scrollHeight: number;
48
+ scrollLeft: number;
49
+ scrollTop: number;
50
+ readonly scrollWidth: number;
51
+ readonly shadowRoot: ShadowRoot | null;
52
+ slot: string;
53
+ readonly tagName: string;
54
+ attachShadow(init: ShadowRootInit): ShadowRoot;
55
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
56
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
57
+ closest<E extends Element = Element>(selectors: string): E | null;
58
+ getAttribute(qualifiedName: string): string | null;
59
+ getAttributeNS(namespace: string | null, localName: string): string | null;
60
+ getAttributeNames(): string[];
61
+ getAttributeNode(qualifiedName: string): Attr | null;
62
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
63
+ getBoundingClientRect(): DOMRect;
64
+ getClientRects(): DOMRectList;
65
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
66
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
67
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
68
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
69
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
70
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
71
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
72
+ hasAttribute(qualifiedName: string): boolean;
73
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
74
+ hasAttributes(): boolean;
75
+ hasPointerCapture(pointerId: number): boolean;
76
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
77
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
78
+ insertAdjacentText(where: InsertPosition, data: string): void;
79
+ matches(selectors: string): boolean;
80
+ releasePointerCapture(pointerId: number): void;
81
+ removeAttribute(qualifiedName: string): void;
82
+ removeAttributeNS(namespace: string | null, localName: string): void;
83
+ removeAttributeNode(attr: Attr): Attr;
84
+ requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
85
+ requestPointerLock(): void;
86
+ scroll(options?: ScrollToOptions | undefined): void;
87
+ scroll(x: number, y: number): void;
88
+ scrollBy(options?: ScrollToOptions | undefined): void;
89
+ scrollBy(x: number, y: number): void;
90
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
91
+ scrollTo(options?: ScrollToOptions | undefined): void;
92
+ scrollTo(x: number, y: number): void;
93
+ setAttribute(qualifiedName: string, value: string): void;
94
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
95
+ setAttributeNode(attr: Attr): Attr | null;
96
+ setAttributeNodeNS(attr: Attr): Attr | null;
97
+ setPointerCapture(pointerId: number): void;
98
+ toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
99
+ webkitMatchesSelector(selectors: string): boolean;
100
+ readonly baseURI: string;
101
+ readonly childNodes: NodeListOf<ChildNode>;
102
+ readonly firstChild: ChildNode | null;
103
+ readonly isConnected: boolean;
104
+ readonly lastChild: ChildNode | null;
105
+ readonly nextSibling: ChildNode | null;
106
+ readonly nodeName: string;
107
+ readonly nodeType: number;
108
+ nodeValue: string | null;
109
+ readonly parentElement: HTMLElement | null;
110
+ readonly parentNode: ParentNode | null;
111
+ readonly previousSibling: ChildNode | null;
112
+ textContent: string | null;
113
+ appendChild<T extends Node>(node: T): T;
114
+ cloneNode(deep?: boolean | undefined): Node;
115
+ compareDocumentPosition(other: Node): number;
116
+ contains(other: Node | null): boolean;
117
+ getRootNode(options?: GetRootNodeOptions | undefined): Node;
118
+ hasChildNodes(): boolean;
119
+ insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
120
+ isDefaultNamespace(namespace: string | null): boolean;
121
+ isEqualNode(otherNode: Node | null): boolean;
122
+ isSameNode(otherNode: Node | null): boolean;
123
+ lookupNamespaceURI(prefix: string | null): string | null;
124
+ lookupPrefix(namespace: string | null): string | null;
125
+ normalize(): void;
126
+ removeChild<T_2 extends Node>(child: T_2): T_2;
127
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
128
+ readonly ATTRIBUTE_NODE: number;
129
+ readonly CDATA_SECTION_NODE: number;
130
+ readonly COMMENT_NODE: number;
131
+ readonly DOCUMENT_FRAGMENT_NODE: number;
132
+ readonly DOCUMENT_NODE: number;
133
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
134
+ readonly DOCUMENT_POSITION_CONTAINS: number;
135
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
136
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
137
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
138
+ readonly DOCUMENT_POSITION_PRECEDING: number;
139
+ readonly DOCUMENT_TYPE_NODE: number;
140
+ readonly ELEMENT_NODE: number;
141
+ readonly ENTITY_NODE: number;
142
+ readonly ENTITY_REFERENCE_NODE: number;
143
+ readonly NOTATION_NODE: number;
144
+ readonly PROCESSING_INSTRUCTION_NODE: number;
145
+ readonly TEXT_NODE: number;
146
+ dispatchEvent(event: Event): boolean;
147
+ ariaAtomic: string;
148
+ ariaAutoComplete: string;
149
+ ariaBusy: string;
150
+ ariaChecked: string;
151
+ ariaColCount: string;
152
+ ariaColIndex: string;
153
+ ariaColSpan: string;
154
+ ariaCurrent: string;
155
+ ariaDisabled: string;
156
+ ariaExpanded: string;
157
+ ariaHasPopup: string;
158
+ ariaHidden: string;
159
+ ariaKeyShortcuts: string;
160
+ ariaLabel: string;
161
+ ariaLevel: string;
162
+ ariaLive: string;
163
+ ariaModal: string;
164
+ ariaMultiLine: string;
165
+ ariaMultiSelectable: string;
166
+ ariaOrientation: string;
167
+ ariaPlaceholder: string;
168
+ ariaPosInSet: string;
169
+ ariaPressed: string;
170
+ ariaReadOnly: string;
171
+ ariaRequired: string;
172
+ ariaRoleDescription: string;
173
+ ariaRowCount: string;
174
+ ariaRowIndex: string;
175
+ ariaRowSpan: string;
176
+ ariaSelected: string;
177
+ ariaSetSize: string;
178
+ ariaSort: string;
179
+ ariaValueMax: string;
180
+ ariaValueMin: string;
181
+ ariaValueNow: string;
182
+ ariaValueText: string;
183
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
184
+ getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
185
+ after(...nodes: (string | Node)[]): void;
186
+ before(...nodes: (string | Node)[]): void;
187
+ remove(): void;
188
+ replaceWith(...nodes: (string | Node)[]): void;
189
+ innerHTML: string;
190
+ readonly nextElementSibling: Element | null;
191
+ readonly previousElementSibling: Element | null;
192
+ readonly childElementCount: number;
193
+ readonly children: HTMLCollection;
194
+ readonly firstElementChild: Element | null;
195
+ readonly lastElementChild: Element | null;
196
+ append(...nodes: (string | Node)[]): void;
197
+ prepend(...nodes: (string | Node)[]): void;
198
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
199
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
200
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
201
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
202
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
203
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
204
+ replaceChildren(...nodes: (string | Node)[]): void;
205
+ readonly assignedSlot: HTMLSlotElement | null;
206
+ oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
207
+ oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
208
+ onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
209
+ readonly style: CSSStyleDeclaration;
210
+ contentEditable: string;
211
+ enterKeyHint: string;
212
+ inputMode: string;
213
+ readonly isContentEditable: boolean;
214
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
215
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
216
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
217
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
218
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
219
+ onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
220
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
221
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
222
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
223
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
224
+ onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
225
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
226
+ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
227
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
228
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
229
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
230
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
231
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
232
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
233
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
234
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
235
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
236
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
237
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
238
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
239
+ onerror: OnErrorEventHandler;
240
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
241
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
242
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
243
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
244
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
245
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
246
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
247
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
248
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
249
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
250
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
251
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
252
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
253
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
254
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
255
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
256
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
257
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
258
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
259
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
260
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
261
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
262
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
263
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
265
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
267
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
268
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
269
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
270
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
271
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
272
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
275
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
276
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
282
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
283
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
+ ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
286
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
287
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
288
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
289
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
290
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
291
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
292
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
293
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
294
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
300
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
301
+ autofocus: boolean;
302
+ readonly dataset: DOMStringMap;
303
+ nonce?: string | undefined;
304
+ tabIndex: number;
305
+ blur(): void;
306
+ focus(options?: FocusOptions | undefined): void;
307
+ };
308
+ readonly observedAttributes: string[];
309
+ };
@@ -0,0 +1,63 @@
1
+ import { getBooleanAttribute, getIntegerAttribute, updateAttribute, updateBooleanAttribute, updateIntegerAttribute } from '../utils';
2
+ const logoStylesHtml = '<style>:host{display:inline-block;vertical-align:middle}svg{display:block;fill:var(--sinch-color-stormy-500)}:host([inverted]:not([inverted=false])) svg{fill:var(--sinch-color-snow-100)}</style>';
3
+ const DEFAULT_SIZE = 16;
4
+ const MIN_SIZE = 4;
5
+ const MAX_SIZE = 256;
6
+ export const createLogoClass = templateHTML => {
7
+ const template = document.createElement('template');
8
+ template.innerHTML = logoStylesHtml + templateHTML;
9
+ return class extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ const shadowRoot = this.attachShadow({
13
+ mode: 'production' === 'development' ? 'open' : 'closed'
14
+ });
15
+ shadowRoot.appendChild(template.content.cloneNode(true));
16
+ this.$svg = shadowRoot.querySelector('svg');
17
+ }
18
+
19
+ static get observedAttributes() {
20
+ return ['size'];
21
+ }
22
+
23
+ set size(value) {
24
+ updateAttribute(this, 'size', value);
25
+ }
26
+
27
+ get size() {
28
+ return getIntegerAttribute(this, 'size', DEFAULT_SIZE);
29
+ }
30
+
31
+ set inverted(isInverted) {
32
+ updateBooleanAttribute(this, 'inverted', isInverted);
33
+ }
34
+
35
+ get inverted() {
36
+ return getBooleanAttribute(this, 'inverted');
37
+ }
38
+
39
+ connectedCallback() {
40
+ if (!this.$svg.hasAttribute('preserveAspectRatio')) {
41
+ this.$svg.setAttribute('preserveAspectRatio', 'xMinYMin meet');
42
+ }
43
+
44
+ if (!this.hasAttribute('size')) {
45
+ this.size = DEFAULT_SIZE;
46
+ }
47
+ }
48
+
49
+ attributeChangedCallback(name, _, newVal) {
50
+ switch (name) {
51
+ case 'size':
52
+ {
53
+ updateIntegerAttribute(this.$svg, 'height', newVal, {
54
+ min: MIN_SIZE,
55
+ max: MAX_SIZE
56
+ });
57
+ break;
58
+ }
59
+ }
60
+ }
61
+
62
+ };
63
+ };
@@ -0,0 +1,11 @@
1
+ import type { TSinchLogoElement, TSinchLogoReact } from '../types';
2
+ declare global {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ 'sinch-logo-sinch-icon': TSinchLogoReact;
6
+ }
7
+ }
8
+ interface HTMLElementTagNameMap {
9
+ 'sinch-logo-sinch-icon': TSinchLogoElement;
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ import { defineCustomElement } from '../../utils';
2
+ import { createLogoClass } from '../create-logo-class';
3
+ const templateHTML = '<svg viewBox="0 0 93 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M92.298 25.271a17.167 17.167 0 0 1-.814 5.312c-1.51 4.734-5.27 8.678-10.06 10.549-5.64 2.202-12.252 1.416-18.624-2.21l-4.649-2.67a16.424 16.424 0 0 1-3.563 3.064l-14.817 8.679-.027.015v-7.501l.027-.014 22.29-13.057a16.017 16.017 0 0 1-.713 3.206l4.656 2.65c5.95 3.386 10.388 2.85 13.065 1.806 2.991-1.167 5.323-3.59 6.245-6.483.692-2.15.679-4.467-.04-6.609-.955-2.88-3.319-5.275-6.324-6.41-2.688-1.014-7.132-1.494-13.04 1.962L29.7 38.747l-.043.028c-4.017 2.35-8.14 3.556-12.065 3.58a18.162 18.162 0 0 1-6.53-1.145C6.247 39.396 2.44 35.498.874 30.783A17.116 17.116 0 0 1 .81 20.166c1.51-4.733 5.272-8.676 10.063-10.548 5.64-2.202 12.252-1.416 18.623 2.212l4.649 2.67a16.377 16.377 0 0 1 3.563-3.067l.281-.163 1.726-1.011-7.37-4.197A3.238 3.238 0 0 1 35.551.437l10.591 6.06L56.52.457a3.238 3.238 0 0 1 3.27 5.588l-29.528 17.05c.132-1.017.36-2.019.683-2.992l-4.656-2.65c-5.946-3.383-10.384-2.847-13.061-1.803-2.991 1.167-5.325 3.59-6.247 6.481a10.623 10.623 0 0 0 .039 6.608c.956 2.882 3.321 5.277 6.324 6.41 2.689 1.012 7.136 1.495 13.042-1.966l36.256-21.208c4.017-2.349 8.14-3.555 12.067-3.579a18.112 18.112 0 0 1 6.53 1.145c4.812 1.813 8.62 5.712 10.187 10.426a17.23 17.23 0 0 1 .872 5.304Z"/></svg>';
4
+ defineCustomElement('sinch-logo-sinch-icon', createLogoClass(templateHTML));
@@ -0,0 +1,11 @@
1
+ import type { TSinchLogoElement, TSinchLogoReact } from '../types';
2
+ declare global {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ 'sinch-logo-sinch-icon-wordmark': TSinchLogoReact;
6
+ }
7
+ }
8
+ interface HTMLElementTagNameMap {
9
+ 'sinch-logo-sinch-icon-wordmark': TSinchLogoElement;
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ import { defineCustomElement } from '../../utils';
2
+ import { createLogoClass } from '../create-logo-class';
3
+ const templateHTML = '<svg viewBox="0 0 236 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m100.82 36.72 6.606-3.801c1.299 2.603 3.5 3.903 6.602 3.9 2.914 0 4.704-1.299 4.704-3.201 0-1.902-2.498-2.498-6.806-3.401-5.903-1.303-9.703-3.7-9.703-8.704 0-5.412 5.503-9.108 11.605-9.108 5.204 0 8.804 1.403 12.006 5.411l-6.303 3.605c-1.199-2.081-3.001-3.101-5.603-3.101-2.701 0-4.2 1.199-4.2 2.802 0 1.998 3.001 2.397 7.002 3.4 5.503 1.4 9.707 3.301 9.707 8.805 0 5.702-5.603 9.603-12.609 9.603-5.802-.008-10.207-1.607-13.008-6.21Zm29.618 5.41V16.739l7.405-4.333v29.717l-7.405.009Zm12.608 0V26.517c0-8.004 5.903-14.111 14.108-14.111 8.325 0 14.107 6.506 14.107 14.111v15.606h-7.493V27.016c0-4.604-2.801-7.306-6.602-7.306-4.104 0-6.606 2.914-6.606 7.306v15.106l-7.514.009Zm32.203-14.515c0-8.904 6.402-15.21 15.402-15.21 5.603 0 10.602 2.914 13.004 7.405l-6.402 3.805a7.36 7.36 0 0 0-6.702-4.005c-4.404 0-7.705 3.302-7.705 8.005 0 4.604 3.101 8.105 7.705 8.105 3.001 0 5.603-1.503 6.802-4.004l6.402 3.704a14.887 14.887 0 0 1-13.104 7.493c-8.883.009-15.402-6.394-15.402-15.298Zm32.519 14.507V4.304L215.186 0v14.607a12.584 12.584 0 0 1 6.902-2.202c8.204 0 13.907 5.603 13.907 13.907v15.819h-7.493V27.016c0-4.604-2.801-7.306-6.602-7.306-4.104 0-6.606 2.914-6.606 7.306v15.106h-7.526ZM82.892 27.578a15.068 15.068 0 0 1-9.766 14.244C68.06 43.8 62.124 43.072 56.4 39.837l-4.162-2.398a14.752 14.752 0 0 1-3.197 2.752l-13.32 7.792h-.026v-6.722h.025l20.02-11.735a14.647 14.647 0 0 1-.641 2.876l4.162 2.381c5.345 3.04 9.333 2.56 11.735 1.624a9.484 9.484 0 0 0 5.607-5.828 9.67 9.67 0 0 0 .458-2.972 9.257 9.257 0 0 0-6.17-8.717c-2.418-.911-6.406-1.344-11.713 1.761L26.675 39.679l-.038.025c-3.605 2.11-7.31 3.197-10.823 3.217-2.001.02-3.99-.328-5.865-1.028a15.185 15.185 0 0 1-9.22-18.898 15.352 15.352 0 0 1 9.037-9.475c5.066-1.977 11.002-1.274 16.725 1.986l4.163 2.398a14.678 14.678 0 0 1 3.201-2.752l.28-.166 1.552-.908-6.619-3.746a2.915 2.915 0 0 1 2.86-5.058l9.512 5.44 9.32-5.41a2.914 2.914 0 0 1 2.939 5.007l-26.52 15.31a14.67 14.67 0 0 1 .616-2.68l-4.163-2.382c-5.341-3.038-9.325-2.56-11.73-1.619a9.317 9.317 0 0 0 .103 17.508c2.415.912 6.407 1.345 11.714-1.76l32.557-19.053c3.604-2.11 7.31-3.193 10.823-3.214 2-.02 3.987.329 5.86 1.029a15.077 15.077 0 0 1 9.937 14.128"/></svg>';
4
+ defineCustomElement('sinch-logo-sinch-icon-wordmark', createLogoClass(templateHTML));
@@ -0,0 +1,9 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ export declare type TSinchLogoElement = HTMLElement & {
3
+ size: number;
4
+ inverted: boolean;
5
+ };
6
+ export declare type TSinchLogoReact = TSinchElementReact<TSinchLogoElement> & {
7
+ size?: number;
8
+ inverted?: boolean;
9
+ };
package/logo/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@nectary/components",
3
+ "version": "0.8.0",
4
+ "files": [
5
+ "theme.css",
6
+ "**/*/*.js",
7
+ "**/*/*.d.ts",
8
+ "utils.js",
9
+ "utils.d.ts",
10
+ "index.js",
11
+ "index.d.ts",
12
+ "types.d.ts"
13
+ ],
14
+ "scripts": {
15
+ "prebuild": "rimraf utils.{js,d.ts} index.{js,d.ts} */*.{js,d.ts} */**/*.{js,d.ts}",
16
+ "build": "NODE_ENV=production babel . --extensions '.ts' --ignore '*.d.ts' --out-dir .",
17
+ "postbuild": "tsc"
18
+ },
19
+ "dependencies": {
20
+ "@babel/runtime": "^7.17.0"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/cli": "^7.17.0",
24
+ "@babel/core": "^7.17.0",
25
+ "@babel/plugin-transform-runtime": "^7.17.0",
26
+ "@babel/preset-env": "^7.16.0",
27
+ "@babel/preset-typescript": "^7.16.0",
28
+ "@types/node": "^17.0.14",
29
+ "@types/react": "^17.0.0",
30
+ "babel-plugin-transform-inline-environment-variables": "^0.4.3",
31
+ "rimraf": "^3.0.2",
32
+ "typescript": "^4.4.2"
33
+ }
34
+ }
@@ -0,0 +1,19 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ import type { SyntheticEvent } from 'react';
3
+ export declare type TSinchRadioElement = HTMLElement & {
4
+ value: string;
5
+ };
6
+ export declare type TSinchRadioReact = TSinchElementReact<TSinchRadioElement> & {
7
+ value: string;
8
+ onChange: (event: SyntheticEvent<TSinchRadioElement, CustomEvent<boolean>>) => void;
9
+ };
10
+ declare global {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ 'sinch-radio': TSinchRadioReact;
14
+ }
15
+ }
16
+ interface HTMLElementTagNameMap {
17
+ 'sinch-radio': TSinchRadioElement;
18
+ }
19
+ }
package/radio/index.js ADDED
@@ -0,0 +1,185 @@
1
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
2
+ import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
3
+
4
+ var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange;
5
+
6
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
7
+
8
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
+
10
+ import { isRadioOptionElement } from '../radio-option';
11
+ import { defineCustomElement, getAttribute, updateAttribute } from '../utils';
12
+ const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;gap:8px;box-sizing:border-box;width:100%}</style><div id="wrapper"><slot></slot></div>';
13
+
14
+ const getEnabledRadioElements = $slot => {
15
+ return $slot.assignedElements().filter(opt => isRadioOptionElement(opt) && opt.disabled !== true);
16
+ };
17
+
18
+ const findSelectedOption = elements => {
19
+ return elements.find(el => el.checked) ?? null;
20
+ };
21
+
22
+ const getFirstOption = $slot => {
23
+ for (const $option of $slot.assignedElements()) {
24
+ if (isRadioOptionElement($option) && $option.disabled !== true) {
25
+ return $option;
26
+ }
27
+ }
28
+
29
+ return null;
30
+ };
31
+
32
+ const getLastOption = $slot => {
33
+ for (const $option of $slot.assignedElements().reverse()) {
34
+ if (isRadioOptionElement($option) && $option.disabled !== true) {
35
+ return $option;
36
+ }
37
+ }
38
+
39
+ return null;
40
+ };
41
+
42
+ const getNextOption = $slot => {
43
+ const $options = getEnabledRadioElements($slot);
44
+ const $selectedOption = findSelectedOption($options);
45
+ const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
46
+
47
+ if (currentIndex < 0) {
48
+ return getFirstOption($slot);
49
+ }
50
+
51
+ return $options[(currentIndex + 1) % $options.length];
52
+ };
53
+
54
+ const getPrevOption = $slot => {
55
+ const $options = getEnabledRadioElements($slot);
56
+ const $selectedOption = findSelectedOption($options);
57
+ const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
58
+
59
+ if (currentIndex < 0) {
60
+ return getLastOption($slot);
61
+ }
62
+
63
+ return $options[(currentIndex - 1 + $options.length) % $options.length];
64
+ };
65
+
66
+ const template = document.createElement('template');
67
+ template.innerHTML = templateHTML;
68
+ defineCustomElement('sinch-radio', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), class extends HTMLElement {
69
+ constructor() {
70
+ super();
71
+
72
+ _classPrivateFieldInitSpec(this, _$slot, {
73
+ writable: true,
74
+ value: void 0
75
+ });
76
+
77
+ _classPrivateFieldInitSpec(this, _onOptionKeyDown, {
78
+ writable: true,
79
+ value: e => {
80
+ switch (e.code) {
81
+ case 'ArrowUp':
82
+ case 'ArrowLeft':
83
+ {
84
+ e.preventDefault();
85
+ const $option = getPrevOption(_classPrivateFieldGet(this, _$slot));
86
+
87
+ if ($option !== null) {
88
+ $option.focus();
89
+ this.dispatchChangeEvent($option.value);
90
+ }
91
+
92
+ break;
93
+ }
94
+
95
+ case 'ArrowDown':
96
+ case 'ArrowRight':
97
+ {
98
+ e.preventDefault();
99
+ const $option = getNextOption(_classPrivateFieldGet(this, _$slot));
100
+
101
+ if ($option !== null) {
102
+ $option.focus();
103
+ this.dispatchChangeEvent($option.value);
104
+ }
105
+
106
+ break;
107
+ }
108
+ }
109
+ }
110
+ });
111
+
112
+ _classPrivateFieldInitSpec(this, _onSlotChange, {
113
+ writable: true,
114
+ value: () => {
115
+ this.onValueChange(this.value);
116
+ }
117
+ });
118
+
119
+ _classPrivateFieldInitSpec(this, _onOptionChange, {
120
+ writable: true,
121
+ value: e => {
122
+ e.stopPropagation();
123
+ this.dispatchChangeEvent(e.detail);
124
+ }
125
+ });
126
+
127
+ const shadowRoot = this.attachShadow({
128
+ mode: 'production' === 'development' ? 'open' : 'closed',
129
+ delegatesFocus: true
130
+ });
131
+ shadowRoot.appendChild(template.content.cloneNode(true));
132
+ shadowRoot.addEventListener('keydown', _classPrivateFieldGet(this, _onOptionKeyDown));
133
+ shadowRoot.addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
134
+
135
+ _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
136
+
137
+ _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
138
+ }
139
+
140
+ static get observedAttributes() {
141
+ return ['value'];
142
+ }
143
+
144
+ get type() {
145
+ return 'text';
146
+ }
147
+
148
+ get nodeName() {
149
+ return 'input';
150
+ }
151
+
152
+ set value(value) {
153
+ updateAttribute(this, 'value', value);
154
+ }
155
+
156
+ get value() {
157
+ return getAttribute(this, 'value', '');
158
+ }
159
+
160
+ attributeChangedCallback(name, oldVal, newVal) {
161
+ switch (name) {
162
+ case 'value':
163
+ {
164
+ this.onValueChange(newVal ?? '');
165
+ break;
166
+ }
167
+ }
168
+ }
169
+
170
+ onValueChange(value) {
171
+ for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
172
+ if (isRadioOptionElement($option)) {
173
+ $option.checked = $option.disabled !== true && $option.value === value;
174
+ }
175
+ }
176
+ }
177
+
178
+ dispatchChangeEvent(value) {
179
+ this.dispatchEvent(new CustomEvent('change', {
180
+ detail: value,
181
+ bubbles: true
182
+ }));
183
+ }
184
+
185
+ }));