@veracity/vui 0.3.1 → 0.4.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 (438) hide show
  1. package/avatar/avatar.d.ts +2 -2
  2. package/avatar/avatar.js +9 -29
  3. package/avatar/avatar.types.d.ts +9 -2
  4. package/avatar/helpers.d.ts +2 -0
  5. package/avatar/helpers.js +26 -0
  6. package/avatar/index.d.ts +1 -1
  7. package/avatar/index.js +1 -1
  8. package/avatar/theme.d.ts +1 -0
  9. package/avatar/theme.js +7 -0
  10. package/box/box.d.ts +2 -2
  11. package/box/box.js +9 -8
  12. package/box/box.types.d.ts +13 -2
  13. package/box/index.d.ts +1 -1
  14. package/box/index.js +1 -1
  15. package/box/theme.d.ts +1 -0
  16. package/box/theme.js +2 -0
  17. package/button/button.d.ts +7 -3
  18. package/button/button.js +24 -14
  19. package/button/button.types.d.ts +16 -34
  20. package/button/buttonIcon.d.ts +1 -0
  21. package/button/buttonIcon.js +3 -5
  22. package/button/buttonText.d.ts +1 -0
  23. package/button/buttonText.js +3 -5
  24. package/button/buttons.js +1 -1
  25. package/button/consts.js +2 -2
  26. package/button/index.d.ts +2 -2
  27. package/button/index.js +3 -3
  28. package/button/theme.d.ts +1 -0
  29. package/button/theme.js +5 -3
  30. package/buttonGroup/buttonGroup.d.ts +5 -2
  31. package/buttonGroup/buttonGroup.js +12 -8
  32. package/buttonGroup/buttonGroup.types.d.ts +4 -2
  33. package/buttonGroup/helpers.d.ts +1 -1
  34. package/buttonGroup/helpers.js +1 -1
  35. package/buttonGroup/index.d.ts +1 -1
  36. package/buttonGroup/index.js +2 -2
  37. package/card/card.d.ts +4 -0
  38. package/card/card.js +8 -0
  39. package/card/card.types.d.ts +3 -2
  40. package/card/index.d.ts +1 -1
  41. package/card/index.js +1 -1
  42. package/card/theme.d.ts +1 -0
  43. package/card/theme.js +2 -0
  44. package/checkbox/checkbox.d.ts +5 -4
  45. package/checkbox/checkbox.js +20 -10
  46. package/checkbox/checkbox.types.d.ts +21 -4
  47. package/checkbox/checkboxGroup.d.ts +5 -2
  48. package/checkbox/checkboxGroup.js +11 -7
  49. package/checkbox/checkboxGroup.types.d.ts +9 -2
  50. package/checkbox/index.d.ts +1 -1
  51. package/checkbox/index.js +2 -2
  52. package/checkbox/theme.d.ts +1 -0
  53. package/checkbox/theme.js +2 -0
  54. package/core/index.d.ts +4 -5
  55. package/core/index.js +4 -12
  56. package/core/media.d.ts +38 -0
  57. package/core/media.js +79 -0
  58. package/core/styled.d.ts +3 -0
  59. package/core/styled.js +21 -3
  60. package/core/theme.d.ts +41 -0
  61. package/core/theme.js +94 -0
  62. package/core/vui.d.ts +31 -0
  63. package/core/vui.js +20 -0
  64. package/core/vuiProvider/fontFaces.js +4 -0
  65. package/core/{globalStyle.d.ts → vuiProvider/globalStyle.d.ts} +7 -0
  66. package/core/{globalStyle.js → vuiProvider/globalStyle.js} +17 -9
  67. package/core/vuiProvider/index.d.ts +5 -0
  68. package/core/vuiProvider/index.js +26 -0
  69. package/core/{resetCSS.d.ts → vuiProvider/resetCSS.d.ts} +1 -0
  70. package/core/{resetCSS.js → vuiProvider/resetCSS.js} +2 -1
  71. package/core/vuiProvider/vuiProvider.d.ts +13 -0
  72. package/core/{vuiProvider.js → vuiProvider/vuiProvider.js} +3 -2
  73. package/divider/divider.d.ts +2 -2
  74. package/divider/divider.js +5 -4
  75. package/divider/divider.types.d.ts +5 -2
  76. package/divider/index.d.ts +1 -1
  77. package/divider/index.js +1 -1
  78. package/divider/theme.d.ts +1 -0
  79. package/divider/theme.js +2 -0
  80. package/footer/consts.d.ts +108 -8
  81. package/footer/consts.js +21 -9
  82. package/footer/footer.d.ts +3 -1
  83. package/footer/footer.js +21 -10
  84. package/footer/footer.types.d.ts +5 -0
  85. package/footer/footerColumn.d.ts +122 -121
  86. package/footer/footerColumn.js +1 -0
  87. package/footer/footerHeading.d.ts +1 -0
  88. package/footer/footerHeading.js +1 -0
  89. package/footer/footerLink.d.ts +1 -0
  90. package/footer/footerLink.js +1 -0
  91. package/footer/footerRow.d.ts +1 -0
  92. package/footer/footerRow.js +1 -0
  93. package/footer/footerSection.d.ts +1 -0
  94. package/footer/footerSection.js +2 -1
  95. package/footer/footerTrademark.d.ts +1 -0
  96. package/footer/footerTrademark.js +1 -0
  97. package/footer/helpers.d.ts +2 -3
  98. package/footer/helpers.js +16 -16
  99. package/footer/index.d.ts +2 -1
  100. package/footer/index.js +2 -2
  101. package/footer/theme.d.ts +1 -0
  102. package/footer/theme.js +2 -0
  103. package/header/consts.d.ts +58 -0
  104. package/header/consts.js +76 -0
  105. package/header/context.d.ts +4 -0
  106. package/header/context.js +23 -0
  107. package/header/header.d.ts +34 -0
  108. package/header/header.js +133 -0
  109. package/header/header.types.d.ts +103 -0
  110. package/header/headerAccount.d.ts +4 -0
  111. package/header/headerAccount.js +109 -0
  112. package/header/headerAccount.types.d.ts +35 -0
  113. package/header/headerContent.d.ts +4 -0
  114. package/header/headerContent.js +28 -0
  115. package/header/headerCreateAccount.d.ts +4 -0
  116. package/header/headerCreateAccount.js +47 -0
  117. package/header/headerDivider.d.ts +4 -0
  118. package/header/headerDivider.js +28 -0
  119. package/header/headerLinkItem.d.ts +4 -0
  120. package/header/headerLinkItem.js +53 -0
  121. package/header/headerLinksList.d.ts +4 -0
  122. package/header/headerLinksList.js +44 -0
  123. package/header/headerLogo.d.ts +4 -0
  124. package/header/headerLogo.js +44 -0
  125. package/header/headerMobileContent.d.ts +4 -0
  126. package/header/headerMobileContent.js +31 -0
  127. package/header/headerMobileToggle.d.ts +4 -0
  128. package/header/headerMobileToggle.js +33 -0
  129. package/header/headerNotifications.d.ts +4 -0
  130. package/header/headerNotifications.js +51 -0
  131. package/header/headerServices.d.ts +4 -0
  132. package/header/headerServices.js +55 -0
  133. package/header/headerSignIn.d.ts +4 -0
  134. package/header/headerSignIn.js +40 -0
  135. package/header/helpers.d.ts +17 -0
  136. package/header/helpers.js +66 -0
  137. package/header/index.d.ts +21 -0
  138. package/header/index.js +38 -0
  139. package/header/loggedInHeader.d.ts +4 -0
  140. package/header/loggedInHeader.js +57 -0
  141. package/header/loggedOutHeader.d.ts +4 -0
  142. package/header/loggedOutHeader.js +57 -0
  143. package/header/theme.d.ts +85 -0
  144. package/header/theme.js +89 -0
  145. package/heading/heading.d.ts +2 -2
  146. package/heading/heading.js +5 -4
  147. package/heading/heading.types.d.ts +7 -2
  148. package/heading/headings.js +1 -1
  149. package/heading/index.d.ts +1 -1
  150. package/heading/index.js +2 -2
  151. package/heading/theme.d.ts +1 -0
  152. package/heading/theme.js +2 -0
  153. package/icon/helpers.js +2 -2
  154. package/icon/icon.d.ts +1 -0
  155. package/icon/icon.js +2 -2
  156. package/icon/icon.types.d.ts +7 -4
  157. package/icon/index.d.ts +1 -1
  158. package/icon/index.js +1 -1
  159. package/icon/theme.d.ts +1 -0
  160. package/icon/theme.js +2 -0
  161. package/icons/baseIcons/fal/falFileInvoiceDollar.d.ts +3 -0
  162. package/icons/baseIcons/fal/falFileInvoiceDollar.js +7 -0
  163. package/icons/baseIcons/fas/fasCalendarAlt.js +1 -1
  164. package/icons/baseIcons/icons.d.ts +1 -0
  165. package/icons/baseIcons/icons.js +5 -3
  166. package/icons/baseIcons/types.d.ts +1 -1
  167. package/icons/cache.d.ts +15 -0
  168. package/icons/{library.js → cache.js} +10 -6
  169. package/icons/index.d.ts +1 -1
  170. package/icons/index.js +3 -3
  171. package/icons/types.d.ts +10 -3
  172. package/image/image.d.ts +2 -0
  173. package/image/image.js +11 -2
  174. package/image/image.types.d.ts +3 -2
  175. package/image/index.d.ts +1 -1
  176. package/image/index.js +1 -1
  177. package/image/theme.d.ts +1 -0
  178. package/image/theme.js +2 -0
  179. package/index.d.ts +3 -1
  180. package/index.js +3 -1
  181. package/input/consts.js +2 -2
  182. package/input/helpers.d.ts +1 -0
  183. package/input/helpers.js +1 -0
  184. package/input/index.d.ts +1 -1
  185. package/input/index.js +2 -2
  186. package/input/input.d.ts +7 -3
  187. package/input/input.js +17 -7
  188. package/input/input.types.d.ts +36 -7
  189. package/input/inputIcon.d.ts +1 -0
  190. package/input/inputIcon.js +2 -1
  191. package/input/inputInput.d.ts +2 -2
  192. package/input/inputInput.js +10 -5
  193. package/input/theme.d.ts +1 -0
  194. package/input/theme.js +2 -0
  195. package/link/index.d.ts +1 -1
  196. package/link/index.js +2 -2
  197. package/link/link.d.ts +6 -3
  198. package/link/link.js +15 -9
  199. package/link/link.types.d.ts +15 -7
  200. package/link/linkIcon.d.ts +1 -0
  201. package/link/linkIcon.js +3 -5
  202. package/link/linkText.d.ts +1 -0
  203. package/link/linkText.js +3 -5
  204. package/link/theme.d.ts +6 -0
  205. package/link/theme.js +9 -1
  206. package/list/index.d.ts +1 -1
  207. package/list/index.js +2 -2
  208. package/list/list.d.ts +3 -3
  209. package/list/list.js +13 -8
  210. package/list/list.types.d.ts +29 -8
  211. package/list/listDivider.d.ts +1 -0
  212. package/list/listDivider.js +3 -5
  213. package/list/listHeading.d.ts +1 -0
  214. package/list/listHeading.js +4 -6
  215. package/list/listIcon.d.ts +1 -0
  216. package/list/listIcon.js +3 -5
  217. package/list/listItem.d.ts +5 -2
  218. package/list/listItem.js +52 -19
  219. package/list/listText.d.ts +1 -0
  220. package/list/listText.js +3 -5
  221. package/list/theme.d.ts +1 -0
  222. package/list/theme.js +5 -2
  223. package/menu/menu.d.ts +1 -0
  224. package/menu/menu.js +1 -0
  225. package/menu/menu.types.d.ts +3 -0
  226. package/menu/menuButton.d.ts +1 -0
  227. package/menu/menuButton.js +3 -4
  228. package/menu/menuItem.d.ts +1 -0
  229. package/menu/menuItem.js +9 -23
  230. package/menu/menuList.d.ts +1 -0
  231. package/menu/menuList.js +3 -4
  232. package/menu/theme.d.ts +16 -2
  233. package/menu/theme.js +18 -3
  234. package/modal/context.d.ts +4 -0
  235. package/modal/context.js +23 -0
  236. package/modal/focusLock.d.ts +9 -0
  237. package/modal/focusLock.js +47 -0
  238. package/modal/focusLock.types.d.ts +28 -0
  239. package/modal/focusLock.types.js +2 -0
  240. package/modal/index.d.ts +7 -0
  241. package/modal/index.js +24 -0
  242. package/modal/modal.d.ts +10 -0
  243. package/modal/modal.js +109 -0
  244. package/modal/modal.types.d.ts +40 -0
  245. package/modal/modal.types.js +2 -0
  246. package/modal/modalBackdrop.d.ts +4 -0
  247. package/modal/modalBackdrop.js +38 -0
  248. package/modal/modalManager.d.ts +12 -0
  249. package/modal/modalManager.js +33 -0
  250. package/modal/theme.d.ts +7 -0
  251. package/modal/theme.js +12 -0
  252. package/notification/consts.js +2 -2
  253. package/notification/index.d.ts +2 -2
  254. package/notification/index.js +3 -3
  255. package/notification/notification.d.ts +5 -1
  256. package/notification/notification.js +12 -27
  257. package/notification/notification.types.d.ts +11 -4
  258. package/notification/notificationButton.d.ts +1 -0
  259. package/notification/notificationButton.js +4 -5
  260. package/notification/notificationIcon.d.ts +1 -0
  261. package/notification/notificationIcon.js +7 -7
  262. package/notification/notificationText.d.ts +1 -0
  263. package/notification/notificationText.js +3 -5
  264. package/notification/notificationTitle.d.ts +1 -0
  265. package/notification/notificationTitle.js +3 -5
  266. package/notification/theme.d.ts +1 -0
  267. package/notification/theme.js +2 -0
  268. package/p/index.d.ts +1 -1
  269. package/p/index.js +1 -1
  270. package/p/p.d.ts +2 -2
  271. package/p/p.js +5 -4
  272. package/p/p.types.d.ts +7 -2
  273. package/p/theme.d.ts +1 -0
  274. package/p/theme.js +2 -0
  275. package/package.json +3 -1
  276. package/panel/index.d.ts +1 -1
  277. package/panel/index.js +1 -1
  278. package/panel/panel.d.ts +4 -0
  279. package/panel/panel.js +4 -0
  280. package/panel/panel.types.d.ts +1 -2
  281. package/panel/theme.d.ts +1 -0
  282. package/panel/theme.js +2 -0
  283. package/popover/consts.d.ts +6 -0
  284. package/popover/consts.js +42 -0
  285. package/popover/index.d.ts +1 -1
  286. package/popover/index.js +1 -1
  287. package/popover/popover.d.ts +6 -2
  288. package/popover/popover.js +20 -4
  289. package/popover/popover.types.d.ts +4 -1
  290. package/popover/popoverContent.d.ts +2 -1
  291. package/popover/popoverContent.js +6 -1
  292. package/popover/popoverTrigger.d.ts +4 -0
  293. package/popover/popoverTrigger.js +4 -0
  294. package/popover/theme.d.ts +1 -0
  295. package/popover/theme.js +2 -0
  296. package/popover/usePopover.d.ts +5 -0
  297. package/popover/usePopover.js +26 -18
  298. package/popover/usePopover.types.d.ts +17 -6
  299. package/portal/index.d.ts +3 -0
  300. package/{styles → portal}/index.js +5 -5
  301. package/portal/portal.d.ts +5 -0
  302. package/portal/portal.js +56 -0
  303. package/portal/portal.types.d.ts +7 -0
  304. package/portal/portal.types.js +2 -0
  305. package/radio/index.d.ts +1 -1
  306. package/radio/index.js +2 -2
  307. package/radio/radio.d.ts +5 -4
  308. package/radio/radio.js +20 -10
  309. package/radio/radio.types.d.ts +19 -4
  310. package/radio/radioGroup.d.ts +5 -2
  311. package/radio/radioGroup.js +11 -7
  312. package/radio/radioGroup.types.d.ts +10 -2
  313. package/radio/theme.d.ts +1 -0
  314. package/radio/theme.js +2 -0
  315. package/skeleton/index.d.ts +1 -1
  316. package/skeleton/index.js +1 -1
  317. package/skeleton/skeleton.d.ts +2 -2
  318. package/skeleton/skeleton.js +4 -3
  319. package/skeleton/skeleton.types.d.ts +5 -2
  320. package/skeleton/theme.d.ts +1 -0
  321. package/skeleton/theme.js +2 -0
  322. package/spinner/index.d.ts +1 -1
  323. package/spinner/index.js +1 -1
  324. package/spinner/spinner.d.ts +6 -2
  325. package/spinner/spinner.js +12 -5
  326. package/spinner/spinner.types.d.ts +10 -6
  327. package/spinner/theme.d.ts +1 -0
  328. package/spinner/theme.js +2 -0
  329. package/svg/helpers.d.ts +1 -1
  330. package/svg/index.d.ts +1 -1
  331. package/svg/index.js +1 -1
  332. package/svg/svg.d.ts +6 -1
  333. package/svg/svg.js +16 -5
  334. package/svg/svg.types.d.ts +7 -5
  335. package/switch/context.d.ts +2 -2
  336. package/switch/index.d.ts +1 -1
  337. package/switch/index.js +2 -2
  338. package/switch/switch.d.ts +6 -3
  339. package/switch/switch.js +15 -12
  340. package/switch/switch.types.d.ts +37 -4
  341. package/switch/switchButton.d.ts +5 -5
  342. package/switch/switchButton.js +34 -26
  343. package/switch/switchLabel.d.ts +1 -0
  344. package/switch/switchLabel.js +3 -5
  345. package/switch/theme.d.ts +1 -0
  346. package/switch/theme.js +2 -0
  347. package/system/animations.d.ts +3 -4
  348. package/system/backgrounds.d.ts +4 -5
  349. package/system/borders.d.ts +60 -61
  350. package/system/custom.d.ts +4 -4
  351. package/system/effects.d.ts +7 -8
  352. package/system/flexboxGrids.d.ts +5 -6
  353. package/system/flexboxes.d.ts +28 -29
  354. package/system/grids.d.ts +25 -26
  355. package/system/index.d.ts +0 -1
  356. package/system/index.js +0 -6
  357. package/system/interactivity.d.ts +11 -12
  358. package/system/layout.d.ts +31 -32
  359. package/system/sizing.d.ts +13 -14
  360. package/system/space.d.ts +37 -38
  361. package/system/system.d.ts +4 -5
  362. package/system/system.js +3 -1
  363. package/system/tables.d.ts +5 -6
  364. package/system/transforms.d.ts +22 -23
  365. package/system/transitions.d.ts +11 -12
  366. package/system/typography.d.ts +33 -34
  367. package/t/index.d.ts +1 -1
  368. package/t/index.js +1 -1
  369. package/t/t.d.ts +2 -2
  370. package/t/t.js +5 -4
  371. package/t/t.types.d.ts +8 -2
  372. package/t/theme.d.ts +1 -0
  373. package/t/theme.js +2 -0
  374. package/tag/index.d.ts +1 -1
  375. package/tag/index.js +2 -2
  376. package/tag/tag.d.ts +6 -3
  377. package/tag/tag.js +14 -7
  378. package/tag/tag.types.d.ts +19 -6
  379. package/tag/tagButton.d.ts +1 -0
  380. package/tag/tagButton.js +4 -16
  381. package/tag/tagIcon.d.ts +1 -0
  382. package/tag/tagIcon.js +3 -5
  383. package/tag/tagText.d.ts +1 -0
  384. package/tag/tagText.js +3 -5
  385. package/tag/theme.d.ts +1 -0
  386. package/tag/theme.js +8 -0
  387. package/textarea/helpers.d.ts +1 -0
  388. package/textarea/helpers.js +1 -0
  389. package/textarea/index.d.ts +1 -1
  390. package/textarea/index.js +1 -1
  391. package/textarea/textarea.d.ts +5 -3
  392. package/textarea/textarea.js +23 -10
  393. package/textarea/textarea.types.d.ts +22 -2
  394. package/textarea/theme.d.ts +1 -0
  395. package/textarea/theme.js +2 -0
  396. package/theme/components.d.ts +129 -2
  397. package/theme/components.js +38 -36
  398. package/theme/defaultTheme.d.ts +134 -2
  399. package/theme/foundations/colors.d.ts +10 -0
  400. package/theme/foundations/colors.js +8 -2
  401. package/theme/foundations/index.d.ts +5 -0
  402. package/theme/foundations/shadows.js +3 -3
  403. package/theme/foundations/transformers.js +3 -2
  404. package/theme/index.d.ts +1 -3
  405. package/theme/index.js +4 -5
  406. package/theme/types.d.ts +3 -2
  407. package/utils/assertion.d.ts +5 -5
  408. package/utils/assertion.js +8 -4
  409. package/utils/index.d.ts +1 -0
  410. package/utils/index.js +1 -0
  411. package/utils/object.d.ts +2 -2
  412. package/utils/object.js +3 -1
  413. package/utils/react.d.ts +10 -5
  414. package/utils/react.js +64 -9
  415. package/utils/string.d.ts +5 -0
  416. package/utils/string.js +19 -0
  417. package/utils/styles.d.ts +2 -2
  418. package/utils/styles.js +4 -4
  419. package/utils/types.d.ts +11 -4
  420. package/core/types/component.d.ts +0 -25
  421. package/core/types/index.d.ts +0 -2
  422. package/core/types/index.js +0 -14
  423. package/core/types/themeGet.d.ts +0 -24
  424. package/core/utils.d.ts +0 -56
  425. package/core/utils.js +0 -194
  426. package/core/vuiProvider.d.ts +0 -20
  427. package/icons/library.d.ts +0 -11
  428. package/popover/plugins.d.ts +0 -3
  429. package/popover/plugins.js +0 -24
  430. package/styles/fontFaces.js +0 -4
  431. package/styles/helpers.d.ts +0 -4
  432. package/styles/helpers.js +0 -8
  433. package/styles/index.d.ts +0 -3
  434. /package/{styles → core/vuiProvider}/animations.d.ts +0 -0
  435. /package/{styles → core/vuiProvider}/animations.js +0 -0
  436. /package/{styles → core/vuiProvider}/fontFaces.d.ts +0 -0
  437. /package/{core/types/component.js → header/header.types.js} +0 -0
  438. /package/{core/types/themeGet.js → header/headerAccount.types.js} +0 -0
