@decisiv/ui-components 2.0.1-alpha.21 → 2.0.1-alpha.210

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 (623) hide show
  1. package/lib/atoms/BaseButton/index.d.ts.map +1 -1
  2. package/lib/atoms/BaseButton/index.js +1 -1
  3. package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
  4. package/lib/atoms/BooleanInput/elements.js +8 -3
  5. package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
  6. package/lib/atoms/BooleanInput/index.js +26 -5
  7. package/lib/atoms/BooleanInput/index.test.js +17 -6
  8. package/lib/atoms/BooleanInput/types.d.ts +4 -0
  9. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  10. package/lib/atoms/BooleanInput/types.js +5 -1
  11. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  12. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  13. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  14. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  15. package/lib/atoms/Calendar/index.js +46 -6
  16. package/lib/atoms/Calendar/index.test.js +68 -38
  17. package/lib/atoms/Calendar/types.d.ts +1 -1
  18. package/lib/atoms/Calendar/types.d.ts.map +1 -1
  19. package/lib/atoms/Calendar/types.js +5 -1
  20. package/lib/atoms/InputField/Containers.d.ts +12 -6
  21. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  22. package/lib/atoms/InputField/Containers.js +8 -6
  23. package/lib/atoms/InputField/HelpMessage.d.ts +1 -1
  24. package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
  25. package/lib/atoms/InputField/HelpMessage.js +23 -7
  26. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  27. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  28. package/lib/atoms/InputField/InputLabel.js +2 -1
  29. package/lib/atoms/InputField/index.d.ts +8 -1
  30. package/lib/atoms/InputField/index.d.ts.map +1 -1
  31. package/lib/atoms/InputField/index.js +33 -9
  32. package/lib/atoms/InputField/index.test.js +144 -0
  33. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  34. package/lib/atoms/InputField/schema.js +3 -2
  35. package/lib/atoms/OptionsList/Category/index.d.ts +4 -0
  36. package/lib/atoms/OptionsList/Category/index.d.ts.map +1 -0
  37. package/lib/atoms/OptionsList/{Category.js → Category/index.js} +13 -21
  38. package/lib/atoms/OptionsList/Category/styles.d.ts +6 -0
  39. package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
  40. package/lib/atoms/OptionsList/Category/styles.js +36 -0
  41. package/lib/atoms/OptionsList/{Option.d.ts → Option/index.d.ts} +2 -2
  42. package/lib/atoms/OptionsList/Option/index.d.ts.map +1 -0
  43. package/lib/atoms/OptionsList/Option/index.js +172 -0
  44. package/lib/atoms/OptionsList/Option/styles.d.ts +17 -0
  45. package/lib/atoms/OptionsList/Option/styles.d.ts.map +1 -0
  46. package/lib/atoms/OptionsList/Option/styles.js +86 -0
  47. package/lib/atoms/OptionsList/context.d.ts +1 -0
  48. package/lib/atoms/OptionsList/context.d.ts.map +1 -1
  49. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  50. package/lib/atoms/OptionsList/index.js +20 -9
  51. package/lib/atoms/OptionsList/index.test.js +249 -156
  52. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  53. package/lib/atoms/OptionsList/schema.js +4 -1
  54. package/lib/atoms/OptionsList/types.d.ts +25 -0
  55. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  56. package/lib/atoms/OptionsList/types.js +5 -1
  57. package/lib/atoms/RequiredIcon.d.ts +9 -0
  58. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  59. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  60. package/lib/components/Accordion/types.js +5 -1
  61. package/lib/components/Accordion/useAccordion/types.js +5 -1
  62. package/lib/components/Alert/Container.d.ts +201 -0
  63. package/lib/components/Alert/Container.d.ts.map +1 -0
  64. package/lib/components/Alert/Container.js +26 -0
  65. package/lib/components/Alert/StyledButton.d.ts +5 -0
  66. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  67. package/lib/components/Alert/StyledButton.js +23 -0
  68. package/lib/components/Alert/index.d.ts +27 -0
  69. package/lib/components/Alert/index.d.ts.map +1 -0
  70. package/lib/components/Alert/index.js +112 -0
  71. package/lib/components/Alert/index.test.js +79 -0
  72. package/lib/components/Alert/intents.d.ts +13 -0
  73. package/lib/components/Alert/intents.d.ts.map +1 -0
  74. package/lib/components/Alert/intents.js +72 -0
  75. package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
  76. package/lib/components/Alert/schema.d.ts.map +1 -0
  77. package/lib/components/Alert/schema.js +25 -0
  78. package/lib/components/Alert/types.d.ts +36 -0
  79. package/lib/components/Alert/types.d.ts.map +1 -0
  80. package/lib/components/Alert/types.js +32 -0
  81. package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
  82. package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
  83. package/lib/components/Avatar/AvatarContainer.js +12 -13
  84. package/lib/components/Avatar/AvatarContent.d.ts +2 -2
  85. package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
  86. package/lib/components/Avatar/AvatarContent.js +24 -20
  87. package/lib/components/Avatar/index.d.ts.map +1 -1
  88. package/lib/components/Avatar/index.js +39 -5
  89. package/lib/components/Avatar/index.test.js +4 -0
  90. package/lib/components/Avatar/schema.d.ts.map +1 -1
  91. package/lib/components/Avatar/schema.js +3 -1
  92. package/lib/components/Avatar/types.d.ts +15 -2
  93. package/lib/components/Avatar/types.d.ts.map +1 -1
  94. package/lib/components/Avatar/types.js +5 -1
  95. package/lib/components/Badge/constants.d.ts +2 -0
  96. package/lib/components/Badge/constants.d.ts.map +1 -0
  97. package/lib/components/Badge/constants.js +29 -0
  98. package/lib/components/Badge/index.d.ts.map +1 -1
  99. package/lib/components/Badge/index.js +3 -70
  100. package/lib/components/Badge/index.test.js +62 -8
  101. package/lib/components/Badge/schema.d.ts.map +1 -1
  102. package/lib/components/Badge/schema.js +2 -1
  103. package/lib/components/Badge/styles.d.ts +3 -0
  104. package/lib/components/Badge/styles.d.ts.map +1 -0
  105. package/lib/components/Badge/styles.js +96 -0
  106. package/lib/components/Badge/types.d.ts +3 -2
  107. package/lib/components/Badge/types.d.ts.map +1 -1
  108. package/lib/components/Badge/types.js +7 -3
  109. package/lib/components/Breadcrumbs/types.js +5 -1
  110. package/lib/components/Button/StyledButton.d.ts +3 -6
  111. package/lib/components/Button/StyledButton.d.ts.map +1 -1
  112. package/lib/components/Button/StyledButton.js +39 -11
  113. package/lib/components/Button/index.d.ts.map +1 -1
  114. package/lib/components/Button/index.js +51 -12
  115. package/lib/components/Button/index.test.js +43 -8
  116. package/lib/components/Button/schema.d.ts.map +1 -1
  117. package/lib/components/Button/schema.js +4 -1
  118. package/lib/components/Button/types.d.ts +4 -1
  119. package/lib/components/Button/types.d.ts.map +1 -1
  120. package/lib/components/Button/types.js +5 -1
  121. package/lib/components/Checkbox/index.d.ts.map +1 -1
  122. package/lib/components/Checkbox/index.js +3 -1
  123. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  124. package/lib/components/Checkbox/schema.js +2 -0
  125. package/lib/components/CheckboxGroup/index.d.ts +1 -1
  126. package/lib/components/Combobox/Target.d.ts.map +1 -1
  127. package/lib/components/Combobox/Target.js +52 -14
  128. package/lib/components/Combobox/index.d.ts.map +1 -1
  129. package/lib/components/Combobox/index.js +231 -89
  130. package/lib/components/Combobox/index.test.js +425 -147
  131. package/lib/components/Combobox/schema.d.ts.map +1 -1
  132. package/lib/components/Combobox/schema.js +13 -3
  133. package/lib/components/Combobox/types.d.ts +13 -3
  134. package/lib/components/Combobox/types.d.ts.map +1 -1
  135. package/lib/components/Combobox/types.js +5 -1
  136. package/lib/components/Drawer/index.d.ts +22 -0
  137. package/lib/components/Drawer/index.d.ts.map +1 -0
  138. package/lib/components/Drawer/index.js +115 -0
  139. package/lib/components/Drawer/index.test.js +139 -0
  140. package/lib/components/Drawer/schema.d.ts +3 -0
  141. package/lib/components/Drawer/schema.d.ts.map +1 -0
  142. package/lib/components/Drawer/schema.js +32 -0
  143. package/lib/components/Drawer/styles.d.ts +11 -0
  144. package/lib/components/Drawer/styles.d.ts.map +1 -0
  145. package/lib/components/Drawer/styles.js +79 -0
  146. package/lib/components/DropdownList/index.d.ts +1 -0
  147. package/lib/components/DropdownList/index.d.ts.map +1 -1
  148. package/lib/components/DropdownList/index.js +70 -22
  149. package/lib/components/DropdownList/index.test.js +47 -15
  150. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  151. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  152. package/lib/components/DropdownList/propTypes.js +42 -0
  153. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  154. package/lib/components/DropdownList/schema.js +2 -1
  155. package/lib/components/DropdownList/types.d.ts +2 -0
  156. package/lib/components/DropdownList/types.d.ts.map +1 -1
  157. package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
  158. package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
  159. package/lib/components/Filter/ActionFilter/index.js +43 -0
  160. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  161. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  162. package/lib/components/Filter/IconWrapper/index.js +35 -0
  163. package/lib/components/Filter/SimplePrimary/index.d.ts +5 -0
  164. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  165. package/lib/components/Filter/SimplePrimary/index.js +46 -0
  166. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  167. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  168. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  169. package/lib/components/Filter/StyledFilter.js +66 -0
  170. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  171. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  172. package/lib/components/Filter/StyledLabel/index.js +38 -0
  173. package/lib/components/Filter/index.d.ts +6 -0
  174. package/lib/components/Filter/index.d.ts.map +1 -0
  175. package/lib/components/Filter/index.js +107 -0
  176. package/lib/components/Filter/index.test.js +70 -0
  177. package/lib/components/Filter/kind.d.ts +7 -0
  178. package/lib/components/Filter/kind.d.ts.map +1 -0
  179. package/lib/components/Filter/kind.js +43 -0
  180. package/lib/components/Filter/schema.d.ts +9 -0
  181. package/lib/components/Filter/schema.d.ts.map +1 -0
  182. package/lib/components/Filter/schema.js +37 -0
  183. package/lib/components/Filter/types.d.ts +31 -0
  184. package/lib/components/Filter/types.d.ts.map +1 -0
  185. package/lib/components/Filter/types.js +5 -0
  186. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  187. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  188. package/lib/components/JumpTo/JumpToMenu.js +53 -12
  189. package/lib/components/JumpTo/index.test.js +84 -0
  190. package/lib/components/JumpTo/schema.d.ts.map +1 -1
  191. package/lib/components/JumpTo/schema.js +2 -1
  192. package/lib/components/JumpTo/types.d.ts +1 -0
  193. package/lib/components/JumpTo/types.d.ts.map +1 -1
  194. package/lib/components/JumpTo/types.js +5 -1
  195. package/lib/components/JumpTo/utils.d.ts.map +1 -1
  196. package/lib/components/JumpTo/utils.js +3 -7
  197. package/lib/components/LeftNav/Item/ClickArea.js +1 -1
  198. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  199. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -1
  200. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  201. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  202. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  203. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  204. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  205. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  206. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  207. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  208. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  209. package/lib/components/LeftNav/Item/types.js +5 -1
  210. package/lib/components/LeftNav/index.test.js +13 -3
  211. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  212. package/lib/components/LeftNav/schema.js +2 -0
  213. package/lib/components/LeftNav/types.d.ts +1 -0
  214. package/lib/components/LeftNav/types.d.ts.map +1 -1
  215. package/lib/components/LeftNav/types.js +5 -1
  216. package/lib/components/Link/DisabledLink.d.ts +7 -0
  217. package/lib/components/Link/DisabledLink.d.ts.map +1 -0
  218. package/lib/components/Link/DisabledLink.js +46 -0
  219. package/lib/components/Link/Link.d.ts +4 -0
  220. package/lib/components/Link/Link.d.ts.map +1 -0
  221. package/lib/components/Link/Link.js +67 -0
  222. package/lib/components/Link/index.d.ts +4 -23
  223. package/lib/components/Link/index.d.ts.map +1 -1
  224. package/lib/components/Link/index.js +20 -158
  225. package/lib/components/Link/index.test.js +63 -42
  226. package/lib/components/Link/schema.d.ts.map +1 -1
  227. package/lib/components/Link/schema.js +2 -1
  228. package/lib/components/Link/styles.d.ts +20 -0
  229. package/lib/components/Link/styles.d.ts.map +1 -0
  230. package/lib/components/Link/styles.js +131 -0
  231. package/lib/components/Link/types.d.ts +28 -0
  232. package/lib/components/Link/types.d.ts.map +1 -0
  233. package/lib/components/Link/types.js +5 -0
  234. package/lib/components/List/BaseCell/index.d.ts +6 -0
  235. package/lib/components/List/BaseCell/index.d.ts.map +1 -0
  236. package/lib/components/List/BaseCell/index.js +17 -0
  237. package/lib/components/List/BaseCell/index.test.js +33 -0
  238. package/lib/components/List/BaseCell/styles.d.ts +198 -0
  239. package/lib/components/List/BaseCell/styles.d.ts.map +1 -0
  240. package/lib/components/List/BaseCell/styles.js +26 -0
  241. package/lib/components/List/ContentContainer/index.d.ts +19 -0
  242. package/lib/components/List/ContentContainer/index.d.ts.map +1 -0
  243. package/lib/components/List/ContentContainer/index.js +78 -0
  244. package/lib/components/List/ContentContainer/index.test.js +102 -0
  245. package/lib/components/List/DefaultCell/index.d.ts +7 -0
  246. package/lib/components/List/DefaultCell/index.d.ts.map +1 -0
  247. package/lib/components/List/DefaultCell/index.js +26 -0
  248. package/lib/components/List/LabelContainer/index.d.ts +9 -0
  249. package/lib/components/List/LabelContainer/index.d.ts.map +1 -0
  250. package/lib/components/List/LabelContainer/index.js +38 -0
  251. package/lib/components/List/LabelContainer/index.test.js +105 -0
  252. package/lib/components/List/LabelContainer/styles.d.ts +4 -0
  253. package/lib/components/List/LabelContainer/styles.d.ts.map +1 -0
  254. package/lib/components/List/LabelContainer/styles.js +28 -0
  255. package/lib/components/List/ListItem/index.d.ts +8 -0
  256. package/lib/components/List/ListItem/index.d.ts.map +1 -0
  257. package/lib/components/List/ListItem/index.js +41 -0
  258. package/lib/components/List/ListItem/index.test.js +76 -0
  259. package/lib/components/List/ListItem/schema.d.ts +4 -0
  260. package/lib/components/List/ListItem/schema.d.ts.map +1 -0
  261. package/lib/components/List/ListItem/schema.js +30 -0
  262. package/lib/components/List/ListItem/styles.d.ts +2 -0
  263. package/lib/components/List/ListItem/styles.d.ts.map +1 -0
  264. package/lib/components/List/ListItem/styles.js +23 -0
  265. package/lib/components/List/constants.d.ts +14 -0
  266. package/lib/components/List/constants.d.ts.map +1 -0
  267. package/lib/components/List/constants.js +22 -0
  268. package/lib/components/List/index.d.ts +14 -0
  269. package/lib/components/List/index.d.ts.map +1 -0
  270. package/lib/components/List/index.js +64 -0
  271. package/lib/components/List/index.test.js +64 -0
  272. package/lib/components/List/schema.d.ts +4 -0
  273. package/lib/components/List/schema.d.ts.map +1 -0
  274. package/lib/components/List/schema.js +26 -0
  275. package/lib/components/List/styles.d.ts +198 -0
  276. package/lib/components/List/styles.d.ts.map +1 -0
  277. package/lib/components/List/styles.js +34 -0
  278. package/lib/components/List/types.d.ts +14 -0
  279. package/lib/components/List/types.d.ts.map +1 -0
  280. package/lib/components/List/types.js +5 -0
  281. package/lib/components/Loading/Loading.d.ts +12 -0
  282. package/lib/components/Loading/Loading.d.ts.map +1 -0
  283. package/lib/components/Loading/Loading.js +70 -0
  284. package/lib/components/Loading/index.d.ts +4 -0
  285. package/lib/components/Loading/index.d.ts.map +1 -0
  286. package/lib/components/Loading/index.js +33 -0
  287. package/lib/components/Loading/index.test.js +55 -0
  288. package/lib/components/Loading/schema.d.ts +4 -0
  289. package/lib/components/Loading/schema.d.ts.map +1 -0
  290. package/lib/components/Loading/schema.js +31 -0
  291. package/lib/components/Loading/styles.d.ts +211 -0
  292. package/lib/components/Loading/styles.d.ts.map +1 -0
  293. package/lib/components/Loading/styles.js +77 -0
  294. package/lib/components/Loading/types.d.ts +10 -0
  295. package/lib/components/Loading/types.d.ts.map +1 -0
  296. package/lib/components/Loading/types.js +5 -0
  297. package/lib/components/Menu/types.js +5 -1
  298. package/lib/components/Modal/Manager.d.ts +6 -0
  299. package/lib/components/Modal/Manager.d.ts.map +1 -0
  300. package/lib/components/Modal/Manager.js +53 -0
  301. package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
  302. package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
  303. package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
  304. package/lib/components/Modal/components.d.ts +201 -3
  305. package/lib/components/Modal/components.d.ts.map +1 -1
  306. package/lib/components/Modal/components.js +16 -24
  307. package/lib/components/Modal/index.d.ts +8 -4
  308. package/lib/components/Modal/index.d.ts.map +1 -1
  309. package/lib/components/Modal/index.js +63 -95
  310. package/lib/components/Modal/index.test.js +89 -0
  311. package/lib/components/Modal/schema.d.ts.map +1 -1
  312. package/lib/components/Modal/schema.js +2 -1
  313. package/lib/components/Modal/types.d.ts +2 -1
  314. package/lib/components/Modal/types.d.ts.map +1 -1
  315. package/lib/components/Modal/types.js +5 -1
  316. package/lib/components/Modal/utils.d.ts +1 -1
  317. package/lib/components/Modal/utils.d.ts.map +1 -1
  318. package/lib/components/Modal/utils.js +7 -5
  319. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  320. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  321. package/lib/components/Notifications/Notification/components.js +12 -6
  322. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  323. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  324. package/lib/components/Notifications/Notification/index.js +19 -12
  325. package/lib/components/Notifications/Notification/index.test.js +38 -19
  326. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  327. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  328. package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
  329. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  330. package/lib/components/Notifications/Notifier.test.js +79 -10
  331. package/lib/components/Notifications/constants.d.ts +2 -0
  332. package/lib/components/Notifications/constants.d.ts.map +1 -0
  333. package/lib/components/Notifications/constants.js +16 -0
  334. package/lib/components/Notifications/schema.d.ts.map +1 -1
  335. package/lib/components/Notifications/schema.js +2 -1
  336. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  337. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  338. package/lib/components/Notifications/useNotifications.test.js +7 -4
  339. package/lib/components/Pagination/Pages.d.ts +1 -7
  340. package/lib/components/Pagination/Pages.d.ts.map +1 -1
  341. package/lib/components/Pagination/Pages.js +17 -0
  342. package/lib/components/Pagination/Pagination.d.ts +13 -14
  343. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  344. package/lib/components/Pagination/Pagination.js +20 -5
  345. package/lib/components/Pagination/Pagination.test.js +14 -0
  346. package/lib/components/Pagination/paginate.d.ts +1 -1
  347. package/lib/components/Pagination/paginate.d.ts.map +1 -1
  348. package/lib/components/Pagination/paginate.js +4 -0
  349. package/lib/components/Pagination/paginate.test.js +38 -17
  350. package/lib/components/Pagination/schema.d.ts.map +1 -1
  351. package/lib/components/Pagination/schema.js +3 -1
  352. package/lib/components/Pagination/types.d.ts +24 -1
  353. package/lib/components/Pagination/types.d.ts.map +1 -1
  354. package/lib/components/Pagination/types.js +5 -1
  355. package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
  356. package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
  357. package/lib/components/PasswordField/IconWrapper.js +32 -0
  358. package/lib/components/PasswordField/Input.d.ts +6 -0
  359. package/lib/components/PasswordField/Input.d.ts.map +1 -0
  360. package/lib/components/PasswordField/Input.js +28 -0
  361. package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
  362. package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
  363. package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
  364. package/lib/components/PasswordField/index.d.ts +14 -0
  365. package/lib/components/PasswordField/index.d.ts.map +1 -0
  366. package/lib/components/PasswordField/index.js +113 -0
  367. package/lib/components/PasswordField/index.test.js +217 -0
  368. package/lib/components/PasswordField/schema.d.ts +3 -0
  369. package/lib/components/PasswordField/schema.d.ts.map +1 -0
  370. package/lib/components/PasswordField/schema.js +27 -0
  371. package/lib/components/Popover/index.d.ts.map +1 -1
  372. package/lib/components/Popover/index.js +19 -8
  373. package/lib/components/Popover/schema.d.ts.map +1 -1
  374. package/lib/components/Popover/schema.js +27 -20
  375. package/lib/components/Popover/types.d.ts +4 -2
  376. package/lib/components/Popover/types.d.ts.map +1 -1
  377. package/lib/components/Popover/utils.d.ts +1 -1
  378. package/lib/components/SearchInput/index.d.ts +11 -0
  379. package/lib/components/SearchInput/index.d.ts.map +1 -0
  380. package/lib/components/SearchInput/index.js +176 -0
  381. package/lib/components/SearchInput/index.test.js +660 -0
  382. package/lib/components/SearchInput/schema.d.ts +3 -0
  383. package/lib/components/SearchInput/schema.d.ts.map +1 -0
  384. package/lib/components/SearchInput/schema.js +37 -0
  385. package/lib/components/SearchInput/styles.d.ts +1176 -0
  386. package/lib/components/SearchInput/styles.d.ts.map +1 -0
  387. package/lib/components/SearchInput/styles.js +97 -0
  388. package/lib/components/SearchInput/types.d.ts +38 -0
  389. package/lib/components/SearchInput/types.d.ts.map +1 -0
  390. package/lib/components/SearchInput/types.js +5 -0
  391. package/lib/components/Select/Target.d.ts.map +1 -1
  392. package/lib/components/Select/Target.js +6 -2
  393. package/lib/components/Select/index.d.ts.map +1 -1
  394. package/lib/components/Select/index.js +26 -3
  395. package/lib/components/Select/index.test.js +106 -23
  396. package/lib/components/Select/schema.d.ts.map +1 -1
  397. package/lib/components/Select/schema.js +5 -0
  398. package/lib/components/Select/types.d.ts +6 -3
  399. package/lib/components/Select/types.d.ts.map +1 -1
  400. package/lib/components/Select/types.js +5 -1
  401. package/lib/components/SelectDate/Target.d.ts.map +1 -1
  402. package/lib/components/SelectDate/Target.js +6 -2
  403. package/lib/components/SelectDate/index.d.ts.map +1 -1
  404. package/lib/components/SelectDate/index.js +35 -4
  405. package/lib/components/SelectDate/index.test.js +108 -51
  406. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  407. package/lib/components/SelectDate/schema.js +3 -0
  408. package/lib/components/SelectDate/types.d.ts +3 -0
  409. package/lib/components/SelectDate/types.d.ts.map +1 -1
  410. package/lib/components/SelectDate/types.js +5 -1
  411. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  412. package/lib/components/SelectDateRange/index.js +34 -3
  413. package/lib/components/SelectDateRange/index.test.js +115 -58
  414. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  415. package/lib/components/SelectDateRange/schema.js +3 -0
  416. package/lib/components/SelectDateRange/types.js +5 -1
  417. package/lib/components/StepTracker/index.d.ts +11 -0
  418. package/lib/components/StepTracker/index.d.ts.map +1 -0
  419. package/lib/components/StepTracker/index.js +56 -0
  420. package/lib/components/StepTracker/index.test.js +89 -0
  421. package/lib/components/StepTracker/schema.d.ts +3 -0
  422. package/lib/components/StepTracker/schema.d.ts.map +1 -0
  423. package/lib/components/StepTracker/schema.js +19 -0
  424. package/lib/components/StepTracker/styles.d.ts +605 -0
  425. package/lib/components/StepTracker/styles.d.ts.map +1 -0
  426. package/lib/components/StepTracker/styles.js +114 -0
  427. package/lib/components/Table/Body.d.ts.map +1 -1
  428. package/lib/components/Table/Body.js +28 -17
  429. package/lib/components/Table/Container.d.ts.map +1 -1
  430. package/lib/components/Table/Container.js +6 -1
  431. package/lib/components/Table/DataRow.d.ts.map +1 -1
  432. package/lib/components/Table/DataRow.js +26 -18
  433. package/lib/components/Table/Head.d.ts +1 -1
  434. package/lib/components/Table/Head.d.ts.map +1 -1
  435. package/lib/components/Table/Head.js +10 -5
  436. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  437. package/lib/components/Table/HeaderCell/index.js +19 -6
  438. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  439. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  440. package/lib/components/Table/HeaderCell/types.js +5 -1
  441. package/lib/components/Table/Provider.d.ts +5 -5
  442. package/lib/components/Table/Provider.d.ts.map +1 -1
  443. package/lib/components/Table/Provider.js +10 -11
  444. package/lib/components/Table/index.d.ts.map +1 -1
  445. package/lib/components/Table/index.js +110 -20
  446. package/lib/components/Table/index.test.js +80 -33
  447. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  448. package/lib/components/Table/schema.columns.js +6 -4
  449. package/lib/components/Table/schema.d.ts.map +1 -1
  450. package/lib/components/Table/schema.js +7 -6
  451. package/lib/components/Table/types.d.ts +19 -4
  452. package/lib/components/Table/types.d.ts.map +1 -1
  453. package/lib/components/Table/utils.d.ts +2 -8
  454. package/lib/components/Table/utils.d.ts.map +1 -1
  455. package/lib/components/Table/utils.js +21 -20
  456. package/lib/components/Tabs/Tab/index.d.ts +13 -0
  457. package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
  458. package/lib/components/Tabs/Tab/index.js +94 -0
  459. package/lib/components/Tabs/Tab/schema.d.ts +3 -0
  460. package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
  461. package/lib/components/Tabs/Tab/styles.d.ts +7 -0
  462. package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
  463. package/lib/components/Tabs/Tab/styles.js +37 -0
  464. package/lib/components/Tabs/context.d.ts +2 -2
  465. package/lib/components/Tabs/context.d.ts.map +1 -1
  466. package/lib/components/Tabs/context.js +1 -1
  467. package/lib/components/Tabs/index.d.ts +17 -6
  468. package/lib/components/Tabs/index.d.ts.map +1 -1
  469. package/lib/components/Tabs/index.js +104 -163
  470. package/lib/components/Tabs/index.test.js +54 -2
  471. package/lib/components/Tabs/styles.d.ts +4 -0
  472. package/lib/components/Tabs/styles.d.ts.map +1 -0
  473. package/lib/components/Tabs/styles.js +35 -0
  474. package/lib/components/Tag/Action.d.ts +4 -0
  475. package/lib/components/Tag/Action.d.ts.map +1 -0
  476. package/lib/components/Tag/Action.js +39 -0
  477. package/lib/components/Tag/constants.d.ts +2 -2
  478. package/lib/components/Tag/constants.d.ts.map +1 -1
  479. package/lib/components/Tag/constants.js +4 -4
  480. package/lib/components/Tag/index.d.ts +1 -3
  481. package/lib/components/Tag/index.d.ts.map +1 -1
  482. package/lib/components/Tag/index.js +40 -97
  483. package/lib/components/Tag/index.test.js +239 -2
  484. package/lib/components/Tag/propTypes.d.ts +4 -1
  485. package/lib/components/Tag/propTypes.d.ts.map +1 -1
  486. package/lib/components/Tag/propTypes.js +5 -2
  487. package/lib/components/Tag/schema.d.ts.map +1 -1
  488. package/lib/components/Tag/schema.js +2 -0
  489. package/lib/components/Tag/styles.d.ts +13 -0
  490. package/lib/components/Tag/styles.d.ts.map +1 -0
  491. package/lib/components/Tag/styles.js +133 -0
  492. package/lib/components/Tag/types.d.ts +9 -10
  493. package/lib/components/Tag/types.d.ts.map +1 -1
  494. package/lib/components/Tag/types.js +5 -1
  495. package/lib/components/TagInput/index.d.ts +10 -0
  496. package/lib/components/TagInput/index.d.ts.map +1 -0
  497. package/lib/components/TagInput/index.js +217 -0
  498. package/lib/components/TagInput/index.test.js +1001 -0
  499. package/lib/components/TagInput/schema.d.ts +3 -0
  500. package/lib/components/TagInput/schema.d.ts.map +1 -0
  501. package/lib/components/TagInput/schema.js +30 -0
  502. package/lib/components/TagInput/styles.d.ts +10 -0
  503. package/lib/components/TagInput/styles.d.ts.map +1 -0
  504. package/lib/components/TagInput/styles.js +52 -0
  505. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  506. package/lib/components/TextArea/TextArea.js +1 -1
  507. package/lib/components/TextArea/index.js +1 -0
  508. package/lib/components/TextArea/index.test.js +5 -0
  509. package/lib/components/TextField/Input.js +1 -1
  510. package/lib/components/TextField/index.test.js +5 -0
  511. package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
  512. package/lib/components/Toggle/Fieldset.js +20 -11
  513. package/lib/components/Toggle/Option.d.ts.map +1 -1
  514. package/lib/components/Toggle/Option.js +1 -1
  515. package/lib/components/Toggle/Slider.d.ts +1 -3
  516. package/lib/components/Toggle/Slider.d.ts.map +1 -1
  517. package/lib/components/Toggle/Slider.js +29 -24
  518. package/lib/components/Toggle/index.d.ts.map +1 -1
  519. package/lib/components/Toggle/index.js +6 -1
  520. package/lib/components/Toggle/index.test.js +39 -10
  521. package/lib/components/Toggle/propTypes.js +1 -1
  522. package/lib/components/Toggle/schema.js +1 -1
  523. package/lib/components/Toggle/types.d.ts +3 -2
  524. package/lib/components/Toggle/types.d.ts.map +1 -1
  525. package/lib/components/Toggle/types.js +5 -1
  526. package/lib/components/ToggleView/ToggleView.d.ts +5 -0
  527. package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
  528. package/lib/components/ToggleView/ToggleView.js +80 -0
  529. package/lib/components/ToggleView/index.d.ts +4 -0
  530. package/lib/components/ToggleView/index.d.ts.map +1 -0
  531. package/lib/components/ToggleView/index.js +33 -0
  532. package/lib/components/ToggleView/index.test.js +61 -0
  533. package/lib/components/ToggleView/schema.d.ts +3 -0
  534. package/lib/components/ToggleView/schema.d.ts.map +1 -0
  535. package/lib/components/ToggleView/schema.js +24 -0
  536. package/lib/components/ToggleView/styles.d.ts +6 -0
  537. package/lib/components/ToggleView/styles.d.ts.map +1 -0
  538. package/lib/components/ToggleView/styles.js +23 -0
  539. package/lib/components/ToggleView/types.d.ts +23 -0
  540. package/lib/components/ToggleView/types.d.ts.map +1 -0
  541. package/lib/components/ToggleView/types.js +12 -0
  542. package/lib/components/Tooltip/index.d.ts.map +1 -1
  543. package/lib/components/Tooltip/index.js +3 -13
  544. package/lib/components/Tooltip/schema.d.ts +3 -0
  545. package/lib/components/Tooltip/schema.d.ts.map +1 -0
  546. package/lib/components/Tooltip/schema.js +29 -0
  547. package/lib/components/TopNav/Menu/index.d.ts +1 -1
  548. package/lib/components/TopNav/index.d.ts +1 -1
  549. package/lib/components/Typography/withColors.d.ts +1 -1
  550. package/lib/components/Typography/withColors.d.ts.map +1 -1
  551. package/lib/components/Typography/withColors.js +1 -1
  552. package/lib/components/Wizard/index.d.ts +24 -0
  553. package/lib/components/Wizard/index.d.ts.map +1 -0
  554. package/lib/components/Wizard/index.js +146 -0
  555. package/lib/components/Wizard/index.test.js +591 -0
  556. package/lib/components/Wizard/schema.d.ts +3 -0
  557. package/lib/components/Wizard/schema.d.ts.map +1 -0
  558. package/lib/components/Wizard/schema.js +37 -0
  559. package/lib/components/Wizard/styles.d.ts +990 -0
  560. package/lib/components/Wizard/styles.d.ts.map +1 -0
  561. package/lib/components/Wizard/styles.js +79 -0
  562. package/lib/components/index.d.ts +12 -1
  563. package/lib/components/index.d.ts.map +1 -1
  564. package/lib/components/index.js +205 -1
  565. package/lib/modifiers/palette.d.ts +36 -0
  566. package/lib/modifiers/palette.d.ts.map +1 -0
  567. package/lib/modifiers/palette.js +88 -0
  568. package/lib/modifiers/spacingSchema.d.ts.map +1 -1
  569. package/lib/modifiers/spacingSchema.js +29 -16
  570. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  571. package/lib/providers/ConfigProvider/index.js +5 -1
  572. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  573. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  574. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  575. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  576. package/lib/providers/ConfigProvider/utils/translations.d.ts +42 -0
  577. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  578. package/lib/providers/ConfigProvider/utils/translations.js +43 -1
  579. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  580. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  581. package/lib/providers/NotificationsProvider/index.js +47 -28
  582. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  583. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  584. package/lib/types/index.d.ts +2 -0
  585. package/lib/types/index.d.ts.map +1 -0
  586. package/lib/types/index.js +5 -0
  587. package/lib/utils/commonUIColors.d.ts +350 -2
  588. package/lib/utils/commonUIColors.d.ts.map +1 -1
  589. package/lib/utils/commonUIColors.js +6 -2
  590. package/lib/utils/joinClassnames.d.ts +3 -0
  591. package/lib/utils/joinClassnames.d.ts.map +1 -0
  592. package/lib/utils/joinClassnames.js +26 -0
  593. package/lib/utils/useDebounce.d.ts +2 -0
  594. package/lib/utils/useDebounce.d.ts.map +1 -0
  595. package/lib/utils/useDebounce.js +37 -0
  596. package/lib/utils/useFirstMount.d.ts +2 -0
  597. package/lib/utils/useFirstMount.d.ts.map +1 -0
  598. package/lib/utils/useFirstMount.js +19 -0
  599. package/lib/utils/useStackingContext.d.ts +12 -0
  600. package/lib/utils/useStackingContext.d.ts.map +1 -0
  601. package/lib/utils/useStackingContext.js +46 -0
  602. package/lib/utils/useUpdateEffect.d.ts +4 -0
  603. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  604. package/lib/utils/useUpdateEffect.js +28 -0
  605. package/package.json +2 -2
  606. package/CHANGELOG.md +0 -796
  607. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  608. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
  609. package/lib/atoms/OptionsList/Category.d.ts +0 -4
  610. package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
  611. package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
  612. package/lib/atoms/OptionsList/Option.js +0 -194
  613. package/lib/components/Tabs/Tab.d.ts +0 -5
  614. package/lib/components/Tabs/Tab.d.ts.map +0 -1
  615. package/lib/components/Tabs/Tab.js +0 -109
  616. package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
  617. package/lib/components/Tabs/types.d.ts +0 -27
  618. package/lib/components/Tabs/types.d.ts.map +0 -1
  619. package/lib/components/Tabs/types.js +0 -1
  620. package/lib/components/Tag/ActionButton.d.ts +0 -5
  621. package/lib/components/Tag/ActionButton.d.ts.map +0 -1
  622. package/lib/components/Tag/ActionButton.js +0 -56
  623. /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
