@meduza/ui-kit-2 0.0.1 → 0.1.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/README.md +7 -179
- package/dist/BookmarkButton/BookmarkButton.stories.d.ts +10 -0
- package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -0
- package/dist/BookmarkButton/index.d.ts +3 -0
- package/dist/Button/Button.stories.d.ts +10 -0
- package/dist/Button/Button.types.d.ts +2 -2
- package/dist/CardTitle/CardTitle.stories.d.ts +10 -0
- package/dist/CardTitle/CardTitle.types.d.ts +8 -0
- package/dist/CardTitle/index.d.ts +3 -0
- package/dist/ChapterBlock/ChapterBlock.stories.d.ts +10 -0
- package/dist/ChapterBlock/ChapterBlock.types.d.ts +7 -0
- package/dist/ChapterBlock/index.d.ts +3 -0
- package/dist/Cover/Cover.stories.d.ts +10 -0
- package/dist/Cover/Cover.types.d.ts +4 -0
- package/dist/Cover/index.d.ts +3 -0
- package/dist/DocumentItemsCount/DocumentItemsCount.stories.d.ts +10 -0
- package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +7 -0
- package/dist/DocumentItemsCount/index.d.ts +3 -0
- package/dist/DotsOnImage/DotsOnImage.stories.d.ts +10 -0
- package/dist/DotsOnImage/DotsOnImage.types.d.ts +42 -0
- package/dist/DotsOnImage/index.d.ts +3 -0
- package/dist/Dropdown/Dropdown.stories.d.ts +10 -0
- package/dist/Dropdown/Dropdown.types.d.ts +6 -0
- package/dist/Dropdown/index.d.ts +4 -0
- package/dist/EmbedBlock/EmbedBlock.d.ts +3 -0
- package/dist/EmbedBlock/EmbedBlock.stories.d.ts +10 -0
- package/dist/EmbedBlock/EmbedBlock.types.d.ts +5 -0
- package/dist/EmbedBlock/IframeBlock.d.ts +3 -0
- package/dist/EmbedBlock/index.d.ts +3 -0
- package/dist/GroupedBlock/GroupedBlock.stories.d.ts +10 -0
- package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -0
- package/dist/GroupedBlock/index.d.ts +3 -0
- package/dist/HalfBlock/HalfBlock.stories.d.ts +10 -0
- package/dist/HalfBlock/HalfBlock.types.d.ts +4 -0
- package/dist/HalfBlock/index.d.ts +3 -0
- package/dist/Image/Image.stories.d.ts +10 -0
- package/dist/Image/Image.types.d.ts +38 -0
- package/dist/Image/RenderPicture.d.ts +4 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/ImportantLead/ImportantLead.stories.d.ts +10 -0
- package/dist/ImportantLead/ImportantLead.types.d.ts +4 -0
- package/dist/ImportantLead/index.d.ts +3 -0
- package/dist/Lazy/Lazy.stories.d.ts +10 -0
- package/dist/Lazy/Lazy.types.d.ts +5 -0
- package/dist/Lazy/index.d.ts +3 -0
- package/dist/ListBlock/ListBlock.stories.d.ts +10 -0
- package/dist/ListBlock/ListBlock.types.d.ts +4 -0
- package/dist/ListBlock/index.d.ts +3 -0
- package/dist/MaterialNote/MaterialNote.stories.d.ts +10 -0
- package/dist/MaterialNote/MaterialNote.types.d.ts +12 -0
- package/dist/MaterialNote/index.d.ts +3 -0
- package/dist/MaterialTitle/MaterialTitle.stories.d.ts +10 -0
- package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -0
- package/dist/MaterialTitle/index.d.ts +5 -0
- package/dist/MediaCaption/MediaCaption.stories.d.ts +10 -0
- package/dist/MediaCaption/MediaCaption.types.d.ts +5 -0
- package/dist/MediaCaption/index.d.ts +3 -0
- package/dist/Meta/Meta.stories.d.ts +10 -0
- package/dist/Meta/Meta.types.d.ts +18 -0
- package/dist/Meta/MetaContainer.d.ts +3 -0
- package/dist/Meta/index.d.ts +3 -0
- package/dist/MetaItem/MetaItem.stories.d.ts +10 -0
- package/dist/MetaItem/MetaItem.types.d.ts +7 -0
- package/dist/MetaItem/index.d.ts +3 -0
- package/dist/MetaItemLive/MetaItemLive.stories.d.ts +10 -0
- package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -0
- package/dist/MetaItemLive/index.d.ts +3 -0
- package/dist/Popover/Popover.stories.d.ts +10 -0
- package/dist/Popover/Popover.types.d.ts +5 -0
- package/dist/Popover/index.d.ts +3 -0
- package/dist/QuoteBlock/QuoteBlock.stories.d.ts +10 -0
- package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -0
- package/dist/QuoteBlock/index.d.ts +3 -0
- package/dist/RawHtmlBlock/RawHtmlBlock.stories.d.ts +10 -0
- package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +9 -0
- package/dist/RawHtmlBlock/index.d.ts +3 -0
- package/dist/RelatedBlock/RelatedBlock.stories.d.ts +10 -0
- package/dist/RelatedBlock/RelatedBlock.types.d.ts +4 -0
- package/dist/RelatedBlock/index.d.ts +3 -0
- package/dist/RenderBlocks/RenderBlocks.stories.d.ts +10 -0
- package/dist/RenderBlocks/RenderBlocks.types.d.ts +10 -0
- package/dist/RenderBlocks/index.d.ts +3 -0
- package/dist/RichTitle/RichTitle.stories.d.ts +10 -0
- package/dist/RichTitle/RichTitle.types.d.ts +4 -0
- package/dist/RichTitle/index.d.ts +3 -0
- package/dist/SimpleBlock/SimpleBlock.stories.d.ts +10 -0
- package/dist/SimpleBlock/SimpleBlock.types.d.ts +4 -0
- package/dist/SimpleBlock/index.d.ts +3 -0
- package/dist/SimpleTitle/SimpleTitle.stories.d.ts +10 -0
- package/dist/SimpleTitle/SimpleTitle.types.d.ts +4 -0
- package/dist/SimpleTitle/index.d.ts +3 -0
- package/dist/SourceBlock/SourceBlock.stories.d.ts +10 -0
- package/dist/SourceBlock/SourceBlock.types.d.ts +4 -0
- package/dist/SourceBlock/index.d.ts +3 -0
- package/dist/Spoiler/Spoiler.stories.d.ts +10 -0
- package/dist/Spoiler/Spoiler.types.d.ts +4 -0
- package/dist/Spoiler/index.d.ts +3 -0
- package/dist/SvgSymbol/SvgSymbol.stories.d.ts +10 -0
- package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -0
- package/dist/SvgSymbol/icons.d.ts +157 -0
- package/dist/SvgSymbol/index.d.ts +3 -0
- package/dist/Switcher/Switcher.stories.d.ts +10 -0
- package/dist/Switcher/Switcher.types.d.ts +12 -0
- package/dist/Switcher/index.d.ts +3 -0
- package/dist/Table/Table.stories.d.ts +10 -0
- package/dist/Table/Table.types.d.ts +25 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Tag/Tag.stories.d.ts +10 -0
- package/dist/Tag/Tag.types.d.ts +12 -0
- package/dist/Tag/index.d.ts +3 -0
- package/dist/Timestamp/Timestamp.stories.d.ts +10 -0
- package/dist/Timestamp/Timestamp.types.d.ts +5 -0
- package/dist/Timestamp/index.d.ts +4 -0
- package/dist/Toolbar/Toolbar.stories.d.ts +10 -0
- package/dist/Toolbar/Toolbar.types.d.ts +5 -0
- package/dist/Toolbar/index.d.ts +3 -0
- package/dist/ToolbarButton/ToolbarButton.stories.d.ts +10 -0
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +9 -0
- package/dist/ToolbarButton/index.d.ts +3 -0
- package/dist/_storybook/PreviewWrapper/index.d.ts +6 -0
- package/dist/constants.d.ts +22 -0
- package/dist/index.d.ts +37 -0
- package/dist/ui-kit-2.cjs.development.js +2257 -10
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +2209 -3
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/utils/BlockContext.d.ts +8 -0
- package/dist/utils/DangerousHtml.d.ts +8 -0
- package/dist/utils/makeClassName.d.ts +1 -1
- package/dist/utils/makeStyleContext.d.ts +2 -0
- package/dist/utils/toCamel.d.ts +1 -0
- package/package.json +28 -13
- package/src/BookmarkButton/BookmarkButton.module.css +50 -0
- package/src/BookmarkButton/BookmarkButton.stories.module.css +5 -0
- package/src/BookmarkButton/BookmarkButton.stories.tsx +39 -0
- package/src/BookmarkButton/BookmarkButton.test.tsx +20 -0
- package/src/BookmarkButton/BookmarkButton.types.ts +6 -0
- package/src/BookmarkButton/index.tsx +37 -0
- package/src/Button/Button.stories.module.css +30 -0
- package/src/Button/Button.stories.tsx +87 -0
- package/src/Button/Button.test.tsx +42 -0
- package/src/Button/Button.types.ts +1 -3
- package/src/Button/index.tsx +2 -2
- package/src/CardTitle/CardTitle.module.css +52 -0
- package/src/CardTitle/CardTitle.stories.module.css +5 -0
- package/src/CardTitle/CardTitle.stories.tsx +36 -0
- package/src/CardTitle/CardTitle.test.tsx +20 -0
- package/src/CardTitle/CardTitle.types.ts +8 -0
- package/src/CardTitle/index.tsx +24 -0
- package/src/CardTitle/mock.json +8 -0
- package/src/ChapterBlock/ChapterBlock.module.css +70 -0
- package/src/ChapterBlock/ChapterBlock.stories.module.css +5 -0
- package/src/ChapterBlock/ChapterBlock.stories.tsx +36 -0
- package/src/ChapterBlock/ChapterBlock.test.tsx +20 -0
- package/src/ChapterBlock/ChapterBlock.types.ts +7 -0
- package/src/ChapterBlock/index.tsx +31 -0
- package/src/ChapterBlock/mock.json +5 -0
- package/src/Cover/Cover.module.css +5 -0
- package/src/Cover/Cover.stories.module.css +5 -0
- package/src/Cover/Cover.stories.tsx +34 -0
- package/src/Cover/Cover.test.tsx +20 -0
- package/src/Cover/Cover.types.ts +4 -0
- package/src/Cover/index.tsx +89 -0
- package/src/DocumentItemsCount/DocumentItemsCount.module.css +18 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.module.css +5 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +34 -0
- package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +20 -0
- package/src/DocumentItemsCount/DocumentItemsCount.types.ts +6 -0
- package/src/DocumentItemsCount/index.tsx +54 -0
- package/src/DotsOnImage/DotsOnImage.module.css +56 -0
- package/src/DotsOnImage/DotsOnImage.stories.module.css +9 -0
- package/src/DotsOnImage/DotsOnImage.stories.tsx +37 -0
- package/src/DotsOnImage/DotsOnImage.test.tsx +19 -0
- package/src/DotsOnImage/DotsOnImage.types.ts +46 -0
- package/src/DotsOnImage/index.tsx +79 -0
- package/src/DotsOnImage/mock.json +102 -0
- package/src/Dropdown/Dropdown.module.css +82 -0
- package/src/Dropdown/Dropdown.stories.module.css +5 -0
- package/src/Dropdown/Dropdown.stories.tsx +55 -0
- package/src/Dropdown/Dropdown.test.tsx +20 -0
- package/src/Dropdown/Dropdown.types.ts +5 -0
- package/src/Dropdown/index.tsx +35 -0
- package/src/EmbedBlock/EmbedBlock.module.css +351 -0
- package/src/EmbedBlock/EmbedBlock.stories.module.css +5 -0
- package/src/EmbedBlock/EmbedBlock.stories.tsx +39 -0
- package/src/EmbedBlock/EmbedBlock.test.tsx +20 -0
- package/src/EmbedBlock/EmbedBlock.tsx +236 -0
- package/src/EmbedBlock/EmbedBlock.types.ts +5 -0
- package/src/EmbedBlock/IframeBlock.tsx +86 -0
- package/src/EmbedBlock/index.tsx +16 -0
- package/src/EmbedBlock/mock.json +89 -0
- package/src/GroupedBlock/GroupedBlock.module.css +94 -0
- package/src/GroupedBlock/GroupedBlock.stories.module.css +5 -0
- package/src/GroupedBlock/GroupedBlock.stories.tsx +34 -0
- package/src/GroupedBlock/GroupedBlock.test.tsx +20 -0
- package/src/GroupedBlock/GroupedBlock.types.ts +4 -0
- package/src/GroupedBlock/index.tsx +67 -0
- package/src/HalfBlock/HalfBlock.module.css +88 -0
- package/src/HalfBlock/HalfBlock.stories.module.css +5 -0
- package/src/HalfBlock/HalfBlock.stories.tsx +34 -0
- package/src/HalfBlock/HalfBlock.test.tsx +20 -0
- package/src/HalfBlock/HalfBlock.types.ts +4 -0
- package/src/HalfBlock/index.tsx +53 -0
- package/src/Image/Image.module.css +78 -0
- package/src/Image/Image.stories.module.css +5 -0
- package/src/Image/Image.stories.tsx +47 -0
- package/src/Image/Image.test.tsx +33 -0
- package/src/Image/Image.types.ts +40 -0
- package/src/Image/RenderPicture.tsx +70 -0
- package/src/Image/index.tsx +101 -0
- package/src/Image/mock.json +49 -0
- package/src/ImportantLead/ImportantLead.module.css +64 -0
- package/src/ImportantLead/ImportantLead.stories.module.css +5 -0
- package/src/ImportantLead/ImportantLead.stories.tsx +34 -0
- package/src/ImportantLead/ImportantLead.test.tsx +20 -0
- package/src/ImportantLead/ImportantLead.types.ts +4 -0
- package/src/ImportantLead/index.tsx +35 -0
- package/src/Lazy/Lazy.module.css +9 -0
- package/src/Lazy/Lazy.stories.module.css +5 -0
- package/src/Lazy/Lazy.stories.tsx +48 -0
- package/src/Lazy/Lazy.test.tsx +20 -0
- package/src/Lazy/Lazy.types.ts +4 -0
- package/src/Lazy/index.tsx +41 -0
- package/src/ListBlock/ListBlock.module.css +163 -0
- package/src/ListBlock/ListBlock.stories.module.css +5 -0
- package/src/ListBlock/ListBlock.stories.tsx +34 -0
- package/src/ListBlock/ListBlock.test.tsx +20 -0
- package/src/ListBlock/ListBlock.types.ts +4 -0
- package/src/ListBlock/index.tsx +33 -0
- package/src/MaterialNote/MaterialNote.module.css +139 -0
- package/src/MaterialNote/MaterialNote.stories.module.css +5 -0
- package/src/MaterialNote/MaterialNote.stories.tsx +36 -0
- package/src/MaterialNote/MaterialNote.test.tsx +20 -0
- package/src/MaterialNote/MaterialNote.types.ts +12 -0
- package/src/MaterialNote/index.tsx +30 -0
- package/src/MaterialNote/mock.json +18 -0
- package/src/MaterialTitle/MaterialTitle.module.css +33 -0
- package/src/MaterialTitle/MaterialTitle.stories.module.css +13 -0
- package/src/MaterialTitle/MaterialTitle.stories.tsx +52 -0
- package/src/MaterialTitle/MaterialTitle.test.tsx +20 -0
- package/src/MaterialTitle/MaterialTitle.types.ts +3 -0
- package/src/MaterialTitle/index.tsx +20 -0
- package/src/MediaCaption/MediaCaption.module.css +85 -0
- package/src/MediaCaption/MediaCaption.stories.module.css +5 -0
- package/src/MediaCaption/MediaCaption.stories.tsx +37 -0
- package/src/MediaCaption/MediaCaption.test.tsx +20 -0
- package/src/MediaCaption/MediaCaption.types.ts +5 -0
- package/src/MediaCaption/index.tsx +35 -0
- package/src/Meta/Meta.module.css +106 -0
- package/src/Meta/Meta.stories.module.css +7 -0
- package/src/Meta/Meta.stories.tsx +69 -0
- package/src/Meta/Meta.test.tsx +20 -0
- package/src/Meta/Meta.types.ts +19 -0
- package/src/Meta/MetaContainer.tsx +148 -0
- package/src/Meta/index.tsx +32 -0
- package/src/MetaItem/MetaItem.module.css +104 -0
- package/src/MetaItem/MetaItem.stories.module.css +5 -0
- package/src/MetaItem/MetaItem.stories.tsx +34 -0
- package/src/MetaItem/MetaItem.test.tsx +20 -0
- package/src/MetaItem/MetaItem.types.ts +6 -0
- package/src/MetaItem/index.tsx +26 -0
- package/src/MetaItemLive/MetaItemLive.module.css +124 -0
- package/src/MetaItemLive/MetaItemLive.stories.module.css +5 -0
- package/src/MetaItemLive/MetaItemLive.stories.tsx +34 -0
- package/src/MetaItemLive/MetaItemLive.test.tsx +20 -0
- package/src/MetaItemLive/MetaItemLive.types.ts +3 -0
- package/src/MetaItemLive/index.tsx +25 -0
- package/src/Popover/Popover.module.css +134 -0
- package/src/Popover/Popover.stories.module.css +5 -0
- package/src/Popover/Popover.stories.tsx +55 -0
- package/src/Popover/Popover.test.tsx +20 -0
- package/src/Popover/Popover.types.ts +4 -0
- package/src/Popover/index.tsx +78 -0
- package/src/QuoteBlock/QuoteBlock.module.css +79 -0
- package/src/QuoteBlock/QuoteBlock.stories.module.css +7 -0
- package/src/QuoteBlock/QuoteBlock.stories.tsx +36 -0
- package/src/QuoteBlock/QuoteBlock.test.tsx +20 -0
- package/src/QuoteBlock/QuoteBlock.types.ts +6 -0
- package/src/QuoteBlock/index.tsx +24 -0
- package/src/QuoteBlock/mock.json +6 -0
- package/src/RawHtmlBlock/RawHtmlBlock.stories.module.css +5 -0
- package/src/RawHtmlBlock/RawHtmlBlock.stories.tsx +34 -0
- package/src/RawHtmlBlock/RawHtmlBlock.test.tsx +20 -0
- package/src/RawHtmlBlock/RawHtmlBlock.types.ts +9 -0
- package/src/RawHtmlBlock/index.tsx +57 -0
- package/src/RelatedBlock/RelatedBlock.module.css +129 -0
- package/src/RelatedBlock/RelatedBlock.stories.module.css +5 -0
- package/src/RelatedBlock/RelatedBlock.stories.tsx +34 -0
- package/src/RelatedBlock/RelatedBlock.test.tsx +20 -0
- package/src/RelatedBlock/RelatedBlock.types.ts +4 -0
- package/src/RelatedBlock/index.tsx +45 -0
- package/src/RenderBlocks/RenderBlocks.stories.module.css +5 -0
- package/src/RenderBlocks/RenderBlocks.stories.tsx +34 -0
- package/src/RenderBlocks/RenderBlocks.test.tsx +20 -0
- package/src/RenderBlocks/RenderBlocks.types.ts +10 -0
- package/src/RenderBlocks/index.tsx +125 -0
- package/src/RichTitle/RichTitle.module.css +85 -0
- package/src/RichTitle/RichTitle.stories.module.css +5 -0
- package/src/RichTitle/RichTitle.stories.tsx +34 -0
- package/src/RichTitle/RichTitle.test.tsx +20 -0
- package/src/RichTitle/RichTitle.types.ts +4 -0
- package/src/RichTitle/index.tsx +32 -0
- package/src/SimpleBlock/FootnoteLink.css +34 -0
- package/src/SimpleBlock/SimpleBlock.module.css +393 -0
- package/src/SimpleBlock/SimpleBlock.stories.module.css +5 -0
- package/src/SimpleBlock/SimpleBlock.stories.tsx +34 -0
- package/src/SimpleBlock/SimpleBlock.test.tsx +20 -0
- package/src/SimpleBlock/SimpleBlock.types.ts +4 -0
- package/src/SimpleBlock/index.tsx +47 -0
- package/src/SimpleTitle/SimpleTitle.module.css +33 -0
- package/src/SimpleTitle/SimpleTitle.stories.module.css +5 -0
- package/src/SimpleTitle/SimpleTitle.stories.tsx +34 -0
- package/src/SimpleTitle/SimpleTitle.test.tsx +20 -0
- package/src/SimpleTitle/SimpleTitle.types.ts +4 -0
- package/src/SimpleTitle/index.tsx +29 -0
- package/src/SourceBlock/SourceBlock.module.css +110 -0
- package/src/SourceBlock/SourceBlock.stories.module.css +5 -0
- package/src/SourceBlock/SourceBlock.stories.tsx +34 -0
- package/src/SourceBlock/SourceBlock.test.tsx +20 -0
- package/src/SourceBlock/SourceBlock.types.ts +4 -0
- package/src/SourceBlock/index.tsx +44 -0
- package/src/Spoiler/Spoiler.module.css +177 -0
- package/src/Spoiler/Spoiler.stories.module.css +8 -0
- package/src/Spoiler/Spoiler.stories.tsx +36 -0
- package/src/Spoiler/Spoiler.test.tsx +20 -0
- package/src/Spoiler/Spoiler.types.ts +4 -0
- package/src/Spoiler/index.tsx +81 -0
- package/src/Spoiler/mock.json +49 -0
- package/src/SvgSymbol/SvgSymbol.module.css +240 -0
- package/src/SvgSymbol/SvgSymbol.stories.module.css +127 -0
- package/src/SvgSymbol/SvgSymbol.stories.tsx +95 -0
- package/src/SvgSymbol/SvgSymbol.test.tsx +21 -0
- package/src/SvgSymbol/SvgSymbol.types.ts +57 -0
- package/src/SvgSymbol/icons.ts +217 -0
- package/src/SvgSymbol/index.tsx +32 -0
- package/src/Switcher/Switcher.module.css +159 -0
- package/src/Switcher/Switcher.stories.module.css +28 -0
- package/src/Switcher/Switcher.stories.tsx +68 -0
- package/src/Switcher/Switcher.test.tsx +43 -0
- package/src/Switcher/Switcher.types.ts +16 -0
- package/src/Switcher/index.tsx +53 -0
- package/src/Table/Table.module.css +300 -0
- package/src/Table/Table.stories.module.css +5 -0
- package/src/Table/Table.stories.tsx +36 -0
- package/src/Table/Table.test.tsx +20 -0
- package/src/Table/Table.types.ts +26 -0
- package/src/Table/index.tsx +76 -0
- package/src/Table/mock.json +301 -0
- package/src/Tag/Tag.module.css +115 -0
- package/src/Tag/Tag.stories.module.css +5 -0
- package/src/Tag/Tag.stories.tsx +53 -0
- package/src/Tag/Tag.test.tsx +20 -0
- package/src/Tag/Tag.types.ts +14 -0
- package/src/Tag/index.tsx +33 -0
- package/src/Timestamp/Timestamp.module.css +6 -0
- package/src/Timestamp/Timestamp.stories.module.css +5 -0
- package/src/Timestamp/Timestamp.stories.tsx +34 -0
- package/src/Timestamp/Timestamp.test.tsx +20 -0
- package/src/Timestamp/Timestamp.types.ts +5 -0
- package/src/Timestamp/index.tsx +40 -0
- package/src/Toolbar/Toolbar.module.css +134 -0
- package/src/Toolbar/Toolbar.stories.module.css +5 -0
- package/src/Toolbar/Toolbar.stories.tsx +89 -0
- package/src/Toolbar/Toolbar.test.tsx +20 -0
- package/src/Toolbar/Toolbar.types.ts +4 -0
- package/src/Toolbar/index.tsx +28 -0
- package/src/ToolbarButton/ToolbarButton.module.css +97 -0
- package/src/ToolbarButton/ToolbarButton.stories.module.css +5 -0
- package/src/ToolbarButton/ToolbarButton.stories.tsx +36 -0
- package/src/ToolbarButton/ToolbarButton.test.tsx +20 -0
- package/src/ToolbarButton/ToolbarButton.types.ts +19 -0
- package/src/ToolbarButton/index.tsx +34 -0
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +117 -0
- package/src/_storybook/PreviewWrapper/index.tsx +23 -0
- package/src/constants.ts +24 -0
- package/src/index.tsx +38 -0
- package/src/utils/BlockContext.ts +7 -0
- package/src/utils/DangerousHtml.tsx +79 -0
- package/src/utils/makeClassName.ts +1 -1
- package/src/utils/makeStyleContext.ts +13 -0
- package/src/utils/toCamel.ts +2 -0
- package/LICENSE +0 -21
- package/src/global.d.ts +0 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
text-align: left;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.main {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-flow: column nowrap;
|
|
12
|
+
|
|
13
|
+
@media $landscapeTablet {
|
|
14
|
+
align-items: center;
|
|
15
|
+
flex-flow: row nowrap;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.body {
|
|
20
|
+
order: -1;
|
|
21
|
+
|
|
22
|
+
max-width: 860px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
|
|
25
|
+
@media $portraitTablet {
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media $landscapeTablet {
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
order: 0;
|
|
33
|
+
|
|
34
|
+
width: 50%;
|
|
35
|
+
max-width: none;
|
|
36
|
+
height: 100%;
|
|
37
|
+
margin-left: 25px;
|
|
38
|
+
|
|
39
|
+
text-align: left;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.footer {
|
|
44
|
+
width: 100%;
|
|
45
|
+
max-width: 650px;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
padding-top: 3px;
|
|
48
|
+
|
|
49
|
+
@media $landscapeTablet {
|
|
50
|
+
max-width: 1000px;
|
|
51
|
+
margin: auto;
|
|
52
|
+
padding-top: 0;
|
|
53
|
+
|
|
54
|
+
border-top: 1px solid #e6e6e6;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.image {
|
|
59
|
+
flex-grow: 1;
|
|
60
|
+
|
|
61
|
+
margin: 0 -20px 0;
|
|
62
|
+
margin-top: 18px;
|
|
63
|
+
|
|
64
|
+
@media $mobile {
|
|
65
|
+
margin: 31px 0 -5px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media $landscapeTablet {
|
|
69
|
+
width: 50%;
|
|
70
|
+
margin: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* VISIBILITY */
|
|
75
|
+
|
|
76
|
+
.mobile {
|
|
77
|
+
@media $mobile {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.desktop {
|
|
83
|
+
display: none;
|
|
84
|
+
|
|
85
|
+
@media $mobile {
|
|
86
|
+
display: block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { HalfBlock } from './'
|
|
4
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './HalfBlock.stories.module.css'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Main / HalfBlock',
|
|
9
|
+
component: HalfBlock,
|
|
10
|
+
parameters: {
|
|
11
|
+
themeWrapperSideBySide: true
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const Example: React.FC = () => {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<div className={styles.root}>
|
|
19
|
+
<HalfBlock />
|
|
20
|
+
</div>
|
|
21
|
+
</>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Default: React.FC = () => (
|
|
26
|
+
<>
|
|
27
|
+
<PreviewWrapper theme="light">
|
|
28
|
+
<Example />
|
|
29
|
+
</PreviewWrapper>
|
|
30
|
+
<PreviewWrapper theme="dark">
|
|
31
|
+
<Example />
|
|
32
|
+
</PreviewWrapper>
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { HalfBlock } from './'
|
|
5
|
+
import { HalfBlockProps } from './HalfBlock.types'
|
|
6
|
+
import styles from './HalfBlock.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Half Block', () => {
|
|
9
|
+
let props: HalfBlockProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<HalfBlock {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const halfBlock = getByTestId('half-block')
|
|
17
|
+
|
|
18
|
+
expect(halfBlock).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HalfBlockProps } from './HalfBlock.types'
|
|
3
|
+
|
|
4
|
+
import makeClassName from '../utils/makeClassName'
|
|
5
|
+
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
|
+
|
|
7
|
+
import { RenderBlocks } from '../RenderBlocks'
|
|
8
|
+
import { Image } from '../Image'
|
|
9
|
+
import { MediaCaption } from '../MediaCaption'
|
|
10
|
+
|
|
11
|
+
import styles from './HalfBlock.module.css'
|
|
12
|
+
|
|
13
|
+
export const HalfBlock: React.FC<HalfBlockProps> = ({
|
|
14
|
+
block: {
|
|
15
|
+
only_on: onlyOn,
|
|
16
|
+
data,
|
|
17
|
+
data: {
|
|
18
|
+
cover: { optimized, ratio, credit, caption }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
styleContext
|
|
22
|
+
}) => {
|
|
23
|
+
let classNames: (string[] | string | boolean)[][] = [
|
|
24
|
+
[styles.root, true],
|
|
25
|
+
[styles[onlyOn], true]
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
if (styleContext) {
|
|
29
|
+
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div data-testid="half-block" className={makeClassName(classNames)}>
|
|
34
|
+
<div className={styles.main}>
|
|
35
|
+
<div className={styles.image}>
|
|
36
|
+
<Image optimized={optimized} ratio={ratio} display="super_full" />
|
|
37
|
+
</div>
|
|
38
|
+
<div className={styles.body}>
|
|
39
|
+
{data.blocks.map(item => (
|
|
40
|
+
<RenderBlocks key={item.id} block={item} styleContext={['rich']} />
|
|
41
|
+
))}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div className={styles.footer}>
|
|
45
|
+
<MediaCaption
|
|
46
|
+
credit={credit}
|
|
47
|
+
caption={caption}
|
|
48
|
+
styleContext={styleContext}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
position: relative;
|
|
5
|
+
z-index: 1;
|
|
6
|
+
|
|
7
|
+
display: block;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
@media $mobile {
|
|
11
|
+
border-radius: inherit;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.placeholder,
|
|
16
|
+
.root img {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.wrapper {
|
|
26
|
+
display: block;
|
|
27
|
+
|
|
28
|
+
width: 100%;
|
|
29
|
+
|
|
30
|
+
background-repeat: no-repeat;
|
|
31
|
+
background-size: 100% auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.placeholder {
|
|
35
|
+
transition: background-color 250ms ease;
|
|
36
|
+
|
|
37
|
+
background-color: #f2f2f2;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.loaded {
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.fullscreen picture {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fullscreen picture:hover::after {
|
|
49
|
+
opacity: 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.fullscreen picture::after {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 12px;
|
|
55
|
+
bottom: 12px;
|
|
56
|
+
|
|
57
|
+
width: 40px;
|
|
58
|
+
height: 40px;
|
|
59
|
+
|
|
60
|
+
transition: opacity 250ms ease;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
|
|
63
|
+
opacity: 0;
|
|
64
|
+
border: 0.5px solid rgba(255, 255, 255, 0.15);
|
|
65
|
+
border-radius: 20px;
|
|
66
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
67
|
+
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.197 10.207V3.763h-6.463' stroke='%23DBDBDB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M19.793 4.166l-6.173 6.172' stroke='%23DBDBDB' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3.803 13.733v6.444h6.463' stroke='%23DBDBDB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4.207 19.774l6.173-6.171' stroke='%23DBDBDB' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
68
|
+
background-repeat: no-repeat;
|
|
69
|
+
background-position: center;
|
|
70
|
+
|
|
71
|
+
@media $landscapeTablet {
|
|
72
|
+
content: '';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-input='mouse'] .wrapper {
|
|
77
|
+
outline: none;
|
|
78
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Image } from './'
|
|
4
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './Image.stories.module.css'
|
|
6
|
+
|
|
7
|
+
import mock from './mock.json'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Main / Image',
|
|
11
|
+
component: Image,
|
|
12
|
+
parameters: {
|
|
13
|
+
themeWrapperSideBySide: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Example: React.FC = () => {
|
|
18
|
+
const {
|
|
19
|
+
image: { data }
|
|
20
|
+
} = mock
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<div className={styles.root}>
|
|
25
|
+
<Image
|
|
26
|
+
optimized={data.optimized}
|
|
27
|
+
width={data.width}
|
|
28
|
+
height={data.height}
|
|
29
|
+
alt={data.credit}
|
|
30
|
+
display={data.display}
|
|
31
|
+
lazy={data.lazy}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Default: React.FC = () => (
|
|
39
|
+
<>
|
|
40
|
+
<PreviewWrapper theme="light">
|
|
41
|
+
<Example />
|
|
42
|
+
</PreviewWrapper>
|
|
43
|
+
<PreviewWrapper theme="dark">
|
|
44
|
+
<Example />
|
|
45
|
+
</PreviewWrapper>
|
|
46
|
+
</>
|
|
47
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { Image } from './'
|
|
5
|
+
import styles from './Image.module.css'
|
|
6
|
+
|
|
7
|
+
import mock from './mock.json'
|
|
8
|
+
|
|
9
|
+
describe('Image', () => {
|
|
10
|
+
const {
|
|
11
|
+
image: { data }
|
|
12
|
+
} = mock
|
|
13
|
+
|
|
14
|
+
const renderComponent = () =>
|
|
15
|
+
render(
|
|
16
|
+
<Image
|
|
17
|
+
optimized={data.optimized}
|
|
18
|
+
width={data.width}
|
|
19
|
+
height={data.height}
|
|
20
|
+
alt={data.credit}
|
|
21
|
+
display={data.display}
|
|
22
|
+
lazy={data.lazy}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
it('should have root style', () => {
|
|
27
|
+
const { getByTestId } = renderComponent()
|
|
28
|
+
|
|
29
|
+
const image = getByTestId('image')
|
|
30
|
+
|
|
31
|
+
expect(image).toHaveClass(styles.root)
|
|
32
|
+
})
|
|
33
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface OptimizedImageItem {
|
|
2
|
+
'1x': string
|
|
3
|
+
'2x': string
|
|
4
|
+
'1x_webp': string
|
|
5
|
+
'2x_webp': string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ImageProps {
|
|
9
|
+
alt?: string
|
|
10
|
+
display?: string
|
|
11
|
+
optimized?: {
|
|
12
|
+
original: string
|
|
13
|
+
w325: OptimizedImageItem
|
|
14
|
+
w520: OptimizedImageItem
|
|
15
|
+
w650: OptimizedImageItem
|
|
16
|
+
w980: OptimizedImageItem
|
|
17
|
+
w1335: OptimizedImageItem
|
|
18
|
+
}
|
|
19
|
+
width?: number
|
|
20
|
+
height?: number
|
|
21
|
+
source?: object
|
|
22
|
+
lazy?: boolean
|
|
23
|
+
fullscreen?: boolean
|
|
24
|
+
ratio?: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface PictureProps {
|
|
28
|
+
source?: object
|
|
29
|
+
optimized?: {
|
|
30
|
+
original: string
|
|
31
|
+
w325: OptimizedImageItem
|
|
32
|
+
w520: OptimizedImageItem
|
|
33
|
+
w650: OptimizedImageItem
|
|
34
|
+
w980: OptimizedImageItem
|
|
35
|
+
w1335: OptimizedImageItem
|
|
36
|
+
}
|
|
37
|
+
alt?: string
|
|
38
|
+
fallbackSource: string
|
|
39
|
+
display: string
|
|
40
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { PictureProps } from './Image.types'
|
|
3
|
+
|
|
4
|
+
import { imageBreakpoints, imageConditionalKeys } from '../constants'
|
|
5
|
+
import { toCamel } from '../utils/toCamel'
|
|
6
|
+
|
|
7
|
+
export const RenderPicture: React.FC<PictureProps> = ({
|
|
8
|
+
source,
|
|
9
|
+
fallbackSource,
|
|
10
|
+
optimized,
|
|
11
|
+
alt,
|
|
12
|
+
display
|
|
13
|
+
}) => {
|
|
14
|
+
const [fallback, setFallback] = useState(false)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setFallback(!window.HTMLPictureElement)
|
|
18
|
+
}, [])
|
|
19
|
+
|
|
20
|
+
const keys =
|
|
21
|
+
imageConditionalKeys[toCamel(display)] || imageConditionalKeys.default
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<picture>
|
|
25
|
+
{source && (
|
|
26
|
+
<source media="(min-width: 325px)" srcSet={`${source[1]} 2x`} />
|
|
27
|
+
)}
|
|
28
|
+
|
|
29
|
+
{optimized && !optimized.w325 && (
|
|
30
|
+
<source media="(min-width: 0)" srcSet={`${optimized.original}`} />
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
{optimized &&
|
|
34
|
+
keys.map(key => {
|
|
35
|
+
const breakpoint = optimized[`w${key}`]
|
|
36
|
+
|
|
37
|
+
if (!breakpoint) {
|
|
38
|
+
return null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<React.Fragment key={key}>
|
|
43
|
+
<source
|
|
44
|
+
type="image/webp"
|
|
45
|
+
media={imageBreakpoints[key]}
|
|
46
|
+
srcSet={`${breakpoint['2x_webp']} 2x, ${breakpoint['1x_webp']} 1x `}
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<source
|
|
50
|
+
type="image/png"
|
|
51
|
+
media={imageBreakpoints[key]}
|
|
52
|
+
srcSet={`${breakpoint['2x']} 2x, ${breakpoint['1x']} 1x `}
|
|
53
|
+
/>
|
|
54
|
+
</React.Fragment>
|
|
55
|
+
)
|
|
56
|
+
})}
|
|
57
|
+
|
|
58
|
+
<img
|
|
59
|
+
src={
|
|
60
|
+
fallback
|
|
61
|
+
? fallbackSource
|
|
62
|
+
: 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='
|
|
63
|
+
}
|
|
64
|
+
alt={alt}
|
|
65
|
+
/>
|
|
66
|
+
</picture>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default RenderPicture
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
|
+
import { ImageProps } from './Image.types'
|
|
3
|
+
|
|
4
|
+
import makeClassName from '../utils/makeClassName'
|
|
5
|
+
|
|
6
|
+
import BlockContext from '../utils/BlockContext'
|
|
7
|
+
import viewportSize from '../utils/viewportSize'
|
|
8
|
+
import { MediaQuerySizes } from '../constants'
|
|
9
|
+
|
|
10
|
+
import { Lazy } from '../Lazy'
|
|
11
|
+
import RenderPicture from './RenderPicture'
|
|
12
|
+
|
|
13
|
+
import styles from './Image.module.css'
|
|
14
|
+
|
|
15
|
+
export const Image: React.FC<ImageProps> = ({
|
|
16
|
+
alt,
|
|
17
|
+
display,
|
|
18
|
+
optimized,
|
|
19
|
+
width,
|
|
20
|
+
height,
|
|
21
|
+
source,
|
|
22
|
+
lazy,
|
|
23
|
+
fullscreen,
|
|
24
|
+
ratio
|
|
25
|
+
}) => {
|
|
26
|
+
const { lightBox } = useContext(BlockContext)
|
|
27
|
+
|
|
28
|
+
const handleClick = (): void => {
|
|
29
|
+
const { width: viewportWidth } = viewportSize()
|
|
30
|
+
|
|
31
|
+
if (
|
|
32
|
+
(optimized && !optimized.original) ||
|
|
33
|
+
!lightBox ||
|
|
34
|
+
(viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen)
|
|
35
|
+
) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
postMessage('fullscreen_click', 'click')
|
|
40
|
+
lightBox.show(optimized, width, height, alt)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const pictureStyles = {
|
|
44
|
+
paddingBottom: `${100 / (ratio || width / height)}%`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const blockStyles = {
|
|
48
|
+
maxWidth: width <= 649 ? width : '100%'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* fallback w325 url until w6 was released */
|
|
52
|
+
const fallbackSource =
|
|
53
|
+
(source && source[0]) ||
|
|
54
|
+
(optimized.w325 && optimized.w325['1x']) ||
|
|
55
|
+
optimized.original
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
className={makeClassName([
|
|
60
|
+
[styles.root, true],
|
|
61
|
+
[styles.fullscreen, fullscreen]
|
|
62
|
+
])}
|
|
63
|
+
style={blockStyles}
|
|
64
|
+
data-testid="image"
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
className={styles.wrapper}
|
|
68
|
+
style={pictureStyles}
|
|
69
|
+
onClick={(): void => handleClick()}
|
|
70
|
+
onKeyPress={(): void => handleClick()}
|
|
71
|
+
role="button"
|
|
72
|
+
tabIndex={0}
|
|
73
|
+
>
|
|
74
|
+
{lazy ? (
|
|
75
|
+
<>
|
|
76
|
+
<Lazy threshold={0.25}>
|
|
77
|
+
<RenderPicture
|
|
78
|
+
fallbackSource={fallbackSource}
|
|
79
|
+
source={source}
|
|
80
|
+
optimized={optimized}
|
|
81
|
+
alt={alt}
|
|
82
|
+
display={display}
|
|
83
|
+
/>
|
|
84
|
+
</Lazy>
|
|
85
|
+
<noscript>
|
|
86
|
+
<img src={fallbackSource} alt={alt} />
|
|
87
|
+
</noscript>
|
|
88
|
+
</>
|
|
89
|
+
) : (
|
|
90
|
+
<RenderPicture
|
|
91
|
+
fallbackSource={fallbackSource}
|
|
92
|
+
source={source}
|
|
93
|
+
optimized={optimized}
|
|
94
|
+
alt={alt}
|
|
95
|
+
display={display}
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"image": {
|
|
3
|
+
"type": "image",
|
|
4
|
+
"data": {
|
|
5
|
+
"display": "default",
|
|
6
|
+
"width": 1335,
|
|
7
|
+
"height": 890,
|
|
8
|
+
"credit": "Николай Петров / BelTA / Reuters / Scanpix / LETA",
|
|
9
|
+
"cc": "default",
|
|
10
|
+
"only_on": "desktop",
|
|
11
|
+
"lazy": true,
|
|
12
|
+
"optimized": {
|
|
13
|
+
"original": "https://meduza.io/impro/F9JGhOM1jFAqUdaty5qKTlWHyOIax0jN_4YHLNftSbg/fill/2670/0/ce/0/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
14
|
+
"w325": {
|
|
15
|
+
"1x": "https://meduza.io/impro/6sHhKtVZ9rcdvj-iASnXgoexdnDZlyMZ1z-brLKZ0sk/fill/325/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
16
|
+
"2x": "https://meduza.io/impro/B4jyVhfDLxy9-xzt7_6v1JxO1wfK-FUXi1m9DmYRPjg/fill/650/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
17
|
+
"1x_webp": "https://meduza.io/impro/-eaVF5oW8y2D95UzQWB44b5ObepgNuRAnm8eZtJLpIY/fill/325/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp",
|
|
18
|
+
"2x_webp": "https://meduza.io/impro/sIhr8I9miVXXIQmgsWYsWqPWsnCc1m3eCxUwLspYk3E/fill/650/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp"
|
|
19
|
+
},
|
|
20
|
+
"w520": {
|
|
21
|
+
"1x": "https://meduza.io/impro/PZlQXlGF_yh27PpHwslH1360tnQNGCfcaMp_0UjjnEI/fill/520/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
22
|
+
"2x": "https://meduza.io/impro/JpGXbnZWrU6rjVeghdkJwq1KN2zrjy062vBCKcovZ44/fill/1040/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
23
|
+
"1x_webp": "https://meduza.io/impro/fIf2--kd58_Kc9bjhckO5Uo00Bjty9MH8gtLZhkseMg/fill/520/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp",
|
|
24
|
+
"2x_webp": "https://meduza.io/impro/GT-iiL_QPziT59XeGCZF8YMLCQ4d4O7nOeGLv72htlk/fill/1040/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp"
|
|
25
|
+
},
|
|
26
|
+
"w650": {
|
|
27
|
+
"1x": "https://meduza.io/impro/B4jyVhfDLxy9-xzt7_6v1JxO1wfK-FUXi1m9DmYRPjg/fill/650/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
28
|
+
"2x": "https://meduza.io/impro/HtOvinjzMc7Ft4AQDz-V25ne6meOR48_FfOY8Kq5wzY/fill/1300/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
29
|
+
"1x_webp": "https://meduza.io/impro/sIhr8I9miVXXIQmgsWYsWqPWsnCc1m3eCxUwLspYk3E/fill/650/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp",
|
|
30
|
+
"2x_webp": "https://meduza.io/impro/ck1HxMsH_ekSQNBlpC2CYIOnPr_Yi9Te_3FnEXrq8wc/fill/1300/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp"
|
|
31
|
+
},
|
|
32
|
+
"w980": {
|
|
33
|
+
"1x": "https://meduza.io/impro/OGw8P4FJu8CBD5WCWNra0X4cjR3NHLHqvUwLNQosEJY/fill/980/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
34
|
+
"2x": "https://meduza.io/impro/SbjBdskXIIqBXEqABY-MjsosAqGIoslrDYqOLByOnU0/fill/1960/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
35
|
+
"1x_webp": "https://meduza.io/impro/ADU6kdmUIwaylp2yYyVCm8DljP_sl0VcRX72ucNVlcw/fill/980/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp",
|
|
36
|
+
"2x_webp": "https://meduza.io/impro/lzSF1aCboClzlJELl0DCxZmAga9R7NsyZxLVrE0BKUg/fill/1960/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp"
|
|
37
|
+
},
|
|
38
|
+
"w1335": {
|
|
39
|
+
"1x": "https://meduza.io/impro/dvyomaKo4UQnFydF116LzwyfbVMsRhvR2dccoBcMIvo/fill/1335/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
40
|
+
"2x": "https://meduza.io/impro/19I4OdPJ_R5KT-YbZsjcr4X6tGAbilTIVlSVKqgMYLI/fill/2670/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.jpg",
|
|
41
|
+
"1x_webp": "https://meduza.io/impro/j-1Dij5eyRc7DpMwMQCplNlJPYfs3lCL0SlerWsWJFk/fill/1335/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp",
|
|
42
|
+
"2x_webp": "https://meduza.io/impro/NhyR_QN9S55r7O0v2Kd2imcdDUFj_umeixgqHXYxWNA/fill/2670/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNS85/NzIvNjE5L29yaWdp/bmFsL0FDbnU4Yi1o/Y1JPaFJLOEhxdjdX/ZlEuanBn.webp"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"only_on": "desktop",
|
|
47
|
+
"id": "0-0e0eaf18c658ef60ad691d9115c61dd994a64361013efea29d52c08e027d8ed7"
|
|
48
|
+
}
|
|
49
|
+
}
|