@nectary/components 4.11.1 → 4.12.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 (585) hide show
  1. package/accordion/global/index.d.ts +1 -0
  2. package/accordion/global/index.js +2 -0
  3. package/accordion/index.d.ts +1 -22
  4. package/accordion/index.js +41 -39
  5. package/accordion/types.d.ts +21 -1
  6. package/accordion/types.js +1 -1
  7. package/accordion-item/global/index.d.ts +1 -0
  8. package/accordion-item/global/index.js +2 -0
  9. package/accordion-item/index.d.ts +2 -22
  10. package/accordion-item/index.js +53 -49
  11. package/accordion-item/types.d.ts +21 -1
  12. package/accordion-item/types.js +1 -1
  13. package/accordion-item/utils.js +4 -1
  14. package/action-menu/global/index.d.ts +1 -0
  15. package/action-menu/global/index.js +2 -0
  16. package/action-menu/index.d.ts +1 -22
  17. package/action-menu/index.js +83 -75
  18. package/action-menu/types.d.ts +21 -1
  19. package/action-menu/types.js +1 -1
  20. package/action-menu-option/global/index.d.ts +1 -0
  21. package/action-menu-option/global/index.js +2 -0
  22. package/action-menu-option/index.d.ts +1 -22
  23. package/action-menu-option/index.js +39 -41
  24. package/action-menu-option/types.d.ts +21 -1
  25. package/action-menu-option/types.js +1 -1
  26. package/action-menu-option/utils.js +6 -3
  27. package/alert/global/index.d.ts +1 -0
  28. package/alert/global/index.js +2 -0
  29. package/alert/index.d.ts +2 -22
  30. package/alert/index.js +24 -21
  31. package/alert/types.d.ts +21 -1
  32. package/alert/types.js +1 -1
  33. package/alert/utils.js +4 -1
  34. package/avatar/colors.js +1 -1
  35. package/avatar/global/index.d.ts +1 -0
  36. package/avatar/global/index.js +2 -0
  37. package/avatar/index.d.ts +2 -22
  38. package/avatar/index.js +42 -41
  39. package/avatar/types.d.ts +21 -1
  40. package/avatar/types.js +1 -1
  41. package/avatar/utils.js +9 -4
  42. package/badge/global/index.d.ts +1 -0
  43. package/badge/global/index.js +2 -0
  44. package/badge/index.d.ts +3 -22
  45. package/badge/index.js +52 -51
  46. package/badge/types.d.ts +21 -1
  47. package/badge/types.js +1 -1
  48. package/badge/utils.js +4 -1
  49. package/bundle.d.ts +78 -0
  50. package/bundle.js +13033 -0
  51. package/bundle.ts +80 -0
  52. package/button/global/index.d.ts +1 -0
  53. package/button/global/index.js +2 -0
  54. package/button/index.d.ts +2 -22
  55. package/button/index.js +101 -111
  56. package/button/types.d.ts +21 -1
  57. package/button/types.js +1 -1
  58. package/button/utils.js +18 -2
  59. package/button-group/global/index.d.ts +1 -0
  60. package/button-group/global/index.js +2 -0
  61. package/button-group/index.d.ts +1 -22
  62. package/button-group/index.js +20 -18
  63. package/button-group/types.d.ts +22 -3
  64. package/button-group/types.js +1 -1
  65. package/button-group-item/global/index.d.ts +1 -0
  66. package/button-group-item/global/index.js +2 -0
  67. package/button-group-item/index.d.ts +2 -22
  68. package/button-group-item/index.js +31 -42
  69. package/button-group-item/types.d.ts +22 -3
  70. package/button-group-item/types.js +1 -1
  71. package/card-container/global/index.d.ts +1 -0
  72. package/card-container/global/index.js +2 -0
  73. package/card-container/index.d.ts +1 -21
  74. package/card-container/index.js +8 -5
  75. package/card-container/types.d.ts +21 -1
  76. package/card-container/types.js +1 -1
  77. package/card-v2/global/index.d.ts +1 -0
  78. package/card-v2/global/index.js +2 -0
  79. package/card-v2/index.d.ts +1 -22
  80. package/card-v2/index.js +59 -57
  81. package/card-v2/types.d.ts +21 -1
  82. package/card-v2/types.js +1 -1
  83. package/card-v2-title/global/index.d.ts +1 -0
  84. package/card-v2-title/global/index.js +2 -0
  85. package/card-v2-title/index.d.ts +2 -22
  86. package/card-v2-title/index.js +28 -26
  87. package/card-v2-title/types.d.ts +21 -1
  88. package/card-v2-title/types.js +1 -1
  89. package/checkbox/global/index.d.ts +1 -0
  90. package/checkbox/global/index.js +2 -0
  91. package/checkbox/index.d.ts +1 -22
  92. package/checkbox/index.js +88 -81
  93. package/checkbox/types.d.ts +21 -1
  94. package/checkbox/types.js +1 -1
  95. package/chip/colors.js +1 -1
  96. package/chip/global/index.d.ts +1 -0
  97. package/chip/global/index.js +2 -0
  98. package/chip/index.d.ts +1 -22
  99. package/chip/index.js +62 -75
  100. package/chip/types.d.ts +21 -1
  101. package/chip/types.js +1 -1
  102. package/chip/utils.js +7 -3
  103. package/code-tag/global/index.d.ts +1 -0
  104. package/code-tag/global/index.js +2 -0
  105. package/code-tag/index.d.ts +1 -22
  106. package/code-tag/index.js +17 -14
  107. package/code-tag/types.d.ts +21 -1
  108. package/code-tag/types.js +1 -1
  109. package/color-menu/global/index.d.ts +1 -0
  110. package/color-menu/global/index.js +2 -0
  111. package/color-menu/index.d.ts +2 -22
  112. package/color-menu/index.js +115 -115
  113. package/color-menu/types.d.ts +21 -1
  114. package/color-menu/types.js +1 -1
  115. package/color-menu/utils.js +6 -3
  116. package/color-menu-option/global/index.d.ts +1 -0
  117. package/color-menu-option/global/index.js +2 -0
  118. package/color-menu-option/index.d.ts +1 -22
  119. package/color-menu-option/index.js +30 -26
  120. package/color-menu-option/types.d.ts +21 -1
  121. package/color-menu-option/types.js +1 -1
  122. package/color-menu-option/utils.js +6 -3
  123. package/color-swatch/global/index.d.ts +1 -0
  124. package/color-swatch/global/index.js +2 -0
  125. package/color-swatch/index.d.ts +1 -22
  126. package/color-swatch/index.js +23 -20
  127. package/color-swatch/types.d.ts +21 -1
  128. package/color-swatch/types.js +1 -1
  129. package/color-swatch/utils.js +7 -3
  130. package/date-picker/global/index.d.ts +1 -0
  131. package/date-picker/global/index.js +2 -0
  132. package/date-picker/index.d.ts +2 -22
  133. package/date-picker/index.js +157 -150
  134. package/date-picker/types.d.ts +21 -1
  135. package/date-picker/types.js +1 -1
  136. package/date-picker/utils.js +59 -42
  137. package/dialog/global/index.d.ts +1 -0
  138. package/dialog/global/index.js +2 -0
  139. package/dialog/index.d.ts +1 -22
  140. package/dialog/index.js +71 -58
  141. package/dialog/types.d.ts +21 -1
  142. package/dialog/types.js +1 -1
  143. package/dialog/utils.js +11 -7
  144. package/emoji/global/index.d.ts +1 -0
  145. package/emoji/global/index.js +2 -0
  146. package/emoji/index.d.ts +1 -22
  147. package/emoji/index.js +19 -16
  148. package/emoji/types.d.ts +21 -1
  149. package/emoji/types.js +1 -1
  150. package/emoji/utils.js +22 -17
  151. package/emoji-picker/global/index.d.ts +1 -0
  152. package/emoji-picker/global/index.js +2 -0
  153. package/emoji-picker/index.d.ts +2 -22
  154. package/emoji-picker/index.js +138 -118
  155. package/emoji-picker/types.d.ts +21 -1
  156. package/emoji-picker/types.js +1 -1
  157. package/field/global/index.d.ts +1 -0
  158. package/field/global/index.js +2 -0
  159. package/field/index.d.ts +1 -22
  160. package/field/index.js +63 -60
  161. package/field/types.d.ts +21 -1
  162. package/field/types.js +1 -1
  163. package/file-drop/global/index.d.ts +1 -0
  164. package/file-drop/global/index.js +2 -0
  165. package/file-drop/index.d.ts +1 -22
  166. package/file-drop/index.js +103 -98
  167. package/file-drop/types.d.ts +21 -1
  168. package/file-drop/types.js +1 -1
  169. package/file-drop/utils.js +27 -22
  170. package/file-picker/global/index.d.ts +1 -0
  171. package/file-picker/global/index.js +2 -0
  172. package/file-picker/index.d.ts +1 -22
  173. package/file-picker/index.js +53 -48
  174. package/file-picker/types.d.ts +21 -1
  175. package/file-picker/types.js +1 -1
  176. package/file-picker/utils.js +6 -3
  177. package/file-status/global/index.d.ts +1 -0
  178. package/file-status/global/index.js +2 -0
  179. package/file-status/index.d.ts +2 -22
  180. package/file-status/index.js +33 -22
  181. package/file-status/types.d.ts +21 -1
  182. package/file-status/types.js +1 -1
  183. package/file-status/utils.js +4 -1
  184. package/flag/global/index.d.ts +1 -0
  185. package/flag/global/index.js +2 -0
  186. package/flag/index.d.ts +1 -22
  187. package/flag/index.js +19 -16
  188. package/flag/types.d.ts +21 -1
  189. package/flag/types.js +1 -1
  190. package/flag/utils.js +11 -8
  191. package/grid/global/index.d.ts +1 -0
  192. package/grid/global/index.js +2 -0
  193. package/grid/index.d.ts +1 -22
  194. package/grid/index.js +8 -5
  195. package/grid/types.d.ts +21 -1
  196. package/grid/types.js +1 -1
  197. package/grid-item/global/index.d.ts +1 -0
  198. package/grid-item/global/index.js +2 -0
  199. package/grid-item/index.d.ts +1 -22
  200. package/grid-item/index.js +17 -13
  201. package/grid-item/types.d.ts +21 -1
  202. package/grid-item/types.js +1 -1
  203. package/help-tooltip/global/index.d.ts +1 -0
  204. package/help-tooltip/global/index.js +2 -0
  205. package/help-tooltip/index.d.ts +1 -22
  206. package/help-tooltip/index.js +29 -26
  207. package/help-tooltip/types.d.ts +21 -1
  208. package/help-tooltip/types.js +1 -1
  209. package/icon/generated-icon-type.js +1 -1
  210. package/icon/global/index.d.ts +1 -0
  211. package/icon/global/index.js +2 -0
  212. package/icon/index.d.ts +1 -22
  213. package/icon/index.js +30 -28
  214. package/icon/types.d.ts +21 -1
  215. package/icon/types.js +1 -1
  216. package/inline-alert/global/index.d.ts +1 -0
  217. package/inline-alert/global/index.js +2 -0
  218. package/inline-alert/index.d.ts +2 -22
  219. package/inline-alert/index.js +58 -39
  220. package/inline-alert/types.d.ts +21 -1
  221. package/inline-alert/types.js +1 -1
  222. package/inline-alert/utils.js +4 -1
  223. package/input/global/index.d.ts +1 -0
  224. package/input/global/index.js +2 -0
  225. package/input/index.d.ts +2 -22
  226. package/input/index.js +295 -317
  227. package/input/types.d.ts +21 -1
  228. package/input/types.js +1 -1
  229. package/input/utils.js +56 -46
  230. package/link/global/index.d.ts +1 -0
  231. package/link/global/index.js +2 -0
  232. package/link/index.d.ts +1 -22
  233. package/link/index.js +88 -79
  234. package/link/types.d.ts +21 -1
  235. package/link/types.js +1 -1
  236. package/list/global/index.d.ts +1 -0
  237. package/list/global/index.js +2 -0
  238. package/list/index.d.ts +1 -21
  239. package/list/index.js +9 -6
  240. package/list/types.d.ts +21 -1
  241. package/list/types.js +1 -1
  242. package/list-item/global/index.d.ts +1 -0
  243. package/list-item/global/index.js +2 -0
  244. package/list-item/index.d.ts +1 -22
  245. package/list-item/index.js +9 -6
  246. package/list-item/types.d.ts +21 -1
  247. package/list-item/types.js +1 -1
  248. package/package.json +12 -6
  249. package/pagination/global/index.d.ts +1 -0
  250. package/pagination/global/index.js +2 -0
  251. package/pagination/index.d.ts +2 -22
  252. package/pagination/index.js +64 -46
  253. package/pagination/types.d.ts +21 -1
  254. package/pagination/types.js +1 -1
  255. package/persistent-overlay/global/index.d.ts +1 -0
  256. package/persistent-overlay/global/index.js +2 -0
  257. package/persistent-overlay/index.d.ts +1 -22
  258. package/persistent-overlay/index.js +42 -44
  259. package/persistent-overlay/types.d.ts +21 -1
  260. package/persistent-overlay/types.js +1 -1
  261. package/pop/global/index.d.ts +1 -0
  262. package/pop/global/index.js +2 -0
  263. package/pop/index.d.ts +3 -22
  264. package/pop/index.js +149 -150
  265. package/pop/types.d.ts +21 -1
  266. package/pop/types.js +1 -1
  267. package/pop/utils.js +24 -8
  268. package/popover/global/index.d.ts +1 -0
  269. package/popover/global/index.js +2 -0
  270. package/popover/index.d.ts +2 -22
  271. package/popover/index.js +75 -68
  272. package/popover/types.d.ts +21 -1
  273. package/popover/types.js +1 -1
  274. package/popover/utils.js +18 -7
  275. package/progress/global/index.d.ts +1 -0
  276. package/progress/global/index.js +2 -0
  277. package/progress/index.d.ts +1 -22
  278. package/progress/index.js +30 -33
  279. package/progress/types.d.ts +21 -1
  280. package/progress/types.js +1 -1
  281. package/progress-stepper/global/index.d.ts +1 -0
  282. package/progress-stepper/global/index.js +2 -0
  283. package/progress-stepper/index.d.ts +2 -22
  284. package/progress-stepper/index.js +64 -66
  285. package/progress-stepper/types.d.ts +21 -1
  286. package/progress-stepper/types.js +1 -1
  287. package/progress-stepper-item/global/index.d.ts +1 -0
  288. package/progress-stepper-item/global/index.js +2 -0
  289. package/progress-stepper-item/index.d.ts +1 -22
  290. package/progress-stepper-item/index.js +58 -50
  291. package/progress-stepper-item/types.d.ts +21 -1
  292. package/progress-stepper-item/types.js +1 -1
  293. package/progress-stepper-item/utils.js +22 -11
  294. package/radio/global/index.d.ts +1 -0
  295. package/radio/global/index.js +2 -0
  296. package/radio/index.d.ts +1 -22
  297. package/radio/index.js +79 -83
  298. package/radio/types.d.ts +21 -1
  299. package/radio/types.js +1 -1
  300. package/radio-option/global/index.d.ts +1 -0
  301. package/radio-option/global/index.js +2 -0
  302. package/radio-option/index.d.ts +1 -22
  303. package/radio-option/index.js +47 -41
  304. package/radio-option/types.d.ts +21 -1
  305. package/radio-option/types.js +1 -1
  306. package/rich-text/global/index.d.ts +1 -0
  307. package/rich-text/global/index.js +2 -0
  308. package/rich-text/index.d.ts +1 -22
  309. package/rich-text/index.js +45 -46
  310. package/rich-text/types.d.ts +21 -1
  311. package/rich-text/types.js +1 -1
  312. package/rich-text/utils.js +31 -33
  313. package/rich-textarea/global/index.d.ts +1 -0
  314. package/rich-textarea/global/index.js +2 -0
  315. package/rich-textarea/index.d.ts +1 -22
  316. package/rich-textarea/index.js +201 -194
  317. package/rich-textarea/types.d.ts +21 -1
  318. package/rich-textarea/types.js +1 -1
  319. package/rich-textarea/utils.js +313 -340
  320. package/segment-collapse/global/index.d.ts +1 -0
  321. package/segment-collapse/global/index.js +2 -0
  322. package/segment-collapse/index.d.ts +1 -22
  323. package/segment-collapse/index.js +31 -25
  324. package/segment-collapse/types.d.ts +21 -1
  325. package/segment-collapse/types.js +1 -1
  326. package/segmented-control/global/index.d.ts +1 -0
  327. package/segmented-control/global/index.js +2 -0
  328. package/segmented-control/index.d.ts +1 -22
  329. package/segmented-control/index.js +45 -45
  330. package/segmented-control/types.d.ts +21 -1
  331. package/segmented-control/types.js +1 -1
  332. package/segmented-control-option/global/index.d.ts +1 -0
  333. package/segmented-control-option/global/index.js +2 -0
  334. package/segmented-control-option/index.d.ts +1 -22
  335. package/segmented-control-option/index.js +44 -46
  336. package/segmented-control-option/types.d.ts +21 -1
  337. package/segmented-control-option/types.js +1 -1
  338. package/segmented-icon-control/global/index.d.ts +1 -0
  339. package/segmented-icon-control/global/index.js +2 -0
  340. package/segmented-icon-control/index.d.ts +1 -22
  341. package/segmented-icon-control/index.js +51 -50
  342. package/segmented-icon-control/types.d.ts +21 -1
  343. package/segmented-icon-control/types.js +1 -1
  344. package/segmented-icon-control-option/global/index.d.ts +1 -0
  345. package/segmented-icon-control-option/global/index.js +2 -0
  346. package/segmented-icon-control-option/index.d.ts +1 -22
  347. package/segmented-icon-control-option/index.js +36 -37
  348. package/segmented-icon-control-option/types.d.ts +21 -1
  349. package/segmented-icon-control-option/types.js +1 -1
  350. package/select-button/global/index.d.ts +1 -0
  351. package/select-button/global/index.js +2 -0
  352. package/select-button/index.d.ts +1 -26
  353. package/select-button/index.js +104 -112
  354. package/select-button/types.d.ts +25 -1
  355. package/select-button/types.js +1 -1
  356. package/select-menu/global/index.d.ts +1 -0
  357. package/select-menu/global/index.js +2 -0
  358. package/select-menu/index.d.ts +1 -22
  359. package/select-menu/index.js +201 -164
  360. package/select-menu/types.d.ts +21 -1
  361. package/select-menu/types.js +1 -1
  362. package/select-menu-option/global/index.d.ts +1 -0
  363. package/select-menu-option/global/index.js +2 -0
  364. package/select-menu-option/index.d.ts +1 -22
  365. package/select-menu-option/index.js +41 -33
  366. package/select-menu-option/types.d.ts +21 -1
  367. package/select-menu-option/types.js +1 -1
  368. package/select-menu-option/utils.js +4 -1
  369. package/skeleton/global/index.d.ts +1 -0
  370. package/skeleton/global/index.js +2 -0
  371. package/skeleton/index.d.ts +1 -22
  372. package/skeleton/index.js +35 -38
  373. package/skeleton/types.d.ts +21 -1
  374. package/skeleton/types.js +1 -1
  375. package/skeleton-item/global/index.d.ts +1 -0
  376. package/skeleton-item/global/index.js +2 -0
  377. package/skeleton-item/index.d.ts +1 -22
  378. package/skeleton-item/index.js +8 -5
  379. package/skeleton-item/types.d.ts +21 -1
  380. package/skeleton-item/types.js +1 -1
  381. package/spinner/global/index.d.ts +1 -0
  382. package/spinner/global/index.js +2 -0
  383. package/spinner/index.d.ts +1 -22
  384. package/spinner/index.js +31 -29
  385. package/spinner/types.d.ts +21 -1
  386. package/spinner/types.js +1 -1
  387. package/standalone.d.ts +0 -8
  388. package/standalone.js +79 -87
  389. package/standalone.ts +0 -8
  390. package/stop-events/index.js +12 -12
  391. package/table/global/index.d.ts +1 -0
  392. package/table/global/index.js +2 -0
  393. package/table/index.d.ts +1 -21
  394. package/table/index.js +9 -6
  395. package/table/types.d.ts +21 -1
  396. package/table/types.js +1 -1
  397. package/table-body/global/index.d.ts +1 -0
  398. package/table-body/global/index.js +2 -0
  399. package/table-body/index.d.ts +1 -21
  400. package/table-body/index.js +9 -6
  401. package/table-body/types.d.ts +21 -1
  402. package/table-body/types.js +1 -1
  403. package/table-cell/global/index.d.ts +1 -0
  404. package/table-cell/global/index.js +2 -0
  405. package/table-cell/index.d.ts +2 -22
  406. package/table-cell/index.js +13 -9
  407. package/table-cell/types.d.ts +21 -1
  408. package/table-cell/types.js +1 -1
  409. package/table-cell/utils.js +4 -1
  410. package/table-head/global/index.d.ts +1 -0
  411. package/table-head/global/index.js +2 -0
  412. package/table-head/index.d.ts +1 -21
  413. package/table-head/index.js +9 -6
  414. package/table-head/types.d.ts +21 -1
  415. package/table-head/types.js +1 -1
  416. package/table-head-cell/global/index.d.ts +1 -0
  417. package/table-head-cell/global/index.js +2 -0
  418. package/table-head-cell/index.d.ts +1 -22
  419. package/table-head-cell/index.js +29 -27
  420. package/table-head-cell/types.d.ts +21 -1
  421. package/table-head-cell/types.js +1 -1
  422. package/table-row/global/index.d.ts +1 -0
  423. package/table-row/global/index.js +2 -0
  424. package/table-row/index.d.ts +1 -22
  425. package/table-row/index.js +20 -17
  426. package/table-row/types.d.ts +21 -1
  427. package/table-row/types.js +1 -1
  428. package/tabs/global/index.d.ts +1 -0
  429. package/tabs/global/index.js +2 -0
  430. package/tabs/index.d.ts +2 -22
  431. package/tabs/index.js +32 -35
  432. package/tabs/types.d.ts +21 -1
  433. package/tabs/types.js +1 -1
  434. package/tabs-icon-option/global/index.d.ts +1 -0
  435. package/tabs-icon-option/global/index.js +2 -0
  436. package/tabs-icon-option/index.d.ts +1 -22
  437. package/tabs-icon-option/index.js +38 -40
  438. package/tabs-icon-option/types.d.ts +21 -1
  439. package/tabs-icon-option/types.js +1 -1
  440. package/tabs-option/global/index.d.ts +1 -0
  441. package/tabs-option/global/index.js +2 -0
  442. package/tabs-option/index.d.ts +1 -22
  443. package/tabs-option/index.js +41 -43
  444. package/tabs-option/types.d.ts +21 -1
  445. package/tabs-option/types.js +1 -1
  446. package/tag/colors.js +1 -1
  447. package/tag/global/index.d.ts +1 -0
  448. package/tag/global/index.js +2 -0
  449. package/tag/index.d.ts +1 -22
  450. package/tag/index.js +45 -44
  451. package/tag/types.d.ts +21 -1
  452. package/tag/types.js +1 -1
  453. package/tag/utils.js +7 -3
  454. package/text/global/index.d.ts +1 -0
  455. package/text/global/index.js +2 -0
  456. package/text/index.d.ts +2 -22
  457. package/text/index.js +33 -28
  458. package/text/types.d.ts +21 -1
  459. package/text/types.js +1 -1
  460. package/text/utils.js +4 -1
  461. package/textarea/global/index.d.ts +1 -0
  462. package/textarea/global/index.js +2 -0
  463. package/textarea/index.d.ts +1 -22
  464. package/textarea/index.js +147 -152
  465. package/textarea/types.d.ts +21 -1
  466. package/textarea/types.js +1 -1
  467. package/time-picker/global/index.d.ts +1 -0
  468. package/time-picker/global/index.js +2 -0
  469. package/time-picker/index.d.ts +2 -22
  470. package/time-picker/index.js +119 -123
  471. package/time-picker/types.d.ts +21 -1
  472. package/time-picker/types.js +1 -1
  473. package/time-picker/utils.js +31 -33
  474. package/title/global/index.d.ts +1 -0
  475. package/title/global/index.js +2 -0
  476. package/title/index.d.ts +2 -22
  477. package/title/index.js +32 -31
  478. package/title/types.d.ts +21 -1
  479. package/title/types.js +1 -1
  480. package/title/utils.js +18 -14
  481. package/toast/global/index.d.ts +1 -0
  482. package/toast/global/index.js +2 -0
  483. package/toast/index.d.ts +2 -22
  484. package/toast/index.js +37 -34
  485. package/toast/types.d.ts +21 -1
  486. package/toast/types.js +1 -1
  487. package/toast/utils.js +4 -1
  488. package/toast-manager/global/index.d.ts +1 -0
  489. package/toast-manager/global/index.js +2 -0
  490. package/toast-manager/index.d.ts +3 -22
  491. package/toast-manager/index.js +77 -63
  492. package/toast-manager/types.d.ts +21 -1
  493. package/toast-manager/types.js +1 -1
  494. package/toast-manager/utils.js +4 -1
  495. package/toggle/global/index.d.ts +1 -0
  496. package/toggle/global/index.js +2 -0
  497. package/toggle/index.d.ts +1 -22
  498. package/toggle/index.js +81 -75
  499. package/toggle/types.d.ts +21 -1
  500. package/toggle/types.js +1 -1
  501. package/tooltip/global/index.d.ts +1 -0
  502. package/tooltip/global/index.js +2 -0
  503. package/tooltip/index.d.ts +3 -22
  504. package/tooltip/index.js +105 -93
  505. package/tooltip/tooltip-state.js +56 -64
  506. package/tooltip/types.d.ts +21 -1
  507. package/tooltip/types.js +1 -1
  508. package/tooltip/utils.js +32 -13
  509. package/types.d.ts +12 -29
  510. package/utils/adapters.js +1 -1
  511. package/utils/component-names.d.ts +3 -0
  512. package/utils/component-names.js +85 -0
  513. package/utils/context.js +32 -42
  514. package/utils/countries.js +490 -2
  515. package/utils/csv.js +13 -6
  516. package/utils/debounce.js +10 -3
  517. package/utils/dom.js +60 -53
  518. package/utils/element.d.ts +107 -15
  519. package/utils/element.js +100 -19
  520. package/utils/event-target.js +11 -5
  521. package/utils/form.js +17 -12
  522. package/utils/get-react-event-handler.js +6 -3
  523. package/utils/global-components-constants.d.ts +3 -0
  524. package/utils/global-components-constants.js +8 -0
  525. package/utils/global-components-manager.d.ts +71 -0
  526. package/utils/global-components-manager.js +24 -0
  527. package/utils/index.js +65 -12
  528. package/utils/markdown.js +56 -43
  529. package/utils/rect.js +13 -18
  530. package/utils/shared/global-elements-manager.d.js +1 -0
  531. package/utils/shared/global-elements-manager.d.ts +62 -0
  532. package/utils/shared/global-elements-manager.js +163 -0
  533. package/utils/shared/global-elements-store.d.js +1 -0
  534. package/utils/shared/global-elements-store.d.ts +12 -0
  535. package/utils/shared/global-elements-store.js +31 -0
  536. package/utils/shared/index.d.js +11 -0
  537. package/utils/shared/index.d.ts +3 -0
  538. package/utils/shared/index.js +11 -0
  539. package/utils/shared/nectary-element-base.d.js +1 -0
  540. package/utils/shared/nectary-element-base.d.ts +9 -0
  541. package/utils/shared/nectary-element-base.js +25 -0
  542. package/utils/shared/package.json +9 -0
  543. package/utils/shared/tsconfig.json +20 -0
  544. package/utils/size.js +8 -3
  545. package/utils/slot.js +13 -9
  546. package/utils/throttle.js +5 -2
  547. package/utils/uid.js +5 -2
  548. package/card/index.d.ts +0 -40
  549. package/card/index.js +0 -134
  550. package/card/types.d.ts +0 -17
  551. package/card/types.js +0 -1
  552. package/horizontal-stepper/index.d.ts +0 -33
  553. package/horizontal-stepper/index.js +0 -62
  554. package/horizontal-stepper/types.d.ts +0 -42
  555. package/horizontal-stepper/types.js +0 -1
  556. package/horizontal-stepper-item/index.d.ts +0 -38
  557. package/horizontal-stepper-item/index.js +0 -62
  558. package/horizontal-stepper-item/types.d.ts +0 -38
  559. package/horizontal-stepper-item/types.js +0 -1
  560. package/horizontal-stepper-item/utils.d.ts +0 -2
  561. package/horizontal-stepper-item/utils.js +0 -1
  562. package/segment/index.d.ts +0 -40
  563. package/segment/index.js +0 -110
  564. package/segment/types.d.ts +0 -23
  565. package/segment/types.js +0 -1
  566. package/segment/utils.d.ts +0 -3
  567. package/segment/utils.js +0 -16
  568. package/tile-control/index.d.ts +0 -39
  569. package/tile-control/index.js +0 -111
  570. package/tile-control/types.d.ts +0 -29
  571. package/tile-control/types.js +0 -1
  572. package/tile-control-option/index.d.ts +0 -40
  573. package/tile-control-option/index.js +0 -99
  574. package/tile-control-option/types.d.ts +0 -52
  575. package/tile-control-option/types.js +0 -1
  576. package/vertical-stepper/index.d.ts +0 -33
  577. package/vertical-stepper/index.js +0 -58
  578. package/vertical-stepper/types.d.ts +0 -34
  579. package/vertical-stepper/types.js +0 -1
  580. package/vertical-stepper-item/index.d.ts +0 -38
  581. package/vertical-stepper-item/index.js +0 -62
  582. package/vertical-stepper-item/types.d.ts +0 -42
  583. package/vertical-stepper-item/types.js +0 -1
  584. package/vertical-stepper-item/utils.d.ts +0 -2
  585. package/vertical-stepper-item/utils.js +0 -1
