@toptal/picasso-lab 9.3.0 → 9.3.1

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 (366) hide show
  1. package/CHANGELOG.md +1385 -0
  2. package/{Calendar → dist-package/Calendar}/Calendar.d.ts +0 -0
  3. package/{Calendar → dist-package/Calendar}/Calendar.js +0 -0
  4. package/{Calendar → dist-package/Calendar}/Calendar.js.map +0 -0
  5. package/{Calendar → dist-package/Calendar}/index.d.ts +0 -0
  6. package/{Calendar → dist-package/Calendar}/index.js +0 -0
  7. package/{Calendar → dist-package/Calendar}/index.js.map +0 -0
  8. package/{Calendar → dist-package/Calendar}/styles.d.ts +0 -0
  9. package/{Calendar → dist-package/Calendar}/styles.js +0 -0
  10. package/{Calendar → dist-package/Calendar}/styles.js.map +0 -0
  11. package/{Calendar → dist-package/Calendar}/types.d.ts +0 -0
  12. package/{Calendar → dist-package/Calendar}/types.js +0 -0
  13. package/{Calendar → dist-package/Calendar}/types.js.map +0 -0
  14. package/{DatePicker → dist-package/DatePicker}/DatePicker.d.ts +0 -0
  15. package/{DatePicker → dist-package/DatePicker}/DatePicker.js +0 -0
  16. package/{DatePicker → dist-package/DatePicker}/DatePicker.js.map +0 -0
  17. package/{DatePicker → dist-package/DatePicker}/constants.d.ts +0 -0
  18. package/{DatePicker → dist-package/DatePicker}/constants.js +0 -0
  19. package/{DatePicker → dist-package/DatePicker}/constants.js.map +0 -0
  20. package/{DatePicker → dist-package/DatePicker}/index.d.ts +0 -0
  21. package/{DatePicker → dist-package/DatePicker}/index.js +0 -0
  22. package/{DatePicker → dist-package/DatePicker}/index.js.map +0 -0
  23. package/{DatePicker → dist-package/DatePicker}/styles.d.ts +0 -0
  24. package/{DatePicker → dist-package/DatePicker}/styles.js +0 -0
  25. package/{DatePicker → dist-package/DatePicker}/styles.js.map +0 -0
  26. package/{DatePicker → dist-package/DatePicker}/types.d.ts +0 -0
  27. package/{DatePicker → dist-package/DatePicker}/types.js +0 -0
  28. package/{DatePicker → dist-package/DatePicker}/types.js.map +0 -0
  29. package/{DatePicker → dist-package/DatePicker}/utils.d.ts +0 -0
  30. package/{DatePicker → dist-package/DatePicker}/utils.js +0 -0
  31. package/{DatePicker → dist-package/DatePicker}/utils.js.map +0 -0
  32. package/{Drawer → dist-package/Drawer}/Drawer.d.ts +0 -0
  33. package/{Drawer → dist-package/Drawer}/Drawer.js +0 -0
  34. package/{Drawer → dist-package/Drawer}/Drawer.js.map +0 -0
  35. package/{Drawer → dist-package/Drawer}/index.d.ts +0 -0
  36. package/{Drawer → dist-package/Drawer}/index.js +0 -0
  37. package/{Drawer → dist-package/Drawer}/index.js.map +0 -0
  38. package/{Drawer → dist-package/Drawer}/styles.d.ts +0 -0
  39. package/{Drawer → dist-package/Drawer}/styles.js +0 -0
  40. package/{Drawer → dist-package/Drawer}/styles.js.map +0 -0
  41. package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.d.ts +0 -0
  42. package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.js +0 -0
  43. package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.js.map +0 -0
  44. package/{DrawerTitle → dist-package/DrawerTitle}/index.d.ts +0 -0
  45. package/{DrawerTitle → dist-package/DrawerTitle}/index.js +0 -0
  46. package/{DrawerTitle → dist-package/DrawerTitle}/index.js.map +0 -0
  47. package/{DrawerTitle → dist-package/DrawerTitle}/styles.d.ts +0 -0
  48. package/{DrawerTitle → dist-package/DrawerTitle}/styles.js +0 -0
  49. package/{DrawerTitle → dist-package/DrawerTitle}/styles.js.map +0 -0
  50. package/{Dropzone → dist-package/Dropzone}/Dropzone.d.ts +0 -0
  51. package/{Dropzone → dist-package/Dropzone}/Dropzone.js +1 -1
  52. package/{Dropzone → dist-package/Dropzone}/Dropzone.js.map +1 -1
  53. package/{Dropzone → dist-package/Dropzone}/index.d.ts +0 -0
  54. package/{Dropzone → dist-package/Dropzone}/index.js +0 -0
  55. package/{Dropzone → dist-package/Dropzone}/index.js.map +0 -0
  56. package/{Dropzone → dist-package/Dropzone}/styles.d.ts +0 -0
  57. package/{Dropzone → dist-package/Dropzone}/styles.js +0 -0
  58. package/{Dropzone → dist-package/Dropzone}/styles.js.map +0 -0
  59. package/{Dropzone → dist-package/Dropzone}/types.d.ts +0 -0
  60. package/{Dropzone → dist-package/Dropzone}/types.js +0 -0
  61. package/{Dropzone → dist-package/Dropzone}/types.js.map +0 -0
  62. package/{EmptyState → dist-package/EmptyState}/EmptyState.d.ts +0 -0
  63. package/{EmptyState → dist-package/EmptyState}/EmptyState.js +0 -0
  64. package/{EmptyState → dist-package/EmptyState}/EmptyState.js.map +0 -0
  65. package/{EmptyState → dist-package/EmptyState}/index.d.ts +0 -0
  66. package/{EmptyState → dist-package/EmptyState}/index.js +0 -0
  67. package/{EmptyState → dist-package/EmptyState}/index.js.map +0 -0
  68. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.d.ts +0 -0
  69. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.js +0 -0
  70. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.js.map +0 -0
  71. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.d.ts +0 -0
  72. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.js +0 -0
  73. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.js.map +0 -0
  74. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.d.ts +0 -0
  75. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.js +0 -0
  76. package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.js.map +0 -0
  77. package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.d.ts +0 -0
  78. package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.js +0 -0
  79. package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.js.map +0 -0
  80. package/{EmptyStatePage → dist-package/EmptyStatePage}/index.d.ts +0 -0
  81. package/{EmptyStatePage → dist-package/EmptyStatePage}/index.js +0 -0
  82. package/{EmptyStatePage → dist-package/EmptyStatePage}/index.js.map +0 -0
  83. package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.d.ts +0 -0
  84. package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.js +0 -0
  85. package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.js.map +0 -0
  86. package/{Note → dist-package/Note}/Note.d.ts +0 -0
  87. package/{Note → dist-package/Note}/Note.js +0 -0
  88. package/{Note → dist-package/Note}/Note.js.map +0 -0
  89. package/{Note → dist-package/Note}/index.d.ts +0 -0
  90. package/{Note → dist-package/Note}/index.js +0 -0
  91. package/{Note → dist-package/Note}/index.js.map +0 -0
  92. package/{Note → dist-package/Note}/styles.d.ts +0 -0
  93. package/{Note → dist-package/Note}/styles.js +0 -0
  94. package/{Note → dist-package/Note}/styles.js.map +0 -0
  95. package/{NoteContent → dist-package/NoteContent}/NoteContent.d.ts +0 -0
  96. package/{NoteContent → dist-package/NoteContent}/NoteContent.js +0 -0
  97. package/{NoteContent → dist-package/NoteContent}/NoteContent.js.map +0 -0
  98. package/{NoteContent → dist-package/NoteContent}/index.d.ts +0 -0
  99. package/{NoteContent → dist-package/NoteContent}/index.js +0 -0
  100. package/{NoteContent → dist-package/NoteContent}/index.js.map +0 -0
  101. package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.d.ts +0 -0
  102. package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.js +0 -0
  103. package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.js.map +0 -0
  104. package/{NoteSubtitle → dist-package/NoteSubtitle}/index.d.ts +0 -0
  105. package/{NoteSubtitle → dist-package/NoteSubtitle}/index.js +0 -0
  106. package/{NoteSubtitle → dist-package/NoteSubtitle}/index.js.map +0 -0
  107. package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.d.ts +0 -0
  108. package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.js +0 -0
  109. package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.js.map +0 -0
  110. package/{NoteTitle → dist-package/NoteTitle}/index.d.ts +0 -0
  111. package/{NoteTitle → dist-package/NoteTitle}/index.js +0 -0
  112. package/{NoteTitle → dist-package/NoteTitle}/index.js.map +0 -0
  113. package/{NoteTitle → dist-package/NoteTitle}/styles.d.ts +0 -0
  114. package/{NoteTitle → dist-package/NoteTitle}/styles.js +0 -0
  115. package/{NoteTitle → dist-package/NoteTitle}/styles.js.map +0 -0
  116. package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.d.ts +0 -0
  117. package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.js +0 -0
  118. package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.js.map +0 -0
  119. package/{OverviewBlock → dist-package/OverviewBlock}/index.d.ts +0 -0
  120. package/{OverviewBlock → dist-package/OverviewBlock}/index.js +0 -0
  121. package/{OverviewBlock → dist-package/OverviewBlock}/index.js.map +0 -0
  122. package/{OverviewBlock → dist-package/OverviewBlock}/styles.d.ts +0 -0
  123. package/{OverviewBlock → dist-package/OverviewBlock}/styles.js +0 -0
  124. package/{OverviewBlock → dist-package/OverviewBlock}/styles.js.map +0 -0
  125. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.d.ts +0 -0
  126. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.js +0 -0
  127. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.js.map +0 -0
  128. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.d.ts +0 -0
  129. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.js +0 -0
  130. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.js.map +0 -0
  131. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.d.ts +0 -0
  132. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.js +0 -0
  133. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.js.map +0 -0
  134. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.d.ts +0 -0
  135. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.js +0 -0
  136. package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.js.map +0 -0
  137. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.d.ts +0 -0
  138. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.js +0 -0
  139. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.js.map +0 -0
  140. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.d.ts +0 -0
  141. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.js +0 -0
  142. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.js.map +0 -0
  143. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.d.ts +0 -0
  144. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.js +0 -0
  145. package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.js.map +0 -0
  146. package/dist-package/README.md +26 -0
  147. package/{Section → dist-package/Section}/Section.d.ts +0 -0
  148. package/{Section → dist-package/Section}/Section.js +0 -0
  149. package/{Section → dist-package/Section}/Section.js.map +0 -0
  150. package/{Section → dist-package/Section}/index.d.ts +0 -0
  151. package/{Section → dist-package/Section}/index.js +0 -0
  152. package/{Section → dist-package/Section}/index.js.map +0 -0
  153. package/{Section → dist-package/Section}/styles.d.ts +0 -0
  154. package/{Section → dist-package/Section}/styles.js +0 -0
  155. package/{Section → dist-package/Section}/styles.js.map +0 -0
  156. package/{Timeline → dist-package/Timeline}/Timeline.d.ts +0 -0
  157. package/{Timeline → dist-package/Timeline}/Timeline.js +0 -0
  158. package/{Timeline → dist-package/Timeline}/Timeline.js.map +0 -0
  159. package/{Timeline → dist-package/Timeline}/index.d.ts +0 -0
  160. package/{Timeline → dist-package/Timeline}/index.js +0 -0
  161. package/{Timeline → dist-package/Timeline}/index.js.map +0 -0
  162. package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.d.ts +0 -0
  163. package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.js +0 -0
  164. package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.js.map +0 -0
  165. package/{TimelineRow → dist-package/TimelineRow}/index.d.ts +0 -0
  166. package/{TimelineRow → dist-package/TimelineRow}/index.js +0 -0
  167. package/{TimelineRow → dist-package/TimelineRow}/index.js.map +0 -0
  168. package/{TimelineRow → dist-package/TimelineRow}/styles.d.ts +0 -0
  169. package/{TimelineRow → dist-package/TimelineRow}/styles.js +0 -0
  170. package/{TimelineRow → dist-package/TimelineRow}/styles.js.map +0 -0
  171. package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.d.ts +0 -0
  172. package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.js +0 -0
  173. package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.js.map +0 -0
  174. package/{TypographyOverflow → dist-package/TypographyOverflow}/index.d.ts +0 -0
  175. package/{TypographyOverflow → dist-package/TypographyOverflow}/index.js +0 -0
  176. package/{TypographyOverflow → dist-package/TypographyOverflow}/index.js.map +0 -0
  177. package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.d.ts +0 -0
  178. package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.js +0 -0
  179. package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.js.map +0 -0
  180. package/{index.d.ts → dist-package/index.d.ts} +0 -0
  181. package/{index.js → dist-package/index.js} +0 -0
  182. package/{index.js.map → dist-package/index.js.map} +0 -0
  183. package/dist-package/package.json +53 -0
  184. package/package.json +3 -4
  185. package/src/Calendar/Calendar.tsx +215 -0
  186. package/src/Calendar/__snapshots__/test.tsx.snap +447 -0
  187. package/src/Calendar/index.ts +2 -0
  188. package/src/Calendar/styles.ts +104 -0
  189. package/src/Calendar/test.tsx +20 -0
  190. package/src/Calendar/types.ts +42 -0
  191. package/src/DatePicker/DatePicker.tsx +366 -0
  192. package/src/DatePicker/__image_snapshots__/datepicker-full-width-snap.png +0 -0
  193. package/src/DatePicker/__image_snapshots__/datepicker-with-custom-day-rendering-snap.png +0 -0
  194. package/src/DatePicker/__snapshots__/test.tsx.snap +51 -0
  195. package/src/DatePicker/constants.ts +2 -0
  196. package/src/DatePicker/index.ts +5 -0
  197. package/src/DatePicker/story/AllowCustomValue.example.tsx +33 -0
  198. package/src/DatePicker/story/Autocomplete.example.tsx +47 -0
  199. package/src/DatePicker/story/Default.example.tsx +19 -0
  200. package/src/DatePicker/story/Error.example.tsx +26 -0
  201. package/src/DatePicker/story/Range.example.tsx +22 -0
  202. package/src/DatePicker/story/WithCustomDayRendering.example.tsx +47 -0
  203. package/src/DatePicker/story/WithInitialValue.example.tsx +19 -0
  204. package/src/DatePicker/story/WithInputProps.example.tsx +24 -0
  205. package/src/DatePicker/story/WithNoHideOnSelect.example.tsx +20 -0
  206. package/src/DatePicker/story/WithOnBlurHandler.example.tsx +22 -0
  207. package/src/DatePicker/story/WithSelectionLimits.example.tsx +32 -0
  208. package/src/DatePicker/story/WithTimezone.example.tsx +25 -0
  209. package/src/DatePicker/story/index.jsx +50 -0
  210. package/src/DatePicker/styles.ts +8 -0
  211. package/src/DatePicker/test.tsx +370 -0
  212. package/src/DatePicker/types.ts +13 -0
  213. package/src/DatePicker/utils.ts +123 -0
  214. package/src/Drawer/Drawer.tsx +105 -0
  215. package/src/Drawer/__image_snapshots__/drawer-custom-title-effect-1-snap.png +0 -0
  216. package/src/Drawer/__image_snapshots__/drawer-custom-title-snap.png +0 -0
  217. package/src/Drawer/__image_snapshots__/drawer-default-effect-1-snap.png +0 -0
  218. package/src/Drawer/__image_snapshots__/drawer-default-snap.png +0 -0
  219. package/src/Drawer/__image_snapshots__/drawer-width-effect-1-snap.png +0 -0
  220. package/src/Drawer/__image_snapshots__/drawer-width-effect-2-snap.png +0 -0
  221. package/src/Drawer/__image_snapshots__/drawer-width-effect-3-snap.png +0 -0
  222. package/src/Drawer/__image_snapshots__/drawer-width-effect-4-snap.png +0 -0
  223. package/src/Drawer/__image_snapshots__/drawer-width-effect-5-snap.png +0 -0
  224. package/src/Drawer/__image_snapshots__/drawer-width-snap.png +0 -0
  225. package/src/Drawer/__image_snapshots__/drawer-without-title-effect-1-snap.png +0 -0
  226. package/src/Drawer/__image_snapshots__/drawer-without-title-snap.png +0 -0
  227. package/src/Drawer/index.ts +6 -0
  228. package/src/Drawer/story/CustomTitle.example.tsx +32 -0
  229. package/src/Drawer/story/Default.example.tsx +29 -0
  230. package/src/Drawer/story/DrawerAndNotification.example.tsx +34 -0
  231. package/src/Drawer/story/Widths.example.tsx +46 -0
  232. package/src/Drawer/story/WithoutTitle.example.tsx +22 -0
  233. package/src/Drawer/story/index.jsx +80 -0
  234. package/src/Drawer/styles.ts +42 -0
  235. package/src/DrawerTitle/DrawerTitle.tsx +35 -0
  236. package/src/DrawerTitle/index.ts +1 -0
  237. package/src/DrawerTitle/styles.ts +12 -0
  238. package/src/Dropzone/Dropzone.tsx +146 -0
  239. package/src/Dropzone/__snapshots__/test.tsx.snap +40 -0
  240. package/src/Dropzone/index.ts +7 -0
  241. package/src/Dropzone/story/Default.example.tsx +8 -0
  242. package/src/Dropzone/story/Disabled.example.tsx +25 -0
  243. package/src/Dropzone/story/Error.example.tsx +16 -0
  244. package/src/Dropzone/story/Multiple.example.tsx +30 -0
  245. package/src/Dropzone/story/Uploader.example.tsx +116 -0
  246. package/src/Dropzone/story/Uploading.example.tsx +16 -0
  247. package/src/Dropzone/story/index.jsx +85 -0
  248. package/src/Dropzone/styles.ts +43 -0
  249. package/src/Dropzone/test.tsx +33 -0
  250. package/src/Dropzone/types.ts +56 -0
  251. package/src/EmptyState/EmptyState.tsx +7 -0
  252. package/src/EmptyState/index.tsx +1 -0
  253. package/src/EmptyState/story/index.jsx +13 -0
  254. package/src/EmptyStateCollection/EmptyStateCollection.tsx +56 -0
  255. package/src/EmptyStateCollection/__image_snapshots__/emptystate-collection-emptystatecollection-snap.png +0 -0
  256. package/src/EmptyStateCollection/index.tsx +1 -0
  257. package/src/EmptyStateCollection/story/Default.example.tsx +11 -0
  258. package/src/EmptyStateCollection/story/index.jsx +20 -0
  259. package/src/EmptyStateCollection/styles.ts +10 -0
  260. package/src/EmptyStatePage/EmptyStatePage.tsx +65 -0
  261. package/src/EmptyStatePage/__image_snapshots__/emptystate-page-emptystatepage-snap.png +0 -0
  262. package/src/EmptyStatePage/index.tsx +1 -0
  263. package/src/EmptyStatePage/story/Default.example.tsx +21 -0
  264. package/src/EmptyStatePage/story/index.jsx +21 -0
  265. package/src/EmptyStatePage/styles.ts +9 -0
  266. package/src/Note/Note.tsx +36 -0
  267. package/src/Note/__snapshots__/test.tsx.snap +37 -0
  268. package/src/Note/index.ts +6 -0
  269. package/src/Note/story/Default.example.tsx +14 -0
  270. package/src/Note/story/index.jsx +23 -0
  271. package/src/Note/styles.ts +27 -0
  272. package/src/Note/test.tsx +22 -0
  273. package/src/NoteContent/NoteContent.tsx +23 -0
  274. package/src/NoteContent/index.ts +1 -0
  275. package/src/NoteContent/story/index.jsx +12 -0
  276. package/src/NoteSubtitle/NoteSubtitle.tsx +25 -0
  277. package/src/NoteSubtitle/index.ts +1 -0
  278. package/src/NoteSubtitle/story/index.jsx +12 -0
  279. package/src/NoteTitle/NoteTitle.tsx +34 -0
  280. package/src/NoteTitle/index.ts +1 -0
  281. package/src/NoteTitle/story/index.jsx +12 -0
  282. package/src/NoteTitle/styles.ts +8 -0
  283. package/src/OverviewBlock/OverviewBlock.tsx +125 -0
  284. package/src/OverviewBlock/__image_snapshots__/overviewblock-default-snap.png +0 -0
  285. package/src/OverviewBlock/__image_snapshots__/overviewblock-multi-line-snap.png +0 -0
  286. package/src/OverviewBlock/__image_snapshots__/overviewblock-number-snap.png +0 -0
  287. package/src/OverviewBlock/__image_snapshots__/overviewblock-routing-snap.png +0 -0
  288. package/src/OverviewBlock/__image_snapshots__/overviewblock-text-snap.png +0 -0
  289. package/src/OverviewBlock/index.ts +6 -0
  290. package/src/OverviewBlock/story/Default.example.tsx +35 -0
  291. package/src/OverviewBlock/story/Multiline.example.tsx +51 -0
  292. package/src/OverviewBlock/story/Number.example.tsx +20 -0
  293. package/src/OverviewBlock/story/Routing.example.tsx +40 -0
  294. package/src/OverviewBlock/story/Text.example.tsx +15 -0
  295. package/src/OverviewBlock/story/index.jsx +100 -0
  296. package/src/OverviewBlock/styles.ts +44 -0
  297. package/src/OverviewBlock/test.tsx +111 -0
  298. package/src/OverviewBlockGroup/OverviewBlockGroup.tsx +56 -0
  299. package/src/OverviewBlockGroup/OverviewBlockGroupContext.tsx +21 -0
  300. package/src/OverviewBlockGroup/__image_snapshots__/visual-variants-of-the-groups-block-width-snap.png +0 -0
  301. package/src/OverviewBlockGroup/__image_snapshots__/visual-variants-of-the-groups-center-aligned-snap.png +0 -0
  302. package/src/OverviewBlockGroup/index.ts +1 -0
  303. package/src/OverviewBlockGroup/settings.ts +2 -0
  304. package/src/OverviewBlockGroup/story/BlockWidth.example.tsx +38 -0
  305. package/src/OverviewBlockGroup/story/CenterAligned.example.tsx +17 -0
  306. package/src/OverviewBlockGroup/story/index.jsx +25 -0
  307. package/src/OverviewBlockGroup/test.tsx +17 -0
  308. package/src/OverviewBlockRow/OverviewBlockRow.tsx +22 -0
  309. package/src/OverviewBlockRow/index.ts +1 -0
  310. package/src/OverviewBlockRow/story/index.jsx +11 -0
  311. package/src/OverviewBlockRow/styles.ts +27 -0
  312. package/src/Section/Section.tsx +163 -0
  313. package/src/Section/__snapshots__/test.tsx.snap +186 -0
  314. package/src/Section/index.ts +6 -0
  315. package/src/Section/story/Actions.example.tsx +85 -0
  316. package/src/Section/story/Collapsible.example.tsx +113 -0
  317. package/src/Section/story/Default.example.tsx +77 -0
  318. package/src/Section/story/TitleSize.example.tsx +34 -0
  319. package/src/Section/story/Variant.example.tsx +108 -0
  320. package/src/Section/story/index.jsx +35 -0
  321. package/src/Section/styles.ts +65 -0
  322. package/src/Section/test.tsx +115 -0
  323. package/src/Timeline/Timeline.tsx +25 -0
  324. package/src/Timeline/__snapshots__/test.tsx.snap +332 -0
  325. package/src/Timeline/index.ts +6 -0
  326. package/src/Timeline/story/Dates.example.tsx +52 -0
  327. package/src/Timeline/story/Default.example.tsx +34 -0
  328. package/src/Timeline/story/TrimLastConnector.example.tsx +29 -0
  329. package/src/Timeline/story/index.jsx +27 -0
  330. package/src/Timeline/test.tsx +101 -0
  331. package/src/TimelineRow/TimelineRow.tsx +83 -0
  332. package/src/TimelineRow/index.ts +6 -0
  333. package/src/TimelineRow/story/index.jsx +11 -0
  334. package/src/TimelineRow/styles.ts +47 -0
  335. package/src/TypographyOverflow/TypographyOverflow.tsx +153 -0
  336. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-checkbox-label-effect-1-snap.png +0 -0
  337. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-checkbox-label-snap.png +0 -0
  338. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-custom-tooltip-content-effect-1-snap.png +0 -0
  339. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-custom-tooltip-content-snap.png +0 -0
  340. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-effect-1-snap.png +0 -0
  341. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-effect-2-snap.png +0 -0
  342. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-snap.png +0 -0
  343. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-effect-1-snap.png +0 -0
  344. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-effect-2-snap.png +0 -0
  345. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-snap.png +0 -0
  346. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-effect-1-snap.png +0 -0
  347. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-effect-2-snap.png +0 -0
  348. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-snap.png +0 -0
  349. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-1-snap.png +0 -0
  350. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-2-snap.png +0 -0
  351. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-3-snap.png +0 -0
  352. package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-snap.png +0 -0
  353. package/src/TypographyOverflow/index.ts +6 -0
  354. package/src/TypographyOverflow/story/CheckboxLabel.example.tsx +21 -0
  355. package/src/TypographyOverflow/story/CustomTooltip.example.tsx +22 -0
  356. package/src/TypographyOverflow/story/Default.example.tsx +32 -0
  357. package/src/TypographyOverflow/story/Delay.example.tsx +29 -0
  358. package/src/TypographyOverflow/story/GridWithControls.example.tsx +64 -0
  359. package/src/TypographyOverflow/story/Multiline.example.tsx +59 -0
  360. package/src/TypographyOverflow/story/TooltipVariants.example.tsx +23 -0
  361. package/src/TypographyOverflow/story/index.jsx +83 -0
  362. package/src/TypographyOverflow/styles.ts +29 -0
  363. package/src/TypographyOverflow/test.tsx +60 -0
  364. package/src/index.ts +35 -0
  365. package/src/story/index.jsx +10 -0
  366. package/tsconfig.build.json +7 -0