@@ -4,14 +4,24 @@ var _react = _interopRequireDefault(require("react"));
4
4
 
5
5
  var _react2 = require("@testing-library/react");
6
6
 
7
+ var _designTokens = require("@decisiv/design-tokens");
8
+
9
+ var _polished = require("polished");
10
+
7
11
  var _ConfigProvider = require("../../providers/ConfigProvider");
8
12
 
9
13
  var _constants = require("./constants");
10
14
 
11
15
  var _ = _interopRequireDefault(require("."));
12
16
 
17
+ var _Combobox = _interopRequireDefault(require("../Combobox"));
18
+
13
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
20
 
21
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
22
+
23
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
24
+
15
25
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
26
 
17
27
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -22,8 +32,24 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
22
32
 
23
33
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
34
 
35
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
36
+
25
37
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
38
 
39
+ // Prevent warnings about missing document methods (createRange, etc.)
40
+ jest.mock('popper.js', function () {
41
+ var _class, _temp;
42
+
43
+ var PopperJS = jest.requireActual('popper.js');
44
+ return _temp = _class = function _class() {
45
+ _classCallCheck(this, _class);
46
+
47
+ return {
48
+ destroy: function destroy() {},
49
+ scheduleUpdate: function scheduleUpdate() {}
50
+ };
51
+ }, _defineProperty(_class, "placements", PopperJS.placements), _temp;
52
+ });
27
53
  beforeAll(function () {
28
54
  var root = document.createElement('div');
29
55
  root.setAttribute('id', 'modal-root');
@@ -180,6 +206,28 @@ describe('Modal', function () {
180
206
  expect(onClose).not.toHaveBeenCalled();
181
207
  });
182
208
  });
