@decisiv/ui-components 2.0.1-alpha.20 → 2.0.1-alpha.201

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 (555) 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 +2 -1
  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 +27 -9
  32. package/lib/atoms/InputField/index.test.js +91 -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 +169 -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 +83 -0
  47. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  48. package/lib/atoms/OptionsList/index.js +16 -7
  49. package/lib/atoms/OptionsList/index.test.js +249 -156
  50. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  51. package/lib/atoms/OptionsList/schema.js +3 -1
  52. package/lib/atoms/OptionsList/types.d.ts +23 -0
  53. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  54. package/lib/atoms/OptionsList/types.js +5 -1
  55. package/lib/atoms/RequiredIcon.d.ts +9 -0
  56. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  57. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  58. package/lib/components/Accordion/types.js +5 -1
  59. package/lib/components/Accordion/useAccordion/types.js +5 -1
  60. package/lib/components/Alert/Container.d.ts +201 -0
  61. package/lib/components/Alert/Container.d.ts.map +1 -0
  62. package/lib/components/Alert/Container.js +26 -0
  63. package/lib/components/Alert/StyledButton.d.ts +5 -0
  64. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  65. package/lib/components/Alert/StyledButton.js +23 -0
  66. package/lib/components/Alert/index.d.ts +27 -0
  67. package/lib/components/Alert/index.d.ts.map +1 -0
  68. package/lib/components/Alert/index.js +112 -0
  69. package/lib/components/Alert/index.test.js +79 -0
  70. package/lib/components/Alert/intents.d.ts +13 -0
  71. package/lib/components/Alert/intents.d.ts.map +1 -0
  72. package/lib/components/Alert/intents.js +72 -0
  73. package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
  74. package/lib/components/Alert/schema.d.ts.map +1 -0
  75. package/lib/components/Alert/schema.js +25 -0
  76. package/lib/components/Alert/types.d.ts +36 -0
  77. package/lib/components/Alert/types.d.ts.map +1 -0
  78. package/lib/components/Alert/types.js +32 -0
  79. package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
  80. package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
  81. package/lib/components/Avatar/AvatarContainer.js +12 -13
  82. package/lib/components/Avatar/AvatarContent.d.ts +2 -2
  83. package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
  84. package/lib/components/Avatar/AvatarContent.js +24 -20
  85. package/lib/components/Avatar/index.d.ts.map +1 -1
  86. package/lib/components/Avatar/index.js +39 -5
  87. package/lib/components/Avatar/index.test.js +4 -0
  88. package/lib/components/Avatar/schema.d.ts.map +1 -1
  89. package/lib/components/Avatar/schema.js +3 -1
  90. package/lib/components/Avatar/types.d.ts +15 -2
  91. package/lib/components/Avatar/types.d.ts.map +1 -1
  92. package/lib/components/Avatar/types.js +5 -1
  93. package/lib/components/Badge/constants.d.ts +2 -0
  94. package/lib/components/Badge/constants.d.ts.map +1 -0
  95. package/lib/components/Badge/constants.js +29 -0
  96. package/lib/components/Badge/index.d.ts.map +1 -1
  97. package/lib/components/Badge/index.js +3 -70
  98. package/lib/components/Badge/index.test.js +62 -8
  99. package/lib/components/Badge/schema.d.ts.map +1 -1
  100. package/lib/components/Badge/schema.js +2 -1
  101. package/lib/components/Badge/styles.d.ts +3 -0
  102. package/lib/components/Badge/styles.d.ts.map +1 -0
  103. package/lib/components/Badge/styles.js +96 -0
  104. package/lib/components/Badge/types.d.ts +3 -2
  105. package/lib/components/Badge/types.d.ts.map +1 -1
  106. package/lib/components/Badge/types.js +7 -3
  107. package/lib/components/Breadcrumbs/types.js +5 -1
  108. package/lib/components/Button/StyledButton.d.ts +3 -6
  109. package/lib/components/Button/StyledButton.d.ts.map +1 -1
  110. package/lib/components/Button/StyledButton.js +39 -11
  111. package/lib/components/Button/index.d.ts.map +1 -1
  112. package/lib/components/Button/index.js +51 -12
  113. package/lib/components/Button/index.test.js +43 -8
  114. package/lib/components/Button/schema.d.ts.map +1 -1
  115. package/lib/components/Button/schema.js +4 -1
  116. package/lib/components/Button/types.d.ts +4 -1
  117. package/lib/components/Button/types.d.ts.map +1 -1
  118. package/lib/components/Button/types.js +5 -1
  119. package/lib/components/Checkbox/index.d.ts.map +1 -1
  120. package/lib/components/Checkbox/index.js +3 -1
  121. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  122. package/lib/components/Checkbox/schema.js +2 -0
  123. package/lib/components/CheckboxGroup/index.d.ts +1 -1
  124. package/lib/components/Combobox/Target.d.ts.map +1 -1
  125. package/lib/components/Combobox/Target.js +52 -14
  126. package/lib/components/Combobox/index.d.ts.map +1 -1
  127. package/lib/components/Combobox/index.js +217 -85
  128. package/lib/components/Combobox/index.test.js +370 -147
  129. package/lib/components/Combobox/schema.d.ts.map +1 -1
  130. package/lib/components/Combobox/schema.js +10 -2
  131. package/lib/components/Combobox/types.d.ts +12 -3
  132. package/lib/components/Combobox/types.d.ts.map +1 -1
  133. package/lib/components/Combobox/types.js +5 -1
  134. package/lib/components/Drawer/index.d.ts +22 -0
  135. package/lib/components/Drawer/index.d.ts.map +1 -0
  136. package/lib/components/Drawer/index.js +115 -0
  137. package/lib/components/Drawer/index.test.js +139 -0
  138. package/lib/components/Drawer/schema.d.ts +3 -0
  139. package/lib/components/Drawer/schema.d.ts.map +1 -0
  140. package/lib/components/Drawer/schema.js +32 -0
  141. package/lib/components/Drawer/styles.d.ts +11 -0
  142. package/lib/components/Drawer/styles.d.ts.map +1 -0
  143. package/lib/components/Drawer/styles.js +79 -0
  144. package/lib/components/DropdownList/index.d.ts +1 -0
  145. package/lib/components/DropdownList/index.d.ts.map +1 -1
  146. package/lib/components/DropdownList/index.js +70 -22
  147. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  148. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  149. package/lib/components/DropdownList/propTypes.js +42 -0
  150. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  151. package/lib/components/DropdownList/schema.js +2 -1
  152. package/lib/components/DropdownList/types.d.ts +2 -0
  153. package/lib/components/DropdownList/types.d.ts.map +1 -1
  154. package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
  155. package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
  156. package/lib/components/Filter/ActionFilter/index.js +43 -0
  157. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  158. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  159. package/lib/components/Filter/IconWrapper/index.js +35 -0
  160. package/lib/components/Filter/SimplePrimary/index.d.ts +5 -0
  161. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  162. package/lib/components/Filter/SimplePrimary/index.js +46 -0
  163. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  164. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  165. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  166. package/lib/components/Filter/StyledFilter.js +66 -0
  167. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  168. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  169. package/lib/components/Filter/StyledLabel/index.js +38 -0
  170. package/lib/components/Filter/index.d.ts +6 -0
  171. package/lib/components/Filter/index.d.ts.map +1 -0
  172. package/lib/components/Filter/index.js +107 -0
  173. package/lib/components/Filter/index.test.js +70 -0
  174. package/lib/components/Filter/kind.d.ts +7 -0
  175. package/lib/components/Filter/kind.d.ts.map +1 -0
  176. package/lib/components/Filter/kind.js +43 -0
  177. package/lib/components/Filter/schema.d.ts +9 -0
  178. package/lib/components/Filter/schema.d.ts.map +1 -0
  179. package/lib/components/Filter/schema.js +37 -0
  180. package/lib/components/Filter/types.d.ts +31 -0
  181. package/lib/components/Filter/types.d.ts.map +1 -0
  182. package/lib/components/Filter/types.js +5 -0
  183. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  184. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  185. package/lib/components/JumpTo/JumpToMenu.js +53 -12
  186. package/lib/components/JumpTo/index.test.js +84 -0
  187. package/lib/components/JumpTo/schema.d.ts.map +1 -1
  188. package/lib/components/JumpTo/schema.js +2 -1
  189. package/lib/components/JumpTo/types.d.ts +1 -0
  190. package/lib/components/JumpTo/types.d.ts.map +1 -1
  191. package/lib/components/JumpTo/types.js +5 -1
  192. package/lib/components/JumpTo/utils.d.ts.map +1 -1
  193. package/lib/components/JumpTo/utils.js +3 -7
  194. package/lib/components/LeftNav/Item/ClickArea.js +1 -1
  195. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  196. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -1
  197. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  198. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  199. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  200. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  201. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  202. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  203. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  204. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  205. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  206. package/lib/components/LeftNav/Item/types.js +5 -1
  207. package/lib/components/LeftNav/index.test.js +13 -3
  208. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  209. package/lib/components/LeftNav/schema.js +2 -0
  210. package/lib/components/LeftNav/types.d.ts +1 -0
  211. package/lib/components/LeftNav/types.d.ts.map +1 -1
  212. package/lib/components/LeftNav/types.js +5 -1
  213. package/lib/components/Link/DisabledLink.d.ts +7 -0
  214. package/lib/components/Link/DisabledLink.d.ts.map +1 -0
  215. package/lib/components/Link/DisabledLink.js +46 -0
  216. package/lib/components/Link/Link.d.ts +4 -0
  217. package/lib/components/Link/Link.d.ts.map +1 -0
  218. package/lib/components/Link/Link.js +67 -0
  219. package/lib/components/Link/index.d.ts +4 -23
  220. package/lib/components/Link/index.d.ts.map +1 -1
  221. package/lib/components/Link/index.js +20 -158
  222. package/lib/components/Link/index.test.js +63 -42
  223. package/lib/components/Link/schema.d.ts.map +1 -1
  224. package/lib/components/Link/schema.js +2 -1
  225. package/lib/components/Link/styles.d.ts +20 -0
  226. package/lib/components/Link/styles.d.ts.map +1 -0
  227. package/lib/components/Link/styles.js +131 -0
  228. package/lib/components/Link/types.d.ts +28 -0
  229. package/lib/components/Link/types.d.ts.map +1 -0
  230. package/lib/components/Link/types.js +5 -0
  231. package/lib/components/Loading/Loading.d.ts +12 -0
  232. package/lib/components/Loading/Loading.d.ts.map +1 -0
  233. package/lib/components/Loading/Loading.js +70 -0
  234. package/lib/components/Loading/index.d.ts +4 -0
  235. package/lib/components/Loading/index.d.ts.map +1 -0
  236. package/lib/components/Loading/index.js +33 -0
  237. package/lib/components/Loading/index.test.js +55 -0
  238. package/lib/components/Loading/schema.d.ts +4 -0
  239. package/lib/components/Loading/schema.d.ts.map +1 -0
  240. package/lib/components/Loading/schema.js +31 -0
  241. package/lib/components/Loading/styles.d.ts +211 -0
  242. package/lib/components/Loading/styles.d.ts.map +1 -0
  243. package/lib/components/Loading/styles.js +77 -0
  244. package/lib/components/Loading/types.d.ts +10 -0
  245. package/lib/components/Loading/types.d.ts.map +1 -0
  246. package/lib/components/Loading/types.js +5 -0
  247. package/lib/components/Menu/types.js +5 -1
  248. package/lib/components/Modal/Manager.d.ts +6 -0
  249. package/lib/components/Modal/Manager.d.ts.map +1 -0
  250. package/lib/components/Modal/Manager.js +53 -0
  251. package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
  252. package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
  253. package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
  254. package/lib/components/Modal/components.d.ts +201 -3
  255. package/lib/components/Modal/components.d.ts.map +1 -1
  256. package/lib/components/Modal/components.js +16 -24
  257. package/lib/components/Modal/index.d.ts +8 -4
  258. package/lib/components/Modal/index.d.ts.map +1 -1
  259. package/lib/components/Modal/index.js +56 -95
  260. package/lib/components/Modal/index.test.js +26 -0
  261. package/lib/components/Modal/schema.d.ts.map +1 -1
  262. package/lib/components/Modal/schema.js +2 -1
  263. package/lib/components/Modal/types.d.ts +2 -1
  264. package/lib/components/Modal/types.d.ts.map +1 -1
  265. package/lib/components/Modal/types.js +5 -1
  266. package/lib/components/Modal/utils.d.ts +1 -1
  267. package/lib/components/Modal/utils.d.ts.map +1 -1
  268. package/lib/components/Modal/utils.js +7 -5
  269. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  270. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  271. package/lib/components/Notifications/Notification/components.js +12 -6
  272. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  273. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  274. package/lib/components/Notifications/Notification/index.js +19 -12
  275. package/lib/components/Notifications/Notification/index.test.js +38 -19
  276. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  277. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  278. package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
  279. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  280. package/lib/components/Notifications/Notifier.test.js +79 -10
  281. package/lib/components/Notifications/constants.d.ts +2 -0
  282. package/lib/components/Notifications/constants.d.ts.map +1 -0
  283. package/lib/components/Notifications/constants.js +16 -0
  284. package/lib/components/Notifications/schema.d.ts.map +1 -1
  285. package/lib/components/Notifications/schema.js +2 -1
  286. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  287. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  288. package/lib/components/Notifications/useNotifications.test.js +7 -4
  289. package/lib/components/Pagination/Pagination.d.ts +1 -1
  290. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  291. package/lib/components/Pagination/Pagination.js +1 -0
  292. package/lib/components/Pagination/Pagination.test.js +9 -0
  293. package/lib/components/Pagination/types.js +5 -1
  294. package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
  295. package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
  296. package/lib/components/PasswordField/IconWrapper.js +32 -0
  297. package/lib/components/PasswordField/Input.d.ts +6 -0
  298. package/lib/components/PasswordField/Input.d.ts.map +1 -0
  299. package/lib/components/PasswordField/Input.js +28 -0
  300. package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
  301. package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
  302. package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
  303. package/lib/components/PasswordField/index.d.ts +14 -0
  304. package/lib/components/PasswordField/index.d.ts.map +1 -0
  305. package/lib/components/PasswordField/index.js +113 -0
  306. package/lib/components/PasswordField/index.test.js +217 -0
  307. package/lib/components/PasswordField/schema.d.ts +3 -0
  308. package/lib/components/PasswordField/schema.d.ts.map +1 -0
  309. package/lib/components/PasswordField/schema.js +27 -0
  310. package/lib/components/Popover/Arrow.d.ts +2 -2
  311. package/lib/components/Popover/index.d.ts.map +1 -1
  312. package/lib/components/Popover/index.js +9 -5
  313. package/lib/components/Popover/schema.d.ts.map +1 -1
  314. package/lib/components/Popover/schema.js +27 -20
  315. package/lib/components/Popover/types.d.ts +4 -2
  316. package/lib/components/Popover/types.d.ts.map +1 -1
  317. package/lib/components/Popover/utils.d.ts +1 -1
  318. package/lib/components/SearchInput/index.d.ts +11 -0
  319. package/lib/components/SearchInput/index.d.ts.map +1 -0
  320. package/lib/components/SearchInput/index.js +176 -0
  321. package/lib/components/SearchInput/index.test.js +660 -0
  322. package/lib/components/SearchInput/schema.d.ts +3 -0
  323. package/lib/components/SearchInput/schema.d.ts.map +1 -0
  324. package/lib/components/SearchInput/schema.js +37 -0
  325. package/lib/components/SearchInput/styles.d.ts +1176 -0
  326. package/lib/components/SearchInput/styles.d.ts.map +1 -0
  327. package/lib/components/SearchInput/styles.js +97 -0
  328. package/lib/components/SearchInput/types.d.ts +38 -0
  329. package/lib/components/SearchInput/types.d.ts.map +1 -0
  330. package/lib/components/SearchInput/types.js +5 -0
  331. package/lib/components/Select/Target.d.ts.map +1 -1
  332. package/lib/components/Select/Target.js +6 -2
  333. package/lib/components/Select/index.d.ts.map +1 -1
  334. package/lib/components/Select/index.js +26 -3
  335. package/lib/components/Select/index.test.js +106 -23
  336. package/lib/components/Select/schema.d.ts.map +1 -1
  337. package/lib/components/Select/schema.js +5 -0
  338. package/lib/components/Select/types.d.ts +6 -3
  339. package/lib/components/Select/types.d.ts.map +1 -1
  340. package/lib/components/Select/types.js +5 -1
  341. package/lib/components/SelectDate/Target.d.ts.map +1 -1
  342. package/lib/components/SelectDate/Target.js +6 -2
  343. package/lib/components/SelectDate/index.d.ts.map +1 -1
  344. package/lib/components/SelectDate/index.js +32 -3
  345. package/lib/components/SelectDate/index.test.js +108 -51
  346. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  347. package/lib/components/SelectDate/schema.js +3 -0
  348. package/lib/components/SelectDate/types.d.ts +3 -0
  349. package/lib/components/SelectDate/types.d.ts.map +1 -1
  350. package/lib/components/SelectDate/types.js +5 -1
  351. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  352. package/lib/components/SelectDateRange/index.js +31 -2
  353. package/lib/components/SelectDateRange/index.test.js +115 -58
  354. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  355. package/lib/components/SelectDateRange/schema.js +3 -0
  356. package/lib/components/SelectDateRange/types.js +5 -1
  357. package/lib/components/StepTracker/index.d.ts +11 -0
  358. package/lib/components/StepTracker/index.d.ts.map +1 -0
  359. package/lib/components/StepTracker/index.js +56 -0
  360. package/lib/components/StepTracker/index.test.js +89 -0
  361. package/lib/components/StepTracker/schema.d.ts +3 -0
  362. package/lib/components/StepTracker/schema.d.ts.map +1 -0
  363. package/lib/components/StepTracker/schema.js +19 -0
  364. package/lib/components/StepTracker/styles.d.ts +605 -0
  365. package/lib/components/StepTracker/styles.d.ts.map +1 -0
  366. package/lib/components/StepTracker/styles.js +114 -0
  367. package/lib/components/Table/Body.d.ts.map +1 -1
  368. package/lib/components/Table/Body.js +28 -17
  369. package/lib/components/Table/Container.d.ts.map +1 -1
  370. package/lib/components/Table/Container.js +6 -1
  371. package/lib/components/Table/DataRow.d.ts.map +1 -1
  372. package/lib/components/Table/DataRow.js +26 -18
  373. package/lib/components/Table/Head.d.ts +1 -1
  374. package/lib/components/Table/Head.d.ts.map +1 -1
  375. package/lib/components/Table/Head.js +10 -5
  376. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  377. package/lib/components/Table/HeaderCell/index.js +19 -6
  378. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  379. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  380. package/lib/components/Table/HeaderCell/types.js +5 -1
  381. package/lib/components/Table/Provider.d.ts +5 -5
  382. package/lib/components/Table/Provider.d.ts.map +1 -1
  383. package/lib/components/Table/Provider.js +10 -11
  384. package/lib/components/Table/index.d.ts.map +1 -1
  385. package/lib/components/Table/index.js +110 -20
  386. package/lib/components/Table/index.test.js +80 -33
  387. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  388. package/lib/components/Table/schema.columns.js +6 -4
  389. package/lib/components/Table/schema.d.ts.map +1 -1
  390. package/lib/components/Table/schema.js +7 -6
  391. package/lib/components/Table/types.d.ts +19 -4
  392. package/lib/components/Table/types.d.ts.map +1 -1
  393. package/lib/components/Table/utils.d.ts +2 -8
  394. package/lib/components/Table/utils.d.ts.map +1 -1
  395. package/lib/components/Table/utils.js +21 -20
  396. package/lib/components/Tabs/Tab/index.d.ts +13 -0
  397. package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
  398. package/lib/components/Tabs/Tab/index.js +94 -0
  399. package/lib/components/Tabs/Tab/schema.d.ts +3 -0
  400. package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
  401. package/lib/components/Tabs/Tab/styles.d.ts +7 -0
  402. package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
  403. package/lib/components/Tabs/Tab/styles.js +37 -0
  404. package/lib/components/Tabs/context.d.ts +2 -2
  405. package/lib/components/Tabs/context.d.ts.map +1 -1
  406. package/lib/components/Tabs/context.js +1 -1
  407. package/lib/components/Tabs/index.d.ts +17 -6
  408. package/lib/components/Tabs/index.d.ts.map +1 -1
  409. package/lib/components/Tabs/index.js +104 -163
  410. package/lib/components/Tabs/index.test.js +54 -2
  411. package/lib/components/Tabs/styles.d.ts +4 -0
  412. package/lib/components/Tabs/styles.d.ts.map +1 -0
  413. package/lib/components/Tabs/styles.js +35 -0
  414. package/lib/components/Tag/Action.d.ts +4 -0
  415. package/lib/components/Tag/Action.d.ts.map +1 -0
  416. package/lib/components/Tag/Action.js +39 -0
  417. package/lib/components/Tag/constants.d.ts +2 -2
  418. package/lib/components/Tag/constants.d.ts.map +1 -1
  419. package/lib/components/Tag/constants.js +4 -4
  420. package/lib/components/Tag/index.d.ts +1 -3
  421. package/lib/components/Tag/index.d.ts.map +1 -1
  422. package/lib/components/Tag/index.js +40 -97
  423. package/lib/components/Tag/index.test.js +239 -2
  424. package/lib/components/Tag/propTypes.d.ts +4 -1
  425. package/lib/components/Tag/propTypes.d.ts.map +1 -1
  426. package/lib/components/Tag/propTypes.js +5 -2
  427. package/lib/components/Tag/schema.d.ts.map +1 -1
  428. package/lib/components/Tag/schema.js +2 -0
  429. package/lib/components/Tag/styles.d.ts +13 -0
  430. package/lib/components/Tag/styles.d.ts.map +1 -0
  431. package/lib/components/Tag/styles.js +133 -0
  432. package/lib/components/Tag/types.d.ts +9 -10
  433. package/lib/components/Tag/types.d.ts.map +1 -1
  434. package/lib/components/Tag/types.js +5 -1
  435. package/lib/components/TagInput/index.d.ts +10 -0
  436. package/lib/components/TagInput/index.d.ts.map +1 -0
  437. package/lib/components/TagInput/index.js +217 -0
  438. package/lib/components/TagInput/index.test.js +1001 -0
  439. package/lib/components/TagInput/schema.d.ts +3 -0
  440. package/lib/components/TagInput/schema.d.ts.map +1 -0
  441. package/lib/components/TagInput/schema.js +30 -0
  442. package/lib/components/TagInput/styles.d.ts +10 -0
  443. package/lib/components/TagInput/styles.d.ts.map +1 -0
  444. package/lib/components/TagInput/styles.js +52 -0
  445. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  446. package/lib/components/TextArea/TextArea.js +1 -1
  447. package/lib/components/TextArea/index.js +1 -0
  448. package/lib/components/TextArea/index.test.js +5 -0
  449. package/lib/components/TextField/Input.js +1 -1
  450. package/lib/components/TextField/index.test.js +5 -0
  451. package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
  452. package/lib/components/Toggle/Fieldset.js +20 -11
  453. package/lib/components/Toggle/Option.d.ts.map +1 -1
  454. package/lib/components/Toggle/Option.js +1 -1
  455. package/lib/components/Toggle/Slider.d.ts +1 -3
  456. package/lib/components/Toggle/Slider.d.ts.map +1 -1
  457. package/lib/components/Toggle/Slider.js +29 -24
  458. package/lib/components/Toggle/index.d.ts.map +1 -1
  459. package/lib/components/Toggle/index.js +6 -1
  460. package/lib/components/Toggle/index.test.js +39 -10
  461. package/lib/components/Toggle/propTypes.js +1 -1
  462. package/lib/components/Toggle/schema.js +1 -1
  463. package/lib/components/Toggle/types.d.ts +3 -2
  464. package/lib/components/Toggle/types.d.ts.map +1 -1
  465. package/lib/components/Toggle/types.js +5 -1
  466. package/lib/components/ToggleView/ToggleView.d.ts +5 -0
  467. package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
  468. package/lib/components/ToggleView/ToggleView.js +80 -0
  469. package/lib/components/ToggleView/index.d.ts +4 -0
  470. package/lib/components/ToggleView/index.d.ts.map +1 -0
  471. package/lib/components/ToggleView/index.js +33 -0
  472. package/lib/components/ToggleView/index.test.js +61 -0
  473. package/lib/components/ToggleView/schema.d.ts +3 -0
  474. package/lib/components/ToggleView/schema.d.ts.map +1 -0
  475. package/lib/components/ToggleView/schema.js +24 -0
  476. package/lib/components/ToggleView/styles.d.ts +6 -0
  477. package/lib/components/ToggleView/styles.d.ts.map +1 -0
  478. package/lib/components/ToggleView/styles.js +23 -0
  479. package/lib/components/ToggleView/types.d.ts +23 -0
  480. package/lib/components/ToggleView/types.d.ts.map +1 -0
  481. package/lib/components/ToggleView/types.js +12 -0
  482. package/lib/components/Tooltip/index.d.ts.map +1 -1
  483. package/lib/components/Tooltip/index.js +3 -13
  484. package/lib/components/Tooltip/schema.d.ts +3 -0
  485. package/lib/components/Tooltip/schema.d.ts.map +1 -0
  486. package/lib/components/Tooltip/schema.js +29 -0
  487. package/lib/components/Typography/withColors.d.ts +1 -1
  488. package/lib/components/Typography/withColors.d.ts.map +1 -1
  489. package/lib/components/Typography/withColors.js +1 -1
  490. package/lib/components/Wizard/index.d.ts +24 -0
  491. package/lib/components/Wizard/index.d.ts.map +1 -0
  492. package/lib/components/Wizard/index.js +146 -0
  493. package/lib/components/Wizard/index.test.js +591 -0
  494. package/lib/components/Wizard/schema.d.ts +3 -0
  495. package/lib/components/Wizard/schema.d.ts.map +1 -0
  496. package/lib/components/Wizard/schema.js +37 -0
  497. package/lib/components/Wizard/styles.d.ts +990 -0
  498. package/lib/components/Wizard/styles.d.ts.map +1 -0
  499. package/lib/components/Wizard/styles.js +79 -0
  500. package/lib/components/index.d.ts +11 -1
  501. package/lib/components/index.d.ts.map +1 -1
  502. package/lib/components/index.js +182 -1
  503. package/lib/modifiers/palette.d.ts +36 -0
  504. package/lib/modifiers/palette.d.ts.map +1 -0
  505. package/lib/modifiers/palette.js +88 -0
  506. package/lib/modifiers/spacingSchema.d.ts.map +1 -1
  507. package/lib/modifiers/spacingSchema.js +29 -16
  508. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  509. package/lib/providers/ConfigProvider/index.js +5 -1
  510. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  511. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  512. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  513. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  514. package/lib/providers/ConfigProvider/utils/translations.d.ts +40 -0
  515. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  516. package/lib/providers/ConfigProvider/utils/translations.js +40 -0
  517. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  518. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  519. package/lib/providers/NotificationsProvider/index.js +47 -28
  520. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  521. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  522. package/lib/utils/commonUIColors.d.ts +351 -3
  523. package/lib/utils/commonUIColors.d.ts.map +1 -1
  524. package/lib/utils/commonUIColors.js +6 -2
  525. package/lib/utils/joinClassnames.d.ts +3 -0
  526. package/lib/utils/joinClassnames.d.ts.map +1 -0
  527. package/lib/utils/joinClassnames.js +26 -0
  528. package/lib/utils/useDebounce.d.ts +2 -0
  529. package/lib/utils/useDebounce.d.ts.map +1 -0
  530. package/lib/utils/useDebounce.js +37 -0
  531. package/lib/utils/useFirstMount.d.ts +2 -0
  532. package/lib/utils/useFirstMount.d.ts.map +1 -0
  533. package/lib/utils/useFirstMount.js +19 -0
  534. package/lib/utils/useUpdateEffect.d.ts +4 -0
  535. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  536. package/lib/utils/useUpdateEffect.js +28 -0
  537. package/package.json +2 -2
  538. package/CHANGELOG.md +0 -796
  539. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  540. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
  541. package/lib/atoms/OptionsList/Category.d.ts +0 -4
  542. package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
  543. package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
  544. package/lib/atoms/OptionsList/Option.js +0 -194
  545. package/lib/components/Tabs/Tab.d.ts +0 -5
  546. package/lib/components/Tabs/Tab.d.ts.map +0 -1
  547. package/lib/components/Tabs/Tab.js +0 -109
  548. package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
  549. package/lib/components/Tabs/types.d.ts +0 -27
  550. package/lib/components/Tabs/types.d.ts.map +0 -1
  551. package/lib/components/Tabs/types.js +0 -1
  552. package/lib/components/Tag/ActionButton.d.ts +0 -5
  553. package/lib/components/Tag/ActionButton.d.ts.map +0 -1
  554. package/lib/components/Tag/ActionButton.js +0 -56
  555. /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
