@decisiv/ui-components 2.0.1-alpha.15 → 2.0.1-alpha.150

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 (362) 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 +1 -0
  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/Alert/schema.d.ts +3 -0
  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 +51 -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/DropdownList/index.d.ts +4 -0
  111. package/lib/components/DropdownList/index.d.ts.map +1 -1
  112. package/lib/components/DropdownList/index.js +76 -11
  113. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  114. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  115. package/lib/components/DropdownList/propTypes.js +42 -0
  116. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  117. package/lib/components/DropdownList/schema.js +5 -0
  118. package/lib/components/DropdownList/types.d.ts +4 -1
  119. package/lib/components/DropdownList/types.d.ts.map +1 -1
  120. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  121. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  122. package/lib/components/Filter/IconWrapper/index.js +35 -0
  123. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  124. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  125. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  126. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  127. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  128. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  129. package/lib/components/Filter/StyledFilter.js +41 -0
  130. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  131. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  132. package/lib/components/Filter/StyledLabel/index.js +30 -0
  133. package/lib/components/Filter/index.d.ts +5 -0
  134. package/lib/components/Filter/index.d.ts.map +1 -0
  135. package/lib/components/Filter/index.js +107 -0
  136. package/lib/components/Filter/index.test.js +60 -0
  137. package/lib/components/Filter/kind.d.ts +6 -0
  138. package/lib/components/Filter/kind.d.ts.map +1 -0
  139. package/lib/components/Filter/kind.js +45 -0
  140. package/lib/components/Filter/schema.d.ts +9 -0
  141. package/lib/components/Filter/schema.d.ts.map +1 -0
  142. package/lib/components/Filter/schema.js +33 -0
  143. package/lib/components/Filter/types.d.ts +18 -0
  144. package/lib/components/Filter/types.d.ts.map +1 -0
  145. package/lib/components/Filter/types.js +5 -0
  146. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  147. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  148. package/lib/components/JumpTo/JumpToMenu.js +3 -3
  149. package/lib/components/JumpTo/types.js +5 -1
  150. package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
  151. package/lib/components/LeftNav/Item/ClickArea.js +2 -2
  152. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  153. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  154. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  155. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  156. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  157. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  158. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  159. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  160. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  161. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  162. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  163. package/lib/components/LeftNav/Item/types.js +5 -1
  164. package/lib/components/LeftNav/index.test.js +13 -3
  165. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  166. package/lib/components/LeftNav/schema.js +2 -0
  167. package/lib/components/LeftNav/types.d.ts +1 -0
  168. package/lib/components/LeftNav/types.d.ts.map +1 -1
  169. package/lib/components/LeftNav/types.js +5 -1
  170. package/lib/components/Link/DisabledLink.d.ts +7 -0
  171. package/lib/components/Link/DisabledLink.d.ts.map +1 -0
  172. package/lib/components/Link/DisabledLink.js +46 -0
  173. package/lib/components/Link/Link.d.ts +4 -0
  174. package/lib/components/Link/Link.d.ts.map +1 -0
  175. package/lib/components/Link/Link.js +67 -0
  176. package/lib/components/Link/index.d.ts +4 -23
  177. package/lib/components/Link/index.d.ts.map +1 -1
  178. package/lib/components/Link/index.js +20 -158
  179. package/lib/components/Link/index.test.js +63 -42
  180. package/lib/components/Link/schema.d.ts.map +1 -1
  181. package/lib/components/Link/schema.js +2 -1
  182. package/lib/components/Link/styles.d.ts +20 -0
  183. package/lib/components/Link/styles.d.ts.map +1 -0
  184. package/lib/components/Link/styles.js +131 -0
  185. package/lib/components/Link/types.d.ts +28 -0
  186. package/lib/components/Link/types.d.ts.map +1 -0
  187. package/lib/components/Link/types.js +5 -0
  188. package/lib/components/Menu/index.d.ts.map +1 -1
  189. package/lib/components/Menu/index.js +3 -1
  190. package/lib/components/Menu/types.d.ts +2 -0
  191. package/lib/components/Menu/types.d.ts.map +1 -1
  192. package/lib/components/Menu/types.js +5 -1
  193. package/lib/components/Modal/components.d.ts +2 -2
  194. package/lib/components/Modal/types.js +5 -1
  195. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  196. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  197. package/lib/components/Notifications/Notification/components.js +12 -6
  198. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  199. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  200. package/lib/components/Notifications/Notification/index.js +19 -12
  201. package/lib/components/Notifications/Notification/index.test.js +38 -19
  202. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  203. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  204. package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
  205. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  206. package/lib/components/Notifications/Notifier.test.js +79 -10
  207. package/lib/components/Notifications/constants.d.ts +2 -0
  208. package/lib/components/Notifications/constants.d.ts.map +1 -0
  209. package/lib/components/Notifications/constants.js +16 -0
  210. package/lib/components/Notifications/schema.d.ts.map +1 -1
  211. package/lib/components/Notifications/schema.js +2 -1
  212. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  213. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  214. package/lib/components/Notifications/useNotifications.test.js +7 -4
  215. package/lib/components/Pagination/Pagination.d.ts +1 -1
  216. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  217. package/lib/components/Pagination/Pagination.js +1 -0
  218. package/lib/components/Pagination/Pagination.test.js +9 -0
  219. package/lib/components/Pagination/types.js +5 -1
  220. package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
  221. package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
  222. package/lib/components/PasswordField/IconWrapper.js +32 -0
  223. package/lib/components/PasswordField/Input.d.ts +6 -0
  224. package/lib/components/PasswordField/Input.d.ts.map +1 -0
  225. package/lib/components/PasswordField/Input.js +28 -0
  226. package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
  227. package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
  228. package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
  229. package/lib/components/PasswordField/index.d.ts +14 -0
  230. package/lib/components/PasswordField/index.d.ts.map +1 -0
  231. package/lib/components/PasswordField/index.js +113 -0
  232. package/lib/components/PasswordField/index.test.js +217 -0
  233. package/lib/components/PasswordField/schema.d.ts +3 -0
  234. package/lib/components/PasswordField/schema.d.ts.map +1 -0
  235. package/lib/components/PasswordField/schema.js +27 -0
  236. package/lib/components/Popover/index.d.ts.map +1 -1
  237. package/lib/components/Popover/index.js +6 -3
  238. package/lib/components/Popover/schema.d.ts.map +1 -1
  239. package/lib/components/Popover/schema.js +27 -20
  240. package/lib/components/Popover/types.d.ts +1 -0
  241. package/lib/components/Popover/types.d.ts.map +1 -1
  242. package/lib/components/Popover/utils.d.ts +1 -1
  243. package/lib/components/SearchInput/index.d.ts +11 -0
  244. package/lib/components/SearchInput/index.d.ts.map +1 -0
  245. package/lib/components/SearchInput/index.js +190 -0
  246. package/lib/components/SearchInput/index.test.js +417 -0
  247. package/lib/components/SearchInput/schema.d.ts +3 -0
  248. package/lib/components/SearchInput/schema.d.ts.map +1 -0
  249. package/lib/components/SearchInput/schema.js +24 -0
  250. package/lib/components/SearchInput/types.d.ts +28 -0
  251. package/lib/components/SearchInput/types.d.ts.map +1 -0
  252. package/lib/components/SearchInput/types.js +5 -0
  253. package/lib/components/Select/Target.d.ts.map +1 -1
  254. package/lib/components/Select/Target.js +6 -2
  255. package/lib/components/Select/index.d.ts.map +1 -1
  256. package/lib/components/Select/index.js +41 -3
  257. package/lib/components/Select/index.test.js +82 -23
  258. package/lib/components/Select/schema.d.ts.map +1 -1
  259. package/lib/components/Select/schema.js +8 -0
  260. package/lib/components/Select/types.d.ts +5 -1
  261. package/lib/components/Select/types.d.ts.map +1 -1
  262. package/lib/components/Select/types.js +5 -1
  263. package/lib/components/SelectDate/Target.d.ts.map +1 -1
  264. package/lib/components/SelectDate/Target.js +6 -2
  265. package/lib/components/SelectDate/index.d.ts.map +1 -1
  266. package/lib/components/SelectDate/index.js +32 -3
  267. package/lib/components/SelectDate/index.test.js +108 -51
  268. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  269. package/lib/components/SelectDate/schema.js +3 -0
  270. package/lib/components/SelectDate/types.d.ts +3 -0
  271. package/lib/components/SelectDate/types.d.ts.map +1 -1
  272. package/lib/components/SelectDate/types.js +5 -1
  273. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  274. package/lib/components/SelectDateRange/index.js +31 -2
  275. package/lib/components/SelectDateRange/index.test.js +115 -58
  276. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  277. package/lib/components/SelectDateRange/schema.js +3 -0
  278. package/lib/components/SelectDateRange/types.js +5 -1
  279. package/lib/components/SelectMenu/index.d.ts +5 -0
  280. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  281. package/lib/components/SelectMenu/index.js +27 -3
  282. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  283. package/lib/components/SelectMenu/schema.js +4 -0
  284. package/lib/components/Table/Body.d.ts.map +1 -1
  285. package/lib/components/Table/Body.js +28 -17
  286. package/lib/components/Table/Container.d.ts.map +1 -1
  287. package/lib/components/Table/Container.js +6 -1
  288. package/lib/components/Table/DataRow.d.ts.map +1 -1
  289. package/lib/components/Table/DataRow.js +26 -18
  290. package/lib/components/Table/Head.d.ts +1 -1
  291. package/lib/components/Table/Head.d.ts.map +1 -1
  292. package/lib/components/Table/Head.js +10 -5
  293. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  294. package/lib/components/Table/HeaderCell/index.js +19 -6
  295. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  296. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  297. package/lib/components/Table/HeaderCell/types.js +5 -1
  298. package/lib/components/Table/Provider.d.ts +5 -5
  299. package/lib/components/Table/Provider.d.ts.map +1 -1
  300. package/lib/components/Table/Provider.js +10 -11
  301. package/lib/components/Table/index.d.ts.map +1 -1
  302. package/lib/components/Table/index.js +109 -19
  303. package/lib/components/Table/index.test.js +80 -33
  304. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  305. package/lib/components/Table/schema.columns.js +6 -4
  306. package/lib/components/Table/schema.d.ts.map +1 -1
  307. package/lib/components/Table/schema.js +7 -6
  308. package/lib/components/Table/types.d.ts +19 -4
  309. package/lib/components/Table/types.d.ts.map +1 -1
  310. package/lib/components/Table/utils.d.ts +2 -8
  311. package/lib/components/Table/utils.d.ts.map +1 -1
  312. package/lib/components/Table/utils.js +21 -20
  313. package/lib/components/Tabs/types.js +5 -1
  314. package/lib/components/Tag/types.d.ts +1 -1
  315. package/lib/components/Tag/types.d.ts.map +1 -1
  316. package/lib/components/Tag/types.js +5 -1
  317. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  318. package/lib/components/TextArea/TextArea.js +1 -1
  319. package/lib/components/TextArea/index.js +1 -0
  320. package/lib/components/TextArea/index.test.js +5 -0
  321. package/lib/components/TextField/Input.js +1 -1
  322. package/lib/components/TextField/index.test.js +5 -0
  323. package/lib/components/Toggle/index.d.ts.map +1 -1
  324. package/lib/components/Toggle/index.js +4 -0
  325. package/lib/components/Toggle/index.test.js +39 -10
  326. package/lib/components/Toggle/types.js +5 -1
  327. package/lib/components/Tooltip/index.d.ts.map +1 -1
  328. package/lib/components/Tooltip/index.js +3 -13
  329. package/lib/components/Tooltip/schema.d.ts +3 -0
  330. package/lib/components/Tooltip/schema.d.ts.map +1 -0
  331. package/lib/components/Tooltip/schema.js +29 -0
  332. package/lib/components/index.d.ts +4 -0
  333. package/lib/components/index.d.ts.map +1 -1
  334. package/lib/components/index.js +50 -0
  335. package/lib/modifiers/spacingSchema.d.ts.map +1 -1
  336. package/lib/modifiers/spacingSchema.js +29 -16
  337. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  338. package/lib/providers/ConfigProvider/index.js +5 -1
  339. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  340. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  341. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  342. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  343. package/lib/providers/ConfigProvider/utils/translations.d.ts +14 -0
  344. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  345. package/lib/providers/ConfigProvider/utils/translations.js +14 -0
  346. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  347. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  348. package/lib/providers/NotificationsProvider/index.js +47 -28
  349. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  350. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  351. package/lib/utils/joinClassnames.d.ts +3 -0
  352. package/lib/utils/joinClassnames.d.ts.map +1 -0
  353. package/lib/utils/joinClassnames.js +26 -0
  354. package/lib/utils/useFirstMount.d.ts +2 -0
  355. package/lib/utils/useFirstMount.d.ts.map +1 -0
  356. package/lib/utils/useFirstMount.js +19 -0
  357. package/lib/utils/useUpdateEffect.d.ts +4 -0
  358. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  359. package/lib/utils/useUpdateEffect.js +28 -0
  360. package/package.json +2 -2
  361. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  362. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
