@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,7 +4,7 @@ var _react = _interopRequireDefault(require("react"));
4
4
 
5
5
  var _react2 = require("@testing-library/react");
6
6
 
7
- var _ConfigProvider = require("../../providers/ConfigProvider");
7
+ var _providers = require("../../providers");
8
8
 
9
9
  var _NotificationsPanel = _interopRequireDefault(require("./NotificationsPanel"));
10
10
 
@@ -12,6 +12,10 @@ var _Notifier = _interopRequireDefault(require("./Notifier"));
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 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); } }
16
20
 
17
21
  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); }); }; }
@@ -22,12 +26,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
22
26
 
23
27
  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; }
24
28
 
29
+ var wrapper = function wrapper(_ref) {
30
+ var children = _ref.children;
31
+ return _react.default.createElement(_providers.ConfigProvider, null, _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_NotificationsPanel.default, null), children));
32
+ };
33
+
25
34
  var render = function render(ui, options) {
26
35
  return (0, _react2.render)(ui, _objectSpread({}, options, {
27
- wrapper: function wrapper(_ref) {
28
- var children = _ref.children;
29
- return _react.default.createElement(_ConfigProvider.ConfigProvider, null, _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_NotificationsPanel.default, null), children));
30
- }
36
+ wrapper: wrapper
31
37
  }));
32
38
  };
33
39
 
@@ -70,7 +76,7 @@ describe('Notifier', function () {
70
76
 
71
77
  expect((0, _react2.queryAllByText)(baseElement, defaultProps.title)).toHaveLength(1);
72
78
 
73
- _react2.fireEvent.click((0, _react2.queryByLabelText)(baseElement, /close/gi));
79
+ _react2.fireEvent.click((0, _react2.getByLabelText)(baseElement, /close/gi));
74
80
 
75
81
  _context.next = 7;
76
82
  return (0, _react2.wait)(function () {
@@ -96,18 +102,19 @@ describe('Notifier', function () {
96
102
  });
97
103
  describe('dispatching more than one notification', function () {
98
104
  it('renders a dismiss all button in the notifications panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
99
- var buttonText, _render2, baseElement, getByText;
105
+ var buttonText, onClose, testProps, _render2, baseElement, getByText;
100
106
 
101
107
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
102
108
  while (1) {
103
109
  switch (_context2.prev = _context2.next) {
104
110
  case 0:
105
111
  buttonText = 'notify';
112
+ onClose = defaultProps.onClose, testProps = _objectWithoutProperties(defaultProps, ["onClose"]);
106
113
  _render2 = render(_react.default.createElement(_Notifier.default, null, function (_ref5) {
107
114
  var notify = _ref5.notify;
108
115
  return _react.default.createElement("button", {
109
116
  onClick: function onClick() {
110
- notify(defaultProps);
117
+ notify(testProps);
111
118
  },
112
119
  type: "button"
113
120
  }, buttonText);
@@ -125,7 +132,7 @@ describe('Notifier', function () {
125
132
 
126
133
  _react2.fireEvent.click((0, _react2.getByText)(baseElement, /dismiss all/gi));
127
134
 
128
- _context2.next = 11;
135
+ _context2.next = 12;
129
136
  return (0, _react2.wait)(function () {
130
137
  return expect((0, _react2.queryAllByText)(baseElement, defaultProps.title)).toHaveLength(0);
131
138
  },
@@ -139,12 +146,74 @@ describe('Notifier', function () {
139
146
  timeout: 2750
140
147
  });
141
148
 
142
- case 11:
149
+ case 12:
143
150
  case "end":
144
151
  return _context2.stop();
145
152
  }
146
153
  }
147
154
  }, _callee2);
148
155
  })));
156
+ it('fires onClose for each notification when clicking dismiss all', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
157
+ var buttonText, onClose, _render3, baseElement, getByText, notifications;
158
+
159
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
160
+ while (1) {
161
+ switch (_context3.prev = _context3.next) {
162
+ case 0:
163
+ buttonText = 'notify';
164
+ onClose = jest.fn();
165
+ jest.useFakeTimers();
166
+ _render3 = render(_react.default.createElement(_Notifier.default, null, function (_ref7) {
167
+ var notify = _ref7.notify;
168
+ return _react.default.createElement("button", {
169
+ onClick: function onClick() {
170
+ notify(_objectSpread({}, defaultProps, {
171
+ onClose: onClose
172
+ }));
173
+ },
174
+ type: "button"
175
+ }, buttonText);
176
+ })), baseElement = _render3.baseElement, getByText = _render3.getByText;
177
+ (0, _react2.act)(function () {
178
+ _react2.fireEvent.click(getByText(buttonText));
179
+
180
+ _react2.fireEvent.click(getByText(buttonText));
181
+
182
+ _react2.fireEvent.click(getByText(buttonText));
183
+
184
+ jest.runAllTimers();
185
+ });
186
+ notifications = (0, _react2.queryAllByText)(baseElement, defaultProps.title);
187
+ expect(notifications).toHaveLength(3);
188
+ (0, _react2.act)(function () {
189
+ _react2.fireEvent.click((0, _react2.getByText)(baseElement, /dismiss all/gi));
190
+ });
191
+ _context3.next = 10;
192
+ return (0, _react2.wait)(function () {
193
+ (0, _react2.act)(function () {
194
+ return jest.runAllTimers();
195
+ });
196
+ expect((0, _react2.queryAllByText)(baseElement, defaultProps.title)).toHaveLength(0);
197
+ },
198
+ /**
199
+ * this timeout is important in checking that the notifications were dismissed via
200
+ * `dismissAll` instead of just timing out. If just timing out, the notifications would
201
+ * dismiss after 5.2 seconds. Selecting a timeout shorter than that verifies `dismissAll`
202
+ * was fired.
203
+ */
204
+ {
205
+ timeout: 2750
206
+ });
207
+
208
+ case 10:
209
+ expect(onClose).toHaveBeenCalledTimes(3);
210
+
211
+ case 11:
212
+ case "end":
213
+ return _context3.stop();
214
+ }
215
+ }
216
+ }, _callee3);
217
+ })));
149
218
  });