@@ -1,9 +1,13 @@
1
+ import { VuiComponent } from '../core';
1
2
  import { NotificationProps } from './notification.types';
2
3
  import NotificationButton from './notificationButton';
3
4
  import NotificationIcon from './notificationIcon';
4
5
  import NotificationText from './notificationText';
5
6
  import NotificationTitle from './notificationTitle';
6
- import { VuiComponent } from '../core';
7
+ /**
8
+ * Displays informational content, like text and icon with optional action buttons.
9
+ * Handles multiple states, like info, error or loading.
10
+ */
7
11
  export declare const Notification: VuiComponent<"div", NotificationProps> & {
8
12
  Button: typeof NotificationButton;
9
13
  Icon: typeof NotificationIcon;
@@ -10,25 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
13
  var __rest = (this && this.__rest) || function (s, e) {
33
14
  var t = {};
34
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -45,24 +26,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
26
  };
46
27
  Object.defineProperty(exports, "__esModule", { value: true });
47
28
  exports.Notification = void 0;
48
- var react_1 = __importStar(require("react"));
29
+ var react_1 = __importDefault(require("react"));
30
+ var box_1 = __importDefault(require("../box"));
31
+ var core_1 = require("../core");
32
+ var utils_1 = require("../utils");
49
33
  var consts_1 = require("./consts");
50
34
  var context_1 = require("./context");
51
35
  var notificationButton_1 = __importDefault(require("./notificationButton"));
52
36
  var notificationIcon_1 = __importDefault(require("./notificationIcon"));
53
37
  var notificationText_1 = __importDefault(require("./notificationText"));
54
38
  var notificationTitle_1 = __importDefault(require("./notificationTitle"));
55
- var box_1 = __importDefault(require("../box"));
56
- var core_1 = require("../core");
57
- var utils_1 = require("../utils");
39
+ /**
40
+ * Displays informational content, like text and icon with optional action buttons.
41
+ * Handles multiple states, like info, error or loading.
42
+ */
58
43
  exports.Notification = (0, core_1.vui)(function (props, ref) {
59
44
  var _a, _b, _c;
60
- var action = props.action, children = props.children, className = props.className, _d = props.colorScheme, colorSchemeProp = _d === void 0 ? 'blue' : _d, icon = props.icon, onClose = props.onClose, size = props.size, _e = props.status, status = _e === void 0 ? '' : _e, statusMapping = props.statusMapping, text = props.text, title = props.title, variant = props.variant, rest = __rest(props, ["action", "children", "className", "colorScheme", "icon", "onClose", "size", "status", "statusMapping", "text", "title", "variant"]);
45
+ var action = props.action, children = props.children, className = props.className, _d = props.colorScheme, colorSchemeProp = _d === void 0 ? 'blue' : _d, icon = props.icon, onClose = props.onClose, size = props.size, status = props.status, statusMapping = props.statusMapping, text = props.text, title = props.title, variant = props.variant, rest = __rest(props, ["action", "children", "className", "colorScheme", "icon", "onClose", "size", "status", "statusMapping", "text", "title", "variant"]);
61
46
  var statuses = __assign(__assign({}, consts_1.notificationStatusMapping), statusMapping);
62
- var _f = ((_a = statuses[status]) !== null && _a !== void 0 ? _a : {}).colorScheme, colorScheme = _f === void 0 ? colorSchemeProp : _f;
47
+ var _e = ((_a = statuses[status !== null && status !== void 0 ? status : '']) !== null && _a !== void 0 ? _a : {}).colorScheme, colorScheme = _e === void 0 ? colorSchemeProp : _e;
63
48
  var styles = (0, core_1.useStyleConfig)('Notification', __assign({ colorScheme: colorScheme }, props));
64
- var iconName = (0, utils_1.isString)(icon) ? icon : (_c = (_b = statuses[status]) === null || _b === void 0 ? void 0 : _b.iconProps) === null || _c === void 0 ? void 0 : _c.name;
65
- var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, size: size, status: status, variant: variant }); }, [colorScheme, size, status, variant]);
49
+ var iconName = (0, utils_1.isString)(icon) ? icon : (_c = (_b = statuses[status !== null && status !== void 0 ? status : '']) === null || _b === void 0 ? void 0 : _b.iconProps) === null || _c === void 0 ? void 0 : _c.name;
50
+ var context = (0, utils_1.filterUndefined)({ colorScheme: colorScheme, size: size, status: status, variant: variant });
66
51
  return (react_1.default.createElement(context_1.NotificationProvider, { value: context },
67
52
  react_1.default.createElement(box_1.default, __assign({ borderRadius: "md", className: (0, utils_1.cs)('vui-notification', className), px: 1.5, py: 1, ref: ref, w: "fit-content" }, styles.container, rest),
68
53
  iconName ? react_1.default.createElement(notificationIcon_1.default, { name: iconName }) : icon, children !== null && children !== void 0 ? children : (react_1.default.createElement(notificationText_1.default, null,
@@ -2,17 +2,24 @@ import { ReactNode } from 'react';
2
2
  import { BoxProps } from '../box';
3
3
  import { IconProp, IconProps } from '../icon';
4
4
  import { ThemingProps } from '../theme';
5
- import { AnyElement } from '../utils';
6
- export interface NotificationProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Notification'> {
5
+ export declare type NotificationProps = Omit<BoxProps, 'size' | 'variant'> & ThemingProps<'Notification'> & {
6
+ /** Socket displaying a button on the right. */
7
7
  action?: ReactNode;
8
+ /** Available theme colors for this component. @default blue */
8
9
  colorScheme?: 'blue' | 'green' | 'red' | 'yellow';
9
- icon?: IconProp | AnyElement;
10
+ /** Socket displaying an icon on the left. */
11
+ icon?: IconProp | JSX.Element;
12
+ /** If provided, displays a close button with this function as onClick. */
10
13
  onClose?: () => void;
14
+ /** Modifies Notification style and content based on the given status. */
11
15
  status?: NotificationStatus;
16
+ /** Object definition of styles and content for each status. */
12
17
  statusMapping?: NotificationStatusMapping;
18
+ /** Socket displaying text in the middle. */
13
19
  text?: ReactNode;
20
+ /** Socket displaying title in the middle. */
14
21
  title?: ReactNode;
15
- }
22
+ };
16
23
  export declare type NotificationStatus = 'error' | 'info' | 'loading' | 'success' | 'warning';
17
24
  export declare type NotificationStatusMapping = Record<string, {
18
25
  colorScheme?: NotificationProps['colorScheme'];
@@ -1,3 +1,4 @@
1
1
  import { ButtonProps } from '../button';
2
+ /** Displays an action button within the Notification. */
2
3
  export declare const NotificationButton: import("../core").VuiComponent<"button", ButtonProps>;
3
4
  export default NotificationButton;
@@ -16,13 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.NotificationButton = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
- var context_1 = require("./context");
20
- var core_1 = require("../core");
21
19
  var button_1 = __importDefault(require("../button"));
20
+ var core_1 = require("../core");
21
+ var context_1 = require("./context");
22
+ /** Displays an action button within the Notification. */
22
23
  exports.NotificationButton = (0, core_1.vui)(function (props, ref) {
23
- var _a;
24
- var notificationProps = (_a = (0, context_1.useNotification)()) !== null && _a !== void 0 ? _a : {};
25
- var mergedProps = __assign(__assign({}, notificationProps), props);
24
+ var mergedProps = __assign(__assign({}, (0, context_1.useNotification)()), props);
26
25
  var styles = (0, core_1.useStyleConfig)('Notification', mergedProps);
27
26
  return (react_1.default.createElement(button_1.default, __assign({ className: "vui-notificationButton", colorScheme: mergedProps.colorScheme, ml: 1, mr: -0.5, ref: ref, size: "sm", variant: "text" }, styles.button, props)));
28
27
  });
@@ -1,3 +1,4 @@
1
1
  import { IconProps } from '../icon';
2
+ /** Displays an icon based on the status within the Notification. */
2
3
  export declare const NotificationIcon: import("../core").VuiComponent<"svg", IconProps>;
3
4
  export default NotificationIcon;
@@ -16,17 +16,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.NotificationIcon = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
- var consts_1 = require("./consts");
20
- var context_1 = require("./context");
21
19
  var core_1 = require("../core");
22
20
  var icon_1 = __importDefault(require("../icon"));
21
+ var consts_1 = require("./consts");
22
+ var context_1 = require("./context");
23
+ /** Displays an icon based on the status within the Notification. */
23
24
  exports.NotificationIcon = (0, core_1.vui)(function (props, ref) {
24
- var _a, _b;
25
- var notificationProps = (_a = (0, context_1.useNotification)()) !== null && _a !== void 0 ? _a : {};
26
- var mergedProps = __assign(__assign({}, notificationProps), props);
25
+ var _a;
26
+ var mergedProps = __assign(__assign({}, (0, context_1.useNotification)()), props);
27
27
  var styles = (0, core_1.useStyleConfig)('Notification', mergedProps);
28
- var _c = mergedProps.status, status = _c === void 0 ? '' : _c;
29
- var iconProps = ((_b = consts_1.notificationStatusMapping[status]) !== null && _b !== void 0 ? _b : {}).iconProps;
28
+ var _b = mergedProps.status, status = _b === void 0 ? '' : _b;
29
+ var iconProps = ((_a = consts_1.notificationStatusMapping[status]) !== null && _a !== void 0 ? _a : {}).iconProps;
30
30
  return (react_1.default.createElement(icon_1.default, __assign({ className: "vui-notificationIcon", mr: 1, my: 0.5, ref: ref, size: "md" }, styles.icon, iconProps, props)));
31
31
  });
32
32
  exports.NotificationIcon.displayName = 'NotificationIcon';
@@ -1,3 +1,4 @@
1
1
  import { TProps } from '../t';
2
+ /** Displays text within the Notification. */
2
3
  export declare const NotificationText: import("../core").VuiComponent<"p", TProps>;
3
4
  export default NotificationText;
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.NotificationText = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
- var context_1 = require("./context");
20
19
  var core_1 = require("../core");
21
20
  var t_1 = __importDefault(require("../t"));
21
+ var context_1 = require("./context");
22
+ /** Displays text within the Notification. */
22
23
  exports.NotificationText = (0, core_1.vui)(function (props, ref) {
23
- var _a;
24
- var notificationProps = (_a = (0, context_1.useNotification)()) !== null && _a !== void 0 ? _a : {};
25
- var mergedProps = __assign(__assign({}, notificationProps), props);
26
- var styles = (0, core_1.useStyleConfig)('Notification', mergedProps);
24
+ var styles = (0, core_1.useStyleConfig)('Notification', __assign(__assign({}, (0, context_1.useNotification)()), props));
27
25
  return (react_1.default.createElement(t_1.default, __assign({ className: "vui-notificationText", flex: "1", lineHeight: "24px", minW: 0, py: 0.5, ref: ref }, styles.text, props)));
28
26
  });
29
27
  exports.NotificationText.displayName = 'NotificationText';
@@ -1,3 +1,4 @@
1
1
  import { HeadingProps } from '../heading';
2
+ /** Displays a title within the Notification. */
2
3
  export declare const NotificationTitle: import("../core").VuiComponent<"h6", HeadingProps>;
3
4
  export default NotificationTitle;
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.NotificationTitle = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
- var context_1 = require("./context");
20
19
  var core_1 = require("../core");
21
20
  var heading_1 = require("../heading");
21
+ var context_1 = require("./context");
22
+ /** Displays a title within the Notification. */
22
23
  exports.NotificationTitle = (0, core_1.vui)(function (props, ref) {
23
- var _a;
24
- var notificationProps = (_a = (0, context_1.useNotification)()) !== null && _a !== void 0 ? _a : {};
25
- var mergedProps = __assign(__assign({}, notificationProps), props);
26
- var styles = (0, core_1.useStyleConfig)('Notification', mergedProps);
24
+ var styles = (0, core_1.useStyleConfig)('Notification', __assign(__assign({}, (0, context_1.useNotification)()), props));
27
25
  return react_1.default.createElement(heading_1.H6, __assign({ className: "vui-notificationTitle", display: "inline-flex", ref: ref }, styles.title, props));
28
26
  });
29
27
  exports.NotificationTitle.displayName = 'NotificationTitle';
@@ -13,6 +13,7 @@ declare function variantSubtle(props: Dict): {
13
13
  };
14
14
  };
15
15
  declare const _default: {
16
+ baseStyle: {};
16
17
  defaultProps: {
17
18
  colorScheme: string;
18
19
  variant: string;
@@ -23,6 +23,7 @@ function variantSubtle(props) {
23
23
  }
24
24
  return { container: container, button: button };
25
25
  }
26
+ var baseStyle = {};
26
27
  var defaultProps = {
27
28
  colorScheme: 'blue',
28
29
  variant: 'subtle'
@@ -33,6 +34,7 @@ var variants = {
33
34
  subtle: variantSubtle
34
35
  };
35
36
  exports.default = {
37
+ baseStyle: baseStyle,
36
38
  defaultProps: defaultProps,
37
39
  parts: parts,
38
40
  sizes: sizes,
package/p/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './p';
2
- export * from './p.types';
3
2
  export { default } from './p';
3
+ export * from './p.types';
package/p/index.js CHANGED
@@ -15,6 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.default = void 0;
17
17
  __exportStar(require("./p"), exports);
18
- __exportStar(require("./p.types"), exports);
19
18
  var p_1 = require("./p");
20
19
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(p_1).default; } });
20
+ __exportStar(require("./p.types"), exports);
package/p/p.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PProps } from './p.types';
2
- import { SystemProps } from '../system';
3
- export declare const PBase: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, SystemProps, never>;
2
+ export declare const PBase: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
3
+ /** Displays a paragraph of text. */
4
4
  export declare const P: import("../core").VuiComponent<"p", PProps>;
5
5
  export default P;
package/p/p.js CHANGED
@@ -31,11 +31,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.P = exports.PBase = void 0;
33
33
  var react_1 = __importDefault(require("react"));
34
- var styled_components_1 = __importDefault(require("styled-components"));
35
34
  var core_1 = require("../core");
36
- var system_1 = require("../system");
37
35
  var utils_1 = require("../utils");
38
- exports.PBase = styled_components_1.default.p.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
36
+ exports.PBase = core_1.styled.pBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\ttransition-duration: fast;\n"], ["\n\ttransition-duration: fast;\n"
37
+ /** Displays a paragraph of text. */
38
+ ])));
39
+ /** Displays a paragraph of text. */
39
40
  exports.P = (0, core_1.vui)(function (props, ref) {
40
41
  var _a = (0, core_1.omitThemingProps)(props), align = _a.align, casing = _a.casing, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "children", "className", "decoration", "text", "weight"]);
