@veracity/vui 0.7.0-beta.1 → 0.7.0-beta.2

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 (409) hide show
  1. package/dist/cjs/button/button.js +1 -1
  2. package/dist/cjs/button/buttonIcon.d.ts.map +1 -1
  3. package/dist/cjs/button/buttonIcon.js +15 -2
  4. package/dist/cjs/button/buttonText.d.ts.map +1 -1
  5. package/dist/cjs/button/buttonText.js +15 -2
  6. package/dist/cjs/button/context.d.ts +2 -2
  7. package/dist/cjs/button/context.d.ts.map +1 -1
  8. package/dist/cjs/button/context.js +3 -3
  9. package/dist/cjs/buttonGroup/context.d.ts +2 -2
  10. package/dist/cjs/buttonGroup/context.d.ts.map +1 -1
  11. package/dist/cjs/buttonGroup/context.js +3 -3
  12. package/dist/cjs/checkbox/checkbox.js +1 -1
  13. package/dist/cjs/checkbox/context.d.ts +2 -2
  14. package/dist/cjs/checkbox/context.d.ts.map +1 -1
  15. package/dist/cjs/checkbox/context.js +3 -3
  16. package/dist/cjs/core/links.d.ts.map +1 -1
  17. package/dist/cjs/core/links.js +26 -25
  18. package/dist/cjs/dialog/dialogBody.d.ts.map +1 -1
  19. package/dist/cjs/dialog/dialogBody.js +13 -1
  20. package/dist/cjs/dialog/dialogCancelButton.d.ts.map +1 -1
  21. package/dist/cjs/dialog/dialogCancelButton.js +14 -1
  22. package/dist/cjs/dialog/dialogCloseButton.d.ts.map +1 -1
  23. package/dist/cjs/dialog/dialogCloseButton.js +14 -1
  24. package/dist/cjs/dialog/dialogFooter.d.ts.map +1 -1
  25. package/dist/cjs/dialog/dialogFooter.js +2 -2
  26. package/dist/cjs/dialog/dialogHeader.js +2 -2
  27. package/dist/cjs/dialog/dialogIcon.d.ts.map +1 -1
  28. package/dist/cjs/dialog/dialogIcon.js +14 -1
  29. package/dist/cjs/dialog/dialogSubmitButton.d.ts.map +1 -1
  30. package/dist/cjs/dialog/dialogSubmitButton.js +14 -1
  31. package/dist/cjs/dialog/dialogTitle.d.ts.map +1 -1
  32. package/dist/cjs/dialog/dialogTitle.js +14 -1
  33. package/dist/cjs/footer/footerColumn.d.ts.map +1 -1
  34. package/dist/cjs/footer/footerColumn.js +3 -2
  35. package/dist/cjs/footer/footerContent.d.ts.map +1 -1
  36. package/dist/cjs/footer/footerContent.js +14 -1
  37. package/dist/cjs/footer/footerHeading.d.ts.map +1 -1
  38. package/dist/cjs/footer/footerHeading.js +14 -1
  39. package/dist/cjs/footer/footerLink.d.ts.map +1 -1
  40. package/dist/cjs/footer/footerLink.js +14 -1
  41. package/dist/cjs/footer/footerRow.d.ts.map +1 -1
  42. package/dist/cjs/footer/footerRow.js +14 -1
  43. package/dist/cjs/footer/footerSection.js +2 -2
  44. package/dist/cjs/footer/footerTrademark.d.ts.map +1 -1
  45. package/dist/cjs/footer/footerTrademark.js +3 -2
  46. package/dist/cjs/header/headerAccount.d.ts.map +1 -1
  47. package/dist/cjs/header/headerAccount.js +5 -5
  48. package/dist/cjs/header/headerAccount.types.d.ts +1 -1
  49. package/dist/cjs/header/headerAccount.types.d.ts.map +1 -1
  50. package/dist/cjs/header/headerAccountUserInfo.d.ts.map +1 -1
  51. package/dist/cjs/header/headerAccountUserInfo.js +5 -4
  52. package/dist/cjs/header/headerContent.d.ts.map +1 -1
  53. package/dist/cjs/header/headerContent.js +14 -1
  54. package/dist/cjs/header/headerCreateAccount.d.ts.map +1 -1
  55. package/dist/cjs/header/headerCreateAccount.js +3 -2
  56. package/dist/cjs/header/headerDivider.d.ts.map +1 -1
  57. package/dist/cjs/header/headerDivider.js +14 -1
  58. package/dist/cjs/header/headerLogo.d.ts.map +1 -1
  59. package/dist/cjs/header/headerLogo.js +3 -2
  60. package/dist/cjs/header/headerMainLinks.d.ts.map +1 -1
  61. package/dist/cjs/header/headerMainLinks.js +3 -2
  62. package/dist/cjs/header/headerMobileContent.d.ts.map +1 -1
  63. package/dist/cjs/header/headerMobileContent.js +13 -1
  64. package/dist/cjs/header/headerMobileToggle.d.ts.map +1 -1
  65. package/dist/cjs/header/headerMobileToggle.js +13 -1
  66. package/dist/cjs/header/headerNotifications.d.ts.map +1 -1
  67. package/dist/cjs/header/headerNotifications.js +3 -2
  68. package/dist/cjs/header/headerServices.js +2 -2
  69. package/dist/cjs/header/headerServicesMessage.d.ts.map +1 -1
  70. package/dist/cjs/header/headerServicesMessage.js +3 -2
  71. package/dist/cjs/header/headerSignIn.d.ts.map +1 -1
  72. package/dist/cjs/header/headerSignIn.js +3 -2
  73. package/dist/cjs/input/context.d.ts +2 -2
  74. package/dist/cjs/input/context.d.ts.map +1 -1
  75. package/dist/cjs/input/context.js +3 -3
  76. package/dist/cjs/input/input.js +1 -1
  77. package/dist/cjs/input/inputIcon.d.ts.map +1 -1
  78. package/dist/cjs/input/inputIcon.js +15 -2
  79. package/dist/cjs/input/inputInput.d.ts.map +1 -1
  80. package/dist/cjs/input/inputInput.js +14 -2
  81. package/dist/cjs/link/context.d.ts +2 -2
  82. package/dist/cjs/link/context.d.ts.map +1 -1
  83. package/dist/cjs/link/context.js +3 -3
  84. package/dist/cjs/link/linkIcon.d.ts.map +1 -1
  85. package/dist/cjs/link/linkIcon.js +15 -2
  86. package/dist/cjs/link/linkText.d.ts.map +1 -1
  87. package/dist/cjs/link/linkText.js +15 -2
  88. package/dist/cjs/list/context.d.ts +2 -2
  89. package/dist/cjs/list/context.d.ts.map +1 -1
  90. package/dist/cjs/list/context.js +3 -3
  91. package/dist/cjs/list/listDivider.d.ts.map +1 -1
  92. package/dist/cjs/list/listDivider.js +15 -2
  93. package/dist/cjs/list/listHeading.d.ts.map +1 -1
  94. package/dist/cjs/list/listHeading.js +15 -2
  95. package/dist/cjs/list/listIcon.d.ts.map +1 -1
  96. package/dist/cjs/list/listIcon.js +15 -2
  97. package/dist/cjs/list/listItem.d.ts.map +1 -1
  98. package/dist/cjs/list/listItem.js +3 -3
  99. package/dist/cjs/list/listText.d.ts.map +1 -1
  100. package/dist/cjs/list/listText.js +15 -2
  101. package/dist/cjs/menu/menuButton.d.ts.map +1 -1
  102. package/dist/cjs/menu/menuButton.js +15 -2
  103. package/dist/cjs/menu/menuItem.d.ts.map +1 -1
  104. package/dist/cjs/menu/menuItem.js +2 -2
  105. package/dist/cjs/menu/menuList.d.ts.map +1 -1
  106. package/dist/cjs/menu/menuList.js +4 -3
  107. package/dist/cjs/modal/modalBackdrop.d.ts.map +1 -1
  108. package/dist/cjs/modal/modalBackdrop.js +13 -1
  109. package/dist/cjs/modal/modalContent.d.ts.map +1 -1
  110. package/dist/cjs/modal/modalContent.js +13 -1
  111. package/dist/cjs/notification/context.d.ts +2 -2
  112. package/dist/cjs/notification/context.d.ts.map +1 -1
  113. package/dist/cjs/notification/context.js +3 -3
  114. package/dist/cjs/notification/notificationButton.d.ts.map +1 -1
  115. package/dist/cjs/notification/notificationButton.js +16 -3
  116. package/dist/cjs/notification/notificationIcon.d.ts.map +1 -1
  117. package/dist/cjs/notification/notificationIcon.js +16 -3
  118. package/dist/cjs/notification/notificationText.d.ts.map +1 -1
  119. package/dist/cjs/notification/notificationText.js +15 -2
  120. package/dist/cjs/notification/notificationTitle.d.ts.map +1 -1
  121. package/dist/cjs/notification/notificationTitle.js +15 -2
  122. package/dist/cjs/pagination/helpers.d.ts.map +1 -1
  123. package/dist/cjs/pagination/helpers.js +30 -12
  124. package/dist/cjs/pagination/paginationButton.d.ts.map +1 -1
  125. package/dist/cjs/pagination/paginationButton.js +3 -2
  126. package/dist/cjs/pagination/paginationEllipsis.d.ts.map +1 -1
  127. package/dist/cjs/pagination/paginationEllipsis.js +3 -2
  128. package/dist/cjs/pagination/paginationGoToPage.d.ts.map +1 -1
  129. package/dist/cjs/pagination/paginationGoToPage.js +14 -1
  130. package/dist/cjs/pagination/paginationNavigation.js +2 -2
  131. package/dist/cjs/pagination/paginationPrevNext.d.ts.map +1 -1
  132. package/dist/cjs/pagination/paginationPrevNext.js +3 -2
  133. package/dist/cjs/pagination/paginationResults.d.ts.map +1 -1
  134. package/dist/cjs/pagination/paginationResults.js +3 -2
  135. package/dist/cjs/popover/popoverContent.js +2 -2
  136. package/dist/cjs/popover/popoverTrigger.js +3 -3
  137. package/dist/cjs/radio/context.d.ts +2 -2
  138. package/dist/cjs/radio/context.d.ts.map +1 -1
  139. package/dist/cjs/radio/context.js +3 -3
  140. package/dist/cjs/radio/radio.js +1 -1
  141. package/dist/cjs/spinner/consts.d.ts +0 -12
  142. package/dist/cjs/spinner/consts.d.ts.map +1 -1
  143. package/dist/cjs/spinner/consts.js +4 -8
  144. package/dist/cjs/spinner/spinner.js +2 -2
  145. package/dist/cjs/switch/context.d.ts +2 -2
  146. package/dist/cjs/switch/context.d.ts.map +1 -1
  147. package/dist/cjs/switch/context.js +3 -3
  148. package/dist/cjs/switch/switchButton.js +2 -2
  149. package/dist/cjs/switch/switchLabel.d.ts.map +1 -1
  150. package/dist/cjs/switch/switchLabel.js +15 -2
  151. package/dist/cjs/tag/context.d.ts +2 -2
  152. package/dist/cjs/tag/context.d.ts.map +1 -1
  153. package/dist/cjs/tag/context.js +3 -3
  154. package/dist/cjs/tag/tagButton.d.ts.map +1 -1
  155. package/dist/cjs/tag/tagButton.js +16 -3
  156. package/dist/cjs/tag/tagIcon.d.ts.map +1 -1
  157. package/dist/cjs/tag/tagIcon.js +15 -2
  158. package/dist/cjs/tag/tagText.d.ts.map +1 -1
  159. package/dist/cjs/tag/tagText.js +15 -2
  160. package/dist/cjs/textarea/textarea.js +1 -1
  161. package/dist/cjs/utils/react.d.ts +2 -2
  162. package/dist/cjs/utils/react.d.ts.map +1 -1
  163. package/dist/cjs/utils/react.js +2 -2
  164. package/dist/esm/button/button.js +2 -2
  165. package/dist/esm/button/buttonIcon.d.ts.map +1 -1
  166. package/dist/esm/button/buttonIcon.js +5 -3
  167. package/dist/esm/button/buttonText.d.ts.map +1 -1
  168. package/dist/esm/button/buttonText.js +5 -3
  169. package/dist/esm/button/context.d.ts +2 -2
  170. package/dist/esm/button/context.d.ts.map +1 -1
  171. package/dist/esm/button/context.js +2 -2
  172. package/dist/esm/buttonGroup/context.d.ts +2 -2
  173. package/dist/esm/buttonGroup/context.d.ts.map +1 -1
  174. package/dist/esm/buttonGroup/context.js +2 -2
  175. package/dist/esm/checkbox/checkbox.js +2 -2
  176. package/dist/esm/checkbox/context.d.ts +2 -2
  177. package/dist/esm/checkbox/context.d.ts.map +1 -1
  178. package/dist/esm/checkbox/context.js +2 -2
  179. package/dist/esm/core/links.d.ts.map +1 -1
  180. package/dist/esm/core/links.js +18 -15
  181. package/dist/esm/dialog/dialogBody.d.ts.map +1 -1
  182. package/dist/esm/dialog/dialogBody.js +3 -2
  183. package/dist/esm/dialog/dialogCancelButton.d.ts.map +1 -1
  184. package/dist/esm/dialog/dialogCancelButton.js +3 -1
  185. package/dist/esm/dialog/dialogCloseButton.d.ts.map +1 -1
  186. package/dist/esm/dialog/dialogCloseButton.js +3 -1
  187. package/dist/esm/dialog/dialogFooter.d.ts.map +1 -1
  188. package/dist/esm/dialog/dialogFooter.js +3 -3
  189. package/dist/esm/dialog/dialogHeader.js +3 -3
  190. package/dist/esm/dialog/dialogIcon.d.ts.map +1 -1
  191. package/dist/esm/dialog/dialogIcon.js +3 -1
  192. package/dist/esm/dialog/dialogSubmitButton.d.ts.map +1 -1
  193. package/dist/esm/dialog/dialogSubmitButton.js +3 -1
  194. package/dist/esm/dialog/dialogTitle.d.ts.map +1 -1
  195. package/dist/esm/dialog/dialogTitle.js +3 -1
  196. package/dist/esm/footer/footerColumn.d.ts.map +1 -1
  197. package/dist/esm/footer/footerColumn.js +3 -2
  198. package/dist/esm/footer/footerContent.d.ts.map +1 -1
  199. package/dist/esm/footer/footerContent.js +3 -1
  200. package/dist/esm/footer/footerHeading.d.ts.map +1 -1
  201. package/dist/esm/footer/footerHeading.js +3 -1
  202. package/dist/esm/footer/footerLink.d.ts.map +1 -1
  203. package/dist/esm/footer/footerLink.js +3 -1
  204. package/dist/esm/footer/footerRow.d.ts.map +1 -1
  205. package/dist/esm/footer/footerRow.js +3 -1
  206. package/dist/esm/footer/footerSection.js +3 -3
  207. package/dist/esm/footer/footerTrademark.d.ts.map +1 -1
  208. package/dist/esm/footer/footerTrademark.js +3 -2
  209. package/dist/esm/header/headerAccount.d.ts.map +1 -1
  210. package/dist/esm/header/headerAccount.js +5 -5
  211. package/dist/esm/header/headerAccount.types.d.ts +1 -1
  212. package/dist/esm/header/headerAccount.types.d.ts.map +1 -1
  213. package/dist/esm/header/headerAccountUserInfo.d.ts.map +1 -1
  214. package/dist/esm/header/headerAccountUserInfo.js +5 -4
  215. package/dist/esm/header/headerContent.d.ts.map +1 -1
  216. package/dist/esm/header/headerContent.js +3 -1
  217. package/dist/esm/header/headerCreateAccount.d.ts.map +1 -1
  218. package/dist/esm/header/headerCreateAccount.js +3 -2
  219. package/dist/esm/header/headerDivider.d.ts.map +1 -1
  220. package/dist/esm/header/headerDivider.js +3 -1
  221. package/dist/esm/header/headerLogo.d.ts.map +1 -1
  222. package/dist/esm/header/headerLogo.js +3 -2
  223. package/dist/esm/header/headerMainLinks.d.ts.map +1 -1
  224. package/dist/esm/header/headerMainLinks.js +3 -2
  225. package/dist/esm/header/headerMobileContent.d.ts.map +1 -1
  226. package/dist/esm/header/headerMobileContent.js +3 -2
  227. package/dist/esm/header/headerMobileToggle.d.ts.map +1 -1
  228. package/dist/esm/header/headerMobileToggle.js +3 -2
  229. package/dist/esm/header/headerNotifications.d.ts.map +1 -1
  230. package/dist/esm/header/headerNotifications.js +3 -2
  231. package/dist/esm/header/headerServices.js +2 -2
  232. package/dist/esm/header/headerServicesMessage.d.ts.map +1 -1
  233. package/dist/esm/header/headerServicesMessage.js +3 -2
  234. package/dist/esm/header/headerSignIn.d.ts.map +1 -1
  235. package/dist/esm/header/headerSignIn.js +3 -2
  236. package/dist/esm/input/context.d.ts +2 -2
  237. package/dist/esm/input/context.d.ts.map +1 -1
  238. package/dist/esm/input/context.js +2 -2
  239. package/dist/esm/input/input.js +1 -1
  240. package/dist/esm/input/inputIcon.d.ts.map +1 -1
  241. package/dist/esm/input/inputIcon.js +5 -3
  242. package/dist/esm/input/inputInput.d.ts.map +1 -1
  243. package/dist/esm/input/inputInput.js +5 -4
  244. package/dist/esm/link/context.d.ts +2 -2
  245. package/dist/esm/link/context.d.ts.map +1 -1
  246. package/dist/esm/link/context.js +2 -2
  247. package/dist/esm/link/linkIcon.d.ts.map +1 -1
  248. package/dist/esm/link/linkIcon.js +5 -3
  249. package/dist/esm/link/linkText.d.ts.map +1 -1
  250. package/dist/esm/link/linkText.js +5 -3
  251. package/dist/esm/list/context.d.ts +2 -2
  252. package/dist/esm/list/context.d.ts.map +1 -1
  253. package/dist/esm/list/context.js +2 -2
  254. package/dist/esm/list/listDivider.d.ts.map +1 -1
  255. package/dist/esm/list/listDivider.js +5 -3
  256. package/dist/esm/list/listHeading.d.ts.map +1 -1
  257. package/dist/esm/list/listHeading.js +5 -3
  258. package/dist/esm/list/listIcon.d.ts.map +1 -1
  259. package/dist/esm/list/listIcon.js +5 -3
  260. package/dist/esm/list/listItem.d.ts.map +1 -1
  261. package/dist/esm/list/listItem.js +4 -4
  262. package/dist/esm/list/listText.d.ts.map +1 -1
  263. package/dist/esm/list/listText.js +5 -3
  264. package/dist/esm/menu/menuButton.d.ts.map +1 -1
  265. package/dist/esm/menu/menuButton.js +4 -2
  266. package/dist/esm/menu/menuItem.d.ts.map +1 -1
  267. package/dist/esm/menu/menuItem.js +3 -3
  268. package/dist/esm/menu/menuList.d.ts.map +1 -1
  269. package/dist/esm/menu/menuList.js +4 -3
  270. package/dist/esm/modal/modalBackdrop.d.ts.map +1 -1
  271. package/dist/esm/modal/modalBackdrop.js +3 -2
  272. package/dist/esm/modal/modalContent.d.ts.map +1 -1
  273. package/dist/esm/modal/modalContent.js +3 -2
  274. package/dist/esm/notification/context.d.ts +2 -2
  275. package/dist/esm/notification/context.d.ts.map +1 -1
  276. package/dist/esm/notification/context.js +2 -2
  277. package/dist/esm/notification/notificationButton.d.ts.map +1 -1
  278. package/dist/esm/notification/notificationButton.js +6 -4
  279. package/dist/esm/notification/notificationIcon.d.ts.map +1 -1
  280. package/dist/esm/notification/notificationIcon.js +6 -4
  281. package/dist/esm/notification/notificationText.d.ts.map +1 -1
  282. package/dist/esm/notification/notificationText.js +5 -3
  283. package/dist/esm/notification/notificationTitle.d.ts.map +1 -1
  284. package/dist/esm/notification/notificationTitle.js +5 -3
  285. package/dist/esm/pagination/helpers.d.ts.map +1 -1
  286. package/dist/esm/pagination/helpers.js +30 -12
  287. package/dist/esm/pagination/paginationButton.d.ts.map +1 -1
  288. package/dist/esm/pagination/paginationButton.js +3 -2
  289. package/dist/esm/pagination/paginationEllipsis.d.ts.map +1 -1
  290. package/dist/esm/pagination/paginationEllipsis.js +3 -2
  291. package/dist/esm/pagination/paginationGoToPage.d.ts.map +1 -1
  292. package/dist/esm/pagination/paginationGoToPage.js +3 -1
  293. package/dist/esm/pagination/paginationNavigation.js +3 -3
  294. package/dist/esm/pagination/paginationPrevNext.d.ts.map +1 -1
  295. package/dist/esm/pagination/paginationPrevNext.js +3 -2
  296. package/dist/esm/pagination/paginationResults.d.ts.map +1 -1
  297. package/dist/esm/pagination/paginationResults.js +3 -2
  298. package/dist/esm/popover/popoverContent.js +3 -3
  299. package/dist/esm/popover/popoverTrigger.js +4 -4
  300. package/dist/esm/radio/context.d.ts +2 -2
  301. package/dist/esm/radio/context.d.ts.map +1 -1
  302. package/dist/esm/radio/context.js +2 -2
  303. package/dist/esm/radio/radio.js +2 -2
  304. package/dist/esm/spinner/consts.d.ts +0 -12
  305. package/dist/esm/spinner/consts.d.ts.map +1 -1
  306. package/dist/esm/spinner/consts.js +4 -8
  307. package/dist/esm/spinner/spinner.js +2 -2
  308. package/dist/esm/switch/context.d.ts +2 -2
  309. package/dist/esm/switch/context.d.ts.map +1 -1
  310. package/dist/esm/switch/context.js +2 -2
  311. package/dist/esm/switch/switchButton.js +3 -3
  312. package/dist/esm/switch/switchLabel.d.ts.map +1 -1
  313. package/dist/esm/switch/switchLabel.js +5 -3
  314. package/dist/esm/tag/context.d.ts +2 -2
  315. package/dist/esm/tag/context.d.ts.map +1 -1
  316. package/dist/esm/tag/context.js +2 -2
  317. package/dist/esm/tag/tagButton.d.ts.map +1 -1
  318. package/dist/esm/tag/tagButton.js +6 -4
  319. package/dist/esm/tag/tagIcon.d.ts.map +1 -1
  320. package/dist/esm/tag/tagIcon.js +5 -3
  321. package/dist/esm/tag/tagText.d.ts.map +1 -1
  322. package/dist/esm/tag/tagText.js +5 -3
  323. package/dist/esm/textarea/textarea.js +1 -1
  324. package/dist/esm/utils/react.d.ts +2 -2
  325. package/dist/esm/utils/react.d.ts.map +1 -1
  326. package/dist/esm/utils/react.js +2 -2
  327. package/package.json +1 -1
  328. package/src/button/button.tsx +2 -2
  329. package/src/button/buttonIcon.tsx +5 -3
  330. package/src/button/buttonText.tsx +5 -3
  331. package/src/button/context.ts +2 -2
  332. package/src/buttonGroup/context.ts +2 -2
  333. package/src/checkbox/checkbox.tsx +2 -2
  334. package/src/checkbox/context.ts +2 -2
  335. package/src/core/links.tsx +19 -16
  336. package/src/dialog/dialogBody.tsx +4 -3
  337. package/src/dialog/dialogCancelButton.tsx +9 -1
  338. package/src/dialog/dialogCloseButton.tsx +4 -2
  339. package/src/dialog/dialogFooter.tsx +11 -3
  340. package/src/dialog/dialogHeader.tsx +3 -3
  341. package/src/dialog/dialogIcon.tsx +3 -1
  342. package/src/dialog/dialogSubmitButton.tsx +10 -1
  343. package/src/dialog/dialogTitle.tsx +3 -1
  344. package/src/footer/footerColumn.tsx +3 -2
  345. package/src/footer/footerContent.tsx +12 -1
  346. package/src/footer/footerHeading.tsx +5 -1
  347. package/src/footer/footerLink.tsx +11 -1
  348. package/src/footer/footerRow.tsx +3 -1
  349. package/src/footer/footerSection.tsx +3 -3
  350. package/src/footer/footerTrademark.tsx +3 -2
  351. package/src/header/headerAccount.tsx +11 -4
  352. package/src/header/headerAccount.types.ts +1 -1
  353. package/src/header/headerAccountUserInfo.tsx +20 -5
  354. package/src/header/headerContent.tsx +14 -1
  355. package/src/header/headerCreateAccount.tsx +3 -2
  356. package/src/header/headerDivider.tsx +4 -2
  357. package/src/header/headerLogo.tsx +3 -2
  358. package/src/header/headerMainLinks.tsx +10 -2
  359. package/src/header/headerMobileContent.tsx +4 -3
  360. package/src/header/headerMobileToggle.tsx +4 -3
  361. package/src/header/headerNotifications.tsx +3 -1
  362. package/src/header/headerServices.tsx +2 -2
  363. package/src/header/headerServicesMessage.tsx +10 -2
  364. package/src/header/headerSignIn.tsx +10 -2
  365. package/src/input/context.ts +2 -2
  366. package/src/input/input.tsx +1 -1
  367. package/src/input/inputIcon.tsx +5 -3
  368. package/src/input/inputInput.tsx +13 -4
  369. package/src/link/context.ts +2 -2
  370. package/src/link/linkIcon.tsx +5 -3
  371. package/src/link/linkText.tsx +12 -3
  372. package/src/list/context.ts +2 -2
  373. package/src/list/listDivider.tsx +5 -3
  374. package/src/list/listHeading.tsx +6 -4
  375. package/src/list/listIcon.tsx +5 -3
  376. package/src/list/listItem.tsx +13 -4
  377. package/src/list/listText.tsx +5 -3
  378. package/src/menu/menuButton.tsx +12 -2
  379. package/src/menu/menuItem.tsx +12 -3
  380. package/src/menu/menuList.tsx +4 -3
  381. package/src/modal/modalBackdrop.tsx +3 -2
  382. package/src/modal/modalContent.tsx +4 -3
  383. package/src/notification/context.ts +2 -2
  384. package/src/notification/notificationButton.tsx +7 -5
  385. package/src/notification/notificationIcon.tsx +7 -5
  386. package/src/notification/notificationText.tsx +6 -4
  387. package/src/notification/notificationTitle.tsx +13 -3
  388. package/src/pagination/helpers.ts +40 -8
  389. package/src/pagination/paginationButton.tsx +3 -2
  390. package/src/pagination/paginationEllipsis.tsx +10 -2
  391. package/src/pagination/paginationGoToPage.tsx +10 -2
  392. package/src/pagination/paginationNavigation.tsx +3 -3
  393. package/src/pagination/paginationPrevNext.tsx +3 -2
  394. package/src/pagination/paginationResults.tsx +3 -2
  395. package/src/popover/popoverContent.tsx +3 -3
  396. package/src/popover/popoverTrigger.tsx +4 -4
  397. package/src/radio/context.ts +2 -2
  398. package/src/radio/radio.tsx +2 -2
  399. package/src/spinner/consts.ts +4 -8
  400. package/src/spinner/spinner.tsx +1 -1
  401. package/src/switch/context.ts +2 -2
  402. package/src/switch/switchButton.tsx +3 -3
  403. package/src/switch/switchLabel.tsx +5 -3
  404. package/src/tag/context.ts +2 -2
  405. package/src/tag/tagButton.tsx +7 -5
  406. package/src/tag/tagIcon.tsx +5 -3
  407. package/src/tag/tagText.tsx +5 -3
  408. package/src/textarea/textarea.tsx +1 -1
  409. package/src/utils/react.ts +12 -3