150
219
  });
@@ -0,0 +1,2 @@
1
+ export declare const NOTIFICATION_CARD_WIDTH: string;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB,QAAyB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NOTIFICATION_CARD_WIDTH = void 0;
7
+
8
+ var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
9
+
10
+ var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ // eslint-disable-next-line import/prefer-default-export
15
+ var NOTIFICATION_CARD_WIDTH = (0, _rem.default)(_spacing.default.base * 34);
16
+ exports.NOTIFICATION_CARD_WIDTH = NOTIFICATION_CARD_WIDTH;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAA4C,CAAC;AAsDzD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAA4C,CAAC;AA0DzD,eAAe,MAAM,CAAC"}
@@ -18,13 +18,14 @@ schema.propTypes = {
18
18
  onClick: _reactDesc.PropTypes.func.isRequired,
19
19
  text: _reactDesc.PropTypes.string.isRequired
20
20
  })).description('An array of objects containing a subset of props valid for the Button. Specifically excluded are `kind`, `size`, and `variant`.').isRequired,
21
+ duration: _reactDesc.PropTypes.number.description('An integer representing the amount of milliseconds to wait until dismissing the notification if no user interaction is captured. If omitted, notification will remain until manually closed.'),
21
22
  children: _reactDesc.PropTypes.func.description('The body of the notification containing additional UI elements').format('React Component'),
22
23
  closeHint: _reactDesc.PropTypes.string.description('The text to present in the tooltip when hovering over the close button.'),
23
24
  color: _reactDesc.PropTypes.oneOf(_commonUIColors.commonUIColorKeys).description('The icon/ border color. Will override the default color associated with any specified `intent`.').format('string'),