41
42
  var styles = (0, core_1.useStyleConfig)('P', props);
@@ -45,7 +46,7 @@ exports.P = (0, core_1.vui)(function (props, ref) {
45
46
  textDecoration: decoration,
46
47
  textTransform: casing
47
48
  });
48
- return (react_1.default.createElement(exports.PBase, __assign({ className: (0, utils_1.cs)('vui-p', className), ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
49
+ return (react_1.default.createElement(exports.PBase, __assign({ className: (0, utils_1.cs)('vui-p', className), ref: ref }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
49
50
  });
50
51
  exports.P.displayName = 'P';
51
52
  exports.default = exports.P;
package/p/p.types.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  import { SystemProps, TypographyProps } from '../system';
2
2
  import { ThemingProps } from '../theme';
3
- export interface PProps extends SystemProps, ThemingProps<'P'> {
3
+ export declare type PProps = SystemProps & ThemingProps<'P'> & {
4
+ /** Alias for textAlign prop. @deprecated */
4
5
  align?: TypographyProps['textAlign'];
6
+ /** Alias for textTransform prop. @deprecated */
5
7
  casing?: TypographyProps['textTransform'];
8
+ /** Alias for textDecoration prop. @deprecated */
6
9
  decoration?: TypographyProps['textDecoration'];
10
+ /** Displays given text if no children are provided. */
7
11
  text?: number | string;
12
+ /** Alias for fontWeight prop. @deprecated */
8
13
  weight?: TypographyProps['fontWeight'];
9
- }
14
+ };
package/p/theme.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ baseStyle: {};
2
3
  defaultProps: {
3
4
  size: string;
4
5
  };
package/p/theme.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var baseStyle = {};
3
4
  var defaultProps = {
4
5
  size: 'md'
5
6
  };
@@ -27,6 +28,7 @@ var sizes = {
27
28
  };
28
29
  var variants = {};
29
30
  exports.default = {
31
+ baseStyle: baseStyle,
30
32
  defaultProps: defaultProps,
31
33
  sizes: sizes,
32
34
  variants: variants
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Veracity UI React components library based on Styled Components and @xstyled",
5
5
  "main": "index.js",
6
6
  "author": "Veracity",
@@ -18,6 +18,8 @@
18
18
  "dependencies": {
19
19
  "@types/styled-components": "^5.1.15",
20
20
  "@xstyled/styled-components": "^2.4.1",
21
+ "react-focus-lock": "^2.7.1",
22
+ "react-remove-scroll": "^2.4.3",
21
23
  "styled-components": "^5.3.1",
22
24
  "tippy.js": "^6.3.7"
23
25
  },
package/panel/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './panel';
2
- export * from './panel.types';
3
2
  export { default } from './panel';
3
+ export * from './panel.types';
package/panel/index.js CHANGED
@@ -15,6 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.default = void 0;
17
17
  __exportStar(require("./panel"), exports);
18
- __exportStar(require("./panel.types"), exports);
19
18
  var panel_1 = require("./panel");
20
19
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(panel_1).default; } });
20
+ __exportStar(require("./panel.types"), exports);
package/panel/panel.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  import { PanelProps } from './panel.types';
2
+ /**
3
+ * Displays static or partially interactive content, such as text, images or buttons.
4
+ * Supports use cases of showing multiple segments of a page, each focusing on different data type or context.
5
+ */
2
6
  export declare const Panel: import("../core").VuiComponent<"div", PanelProps>;
3
7
  export default Panel;
package/panel/panel.js CHANGED
@@ -30,6 +30,10 @@ var react_1 = __importDefault(require("react"));
30
30
  var box_1 = __importDefault(require("../box"));
31
31
  var core_1 = require("../core");
32
32
  var utils_1 = require("../utils");
33
+ /**
34
+ * Displays static or partially interactive content, such as text, images or buttons.
35
+ * Supports use cases of showing multiple segments of a page, each focusing on different data type or context.
36
+ */
33
37
  exports.Panel = (0, core_1.vui)(function (props, ref) {
34
38
  var _a = (0, core_1.omitThemingProps)(props), className = _a.className, rest = __rest(_a, ["className"]);
35
39
  var styles = (0, core_1.useStyleConfig)('Panel', props);
@@ -1,4 +1,3 @@
1
1
  import { BoxProps } from '../box';
2
2
  import { ThemingProps } from '../theme';
3
- export interface PanelProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Panel'> {
4
- }
3
+ export declare type PanelProps = Omit<BoxProps, 'size' | 'variant'> & ThemingProps<'Panel'> & {};
package/panel/theme.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ baseStyle: {};
2
3
  defaultProps: {
3
4
  variant: string;
4
5
  };
package/panel/theme.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var baseStyle = {};
3
4
  var defaultProps = {
4
5
  variant: 'elevated'
5
6
  };
@@ -14,6 +15,7 @@ var variants = {
14
15
  }
15
16
  };
16
17
  exports.default = {
18
+ baseStyle: baseStyle,
17
19
  defaultProps: defaultProps,
18
20
  sizes: sizes,
19
21
  variants: variants
@@ -0,0 +1,6 @@
1
+ import { Modifier } from '@popperjs/core';
2
+ import { Plugin } from 'tippy.js';
3
+ /** Closes the popper if 'Escape' is pressed. Tippy plugin. */
4
+ export declare const closeOnEscPlugin: Plugin;
5
+ /** Sets popper width to be the same as reference. Updates on resize, etc. Popper modifier. */
6
+ export declare const matchWidthModifier: Modifier<'matchWidth', any>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchWidthModifier = exports.closeOnEscPlugin = void 0;
4
+ /** Closes the popper if 'Escape' is pressed. Tippy plugin. */
5
+ exports.closeOnEscPlugin = {
6
+ name: 'closeOnEsc',
7
+ defaultValue: true,
8
+ fn: function (_a) {
9
+ var hide = _a.hide;
10
+ function onKeyDown(e) {
11
+ if (e.key === 'Escape') {
12
+ hide();
13
+ }
14
+ }
15
+ return {
16
+ onHide: function () {
17
+ document.removeEventListener('keydown', onKeyDown);
18
+ },
19
+ onShow: function () {
20
+ document.addEventListener('keydown', onKeyDown);
21
+ }
22
+ };
23
+ }
24
+ };
25
+ /** Sets popper width to be the same as reference. Updates on resize, etc. Popper modifier. */
26
+ exports.matchWidthModifier = {
27
+ name: 'matchWidth',
28
+ enabled: true,
29
+ phase: 'beforeWrite',
30
+ requires: ['computeStyles'],
31
+ fn: function (_a) {
32
+ var state = _a.state;
33
+ state.styles.popper.width = state.rects.reference.width + "px";
34
+ },
35
+ effect: function (_a) {
36
+ var state = _a.state;
37
+ return function () {
38
+ var reference = state.elements.reference;
39
+ state.elements.popper.style.width = reference.offsetWidth + "px";
40
+ };
41
+ }
42
+ };
@@ -1,5 +1,5 @@
1
+ export * from './consts';
1
2
  export * from './context';
2
- export * from './plugins';
3
3
  export { default, default as Popover } from './popover';
4
4
  export * from './popover.types';
5
5
  export { default as PopoverContent } from './popoverContent';
package/popover/index.js CHANGED
@@ -14,8 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.usePopover = exports.PopoverTrigger = exports.PopoverStyle = exports.PopoverContent = exports.Popover = exports.default = void 0;
17
+ __exportStar(require("./consts"), exports);
17
18
  __exportStar(require("./context"), exports);
18
- __exportStar(require("./plugins"), exports);
19
19
  var popover_1 = require("./popover");
20
20
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(popover_1).default; } });
21
21
  Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return __importDefault(popover_1).default; } });
