@nectary/components 0.26.0 → 0.27.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 (676) hide show
  1. package/accordion/index.js +31 -34
  2. package/accordion-item/index.d.ts +0 -1
  3. package/accordion-item/index.js +1 -7
  4. package/avatar/index.d.ts +0 -1
  5. package/avatar/index.js +0 -1
  6. package/avatar-badge/index.d.ts +0 -1
  7. package/avatar-badge/index.js +0 -1
  8. package/avatar-status/index.d.ts +0 -1
  9. package/avatar-status/index.js +0 -1
  10. package/card/index.js +3 -7
  11. package/card-button/index.d.ts +0 -1
  12. package/card-button/index.js +0 -3
  13. package/card-button/utils.d.ts +2 -0
  14. package/card-button/utils.js +3 -0
  15. package/card-link/index.d.ts +0 -1
  16. package/card-link/index.js +0 -3
  17. package/card-link/utils.d.ts +2 -0
  18. package/card-link/utils.js +3 -0
  19. package/chat-block/index.js +1 -1
  20. package/chat-bubble/index.d.ts +10 -1
  21. package/chat-bubble/index.js +16 -3
  22. package/chat-bubble/utils.d.ts +1 -0
  23. package/chat-bubble/utils.js +1 -0
  24. package/dropdown/index.d.ts +2 -0
  25. package/dropdown/index.js +101 -183
  26. package/dropdown-checkbox-option/index.d.ts +24 -0
  27. package/dropdown-checkbox-option/index.js +96 -0
  28. package/dropdown-radio-option/index.d.ts +24 -0
  29. package/dropdown-radio-option/index.js +96 -0
  30. package/{dropdown-option → dropdown-text-option}/index.d.ts +5 -6
  31. package/{dropdown-option → dropdown-text-option}/index.js +4 -7
  32. package/icons/3d-rotation/index.d.ts +11 -0
  33. package/icons/3d-rotation/index.js +4 -0
  34. package/icons/accessibility/index.d.ts +11 -0
  35. package/icons/accessibility/index.js +4 -0
  36. package/icons/accessibility-new/index.d.ts +11 -0
  37. package/icons/accessibility-new/index.js +4 -0
  38. package/icons/accessible/index.d.ts +11 -0
  39. package/icons/accessible/index.js +4 -0
  40. package/icons/accessible-forward/index.d.ts +11 -0
  41. package/icons/accessible-forward/index.js +4 -0
  42. package/icons/account-balance/index.d.ts +11 -0
  43. package/icons/account-balance/index.js +4 -0
  44. package/icons/account-balance-wallet/index.d.ts +11 -0
  45. package/icons/account-balance-wallet/index.js +4 -0
  46. package/icons/account-box/index.d.ts +11 -0
  47. package/icons/account-box/index.js +4 -0
  48. package/icons/account-circle/index.d.ts +11 -0
  49. package/icons/account-circle/index.js +4 -0
  50. package/icons/add-shopping-cart/index.d.ts +11 -0
  51. package/icons/add-shopping-cart/index.js +4 -0
  52. package/icons/add-task/index.d.ts +11 -0
  53. package/icons/add-task/index.js +4 -0
  54. package/icons/addchart/index.d.ts +11 -0
  55. package/icons/addchart/index.js +4 -0
  56. package/icons/admin-panel-settings/index.d.ts +11 -0
  57. package/icons/admin-panel-settings/index.js +4 -0
  58. package/icons/alarm/index.d.ts +11 -0
  59. package/icons/alarm/index.js +4 -0
  60. package/icons/alarm-add/index.d.ts +11 -0
  61. package/icons/alarm-add/index.js +4 -0
  62. package/icons/alarm-off/index.d.ts +11 -0
  63. package/icons/alarm-off/index.js +4 -0
  64. package/icons/alarm-on/index.d.ts +11 -0
  65. package/icons/alarm-on/index.js +4 -0
  66. package/icons/all-inbox/index.d.ts +11 -0
  67. package/icons/all-inbox/index.js +4 -0
  68. package/icons/all-out/index.d.ts +11 -0
  69. package/icons/all-out/index.js +4 -0
  70. package/icons/analytics/index.d.ts +11 -0
  71. package/icons/analytics/index.js +4 -0
  72. package/icons/anchor/index.d.ts +11 -0
  73. package/icons/anchor/index.js +4 -0
  74. package/icons/android/index.d.ts +11 -0
  75. package/icons/android/index.js +4 -0
  76. package/icons/announcement/index.d.ts +11 -0
  77. package/icons/announcement/index.js +4 -0
  78. package/icons/api/index.d.ts +11 -0
  79. package/icons/api/index.js +4 -0
  80. package/icons/app-blocking/index.d.ts +11 -0
  81. package/icons/app-blocking/index.js +4 -0
  82. package/icons/arrow-circle-down/index.d.ts +11 -0
  83. package/icons/arrow-circle-down/index.js +4 -0
  84. package/icons/arrow-circle-up/index.d.ts +11 -0
  85. package/icons/arrow-circle-up/index.js +4 -0
  86. package/icons/arrow-right-alt/index.d.ts +11 -0
  87. package/icons/arrow-right-alt/index.js +4 -0
  88. package/icons/article/index.d.ts +11 -0
  89. package/icons/article/index.js +4 -0
  90. package/icons/aspect-ratio/index.d.ts +11 -0
  91. package/icons/aspect-ratio/index.js +4 -0
  92. package/icons/assessment/index.d.ts +11 -0
  93. package/icons/assessment/index.js +4 -0
  94. package/icons/assignment-ind/index.d.ts +11 -0
  95. package/icons/assignment-ind/index.js +4 -0
  96. package/icons/assignment-late/index.d.ts +11 -0
  97. package/icons/assignment-late/index.js +4 -0
  98. package/icons/assignment-return/index.d.ts +11 -0
  99. package/icons/assignment-return/index.js +4 -0
  100. package/icons/assignment-returned/index.d.ts +11 -0
  101. package/icons/assignment-returned/index.js +4 -0
  102. package/icons/assignment-turned-in/index.d.ts +11 -0
  103. package/icons/assignment-turned-in/index.js +4 -0
  104. package/icons/autorenew/index.d.ts +11 -0
  105. package/icons/autorenew/index.js +4 -0
  106. package/icons/backup/index.d.ts +11 -0
  107. package/icons/backup/index.js +4 -0
  108. package/icons/backup-table/index.d.ts +11 -0
  109. package/icons/backup-table/index.js +4 -0
  110. package/icons/batch-prediction/index.d.ts +11 -0
  111. package/icons/batch-prediction/index.js +4 -0
  112. package/icons/book/index.d.ts +11 -0
  113. package/icons/book/index.js +4 -0
  114. package/icons/book-online/index.d.ts +11 -0
  115. package/icons/book-online/index.js +4 -0
  116. package/icons/bookmark/index.d.ts +11 -0
  117. package/icons/bookmark/index.js +4 -0
  118. package/icons/bookmark-border/index.d.ts +11 -0
  119. package/icons/bookmark-border/index.js +4 -0
  120. package/icons/bookmarks/index.d.ts +11 -0
  121. package/icons/bookmarks/index.js +4 -0
  122. package/icons/bug-report/index.d.ts +11 -0
  123. package/icons/bug-report/index.js +4 -0
  124. package/icons/build/index.d.ts +11 -0
  125. package/icons/build/index.js +4 -0
  126. package/icons/build-circle/index.d.ts +11 -0
  127. package/icons/build-circle/index.js +4 -0
  128. package/icons/cached/index.d.ts +11 -0
  129. package/icons/cached/index.js +4 -0
  130. package/icons/calendar-today/index.d.ts +11 -0
  131. package/icons/calendar-today/index.js +4 -0
  132. package/icons/calendar-view-day/index.d.ts +11 -0
  133. package/icons/calendar-view-day/index.js +4 -0
  134. package/icons/camera-enhance/index.d.ts +11 -0
  135. package/icons/camera-enhance/index.js +4 -0
  136. package/icons/cancel-schedule-send/index.d.ts +11 -0
  137. package/icons/cancel-schedule-send/index.js +4 -0
  138. package/icons/card-giftcard/index.d.ts +11 -0
  139. package/icons/card-giftcard/index.js +4 -0
  140. package/icons/card-membership/index.d.ts +11 -0
  141. package/icons/card-membership/index.js +4 -0
  142. package/icons/card-travel/index.d.ts +11 -0
  143. package/icons/card-travel/index.js +4 -0
  144. package/icons/change-history/index.d.ts +11 -0
  145. package/icons/change-history/index.js +4 -0
  146. package/icons/check-circle/index.d.ts +11 -0
  147. package/icons/check-circle/index.js +4 -0
  148. package/icons/check-circle-outline/index.d.ts +2 -2
  149. package/icons/check-circle-outline/index.js +1 -1
  150. package/icons/chrome-reader-mode/index.d.ts +11 -0
  151. package/icons/chrome-reader-mode/index.js +4 -0
  152. package/icons/class/index.d.ts +11 -0
  153. package/icons/class/index.js +4 -0
  154. package/icons/close-fullscreen/index.d.ts +11 -0
  155. package/icons/close-fullscreen/index.js +4 -0
  156. package/icons/code/index.d.ts +11 -0
  157. package/icons/code/index.js +4 -0
  158. package/icons/comment-bank/index.d.ts +11 -0
  159. package/icons/comment-bank/index.js +4 -0
  160. package/icons/commute/index.d.ts +11 -0
  161. package/icons/commute/index.js +4 -0
  162. package/icons/compare-arrows/index.d.ts +11 -0
  163. package/icons/compare-arrows/index.js +4 -0
  164. package/icons/contact-page/index.d.ts +11 -0
  165. package/icons/contact-page/index.js +4 -0
  166. package/icons/contact-support/index.d.ts +11 -0
  167. package/icons/contact-support/index.js +4 -0
  168. package/icons/contactless/index.d.ts +11 -0
  169. package/icons/contactless/index.js +4 -0
  170. package/icons/copyright/index.d.ts +11 -0
  171. package/icons/copyright/index.js +4 -0
  172. package/icons/credit-card/index.d.ts +11 -0
  173. package/icons/credit-card/index.js +4 -0
  174. package/icons/dashboard/index.d.ts +11 -0
  175. package/icons/dashboard/index.js +4 -0
  176. package/icons/date-range/index.d.ts +11 -0
  177. package/icons/date-range/index.js +4 -0
  178. package/icons/delete/index.d.ts +11 -0
  179. package/icons/delete/index.js +4 -0
  180. package/icons/delete-forever/index.d.ts +11 -0
  181. package/icons/delete-forever/index.js +4 -0
  182. package/icons/delete-outline/index.d.ts +11 -0
  183. package/icons/delete-outline/index.js +4 -0
  184. package/icons/description/index.d.ts +11 -0
  185. package/icons/description/index.js +4 -0
  186. package/icons/disabled-by-default/index.d.ts +11 -0
  187. package/icons/disabled-by-default/index.js +4 -0
  188. package/icons/dns/index.d.ts +11 -0
  189. package/icons/dns/index.js +4 -0
  190. package/icons/done/index.d.ts +11 -0
  191. package/icons/done/index.js +4 -0
  192. package/icons/done-outline/index.d.ts +11 -0
  193. package/icons/done-outline/index.js +4 -0
  194. package/icons/donut-large/index.d.ts +11 -0
  195. package/icons/donut-large/index.js +4 -0
  196. package/icons/donut-small/index.d.ts +11 -0
  197. package/icons/donut-small/index.js +4 -0
  198. package/icons/drag-indicator/index.d.ts +11 -0
  199. package/icons/drag-indicator/index.js +4 -0
  200. package/icons/dynamic-form/index.d.ts +11 -0
  201. package/icons/dynamic-form/index.js +4 -0
  202. package/icons/eco/index.d.ts +11 -0
  203. package/icons/eco/index.js +4 -0
  204. package/icons/eject/index.d.ts +11 -0
  205. package/icons/eject/index.js +4 -0
  206. package/icons/euro-symbol/index.d.ts +11 -0
  207. package/icons/euro-symbol/index.js +4 -0
  208. package/icons/event/index.d.ts +11 -0
  209. package/icons/event/index.js +4 -0
  210. package/icons/event-seat/index.d.ts +11 -0
  211. package/icons/event-seat/index.js +4 -0
  212. package/icons/exit-to-app/index.d.ts +11 -0
  213. package/icons/exit-to-app/index.js +4 -0
  214. package/icons/explore/index.d.ts +11 -0
  215. package/icons/explore/index.js +4 -0
  216. package/icons/explore-off/index.d.ts +11 -0
  217. package/icons/explore-off/index.js +4 -0
  218. package/icons/extension/index.d.ts +11 -0
  219. package/icons/extension/index.js +4 -0
  220. package/icons/face/index.d.ts +11 -0
  221. package/icons/face/index.js +4 -0
  222. package/icons/face-unlock/index.d.ts +11 -0
  223. package/icons/face-unlock/index.js +4 -0
  224. package/icons/fact-check/index.d.ts +11 -0
  225. package/icons/fact-check/index.js +4 -0
  226. package/icons/favorite/index.d.ts +11 -0
  227. package/icons/favorite/index.js +4 -0
  228. package/icons/favorite-border/index.d.ts +11 -0
  229. package/icons/favorite-border/index.js +4 -0
  230. package/icons/feedback/index.d.ts +11 -0
  231. package/icons/feedback/index.js +4 -0
  232. package/icons/filter-alt/index.d.ts +11 -0
  233. package/icons/filter-alt/index.js +4 -0
  234. package/icons/find-in-page/index.d.ts +11 -0
  235. package/icons/find-in-page/index.js +4 -0
  236. package/icons/find-replace/index.d.ts +11 -0
  237. package/icons/find-replace/index.js +4 -0
  238. package/icons/fingerprint/index.d.ts +11 -0
  239. package/icons/fingerprint/index.js +4 -0
  240. package/icons/flaky/index.d.ts +11 -0
  241. package/icons/flaky/index.js +4 -0
  242. package/icons/flight-land/index.d.ts +11 -0
  243. package/icons/flight-land/index.js +4 -0
  244. package/icons/flight-takeoff/index.d.ts +11 -0
  245. package/icons/flight-takeoff/index.js +4 -0
  246. package/icons/flip-to-back/index.d.ts +11 -0
  247. package/icons/flip-to-back/index.js +4 -0
  248. package/icons/flip-to-front/index.d.ts +11 -0
  249. package/icons/flip-to-front/index.js +4 -0
  250. package/icons/g-translate/index.d.ts +11 -0
  251. package/icons/g-translate/index.js +4 -0
  252. package/icons/gavel/index.d.ts +11 -0
  253. package/icons/gavel/index.js +4 -0
  254. package/icons/get-app/index.d.ts +11 -0
  255. package/icons/get-app/index.js +4 -0
  256. package/icons/gif/index.d.ts +11 -0
  257. package/icons/gif/index.js +4 -0
  258. package/icons/grade/index.d.ts +11 -0
  259. package/icons/grade/index.js +4 -0
  260. package/icons/grading/index.d.ts +11 -0
  261. package/icons/grading/index.js +4 -0
  262. package/icons/group-work/index.d.ts +11 -0
  263. package/icons/group-work/index.js +4 -0
  264. package/icons/help/index.d.ts +11 -0
  265. package/icons/help/index.js +4 -0
  266. package/icons/help-center/index.d.ts +11 -0
  267. package/icons/help-center/index.js +4 -0
  268. package/icons/highlight-alt/index.d.ts +11 -0
  269. package/icons/highlight-alt/index.js +4 -0
  270. package/icons/highlight-off/index.d.ts +11 -0
  271. package/icons/highlight-off/index.js +4 -0
  272. package/icons/history-toggle-off/index.d.ts +11 -0
  273. package/icons/history-toggle-off/index.js +4 -0
  274. package/icons/home/index.d.ts +11 -0
  275. package/icons/home/index.js +4 -0
  276. package/icons/horizontal-split/index.d.ts +11 -0
  277. package/icons/horizontal-split/index.js +4 -0
  278. package/icons/hourglass-disabled/index.d.ts +11 -0
  279. package/icons/hourglass-disabled/index.js +4 -0
  280. package/icons/hourglass-empty/index.d.ts +11 -0
  281. package/icons/hourglass-empty/index.js +4 -0
  282. package/icons/hourglass-full/index.d.ts +11 -0
  283. package/icons/hourglass-full/index.js +4 -0
  284. package/icons/http/index.d.ts +11 -0
  285. package/icons/http/index.js +4 -0
  286. package/icons/https/index.d.ts +11 -0
  287. package/icons/https/index.js +4 -0
  288. package/icons/important-devices/index.d.ts +11 -0
  289. package/icons/important-devices/index.js +4 -0
  290. package/icons/info/index.d.ts +11 -0
  291. package/icons/info/index.js +4 -0
  292. package/icons/input/index.d.ts +11 -0
  293. package/icons/input/index.js +4 -0
  294. package/icons/integration-instructions/index.d.ts +11 -0
  295. package/icons/integration-instructions/index.js +4 -0
  296. package/icons/invert-colors/index.d.ts +11 -0
  297. package/icons/invert-colors/index.js +4 -0
  298. package/icons/label/index.d.ts +11 -0
  299. package/icons/label/index.js +4 -0
  300. package/icons/label-important/index.d.ts +11 -0
  301. package/icons/label-important/index.js +4 -0
  302. package/icons/label-important-outline/index.d.ts +11 -0
  303. package/icons/label-important-outline/index.js +4 -0
  304. package/icons/label-off/index.d.ts +11 -0
  305. package/icons/label-off/index.js +4 -0
  306. package/icons/label-outline/index.d.ts +11 -0
  307. package/icons/label-outline/index.js +4 -0
  308. package/icons/language/index.d.ts +11 -0
  309. package/icons/language/index.js +4 -0
  310. package/icons/launch/index.d.ts +11 -0
  311. package/icons/launch/index.js +4 -0
  312. package/icons/leaderboard/index.d.ts +11 -0
  313. package/icons/leaderboard/index.js +4 -0
  314. package/icons/lightbulb-outline/index.d.ts +11 -0
  315. package/icons/lightbulb-outline/index.js +4 -0
  316. package/icons/line-style/index.d.ts +11 -0
  317. package/icons/line-style/index.js +4 -0
  318. package/icons/line-weight/index.d.ts +11 -0
  319. package/icons/line-weight/index.js +4 -0
  320. package/icons/list/index.d.ts +11 -0
  321. package/icons/list/index.js +4 -0
  322. package/icons/lock/index.d.ts +11 -0
  323. package/icons/lock/index.js +4 -0
  324. package/icons/lock-open/index.d.ts +11 -0
  325. package/icons/lock-open/index.js +4 -0
  326. package/icons/lock-outline/index.d.ts +11 -0
  327. package/icons/lock-outline/index.js +4 -0
  328. package/icons/login/index.d.ts +11 -0
  329. package/icons/login/index.js +4 -0
  330. package/icons/logout/index.d.ts +11 -0
  331. package/icons/logout/index.js +4 -0
  332. package/icons/loyalty/index.d.ts +11 -0
  333. package/icons/loyalty/index.js +4 -0
  334. package/icons/markunread-mailbox/index.d.ts +11 -0
  335. package/icons/markunread-mailbox/index.js +4 -0
  336. package/icons/maximize/index.d.ts +11 -0
  337. package/icons/maximize/index.js +4 -0
  338. package/icons/mediation/index.d.ts +11 -0
  339. package/icons/mediation/index.js +4 -0
  340. package/icons/minimize/index.d.ts +11 -0
  341. package/icons/minimize/index.js +4 -0
  342. package/icons/model-training/index.d.ts +11 -0
  343. package/icons/model-training/index.js +4 -0
  344. package/icons/next-plan/index.d.ts +11 -0
  345. package/icons/next-plan/index.js +4 -0
  346. package/icons/not-accessible/index.d.ts +11 -0
  347. package/icons/not-accessible/index.js +4 -0
  348. package/icons/not-started/index.d.ts +11 -0
  349. package/icons/not-started/index.js +4 -0
  350. package/icons/note-add/index.d.ts +11 -0
  351. package/icons/note-add/index.js +4 -0
  352. package/icons/offline-bolt/index.d.ts +11 -0
  353. package/icons/offline-bolt/index.js +4 -0
  354. package/icons/offline-pin/index.d.ts +11 -0
  355. package/icons/offline-pin/index.js +4 -0
  356. package/icons/online-prediction/index.d.ts +11 -0
  357. package/icons/online-prediction/index.js +4 -0
  358. package/icons/opacity/index.d.ts +11 -0
  359. package/icons/opacity/index.js +4 -0
  360. package/icons/open-in-browser/index.d.ts +11 -0
  361. package/icons/open-in-browser/index.js +4 -0
  362. package/icons/open-in-full/index.d.ts +11 -0
  363. package/icons/open-in-full/index.js +4 -0
  364. package/icons/open-with/index.d.ts +11 -0
  365. package/icons/open-with/index.js +4 -0
  366. package/icons/outbond/index.d.ts +11 -0
  367. package/icons/outbond/index.js +4 -0
  368. package/icons/outlet/index.d.ts +11 -0
  369. package/icons/outlet/index.js +4 -0
  370. package/icons/pageview/index.d.ts +11 -0
  371. package/icons/pageview/index.js +4 -0
  372. package/icons/pan-tool/index.d.ts +11 -0
  373. package/icons/pan-tool/index.js +4 -0
  374. package/icons/payment/index.d.ts +11 -0
  375. package/icons/payment/index.js +4 -0
  376. package/icons/pending/index.d.ts +11 -0
  377. package/icons/pending/index.js +4 -0
  378. package/icons/pending-actions/index.d.ts +11 -0
  379. package/icons/pending-actions/index.js +4 -0
  380. package/icons/perm-camera-mic/index.d.ts +11 -0
  381. package/icons/perm-camera-mic/index.js +4 -0
  382. package/icons/perm-contact-calendar/index.d.ts +11 -0
  383. package/icons/perm-contact-calendar/index.js +4 -0
  384. package/icons/perm-data-setting/index.d.ts +11 -0
  385. package/icons/perm-data-setting/index.js +4 -0
  386. package/icons/perm-device-information/index.d.ts +11 -0
  387. package/icons/perm-device-information/index.js +4 -0
  388. package/icons/perm-identity/index.d.ts +11 -0
  389. package/icons/perm-identity/index.js +4 -0
  390. package/icons/perm-media/index.d.ts +11 -0
  391. package/icons/perm-media/index.js +4 -0
  392. package/icons/perm-phone-msg/index.d.ts +11 -0
  393. package/icons/perm-phone-msg/index.js +4 -0
  394. package/icons/perm-scan-wifi/index.d.ts +11 -0
  395. package/icons/perm-scan-wifi/index.js +4 -0
  396. package/icons/pets/index.d.ts +11 -0
  397. package/icons/pets/index.js +4 -0
  398. package/icons/picture-in-picture/index.d.ts +11 -0
  399. package/icons/picture-in-picture/index.js +4 -0
  400. package/icons/picture-in-picture-alt/index.d.ts +11 -0
  401. package/icons/picture-in-picture-alt/index.js +4 -0
  402. package/icons/plagiarism/index.d.ts +11 -0
  403. package/icons/plagiarism/index.js +4 -0
  404. package/icons/play-for-work/index.d.ts +11 -0
  405. package/icons/play-for-work/index.js +4 -0
  406. package/icons/polymer/index.d.ts +11 -0
  407. package/icons/polymer/index.js +4 -0
  408. package/icons/power-settings-new/index.d.ts +11 -0
  409. package/icons/power-settings-new/index.js +4 -0
  410. package/icons/pregnant-woman/index.d.ts +11 -0
  411. package/icons/pregnant-woman/index.js +4 -0
  412. package/icons/preview/index.d.ts +11 -0
  413. package/icons/preview/index.js +4 -0
  414. package/icons/print/index.d.ts +11 -0
  415. package/icons/print/index.js +4 -0
  416. package/icons/privacy-tip/index.d.ts +11 -0
  417. package/icons/privacy-tip/index.js +4 -0
  418. package/icons/published-with-changes/index.d.ts +11 -0
  419. package/icons/published-with-changes/index.js +4 -0
  420. package/icons/query-builder/index.d.ts +11 -0
  421. package/icons/query-builder/index.js +4 -0
  422. package/icons/question-answer/index.d.ts +11 -0
  423. package/icons/question-answer/index.js +4 -0
  424. package/icons/quickreply/index.d.ts +11 -0
  425. package/icons/quickreply/index.js +4 -0
  426. package/icons/receipt/index.d.ts +11 -0
  427. package/icons/receipt/index.js +4 -0
  428. package/icons/record-voice-over/index.d.ts +11 -0
  429. package/icons/record-voice-over/index.js +4 -0
  430. package/icons/redeem/index.d.ts +11 -0
  431. package/icons/redeem/index.js +4 -0
  432. package/icons/remove-shopping-cart/index.d.ts +11 -0
  433. package/icons/remove-shopping-cart/index.js +4 -0
  434. package/icons/reorder/index.d.ts +11 -0
  435. package/icons/reorder/index.js +4 -0
  436. package/icons/report-problem/index.d.ts +11 -0
  437. package/icons/report-problem/index.js +4 -0
  438. package/icons/request-page/index.d.ts +11 -0
  439. package/icons/request-page/index.js +4 -0
  440. package/icons/restore/index.d.ts +11 -0
  441. package/icons/restore/index.js +4 -0
  442. package/icons/restore-from-trash/index.d.ts +11 -0
  443. package/icons/restore-from-trash/index.js +4 -0
  444. package/icons/restore-page/index.d.ts +11 -0
  445. package/icons/restore-page/index.js +4 -0
  446. package/icons/room/index.d.ts +11 -0
  447. package/icons/room/index.js +4 -0
  448. package/icons/rounded-corner/index.d.ts +11 -0
  449. package/icons/rounded-corner/index.js +4 -0
  450. package/icons/rowing/index.d.ts +11 -0
  451. package/icons/rowing/index.js +4 -0
  452. package/icons/rule/index.d.ts +11 -0
  453. package/icons/rule/index.js +4 -0
  454. package/icons/schedule/index.d.ts +11 -0
  455. package/icons/schedule/index.js +4 -0
  456. package/icons/search-off/index.d.ts +11 -0
  457. package/icons/search-off/index.js +4 -0
  458. package/icons/settings-applications/index.d.ts +11 -0
  459. package/icons/settings-applications/index.js +4 -0
  460. package/icons/settings-backup-restore/index.d.ts +11 -0
  461. package/icons/settings-backup-restore/index.js +4 -0
  462. package/icons/settings-bluetooth/index.d.ts +11 -0
  463. package/icons/settings-bluetooth/index.js +4 -0
  464. package/icons/settings-brightness/index.d.ts +11 -0
  465. package/icons/settings-brightness/index.js +4 -0
  466. package/icons/settings-cell/index.d.ts +11 -0
  467. package/icons/settings-cell/index.js +4 -0
  468. package/icons/settings-ethernet/index.d.ts +11 -0
  469. package/icons/settings-ethernet/index.js +4 -0
  470. package/icons/settings-input-antenna/index.d.ts +11 -0
  471. package/icons/settings-input-antenna/index.js +4 -0
  472. package/icons/settings-input-component/index.d.ts +11 -0
  473. package/icons/settings-input-component/index.js +4 -0
  474. package/icons/settings-input-composite/index.d.ts +11 -0
  475. package/icons/settings-input-composite/index.js +4 -0
  476. package/icons/settings-input-hdmi/index.d.ts +11 -0
  477. package/icons/settings-input-hdmi/index.js +4 -0
  478. package/icons/settings-input-svideo/index.d.ts +11 -0
  479. package/icons/settings-input-svideo/index.js +4 -0
  480. package/icons/settings-overscan/index.d.ts +11 -0
  481. package/icons/settings-overscan/index.js +4 -0
  482. package/icons/settings-phone/index.d.ts +11 -0
  483. package/icons/settings-phone/index.js +4 -0
  484. package/icons/settings-power/index.d.ts +11 -0
  485. package/icons/settings-power/index.js +4 -0
  486. package/icons/settings-remote/index.d.ts +11 -0
  487. package/icons/settings-remote/index.js +4 -0
  488. package/icons/settings-voice/index.d.ts +11 -0
  489. package/icons/settings-voice/index.js +4 -0
  490. package/icons/shop/index.d.ts +11 -0
  491. package/icons/shop/index.js +4 -0
  492. package/icons/shop-two/index.d.ts +11 -0
  493. package/icons/shop-two/index.js +4 -0
  494. package/icons/shopping-bag/index.d.ts +11 -0
  495. package/icons/shopping-bag/index.js +4 -0
  496. package/icons/shopping-basket/index.d.ts +11 -0
  497. package/icons/shopping-basket/index.js +4 -0
  498. package/icons/shopping-cart/index.d.ts +11 -0
  499. package/icons/shopping-cart/index.js +4 -0
  500. package/icons/smart-button/index.d.ts +11 -0
  501. package/icons/smart-button/index.js +4 -0
  502. package/icons/source/index.d.ts +11 -0
  503. package/icons/source/index.js +4 -0
  504. package/icons/speaker-notes/index.d.ts +11 -0
  505. package/icons/speaker-notes/index.js +4 -0
  506. package/icons/speaker-notes-off/index.d.ts +11 -0
  507. package/icons/speaker-notes-off/index.js +4 -0
  508. package/icons/spellcheck/index.d.ts +11 -0
  509. package/icons/spellcheck/index.js +4 -0
  510. package/icons/star-rate/index.d.ts +11 -0
  511. package/icons/star-rate/index.js +4 -0
  512. package/icons/stars/index.d.ts +11 -0
  513. package/icons/stars/index.js +4 -0
  514. package/icons/sticky-note-2/index.d.ts +11 -0
  515. package/icons/sticky-note-2/index.js +4 -0
  516. package/icons/store/index.d.ts +11 -0
  517. package/icons/store/index.js +4 -0
  518. package/icons/subject/index.d.ts +11 -0
  519. package/icons/subject/index.js +4 -0
  520. package/icons/subtitles-off/index.d.ts +11 -0
  521. package/icons/subtitles-off/index.js +4 -0
  522. package/icons/supervised-user-circle/index.d.ts +11 -0
  523. package/icons/supervised-user-circle/index.js +4 -0
  524. package/icons/supervisor-account/index.d.ts +11 -0
  525. package/icons/supervisor-account/index.js +4 -0
  526. package/icons/support/index.d.ts +11 -0
  527. package/icons/support/index.js +4 -0
  528. package/icons/swap-horiz/index.d.ts +11 -0
  529. package/icons/swap-horiz/index.js +4 -0
  530. package/icons/swap-horizontal-circle/index.d.ts +11 -0
  531. package/icons/swap-horizontal-circle/index.js +4 -0
  532. package/icons/swap-vertical-circle/index.d.ts +11 -0
  533. package/icons/swap-vertical-circle/index.js +4 -0
  534. package/icons/sync-alt/index.d.ts +11 -0
  535. package/icons/sync-alt/index.js +4 -0
  536. package/icons/system-update-alt/index.d.ts +11 -0
  537. package/icons/system-update-alt/index.js +4 -0
  538. package/icons/tab/index.d.ts +11 -0
  539. package/icons/tab/index.js +4 -0
  540. package/icons/tab-unselected/index.d.ts +11 -0
  541. package/icons/tab-unselected/index.js +4 -0
  542. package/icons/table-view/index.d.ts +11 -0
  543. package/icons/table-view/index.js +4 -0
  544. package/icons/text-rotate-up/index.d.ts +11 -0
  545. package/icons/text-rotate-up/index.js +4 -0
  546. package/icons/text-rotate-vertical/index.d.ts +11 -0
  547. package/icons/text-rotate-vertical/index.js +4 -0
  548. package/icons/text-rotation-angledown/index.d.ts +11 -0
  549. package/icons/text-rotation-angledown/index.js +4 -0
  550. package/icons/text-rotation-angleup/index.d.ts +11 -0
  551. package/icons/text-rotation-angleup/index.js +4 -0
  552. package/icons/text-rotation-down/index.d.ts +11 -0
  553. package/icons/text-rotation-down/index.js +4 -0
  554. package/icons/text-rotation-none/index.d.ts +11 -0
  555. package/icons/text-rotation-none/index.js +4 -0
  556. package/icons/theaters/index.d.ts +11 -0
  557. package/icons/theaters/index.js +4 -0
  558. package/icons/thumb-down/index.d.ts +11 -0
  559. package/icons/thumb-down/index.js +4 -0
  560. package/icons/thumb-up/index.d.ts +11 -0
  561. package/icons/thumb-up/index.js +4 -0
  562. package/icons/thumbs-up-down/index.d.ts +11 -0
  563. package/icons/thumbs-up-down/index.js +4 -0
  564. package/icons/timeline/index.d.ts +11 -0
  565. package/icons/timeline/index.js +4 -0
  566. package/icons/toc/index.d.ts +11 -0
  567. package/icons/toc/index.js +4 -0
  568. package/icons/today/index.d.ts +11 -0
  569. package/icons/today/index.js +4 -0
  570. package/icons/toll/index.d.ts +11 -0
  571. package/icons/toll/index.js +4 -0
  572. package/icons/touch-app/index.d.ts +11 -0
  573. package/icons/touch-app/index.js +4 -0
  574. package/icons/tour/index.d.ts +11 -0
  575. package/icons/tour/index.js +4 -0
  576. package/icons/track-changes/index.d.ts +11 -0
  577. package/icons/track-changes/index.js +4 -0
  578. package/icons/translate/index.d.ts +11 -0
  579. package/icons/translate/index.js +4 -0
  580. package/icons/trending-down/index.d.ts +11 -0
  581. package/icons/trending-down/index.js +4 -0
  582. package/icons/trending-flat/index.d.ts +11 -0
  583. package/icons/trending-flat/index.js +4 -0
  584. package/icons/trending-up/index.d.ts +11 -0
  585. package/icons/trending-up/index.js +4 -0
  586. package/icons/turned-in/index.d.ts +11 -0
  587. package/icons/turned-in/index.js +4 -0
  588. package/icons/turned-in-not/index.d.ts +11 -0
  589. package/icons/turned-in-not/index.js +4 -0
  590. package/icons/unpublished/index.d.ts +11 -0
  591. package/icons/unpublished/index.js +4 -0
  592. package/icons/upgrade/index.d.ts +11 -0
  593. package/icons/upgrade/index.js +4 -0
  594. package/icons/verified/index.d.ts +11 -0
  595. package/icons/verified/index.js +4 -0
  596. package/icons/verified-user/index.d.ts +11 -0
  597. package/icons/verified-user/index.js +4 -0
  598. package/icons/vertical-split/index.d.ts +11 -0
  599. package/icons/vertical-split/index.js +4 -0
  600. package/icons/view-agenda/index.d.ts +11 -0
  601. package/icons/view-agenda/index.js +4 -0
  602. package/icons/view-array/index.d.ts +11 -0
  603. package/icons/view-array/index.js +4 -0
  604. package/icons/view-carousel/index.d.ts +11 -0
  605. package/icons/view-carousel/index.js +4 -0
  606. package/icons/view-column/index.d.ts +11 -0
  607. package/icons/view-column/index.js +4 -0
  608. package/icons/view-day/index.d.ts +11 -0
  609. package/icons/view-day/index.js +4 -0
  610. package/icons/view-headline/index.d.ts +11 -0
  611. package/icons/view-headline/index.js +4 -0
  612. package/icons/view-list/index.d.ts +11 -0
  613. package/icons/view-list/index.js +4 -0
  614. package/icons/view-module/index.d.ts +11 -0
  615. package/icons/view-module/index.js +4 -0
  616. package/icons/view-quilt/index.d.ts +11 -0
  617. package/icons/view-quilt/index.js +4 -0
  618. package/icons/view-sidebar/index.d.ts +11 -0
  619. package/icons/view-sidebar/index.js +4 -0
  620. package/icons/view-stream/index.d.ts +11 -0
  621. package/icons/view-stream/index.js +4 -0
  622. package/icons/view-week/index.d.ts +11 -0
  623. package/icons/view-week/index.js +4 -0
  624. package/icons/visibility/index.d.ts +11 -0
  625. package/icons/visibility/index.js +4 -0
  626. package/icons/visibility-off/index.d.ts +11 -0
  627. package/icons/visibility-off/index.js +4 -0
  628. package/icons/voice-over-off/index.d.ts +11 -0
  629. package/icons/voice-over-off/index.js +4 -0
  630. package/icons/watch-later/index.d.ts +11 -0
  631. package/icons/watch-later/index.js +4 -0
  632. package/icons/wifi-protected-setup/index.d.ts +11 -0
  633. package/icons/wifi-protected-setup/index.js +4 -0
  634. package/icons/work/index.d.ts +11 -0
  635. package/icons/work/index.js +4 -0
  636. package/icons/work-off/index.d.ts +11 -0
  637. package/icons/work-off/index.js +4 -0
  638. package/icons/work-outline/index.d.ts +11 -0
  639. package/icons/work-outline/index.js +4 -0
  640. package/icons/wysiwyg/index.d.ts +11 -0
  641. package/icons/wysiwyg/index.js +4 -0
  642. package/icons/youtube-searched-for/index.d.ts +11 -0
  643. package/icons/youtube-searched-for/index.js +4 -0
  644. package/icons/zoom-in/index.d.ts +11 -0
  645. package/icons/zoom-in/index.js +4 -0
  646. package/icons/zoom-out/index.d.ts +11 -0
  647. package/icons/zoom-out/index.js +4 -0
  648. package/icons-branded/credit-card/index.d.ts +11 -0
  649. package/icons-branded/credit-card/index.js +4 -0
  650. package/icons-branded/finance/index.d.ts +11 -0
  651. package/icons-branded/finance/index.js +4 -0
  652. package/icons-branded/global-settings/index.d.ts +11 -0
  653. package/icons-branded/global-settings/index.js +4 -0
  654. package/icons-branded/help/index.d.ts +11 -0
  655. package/icons-branded/help/index.js +4 -0
  656. package/icons-branded/verified-phone/index.d.ts +11 -0
  657. package/icons-branded/verified-phone/index.js +4 -0
  658. package/index.d.ts +537 -220
  659. package/index.js +538 -221
  660. package/package.json +1 -1
  661. package/popover/index.js +29 -19
  662. package/radio/index.js +18 -17
  663. package/search/index.js +8 -11
  664. package/segmented-control/index.js +20 -113
  665. package/segmented-control-option/index.d.ts +0 -1
  666. package/segmented-control-option/index.js +1 -4
  667. package/segmented-icon-control/index.js +30 -26
  668. package/segmented-icon-control-option/index.d.ts +0 -1
  669. package/segmented-icon-control-option/index.js +6 -15
  670. package/select/index.d.ts +0 -1
  671. package/select/index.js +3 -5
  672. package/select-option/index.d.ts +3 -3
  673. package/select-option/index.js +2 -2
  674. package/tabs/index.js +6 -8
  675. package/utils.d.ts +4 -3
  676. package/utils.js +23 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "files": [
5
5
  "theme.css",
6
6
  "**/*/*.js",
package/popover/index.js CHANGED
@@ -12,11 +12,12 @@ 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 } from '../utils';
16
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative}dialog{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:none;border-radius:4px;overflow-y:auto;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}</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 } 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>';
17
17
  const orientationValues = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
