@nectary/components 0.29.1 → 0.31.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 (347) hide show
  1. package/accordion-item/types.d.ts +1 -2
  2. package/accordion-item/utils.d.ts +2 -1
  3. package/alert/index.js +1 -1
  4. package/alert/types.d.ts +1 -2
  5. package/alert/utils.d.ts +2 -1
  6. package/alert-button/index.js +1 -1
  7. package/avatar/types.d.ts +2 -3
  8. package/avatar/utils.d.ts +3 -2
  9. package/avatar-status/index.js +1 -3
  10. package/avatar-status/types.d.ts +1 -2
  11. package/avatar-status/utils.d.ts +1 -1
  12. package/button/index.js +1 -1
  13. package/button/types.d.ts +14 -2
  14. package/button/utils.d.ts +2 -1
  15. package/card/index.js +1 -1
  16. package/card-container/index.js +1 -1
  17. package/chat-bubble/types.d.ts +2 -3
  18. package/chat-bubble/utils.d.ts +3 -2
  19. package/checkbox/index.js +1 -1
  20. package/colors.json +6 -1
  21. package/date-picker/index.d.ts +19 -0
  22. package/date-picker/index.js +419 -0
  23. package/date-picker/types.d.ts +26 -0
  24. package/date-picker/utils.d.ts +32 -0
  25. package/date-picker/utils.js +145 -0
  26. package/dialog/index.js +23 -5
  27. package/dropdown-checkbox-option/index.js +1 -1
  28. package/icon-button/index.js +1 -1
  29. package/icons/create-icon-class.d.ts +1 -307
  30. package/icons/keyboard-double-arrow-left/index.d.ts +11 -0
  31. package/icons/keyboard-double-arrow-left/index.js +4 -0
  32. package/icons/keyboard-double-arrow-right/index.d.ts +11 -0
  33. package/icons/keyboard-double-arrow-right/index.js +4 -0
  34. package/icons-branded/ai/index.d.ts +11 -0
  35. package/icons-branded/ai/index.js +4 -0
  36. package/icons-branded/chat/index.d.ts +11 -0
  37. package/icons-branded/chat/index.js +4 -0
  38. package/icons-branded/create-icon-class.d.ts +1 -311
  39. package/icons-branded/custom-message/index.d.ts +11 -0
  40. package/icons-branded/custom-message/index.js +4 -0
  41. package/icons-branded/integration/index.d.ts +11 -0
  42. package/icons-branded/integration/index.js +4 -0
  43. package/icons-branded/line-chart-down/index.d.ts +11 -0
  44. package/icons-branded/line-chart-down/index.js +4 -0
  45. package/icons-branded/line-chart-up/index.d.ts +11 -0
  46. package/icons-branded/line-chart-up/index.js +4 -0
  47. package/icons-branded/mms/index.d.ts +11 -0
  48. package/icons-branded/mms/index.js +4 -0
  49. package/icons-branded/push/index.d.ts +11 -0
  50. package/icons-branded/push/index.js +4 -0
  51. package/icons-branded/rcs/index.d.ts +11 -0
  52. package/icons-branded/rcs/index.js +4 -0
  53. package/icons-branded/sms/index.d.ts +11 -0
  54. package/icons-branded/sms/index.js +4 -0
  55. package/icons-branded/time/index.d.ts +11 -0
  56. package/icons-branded/time/index.js +4 -0
  57. package/icons-channel/apple-business-chat-square/index.d.ts +11 -0
  58. package/icons-channel/apple-business-chat-square/index.js +4 -0
  59. package/icons-channel/create-icon-class.d.ts +1 -310
  60. package/icons-channel/create-icon-class.js +1 -1
  61. package/icons-channel/facebook-messenger-square/index.d.ts +11 -0
  62. package/icons-channel/facebook-messenger-square/index.js +4 -0
  63. package/icons-channel/instagram-square/index.d.ts +11 -0
  64. package/icons-channel/instagram-square/index.js +4 -0
  65. package/icons-channel/line-square/index.d.ts +11 -0
  66. package/icons-channel/line-square/index.js +4 -0
  67. package/icons-channel/talk-square/index.d.ts +11 -0
  68. package/icons-channel/talk-square/index.js +4 -0
  69. package/icons-channel/telegram-square/index.d.ts +11 -0
  70. package/icons-channel/telegram-square/index.js +4 -0
  71. package/icons-channel/twitter-square/index.d.ts +11 -0
  72. package/icons-channel/twitter-square/index.js +4 -0
  73. package/icons-channel/viber-square/index.d.ts +11 -0
  74. package/icons-channel/viber-square/index.js +4 -0
  75. package/icons-channel/wechat-square/index.d.ts +11 -0
  76. package/icons-channel/wechat-square/index.js +4 -0
  77. package/icons-channel/whatsapp-square/index.d.ts +11 -0
  78. package/icons-channel/whatsapp-square/index.js +4 -0
  79. package/illustrations/5g/index.d.ts +11 -0
  80. package/illustrations/5g/index.js +4 -0
  81. package/illustrations/about-page/index.d.ts +11 -0
  82. package/illustrations/about-page/index.js +4 -0
  83. package/illustrations/bank/index.d.ts +11 -0
  84. package/illustrations/bank/index.js +4 -0
  85. package/illustrations/boost/index.d.ts +11 -0
  86. package/illustrations/boost/index.js +4 -0
  87. package/illustrations/buildvoicebot/index.d.ts +11 -0
  88. package/illustrations/buildvoicebot/index.js +4 -0
  89. package/illustrations/call-center/index.d.ts +11 -0
  90. package/illustrations/call-center/index.js +4 -0
  91. package/illustrations/cat-texting/index.d.ts +11 -0
  92. package/illustrations/cat-texting/index.js +4 -0
  93. package/illustrations/chat-bot/index.d.ts +11 -0
  94. package/illustrations/chat-bot/index.js +4 -0
  95. package/illustrations/check/index.d.ts +11 -0
  96. package/illustrations/check/index.js +4 -0
  97. package/illustrations/code/index.d.ts +11 -0
  98. package/illustrations/code/index.js +4 -0
  99. package/illustrations/contact-us/index.d.ts +11 -0
  100. package/illustrations/contact-us/index.js +4 -0
  101. package/illustrations/contactus/index.d.ts +11 -0
  102. package/illustrations/contactus/index.js +4 -0
  103. package/illustrations/conversation-api/index.d.ts +11 -0
  104. package/illustrations/conversation-api/index.js +4 -0
  105. package/illustrations/cooking/index.d.ts +11 -0
  106. package/illustrations/cooking/index.js +4 -0
  107. package/illustrations/costumer-support/index.d.ts +11 -0
  108. package/illustrations/costumer-support/index.js +4 -0
  109. package/illustrations/create-illustration-class.d.ts +1 -0
  110. package/illustrations/create-illustration-class.js +68 -0
  111. package/illustrations/credit-card/index.d.ts +11 -0
  112. package/illustrations/credit-card/index.js +4 -0
  113. package/illustrations/credit-card-30-degrees/index.d.ts +11 -0
  114. package/illustrations/credit-card-30-degrees/index.js +4 -0
  115. package/illustrations/cute-bee/index.d.ts +11 -0
  116. package/illustrations/cute-bee/index.js +4 -0
  117. package/illustrations/decorative-flamingo/index.d.ts +11 -0
  118. package/illustrations/decorative-flamingo/index.js +4 -0
  119. package/illustrations/decorative-rainbow/index.d.ts +11 -0
  120. package/illustrations/decorative-rainbow/index.js +4 -0
  121. package/illustrations/delivery-service-package/index.d.ts +11 -0
  122. package/illustrations/delivery-service-package/index.js +4 -0
  123. package/illustrations/desktop/index.d.ts +11 -0
  124. package/illustrations/desktop/index.js +4 -0
  125. package/illustrations/document/index.d.ts +11 -0
  126. package/illustrations/document/index.js +4 -0
  127. package/illustrations/flower-hand/index.d.ts +11 -0
  128. package/illustrations/flower-hand/index.js +4 -0
  129. package/illustrations/football/index.d.ts +11 -0
  130. package/illustrations/football/index.js +4 -0
  131. package/illustrations/geometric-shapes-passing/index.d.ts +11 -0
  132. package/illustrations/geometric-shapes-passing/index.js +4 -0
  133. package/illustrations/girl-on-phone/index.d.ts +11 -0
  134. package/illustrations/girl-on-phone/index.js +4 -0
  135. package/illustrations/global-reach/index.d.ts +11 -0
  136. package/illustrations/global-reach/index.js +4 -0
  137. package/illustrations/hand-ok/index.d.ts +11 -0
  138. package/illustrations/hand-ok/index.js +4 -0
  139. package/illustrations/hands-laptop/index.d.ts +11 -0
  140. package/illustrations/hands-laptop/index.js +4 -0
  141. package/illustrations/handset-omnichannel-messages/index.d.ts +11 -0
  142. package/illustrations/handset-omnichannel-messages/index.js +4 -0
  143. package/illustrations/happy-text/index.d.ts +11 -0
  144. package/illustrations/happy-text/index.js +4 -0
  145. package/illustrations/headphones/index.d.ts +11 -0
  146. package/illustrations/headphones/index.js +4 -0
  147. package/illustrations/heart/index.d.ts +11 -0
  148. package/illustrations/heart/index.js +4 -0
  149. package/illustrations/hero-messages/index.d.ts +11 -0
  150. package/illustrations/hero-messages/index.js +4 -0
  151. package/illustrations/hero-page/index.d.ts +11 -0
  152. package/illustrations/hero-page/index.js +4 -0
  153. package/illustrations/jump/index.d.ts +11 -0
  154. package/illustrations/jump/index.js +4 -0
  155. package/illustrations/laptop-holding/index.d.ts +11 -0
  156. package/illustrations/laptop-holding/index.js +4 -0
  157. package/illustrations/laptop-sitting-verified/index.d.ts +11 -0
  158. package/illustrations/laptop-sitting-verified/index.js +4 -0
  159. package/illustrations/lightning/index.d.ts +11 -0
  160. package/illustrations/lightning/index.js +4 -0
  161. package/illustrations/lock/index.d.ts +11 -0
  162. package/illustrations/lock/index.js +4 -0
  163. package/illustrations/lying-and-looking-at-the-phone/index.d.ts +11 -0
  164. package/illustrations/lying-and-looking-at-the-phone/index.js +4 -0
  165. package/illustrations/magnifying-glass/index.d.ts +11 -0
  166. package/illustrations/magnifying-glass/index.js +4 -0
  167. package/illustrations/man-on-right/index.d.ts +11 -0
  168. package/illustrations/man-on-right/index.js +4 -0
  169. package/illustrations/meeting-scrum/index.d.ts +11 -0
  170. package/illustrations/meeting-scrum/index.js +4 -0
  171. package/illustrations/meeting-scrum-2/index.d.ts +11 -0
  172. package/illustrations/meeting-scrum-2/index.js +4 -0
  173. package/illustrations/megaphone/index.d.ts +11 -0
  174. package/illustrations/megaphone/index.js +4 -0
  175. package/illustrations/menu/index.d.ts +11 -0
  176. package/illustrations/menu/index.js +4 -0
  177. package/illustrations/message-passing/index.d.ts +11 -0
  178. package/illustrations/message-passing/index.js +4 -0
  179. package/illustrations/message-recieved/index.d.ts +11 -0
  180. package/illustrations/message-recieved/index.js +4 -0
  181. package/illustrations/messages/index.d.ts +11 -0
  182. package/illustrations/messages/index.js +4 -0
  183. package/illustrations/messages-on-yellow-bg/index.d.ts +11 -0
  184. package/illustrations/messages-on-yellow-bg/index.js +4 -0
  185. package/illustrations/messages-shopping/index.d.ts +11 -0
  186. package/illustrations/messages-shopping/index.js +4 -0
  187. package/illustrations/monitor/index.d.ts +11 -0
  188. package/illustrations/monitor/index.js +4 -0
  189. package/illustrations/numbers-passing/index.d.ts +11 -0
  190. package/illustrations/numbers-passing/index.js +4 -0
  191. package/illustrations/office-worker/index.d.ts +11 -0
  192. package/illustrations/office-worker/index.js +4 -0
  193. package/illustrations/old-person-on-phone/index.d.ts +11 -0
  194. package/illustrations/old-person-on-phone/index.js +4 -0
  195. package/illustrations/omnichannel-messaging/index.d.ts +11 -0
  196. package/illustrations/omnichannel-messaging/index.js +4 -0
  197. package/illustrations/on-the-phone/index.d.ts +11 -0
  198. package/illustrations/on-the-phone/index.js +4 -0
  199. package/illustrations/parcel-delivery/index.d.ts +11 -0
  200. package/illustrations/parcel-delivery/index.js +4 -0
  201. package/illustrations/passing-heart/index.d.ts +11 -0
  202. package/illustrations/passing-heart/index.js +4 -0
  203. package/illustrations/passing-heart-cool/index.d.ts +11 -0
  204. package/illustrations/passing-heart-cool/index.js +4 -0
  205. package/illustrations/person-on-phone/index.d.ts +11 -0
  206. package/illustrations/person-on-phone/index.js +4 -0
  207. package/illustrations/person-on-walk/index.d.ts +11 -0
  208. package/illustrations/person-on-walk/index.js +4 -0
  209. package/illustrations/person-with-dog/index.d.ts +11 -0
  210. package/illustrations/person-with-dog/index.js +4 -0
  211. package/illustrations/person-with-phone/index.d.ts +11 -0
  212. package/illustrations/person-with-phone/index.js +4 -0
  213. package/illustrations/phone-and-cat/index.js +4 -0
  214. package/illustrations/pineapple/index.d.ts +11 -0
  215. package/illustrations/pineapple/index.js +4 -0
  216. package/illustrations/pizza/index.d.ts +11 -0
  217. package/illustrations/pizza/index.js +4 -0
  218. package/illustrations/plane/index.d.ts +11 -0
  219. package/illustrations/plane/index.js +4 -0
  220. package/illustrations/presenting-charts/index.d.ts +11 -0
  221. package/illustrations/presenting-charts/index.js +4 -0
  222. package/illustrations/product-page/index.d.ts +11 -0
  223. package/illustrations/product-page/index.js +4 -0
  224. package/illustrations/product-page-2/index.d.ts +11 -0
  225. package/illustrations/product-page-2/index.js +4 -0
  226. package/illustrations/scooter/index.d.ts +11 -0
  227. package/illustrations/scooter/index.js +4 -0
  228. package/illustrations/security/index.d.ts +11 -0
  229. package/illustrations/security/index.js +4 -0
  230. package/illustrations/security-camera/index.d.ts +11 -0
  231. package/illustrations/security-camera/index.js +4 -0
  232. package/illustrations/sherlockholmes/index.d.ts +11 -0
  233. package/illustrations/sherlockholmes/index.js +4 -0
  234. package/illustrations/shoe/index.d.ts +11 -0
  235. package/illustrations/shoe/index.js +4 -0
  236. package/illustrations/shopping/index.d.ts +11 -0
  237. package/illustrations/shopping/index.js +4 -0
  238. package/illustrations/shopping-cart/index.d.ts +11 -0
  239. package/illustrations/shopping-cart/index.js +4 -0
  240. package/illustrations/sick-kid/index.d.ts +11 -0
  241. package/illustrations/sick-kid/index.js +4 -0
  242. package/illustrations/sitting-messaging/index.d.ts +11 -0
  243. package/illustrations/sitting-messaging/index.js +4 -0
  244. package/illustrations/sitting-person/index.d.ts +11 -0
  245. package/illustrations/sitting-person/index.js +4 -0
  246. package/illustrations/sitting-person-2/index.d.ts +11 -0
  247. package/illustrations/sitting-person-2/index.js +4 -0
  248. package/illustrations/sofa/index.d.ts +11 -0
  249. package/illustrations/sofa/index.js +4 -0
  250. package/illustrations/stats/index.d.ts +11 -0
  251. package/illustrations/stats/index.js +4 -0
  252. package/illustrations/support-center/index.d.ts +11 -0
  253. package/illustrations/support-center/index.js +4 -0
  254. package/illustrations/supporting-device/index.d.ts +11 -0
  255. package/illustrations/supporting-device/index.js +4 -0
  256. package/illustrations/supporting-device-2/index.d.ts +11 -0
  257. package/illustrations/supporting-device-2/index.js +4 -0
  258. package/illustrations/supporting-device-3/index.d.ts +11 -0
  259. package/illustrations/supporting-device-3/index.js +4 -0
  260. package/illustrations/supporting-device-4/index.d.ts +11 -0
  261. package/illustrations/supporting-device-4/index.js +4 -0
  262. package/illustrations/surf/index.d.ts +11 -0
  263. package/illustrations/surf/index.js +4 -0
  264. package/illustrations/taxi/index.d.ts +11 -0
  265. package/illustrations/taxi/index.js +4 -0
  266. package/illustrations/taxi-2/index.d.ts +11 -0
  267. package/illustrations/taxi-2/index.js +4 -0
  268. package/illustrations/teamwork-from-phone/index.d.ts +11 -0
  269. package/illustrations/teamwork-from-phone/index.js +4 -0
  270. package/illustrations/telemast/index.d.ts +11 -0
  271. package/illustrations/telemast/index.js +4 -0
  272. package/illustrations/texting-sitting/index.d.ts +11 -0
  273. package/illustrations/texting-sitting/index.js +4 -0
  274. package/illustrations/texting-sofa/index.d.ts +11 -0
  275. package/illustrations/texting-sofa/index.js +4 -0
  276. package/illustrations/train/index.d.ts +11 -0
  277. package/illustrations/train/index.js +4 -0
  278. package/illustrations/types.d.ts +16 -0
  279. package/illustrations/types.js +1 -0
  280. package/illustrations/utils.d.ts +3 -0
  281. package/illustrations/utils.js +2 -0
  282. package/illustrations/video-voice-call/index.d.ts +11 -0
  283. package/illustrations/video-voice-call/index.js +4 -0
  284. package/illustrations/voicebot/index.d.ts +11 -0
  285. package/illustrations/voicebot/index.js +4 -0
  286. package/illustrations/walking-on-phone/index.d.ts +11 -0
  287. package/illustrations/walking-on-phone/index.js +4 -0
  288. package/illustrations/what-tools/index.d.ts +11 -0
  289. package/illustrations/what-tools/index.js +4 -0
  290. package/illustrations/win-together/index.d.ts +11 -0
  291. package/illustrations/win-together/index.js +4 -0
  292. package/illustrations/win-together-two-people/index.d.ts +11 -0
  293. package/illustrations/win-together-two-people/index.js +4 -0
  294. package/illustrations/wizard/index.d.ts +11 -0
  295. package/illustrations/wizard/index.js +4 -0
  296. package/illustrations/woman-hand-lifted/index.d.ts +11 -0
  297. package/illustrations/woman-hand-lifted/index.js +4 -0
  298. package/illustrations/woman-on-left/index.d.ts +11 -0
  299. package/illustrations/woman-on-left/index.js +4 -0
  300. package/illustrations/woman-on-right/index.d.ts +11 -0
  301. package/illustrations/woman-on-right/index.js +4 -0
  302. package/input/index.js +1 -1
  303. package/input/types.d.ts +38 -12
  304. package/input/utils.d.ts +2 -1
  305. package/link/index.js +18 -4
  306. package/link/types.d.ts +0 -2
  307. package/logo/create-logo-class.d.ts +1 -311
  308. package/package.json +1 -1
  309. package/popover/index.js +76 -47
  310. package/popover/types.d.ts +1 -2
  311. package/popover/utils.d.ts +2 -1
  312. package/search/index.js +1 -1
  313. package/segment/index.d.ts +1 -0
  314. package/segment/index.js +109 -6
  315. package/segment/types.d.ts +4 -0
  316. package/segment/utils.d.ts +5 -0
  317. package/segment/utils.js +6 -0
  318. package/select/index.js +1 -1
  319. package/spinner/types.d.ts +1 -2
  320. package/spinner/utils.d.ts +2 -1
  321. package/table-cell/types.d.ts +4 -5
  322. package/table-cell/utils.d.ts +2 -1
  323. package/table-head-cell/types.d.ts +4 -4
  324. package/tag/index.js +1 -1
  325. package/tag/types.d.ts +1 -2
  326. package/tag/utils.d.ts +2 -1
  327. package/text/index.js +0 -1
  328. package/text/types.d.ts +1 -2
  329. package/text/utils.d.ts +1 -1
  330. package/textarea/index.js +1 -1
  331. package/theme.css +17 -0
  332. package/title/index.js +0 -2
  333. package/title/types.d.ts +2 -3
  334. package/title/utils.d.ts +4 -3
  335. package/title/utils.js +21 -0
  336. package/toggle/index.js +1 -1
  337. package/tooltip/index.js +1 -1
  338. package/tooltip/types.d.ts +1 -2
  339. package/tooltip/utils.d.ts +2 -1
  340. package/utils.d.ts +4 -0
  341. package/utils.js +35 -4
  342. package/illustration/create-illustration-class.d.ts +0 -310
  343. package/illustration/create-illustration-class.js +0 -51
  344. package/illustration/phone-and-cat/index.js +0 -4
  345. package/illustration/types.d.ts +0 -8
  346. /package/{illustration → date-picker}/types.js +0 -0
  347. /package/{illustration → illustrations}/phone-and-cat/index.d.ts +0 -0
