@decisiv/ui-components 2.0.1-alpha.17 → 2.0.1-alpha.173

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 (469) 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/InputLabel.d.ts +1 -0
  24. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  25. package/lib/atoms/InputField/InputLabel.js +2 -1
  26. package/lib/atoms/InputField/index.d.ts +6 -0
  27. package/lib/atoms/InputField/index.d.ts.map +1 -1
  28. package/lib/atoms/InputField/index.js +25 -8
  29. package/lib/atoms/InputField/index.test.js +91 -0
  30. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  31. package/lib/atoms/InputField/schema.js +3 -2
  32. package/lib/atoms/OptionsList/Category.d.ts +1 -1
  33. package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
  34. package/lib/atoms/OptionsList/Category.js +4 -2
  35. package/lib/atoms/OptionsList/Footer.d.ts +8 -0
  36. package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
  37. package/lib/atoms/OptionsList/Footer.js +72 -0
  38. package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
  39. package/lib/atoms/OptionsList/Option.js +24 -9
  40. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  41. package/lib/atoms/OptionsList/index.js +44 -17
  42. package/lib/atoms/OptionsList/index.test.js +127 -17
  43. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  44. package/lib/atoms/OptionsList/schema.js +5 -0
  45. package/lib/atoms/OptionsList/types.d.ts +15 -0
  46. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  47. package/lib/atoms/OptionsList/types.js +5 -1
  48. package/lib/atoms/RequiredIcon.d.ts +9 -0
  49. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  50. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  51. package/lib/components/Accordion/types.js +5 -1
  52. package/lib/components/Accordion/useAccordion/types.js +5 -1
  53. package/lib/components/Alert/Container.d.ts +201 -0
  54. package/lib/components/Alert/Container.d.ts.map +1 -0
  55. package/lib/components/Alert/Container.js +26 -0
  56. package/lib/components/Alert/StyledButton.d.ts +5 -0
  57. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  58. package/lib/components/Alert/StyledButton.js +23 -0
  59. package/lib/components/Alert/index.d.ts +27 -0
  60. package/lib/components/Alert/index.d.ts.map +1 -0
  61. package/lib/components/Alert/index.js +112 -0
  62. package/lib/components/Alert/index.test.js +79 -0
  63. package/lib/components/Alert/intents.d.ts +13 -0
  64. package/lib/components/Alert/intents.d.ts.map +1 -0
  65. package/lib/components/Alert/intents.js +72 -0
  66. package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
  67. package/lib/components/Alert/schema.d.ts.map +1 -0
  68. package/lib/components/Alert/schema.js +25 -0
  69. package/lib/components/Alert/types.d.ts +36 -0
  70. package/lib/components/Alert/types.d.ts.map +1 -0
  71. package/lib/components/Alert/types.js +32 -0
  72. package/lib/components/Avatar/types.js +5 -1
  73. package/lib/components/Badge/constants.d.ts +2 -0
  74. package/lib/components/Badge/constants.d.ts.map +1 -0
  75. package/lib/components/Badge/constants.js +29 -0
  76. package/lib/components/Badge/index.d.ts.map +1 -1
  77. package/lib/components/Badge/index.js +12 -23
  78. package/lib/components/Badge/index.test.js +51 -8
  79. package/lib/components/Badge/schema.js +1 -1
  80. package/lib/components/Badge/types.d.ts +1 -1
  81. package/lib/components/Badge/types.d.ts.map +1 -1
  82. package/lib/components/Badge/types.js +7 -3
  83. package/lib/components/Breadcrumbs/types.js +5 -1
  84. package/lib/components/Button/StyledButton.d.ts +3 -2
  85. package/lib/components/Button/StyledButton.d.ts.map +1 -1
  86. package/lib/components/Button/StyledButton.js +21 -7
  87. package/lib/components/Button/index.d.ts.map +1 -1
  88. package/lib/components/Button/index.js +19 -9
  89. package/lib/components/Button/index.test.js +24 -8
  90. package/lib/components/Button/schema.d.ts +6 -1
  91. package/lib/components/Button/schema.d.ts.map +1 -1
  92. package/lib/components/Button/schema.js +11 -5
  93. package/lib/components/Button/types.d.ts +2 -1
  94. package/lib/components/Button/types.d.ts.map +1 -1
  95. package/lib/components/Button/types.js +5 -1
  96. package/lib/components/Checkbox/index.d.ts.map +1 -1
  97. package/lib/components/Checkbox/index.js +3 -1
  98. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  99. package/lib/components/Checkbox/schema.js +2 -0
  100. package/lib/components/Combobox/Target.d.ts.map +1 -1
  101. package/lib/components/Combobox/Target.js +52 -14
  102. package/lib/components/Combobox/index.d.ts.map +1 -1
  103. package/lib/components/Combobox/index.js +196 -66
  104. package/lib/components/Combobox/index.test.js +369 -146
  105. package/lib/components/Combobox/schema.d.ts.map +1 -1
  106. package/lib/components/Combobox/schema.js +10 -2
  107. package/lib/components/Combobox/types.d.ts +12 -3
  108. package/lib/components/Combobox/types.d.ts.map +1 -1
  109. package/lib/components/Combobox/types.js +5 -1
  110. package/lib/components/Drawer/index.d.ts +22 -0
  111. package/lib/components/Drawer/index.d.ts.map +1 -0
  112. package/lib/components/Drawer/index.js +105 -0
  113. package/lib/components/Drawer/index.test.js +122 -0
  114. package/lib/components/Drawer/schema.d.ts +3 -0
  115. package/lib/components/Drawer/schema.d.ts.map +1 -0
  116. package/lib/components/Drawer/schema.js +32 -0
  117. package/lib/components/Drawer/styles.d.ts +11 -0
  118. package/lib/components/Drawer/styles.d.ts.map +1 -0
  119. package/lib/components/Drawer/styles.js +79 -0
  120. package/lib/components/DropdownList/index.d.ts +4 -0
  121. package/lib/components/DropdownList/index.d.ts.map +1 -1
  122. package/lib/components/DropdownList/index.js +76 -11
  123. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  124. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  125. package/lib/components/DropdownList/propTypes.js +42 -0
  126. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  127. package/lib/components/DropdownList/schema.js +6 -1
  128. package/lib/components/DropdownList/types.d.ts +4 -1
  129. package/lib/components/DropdownList/types.d.ts.map +1 -1
  130. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  131. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  132. package/lib/components/Filter/IconWrapper/index.js +35 -0
  133. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  134. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  135. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  136. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  137. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  138. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  139. package/lib/components/Filter/StyledFilter.js +41 -0
  140. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  141. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  142. package/lib/components/Filter/StyledLabel/index.js +30 -0
  143. package/lib/components/Filter/index.d.ts +5 -0
  144. package/lib/components/Filter/index.d.ts.map +1 -0
  145. package/lib/components/Filter/index.js +107 -0
  146. package/lib/components/Filter/index.test.js +60 -0
  147. package/lib/components/Filter/kind.d.ts +6 -0
  148. package/lib/components/Filter/kind.d.ts.map +1 -0
  149. package/lib/components/Filter/kind.js +45 -0
  150. package/lib/components/Filter/schema.d.ts +9 -0
  151. package/lib/components/Filter/schema.d.ts.map +1 -0
  152. package/lib/components/Filter/schema.js +33 -0
  153. package/lib/components/Filter/types.d.ts +18 -0
  154. package/lib/components/Filter/types.d.ts.map +1 -0
  155. package/lib/components/Filter/types.js +5 -0
  156. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  157. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  158. package/lib/components/JumpTo/JumpToMenu.js +3 -3
  159. package/lib/components/JumpTo/types.js +5 -1
  160. package/lib/components/JumpTo/utils.d.ts.map +1 -1
  161. package/lib/components/JumpTo/utils.js +3 -7
  162. package/lib/components/LeftNav/Item/ClickArea.js +1 -1
  163. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  164. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  165. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  166. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  167. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  168. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  169. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  170. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  171. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  172. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  173. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  174. package/lib/components/LeftNav/Item/types.js +5 -1
  175. package/lib/components/LeftNav/index.test.js +13 -3
  176. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  177. package/lib/components/LeftNav/schema.js +2 -0
  178. package/lib/components/LeftNav/types.d.ts +1 -0
  179. package/lib/components/LeftNav/types.d.ts.map +1 -1
  180. package/lib/components/LeftNav/types.js +5 -1
  181. package/lib/components/Link/DisabledLink.d.ts +7 -0
  182. package/lib/components/Link/DisabledLink.d.ts.map +1 -0
  183. package/lib/components/Link/DisabledLink.js +46 -0
  184. package/lib/components/Link/Link.d.ts +4 -0
  185. package/lib/components/Link/Link.d.ts.map +1 -0
  186. package/lib/components/Link/Link.js +67 -0
  187. package/lib/components/Link/index.d.ts +4 -23
  188. package/lib/components/Link/index.d.ts.map +1 -1
  189. package/lib/components/Link/index.js +20 -158
  190. package/lib/components/Link/index.test.js +63 -42
  191. package/lib/components/Link/schema.d.ts.map +1 -1
  192. package/lib/components/Link/schema.js +2 -1
  193. package/lib/components/Link/styles.d.ts +20 -0
  194. package/lib/components/Link/styles.d.ts.map +1 -0
  195. package/lib/components/Link/styles.js +131 -0
  196. package/lib/components/Link/types.d.ts +28 -0
  197. package/lib/components/Link/types.d.ts.map +1 -0
  198. package/lib/components/Link/types.js +5 -0
  199. package/lib/components/Loading/Loading.d.ts +12 -0
  200. package/lib/components/Loading/Loading.d.ts.map +1 -0
  201. package/lib/components/Loading/Loading.js +70 -0
  202. package/lib/components/Loading/index.d.ts +4 -0
  203. package/lib/components/Loading/index.d.ts.map +1 -0
  204. package/lib/components/Loading/index.js +33 -0
  205. package/lib/components/Loading/index.test.js +55 -0
  206. package/lib/components/Loading/schema.d.ts +4 -0
  207. package/lib/components/Loading/schema.d.ts.map +1 -0
  208. package/lib/components/Loading/schema.js +31 -0
  209. package/lib/components/Loading/styles.d.ts +211 -0
  210. package/lib/components/Loading/styles.d.ts.map +1 -0
  211. package/lib/components/Loading/styles.js +77 -0
  212. package/lib/components/Loading/types.d.ts +10 -0
  213. package/lib/components/Loading/types.d.ts.map +1 -0
  214. package/lib/components/Loading/types.js +5 -0
  215. package/lib/components/Menu/index.d.ts.map +1 -1
  216. package/lib/components/Menu/index.js +3 -1
  217. package/lib/components/Menu/types.d.ts +2 -0
  218. package/lib/components/Menu/types.d.ts.map +1 -1
  219. package/lib/components/Menu/types.js +5 -1
  220. package/lib/components/Modal/components.d.ts +2 -2
  221. package/lib/components/Modal/types.js +5 -1
  222. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  223. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  224. package/lib/components/Notifications/Notification/components.js +12 -6
  225. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  226. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  227. package/lib/components/Notifications/Notification/index.js +19 -12
  228. package/lib/components/Notifications/Notification/index.test.js +38 -19
  229. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  230. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  231. package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
  232. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  233. package/lib/components/Notifications/Notifier.test.js +79 -10
  234. package/lib/components/Notifications/constants.d.ts +2 -0
  235. package/lib/components/Notifications/constants.d.ts.map +1 -0
  236. package/lib/components/Notifications/constants.js +16 -0
  237. package/lib/components/Notifications/schema.d.ts.map +1 -1
  238. package/lib/components/Notifications/schema.js +2 -1
  239. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  240. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  241. package/lib/components/Notifications/useNotifications.test.js +7 -4
  242. package/lib/components/Pagination/Pagination.d.ts +1 -1
  243. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  244. package/lib/components/Pagination/Pagination.js +1 -0
  245. package/lib/components/Pagination/Pagination.test.js +9 -0
  246. package/lib/components/Pagination/types.js +5 -1
  247. package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
  248. package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
  249. package/lib/components/PasswordField/IconWrapper.js +32 -0
  250. package/lib/components/PasswordField/Input.d.ts +6 -0
  251. package/lib/components/PasswordField/Input.d.ts.map +1 -0
  252. package/lib/components/PasswordField/Input.js +28 -0
  253. package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
  254. package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
  255. package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
  256. package/lib/components/PasswordField/index.d.ts +14 -0
  257. package/lib/components/PasswordField/index.d.ts.map +1 -0
  258. package/lib/components/PasswordField/index.js +113 -0
  259. package/lib/components/PasswordField/index.test.js +217 -0
  260. package/lib/components/PasswordField/schema.d.ts +3 -0
  261. package/lib/components/PasswordField/schema.d.ts.map +1 -0
  262. package/lib/components/PasswordField/schema.js +27 -0
  263. package/lib/components/Popover/index.d.ts.map +1 -1
  264. package/lib/components/Popover/index.js +6 -3
  265. package/lib/components/Popover/schema.d.ts.map +1 -1
  266. package/lib/components/Popover/schema.js +27 -20
  267. package/lib/components/Popover/types.d.ts +1 -0
  268. package/lib/components/Popover/types.d.ts.map +1 -1
  269. package/lib/components/Popover/utils.d.ts +1 -1
  270. package/lib/components/SearchInput/index.d.ts +11 -0
  271. package/lib/components/SearchInput/index.d.ts.map +1 -0
  272. package/lib/components/SearchInput/index.js +190 -0
  273. package/lib/components/SearchInput/index.test.js +417 -0
  274. package/lib/components/SearchInput/schema.d.ts +3 -0
  275. package/lib/components/SearchInput/schema.d.ts.map +1 -0
  276. package/lib/components/SearchInput/schema.js +24 -0
  277. package/lib/components/SearchInput/types.d.ts +28 -0
  278. package/lib/components/SearchInput/types.d.ts.map +1 -0
  279. package/lib/components/SearchInput/types.js +5 -0
  280. package/lib/components/Select/Target.d.ts.map +1 -1
  281. package/lib/components/Select/Target.js +6 -2
  282. package/lib/components/Select/index.d.ts.map +1 -1
  283. package/lib/components/Select/index.js +44 -4
  284. package/lib/components/Select/index.test.js +106 -23
  285. package/lib/components/Select/schema.d.ts.map +1 -1
  286. package/lib/components/Select/schema.js +9 -0
  287. package/lib/components/Select/types.d.ts +6 -1
  288. package/lib/components/Select/types.d.ts.map +1 -1
  289. package/lib/components/Select/types.js +5 -1
  290. package/lib/components/SelectDate/Target.d.ts.map +1 -1
  291. package/lib/components/SelectDate/Target.js +6 -2
  292. package/lib/components/SelectDate/index.d.ts.map +1 -1
  293. package/lib/components/SelectDate/index.js +32 -3
  294. package/lib/components/SelectDate/index.test.js +108 -51
  295. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  296. package/lib/components/SelectDate/schema.js +3 -0
  297. package/lib/components/SelectDate/types.d.ts +3 -0
  298. package/lib/components/SelectDate/types.d.ts.map +1 -1
  299. package/lib/components/SelectDate/types.js +5 -1
  300. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  301. package/lib/components/SelectDateRange/index.js +31 -2
  302. package/lib/components/SelectDateRange/index.test.js +115 -58
  303. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  304. package/lib/components/SelectDateRange/schema.js +3 -0
  305. package/lib/components/SelectDateRange/types.js +5 -1
  306. package/lib/components/SelectMenu/index.d.ts +5 -0
  307. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  308. package/lib/components/SelectMenu/index.js +27 -3
  309. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  310. package/lib/components/SelectMenu/schema.js +4 -0
  311. package/lib/components/Table/Body.d.ts.map +1 -1
  312. package/lib/components/Table/Body.js +28 -17
  313. package/lib/components/Table/Container.d.ts.map +1 -1
  314. package/lib/components/Table/Container.js +6 -1
  315. package/lib/components/Table/DataRow.d.ts.map +1 -1
  316. package/lib/components/Table/DataRow.js +26 -18
  317. package/lib/components/Table/Head.d.ts +1 -1
  318. package/lib/components/Table/Head.d.ts.map +1 -1
  319. package/lib/components/Table/Head.js +10 -5
  320. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  321. package/lib/components/Table/HeaderCell/index.js +19 -6
  322. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  323. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  324. package/lib/components/Table/HeaderCell/types.js +5 -1
  325. package/lib/components/Table/Provider.d.ts +5 -5
  326. package/lib/components/Table/Provider.d.ts.map +1 -1
  327. package/lib/components/Table/Provider.js +10 -11
  328. package/lib/components/Table/index.d.ts.map +1 -1
  329. package/lib/components/Table/index.js +110 -20
  330. package/lib/components/Table/index.test.js +80 -33
  331. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  332. package/lib/components/Table/schema.columns.js +6 -4
  333. package/lib/components/Table/schema.d.ts.map +1 -1
  334. package/lib/components/Table/schema.js +7 -6
  335. package/lib/components/Table/types.d.ts +19 -4
  336. package/lib/components/Table/types.d.ts.map +1 -1
  337. package/lib/components/Table/utils.d.ts +2 -8
  338. package/lib/components/Table/utils.d.ts.map +1 -1
  339. package/lib/components/Table/utils.js +21 -20
  340. package/lib/components/Tabs/Tab/index.d.ts +13 -0
  341. package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
  342. package/lib/components/Tabs/Tab/index.js +94 -0
  343. package/lib/components/Tabs/Tab/schema.d.ts +3 -0
  344. package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
  345. package/lib/components/Tabs/Tab/styles.d.ts +7 -0
  346. package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
  347. package/lib/components/Tabs/Tab/styles.js +37 -0
  348. package/lib/components/Tabs/context.d.ts +2 -2
  349. package/lib/components/Tabs/context.d.ts.map +1 -1
  350. package/lib/components/Tabs/context.js +1 -1
  351. package/lib/components/Tabs/index.d.ts +17 -6
  352. package/lib/components/Tabs/index.d.ts.map +1 -1
  353. package/lib/components/Tabs/index.js +104 -163
  354. package/lib/components/Tabs/index.test.js +54 -2
  355. package/lib/components/Tabs/styles.d.ts +4 -0
  356. package/lib/components/Tabs/styles.d.ts.map +1 -0
  357. package/lib/components/Tabs/styles.js +35 -0
  358. package/lib/components/Tag/Action.d.ts +4 -0
  359. package/lib/components/Tag/Action.d.ts.map +1 -0
  360. package/lib/components/Tag/Action.js +39 -0
  361. package/lib/components/Tag/constants.d.ts +2 -2
  362. package/lib/components/Tag/constants.d.ts.map +1 -1
  363. package/lib/components/Tag/constants.js +4 -4
  364. package/lib/components/Tag/index.d.ts +1 -3
  365. package/lib/components/Tag/index.d.ts.map +1 -1
  366. package/lib/components/Tag/index.js +40 -97
  367. package/lib/components/Tag/index.test.js +239 -2
  368. package/lib/components/Tag/propTypes.d.ts +3 -0
  369. package/lib/components/Tag/propTypes.d.ts.map +1 -1
  370. package/lib/components/Tag/propTypes.js +5 -2
  371. package/lib/components/Tag/schema.d.ts.map +1 -1
  372. package/lib/components/Tag/schema.js +2 -0
  373. package/lib/components/Tag/styles.d.ts +13 -0
  374. package/lib/components/Tag/styles.d.ts.map +1 -0
  375. package/lib/components/Tag/styles.js +167 -0
  376. package/lib/components/Tag/types.d.ts +9 -10
  377. package/lib/components/Tag/types.d.ts.map +1 -1
  378. package/lib/components/Tag/types.js +5 -1
  379. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  380. package/lib/components/TextArea/TextArea.js +1 -1
  381. package/lib/components/TextArea/index.js +1 -0
  382. package/lib/components/TextArea/index.test.js +5 -0
  383. package/lib/components/TextField/Input.js +1 -1
  384. package/lib/components/TextField/index.test.js +5 -0
  385. package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
  386. package/lib/components/Toggle/Fieldset.js +20 -11
  387. package/lib/components/Toggle/Option.d.ts.map +1 -1
  388. package/lib/components/Toggle/Option.js +1 -1
  389. package/lib/components/Toggle/Slider.d.ts +1 -3
  390. package/lib/components/Toggle/Slider.d.ts.map +1 -1
  391. package/lib/components/Toggle/Slider.js +29 -24
  392. package/lib/components/Toggle/index.d.ts.map +1 -1
  393. package/lib/components/Toggle/index.js +6 -1
  394. package/lib/components/Toggle/index.test.js +39 -10
  395. package/lib/components/Toggle/propTypes.js +1 -1
  396. package/lib/components/Toggle/schema.js +1 -1
  397. package/lib/components/Toggle/types.d.ts +3 -2
  398. package/lib/components/Toggle/types.d.ts.map +1 -1
  399. package/lib/components/Toggle/types.js +5 -1
  400. package/lib/components/ToggleView/ToggleView.d.ts +5 -0
  401. package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
  402. package/lib/components/ToggleView/ToggleView.js +80 -0
  403. package/lib/components/ToggleView/index.d.ts +4 -0
  404. package/lib/components/ToggleView/index.d.ts.map +1 -0
  405. package/lib/components/ToggleView/index.js +33 -0
  406. package/lib/components/ToggleView/index.test.js +61 -0
  407. package/lib/components/ToggleView/schema.d.ts +3 -0
  408. package/lib/components/ToggleView/schema.d.ts.map +1 -0
  409. package/lib/components/ToggleView/schema.js +24 -0
  410. package/lib/components/ToggleView/styles.d.ts +6 -0
  411. package/lib/components/ToggleView/styles.d.ts.map +1 -0
  412. package/lib/components/ToggleView/styles.js +23 -0
  413. package/lib/components/ToggleView/types.d.ts +23 -0
  414. package/lib/components/ToggleView/types.d.ts.map +1 -0
  415. package/lib/components/ToggleView/types.js +12 -0
  416. package/lib/components/Tooltip/index.d.ts.map +1 -1
  417. package/lib/components/Tooltip/index.js +3 -13
  418. package/lib/components/Tooltip/schema.d.ts +3 -0
  419. package/lib/components/Tooltip/schema.d.ts.map +1 -0
  420. package/lib/components/Tooltip/schema.js +29 -0
  421. package/lib/components/Typography/withColors.d.ts +1 -1
  422. package/lib/components/Typography/withColors.d.ts.map +1 -1
  423. package/lib/components/Typography/withColors.js +1 -1
  424. package/lib/components/index.d.ts +8 -1
  425. package/lib/components/index.d.ts.map +1 -1
  426. package/lib/components/index.js +126 -0
  427. package/lib/modifiers/spacingSchema.d.ts.map +1 -1
  428. package/lib/modifiers/spacingSchema.js +29 -16
  429. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  430. package/lib/providers/ConfigProvider/index.js +5 -1
  431. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  432. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  433. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  434. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  435. package/lib/providers/ConfigProvider/utils/translations.d.ts +24 -0
  436. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  437. package/lib/providers/ConfigProvider/utils/translations.js +24 -0
  438. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  439. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  440. package/lib/providers/NotificationsProvider/index.js +47 -28
  441. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  442. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  443. package/lib/utils/commonUIColors.d.ts +349 -1
  444. package/lib/utils/commonUIColors.d.ts.map +1 -1
  445. package/lib/utils/commonUIColors.js +6 -2
  446. package/lib/utils/joinClassnames.d.ts +3 -0
  447. package/lib/utils/joinClassnames.d.ts.map +1 -0
  448. package/lib/utils/joinClassnames.js +26 -0
  449. package/lib/utils/useFirstMount.d.ts +2 -0
  450. package/lib/utils/useFirstMount.d.ts.map +1 -0
  451. package/lib/utils/useFirstMount.js +19 -0
  452. package/lib/utils/useUpdateEffect.d.ts +4 -0
  453. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  454. package/lib/utils/useUpdateEffect.js +28 -0
  455. package/package.json +2 -2
  456. package/CHANGELOG.md +0 -796
  457. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  458. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
  459. package/lib/components/Tabs/Tab.d.ts +0 -5
  460. package/lib/components/Tabs/Tab.d.ts.map +0 -1
  461. package/lib/components/Tabs/Tab.js +0 -109
  462. package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
  463. package/lib/components/Tabs/types.d.ts +0 -27
  464. package/lib/components/Tabs/types.d.ts.map +0 -1
  465. package/lib/components/Tabs/types.js +0 -1
  466. package/lib/components/Tag/ActionButton.d.ts +0 -5
  467. package/lib/components/Tag/ActionButton.d.ts.map +0 -1
  468. package/lib/components/Tag/ActionButton.js +0 -56
  469. /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