18
18
  const template = document.createElement('template');
19
19
  template.innerHTML = templateHTML;
20
+ const POPOVER_VERTICAL_OFFSET = 4;
20
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 {
21
22
  constructor() {
22
23
  super();
@@ -165,21 +166,28 @@ defineCustomElement('sinch-popover', (_$target = new WeakMap(), _$dialog = new W
165
166
  }));
166
167
 
167
168
  function _onExpand2() {
169
+ if (_classPrivateMethodGet(this, _isOpen, _isOpen2).call(this)) {
170
+ return;
171
+ }
172
+
168
173
  _classPrivateFieldGet(this, _$target).setAttribute('aria-expanded', 'true');
169
174
 
170
- if (!_classPrivateMethodGet(this, _isOpen, _isOpen2).call(this)) {
171
- _classPrivateFieldGet(this, _$dialog).showModal();
172
- }
175
+ _classPrivateFieldGet(this, _$dialog).showModal();
173
176
 
174
177
  _classPrivateMethodGet(this, _updateOrientation, _updateOrientation2).call(this);
178
+
179
+ document.body.style.overflow = 'hidden';
175
180
  }
176
181
 
177
182
  function _onCollapse2() {
183
+ if (!_classPrivateMethodGet(this, _isOpen, _isOpen2).call(this)) {
184
+ return;
185
+ }
186
+
178
187
  _classPrivateFieldGet(this, _$target).setAttribute('aria-expanded', 'false');
179
188
 
180
- if (_classPrivateMethodGet(this, _isOpen, _isOpen2).call(this)) {
181
- _classPrivateFieldGet(this, _$dialog).close?.();
182
- }
189
+ _classPrivateFieldGet(this, _$dialog).close?.();
190
+ document.body.style.overflow = '';
183
191
  }
184
192
 
185
193
  function _isOpen2() {
@@ -187,37 +195,39 @@ function _isOpen2() {
187
195
  }
188
196
 
189
197
  function _updateOrientation2() {
190
- _classPrivateFieldGet(this, _$dialog).style.transform = `initial`;
191
- _classPrivateFieldGet(this, _$dialog).style.width = `max-content`;
198
+ _classPrivateFieldGet(this, _$dialog).style.transform = 'initial';
199
+ _classPrivateFieldGet(this, _$dialog).style.width = 'fit-content';
192
200
 
193
- const buttonRect = _classPrivateFieldGet(this, _$target).getBoundingClientRect();
201
+ const targetRect = _classPrivateFieldGet(this, _$target).getBoundingClientRect();
194
202
 
195
203
  const modalRect = _classPrivateFieldGet(this, _$dialog).getBoundingClientRect();
196
204
 
197
- const width = Math.max(modalRect.width, buttonRect.width);
198
- const widthDiff = Math.max(buttonRect.width - modalRect.width, 0);
199
205
  let leftOffset = 0;
200
206
  let topOffset = 0;
201
207
  const orient = this.orientation;
208
+ const shouldExpandWidthToTarget = getCssVar(this, '--sinch-popover-expand-width') !== null;
209
+ const largestWidth = Math.max(modalRect.width, targetRect.width);
210
+ const widthDiff = shouldExpandWidthToTarget ? Math.max(largestWidth - modalRect.width, 0) * 0.5 : 0;
211
+ const resultWidth = shouldExpandWidthToTarget ? largestWidth : modalRect.width;
202
212
 
203
213
  if (orient === 'bottom-right' || orient === 'top-right') {
204
- leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, buttonRect.x - modalRect.x + widthDiff * 0.5));
214
+ leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, targetRect.x - modalRect.x) + widthDiff);
205
215
  }