@@ -1,311 +1 @@
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
- attachShadow(options?: Partial<ShadowRootInit> | undefined): ShadowRoot;
9
- accessKey: string;
10
- readonly accessKeyLabel: string;
11
- autocapitalize: string;
12
- dir: string;
13
- draggable: boolean;
14
- hidden: boolean;
15
- innerText: string;
16
- lang: string;
17
- readonly offsetHeight: number;
18
- readonly offsetLeft: number;
19
- readonly offsetParent: Element | null;
20
- readonly offsetTop: number;
21
- readonly offsetWidth: number;
22
- outerText: string;
23
- spellcheck: boolean;
24
- title: string;
25
- translate: boolean;
26
- attachInternals(): ElementInternals;
27
- click(): void;
28
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
29
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
30
- removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
31
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
32
- readonly attributes: NamedNodeMap;
33
- readonly classList: DOMTokenList;
34
- className: string;
35
- readonly clientHeight: number;
36
- readonly clientLeft: number;
37
- readonly clientTop: number;
38
- readonly clientWidth: number;
39
- id: string;
40
- readonly localName: string;
41
- readonly namespaceURI: string | null;
42
- onfullscreenchange: ((this: Element, ev: Event) => any) | null;
43
- onfullscreenerror: ((this: Element, ev: Event) => any) | null;
44
- outerHTML: string;
45
- readonly ownerDocument: Document;
46
- readonly part: DOMTokenList;
47
- readonly prefix: string | null;
48
- readonly scrollHeight: number;
49
- scrollLeft: number;
50
- scrollTop: number;
51
- readonly scrollWidth: number;
52
- readonly shadowRoot: ShadowRoot | null;
53
- slot: string;
54
- readonly tagName: string;
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 | null;
148
- ariaAutoComplete: string | null;
149
- ariaBusy: string | null;
150
- ariaChecked: string | null;
151
- ariaColCount: string | null;
152
- ariaColIndex: string | null;
153
- ariaColSpan: string | null;
154
- ariaCurrent: string | null;
155
- ariaDisabled: string | null;
156
- ariaExpanded: string | null;
157
- ariaHasPopup: string | null;
158
- ariaHidden: string | null;
159
- ariaKeyShortcuts: string | null;
160
- ariaLabel: string | null;
161
- ariaLevel: string | null;
162
- ariaLive: string | null;
163
- ariaModal: string | null;
164
- ariaMultiLine: string | null;
165
- ariaMultiSelectable: string | null;
166
- ariaOrientation: string | null;
167
- ariaPlaceholder: string | null;
168
- ariaPosInSet: string | null;
169
- ariaPressed: string | null;
170
- ariaReadOnly: string | null;
171
- ariaRequired: string | null;
172
- ariaRoleDescription: string | null;
173
- ariaRowCount: string | null;
174
- ariaRowIndex: string | null;
175
- ariaRowSpan: string | null;
176
- ariaSelected: string | null;
177
- ariaSetSize: string | null;
178
- ariaSort: string | null;
179
- ariaValueMax: string | null;
180
- ariaValueMin: string | null;
181
- ariaValueNow: string | null;
182
- ariaValueText: string | null;
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
- onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
277
- onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
- onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
- onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
- onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
- onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
282
- onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
- onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
- onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
285
- onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
286
- ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
287
- ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
288
- ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
289
- ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
290
- ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
291
- ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
292
- ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
293
- ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
294
- ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
295
- ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
296
- onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
- onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
- onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
- onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
300
- onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
- onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
302
- onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
303
- autofocus: boolean;
304
- readonly dataset: DOMStringMap;
305
- nonce?: string | undefined;
306
- tabIndex: number;
307
- blur(): void;
308
- focus(options?: FocusOptions | undefined): void;
309
- };
310
- readonly observedAttributes: string[];
311
- };
1
+ export declare const createLogoClass: (templateHTML: string) => CustomElementConstructor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "0.29.1",
3
+ "version": "0.31.0",
4
4
  "files": [
5
5
  "theme.css",
6
6
  "**/*/*.js",
package/popover/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
2
  import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$target, _$dialog, _isConnected, _onExpand, _onCollapse, _isOpen, _updateOrientation, _onBackdropClick, _onCancel, _onCloseReactHandler, _dispatchCloseEvent;
4
+ var _$target, _$dialog, _isConnected, _resizeThrottle, _prevOverflowValue, _onExpand, _onCollapse, _isOpen, _onResize, _updateOrientation, _onBackdropClick, _onCancel, _onCloseReactHandler, _dispatchCloseEvent;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -12,20 +12,18 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
12
12
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
13
 
14
14
  import dialogPolyfill from 'dialog-polyfill';
15
- import { defineCustomElement, getBooleanAttribute, getLiteralAttribute, getRect, isAttrTrue, updateLiteralAttribute, getReactEventHandler, updateBooleanAttribute, NectaryElement, getCssVar } from '../utils';
16
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative}dialog{position:fixed;left:0;right:0;margin:auto;outline:0;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 6px rgba(0,0,0,.15);border:1px solid var(--sinch-color-snow-500);border-radius:4px;contain:content;padding:0;box-sizing:border-box}dialog:not([open]){display:none}dialog::backdrop{background-color:transparent}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:transparent}dialog.fixed{position:fixed;top:50%;transform:translate(0,-50%)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}#target{display:flex;flex-direction:column}</style><div id="wrapper"><div id="target" aria-haspopup="dialog" aria-expanded="false"><slot name="target"></slot></div><dialog id="dialog" tabindex="-1"><slot name="content"></slot></dialog></div>';
15
+ import { defineCustomElement, getBooleanAttribute, getLiteralAttribute, getRect, isAttrTrue, updateLiteralAttribute, getReactEventHandler, updateBooleanAttribute, NectaryElement, getCssVar, throttleAnimationFrame } from '../utils';
16
+ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative}dialog{position:fixed;top:0;left:0;margin:0;outline:0;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:var(--sinch-elevation-level-2);border:1px solid var(--sinch-color-snow-500);border-radius:var(--sinch-shape-radius-s);contain:content;padding:0;box-sizing:border-box;max-width:unset;max-height:unset}dialog:not([open]){display:none}dialog::backdrop{background-color:transparent}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:transparent}dialog.fixed{position:fixed;top:50%;transform:translate(0,-50%)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}#target{display:flex;flex-direction:column}</style><div id="wrapper"><div id="target" aria-haspopup="dialog" aria-expanded="false"><slot name="target"></slot></div><dialog id="dialog" tabindex="-1"><slot name="content"></slot></dialog></div>';
17
17
  import { orientationValues } from './utils';