24
25
  icon: _reactDesc.PropTypes.element.description('The `iconix` icon to display. Will override the default icon associated with any specified `intent`.').format('Iconix Icon'),
25
26
  id: _reactDesc.PropTypes.string.description('A unique identifier for the notification.'),
26
27
  intent: _reactDesc.PropTypes.oneOf(['information', 'success', 'warning', 'danger']).description('Shortcuts to the most common combinations of icon and color.'),
27
- onClose: _reactDesc.PropTypes.func.description('The event handler called to close the notification. WILL NOT be called if notification times out or is closed because an action button is clicked.'),
28
+ onClose: _reactDesc.PropTypes.func.description('The event handler called when the notification is manually closed. Will also be called with a blank event if "DISMISS ALL" is clicked. WILL NOT be called if notification times out or is closed because an action button is clicked. In IE, will be called with an empty object.'),
28
29
  title: _reactDesc.PropTypes.string.description('The text for rendering in the H2 at the top of the notification').isRequired
29
30
  };
30
31
  var _default = schema;
@@ -1,6 +1,7 @@
1
1
  import { TNotificationsContext } from '../../providers/NotificationsProvider';
2
2
  export interface TUseNotifications {
3
3
  dismissAll: TNotificationsContext['dismissAll'];
4
+ isDismissingAll: TNotificationsContext['isDismissingAll'];
4
5
  notifications: TNotificationsContext['notifications'];
5
6
  notify: TNotificationsContext['notify'];
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/useNotifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAChD,aAAa,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;CACzC;AAED,iBAAS,gBAAgB,IAAI,iBAAiB,CAI7C;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/useNotifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAChD,eAAe,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,aAAa,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;CACzC;AAED,iBAAS,gBAAgB,IAAI,iBAAiB,CAI7C;AAED,eAAe,gBAAgB,CAAC"}
@@ -19,11 +19,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
19
19
  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; }
20
20
 
21
21
  jest.useFakeTimers();
22
+
23
+ var wrapper = function wrapper(_ref) {
24
+ var children = _ref.children;
25
+ return _react.default.createElement(_NotificationsProvider.default, null, _react.default.createElement(_react.default.Fragment, null, children));
26
+ };
27
+
22
28
  var defaultRenderHookOptions = {
23
- wrapper: function wrapper(_ref) {
24
- var children = _ref.children;
25
- return _react.default.createElement(_NotificationsProvider.default, null, _react.default.createElement(_react.default.Fragment, null, children));
26
- }
29
+ wrapper: wrapper
27
30
  };
28
31
  var defaultNotificationOptions = {
29
32
  id: 'test-0',
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { Page, PaginationVariant } from './types';
3
- export interface PagesProps {
4
- variant?: PaginationVariant;
5
- currentPage: number;
6
- totalPages: number;
7
- onPageChange: (page: Page) => void;
8
- }
2
+ import { PagesProps } from './types';
9
3
  export default function Pages({ variant, currentPage, totalPages, onPageChange, }: PagesProps): JSX.Element;
10
4
  //# sourceMappingURL=Pages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pages.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pages.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkBlD,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,WAAW,EACX,UAAU,EACV,YAAY,GACb,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAuB1B"}
1
+ {"version":3,"file":"Pages.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pages.tsx"],"names":[],"mappings":";AAQA,OAAO,EAA2B,UAAU,EAAE,MAAM,SAAS,CAAC;AAoB9D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,WAAW,EACX,UAAU,EACV,YAAY,GACb,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAuC1B"}
@@ -17,6 +17,10 @@ var _PaginationItem = _interopRequireDefault(require("./PaginationItem"));
17
17
 
18
18
  var _paginate = _interopRequireDefault(require("./paginate"));
19
19
 
20
+ var _Typography = require("../Typography");
21
+
22
+ var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
23
+
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
22
26
  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; } }