@@ -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;AA2PjD,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,8 @@ 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,
70
75
  defaultValue = props.defaultValue,
71
76
  id = props.id,
72
77
  inputContainerRef = props.inputContainerRef,
@@ -74,10 +79,14 @@ function Select(props, ref) {
74
79
  name = props.name,
75
80
  onChange = props.onChange,
76
81
  onClick = props.onClick,
82
+ onHide = props.onHide,
77
83
  onKeyDown = props.onKeyDown,
84
+ onShow = props.onShow,
78
85
  options = props.options,
86
+ renderOptionLabel = props.renderOptionLabel,
79
87
  propValue = props.value,
80
- zIndex = props.zIndex;
88
+ zIndex = props.zIndex,
89
+ containerSelector = props.containerSelector;
81
90
  var fallbackSelectRef = (0, _react.useRef)(null);
82
91
  var finalSelectRef = ref || fallbackSelectRef;
83
92
  var inputId = (0, _useUniqueId.default)(id, 'select-');
@@ -199,6 +208,19 @@ function Select(props, ref) {
199
208
  }, [isPopoverVisible]);
200
209
  (0, _useClickOutside.default)([listRef], handleClickOutsideList);
201
210
  var inputContainerRefs = (0, _compact.default)([inputContainerRef, popoverTargetRef]);
