@toptal/picasso-lab 9.1.1-alpha-sat-750--poc-picasso-with-ssr.2531 → 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.
- package/CHANGELOG.md +1385 -0
- package/{Calendar → dist-package/Calendar}/Calendar.d.ts +0 -0
- package/{Calendar → dist-package/Calendar}/Calendar.js +0 -0
- package/{Calendar → dist-package/Calendar}/Calendar.js.map +0 -0
- package/{Calendar → dist-package/Calendar}/index.d.ts +0 -0
- package/{Calendar → dist-package/Calendar}/index.js +0 -0
- package/{Calendar → dist-package/Calendar}/index.js.map +0 -0
- package/{Calendar → dist-package/Calendar}/styles.d.ts +0 -0
- package/{Calendar → dist-package/Calendar}/styles.js +0 -0
- package/{Calendar → dist-package/Calendar}/styles.js.map +0 -0
- package/{Calendar → dist-package/Calendar}/types.d.ts +0 -0
- package/{Calendar → dist-package/Calendar}/types.js +0 -0
- package/{Calendar → dist-package/Calendar}/types.js.map +0 -0
- package/{DatePicker → dist-package/DatePicker}/DatePicker.d.ts +9 -9
- package/{DatePicker → dist-package/DatePicker}/DatePicker.js +24 -14
- package/dist-package/DatePicker/DatePicker.js.map +1 -0
- package/dist-package/DatePicker/constants.d.ts +2 -0
- package/dist-package/DatePicker/constants.js +3 -0
- package/dist-package/DatePicker/constants.js.map +1 -0
- package/dist-package/DatePicker/index.d.ts +5 -0
- package/dist-package/DatePicker/index.js +4 -0
- package/{DatePicker → dist-package/DatePicker}/index.js.map +1 -1
- package/{DatePicker → dist-package/DatePicker}/styles.d.ts +0 -0
- package/{DatePicker → dist-package/DatePicker}/styles.js +0 -0
- package/{DatePicker → dist-package/DatePicker}/styles.js.map +0 -0
- package/dist-package/DatePicker/types.d.ts +8 -0
- package/dist-package/DatePicker/types.js +2 -0
- package/dist-package/DatePicker/types.js.map +1 -0
- package/{DatePicker → dist-package/DatePicker}/utils.d.ts +3 -0
- package/{DatePicker → dist-package/DatePicker}/utils.js +12 -0
- package/{DatePicker → dist-package/DatePicker}/utils.js.map +1 -1
- package/{Drawer → dist-package/Drawer}/Drawer.d.ts +0 -0
- package/{Drawer → dist-package/Drawer}/Drawer.js +0 -0
- package/{Drawer → dist-package/Drawer}/Drawer.js.map +0 -0
- package/{Drawer → dist-package/Drawer}/index.d.ts +0 -0
- package/{Drawer → dist-package/Drawer}/index.js +0 -0
- package/{Drawer → dist-package/Drawer}/index.js.map +0 -0
- package/{Drawer → dist-package/Drawer}/styles.d.ts +0 -0
- package/{Drawer → dist-package/Drawer}/styles.js +0 -0
- package/{Drawer → dist-package/Drawer}/styles.js.map +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.d.ts +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.js +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/DrawerTitle.js.map +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/index.d.ts +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/index.js +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/index.js.map +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/styles.d.ts +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/styles.js +0 -0
- package/{DrawerTitle → dist-package/DrawerTitle}/styles.js.map +0 -0
- package/{Dropzone → dist-package/Dropzone}/Dropzone.d.ts +0 -0
- package/{Dropzone → dist-package/Dropzone}/Dropzone.js +1 -1
- package/{Dropzone → dist-package/Dropzone}/Dropzone.js.map +1 -1
- package/{Dropzone → dist-package/Dropzone}/index.d.ts +0 -0
- package/{Dropzone → dist-package/Dropzone}/index.js +0 -0
- package/{Dropzone → dist-package/Dropzone}/index.js.map +0 -0
- package/{Dropzone → dist-package/Dropzone}/styles.d.ts +1 -1
- package/{Dropzone → dist-package/Dropzone}/styles.js +0 -0
- package/{Dropzone → dist-package/Dropzone}/styles.js.map +0 -0
- package/{Dropzone → dist-package/Dropzone}/types.d.ts +0 -0
- package/{Dropzone → dist-package/Dropzone}/types.js +0 -0
- package/{Dropzone → dist-package/Dropzone}/types.js.map +0 -0
- package/{EmptyState → dist-package/EmptyState}/EmptyState.d.ts +0 -0
- package/{EmptyState → dist-package/EmptyState}/EmptyState.js +0 -0
- package/{EmptyState → dist-package/EmptyState}/EmptyState.js.map +0 -0
- package/{EmptyState → dist-package/EmptyState}/index.d.ts +0 -0
- package/{EmptyState → dist-package/EmptyState}/index.js +0 -0
- package/{EmptyState → dist-package/EmptyState}/index.js.map +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.d.ts +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.js +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/EmptyStateCollection.js.map +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.d.ts +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.js +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/index.js.map +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.d.ts +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.js +0 -0
- package/{EmptyStateCollection → dist-package/EmptyStateCollection}/styles.js.map +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.d.ts +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.js +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/EmptyStatePage.js.map +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/index.d.ts +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/index.js +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/index.js.map +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.d.ts +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.js +0 -0
- package/{EmptyStatePage → dist-package/EmptyStatePage}/styles.js.map +0 -0
- package/{Note → dist-package/Note}/Note.d.ts +0 -0
- package/{Note → dist-package/Note}/Note.js +0 -0
- package/{Note → dist-package/Note}/Note.js.map +0 -0
- package/{Note → dist-package/Note}/index.d.ts +0 -0
- package/{Note → dist-package/Note}/index.js +0 -0
- package/{Note → dist-package/Note}/index.js.map +0 -0
- package/{Note → dist-package/Note}/styles.d.ts +0 -0
- package/{Note → dist-package/Note}/styles.js +0 -0
- package/{Note → dist-package/Note}/styles.js.map +0 -0
- package/{NoteContent → dist-package/NoteContent}/NoteContent.d.ts +0 -0
- package/{NoteContent → dist-package/NoteContent}/NoteContent.js +0 -0
- package/{NoteContent → dist-package/NoteContent}/NoteContent.js.map +0 -0
- package/{NoteContent → dist-package/NoteContent}/index.d.ts +0 -0
- package/{NoteContent → dist-package/NoteContent}/index.js +0 -0
- package/{NoteContent → dist-package/NoteContent}/index.js.map +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.d.ts +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.js +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/NoteSubtitle.js.map +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/index.d.ts +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/index.js +0 -0
- package/{NoteSubtitle → dist-package/NoteSubtitle}/index.js.map +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.d.ts +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.js +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/NoteTitle.js.map +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/index.d.ts +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/index.js +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/index.js.map +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/styles.d.ts +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/styles.js +0 -0
- package/{NoteTitle → dist-package/NoteTitle}/styles.js.map +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.d.ts +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.js +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/OverviewBlock.js.map +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/index.d.ts +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/index.js +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/index.js.map +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/styles.d.ts +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/styles.js +0 -0
- package/{OverviewBlock → dist-package/OverviewBlock}/styles.js.map +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.d.ts +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.js +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroup.js.map +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.d.ts +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.js +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/OverviewBlockGroupContext.js.map +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.d.ts +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.js +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/index.js.map +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.d.ts +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.js +0 -0
- package/{OverviewBlockGroup → dist-package/OverviewBlockGroup}/settings.js.map +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.d.ts +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.js +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/OverviewBlockRow.js.map +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.d.ts +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.js +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/index.js.map +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.d.ts +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.js +0 -0
- package/{OverviewBlockRow → dist-package/OverviewBlockRow}/styles.js.map +0 -0
- package/dist-package/README.md +26 -0
- package/{Section → dist-package/Section}/Section.d.ts +1 -1
- package/{Section → dist-package/Section}/Section.js +6 -5
- package/dist-package/Section/Section.js.map +1 -0
- package/{Section → dist-package/Section}/index.d.ts +0 -0
- package/{Section → dist-package/Section}/index.js +0 -0
- package/{Section → dist-package/Section}/index.js.map +0 -0
- package/dist-package/Section/styles.d.ts +3 -0
- package/dist-package/Section/styles.js +60 -0
- package/dist-package/Section/styles.js.map +1 -0
- package/{Timeline → dist-package/Timeline}/Timeline.d.ts +0 -0
- package/{Timeline → dist-package/Timeline}/Timeline.js +0 -0
- package/{Timeline → dist-package/Timeline}/Timeline.js.map +0 -0
- package/{Timeline → dist-package/Timeline}/index.d.ts +0 -0
- package/{Timeline → dist-package/Timeline}/index.js +0 -0
- package/{Timeline → dist-package/Timeline}/index.js.map +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.d.ts +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.js +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/TimelineRow.js.map +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/index.d.ts +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/index.js +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/index.js.map +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/styles.d.ts +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/styles.js +0 -0
- package/{TimelineRow → dist-package/TimelineRow}/styles.js.map +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.d.ts +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.js +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/TypographyOverflow.js.map +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/index.d.ts +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/index.js +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/index.js.map +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.d.ts +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.js +0 -0
- package/{TypographyOverflow → dist-package/TypographyOverflow}/styles.js.map +0 -0
- package/{index.d.ts → dist-package/index.d.ts} +2 -2
- package/{index.js → dist-package/index.js} +1 -1
- package/dist-package/index.js.map +1 -0
- package/dist-package/package.json +53 -0
- package/package.json +4 -5
- package/src/Calendar/Calendar.tsx +215 -0
- package/src/Calendar/__snapshots__/test.tsx.snap +447 -0
- package/src/Calendar/index.ts +2 -0
- package/src/Calendar/styles.ts +104 -0
- package/src/Calendar/test.tsx +20 -0
- package/src/Calendar/types.ts +42 -0
- package/src/DatePicker/DatePicker.tsx +366 -0
- 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 +51 -0
- package/src/DatePicker/constants.ts +2 -0
- package/src/DatePicker/index.ts +5 -0
- package/src/DatePicker/story/AllowCustomValue.example.tsx +33 -0
- package/src/DatePicker/story/Autocomplete.example.tsx +47 -0
- package/src/DatePicker/story/Default.example.tsx +19 -0
- package/src/DatePicker/story/Error.example.tsx +26 -0
- package/src/DatePicker/story/Range.example.tsx +22 -0
- package/src/DatePicker/story/WithCustomDayRendering.example.tsx +47 -0
- package/src/DatePicker/story/WithInitialValue.example.tsx +19 -0
- package/src/DatePicker/story/WithInputProps.example.tsx +24 -0
- package/src/DatePicker/story/WithNoHideOnSelect.example.tsx +20 -0
- package/src/DatePicker/story/WithOnBlurHandler.example.tsx +22 -0
- package/src/DatePicker/story/WithSelectionLimits.example.tsx +32 -0
- package/src/DatePicker/story/WithTimezone.example.tsx +25 -0
- package/src/DatePicker/story/index.jsx +50 -0
- package/src/DatePicker/styles.ts +8 -0
- package/src/DatePicker/test.tsx +370 -0
- package/src/DatePicker/types.ts +13 -0
- package/src/DatePicker/utils.ts +123 -0
- package/src/Drawer/Drawer.tsx +105 -0
- 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 +6 -0
- package/src/Drawer/story/CustomTitle.example.tsx +32 -0
- package/src/Drawer/story/Default.example.tsx +29 -0
- package/src/Drawer/story/DrawerAndNotification.example.tsx +34 -0
- package/src/Drawer/story/Widths.example.tsx +46 -0
- package/src/Drawer/story/WithoutTitle.example.tsx +22 -0
- package/src/Drawer/story/index.jsx +80 -0
- package/src/Drawer/styles.ts +42 -0
- package/src/DrawerTitle/DrawerTitle.tsx +35 -0
- package/src/DrawerTitle/index.ts +1 -0
- package/src/DrawerTitle/styles.ts +12 -0
- package/src/Dropzone/Dropzone.tsx +146 -0
- package/src/Dropzone/__snapshots__/test.tsx.snap +40 -0
- package/src/Dropzone/index.ts +7 -0
- package/src/Dropzone/story/Default.example.tsx +8 -0
- package/src/Dropzone/story/Disabled.example.tsx +25 -0
- package/src/Dropzone/story/Error.example.tsx +16 -0
- package/src/Dropzone/story/Multiple.example.tsx +30 -0
- package/src/Dropzone/story/Uploader.example.tsx +116 -0
- package/src/Dropzone/story/Uploading.example.tsx +16 -0
- package/src/Dropzone/story/index.jsx +85 -0
- package/src/Dropzone/styles.ts +43 -0
- package/src/Dropzone/test.tsx +33 -0
- package/src/Dropzone/types.ts +56 -0
- package/src/EmptyState/EmptyState.tsx +7 -0
- package/src/EmptyState/index.tsx +1 -0
- package/src/EmptyState/story/index.jsx +13 -0
- package/src/EmptyStateCollection/EmptyStateCollection.tsx +56 -0
- package/src/EmptyStateCollection/__image_snapshots__/emptystate-collection-emptystatecollection-snap.png +0 -0
- package/src/EmptyStateCollection/index.tsx +1 -0
- package/src/EmptyStateCollection/story/Default.example.tsx +11 -0
- package/src/EmptyStateCollection/story/index.jsx +20 -0
- package/src/EmptyStateCollection/styles.ts +10 -0
- package/src/EmptyStatePage/EmptyStatePage.tsx +65 -0
- package/src/EmptyStatePage/__image_snapshots__/emptystate-page-emptystatepage-snap.png +0 -0
- package/src/EmptyStatePage/index.tsx +1 -0
- package/src/EmptyStatePage/story/Default.example.tsx +21 -0
- package/src/EmptyStatePage/story/index.jsx +21 -0
- package/src/EmptyStatePage/styles.ts +9 -0
- package/src/Note/Note.tsx +36 -0
- package/src/Note/__snapshots__/test.tsx.snap +37 -0
- package/src/Note/index.ts +6 -0
- package/src/Note/story/Default.example.tsx +14 -0
- package/src/Note/story/index.jsx +23 -0
- package/src/Note/styles.ts +27 -0
- package/src/Note/test.tsx +22 -0
- package/src/NoteContent/NoteContent.tsx +23 -0
- package/src/NoteContent/index.ts +1 -0
- package/src/NoteContent/story/index.jsx +12 -0
- package/src/NoteSubtitle/NoteSubtitle.tsx +25 -0
- package/src/NoteSubtitle/index.ts +1 -0
- package/src/NoteSubtitle/story/index.jsx +12 -0
- package/src/NoteTitle/NoteTitle.tsx +34 -0
- package/src/NoteTitle/index.ts +1 -0
- package/src/NoteTitle/story/index.jsx +12 -0
- package/src/NoteTitle/styles.ts +8 -0
- package/src/OverviewBlock/OverviewBlock.tsx +125 -0
- 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 +6 -0
- package/src/OverviewBlock/story/Default.example.tsx +35 -0
- package/src/OverviewBlock/story/Multiline.example.tsx +51 -0
- package/src/OverviewBlock/story/Number.example.tsx +20 -0
- package/src/OverviewBlock/story/Routing.example.tsx +40 -0
- package/src/OverviewBlock/story/Text.example.tsx +15 -0
- package/src/OverviewBlock/story/index.jsx +100 -0
- package/src/OverviewBlock/styles.ts +44 -0
- package/src/OverviewBlock/test.tsx +111 -0
- package/src/OverviewBlockGroup/OverviewBlockGroup.tsx +56 -0
- package/src/OverviewBlockGroup/OverviewBlockGroupContext.tsx +21 -0
- 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 +1 -0
- package/src/OverviewBlockGroup/settings.ts +2 -0
- package/src/OverviewBlockGroup/story/BlockWidth.example.tsx +38 -0
- package/src/OverviewBlockGroup/story/CenterAligned.example.tsx +17 -0
- package/src/OverviewBlockGroup/story/index.jsx +25 -0
- package/src/OverviewBlockGroup/test.tsx +17 -0
- package/src/OverviewBlockRow/OverviewBlockRow.tsx +22 -0
- package/src/OverviewBlockRow/index.ts +1 -0
- package/src/OverviewBlockRow/story/index.jsx +11 -0
- package/src/OverviewBlockRow/styles.ts +27 -0
- package/src/Section/Section.tsx +163 -0
- package/src/Section/__snapshots__/test.tsx.snap +186 -0
- package/src/Section/index.ts +6 -0
- package/src/Section/story/Actions.example.tsx +85 -0
- package/src/Section/story/Collapsible.example.tsx +113 -0
- package/src/Section/story/Default.example.tsx +77 -0
- package/src/Section/story/TitleSize.example.tsx +34 -0
- package/src/Section/story/Variant.example.tsx +108 -0
- package/src/Section/story/index.jsx +35 -0
- package/src/Section/styles.ts +65 -0
- package/src/Section/test.tsx +115 -0
- package/src/Timeline/Timeline.tsx +25 -0
- package/src/Timeline/__snapshots__/test.tsx.snap +332 -0
- package/src/Timeline/index.ts +6 -0
- package/src/Timeline/story/Dates.example.tsx +52 -0
- package/src/Timeline/story/Default.example.tsx +34 -0
- package/src/Timeline/story/TrimLastConnector.example.tsx +29 -0
- package/src/Timeline/story/index.jsx +27 -0
- package/src/Timeline/test.tsx +101 -0
- package/src/TimelineRow/TimelineRow.tsx +83 -0
- package/src/TimelineRow/index.ts +6 -0
- package/src/TimelineRow/story/index.jsx +11 -0
- package/src/TimelineRow/styles.ts +47 -0
- package/src/TypographyOverflow/TypographyOverflow.tsx +153 -0
- 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 +6 -0
- package/src/TypographyOverflow/story/CheckboxLabel.example.tsx +21 -0
- package/src/TypographyOverflow/story/CustomTooltip.example.tsx +22 -0
- package/src/TypographyOverflow/story/Default.example.tsx +32 -0
- package/src/TypographyOverflow/story/Delay.example.tsx +29 -0
- package/src/TypographyOverflow/story/GridWithControls.example.tsx +64 -0
- package/src/TypographyOverflow/story/Multiline.example.tsx +59 -0
- package/src/TypographyOverflow/story/TooltipVariants.example.tsx +23 -0
- package/src/TypographyOverflow/story/index.jsx +83 -0
- package/src/TypographyOverflow/styles.ts +29 -0
- package/src/TypographyOverflow/test.tsx +60 -0
- package/src/index.ts +35 -0
- package/src/story/index.jsx +10 -0
- package/tsconfig.build.json +7 -0
- package/DatePicker/DatePicker.js.map +0 -1
- package/DatePicker/index.d.ts +0 -2
- package/DatePicker/index.js +0 -2
- package/Section/Section.js.map +0 -1
- package/Section/styles.d.ts +0 -3
- package/Section/styles.js +0 -36
- package/Section/styles.js.map +0 -1
- package/index.js.map +0 -1
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# @toptal/picasso-lab
|
2
|
+
|
3
|
+
[](https://www.npmjs.com/package/@toptal/picasso-lab)
|
4
|
+
|
5
|
+
This package is a home of experimental features. Once APIs are battle tested and proven to work they are moved to `@toptal/picasso`.
|
6
|
+
|
7
|
+
## Prerequisites
|
8
|
+
|
9
|
+
The following peer dependencies are required:
|
10
|
+
|
11
|
+
- `@toptal/picasso`
|
12
|
+
- `@toptal/picasso-shared`
|
13
|
+
- `react`
|
14
|
+
- `react-dom`
|
15
|
+
|
16
|
+
## Setup
|
17
|
+
|
18
|
+
- `yarn add @toptal/picasso-lab`
|
19
|
+
|
20
|
+
## Limitations
|
21
|
+
|
22
|
+
This package does not practice strict [semantic versioning](https://semver.org/) and is not supported by our [Version Support Policy](https://toptal-core.atlassian.net/wiki/spaces/FE/pages/1357545615/Version+Support+Policy). Breaking changes can be rolled out as minor/path releases.
|
23
|
+
|
24
|
+
## Documentation
|
25
|
+
|
26
|
+
Documentation and demos are available at [picasso.toptal.net](https://picasso.toptal.net/).
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { BaseProps, SizeType } from '@toptal/picasso';
|
3
|
-
declare type VariantType = 'bordered' | 'default';
|
3
|
+
declare type VariantType = 'bordered' | 'default' | 'withHeaderBar';
|
4
4
|
export interface Props extends BaseProps {
|
5
5
|
/** Title of the Section */
|
6
6
|
title?: ReactNode;
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles(styles, {
|
|
20
20
|
name: 'PicassoSection'
|
21
21
|
});
|
22
22
|
export const Section = forwardRef(function Section(props, ref) {
|
23
|
-
const { className, style, title, subtitle, actions, children, testIds, collapsible = false, defaultCollapsed = true, variant, titleSize = 'medium' } = props, rest = __rest(props, ["className", "style", "title", "subtitle", "actions", "children", "testIds", "collapsible", "defaultCollapsed", "variant", "titleSize"]);
|
23
|
+
const { className, style, title, subtitle, actions, children, testIds, collapsible = false, defaultCollapsed = true, variant = 'default', titleSize = 'medium' } = props, rest = __rest(props, ["className", "style", "title", "subtitle", "actions", "children", "testIds", "collapsible", "defaultCollapsed", "variant", "titleSize"]);
|
24
24
|
const classes = useStyles();
|
25
25
|
const [collapsed, setCollapsed] = useState(collapsible ? defaultCollapsed : false);
|
26
26
|
const toggleCollapse = () => setCollapsed(!collapsed);
|
@@ -34,11 +34,12 @@ export const Section = forwardRef(function Section(props, ref) {
|
|
34
34
|
renderCollapse())) : null;
|
35
35
|
const hasHeader = title || subtitle || hasActions;
|
36
36
|
return (React.createElement(Container, Object.assign({ ref: ref, className: cx({
|
37
|
-
[classes
|
38
|
-
[classes.collapsed]: variant
|
37
|
+
[classes[variant]]: true,
|
38
|
+
[classes.collapsed]: variant === 'default' && collapsed
|
39
39
|
}, classes.root, className), style: style }, rest),
|
40
|
-
hasHeader && (React.createElement(Container, { "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.header, className: cx(
|
41
|
-
[classes
|
40
|
+
hasHeader && (React.createElement(Container, { "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.header, className: cx({
|
41
|
+
[classes[`${variant}Header`]]: true,
|
42
|
+
[classes[`${variant}CollapsedHeader`]]: collapsed
|
42
43
|
}) },
|
43
44
|
renderTitle(),
|
44
45
|
renderSubtitle(),
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/Section/Section.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAS,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,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AC5B,SAAS,EAAE,EAAE,CAAC;gBACZ,CAAC,OAAO,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC,EAAE,IAAI;gBACnC,CAAC,OAAO,CAAC,GAAG,OAAO,iBAAiB,CAAC,CAAC,EAAE,SAAS;aAClD,CAAC;YAED,WAAW,EAAE;YACb,cAAc,EAAE;YAChB,aAAa,EAAE,CACN,CACb;QACD,oBAAC,QAAQ,IAAC,EAAE,EAAE,CAAC,SAAS,EAAE,aAAa,UACpC,QAAQ,CACA,CACD,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAA;AAC/B,OAAO,CAAC,YAAY,GAAG;IACrB,WAAW,EAAE,KAAK;IAClB,gBAAgB,EAAE,IAAI;IACtB,SAAS,EAAE,QAAQ;CACpB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { Theme } from '@material-ui/core';
|
2
|
+
declare const _default: ({ sizes, palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "default" | "title" | "root" | "bordered" | "actions" | "subtitle" | "collapsed" | "withHeaderBar" | "defaultHeader" | "borderedHeader" | "withHeaderBarHeader" | "defaultCollapsedHeader" | "borderedCollapsedHeader" | "withHeaderBarCollapsedHeader">;
|
3
|
+
export default _default;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { createStyles } from '@material-ui/core';
|
2
|
+
const defaultHeader = {
|
3
|
+
display: 'flex',
|
4
|
+
paddingBottom: '1.5rem'
|
5
|
+
};
|
6
|
+
const defaultCollapsedHeader = {
|
7
|
+
paddingBottom: '0'
|
8
|
+
};
|
9
|
+
export default ({ sizes, palette }) => createStyles({
|
10
|
+
root: {
|
11
|
+
paddingTop: '2rem'
|
12
|
+
},
|
13
|
+
title: {
|
14
|
+
marginRight: '1rem'
|
15
|
+
},
|
16
|
+
subtitle: {
|
17
|
+
alignSelf: 'center',
|
18
|
+
marginRight: '1rem'
|
19
|
+
},
|
20
|
+
actions: {
|
21
|
+
display: 'flex',
|
22
|
+
marginLeft: 'auto'
|
23
|
+
},
|
24
|
+
collapsed: {
|
25
|
+
paddingBottom: '2rem'
|
26
|
+
},
|
27
|
+
default: {},
|
28
|
+
bordered: {
|
29
|
+
borderRadius: sizes.borderRadius.medium,
|
30
|
+
border: `solid ${sizes.borderWidth} ${palette.grey.light}`,
|
31
|
+
padding: '2rem',
|
32
|
+
'& > :last-child': {
|
33
|
+
paddingBottom: '0'
|
34
|
+
}
|
35
|
+
},
|
36
|
+
withHeaderBar: {
|
37
|
+
padding: 0,
|
38
|
+
'& > :last-child:not(:first-child)': {
|
39
|
+
padding: '1.5rem'
|
40
|
+
},
|
41
|
+
borderRadius: sizes.borderRadius.medium,
|
42
|
+
border: `solid ${sizes.borderWidth} ${palette.grey.light2}`
|
43
|
+
},
|
44
|
+
defaultHeader,
|
45
|
+
borderedHeader: defaultHeader,
|
46
|
+
withHeaderBarHeader: {
|
47
|
+
display: 'flex',
|
48
|
+
padding: '0.75rem 1rem',
|
49
|
+
borderRadius: `${sizes.borderRadius.medium} ${sizes.borderRadius.medium} 0 0`,
|
50
|
+
borderBottom: `solid ${sizes.borderWidth} ${palette.grey.light2}`,
|
51
|
+
backgroundColor: palette.grey.lighter
|
52
|
+
},
|
53
|
+
defaultCollapsedHeader,
|
54
|
+
borderedCollapsedHeader: defaultCollapsedHeader,
|
55
|
+
withHeaderBarCollapsedHeader: {
|
56
|
+
borderBottom: 'none',
|
57
|
+
borderRadius: sizes.borderRadius.medium
|
58
|
+
}
|
59
|
+
});
|
60
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/Section/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,mBAAmB,CAAA;AAEvD,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,MAAM;IAC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AE,OAAO,CAAC,IAAI,CAAC,OAAO;KACtC;IAED,sBAAsB;IACtB,uBAAuB,EAAE,sBAAsB;IAC/C,4BAA4B,EAAE;QAC5B,YAAY,EAAE,MAAM;QACpB,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM;KACxC;CACF,CAAC,CAAA"}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export { default as Calendar } from './Calendar';
|
2
2
|
export type { DateOrDateRangeType } from './Calendar';
|
3
|
-
export { default as DatePicker } from './DatePicker';
|
4
|
-
export type { DatePickerProps } from './DatePicker';
|
3
|
+
export { default as DatePicker, datePickerParseDateString, DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT } from './DatePicker';
|
4
|
+
export type { DatePickerValue, DatePickerStringParser, DatePickerProps } from './DatePicker';
|
5
5
|
export { default as Drawer } from './Drawer';
|
6
6
|
export type { DrawerProps } from './Drawer';
|
7
7
|
export { default as Dropzone, ErrorCode as DropzoneErrorCode } from './Dropzone';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export { default as Calendar } from './Calendar';
|
2
|
-
export { default as DatePicker } from './DatePicker';
|
2
|
+
export { default as DatePicker, datePickerParseDateString, DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT } from './DatePicker';
|
3
3
|
export { default as Drawer } from './Drawer';
|
4
4
|
export { default as Dropzone, ErrorCode as DropzoneErrorCode } from './Dropzone';
|
5
5
|
export { default as OverviewBlock } from './OverviewBlock';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,yBAAyB,EACzB,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAE5C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAQhF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE1D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AAExC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEhD,qEAAqE"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
{
|
2
|
+
"name": "@toptal/picasso-lab",
|
3
|
+
"version": "9.3.1",
|
4
|
+
"description": "Lab components of Picasso",
|
5
|
+
"author": "Toptal",
|
6
|
+
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-lab#readme",
|
7
|
+
"license": "MIT",
|
8
|
+
"main": "index.js",
|
9
|
+
"module": "index.js",
|
10
|
+
"publishConfig": {
|
11
|
+
"access": "public"
|
12
|
+
},
|
13
|
+
"repository": {
|
14
|
+
"type": "git",
|
15
|
+
"url": "git+https://github.com/toptal/picasso.git"
|
16
|
+
},
|
17
|
+
"scripts": {
|
18
|
+
"build:package": "cross-env NODE_ENV=production node ../../bin/build.js --tsConfig=./tsconfig.build.json",
|
19
|
+
"prepublishOnly": "../../bin/prepublish.js"
|
20
|
+
},
|
21
|
+
"bugs": {
|
22
|
+
"url": "https://github.com/toptal/picasso/issues"
|
23
|
+
},
|
24
|
+
"peerDependencies": {
|
25
|
+
"@material-ui/core": "4.11.0",
|
26
|
+
"@toptal/picasso": "^13.4.2",
|
27
|
+
"@toptal/picasso-shared": "^7",
|
28
|
+
"popper.js": "^1.16.1",
|
29
|
+
"react": "^16.12.0",
|
30
|
+
"react-dom": "^16.12.0"
|
31
|
+
},
|
32
|
+
"dependencies": {
|
33
|
+
"@toptal/picasso-provider": "^0.3.1",
|
34
|
+
"ap-style-title-case": "^1.1.2",
|
35
|
+
"classnames": "^2.3.1",
|
36
|
+
"date-fns": "^2.9.0",
|
37
|
+
"date-fns-tz": "^1.1.3",
|
38
|
+
"react-dropzone": "^11.4.0",
|
39
|
+
"react-router-dom": "^5.2.0",
|
40
|
+
"simple-react-calendar": "^2.2.8"
|
41
|
+
},
|
42
|
+
"devDependencies": {
|
43
|
+
"@babel/types": "^7.15.0",
|
44
|
+
"@types/classnames": "^2.3.1",
|
45
|
+
"@types/styled-components": "^5.1.13",
|
46
|
+
"storybook-readme": "^5.0.9",
|
47
|
+
"styled-components": "^5.3.1"
|
48
|
+
},
|
49
|
+
"sideEffects": [
|
50
|
+
"**/styles.ts",
|
51
|
+
"**/styles.js"
|
52
|
+
]
|
53
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@toptal/picasso-lab",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.3.1",
|
4
4
|
"description": "Lab components of Picasso",
|
5
5
|
"author": "Toptal",
|
6
6
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-lab#readme",
|
@@ -23,14 +23,14 @@
|
|
23
23
|
},
|
24
24
|
"peerDependencies": {
|
25
25
|
"@material-ui/core": "4.11.0",
|
26
|
-
"@toptal/picasso": "^
|
26
|
+
"@toptal/picasso": "^13.4.2",
|
27
27
|
"@toptal/picasso-shared": "^7",
|
28
28
|
"popper.js": "^1.16.1",
|
29
29
|
"react": "^16.12.0",
|
30
30
|
"react-dom": "^16.12.0"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@toptal/picasso-provider": "0.3.1
|
33
|
+
"@toptal/picasso-provider": "^0.3.1",
|
34
34
|
"ap-style-title-case": "^1.1.2",
|
35
35
|
"classnames": "^2.3.1",
|
36
36
|
"date-fns": "^2.9.0",
|
@@ -49,6 +49,5 @@
|
|
49
49
|
"sideEffects": [
|
50
50
|
"**/styles.ts",
|
51
51
|
"**/styles.js"
|
52
|
-
]
|
53
|
-
"gitHead": "65adfef8a2a7320ca68307bcc6916d6edb3b5a61"
|
52
|
+
]
|
54
53
|
}
|
@@ -0,0 +1,215 @@
|
|
1
|
+
import React, { forwardRef, ReactNode } from 'react'
|
2
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
3
|
+
// @ts-ignore
|
4
|
+
import SimpleReactCalendar from 'simple-react-calendar'
|
5
|
+
import cx from 'classnames'
|
6
|
+
import format from 'date-fns/format'
|
7
|
+
import { Theme, makeStyles } from '@material-ui/core/styles'
|
8
|
+
import { BaseProps } from '@toptal/picasso-shared'
|
9
|
+
import { Button, Typography } from '@toptal/picasso'
|
10
|
+
import { ChevronMinor16, BackMinor16 } from '@toptal/picasso/Icon'
|
11
|
+
|
12
|
+
import {
|
13
|
+
CalendarProps,
|
14
|
+
MonthHeaderProps,
|
15
|
+
WeekProps,
|
16
|
+
DayOfWeekProps,
|
17
|
+
DayProps,
|
18
|
+
DaysOfWeekProps
|
19
|
+
} from './types'
|
20
|
+
import styles from './styles'
|
21
|
+
|
22
|
+
type SimpleReactCalendarRangeType = {
|
23
|
+
start: Date
|
24
|
+
end: Date
|
25
|
+
}
|
26
|
+
export type DateOrDateRangeType = Date | DateRangeType
|
27
|
+
export type DateRangeType = [Date, Date]
|
28
|
+
|
29
|
+
export { DayProps }
|
30
|
+
|
31
|
+
const getNormalizedValue = (value: DateOrDateRangeType | undefined) => {
|
32
|
+
if (!value) {
|
33
|
+
return
|
34
|
+
}
|
35
|
+
|
36
|
+
if (value instanceof Date) {
|
37
|
+
return value
|
38
|
+
}
|
39
|
+
|
40
|
+
const [start, end] = value
|
41
|
+
|
42
|
+
return { start, end }
|
43
|
+
}
|
44
|
+
|
45
|
+
export interface Props
|
46
|
+
extends BaseProps,
|
47
|
+
Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'> {
|
48
|
+
onChange: (value: DateOrDateRangeType) => void
|
49
|
+
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void
|
50
|
+
renderDay?: (args: DayProps) => ReactNode
|
51
|
+
minDate?: Date
|
52
|
+
maxDate?: Date
|
53
|
+
range?: boolean
|
54
|
+
value?: DateOrDateRangeType
|
55
|
+
activeMonth?: Date
|
56
|
+
disabledIntervals?: { start: Date; end: Date }[]
|
57
|
+
weekStartsOn?: number
|
58
|
+
}
|
59
|
+
|
60
|
+
const isDateRange = (
|
61
|
+
value: Date | SimpleReactCalendarRangeType
|
62
|
+
): value is SimpleReactCalendarRangeType => {
|
63
|
+
return !(value instanceof Date) && Boolean(value.start && value.end)
|
64
|
+
}
|
65
|
+
|
66
|
+
const useStyles = makeStyles<Theme>(styles, { name: 'PicassoCalendar' })
|
67
|
+
|
68
|
+
export const Calendar = forwardRef<HTMLDivElement, Props>(function Calendar(
|
69
|
+
props,
|
70
|
+
ref
|
71
|
+
) {
|
72
|
+
const classes = useStyles()
|
73
|
+
const {
|
74
|
+
range,
|
75
|
+
activeMonth,
|
76
|
+
value,
|
77
|
+
onChange,
|
78
|
+
minDate,
|
79
|
+
maxDate,
|
80
|
+
disabledIntervals,
|
81
|
+
renderDay,
|
82
|
+
weekStartsOn,
|
83
|
+
...rest
|
84
|
+
} = props
|
85
|
+
|
86
|
+
const handleChange = (selection: Date | SimpleReactCalendarRangeType) => {
|
87
|
+
if (isDateRange(selection)) {
|
88
|
+
const { start, end } = selection
|
89
|
+
|
90
|
+
onChange([start, end])
|
91
|
+
} else {
|
92
|
+
onChange(selection)
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
return (
|
97
|
+
<div ref={ref} {...rest} tabIndex={0}>
|
98
|
+
<SimpleReactCalendar
|
99
|
+
selected={getNormalizedValue(value)}
|
100
|
+
onSelect={handleChange}
|
101
|
+
customRender={({ children }: CalendarProps) => {
|
102
|
+
return <div className={classes.root}>{children}</div>
|
103
|
+
}}
|
104
|
+
renderDay={(dayProps: DayProps) => {
|
105
|
+
const {
|
106
|
+
key,
|
107
|
+
isDisabled,
|
108
|
+
isSelected,
|
109
|
+
isSelectable,
|
110
|
+
isToday,
|
111
|
+
isMonthNext,
|
112
|
+
isMonthPrev,
|
113
|
+
isSelectionStart,
|
114
|
+
isSelectionEnd,
|
115
|
+
handleOnClick,
|
116
|
+
handleOnEnter,
|
117
|
+
getDayFormatted,
|
118
|
+
date,
|
119
|
+
ISODate
|
120
|
+
} = dayProps
|
121
|
+
|
122
|
+
const defaultMarkup = (
|
123
|
+
<button
|
124
|
+
data-testid={`day-button-${
|
125
|
+
isSelected ? 'selected' : getDayFormatted(date)
|
126
|
+
}`}
|
127
|
+
data-simple-react-calendar-day={ISODate}
|
128
|
+
key={key}
|
129
|
+
tabIndex={isDisabled || !isSelectable ? -1 : undefined}
|
130
|
+
className={cx(classes.day, {
|
131
|
+
[classes.selected]: isSelected,
|
132
|
+
[classes.selectable]: isSelectable,
|
133
|
+
[classes.today]: isToday,
|
134
|
+
[classes.grayed]:
|
135
|
+
(isMonthPrev || isMonthNext) && !isSelected && !isDisabled,
|
136
|
+
[classes.disabled]: isDisabled || !isSelectable,
|
137
|
+
[classes.startSelection]: isSelectionStart,
|
138
|
+
[classes.endSelection]: isSelectionEnd
|
139
|
+
})}
|
140
|
+
onClick={handleOnClick}
|
141
|
+
onMouseEnter={handleOnEnter}
|
142
|
+
value={date.toString()}
|
143
|
+
type='button'
|
144
|
+
>
|
145
|
+
{getDayFormatted(date)}
|
146
|
+
</button>
|
147
|
+
)
|
148
|
+
|
149
|
+
return renderDay
|
150
|
+
? renderDay({
|
151
|
+
...dayProps,
|
152
|
+
children: defaultMarkup
|
153
|
+
})
|
154
|
+
: defaultMarkup
|
155
|
+
}}
|
156
|
+
renderMonthHeader={({
|
157
|
+
switchMonth,
|
158
|
+
activeMonth: headerActiveMonth
|
159
|
+
}: MonthHeaderProps) => {
|
160
|
+
return (
|
161
|
+
<div className={classes.actions}>
|
162
|
+
<Button
|
163
|
+
title='Previous month'
|
164
|
+
variant='secondary'
|
165
|
+
size='small'
|
166
|
+
onClick={() => switchMonth(-1)}
|
167
|
+
>
|
168
|
+
<BackMinor16 />
|
169
|
+
</Button>
|
170
|
+
<Typography variant='heading' size='medium'>
|
171
|
+
{format(headerActiveMonth, 'MMMM y')}
|
172
|
+
</Typography>
|
173
|
+
<Button
|
174
|
+
title='Next month'
|
175
|
+
variant='secondary'
|
176
|
+
size='small'
|
177
|
+
onClick={() => switchMonth(1)}
|
178
|
+
>
|
179
|
+
<ChevronMinor16 />
|
180
|
+
</Button>
|
181
|
+
</div>
|
182
|
+
)
|
183
|
+
}}
|
184
|
+
renderDaysOfWeek={({ children }: DaysOfWeekProps) => {
|
185
|
+
return <div className={classes.weekDays}>{children}</div>
|
186
|
+
}}
|
187
|
+
renderDayOfWeek={({ day, key }: DayOfWeekProps) => {
|
188
|
+
return (
|
189
|
+
<div key={key} className={classes.weekDay}>
|
190
|
+
{day}
|
191
|
+
</div>
|
192
|
+
)
|
193
|
+
}}
|
194
|
+
renderWeek={({ children }: WeekProps) => {
|
195
|
+
return <div className={classes.week}>{children}</div>
|
196
|
+
}}
|
197
|
+
activeMonth={activeMonth || value}
|
198
|
+
mode={range ? 'range' : 'single'}
|
199
|
+
minDate={minDate}
|
200
|
+
maxDate={maxDate}
|
201
|
+
disabledIntervals={disabledIntervals}
|
202
|
+
getNoticeContent={() => null}
|
203
|
+
weekStartsOn={weekStartsOn}
|
204
|
+
/>
|
205
|
+
</div>
|
206
|
+
)
|
207
|
+
})
|
208
|
+
|
209
|
+
Calendar.defaultProps = {
|
210
|
+
range: false
|
211
|
+
}
|
212
|
+
|
213
|
+
Calendar.displayName = 'Calendar'
|
214
|
+
|
215
|
+
export default Calendar
|