209
+ describe('size', function () {
210
+ describe('medium / default', function () {
211
+ it('renders the modal with a max-width of 650px', function () {
212
+ var _render3 = render(_react.default.createElement(_.default, defaultProps)),
213
+ getByRole = _render3.getByRole;
214
+
215
+ var modal = getByRole('dialog');
216
+ expect(modal).toHaveStyle('max-width: 650px');
217
+ });
218
+ });
219
+ describe('large', function () {
220
+ it("renders the modal with a max-width of ".concat((0, _polished.rem)(_designTokens.spacing.base * 90)), function () {
221
+ var _render4 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
222
+ size: "large"
223
+ }))),
224
+ getByRole = _render4.getByRole;
225
+
226
+ var modal = getByRole('dialog');
227
+ expect(modal).toHaveStyle("max-width: ".concat((0, _polished.rem)(_designTokens.spacing.base * 90)));
228
+ });
229
+ });
230
+ });
183
231
  describe('with invalid props', function () {
184
232
  beforeEach(function () {
185
233
  jest.spyOn(console, 'error').mockImplementation(function () {});
@@ -212,4 +260,45 @@ describe('Modal', function () {
212
260
  });
213
261
  });
214
262
  });
263
+ describe('with a Popover as its children', function () {
264
+ it('renders the Popover with the same zIndex', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
265
+ var _render5, getByRole, getByLabelText, modal, combobox, modalZIndex, comboboxOptionsZIndex;
266
+
267
+ return regeneratorRuntime.wrap(function _callee$(_context) {
268
+ while (1) {
269
+ switch (_context.prev = _context.next) {
270
+ case 0:
271
+ _render5 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
272
+ zIndex: 1234
273
+ }), _react.default.createElement(_Combobox.default, {
274
+ label: "Nested Combobox",
275
+ options: [{
276
+ id: '1',
277
+ value: '1',
278
+ label: 'Combobox Opt 1'
279
+ }]
280
+ }))), getByRole = _render5.getByRole, getByLabelText = _render5.getByLabelText;
281
+ modal = getByRole('dialog');
282
+ combobox = getByLabelText('Nested Combobox');
283
+ (0, _react2.act)(function () {
284
+ _react2.fireEvent.click(combobox);
285
+ });
286
+ _context.next = 6;
287
+ return (0, _react2.wait)(function () {
288
+ expect(getByRole('listbox')).toBeInTheDocument();
289
+ });
290
+
291
+ case 6:
292
+ modalZIndex = window.getComputedStyle(modal).zIndex;
293
+ comboboxOptionsZIndex = window.getComputedStyle(getByRole('listbox')).zIndex;
294
+ expect(modalZIndex).toEqual(comboboxOptionsZIndex);
295
+
296
+ case 9:
297
+ case "end":
298
+ return _context.stop();
299
+ }
300
+ }
301
+ }, _callee);
302
+ })));
303
+ });
215
304
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAuDlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA0DlD,eAAe,MAAM,CAAC"}
@@ -17,13 +17,14 @@ schema.propTypes = {
17
17
  actions: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
18
18
  onClick: _reactDesc.PropTypes.func.isRequired,
19
19
  text: _reactDesc.PropTypes.string.isRequired
20
- })).description('An array of objects containing a subset of props valid for the Button. Specifically excluded are `kind`, `size`, and `variant`.'),
20
+ })).description('An array of objects containing a subset of props valid for the Button. Specifically excluded are `size` and `variant`.'),
21
21
  closeHint: _reactDesc.PropTypes.string.description('The text to present in the tooltip when hovering over the close button.'),