211
+ /**
212
+ * Triggers onShow/onHide callbacks representing wether the Popover is open or not.
213
+ */
214
+
215
+ (0, _useUpdateEffect.default)(function () {
216
+ if (isPopoverVisible) {
217
+ onShow && onShow();
218
+ }
219
+
220
+ if (!isPopoverVisible) {
221
+ onHide && onHide();
222
+ }
223
+ }, [isPopoverVisible, onHide, onShow]);
202
224
  return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_InputField.default, _extends({}, props, {
203
225
  "aria-live": "assertive",
204
226
  cursor: "default",
@@ -235,6 +257,7 @@ function Select(props, ref) {
235
257
  ref: targetRef,
236
258
  type: "button"
237
259
  }, value), _react.default.createElement(_DropdownList.default, {
260
+ actions: actions,
238
261
  "aria-labelledby": ariaLabelledBy,
239
262
  borderRadius: "0",
240
263
  id: dropdownListId,
@@ -246,11 +269,13 @@ function Select(props, ref) {
246
269
  onChange: handleChangeValue,
247
270
  onHide: toggleIsPopoverVisible,
248
271
  onShow: toggleIsPopoverVisible,
272
+ renderOptionLabel: renderOptionLabel,
249
273
  selectedIds: selectedValue,
250
274
  showArrow: false,
251
275
  target: popoverTargetRef,
252
276
  visible: isPopoverVisible,
253
- zIndex: zIndex
277
+ zIndex: zIndex,
278
+ containerSelector: containerSelector
254
279
  }));
255
280
  }));
256
281
  }
@@ -258,9 +283,22 @@ function Select(props, ref) {
258
283
  var SelectWithRef = (0, _react.forwardRef)(Select);
259
284
  SelectWithRef.displayName = 'Select';
260
285
  SelectWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
286
+ actions: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
287
+ id: _propTypes.default.string.isRequired
288
+ }))), _propTypes.default.shape({
289
+ left: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
290
+ id: _propTypes.default.string.isRequired
291
+ }))),
292
+ right: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
293
+ id: _propTypes.default.string.isRequired
294
+ })))
295
+ })]),
261
296
  defaultValue: _propTypes2.valueValidator,
262
297
  icon: _propTypes.default.elementType,
263
298
  value: _propTypes2.valueValidator
264
299
  });
300
+ SelectWithRef.defaultProps = {
301
+ actions: undefined
302
+ };
265
303
  var _default = SelectWithRef;
266
304
  exports.default = _default;