@@ -2,16 +2,18 @@ import React from 'react'
2
2
 
3
3
  import Button, { ButtonProps } from '../button'
4
4
  import { useStyleConfig, vui } from '../core'
5
- import { useNotification } from './context'
5
+ import { cs } from '../utils'
6
+ import { useNotificationContext } from './context'
6
7
 
7
8
  /** Displays an action button within the Notification. */
8
9
  export const NotificationButton = vui<'button', ButtonProps>((props, ref) => {
9
- const mergedProps = { ...useNotification(), ...props }
10
- const styles = useStyleConfig('Notification', mergedProps)
10
+ const { className, ...rest } = props
11
+ const mergedProps = { ...useNotificationContext(), ...props }
12
+ const styles = useStyleConfig('Notification', useNotificationContext())
11
13
 
12
14
  return (
13
15
  <Button
14
- className="vui-notificationButton"
16
+ className={cs('vui-notificationButton', className)}
15
17
  colorScheme={mergedProps.colorScheme}
16
18
  ml={1}
17
19
  mr={-0.5}
@@ -19,7 +21,7 @@ export const NotificationButton = vui<'button', ButtonProps>((props, ref) => {
19
21
  size="sm"
20
22
  variant="text"
21
23
  {...styles.button}
22
- {...props}
24
+ {...rest}
23
25
  />
24
26
  )
25
27
  })
@@ -2,27 +2,29 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import Icon, { IconProps } from '../icon'
5
+ import { cs } from '../utils'
5
6
  import { notificationStatusMapping } from './consts'
6
- import { useNotification } from './context'
7
+ import { useNotificationContext } from './context'
7
8
 
8
9
  /** Displays an icon based on the status within the Notification. */
9
10
  export const NotificationIcon = vui<'svg', IconProps>((props, ref) => {
10
- const mergedProps = { ...useNotification(), ...props }
11
- const styles = useStyleConfig('Notification', mergedProps)
11
+ const { className, ...rest } = props
12
+ const mergedProps = { ...useNotificationContext(), ...props }
13
+ const styles = useStyleConfig('Notification', useNotificationContext())
12
14
 
13
15
  const { status = '' } = mergedProps
14
16
  const { iconProps } = notificationStatusMapping[status] ?? {}
15
17
 
16
18
  return (
17
19
  <Icon
18
- className="vui-notificationIcon"
20
+ className={cs('vui-notificationIcon', className)}
19
21
  mr={1}
20
22
  my={0.5}
21
23
  ref={ref}
22
24
  size="md"
23
25
  {...styles.icon}
24
26
  {...iconProps}
25
- {...props}
27
+ {...rest}
26
28
  />
27
29
  )
28
30
  })
@@ -2,22 +2,24 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import T, { TProps } from '../t'
5
- import { useNotification } from './context'
5
+ import { cs } from '../utils'
6
+ import { useNotificationContext } from './context'
6
7
 
7
8
  /** Displays text within the Notification. */
8
9
  export const NotificationText = vui<'p', TProps>((props, ref) => {
9
- const styles = useStyleConfig('Notification', { ...useNotification(), ...props })
10
+ const { className, ...rest } = props
11
+ const styles = useStyleConfig('Notification', useNotificationContext())
10
12
 
11
13
  return (
12
14
  <T
13
- className="vui-notificationText"
15
+ className={cs('vui-notificationText', className)}
14
16
  flex="1"
15
17
  lineHeight="24px"
16
18
  minW={0}
17
19
  py={0.5}
18
20
  ref={ref}
19
21
  {...styles.text}
20
- {...props}
22
+ {...rest}
21
23
  />
22
24
  )
23
25
  })
@@ -2,13 +2,23 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import { H6, HeadingProps } from '../heading'
5
- import { useNotification } from './context'
5
+ import { cs } from '../utils'
6
+ import { useNotificationContext } from './context'
6
7
 
7
8
  /** Displays a title within the Notification. */
8
9
  export const NotificationTitle = vui<'h6', HeadingProps>((props, ref) => {
9
- const styles = useStyleConfig('Notification', { ...useNotification(), ...props })
10
+ const { className, ...rest } = props
11
+ const styles = useStyleConfig('Notification', useNotificationContext())
10
12
 
11
- return <H6 className="vui-notificationTitle" display="inline-flex" ref={ref} {...styles.title} {...props} />
13
+ return (
14
+ <H6
15
+ className={cs('vui-notificationTitle', className)}
16
+ display="inline-flex"
17
+ ref={ref}
18
+ {...styles.title}
19
+ {...rest}
20
+ />
21
+ )
12
22
  })
13
23
 
14
24
  NotificationTitle.displayName = 'NotificationTitle'
@@ -1,20 +1,52 @@
1
1
  import { PaginationItem } from './pagination.types'
2
2
 
3
+ const range = (start: number, end: number) => {
4
+ const length = end - start + 1
5
+ return Array.from({ length }, (_, i) => start + i)
6
+ }
7
+
3
8
  /** Returns an array describing pagination items, like page buttons, prev/next arrows or ellipsis. */
4
9
  export function getPaginationItems(page: number, pageCount: number) {
5
- const items: PaginationItem[] = ['previous', 1]
10
+ const boundaryCount = 1
11
+ const siblingCount = 1
12
+
13
+ const startPages = range(1, Math.min(boundaryCount, pageCount))
14
+ const endPages = range(Math.max(pageCount - boundaryCount + 1, boundaryCount + 1), pageCount)
15
+
16
+ const siblingsStart = Math.max(
17
+ Math.min(page - siblingCount, pageCount - boundaryCount - siblingCount * 2 - 1),
18
+ boundaryCount + 2
19
+ )
20
+
21
+ const siblingsEnd = Math.min(
22
+ Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),
23
+ endPages.length > 0 ? endPages[0] - 2 : pageCount - 1
24
+ )
6
25
 
7
- if (page - 2 > 1) items.push('ellipsisStart')
26
+ const items = [
27
+ 'previous',
28
+ ...startPages,
8
29
 
9
- for (let i = page - 1; i <= page + 1; i++) {
10
- if (i > 1 && i < pageCount) items.push(i)
11
- }
30
+ // Start ellipsis
31
+ ...(siblingsStart > boundaryCount + 2
32
+ ? ['ellipsisStart']
33
+ : boundaryCount + 1 < pageCount - boundaryCount
34
+ ? [boundaryCount + 1]
35
+ : []),
12
36
 
13
- if (page + 2 < pageCount) items.push('ellipsisEnd')
37
+ // Sibling pages
38
+ ...range(siblingsStart, siblingsEnd),
14
39
 
15
- if (pageCount > 1) items.push(pageCount)
40
+ // End ellipsis
41
+ ...(siblingsEnd < pageCount - boundaryCount - 1
42
+ ? ['ellipsisEnd']
43
+ : pageCount - boundaryCount > boundaryCount
44
+ ? [pageCount - boundaryCount]
45
+ : []),
16
46
 
17
- items.push('next')
47
+ ...endPages,
48
+ 'next'
49
+ ] as PaginationItem[]
18
50
 
19
51
  return items
20
52
  }
@@ -2,12 +2,13 @@ import React from 'react'
2
2
 
3
3
  import Button from '../button'
4
4
  import { useStyleConfig, vui } from '../core'
5
+ import { cs } from '../utils'
5
6
  import { usePaginationContext } from './context'
6
7
  import { PaginationButtonProps } from './pagination.types'
7
8
 
8
9
  /** Displays a page navigation button within the Pagination. */
9
10
  export const PaginationButton = vui<'button', PaginationButtonProps>((props, ref) => {
10
- const { isActive: isActiveProp, page: pageProp, ...rest } = props
11
+ const { className, isActive: isActiveProp, page: pageProp, ...rest } = props
11
12
  const { onPageChange, page } = usePaginationContext()
12
13
  const styles = useStyleConfig('Pagination', usePaginationContext())
13
14
 
@@ -23,7 +24,7 @@ export const PaginationButton = vui<'button', PaginationButtonProps>((props, ref
23
24
 
24
25
  return (
25
26
  <Button
26
- className="vui-paginationButton"
27
+ className={cs('vui-paginationButton', className)}
27
28
  minW={0}
28
29
  onClick={() => onPageChange(pageProp)}
29
30
  ref={ref}
@@ -2,15 +2,23 @@ import React from 'react'
2
2
 
3
3
  import Box, { BoxProps } from '../box'
4
4
  import { useStyleConfig, vui } from '../core'
5
+ import { cs } from '../utils'
5
6
  import { usePaginationContext } from './context'
6
7
 
7
8
  /** Displays '...' ellipsis for hidden pages. */
8
9
  export const PaginationEllipsis = vui<'span', BoxProps>((props, ref) => {
9
- const { children, ...rest } = props
10
+ const { children, className, ...rest } = props
10
11
  const styles = useStyleConfig('Pagination', usePaginationContext())
11
12
 
12
13
  return (
13
- <Box alignItems="center" className="vui-paginationEllipsis" ref={ref} {...styles.ellipsis} {...rest}>
14
+ <Box
15
+ alignItems="center"
16
+ className={cs('vui-paginationEllipsis', className)}
17
+ px="10px"
18
+ ref={ref}
19
+ {...styles.ellipsis}
20
+ {...rest}
21
+ >
14
22
  {children ?? '...'}
15
23
  </Box>
16
24
  )
@@ -4,11 +4,12 @@ import Box, { BoxProps } from '../box'
4
4
  import { useStyleConfig, vui } from '../core'
5
5
  import Input from '../input'
6
6
  import T from '../t'
7
- import { ChangeEvent } from '../utils'
7
+ import { ChangeEvent, cs } from '../utils'
8
8
  import { usePaginationContext } from './context'
9
9
 
10
10
  /** Displays a number input, which allows quickly jumping between pages. */
11
11
  export const PaginationGoToPage = vui<'div', BoxProps>((props, ref) => {
12
+ const { className, ...rest } = props
12
13
  const { onPageChange, pageCount } = usePaginationContext()
13
14
  const styles = useStyleConfig('Pagination', usePaginationContext())
14
15
 
@@ -20,7 +21,14 @@ export const PaginationGoToPage = vui<'div', BoxProps>((props, ref) => {
20
21
  }
21
22
 
22
23
  return (
23
- <Box centerV className="vui-paginationGoToPage" lineHeight="normal" ref={ref} {...styles.goToPage} {...props}>
24
+ <Box
25
+ centerV
26
+ className={cs('vui-paginationGoToPage', className)}
27
+ lineHeight="normal"
28
+ ref={ref}
29
+ {...styles.goToPage}
30
+ {...rest}
31
+ >
24
32
  <T size="sm" weight="medium">
25
33
  Go to
26
34
  </T>
@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'
2
2
 
3
3
  import Box, { BoxProps } from '../box'
4
4
  import { useStyleConfig, vui } from '../core'
5
- import { isNumber, isString } from '../utils'
5
+ import { cs, isNumber, isString } from '../utils'
6
6
  import { usePaginationContext } from './context'
7
7
  import PaginationButton from './paginationButton'
8
8
  import PaginationEllipsis from './paginationEllipsis'
@@ -10,12 +10,12 @@ import PaginationPrevNext from './paginationPrevNext'
10
10
 
11
11
  /** Displays a set of page navigation buttons. */
12
12
  export const PaginationNavigation = vui<'div', BoxProps>((props, ref) => {
13
- const { children, ...rest } = props
13
+ const { children, className, ...rest } = props
14
14
  const { items } = usePaginationContext()
15
15
  const styles = useStyleConfig('Pagination', usePaginationContext())
16
16
 
17
17
  return (
18
- <Box className="vui-paginationNavigation" gap={1} ref={ref} wrap {...styles.navigation} {...rest}>
18
+ <Box className={cs('vui-paginationNavigation', className)} gap={1} ref={ref} wrap {...styles.navigation} {...rest}>
19
19
  {children ??
20
20
  items.map(item => (
21
21
  <Fragment key={item}>
@@ -2,12 +2,13 @@ import React from 'react'
2
2
 
3
3
  import Button from '../button'
4
4
  import { useStyleConfig, vui } from '../core'
5
+ import { cs } from '../utils'
5
6
  import { usePaginationContext } from './context'
6
7
  import { PaginationPrevNextProps } from './pagination.types'
7
8
 
8
9
  /** Displays a page navigation button, which navigates forward or backward. */
9
10
  export const PaginationPrevNext = vui<'button', PaginationPrevNextProps>((props, ref) => {
10
- const { direction, ...rest } = props
11
+ const { className, direction, ...rest } = props
11
12
  const { onPageChange, page, pageCount } = usePaginationContext()
12
13
  const styles = useStyleConfig('Pagination', usePaginationContext())
13
14
 
@@ -21,7 +22,7 @@ export const PaginationPrevNext = vui<'button', PaginationPrevNextProps>((props,
21
22
 
22
23
  return (
23
24
  <Button
24
- className="vui-paginationPrevNext"
25
+ className={cs('vui-paginationPrevNext', className)}
25
26
  minW={0}
26
27
  ref={ref}
27
28
  size="sm"
@@ -2,17 +2,18 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import T, { TProps } from '../t'
5
+ import { cs } from '../utils'
5
6
  import { usePaginationContext } from './context'
6
7
 
7
8
  /** Displays an action button within the Pagination. */
8
9
  export const PaginationResults = vui<'span', TProps>((props, ref) => {
9
- const { children, ...rest } = props
10
+ const { children, className, ...rest } = props
10
11
  const { count, rangeEnd, rangeStart } = usePaginationContext()
11
12
  const styles = useStyleConfig('Pagination', usePaginationContext())
12
13
 
13
14
  return (
14
15
  <T
15
- className="vui-paginationResults"
16
+ className={cs('vui-paginationResults', className)}
16
17
  color="grey.80"
17
18
  ref={ref}
18
19
  size="sm"
@@ -2,15 +2,15 @@ import React from 'react'
2
2
 
3
3
  import Box from '../box'
4
4
  import { useStyleConfig, vui } from '../core'
5
- import { mergeRefs } from '../utils'
5
+ import { cs, mergeRefs } from '../utils'
6
6
  import { usePopoverContext } from './context'
7
7
  import { PopoverContentProps } from './popover.types'
8
8
 
9
9
  /** Displays provided content in an overlaying wrapper. */
10
10
  export const PopoverContent = vui<'div', PopoverContentProps>((props, ref) => {
11
+ const { children, className, ...rest } = props
11
12
  const popoverProps = usePopoverContext() ?? {}
12
13
  const { isLazy, isOpen, setPopper } = popoverProps
13
- const { children, ...rest } = props
14
14
  const styles = useStyleConfig('Popover', { ...popoverProps, ...props })
15
15
 
16
16
  const shouldRenderChildren = isLazy ? isOpen : true
@@ -22,7 +22,7 @@ export const PopoverContent = vui<'div', PopoverContentProps>((props, ref) => {
22
22
  bg="white"
23
23
  borderRadius="md"
24
24
  boxShadow="2"
25
- className="vui-popoverContent"
25
+ className={cs('vui-popoverContent', className)}
26
26
  overflowY="auto"
27
27
  ref={mergeRefs(setPopper, ref)}
28
28
  {...styles.content}
@@ -3,7 +3,7 @@
3
3
  import React from 'react'
4
4
 
5
5
  import { useStyleConfig, v, vui } from '../core'
6
- import { mergeRefs, MouseEvent } from '../utils'
6
+ import { cs, mergeRefs, MouseEvent } from '../utils'
7
7
  import { usePopoverContext } from './context'
8
8
  import { PopoverTriggerProps } from './popover.types'
9
9
 
@@ -12,11 +12,11 @@ import { PopoverTriggerProps } from './popover.types'
12
12
  * Can be rendered as any component using the 'as' prop. By default renders as a plain button.
13
13
  */
14
14
  export const PopoverTrigger = vui<'button', PopoverTriggerProps>((props, ref) => {
15
+ // @ts-ignore - TS incorrectly doesn't recognize 'as' prop
16
+ const { as: As, className, onClick: onClickProp, ...rest } = props
15
17
  const { setReference, ...popoverProps } = usePopoverContext() ?? {}
16
18
  const styles = useStyleConfig('Popover', { ...popoverProps, ...props })
17
19
 
18
- // @ts-ignore - TS incorrectly doesn't recognize 'as' prop
19
- const { as: As, onClick: onClickProp, ...rest } = props
20
20
  const Element = As || v.button
21
21
 
22
22
  const onClick = (e: MouseEvent<HTMLButtonElement>) => {
@@ -27,7 +27,7 @@ export const PopoverTrigger = vui<'button', PopoverTriggerProps>((props, ref) =>
27
27
 
28
28
  return (
29
29
  <Element
30
- className="vui-popoverTrigger"
30
+ className={cs('vui-popoverTrigger', className)}
31
31
  onClick={onClick}
32
32
  ref={mergeRefs(setReference, ref)}
33
33
  {...styles.trigger}
@@ -1,5 +1,5 @@
1
1
  import { createContext, Dict } from '../utils'
2
2
 
3
- const [RadioGroupProvider, useRadioGroup] = createContext<Dict>({ isOptional: true })
3
+ const [RadioGroupProvider, useRadioGroupContext] = createContext<Dict>({ isOptional: true })
4
4
 
5
- export { RadioGroupProvider, useRadioGroup }
5
+ export { RadioGroupProvider, useRadioGroupContext }
@@ -4,7 +4,7 @@ import { omitThemingProps, styled, th, useStyleConfig, vui } from '../core'
4
4
  import Icon from '../icon'
5
5
  import T from '../t'
6
6
  import { ChangeEvent, cs, filterUndefined } from '../utils'
7
- import { useRadioGroup } from './context'
7
+ import { useRadioGroupContext } from './context'
8
8
  import { RadioProps, RadioStyleProps } from './radio.types'
9
9
 
10
10
  const RadioControl = styled.spanBox`
@@ -59,7 +59,7 @@ export const Radio = vui<'span', RadioProps>((props, ref) => {
59
59
  onChange: groupOnChange,
60
60
  value: groupValue,
61
61
  ...radioGroupProps
62
- } = useRadioGroup() ?? {}
62
+ } = useRadioGroupContext() ?? {}
63
63
  const defaultIsChecked = groupIsChecked !== undefined ? groupIsChecked === props.value : undefined
64
64
 
65
65
  const mergedProps = { ...radioGroupProps, ...props }
@@ -2,20 +2,16 @@ import { Dict } from '../utils'
2
2
 
3
3
  export const spinnerPositionMapping = {
4
4
  bottom: {
5
- container: { flexDirection: 'column' },
6
- circle: { mb: 1 }
5
+ container: { flexDirection: 'column' }
7
6
  },
8
7
  left: {
9
- container: { flexDirection: 'row-reverse' },
10
- circle: { ml: 1 }
8
+ container: { flexDirection: 'row-reverse' }
11
9
  },
12
10
  right: {
13
- container: { flexDirection: 'row' },
14
- circle: { mr: 1 }
11
+ container: { flexDirection: 'row' }
15
12
  },
16
13
  top: {
17
- container: { flexDirection: 'column-reverse' },
18
- circle: { mt: 1 }
14
+ container: { flexDirection: 'column-reverse' }
19
15
  }
20
16
  }
21
17
 
@@ -45,6 +45,7 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
45
45
  <Box
46
46
  center
47
47
  className={cs('vui-spinner', className)}
48
+ gap={1}
48
49
  ref={ref}
49
50
  transitionDuration="fast"
50
51
  {...styles.container}
@@ -55,7 +56,6 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
55
56
  animation={`vui-spin ${speed} linear infinite`}
56
57
  className="vui-spinnerCircle"
57
58
  {...styles.circle}
58
- {...positionProps.circle}
59
59
  {...circleProps}
60
60
  />
61
61
 
@@ -1,6 +1,6 @@
1
1
  import { createContext } from '../utils'
2
2
  import { SwitchContext } from './switch.types'
3
3
 
4
- const [SwitchProvider, useSwitch] = createContext<SwitchContext>({ isOptional: true })
4
+ const [SwitchProvider, useSwitchContext] = createContext<SwitchContext>({ isOptional: true })
5
5
 
6
- export { SwitchProvider, useSwitch }
6
+ export { SwitchProvider, useSwitchContext }
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'
2
2
 
3
3
  import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
4
4
  import { ChangeEvent, cs, filterUndefined, FocusEvent } from '../utils'
5
- import { useSwitch } from './context'
5
+ import { useSwitchContext } from './context'
6
6
  import { SwitchButtonProps } from './switch.types'
7
7
 
8
8
  const SwitchInput = styled.inputBox`
@@ -64,7 +64,7 @@ export const SwitchButtonBase = styled.spanBox`
64
64
  * Handles controlled and uncontrolled modes.
65
65
  */
66
66
  export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
67
- const mergedProps = { ...useSwitch(), ...props }
67
+ const mergedProps = { ...useSwitchContext(), ...props }
68
68
  const {
69
69
  checked,
70
70
  className,
@@ -86,7 +86,7 @@ export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
86
86
  const { current: isControlled } = useRef(checked !== undefined)
87
87
  const [isChecked, setIsChecked] = useState(checked ?? defaultChecked)
88
88
  const [isFocused, setIsFocused] = useState(false)
89
- const styles = useStyleConfig('Switch', mergedProps)
89
+ const styles = useStyleConfig('Switch', useSwitchContext())
90
90
  const { thumb: thumbStyles, track: trackStyles, ...buttonStyles } = styles.button
91
91
 
92
92
  useEffect(() => {
@@ -2,13 +2,15 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import T, { TProps } from '../t'
5
- import { useSwitch } from './context'
5
+ import { cs } from '../utils'
6
+ import { useSwitchContext } from './context'
6
7
 
7
8
  /** Displays label text within the Switch component. */
8
9
  export const SwitchLabel = vui<'span', TProps>((props, ref) => {
9
- const styles = useStyleConfig('Switch', { ...useSwitch(), ...props })
10
+ const { className, ...rest } = props
11
+ const styles = useStyleConfig('Switch', useSwitchContext())
10
12
 
11
- return <T className="vui-switchLabel" display="flex" ref={ref} {...styles.label} {...props} />
13
+ return <T className={cs('vui-switchLabel', className)} display="flex" ref={ref} {...styles.label} {...rest} />
12
14
  })
13
15
 
14
16
  SwitchLabel.displayName = 'SwitchLabel'
@@ -1,5 +1,5 @@
1
1
  import { createContext, Dict } from '../utils'
2
2
 
3
- const [TagProvider, useTag] = createContext<Dict>({ isOptional: true })
3
+ const [TagProvider, useTagContext] = createContext<Dict>({ isOptional: true })
4
4
 
5
- export { TagProvider, useTag }
5
+ export { TagProvider, useTagContext }
@@ -2,17 +2,19 @@ import React from 'react'
2
2
 
3
3
  import Button, { ButtonProps } from '../button'
4
4
  import { useStyleConfig, vui } from '../core'
5
- import { useTag } from './context'
5
+ import { cs } from '../utils'
6
+ import { useTagContext } from './context'
6
7
 
7
8
  /** Displays a button within the Tag. */
8
9
  export const TagButton = vui<'button', ButtonProps>((props, ref) => {
9
- const mergedProps = { ...useTag(), ...props }
10
- const styles = useStyleConfig('Tag', mergedProps)
10
+ const { className, ...rest } = props
11
+ const mergedProps = { ...useTagContext(), ...props }
12
+ const styles = useStyleConfig('Tag', useTagContext())
11
13
 
12
14
  return (
13
15
  <Button
14
16
  borderColor="transparent"
15
- className="vui-tagButton"
17
+ className={cs('vui-tagButton', className)}
16
18
  colorScheme={mergedProps.colorScheme}
17
19
  disabled={mergedProps.disabled}
18
20
  hoverBorderColor="transparent"
@@ -21,7 +23,7 @@ export const TagButton = vui<'button', ButtonProps>((props, ref) => {
21
23
  ref={ref}
22
24
  variant="text"
23
25
  {...styles.button}
24
- {...props}
26
+ {...rest}
25
27
  />
26
28
  )
27
29
  })
@@ -2,13 +2,15 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import Icon, { IconProps } from '../icon'
5
- import { useTag } from './context'
5
+ import { cs } from '../utils'
6
+ import { useTagContext } from './context'
6
7
 
7
8
  /** Displays an icon within the Tag. */
8
9
  export const TagIcon = vui<'svg', IconProps>((props, ref) => {
9
- const styles = useStyleConfig('Tag', { ...useTag(), ...props })
10
+ const { className, ...rest } = props
11
+ const styles = useStyleConfig('Tag', useTagContext())
10
12
 
11
- return <Icon className="vui-tagIcon" ref={ref} {...styles.icon} {...props} />
13
+ return <Icon className={cs('vui-tagIcon', className)} ref={ref} {...styles.icon} {...rest} />
12
14
  })
13
15
 
14
16
  TagIcon.displayName = 'TagIcon'
@@ -2,13 +2,15 @@ import React from 'react'
2
2
 
3
3
  import { useStyleConfig, vui } from '../core'
4
4
  import T, { TProps } from '../t'
5
- import { useTag } from './context'
5
+ import { cs } from '../utils'
6
+ import { useTagContext } from './context'
6
7
 
7
8
  /** Displays text within the Tag. */
8
9
  export const TagText = vui<'span', TProps>((props, ref) => {
9
- const styles = useStyleConfig('Tag', { ...useTag(), ...props })
10
+ const { className, ...rest } = props
11
+ const styles = useStyleConfig('Tag', useTagContext())
10
12
 
11
- return <T className="vui-tagText" fontSize="inherit" ref={ref} {...styles.text} {...props} />
13
+ return <T className={cs('vui-tagText', className)} fontSize="inherit" ref={ref} {...styles.text} {...rest} />
12
14
  })
13
15
 
14
16
  TagText.displayName = 'TagText'
@@ -116,7 +116,7 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
116
116
  />
117
117
 
118
118
  {showCount && (
119
- <T color="grey.80" position="absolute" right={0} size="sm" top="calc(100% + 1px)">
119
+ <T className="vui-textareaCount" color="grey.80" position="absolute" right={0} size="sm" top="calc(100% + 1px)">
120
120
  {count} / {maxLength}
121
121
  </T>
122
122
  )}
@@ -1,6 +1,15 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2
2
 
3
- import React, { Dispatch, RefObject, SetStateAction, useCallback, useEffect, useRef, useState } from 'react'
3
+ import React, {
4
+ DependencyList,
5
+ Dispatch,
6
+ RefObject,
7
+ SetStateAction,
8
+ useCallback,
9
+ useEffect,
10
+ useRef,
11
+ useState
12
+ } from 'react'
4
13
 
5
14
  import { isArray, isFunction } from './assertion'
6
15
  import { runIfFn } from './function'
@@ -60,12 +69,12 @@ export function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]) {
60
69
 
61
70
  // TODO: Bring it from UI-Utils
62
71
  /** Returns given callback with a stable reference, but keeps it updated internally. */
63
- export function useCallbackRef<T extends AnyFunction>(callback?: T) {
72
+ export function useCallbackRef<T extends AnyFunction>(callback?: T, deps: DependencyList = []) {
64
73
  const ref = useRef(callback)
65
74
 
66
75
  ref.current = callback
67
76
 
68
- return useCallback(((...args) => ref.current?.(...args)) as T, [])
77
+ return useCallback(((...args) => ref.current?.(...args)) as T, deps)
69
78
  }
70
79
 
71
80
  const defaultEvents = ['mousedown', 'touchstart']