@@ -0,0 +1,1001 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _react2 = require("@testing-library/react");
6
+
7
+ var _ = _interopRequireDefault(require("."));
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
11
+ 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); } }
12
+
13
+ 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); }); }; }
14
+
15
+ var onChange = jest.fn();
16
+ afterEach(function () {
17
+ onChange.mockClear();
18
+ });
19
+ describe('TagInput', function () {
20
+ it('renders label', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
21
+ var _render, getByText;
22
+
23
+ return regeneratorRuntime.wrap(function _callee$(_context) {
24
+ while (1) {
25
+ switch (_context.prev = _context.next) {
26
+ case 0:
27
+ _render = (0, _react2.render)(_react.default.createElement(_.default, {
28
+ tags: [],
29
+ hideLabel: false,
30
+ label: "My Tag Input",
31
+ onChange: onChange
32
+ })), getByText = _render.getByText;
33
+ expect(getByText(/my tag input/i)).toBeInTheDocument();
34
+
35
+ case 2:
36
+ case "end":
37
+ return _context.stop();
38
+ }
39
+ }
40
+ }, _callee);
41
+ })));
42
+ it('renders help message', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
43
+ var _render2, getByText;
44
+
45
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
46
+ while (1) {
47
+ switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ _render2 = (0, _react2.render)(_react.default.createElement(_.default, {
50
+ tags: [],
51
+ hideLabel: false,
52
+ label: "My Tag Input",
53
+ helpMessage: "My Help Message",
54
+ onChange: onChange
55
+ })), getByText = _render2.getByText;
56
+ expect(getByText(/my help message/i)).toBeInTheDocument();
57
+
58
+ case 2:
59
+ case "end":
60
+ return _context2.stop();
61
+ }
62
+ }
63
+ }, _callee2);
64
+ })));
65
+ it('renders warning message', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
66
+ var _render3, getByText;
67
+
68
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
69
+ while (1) {
70
+ switch (_context3.prev = _context3.next) {
71
+ case 0:
72
+ _render3 = (0, _react2.render)(_react.default.createElement(_.default, {
73
+ tags: [],
74
+ hideLabel: false,
75
+ label: "My Tag Input",
76
+ warningMessage: "My Warning Message",
77
+ onChange: onChange
78
+ })), getByText = _render3.getByText;
79
+ expect(getByText(/my warning message/i)).toBeInTheDocument();
80
+
81
+ case 2:
82
+ case "end":
83
+ return _context3.stop();
84
+ }
85
+ }
86
+ }, _callee3);
87
+ })));
88
+ describe('when input is uncontrolled', function () {
89
+ it('renders default tags', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
90
+ var _render4, getByText;
91
+
92
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
93
+ while (1) {
94
+ switch (_context4.prev = _context4.next) {
95
+ case 0:
96
+ _render4 = (0, _react2.render)(_react.default.createElement(_.default, {
97
+ defaultTags: ['Foo tag'],
98
+ label: "My Tag Input"
99
+ })), getByText = _render4.getByText;
100
+ expect(getByText(/Foo tag/i)).toBeInTheDocument();
101
+
102
+ case 2:
103
+ case "end":
104
+ return _context4.stop();
105
+ }
106
+ }
107
+ }, _callee4);
108
+ })));
109
+ it('renders tag action button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
110
+ var _render5, getByLabelText;
111
+
112
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
113
+ while (1) {
114
+ switch (_context5.prev = _context5.next) {
115
+ case 0:
116
+ _render5 = (0, _react2.render)(_react.default.createElement(_.default, {
117
+ defaultTags: ['My tag'],
118
+ label: "My Tag Input"
119
+ })), getByLabelText = _render5.getByLabelText;
120
+ expect(getByLabelText(/remove my tag/i)).toBeInTheDocument();
121
+
122
+ case 2:
123
+ case "end":
124
+ return _context5.stop();
125
+ }
126
+ }
127
+ }, _callee5);
128
+ })));
129
+ describe('when typing in input', function () {
130
+ describe('when hitting Enter', function () {
131
+ describe('when input has value', function () {
132
+ describe('when value is unique', function () {
133
+ it('adds tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
134
+ var _render6, getByLabelText;
135
+
136
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
137
+ while (1) {
138
+ switch (_context6.prev = _context6.next) {
139
+ case 0:
140
+ _render6 = (0, _react2.render)(_react.default.createElement(_.default, {
141
+ defaultTags: ['Foo tag'],
142
+ label: "My Tag Input",
143
+ "aria-label": "My Tag Input"
144
+ })), getByLabelText = _render6.getByLabelText;
145
+
146
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
147
+ target: {
148
+ value: 'Bar tag'
149
+ }
150
+ });
151
+
152
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
153
+ key: 'Enter'
154
+ });
155
+
156
+ expect(getByLabelText('Remove Bar tag')).toBeInTheDocument();
157
+
158
+ case 4:
159
+ case "end":
160
+ return _context6.stop();
161
+ }
162
+ }
163
+ }, _callee6);
164
+ })));
165
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
166
+ var _render7, getByLabelText;
167
+
168
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
169
+ while (1) {
170
+ switch (_context7.prev = _context7.next) {
171
+ case 0:
172
+ _render7 = (0, _react2.render)(_react.default.createElement(_.default, {
173
+ defaultTags: ['Foo tag'],
174
+ label: "My Tag Input",
175
+ "aria-label": "My Tag Input",
176
+ onChange: onChange
177
+ })), getByLabelText = _render7.getByLabelText;
178
+
179
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
180
+ target: {
181
+ value: 'Bar tag'
182
+ }
183
+ });
184
+
185
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
186
+ key: 'Enter'
187
+ });
188
+
189
+ expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
190
+
191
+ case 4:
192
+ case "end":
193
+ return _context7.stop();
194
+ }
195
+ }
196
+ }, _callee7);
197
+ })));
198
+ });
199
+ describe('when value is not unique', function () {
200
+ it('does not add duplicated tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
201
+ var _render8, getAllByLabelText, getByLabelText;
202
+
203
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
204
+ while (1) {
205
+ switch (_context8.prev = _context8.next) {
206
+ case 0:
207
+ _render8 = (0, _react2.render)(_react.default.createElement(_.default, {
208
+ defaultTags: ['Foo tag'],
209
+ label: "My Tag Input",
210
+ "aria-label": "My Tag Input",
211
+ onChange: onChange
212
+ })), getAllByLabelText = _render8.getAllByLabelText, getByLabelText = _render8.getByLabelText;
213
+
214
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
215
+ target: {
216
+ value: 'Foo tag'
217
+ }
218
+ });
219
+
220
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
221
+ key: 'Enter'
222
+ });
223
+
224
+ expect(getAllByLabelText('Remove Foo tag').length).toBe(1);
225
+
226
+ case 4:
227
+ case "end":
228
+ return _context8.stop();
229
+ }
230
+ }
231
+ }, _callee8);
232
+ })));
233
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
234
+ var _render9, getByLabelText;
235
+
236
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
237
+ while (1) {
238
+ switch (_context9.prev = _context9.next) {
239
+ case 0:
240
+ _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
241
+ defaultTags: ['Foo tag'],
242
+ label: "My Tag Input",
243
+ "aria-label": "My Tag Input",
244
+ onChange: onChange
245
+ })), getByLabelText = _render9.getByLabelText;
246
+
247
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
248
+ target: {
249
+ value: 'Foo tag'
250
+ }
251
+ });
252
+
253
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
254
+ key: 'Enter'
255
+ });
256
+
257
+ expect(onChange).not.toHaveBeenCalled();
258
+
259
+ case 4:
260
+ case "end":
261
+ return _context9.stop();
262
+ }
263
+ }
264
+ }, _callee9);
265
+ })));
266
+ });
267
+ });
268
+ describe('when input is blank', function () {
269
+ it('does not add blank tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
270
+ var _render10, queryByLabelText, getByLabelText;
271
+
272
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
273
+ while (1) {
274
+ switch (_context10.prev = _context10.next) {
275
+ case 0:
276
+ _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
277
+ defaultTags: ['Foo tag'],
278
+ label: "My Tag Input",
279
+ "aria-label": "My Tag Input"
280
+ })), queryByLabelText = _render10.queryByLabelText, getByLabelText = _render10.getByLabelText;
281
+
282
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
283
+ target: {
284
+ value: ' '
285
+ }
286
+ });
287
+
288
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
289
+ key: 'Enter'
290
+ });
291
+
292
+ expect(queryByLabelText('Remove ')).not.toBeInTheDocument();
293
+
294
+ case 4:
295
+ case "end":
296
+ return _context10.stop();
297
+ }
298
+ }
299
+ }, _callee10);
300
+ })));
301
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
302
+ var _render11, getByLabelText;
303
+
304
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
305
+ while (1) {
306
+ switch (_context11.prev = _context11.next) {
307
+ case 0:
308
+ _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
309
+ defaultTags: ['Foo tag'],
310
+ label: "My Tag Input",
311
+ "aria-label": "My Tag Input",
312
+ onChange: onChange
313
+ })), getByLabelText = _render11.getByLabelText;
314
+
315
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
316
+ target: {
317
+ value: ' '
318
+ }
319
+ });
320
+
321
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
322
+ key: 'Enter'
323
+ });
324
+
325
+ expect(onChange).not.toHaveBeenCalled();
326
+
327
+ case 4:
328
+ case "end":
329
+ return _context11.stop();
330
+ }
331
+ }
332
+ }, _callee11);
333
+ })));
334
+ });
335
+ });
336
+ describe('when loose focus', function () {
337
+ describe('when input has value', function () {
338
+ describe('when value is unique', function () {
339
+ it('adds tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
340
+ var _render12, getByLabelText;
341
+
342
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
343
+ while (1) {
344
+ switch (_context12.prev = _context12.next) {
345
+ case 0:
346
+ _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
347
+ defaultTags: ['Foo tag'],
348
+ label: "My Tag Input",
349
+ "aria-label": "My Tag Input",
350
+ onChange: onChange
351
+ })), getByLabelText = _render12.getByLabelText;
352
+
353
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
354
+ target: {
355
+ value: 'Bar tag'
356
+ }
357
+ });
358
+
359
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
360
+
361
+ expect(getByLabelText('Remove Bar tag')).toBeInTheDocument();
362
+
363
+ case 4:
364
+ case "end":
365
+ return _context12.stop();
366
+ }
367
+ }
368
+ }, _callee12);
369
+ })));
370
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
371
+ var _render13, getByLabelText;
372
+
373
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
374
+ while (1) {
375
+ switch (_context13.prev = _context13.next) {
376
+ case 0:
377
+ _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
378
+ defaultTags: ['Foo tag'],
379
+ label: "My Tag Input",
380
+ "aria-label": "My Tag Input",
381
+ onChange: onChange
382
+ })), getByLabelText = _render13.getByLabelText;
383
+
384
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
385
+ target: {
386
+ value: 'Bar tag'
387
+ }
388
+ });
389
+
390
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
391
+
392
+ expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
393
+
394
+ case 4:
395
+ case "end":
396
+ return _context13.stop();
397
+ }
398
+ }
399
+ }, _callee13);
400
+ })));
401
+ });
402
+ describe('when value is not unique', function () {
403
+ it('does not add duplicated tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
404
+ var _render14, getAllByLabelText, getByLabelText;
405
+
406
+ return regeneratorRuntime.wrap(function _callee14$(_context14) {
407
+ while (1) {
408
+ switch (_context14.prev = _context14.next) {
409
+ case 0:
410
+ _render14 = (0, _react2.render)(_react.default.createElement(_.default, {
411
+ defaultTags: ['Foo tag'],
412
+ label: "My Tag Input",
413
+ "aria-label": "My Tag Input",
414
+ onChange: onChange
415
+ })), getAllByLabelText = _render14.getAllByLabelText, getByLabelText = _render14.getByLabelText;
416
+
417
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
418
+ target: {
419
+ value: 'Foo tag'
420
+ }
421
+ });
422
+
423
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
424
+
425
+ expect(getAllByLabelText('Remove Foo tag').length).toBe(1);
426
+
427
+ case 4:
428
+ case "end":
429
+ return _context14.stop();
430
+ }
431
+ }
432
+ }, _callee14);
433
+ })));
434
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
435
+ var _render15, getByLabelText;
436
+
437
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
438
+ while (1) {
439
+ switch (_context15.prev = _context15.next) {
440
+ case 0:
441
+ _render15 = (0, _react2.render)(_react.default.createElement(_.default, {
442
+ defaultTags: ['Foo tag'],
443
+ label: "My Tag Input",
444
+ "aria-label": "My Tag Input",
445
+ onChange: onChange
446
+ })), getByLabelText = _render15.getByLabelText;
447
+
448
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
449
+ target: {
450
+ value: 'Foo tag'
451
+ }
452
+ });
453
+
454
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
455
+
456
+ expect(onChange).not.toHaveBeenCalled();
457
+
458
+ case 4:
459
+ case "end":
460
+ return _context15.stop();
461
+ }
462
+ }
463
+ }, _callee15);
464
+ })));
465
+ });
466
+ });
467
+ describe('when input is blank', function () {
468
+ it('does not add blank tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
469
+ var _render16, queryByLabelText, getByLabelText;
470
+
471
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
472
+ while (1) {
473
+ switch (_context16.prev = _context16.next) {
474
+ case 0:
475
+ _render16 = (0, _react2.render)(_react.default.createElement(_.default, {
476
+ defaultTags: ['Foo tag'],
477
+ label: "My Tag Input",
478
+ "aria-label": "My Tag Input"
479
+ })), queryByLabelText = _render16.queryByLabelText, getByLabelText = _render16.getByLabelText;
480
+
481
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
482
+ target: {
483
+ value: ' '
484
+ }
485
+ });
486
+
487
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
488
+
489
+ expect(queryByLabelText('Remove ')).not.toBeInTheDocument();
490
+
491
+ case 4:
492
+ case "end":
493
+ return _context16.stop();
494
+ }
495
+ }
496
+ }, _callee16);
497
+ })));
498
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
499
+ var _render17, getByLabelText;
500
+
501
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
502
+ while (1) {
503
+ switch (_context17.prev = _context17.next) {
504
+ case 0:
505
+ _render17 = (0, _react2.render)(_react.default.createElement(_.default, {
506
+ defaultTags: ['Foo tag'],
507
+ label: "My Tag Input",
508
+ "aria-label": "My Tag Input",
509
+ onChange: onChange
510
+ })), getByLabelText = _render17.getByLabelText;
511
+
512
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
513
+ target: {
514
+ value: ' '
515
+ }
516
+ });
517
+
518
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
519
+
520
+ expect(onChange).not.toHaveBeenCalled();
521
+
522
+ case 4:
523
+ case "end":
524
+ return _context17.stop();
525
+ }
526
+ }
527
+ }, _callee17);
528
+ })));
529
+ });
530
+ });
531
+ describe('when hitting Backspace', function () {
532
+ describe('when input has value', function () {
533
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
534
+ var _render18, getByLabelText;
535
+
536
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
537
+ while (1) {
538
+ switch (_context18.prev = _context18.next) {
539
+ case 0:
540
+ _render18 = (0, _react2.render)(_react.default.createElement(_.default, {
541
+ defaultTags: ['Foo tag'],
542
+ label: "My Tag Input",
543
+ "aria-label": "My Tag Input",
544
+ onChange: onChange
545
+ })), getByLabelText = _render18.getByLabelText;
546
+
547
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
548
+ target: {
549
+ value: 'something'
550
+ }
551
+ });
552
+
553
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
554
+ key: 'Backspace'
555
+ });
556
+
557
+ expect(onChange).not.toHaveBeenCalled();
558
+
559
+ case 4:
560
+ case "end":
561
+ return _context18.stop();
562
+ }
563
+ }
564
+ }, _callee18);
565
+ })));
566
+ });
567
+ describe('when input value is blank', function () {
568
+ it('removes tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
569
+ var _render19, getByLabelText, queryByLabelText;
570
+
571
+ return regeneratorRuntime.wrap(function _callee19$(_context19) {
572
+ while (1) {
573
+ switch (_context19.prev = _context19.next) {
574
+ case 0:
575
+ _render19 = (0, _react2.render)(_react.default.createElement(_.default, {
576
+ defaultTags: ['Foo tag'],
577
+ label: "My Tag Input",
578
+ "aria-label": "My Tag Input",
579
+ onChange: onChange
580
+ })), getByLabelText = _render19.getByLabelText, queryByLabelText = _render19.queryByLabelText;
581
+
582
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
583
+ key: 'Backspace'
584
+ });
585
+
586
+ expect(queryByLabelText('Remove Foo tag')).not.toBeInTheDocument();
587
+
588
+ case 3:
589
+ case "end":
590
+ return _context19.stop();
591
+ }
592
+ }
593
+ }, _callee19);
594
+ })));
595
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() {
596
+ var _render20, getByLabelText;
597
+
598
+ return regeneratorRuntime.wrap(function _callee20$(_context20) {
599
+ while (1) {
600
+ switch (_context20.prev = _context20.next) {
601
+ case 0:
602
+ _render20 = (0, _react2.render)(_react.default.createElement(_.default, {
603
+ defaultTags: ['Foo tag'],
604
+ label: "My Tag Input",
605
+ "aria-label": "My Tag Input",
606
+ onChange: onChange
607
+ })), getByLabelText = _render20.getByLabelText;
608
+
609
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
610
+ key: 'Backspace'
611
+ });
612
+
613
+ expect(onChange).toHaveBeenCalledWith([]);
614
+
615
+ case 3:
616
+ case "end":
617
+ return _context20.stop();
618
+ }
619
+ }
620
+ }, _callee20);
621
+ })));
622
+ });
623
+ });
624
+ });
625
+ describe("when clicking on tag's action button", function () {
626
+ it('removes tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() {
627
+ var _render21, getByLabelText, queryByLabelText;
628
+
629
+ return regeneratorRuntime.wrap(function _callee21$(_context21) {
630
+ while (1) {
631
+ switch (_context21.prev = _context21.next) {
632
+ case 0:
633
+ _render21 = (0, _react2.render)(_react.default.createElement(_.default, {
634
+ defaultTags: ['Foo tag'],
635
+ label: "My Tag Input",
636
+ "aria-label": "My Tag Input",
637
+ onChange: onChange
638
+ })), getByLabelText = _render21.getByLabelText, queryByLabelText = _render21.queryByLabelText;
639
+
640
+ _react2.fireEvent.click(getByLabelText('Remove Foo tag'));
641
+
642
+ expect(queryByLabelText('Remove Foo tag')).not.toBeInTheDocument();
643
+
644
+ case 3:
645
+ case "end":
646
+ return _context21.stop();
647
+ }
648
+ }
649
+ }, _callee21);
650
+ })));
651
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
652
+ var _render22, getByLabelText, queryByLabelText;
653
+
654
+ return regeneratorRuntime.wrap(function _callee22$(_context22) {
655
+ while (1) {
656
+ switch (_context22.prev = _context22.next) {
657
+ case 0:
658
+ _render22 = (0, _react2.render)(_react.default.createElement(_.default, {
659
+ defaultTags: ['Foo tag'],
660
+ label: "My Tag Input",
661
+ "aria-label": "My Tag Input",
662
+ onChange: onChange
663
+ })), getByLabelText = _render22.getByLabelText, queryByLabelText = _render22.queryByLabelText;
664
+
665
+ _react2.fireEvent.click(getByLabelText('Remove Foo tag'));
666
+
667
+ expect(onChange).toHaveBeenCalledWith([]);
668
+
669
+ case 3:
670
+ case "end":
671
+ return _context22.stop();
672
+ }
673
+ }
674
+ }, _callee22);
675
+ })));
676
+ });
677
+ });
678
+ describe('when input is controlled', function () {
679
+ describe('when typing in input', function () {
680
+ describe('when hitting Enter', function () {
681
+ describe('when input has value', function () {
682
+ describe('when value is unique', function () {
683
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23() {
684
+ var _render23, getByLabelText;
685
+
686
+ return regeneratorRuntime.wrap(function _callee23$(_context23) {
687
+ while (1) {
688
+ switch (_context23.prev = _context23.next) {
689
+ case 0:
690
+ _render23 = (0, _react2.render)(_react.default.createElement(_.default, {
691
+ tags: ['Foo tag'],
692
+ label: "My Tag Input",
693
+ "aria-label": "My Tag Input",
694
+ onChange: onChange
695
+ })), getByLabelText = _render23.getByLabelText;
696
+
697
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
698
+ target: {
699
+ value: 'Bar tag'
700
+ }
701
+ });
702
+
703
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
704
+ key: 'Enter'
705
+ });
706
+
707
+ expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
708
+
709
+ case 4:
710
+ case "end":
711
+ return _context23.stop();
712
+ }
713
+ }
714
+ }, _callee23);
715
+ })));
716
+ });
717
+ describe('when value is not unique', function () {
718
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24() {
719
+ var _render24, getByLabelText;
720
+
721
+ return regeneratorRuntime.wrap(function _callee24$(_context24) {
722
+ while (1) {
723
+ switch (_context24.prev = _context24.next) {
724
+ case 0:
725
+ _render24 = (0, _react2.render)(_react.default.createElement(_.default, {
726
+ tags: ['Foo tag'],
727
+ label: "My Tag Input",
728
+ "aria-label": "My Tag Input",
729
+ onChange: onChange
730
+ })), getByLabelText = _render24.getByLabelText;
731
+
732
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
733
+ target: {
734
+ value: 'Foo tag'
735
+ }
736
+ });
737
+
738
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
739
+ key: 'Enter'
740
+ });
741
+
742
+ expect(onChange).not.toHaveBeenCalled();
743
+
744
+ case 4:
745
+ case "end":
746
+ return _context24.stop();
747
+ }
748
+ }
749
+ }, _callee24);
750
+ })));
751
+ });
752
+ });
753
+ describe('when input is blank', function () {
754
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25() {
755
+ var _render25, getByLabelText;
756
+
757
+ return regeneratorRuntime.wrap(function _callee25$(_context25) {
758
+ while (1) {
759
+ switch (_context25.prev = _context25.next) {
760
+ case 0:
761
+ _render25 = (0, _react2.render)(_react.default.createElement(_.default, {
762
+ tags: ['Foo tag'],
763
+ label: "My Tag Input",
764
+ "aria-label": "My Tag Input",
765
+ onChange: onChange
766
+ })), getByLabelText = _render25.getByLabelText;
767
+
768
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
769
+ target: {
770
+ value: ' '
771
+ }
772
+ });
773
+
774
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
775
+ key: 'Enter'
776
+ });
777
+
778
+ expect(onChange).not.toHaveBeenCalled();
779
+
780
+ case 4:
781
+ case "end":
782
+ return _context25.stop();
783
+ }
784
+ }
785
+ }, _callee25);
786
+ })));
787
+ });
788
+ });
789
+ describe('when loose focus', function () {
790
+ describe('when input has value', function () {
791
+ describe('when value is unique', function () {
792
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26() {
793
+ var _render26, getByLabelText;
794
+
795
+ return regeneratorRuntime.wrap(function _callee26$(_context26) {
796
+ while (1) {
797
+ switch (_context26.prev = _context26.next) {
798
+ case 0:
799
+ _render26 = (0, _react2.render)(_react.default.createElement(_.default, {
800
+ tags: ['Foo tag'],
801
+ label: "My Tag Input",
802
+ "aria-label": "My Tag Input",
803
+ onChange: onChange
804
+ })), getByLabelText = _render26.getByLabelText;
805
+
806
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
807
+ target: {
808
+ value: 'Bar tag'
809
+ }
810
+ });
811
+
812
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
813
+
814
+ expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
815
+
816
+ case 4:
817
+ case "end":
818
+ return _context26.stop();
819
+ }
820
+ }
821
+ }, _callee26);
822
+ })));
823
+ });
824
+ describe('when value is not unique', function () {
825
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee27() {
826
+ var _render27, getByLabelText;
827
+
828
+ return regeneratorRuntime.wrap(function _callee27$(_context27) {
829
+ while (1) {
830
+ switch (_context27.prev = _context27.next) {
831
+ case 0:
832
+ _render27 = (0, _react2.render)(_react.default.createElement(_.default, {
833
+ tags: ['Foo tag'],
834
+ label: "My Tag Input",
835
+ "aria-label": "My Tag Input",
836
+ onChange: onChange
837
+ })), getByLabelText = _render27.getByLabelText;
838
+
839
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
840
+ target: {
841
+ value: 'Foo tag'
842
+ }
843
+ });
844
+
845
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
846
+
847
+ expect(onChange).not.toHaveBeenCalled();
848
+
849
+ case 4:
850
+ case "end":
851
+ return _context27.stop();
852
+ }
853
+ }
854
+ }, _callee27);
855
+ })));
856
+ });
857
+ });
858
+ describe('when input is blank', function () {
859
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee28() {
860
+ var _render28, getByLabelText;
861
+
862
+ return regeneratorRuntime.wrap(function _callee28$(_context28) {
863
+ while (1) {
864
+ switch (_context28.prev = _context28.next) {
865
+ case 0:
866
+ _render28 = (0, _react2.render)(_react.default.createElement(_.default, {
867
+ tags: ['Foo tag'],
868
+ label: "My Tag Input",
869
+ "aria-label": "My Tag Input",
870
+ onChange: onChange
871
+ })), getByLabelText = _render28.getByLabelText;
872
+
873
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
874
+ target: {
875
+ value: ' '
876
+ }
877
+ });
878
+
879
+ _react2.fireEvent.blur(getByLabelText('My Tag Input'));
880
+
881
+ expect(onChange).not.toHaveBeenCalled();
882
+
883
+ case 4:
884
+ case "end":
885
+ return _context28.stop();
886
+ }
887
+ }
888
+ }, _callee28);
889
+ })));
890
+ });
891
+ });
892
+ describe('when hitting Backspace', function () {
893
+ describe('when input has value', function () {
894
+ it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee29() {
895
+ var _render29, getByLabelText;
896
+
897
+ return regeneratorRuntime.wrap(function _callee29$(_context29) {
898
+ while (1) {
899
+ switch (_context29.prev = _context29.next) {
900
+ case 0:
901
+ _render29 = (0, _react2.render)(_react.default.createElement(_.default, {
902
+ defaultTags: ['Foo tag'],
903
+ label: "My Tag Input",
904
+ "aria-label": "My Tag Input",
905
+ onChange: onChange
906
+ })), getByLabelText = _render29.getByLabelText;
907
+
908
+ _react2.fireEvent.change(getByLabelText('My Tag Input'), {
909
+ target: {
910
+ value: 'something'
911
+ }
912
+ });
913
+
914
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
915
+ key: 'Backspace'
916
+ });
917
+
918
+ expect(onChange).not.toHaveBeenCalled();
919
+
920
+ case 4:
921
+ case "end":
922
+ return _context29.stop();
923
+ }
924
+ }
925
+ }, _callee29);
926
+ })));
927
+ });
928
+ describe('when input value is blank', function () {
929
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee30() {
930
+ return regeneratorRuntime.wrap(function _callee30$(_context30) {
931
+ while (1) {
932
+ switch (_context30.prev = _context30.next) {
933
+ case 0:
934
+ case "end":
935
+ return _context30.stop();
936
+ }
937
+ }
938
+ }, _callee30);
939
+ })));
940
+ });
941
+ });
942
+ });
943
+ describe("when clicking on tag's action button", function () {
944
+ it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee31() {
945
+ var _render30, getByLabelText;
946
+
947
+ return regeneratorRuntime.wrap(function _callee31$(_context31) {
948
+ while (1) {
949
+ switch (_context31.prev = _context31.next) {
950
+ case 0:
951
+ _render30 = (0, _react2.render)(_react.default.createElement(_.default, {
952
+ tags: ['Foo tag'],
953
+ label: "My Tag Input",
954
+ "aria-label": "My Tag Input",
955
+ onChange: onChange
956
+ })), getByLabelText = _render30.getByLabelText;
957
+
958
+ _react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
959
+ key: 'Backspace'
960
+ });
961
+
962
+ expect(onChange).toHaveBeenCalledWith([]);
963
+
964
+ case 3:
965
+ case "end":
966
+ return _context31.stop();
967
+ }
968
+ }
969
+ }, _callee31);
970
+ })));
971
+ });
972
+ });
973
+ describe('when input is disabled', function () {
974
+ it('suppress tag click event', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee32() {
975
+ var _render31, getByLabelText;
976
+
977
+ return regeneratorRuntime.wrap(function _callee32$(_context32) {
978
+ while (1) {
979
+ switch (_context32.prev = _context32.next) {
980
+ case 0:
981
+ _render31 = (0, _react2.render)(_react.default.createElement(_.default, {
982
+ tags: ['Foo tag'],
983
+ label: "My Tag Input",
984
+ "aria-label": "My Tag Input",
985
+ onChange: onChange,
986
+ disabled: true
987
+ })), getByLabelText = _render31.getByLabelText;
988
+
989
+ _react2.fireEvent.click(getByLabelText('Remove Foo tag'));
990
+
991
+ expect(onChange).not.toHaveBeenCalled();
992
+
993
+ case 3:
994
+ case "end":
995
+ return _context32.stop();
996
+ }
997
+ }
998
+ }, _callee32);
999
+ })));
1000
+ });
1001
+ });