206
216
 
207
217
  if (orient === 'bottom-left' || orient === 'top-left') {
208
- leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, buttonRect.x + buttonRect.width - modalRect.x - modalRect.width - widthDiff * 0.5));
218
+ leftOffset = Math.min(modalRect.x, Math.max(-modalRect.x, targetRect.x + targetRect.width - modalRect.x - modalRect.width) - widthDiff);
209
219
  }
210
220
 
211
221
  if (orient === 'bottom-left' || orient === 'bottom-right') {
212
- topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, buttonRect.y + buttonRect.height - modalRect.y + 8));
222
+ topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, targetRect.y + targetRect.height - modalRect.y + POPOVER_VERTICAL_OFFSET));
213
223
  }
214
224
 
215
225
  if (orient === 'top-left' || orient === 'top-right') {
216
- topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, buttonRect.y - modalRect.y - modalRect.height - 8));
226
+ topOffset = Math.min(modalRect.y, Math.max(-modalRect.y, targetRect.y - modalRect.y - modalRect.height - POPOVER_VERTICAL_OFFSET));
217
227
  }
218
228
 
219
- _classPrivateFieldGet(this, _$dialog).style.transform = `translateX(${leftOffset}px) translateY(${topOffset}px)`;
220
- _classPrivateFieldGet(this, _$dialog).style.width = `${width}px`;
229
+ _classPrivateFieldGet(this, _$dialog).style.transform = `translate(${leftOffset}px, ${topOffset}px)`;
230
+ _classPrivateFieldGet(this, _$dialog).style.width = `${resultWidth}px`;
221
231
  }