@@ -0,0 +1,417 @@
1
+ "use strict";
2
+
3
+ require("jest-styled-components");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _react2 = require("@testing-library/react");
8
+
9
+ var _ConfigProvider = require("../../providers/ConfigProvider");
10
+
11
+ var _ = _interopRequireDefault(require("."));
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ 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
+
17
+ 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); }); }; }
18
+
19
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
20
+
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22
+
23
+ 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
+
25
+ beforeAll(function () {
26
+ var root = document.createElement('div');
27
+ root.setAttribute('id', 'popovers-root');
28
+ document.body.appendChild(root);
29
+ });
30
+
31
+ var wrapper = function wrapper(_ref) {
32
+ var children = _ref.children;
33
+ return _react.default.createElement(_ConfigProvider.ConfigProvider, null, children);
34
+ };
35
+
36
+ var render = function render(ui, options) {
37
+ return (0, _react2.render)(ui, _objectSpread({}, options, {
38
+ wrapper: wrapper
39
+ }));
40
+ };
41
+
42
+ var onChangeMock = jest.fn();
43
+ var onSearchMock = jest.fn();
44
+ describe('Search input', function () {
45
+ afterEach(jest.clearAllMocks);
46
+ it('renders the search input with the TIMES icon HIDDEN when its blank', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
47
+ var container, searchContainer;
48
+ return regeneratorRuntime.wrap(function _callee$(_context) {
49
+ while (1) {
50
+ switch (_context.prev = _context.next) {
51
+ case 0:
52
+ container = render(_react.default.createElement(_.default, {
53
+ value: "",
54
+ onChange: onChangeMock
55
+ }));
56
+ _context.next = 3;
57
+ return container.findByTestId('search-container');
58
+
59
+ case 3:
60
+ searchContainer = _context.sent;
61
+ expect((0, _react2.within)(searchContainer).getByLabelText('Clear search')).not.toBeVisible();
62
+
63
+ case 5:
64
+ case "end":
65
+ return _context.stop();
66
+ }
67
+ }
68
+ }, _callee);
69
+ })));
70
+ it('renders the search input with the TIMES icon VISIBLE when its blank', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
71
+ var container, searchContainer;
72
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
73
+ while (1) {
74
+ switch (_context2.prev = _context2.next) {
75
+ case 0:
76
+ container = render(_react.default.createElement(_.default, {
77
+ value: "Some value",
78
+ onChange: onChangeMock
79
+ }));
80
+ _context2.next = 3;
81
+ return container.findByTestId('search-container');
82
+
83
+ case 3:
84
+ searchContainer = _context2.sent;
85
+ expect((0, _react2.within)(searchContainer).getByLabelText('Clear search')).toBeVisible();
86
+
87
+ case 5:
88
+ case "end":
89
+ return _context2.stop();
90
+ }
91
+ }
92
+ }, _callee2);
93
+ })));
94
+ it('renders SEARCH icon for MEDIUM sized search input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
95
+ var container;
96
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
97
+ while (1) {
98
+ switch (_context3.prev = _context3.next) {
99
+ case 0:
100
+ container = render(_react.default.createElement(_.default, {
101
+ value: "",
102
+ onChange: onChangeMock,
103
+ size: "medium"
104
+ }));
105
+ _context3.t0 = expect;
106
+ _context3.next = 4;
107
+ return container.findByTestId('search-icon');
108
+
109
+ case 4:
110
+ _context3.t1 = _context3.sent;
111
+ (0, _context3.t0)(_context3.t1).toBeInTheDocument();
112
+
113
+ case 6:
114
+ case "end":
115
+ return _context3.stop();
116
+ }
117
+ }
118
+ }, _callee3);
119
+ })));
120
+ it('renders search button with the text SEARCH for MEDIUM sized search input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
121
+ var container;
122
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
123
+ while (1) {
124
+ switch (_context4.prev = _context4.next) {
125
+ case 0:
126
+ container = render(_react.default.createElement(_.default, {
127
+ value: "",
128
+ onChange: onChangeMock,
129
+ size: "medium"
130
+ }));
131
+ _context4.t0 = expect;
132
+ _context4.next = 4;
133
+ return container.findByRole('button');
134
+
135
+ case 4:
136
+ _context4.t1 = _context4.sent;
137
+ (0, _context4.t0)(_context4.t1).toHaveTextContent('Search');
138
+
139
+ case 6:
140
+ case "end":
141
+ return _context4.stop();
142
+ }
143
+ }
144
+ }, _callee4);
145
+ })));
146
+ it('does not render the SEARCH icon for SMALL sized search input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
147
+ var container;
148
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
149
+ while (1) {
150
+ switch (_context5.prev = _context5.next) {
151
+ case 0:
152
+ container = render(_react.default.createElement(_.default, {
153
+ value: "",
154
+ onChange: onChangeMock,
155
+ size: "small"
156
+ }));
157
+ expect(container.queryByTestId('search-icon')).not.toBeInTheDocument();
158
+
159
+ case 2:
160
+ case "end":
161
+ return _context5.stop();
162
+ }
163
+ }
164
+ }, _callee5);
165
+ })));
166
+ it('renders search button with the icon SEARCH for SMALL sized search input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
167
+ var container, button;
168
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
169
+ while (1) {
170
+ switch (_context6.prev = _context6.next) {
171
+ case 0:
172
+ container = render(_react.default.createElement(_.default, {
173
+ value: "",
174
+ onChange: onChangeMock,
175
+ size: "small"
176
+ }));
177
+ button = container.getByRole('button');
178
+ expect(button.querySelector('svg')).toBeInTheDocument();
179
+
180
+ case 3:
181
+ case "end":
182
+ return _context6.stop();
183
+ }
184
+ }
185
+ }, _callee6);
186
+ })));
187
+ it('renders the search input with the TIMES icon HIDDEN when its disabled', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
188
+ var container, searchContainer;
189
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
190
+ while (1) {
191
+ switch (_context7.prev = _context7.next) {
192
+ case 0:
193
+ container = render(_react.default.createElement(_.default, {
194
+ value: "some value",
195
+ onChange: onChangeMock,
196
+ disabled: true
197
+ }));
198
+ _context7.next = 3;
199
+ return container.findByTestId('search-container');
200
+
201
+ case 3:
202
+ searchContainer = _context7.sent;
203
+ expect((0, _react2.within)(searchContainer).queryByLabelText('Clear search')).not.toBeInTheDocument();
204
+
205
+ case 5:
206
+ case "end":
207
+ return _context7.stop();
208
+ }
209
+ }
210
+ }, _callee7);
211
+ })));
212
+ it('calls onChange when a change is triggered', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
213
+ var container, searchInput;
214
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
215
+ while (1) {
216
+ switch (_context8.prev = _context8.next) {
217
+ case 0:
218
+ container = render(_react.default.createElement(_.default, {
219
+ value: "",
220
+ onChange: onChangeMock,
221
+ disabled: true
222
+ }));
223
+ _context8.next = 3;
224
+ return container.findByTestId('search-container');
225
+
226
+ case 3:
227
+ _context8.next = 5;
228
+ return _context8.sent.querySelector('input');
229
+
230
+ case 5:
231
+ searchInput = _context8.sent;
232
+ _context8.next = 8;
233
+ return _react2.fireEvent.change(searchInput, {
234
+ target: {
235
+ value: 'some value'
236
+ }
237
+ });
238
+
239
+ case 8:
240
+ expect(onChangeMock).toHaveBeenCalled();
241
+
242
+ case 9:
243
+ case "end":
244
+ return _context8.stop();
245
+ }
246
+ }
247
+ }, _callee8);
248
+ })));
249
+ it('calls onChange with a blank value when clear button is clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
250
+ var container, searchContainer;
251
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
252
+ while (1) {
253
+ switch (_context9.prev = _context9.next) {
254
+ case 0:
255
+ container = render(_react.default.createElement(_.default, {
256
+ value: "Some value",
257
+ onChange: onChangeMock
258
+ }));
259
+ _context9.next = 3;
260
+ return container.findByTestId('search-container');
261
+
262
+ case 3:
263
+ searchContainer = _context9.sent;
264
+ _context9.next = 6;
265
+ return _react2.fireEvent.click((0, _react2.within)(searchContainer).getByLabelText('Clear search'));
266
+
267
+ case 6:
268
+ expect(onChangeMock).toHaveBeenCalledWith({
269
+ target: {
270
+ value: ''
271
+ }
272
+ });
273
+
274
+ case 7:
275
+ case "end":
276
+ return _context9.stop();
277
+ }
278
+ }
279
+ }, _callee9);
280
+ })));
281
+ it('calls onSearch when search button is clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
282
+ var container;
283
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
284
+ while (1) {
285
+ switch (_context10.prev = _context10.next) {
286
+ case 0:
287
+ container = render(_react.default.createElement(_.default, {
288
+ value: "Searched value",
289
+ onChange: onChangeMock,
290
+ onSearch: onSearchMock,
291
+ size: "medium"
292
+ }));
293
+ _context10.t0 = _react2.fireEvent;
294
+ _context10.next = 4;
295
+ return container.findByRole('button');
296
+
297
+ case 4:
298
+ _context10.t1 = _context10.sent;
299
+
300
+ _context10.t0.click.call(_context10.t0, _context10.t1);
301
+
302
+ expect(onSearchMock).toHaveBeenCalledWith('Searched value');
303
+
304
+ case 7:
305
+ case "end":
306
+ return _context10.stop();
307
+ }
308
+ }
309
+ }, _callee10);
310
+ })));
311
+ it('calls onSearch when enter is pressed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
312
+ var container, searchInput;
313
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
314
+ while (1) {
315
+ switch (_context11.prev = _context11.next) {
316
+ case 0:
317
+ container = render(_react.default.createElement(_.default, {
318
+ value: "Searched value",
319
+ onChange: onChangeMock,
320
+ onSearch: onSearchMock,
321
+ size: "medium"
322
+ }));
323
+ _context11.next = 3;
324
+ return container.findByTestId('search-container');
325
+
326
+ case 3:
327
+ _context11.next = 5;
328
+ return _context11.sent.querySelector('input');
329
+
330
+ case 5:
331
+ searchInput = _context11.sent;
332
+
333
+ _react2.fireEvent.keyPress(searchInput, {
334
+ code: 'Enter',
335
+ key: 'Enter',
336
+ charCode: 13
337
+ });
338
+
339
+ expect(onSearchMock).toHaveBeenCalledWith('Searched value');
340
+
341
+ case 8:
342
+ case "end":
343
+ return _context11.stop();
344
+ }
345
+ }
346
+ }, _callee11);
347
+ })));
348
+ describe('when using the searchOn `change`', function () {
349
+ var searchOn = 'change';
350
+ it('renders the search icon when size is "small"', function () {
351
+ var container = render(_react.default.createElement(_.default, {
352
+ searchOn: "change",
353
+ value: "",
354
+ onChange: onChangeMock,
355
+ size: "small"
356
+ }));
357
+ expect(container.getByTestId('search-icon')).toBeInTheDocument();
358
+ });
359
+ it('renders the search icon when size is "medium"', function () {
360
+ var container = render(_react.default.createElement(_.default, {
361
+ searchOn: "change",
362
+ value: "",
363
+ onChange: onChangeMock,
364
+ size: "medium"
365
+ }));
366
+ expect(container.getByTestId('search-icon')).toBeInTheDocument();
367
+ });
368
+ it('does not render the submit search button', function () {
369
+ var _render = render(_react.default.createElement(_.default, {
370
+ value: "search value",
371
+ searchOn: searchOn,
372
+ onChange: onChangeMock,
373
+ onSearch: onSearchMock
374
+ })),
375
+ queryByRole = _render.queryByRole;
376
+
377
+ expect(queryByRole('button')).not.toBeInTheDocument();
378
+ });
379
+ it('triggers the onSearch function when changing the value of the component', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
380
+ var container, searchInput;
381
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
382
+ while (1) {
383
+ switch (_context12.prev = _context12.next) {
384
+ case 0:
385
+ container = render(_react.default.createElement(_.default, {
386
+ searchOn: searchOn,
387
+ value: "Searched value",
388
+ onChange: onChangeMock,
389
+ onSearch: onSearchMock
390
+ }));
391
+ _context12.next = 3;
392
+ return container.findByTestId('search-container');
393
+
394
+ case 3:
395
+ _context12.next = 5;
396
+ return _context12.sent.querySelector('input');
397
+
398
+ case 5:
399
+ searchInput = _context12.sent;
400
+
401
+ _react2.fireEvent.change(searchInput, {
402
+ target: {
403
+ value: 'some value'
404
+ }
405
+ });
406
+
407
+ expect(onChangeMock).toHaveBeenCalled();
408
+
409
+ case 8:
410
+ case "end":
411
+ return _context12.stop();
412
+ }
413
+ }
414
+ }, _callee12);
415
+ })));
416
+ });
417
+ });
@@ -0,0 +1,3 @@
1
+ declare const schema: any;
2
+ export default schema;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;AAkCxD,eAAe,MAAM,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _reactDesc = require("react-desc");
9
+
10
+ // @ts-ignore no module typings
11
+ var schema = (0, _reactDesc.describe)({
12
+ displayName: 'SearchInput'
13
+ });
14
+ schema.propTypes = {
15
+ searchOn: _reactDesc.PropTypes.oneOf(['change', 'submit']).description('Set the behavior when the onSearch function is called').defaultValue('submit'),
16
+ debounceTimeout: _reactDesc.PropTypes.number.description('The amount of ms to wait until onSearch is called after the user has typed in the search input').defaultValue('500'),
17
+ size: _reactDesc.PropTypes.oneOf(['medium', 'small']).description('Controls the size of the search input.').defaultValue('medium'),
18
+ disabled: _reactDesc.PropTypes.bool.description('Boolean indicating whether the search input is disabled.'),
19
+ value: _reactDesc.PropTypes.string.description('A text value to be displayed on the input field'),
20
+ onSearch: _reactDesc.PropTypes.func.description('A callback that is invoked with the input value when the the search action is performed'),
21
+ onChange: _reactDesc.PropTypes.func.description('A callback that is invoked when the value of the search field changes')
22
+ };
23
+ var _default = schema;
24
+ exports.default = _default;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { BaseInputFieldProps } from '../../atoms/InputField';
3
+ import { FlexComponentProps } from '../Flex';
4
+ export interface SearchItem<T> {
5
+ label: string;
6
+ value: T;
7
+ }
8
+ export declare type Size = 'medium' | 'small';
9
+ export declare type SearchOn = 'submit' | 'change';
10
+ export interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'label'>, Omit<BaseInputFieldProps, 'children' | 'onClick' | 'label'> {
11
+ zIndex?: number;
12
+ searchOn?: SearchOn;
13
+ onSearch?: (value: string) => void;
14
+ onSelectItem?: (value: any) => void;
15
+ onBlur?: React.FocusEventHandler;
16
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
17
+ onFocus?: React.FocusEventHandler;
18
+ onKeyDown?: React.KeyboardEventHandler;
19
+ size: Size;
20
+ value: string;
21
+ }
22
+ export interface SearchFieldProps extends Omit<SearchInputProps, 'loader'> {
23
+ observedElementRef: React.MutableRefObject<any>;
24
+ }
25
+ export interface StyledFlexProps extends FlexComponentProps {
26
+ width: number | null;
27
+ }
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACV;AAED,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtC,oBAAY,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,EACzE,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC;IACvC,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IACxE,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Target.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAmBvE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA8GjD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AAGvB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Target.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAmBvE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgHjD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AAGvB,eAAe,aAAa,CAAC"}
@@ -48,7 +48,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
48
48
  var TargetContainer = _styledComponents.default.div.withConfig({
49
49
  displayName: "Target__TargetContainer",
50
50
  componentId: "sc-1t0verh-0"
51
- })(["align-items:center;display:flex;justify-content:space-between;position:relative;top:-4px;width:100%;"]);
51
+ })(["align-items:center;display:flex;justify-content:space-between;position:relative;top:-2px;width:100%;"]);
52
52
 
