@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.
- package/{dist-package/Calendar → Calendar}/Calendar.d.ts +0 -0
- package/{dist-package/Calendar → Calendar}/Calendar.js +0 -0
- package/{dist-package/Calendar → Calendar}/Calendar.js.map +0 -0
- package/{dist-package/Calendar → Calendar}/index.d.ts +0 -0
- package/{dist-package/Calendar → Calendar}/index.js +0 -0
- package/{dist-package/Calendar → Calendar}/index.js.map +0 -0
- package/{dist-package/Calendar → Calendar}/styles.d.ts +0 -0
- package/{dist-package/Calendar → Calendar}/styles.js +0 -0
- package/{dist-package/Calendar → Calendar}/styles.js.map +0 -0
- package/{dist-package/Calendar → Calendar}/types.d.ts +0 -0
- package/{dist-package/Calendar → Calendar}/types.js +0 -0
- package/{dist-package/Calendar → Calendar}/types.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/DatePicker.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/DatePicker.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/DatePicker.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/constants.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/constants.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/constants.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/index.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/index.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/index.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/styles.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/styles.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/styles.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/types.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/types.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/types.js.map +0 -0
- package/{dist-package/DatePicker → DatePicker}/utils.d.ts +0 -0
- package/{dist-package/DatePicker → DatePicker}/utils.js +0 -0
- package/{dist-package/DatePicker → DatePicker}/utils.js.map +0 -0
- package/{dist-package/Drawer → Drawer}/Drawer.d.ts +0 -0
- package/{dist-package/Drawer → Drawer}/Drawer.js +0 -0
- package/{dist-package/Drawer → Drawer}/Drawer.js.map +0 -0
- package/{dist-package/Drawer → Drawer}/index.d.ts +0 -0
- package/{dist-package/Drawer → Drawer}/index.js +0 -0
- package/{dist-package/Drawer → Drawer}/index.js.map +0 -0
- package/{dist-package/Drawer → Drawer}/styles.d.ts +0 -0
- package/{dist-package/Drawer → Drawer}/styles.js +0 -0
- package/{dist-package/Drawer → Drawer}/styles.js.map +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.d.ts +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.js +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/DrawerTitle.js.map +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/index.d.ts +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/index.js +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/index.js.map +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/styles.d.ts +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/styles.js +0 -0
- package/{dist-package/DrawerTitle → DrawerTitle}/styles.js.map +0 -0
- package/{dist-package/Dropzone → Dropzone}/Dropzone.d.ts +0 -0
- package/{dist-package/Dropzone → Dropzone}/Dropzone.js +0 -0
- package/{dist-package/Dropzone → Dropzone}/Dropzone.js.map +0 -0
- package/{dist-package/Dropzone → Dropzone}/index.d.ts +0 -0
- package/{dist-package/Dropzone → Dropzone}/index.js +0 -0
- package/{dist-package/Dropzone → Dropzone}/index.js.map +0 -0
- package/{dist-package/Dropzone → Dropzone}/styles.d.ts +0 -0
- package/{dist-package/Dropzone → Dropzone}/styles.js +0 -0
- package/{dist-package/Dropzone → Dropzone}/styles.js.map +0 -0
- package/{dist-package/Dropzone → Dropzone}/types.d.ts +0 -0
- package/{dist-package/Dropzone → Dropzone}/types.js +0 -0
- package/{dist-package/Dropzone → Dropzone}/types.js.map +0 -0
- package/{dist-package/EmptyState → EmptyState}/EmptyState.d.ts +0 -0
- package/{dist-package/EmptyState → EmptyState}/EmptyState.js +0 -0
- package/{dist-package/EmptyState → EmptyState}/EmptyState.js.map +0 -0
- package/{dist-package/EmptyState → EmptyState}/index.d.ts +0 -0
- package/{dist-package/EmptyState → EmptyState}/index.js +0 -0
- package/{dist-package/EmptyState → EmptyState}/index.js.map +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.d.ts +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.js +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/EmptyStateCollection.js.map +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.d.ts +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.js +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/index.js.map +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.d.ts +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.js +0 -0
- package/{dist-package/EmptyStateCollection → EmptyStateCollection}/styles.js.map +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.d.ts +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.js +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/EmptyStatePage.js.map +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/index.d.ts +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/index.js +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/index.js.map +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.d.ts +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.js +0 -0
- package/{dist-package/EmptyStatePage → EmptyStatePage}/styles.js.map +0 -0
- package/{dist-package/Note → Note}/Note.d.ts +0 -0
- package/{dist-package/Note → Note}/Note.js +0 -0
- package/{dist-package/Note → Note}/Note.js.map +0 -0
- package/{dist-package/Note → Note}/index.d.ts +0 -0
- package/{dist-package/Note → Note}/index.js +0 -0
- package/{dist-package/Note → Note}/index.js.map +0 -0
- package/{dist-package/Note → Note}/styles.d.ts +0 -0
- package/{dist-package/Note → Note}/styles.js +0 -0
- package/{dist-package/Note → Note}/styles.js.map +0 -0
- package/{dist-package/NoteContent → NoteContent}/NoteContent.d.ts +0 -0
- package/{dist-package/NoteContent → NoteContent}/NoteContent.js +0 -0
- package/{dist-package/NoteContent → NoteContent}/NoteContent.js.map +0 -0
- package/{dist-package/NoteContent → NoteContent}/index.d.ts +0 -0
- package/{dist-package/NoteContent → NoteContent}/index.js +0 -0
- package/{dist-package/NoteContent → NoteContent}/index.js.map +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.d.ts +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.js +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/NoteSubtitle.js.map +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/index.d.ts +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/index.js +0 -0
- package/{dist-package/NoteSubtitle → NoteSubtitle}/index.js.map +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.d.ts +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.js +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/NoteTitle.js.map +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/index.d.ts +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/index.js +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/index.js.map +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/styles.d.ts +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/styles.js +0 -0
- package/{dist-package/NoteTitle → NoteTitle}/styles.js.map +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.d.ts +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.js +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/OverviewBlock.js.map +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/index.d.ts +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/index.js +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/index.js.map +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/styles.d.ts +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/styles.js +0 -0
- package/{dist-package/OverviewBlock → OverviewBlock}/styles.js.map +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.d.ts +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.js +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroup.js.map +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.d.ts +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.js +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/OverviewBlockGroupContext.js.map +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.d.ts +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.js +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/index.js.map +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.d.ts +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.js +0 -0
- package/{dist-package/OverviewBlockGroup → OverviewBlockGroup}/settings.js.map +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.d.ts +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.js +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/OverviewBlockRow.js.map +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.d.ts +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.js +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/index.js.map +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.d.ts +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.js +0 -0
- package/{dist-package/OverviewBlockRow → OverviewBlockRow}/styles.js.map +0 -0
- package/{dist-package/Section → Section}/Section.d.ts +0 -0
- package/{dist-package/Section → Section}/Section.js +0 -0
- package/{dist-package/Section → Section}/Section.js.map +0 -0
- package/{dist-package/Section → Section}/index.d.ts +0 -0
- package/{dist-package/Section → Section}/index.js +0 -0
- package/{dist-package/Section → Section}/index.js.map +0 -0
- package/{dist-package/Section → Section}/styles.d.ts +0 -0
- package/{dist-package/Section → Section}/styles.js +0 -0
- package/{dist-package/Section → Section}/styles.js.map +0 -0
- package/{dist-package/Timeline → Timeline}/Timeline.d.ts +0 -0
- package/{dist-package/Timeline → Timeline}/Timeline.js +0 -0
- package/{dist-package/Timeline → Timeline}/Timeline.js.map +0 -0
- package/{dist-package/Timeline → Timeline}/index.d.ts +0 -0
- package/{dist-package/Timeline → Timeline}/index.js +0 -0
- package/{dist-package/Timeline → Timeline}/index.js.map +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.d.ts +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.js +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/TimelineRow.js.map +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/index.d.ts +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/index.js +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/index.js.map +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/styles.d.ts +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/styles.js +0 -0
- package/{dist-package/TimelineRow → TimelineRow}/styles.js.map +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.d.ts +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.js +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/TypographyOverflow.js.map +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/index.d.ts +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/index.js +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/index.js.map +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.d.ts +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.js +0 -0
- package/{dist-package/TypographyOverflow → TypographyOverflow}/styles.js.map +0 -0
- package/{dist-package/index.d.ts → index.d.ts} +0 -0
- package/{dist-package/index.js → index.js} +0 -0
- package/{dist-package/index.js.map → index.js.map} +0 -0
- package/package.json +5 -5
- package/CHANGELOG.md +0 -1385
- package/dist-package/README.md +0 -26
- package/dist-package/package.json +0 -53
- package/src/Calendar/Calendar.tsx +0 -215
- package/src/Calendar/__snapshots__/test.tsx.snap +0 -447
- package/src/Calendar/index.ts +0 -2
- package/src/Calendar/styles.ts +0 -104
- package/src/Calendar/test.tsx +0 -20
- package/src/Calendar/types.ts +0 -42
- package/src/DatePicker/DatePicker.tsx +0 -366
- package/src/DatePicker/__image_snapshots__/datepicker-full-width-snap.png +0 -0
- package/src/DatePicker/__image_snapshots__/datepicker-with-custom-day-rendering-snap.png +0 -0
- package/src/DatePicker/__snapshots__/test.tsx.snap +0 -51
- package/src/DatePicker/constants.ts +0 -2
- package/src/DatePicker/index.ts +0 -5
- package/src/DatePicker/story/AllowCustomValue.example.tsx +0 -33
- package/src/DatePicker/story/Autocomplete.example.tsx +0 -47
- package/src/DatePicker/story/Default.example.tsx +0 -19
- package/src/DatePicker/story/Error.example.tsx +0 -26
- package/src/DatePicker/story/Range.example.tsx +0 -22
- package/src/DatePicker/story/WithCustomDayRendering.example.tsx +0 -47
- package/src/DatePicker/story/WithInitialValue.example.tsx +0 -19
- package/src/DatePicker/story/WithInputProps.example.tsx +0 -24
- package/src/DatePicker/story/WithNoHideOnSelect.example.tsx +0 -20
- package/src/DatePicker/story/WithOnBlurHandler.example.tsx +0 -22
- package/src/DatePicker/story/WithSelectionLimits.example.tsx +0 -32
- package/src/DatePicker/story/WithTimezone.example.tsx +0 -25
- package/src/DatePicker/story/index.jsx +0 -50
- package/src/DatePicker/styles.ts +0 -8
- package/src/DatePicker/test.tsx +0 -370
- package/src/DatePicker/types.ts +0 -13
- package/src/DatePicker/utils.ts +0 -123
- package/src/Drawer/Drawer.tsx +0 -105
- package/src/Drawer/__image_snapshots__/drawer-custom-title-effect-1-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-custom-title-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-default-effect-1-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-default-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-effect-1-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-effect-2-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-effect-3-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-effect-4-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-effect-5-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-width-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-without-title-effect-1-snap.png +0 -0
- package/src/Drawer/__image_snapshots__/drawer-without-title-snap.png +0 -0
- package/src/Drawer/index.ts +0 -6
- package/src/Drawer/story/CustomTitle.example.tsx +0 -32
- package/src/Drawer/story/Default.example.tsx +0 -29
- package/src/Drawer/story/DrawerAndNotification.example.tsx +0 -34
- package/src/Drawer/story/Widths.example.tsx +0 -46
- package/src/Drawer/story/WithoutTitle.example.tsx +0 -22
- package/src/Drawer/story/index.jsx +0 -80
- package/src/Drawer/styles.ts +0 -42
- package/src/DrawerTitle/DrawerTitle.tsx +0 -35
- package/src/DrawerTitle/index.ts +0 -1
- package/src/DrawerTitle/styles.ts +0 -12
- package/src/Dropzone/Dropzone.tsx +0 -146
- package/src/Dropzone/__snapshots__/test.tsx.snap +0 -40
- package/src/Dropzone/index.ts +0 -7
- package/src/Dropzone/story/Default.example.tsx +0 -8
- package/src/Dropzone/story/Disabled.example.tsx +0 -25
- package/src/Dropzone/story/Error.example.tsx +0 -16
- package/src/Dropzone/story/Multiple.example.tsx +0 -30
- package/src/Dropzone/story/Uploader.example.tsx +0 -116
- package/src/Dropzone/story/Uploading.example.tsx +0 -16
- package/src/Dropzone/story/index.jsx +0 -85
- package/src/Dropzone/styles.ts +0 -43
- package/src/Dropzone/test.tsx +0 -33
- package/src/Dropzone/types.ts +0 -56
- package/src/EmptyState/EmptyState.tsx +0 -7
- package/src/EmptyState/index.tsx +0 -1
- package/src/EmptyState/story/index.jsx +0 -13
- package/src/EmptyStateCollection/EmptyStateCollection.tsx +0 -56
- package/src/EmptyStateCollection/__image_snapshots__/emptystate-collection-emptystatecollection-snap.png +0 -0
- package/src/EmptyStateCollection/index.tsx +0 -1
- package/src/EmptyStateCollection/story/Default.example.tsx +0 -11
- package/src/EmptyStateCollection/story/index.jsx +0 -20
- package/src/EmptyStateCollection/styles.ts +0 -10
- package/src/EmptyStatePage/EmptyStatePage.tsx +0 -65
- package/src/EmptyStatePage/__image_snapshots__/emptystate-page-emptystatepage-snap.png +0 -0
- package/src/EmptyStatePage/index.tsx +0 -1
- package/src/EmptyStatePage/story/Default.example.tsx +0 -21
- package/src/EmptyStatePage/story/index.jsx +0 -21
- package/src/EmptyStatePage/styles.ts +0 -9
- package/src/Note/Note.tsx +0 -36
- package/src/Note/__snapshots__/test.tsx.snap +0 -37
- package/src/Note/index.ts +0 -6
- package/src/Note/story/Default.example.tsx +0 -14
- package/src/Note/story/index.jsx +0 -23
- package/src/Note/styles.ts +0 -27
- package/src/Note/test.tsx +0 -22
- package/src/NoteContent/NoteContent.tsx +0 -23
- package/src/NoteContent/index.ts +0 -1
- package/src/NoteContent/story/index.jsx +0 -12
- package/src/NoteSubtitle/NoteSubtitle.tsx +0 -25
- package/src/NoteSubtitle/index.ts +0 -1
- package/src/NoteSubtitle/story/index.jsx +0 -12
- package/src/NoteTitle/NoteTitle.tsx +0 -34
- package/src/NoteTitle/index.ts +0 -1
- package/src/NoteTitle/story/index.jsx +0 -12
- package/src/NoteTitle/styles.ts +0 -8
- package/src/OverviewBlock/OverviewBlock.tsx +0 -125
- package/src/OverviewBlock/__image_snapshots__/overviewblock-default-snap.png +0 -0
- package/src/OverviewBlock/__image_snapshots__/overviewblock-multi-line-snap.png +0 -0
- package/src/OverviewBlock/__image_snapshots__/overviewblock-number-snap.png +0 -0
- package/src/OverviewBlock/__image_snapshots__/overviewblock-routing-snap.png +0 -0
- package/src/OverviewBlock/__image_snapshots__/overviewblock-text-snap.png +0 -0
- package/src/OverviewBlock/index.ts +0 -6
- package/src/OverviewBlock/story/Default.example.tsx +0 -35
- package/src/OverviewBlock/story/Multiline.example.tsx +0 -51
- package/src/OverviewBlock/story/Number.example.tsx +0 -20
- package/src/OverviewBlock/story/Routing.example.tsx +0 -40
- package/src/OverviewBlock/story/Text.example.tsx +0 -15
- package/src/OverviewBlock/story/index.jsx +0 -100
- package/src/OverviewBlock/styles.ts +0 -44
- package/src/OverviewBlock/test.tsx +0 -111
- package/src/OverviewBlockGroup/OverviewBlockGroup.tsx +0 -56
- package/src/OverviewBlockGroup/OverviewBlockGroupContext.tsx +0 -21
- package/src/OverviewBlockGroup/__image_snapshots__/visual-variants-of-the-groups-block-width-snap.png +0 -0
- package/src/OverviewBlockGroup/__image_snapshots__/visual-variants-of-the-groups-center-aligned-snap.png +0 -0
- package/src/OverviewBlockGroup/index.ts +0 -1
- package/src/OverviewBlockGroup/settings.ts +0 -2
- package/src/OverviewBlockGroup/story/BlockWidth.example.tsx +0 -38
- package/src/OverviewBlockGroup/story/CenterAligned.example.tsx +0 -17
- package/src/OverviewBlockGroup/story/index.jsx +0 -25
- package/src/OverviewBlockGroup/test.tsx +0 -17
- package/src/OverviewBlockRow/OverviewBlockRow.tsx +0 -22
- package/src/OverviewBlockRow/index.ts +0 -1
- package/src/OverviewBlockRow/story/index.jsx +0 -11
- package/src/OverviewBlockRow/styles.ts +0 -27
- package/src/Section/Section.tsx +0 -163
- package/src/Section/__snapshots__/test.tsx.snap +0 -186
- package/src/Section/index.ts +0 -6
- package/src/Section/story/Actions.example.tsx +0 -85
- package/src/Section/story/Collapsible.example.tsx +0 -113
- package/src/Section/story/Default.example.tsx +0 -77
- package/src/Section/story/TitleSize.example.tsx +0 -34
- package/src/Section/story/Variant.example.tsx +0 -108
- package/src/Section/story/index.jsx +0 -35
- package/src/Section/styles.ts +0 -65
- package/src/Section/test.tsx +0 -115
- package/src/Timeline/Timeline.tsx +0 -25
- package/src/Timeline/__snapshots__/test.tsx.snap +0 -332
- package/src/Timeline/index.ts +0 -6
- package/src/Timeline/story/Dates.example.tsx +0 -52
- package/src/Timeline/story/Default.example.tsx +0 -34
- package/src/Timeline/story/TrimLastConnector.example.tsx +0 -29
- package/src/Timeline/story/index.jsx +0 -27
- package/src/Timeline/test.tsx +0 -101
- package/src/TimelineRow/TimelineRow.tsx +0 -83
- package/src/TimelineRow/index.ts +0 -6
- package/src/TimelineRow/story/index.jsx +0 -11
- package/src/TimelineRow/styles.ts +0 -47
- package/src/TypographyOverflow/TypographyOverflow.tsx +0 -153
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-checkbox-label-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-checkbox-label-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-custom-tooltip-content-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-custom-tooltip-content-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-effect-2-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-default-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-effect-2-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-delay-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-effect-2-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-light-tooltip-background-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-1-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-2-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-effect-3-snap.png +0 -0
- package/src/TypographyOverflow/__image_snapshots__/typographyoverflow-multiline-snap.png +0 -0
- package/src/TypographyOverflow/index.ts +0 -6
- package/src/TypographyOverflow/story/CheckboxLabel.example.tsx +0 -21
- package/src/TypographyOverflow/story/CustomTooltip.example.tsx +0 -22
- package/src/TypographyOverflow/story/Default.example.tsx +0 -32
- package/src/TypographyOverflow/story/Delay.example.tsx +0 -29
- package/src/TypographyOverflow/story/GridWithControls.example.tsx +0 -64
- package/src/TypographyOverflow/story/Multiline.example.tsx +0 -59
- package/src/TypographyOverflow/story/TooltipVariants.example.tsx +0 -23
- package/src/TypographyOverflow/story/index.jsx +0 -83
- package/src/TypographyOverflow/styles.ts +0 -29
- package/src/TypographyOverflow/test.tsx +0 -60
- package/src/index.ts +0 -35
- package/src/story/index.jsx +0 -10
- 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
|
Binary file
|
Binary file
|
@@ -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
|
-
`;
|
package/src/DatePicker/index.ts
DELETED
@@ -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
|