22
22
  color: _reactDesc.PropTypes.oneOf(_commonUIColors.commonUIColorKeys).description('The icon color; Will override the default color associated with any specified `intent`.').format('string'),
23
23
  icon: _reactDesc.PropTypes.element.description('Which `iconix` icon to display; Will override the default icon associated with any specified `intent`.'),
24
24
  id: _reactDesc.PropTypes.string.description('A unique identifier for the modal.'),
25
25
  intent: _reactDesc.PropTypes.oneOf(['information', 'success', 'warning', 'danger', 'help']).description('Shortcuts to the most common combinations of icon and color.'),
26
26
  onClose: _reactDesc.PropTypes.func.description('The event handler called to close the modal. If not provided, the modal will not include a close button and closing by clicking outside or pressing the "Esc" key will be disabled.'),
27
+ size: _reactDesc.PropTypes.oneOf(['medium', 'large']).description('Define the max width size of the modal').defaultValue('medium'),
27
28
  title: _reactDesc.PropTypes.string.description('The text for rendering in the H2 at the top of the modal').isRequired,
28
29
  visible: _reactDesc.PropTypes.bool.description('A boolean value used to control whether the modal is visible or not').defaultValue('false'),
29
30
  zIndex: _reactDesc.PropTypes.number.description('Sets the z-index value for the modal & overlay.')