@@ -0,0 +1,52 @@
1
+ import React from 'react'
2
+ import { Timeline, Note } from '@toptal/picasso-lab'
3
+ import { Tasks16, Pencil16, Email16 } from '@toptal/picasso/Icon'
4
+ import { Link, Typography } from '@toptal/picasso'
5
+
6
+ const Example = () => (
7
+ <div style={{ maxWidth: 500 }}>
8
+ <Timeline>
9
+ <Timeline.Row icon={<Tasks16 />} date='Jun 24, 2020'>
10
+ <Typography>
11
+ System marked job{' '}
12
+ <Link fontSize='inherit'>
13
+ Principal Solutions Product Manager (203875) → Cleo O'Connell
14
+ </Link>{' '}
15
+ as inactive
16
+ </Typography>
17
+ </Timeline.Row>
18
+ <Timeline.Row icon={<Pencil16 />} date='Jun 23, 2020'>
19
+ <Typography inline>
20
+ <Link fontSize='inherit'>Bettina Barreto</Link>
21
+ </Typography>{' '}
22
+ added a note
23
+ <Note>
24
+ <Note.Title>New TOP</Note.Title>
25
+ <Note.Content>
26
+ This part was obfuscated, some content was here.
27
+ </Note.Content>
28
+ </Note>
29
+ </Timeline.Row>
30
+ <Timeline.Row icon={<Tasks16 />} date='Jun 23, 2020'>
31
+ <Typography>
32
+ <Link fontSize='inherit'>Carolina Della Corte</Link> changed
33
+ commitment of{' '}
34
+ <Link fontSize='inherit'>
35
+ Principal Solutions Product Manager (203875) → Cleo O'Connell
36
+ </Link>{' '}
37
+ from part-time to hourly
38
+ </Typography>
39
+ </Timeline.Row>
40
+ <Timeline.Row icon={<Email16 />} date='Jun 22, 2020'>
41
+ <Note>
42
+ <Note.Title>Review of your Toptal coding exercize</Note.Title>
43
+ <Note.Content>
44
+ This part was obfuscated, some content was here.
45
+ </Note.Content>
46
+ </Note>
47
+ </Timeline.Row>
48
+ </Timeline>
49
+ </div>
50
+ )
51
+
52
+ export default Example
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import { Timeline } from '@toptal/picasso-lab'
3
+ import { Typography, Container } from '@toptal/picasso'
4
+
5
+ const Example = () => (
6
+ <Timeline>
7
+ <Timeline.Row>
8
+ <Typography size='medium' variant='heading'>
9
+ Founder
10
+ </Typography>
11
+ <Container bottom='small'>
12
+ <Typography size='small'>Brutalism 2019 - PRESENT</Typography>
13
+ </Container>
14
+ <Typography size='medium'>
15
+ Founded a private practice focusing on computational design and art.
16
+ </Typography>
17
+ </Timeline.Row>
18
+
19
+ <Timeline.Row>
20
+ <Typography size='medium' variant='heading'>
21
+ Computational Geometry Engineer
22
+ </Typography>
23
+ <Container bottom='small'>
24
+ <Typography size='small'>Arkio 2018 - 2019</Typography>
25
+ </Container>
26
+ <Typography size='medium'>
27
+ Worked on the core engine supporting Arkio's computational geometry
28
+ operations in VR.
29
+ </Typography>
30
+ </Timeline.Row>
31
+ </Timeline>
32
+ )
33
+
34
+ export default Example
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Timeline } from '@toptal/picasso-lab'
3
+ import { Typography, Link } from '@toptal/picasso'
4
+
5
+ const Example = () => (
6
+ <Timeline>
7
+ <Timeline.Row date='May 21, 11:17 PM'>
8
+ <Typography as='div'>
9
+ <Link fontSize='inherit'>Lavinia Maluf</Link> commented task{' '}
10
+ <Typography weight='semibold'>
11
+ “Mark meetings’ outcome (through the Unresolved Meetings page)”
12
+ </Typography>{' '}
13
+ on <Link fontSize='inherit'>Obfuscated subject for meeting 124555</Link>
14
+ </Typography>
15
+ </Timeline.Row>
16
+
17
+ <Timeline.Row date='May 23, 9:19 AM' hasConnector={false}>
18
+ <Typography as='div'>
19
+ <Link fontSize='inherit'>Tomas Urban</Link> commented task{' '}
20
+ <Typography weight='semibold'>
21
+ “Mark meetings’ outcome (through the Unresolved Meetings page)”
22
+ </Typography>{' '}
23
+ on <Link fontSize='inherit'>Obfuscated subject for meeting 124555</Link>
24
+ </Typography>
25
+ </Timeline.Row>
26
+ </Timeline>
27
+ )
28
+
29
+ export default Example
@@ -0,0 +1,27 @@
1
+ import PicassoBook from '~/.storybook/components/PicassoBook'
2
+ import timelineRowStory from '../../TimelineRow/story'
3
+ import Timeline from '../Timeline'
4
+
5
+ const page = PicassoBook.section('Picasso Lab').createPage(
6
+ 'Timeline',
7
+ `
8
+ ${PicassoBook.createBaseDocsLink(
9
+ 'https://share.goabstract.com/e4c79c6c-4bcd-4411-97b7-09e821925e8e?mode=build&sha=e93949b90e728478fecb60bd7ba1efc06803315b'
10
+ )}
11
+ `
12
+ )
13
+
14
+ page
15
+ .createTabChapter('Props')
16
+ .addComponentDocs({ component: Timeline, name: 'Timeline' })
17
+ .addComponentDocs(timelineRowStory.componentDocs)
18
+
19
+ page
20
+ .createChapter()
21
+ .addExample('Timeline/story/Default.example.tsx', 'Default') // picasso-skip-visuals
22
+ .addExample('Timeline/story/Dates.example.tsx', 'Dates') // picasso-skip-visuals
23
+ .addExample('Timeline/story/TrimLastConnector.example.tsx', {
24
+ title: 'Trim last connector',
25
+ description:
26
+ 'You can trim last connector by passing `hasConnector={false}` to the `Timeline.Row` component. It can be useful in situation when you sort date points in the ascending order.'
27
+ }) // picasso-skip-visuals
@@ -0,0 +1,101 @@
1
+ import React from 'react'
2
+ import { render, TestingPicasso } from '@toptal/picasso/test-utils'
3
+
4
+ import Timeline, { Props } from './Timeline'
5
+
6
+ const renderTimeline = ({ children }: Props) =>
7
+ render(
8
+ <TestingPicasso>
9
+ <Timeline>{children}</Timeline>
10
+ </TestingPicasso>
11
+ )
12
+
13
+ describe('Timeline', () => {
14
+ it('renders', async () => {
15
+ const { container, queryByText, queryAllByTestId } = renderTimeline({
16
+ children: (
17
+ <>
18
+ <Timeline.Row testIds={{ dot: 'dot' }}>Row #1</Timeline.Row>
19
+ <Timeline.Row testIds={{ dot: 'dot' }}>Row #2</Timeline.Row>
20
+ <Timeline.Row testIds={{ dot: 'dot' }}>Row #3</Timeline.Row>
21
+ </>
22
+ )
23
+ })
24
+
25
+ expect(queryByText('Row #1')).toBeInTheDocument()
26
+ expect(queryByText('Row #2')).toBeInTheDocument()
27
+ expect(queryByText('Row #3')).toBeInTheDocument()
28
+
29
+ expect(queryAllByTestId('dot')).toHaveLength(3)
30
+
31
+ expect(container).toMatchSnapshot()
32
+ })
33
+
34
+ it('renders without a connector', async () => {
35
+ const { container, queryAllByTestId } = renderTimeline({
36
+ children: (
37
+ <>
38
+ <Timeline.Row testIds={{ dot: 'dot', connector: 'connector' }}>
39
+ Row #1
40
+ </Timeline.Row>
41
+ <Timeline.Row testIds={{ dot: 'dot', connector: 'connector' }}>
42
+ Row #2
43
+ </Timeline.Row>
44
+ <Timeline.Row
45
+ testIds={{ dot: 'dot', connector: 'connector' }}
46
+ hasConnector={false}
47
+ >
48
+ Row #3
49
+ </Timeline.Row>
50
+ </>
51
+ )
52
+ })
53
+
54
+ expect(queryAllByTestId('dot')).toHaveLength(3)
55
+ expect(queryAllByTestId('connector')).toHaveLength(2)
56
+
57
+ expect(container).toMatchSnapshot()
58
+ })
59
+
60
+ it('renders with dates', async () => {
61
+ const { container, queryByText } = renderTimeline({
62
+ children: (
63
+ <>
64
+ <Timeline.Row date='25.06.2021'>Row #1</Timeline.Row>
65
+ <Timeline.Row date='25.06.2022'>Row #2</Timeline.Row>
66
+ <Timeline.Row date='25.06.2023'>Row #3</Timeline.Row>
67
+ </>
68
+ )
69
+ })
70
+
71
+ expect(queryByText('25.06.2021')).toBeInTheDocument()
72
+ expect(queryByText('25.06.2022')).toBeInTheDocument()
73
+ expect(queryByText('25.06.2023')).toBeInTheDocument()
74
+
75
+ expect(container).toMatchSnapshot()
76
+ })
77
+
78
+ it('renders with icons', async () => {
79
+ const { container, queryByTestId } = renderTimeline({
80
+ children: (
81
+ <>
82
+ <Timeline.Row icon={<span data-testid='icon-1' />}>
83
+ Row #1
84
+ </Timeline.Row>
85
+ <Timeline.Row icon={<span data-testid='icon-2' />}>
86
+ Row #2
87
+ </Timeline.Row>
88
+ <Timeline.Row icon={<span data-testid='icon-3' />}>
89
+ Row #3
90
+ </Timeline.Row>
91
+ </>
92
+ )
93
+ })
94
+
95
+ expect(queryByTestId('icon-1')).toBeInTheDocument()
96
+ expect(queryByTestId('icon-2')).toBeInTheDocument()
97
+ expect(queryByTestId('icon-3')).toBeInTheDocument()
98
+
99
+ expect(container).toMatchSnapshot()
100
+ })
101
+ })
@@ -0,0 +1,83 @@
1
+ import React, { ReactElement, ReactNode } from 'react'
2
+ import { Theme, makeStyles } from '@material-ui/core/styles'
3
+ import { BaseProps } from '@toptal/picasso-shared'
4
+ import { Container, Typography } from '@toptal/picasso'
5
+ import cx from 'classnames'
6
+
7
+ import styles from './styles'
8
+
9
+ export interface Props extends BaseProps {
10
+ /** Timeline row content */
11
+ children: ReactNode
12
+ /** Icon for the row between lines */
13
+ icon?: ReactElement
14
+ /** Timeline row date */
15
+ date?: string
16
+ /** Whether to render a connector line after the row */
17
+ hasConnector?: boolean
18
+ testIds?: {
19
+ dot?: string
20
+ connector?: string
21
+ }
22
+ }
23
+
24
+ const useStyles = makeStyles<Theme>(styles, {
25
+ name: 'PicassoTimelineRow'
26
+ })
27
+
28
+ const TimelineRow = ({
29
+ className,
30
+ children,
31
+ icon,
32
+ date,
33
+ hasConnector,
34
+ 'data-testid': dataTestId,
35
+ testIds = {}
36
+ }: Props) => {
37
+ const classes = useStyles()
38
+
39
+ return (
40
+ <Container
41
+ data-testid={dataTestId}
42
+ className={cx(classes.root, className)}
43
+ flex
44
+ >
45
+ <Container flex direction='column' alignItems='center' right='medium'>
46
+ {typeof icon !== 'undefined' ? (
47
+ React.cloneElement(icon, {
48
+ className: cx(icon.props.className, classes.icon)
49
+ })
50
+ ) : (
51
+ <div className={classes.dot} data-testid={testIds.dot} />
52
+ )}
53
+ {hasConnector && (
54
+ <div className={classes.connector} data-testid={testIds.connector} />
55
+ )}
56
+ </Container>
57
+
58
+ {date && (
59
+ <Container className={classes.date} right='large'>
60
+ <Typography
61
+ className={classes.dateText}
62
+ weight='semibold'
63
+ size='medium'
64
+ >
65
+ {date}
66
+ </Typography>
67
+ </Container>
68
+ )}
69
+
70
+ <Container className={classes.content} bottom='large'>
71
+ {children}
72
+ </Container>
73
+ </Container>
74
+ )
75
+ }
76
+
77
+ TimelineRow.defaultProps = {
78
+ hasConnector: true
79
+ }
80
+
81
+ TimelineRow.displayName = 'TimelineRow'
82
+
83
+ export default TimelineRow
@@ -0,0 +1,6 @@
1
+ import { OmitInternalProps } from '@toptal/picasso-shared'
2
+
3
+ import { Props } from './TimelineRow'
4
+
5
+ export { default } from './TimelineRow'
6
+ export type TimelineRowProps = OmitInternalProps<Props>
@@ -0,0 +1,11 @@
1
+ import PicassoBook from '~/.storybook/components/PicassoBook'
2
+ import TimelineRow from '../TimelineRow'
3
+
4
+ const componentDocs = PicassoBook.createComponentDocs(
5
+ TimelineRow,
6
+ 'Timeline.Row'
7
+ )
8
+
9
+ export default {
10
+ componentDocs
11
+ }
@@ -0,0 +1,47 @@
1
+ import { createStyles, Theme } from '@material-ui/core/styles'
2
+ import { rem } from '@toptal/picasso-shared'
3
+
4
+ export default ({ palette }: Theme) =>
5
+ createStyles({
6
+ root: {
7
+ // No bottom spacing for the last Container
8
+ '&:last-child $content': {
9
+ marginBottom: 0
10
+ }
11
+ },
12
+ content: {},
13
+ icon: {
14
+ margin: '4px 0',
15
+ color: palette.grey.main2
16
+ },
17
+ dot: {
18
+ // Outer dot icon dimensions should match picasso 16px icons
19
+ width: '16px',
20
+ height: '16px',
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ justifyContent: 'center',
24
+ background: 'white',
25
+ margin: '4px 0',
26
+
27
+ '&:after': {
28
+ content: '""',
29
+ width: '9px',
30
+ height: '9px',
31
+ background: palette.grey.main2,
32
+ borderRadius: '50%',
33
+ lineHeight: '20px'
34
+ }
35
+ },
36
+ date: {
37
+ flex: '0 0 auto'
38
+ },
39
+ dateText: {
40
+ lineHeight: rem('24px')
41
+ },
42
+ connector: {
43
+ flex: 1,
44
+ width: 0,
45
+ borderLeft: `1px dashed ${palette.grey.main2}`
46
+ }
47
+ })
@@ -0,0 +1,153 @@
1
+ import cx from 'classnames'
2
+ import React, { ReactNode, useCallback, useState } from 'react'
3
+ import { makeStyles, Theme } from '@material-ui/core/styles'
4
+ import { Tooltip, Typography, TypographyProps } from '@toptal/picasso'
5
+ import { isOverflown } from '@toptal/picasso/utils'
6
+ import { BaseProps } from '@toptal/picasso-shared'
7
+ import { DelayType, VariantType } from '@toptal/picasso/Tooltip/Tooltip'
8
+
9
+ import styles from './styles'
10
+
11
+ export interface Props extends BaseProps, TypographyProps {
12
+ /** A typography which can possibly overflow */
13
+ children?: ReactNode
14
+ /** Number of lines displayed */
15
+ lines?: number
16
+ /** A content to show in tooltip when typography overflows. By default, TypographyOverflow's children are used. */
17
+ tooltipContent?: ReactNode
18
+ /** A delay in showing the tooltip when typography overflows. */
19
+ tooltipDelay?: DelayType
20
+ /** Tooltip color variant to use. */
21
+ tooltipVariant?: VariantType
22
+ /** Do not show tooltips for shorten content. */
23
+ disableTooltip?: boolean
24
+ }
25
+
26
+ const useStyles = makeStyles<Theme, Props>(styles, {
27
+ name: 'TypographyOverflow'
28
+ })
29
+
30
+ export const TypographyOverflow = (props: Props) => {
31
+ const {
32
+ children,
33
+ lines = 1,
34
+ tooltipContent,
35
+ tooltipDelay,
36
+ tooltipVariant,
37
+ disableTooltip,
38
+ className,
39
+ onClick,
40
+ onMouseEnter,
41
+ style,
42
+ ...rest
43
+ } = props
44
+
45
+ const classes = useStyles(props)
46
+ const [isTooltipActive, setIsTooltipActive] = useState(false)
47
+ const [isTooltipOpened, setIsTooltipOpened] = useState(false)
48
+ const [isTooltipAnimating, setIsTooltipAnimating] = useState(false)
49
+ const isTooltipRendered = isTooltipActive || isTooltipAnimating
50
+ const isMultiline = lines > 1
51
+
52
+ // We are paying a very high price when using dynamic JSS rules
53
+ // for a component that is used on a very large scale.
54
+ // It was causing a major UI freezes and unnecessary style recalculations,
55
+ // that's why we decided to go with inline styles:
56
+ // https://github.com/toptal/picasso/pull/2110
57
+ const extendedStyle = isMultiline
58
+ ? { ...style, WebkitLineClamp: lines }
59
+ : style
60
+
61
+ const handleClick = useCallback(
62
+ (event: React.MouseEvent<HTMLElement>) => {
63
+ if (
64
+ !isTooltipOpened &&
65
+ !disableTooltip &&
66
+ isOverflown(event.currentTarget)
67
+ ) {
68
+ setIsTooltipOpened(true)
69
+ setIsTooltipActive(true)
70
+ }
71
+
72
+ if (onClick) {
73
+ onClick(event)
74
+ }
75
+ },
76
+ [isTooltipOpened, disableTooltip, onClick]
77
+ )
78
+
79
+ const handleMouseEnter = useCallback(
80
+ (event: React.MouseEvent<HTMLElement>) => {
81
+ if (isOverflown(event.currentTarget)) {
82
+ setIsTooltipActive(true)
83
+ setIsTooltipAnimating(true)
84
+ }
85
+
86
+ if (onMouseEnter) {
87
+ onMouseEnter(event)
88
+ }
89
+ },
90
+ [onMouseEnter]
91
+ )
92
+
93
+ const handleTooltipOpen = useCallback(() => {
94
+ setIsTooltipOpened(true)
95
+ }, [])
96
+
97
+ const handleTooltipClose = useCallback(() => {
98
+ setIsTooltipActive(false)
99
+ setIsTooltipOpened(false)
100
+ }, [])
101
+
102
+ const handleTransitionExiting = useCallback(() => {
103
+ setIsTooltipAnimating(true)
104
+ }, [])
105
+
106
+ const handleTransitionExited = useCallback(() => {
107
+ setIsTooltipAnimating(false)
108
+ }, [])
109
+
110
+ const typography = (
111
+ <Typography
112
+ {...rest}
113
+ style={extendedStyle}
114
+ className={cx(
115
+ classes.wrapper,
116
+ isMultiline ? classes.multiLine : classes.singleLine,
117
+ className
118
+ )}
119
+ onClick={handleClick}
120
+ onMouseEnter={handleMouseEnter}
121
+ >
122
+ {children}
123
+ </Typography>
124
+ )
125
+
126
+ const tooltip = (
127
+ <Tooltip
128
+ open={isTooltipOpened}
129
+ content={tooltipContent ?? children}
130
+ variant={tooltipVariant}
131
+ placement='top'
132
+ delay={tooltipDelay}
133
+ interactive
134
+ disableListeners={disableTooltip}
135
+ onOpen={handleTooltipOpen}
136
+ onClose={handleTooltipClose}
137
+ onTransitionExiting={handleTransitionExiting}
138
+ onTransitionExited={handleTransitionExited}
139
+ >
140
+ {typography}
141
+ </Tooltip>
142
+ )
143
+
144
+ return isTooltipRendered ? tooltip : typography
145
+ }
146
+
147
+ TypographyOverflow.displayName = 'TypographyOverflow'
148
+
149
+ TypographyOverflow.defaultProps = {
150
+ noWrap: true
151
+ }
152
+
153
+ export default TypographyOverflow
@@ -0,0 +1,6 @@
1
+ import { OmitInternalProps } from '@toptal/picasso-shared'
2
+
3
+ import { Props } from './TypographyOverflow'
4
+
5
+ export { default } from './TypographyOverflow'
6
+ export type TypographyOverflowProps = OmitInternalProps<Props>
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+ import { Checkbox } from '@toptal/picasso'
3
+ import { TypographyOverflow } from '@toptal/picasso-lab'
4
+
5
+ const Example = () => {
6
+ return (
7
+ <div style={{ display: 'flex' }}>
8
+ <div style={{ marginTop: 100, maxWidth: '150px', flexBasis: '150px' }}>
9
+ <Checkbox
10
+ label={
11
+ <TypographyOverflow data-testid='ellipsed-text'>
12
+ This typography is very long and therefore it overflows.
13
+ </TypographyOverflow>
14
+ }
15
+ />
16
+ </div>
17
+ </div>
18
+ )
19
+ }
20
+
21
+ export default Example
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import { TypographyOverflow } from '@toptal/picasso-lab'
3
+ import { Typography } from '@toptal/picasso'
4
+
5
+ const Example = () => {
6
+ return (
7
+ <div style={{ width: 300, marginTop: 100 }}>
8
+ <TypographyOverflow
9
+ data-testid='ellipsed-text'
10
+ tooltipContent={
11
+ <Typography color='yellow' weight='semibold'>
12
+ This typography is very long and therefore it overflows.
13
+ </Typography>
14
+ }
15
+ >
16
+ This typography is very long and therefore it overflows.
17
+ </TypographyOverflow>
18
+ </div>
19
+ )
20
+ }
21
+
22
+ export default Example
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import { TypographyOverflow } from '@toptal/picasso-lab'
3
+ import styled from 'styled-components'
4
+ import { Container } from '@toptal/picasso'
5
+
6
+ const DynamicWidthContainer = styled(Container)`
7
+ margin-top: 1rem;
8
+ width: 500px;
9
+ padding-right: 20px;
10
+ resize: horizontal;
11
+ overflow: auto;
12
+ border-right: 3px solid black;
13
+ `
14
+
15
+ const Example = () => {
16
+ return (
17
+ <>
18
+ <div style={{ width: 300, marginTop: 100 }}>
19
+ <TypographyOverflow data-testid='ellipsed-text'>
20
+ This typography is very long and therefore it overflows.
21
+ </TypographyOverflow>
22
+ </div>
23
+ <DynamicWidthContainer>
24
+ <TypographyOverflow data-testid='ellipsed-text-dynamic-width'>
25
+ Another typography is very long and has dynamic width. Try to resize.
26
+ </TypographyOverflow>
27
+ </DynamicWidthContainer>
28
+ </>
29
+ )
30
+ }
31
+
32
+ export default Example