@veracity/vui 2.10.0 → 2.12.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/dist/cjs/accordion/accordion.types.d.ts +4 -2
  2. package/dist/cjs/accordion/accordion.types.d.ts.map +1 -1
  3. package/dist/cjs/accordion/accordionItem.d.ts.map +1 -1
  4. package/dist/cjs/accordion/accordionItem.js +2 -2
  5. package/dist/cjs/accordion/accordionItemArrow.d.ts +1 -1
  6. package/dist/cjs/accordion/accordionItemArrow.d.ts.map +1 -1
  7. package/dist/cjs/accordion/accordionItemArrow.js +15 -1
  8. package/dist/cjs/accordion/accordionItemHorizontal.d.ts.map +1 -1
  9. package/dist/cjs/accordion/accordionItemHorizontal.js +2 -2
  10. package/dist/cjs/button/button.d.ts.map +1 -1
  11. package/dist/cjs/button/button.js +9 -15
  12. package/dist/cjs/button/buttonIcon.d.ts.map +1 -1
  13. package/dist/cjs/button/buttonIcon.js +4 -2
  14. package/dist/cjs/button/consts.d.ts +5 -0
  15. package/dist/cjs/button/consts.d.ts.map +1 -1
  16. package/dist/cjs/button/consts.js +7 -6
  17. package/dist/cjs/core/vuiProvider/consts.d.ts +2 -0
  18. package/dist/cjs/core/vuiProvider/consts.d.ts.map +1 -0
  19. package/dist/cjs/core/vuiProvider/consts.js +4 -0
  20. package/dist/cjs/core/vuiProvider/globalStyle.d.ts.map +1 -1
  21. package/dist/cjs/core/vuiProvider/globalStyle.js +8 -0
  22. package/dist/cjs/core/vuiProvider/index.d.ts +2 -0
  23. package/dist/cjs/core/vuiProvider/index.d.ts.map +1 -1
  24. package/dist/cjs/core/vuiProvider/index.js +2 -0
  25. package/dist/cjs/core/vuiProvider/useBodyScrollLock.d.ts +7 -0
  26. package/dist/cjs/core/vuiProvider/useBodyScrollLock.d.ts.map +1 -0
  27. package/dist/cjs/core/vuiProvider/useBodyScrollLock.js +18 -0
  28. package/dist/cjs/core/vuiProvider/vuiProvider.d.ts.map +1 -1
  29. package/dist/cjs/core/vuiProvider/vuiProvider.js +0 -2
  30. package/dist/cjs/definition/definition.d.ts +9 -0
  31. package/dist/cjs/definition/definition.d.ts.map +1 -0
  32. package/dist/cjs/definition/definition.js +85 -0
  33. package/dist/cjs/definition/definition.types.d.ts +24 -0
  34. package/dist/cjs/definition/definition.types.d.ts.map +1 -0
  35. package/dist/cjs/definition/definitionContent.d.ts +6 -0
  36. package/dist/cjs/definition/definitionContent.d.ts.map +1 -0
  37. package/dist/cjs/definition/definitionContent.js +46 -0
  38. package/dist/cjs/definition/index.d.ts +3 -0
  39. package/dist/cjs/definition/index.d.ts.map +1 -0
  40. package/dist/cjs/definition/index.js +23 -0
  41. package/dist/cjs/definition/theme.d.ts +65 -0
  42. package/dist/cjs/definition/theme.d.ts.map +1 -0
  43. package/dist/cjs/definition/theme.js +70 -0
  44. package/dist/cjs/dialog/consts.d.ts +0 -1
  45. package/dist/cjs/dialog/consts.d.ts.map +1 -1
  46. package/dist/cjs/dialog/consts.js +1 -2
  47. package/dist/cjs/focusLock/focusLock.d.ts +11 -0
  48. package/dist/cjs/focusLock/focusLock.d.ts.map +1 -0
  49. package/dist/cjs/{modal → focusLock}/focusLock.js +3 -3
  50. package/dist/cjs/focusLock/focusLock.types.d.ts.map +1 -0
  51. package/dist/cjs/focusLock/focusLock.types.js +2 -0
  52. package/dist/cjs/focusLock/index.d.ts +4 -0
  53. package/dist/cjs/focusLock/index.d.ts.map +1 -0
  54. package/dist/cjs/focusLock/index.js +24 -0
  55. package/dist/cjs/footer/footer.d.ts.map +1 -1
  56. package/dist/cjs/footer/footer.js +5 -1
  57. package/dist/cjs/footer/footer.types.d.ts +2 -1
  58. package/dist/cjs/footer/footer.types.d.ts.map +1 -1
  59. package/dist/cjs/header/headerAccountUserInfo.d.ts.map +1 -1
  60. package/dist/cjs/header/headerAccountUserInfo.js +3 -3
  61. package/dist/cjs/header/headerLinkItem.d.ts.map +1 -1
  62. package/dist/cjs/header/headerLinkItem.js +7 -3
  63. package/dist/cjs/header/headerNotifications.d.ts.map +1 -1
  64. package/dist/cjs/header/headerNotifications.js +3 -3
  65. package/dist/cjs/header/headerSignIn.d.ts.map +1 -1
  66. package/dist/cjs/header/headerSignIn.js +1 -1
  67. package/dist/cjs/header/theme.d.ts +2 -0
  68. package/dist/cjs/header/theme.d.ts.map +1 -1
  69. package/dist/cjs/header/theme.js +2 -0
  70. package/dist/cjs/icons/baseIcons/conc/conCard.d.ts +4 -0
  71. package/dist/cjs/icons/baseIcons/conc/conCard.d.ts.map +1 -0
  72. package/dist/cjs/icons/baseIcons/conc/conCard.js +8 -0
  73. package/dist/cjs/icons/baseIcons/conc/conEmptyBox.d.ts +4 -0
  74. package/dist/cjs/icons/baseIcons/conc/conEmptyBox.d.ts.map +1 -0
  75. package/dist/cjs/icons/baseIcons/conc/conEmptyBox.js +7 -0
  76. package/dist/cjs/icons/baseIcons/icons.d.ts +2 -0
  77. package/dist/cjs/icons/baseIcons/icons.d.ts.map +1 -1
  78. package/dist/cjs/icons/baseIcons/icons.js +12 -8
  79. package/dist/cjs/icons/baseIcons/types.d.ts +1 -1
  80. package/dist/cjs/icons/baseIcons/types.d.ts.map +1 -1
  81. package/dist/cjs/index.d.ts +2 -0
  82. package/dist/cjs/index.d.ts.map +1 -1
  83. package/dist/cjs/index.js +2 -0
  84. package/dist/cjs/input/consts.d.ts +6 -0
  85. package/dist/cjs/input/consts.d.ts.map +1 -1
  86. package/dist/cjs/input/consts.js +7 -1
  87. package/dist/cjs/input/input.d.ts.map +1 -1
  88. package/dist/cjs/input/input.js +3 -3
  89. package/dist/cjs/input/input.types.d.ts +2 -0
  90. package/dist/cjs/input/input.types.d.ts.map +1 -1
  91. package/dist/cjs/modal/index.d.ts +2 -2
  92. package/dist/cjs/modal/index.d.ts.map +1 -1
  93. package/dist/cjs/modal/index.js +2 -2
  94. package/dist/cjs/modal/modal.d.ts.map +1 -1
  95. package/dist/cjs/modal/modal.js +1 -1
  96. package/dist/cjs/modal/modal.types.d.ts +1 -1
  97. package/dist/cjs/modal/modal.types.d.ts.map +1 -1
  98. package/dist/cjs/modal/modalManager.d.ts +2 -2
  99. package/dist/cjs/modal/modalManager.d.ts.map +1 -1
  100. package/dist/cjs/modal/modalManager.js +6 -9
  101. package/dist/cjs/onedesign-tokens/dist/js/rem/button.d.ts +85 -0
  102. package/dist/cjs/onedesign-tokens/dist/js/rem/button.d.ts.map +1 -0
  103. package/dist/cjs/onedesign-tokens/dist/js/rem/button.js +88 -0
  104. package/dist/cjs/sidemenu/sidemenu.d.ts +0 -1
  105. package/dist/cjs/sidemenu/sidemenu.d.ts.map +1 -1
  106. package/dist/cjs/sidemenu/sidemenu.js +10 -11
  107. package/dist/cjs/sidemenu/sidemenu.types.d.ts +4 -0
  108. package/dist/cjs/sidemenu/sidemenu.types.d.ts.map +1 -1
  109. package/dist/cjs/sidemenu/sidemenuItem.d.ts.map +1 -1
  110. package/dist/cjs/sidemenu/sidemenuItem.js +11 -6
  111. package/dist/cjs/spinner/spinner.d.ts.map +1 -1
  112. package/dist/cjs/spinner/spinner.js +2 -2
  113. package/dist/cjs/spinner/spinner.types.d.ts +2 -1
  114. package/dist/cjs/spinner/spinner.types.d.ts.map +1 -1
  115. package/dist/cjs/spinner/theme.d.ts +26 -5
  116. package/dist/cjs/spinner/theme.d.ts.map +1 -1
  117. package/dist/cjs/spinner/theme.js +34 -13
  118. package/dist/cjs/theme/components.d.ts +91 -5
  119. package/dist/cjs/theme/components.d.ts.map +1 -1
  120. package/dist/cjs/theme/components.js +70 -68
  121. package/dist/cjs/theme/defaultTheme.d.ts +92 -5
  122. package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
  123. package/dist/cjs/theme/foundations/colors.js +1 -1
  124. package/dist/cjs/theme/foundations/index.d.ts +1 -0
  125. package/dist/cjs/theme/foundations/index.d.ts.map +1 -1
  126. package/dist/cjs/theme/foundations/screens.d.ts +1 -0
  127. package/dist/cjs/theme/foundations/screens.d.ts.map +1 -1
  128. package/dist/cjs/theme/foundations/screens.js +2 -1
  129. package/dist/esm/accordion/accordion.types.d.ts +4 -2
  130. package/dist/esm/accordion/accordion.types.d.ts.map +1 -1
  131. package/dist/esm/accordion/accordionItem.d.ts.map +1 -1
  132. package/dist/esm/accordion/accordionItem.js +2 -2
  133. package/dist/esm/accordion/accordionItemArrow.d.ts +1 -1
  134. package/dist/esm/accordion/accordionItemArrow.d.ts.map +1 -1
  135. package/dist/esm/accordion/accordionItemArrow.js +1 -1
  136. package/dist/esm/accordion/accordionItemHorizontal.d.ts.map +1 -1
  137. package/dist/esm/accordion/accordionItemHorizontal.js +2 -2
  138. package/dist/esm/button/button.d.ts.map +1 -1
  139. package/dist/esm/button/button.js +10 -16
  140. package/dist/esm/button/buttonIcon.d.ts.map +1 -1
  141. package/dist/esm/button/buttonIcon.js +4 -2
  142. package/dist/esm/button/consts.d.ts +5 -0
  143. package/dist/esm/button/consts.d.ts.map +1 -1
  144. package/dist/esm/button/consts.js +6 -5
  145. package/dist/esm/core/vuiProvider/consts.d.ts +2 -0
  146. package/dist/esm/core/vuiProvider/consts.d.ts.map +1 -0
  147. package/dist/esm/core/vuiProvider/consts.js +1 -0
  148. package/dist/esm/core/vuiProvider/globalStyle.d.ts.map +1 -1
  149. package/dist/esm/core/vuiProvider/globalStyle.js +8 -0
  150. package/dist/esm/core/vuiProvider/index.d.ts +2 -0
  151. package/dist/esm/core/vuiProvider/index.d.ts.map +1 -1
  152. package/dist/esm/core/vuiProvider/index.js +2 -0
  153. package/dist/esm/core/vuiProvider/useBodyScrollLock.d.ts +7 -0
  154. package/dist/esm/core/vuiProvider/useBodyScrollLock.d.ts.map +1 -0
  155. package/dist/esm/core/vuiProvider/useBodyScrollLock.js +14 -0
  156. package/dist/esm/core/vuiProvider/vuiProvider.d.ts.map +1 -1
  157. package/dist/esm/core/vuiProvider/vuiProvider.js +0 -2
  158. package/dist/esm/definition/definition.d.ts +9 -0
  159. package/dist/esm/definition/definition.d.ts.map +1 -0
  160. package/dist/esm/definition/definition.js +68 -0
  161. package/dist/esm/definition/definition.types.d.ts +24 -0
  162. package/dist/esm/definition/definition.types.d.ts.map +1 -0
  163. package/dist/esm/definition/definitionContent.d.ts +6 -0
  164. package/dist/esm/definition/definitionContent.d.ts.map +1 -0
  165. package/dist/esm/definition/definitionContent.js +26 -0
  166. package/dist/esm/definition/index.d.ts +3 -0
  167. package/dist/esm/definition/index.d.ts.map +1 -0
  168. package/dist/esm/definition/index.js +2 -0
  169. package/dist/esm/definition/theme.d.ts +65 -0
  170. package/dist/esm/definition/theme.d.ts.map +1 -0
  171. package/dist/esm/definition/theme.js +68 -0
  172. package/dist/esm/dialog/consts.d.ts +0 -1
  173. package/dist/esm/dialog/consts.d.ts.map +1 -1
  174. package/dist/esm/dialog/consts.js +0 -1
  175. package/dist/esm/focusLock/focusLock.d.ts +11 -0
  176. package/dist/esm/focusLock/focusLock.d.ts.map +1 -0
  177. package/dist/esm/{modal → focusLock}/focusLock.js +3 -3
  178. package/dist/esm/focusLock/focusLock.types.d.ts.map +1 -0
  179. package/dist/esm/focusLock/focusLock.types.js +1 -0
  180. package/dist/esm/focusLock/index.d.ts +4 -0
  181. package/dist/esm/focusLock/index.d.ts.map +1 -0
  182. package/dist/esm/focusLock/index.js +3 -0
  183. package/dist/esm/footer/footer.d.ts.map +1 -1
  184. package/dist/esm/footer/footer.js +5 -1
  185. package/dist/esm/footer/footer.types.d.ts +2 -1
  186. package/dist/esm/footer/footer.types.d.ts.map +1 -1
  187. package/dist/esm/header/headerAccountUserInfo.d.ts.map +1 -1
  188. package/dist/esm/header/headerAccountUserInfo.js +3 -3
  189. package/dist/esm/header/headerLinkItem.d.ts.map +1 -1
  190. package/dist/esm/header/headerLinkItem.js +7 -3
  191. package/dist/esm/header/headerNotifications.d.ts.map +1 -1
  192. package/dist/esm/header/headerNotifications.js +3 -3
  193. package/dist/esm/header/headerSignIn.d.ts.map +1 -1
  194. package/dist/esm/header/headerSignIn.js +1 -1
  195. package/dist/esm/header/theme.d.ts +2 -0
  196. package/dist/esm/header/theme.d.ts.map +1 -1
  197. package/dist/esm/header/theme.js +2 -0
  198. package/dist/esm/icons/baseIcons/conc/conCard.d.ts +4 -0
  199. package/dist/esm/icons/baseIcons/conc/conCard.d.ts.map +1 -0
  200. package/dist/esm/icons/baseIcons/conc/conCard.js +6 -0
  201. package/dist/esm/icons/baseIcons/conc/conEmptyBox.d.ts +4 -0
  202. package/dist/esm/icons/baseIcons/conc/conEmptyBox.d.ts.map +1 -0
  203. package/dist/esm/icons/baseIcons/conc/conEmptyBox.js +5 -0
  204. package/dist/esm/icons/baseIcons/icons.d.ts +2 -0
  205. package/dist/esm/icons/baseIcons/icons.d.ts.map +1 -1
  206. package/dist/esm/icons/baseIcons/icons.js +2 -0
  207. package/dist/esm/icons/baseIcons/types.d.ts +1 -1
  208. package/dist/esm/icons/baseIcons/types.d.ts.map +1 -1
  209. package/dist/esm/index.d.ts +2 -0
  210. package/dist/esm/index.d.ts.map +1 -1
  211. package/dist/esm/index.js +2 -0
  212. package/dist/esm/input/consts.d.ts +6 -0
  213. package/dist/esm/input/consts.d.ts.map +1 -1
  214. package/dist/esm/input/consts.js +6 -0
  215. package/dist/esm/input/input.d.ts.map +1 -1
  216. package/dist/esm/input/input.js +4 -4
  217. package/dist/esm/input/input.types.d.ts +2 -0
  218. package/dist/esm/input/input.types.d.ts.map +1 -1
  219. package/dist/esm/modal/index.d.ts +2 -2
  220. package/dist/esm/modal/index.d.ts.map +1 -1
  221. package/dist/esm/modal/index.js +2 -2
  222. package/dist/esm/modal/modal.d.ts.map +1 -1
  223. package/dist/esm/modal/modal.js +1 -1
  224. package/dist/esm/modal/modal.types.d.ts +1 -1
  225. package/dist/esm/modal/modal.types.d.ts.map +1 -1
  226. package/dist/esm/modal/modalManager.d.ts +2 -2
  227. package/dist/esm/modal/modalManager.d.ts.map +1 -1
  228. package/dist/esm/modal/modalManager.js +6 -9
  229. package/dist/esm/onedesign-tokens/dist/js/rem/button.d.ts +85 -0
  230. package/dist/esm/onedesign-tokens/dist/js/rem/button.d.ts.map +1 -0
  231. package/dist/esm/onedesign-tokens/dist/js/rem/button.js +84 -0
  232. package/dist/esm/sidemenu/sidemenu.d.ts +0 -1
  233. package/dist/esm/sidemenu/sidemenu.d.ts.map +1 -1
  234. package/dist/esm/sidemenu/sidemenu.js +9 -11
  235. package/dist/esm/sidemenu/sidemenu.types.d.ts +4 -0
  236. package/dist/esm/sidemenu/sidemenu.types.d.ts.map +1 -1
  237. package/dist/esm/sidemenu/sidemenuItem.d.ts.map +1 -1
  238. package/dist/esm/sidemenu/sidemenuItem.js +29 -6
  239. package/dist/esm/spinner/spinner.d.ts.map +1 -1
  240. package/dist/esm/spinner/spinner.js +2 -2
  241. package/dist/esm/spinner/spinner.types.d.ts +2 -1
  242. package/dist/esm/spinner/spinner.types.d.ts.map +1 -1
  243. package/dist/esm/spinner/theme.d.ts +26 -5
  244. package/dist/esm/spinner/theme.d.ts.map +1 -1
  245. package/dist/esm/spinner/theme.js +34 -13
  246. package/dist/esm/theme/components.d.ts +91 -5
  247. package/dist/esm/theme/components.d.ts.map +1 -1
  248. package/dist/esm/theme/components.js +2 -0
  249. package/dist/esm/theme/defaultTheme.d.ts +92 -5
  250. package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
  251. package/dist/esm/theme/foundations/colors.js +1 -1
  252. package/dist/esm/theme/foundations/index.d.ts +1 -0
  253. package/dist/esm/theme/foundations/index.d.ts.map +1 -1
  254. package/dist/esm/theme/foundations/screens.d.ts +1 -0
  255. package/dist/esm/theme/foundations/screens.d.ts.map +1 -1
  256. package/dist/esm/theme/foundations/screens.js +2 -1
  257. package/package.json +1 -1
  258. package/src/accordion/accordion.types.ts +4 -2
  259. package/src/accordion/accordionItem.tsx +6 -2
  260. package/src/accordion/accordionItemArrow.tsx +10 -2
  261. package/src/accordion/accordionItemHorizontal.tsx +11 -2
  262. package/src/button/button.tsx +18 -19
  263. package/src/button/buttonIcon.tsx +6 -3
  264. package/src/button/consts.ts +7 -5
  265. package/src/core/vuiProvider/consts.ts +1 -0
  266. package/src/core/vuiProvider/globalStyle.tsx +8 -0
  267. package/src/core/vuiProvider/index.ts +2 -0
  268. package/src/core/vuiProvider/useBodyScrollLock.tsx +17 -0
  269. package/src/core/vuiProvider/vuiProvider.tsx +0 -2
  270. package/src/definition/definition.tsx +83 -0
  271. package/src/definition/definition.types.ts +24 -0
  272. package/src/definition/definitionContent.tsx +61 -0
  273. package/src/definition/index.ts +2 -0
  274. package/src/definition/theme.ts +73 -0
  275. package/src/dialog/consts.ts +0 -2
  276. package/src/{modal → focusLock}/focusLock.tsx +4 -3
  277. package/src/focusLock/index.ts +3 -0
  278. package/src/footer/footer.tsx +29 -1
  279. package/src/footer/footer.types.ts +2 -1
  280. package/src/header/headerAccountUserInfo.tsx +7 -3
  281. package/src/header/headerLinkItem.tsx +7 -3
  282. package/src/header/headerNotifications.tsx +7 -3
  283. package/src/header/headerSignIn.tsx +1 -0
  284. package/src/header/theme.ts +2 -0
  285. package/src/icons/baseIcons/conc/conCard.ts +9 -0
  286. package/src/icons/baseIcons/conc/conEmptyBox.ts +8 -0
  287. package/src/icons/baseIcons/icons.ts +2 -0
  288. package/src/icons/baseIcons/types.ts +2 -0
  289. package/src/index.ts +2 -0
  290. package/src/input/consts.ts +7 -0
  291. package/src/input/input.tsx +66 -55
  292. package/src/input/input.types.ts +2 -0
  293. package/src/modal/index.ts +2 -2
  294. package/src/modal/modal.tsx +1 -2
  295. package/src/modal/modal.types.ts +1 -1
  296. package/src/modal/modalManager.ts +6 -9
  297. package/src/onedesign-tokens/dist/js/rem/button.js +85 -0
  298. package/src/sidemenu/sidemenu.tsx +23 -13
  299. package/src/sidemenu/sidemenu.types.ts +4 -0
  300. package/src/sidemenu/sidemenuItem.tsx +49 -36
  301. package/src/spinner/spinner.tsx +3 -4
  302. package/src/spinner/spinner.types.ts +3 -1
  303. package/src/spinner/theme.ts +34 -13
  304. package/src/theme/components.ts +2 -0
  305. package/src/theme/foundations/colors.ts +1 -1
  306. package/src/theme/foundations/screens.ts +2 -1
  307. package/dist/cjs/modal/focusLock.d.ts +0 -11
  308. package/dist/cjs/modal/focusLock.d.ts.map +0 -1
  309. package/dist/cjs/modal/focusLock.types.d.ts.map +0 -1
  310. package/dist/cjs/modal/modalStyle.d.ts +0 -3
  311. package/dist/cjs/modal/modalStyle.d.ts.map +0 -1
  312. package/dist/cjs/modal/modalStyle.js +0 -10
  313. package/dist/esm/modal/focusLock.d.ts +0 -11
  314. package/dist/esm/modal/focusLock.d.ts.map +0 -1
  315. package/dist/esm/modal/focusLock.types.d.ts.map +0 -1
  316. package/dist/esm/modal/modalStyle.d.ts +0 -3
  317. package/dist/esm/modal/modalStyle.d.ts.map +0 -1
  318. package/dist/esm/modal/modalStyle.js +0 -8
  319. package/src/modal/modalStyle.ts +0 -9
  320. /package/dist/cjs/{modal/focusLock.types.js → definition/definition.types.js} +0 -0
  321. /package/dist/cjs/{modal → focusLock}/focusLock.types.d.ts +0 -0
  322. /package/dist/esm/{modal/focusLock.types.js → definition/definition.types.js} +0 -0
  323. /package/dist/esm/{modal → focusLock}/focusLock.types.d.ts +0 -0
  324. /package/src/{modal → focusLock}/focusLock.types.ts +0 -0
