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

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 +4 -2
  85. package/lib/components/Button/StyledButton.d.ts.map +1 -1
  86. package/lib/components/Button/StyledButton.js +37 -10
  87. package/lib/components/Button/index.d.ts.map +1 -1
  88. package/lib/components/Button/index.js +51 -12
  89. package/lib/components/Button/index.test.js +43 -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 +13 -5
  93. package/lib/components/Button/types.d.ts +4 -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 +27 -0
  436. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  437. package/lib/providers/ConfigProvider/utils/translations.js +27 -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
@@ -10,6 +10,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
14
+
15
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
16
+
17
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
18
+
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
20
+
13
21
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
22
 
15
23
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -281,29 +289,49 @@ describe('Table', function () {
281
289
  });
282
290
  });
283
291
  describe('fixed columns', function () {
284
- var columnsFixed = [].concat(columns);
285
- var firstColumn = columnsFixed[0];
286
- columnsFixed[0] = _objectSpread({}, firstColumn, {
287
- fixed: 'left'
288
- });
289
- var lastIndex = columnsFixed.length - 1;
290
- var lastColumn = columnsFixed[lastIndex];
291
- columnsFixed[lastIndex] = _objectSpread({}, lastColumn, {
292
- fixed: 'right'
292
+ it('renders columns with sticky styles', function () {
293
+ var columnsFixed = [].concat(columns);
294
+ var firstColumn = columnsFixed[0];
295
+ columnsFixed[0] = _objectSpread({}, firstColumn, {
296
+ fixed: true
297
+ });
298
+ var lastIndex = columnsFixed.length - 1;
299
+ var lastColumn = columnsFixed[lastIndex];
300
+ columnsFixed[lastIndex] = _objectSpread({}, lastColumn, {
301
+ fixed: true
302
+ });
303
+
304
+ var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
305
+ columns: columnsFixed,
306
+ data: data
307
+ })),
308
+ getByText = _render9.getByText,
309
+ container = _render9.container;
310
+
311
+ expect(getByText(firstColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
312
+ expect(getByText(lastColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
313
+ var firstRow = container.querySelector('tbody tr:first-child');
314
+ expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
315
+ expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
293
316
  });
317
+ it('ignores columns in the middle', function () {
318
+ var columnsFixed = [].concat(columns);
319
+ var middleIndex = Math.trunc(columns.length / 2);
320
+ var middleColumn = columnsFixed[middleIndex];
321
+ columnsFixed[middleIndex] = _objectSpread({}, middleColumn, {
322
+ fixed: true
323
+ });
294
324
 
295
- var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
296
- columns: columnsFixed,
297
- data: data
298
- })),
299
- getByText = _render9.getByText,
300
- container = _render9.container;
301
-
302
- expect(getByText(firstColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
303
- expect(getByText(lastColumn.title).closest('th')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
304
- var firstRow = container.querySelector('tbody tr:first-child');
305
- expect((0, _react2.getByText)(firstRow, data[0][firstColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n left: 0px;\n ");
306
- expect((0, _react2.getByText)(firstRow, data[0][lastColumn.name]).closest('td')).toHaveStyle("\n position: sticky;\n right: 0px;\n ");
325
+ var _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
326
+ columns: columnsFixed,
327
+ data: data,
328
+ scroll: "x"
329
+ })),
330
+ container = _render10.container;
331
+
332
+ var firstRow = container.querySelector('tbody tr:first-child');
333
+ expect((0, _react2.getByText)(firstRow, data[0][middleColumn.name]).closest('td')).not.toHaveStyle("\n position: sticky;\n ");
334
+ });
307
335
  });
308
336
  describe('Drag-and-Drop sorting', function () {
309
337
  var dragItem = /*#__PURE__*/function () {
@@ -377,18 +405,18 @@ describe('Table', function () {
377
405
  }();
378
406
 
379
407
  it('calls onDragEnd prop when sorting with DnD', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
380
- var onDragEnd, _render10, getByText;
408
+ var onDragEnd, _render11, getByText;
381
409
 
382
410
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
383
411
  while (1) {
384
412
  switch (_context2.prev = _context2.next) {
385
413
  case 0:
386
414
  onDragEnd = jest.fn();
387
- _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
415
+ _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
388
416
  columns: columns,
389
417
  data: data,
390
418
  onDragEnd: onDragEnd
391
- })), getByText = _render10.getByText;
419
+ })), getByText = _render11.getByText;
392
420
  _context2.next = 4;
393
421
  return dragItem(getByText('Avatar'), 2, 'down', getByText);
394
422
 
@@ -405,14 +433,14 @@ describe('Table', function () {
405
433
  describe('grouped data', function () {
406
434
  // the beginning of the table is outside any group
407
435
  it('does not call onDragEnd prop when moving item to the beginning', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
408
- var onDragEnd, _render11, getByText;
436
+ var onDragEnd, _render12, getByText;
409
437
 
410
438
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
411
439
  while (1) {
412
440
  switch (_context3.prev = _context3.next) {
413
441
  case 0:
414
442
  onDragEnd = jest.fn();
415
- _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
443
+ _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
416
444
  columns: groupColumns,
417
445
  data: groupData,
418
446
  onDragEnd: onDragEnd,
@@ -421,7 +449,7 @@ describe('Table', function () {
421
449
  var name = _ref10.groupData.name;
422
450
  return _react.default.createElement("span", null, name);
423
451
  }
424
- })), getByText = _render11.getByText;
452
+ })), getByText = _render12.getByText;
425
453
  _context3.next = 4;
426
454
  return dragItem(getByText('garlic'), 2, 'up', getByText);
427
455
 
@@ -436,14 +464,14 @@ describe('Table', function () {
436
464
  }, _callee3);
437
465
  })));
438
466
  it('calls onDragEnd prop when moving item to a group before', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
439
- var onDragEnd, _render12, getByText;
467
+ var onDragEnd, _render13, getByText;
440
468
 
441
469
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
442
470
  while (1) {
443
471
  switch (_context4.prev = _context4.next) {
444
472
  case 0:
445
473
  onDragEnd = jest.fn();
446
- _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
474
+ _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
447
475
  columns: groupColumns,
448
476
  data: groupData,
449
477
  onDragEnd: onDragEnd,
@@ -452,7 +480,7 @@ describe('Table', function () {
452
480
  var name = _ref12.groupData.name;
453
481
  return _react.default.createElement("span", null, name);
454
482
  }
455
- })), getByText = _render12.getByText;
483
+ })), getByText = _render13.getByText;
456
484
  _context4.next = 4;