@@ -3,7 +3,7 @@ import { IconProps } from '@decisiv/iconix';
3
3
  import { CommonUIColorKeys } from '../../utils/commonUIColors';
4
4
  import { ButtonProps } from '../Button/types';
5
5
  import { intents } from './constants';
6
- declare type ActionProps = Exclude<ButtonProps, 'kind' | 'size' | 'variant'>;
6
+ declare type ActionProps = Exclude<ButtonProps, 'size' | 'variant'>;
7
7
  export interface ModalProps {
8
8
  actions?: [ActionProps] | [ActionProps, ActionProps];
9
9
  children: React.ReactNode;
@@ -13,6 +13,7 @@ export interface ModalProps {
13
13
  id?: string;
14
14
  intent?: keyof typeof intents;
15
15
  onClose?: (event: React.MouseEvent<unknown> | KeyboardEvent) => void;
16
+ size?: 'medium' | 'large';
16
17
  title: string;
17
18
  visible?: boolean;
18
19
  zIndex?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,aAAK,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAGrE,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,aAAK,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAG5D,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC;IACrE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,4 +1,4 @@
1
1
  export declare function useReturnFocus(returnFocus: boolean): void;
2
2
  export declare function useElement(): [HTMLElement | null, (node: HTMLElement | null) => void];
3
- export declare function useKeepFocusWithin(container: HTMLElement | null): void;
3
+ export declare function useKeepFocusWithin(container: HTMLElement | null, hasCloseButton: boolean): void;
4
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/utils.tsx"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAWzD;AAUD,wBAAgB,UAAU,IAAI,CAC5B,WAAW,GAAG,IAAI,EAClB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CACnC,CAUA;AAoCD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAyDtE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/utils.tsx"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAWzD;AAUD,wBAAgB,UAAU,IAAI,CAC5B,WAAW,GAAG,IAAI,EAClB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CACnC,CAUA;AAoCD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,cAAc,EAAE,OAAO,GACtB,IAAI,CA2DN"}
@@ -95,19 +95,21 @@ function useTabbableElements(container) {
95
95
  */
96
96
 
97
97
 
98
- function useKeepFocusWithin(container) {
98
+ function useKeepFocusWithin(container, hasCloseButton) {
99
99
  var tabbableElements = useTabbableElements(container); // This effect should run only when the container changes from null to an element. Since
100
100
  // the component does not control the tabbable elements and they may be updated, we
101
101
  // don't want to automatically change the focus at any other time.
102
102
 
103
103
  (0, _react.useEffect)(function () {
104
104
  if (container && !(0, _isEmpty.default)(tabbableElements)) {
105
- // The first tabbable element will be the close button, but that isn't where
106
- // the user's focus should start. Instead, get the second tabbable element.
107
- var secondTabbable = (0, _get.default)(tabbableElements, 1, {
105
+ // Determine where to set the initial focus within the modal:
106
+ // - If the modal includes a close button, it will be the first tabbable element. However, user focus should not start there. Instead, move the focus to the second tabbable element.
107
+ // - If there is no close button, set the focus to the first tabbable element.
108
+ var focusElementIndex = hasCloseButton ? 1 : 0;
109
+ var focusElement = (0, _get.default)(tabbableElements, focusElementIndex, {
108
110
  focus: function focus() {}
109
111
  });
110
- secondTabbable.focus();
112
+ focusElement.focus();
111
113
  }
112
114
  }, [container]); // eslint-disable-line react-hooks/exhaustive-deps
113
115
 
@@ -102,9 +102,9 @@ export declare const NotificationCard: import("styled-components").StyledCompone
102
102
  }> & {
103
103
  borderColor: string;
104
104
  }, never>;
105
- export declare const IconColumn: import("styled-components").StyledComponent<"div", any, import("../../Grid/Column/types").default & {
106
- span: string;
107
- }, "span">;
105
+ export declare const IconColumn: import("styled-components").StyledComponent<"div", any, {
106
+ right?: boolean | undefined;
107
+ }, never>;
108
108
  export declare const CloseButton: import("styled-components").StyledComponent<import("react").RefForwardingComponent<HTMLButtonElement, ButtonProps>, any, ButtonProps, never>;
109
109
  export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
110
110
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/components.ts"],"names":[],"mappings":";AAWA,OAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAa5B,CAAC;AAEF,eAAO,MAAM,UAAU;;UAGtB,CAAC;AAEF,eAAO,MAAM,WAAW,8IAEvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEAGjC,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/components.ts"],"names":[],"mappings":";AAWA,OAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAInD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAa5B,CAAC;AAEF,eAAO,MAAM,UAAU;;SAOtB,CAAC;AAEF,eAAO,MAAM,WAAW,8IAEvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEAGjC,CAAC"}
@@ -15,7 +15,7 @@ var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"))
15
15
 
16
16
  var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
17
17
 
18
- var _dynamicModifiers = require("../../../utils/dynamicModifiers");
18
+ var _utils = require("../../../utils");
19
19
 
20
20
  var _skyPlane = _interopRequireDefault(require("../../../utils/skyPlane"));
21
21
 
@@ -23,6 +23,8 @@ var _Grid = _interopRequireDefault(require("../../Grid"));
23
23
 
24
24
  var _Button = _interopRequireDefault(require("../../Button"));
25
25
 
26
+ var _constants = require("../constants");
27
+
26
28
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
27
29
 
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -30,17 +32,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
30
32
  var NotificationCard = (0, _styledComponents.default)(_Grid.default.Container).withConfig({
31
33
  displayName: "components__NotificationCard",
32
34
  componentId: "ds1zkc-0"
33
- })(["background-color:", ";box-shadow:", ";border-radius:2px;width:", ";", ";"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _skyPlane.default)(2), (0, _rem.default)(_spacing.default.base * 34), (0, _dynamicModifiers.applyDynamicModifiers)('borderColor', function (_ref) {
35
+ })(["background-color:", ";box-shadow:", ";border-radius:2px;width:", ";", ";"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _skyPlane.default)(2), _constants.NOTIFICATION_CARD_WIDTH, (0, _utils.applyDynamicModifiers)('borderColor', function (_ref) {
34
36
  var borderColor = _ref.borderColor;
35
37
  return (0, _styledComponents.css)(["border-left:2px solid ", ";"], borderColor);
36
38
  }));
37
39
  exports.NotificationCard = NotificationCard;
38
- var IconColumn = (0, _styledComponents.default)(_Grid.default.Column).attrs({
39
- span: '0'
40
- }).withConfig({
40
+
41
+ var IconColumn = _styledComponents.default.div.withConfig({
41
42
  displayName: "components__IconColumn",
42
43
  componentId: "ds1zkc-1"
43
- })(["top:1px;width:", ";"], (0, _rem.default)(_spacing.default.base * 4));
44
+ })(["padding-left:", ";", ""], (0, _rem.default)(_spacing.default.base), function (_ref2) {
45
+ var _ref2$right = _ref2.right,
46
+ right = _ref2$right === void 0 ? false : _ref2$right;
47
+ return right && (0, _styledComponents.css)(["padding-right:", ";"], (0, _rem.default)(_spacing.default.base));
48
+ });
49
+
44
50
  exports.IconColumn = IconColumn;
45
51
  var CloseButton = (0, _styledComponents.default)(_Button.default).withConfig({
46
52
  displayName: "components__CloseButton",
@@ -1,13 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
2
3
  import { TNotificationProps } from '../../../providers/NotificationsProvider/types';
3
4
  declare function Notification(props: TNotificationProps): JSX.Element;
4
5
  declare namespace Notification {
5
- var propTypes: any;
6
- var defaultProps: {
7
- actions: undefined;
8
- children: null;
9
- icon: undefined;
10
- };
6
+ var propTypes: PropTypes.ValidationMap<TNotificationProps>;
7
+ var defaultProps: Partial<TNotificationProps>;
11
8
  var displayName: string;
12
9
  }
13
10
  export default Notification;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAwBpF,iBAAS,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAiG5D;kBAjGQ,YAAY;;;;;;;;;AAqHrB,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/Notification/index.tsx"],"names":[],"mappings":";AAGA,OAAO,SAA4B,MAAM,YAAY,CAAC;AAMtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAwBpF,iBAAS,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAuG5D;kBAvGQ,YAAY;;;;;AA8HrB,eAAe,YAAY,CAAC"}
@@ -72,6 +72,8 @@ function Notification(props) {
72
72
  _props$intent = props.intent,
73
73
  intent = _props$intent === void 0 ? _constants.intentNames.information : _props$intent,
74
74
  onClose = props.onClose,
75
+ onFocus = props.onFocus,
76
+ onHover = props.onHover,
75
77
  title = props.title;
76
78
  var translate = (0, _useTranslations.default)();
77
79
 
@@ -91,13 +93,15 @@ function Notification(props) {
91
93
  id: id,
92
94
  borderColor: accentColor,
93
95
  margin: 0,
94
- padding: 1.5
95
- }, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_components.IconColumn, {
96
- paddingRight: 0
97
- }, Icon), _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Typography.P, {
96
+ padding: 1.5,
97
+ onFocus: onFocus,
98
+ onMouseOver: onHover
99
+ }, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_components.IconColumn, null, Icon), _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_Grid.default.Column, null, _react.default.createElement(_Typography.P, {
98
100
  shade: 0,
99
101
  weight: "semibold"
100
- }, title)), _react.default.createElement(_components.IconColumn, null, _react.default.createElement(_Tooltip.default, {
102
+ }, title)), onClose && _react.default.createElement(_components.IconColumn, {
103
+ right: true
104
+ }, _react.default.createElement(_Tooltip.default, {
101
105
  target: // eslint-disable-next-line react/jsx-wrap-multilines
102
106
  _react.default.createElement(_components.CloseButton, {
103
107
  "aria-label": translate(closeHint, 'notification.closeHint'),
@@ -120,21 +124,24 @@ function Notification(props) {
120
124
  key: action.text
121
125
  }, _react.default.createElement(_Button.default, _extends({}, (0, _omit.default)(action, ['kind', 'size', 'variant']), actionProps[index])));
122
126
  }))))));
123
- } // @ts-ignore
127
+ }
124
128
 
125
-
126
- Notification.propTypes = _objectSpread({}, _schema.default.propTypes, {
129
+ var propTypes = _objectSpread({}, _schema.default.propTypes, {
127
130
  actions: _proptypeValidators.actionsValidator,
128
- children: _propTypes.default.elementType,
131
+ children: _propTypes.default.node,
129
132
  icon: _propTypes.default.elementType,
130
133
  id: _propTypes.default.string.isRequired,
131
- onClose: _propTypes.default.func.isRequired
134
+ onClose: _propTypes.default.func
132
135
  });
133
- Notification.defaultProps = {
136
+
137
+ var defaultProps = {
134
138
  actions: undefined,
135
139
  children: null,
136
- icon: undefined
140
+ icon: undefined,
141
+ onClose: undefined
137
142
  };
143
+ Notification.propTypes = propTypes;
144
+ Notification.defaultProps = defaultProps;
138
145
  Notification.displayName = 'Notification';
139
146
  var _default = Notification;
140
147
  exports.default = _default;
@@ -6,12 +6,16 @@ var _react2 = require("@testing-library/react");
6
6
 
7
7
  var _constants = require("../../../constants");
8
8
 
9
- var _ConfigProvider = require("../../../providers/ConfigProvider");
9
+ var _providers = require("../../../providers");
10
10
 
11
11
  var _ = _interopRequireDefault(require("."));
12
12
 
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
 
15
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
+
17
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
+
15
19
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
20
 
17
21
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
@@ -20,12 +24,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
20
24
 
21
25
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
26
 
27
+ var wrapper = function wrapper(_ref) {
28
+ var children = _ref.children;
29
+ return _react.default.createElement(_providers.ConfigProvider, null, children);
30
+ };
31
+
23
32
  var render = function render(ui, options) {
24
33
  return (0, _react2.render)(ui, _objectSpread({}, options, {
25
- wrapper: function wrapper(_ref) {
26
- var children = _ref.children;
27
- return _react.default.createElement(_ConfigProvider.ConfigProvider, null, children);
28
- }
34
+ wrapper: wrapper
29
35
  }));
30
36
  };
31
37
 
@@ -60,26 +66,39 @@ describe('Notification', function () {
60
66
 
61
67
  expect(queryByText(defaultProps.title)).toBeTruthy();
62
68
  });
63
- it('renders a close button in the header of the notification', function () {
64
- var onClose = jest.fn();
69
+ describe('when onClose is NOT provided', function () {
70
+ it('does NOT render a close button in the header of the notification', function () {
71
+ var onClose = defaultProps.onClose,
72
+ testProps = _objectWithoutProperties(defaultProps, ["onClose"]);
65
73
 
66
- var _render3 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
67
- onClose: onClose
68
- }))),
69
- queryByLabelText = _render3.queryByLabelText;
74
+ var _render3 = render(_react.default.createElement(_.default, testProps)),
75
+ queryByLabelText = _render3.queryByLabelText;
76
+
77
+ expect(queryByLabelText(/close/i)).not.toBeTruthy();
78
+ });
79
+ });
80
+ describe('when onClose is provided', function () {
81
+ it('renders a close button in the header of the notification', function () {
82
+ var onClose = jest.fn();
83
+
84
+ var _render4 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
85
+ onClose: onClose
86
+ }))),
87
+ queryByLabelText = _render4.queryByLabelText;
70
88
 
71
- var closeButton = queryByLabelText(/close/i);
72
- expect(closeButton).toBeTruthy();
89
+ var closeButton = queryByLabelText(/close/i);
90
+ expect(closeButton).toBeTruthy();
73
91
 
74
- _react2.fireEvent.click(closeButton);
92
+ _react2.fireEvent.click(closeButton);
75
93
 
76
- expect(onClose).toHaveBeenCalled();
94
+ expect(onClose).toHaveBeenCalled();
95
+ });
77
96
  });