@@ -1,4 +1,4 @@
1
- import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType, NectaryComponentReact, NectaryComponentVanilla } from '../types';
2
2
  export type TSinchTextareaProps = {
3
3
  /** Identification for uncontrolled form submissions */
4
4
  name?: string;
@@ -48,3 +48,23 @@ export type TSinchTextarea = {
48
48
  };
49
49
  export type TSinchTextareaElement = NectaryComponentVanillaByType<TSinchTextarea>;
50
50
  export type TSinchTextareaReact = NectaryComponentReactByType<TSinchTextarea>;
51
+ declare global {
52
+ interface NectaryComponentMap {
53
+ 'sinch-textarea': TSinchTextarea;
54
+ }
55
+ interface HTMLElementTagNameMap {
56
+ 'sinch-textarea': NectaryComponentVanilla<'sinch-textarea'>;
57
+ }
58
+ namespace JSX {
59
+ interface IntrinsicElements {
60
+ 'sinch-textarea': NectaryComponentReact<'sinch-textarea'>;
61
+ }
62
+ }
63
+ }
64
+ declare module 'react' {
65
+ namespace JSX {
66
+ interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
67
+ 'sinch-textarea': NectaryComponentReact<'sinch-textarea'>;
68
+ }
69
+ }
70
+ }
package/textarea/types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+
@@ -0,0 +1 @@
1
+ export * from '../types';
@@ -0,0 +1,2 @@
1
+ import { defineCustomElement } from "../../utils/element.js";
2
+ defineCustomElement("sinch-time-picker");
@@ -2,8 +2,8 @@ import '../icon';
2
2
  import '../segmented-control';
