@toptal/picasso-lab 9.3.1 → 10.0.0

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/{dist-package/Calendar → Calendar}/Calendar.d.ts +0 -0
  2. package/{dist-package/Calendar → Calendar}/Calendar.js +0 -0
  3. package/{dist-package/Calendar → Calendar}/Calendar.js.map +0 -0
  4. package/{dist-package/Calendar → Calendar}/index.d.ts +0 -0
  5. package/{dist-package/Calendar → Calendar}/index.js +0 -0
  6. package/{dist-package/Calendar → Calendar}/index.js.map +0 -0
  7. package/{dist-package/Calendar → Calendar}/styles.d.ts +0 -0
  8. package/{dist-package/Calendar → Calendar}/styles.js +0 -0
  9. package/{dist-package/Calendar → Calendar}/styles.js.map +0 -0
  10. package/{dist-package/Calendar → Calendar}/types.d.ts +0 -0
  11. package/{dist-package/Calendar → Calendar}/types.js +0 -0
  12. package/{dist-package/Calendar → Calendar}/types.js.map +0 -0
  13. package/{dist-package/DatePicker → DatePicker}/DatePicker.d.ts +0 -0
  14. package/{dist-package/DatePicker → DatePicker}/DatePicker.js +0 -0
  15. package/{dist-package/DatePicker → DatePicker}/DatePicker.js.map +0 -0
  16. package/{dist-package/DatePicker → DatePicker}/constants.d.ts +0 -0
  17. package/{dist-package/DatePicker → DatePicker}/constants.js +0 -0
  18. package/{dist-package/DatePicker → DatePicker}/constants.js.map +0 -0
  19. package/{dist-package/DatePicker → DatePicker}/index.d.ts +0 -0
  20. package/{dist-package/DatePicker → DatePicker}/index.js +0 -0
  21. package/{dist-package/DatePicker → DatePicker}/index.js.map +0 -0
  22. package/{dist-package/DatePicker → DatePicker}/styles.d.ts +0 -0
  23. package/{dist-package/DatePicker → DatePicker}/styles.js +0 -0
  24. package/{dist-package/DatePicker → DatePicker}/styles.js.map +0 -0
  25. package/{dist-package/DatePicker → DatePicker}/types.d.ts +0 -0
  26. package/{dist-package/DatePicker → DatePicker}/types.js +0 -0
  27. package/{dist-package/DatePicker → DatePicker}/types.js.map +0 -0
  28. package/{dist-package/DatePicker → DatePicker}/utils.d.ts +0 -0
  29. package/{dist-package/DatePicker → DatePicker}/utils.js +0 -0
  30. package/{dist-package/DatePicker → DatePicker}/utils.js.map +0 -0
  31. package/{dist-package/Drawer → Drawer}/Drawer.d.ts +0 -0
  32. package/{dist-package/Drawer → Drawer}/Drawer.js +0 -0
  33. package/{dist-package/Drawer → Drawer}/Drawer.js.map +0 -0
  34. package/{dist-package/Drawer → Drawer}/index.d.ts +0 -0
  35. package/{dist-package/Drawer → Drawer}/index.js +0 -0
  36. package/{dist-package/Drawer → Drawer}/index.js.map +0 -0
  37. package/{dist-package/Drawer → Drawer}/styles.d.ts +0 -0
  38. package/{dist-package/Drawer → Drawer}/styles.js +0 -0
  39. package/{dist-package/Drawer → Drawer}/styles.js.map +0 -0
  40. package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.d.ts +0 -0
  41. package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.js +0 -0
  42. package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.js.map +0 -0
  43. package/{dist-package/DrawerTitle → DrawerTitle}/index.d.ts +0 -0
  44. package/{dist-package/DrawerTitle → DrawerTitle}/index.js +0 -0
  45. package/{dist-package/DrawerTitle → DrawerTitle}/index.js.map +0 -0
  46. package/{dist-package/DrawerTitle → DrawerTitle}/styles.d.ts +0 -0
  47. package/{dist-package/DrawerTitle → DrawerTitle}/styles.js +0 -0
  48. package/{dist-package/DrawerTitle → DrawerTitle}/styles.js.map +0 -0
  49. package/{dist-package/Dropzone → Dropzone}/Dropzone.d.ts +0 -0
  50. package/{dist-package/Dropzone → Dropzone}/Dropzone.js +0 -0
  51. package/{dist-package/Dropzone → Dropzone}/Dropzone.js.map +0 -0
  52. package/{dist-package/Dropzone → Dropzone}/index.d.ts +0 -0
  53. package/{dist-package/Dropzone → Dropzone}/index.js +0 -0
  54. package/{dist-package/Dropzone → Dropzone}/index.js.map +0 -0
  55. package/{dist-package/Dropzone → Dropzone}/styles.d.ts +0 -0
  56. package/{dist-package/Dropzone → Dropzone}/styles.js +0 -0
  57. package/{dist-package/Dropzone → Dropzone}/styles.js.map +0 -0
  58. package/{dist-package/Dropzone → Dropzone}/types.d.ts +0 -0
  59. package/{dist-package/Dropzone → Dropzone}/types.js +0 -0
  60. package/{dist-package/Dropzone → Dropzone}/types.js.map +0 -0
  61. package/{dist-package/EmptyState → EmptyState}/EmptyState.d.ts +0 -0
  62. package/{dist-package/EmptyState → EmptyState}/EmptyState.js +0 -0
  63. package/{dist-package/EmptyState → EmptyState}/EmptyState.js.map +0 -0
  64. package/{dist-package/EmptyState → EmptyState}/index.d.ts +0 -0
  65. package/{dist-package/EmptyState → EmptyState}/index.js +0 -0
  66. package/{dist-package/EmptyState → EmptyState}/index.js.map +0 -0
  67. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.d.ts +0 -0
  68. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.js +0 -0
  69. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.js.map +0 -0
  70. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.d.ts +0 -0
  71. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.js +0 -0
  72. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.js.map +0 -0
  73. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.d.ts +0 -0
  74. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.js +0 -0
  75. package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.js.map +0 -0
  76. package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.d.ts +0 -0
  77. package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.js +0 -0
  78. package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.js.map +0 -0
  79. package/{dist-package/EmptyStatePage → EmptyStatePage}/index.d.ts +0 -0
  80. package/{dist-package/EmptyStatePage → EmptyStatePage}/index.js +0 -0
  81. package/{dist-package/EmptyStatePage → EmptyStatePage}/index.js.map +0 -0
  82. package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.d.ts +0 -0
  83. package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.js +0 -0
  84. package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.js.map +0 -0
  85. package/{dist-package/Note → Note}/Note.d.ts +0 -0
  86. package/{dist-package/Note → Note}/Note.js +0 -0
  87. package/{dist-package/Note → Note}/Note.js.map +0 -0
  88. package/{dist-package/Note → Note}/index.d.ts +0 -0
  89. package/{dist-package/Note → Note}/index.js +0 -0
  90. package/{dist-package/Note → Note}/index.js.map +0 -0
  91. package/{dist-package/Note → Note}/styles.d.ts +0 -0
  92. package/{dist-package/Note → Note}/styles.js +0 -0
  93. package/{dist-package/Note → Note}/styles.js.map +0 -0
  94. package/{dist-package/NoteContent → NoteContent}/NoteContent.d.ts +0 -0
  95. package/{dist-package/NoteContent → NoteContent}/NoteContent.js +0 -0
  96. package/{dist-package/NoteContent → NoteContent}/NoteContent.js.map +0 -0
  97. package/{dist-package/NoteContent → NoteContent}/index.d.ts +0 -0
  98. package/{dist-package/NoteContent → NoteContent}/index.js +0 -0
  99. package/{dist-package/NoteContent → NoteContent}/index.js.map +0 -0
  100. package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.d.ts +0 -0
  101. package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.js +0 -0
  102. package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.js.map +0 -0
  103. package/{dist-package/NoteSubtitle → NoteSubtitle}/index.d.ts +0 -0
  104. package/{dist-package/NoteSubtitle → NoteSubtitle}/index.js +0 -0
  105. package/{dist-package/NoteSubtitle → NoteSubtitle}/index.js.map +0 -0
  106. package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.d.ts +0 -0
  107. package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.js +0 -0
  108. package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.js.map +0 -0
  109. package/{dist-package/NoteTitle → NoteTitle}/index.d.ts +0 -0
  110. package/{dist-package/NoteTitle → NoteTitle}/index.js +0 -0
  111. package/{dist-package/NoteTitle → NoteTitle}/index.js.map +0 -0
  112. package/{dist-package/NoteTitle → NoteTitle}/styles.d.ts +0 -0
  113. package/{dist-package/NoteTitle → NoteTitle}/styles.js +0 -0
  114. package/{dist-package/NoteTitle → NoteTitle}/styles.js.map +0 -0
  115. package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.d.ts +0 -0
  116. package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.js +0 -0
  117. package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.js.map +0 -0
  118. package/{dist-package/OverviewBlock → OverviewBlock}/index.d.ts +0 -0
  119. package/{dist-package/OverviewBlock → OverviewBlock}/index.js +0 -0
  120. package/{dist-package/OverviewBlock → OverviewBlock}/index.js.map +0 -0
  121. package/{dist-package/OverviewBlock → OverviewBlock}/styles.d.ts +0 -0
  122. package/{dist-package/OverviewBlock → OverviewBlock}/styles.js +0 -0
  123. package/{dist-package/OverviewBlock → OverviewBlock}/styles.js.map +0 -0
  124. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.d.ts +0 -0
  125. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.js +0 -0
  126. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.js.map +0 -0
  127. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.d.ts +0 -0
  128. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.js +0 -0
  129. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.js.map +0 -0
  130. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.d.ts +0 -0
  131. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.js +0 -0
  132. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.js.map +0 -0
  133. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.d.ts +0 -0
  134. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.js +0 -0
  135. package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.js.map +0 -0
  136. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.d.ts +0 -0
  137. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.js +0 -0
  138. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.js.map +0 -0
  139. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.d.ts +0 -0
  140. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.js +0 -0
  141. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.js.map +0 -0
  142. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.d.ts +0 -0
  143. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.js +0 -0
  144. package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.js.map +0 -0
  145. package/{dist-package/Section → Section}/Section.d.ts +0 -0
  146. package/{dist-package/Section → Section}/Section.js +0 -0
  147. package/{dist-package/Section → Section}/Section.js.map +0 -0
  148. package/{dist-package/Section → Section}/index.d.ts +0 -0
  149. package/{dist-package/Section → Section}/index.js +0 -0
  150. package/{dist-package/Section → Section}/index.js.map +0 -0
  151. package/{dist-package/Section → Section}/styles.d.ts +0 -0
  152. package/{dist-package/Section → Section}/styles.js +0 -0
  153. package/{dist-package/Section → Section}/styles.js.map +0 -0
  154. package/{dist-package/Timeline → Timeline}/Timeline.d.ts +0 -0
  155. package/{dist-package/Timeline → Timeline}/Timeline.js +0 -0
  156. package/{dist-package/Timeline → Timeline}/Timeline.js.map +0 -0
  157. package/{dist-package/Timeline → Timeline}/index.d.ts +0 -0
  158. package/{dist-package/Timeline → Timeline}/index.js +0 -0
  159. package/{dist-package/Timeline → Timeline}/index.js.map +0 -0
  160. package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.d.ts +0 -0
  161. package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.js +0 -0
  162. package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.js.map +0 -0
  163. package/{dist-package/TimelineRow → TimelineRow}/index.d.ts +0 -0
  164. package/{dist-package/TimelineRow → TimelineRow}/index.js +0 -0
  165. package/{dist-package/TimelineRow → TimelineRow}/index.js.map +0 -0
  166. package/{dist-package/TimelineRow → TimelineRow}/styles.d.ts +0 -0
  167. package/{dist-package/TimelineRow → TimelineRow}/styles.js +0 -0
  168. package/{dist-package/TimelineRow → TimelineRow}/styles.js.map +0 -0
  169. package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.d.ts +0 -0
  170. package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.js +0 -0
  171. package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.js.map +0 -0
  172. package/{dist-package/TypographyOverflow → TypographyOverflow}/index.d.ts +0 -0
  173. package/{dist-package/TypographyOverflow → TypographyOverflow}/index.js +0 -0
  174. package/{dist-package/TypographyOverflow → TypographyOverflow}/index.js.map +0 -0
  175. package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.d.ts +0 -0
  176. package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.js +0 -0
  177. package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.js.map +0 -0
  178. package/{dist-package/index.d.ts → index.d.ts} +0 -0
  179. package/{dist-package/index.js → index.js} +0 -0
  180. package/{dist-package/index.js.map → index.js.map} +0 -0
  181. package/package.json +5 -5
  182. package/CHANGELOG.md +0 -1385
  183. package/dist-package/README.md +0 -26
  184. package/dist-package/package.json +0 -53
  185. package/src/Calendar/Calendar.tsx +0 -215
  186. package/src/Calendar/__snapshots__/test.tsx.snap +0 -447
  187. package/src/Calendar/index.ts +0 -2
  188. package/src/Calendar/styles.ts +0 -104
  189. package/src/Calendar/test.tsx +0 -20
  190. package/src/Calendar/types.ts +0 -42
  191. package/src/DatePicker/DatePicker.tsx +0 -366
  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 +0 -51
  195. package/src/DatePicker/constants.ts +0 -2
  196. package/src/DatePicker/index.ts +0 -5
  197. package/src/DatePicker/story/AllowCustomValue.example.tsx +0 -33
  198. package/src/DatePicker/story/Autocomplete.example.tsx +0 -47
  199. package/src/DatePicker/story/Default.example.tsx +0 -19
  200. package/src/DatePicker/story/Error.example.tsx +0 -26
  201. package/src/DatePicker/story/Range.example.tsx +0 -22
  202. package/src/DatePicker/story/WithCustomDayRendering.example.tsx +0 -47
  203. package/src/DatePicker/story/WithInitialValue.example.tsx +0 -19
  204. package/src/DatePicker/story/WithInputProps.example.tsx +0 -24
  205. package/src/DatePicker/story/WithNoHideOnSelect.example.tsx +0 -20
  206. package/src/DatePicker/story/WithOnBlurHandler.example.tsx +0 -22
  207. package/src/DatePicker/story/WithSelectionLimits.example.tsx +0 -32
  208. package/src/DatePicker/story/WithTimezone.example.tsx +0 -25
  209. package/src/DatePicker/story/index.jsx +0 -50
  210. package/src/DatePicker/styles.ts +0 -8
  211. package/src/DatePicker/test.tsx +0 -370
  212. package/src/DatePicker/types.ts +0 -13
  213. package/src/DatePicker/utils.ts +0 -123
  214. package/src/Drawer/Drawer.tsx +0 -105
  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 +0 -6
  228. package/src/Drawer/story/CustomTitle.example.tsx +0 -32
  229. package/src/Drawer/story/Default.example.tsx +0 -29
  230. package/src/Drawer/story/DrawerAndNotification.example.tsx +0 -34
  231. package/src/Drawer/story/Widths.example.tsx +0 -46
  232. package/src/Drawer/story/WithoutTitle.example.tsx +0 -22
  233. package/src/Drawer/story/index.jsx +0 -80
  234. package/src/Drawer/styles.ts +0 -42
  235. package/src/DrawerTitle/DrawerTitle.tsx +0 -35
  236. package/src/DrawerTitle/index.ts +0 -1
  237. package/src/DrawerTitle/styles.ts +0 -12
  238. package/src/Dropzone/Dropzone.tsx +0 -146
  239. package/src/Dropzone/__snapshots__/test.tsx.snap +0 -40
  240. package/src/Dropzone/index.ts +0 -7
  241. package/src/Dropzone/story/Default.example.tsx +0 -8
  242. package/src/Dropzone/story/Disabled.example.tsx +0 -25
  243. package/src/Dropzone/story/Error.example.tsx +0 -16
  244. package/src/Dropzone/story/Multiple.example.tsx +0 -30
  245. package/src/Dropzone/story/Uploader.example.tsx +0 -116
  246. package/src/Dropzone/story/Uploading.example.tsx +0 -16
  247. package/src/Dropzone/story/index.jsx +0 -85
  248. package/src/Dropzone/styles.ts +0 -43
  249. package/src/Dropzone/test.tsx +0 -33
  250. package/src/Dropzone/types.ts +0 -56
  251. package/src/EmptyState/EmptyState.tsx +0 -7
  252. package/src/EmptyState/index.tsx +0 -1
  253. package/src/EmptyState/story/index.jsx +0 -13
  254. package/src/EmptyStateCollection/EmptyStateCollection.tsx +0 -56
  255. package/src/EmptyStateCollection/__image_snapshots__/emptystate-collection-emptystatecollection-snap.png +0 -0
  256. package/src/EmptyStateCollection/index.tsx +0 -1
  257. package/src/EmptyStateCollection/story/Default.example.tsx +0 -11
  258. package/src/EmptyStateCollection/story/index.jsx +0 -20
  259. package/src/EmptyStateCollection/styles.ts +0 -10
  260. package/src/EmptyStatePage/EmptyStatePage.tsx +0 -65
  261. package/src/EmptyStatePage/__image_snapshots__/emptystate-page-emptystatepage-snap.png +0 -0
  262. package/src/EmptyStatePage/index.tsx +0 -1
  263. package/src/EmptyStatePage/story/Default.example.tsx +0 -21
  264. package/src/EmptyStatePage/story/index.jsx +0 -21
  265. package/src/EmptyStatePage/styles.ts +0 -9
  266. package/src/Note/Note.tsx +0 -36
  267. package/src/Note/__snapshots__/test.tsx.snap +0 -37
  268. package/src/Note/index.ts +0 -6
  269. package/src/Note/story/Default.example.tsx +0 -14
  270. package/src/Note/story/index.jsx +0 -23
  271. package/src/Note/styles.ts +0 -27
  272. package/src/Note/test.tsx +0 -22
  273. package/src/NoteContent/NoteContent.tsx +0 -23
  274. package/src/NoteContent/index.ts +0 -1
  275. package/src/NoteContent/story/index.jsx +0 -12
  276. package/src/NoteSubtitle/NoteSubtitle.tsx +0 -25
  277. package/src/NoteSubtitle/index.ts +0 -1
  278. package/src/NoteSubtitle/story/index.jsx +0 -12
  279. package/src/NoteTitle/NoteTitle.tsx +0 -34
  280. package/src/NoteTitle/index.ts +0 -1
  281. package/src/NoteTitle/story/index.jsx +0 -12
  282. package/src/NoteTitle/styles.ts +0 -8
  283. package/src/OverviewBlock/OverviewBlock.tsx +0 -125
  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 +0 -6
  290. package/src/OverviewBlock/story/Default.example.tsx +0 -35
  291. package/src/OverviewBlock/story/Multiline.example.tsx +0 -51
  292. package/src/OverviewBlock/story/Number.example.tsx +0 -20
  293. package/src/OverviewBlock/story/Routing.example.tsx +0 -40
  294. package/src/OverviewBlock/story/Text.example.tsx +0 -15
  295. package/src/OverviewBlock/story/index.jsx +0 -100
  296. package/src/OverviewBlock/styles.ts +0 -44
  297. package/src/OverviewBlock/test.tsx +0 -111
  298. package/src/OverviewBlockGroup/OverviewBlockGroup.tsx +0 -56
  299. package/src/OverviewBlockGroup/OverviewBlockGroupContext.tsx +0 -21
  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 +0 -1
  303. package/src/OverviewBlockGroup/settings.ts +0 -2
  304. package/src/OverviewBlockGroup/story/BlockWidth.example.tsx +0 -38
  305. package/src/OverviewBlockGroup/story/CenterAligned.example.tsx +0 -17
  306. package/src/OverviewBlockGroup/story/index.jsx +0 -25
  307. package/src/OverviewBlockGroup/test.tsx +0 -17
  308. package/src/OverviewBlockRow/OverviewBlockRow.tsx +0 -22
  309. package/src/OverviewBlockRow/index.ts +0 -1
  310. package/src/OverviewBlockRow/story/index.jsx +0 -11
  311. package/src/OverviewBlockRow/styles.ts +0 -27
  312. package/src/Section/Section.tsx +0 -163
  313. package/src/Section/__snapshots__/test.tsx.snap +0 -186
  314. package/src/Section/index.ts +0 -6
  315. package/src/Section/story/Actions.example.tsx +0 -85
  316. package/src/Section/story/Collapsible.example.tsx +0 -113
  317. package/src/Section/story/Default.example.tsx +0 -77
  318. package/src/Section/story/TitleSize.example.tsx +0 -34
  319. package/src/Section/story/Variant.example.tsx +0 -108
  320. package/src/Section/story/index.jsx +0 -35
  321. package/src/Section/styles.ts +0 -65
  322. package/src/Section/test.tsx +0 -115
  323. package/src/Timeline/Timeline.tsx +0 -25
  324. package/src/Timeline/__snapshots__/test.tsx.snap +0 -332
  325. package/src/Timeline/index.ts +0 -6
  326. package/src/Timeline/story/Dates.example.tsx +0 -52
  327. package/src/Timeline/story/Default.example.tsx +0 -34
  328. package/src/Timeline/story/TrimLastConnector.example.tsx +0 -29
  329. package/src/Timeline/story/index.jsx +0 -27
  330. package/src/Timeline/test.tsx +0 -101
  331. package/src/TimelineRow/TimelineRow.tsx +0 -83
  332. package/src/TimelineRow/index.ts +0 -6
  333. package/src/TimelineRow/story/index.jsx +0 -11
  334. package/src/TimelineRow/styles.ts +0 -47
  335. package/src/TypographyOverflow/TypographyOverflow.tsx +0 -153
  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 +0 -6
  354. package/src/TypographyOverflow/story/CheckboxLabel.example.tsx +0 -21
  355. package/src/TypographyOverflow/story/CustomTooltip.example.tsx +0 -22
  356. package/src/TypographyOverflow/story/Default.example.tsx +0 -32
  357. package/src/TypographyOverflow/story/Delay.example.tsx +0 -29
  358. package/src/TypographyOverflow/story/GridWithControls.example.tsx +0 -64
  359. package/src/TypographyOverflow/story/Multiline.example.tsx +0 -59
  360. package/src/TypographyOverflow/story/TooltipVariants.example.tsx +0 -23
  361. package/src/TypographyOverflow/story/index.jsx +0 -83
  362. package/src/TypographyOverflow/styles.ts +0 -29
  363. package/src/TypographyOverflow/test.tsx +0 -60
  364. package/src/index.ts +0 -35
  365. package/src/story/index.jsx +0 -10
  366. package/tsconfig.build.json +0 -7
