@nectary/components 0.27.0 → 0.28.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/index.d.ts +1 -24
  2. package/accordion-item/index.js +1 -1
  3. package/accordion-item/types.d.ts +23 -0
  4. package/accordion-item/types.js +1 -0
  5. package/accordion-item/utils.d.ts +1 -0
  6. package/accordion-item/utils.js +1 -0
  7. package/action-menu/index.d.ts +29 -0
  8. package/action-menu/index.js +274 -0
  9. package/action-menu-option/index.d.ts +11 -0
  10. package/action-menu-option/index.js +95 -0
  11. package/action-menu-option/types.d.ts +17 -0
  12. package/action-menu-option/types.js +1 -0
  13. package/button/index.js +1 -1
  14. package/chat-block/index.d.ts +1 -1
  15. package/chat-bubble/index.d.ts +1 -15
  16. package/chat-bubble/index.js +1 -2
  17. package/chat-bubble/types.d.ts +13 -0
  18. package/chat-bubble/types.js +1 -0
  19. package/chat-bubble/utils.d.ts +1 -0
  20. package/chat-bubble/utils.js +2 -1
  21. package/dropdown/index.d.ts +2 -27
  22. package/dropdown/index.js +2 -1
  23. package/dropdown/types.d.ts +25 -0
  24. package/dropdown/types.js +1 -0
  25. package/dropdown-checkbox-option/index.d.ts +1 -14
  26. package/dropdown-checkbox-option/types.d.ts +14 -0
  27. package/dropdown-checkbox-option/types.js +1 -0
  28. package/dropdown-radio-option/index.d.ts +1 -14
  29. package/dropdown-radio-option/types.d.ts +14 -0
  30. package/dropdown-radio-option/types.js +1 -0
  31. package/dropdown-text-option/index.d.ts +1 -15
  32. package/dropdown-text-option/types.d.ts +15 -0
  33. package/dropdown-text-option/types.js +1 -0
  34. package/grid/index.d.ts +0 -1
  35. package/grid/index.js +0 -1
  36. package/grid-item/index.d.ts +3 -15
  37. package/grid-item/types.d.ts +13 -0
  38. package/grid-item/types.js +1 -0
  39. package/help-tooltip/index.d.ts +1 -1
  40. package/icons/access-alarm/index.d.ts +11 -0
  41. package/icons/access-alarm/index.js +4 -0
  42. package/icons/access-alarms/index.d.ts +11 -0
  43. package/icons/access-alarms/index.js +4 -0
  44. package/icons/ad-units/index.d.ts +11 -0
  45. package/icons/ad-units/index.js +4 -0
  46. package/icons/add-alarm/index.d.ts +11 -0
  47. package/icons/add-alarm/index.js +4 -0
  48. package/icons/add-ic-call/index.d.ts +11 -0
  49. package/icons/add-ic-call/index.js +4 -0
  50. package/icons/add-to-home-screen/index.d.ts +11 -0
  51. package/icons/add-to-home-screen/index.js +4 -0
  52. package/icons/admin-panel-settings/index.js +1 -1
  53. package/icons/airplanemode-active/index.d.ts +11 -0
  54. package/icons/airplanemode-active/index.js +4 -0
  55. package/icons/airplanemode-inactive/index.d.ts +11 -0
  56. package/icons/airplanemode-inactive/index.js +4 -0
  57. package/icons/alternate-email/index.d.ts +11 -0
  58. package/icons/alternate-email/index.js +4 -0
  59. package/icons/app-blocking/index.js +1 -1
  60. package/icons/arrow-left/index.js +1 -1
  61. package/icons/attach-email/index.js +1 -1
  62. package/icons/attribution/index.js +1 -1
  63. package/icons/backup-table/index.js +1 -1
  64. package/icons/battery-alert/index.d.ts +11 -0
  65. package/icons/battery-alert/index.js +4 -0
  66. package/icons/battery-charging-full/index.d.ts +11 -0
  67. package/icons/battery-charging-full/index.js +4 -0
  68. package/icons/battery-full/index.d.ts +11 -0
  69. package/icons/battery-full/index.js +4 -0
  70. package/icons/battery-std/index.d.ts +11 -0
  71. package/icons/battery-std/index.js +4 -0
  72. package/icons/battery-unknown/index.d.ts +11 -0
  73. package/icons/battery-unknown/index.js +4 -0
  74. package/icons/biotech/index.js +1 -1
  75. package/icons/bluetooth/index.d.ts +11 -0
  76. package/icons/bluetooth/index.js +4 -0
  77. package/icons/bluetooth-connected/index.d.ts +11 -0
  78. package/icons/bluetooth-connected/index.js +4 -0
  79. package/icons/bluetooth-disabled/index.d.ts +11 -0
  80. package/icons/bluetooth-disabled/index.js +4 -0
  81. package/icons/bluetooth-searching/index.d.ts +11 -0
  82. package/icons/bluetooth-searching/index.js +4 -0
  83. package/icons/brightness-auto/index.d.ts +11 -0
  84. package/icons/brightness-auto/index.js +4 -0
  85. package/icons/brightness-high/index.d.ts +11 -0
  86. package/icons/brightness-high/index.js +4 -0
  87. package/icons/brightness-low/index.d.ts +11 -0
  88. package/icons/brightness-low/index.js +4 -0
  89. package/icons/brightness-medium/index.d.ts +11 -0
  90. package/icons/brightness-medium/index.js +4 -0
  91. package/icons/business/index.d.ts +11 -0
  92. package/icons/business/index.js +4 -0
  93. package/icons/call/index.d.ts +11 -0
  94. package/icons/call/index.js +4 -0
  95. package/icons/call-end/index.d.ts +11 -0
  96. package/icons/call-end/index.js +4 -0
  97. package/icons/call-made/index.d.ts +11 -0
  98. package/icons/call-made/index.js +4 -0
  99. package/icons/call-merge/index.d.ts +11 -0
  100. package/icons/call-merge/index.js +4 -0
  101. package/icons/call-missed/index.d.ts +11 -0
  102. package/icons/call-missed/index.js +4 -0
  103. package/icons/call-missed-outgoing/index.d.ts +11 -0
  104. package/icons/call-missed-outgoing/index.js +4 -0
  105. package/icons/call-received/index.d.ts +11 -0
  106. package/icons/call-received/index.js +4 -0
  107. package/icons/call-split/index.d.ts +11 -0
  108. package/icons/call-split/index.js +4 -0
  109. package/icons/cancel-presentation/index.d.ts +11 -0
  110. package/icons/cancel-presentation/index.js +4 -0
  111. package/icons/chat-bubble/index.d.ts +11 -0
  112. package/icons/chat-bubble/index.js +4 -0
  113. package/icons/clear-all/index.d.ts +11 -0
  114. package/icons/clear-all/index.js +4 -0
  115. package/icons/contact-mail/index.d.ts +11 -0
  116. package/icons/contact-mail/index.js +4 -0
  117. package/icons/contact-phone/index.d.ts +11 -0
  118. package/icons/contact-phone/index.js +4 -0
  119. package/icons/contacts/index.d.ts +11 -0
  120. package/icons/contacts/index.js +4 -0
  121. package/icons/data-usage/index.d.ts +11 -0
  122. package/icons/data-usage/index.js +4 -0
  123. package/icons/desktop-access-disabled/index.d.ts +11 -0
  124. package/icons/desktop-access-disabled/index.js +4 -0
  125. package/icons/developer-mode/index.d.ts +11 -0
  126. package/icons/developer-mode/index.js +4 -0
  127. package/icons/devices/index.d.ts +11 -0
  128. package/icons/devices/index.js +4 -0
  129. package/icons/dialer-sip/index.d.ts +11 -0
  130. package/icons/dialer-sip/index.js +4 -0
  131. package/icons/dialpad/index.d.ts +11 -0
  132. package/icons/dialpad/index.js +4 -0
  133. package/icons/domain-disabled/index.d.ts +11 -0
  134. package/icons/domain-disabled/index.js +4 -0
  135. package/icons/domain-verification/index.d.ts +11 -0
  136. package/icons/domain-verification/index.js +4 -0
  137. package/icons/double-arrow/index.js +1 -1
  138. package/icons/duo/index.d.ts +11 -0
  139. package/icons/duo/index.js +4 -0
  140. package/icons/dvr/index.d.ts +11 -0
  141. package/icons/dvr/index.js +4 -0
  142. package/icons/dynamic-feed/index.js +1 -1
  143. package/icons/email/index.d.ts +11 -0
  144. package/icons/email/index.js +4 -0
  145. package/icons/forward-to-inbox/index.d.ts +11 -0
  146. package/icons/forward-to-inbox/index.js +4 -0
  147. package/icons/gps-fixed/index.d.ts +11 -0
  148. package/icons/gps-fixed/index.js +4 -0
  149. package/icons/gps-not-fixed/index.d.ts +11 -0
  150. package/icons/gps-not-fixed/index.js +4 -0
  151. package/icons/gps-off/index.d.ts +11 -0
  152. package/icons/gps-off/index.js +4 -0
  153. package/icons/graphic-eq/index.d.ts +11 -0
  154. package/icons/graphic-eq/index.js +4 -0
  155. package/icons/home-work/index.js +1 -1
  156. package/icons/hourglass-bottom/index.d.ts +11 -0
  157. package/icons/hourglass-bottom/index.js +4 -0
  158. package/icons/hourglass-top/index.d.ts +11 -0
  159. package/icons/hourglass-top/index.js +4 -0
  160. package/icons/import-contacts/index.d.ts +11 -0
  161. package/icons/import-contacts/index.js +4 -0
  162. package/icons/import-export/index.d.ts +11 -0
  163. package/icons/import-export/index.js +4 -0
  164. package/icons/insights/index.js +1 -1
  165. package/icons/invert-colors-off/index.d.ts +11 -0
  166. package/icons/invert-colors-off/index.js +4 -0
  167. package/icons/list-alt/index.d.ts +11 -0
  168. package/icons/list-alt/index.js +4 -0
  169. package/icons/live-help/index.d.ts +11 -0
  170. package/icons/live-help/index.js +4 -0
  171. package/icons/location-disabled/index.d.ts +11 -0
  172. package/icons/location-disabled/index.js +4 -0
  173. package/icons/location-off/index.d.ts +11 -0
  174. package/icons/location-off/index.js +4 -0
  175. package/icons/location-on/index.d.ts +11 -0
  176. package/icons/location-on/index.js +4 -0
  177. package/icons/location-searching/index.d.ts +11 -0
  178. package/icons/location-searching/index.js +4 -0
  179. package/icons/logout/index.js +1 -1
  180. package/icons/mail-outline/index.d.ts +11 -0
  181. package/icons/mail-outline/index.js +4 -0
  182. package/icons/mark-email-read/index.d.ts +11 -0
  183. package/icons/mark-email-read/index.js +4 -0
  184. package/icons/mark-email-unread/index.d.ts +11 -0
  185. package/icons/mark-email-unread/index.js +4 -0
  186. package/icons/message/index.d.ts +11 -0
  187. package/icons/message/index.js +4 -0
  188. package/icons/mobile-friendly/index.d.ts +11 -0
  189. package/icons/mobile-friendly/index.js +4 -0
  190. package/icons/mobile-off/index.d.ts +11 -0
  191. package/icons/mobile-off/index.js +4 -0
  192. package/icons/mobile-screen-share/index.d.ts +11 -0
  193. package/icons/mobile-screen-share/index.js +4 -0
  194. package/icons/more-time/index.js +1 -1
  195. package/icons/nat/index.d.ts +11 -0
  196. package/icons/nat/index.js +4 -0
  197. package/icons/nfc/index.d.ts +11 -0
  198. package/icons/nfc/index.js +4 -0
  199. package/icons/no-sim/index.d.ts +11 -0
  200. package/icons/no-sim/index.js +4 -0
  201. package/icons/pause-presentation/index.d.ts +11 -0
  202. package/icons/pause-presentation/index.js +4 -0
  203. package/icons/person-add-disabled/index.d.ts +11 -0
  204. package/icons/person-add-disabled/index.js +4 -0
  205. package/icons/person-search/index.d.ts +11 -0
  206. package/icons/person-search/index.js +4 -0
  207. package/icons/phone/index.d.ts +11 -0
  208. package/icons/phone/index.js +4 -0
  209. package/icons/phone-disabled/index.d.ts +11 -0
  210. package/icons/phone-disabled/index.js +4 -0
  211. package/icons/phone-enabled/index.d.ts +11 -0
  212. package/icons/phone-enabled/index.js +4 -0
  213. package/icons/phonelink-erase/index.d.ts +11 -0
  214. package/icons/phonelink-erase/index.js +4 -0
  215. package/icons/phonelink-lock/index.d.ts +11 -0
  216. package/icons/phonelink-lock/index.js +4 -0
  217. package/icons/phonelink-ring/index.d.ts +11 -0
  218. package/icons/phonelink-ring/index.js +4 -0
  219. package/icons/phonelink-setup/index.d.ts +11 -0
  220. package/icons/phonelink-setup/index.js +4 -0
  221. package/icons/plagiarism/index.js +1 -1
  222. package/icons/policy/index.js +1 -1
  223. package/icons/portable-wifi-off/index.d.ts +11 -0
  224. package/icons/portable-wifi-off/index.js +4 -0
  225. package/icons/post-add/index.js +1 -1
  226. package/icons/present-to-all/index.d.ts +11 -0
  227. package/icons/present-to-all/index.js +4 -0
  228. package/icons/print-disabled/index.d.ts +11 -0
  229. package/icons/print-disabled/index.js +4 -0
  230. package/icons/qr-code/index.d.ts +11 -0
  231. package/icons/qr-code/index.js +4 -0
  232. package/icons/qr-code-scanner/index.d.ts +11 -0
  233. package/icons/qr-code-scanner/index.js +4 -0
  234. package/icons/quickreply/index.js +1 -1
  235. package/icons/read-more/index.d.ts +11 -0
  236. package/icons/read-more/index.js +4 -0
  237. package/icons/report-outline/index.js +1 -1
  238. package/icons/ring-volume/index.d.ts +11 -0
  239. package/icons/ring-volume/index.js +4 -0
  240. package/icons/rss-feed/index.d.ts +11 -0
  241. package/icons/rss-feed/index.js +4 -0
  242. package/icons/screen-lock-landscape/index.d.ts +11 -0
  243. package/icons/screen-lock-landscape/index.js +4 -0
  244. package/icons/screen-lock-portrait/index.d.ts +11 -0
  245. package/icons/screen-lock-portrait/index.js +4 -0
  246. package/icons/screen-lock-rotation/index.d.ts +11 -0
  247. package/icons/screen-lock-rotation/index.js +4 -0
  248. package/icons/screen-rotation/index.d.ts +11 -0
  249. package/icons/screen-rotation/index.js +4 -0
  250. package/icons/screen-share/index.d.ts +11 -0
  251. package/icons/screen-share/index.js +4 -0
  252. package/icons/sd-storage/index.d.ts +11 -0
  253. package/icons/sd-storage/index.js +4 -0
  254. package/icons/search-off/index.js +1 -1
  255. package/icons/sentiment-satisfied-alt/index.d.ts +11 -0
  256. package/icons/sentiment-satisfied-alt/index.js +4 -0
  257. package/icons/settings-system-daydream/index.d.ts +11 -0
  258. package/icons/settings-system-daydream/index.js +4 -0
  259. package/icons/signal-cellular-4-bar/index.d.ts +11 -0
  260. package/icons/signal-cellular-4-bar/index.js +4 -0
  261. package/icons/signal-cellular-alt/index.d.ts +11 -0
  262. package/icons/signal-cellular-alt/index.js +4 -0
  263. package/icons/signal-cellular-connected-no-internet-4-bar/index.d.ts +11 -0
  264. package/icons/signal-cellular-connected-no-internet-4-bar/index.js +4 -0
  265. package/icons/signal-cellular-no-sim/index.d.ts +11 -0
  266. package/icons/signal-cellular-no-sim/index.js +4 -0
  267. package/icons/signal-cellular-null/index.d.ts +11 -0
  268. package/icons/signal-cellular-null/index.js +4 -0
  269. package/icons/signal-cellular-off/index.d.ts +11 -0
  270. package/icons/signal-cellular-off/index.js +4 -0
  271. package/icons/signal-wifi-4-bar/index.d.ts +11 -0
  272. package/icons/signal-wifi-4-bar/index.js +4 -0
  273. package/icons/signal-wifi-4-bar-lock/index.d.ts +11 -0
  274. package/icons/signal-wifi-4-bar-lock/index.js +4 -0
  275. package/icons/signal-wifi-off/index.d.ts +11 -0
  276. package/icons/signal-wifi-off/index.js +4 -0
  277. package/icons/speaker-phone/index.d.ts +11 -0
  278. package/icons/speaker-phone/index.js +4 -0
  279. package/icons/stay-current-landscape/index.d.ts +11 -0
  280. package/icons/stay-current-landscape/index.js +4 -0
  281. package/icons/stay-current-portrait/index.d.ts +11 -0
  282. package/icons/stay-current-portrait/index.js +4 -0
  283. package/icons/stay-primary-landscape/index.d.ts +11 -0
  284. package/icons/stay-primary-landscape/index.js +4 -0
  285. package/icons/stay-primary-portrait/index.d.ts +11 -0
  286. package/icons/stay-primary-portrait/index.js +4 -0
  287. package/icons/stop-screen-share/index.d.ts +11 -0
  288. package/icons/stop-screen-share/index.js +4 -0
  289. package/icons/storage/index.d.ts +11 -0
  290. package/icons/storage/index.js +4 -0
  291. package/icons/swap-calls/index.d.ts +11 -0
  292. package/icons/swap-calls/index.js +4 -0
  293. package/icons/switch-left/index.js +1 -1
  294. package/icons/switch-right/index.js +1 -1
  295. package/icons/textsms/index.d.ts +11 -0
  296. package/icons/textsms/index.js +4 -0
  297. package/icons/thermostat/index.d.ts +11 -0
  298. package/icons/thermostat/index.js +4 -0
  299. package/icons/unsubscribe/index.d.ts +11 -0
  300. package/icons/unsubscribe/index.js +4 -0
  301. package/icons/usb/index.d.ts +11 -0
  302. package/icons/usb/index.js +4 -0
  303. package/icons/voicemail/index.d.ts +11 -0
  304. package/icons/voicemail/index.js +4 -0
  305. package/icons/vpn-key/index.d.ts +11 -0
  306. package/icons/vpn-key/index.js +4 -0
  307. package/icons/wallpaper/index.d.ts +11 -0
  308. package/icons/wallpaper/index.js +4 -0
  309. package/icons/widgets/index.d.ts +11 -0
  310. package/icons/widgets/index.js +4 -0
  311. package/icons/wifi-calling/index.d.ts +11 -0
  312. package/icons/wifi-calling/index.js +4 -0
  313. package/icons/wifi-lock/index.d.ts +11 -0
  314. package/icons/wifi-lock/index.js +4 -0
  315. package/icons/wifi-tethering/index.d.ts +11 -0
  316. package/icons/wifi-tethering/index.js +4 -0
  317. package/package.json +1 -3
  318. package/popover/index.d.ts +1 -2
  319. package/popover/index.js +5 -1
  320. package/popover/utils.d.ts +1 -0
  321. package/popover/utils.js +1 -0
  322. package/radio-option/index.d.ts +1 -19
  323. package/radio-option/index.js +0 -3
  324. package/radio-option/types.d.ts +18 -0
  325. package/radio-option/types.js +1 -0
  326. package/search-option/index.d.ts +1 -10
  327. package/search-option/index.js +4 -10
  328. package/search-option/types.d.ts +9 -0
  329. package/search-option/types.js +1 -0
  330. package/select-option/index.d.ts +1 -3
  331. package/select-option/types.d.ts +3 -0
  332. package/select-option/types.js +1 -0
  333. package/table/index.js +1 -1
  334. package/table-cell/index.js +1 -1
  335. package/table-head-cell/index.js +1 -1
  336. package/tabs-option/index.d.ts +1 -19
  337. package/tabs-option/index.js +0 -3
  338. package/tabs-option/types.d.ts +18 -0
  339. package/tabs-option/types.js +1 -0
  340. package/tooltip/index.d.ts +1 -17
  341. package/tooltip/index.js +1 -1
  342. package/tooltip/types.d.ts +16 -0
  343. package/tooltip/types.js +1 -0
  344. package/tooltip/utils.d.ts +1 -0
  345. package/tooltip/utils.js +1 -0
  346. package/index.d.ts +0 -649
  347. package/index.js +0 -649