@@ -4,7 +4,7 @@ import { styled, useStyleConfig, vui, VuiComponent } from '../core'
4
4
  import { T } from '../t'
5
5
  import { ChangeEvent, cs, filterUndefined, isString } from '../utils'
6
6
  import AutoCompletePopover from './autoCompletePopover'
7
- import { inputColors, inputStateMapping } from './consts'
7
+ import { displayValueOnlyTextSize, inputColors, inputStateMapping } from './consts'
8
8
  import { InputProvider } from './context'
9
9
  import { getInitialCount } from './helpers'
10
10
  import HelpText from './helpText'
@@ -67,7 +67,8 @@ export const Input = vui<'div', InputProps>((props, ref) => {
67
67
  readOnly,
68
68
  required,
69
69
  showCount,
70
- size,
70
+ displayValueOnly,
71
+ size = 'lg',
71
72
  state = '',
72
73
  stateMapping,
73
74
  step,
@@ -113,59 +114,69 @@ export const Input = vui<'div', InputProps>((props, ref) => {
113
114
 
114
115
  return (
115
116
  <InputProvider value={context}>
116
- <AutoCompletePopover
117
- autoCompleteMaxHeight={autoCompleteMaxHeight}
118
- autoCompleteOptions={autoCompleteOptions}
119
- filterAutoCompleteOptions={filterAutoCompleteOptions}
120
- onAutoCompleteSelect={onAutoCompleteSelect}
121
- >
122
- <InputBase className={cs('vui-input', className)} ref={ref} {...styles.container} {...aliasedProps} {...rest}>
123
- {itemLeft}
124
- {isString(iconLeft) ? <InputIcon ml={1} name={iconLeft} /> : iconLeft}
125
- {children ?? input ?? (
126
- <InputInput
127
- ref={inputRef}
128
- {...{
129
- autoFocus,
130
- defaultValue,
131
- disabled,
132
- id,
133
- max,
134
- maxLength,
135
- min,
136
- name,
137
- onBlur,
138
- onChange,
139
- onFocus,
140
- pattern,
141
- placeholder,
142
- readOnly,
143
- required,
144
- step,
145
- type
146
- }}
147
- autoComplete={autoCompleteOptions?.length ? 'off' : autoComplete}
148
- value={valueInternal}
149
- {...inputProps}
150
- />
151
- )}
152
- {isString(iconRight) ? <InputIcon mr={1} name={iconRight} /> : iconRight}
153
- {itemRight}
154
- {state && <InputIcon mr={1} {...states[state]?.iconProps} />}
155
- {showCount && (
156
- <T
157
- className="vui-inputCount"
158
- color={maxLength && count > maxLength ? inputColors.error : inputColors.helpText}
159
- position="absolute"
160
- right={0}
161
- size="sm"
162
- top="calc(100% + 1px)"
163
- >
164
- {count} {maxLength ? `/ ${maxLength}` : null}
165
- </T>
166
- )}
167
- </InputBase>
168
- </AutoCompletePopover>
117
+ {displayValueOnly ? (
118
+ <T
119
+ className={cs('vui-input-value', className)}
120
+ size={displayValueOnlyTextSize[size] as 'xs' | 'md' | 'sm' | 'lg'}
121
+ >
122
+ {value || defaultValue}
123
+ </T>
124
+ ) : (
125
+ <AutoCompletePopover
126
+ autoCompleteMaxHeight={autoCompleteMaxHeight}
127
+ autoCompleteOptions={autoCompleteOptions}
128
+ filterAutoCompleteOptions={filterAutoCompleteOptions}
129
+ onAutoCompleteSelect={onAutoCompleteSelect}
130
+ >
131
+ <InputBase className={cs('vui-input', className)} ref={ref} {...styles.container} {...aliasedProps} {...rest}>
132
+ {itemLeft}
133
+ {isString(iconLeft) ? <InputIcon ml={1} name={iconLeft} /> : iconLeft}
134
+ {children ?? input ?? (
135
+ <InputInput
136
+ ref={inputRef}
137
+ {...{
138
+ autoFocus,
139
+ defaultValue,
140
+ disabled,
141
+ id,
142
+ max,
143
+ maxLength,
144
+ min,
145
+ name,
146
+ onBlur,
147
+ onChange,
148
+ onFocus,
149
+ pattern,
150
+ placeholder,
151
+ readOnly,
152
+ required,
153
+ step,
154
+ type
155
+ }}
156
+ autoComplete={autoCompleteOptions?.length ? 'off' : autoComplete}
157
+ value={valueInternal}
158
+ {...inputProps}
159
+ />
160
+ )}
161
+ {isString(iconRight) ? <InputIcon mr={1} name={iconRight} /> : iconRight}
162
+ {itemRight}
163
+ {state && <InputIcon mr={1} {...states[state]?.iconProps} />}
164
+ {showCount && (
165
+ <T
166
+ className="vui-inputCount"
167
+ color={maxLength && count > maxLength ? inputColors.error : inputColors.helpText}
168
+ position="absolute"
169
+ right={0}
170
+ size="sm"
171
+ top="calc(100% + 1px)"
172
+ >
173
+ {count} {maxLength ? `/ ${maxLength}` : null}
174
+ </T>
175
+ )}
176
+ </InputBase>
177
+ </AutoCompletePopover>
178
+ )}
179
+
169
180
  {!!helpText && <HelpText>{helpText}</HelpText>}
170
181
  {!!errorText && <HelpText isError>{errorText}</HelpText>}
171
182
  </InputProvider>
@@ -68,6 +68,8 @@ export type InputProps = SystemProps &
68
68
  required?: boolean
69
69
  /** Displays length of input value if also using maxLength. */
70
70
  showCount?: boolean
71
+ /** Displays the provided value. */
72
+ displayValueOnly?: boolean
71
73
  /** Modifies Input style and content based on the given state. */
72
74
  state?: InputState
73
75
  /** Object definition of styles and content for each state. */
@@ -1,6 +1,6 @@
1
1
  export * from './context'
2
- export * from './focusLock'
3
- export * from './focusLock.types'
2
+ export * from '../focusLock/focusLock'
3
+ export * from '../focusLock/focusLock.types'
4
4
  export * from './modal'
5
5
  export { default as Modal } from './modal'
6
6
  export * from './modal.types'
@@ -2,10 +2,10 @@ import React, { cloneElement, useRef } from 'react'
2
2
 
3
3
  import Box from '../box'
4
4
  import { vui, VuiComponent } from '../core'
5
+ import FocusLock from '../focusLock'
5
6
  import Portal from '../portal'
6
7
  import { callAll, cs, KeyboardEvent, mergeRefs, MouseEvent } from '../utils'
7
8
  import { ModalProvider } from './context'
8
- import FocusLock from './focusLock'
9
9
  import { ModalProps } from './modal.types'
10
10
  import ModalBackdrop from './modalBackdrop'
11
11
  import ModalContent from './modalContent'
@@ -95,7 +95,6 @@ export const Modal = vui<'div', ModalProps>((props, ref) => {
95
95
  onMouseDown={callAll(props.onMouseDown, onMouseDown)}
96
96
  >
97
97
  {!hideBackdrop && <ModalBackdrop />}
98
-
99
98
  <FocusLock
100
99
  autoFocus={!disableAutoFocus}
101
100
  finalFocusRef={finalFocusRef}
@@ -1,9 +1,9 @@
1
1
  import { ReactElement } from 'react'
2
2
 
3
+ import { FocusableElement } from '../focusLock/focusLock.types'
3
4
  import { SystemProps } from '../system'
4
5
  import { ThemingProps } from '../theme'
5
6
  import { MouseEvent } from '../utils'
6
- import { FocusableElement } from './focusLock.types'
7
7
 
8
8
  export type ModalBackdropProps = SystemProps
9
9
 
@@ -1,18 +1,14 @@
1
1
  import { Ref, useEffect } from 'react'
2
2
 
3
- import { addBodyClass, removeBodyClass } from '../utils/dom'
3
+ import { useBodyScrollLock } from '../core'
4
4
 
5
5
  /** State management for nested modals. */
6
6
  class ModalManager {
7
7
  modals: any[] = []
8
8
 
9
- add = (modal: any) => {
10
- this.modals.push(modal)
11
- }
9
+ add = (modal: any) => this.modals.push(modal)
12
10
 
13
- remove = (modal: any) => {
14
- this.modals = this.modals.filter(m => m !== modal)
15
- }
11
+ remove = (modal: any) => (this.modals = this.modals.filter(m => m !== modal))
16
12
 
17
13
  isTopModal = (modal: any) => {
18
14
  const topmostModal = this.modals[this.modals.length - 1]
@@ -24,15 +20,16 @@ export const manager = new ModalManager()
24
20
 
25
21
  /** Refs of new modals will be automatically added/removed from the state when rendering. */
26
22
  export function useModalManager(ref: Ref<any>, isOpen?: boolean, disableScrollLock?: boolean) {
23
+ const { setIsScrollLocked } = useBodyScrollLock()
27
24
  useEffect(() => {
28
25
  if (isOpen) {
29
26
  manager.add(ref)
30
- if (!disableScrollLock) addBodyClass('vui-no-scroll')
27
+ if (!disableScrollLock) setIsScrollLocked(true)
31
28
  }
32
29
 
33
30
  return () => {
34
31
  manager.remove(ref)
35
- if (!disableScrollLock) removeBodyClass('vui-no-scroll')
32
+ if (!disableScrollLock) setIsScrollLocked(false)
36
33
  }
37
34
  }, [isOpen, ref])
38
35
  }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Do not edit directly
3
+ * Generated on Wed, 22 Mar 2023 12:31:05 GMT
4
+ */
5
+
6
+ export const buttonSizeLargeFontSize = "1.125rem";
7
+ export const buttonSizeLargeLineHeight = "1.75rem";
8
+ export const buttonSizeLargePadding = "0.5rem 1rem";
9
+ export const buttonSizeMediumFontSize = "1rem";
10
+ export const buttonSizeMediumLineHeight = "1.5rem";
11
+ export const buttonSizeMediumPadding = "0.25rem calc(0.25rem * 3)";
12
+ export const buttonSizeSmallFontSize = "0.875rem";
13
+ export const buttonSizeSmallLineHeight = "1.25rem";
14
+ export const buttonSizeSmallPadding = "calc(0.25rem / 2) 0.5rem";
15
+ export const buttonSizeDefaultFontSize = "1rem";
16
+ export const buttonSizeDefaultLineHeight = "1.5rem";
17
+ export const buttonSizeDefaultPadding = "0.25rem calc(0.25rem * 3)";
18
+ export const buttonTypePrimaryDefaultBorderColorDark = "hsla(0, 0%, 0%, 0)";
19
+ export const buttonTypePrimaryDefaultBorderColorLight = "hsla(0, 0%, 0%, 0)";
20
+ export const buttonTypePrimaryDefaultBackgroundColorDark = "hsla(218, 100%, 28%, 1)";
21
+ export const buttonTypePrimaryDefaultBackgroundColorLight = "hsla(139, 100%, 78%, 1)";
22
+ export const buttonTypePrimaryDefaultTextColorDark = "hsla(40, 3%, 100%, 1)";
23
+ export const buttonTypePrimaryDefaultTextColorLight = "hsla(223, 67%, 18%, 1)";
24
+ export const buttonTypePrimaryHoverBorderColorDark = "hsla(0, 0%, 0%, 0)";
25
+ export const buttonTypePrimaryHoverBorderColorLight = "hsla(0, 0%, 0%, 0)";
26
+ export const buttonTypePrimaryHoverBackgroundColorDark = "hsla(218, 100%, 20%, 1)";
27
+ export const buttonTypePrimaryHoverBackgroundColorLight = "hsla(139, 100%, 70%, 1)";
28
+ export const buttonTypePrimaryHoverTextColorDark = "hsla(40, 3%, 100%, 1)";
29
+ export const buttonTypePrimaryHoverTextColorLight = "hsla(223, 67%, 18%, 1)";
30
+ export const buttonTypePrimaryActiveBorderColorDark = "hsla(0, 0%, 0%, 0)";
31
+ export const buttonTypePrimaryActiveBorderColorLight = "hsla(0, 0%, 0%, 0)";
32
+ export const buttonTypePrimaryActiveBackgroundColorDark = "hsla(218, 100%, 35%, 1)";
33
+ export const buttonTypePrimaryActiveBackgroundColorLight = "hsla(139, 100%, 85%, 1)";
34
+ export const buttonTypePrimaryActiveTextColorDark = "hsla(40, 3%, 100%, 1)";
35
+ export const buttonTypePrimaryActiveTextColorLight = "hsla(223, 67%, 18%, 1)";
36
+ export const buttonTypePrimaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
37
+ export const buttonTypeSecondaryDefaultBorderColorDark = "hsla(218, 100%, 28%, 1)";
38
+ export const buttonTypeSecondaryDefaultBorderColorLight = "hsla(139, 100%, 78%, 1)";
39
+ export const buttonTypeSecondaryDefaultBackgroundColorDark = "hsla(0, 0%, 0%, 0)";
40
+ export const buttonTypeSecondaryDefaultBackgroundColorLight = "hsla(0, 0%, 0%, 0)";
41
+ export const buttonTypeSecondaryDefaultTextColorDark = "hsla(218, 100%, 28%, 1)";
42
+ export const buttonTypeSecondaryDefaultTextColorLight = "hsla(139, 100%, 78%, 1)";
43
+ export const buttonTypeSecondaryHoverBorderColorDark = "hsla(218, 100%, 28%, 1)";
44
+ export const buttonTypeSecondaryHoverBorderColorLight = "hsla(139, 100%, 78%, 1)";
45
+ export const buttonTypeSecondaryHoverBackgroundColorDark = "hsla(196, 74%, 80%, 1)";
46
+ export const buttonTypeSecondaryHoverBackgroundColorLight = "hsla(218, 100%, 25%, 1)";
47
+ export const buttonTypeSecondaryHoverTextColorDark = "hsla(218, 100%, 28%, 1)";
48
+ export const buttonTypeSecondaryHoverTextColorLight = "hsla(139, 100%, 78%, 1)";
49
+ export const buttonTypeSecondaryActiveBorderColorDark = "hsla(218, 100%, 28%, 1)";
50
+ export const buttonTypeSecondaryActiveBorderColorLight = "hsla(139, 100%, 78%, 1)";
51
+ export const buttonTypeSecondaryActiveBackgroundColorDark = "hsla(196, 74%, 85%, 1)";
52
+ export const buttonTypeSecondaryActiveBackgroundColorLight = "hsla(218, 100%, 35%, 1)";
53
+ export const buttonTypeSecondaryActiveTextColorDark = "hsla(218, 100%, 28%, 1)";
54
+ export const buttonTypeSecondaryActiveTextColorLight = "hsla(139, 100%, 78%, 1)";
55
+ export const buttonTypeSecondaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
56
+ export const buttonTypeTertiaryDefaultBorderColorDark = "hsla(0, 0%, 0%, 0)";
57
+ export const buttonTypeTertiaryDefaultBorderColorLight = "hsla(0, 0%, 0%, 0)";
58
+ export const buttonTypeTertiaryDefaultBackgroundColorDark = "hsla(0, 0%, 0%, 0)";
59
+ export const buttonTypeTertiaryDefaultBackgroundColorLight = "hsla(0, 0%, 0%, 0)";
60
+ export const buttonTypeTertiaryDefaultTextColorDark = "hsla(218, 100%, 28%, 1)";
61
+ export const buttonTypeTertiaryDefaultTextColorLight = "hsla(139, 100%, 78%, 1)";
62
+ export const buttonTypeTertiaryHoverBorderColorDark = "hsla(0, 0%, 0%, 0)";
63
+ export const buttonTypeTertiaryHoverBorderColorLight = "hsla(0, 0%, 0%, 0)";
64
+ export const buttonTypeTertiaryHoverBackgroundColorDark = "hsla(196, 74%, 80%, 1)";
65
+ export const buttonTypeTertiaryHoverBackgroundColorLight = "hsla(218, 100%, 25%, 1)";
66
+ export const buttonTypeTertiaryHoverTextColorDark = "hsla(218, 100%, 28%, 1)";
67
+ export const buttonTypeTertiaryHoverTextColorLight = "hsla(139, 100%, 78%, 1)";
68
+ export const buttonTypeTertiaryActiveBorderColorDark = "hsla(0, 0%, 0%, 0)";
69
+ export const buttonTypeTertiaryActiveBorderColorLight = "hsla(0, 0%, 0%, 0)";
70
+ export const buttonTypeTertiaryActiveBackgroundColorDark = "hsla(196, 74%, 85%, 1)";
71
+ export const buttonTypeTertiaryActiveBackgroundColorLight = "hsla(218, 100%, 35%, 1)";
72
+ export const buttonTypeTertiaryActiveTextColorDark = "hsla(218, 100%, 28%, 1)";
73
+ export const buttonTypeTertiaryActiveTextColorLight = "hsla(139, 100%, 78%, 1)";
74
+ export const buttonTypeTertiaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
75
+ export const buttonDisabledCursor = "default";
76
+ export const buttonDisabledOpacity = "0.5";
77
+ export const buttonBorderStyle = "solid";
78
+ export const buttonBorderWidth = "calc(0.125rem / 2)";
79
+ export const buttonFontFamily = "'Avenir Next', Arial, sans-serif";
80
+ export const buttonFontSize = "1rem";
81
+ export const buttonLineHeight = "1.5rem";
82
+ export const buttonFontWeight = "500";
83
+ export const buttonPadding = "calc(0.25rem * 1.5) calc(0.25rem * 3)";
84
+ export const buttonTransition = "all 0.15s ease-in-out";
85
+ export const buttonCursor = "pointer";
@@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useState } from 'react'
2
2
 
3
3
  import Box from '../box'
4
4
  import Button from '../button'
5
- import { styled, useStyleConfig, vui, VuiComponent } from '../core'
5
+ import { useStyleConfig, vui, VuiComponent } from '../core'
6
6
  import Icon from '../icon'
7
7
  import { cs, filterUndefined } from '../utils'
8
8
  import { expandedWidth } from './consts'
@@ -11,17 +11,9 @@ import { SidemenuItemProps, SidemenuProps } from './sidemenu.types'
11
11
  import SidemenuItem from './sidemenuItem'
12
12
  import SidemenuTop from './sidemenuTop'
13
13
 
14
- export const SidemenuBase = styled.divBox`
15
- display: flex;
16
- flex-direction: column;
17
- min-width: 0;
18
- transition-duration: normal;
19
- overflow: hidden;
20
- `
21
-
22
14
  /** A collapsible side menu for navigation. */
23
15
  export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
24
- const { children, className, items, isExpanded = false, size, variant, width = 280, ...rest } = props
16
+ const { children, className, items, isExpanded = false, size, variant, width = 280, onNavigate, ...rest } = props
25
17
 
26
18
  const [isExpandedInternal, setIsExpandedInternal] = useState(isExpanded)
27
19
  const context = useMemo(
@@ -43,12 +35,30 @@ export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
43
35
  const icon = `falArrow${isExpandedInternal ? 'Left' : 'Right'}`
44
36
  const justifyContent = isExpandedInternal ? 'flex-end' : 'center'
45
37
 
38
+ function onItemClick(item: SidemenuItemProps) {
39
+ item?.onClick?.()
40
+ if (item?.path) onNavigate?.(item.path)
41
+ }
42
+
46
43
  return (
47
44
  <SidemenuProvider value={context}>
48
- <SidemenuBase className={cs('vui-sidemenu', className)} ref={ref} w={w} {...styles.container} {...rest}>
45
+ <Box
46
+ className={cs('vui-sidemenu', className)}
47
+ elevation="3"
48
+ flexDirection="column"
49
+ minWidth={0}
50
+ overflowX="hidden"
51
+ ref={ref}
52
+ transitionDuration="normal"
53
+ w={w}
54
+ {...styles.container}
55
+ {...rest}
56
+ >
49
57
  <Box flexDirection="column" flexGrow={1} overflowX="hidden" overflowY="auto" w="100%">
50
58
  {items
51
- ? items?.map?.((item: SidemenuItemProps, key: number) => <SidemenuItem key={key} {...item} />)
59
+ ? items?.map?.((item: SidemenuItemProps, key: number) => (
60
+ <SidemenuItem key={key} {...item} onClick={() => onItemClick(item)} />
61
+ ))
52
62
  : children}
53
63
  </Box>
54
64
  <Box className="vui-sidemenu-bottom" w="100%" {...styles.bottom}>
@@ -63,7 +73,7 @@ export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
63
73
  <Icon name={icon} />
64
74
  </Button>
65
75
  </Box>
66
- </SidemenuBase>
76
+ </Box>
67
77
  </SidemenuProvider>
68
78
  )
69
79
  }) as VuiComponent<'div', SidemenuProps> & {
@@ -13,6 +13,8 @@ export type SidemenuProps = SystemProps &
13
13
  items?: SidemenuItemProps[]
14
14
  /** Whether the menu is expanded @default false */
15
15
  isExpanded?: boolean
16
+ /** External callback for navigation to the item path, could be a custom function or React Router hook: https://reactrouter.com/en/main/hooks/use-navigate */
17
+ onNavigate?: (to: string) => void
16
18
  /** With of the container when the side menu is expanded @default 280 */
17
19
  width?: number
18
20
  }
@@ -30,6 +32,8 @@ export type SidemenuItemProps = BoxProps & {
30
32
  isActive?: boolean
31
33
  /** On click callback */
32
34
  onClick?: () => void
35
+ /** Router path */
36
+ path?: string
33
37
  /** Title */
34
38
  title: string
35
39
  }
@@ -4,6 +4,7 @@ import Box from '../box'
4
4
  import Button from '../button'
5
5
  import { omitThemingProps, useStyleConfig, vui, VuiComponent } from '../core'
6
6
  import Icon from '../icon'
7
+ import { Popover } from '../popover'
7
8
  import T from '../t'
8
9
  import { cs } from '../utils'
9
10
  import { useSidemenuContext } from './context'
@@ -19,17 +20,13 @@ export const SidemenuItem = vui<'button', SidemenuItemProps>((props, ref) => {
19
20
  const isDark = variant === 'dark'
20
21
  const hasChildrenExpanded = !!children && isExpandedInternal
21
22
 
22
- const innerContent = isExpandedInternal ? (
23
+ const innerContent = (
23
24
  <Box centerV px={2} py={1} w="100%" whiteSpace="pre">
24
25
  <Icon ml={iconSize === 'sm' ? '4px' : 0} name={icon} size={iconSize} />
25
26
  <T isTruncated ml={2}>
26
27
  {title}
27
28
  </T>
28
29
  </Box>
29
- ) : (
30
- <Box centerV px={2} py={1} w="100%">
31
- <Icon ml={iconSize === 'sm' ? '4px' : 0} name={icon} size={iconSize} />
32
- </Box>
33
30
  )
34
31
 
35
32
  const toggle = (e: MouseEvent<HTMLButtonElement>) => {
@@ -38,39 +35,55 @@ export const SidemenuItem = vui<'button', SidemenuItemProps>((props, ref) => {
38
35
  setDisplayChildren(!displayChildren)
39
36
  }
40
37
 
38
+ const buttonStyles = {
39
+ alignItems: 'center',
40
+ border: 'none',
41
+ borderRadius: 0,
42
+ borderLeft: '3px solid transparent',
43
+ borderLeftColor: isActive ? (isDark ? 'digiGreen.main' : 'seaBlue.main') : undefined,
44
+ bg: isDark ? 'darkBlue.main' : isActive ? 'skyBlue.95' : 'white',
45
+ color: hasChildrenExpanded ? 'seaBlue.main' : isDark ? 'digiGreen.main' : 'sandstone.10',
46
+ h: 'auto',
47
+ justifyContent: 'space-between',
48
+ onClick: () => onClick?.(),
49
+ p: 0,
50
+ variant: isDark ? 'tertiaryLight' : 'tertiaryDark',
51
+ w: '100%',
52
+ ...styles.item,
53
+ minH: size === 'lg' ? '56px' : '40px',
54
+ hoverBg: isDark ? 'seaBlue.main' : 'skyBlue.90',
55
+ ...rest
56
+ }
57
+
41
58
  return (
42
59
  <Box flexDirection="column" ref={ref} w="100%">
43
- <Button
44
- alignItems="center"
45
- border="none"
46
- borderLeft="3px solid transparent"
47
- borderLeftColor={isActive ? (isDark ? 'digiGreen.main' : 'seaBlue.main') : undefined}
48
- borderRadius={0}
49
- className={cs('vui-sidemenu-item', className)}
50
- color={hasChildrenExpanded ? 'seaBlue.main' : isDark ? 'digiGreen.main' : 'sandstone.10'}
51
- h="auto"
52
- justifyContent="space-between"
53
- onClick={() => onClick?.()}
54
- p={0}
55
- variant={isDark ? 'tertiaryLight' : 'tertiaryDark'}
56
- w="100%"
57
- {...styles.item}
58
- minH={size === 'lg' ? '56px' : '40px'}
59
- {...rest}
60
- >
61
- {innerContent}
62
- {hasChildrenExpanded && (
63
- <Button
64
- className="vui-sidemenu-item-expand"
65
- icon={displayChildren ? 'falChevronUp' : 'falChevronDown'}
66
- mr={1}
67
- onClick={toggle}
68
- size="sm"
69
- variant={isDark ? 'tertiaryLight' : 'tertiaryDark'}
70
- />
71
- )}
72
- </Button>
73
- {!!children && displayChildren && (
60
+ {!hasChildrenExpanded && children ? (
61
+ <Popover offset={[0, 0]} placement="right-start" trigger="mouseenter">
62
+ <Popover.Trigger className={cs('vui-sidemenu-item-popover', className)} {...buttonStyles}>
63
+ <Box borderLeft={`3px solid ${isDark ? 'digiGreen.main' : 'seaBlue.main'}`}>{innerContent}</Box>
64
+ </Popover.Trigger>
65
+ <Popover.Content shadow={'none'}>
66
+ <Box flexDirection="column" justifyContent="start" w="100%">
67
+ {children}
68
+ </Box>
69
+ </Popover.Content>
70
+ </Popover>
71
+ ) : (
72
+ <Button className={cs('vui-sidemenu-item', className)} {...buttonStyles}>
73
+ {innerContent}
74
+ {hasChildrenExpanded && (
75
+ <Button
76
+ className="vui-sidemenu-item-expand"
77
+ icon={displayChildren ? 'falChevronUp' : 'falChevronDown'}
78
+ mr={1}
79
+ onClick={toggle}
80
+ size="sm"
81
+ variant={isDark ? 'tertiaryLight' : 'tertiaryDark'}
82
+ />
83
+ )}
84
+ </Button>
85
+ )}
86
+ {!!children && hasChildrenExpanded && displayChildren && (
74
87
  <Box flexDirection="column" justifyContent="start" w="100%">
75
88
  {children}
76
89
  </Box>
@@ -29,8 +29,8 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
29
29
  thickness,
30
30
  ...rest
31
31
  } = props
32
- const styles = useStyleConfig('Spinner', props)
33
32
 
33
+ const styles = useStyleConfig('Spinner', props)
34
34
  const isCustomSize = typeof size === 'number'
35
35
  const positionProps = spinnerPositionMapping[textPosition]
36
36
  const speed = spinnerSpeedMapping[speedProp] ?? speedProp
@@ -49,8 +49,8 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
49
49
  gap={1}
50
50
  ref={ref}
51
51
  transitionDuration="fast"
52
- {...styles.container}
53
52
  {...positionProps.container}
53
+ {...styles.container}
54
54
  {...rest}
55
55
  >
56
56
  <SpinnerCircle
@@ -59,8 +59,7 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
59
59
  {...styles.circle}
60
60
  {...circleProps}
61
61
  />
62
-
63
- {text && (
62
+ {!!text && (
64
63
  <T className="vui-spinnerText" {...styles.text}>
65
64
  {text}
66
65
  </T>
@@ -1,3 +1,5 @@
1
+ import { ReactNode } from 'react'
2
+
1
3
  import { BoxProps } from '../box'
2
4
  import { ThemingProps } from '../theme'
3
5
 
@@ -14,7 +16,7 @@ export type SpinnerProps = Omit<BoxProps, 'size' | 'variant'> &
14
16
  /** Theme size or a number defining height and width. */
15
17
  size?: ThemingProps<'Spinner'>['size'] | number
16
18
  /** Displays given text next to the spinner. */
17
- text?: string
19
+ text?: ReactNode
18
20
  /** Text placement relative to the spinner. */
19
21
  textPosition?: 'bottom' | 'left' | 'right' | 'top'
20
22
  /** Thickness of the spinner circle in pixels. */
@@ -1,8 +1,12 @@
1
- const baseStyle = {}
1
+ const baseStyle = {
2
+ container: {
3
+ padding: 1
4
+ }
5
+ }
2
6
 
3
7
  const defaultProps = {
4
- size: 'page',
5
- variant: 'lightBackground'
8
+ size: 'xxxl',
9
+ variant: 'light'
6
10
  }
7
11
 
8
12
  const parts = ['container', 'circle', 'text']
@@ -10,9 +14,9 @@ const parts = ['container', 'circle', 'text']
10
14
  const sizes = {
11
15
  xs: {
12
16
  circle: {
13
- borderWidth: 1,
14
- h: 16,
15
- w: 16
17
+ borderWidth: 2,
18
+ h: 20,
19
+ w: 20
16
20
  }
17
21
  },
18
22
  sm: {
@@ -36,24 +40,38 @@ const sizes = {
36
40
  w: 40
37
41
  }
38
42
  },
39
- card: {
43
+ xl: {
44
+ circle: {
45
+ borderWidth: 3,
46
+ h: 48,
47
+ w: 48
48
+ }
49
+ },
50
+ xxl: {
40
51
  circle: {
41
52
  borderWidth: 4,
42
53
  h: 60,
43
54
  w: 60
44
55
  }
45
56
  },
46
- page: {
57
+ xxxl: {
47
58
  circle: {
48
59
  borderWidth: 5,
49
60
  h: 80,
50
61
  w: 80
51
62
  }
63
+ },
64
+ xxxxl: {
65
+ circle: {
66
+ borderWidth: 5,
67
+ h: 120,
68
+ w: 120
69
+ }
52
70
  }
53
71
  }
54
72
 
55
73
  const variants = {
56
- lightBackground: {
74
+ light: {
57
75
  circle: {
58
76
  borderColor: 'seaBlue.80',
59
77
  borderTopColor: 'seaBlue.main'
@@ -62,13 +80,16 @@ const variants = {
62
80
  color: 'seaBlue.main'
63
81
  }
64
82
  },
65
- darkBackground: {
83
+ dark: {
84
+ container: {
85
+ bg: 'darkBlue.main'
86
+ },
66
87
  circle: {
67
- borderColor: 'digiGreen.30',
68
- borderTopColor: 'digiGreen.78'
88
+ borderColor: 'hsl(139, 100%, 78%, 0.4)',
89
+ borderTopColor: 'digiGreen.main'
69
90
  },
70
91
  text: {
71
- color: 'digiGreen.78'
92
+ color: 'digiGreen.main'
72
93
  }
73
94
  }
74
95
  }