@nectary/components 4.12.0 → 4.12.1

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