3
3
  import '../segmented-control-option';
4
4
  import { NectaryElement } from '../utils';
5
- import type { TSinchTimePicker } from './types';
6
- import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
5
+ import type { TRect } from '../types';
6
+ export * from './types';
7
7
  export declare class TimePicker extends NectaryElement {
8
8
  #private;
9
9
  constructor();
@@ -23,23 +23,3 @@ export declare class TimePicker extends NectaryElement {
23
23
  hourDigitRect(hour: number): TRect | null;
24
24
  minuteDigitRect(minute: number): TRect | null;
25
25
  }
26
- declare global {
27
- interface NectaryComponentMap {
28
- 'sinch-time-picker': TSinchTimePicker;
29
- }
30
- interface HTMLElementTagNameMap {
31
- 'sinch-time-picker': NectaryComponentVanilla<'sinch-time-picker'>;
32
- }
33
- namespace JSX {
34
- interface IntrinsicElements {
35
- 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
36
- }
37
- }
38
- }
39
- declare module 'react' {
40
- namespace JSX {
41
- interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
42
- 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
43
- }
44
- }
45
- }
@@ -1,10 +1,13 @@
1
- import '../icon';
2
- import '../segmented-control';
3
- import '../segmented-control-option';
4
- import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHandler, getRect, isAttrEqual, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute } from '../utils';
5
- const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;width:248px;padding:16px;box-sizing:border-box;gap:16px}#header{position:relative;width:100%;height:48px;font:var(--sinch-comp-time-picker-header-font);line-height:48px;user-select:none;color:var(--sinch-comp-time-picker-header-color-default-text-initial)}#footer{display:flex;justify-content:center;width:100%;height:32px}#picker{position:relative;width:216px;height:216px;border-radius:50%;box-sizing:border-box;border:1px solid var(--sinch-comp-time-picker-watch-face-color-default-border-initial);background-color:var(--sinch-comp-time-picker-watch-face-color-default-background-initial)}#picker-hours,#picker-minutes{position:absolute;left:0;top:0;width:100%;height:100%;border-radius:50%;pointer-events:none;user-select:none}.digit-hour-12,.digit-hour-24,.digit-minute{position:absolute;width:28px;height:28px;text-align:center;top:calc(50% - 14px);left:calc(50% - 14px);z-index:1;cursor:pointer}.digit-hour-12{font:var(--sinch-comp-time-picker-digit-font-default-h12);color:var(--sinch-comp-time-picker-digit-color-default-h12-initial);line-height:28px}.digit-hour-12.selected{font:var(--sinch-comp-time-picker-digit-font-checked-h12);color:var(--sinch-comp-time-picker-digit-color-checked-h12-default)}.digit-hour-24{font:var(--sinch-comp-time-picker-digit-font-default-h24);color:var(--sinch-comp-time-picker-digit-color-default-h24-initial);line-height:28px}.digit-hour-24.selected{font:var(--sinch-comp-time-picker-digit-font-checked-h24);color:var(--sinch-comp-time-picker-digit-color-checked-h24-initial)}.digit-minute{font:var(--sinch-comp-time-picker-digit-font-default-minutes);color:var(--sinch-comp-time-picker-digit-color-default-minute-initial);line-height:28px}.digit-minute.selected{font:var(--sinch-comp-time-picker-digit-font-checked-minutes);color:var(--sinch-comp-time-picker-digit-color-checked-minute-initial)}#picker-touch{position:absolute;left:0;top:0;width:100%;height:100%;cursor:pointer;border-radius:50%}#needle-hour,#needle-minute,#picker-touch::after{background-color:var(--sinch-comp-time-picker-needle-color-default-background-initial)}#needle-hour,#needle-minute{position:absolute;transform-origin:bottom center;transform:rotate(0);bottom:50%;height:50px;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:transform height;z-index:2;outline:0}@media (prefers-reduced-motion){#needle-hour,#needle-minute{transition:none}}#needle-hour{width:4px;left:calc(50% - 2px);border-radius:2px}#needle-minute{width:2px;left:calc(50% - 1px);border-radius:1px}#needle-hour:focus-visible,#needle-minute:focus-visible{background-color:var(--sinch-comp-time-picker-needle-color-default-background-focus)}#needle-minute:not(.selected)::after{content:"";position:absolute;transform:translateX(-50%);left:0;top:-16px;width:4px;height:4px;border-radius:50%;background-color:var(--sinch-comp-time-picker-digit-color-checked-minute-initial)}#picker-touch::after{content:"";position:absolute;top:50%;left:50%;width:12px;height:12px;border-radius:50%;transform:translate(-50%,-50%)}#header-hours,#header-minutes{position:absolute;padding:0 4px;width:50px;outline:0}#header-hours{right:calc(50% + 8px);text-align:right}#header-minutes{left:calc(50% + 8px)}#header-colon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}#submit{position:absolute;right:0;top:50%;transform:translateY(-50%)}#submit-icon{--sinch-global-color-icon:var(--sinch-comp-time-picker-header-color-default-icon-initial)}:host([ampm]) .digit-hour-24{display:none}:host(:not([ampm])) #footer{display:none}</style><div id="wrapper"><div id="header"><div id="header-hours" role="meter" aria-valuemin="0" aria-valuemax="23" aria-valuenow="0" aria-valuetext="0"><span>00</span></div><div id="header-colon">&colon;</div><div id="header-minutes" role="meter" aria-valuemin="0" aria-valuemax="59" aria-valuenow="0" aria-valuetext="0"><span>00</span></div><sinch-button id="submit" size="s" aria-label="Submit"><sinch-icon icons-version="2" name="fa-check" id="icon-submit" slot="icon"></sinch-icon></sinch-button></div><div id="picker" aria-hidden="true"><div id="picker-hours"></div><div id="picker-minutes"></div><div id="picker-touch"><div id="needle-hour" tabindex="0"></div><div id="needle-minute" tabindex="0"></div></div></div><div id="footer"><sinch-segmented-control id="ampm"><sinch-segmented-control-option value="am" text="AM" aria-label="AM"></sinch-segmented-control-option><sinch-segmented-control-option value="pm" text="PM" aria-label="PM"></sinch-segmented-control-option></sinch-segmented-control></div></div>';
6
- import { getNeedleRotationDeg, getShortestCssDeg, hourToIndex, parseTime, stringifyHour, stringifyHourFace, stringifyMinute, stringifyTime } from './utils';
7
- const template = document.createElement('template');
1
+ import "../icon/index.js";
2
+ import "../segmented-control/index.js";
3
+ import "../segmented-control-option/index.js";
4
+ import { isAttrEqual, updateAttribute, updateBooleanAttribute, isAttrTrue, getAttribute, getBooleanAttribute, setClass } from "../utils/dom.js";
5
+ import { defineCustomElement, NectaryElement } from "../utils/element.js";
6
+ import { getRect } from "../utils/rect.js";
7
+ import { getReactEventHandler } from "../utils/get-react-event-handler.js";
8
+ import { stringifyHourFace, stringifyMinute, parseTime, hourToIndex, stringifyHour, getNeedleRotationDeg, getShortestCssDeg, stringifyTime } from "./utils.js";
9
+ const templateHTML = '<style>\n :host {\n display: block;\n outline: none;\n }\n\n #wrapper {\n display: flex;\n flex-direction: column;\n width: 248px;\n padding: 16px;\n box-sizing: border-box;\n gap: 16px;\n }\n\n #header {\n position: relative;\n width: 100%;\n height: 48px;\n font: var(--sinch-comp-time-picker-header-font);\n line-height: 48px;\n user-select: none;\n color: var(--sinch-comp-time-picker-header-color-default-text-initial);\n }\n\n #footer {\n display: flex;\n justify-content: center;\n width: 100%;\n height: 32px;\n }\n\n #picker {\n position: relative;\n width: 216px;\n height: 216px;\n border-radius: 50%;\n box-sizing: border-box;\n border:\n 1px solid\n var(--sinch-comp-time-picker-watch-face-color-default-border-initial);\n background-color:\n var(\n --sinch-comp-time-picker-watch-face-color-default-background-initial\n );\n }\n\n #picker-hours,\n #picker-minutes {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n pointer-events: none;\n user-select: none;\n }\n\n .digit-hour-12,\n .digit-hour-24,\n .digit-minute {\n position: absolute;\n width: 28px;\n height: 28px;\n text-align: center;\n top: calc(50% - 14px);\n left: calc(50% - 14px);\n z-index: 1;\n cursor: pointer;\n }\n\n .digit-hour-12 {\n font: var(--sinch-comp-time-picker-digit-font-default-h12);\n color: var(--sinch-comp-time-picker-digit-color-default-h12-initial);\n line-height: 28px;\n }\n\n .digit-hour-12.selected {\n font: var(--sinch-comp-time-picker-digit-font-checked-h12);\n color: var(--sinch-comp-time-picker-digit-color-checked-h12-default);\n }\n\n .digit-hour-24 {\n font: var(--sinch-comp-time-picker-digit-font-default-h24);\n color: var(--sinch-comp-time-picker-digit-color-default-h24-initial);\n line-height: 28px;\n }\n\n .digit-hour-24.selected {\n font: var(--sinch-comp-time-picker-digit-font-checked-h24);\n color: var(--sinch-comp-time-picker-digit-color-checked-h24-initial);\n }\n\n .digit-minute {\n font: var(--sinch-comp-time-picker-digit-font-default-minutes);\n color: var(--sinch-comp-time-picker-digit-color-default-minute-initial);\n line-height: 28px;\n }\n\n .digit-minute.selected {\n font: var(--sinch-comp-time-picker-digit-font-checked-minutes);\n color: var(--sinch-comp-time-picker-digit-color-checked-minute-initial);\n }\n\n #picker-touch {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n border-radius: 50%;\n }\n\n #needle-hour,\n #needle-minute,\n #picker-touch::after {\n background-color:\n var(\n --sinch-comp-time-picker-needle-color-default-background-initial\n );\n }\n\n #needle-hour,\n #needle-minute {\n position: absolute;\n transform-origin: bottom center;\n transform: rotate(0deg);\n bottom: 50%;\n height: 50px;\n transition-duration: 0.25s;\n transition-timing-function: ease-in-out;\n transition-property: transform height;\n z-index: 2;\n outline: none;\n }\n\n @media (prefers-reduced-motion) {\n #needle-hour,\n #needle-minute {\n transition: none;\n }\n }\n\n #needle-hour {\n width: 4px;\n left: calc(50% - 2px);\n border-radius: 2px;\n }\n\n #needle-minute {\n width: 2px;\n left: calc(50% - 1px);\n border-radius: 1px;\n }\n\n #needle-hour:focus-visible,\n #needle-minute:focus-visible {\n background-color:\n var(\n --sinch-comp-time-picker-needle-color-default-background-focus\n );\n }\n\n #needle-minute:not(.selected)::after {\n content: "";\n position: absolute;\n transform: translateX(-50%);\n left: 0;\n top: -16px;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color:\n var(\n --sinch-comp-time-picker-digit-color-checked-minute-initial\n );\n }\n\n #picker-touch::after {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n }\n\n #header-hours,\n #header-minutes {\n position: absolute;\n padding: 0 4px;\n width: 50px;\n outline: none;\n }\n\n #header-hours {\n right: calc(50% + 8px);\n text-align: right;\n }\n\n #header-minutes {\n left: calc(50% + 8px);\n }\n\n #header-colon {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n #submit {\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n }\n\n #submit-icon {\n --sinch-global-color-icon:\n var(\n --sinch-comp-time-picker-header-color-default-icon-initial\n );\n }\n\n :host([ampm]) .digit-hour-24 {\n display: none;\n }\n\n :host(:not([ampm])) #footer {\n display: none;\n }\n</style>\n\n<div id="wrapper">\n <div id="header">\n <div\n id="header-hours"\n role="meter"\n aria-valuemin="0"\n aria-valuemax="23"\n aria-valuenow="0"\n aria-valuetext="0"\n >\n <span>00</span>\n </div>\n <div id="header-colon">&colon;</div>\n <div\n id="header-minutes"\n role="meter"\n aria-valuemin="0"\n aria-valuemax="59"\n aria-valuenow="0"\n aria-valuetext="0"\n >\n <span>00</span>\n </div>\n <sinch-button id="submit" size="s" aria-label="Submit">\n <sinch-icon icons-version="2" name="fa-check" id="icon-submit" slot="icon"></sinch-icon>\n </sinch-button>\n </div>\n <div id="picker" aria-hidden="true">\n <div id="picker-hours"></div>\n <div id="picker-minutes"></div>\n <div id="picker-touch">\n <div id="needle-hour" tabindex="0"></div>\n <div id="needle-minute" tabindex="0"></div>\n </div>\n </div>\n <div id="footer">\n <sinch-segmented-control id="ampm">\n <sinch-segmented-control-option\n value="am"\n text="AM"\n aria-label="AM"\n ></sinch-segmented-control-option>\n <sinch-segmented-control-option\n value="pm"\n text="PM"\n aria-label="PM"\n ></sinch-segmented-control-option>\n </sinch-segmented-control>\n </div>\n</div>\n';
10
+ const template = document.createElement("template");
8
11
  template.innerHTML = templateHTML;