457
485
  return dragItem(getByText('kale'), 2, 'up', getByText);
458
486
 
@@ -467,14 +495,14 @@ describe('Table', function () {
467
495
  }, _callee4);
468
496
  })));
469
497
  it('calls onDragEnd prop when moving item to a group after', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
470
- var onDragEnd, _render13, getByText;
498
+ var onDragEnd, _render14, getByText;
471
499
 
472
500
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
473
501
  while (1) {
474
502
  switch (_context5.prev = _context5.next) {
475
503
  case 0:
476
504
  onDragEnd = jest.fn();
477
- _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
505
+ _render14 = (0, _react2.render)(_react.default.createElement(_.default, {
478
506
  columns: groupColumns,
479
507
  data: groupData,
480
508
  onDragEnd: onDragEnd,
@@ -483,7 +511,7 @@ describe('Table', function () {
483
511
  var name = _ref14.groupData.name;
484
512
  return _react.default.createElement("span", null, name);
485
513
  }
486
- })), getByText = _render13.getByText;
514
+ })), getByText = _render14.getByText;
487
515
  _context5.next = 4;
488
516
  return dragItem(getByText('onion'), 2, 'down', getByText);
489
517
 
@@ -499,4 +527,23 @@ describe('Table', function () {
499
527
  })));
500
528
  });
501
529
  });
530
+ describe('rendering custom header', function () {
531
+ it('renders a custom header', function () {
532
+ var firstColumn = columns[0],
533
+ rest = columns.slice(1);
534
+ var headerTitle = 'Custom header';
535
+
536
+ var _render15 = (0, _react2.render)(_react.default.createElement(_.default, {
537
+ columns: [_objectSpread({
538
+ HeaderCell: function HeaderCell() {
539
+ return _react.default.createElement("span", null, headerTitle);
540
+ }
541
+ }, firstColumn)].concat(_toConsumableArray(rest)),
542
+ data: data
543
+ })),
544
+ getByText = _render15.getByText;
545
+
546
+ expect(getByText(headerTitle)).toBeTruthy();
547
+ });
548
+ });
502
549
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA4BlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.columns.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.columns.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAoClD,eAAe,MAAM,CAAC"}
@@ -12,13 +12,15 @@ var schema = (0, _reactDesc.describe)({
12
12
  displayName: 'Table'
13
13
  });