@@ -1,366 +0,0 @@
1
- /* eslint-disable max-lines-per-function, max-lines */
2
- /* eslint-disable complexity, max-statements */ // Squiggly lines makes code difficult to work with
3
- import { makeStyles, Theme } from '@material-ui/core/styles'
4
- import {
5
- BaseProps,
6
- Container,
7
- Input,
8
- InputAdornment,
9
- InputProps
10
- } from '@toptal/picasso'
11
- import { Calendar16 } from '@toptal/picasso/Icon'
12
- import Popper from '@toptal/picasso/Popper'
13
- import { noop } from '@toptal/picasso/utils'
14
- import formatDate from 'date-fns/format'
15
- import PopperJs from 'popper.js'
16
- import React, {
17
- KeyboardEvent,
18
- ReactNode,
19
- useCallback,
20
- useLayoutEffect,
21
- useRef,
22
- useState
23
- } from 'react'
24
-
25
- import Calendar, {
26
- DateOrDateRangeType,
27
- DateRangeType,
28
- DayProps
29
- } from '../Calendar'
30
- import {
31
- DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT,
32
- DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT
33
- } from './constants'
34
- import styles from './styles'
35
- import { DatePickerValue, DatePickerStringParser } from './types'
36
- import {
37
- formatDateRange,
38
- datePickerParseDateString,
39
- timezoneConvert,
40
- timezoneFormat,
41
- isValidDateValue
42
- } from './utils'
43
-
44
- const EMPTY_INPUT_VALUE = ''
45
-
46
- const useStyles = makeStyles<Theme>(styles, {
47
- name: 'PicassoDatePicker'
48
- })
49
-
50
- export interface Props
51
- extends BaseProps,
52
- Omit<
53
- InputProps,
54
- | 'value'
55
- | 'onSelect'
56
- | 'type'
57
- | 'multiline'
58
- | 'rows'
59
- | 'defaultValue'
60
- | 'onChange'
61
- > {
62
- /** Date that will be selected in `DatePicker` */
63
- value?: DatePickerValue
64
- /** Method that will be invoked with selected values */
65
- onChange: (value: DatePickerValue) => void
66
- /** Invoked when user goes away from `DatePicker` input */
67
- onBlur?: () => void
68
- /** Whether calendar supports single date selection or range */
69
- range?: boolean
70
- /** Earliest date available for selection */
71
- minDate?: Date
72
- /** Latest date available for selection */
73
- maxDate?: Date
74
- /** Whether calendar should be closed after date selection. True by default */
75
- hideOnSelect?: boolean
76
- /** Date format that user will see in the input */
77
- displayDateFormat?: string
78
- /** Date range where selection is not allowed */
79
- disabledIntervals?: { start: Date; end: Date }[]
80
- /** Date format that user will see during manual input */
81
- editDateFormat?: string
82
- /** Specify icon which should be rendered inside `DatePicker` */
83
- icon?: ReactNode
84
- /** Specify a value if want to enable browser autofill */
85
- autoComplete?: string
86
- /** Indicate whether `DatePicker`'s input is in error state */
87
- error?: boolean
88
- /** Function to override default markup to show Date */
89
- renderDay?: (args: DayProps) => ReactNode
90
- popperContainer?: HTMLElement
91
- /** Index of the first day of the week (0 - Sunday). Default is 1 - Monday */
92
- weekStartsOn?: number
93
- /** IANA timezone to display and edit date(s) */
94
- timezone?: string
95
- /* Invoked when input value has been changed. If method failed to parse a value, it must return undefined. Used to process input value before passing it to the `onChange` */
96
- parseInputValue?: DatePickerStringParser
97
- }
98
- export const DatePicker = (props: Props) => {
99
- const {
100
- range,
101
- hideOnSelect,
102
- displayDateFormat = DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT,
103
- editDateFormat = DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT,
104
- onBlur = noop,
105
- onChange,
106
- value,
107
- width,
108
- icon,
109
- minDate,
110
- maxDate,
111
- disabledIntervals,
112
- popperContainer,
113
- renderDay,
114
- weekStartsOn,
115
- timezone,
116
- size,
117
- parseInputValue = datePickerParseDateString,
118
- ...rest
119
- } = props
120
- const classes = useStyles()
121
-
122
- const inputProps = rest
123
-
124
- const [calendarIsShown, setCalendarIsShown] = useState(false)
125
- const [isInputFocused, setIsInputFocused] = useState(false)
126
- const [inputValue, setInputValue] = useState(EMPTY_INPUT_VALUE)
127
- const [
128
- calendarValue,
129
- setCalendarValue
130
- ] = useState<DateOrDateRangeType | null>(null)
131
-
132
- const hideCalendar = () => setCalendarIsShown(false)
133
- const showCalendar = () => setCalendarIsShown(true)
134
-
135
- const inputRef = useRef<HTMLInputElement>(null)
136
- const popperRef = useRef<PopperJs>(null)
137
- const calendarRef = useRef<HTMLDivElement>(null)
138
- const inputWrapperRef = useRef<HTMLDivElement>(null)
139
-
140
- // Format the input based on its 'focus' state
141
- const formatInputValue = useCallback(
142
- (valueToFormat: DateOrDateRangeType | string) => {
143
- if (!isValidDateValue(valueToFormat)) {
144
- return valueToFormat
145
- }
146
-
147
- return Array.isArray(valueToFormat)
148
- ? formatDateRange(valueToFormat as DateRangeType, displayDateFormat)
149
- : formatDate(
150
- valueToFormat as Date,
151
- isInputFocused ? editDateFormat : displayDateFormat
152
- )
153
- },
154
- [isInputFocused, editDateFormat, displayDateFormat]
155
- )
156
-
157
- // Keep the input format in sync with its 'focus' state
158
- useLayoutEffect(() => {
159
- setInputValue(() => {
160
- if (!value) {
161
- return EMPTY_INPUT_VALUE
162
- }
163
-
164
- if (!isValidDateValue(value)) {
165
- return value
166
- }
167
-
168
- return formatInputValue(timezoneConvert(value, timezone))
169
- })
170
- }, [value, timezone, formatInputValue])
171
-
172
- // Keep the calendar in sync with the input value
173
- useLayoutEffect(() => {
174
- setCalendarValue(() => {
175
- if (!value || !isValidDateValue(value)) {
176
- return null
177
- }
178
-
179
- return timezoneConvert(value, timezone)
180
- })
181
- }, [value, timezone])
182
-
183
- const isInsideDatePicker = (node: Node) => {
184
- return (
185
- popperRef.current?.popper.contains(node) ||
186
- inputWrapperRef.current?.contains(node)
187
- )
188
- }
189
-
190
- const handleBlur = (event: React.FocusEvent<HTMLDivElement>) => {
191
- const isFocusedInsideDatePicker = isInsideDatePicker(
192
- (event.relatedTarget || document.activeElement) as Node
193
- )
194
-
195
- if (isFocusedInsideDatePicker) {
196
- return
197
- }
198
-
199
- hideCalendar()
200
- onBlur()
201
-
202
- setIsInputFocused(false)
203
- }
204
-
205
- const handleInputChange = (
206
- e: React.ChangeEvent<
207
- HTMLTextAreaElement | HTMLInputElement | HTMLSelectElement
208
- >
209
- ) => {
210
- // TODO: change this if manual entering of range is needed
211
- if (range) {
212
- return
213
- }
214
-
215
- const nextValue = e.target.value
216
-
217
- // TODO: add char filtering (only number , `-` or ` ` allowed)
218
- setInputValue(nextValue)
219
- if (!nextValue) {
220
- onChange(null)
221
- } else {
222
- const parsedInputValue = parseInputValue(nextValue, {
223
- dateFormat: editDateFormat,
224
- timezone,
225
- minDate,
226
- maxDate
227
- })
228
-
229
- if (parsedInputValue) {
230
- onChange(parsedInputValue)
231
- }
232
- }
233
- }
234
-
235
- const focus = () => {
236
- if (inputRef && inputRef.current) {
237
- inputRef.current.focus()
238
- }
239
- }
240
-
241
- const handleCalendarChange = (nextValue: DateOrDateRangeType) => {
242
- const nextTimezoneValue = Array.isArray(nextValue)
243
- ? (nextValue.map((date: Date) =>
244
- timezoneFormat(date, timezone)
245
- ) as DateRangeType)
246
- : timezoneFormat(nextValue, timezone)
247
-
248
- onChange(nextTimezoneValue)
249
- setCalendarValue(nextTimezoneValue)
250
-
251
- if (hideOnSelect) {
252
- focus()
253
- hideCalendar()
254
- }
255
- }
256
-
257
- const handleInputKeydown = (event: KeyboardEvent<HTMLInputElement>) => {
258
- const key = event.key
259
-
260
- if (key === 'Escape') {
261
- hideCalendar()
262
- event.currentTarget.blur()
263
-
264
- return
265
- }
266
-
267
- if (key === 'Enter') {
268
- if (!calendarIsShown) {
269
- showCalendar()
270
- } else {
271
- hideCalendar()
272
- }
273
-
274
- return
275
- }
276
-
277
- if (key === 'Tab' && calendarIsShown) {
278
- event.preventDefault()
279
- event.stopPropagation()
280
-
281
- if (!calendarIsShown) {
282
- event.currentTarget.blur()
283
- } else {
284
- // TODO: Manage this whole logic inside simple-react-calendar
285
- const firstButton = calendarRef.current?.querySelector<HTMLButtonElement>(
286
- 'button:not([tabindex="-1"])'
287
- )
288
-
289
- if (firstButton) {
290
- firstButton.focus()
291
- }
292
- }
293
- }
294
- }
295
-
296
- const handleFocusOrClick = () => {
297
- showCalendar()
298
- setIsInputFocused(true)
299
- }
300
-
301
- const startAdornment =
302
- size !== 'small' ? (
303
- <InputAdornment position='start' disablePointerEvents>
304
- {icon || <Calendar16 />}
305
- </InputAdornment>
306
- ) : undefined
307
-
308
- return (
309
- <>
310
- <Container inline={width !== 'full'} ref={inputWrapperRef}>
311
- <Input
312
- {...inputProps}
313
- ref={inputRef}
314
- onKeyDown={handleInputKeydown}
315
- onClick={handleFocusOrClick}
316
- onFocus={handleFocusOrClick}
317
- onBlur={handleBlur}
318
- value={inputValue}
319
- onChange={handleInputChange}
320
- size={size}
321
- startAdornment={startAdornment}
322
- width={width}
323
- />
324
- </Container>
325
- {inputWrapperRef.current && (
326
- <Popper
327
- placement='bottom-start'
328
- open={calendarIsShown}
329
- anchorEl={inputWrapperRef.current}
330
- autoWidth={false}
331
- enableCompactMode
332
- container={popperContainer}
333
- ref={popperRef}
334
- >
335
- <Calendar
336
- data-testid='calendar'
337
- ref={calendarRef}
338
- range={range}
339
- value={calendarValue ?? undefined}
340
- minDate={minDate}
341
- maxDate={maxDate}
342
- disabledIntervals={disabledIntervals}
343
- renderDay={renderDay}
344
- onChange={handleCalendarChange}
345
- onBlur={handleBlur}
346
- className={classes.calendar}
347
- weekStartsOn={weekStartsOn}
348
- />
349
- </Popper>
350
- )}
351
- </>
352
- )
353
- }
354
-
355
- DatePicker.defaultProps = {
356
- range: false,
357
- hideOnSelect: true,
358
- onBlur: noop,
359
- editDateFormat: 'MM-dd-yyyy',
360
- displayDateFormat: 'MMM d, yyyy',
361
- autoComplete: 'off'
362
- }
363
-
364
- DatePicker.displayName = 'DatePicker'
365
-
366
- export default DatePicker
@@ -1,51 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`DatePicker renders 1`] = `
4
- <div>
5
- <div
6
- class="Picasso-root"
7
- >
8
- <div
9
- class="PicassoContainer-inline"
10
- >
11
- <div
12
- class="MuiInputBase-root MuiOutlinedInput-root PicassoOutlinedInput-root PicassoInput-root PicassoOutlinedInput-rootAuto PicassoOutlinedInput-rootMedium MuiInputBase-adornedStart MuiOutlinedInput-adornedStart MuiInputBase-adornedEnd MuiOutlinedInput-adornedEnd"
13
- >
14
- <div
15
- class="MuiInputAdornment-root PicassoInputAdornment-root MuiInputAdornment-disablePointerEvents MuiInputAdornment-positionStart"
16
- >
17
- <svg
18
- class="PicassoSvgCalendar16-root"
19
- style="min-width: 16px; min-height: 16px;"
20
- viewBox="0 0 16 16"
21
- >
22
- <path
23
- d="M3 2V1h1v1h8V1h1v1h3v13H0V2h3zm0 1H1v2h14V3h-2v1h-1V3H4v1H3V3zm12 3H1v8h14V6z"
24
- />
25
- </svg>
26
- </div>
27
- <input
28
- autocomplete="off"
29
- class="MuiInputBase-input MuiOutlinedInput-input PicassoOutlinedInput-input PicassoOutlinedInput-inputMedium MuiInputBase-inputAdornedStart MuiOutlinedInput-inputAdornedStart MuiInputBase-inputAdornedEnd MuiOutlinedInput-inputAdornedEnd"
30
- type="text"
31
- value="Dec 12, 2019"
32
- />
33
- <fieldset
34
- aria-hidden="true"
35
- class="PrivateNotchedOutline-root MuiOutlinedInput-notchedOutline PicassoOutlinedInput-notchedOutline"
36
- style="padding-left: 8px;"
37
- >
38
- <legend
39
- class="PrivateNotchedOutline-legend"
40
- style="width: 0.01px;"
41
- >
42
- <span>
43
-
44
- </span>
45
- </legend>
46
- </fieldset>
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- `;
@@ -1,2 +0,0 @@
1
- export const DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT = 'MM-dd-yyyy'
2
- export const DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT = 'MMM d, yyyy'
@@ -1,5 +0,0 @@
1
- export { default } from './DatePicker'
2
- export type { Props as DatePickerProps } from './DatePicker'
3
- export type { DatePickerValue, DatePickerStringParser } from './types'
4
- export { datePickerParseDateString } from './utils'
5
- export { DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT, DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT } from './constants'
@@ -1,33 +0,0 @@
1
- import {
2
- DatePicker,
3
- DatePickerValue,
4
- DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT,
5
- datePickerParseDateString
6
- } from '@toptal/picasso-lab'
7
- import React, { useState } from 'react'
8
-
9
- const AllowCustomValue = () => {
10
- const [datepickerValue, setDatepickerValue] = useState<DatePickerValue>(
11
- 'some custom value'
12
- )
13
-
14
- const parseInputValue = (value: string) => {
15
- const result = datePickerParseDateString(value, {
16
- dateFormat: DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT
17
- })
18
-
19
- return result ?? value
20
- }
21
-
22
- return (
23
- <div style={{ height: '50vh' }}>
24
- <DatePicker
25
- value={datepickerValue}
26
- parseInputValue={parseInputValue}
27
- onChange={setDatepickerValue}
28
- />
29
- </div>
30
- )
31
- }
32
-
33
- export default AllowCustomValue
@@ -1,47 +0,0 @@
1
- import React, { useState, FormEvent } from 'react'
2
- import { DatePicker } from '@toptal/picasso-lab'
3
- import { Form, Button, Container } from '@toptal/picasso'
4
-
5
- const AutocompleteExample = () => {
6
- const [datepickerValue, setDatepickerValue] = useState<Date>()
7
-
8
- return (
9
- <div style={{ height: '50vh' }}>
10
- <Form
11
- onSubmit={(e: FormEvent<HTMLFormElement>) => {
12
- e.preventDefault()
13
- }}
14
- >
15
- <Form.Field>
16
- <Form.Label>Disabled by default</Form.Label>
17
- <DatePicker
18
- name='date'
19
- value={datepickerValue}
20
- onChange={date => {
21
- setDatepickerValue(date as Date)
22
- }}
23
- />
24
- </Form.Field>
25
- <Form.Field>
26
- <Form.Label>Enabled</Form.Label>
27
- <DatePicker
28
- name='cc-exp'
29
- value={datepickerValue}
30
- autoComplete='cc-exp'
31
- onChange={date => {
32
- setDatepickerValue(date as Date)
33
- }}
34
- />
35
- </Form.Field>
36
-
37
- <Container top='small'>
38
- <Button type='submit'>
39
- Submit to include value to the browser autocomplete
40
- </Button>
41
- </Container>
42
- </Form>
43
- </div>
44
- )
45
- }
46
-
47
- export default AutocompleteExample
@@ -1,19 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { DatePicker } from '@toptal/picasso-lab'
3
-
4
- const DefaultExample = () => {
5
- const [datepickerValue, setDatepickerValue] = useState<Date>()
6
-
7
- return (
8
- <div style={{ height: '50vh' }}>
9
- <DatePicker
10
- value={datepickerValue}
11
- onChange={date => {
12
- setDatepickerValue(date as Date)
13
- }}
14
- />
15
- </div>
16
- )
17
- }
18
-
19
- export default DefaultExample
@@ -1,26 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Form } from '@toptal/picasso'
3
- import { DatePicker } from '@toptal/picasso-lab'
4
-
5
- const DefaultExample = () => {
6
- const [datepickerValue, setDatepickerValue] = useState<Date>()
7
-
8
- return (
9
- <div style={{ height: '50vh' }}>
10
- <Form>
11
- <Form.Field>
12
- <Form.Label>Failed validation</Form.Label>
13
- <DatePicker
14
- value={datepickerValue}
15
- error
16
- onChange={date => {
17
- setDatepickerValue(date as Date)
18
- }}
19
- />
20
- </Form.Field>
21
- </Form>
22
- </div>
23
- )
24
- }
25
-
26
- export default DefaultExample
@@ -1,22 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { DatePicker } from '@toptal/picasso-lab'
3
-
4
- const RangeExample = () => {
5
- const [value, setValue] = useState<[Date, Date]>()
6
-
7
- return (
8
- <div style={{ height: '50vh' }}>
9
- <DatePicker
10
- range
11
- value={value}
12
- onChange={dates => {
13
- const [start, end] = dates as [Date, Date]
14
-
15
- setValue([start, end])
16
- }}
17
- />
18
- </div>
19
- )
20
- }
21
-
22
- export default RangeExample
@@ -1,47 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Tooltip } from '@toptal/picasso'
3
- import { DatePicker } from '@toptal/picasso-lab'
4
- import { isBefore, isWithinInterval } from 'date-fns'
5
-
6
- const WithCustomDayRendering = () => {
7
- const [datepickerValue, setDatepickerValue] = useState(new Date('2015-12-12'))
8
-
9
- const minDate = new Date('2015-12-07')
10
-
11
- const disabledIntervals = [
12
- { start: new Date('2015-12-20'), end: new Date('2015-12-30') }
13
- ]
14
-
15
- return (
16
- <div style={{ height: '50vh' }}>
17
- <DatePicker
18
- value={datepickerValue}
19
- minDate={minDate}
20
- disabledIntervals={disabledIntervals}
21
- renderDay={({ date, children, isSelectable }) => {
22
- const day = new Date(date)
23
-
24
- if (!isSelectable) {
25
- if (isBefore(day, minDate)) {
26
- return <Tooltip content='It is vacation time'>{children}</Tooltip>
27
- }
28
- const isWithinDisabledInterval = disabledIntervals.some(interval =>
29
- isWithinInterval(day, interval)
30
- )
31
-
32
- if (isWithinDisabledInterval) {
33
- return <Tooltip content='In a meeting'>{children}</Tooltip>
34
- }
35
- }
36
-
37
- return children
38
- }}
39
- onChange={date => {
40
- setDatepickerValue(date as Date)
41
- }}
42
- />
43
- </div>
44
- )
45
- }
46
-
47
- export default WithCustomDayRendering
@@ -1,19 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { DatePicker } from '@toptal/picasso-lab'
3
-
4
- const WithInitialValueExample = () => {
5
- const [datepickerValue, setDatepickerValue] = useState(new Date(2019, 10, 10))
6
-
7
- return (
8
- <div style={{ height: '50vh' }}>
9
- <DatePicker
10
- value={datepickerValue}
11
- onChange={date => {
12
- setDatepickerValue(date as Date)
13
- }}
14
- />
15
- </div>
16
- )
17
- }
18
-
19
- export default WithInitialValueExample
@@ -1,24 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { DatePicker } from '@toptal/picasso-lab'
3
- import { Search16 } from '@toptal/picasso'
4
-
5
- const WithInputPropsExample = () => {
6
- const [value, setValue] = useState<Date>()
7
-
8
- return (
9
- <div style={{ height: '50vh', width: '100%' }}>
10
- <DatePicker
11
- value={value}
12
- icon={<Search16 />}
13
- iconPosition='end'
14
- width='full'
15
- placeholder='Please select date...'
16
- onChange={date => {
17
- setValue(date as Date)
18
- }}
19
- />
20
- </div>
21
- )
22
- }
23
-
24
- export default WithInputPropsExample
@@ -1,20 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { DatePicker, DatePickerValue } from '@toptal/picasso-lab'
3
-
4
- const WithNoHideOnSelect = () => {
5
- const [datepickerValue, setDatepickerValue] = useState<DatePickerValue>()
6
-
7
- return (
8
- <div style={{ height: '50vh' }}>
9
- <DatePicker
10
- value={datepickerValue}
11
- hideOnSelect={false}
12
- onChange={(date: DatePickerValue) => {
13
- setDatepickerValue(date)
14
- }}
15
- />
16
- </div>
17
- )
18
- }
19
-
20
- export default WithNoHideOnSelect