18
18
  const template = document.createElement('template');
19
19
  template.innerHTML = templateHTML;
20
- const POPOVER_VERTICAL_OFFSET = 4;
21
- defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new WeakMap(), _isConnected = new WeakMap(), _onExpand = new WeakSet(), _onCollapse = new WeakSet(), _isOpen = new WeakSet(), _updateOrientation = new WeakSet(), _onBackdropClick = new WeakMap(), _onCancel = new WeakMap(), _onCloseReactHandler = new WeakMap(), _dispatchCloseEvent = new WeakSet(), class extends NectaryElement {
20
+ const POPOVER_OFFSET = 4;
21
+ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new WeakMap(), _isConnected = new WeakMap(), _resizeThrottle = new WeakMap(), _prevOverflowValue = new WeakMap(), _onExpand = new WeakSet(), _onCollapse = new WeakSet(), _isOpen = new WeakSet(), _onResize = new WeakMap(), _updateOrientation = new WeakMap(), _onBackdropClick = new WeakMap(), _onCancel = new WeakMap(), _onCloseReactHandler = new WeakMap(), _dispatchCloseEvent = new WeakSet(), class extends NectaryElement {
22
22
  constructor() {
23
23
  super();
24
24
 
25
25
  _classPrivateMethodInitSpec(this, _dispatchCloseEvent);
26
26
 
27
- _classPrivateMethodInitSpec(this, _updateOrientation);
28
-
29
27
  _classPrivateMethodInitSpec(this, _isOpen);
30
28
 
31
29
  _classPrivateMethodInitSpec(this, _onCollapse);
@@ -44,7 +42,62 @@ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new W
44
42
 
45
43
  _classPrivateFieldInitSpec(this, _isConnected, {
46
44
  writable: true,
47
- value: false
45
+ value: void 0
46
+ });
47
+
48
+ _classPrivateFieldInitSpec(this, _resizeThrottle, {
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+
53
+ _classPrivateFieldInitSpec(this, _prevOverflowValue, {
54
+ writable: true,
55
+ value: ''
56
+ });
57
+
58
+ _classPrivateFieldInitSpec(this, _onResize, {
59
+ writable: true,
60
+ value: () => {
61
+ _classPrivateFieldGet(this, _resizeThrottle).fn();
62
+ }
63
+ });
64
+
65
+ _classPrivateFieldInitSpec(this, _updateOrientation, {
66
+ writable: true,
67
+ value: () => {
68
+ _classPrivateFieldGet(this, _$dialog).style.width = 'fit-content';
69
+
70
+ const targetRect = _classPrivateFieldGet(this, _$target).getBoundingClientRect();
71
+
72
+ const modalRect = _classPrivateFieldGet(this, _$dialog).getBoundingClientRect();
73
+
74
+ let leftPos = 0;
75
+ let topPos = 0;
76
+ const orient = this.orientation;
77
+ const shouldExpandWidthToTarget = getCssVar(this, '--sinch-popover-expand-width') !== null;
78
+ const largestWidth = Math.max(modalRect.width, targetRect.width);
79
+ const resultWidth = shouldExpandWidthToTarget ? largestWidth : modalRect.width;
80
+
81
+ if (orient === 'bottom-right' || orient === 'top-right') {
82
+ leftPos = Math.max(POPOVER_OFFSET, Math.min(targetRect.x, window.innerWidth - resultWidth - POPOVER_OFFSET));
83
+ }
84
+
85
+ if (orient === 'bottom-left' || orient === 'top-left') {
86
+ leftPos = Math.max(POPOVER_OFFSET, targetRect.right - resultWidth);
87
+ }
88
+
89
+ if (orient === 'bottom-left' || orient === 'bottom-right') {
90
+ topPos = Math.max(POPOVER_OFFSET, Math.min(targetRect.bottom + POPOVER_OFFSET, window.innerHeight - modalRect.height - POPOVER_OFFSET));
91
+ }
92
+
93
+ if (orient === 'top-left' || orient === 'top-right') {
94
+ topPos = Math.max(POPOVER_OFFSET, targetRect.top - POPOVER_OFFSET - modalRect.height);
95
+ }
96
+
97
+ _classPrivateFieldGet(this, _$dialog).style.left = `${leftPos}px`;
98
+ _classPrivateFieldGet(this, _$dialog).style.top = `${topPos}px`;
99
+ _classPrivateFieldGet(this, _$dialog).style.width = `${resultWidth}px`;
100
+ }
48
101
  });
49
102
 
50
103
  _classPrivateFieldInitSpec(this, _onBackdropClick, {
@@ -58,6 +111,8 @@ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new W
58
111
  const isInside = e.x >= rect.x && e.x < rect.x + rect.width && e.y >= rect.y && e.y < rect.y + rect.height;
59
112
 
60
113
  if (!isInside) {
114
+ e.stopPropagation();
115
+
61
116
  _classPrivateMethodGet(this, _dispatchCloseEvent, _dispatchCloseEvent2).call(this);
62
117
  }
63
118
  }
@@ -86,6 +141,10 @@ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new W
86
141
 
87
142
  _classPrivateFieldSet(this, _$dialog, shadowRoot.querySelector('#dialog'));
88
143
 
144
+ _classPrivateFieldSet(this, _isConnected, false);
145
+
146
+ _classPrivateFieldSet(this, _resizeThrottle, throttleAnimationFrame(_classPrivateFieldGet(this, _updateOrientation)));
147
+
89
148
  dialogPolyfill.registerDialog(_classPrivateFieldGet(this, _$dialog));
90
149
  }
91
150
 
@@ -159,7 +218,7 @@ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new W
159
218
  case 'orientation':
160
219
  {
161
220
  if (_classPrivateMethodGet(this, _isOpen, _isOpen2).call(this)) {
162
- _classPrivateMethodGet(this, _updateOrientation, _updateOrientation2).call(this);
221
+ _classPrivateFieldGet(this, _updateOrientation).call(this);
163
222
  }
164
223
 
165
224
  break;
@@ -178,9 +237,12 @@ function _onExpand2() {
178
237
 
179
238
  _classPrivateFieldGet(this, _$dialog).showModal();
180
239
 
181
- _classPrivateMethodGet(this, _updateOrientation, _updateOrientation2).call(this);
240
+ _classPrivateFieldGet(this, _updateOrientation).call(this);
241
+
242
+ _classPrivateFieldSet(this, _prevOverflowValue, document.body.style.overflow);
182
243
 
183
244
  document.body.style.overflow = 'hidden';
245
+ window.addEventListener('resize', _classPrivateFieldGet(this, _onResize));
184
246
  }
185
247
 
186
248
  function _onCollapse2() {
@@ -191,49 +253,16 @@ function _onCollapse2() {
191
253
  _classPrivateFieldGet(this, _$target).setAttribute('aria-expanded', 'false');
192
254
 
193
255
  _classPrivateFieldGet(this, _$dialog).close?.();
194
- document.body.style.overflow = '';
256
+ document.body.style.overflow = _classPrivateFieldGet(this, _prevOverflowValue);
257
+ window.removeEventListener('resize', _classPrivateFieldGet(this, _onResize));
258
+
259
+ _classPrivateFieldGet(this, _resizeThrottle).cancel();
195
260
  }
196
261
 
197
262
  function _isOpen2() {
198
263
  return _classPrivateFieldGet(this, _isConnected) && getBooleanAttribute(_classPrivateFieldGet(this, _$dialog), 'open');
199
264
  }
200
265
 
201
- function _updateOrientation2() {
202
- _classPrivateFieldGet(this, _$dialog).style.transform = 'initial';
203
- _classPrivateFieldGet(this, _$dialog).style.width = 'fit-content';
204
-
205
- const targetRect = _classPrivateFieldGet(this, _$target).getBoundingClientRect();
206
-
207
- const modalRect = _classPrivateFieldGet(this, _$dialog).getBoundingClientRect();
208
-
209
- let leftOffset = 0;
210
- let topOffset = 0;
211
- const orient = this.orientation;
212
- const shouldExpandWidthToTarget = getCssVar(this, '--sinch-popover-expand-width') !== null;
213
- const largestWidth = Math.max(modalRect.width, targetRect.width);
214
- const widthDiff = shouldExpandWidthToTarget ? Math.max(largestWidth - modalRect.width, 0) * 0.5 : 0;
215
- const resultWidth = shouldExpandWidthToTarget ? largestWidth : modalRect.width;
216
-
217
- if (orient === 'bottom-right' || orient === 'top-right') {
218
- leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, targetRect.x - modalRect.x) + widthDiff);
219
- }
220
-
221
- if (orient === 'bottom-left' || orient === 'top-left') {
222
- leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, targetRect.x + targetRect.width - modalRect.x - modalRect.width) - widthDiff);
223
- }
224
-
225
- if (orient === 'bottom-left' || orient === 'bottom-right') {
226
- topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, targetRect.y + targetRect.height - modalRect.y + POPOVER_VERTICAL_OFFSET));
227
- }
228
-
229
- if (orient === 'top-left' || orient === 'top-right') {
230
- topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, targetRect.y - modalRect.y - modalRect.height - POPOVER_VERTICAL_OFFSET));
231
- }
232
-
233
- _classPrivateFieldGet(this, _$dialog).style.transform = `translate(${leftOffset}px, ${topOffset}px)`;
234
- _classPrivateFieldGet(this, _$dialog).style.width = `${resultWidth}px`;
235
- }
236
-
237
266
  function _dispatchCloseEvent2() {
238
267
  this.dispatchEvent(new CustomEvent('close', {
239
268
  bubbles: true
@@ -1,7 +1,6 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
- import type { orientationValues } from './utils';
3
2
  import type { SyntheticEvent } from 'react';
4
- export declare type TSinchPopoverOrientation = typeof orientationValues[number];
3
+ export declare type TSinchPopoverOrientation = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
5
4
  export declare type TSinchPopoverElement = HTMLElement & {
6
5
  open: boolean;
7
6
  orientation: TSinchPopoverOrientation;
@@ -1 +1,2 @@
1
- export declare const orientationValues: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
1
+ import type { TSinchPopoverOrientation } from './types';
2
+ export declare const orientationValues: readonly TSinchPopoverOrientation[];
package/search/index.js CHANGED
@@ -12,7 +12,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
12
12
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
13
 
14
14
  import { attrValueToPixels, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getRect, NectaryElement, updateAttribute, updateBooleanAttribute, updateIntegerAttribute } from '../utils';
15
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:4px;width:100%;height:48px;padding:0 44px;padding-right:12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 4px rgba(0,0,0,.15);overflow-y:auto}:host([aria-expanded=true]) #listbox{display:block}:host([label]:not([label=""])) #label{display:block}</style><label id="label" for="input"></label><div id="wrapper"><input id="input" type="text"/><sinch-icon-search id="icon-search"></sinch-icon-search><sinch-icon-button id="clear" small><sinch-icon-close id="icon-close" slot="icon"></sinch-icon-close></sinch-icon-button><div id="listbox"><slot name="option"></slot></div></div>';
15
+ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:var(--sinch-shape-radius-s);width:100%;height:48px;padding:0 44px;padding-right:12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:var(--sinch-elevation-level-2);overflow-y:auto}:host([aria-expanded=true]) #listbox{display:block}:host([label]:not([label=""])) #label{display:block}</style><label id="label" for="input"></label><div id="wrapper"><input id="input" type="text"/><sinch-icon-search id="icon-search"></sinch-icon-search><sinch-icon-button id="clear" small><sinch-icon-close id="icon-close" slot="icon"></sinch-icon-close></sinch-icon-button><div id="listbox"><slot name="option"></slot></div></div>';
16
16
  import '../icons/search';
17
17
  import '../icons/close';
18
18
  import '../icon-button';
@@ -1,3 +1,4 @@
1
+ import '../title';
1
2
  import type { TSinchSegmentElement, TSinchSegmentReact } from './types';
2
3
  declare global {
3
4
  namespace JSX {