9
12
  const PICKER_RADIUS = 216 / 2;
10
13
  const MINUTE_DIGIT_SIZE = 30;
@@ -16,7 +19,7 @@ const HOUR_24_RADIUS = HOUR_12_RADIUS - HOUR_24_DIGIT_SIZE;
16
19
  const NEEDLE_HOUR_12_LENGTH = HOUR_12_RADIUS;
17
20
  const NEEDLE_HOUR_24_LENGTH = HOUR_24_RADIUS;
18
21
  const NEEDLE_MINUTE_LENGTH = MINUTE_RADIUS;
19
- export class TimePicker extends NectaryElement {
22
+ class TimePicker extends NectaryElement {
20
23
  #$pickerHours;
21
24
  #$pickerMinutes;
22
25
  #$pickerTouch;
@@ -35,17 +38,17 @@ export class TimePicker extends NectaryElement {
35
38
  super();
36
39
  const shadowRoot = this.attachShadow();
37
40
  shadowRoot.appendChild(template.content.cloneNode(true));
38
- this.#$pickerHours = shadowRoot.querySelector('#picker-hours');
39
- this.#$pickerMinutes = shadowRoot.querySelector('#picker-minutes');
40
- this.#$pickerTouch = shadowRoot.querySelector('#picker');
41
- this.#$needleHour = shadowRoot.querySelector('#needle-hour');
42
- this.#$needleMinute = shadowRoot.querySelector('#needle-minute');
43
- this.#$headerHours = shadowRoot.querySelector('#header-hours');
44
- this.#$headerMinutes = shadowRoot.querySelector('#header-minutes');
45
- this.#$headerHoursText = shadowRoot.querySelector('#header-hours > span');
46
- this.#$headerMinutesText = shadowRoot.querySelector('#header-minutes > span');
47
- this.#$ampm = shadowRoot.querySelector('#ampm');
48
- this.#$submitButton = shadowRoot.querySelector('#submit');
41
+ this.#$pickerHours = shadowRoot.querySelector("#picker-hours");
42
+ this.#$pickerMinutes = shadowRoot.querySelector("#picker-minutes");
43
+ this.#$pickerTouch = shadowRoot.querySelector("#picker");
44
+ this.#$needleHour = shadowRoot.querySelector("#needle-hour");
45
+ this.#$needleMinute = shadowRoot.querySelector("#needle-minute");
46
+ this.#$headerHours = shadowRoot.querySelector("#header-hours");
47
+ this.#$headerMinutes = shadowRoot.querySelector("#header-minutes");
48
+ this.#$headerHoursText = shadowRoot.querySelector("#header-hours > span");
49
+ this.#$headerMinutesText = shadowRoot.querySelector("#header-minutes > span");
50
+ this.#$ampm = shadowRoot.querySelector("#ampm");
51
+ this.#$submitButton = shadowRoot.querySelector("#submit");
49
52
  this.#$needleMinute.style.height = `${NEEDLE_MINUTE_LENGTH}px`;
50
53
  this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
51
54
  const MINUTE_DIGIT_RADIUS = MINUTE_RADIUS + MINUTE_DIGIT_SIZE / 2;
@@ -54,11 +57,11 @@ export class TimePicker extends NectaryElement {
54
57
  const hours12Frag = document.createDocumentFragment();
55
58
  for (let i = 0; i < 12; i++) {
56
59
  const rad = Math.PI / 6 * (i - 3);
57
- const el = document.createElement('div');
60
+ const el = document.createElement("div");
58
61
  const x = Math.cos(rad) * HOUR_12_DIGIT_RADIUS;
59
62
  const y = Math.sin(rad) * HOUR_12_DIGIT_RADIUS;
60
63
  const hourDisplayValue = stringifyHourFace(i);
61
- el.className = 'digit-hour-12';
64
+ el.className = "digit-hour-12";
62
65
  el.style.transform = `translate(${x}px, ${y}px)`;
63
66
  el.textContent = hourDisplayValue;
64
67
  hours12Frag.appendChild(el);
@@ -67,11 +70,11 @@ export class TimePicker extends NectaryElement {
67
70
  const hours24Frag = document.createDocumentFragment();
68
71
  for (let i = 12; i < 24; i++) {
69
72
  const rad = Math.PI / 6 * (i - 3);
70
- const el = document.createElement('div');
73
+ const el = document.createElement("div");
71
74
  const x = Math.cos(rad) * HOUR_24_DIGIT_RADIUS;
72
75
  const y = Math.sin(rad) * HOUR_24_DIGIT_RADIUS;
73
76
  const hourDisplayValue = stringifyHourFace(i);
74
- el.className = 'digit-hour-24';
77
+ el.className = "digit-hour-24";
75
78
  el.style.transform = `translate(${x}px, ${y}px)`;
76
79
  el.textContent = hourDisplayValue;
77
80
  hours24Frag.appendChild(el);
@@ -80,10 +83,10 @@ export class TimePicker extends NectaryElement {
80
83
  const minutesFrag = document.createDocumentFragment();
81
84
  for (let i = 0; i < 60; i += 5) {
82
85
  const rad = Math.PI / 30 * (i - 15);
83
- const el = document.createElement('div');
86
+ const el = document.createElement("div");
84
87
  const x = Math.cos(rad) * MINUTE_DIGIT_RADIUS;
85
88
  const y = Math.sin(rad) * MINUTE_DIGIT_RADIUS;
86
- el.className = 'digit-minute';
89
+ el.className = "digit-minute";
87
90
  el.style.transform = `translate(${x}px, ${y}px)`;
88
91
  el.textContent = stringifyMinute(i);
89
92
  minutesFrag.appendChild(el);
@@ -95,66 +98,60 @@ export class TimePicker extends NectaryElement {
95
98
  const options = {
96
99
  signal: this.#controller.signal
97
100
  };
98
- this.#$pickerTouch.addEventListener('click', this.#onPickerClick, options);
99
- this.#$ampm.addEventListener('-change', this.#onAmPmChange, options);
100
- this.#$submitButton.addEventListener('click', this.#onSubmitButtonClick, options);
101
- this.#$needleHour.addEventListener('keydown', this.#onHoursKeydown, options);
102
- this.#$needleMinute.addEventListener('keydown', this.#onMinutesKeydown, options);
103
- this.addEventListener('-change', this.#onChangeReactHandler, options);
101
+ this.#$pickerTouch.addEventListener("click", this.#onPickerClick, options);
102
+ this.#$ampm.addEventListener("-change", this.#onAmPmChange, options);
103
+ this.#$submitButton.addEventListener("click", this.#onSubmitButtonClick, options);
104
+ this.#$needleHour.addEventListener("keydown", this.#onHoursKeydown, options);
105
+ this.#$needleMinute.addEventListener("keydown", this.#onMinutesKeydown, options);
106
+ this.addEventListener("-change", this.#onChangeReactHandler, options);
104
107
  }
105
108
  disconnectedCallback() {
106
109
  this.#controller.abort();
107
110
  this.#controller = null;
108
111
  }
109
112
  static get observedAttributes() {
110
- return ['value', 'ampm', 'submit-aria-label'];
113
+ return ["value", "ampm", "submit-aria-label"];
111
114
  }
112
115
  attributeChangedCallback(name, prevValue, newVal) {
113
116
  if (isAttrEqual(prevValue, newVal)) {
114
117
  return;
115
118
  }
116
119
  switch (name) {
117
- case 'value':
118
- {
119
- const {
120
- hours,
121
- minutes
122
- } = parseTime(newVal);
123
- this.#hour = hours;
124
- this.#minute = minutes;
125
- this.#render();
126
- break;
127
- }
128
- case 'ampm':
129
- {
130
- this.#render();
131
- updateBooleanAttribute(this, 'ampm', isAttrTrue(newVal));
132
- break;
133
- }
134
- case 'submit-aria-label':
135
- {
136
- updateAttribute(this.#$submitButton, 'aria-label', newVal);
137
- break;
138
- }
120
+ case "value": {
121
+ const { hours, minutes } = parseTime(newVal);
122
+ this.#hour = hours;
123
+ this.#minute = minutes;
124
+ this.#render();
125
+ break;
126
+ }
127
+ case "ampm": {
128
+ this.#render();
129
+ updateBooleanAttribute(this, "ampm", isAttrTrue(newVal));
130
+ break;
131
+ }
132
+ case "submit-aria-label": {
133
+ updateAttribute(this.#$submitButton, "aria-label", newVal);
134
+ break;
135
+ }
139
136
  }
140
137
  }
141
138
  set value(value) {
142
- updateAttribute(this, 'value', value);
139
+ updateAttribute(this, "value", value);
143
140
  }
144
141
  get value() {
145
- return getAttribute(this, 'value', '');
142
+ return getAttribute(this, "value", "");
146
143
  }
147
144
  set ampm(value) {
148
- updateBooleanAttribute(this, 'ampm', value);
145
+ updateBooleanAttribute(this, "ampm", value);
149
146
  }
150
147
  get ampm() {
151
- return getBooleanAttribute(this, 'ampm');
148
+ return getBooleanAttribute(this, "ampm");
152
149
  }
153
150
  set submitAriaLabel(value) {
154
- updateAttribute(this, 'submit-aria-label', value);
151
+ updateAttribute(this, "submit-aria-label", value);
155
152
  }
156
153
  get submitAriaLabel() {
157
- return getAttribute(this, 'submit-aria-label', '');
154
+ return getAttribute(this, "submit-aria-label", "");
158
155
  }
159
156
  get submitButtonRect() {
160
157
  return getRect(this.#$submitButton);
@@ -200,13 +197,13 @@ export class TimePicker extends NectaryElement {
200
197
  const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
201
198
  return [cssDeg, rowIndex];
202
199
  }
203
- #onPickerClick = e => {
200
+ #onPickerClick = (e) => {
204
201
  const [cssDeg, rowIndex] = this.#getClickDegree(e.x, e.y);
205
202
  const isHourRowClick = rowIndex > 0;
206
203
  const isHour24RowClick = rowIndex > 1;
207
204
  if (isHourRowClick) {
208
205
  const digitIndex = Math.round(cssDeg / 30) % 12;
209
- const is24 = getBooleanAttribute(this, 'ampm') === false;
206
+ const is24 = getBooleanAttribute(this, "ampm") === false;
210
207
  if (is24) {
211
208
  if (isHour24RowClick) {
212
209
  this.#hour = digitIndex === 0 ? 0 : digitIndex + 12;
@@ -214,7 +211,7 @@ export class TimePicker extends NectaryElement {
214
211
  this.#hour = digitIndex === 0 ? 12 : digitIndex;
215
212
  }
216
213
  } else {
217
- this.#hour = digitIndex + (this.#$ampm.value === 'pm' ? 12 : 0);
214
+ this.#hour = digitIndex + (this.#$ampm.value === "pm" ? 12 : 0);
218
215
  }
219
216
  this.#$headerHours.focus();
220
217
  } else {
@@ -224,15 +221,15 @@ export class TimePicker extends NectaryElement {
224
221
  this.#render();
225
222
  };
226
223
  #render() {
227
- const is24 = getBooleanAttribute(this, 'ampm') === false;
224
+ const is24 = getBooleanAttribute(this, "ampm") === false;
228
225
  this.#selectHour(is24);
229
226
  this.#selectMinute();
230
227
  this.#$headerHoursText.textContent = stringifyHour(this.#hour, is24);
231
228
  this.#$headerMinutesText.textContent = stringifyMinute(this.#minute);
232
- updateAttribute(this.#$headerHours, 'aria-valuenow', this.#hour);
233
- updateAttribute(this.#$headerHours, 'aria-valuetext', this.#hour);
234
- updateAttribute(this.#$headerMinutes, 'aria-valuenow', this.#minute);
235
- updateAttribute(this.#$headerMinutes, 'aria-valuetext', this.#minute);
229
+ updateAttribute(this.#$headerHours, "aria-valuenow", this.#hour);
230
+ updateAttribute(this.#$headerHours, "aria-valuetext", this.#hour);
231
+ updateAttribute(this.#$headerMinutes, "aria-valuenow", this.#minute);
232
+ updateAttribute(this.#$headerMinutes, "aria-valuetext", this.#minute);
236
233
  }
237
234
  #selectHour(is24) {
238
235
  const $hours = this.#$pickerHours.children;
@@ -241,7 +238,7 @@ export class TimePicker extends NectaryElement {
241
238
  const currentCssDeg = getNeedleRotationDeg(this.#$needleHour);
242
239
  const hourCssDeg = getShortestCssDeg(currentCssDeg, hourDigitIndex * 30);
243
240
  for (let i = 0; i < $hours.length; i++) {
244
- setClass($hours[i], 'selected', i === selectedIndex);
241
+ setClass($hours[i], "selected", i === selectedIndex);
245
242
  }
246
243
  this.#$needleHour.style.transform = `rotate(${hourCssDeg}deg)`;
247
244
  if (is24) {
@@ -253,7 +250,7 @@ export class TimePicker extends NectaryElement {
253
250
  } else {
254
251
  this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
255
252
  }
256
- this.#$ampm.setAttribute('value', this.#hour >= 0 && this.#hour < 12 ? 'am' : 'pm');
253
+ this.#$ampm.setAttribute("value", this.#hour >= 0 && this.#hour < 12 ? "am" : "pm");
257
254
  }
258
255
  #selectMinute() {
259
256
  const $minutes = this.#$pickerMinutes.children;
@@ -262,76 +259,75 @@ export class TimePicker extends NectaryElement {
262
259
  const currentCssDeg = getNeedleRotationDeg(this.#$needleMinute);
263
260
  const minuteCssDeg = getShortestCssDeg(currentCssDeg, this.#minute * 6);
264
261
  for (let i = 0; i < $minutes.length; i++) {
265
- setClass($minutes[i], 'selected', selectedIndex === i);
262
+ setClass($minutes[i], "selected", selectedIndex === i);
266
263
  }
267
- setClass(this.#$needleMinute, 'selected', isNeedleSelected);
264
+ setClass(this.#$needleMinute, "selected", isNeedleSelected);
268
265
  this.#$needleMinute.style.transform = `rotate(${minuteCssDeg}deg)`;
269
266
  }
270
- #onAmPmChange = e => {
267
+ #onAmPmChange = (e) => {
271
268
  const value = e.detail;
272
269
  switch (value) {
273
- case 'am':
274
- {
275
- if (this.#hour >= 12) {
276
- this.#hour -= 12;
277
- this.#render();
278
- }
279
- break;
270
+ case "am": {
271
+ if (this.#hour >= 12) {
272
+ this.#hour -= 12;
273
+ this.#render();
280
274
  }
281
- case 'pm':
282
- {
283
- if (this.#hour < 12) {
284
- this.#hour += 12;
285
- this.#render();
286
- }
287
- break;
275
+ break;
276
+ }
277
+ case "pm": {
278
+ if (this.#hour < 12) {
279
+ this.#hour += 12;
280
+ this.#render();
288
281
  }
282
+ break;
283
+ }
289
284
  }
290
285
  };
291
286
  #onSubmitButtonClick = () => {
292
287
  const value = stringifyTime(this.#hour, this.#minute);
293
- this.dispatchEvent(new CustomEvent('-change', {
294
- detail: value
295
- }));
288
+ this.dispatchEvent(
289
+ new CustomEvent("-change", {
290
+ detail: value
291
+ })
292
+ );
296
293
  };
297
- #onHoursKeydown = e => {
294
+ #onHoursKeydown = (e) => {
298
295
  switch (e.key) {
299
- case 'ArrowUp':
300
- {
301
- e.preventDefault();
302
- this.#hour = (this.#hour + 1) % 24;
303
- this.#render();
304
- break;
305
- }
306
- case 'ArrowDown':
307
- {
308
- e.preventDefault();
309
- this.#hour = (this.#hour + 23) % 24;
310
- this.#render();
311
- break;
312
- }
296
+ case "ArrowUp": {
297
+ e.preventDefault();
298
+ this.#hour = (this.#hour + 1) % 24;
299
+ this.#render();
300
+ break;
301
+ }
302
+ case "ArrowDown": {
303
+ e.preventDefault();
304
+ this.#hour = (this.#hour + 23) % 24;
305
+ this.#render();
306
+ break;
307
+ }
313
308
  }
314
309
  };
315
- #onMinutesKeydown = e => {
310
+ #onMinutesKeydown = (e) => {
316
311
  switch (e.key) {
317
- case 'ArrowUp':
318
- {
319
- e.preventDefault();
320
- this.#minute = (this.#minute + 1) % 60;
321
- this.#render();
322
- break;
323
- }
324
- case 'ArrowDown':
325
- {
326
- e.preventDefault();
327
- this.#minute = (this.#minute + 59) % 60;
328
- this.#render();
329
- break;
330
- }
312
+ case "ArrowUp": {
313
+ e.preventDefault();
314
+ this.#minute = (this.#minute + 1) % 60;
315
+ this.#render();
316
+ break;
317
+ }
318
+ case "ArrowDown": {
319
+ e.preventDefault();
320
+ this.#minute = (this.#minute + 59) % 60;
321
+ this.#render();
322
+ break;
323
+ }
331
324
  }
332
325
  };
333
- #onChangeReactHandler = e => {
334
- getReactEventHandler(this, 'on-change')?.(e);
326
+ #onChangeReactHandler = (e) => {
327
+ getReactEventHandler(this, "on-change")?.(e);
335
328
  };
336
329
  }
337
- defineCustomElement('sinch-time-picker', TimePicker);
330
+ defineCustomElement("sinch-time-picker", TimePicker);
331
+ export {
332
+ TimePicker
333
+ };
@@ -1,4 +1,4 @@
1
- import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect } from '../types';
1
+ import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect, NectaryComponentReact, NectaryComponentVanilla } from '../types';
2
2
  export type TSinchTimePickerProps = {
3
3
  /** Time value in ISO 8601 format */
4
4
  value: string;
@@ -50,3 +50,23 @@ export type TSinchTimePicker = {
50
50
  };
51
51
  export type TSinchTimePickerElement = NectaryComponentVanillaByType<TSinchTimePicker>;
52
52
  export type TSinchTimePickerReact = NectaryComponentReactByType<TSinchTimePicker>;
53
+ declare global {
54
+ interface NectaryComponentMap {
55
+ 'sinch-time-picker': TSinchTimePicker;
56
+ }
57
+ interface HTMLElementTagNameMap {
58
+ 'sinch-time-picker': NectaryComponentVanilla<'sinch-time-picker'>;
59
+ }
60
+ namespace JSX {
61
+ interface IntrinsicElements {
62
+ 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
63
+ }
64
+ }
65
+ }
66
+ declare module 'react' {
67
+ namespace JSX {
68
+ interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
69
+ 'sinch-time-picker': NectaryComponentReact<'sinch-time-picker'>;
70
+ }
71
+ }
72
+ }
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,52 +1,40 @@
1
- export const parseTime = value => {
2
- if (value === '' || value === null) {
3
- return {
4
- hours: 0,
5
- minutes: 0
6
- };
1
+ const parseTime = (value) => {
2
+ if (value === "" || value === null) {
3
+ return { hours: 0, minutes: 0 };
7
4
  }
8
- const timeParts = value.split(':');
9
- const hours = parseInt(timeParts[0] ?? '00');
10
- const minutes = parseInt(timeParts[1] ?? '00');
5
+ const timeParts = value.split(":");
6
+ const hours = parseInt(timeParts[0] ?? "00");
7
+ const minutes = parseInt(timeParts[1] ?? "00");
11
8
  if (isNaN(hours) || hours > 23 || hours < 0) {
12
- return {
13
- hours: 0,
14
- minutes: 0
15
- };
9
+ return { hours: 0, minutes: 0 };
16
10
  }
17
11
  if (isNaN(minutes) || minutes > 59 || minutes < 0) {
18
- return {
19
- hours: 0,
20
- minutes: 0
21
- };
12
+ return { hours: 0, minutes: 0 };
22
13
  }
23
- return {
24
- hours,
25
- minutes
26
- };
14
+ return { hours, minutes };
27
15
  };
28
- const pad = value => {
29
- return value.toString().padStart(2, '0');
16
+ const pad = (value) => {
17
+ return value.toString().padStart(2, "0");
30
18
  };
31
- export const stringifyTime = (hour, minute) => {
19
+ const stringifyTime = (hour, minute) => {
32
20
  return `${pad(hour)}:${pad(minute)}:00`;
33
21
  };
34
- export const stringifyHour = (hour, is24) => {
22
+ const stringifyHour = (hour, is24) => {
35
23
  if (is24) {
36
24
  return pad(hour);
37
25
  }
38
26
  if (hour === 0 || hour === 12) {
39
- return '12';
27
+ return "12";
40
28
  }
41
29
  return pad(hour % 12);
42
30
  };
43
- export const stringifyHourFace = hour => {
44
- return hour === 0 ? '12' : hour === 12 ? '24' : String(hour);
31
+ const stringifyHourFace = (hour) => {
32
+ return hour === 0 ? "12" : hour === 12 ? "24" : String(hour);
45
33
  };
46
- export const stringifyMinute = minute => {
34
+ const stringifyMinute = (minute) => {
47
35
  return pad(minute);
48
36
  };
49
- export const hourToIndex = (hour, is24) => {
37
+ const hourToIndex = (hour, is24) => {
50
38
  if (is24) {
51
39
  if (hour === 0) {
52
40
  return 12;
@@ -58,18 +46,28 @@ export const hourToIndex = (hour, is24) => {
58
46
  }
59
47
  return hour % 12;
60
48
  };
61
- export const getNeedleRotationDeg = elem => {
49
+ const getNeedleRotationDeg = (elem) => {
62
50
  const match = elem.style.transform.match(/^rotate\((-?\d+)deg\)$/);
63
51
  if (match === null) {
64
52
  return 0;
65
53
  }
66
54
  return Number(match[1]);
67
55
  };
68
- export const getShortestCssDeg = (currentDeg, nextDeg) => {
56
+ const getShortestCssDeg = (currentDeg, nextDeg) => {
69
57
  const angle = currentDeg % 360;
70
58
  const diff = (360 - (angle - nextDeg)) % 360;
71
59
  if (diff > 180) {
72
60
  return currentDeg - 360 + diff;
73
61
  }
74
62
  return currentDeg + diff;
75
- };
63
+ };
64
+ export {
65
+ getNeedleRotationDeg,
66
+ getShortestCssDeg,
67
+ hourToIndex,
68
+ parseTime,
69
+ stringifyHour,
70
+ stringifyHourFace,
71
+ stringifyMinute,
72
+ stringifyTime
73
+ };
@@ -0,0 +1 @@
1
+ export * from '../types';
@@ -0,0 +1,2 @@
1
+ import { defineCustomElement } from "../../utils/element.js";
2
+ defineCustomElement("sinch-title");