@@ -1,8 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { PopoverProps } from './popover.types';
3
- declare function Popover({ children, isLazy, ...props }: PopoverProps): JSX.Element;
3
+ /**
4
+ * Uses 'usePopover' hook to expose relevant data to its children parts.
5
+ * By default, renders provided content only when popover is opened (lazy).
6
+ */
7
+ declare function Popover(props: PopoverProps): JSX.Element;
4
8
  declare namespace Popover {
5
- var Content: import("..").VuiComponent<"div", import("..").SystemProps>;
9
+ var Content: import("..").VuiComponent<"div", import("..").BoxProps>;
6
10
  var Trigger: import("..").VuiComponent<"button", import("..").SystemProps>;
7
11
  }
8
12
  export default Popover;
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __rest = (this && this.__rest) || function (s, e) {
3
14
  var t = {};
4
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -20,11 +31,16 @@ var context_1 = require("./context");
20
31
  var popoverContent_1 = __importDefault(require("./popoverContent"));
21
32
  var popoverTrigger_1 = __importDefault(require("./popoverTrigger"));
22
33
  var usePopover_1 = __importDefault(require("./usePopover"));
23
- function Popover(_a) {
24
- var children = _a.children, _b = _a.isLazy, isLazy = _b === void 0 ? true : _b, props = __rest(_a, ["children", "isLazy"]);
25
- var popoverProps = (0, usePopover_1.default)(props);
34
+ /**
35
+ * Uses 'usePopover' hook to expose relevant data to its children parts.
36
+ * By default, renders provided content only when popover is opened (lazy).
37
+ */
38
+ function Popover(props) {
39
+ var children = props.children, _a = props.isLazy, isLazy = _a === void 0 ? true : _a, rest = __rest(props, ["children", "isLazy"]);
40
+ var popoverProps = (0, usePopover_1.default)(rest);
26
41
  var close = popoverProps.close, isOpen = popoverProps.isOpen, open = popoverProps.open;
27
- return react_1.default.createElement(context_1.PopoverProvider, { value: popoverProps }, (0, utils_1.runIfFn)(children, { close: close, isOpen: isOpen, open: open }));
42
+ var context = (0, utils_1.filterUndefined)(__assign({ isLazy: isLazy }, popoverProps));
43
+ return react_1.default.createElement(context_1.PopoverProvider, { value: context }, (0, utils_1.runIfFn)(children, { close: close, isOpen: isOpen, open: open }));
28
44
  }
29
45
  exports.default = Popover;
30
46
  Popover.Content = popoverContent_1.default;
@@ -1,10 +1,13 @@
1
+ import { BoxProps } from '../box';
1
2
  import { SystemProps } from '../system';
2
3
  import { RenderProps } from '../utils';
3
4
  import { UsePopoverType } from './usePopover';
4
5
  import { UsePopoverProps } from './usePopover.types';
5
- export declare type PopoverContentProps = SystemProps;
6
+ export declare type PopoverContentProps = BoxProps;
6
7
  export declare type PopoverProps = UsePopoverProps & {
8
+ /** Exposes render props to the children. */
7
9
  children?: PopoverRenderProps;
10
+ /** Mounts provided content only when popover is opened for performance. @default true */
8
11
  isLazy?: boolean;
9
12
  };
10
13
  export declare type PopoverRenderProps = RenderProps<{
@@ -1,2 +1,3 @@
1
- export declare const PopoverContent: import("../core").VuiComponent<"div", import("..").SystemProps>;
1
+ /** Displays provided content in an overlaying wrapper. */
2
+ export declare const PopoverContent: import("../core").VuiComponent<"div", import("../box").BoxProps>;
2
3
  export default PopoverContent;
@@ -27,9 +27,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.PopoverContent = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
+ var box_1 = __importDefault(require("../box"));
30
31
  var core_1 = require("../core");
31
32
  var utils_1 = require("../utils");
32
33
  var context_1 = require("./context");
34
+ /** Displays provided content in an overlaying wrapper. */
33
35
  exports.PopoverContent = (0, core_1.vui)(function (props, ref) {
34
36
  var _a;
35
37
  var popoverProps = (_a = (0, context_1.usePopoverContext)()) !== null && _a !== void 0 ? _a : {};
@@ -37,7 +39,10 @@ exports.PopoverContent = (0, core_1.vui)(function (props, ref) {
37
39
  var children = props.children, rest = __rest(props, ["children"]);
38
40
  var styles = (0, core_1.useStyleConfig)('Popover', __assign(__assign({}, popoverProps), props));
39
41
  var shouldRenderChildren = isLazy ? isOpen : true;
40
- return (react_1.default.createElement(core_1.v.div, __assign({ bg: "white", borderRadius: "md", boxShadow: "2", className: "vui-popoverContent", ref: (0, utils_1.mergeRefs)(setPopper, ref) }, styles.content, rest), shouldRenderChildren ? children : null));
42
+ return (
43
+ // Wrapping div prevents an error thrown when conditionally unmounting this component
44
+ react_1.default.createElement("div", null,
45
+ react_1.default.createElement(box_1.default, __assign({ bg: "white", borderRadius: "md", boxShadow: "2", className: "vui-popoverContent", overflowY: "auto", ref: (0, utils_1.mergeRefs)(setPopper, ref) }, styles.content, rest), shouldRenderChildren ? children : null)));
41
46
  });
42
47
  exports.PopoverContent.displayName = 'PopoverContent';
43
48
  exports.default = exports.PopoverContent;
@@ -1,2 +1,6 @@
1
+ /**
2
+ * Displays a trigger component to toggle display of the popover content.
3
+ * Can be rendered as any component using the 'as' prop. By default renders as a plain button.
4
+ */
1
5
  export declare const PopoverTrigger: import("../core").VuiComponent<"button", import("..").SystemProps>;
2
6
  export default PopoverTrigger;
@@ -31,6 +31,10 @@ var react_1 = __importDefault(require("react"));
31
31
  var core_1 = require("../core");
32
32
  var utils_1 = require("../utils");
33
33
  var context_1 = require("./context");
34
+ /**
35
+ * Displays a trigger component to toggle display of the popover content.
36
+ * Can be rendered as any component using the 'as' prop. By default renders as a plain button.
37
+ */
34
38
  exports.PopoverTrigger = (0, core_1.vui)(function (props, ref) {
35
39
  var _a;
36
40
  var _b = (_a = (0, context_1.usePopoverContext)()) !== null && _a !== void 0 ? _a : {}, setReference = _b.setReference, popoverProps = __rest(_b, ["setReference"]);
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ baseStyle: {};
2
3
  defaultProps: {};
3
4
  parts: string[];
4
5
  sizes: {};