78
97
  it('renders the children as the content of the notification', function () {
79
98
  var content = 'Test modal content.';
80
99
 
81
- var _render4 = render(_react.default.createElement(_.default, defaultProps, content)),
82
- queryByText = _render4.queryByText;
100
+ var _render5 = render(_react.default.createElement(_.default, defaultProps, content)),
101
+ queryByText = _render5.queryByText;
83
102
 
84
103
  expect(queryByText(content)).toBeTruthy();
85
104
  });
@@ -94,10 +113,10 @@ describe('Notification', function () {
94
113
  text: 'secondary'
95
114
  }];
96
115
 
97
- var _render5 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
116
+ var _render6 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
98
117
  actions: actions
99
118
  }))),
100
- queryByText = _render5.queryByText;
119
+ queryByText = _render6.queryByText;
101
120
 
102
121
  var primaryActionButton = queryByText(actions[0].text);
103
122
  expect(primaryActionButton).toBeTruthy();
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { TNotifications } from '../../../providers/NotificationsProvider/types';
3
3
  interface TNotificationsContainerProps {
4
+ scroll?: boolean;
4
5
  notifications?: TNotifications;
5
6
  marginTop?: number;
6
7
  zIndex?: number;
7
8
  }
8
- declare function NotificationsPanel({ marginTop, zIndex, }: TNotificationsContainerProps): JSX.Element;
9
+ declare function NotificationsPanel({ marginTop, zIndex, }: TNotificationsContainerProps): JSX.Element | null;
9
10
  export default NotificationsPanel;
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/NotificationsPanel/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,cAAc,EACf,MAAM,gDAAgD,CAAC;AAYxD,UAAU,4BAA4B;IACpC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAsDD,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,MAAM,GACP,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CA4C5C;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notifications/NotificationsPanel/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,cAAc,EACf,MAAM,gDAAgD,CAAC;AAcxD,UAAU,4BAA4B;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4ED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,MAAM,GACP,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA2CnD;AAED,eAAe,kBAAkB,CAAC"}
@@ -37,6 +37,8 @@ var _Notification = _interopRequireDefault(require("../Notification"));
37
37
 