53
53
  var TargetButton = (0, _styledComponents.default)(_BaseButton.default).withConfig({
54
54
  displayName: "Target__TargetButton",
@@ -56,7 +56,8 @@ var TargetButton = (0, _styledComponents.default)(_BaseButton.default).withConfi
56
56
  })(["background:transparent;border:transparent;cursor:inherit;font-size:", ";font-weight:", ";height:24px;line-height:140%;margin-right:", "px;overflow:hidden;padding:0;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%;&:active,&:focus{outline:none;}"], (0, _rem.default)(_typography.default.size.alias.default), _typography.default.weight.alias.medium, _spacing.default.base * 0.5);
57
57
  var ExpandedIndicatorContainer = (0, _styledComponents.default)(_Flex.default).attrs({
58
58
  alignItems: 'center',
59
- paddingX: 1
59
+ paddingLeft: 0.7,
60
+ paddingRight: 1
60
61
  }).withConfig({
61
62
  displayName: "Target__ExpandedIndicatorContainer",
62
63
  componentId: "sc-1t0verh-2"
@@ -77,6 +78,9 @@ function Target(_ref, ref) {
77
78
  return _react.default.createElement(TargetContainer, null, _react.default.createElement(TargetButton, _extends({}, rest, {
78
79
  ref: ref
79
80
  }), children), hasClearButton && !readOnly && _react.default.createElement(_Button.default, {
81
+ style: {
82
+ padding: 0
83
+ },
80
84
  "aria-label": translate(clearButtonLabel, 'select.clearButtonLabel', {
81
85
  label: inputFieldLabel
82
86
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAGA,OAAc,EAEZ,sBAAsB,EAMvB,MAAM,OAAO,CAAC;AAkBf,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAuOjD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AAUvB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAGA,OAAc,EAEZ,sBAAsB,EAMvB,MAAM,OAAO,CAAC;AAoBf,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA8PjD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AAgCvB,eAAe,aAAa,CAAC"}
@@ -27,8 +27,12 @@ var _useClickOutside = _interopRequireDefault(require("../../utils/useClickOutsi
27
27
 
28
28
  var _useUniqueId = _interopRequireDefault(require("../../utils/useUniqueId"));
29
29
 
30
+ var _useUpdateEffect = _interopRequireDefault(require("../../utils/useUpdateEffect"));
31
+
30
32
  var _DropdownList = _interopRequireDefault(require("../DropdownList"));
31
33
 
34
+ var _Button = require("../Button");
35
+
32
36
  var _Target = _interopRequireDefault(require("./Target"));
33
37
 
34
38
  var _propTypes2 = require("./propTypes");
@@ -66,7 +70,10 @@ function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d =
66
70
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
67
71
 
68
72
  function Select(props, ref) {
69
- var clearButtonLabel = props.clearButtonLabel,
73
+ var actions = props.actions,
74
+ clearButtonLabel = props.clearButtonLabel,
75
+ _props$hideClearButto = props.hideClearButton,
76
+ hideClearButton = _props$hideClearButto === void 0 ? false : _props$hideClearButto,
70
77
  defaultValue = props.defaultValue,
71
78
  id = props.id,
72
79
  inputContainerRef = props.inputContainerRef,
@@ -74,10 +81,14 @@ function Select(props, ref) {
74
81
  name = props.name,
75
82
  onChange = props.onChange,
76
83
  onClick = props.onClick,
84
+ onHide = props.onHide,
77
85
  onKeyDown = props.onKeyDown,
86
+ onShow = props.onShow,
78
87
  options = props.options,
88
+ renderOptionLabel = props.renderOptionLabel,
79
89
  propValue = props.value,
80
- zIndex = props.zIndex;
90
+ zIndex = props.zIndex,
91
+ containerSelector = props.containerSelector;
81
92
  var fallbackSelectRef = (0, _react.useRef)(null);
82
93
  var finalSelectRef = ref || fallbackSelectRef;
83
94
  var inputId = (0, _useUniqueId.default)(id, 'select-');
@@ -199,6 +210,19 @@ function Select(props, ref) {
199
210
  }, [isPopoverVisible]);
200
211
  (0, _useClickOutside.default)([listRef], handleClickOutsideList);
201
212
  var inputContainerRefs = (0, _compact.default)([inputContainerRef, popoverTargetRef]);
213
+ /**
214
+ * Triggers onShow/onHide callbacks representing wether the Popover is open or not.
215
+ */
216
+
217
+ (0, _useUpdateEffect.default)(function () {
218
+ if (isPopoverVisible) {
219
+ onShow && onShow();
220
+ }
221
+
222
+ if (!isPopoverVisible) {
223
+ onHide && onHide();
224
+ }
225
+ }, [isPopoverVisible, onHide, onShow]);
202
226
  return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_InputField.default, _extends({}, props, {
203
227
  "aria-live": "assertive",
204
228
  cursor: "default",
@@ -224,7 +248,7 @@ function Select(props, ref) {
224
248
  "aria-owns": dropdownListId,
225
249
  clearButtonLabel: clearButtonLabel,
226
250
  disabled: disabled,
227
- hasClearButton: Boolean(selectedValue),
251
+ hasClearButton: hideClearButton ? false : Boolean(selectedValue),
228
252
  id: targetId,
229
253
  inputFieldLabel: label,
230
254
  isPopoverVisible: isPopoverVisible,
@@ -235,6 +259,7 @@ function Select(props, ref) {
235
259
  ref: targetRef,
236
260
  type: "button"
237
261
  }, value), _react.default.createElement(_DropdownList.default, {
262
+ actions: actions,
238
263
  "aria-labelledby": ariaLabelledBy,
239
264
  borderRadius: "0",
240
265
  id: dropdownListId,
@@ -246,11 +271,13 @@ function Select(props, ref) {
246
271
  onChange: handleChangeValue,
247
272
  onHide: toggleIsPopoverVisible,
248
273
  onShow: toggleIsPopoverVisible,
274
+ renderOptionLabel: renderOptionLabel,
249
275
  selectedIds: selectedValue,
250
276
  showArrow: false,
251
277
  target: popoverTargetRef,
252
278
  visible: isPopoverVisible,
253
- zIndex: zIndex
279
+ zIndex: zIndex,
280
+ containerSelector: containerSelector
254
281
  }));
255
282
  }));
256
283
  }
@@ -258,9 +285,22 @@ function Select(props, ref) {
258
285
  var SelectWithRef = (0, _react.forwardRef)(Select);
259
286
  SelectWithRef.displayName = 'Select';
260
287
  SelectWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
288
+ actions: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
289
+ id: _propTypes.default.string.isRequired
290
+ }))), _propTypes.default.shape({
291
+ left: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
292
+ id: _propTypes.default.string.isRequired
293
+ }))),
294
+ right: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
295
+ id: _propTypes.default.string.isRequired
296
+ })))
297
+ })]),
261
298
  defaultValue: _propTypes2.valueValidator,
262
299
  icon: _propTypes.default.elementType,
263
300
  value: _propTypes2.valueValidator
264
301
  });
302
+ SelectWithRef.defaultProps = {
303
+ actions: undefined
304
+ };
265
305
  var _default = SelectWithRef;
266
306
  exports.default = _default;