@@ -1,27 +1,5 @@
1
1
  import '../icons/keyboard-arrow-down';
2
- import type { TSinchElementReact } from '../types';
3
- import type { FocusEvent } from 'react';
4
- declare const statusValues: readonly ["info", "success", "warn", "error"];
5
- export declare type TSinchAccordionStatusType = typeof statusValues[number];
6
- export declare type TSinchAccordionItemElement = HTMLElement & {
7
- value: string;
8
- label: string;
9
- optionalText: string | null;
10
- disabled: boolean;
11
- checked: boolean;
12
- status: TSinchAccordionStatusType | null;
13
- focus(): void;
14
- blur(): void;
15
- };
16
- export declare type TSinchAccordionItemReact = TSinchElementReact<TSinchAccordionItemElement> & {
17
- value: string;
18
- label: string;
19
- optionalText?: string;
20
- disabled?: boolean;
21
- status?: TSinchAccordionStatusType;
22
- onFocus?: (e: FocusEvent<TSinchAccordionItemElement>) => void;
23
- onBlur?: (e: FocusEvent<TSinchAccordionItemElement>) => void;
24
- };
2
+ import type { TSinchAccordionItemElement, TSinchAccordionItemReact } from './types';
25
3
  declare global {
26
4
  namespace JSX {
27
5
  interface IntrinsicElements {
@@ -32,4 +10,3 @@ declare global {
32
10
  'sinch-accordion-item': TSinchAccordionItemElement;
33
11
  }
34
12
  }
35
- export {};
@@ -10,7 +10,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
10
10
  import '../icons/keyboard-arrow-down';
11
11
  import { defineCustomElement, getAttribute, getBooleanAttribute, getLiteralAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
12
12
  const templateHTML = '<style>:host{display:block;outline:0;min-height:48px}#wrapper{display:flex;flex-direction:column;position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border-bottom:1px solid var(--sinch-color-stormy-200);--sinch-size-icon:16px}#button{all:initial;cursor:pointer;display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;height:48px;padding:12px 8px;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);fill:var(--sinch-color-stormy-500)}#button>*{pointer-events:none}#button:disabled{cursor:initial;color:var(--sinch-color-stormy-100);fill:var(--sinch-color-stormy-100)}#button::before{width:8px;height:8px;border-radius:50%;margin-left:2px;margin-right:8px}:host([status=success]) #button::before{content:"";background-color:var(--sinch-color-success-500)}:host([status=warn]) #button::before{content:"";background-color:var(--sinch-color-warning-500)}:host([status=error]) #button::before{content:"";background-color:var(--sinch-color-error-500)}:host([status=info]) #button::before{content:"";background-color:var(--sinch-color-informative-500)}#title{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#content{display:none;overflow-y:auto;flex-shrink:1;min-height:0;padding:0 8px 18px;font:var(--sinch-font-body);color:var(--sinch-color-text-default)}#dropdown-icon{--sinch-size-icon:24px}#button[aria-expanded=true]>#dropdown-icon{transform:rotate(180deg)}#button[aria-expanded=true]+#content{display:block}#optional{font:var(--sinch-font-small-text);color:var(--sinch-color-stormy-300)}</style><div id="wrapper"><button id="button" aria-controls="content" aria-expanded="false"><slot name="icon"></slot><span id="title"></span> <span id="optional"></span><sinch-icon-keyboard-arrow-down id="dropdown-icon"></sinch-icon-keyboard-arrow-down></button><div id="content" role="region" aria-labelledby="button"><slot name="content"></slot></div></div>';
13
- const statusValues = ['info', 'success', 'warn', 'error'];
13
+ import { statusValues } from './utils';
14
14
  const template = document.createElement('template');
15
15
  template.innerHTML = templateHTML;
16
16
  defineCustomElement('sinch-accordion-item', (_$button = new WeakMap(), _$buttonContent = new WeakMap(), _$optionalText = new WeakMap(), _onButtonClick = new WeakMap(), class extends NectaryElement {
@@ -0,0 +1,23 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ import type { statusValues } from './utils';
3
+ import type { FocusEvent } from 'react';
4
+ export declare type TSinchAccordionStatusType = typeof statusValues[number];
5
+ export declare type TSinchAccordionItemElement = HTMLElement & {
6
+ value: string;
7
+ label: string;
8
+ optionalText: string | null;
9
+ disabled: boolean;
10
+ checked: boolean;
11
+ status: TSinchAccordionStatusType | null;
12
+ focus(): void;
13
+ blur(): void;
14
+ };
15
+ export declare type TSinchAccordionItemReact = TSinchElementReact<TSinchAccordionItemElement> & {
16
+ value: string;
17
+ label: string;
18
+ optionalText?: string;
19
+ disabled?: boolean;
20
+ status?: TSinchAccordionStatusType;
21
+ onFocus?: (e: FocusEvent<TSinchAccordionItemElement>) => void;
22
+ onBlur?: (e: FocusEvent<TSinchAccordionItemElement>) => void;
23
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const statusValues: readonly ["info", "success", "warn", "error"];
@@ -0,0 +1 @@
1
+ export const statusValues = ['info', 'success', 'warn', 'error'];
@@ -0,0 +1,29 @@
1
+ import '../popover';
2
+ import type { TSinchPopoverOrientation } from '../popover';
3
+ import type { TRect, TSinchElementReact } from '../types';
4
+ import type { SyntheticEvent } from 'react';
5
+ export declare type TSinchActionMenuElement = HTMLElement & {
6
+ open: boolean;
7
+ orientation: TSinchPopoverOrientation;
8
+ maxVisibleItems: number | null;
9
+ readonly dropdownRect: TRect;
10
+ focus(): void;
11
+ blur(): void;
12
+ };
13
+ export declare type TSinchActionMenuReact = TSinchElementReact<TSinchActionMenuElement> & {
14
+ open: boolean;
15
+ orientation?: TSinchPopoverOrientation;
16
+ maxVisibleItems?: number;
17
+ 'aria-label': string;
18
+ onClose: (event: SyntheticEvent<TSinchActionMenuElement, CustomEvent<void>>) => void;
19
+ };
20
+ declare global {
21
+ namespace JSX {
22
+ interface IntrinsicElements {
23
+ 'sinch-action-menu': TSinchActionMenuReact;
24
+ }
25
+ }
26
+ interface HTMLElementTagNameMap {
27
+ 'sinch-action-menu': TSinchActionMenuElement;
28
+ }
29
+ }
@@ -0,0 +1,274 @@
1
+ import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
+
4
+ var _$optionSlot, _$listbox, _$popover, _onListboxKeyDown, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _selectOption, _getOptionElements, _findSelectedOption, _getEnabledOptionElements, _onOpen, _onClose, _onReactClose;
5
+
6
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
+
8
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
9
+
10
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
+
12
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
+
14
+ import { orientationValues } from '../popover/utils';
15
+ import '../popover';
16
+ import { attrValueToPixels, defineCustomElement, getBooleanAttribute, getIntegerAttribute, getLiteralAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateIntegerAttribute, updateLiteralAttribute } from '../utils';
17
+ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}sinch-popover{width:100%}</style><sinch-popover><slot name="target" slot="target"></slot><div id="listbox" slot="content"><slot name="option"></slot></div></sinch-popover>';
18
+ const ITEM_HEIGHT = 40;
19
+ const template = document.createElement('template');
20
+ template.innerHTML = templateHTML;
21
+ defineCustomElement('sinch-action-menu', (_$optionSlot = new WeakMap(), _$listbox = new WeakMap(), _$popover = new WeakMap(), _onListboxKeyDown = new WeakMap(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _selectOption = new WeakSet(), _getOptionElements = new WeakSet(), _findSelectedOption = new WeakSet(), _getEnabledOptionElements = new WeakSet(), _onOpen = new WeakSet(), _onClose = new WeakMap(), _onReactClose = new WeakMap(), class extends NectaryElement {
22
+ constructor() {
23
+ super();
24
+
25
+ _classPrivateMethodInitSpec(this, _onOpen);
26
+
27
+ _classPrivateMethodInitSpec(this, _getEnabledOptionElements);
28
+
29
+ _classPrivateMethodInitSpec(this, _findSelectedOption);
30
+
31
+ _classPrivateMethodInitSpec(this, _getOptionElements);
32
+
33
+ _classPrivateMethodInitSpec(this, _selectOption);
34
+
35
+ _classPrivateMethodInitSpec(this, _getPrevOption);
36
+
37
+ _classPrivateMethodInitSpec(this, _getNextOption);
38
+
39
+ _classPrivateMethodInitSpec(this, _getLastOption);
40
+
41
+ _classPrivateMethodInitSpec(this, _getFirstOption);
42
+
43
+ _classPrivateFieldInitSpec(this, _$optionSlot, {
44
+ writable: true,
45
+ value: void 0
46
+ });
47
+
48
+ _classPrivateFieldInitSpec(this, _$listbox, {
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+
53
+ _classPrivateFieldInitSpec(this, _$popover, {
54
+ writable: true,
55
+ value: void 0
56
+ });
57
+
58
+ _classPrivateFieldInitSpec(this, _onListboxKeyDown, {
59
+ writable: true,
60
+ value: e => {
61
+ switch (e.code) {
62
+ case 'ArrowUp':
63
+ case 'ArrowLeft':
64
+ {
65
+ e.preventDefault();
66
+
67
+ _classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, _classPrivateMethodGet(this, _getPrevOption, _getPrevOption2).call(this));
68
+
69
+ break;
70
+ }
71
+
72
+ case 'ArrowDown':
73
+ case 'ArrowRight':
74
+ {
75
+ e.preventDefault();
76
+
77
+ _classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, _classPrivateMethodGet(this, _getNextOption, _getNextOption2).call(this));
78
+
79
+ break;
80
+ }
81
+ }
82
+ }
83
+ });
84
+
85
+ _classPrivateFieldInitSpec(this, _onClose, {
86
+ writable: true,
87
+ value: () => {
88
+ this.dispatchEvent(new CustomEvent('close', {
89
+ bubbles: true
90
+ }));
91
+ }
92
+ });
93
+
94
+ _classPrivateFieldInitSpec(this, _onReactClose, {
95
+ writable: true,
96
+ value: () => {
97
+ getReactEventHandler(this, 'onClose')?.();
98
+ }
99
+ });
100
+
101
+ const shadowRoot = this.attachShadow();
102
+ shadowRoot.appendChild(template.content.cloneNode(true));
103
+
104
+ _classPrivateFieldSet(this, _$optionSlot, shadowRoot.querySelector('slot[name="option"]'));
105
+
106
+ _classPrivateFieldSet(this, _$listbox, shadowRoot.querySelector('#listbox'));
107
+
108
+ _classPrivateFieldSet(this, _$popover, shadowRoot.querySelector('sinch-popover'));
109
+ }
110
+
111
+ connectedCallback() {
112
+ this.setAttribute('role', 'listbox');
113
+ this.addEventListener('close', _classPrivateFieldGet(this, _onReactClose));
114
+ }
115
+
116
+ disconnectedCallback() {
117
+ this.removeEventListener('close', _classPrivateFieldGet(this, _onReactClose));
118
+ }
119
+
120
+ static get observedAttributes() {
121
+ return ['open', 'orientation', 'maxvisibleitems'];
122
+ }
123
+
124
+ get nodeName() {
125
+ return 'select';
126
+ }
127
+
128
+ set maxVisibleItems(value) {
129
+ updateIntegerAttribute(this, 'maxvisibleitems', value);
130
+ }
131
+
132
+ get maxVisibleItems() {
133
+ return getIntegerAttribute(this, 'maxvisibleitems', null);
134
+ }
135
+
136
+ get orientation() {
137
+ return getLiteralAttribute(this, orientationValues, 'orientation', 'bottom-right');
138
+ }
139
+
140
+ set orientation(value) {
141
+ updateLiteralAttribute(this, orientationValues, 'orientation', value);
142
+ }
143
+
144
+ set open(isOpen) {
145
+ updateBooleanAttribute(this, 'open', isOpen);
146
+ }
147
+
148
+ get open() {
149
+ return getBooleanAttribute(this, 'open');
150
+ }
151
+
152
+ get dropdownRect() {
153
+ return _classPrivateFieldGet(this, _$popover).popoverRect;
154
+ }
155
+
156
+ attributeChangedCallback(name, oldVal, newVal) {
157
+ switch (name) {
158
+ case 'open':
159
+ {
160
+ updateAttribute(_classPrivateFieldGet(this, _$popover), 'open', newVal);
161
+
162
+ if (isAttrTrue(newVal)) {
163
+ _classPrivateMethodGet(this, _onOpen, _onOpen2).call(this);
164
+
165
+ _classPrivateFieldGet(this, _$popover).addEventListener('keydown', _classPrivateFieldGet(this, _onListboxKeyDown));
166
+
167
+ _classPrivateFieldGet(this, _$popover).addEventListener('close', _classPrivateFieldGet(this, _onClose));
168
+ } else {
169
+ _classPrivateFieldGet(this, _$popover).removeEventListener('keydown', _classPrivateFieldGet(this, _onListboxKeyDown));
170
+
171
+ _classPrivateFieldGet(this, _$popover).removeEventListener('close', _classPrivateFieldGet(this, _onClose));
172
+ }
173
+
174
+ break;
175
+ }
176
+
177
+ case 'orientation':
178
+ {
179
+ updateAttribute(_classPrivateFieldGet(this, _$popover), 'orientation', newVal);
180
+ break;
181
+ }
182
+
183
+ case 'maxvisibleitems':
184
+ {
185
+ if (newVal === '0') {
186
+ _classPrivateFieldGet(this, _$listbox).style.maxHeight = 'unset';
187
+ } else {
188
+ _classPrivateFieldGet(this, _$listbox).style.maxHeight = attrValueToPixels(newVal, {
189
+ min: 2,
190
+ multiplier: ITEM_HEIGHT
191
+ });
192
+ }
193
+
194
+ break;
195
+ }
196
+ }
197
+ }
198
+
199
+ }));
200
+
201
+ function _getFirstOption2() {
202
+ return _classPrivateMethodGet(this, _getEnabledOptionElements, _getEnabledOptionElements2).call(this)[0] ?? null;
203
+ }
204
+
205
+ function _getLastOption2() {
206
+ return _classPrivateMethodGet(this, _getEnabledOptionElements, _getEnabledOptionElements2).call(this).reverse()[0] ?? null;
207
+ }
208
+
209
+ function _getNextOption2() {
210
+ const $options = _classPrivateMethodGet(this, _getEnabledOptionElements, _getEnabledOptionElements2).call(this);
211
+
212
+ const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this, $options);
213
+
214
+ const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
215
+
216
+ if (currentIndex < 0) {
217
+ return _classPrivateMethodGet(this, _getFirstOption, _getFirstOption2).call(this);
218
+ }
219
+
220
+ return $options[(currentIndex + 1) % $options.length];
221
+ }
222
+
223
+ function _getPrevOption2() {
224
+ const $options = _classPrivateMethodGet(this, _getEnabledOptionElements, _getEnabledOptionElements2).call(this);
225
+
226
+ const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this, $options);
227
+
228
+ const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
229
+
230
+ if (currentIndex < 0) {
231
+ return _classPrivateMethodGet(this, _getLastOption, _getLastOption2).call(this);
232
+ }
233
+
234
+ return $options[(currentIndex - 1 + $options.length) % $options.length];
235
+ }
236
+
237
+ function _selectOption2($option) {
238
+ for (const $op of _classPrivateMethodGet(this, _getOptionElements, _getOptionElements2).call(this)) {
239
+ const isSelected = $op === $option;
240
+ $op.selected = isSelected;
241
+
242
+ if (isSelected) {
243
+ $op.focus();
244
+ }
245
+ }
246
+ }
247
+
248
+ function _getOptionElements2() {
249
+ let $elements = _classPrivateFieldGet(this, _$optionSlot).assignedElements();
250
+
251
+ if ($elements.length === 1 && $elements[0].tagName === 'SLOT') {
252
+ $elements = $elements[0].assignedElements();
253
+ }
254
+
255
+ return $elements;
256
+ }
257
+
258
+ function _findSelectedOption2(elements) {
259
+ for (const el of elements) {
260
+ if (el.selected) {
261
+ return el;
262
+ }
263
+ }
264
+
265
+ return null;
266
+ }
267
+
268
+ function _getEnabledOptionElements2() {
269
+ return _classPrivateMethodGet(this, _getOptionElements, _getOptionElements2).call(this).filter(opt => opt.disabled !== true);
270
+ }
271
+
272
+ function _onOpen2() {
273
+ _classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, _classPrivateMethodGet(this, _getFirstOption, _getFirstOption2).call(this));
274
+ }
@@ -0,0 +1,11 @@
1
+ import type { TSinchActionMenuOptionElement, TSinchActionMenuOptionReact } from './types';
2
+ declare global {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ 'sinch-action-menu-option': TSinchActionMenuOptionReact;
6
+ }
7
+ }
8
+ interface HTMLElementTagNameMap {
9
+ 'sinch-action-menu-option': TSinchActionMenuOptionElement;
10
+ }
11
+ }
@@ -0,0 +1,95 @@
1
+ import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
+
4
+ var _$button, _$content;
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 { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
11
+ const templateHTML = '<style>:host{display:block}#wrapper{all:initial;display:flex;position:relative;box-sizing:border-box;height:40px;width:100%;padding:6px 12px;align-items:center;gap:12px;user-select:none;cursor:pointer;font:inherit;color:inherit;--sinch-size-icon:24px}#content{flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#wrapper:focus,:host(:hover)>#wrapper{background-color:var(--sinch-color-snow-500)}:host([disabled]:not([disabled=false]))>#wrapper{color:var(--sinch-color-stormy-100);cursor:initial;--sinch-color-icon:var(--sinch-color-stormy-100)}</style><button id="wrapper"><slot name="icon"></slot><span id="content"></span></button>';
12
+ const template = document.createElement('template');
13
+ template.innerHTML = templateHTML;
14
+ defineCustomElement('sinch-action-menu-option', (_$button = new WeakMap(), _$content = new WeakMap(), class ActionMenuOption extends NectaryElement {
15
+ constructor() {
16
+ super();
17
+
18
+ _classPrivateFieldInitSpec(this, _$button, {
19
+ writable: true,
20
+ value: void 0
21
+ });
22
+
23
+ _classPrivateFieldInitSpec(this, _$content, {
24
+ writable: true,
25
+ value: void 0
26
+ });
27
+
28
+ const shadowRoot = this.attachShadow();
29
+ shadowRoot.appendChild(template.content.cloneNode(true));
30
+
31
+ _classPrivateFieldSet(this, _$button, shadowRoot.querySelector('#wrapper'));
32
+
33
+ _classPrivateFieldSet(this, _$content, shadowRoot.querySelector('#content'));
34
+ }
35
+
36
+ connectedCallback() {
37
+ this.setAttribute('role', 'option');
38
+ }
39
+
40
+ static get observedAttributes() {
41
+ return ['text', 'disabled'];
42
+ }
43
+
44
+ attributeChangedCallback(name, oldVal, newVal) {
45
+ if (oldVal === newVal) {
46
+ return;
47
+ }
48
+
49
+ switch (name) {
50
+ case 'text':
51
+ {
52
+ _classPrivateFieldGet(this, _$content).textContent = newVal;
53
+ break;
54
+ }
55
+
56
+ case 'disabled':
57
+ {
58
+ _classPrivateFieldGet(this, _$button).disabled = isAttrTrue(newVal);
59
+ }
60
+ }
61
+ }
62
+
63
+ set text(value) {
64
+ updateAttribute(this, 'text', value);
65
+ }
66
+
67
+ get text() {
68
+ return getAttribute(this, 'text', '');
69
+ }
70
+
71
+ set disabled(isDisabled) {
72
+ updateBooleanAttribute(this, 'disabled', isDisabled);
73
+ }
74
+
75
+ get disabled() {
76
+ return getBooleanAttribute(this, 'disabled');
77
+ }
78
+
79
+ set selected(isSelected) {
80
+ updateBooleanAttribute(this, 'data-selected', isSelected);
81
+ }
82
+
83
+ get selected() {
84
+ return getBooleanAttribute(this, 'data-selected');
85
+ }
86
+
87
+ focus() {
88
+ _classPrivateFieldGet(this, _$button).focus();
89
+ }
90
+
91
+ blur() {
92
+ _classPrivateFieldGet(this, _$button).blur();
93
+ }
94
+
95
+ }));
@@ -0,0 +1,17 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ import type { FocusEvent, MouseEvent } from 'react';
3
+ export declare type TSinchActionMenuOptionElement = HTMLElement & {
4
+ text: string;
5
+ selected: boolean;
6
+ disabled: boolean;
7
+ focus(): void;
8
+ blur(): void;
9
+ };
10
+ export declare type TSinchActionMenuOptionReact = TSinchElementReact<TSinchActionMenuOptionElement> & {
11
+ text: string;
12
+ disabled?: boolean;
13
+ 'aria-label': string;
14
+ onClick: (e: MouseEvent<TSinchActionMenuOptionElement>) => void;
15
+ onFocus?: (e: FocusEvent<TSinchActionMenuOptionElement>) => void;
16
+ onBlur?: (e: FocusEvent<TSinchActionMenuOptionElement>) => void;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
package/button/index.js CHANGED
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
8
8
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
9
 
10
10
  import { defineCustomElement, getBooleanAttribute, getAttribute, getLiteralAttribute, isAttrTrue, updateBooleanAttribute, updateAttribute, updateLiteralAttribute, NectaryElement } from '../utils';
11
- const templateHTML = '<style>:host{--sinch-color-button-background:var(--sinch-color-tropical-500);--sinch-color-button-background-hover:var(--sinch-color-tropical-400);--sinch-color-button-background-focus:var(--sinch-color-tropical-500);--sinch-color-button-background-active:var(--sinch-color-tropical-600);--sinch-color-button-background-disabled:var(--sinch-color-tropical-100);--sinch-color-button-text:var(--sinch-color-text-inverted);--sinch-color-button-text-disabled:var(--sinch-color-text-inverted);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-text-inverted);display:inline-block;vertical-align:middle;outline:0}:host([type=secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-tropical-100);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-tropical-100);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-tropical-500);--sinch-color-button-text-disabled:var(--sinch-color-tropical-100);--sinch-color-button-border:var(--sinch-color-tropical-500);--sinch-color-button-border-hover:var(--sinch-color-tropical-500);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-tropical-500);--sinch-color-button-border-disabled:var(--sinch-color-tropical-100);--sinch-color-spinner-bg:var(--sinch-color-tropical-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([type=secondary]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100)}:host([type=secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-tropical-200);--sinch-color-spinner-fg:var(--sinch-color-tropical-400)}:host([type=cta-primary]){--sinch-color-button-background:var(--sinch-color-honey-500);--sinch-color-button-background-hover:var(--sinch-color-honey-400);--sinch-color-button-background-focus:var(--sinch-color-honey-500);--sinch-color-button-background-active:var(--sinch-color-honey-600);--sinch-color-button-background-disabled:var(--sinch-color-honey-100);--sinch-color-button-text:var(--sinch-color-text-default);--sinch-color-button-text-disabled:var(--sinch-color-stormy-300);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-text-default);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-honey-700);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-text-default)}:host([type=cta-primary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-stormy-300)}:host([type=cta-secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-snow-500);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-snow-500);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-stormy-500);--sinch-color-button-text-disabled:var(--sinch-color-stormy-200);--sinch-color-button-border:var(--sinch-color-stormy-500);--sinch-color-button-border-hover:var(--sinch-color-stormy-500);--sinch-color-button-border-focus:var(--sinch-color-stormy-500);--sinch-color-button-border-active:var(--sinch-color-stormy-500);--sinch-color-button-border-disabled:var(--sinch-color-stormy-200);--sinch-color-spinner-bg:var(--sinch-color-snow-800);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-stormy-500)}:host([type=cta-secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-600);--sinch-color-spinner-fg:var(--sinch-color-stormy-200);--sinch-color-icon:var(--sinch-color-stormy-200)}:host([type=destructive]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-error-200);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-error-200);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-text-invalid);--sinch-color-button-text-disabled:var(--sinch-color-error-200);--sinch-color-button-border:var(--sinch-color-error-500);--sinch-color-button-border-hover:var(--sinch-color-error-500);--sinch-color-button-border-focus:var(--sinch-color-error-800);--sinch-color-button-border-active:var(--sinch-color-error-500);--sinch-color-button-border-disabled:var(--sinch-color-error-200);--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500);--sinch-color-icon:var(--sinch-color-text-invalid)}:host([type=destructive]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-raspberry-200);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}:host([type=destructive]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}button{all:initial;display:flex;align-items:center;justify-content:center;gap:15px;box-sizing:border-box;width:100%;height:48px;padding:12px;border-radius:4px;font:var(--sinch-font-title-s);color:var(--sinch-color-button-text);background-color:var(--sinch-color-button-background);box-shadow:0 0 0 1px var(--sinch-color-button-border) inset;cursor:pointer;--sinch-size-icon:24px}button:focus{background-color:var(--sinch-color-button-background-focus);box-shadow:0 0 0 2px var(--sinch-color-button-border-focus) inset}button:hover{background-color:var(--sinch-color-button-background-hover);box-shadow:0 0 0 1px var(--sinch-color-button-border-hover) inset}button:active{background-color:var(--sinch-color-button-background-active);box-shadow:0 0 0 2px var(--sinch-color-button-border-active) inset}button:disabled{color:var(--sinch-color-button-text-disabled);background-color:var(--sinch-color-button-background-disabled);box-shadow:0 0 0 1px var(--sinch-color-button-border-disabled) inset;cursor:initial;--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-200);--sinch-color-icon:var(--sinch-color-button-text-disabled)}button>*{pointer-events:none}#text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:none}:host([text]:not([text=""])) #text{display:initial}:host([text]:not([text=""])) button{padding:12px 24px}:host([small]:not([small=false]))>button{height:32px;padding:8px;line-height:16px;font-size:14px;gap:8px;--sinch-size-icon:16px}:host([text]:not([text=""])[small]:not([small=false])) button{padding:8px 16px}</style><button><slot name="icon"></slot><span id="text"></span></button>';
11
+ const templateHTML = '<style>:host{--sinch-color-button-background:var(--sinch-color-tropical-500);--sinch-color-button-background-hover:var(--sinch-color-tropical-400);--sinch-color-button-background-focus:var(--sinch-color-tropical-500);--sinch-color-button-background-active:var(--sinch-color-tropical-600);--sinch-color-button-background-disabled:var(--sinch-color-tropical-100);--sinch-color-button-text:var(--sinch-color-text-inverted);--sinch-color-button-text-disabled:var(--sinch-color-text-inverted);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-text-inverted);display:inline-block;vertical-align:middle;outline:0}:host([type=secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-tropical-100);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-tropical-100);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-tropical-500);--sinch-color-button-text-disabled:var(--sinch-color-tropical-100);--sinch-color-button-border:var(--sinch-color-tropical-500);--sinch-color-button-border-hover:var(--sinch-color-tropical-500);--sinch-color-button-border-focus:var(--sinch-color-tropical-700);--sinch-color-button-border-active:var(--sinch-color-tropical-500);--sinch-color-button-border-disabled:var(--sinch-color-tropical-100);--sinch-color-spinner-bg:var(--sinch-color-tropical-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-500);--sinch-color-icon:var(--sinch-color-tropical-500)}:host([type=secondary]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-tropical-300);--sinch-color-spinner-fg:var(--sinch-color-snow-100)}:host([type=secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-tropical-200);--sinch-color-spinner-fg:var(--sinch-color-tropical-400)}:host([type=cta-primary]){--sinch-color-button-background:var(--sinch-color-honey-500);--sinch-color-button-background-hover:var(--sinch-color-honey-400);--sinch-color-button-background-focus:var(--sinch-color-honey-500);--sinch-color-button-background-active:var(--sinch-color-honey-600);--sinch-color-button-background-disabled:var(--sinch-color-honey-100);--sinch-color-button-text:var(--sinch-color-text-default);--sinch-color-button-text-disabled:var(--sinch-color-stormy-300);--sinch-color-button-border:var(--sinch-color-transparent);--sinch-color-button-border-hover:var(--sinch-color-transparent);--sinch-color-button-border-focus:var(--sinch-color-text-default);--sinch-color-button-border-active:var(--sinch-color-transparent);--sinch-color-button-border-disabled:var(--sinch-color-transparent);--sinch-color-spinner-bg:var(--sinch-color-honey-700);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-text-default)}:host([type=cta-primary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-stormy-300)}:host([type=cta-secondary]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-snow-500);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-snow-500);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-stormy-500);--sinch-color-button-text-disabled:var(--sinch-color-stormy-200);--sinch-color-button-border:var(--sinch-color-stormy-500);--sinch-color-button-border-hover:var(--sinch-color-stormy-500);--sinch-color-button-border-focus:var(--sinch-color-stormy-500);--sinch-color-button-border-active:var(--sinch-color-stormy-500);--sinch-color-button-border-disabled:var(--sinch-color-stormy-200);--sinch-color-spinner-bg:var(--sinch-color-snow-800);--sinch-color-spinner-fg:var(--sinch-color-stormy-600);--sinch-color-icon:var(--sinch-color-stormy-500)}:host([type=cta-secondary]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-snow-600);--sinch-color-spinner-fg:var(--sinch-color-stormy-200);--sinch-color-icon:var(--sinch-color-stormy-200)}:host([type=destructive]){--sinch-color-button-background:var(--sinch-color-snow-100);--sinch-color-button-background-hover:var(--sinch-color-error-200);--sinch-color-button-background-focus:var(--sinch-color-snow-100);--sinch-color-button-background-active:var(--sinch-color-error-200);--sinch-color-button-background-disabled:var(--sinch-color-snow-100);--sinch-color-button-text:var(--sinch-color-text-invalid);--sinch-color-button-text-disabled:var(--sinch-color-error-200);--sinch-color-button-border:var(--sinch-color-error-500);--sinch-color-button-border-hover:var(--sinch-color-error-500);--sinch-color-button-border-focus:var(--sinch-color-error-800);--sinch-color-button-border-active:var(--sinch-color-error-500);--sinch-color-button-border-disabled:var(--sinch-color-error-200);--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500);--sinch-color-icon:var(--sinch-color-text-invalid)}:host([type=destructive]) button:is(:hover,:active){--sinch-color-spinner-bg:var(--sinch-color-raspberry-200);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}:host([type=destructive]) button:disabled{--sinch-color-spinner-bg:var(--sinch-color-raspberry-100);--sinch-color-spinner-fg:var(--sinch-color-raspberry-500)}button{all:initial;display:flex;align-items:center;justify-content:center;gap:12px;box-sizing:border-box;width:100%;height:48px;padding:12px;border-radius:4px;font:var(--sinch-font-title-s);color:var(--sinch-color-button-text);background-color:var(--sinch-color-button-background);box-shadow:0 0 0 1px var(--sinch-color-button-border) inset;cursor:pointer;--sinch-size-icon:24px}button:focus{background-color:var(--sinch-color-button-background-focus);box-shadow:0 0 0 2px var(--sinch-color-button-border-focus) inset}button:hover{background-color:var(--sinch-color-button-background-hover);box-shadow:0 0 0 1px var(--sinch-color-button-border-hover) inset}button:active{background-color:var(--sinch-color-button-background-active);box-shadow:0 0 0 2px var(--sinch-color-button-border-active) inset}button:disabled{color:var(--sinch-color-button-text-disabled);background-color:var(--sinch-color-button-background-disabled);box-shadow:0 0 0 1px var(--sinch-color-button-border-disabled) inset;cursor:initial;--sinch-color-spinner-bg:var(--sinch-color-snow-100);--sinch-color-spinner-fg:var(--sinch-color-tropical-200);--sinch-color-icon:var(--sinch-color-button-text-disabled)}button>*{pointer-events:none}#text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:none}:host([text]:not([text=""])) #text{display:initial}:host([text]:not([text=""])) button{padding:12px 24px}:host([small]:not([small=false]))>button{height:32px;padding:8px;line-height:16px;font-size:14px;gap:8px;--sinch-size-icon:16px}:host([text]:not([text=""])[small]:not([small=false])) button{padding:8px 16px}</style><button><slot name="left-icon"></slot><span id="text"></span><slot name="right-icon"></slot></button>';
12
12
  const buttonTypes = ['primary', 'secondary', 'cta-primary', 'cta-secondary', 'destructive'];
13
13
  const template = document.createElement('template');
14
14
  template.innerHTML = templateHTML;
@@ -1,4 +1,4 @@
1
- import type { TSinchChatBubbleType } from '../chat-bubble';
1
+ import type { TSinchChatBubbleType } from '../chat-bubble/types';
2
2
  import type { TSinchElementReact } from '../types';
3
3
  export declare type TSinchChatBlockElement = HTMLElement & {
4
4
  type: TSinchChatBubbleType | null;
@@ -2,20 +2,7 @@ import '../icons/query-builder';
2
2
  import '../icons/check';
3
3
  import '../icons/done-all';
4
4
  import '../icons/error-outline';
5
- import { typeValues } from './utils';
6
- import type { TSinchElementReact } from '../types';
7
- declare const statusValues: readonly ["sending", "sent", "received", "seen", "error"];
8
- export declare type TSinchChatBubbleType = typeof typeValues[number];
9
- export declare type TSinchChatBubbleStatus = typeof statusValues[number];
10
- export declare type TSinchChatBubbleElement = HTMLElement & {
11
- readonly type: TSinchChatBubbleType | null;
12
- text: string;
13
- status: TSinchChatBubbleStatus | null;
14
- };
15
- export declare type TSinchChatBubbleReact = TSinchElementReact<TSinchChatBubbleElement> & {
16
- text: string;
17
- status?: TSinchChatBubbleStatus;
18
- };
5
+ import type { TSinchChatBubbleElement, TSinchChatBubbleReact } from './types';
19
6
  declare global {
20
7
  namespace JSX {
21
8
  interface IntrinsicElements {
@@ -26,4 +13,3 @@ declare global {
26
13
  'sinch-chat-bubble': TSinchChatBubbleElement;
27
14
  }
28
15
  }
29
- export {};
@@ -13,8 +13,7 @@ import '../icons/done-all';
13
13
  import '../icons/error-outline';
14
14
  import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
15
15
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;padding:12px 16px;border-radius:16px;max-width:595px;box-sizing:border-box}:host([data-type=customer])>#wrapper{background-color:var(--sinch-color-snow-500);border-top-left-radius:0}:host([data-type=agent-prev])>#wrapper{background-color:var(--sinch-color-snow-700);border-top-right-radius:0}:host([data-type=agent])>#wrapper{background-color:var(--sinch-color-honey-200);border-top-right-radius:0}#text{font:var(--sinch-font-body);color:var(--sinch-color-stormy-500)}sinch-icon-check,sinch-icon-done-all,sinch-icon-error-outline,sinch-icon-query-builder{display:none;position:absolute;right:16px;bottom:12px;--sinch-size-icon:16px;--sinch-color-icon:var(--sinch-color-stormy-500)}:host([status=sending]) sinch-icon-query-builder{display:block}:host([status=sent]) sinch-icon-check{display:block}:host([status=received]) sinch-icon-done-all{display:block}:host([status=seen]) sinch-icon-done-all{display:block;--sinch-color-icon:var(--sinch-color-success-500)}:host([status=error]) sinch-icon-error-outline{display:block;--sinch-color-icon:var(--sinch-color-error-500)}:host([status]:not([status=""])) #wrapper{padding-right:42px}</style><div id="wrapper"><span id="text"></span><sinch-icon-query-builder></sinch-icon-query-builder><sinch-icon-check></sinch-icon-check><sinch-icon-done-all></sinch-icon-done-all><sinch-icon-error-outline></sinch-icon-error-outline></div>';
16
- import { typeValues } from './utils';
17
- const statusValues = ['sending', 'sent', 'received', 'seen', 'error'];
16
+ import { statusValues, typeValues } from './utils';
18
17
  const template = document.createElement('template');
19
18
  template.innerHTML = templateHTML;
20
19
  defineCustomElement('sinch-chat-bubble', (_$text = new WeakMap(), class extends NectaryElement {
@@ -0,0 +1,13 @@
1
+ import type { TSinchElementReact } from '../types';
2
+ import type { statusValues, typeValues } from './utils';
3
+ export declare type TSinchChatBubbleType = typeof typeValues[number];
4
+ export declare type TSinchChatBubbleStatus = typeof statusValues[number];
5
+ export declare type TSinchChatBubbleElement = HTMLElement & {
6
+ readonly type: TSinchChatBubbleType | null;
7
+ text: string;
8
+ status: TSinchChatBubbleStatus | null;
9
+ };
10
+ export declare type TSinchChatBubbleReact = TSinchElementReact<TSinchChatBubbleElement> & {
11
+ text: string;
12
+ status?: TSinchChatBubbleStatus;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  export declare const typeValues: readonly ["customer", "agent", "agent-prev"];
2
+ export declare const statusValues: readonly ["sending", "sent", "received", "seen", "error"];
@@ -1 +1,2 @@
1
- export const typeValues = ['customer', 'agent', 'agent-prev'];
1
+ export const typeValues = ['customer', 'agent', 'agent-prev'];
2
+ export const statusValues = ['sending', 'sent', 'received', 'seen', 'error'];