38
38
  var _useNotifications2 = _interopRequireDefault(require("../useNotifications"));
39
39
 
40
+ var _constants = require("../constants");
41
+
40
42
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
41
43
 
42
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -54,16 +56,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
54
56
  var NotificationsContainer = _styledComponents.default.div.withConfig({
55
57
  displayName: "NotificationsPanel__NotificationsContainer",
56
58
  componentId: "sc-1u8dp2k-0"
57
- })(["max-height:100vh;margin-top:", ";overflow-y:auto;padding-bottom:", ";position:fixed;right:", ";top:0;z-index:", ";overflow-x:hidden;", ";"], function (_ref) {
59
+ })(["max-height:", ";margin-bottom:", ";margin-top:", ";overflow-y:hidden;padding-bottom:", ";position:fixed;right:", ";top:0;min-width:calc(1.25rem + ", ");z-index:", ";overflow-x:hidden;scrollbar-width:thin;", ";", ";"], function (_ref) {
58
60
  var _ref$marginTop = _ref.marginTop,
59
61
  marginTop = _ref$marginTop === void 0 ? 0 : _ref$marginTop;
62
+ return "calc(100vh - ".concat((0, _rem.default)(_spacing.default.base * marginTop), ");");
63
+ }, function (_ref2) {
64
+ var _ref2$marginTop = _ref2.marginTop,
65
+ marginTop = _ref2$marginTop === void 0 ? 0 : _ref2$marginTop;
60
66
  return (0, _rem.default)(_spacing.default.base * marginTop);
61
- }, (0, _rem.default)(_spacing.default.base * 0.8), (0, _rem.default)(_spacing.default.base), function (_ref2) {
62
- var _ref2$zIndex = _ref2.zIndex,
63
- zIndex = _ref2$zIndex === void 0 ? 100 : _ref2$zIndex;
64
- return zIndex;
65
67
  }, function (_ref3) {
66
- var notifications = _ref3.notifications;
68
+ var _ref3$marginTop = _ref3.marginTop,
69
+ marginTop = _ref3$marginTop === void 0 ? 0 : _ref3$marginTop;
70
+ return (0, _rem.default)(_spacing.default.base * marginTop);
71
+ }, (0, _rem.default)(_spacing.default.base * 0.8), (0, _rem.default)(_spacing.default.base), _constants.NOTIFICATION_CARD_WIDTH, function (_ref4) {
72
+ var _ref4$zIndex = _ref4.zIndex,
73
+ zIndex = _ref4$zIndex === void 0 ? 100 : _ref4$zIndex;
74
+ return zIndex;
75
+ }, function (_ref5) {
76
+ var scroll = _ref5.scroll,
77
+ _ref5$notifications = _ref5.notifications,
78
+ notifications = _ref5$notifications === void 0 ? [] : _ref5$notifications;
79
+ return scroll && notifications.length > 2 ? "overflow-y: auto;" : "overflow-y: hidden;";
80
+ }, function (_ref6) {
81
+ var notifications = _ref6.notifications;
67
82
  return (0, _isEmpty.default)(notifications) && "width : 0";
68
83
  });