222
232
 
223
233
  function _dispatchCloseEvent2() {
package/radio/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
2
2
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
3
3
 
4
- var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _getEnabledRadioElements;
4
+ var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _getEnabledRadioElements, _findSelectedOption;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -11,20 +11,16 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
11
11
 
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
- import { isRadioOptionElement } from '../radio-option';
15
- import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } from '../utils';
14
+ import { defineCustomElement, getAttribute, getBooleanAttribute, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
16
15
  const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;gap:8px;box-sizing:border-box;width:100%}</style><div id="wrapper"><slot></slot></div>';
17
-
18
- const findSelectedOption = elements => {
19
- return elements.find(el => el.checked) ?? null;
20
- };
21
-
22
16
  const template = document.createElement('template');
23
17
  template.innerHTML = templateHTML;
24
- defineCustomElement('sinch-radio', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _getEnabledRadioElements = new WeakSet(), class extends NectaryElement {
18
+ defineCustomElement('sinch-radio', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _getEnabledRadioElements = new WeakSet(), _findSelectedOption = new WeakSet(), class extends NectaryElement {
25
19
  constructor() {
26
20
  super();
27
21
 
22
+ _classPrivateMethodInitSpec(this, _findSelectedOption);
23
+
28
24
  _classPrivateMethodInitSpec(this, _getEnabledRadioElements);
29
25
 
30
26
  _classPrivateMethodInitSpec(this, _getPrevOption);
@@ -144,9 +140,8 @@ defineCustomElement('sinch-radio', (_$slot = new WeakMap(), _onOptionKeyDown = n
144
140
 
145
141
  function _onValueChange2(value) {
146
142
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
147
- if (isRadioOptionElement($option)) {
148
- $option.checked = $option.disabled !== true && $option.value === value;
149
- }
143
+ const isChecked = !getBooleanAttribute($option, 'disabled') && value === getAttribute($option, 'value', '');
144
+ updateBooleanAttribute($option, 'checked', isChecked);
150
145
  }
151
146
  }
152
147
 
@@ -159,7 +154,7 @@ function _dispatchChangeEvent2(value) {
159
154
 
160
155
  function _getFirstOption2() {
161
156
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
162
- if (isRadioOptionElement($option) && $option.disabled !== true) {
157
+ if ($option.disabled !== true) {
163
158
  return $option;
164
159
  }
165
160
  }
@@ -169,7 +164,7 @@ function _getFirstOption2() {
169
164
 
170
165
  function _getLastOption2() {
171
166
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements().reverse()) {
172
- if (isRadioOptionElement($option) && $option.disabled !== true) {
167
+ if ($option.disabled !== true) {
173
168
  return $option;
174
169
  }
175
170
  }
@@ -180,7 +175,8 @@ function _getLastOption2() {
180
175
  function _getNextOption2() {
181
176
  const $options = _classPrivateMethodGet(this, _getEnabledRadioElements, _getEnabledRadioElements2).call(this);
182
177
 
183
- const $selectedOption = findSelectedOption($options);
178
+ const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this, $options);
179
+
184
180
  const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
185
181
 
186
182
  if (currentIndex < 0) {
@@ -193,7 +189,8 @@ function _getNextOption2() {
193
189
  function _getPrevOption2() {
194
190
  const $options = _classPrivateMethodGet(this, _getEnabledRadioElements, _getEnabledRadioElements2).call(this);
195
191
 
196
- const $selectedOption = findSelectedOption($options);
192
+ const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this, $options);
193
+
197
194
  const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
198
195
 
199
196
  if (currentIndex < 0) {
@@ -204,5 +201,9 @@ function _getPrevOption2() {
204
201
  }
205
202
 
206
203
  function _getEnabledRadioElements2() {
207
- return _classPrivateFieldGet(this, _$slot).assignedElements().filter(opt => isRadioOptionElement(opt) && opt.disabled !== true);
204
+ return _classPrivateFieldGet(this, _$slot).assignedElements().filter(el => el.disabled !== true);
205
+ }
206
+
207
+ function _findSelectedOption2(elements) {
208
+ return elements.find(el => el.checked) ?? null;
208
209
  }
package/search/index.js CHANGED
@@ -11,7 +11,6 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
11
11
 
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
- import { isSinchSearchOptionElement } from '../search-option';
15
14
  import { attrValueToPixels, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getRect, NectaryElement, updateAttribute, updateIntegerAttribute } from '../utils';
16
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>';
17
16
  import '../icons/search';
@@ -141,9 +140,7 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
141
140
  e.stopPropagation();
142
141
  const $elem = e.target;
143
142
 
144
- if (isSinchSearchOptionElement($elem)) {
145
- _classPrivateMethodGet(this, _onValueChange, _onValueChange2).call(this, $elem.text);
146
- }
143
+ _classPrivateMethodGet(this, _onValueChange, _onValueChange2).call(this, $elem.text);
147
144
 
148
145
  _classPrivateMethodGet(this, _onCollapse, _onCollapse2).call(this);
149
146
  }
@@ -467,15 +464,15 @@ function _onCollapse2() {
467
464
  }
468
465
 
469
466
  function _getFirstOption2() {
470
- return _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement)[0] ?? null;
467
+ return _classPrivateFieldGet(this, _$optionSlot).assignedElements()[0] ?? null;
471
468
  }
472
469
 
473
470
  function _getLastOption2() {
474
- return _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement).reverse()[0] ?? null;
471
+ return _classPrivateFieldGet(this, _$optionSlot).assignedElements().reverse()[0] ?? null;
475
472
  }
476
473
 
477
474
  function _getNextOption2() {
478
- const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement);
475
+ const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements();
479
476
 
480
477
  const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this);
481
478
 
@@ -489,7 +486,7 @@ function _getNextOption2() {
489
486
  }
490
487
 
491
488
  function _getPrevOption2() {
492
- const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement);
489
+ const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements();
493
490
 
494
491
  const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this);
495
492
 
@@ -516,9 +513,9 @@ function _selectOption2($option) {
516
513
  }
517
514
 
518
515
  function _findSelectedOption2() {
519
- for (const el of _classPrivateFieldGet(this, _$optionSlot).assignedElements()) {
520
- if (isSinchSearchOptionElement(el) && el.selected) {
521
- return el;
516
+ for (const $option of _classPrivateFieldGet(this, _$optionSlot).assignedElements()) {
517
+ if ($option.selected) {
518
+ return $option;
522
519
  }
523
520
  }
524
521
 
@@ -1,7 +1,7 @@
1
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
2
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _getEnabledRadioElements;
4
+ var _$slot, _$sh, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -11,30 +11,14 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
11
11
 
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
- import { isSegmentedControlOptionElement } from '../segmented-control-option';
15
- import { defineCustomElement, getAttribute, NectaryElement, updateAttribute } from '../utils';
14
+ import { defineCustomElement, getAttribute, getBooleanAttribute, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
16
15
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row;width:100%;box-sizing:border-box}</style><div id="wrapper"><slot></slot></div>';
17
-
18
- const findSelectedOption = elements => {
19
- return elements.find(el => el.checked) ?? null;
20
- };
21
-
22
16
  const template = document.createElement('template');
23
17
  template.innerHTML = templateHTML;
24
- defineCustomElement('sinch-segmented-control', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _getEnabledRadioElements = new WeakSet(), class extends NectaryElement {
18
+ defineCustomElement('sinch-segmented-control', (_$slot = new WeakMap(), _$sh = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), class extends NectaryElement {
25
19
  constructor() {
26
20
  super();
27
21
 
28
- _classPrivateMethodInitSpec(this, _getEnabledRadioElements);
29
-
30
- _classPrivateMethodInitSpec(this, _getPrevOption);
31
-
32
- _classPrivateMethodInitSpec(this, _getNextOption);
33
-
34
- _classPrivateMethodInitSpec(this, _getLastOption);
35
-
36
- _classPrivateMethodInitSpec(this, _getFirstOption);
37
-
38
22
  _classPrivateMethodInitSpec(this, _dispatchChangeEvent);
39
23
 
40
24
  _classPrivateMethodInitSpec(this, _onValueChange);
@@ -44,43 +28,9 @@ defineCustomElement('sinch-segmented-control', (_$slot = new WeakMap(), _onOptio
44
28
  value: void 0
45
29
  });
46
30
 
47
- _classPrivateFieldInitSpec(this, _onOptionKeyDown, {
31
+ _classPrivateFieldInitSpec(this, _$sh, {
48
32
  writable: true,
49
- value: e => {
50
- switch (e.code) {
51
- case 'ArrowUp':
52
- case 'ArrowLeft':
53
- {
54
- e.preventDefault();
55
-
56
- const $option = _classPrivateMethodGet(this, _getPrevOption, _getPrevOption2).call(this);
57
-
58
- if ($option !== null) {
59
- $option.focus();
60
-
61
- _classPrivateMethodGet(this, _dispatchChangeEvent, _dispatchChangeEvent2).call(this, $option.value);
62
- }
63
-
64
- break;
65
- }
66
-
67
- case 'ArrowDown':
68
- case 'ArrowRight':
69
- {
70
- e.preventDefault();
71
-
72
- const $option = _classPrivateMethodGet(this, _getNextOption, _getNextOption2).call(this);
73
-
74
- if ($option !== null) {
75
- $option.focus();
76
-
77
- _classPrivateMethodGet(this, _dispatchChangeEvent, _dispatchChangeEvent2).call(this, $option.value);
78
- }
79
-
80
- break;
81
- }
82
- }
83
- }
33
+ value: void 0
84
34
  });
85
35
 
86
36
  _classPrivateFieldInitSpec(this, _onSlotChange, {
@@ -101,16 +51,24 @@ defineCustomElement('sinch-segmented-control', (_$slot = new WeakMap(), _onOptio
101
51
 
102
52
  const shadowRoot = this.attachShadow();
103
53
  shadowRoot.appendChild(template.content.cloneNode(true));
104
- shadowRoot.addEventListener('keydown', _classPrivateFieldGet(this, _onOptionKeyDown));
105
- shadowRoot.addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
106
54
 
107
- _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
55
+ _classPrivateFieldSet(this, _$sh, shadowRoot);
108
56
 
109
- _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
57
+ _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
110
58
  }
111
59
 
112
60
  connectedCallback() {
113
61
  this.setAttribute('role', 'tablist');
62
+
63
+ _classPrivateFieldGet(this, _$sh).addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
64
+
65
+ _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
66
+ }
67
+
68
+ disconnectedCallback() {
69
+ _classPrivateFieldGet(this, _$sh).removeEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
70
+
71
+ _classPrivateFieldGet(this, _$slot).removeEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
114
72
  }
115
73
 
116
74
  static get observedAttributes() {
@@ -144,9 +102,8 @@ defineCustomElement('sinch-segmented-control', (_$slot = new WeakMap(), _onOptio
144
102
 
145
103
  function _onValueChange2(value) {
146
104
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
147
- if (isSegmentedControlOptionElement($option)) {
148
- $option.checked = $option.disabled !== true && $option.value === value;
149
- }
105
+ const isChecked = !getBooleanAttribute($option, 'disabled') && value === getAttribute($option, 'value', '');
106
+ updateBooleanAttribute($option, 'checked', isChecked);
150
107
  }
151
108
  }
152
109
 
@@ -155,54 +112,4 @@ function _dispatchChangeEvent2(value) {
155
112
  detail: value,
156
113
  bubbles: true
157
114
  }));
158
- }
159
-
160
- function _getFirstOption2() {
161
- for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
162
- if (isSegmentedControlOptionElement($option) && $option.disabled !== true) {
163
- return $option;
164
- }
165
- }
166
-
167
- return null;
168
- }
169
-
170
- function _getLastOption2() {
171
- for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements().reverse()) {
172
- if (isSegmentedControlOptionElement($option) && $option.disabled !== true) {
173
- return $option;
174
- }
175
- }
176
-
177
- return null;
178
- }
179
-
180
- function _getNextOption2() {
181
- const $options = _classPrivateMethodGet(this, _getEnabledRadioElements, _getEnabledRadioElements2).call(this);
182
-
183
- const $selectedOption = findSelectedOption($options);
184
- const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
185
-
186
- if (currentIndex < 0) {
187
- return _classPrivateMethodGet(this, _getFirstOption, _getFirstOption2).call(this);
188
- }
189
-
190
- return $options[(currentIndex + 1) % $options.length];
191
- }
192
-
193
- function _getPrevOption2() {
194
- const $options = _classPrivateMethodGet(this, _getEnabledRadioElements, _getEnabledRadioElements2).call(this);
195
-
196
- const $selectedOption = findSelectedOption($options);
197
- const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
198
-
199
- if (currentIndex < 0) {
200
- return _classPrivateMethodGet(this, _getLastOption, _getLastOption2).call(this);
201
- }
202
-
203
- return $options[(currentIndex - 1 + $options.length) % $options.length];
204
- }
205
-
206
- function _getEnabledRadioElements2() {
207
- return _classPrivateFieldGet(this, _$slot).assignedElements().filter(opt => isSegmentedControlOptionElement(opt) && opt.disabled !== true);
208
115
  }
@@ -1,6 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { FocusEvent } from 'react';
3
- export declare const isSegmentedControlOptionElement: (element: EventTarget | Element | null) => element is TSinchSegmentedControlOptionElement;
4
3
  export declare type TSinchSegmentedControlOptionElement = HTMLElement & {
5
4
  value: string;
6
5
  disabled: boolean;
@@ -7,10 +7,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
7
7
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
8
8
 
9
9
  import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
10
- const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;position:relative;flex-direction:row;align-items:center;gap:12px;width:100%;height:42px;padding:8px 20px;box-sizing:border-box;border:1px solid var(--sinch-color-snow-600);border-left-width:0;border-right-width:0;color:var(--sinch-color-stormy-500);background-color:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:16px}#wrapper:hover{background-color:var(--sinch-color-snow-500)}:host(:first-child) #wrapper{border-left-width:1px;border-top-left-radius:4px;border-bottom-left-radius:4px}:host(:last-child) #wrapper{border-right-width:1px;border-top-right-radius:4px;border-bottom-right-radius:4px}#content{font:var(--sinch-font-title-s);flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([checked]:not([checked=false])) #wrapper{border-color:var(--sinch-color-stormy-500)}:host([checked]:not([checked=false]):not(:first-child)) #wrapper::before{content:"";width:1px;background-color:var(--sinch-color-stormy-500);position:absolute;left:0;top:-1px;bottom:-1px}:host([checked]:not([checked=false]):not(:last-child)) #wrapper::after{content:"";width:1px;background-color:var(--sinch-color-stormy-500);position:absolute;right:0;top:-1px;bottom:-1px}#button{all:initial;position:absolute;left:0;top:0;box-sizing:border-box;width:100%;height:100%;cursor:pointer;z-index:1}#button:focus::before{content:"";position:absolute;left:-3px;right:-3px;top:-4px;bottom:-4px;border:2px solid var(--sinch-color-aqua-400)}#button:disabled{cursor:unset}:host(:first-child) #button:focus::before{left:-4px;border-top-left-radius:6px;border-bottom-left-radius:6px}:host(:last-child) #button:focus::before{right:-4px;border-top-right-radius:6px;border-bottom-right-radius:6px}:host([disabled]:not([disabled=false])) #wrapper{background-color:var(--sinch-color-snow-100);color:var(--sinch-color-stormy-100);--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><slot name="icon"></slot><label for="button" id="content"></label> <button id="button"></button></div>';
11
- export const isSegmentedControlOptionElement = element => {
12
- return element instanceof Element && element.tagName === 'SINCH-SEGMENTED-CONTROL-OPTION';
13
- };
10
+ const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;position:relative;flex-direction:row;align-items:center;gap:12px;width:100%;height:42px;padding:8px 20px;box-sizing:border-box;border:1px solid var(--sinch-color-snow-600);border-left-width:0;border-right-width:0;color:var(--sinch-color-stormy-500);background-color:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:16px}#wrapper:hover{background-color:var(--sinch-color-snow-500)}:host(:first-child) #wrapper{border-left-width:1px;border-top-left-radius:4px;border-bottom-left-radius:4px}:host(:last-child) #wrapper{border-right-width:1px;border-top-right-radius:4px;border-bottom-right-radius:4px}#content{font:var(--sinch-font-title-s);flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([checked]:not([checked=false])) #wrapper{border-color:var(--sinch-color-stormy-500)}:host([checked]:not([checked=false]):not(:first-child)) #wrapper::before{content:"";width:1px;background-color:var(--sinch-color-stormy-500);position:absolute;left:0;top:-1px;bottom:-1px}:host([checked]:not([checked=false]):not(:last-child)) #wrapper::after{content:"";width:1px;background-color:var(--sinch-color-stormy-500);position:absolute;right:0;top:-1px;bottom:-1px}#button{all:initial;position:absolute;left:0;top:0;box-sizing:border-box;width:100%;height:100%;cursor:pointer;z-index:1}#button:disabled{cursor:unset}#button:focus::before{content:"";position:absolute;left:-3px;right:-3px;top:-4px;bottom:-4px;border-style:solid;border-color:var(--sinch-color-aqua-400);border-width:0}#button:focus-visible::before{border-width:2px}:host(:first-child) #button:focus::before{left:-4px;border-top-left-radius:6px;border-bottom-left-radius:6px}:host(:last-child) #button:focus::before{right:-4px;border-top-right-radius:6px;border-bottom-right-radius:6px}@supports not selector(:focus-visible){#button:focus::before{border-width:2px}}:host([disabled]:not([disabled=false])) #wrapper{background-color:var(--sinch-color-snow-100);color:var(--sinch-color-stormy-100);--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><slot name="icon"></slot><label for="button" id="content"></label> <button id="button"></button></div>';
14
11
  const template = document.createElement('template');
15
12
  template.innerHTML = templateHTML;
16
13
  defineCustomElement('sinch-segmented-control-option', (_onClick = new WeakMap(), class extends NectaryElement {
@@ -1,7 +1,7 @@
1
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
2
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$slot, _onSlotChange, _onOptionChange, _onValueChange;
4
+ var _$slot, _$sh, _onSlotChange, _onOptionChange, _onValueChange;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -11,12 +11,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
11
11
 
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
- import { isSegmentedIconControlOptionElement } from '../segmented-icon-control-option';
15
- import { defineCustomElement, getAttribute, getBooleanAttribute, getCSVSet, getFirstCSValue, NectaryElement, updateAttribute, updateBooleanAttribute, updateCSV } from '../utils';
14
+ import { defineCustomElement, getAttribute, getBooleanAttribute, getCsvSet, getFirstCsvValue, NectaryElement, updateAttribute, updateBooleanAttribute, updateCsv } from '../utils';
16
15
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row}</style><div id="wrapper"><slot></slot></div>';
17
16
  const template = document.createElement('template');
18
17
  template.innerHTML = templateHTML;
19
- defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), class extends NectaryElement {
18
+ defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _$sh = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), class extends NectaryElement {
20
19
  constructor() {
21
20
  super();
22
21
 
@@ -27,6 +26,11 @@ defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _on
27
26
  value: void 0
28
27
  });
29
28
 
29
+ _classPrivateFieldInitSpec(this, _$sh, {
30
+ writable: true,
31
+ value: void 0
32
+ });
33
+
30
34
  _classPrivateFieldInitSpec(this, _onSlotChange, {
31
35
  writable: true,
32
36
  value: () => {
@@ -38,16 +42,9 @@ defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _on
38
42
  writable: true,
39
43
  value: e => {
40
44
  e.stopPropagation();
41
-
42
- if (!isSegmentedIconControlOptionElement(e.target)) {
43
- return;
44
- }
45
-
46
- const {
47
- value,
48
- isChecked
49
- } = e.detail;
50
- const result = this.multiple ? updateCSV(this.value, value, isChecked) : value;
45
+ const $elem = e.target;
46
+ const value = e.detail;
47
+ const result = this.multiple ? updateCsv(this.value, value, !getBooleanAttribute($elem, 'checked')) : value;
51
48
  this.dispatchEvent(new CustomEvent('change', {
52
49
  detail: result,
53
50
  bubbles: true
@@ -57,15 +54,24 @@ defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _on
57
54
 
58
55
  const shadowRoot = this.attachShadow();
59
56
  shadowRoot.appendChild(template.content.cloneNode(true));
60
- shadowRoot.addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
61
57
 
62
- _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
58
+ _classPrivateFieldSet(this, _$sh, shadowRoot);
63
59
 
64
- _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
60
+ _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
65
61
  }
66
62
 
67
63
  connectedCallback() {
68
64
  this.setAttribute('role', 'tablist');
65
+
66
+ _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
67
+
68
+ _classPrivateFieldGet(this, _$sh).addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
69
+ }
70
+
71
+ disconnectedCallback() {
72
+ _classPrivateFieldGet(this, _$slot).removeEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
73
+
74
+ _classPrivateFieldGet(this, _$sh).removeEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
69
75
  }
70
76
 
71
77
  static get observedAttributes() {
@@ -107,20 +113,18 @@ defineCustomElement('sinch-segmented-icon-control', (_$slot = new WeakMap(), _on
107
113
 
108
114
  function _onValueChange2(csv) {
109
115
  if (this.multiple) {
110
- const values = getCSVSet(csv);
116
+ const values = getCsvSet(csv);
111
117
 
112
118
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
113
- if (isSegmentedIconControlOptionElement($option)) {
114
- $option.checked = $option.disabled !== true && values.has($option.value);
115
- }
119
+ const isChecked = !getBooleanAttribute($option, 'disabled') && values.has(getAttribute($option, 'value', ''));
120
+ updateBooleanAttribute($option, 'checked', isChecked);
116
121
  }
117
122
  } else {
118
- const value = getFirstCSValue(csv);
123
+ const value = getFirstCsvValue(csv);
119
124
 
120
125
  for (const $option of _classPrivateFieldGet(this, _$slot).assignedElements()) {
121
- if (isSegmentedIconControlOptionElement($option)) {
122
- $option.checked = $option.disabled !== true && $option.value === value;
123
- }
126
+ const isChecked = !getBooleanAttribute($option, 'disabled') && value === getAttribute($option, 'value', '');
127
+ updateBooleanAttribute($option, 'checked', isChecked);
124
128
  }
125
129
  }
126
130
  }
@@ -1,6 +1,5 @@
1
1
  import type { TSinchElementReact } from '../types';
2
2
  import type { FocusEvent } from 'react';
3
- export declare const isSegmentedIconControlOptionElement: (element: EventTarget | Element | null) => element is TSinchSegmentedIconControlOptionElement;
4
3
  export declare type TSinchSegmentedIconControlOptionElement = HTMLElement & {
5
4
  value: string;
6
5
  disabled: boolean;