14
14
  schema.propTypes = {
15
- DataCell: _reactDesc.PropTypes.any.description("A React Component used to render data inside one of the column's data cells.").format('React Component').isRequired,
16
- getCellAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<td>`.'),
17
- getCellKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each cell based on the row's data and the column's name. Defaults to `rowData[columnName]`."),
15
+ HeaderCell: _reactDesc.PropTypes.any.description('A React Component used to render a custom column header cell. See below for more details.').format('React Component'),
16
+ DataCell: _reactDesc.PropTypes.any.description("A React Component used to render data inside one of the column's data cells. See below for more details.").format('React Component').isRequired,
17
+ getCellAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<td>`. Receives the row's data and the column's name as arguments. See below for function signature."),
18
+ getHeaderCellAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<th>` within the `<thead>`. Receives the column name as argument. See below for function signature.'),
19
+ getCellKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each cell based on the row's data and the column's name. Receives the row's data and the column's name as arguments. Defaults to `columnName`. See below for function signature."),
18
20
  name: _reactDesc.PropTypes.string.description('The name of this column. Must be unique to the table.').isRequired,
19
21
  sortBy: _reactDesc.PropTypes.func.description("If included (with a title), makes a column sortable. Will be called with the new sorting type when a user clicks on the column's header. Should cause the data provided to the table to update based on the new sorting type."),
20
22
  title: _reactDesc.PropTypes.string.description("The text displayed in a column's header."),
21
- fixed: _reactDesc.PropTypes.oneOf(['right', 'left']).description('If included, the column will be kept visible when scrolling, sticking to the side defined. Horizontal scroll in table is required')
23
+ fixed: _reactDesc.PropTypes.bool.description('If true the column will be kept visible when scrolling horizontally, it will stick to the left when the column is at the beginning of the array and to the right when at the end. Fixed columns can be grouped at the beginning or at the end of the array, if set to a column in the middle it will be ignored. Horizontal scroll in table is required.')
22
24
  };
23
25
  var _default = schema;
24
26
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA6DlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Table/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAkElD,eAAe,MAAM,CAAC"}
@@ -23,7 +23,7 @@ var schema = (0, _reactDesc.describe)({
23
23
  displayName: 'Table'
24
24
  });
25
25
  schema.propTypes = {
26
- GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided.').format('React Component'),
26
+ GroupHeader: _reactDesc.PropTypes.any.description('A React Component used to render a header within the table for grouped data. Required if `rowDataPath` is provided. Receives `groupData` as prop.').format('React Component'),
27
27
  columns: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of column configuration objects (described in more detail below). Columns will be displayed in the order of the array.').isRequired,
28
28
  data: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object).description('An array of row data objects. Row data can contain basically anything. Rows will be displayed in the order of the array.').isRequired,
29
29
  defaultSort: _reactDesc.PropTypes.shape({
@@ -31,16 +31,17 @@ schema.propTypes = {
31
31
  sortingType: _reactDesc.PropTypes.oneOf([_useSortableHeaders.ASCENDING, _useSortableHeaders.DESCENDING, _useSortableHeaders.UNSORTED]).description('The initial sort type.')
32
32
  }).description("Indicates that the provided data is initially sorted on the given column, in the specified direction. The column's onSort handler will NOT be called; it is assumed that the data has been sorted prior to the initial render."),
33
33
  footer: _reactDesc.PropTypes.any.description("A React Component used to render a footer area beneath the table rows. This component is not included in the 'height' if set.").format('React Component'),
34
- getGroupHeaderAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the `<th>` rendered as a row group header.'),
35
- getRowAttrs: _reactDesc.PropTypes.func.description('A function that returns additional attributes for the rendered `<tr>` within the `<tbody>`.'),
36
- getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Defaults to `rowData['key']` or `rowData['id']`."),
34
+ getGroupHeaderAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the `<th>` rendered as a row group header. Receives the row's data as argument. See below for function signature."),
35
+ getRowAttrs: _reactDesc.PropTypes.func.description("A function that returns additional attributes for the rendered `<tr>` within the `<tbody>`. Receives 2 arguments: the row's data and an options object. See below for function signature."),
36
+ getRowKey: _reactDesc.PropTypes.func.description("A function that returns a unique, stable key for each row based on that row's data. Receives 2 arguments: the row's data and an options object. Defaults to `rowData['key']` or `rowData['id']`. See below for function signature."),
37
37
  height: _reactDesc.PropTypes.string.description('A pass through CSS value for the height of the table.'),
38
38
  kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).description('A flag controlling the kind of table displayed.').defaultValue('primary'),
39
39
  rowDataPath: _reactDesc.PropTypes.string.description('A valid path to an array of rowData objects within a groupData object. Required if `GroupHeader` is provided.'),
40
- scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table. '),
40
+ scroll: _reactDesc.PropTypes.oneOf(['x', 'y']).description('A responsive modifier used to control scrolling on the table.'),
41
41
  size: _reactDesc.PropTypes.oneOf(['_'].concat(_toConsumableArray(Object.keys(_breakpointObserver.sizes)))).description('Defines the breakpoint to use (for use in reactive design).'),
42
42
  variant: _reactDesc.PropTypes.oneOf(['comfortable', 'compact']).description('A flag controlling the variant of the table displayed.').defaultValue('comfortable'),
43
- onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group")
43
+ onDragEnd: _reactDesc.PropTypes.func.description("If present enables Drag-and-Drop sorting. A function called after the order of rows changes when a row is dragged and dropped, it is called with 2 arguments: the index from where it's dragged and the index to where it's dropped, if there are grouped rows each argument is an array where the first element is the group index and the second the row index inside the group. See below for function signature."),
44
+ dragVariant: _reactDesc.PropTypes.oneOf(['handle', 'row']).description('When Drag-and-Drop sorting is enabled, defines if the rows should be dragged only from the default handle or from anywhere in the row. This flag is ignored when a `DragHandle` node is rendered in a `DataCell`.').defaultValue('row')
44
45
  };
45
46
  var _default = schema;
46
47
  exports.default = _default;
@@ -5,17 +5,27 @@ import { ModifiersProp } from 'styled-components-modifiers';
5
5
  import { DroppableProvided, DroppableStateSnapshot, DraggableProvided, DraggableStateSnapshot, DropResult } from 'react-beautiful-dnd';
6
6
  import { KindModifiers, ScrollModifiersConfig, VariantModifiers } from './Container';
7
7
  import { SortableState, SortingTypes } from './hooks/useSortableHeaders';
8
+ import { CustomHeaderCellProps } from './HeaderCell/types';
8
9
  export { KindModifiers, ScrollModifiers, VariantModifiers } from './Container';
9
10
  export interface Column<TData> {
11
+ HeaderCell?: (props: CustomHeaderCellProps) => JSX.Element;
10
12
  DataCell: (props: DataCellProps<TData>) => JSX.Element;
11
13
  getCellAttrs?: (rowData: TData, columnName: string) => object | undefined;
14
+ getHeaderCellAttrs?: (columnName: string) => object | undefined;
12
15
  getCellKey?: (rowData: TData, columnName: string) => string;
13
16
  name: string;
14
17
  sortBy?: (sortingType: SortingTypes) => void;
15
18
  title?: string;
16
- fixed?: 'left' | 'right';
19
+ fixed?: boolean;
17
20
  }
21
+ export declare type DragVariant = 'handle' | 'row';
18
22
  export declare type Columns<TData> = Column<TData>[];
23
+ export interface FixedColumns {
24
+ [name: string]: {
25
+ offset: number;
26
+ alignment: string;
27
+ };
28
+ }
19
29
  export interface HeadProps<TData> {
20
30
  columns: Columns<TData>;
21
31
  kind?: KindModifiers;
@@ -24,7 +34,7 @@ export interface HeadProps<TData> {
24
34
  export interface DataRowProps<TData> {
25
35
  className?: 'group-data-row';
26
36
  columns: Columns<TData>;
27
- getRowAttrs?: (rowData: TData, isGroupHeaderRow?: boolean) => object | undefined;
37
+ getRowAttrs?: TableProps<TData>['getRowAttrs'];
28
38
  groupData?: TData;
29
39
  groupId?: string | undefined;
30
40
  kind?: KindModifiers;
@@ -69,13 +79,18 @@ export interface TableProps<TData extends RowData> extends HeadProps<TData>, Too
69
79
  data: TData[];
70
80
  defaultSort?: SortableState;
71
81
  getGroupHeaderAttrs?: (groupData: TData) => object | undefined;
72
- getRowAttrs?: (rowData: TData, isGroupHeaderRow?: boolean) => object | undefined;
73
- getRowKey?: (rowData: TData) => string;
82
+ getRowAttrs?: (rowData: TData, options: {
83
+ isGroupHeaderRow?: boolean;
84
+ }) => object | undefined;
85
+ getRowKey?: (rowData: TData, options: {
86
+ isGroupHeaderRow?: boolean;
87
+ }) => string;
74
88
  height?: HeightProperty<string>;
75
89
  rowDataPath?: string;
76
90
  scroll?: ModifiersProp<ScrollModifiersConfig, typeof sizes>;
77
91
  size?: keyof typeof sizes;
78
92
  onDragEnd?: (from: number | number[], to: number | number[]) => void;
93
+ dragVariant?: DragVariant;
79
94
  }
80
95
  export interface DroppableWrapperProps {
81
96
  children(provided?: DroppableProvided, snapshot?: DroppableStateSnapshot): React.ReactElement<HTMLElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAA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from './types';
2
2
  export declare function defaultGetRowKey({ key, id }: RowData): string | undefined;
3
3
  export declare function isGroupData<TData>(dataObj: TData, { rowDataPath, GroupHeader }: TableProps<TData>): boolean;
4
4
  export declare const Wrapper: import("styled-components").StyledComponent<"div", any, WrapperProps, never>;
5
- export interface ColumnsOffset {
6
- [name: string]: number;
7
- }
8
5
  export declare function calculateOffsets<T>(columns: Columns<T>, columnsWidth: {
9
6
  [name: string]: number;
10
- }): {
11
- leftColumnsOffset: ColumnsOffset;
12
- rightColumnsOffset: ColumnsOffset;
13
- };
7
+ }): FixedColumns;
14
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAC/B,OAAO,EAAE,KAAK,EACd,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC,GAC9C,OAAO,CAMT;AAaD,eAAO,MAAM,OAAO,8EAQnB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,YAAY,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACvC;IACD,iBAAiB,EAAE,aAAa,CAAC;IACjC,kBAAkB,EAAE,aAAa,CAAC;CACnC,CA6BA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Table/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,EACP,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAC/B,OAAO,EAAE,KAAK,EACd,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,UAAU,CAAC,KAAK,CAAC,GAC9C,OAAO,CAMT;AAaD,eAAO,MAAM,OAAO,8EAQnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,YAAY,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACvC,YAAY,CA4Bd"}
@@ -61,26 +61,27 @@ exports.Wrapper = Wrapper;
61
61
  function calculateOffsets(columns, columnsWidth) {
62
62
  var leftOffset = 0;
63
63
  var rightOffset = 0;
64
- var leftOffsets = {};
65
- var rightOffsets = {};
66
-
67
- for (var indexLeft = 0, indexRight = columns.length - 1; indexLeft < columns.length; indexLeft += 1, indexRight -= 1) {
68
- var leftColumn = columns[indexLeft];
69
- var rightColumn = columns[indexRight];
70
-
71
- if (leftColumn.fixed === 'left') {
72
- leftOffsets[leftColumn.name] = leftOffset;
73
- leftOffset += Math.floor(columnsWidth[leftColumn.name] || 0);
74
- }
75
-
76
- if (rightColumn.fixed === 'right') {
77
- rightOffsets[rightColumn.name] = rightOffset;
78
- rightOffset += Math.floor(columnsWidth[rightColumn.name] || 0);
79
- }
64
+ var fixedColumns = {};
65
+
66
+ for (var index = 0; index < columns.length; index += 1) {
67
+ var column = columns[index];
68
+ if (!column.fixed) break;
69
+ fixedColumns[column.name] = {
70
+ alignment: 'left',
71
+ offset: leftOffset
72
+ };
73
+ leftOffset += Math.floor(columnsWidth[column.name] || 0);
80
74
  }
81
75
 
82
- return {
83
- leftColumnsOffset: leftOffsets,
84
- rightColumnsOffset: rightOffsets
85
- };
76
+ for (var _index = columns.length - 1; _index >= 0; _index -= 1) {
77
+ var _column = columns[_index];
78
+ if (!_column.fixed) break;
79
+ fixedColumns[_column.name] = {
80
+ alignment: 'right',
81
+ offset: rightOffset
82
+ };
83
+ rightOffset += Math.floor(columnsWidth[_column.name] || 0);
84
+ }
85
+
86
+ return fixedColumns;
86
87
  }
@@ -0,0 +1,13 @@
1
+ import React, { Ref, HTMLAttributes } from 'react';
2
+ import { IconProps } from '@decisiv/iconix';
3
+ export declare type TabIcon = (props: IconProps) => JSX.Element;
4
+ export interface TabProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'size'> {
5
+ id: string;
6
+ ref?: Ref<HTMLButtonElement>;
7
+ icon?: TabIcon;
8
+ title: string;
9
+ disabled?: boolean;
10
+ }
11
+ declare const Tab: React.ForwardRefExoticComponent<Pick<TabProps, "title" | "style" | "onDragEnd" | "id" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "icon" | "disabled"> & React.RefAttributes<HTMLButtonElement>>;
12
+ export default Tab;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAEZ,GAAG,EAKH,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,oBAAY,OAAO,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAExD,MAAM,WAAW,QACf,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,GAAG,glJAsDR,CAAC;AAiBF,eAAe,GAAG,CAAC"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _assignRef = _interopRequireDefault(require("../../../utils/assignRef"));
13
+
14
+ var _context = require("../context");
15
+
16
+ var _styles = require("./styles");
17
+
18
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+
24
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
25
+
26
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
27
+
28
+ var Tab = (0, _react.forwardRef)(function (_ref, ref) {
29
+ var id = _ref.id,
30
+ children = _ref.children,
31
+ icon = _ref.icon,
32
+ title = _ref.title,
33
+ onClick = _ref.onClick,
34
+ disabled = _ref.disabled,
35
+ rest = _objectWithoutProperties(_ref, ["id", "children", "icon", "title", "onClick", "disabled"]);
36
+
37
+ var _useTabs = (0, _context.useTabs)(),
38
+ register = _useTabs.register,
39
+ activate = _useTabs.activate,
40
+ activeId = _useTabs.activeId,
41
+ onKeyDown = _useTabs.onKeyDown,
42
+ size = _useTabs.size;
43
+
44
+ var Icon = icon;
45
+ var isActive = id === activeId;
46
+ var internalRef = (0, _react.useRef)(null);
47
+ var handleClick = (0, _react.useCallback)(function (e) {
48
+ !disabled && activate(id);
49
+ onClick && onClick(e);
50
+ }, [id, activate, disabled, onClick]);
51
+
52
+ var assignRefs = function assignRefs(node) {
53
+ (0, _assignRef.default)(ref, node);
54
+ (0, _assignRef.default)(internalRef, node);
55
+ };
56
+
57
+ (0, _react.useEffect)(function () {
58
+ var unregister = register(id, {
59
+ isDisabled: !!disabled,
60
+ content: children,
61
+ ref: internalRef
62
+ });
63
+ return unregister;
64
+ }, [id, disabled, children, internalRef, register]);
65
+ return _react.default.createElement(_styles.TabContainer, _extends({}, rest, {
66
+ "aria-controls": "tab-panel-".concat(id),
67
+ "aria-selected": isActive,
68
+ disabled: !!disabled,
69
+ id: "tab-".concat(id),
70
+ onClick: handleClick,
71
+ onKeyDown: onKeyDown,
72
+ ref: assignRefs,
73
+ role: "tab",
74
+ size: size || 'normal',
75
+ tabIndex: isActive ? 0 : -1,
76
+ type: "button"
77
+ }), Icon && _react.default.createElement(Icon, {
78
+ size: "medium"
79
+ }), _react.default.createElement("span", null, title));
80
+ }); // @ts-ignore
81
+
82
+ Tab.propTypes = {
83
+ id: _propTypes.default.string.isRequired,
84
+ title: _propTypes.default.string.isRequired,
85
+ icon: _propTypes.default.elementType,
86
+ disabled: _propTypes.default.bool
87
+ };
88
+ Tab.displayName = 'Tab';
89
+ Tab.defaultProps = {
90
+ icon: undefined,
91
+ disabled: false
92
+ };
93
+ var _default = Tab;
94
+ exports.default = _default;
@@ -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/Tabs/Tab/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAmC,CAAC;AAqBhD,eAAe,MAAM,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TabProps } from '.';
2
+ interface StyledTabProps extends Omit<TabProps, 'title'> {
3
+ size: 'normal' | 'large';
4
+ }
5
+ export declare const TabContainer: import("styled-components").StyledComponent<"button", any, StyledTabProps, never>;
6
+ export {};
7
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/styles.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,UAAU,cAAe,SAAQ,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;IACtD,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAMD,eAAO,MAAM,YAAY,mFAgFxB,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TabContainer = void 0;
7
+
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+
10
+ var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
11
+
12
+ var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
13
+
14
+ var _designTokens = require("@decisiv/design-tokens");
15
+
16
+ var _BaseButton = _interopRequireDefault(require("../../../atoms/BaseButton"));
17
+
18
+ var _styleModifiers = require("../../../utils/styleModifiers");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
23
+
24
+ /* eslint-disable import/prefer-default-export */
25
+ var base = _designTokens.color.base,
26
+ interaction = _designTokens.color.interaction,
27
+ opacity = _designTokens.color.opacity;
28
+ var shadowColor = (0, _toColorString.default)(interaction.pacificOcean40);
29
+ var yPaddingBySize = {
30
+ normal: 5,
31
+ large: 10
32
+ };
33
+ var TabContainer = (0, _styledComponents.default)(_BaseButton.default).withConfig({
34
+ displayName: "styles__TabContainer",
35
+ componentId: "sc-3l38e9-0"
36
+ })(["color:", ";align-items:center;background:", ";border-radius:2px 2px 0 0;border:1px solid transparent;cursor:default;display:flex;font-size:", ";line-height:1.4;margin:0;outline:none;padding-top:", ";padding-right:", ";padding-bottom:", ";padding-left:", ";position:relative;font-weight:", ";&::after{background:", ";bottom:-1px;content:'';height:3px;left:2px;opacity:0;position:absolute;right:2px;}&:hover{color:", ";}&[aria-selected='true']{border-color:", ";border-bottom-color:transparent;color:", ";margin-bottom:-1px;padding-bottom:", ";&:focus{border-color:", ";border-bottom-color:", ";box-shadow:inset 0 0 0 2px ", ";&::after{opacity:1;}}}&:disabled{color:", ";cursor:not-allowed;}> *:not(span){margin-top:-1px;}> * + span{margin-left:", ";}", ";"], (0, _toColorString.default)(interaction.pacificOcean), (0, _toColorString.default)(base.snowWhite), (0, _rem.default)(_designTokens.typography.size.scale[1]), (0, _rem.default)(yPaddingBySize.normal + 3), (0, _rem.default)(15), (0, _rem.default)(yPaddingBySize.normal - 1), (0, _rem.default)(15), _designTokens.typography.weight.alias.medium, (0, _toColorString.default)(base.snowWhite), (0, _toColorString.default)(interaction.indianOcean), (0, _toColorString.default)(base.quarterMoon), (0, _toColorString.default)(base.alaskanHusky), (0, _rem.default)(yPaddingBySize.normal), (0, _toColorString.default)(interaction.pacificOcean), shadowColor, shadowColor, (0, _toColorString.default)(opacity.charcoal40), (0, _rem.default)(8), (0, _styleModifiers.when)('size', 'large', (0, _styledComponents.css)(["font-size:", ";line-height:1.2;padding-bottom:", ";padding-top:", ";&[aria-selected='true']{padding-bottom:", ";}"], (0, _rem.default)(_designTokens.typography.size.scale[2]), (0, _rem.default)(yPaddingBySize.large - 1), (0, _rem.default)(yPaddingBySize.large + 3), (0, _rem.default)(yPaddingBySize.large))));
37
+ exports.TabContainer = TabContainer;