69
84
 
@@ -74,42 +89,46 @@ var FloatingButton = (0, _styledComponents.default)(_Button.default).attrs({
74
89
  componentId: "sc-1u8dp2k-1"
75
90
  })(["box-shadow:", ";&:focus,&:focus:not(:active){border-color:", ";", ";}&:hover,&:hover:not(:active){background-color:", ";color:", ";}"], (0, _skyPlane.default)(2), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _focusRingWithColor.default)((0, _toColorString.default)(_color.default.interaction.pacificOcean40)), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.interaction.pacificOcean.fg));
76
91
 
92
+ var FloatingButtonColumn = _styledComponents.default.div.withConfig({
93
+ displayName: "NotificationsPanel__FloatingButtonColumn",
94
+ componentId: "sc-1u8dp2k-2"
95
+ })(["display:flex;flex:1;height:24px;justify-content:flex-end;padding-left:", ";padding-right:", ";"], (0, _rem.default)(_spacing.default.base), (0, _rem.default)(_spacing.default.base));
96
+
77
97
  var NotificationContainer = _styledComponents.default.div.withConfig({
78
98
  displayName: "NotificationsPanel__NotificationContainer",
79
- componentId: "sc-1u8dp2k-2"
99
+ componentId: "sc-1u8dp2k-3"
80
100
  })(["height:auto;max-height:0;opacity:0;transition:opacity 1s cubic-bezier(0.33,1,0.68,1),max-height 1s cubic-bezier(0.33,1,0.68,1);", ";"], (0, _styledComponentsModifiers.applyStyleModifiers)(_defineProperty({}, _types.NotificationState.DISPLAYING, function () {
81
101
  return (0, _styledComponents.css)(["max-height:100vh;opacity:1;"]);
82
102
  }), 'renderState'));
83
103
 
84
- function NotificationsPanel(_ref4) {
85
- var marginTop = _ref4.marginTop,
86
- zIndex = _ref4.zIndex;
104
+ function NotificationsPanel(_ref7) {
105
+ var marginTop = _ref7.marginTop,
106
+ zIndex = _ref7.zIndex;
87
107
 
88
108
  var _useNotifications = (0, _useNotifications2.default)(),
89
109
  dismissAll = _useNotifications.dismissAll,
110
+ isDismissingAll = _useNotifications.isDismissingAll,
90
111
  notifications = _useNotifications.notifications;
91
112
 
92
113
  var translate = (0, _useTranslations.default)();
93
- return _react.default.createElement(NotificationsContainer, {
114
+ return (0, _isEmpty.default)(notifications) ? null : _react.default.createElement(NotificationsContainer, {
115
+ scroll: !isDismissingAll,
94
116
  marginTop: marginTop,
95
117
  zIndex: zIndex,
96
118
  notifications: notifications
97
119
  }, _react.default.createElement(_Grid.default.Container, null, _react.default.createElement(_Grid.default.Row, {
98
120
  alignment: "end"
99
- }, _react.default.createElement(_Grid.default.Column, {
100
- height: "24px",
101
- span: "0"
102
- }, notifications.length >= 2 && _react.default.createElement(FloatingButton, {
121
+ }, _react.default.createElement(FloatingButtonColumn, null, !isDismissingAll && notifications.length >= 2 && _react.default.createElement(FloatingButton, {
103
122
  onClick: dismissAll,
104
123
  size: "small",
105
124
  text: translate(undefined, 'notifications.dismissAll')
106
- })))), !(0, _isEmpty.default)(notifications) && _react.default.createElement(_Grid.default.Container, null, (notifications || []).map(function (_ref5) {
107
- var _ref6 = _slicedToArray(_ref5, 3),
108
- notificationProps = _ref6[0],
109
- body = _ref6[1],
110
- _ref6$ = _ref6[2],
111
- notificationID = _ref6$.notificationID,
112
- state = _ref6$.state;
125
+ })))), _react.default.createElement(_Grid.default.Container, null, (notifications || []).map(function (_ref8) {
126
+ var _ref9 = _slicedToArray(_ref8, 3),
127
+ notificationProps = _ref9[0],
128
+ body = _ref9[1],
129
+ _ref9$ = _ref9[2],
130
+ notificationID = _ref9$.notificationID,
131
+ state = _ref9$.state;
113
132
 
114
133
  return _react.default.createElement(_Grid.default.Row, {
115
134
  key: notificationID,
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _reactDesc = require("react-desc");
9
9
 
10
- // @ts-ignore no module typings
10
+ // @ts-ignore no module typings for react-desc
11
11
  var schema = (0, _reactDesc.describe)({
12
12
  displayName: 'NotificationsPanel'
13
13
  });