@@ -37,6 +41,7 @@ function Pages(_ref2) {
37
41
  currentPage = _ref2.currentPage,
38
42
  totalPages = _ref2.totalPages,
39
43
  onPageChange = _ref2.onPageChange;
44
+ var translate = (0, _useTranslations.default)();
40
45
  var pages = (0, _react.useMemo)(function () {
41
46
  return (0, _paginate.default)(currentPage, totalPages);
42
47
  }, [currentPage, totalPages]); // for creating unique keys for the ellipses:
@@ -46,6 +51,18 @@ function Pages(_ref2) {
46
51
  variant: variant
47
52
  }, pages.map(function (page) {
48
53
  var key = page.ellipsis ? "ellipsis-".concat(ellipsisCount += 1) : "page-".concat(page.page);
54
+ var pageText = translate(undefined, 'pagination.page', {
55
+ page: "".concat(page.page)
56
+ }); // if its openEnded
57
+
58
+ if (!totalPages) {
59
+ return _react.default.createElement(_Typography.P, {
60
+ key: key,
61
+ shade: 1,
62
+ size: "small"
63
+ }, pageText);
64
+ }
65
+
49
66
  return _react.default.createElement(_PaginationItem.default, {
50
67
  page: page,
51
68
  key: key,
@@ -1,29 +1,28 @@
1
1
  /// <reference types="react" />
2
2
  import PropTypes from 'prop-types';
3
- import { PaginationVariant } from './types';
4
- interface DefaultPaginationProps {
5
- variant: PaginationVariant;
6
- defaultActivePage?: number;
7
- activePage?: number;
8
- onPageChange?: (newPage: number, oldPage: number) => void;
9
- labelPrevious?: string;
10
- labelNext?: string;
11
- }
12
- export interface PaginationProps extends DefaultPaginationProps {
13
- totalPages: number;
14
- }
3
+ import { PaginationProps } from './types';
15
4
  declare function Pagination(props: PaginationProps): JSX.Element | null;
16
5
  declare namespace Pagination {
17
6
  var propTypes: {
18
7
  variant: PropTypes.Requireable<string>;
8
+ openEnded: PropTypes.Requireable<boolean>;
19
9
  defaultActivePage: PropTypes.Requireable<number>;
20
10
  activePage: PropTypes.Requireable<number>;
21
- totalPages: PropTypes.Validator<number>;
11
+ totalPages: PropTypes.Requireable<number>;
22
12
  onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
23
13
  labelPrevious: PropTypes.Requireable<string>;
24
14
  labelNext: PropTypes.Requireable<string>;
25
15
  };
26
- var defaultProps: DefaultPaginationProps;
16
+ var defaultProps: {
17
+ readonly variant: "comfortable";
18
+ readonly openEnded: false;
19
+ readonly hasNext: false;
20
+ readonly defaultActivePage: 1;
21
+ readonly activePage: undefined;
22
+ readonly onPageChange: undefined;
23
+ readonly labelPrevious: undefined;
24
+ readonly labelNext: undefined;
25
+ };
27
26
  }
28
27
  export default Pagination;
29
28
  //# sourceMappingURL=Pagination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjE,UAAU,sBAAsB;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,iBAAwB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA+E7E;kBA/EuB,UAAU;;;;;;;;;;;;eAAV,UAAU"}
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,OAAO,EAA6B,eAAe,EAAE,MAAM,SAAS,CAAC;AAGrE,iBAAwB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmG7E;kBAnGuB,UAAU;;;;;;;;;;;;;;;;;;;;;;eAAV,UAAU"}
@@ -37,7 +37,6 @@ function Pagination(props) {
37
37
  var variant = props.variant,
38
38
  defaultActivePage = props.defaultActivePage,
39
39
  activePage = props.activePage,
40
- totalPages = props.totalPages,
41
40
  onPageChange = props.onPageChange,
42
41
  labelPrevious = props.labelPrevious,
43
42
  labelNext = props.labelNext;
@@ -49,7 +48,16 @@ function Pagination(props) {
49
48
  currentPage = _useState2[0],
50
49
  setCurrentPage = _useState2[1];
51
50
 
52
- if (totalPages <= 1) return null;
51
+ if (props.openEnded === false && !props.totalPages) {
52
+ // eslint-disable-next-line no-console
53
+ console.warn('totalPages prop must be defined when using a close-ended pagination');
54
+ return null;
55
+ }
56
+
57
+ if (props.openEnded === false && props.totalPages <= 1) {
58
+ return null;
59
+ }
60
+
53
61
  var activePageIsControlled = typeof activePage !== 'undefined';
54
62
 
55
63
  if (activePageIsControlled && activePage !== currentPage) {
@@ -59,9 +67,13 @@ function Pagination(props) {
59
67
  var prevPage = currentPage > 1 ? {
60
68
  page: currentPage - 1
61
69
  } : undefined;
62
- var nextPage = currentPage < totalPages ? {
70
+ var openEndedNextPage = props.openEnded && props.hasNext ? {
71
+ page: currentPage + 1
72
+ } : undefined;
73
+ var fixedpaginationNextPage = props.openEnded === false && currentPage < props.totalPages ? {
63
74
  page: currentPage + 1
64
75
  } : undefined;
76
+ var nextPage = props.openEnded ? openEndedNextPage : fixedpaginationNextPage;
65
77
  var prevButtonAriaLabel = prevPage ? translate(labelPrevious, 'pagination.aria.previous', {
66
78
  page: "".concat(prevPage.page)
67
79
  }) : undefined;
@@ -94,7 +106,7 @@ function Pagination(props) {
94
106
  }), _react.default.createElement(_Pages.default, {
95
107
  variant: variant,
96
108
  currentPage: currentPage,
97
- totalPages: totalPages,
109
+ totalPages: props.openEnded ? undefined : props.totalPages,
98
110
  onPageChange: pageChangeHandler
99
111
  }), _react.default.createElement(_NextPrevButton.default, {
100
112
  variant: variant,
@@ -109,15 +121,18 @@ function Pagination(props) {
109
121
 
110
122
  Pagination.propTypes = {
111
123
  variant: _propTypes.default.oneOf(['comfortable', 'compact']),
124
+ openEnded: _propTypes.default.bool,
112
125
  defaultActivePage: _propTypes.default.number,
113
126
  activePage: _propTypes.default.number,
114
- totalPages: _propTypes.default.number.isRequired,
127
+ totalPages: _propTypes.default.number,
115
128
  onPageChange: _propTypes.default.func,
116
129
  labelPrevious: _propTypes.default.string,
117
130
  labelNext: _propTypes.default.string
118
131
  };
119
132
  var defaultProps = {
120
133
  variant: 'comfortable',
134
+ openEnded: false,
135
+ hasNext: false,
121
136
  defaultActivePage: 1,
122
137
  activePage: undefined,
123
138
  onPageChange: undefined,
@@ -254,4 +254,18 @@ describe('Pagination', function () {
254
254
 
255
255
  expect(container).toBeEmpty();
256
256
  });
257
+ it('shows warning when totalPages is not defined and its not openEnded', function () {
258
+ jest.spyOn(console, 'warn').mockImplementation(function () {});
259
+
260
+ var _renderPagination18 = renderPagination(_objectSpread({}, defaultProps, {
261
+ openEnded: false,
262
+ totalPages: undefined
263
+ })),
264
+ container = _renderPagination18.container;
265
+
266
+ expect(container).toBeEmpty();
267
+ expect(console.warn).toHaveBeenCalled(); // @ts-ignore
268
+
269
+ console.warn.mockRestore();
270
+ });
257
271
  });
@@ -1,3 +1,3 @@
1
1
  import { Page } from './types';
2
- export default function paginate(currentPage: number, totalPages: number): Page[];
2
+ export default function paginate(currentPage: number, totalPages?: number): Page[];
3
3
  //# sourceMappingURL=paginate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paginate.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/paginate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA4C/B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,IAAI,EAAE,CA4CR"}
1
+ {"version":3,"file":"paginate.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/paginate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA4C/B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,EAAE,CAgDR"}
@@ -74,6 +74,10 @@ function paginate(currentPage, totalPages) {
74
74
  };
75
75
  };
76
76
 
77
+ if (!totalPages) {
78
+ return [currentPage].map(pageMaker);
79
+ }
80
+
77
81
  if (totalPages <= PAGE_SLOTS) {
78
82
  // no ellipses needed
79
83
  return (0, _range.default)(1, totalPages + 1).map(pageMaker);
@@ -42,10 +42,11 @@ var countEllipses = function countEllipses(pages) {
42
42
  };
43
43
 
44
44
  describe('paginate', function () {
45
- describe('with 7 or less pages', function () {
45
+ // open ended pagination case
46
+ describe('with no total pages', function () {
46
47
  it('does not include any ellipses', function () {
47
48
  testAllPages({
48
- maxTotal: 7
49
+ maxTotal: 1
49
50
  }, function (_ref2) {
50
51
  var pages = _ref2.pages;
51
52
  pages.forEach(function (page) {
@@ -53,20 +54,40 @@ describe('paginate', function () {
53
54
  });
54
55
  });
55
56
  });
56
- it('renders only as many items as there are pages', function () {
57
+ it('only renders the current page', function () {
58
+ var result = (0, _paginate.default)(1, undefined);
59
+ expect(result).toEqual([{
60
+ active: true,
61
+ page: 1,
62
+ ellipsis: false
63
+ }]);
64
+ });
65
+ });
66
+ describe('with 7 or less pages', function () {
67
+ it('does not include any ellipses', function () {
57
68
  testAllPages({
58
69
  maxTotal: 7
59
70
  }, function (_ref3) {
60
- var totalPages = _ref3.totalPages,
61
- pages = _ref3.pages;
71
+ var pages = _ref3.pages;
72
+ pages.forEach(function (page) {
73
+ expect(page.ellipsis).toEqual(false);
74
+ });
75
+ });
76
+ });
77
+ it('renders only as many items as there are pages', function () {
78
+ testAllPages({
79
+ maxTotal: 7
80
+ }, function (_ref4) {
81
+ var totalPages = _ref4.totalPages,
82
+ pages = _ref4.pages;
62
83
  expect(pages.length).toEqual(totalPages);
63
84
  });
64
85
  });
65
86
  });
66
87
  describe('with 8 or more pages', function () {
67
- function sharedTests(_ref4) {
68
- var pages = _ref4.pages,
69
- currentPage = _ref4.currentPage;
88
+ function sharedTests(_ref5) {
89
+ var pages = _ref5.pages,
90
+ currentPage = _ref5.currentPage;
70
91
  it('renders 7 items', function () {
71
92
  expect(pages).toHaveLength(7);
72
93
  });
@@ -88,9 +109,9 @@ describe('paginate', function () {
88
109
  lastCurrent: 4,
89
110
  minTotal: totalPages,
90
111
  maxTotal: totalPages
91
- }, function (_ref5) {
92
- var currentPage = _ref5.currentPage,
93
- pages = _ref5.pages;
112
+ }, function (_ref6) {
113
+ var currentPage = _ref6.currentPage,
114
+ pages = _ref6.pages;
94
115
  describe("when on page ".concat(currentPage), function () {
95
116
  it("has one ellipsis at the end", function () {
96
117
  expect(countEllipses(pages)).toEqual(1);
@@ -112,9 +133,9 @@ describe('paginate', function () {
112
133
  lastCurrent: rightBound - 1,
113
134
  minTotal: totalPages,
114
135
  maxTotal: totalPages
115
- }, function (_ref6) {
116
- var currentPage = _ref6.currentPage,
117
- pages = _ref6.pages;
136
+ }, function (_ref7) {
137
+ var currentPage = _ref7.currentPage,
138
+ pages = _ref7.pages;
118
139
  describe("when on page ".concat(currentPage), function () {
119
140
  it("has two ellipses", function () {
120
141
  expect(countEllipses(pages)).toEqual(2);
@@ -136,9 +157,9 @@ describe('paginate', function () {
136
157
  firstCurrent: rightBound,
137
158
  minTotal: totalPages,
138
159
  maxTotal: totalPages
139
- }, function (_ref7) {
140
- var currentPage = _ref7.currentPage,
141
- pages = _ref7.pages;
160
+ }, function (_ref8) {
161
+ var currentPage = _ref8.currentPage,
162
+ pages = _ref8.pages;
142
163
  describe("when on page ".concat(currentPage), function () {
143
164
  it("has one ellipsis at the start", function () {
144
165
  expect(countEllipses(pages)).toEqual(1);
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA0C,CAAC;AA0BvD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA0C,CAAC;AAoCvD,eAAe,MAAM,CAAC"}
@@ -15,7 +15,9 @@ schema.propTypes = {
15
15
  variant: _reactDesc.PropTypes.oneOf(['comfortable', 'compact']).description('Controls the padding size of the component').defaultValue('comfortable'),
16
16
  defaultActivePage: _reactDesc.PropTypes.number.description('When uncontrolled, specifies the default initially-active page').defaultValue('1'),
17
17
  activePage: _reactDesc.PropTypes.number.description('Sets the currently-active page. If specified, the component is "controlled".'),
18
- totalPages: _reactDesc.PropTypes.number.isRequired.description('Sets the total number of pages'),
18
+ openEnded: _reactDesc.PropTypes.bool.description('Define if this is an open-ended pagination. Use hasNext to enable the next button').defaultValue('false'),
19
+ hasNext: _reactDesc.PropTypes.bool.description('Use with `openEnded` prop to define if the Next button is enabled').defaultValue('false'),
20
+ totalPages: _reactDesc.PropTypes.number.description('Sets the total number of pages. This is required when using a fixed pagination'),
19
21
  onPageChange: _reactDesc.PropTypes.func.description('A function called with two arguments (the newly-active page and the previously-active page) whenever the active page changes'),
20
22
  labelPrevious: _reactDesc.PropTypes.string.description('Override the "Previous" button label'),
21
23
  labelNext: _reactDesc.PropTypes.string.description('Override the "Next" button label')
@@ -1,8 +1,31 @@
1
1
  export declare type PaginationVariant = 'comfortable' | 'compact';
2
2
  export interface Page {
3
- active?: boolean;
4
3
  page?: number;
4
+ active?: boolean;
5
5
  ellipsis?: boolean;
6
6
  }
7
+ export interface DefaultPaginationProps {
8
+ variant: PaginationVariant;
9
+ defaultActivePage?: number;
10
+ activePage?: number;
11
+ onPageChange?: (newPage: number, oldPage: number) => void;
12
+ labelPrevious?: string;
13
+ labelNext?: string;
14
+ }
15
+ declare type OpenEndedPaginationProps = {
16
+ openEnded: true;
17
+ hasNext: boolean;
18
+ } & DefaultPaginationProps;
19
+ declare type CloseEndedPaginationProps = {
20
+ openEnded: false;
21
+ totalPages: number;
22
+ } & DefaultPaginationProps;
23
+ export declare type PaginationProps = CloseEndedPaginationProps | OpenEndedPaginationProps;
24
+ export declare type PagesProps = {
25
+ currentPage: number;
26
+ totalPages?: CloseEndedPaginationProps['totalPages'];
27
+ onPageChange: (page: Page) => void;
28
+ } & Pick<PaginationProps, 'variant' | 'activePage'>;
7
29
  export declare type PageChangeHandlerFn = (page: Page) => void;
30
+ export {};
8
31
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,IAAI;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,aAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,sBAAsB,CAAC;AAE3B,aAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,sBAAsB,CAAC;AAE3B,oBAAY,eAAe,GACvB,yBAAyB,GACzB,wBAAwB,CAAC;AAE7B,oBAAY,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACrD,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;AAEpD,oBAAY,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC"}
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });