@meduza/ui-kit-2 0.0.1 → 0.1.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/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.css +36 -0
- package/dist/ui-kit-2.cjs.development.js +2187 -39
- 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 +2139 -32
- 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 +29 -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 +75 -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,134 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
position: fixed;
|
|
5
|
+
z-index: $zIndex-10;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: flex-end;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
min-height: 120px;
|
|
16
|
+
padding: 10px 10px 0;
|
|
17
|
+
|
|
18
|
+
animation: fadeOut 250ms ease both 100ms;
|
|
19
|
+
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.root.visible {
|
|
24
|
+
animation: fadeIn 250ms ease both;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.overlay {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
|
|
34
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
35
|
+
|
|
36
|
+
contain: '';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.container {
|
|
40
|
+
position: relative;
|
|
41
|
+
|
|
42
|
+
flex: 1;
|
|
43
|
+
|
|
44
|
+
max-width: 420px;
|
|
45
|
+
min-height: 80px;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
padding: 15px 20px 40px;
|
|
48
|
+
|
|
49
|
+
animation: disappear 350ms ease both;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dismiss {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: -23px;
|
|
55
|
+
left: 50%;
|
|
56
|
+
|
|
57
|
+
width: 50px;
|
|
58
|
+
height: 36px;
|
|
59
|
+
padding: 0;
|
|
60
|
+
|
|
61
|
+
transform: translateX(-50%);
|
|
62
|
+
|
|
63
|
+
opacity: 0.4;
|
|
64
|
+
border-width: 0;
|
|
65
|
+
border-radius: 0;
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
background-image: url("data:image/svg+xml,%3Csvg width='17' height='7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.445 1.832l6.946 4.63a2 2 0 0 0 2.218 0l6.946-4.63a1 1 0 1 0-1.11-1.664L8.5 4.798 1.555.168a1 1 0 1 0-1.11 1.664z' fill='%23F7F7F7' fill-rule='nonzero'/%3E%3C/svg%3E");
|
|
68
|
+
background-repeat: no-repeat;
|
|
69
|
+
background-position: center;
|
|
70
|
+
box-shadow: none;
|
|
71
|
+
|
|
72
|
+
appearance: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.background {
|
|
76
|
+
position: absolute;
|
|
77
|
+
z-index: -1;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
|
|
83
|
+
width: 100%;
|
|
84
|
+
height: 100%;
|
|
85
|
+
|
|
86
|
+
border-radius: 8px 8px 0 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.background rect {
|
|
90
|
+
position: absolute;
|
|
91
|
+
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.visible .container {
|
|
97
|
+
animation: appear 350ms ease both;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes appear {
|
|
101
|
+
0% {
|
|
102
|
+
transform: translateY(100%);
|
|
103
|
+
}
|
|
104
|
+
100% {
|
|
105
|
+
transform: translateY(0);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@keyframes disappear {
|
|
110
|
+
0% {
|
|
111
|
+
transform: translateY(0);
|
|
112
|
+
}
|
|
113
|
+
100% {
|
|
114
|
+
transform: translateY(100%);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@keyframes fadeIn {
|
|
119
|
+
0% {
|
|
120
|
+
opacity: 0;
|
|
121
|
+
}
|
|
122
|
+
100% {
|
|
123
|
+
opacity: 1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@keyframes fadeOut {
|
|
128
|
+
0% {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
100% {
|
|
132
|
+
opacity: 0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Popover } from './'
|
|
4
|
+
import { Button } from '../Button'
|
|
5
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
6
|
+
import styles from './Popover.stories.module.css'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Main / Popover',
|
|
10
|
+
component: Popover,
|
|
11
|
+
parameters: {
|
|
12
|
+
themeWrapperSideBySide: true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Example: React.FC = () => {
|
|
17
|
+
const [isPopoverShown, setIsPopoverShown] = useState(false)
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<div className={styles.root}>
|
|
22
|
+
<Button
|
|
23
|
+
size="default"
|
|
24
|
+
theme="gold"
|
|
25
|
+
onClick={(): void => {
|
|
26
|
+
setIsPopoverShown(!isPopoverShown)
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
Показать поповер
|
|
30
|
+
</Button>
|
|
31
|
+
|
|
32
|
+
{isPopoverShown && (
|
|
33
|
+
<Popover
|
|
34
|
+
onClose={(): void => {
|
|
35
|
+
setIsPopoverShown(false)
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
Здесь мог бы быть ваш компонент
|
|
39
|
+
</Popover>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
</>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Default: React.FC = () => (
|
|
47
|
+
<>
|
|
48
|
+
<PreviewWrapper theme="light">
|
|
49
|
+
<Example />
|
|
50
|
+
</PreviewWrapper>
|
|
51
|
+
<PreviewWrapper theme="dark">
|
|
52
|
+
<Example />
|
|
53
|
+
</PreviewWrapper>
|
|
54
|
+
</>
|
|
55
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { Popover } from './'
|
|
5
|
+
import { PopoverProps } from './Popover.types'
|
|
6
|
+
import styles from './Popover.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Popover', () => {
|
|
9
|
+
let props: PopoverProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<Popover {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const popover = getByTestId('popover')
|
|
17
|
+
|
|
18
|
+
expect(popover).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { PopoverProps } from './Popover.types'
|
|
3
|
+
import makeClassName from '../utils/makeClassName'
|
|
4
|
+
|
|
5
|
+
import styles from './Popover.module.css'
|
|
6
|
+
|
|
7
|
+
export const Popover: React.FC<PopoverProps> = ({ children, onClose }) => {
|
|
8
|
+
const [visible, setVisible] = useState(true)
|
|
9
|
+
|
|
10
|
+
const handleClose = (): void => {
|
|
11
|
+
setVisible(false)
|
|
12
|
+
setTimeout(onClose, 350)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const handleScroll = (): void => {
|
|
16
|
+
handleClose()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const escFunction = (event: KeyboardEvent): void => {
|
|
20
|
+
if (event.key === 'Escape') {
|
|
21
|
+
handleClose()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
window.addEventListener('keydown', escFunction, false)
|
|
27
|
+
window.addEventListener('scroll', handleScroll, false)
|
|
28
|
+
|
|
29
|
+
return () => {
|
|
30
|
+
window.removeEventListener('keydown', escFunction, false)
|
|
31
|
+
window.removeEventListener('scroll', handleScroll, false)
|
|
32
|
+
}
|
|
33
|
+
}, [visible])
|
|
34
|
+
|
|
35
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
data-testid="popover"
|
|
39
|
+
className={makeClassName([
|
|
40
|
+
[styles.root, true],
|
|
41
|
+
[styles.visible, visible]
|
|
42
|
+
])}
|
|
43
|
+
>
|
|
44
|
+
<div className={styles.overlay} onClick={(): void => handleClose()} />
|
|
45
|
+
|
|
46
|
+
<div className={styles.container}>
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
className={styles.dismiss}
|
|
50
|
+
onClick={(): void => handleClose()}
|
|
51
|
+
aria-label="dismiss"
|
|
52
|
+
/>
|
|
53
|
+
<svg width="100%" className={styles.background}>
|
|
54
|
+
<defs>
|
|
55
|
+
<mask id="myMask" x="0" y="0" width="100%" height="100%">
|
|
56
|
+
<rect fill="white" y="0" width="100%" height="100%" x="0" />
|
|
57
|
+
<svg x="50%" overflow="visible">
|
|
58
|
+
<g transform="translate(-12 0)">
|
|
59
|
+
<path d="M4.61852778e-14,9.76996262e-15 L9.84597532,5.80270273 C11.0992017,6.54128882 12.6546044,6.54128882 13.9078308,5.80270273 L23.7538061,9.76996262e-15 L4.61852778e-14,9.76996262e-15 Z" />
|
|
60
|
+
</g>
|
|
61
|
+
</svg>
|
|
62
|
+
</mask>
|
|
63
|
+
</defs>
|
|
64
|
+
<rect
|
|
65
|
+
fill="#F7F7F7"
|
|
66
|
+
id="base-mask"
|
|
67
|
+
mask="url(#myMask)"
|
|
68
|
+
x="0"
|
|
69
|
+
y="0"
|
|
70
|
+
width="100%"
|
|
71
|
+
height="100%"
|
|
72
|
+
/>
|
|
73
|
+
</svg>
|
|
74
|
+
{children}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
margin-bottom: 14px;
|
|
7
|
+
padding-left: 18px;
|
|
8
|
+
|
|
9
|
+
font-family: $primaryFont;
|
|
10
|
+
font-size: 18px;
|
|
11
|
+
line-height: 24px;
|
|
12
|
+
|
|
13
|
+
@media $mobile {
|
|
14
|
+
margin: 0 0 20px;
|
|
15
|
+
padding-left: 36px;
|
|
16
|
+
|
|
17
|
+
font-size: 20px;
|
|
18
|
+
line-height: 28px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.root + .root {
|
|
23
|
+
margin-top: -14px;
|
|
24
|
+
padding-top: 14px;
|
|
25
|
+
|
|
26
|
+
@media $mobile {
|
|
27
|
+
margin-top: -20px;
|
|
28
|
+
padding-top: 20px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.root + .root::before {
|
|
33
|
+
top: -10px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.root:before {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 5px;
|
|
39
|
+
bottom: 7px;
|
|
40
|
+
left: 0;
|
|
41
|
+
|
|
42
|
+
width: 4px;
|
|
43
|
+
|
|
44
|
+
content: '';
|
|
45
|
+
|
|
46
|
+
border-radius: 2px;
|
|
47
|
+
background-color: #ebebeb;
|
|
48
|
+
|
|
49
|
+
@media $mobile {
|
|
50
|
+
top: 4px;
|
|
51
|
+
bottom: 6px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.root:last-child {
|
|
56
|
+
margin-bottom: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.root p {
|
|
60
|
+
margin: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.root a {
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
|
|
66
|
+
color: inherit;
|
|
67
|
+
box-shadow: inset 0 -1px $gold;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.root a:hover {
|
|
71
|
+
color: $gold;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.center {
|
|
75
|
+
width: 100%;
|
|
76
|
+
max-width: 650px;
|
|
77
|
+
margin-right: auto;
|
|
78
|
+
margin-left: auto;
|
|
79
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { QuoteBlock } from './'
|
|
4
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './QuoteBlock.stories.module.css'
|
|
6
|
+
|
|
7
|
+
import mock from './mock.json'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Main / QuoteBlock',
|
|
11
|
+
component: QuoteBlock,
|
|
12
|
+
parameters: {
|
|
13
|
+
themeWrapperSideBySide: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Example: React.FC = () => {
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div className={styles.root}>
|
|
21
|
+
<QuoteBlock block={mock} />
|
|
22
|
+
</div>
|
|
23
|
+
</>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const Default: React.FC = () => (
|
|
28
|
+
<>
|
|
29
|
+
<PreviewWrapper theme="light">
|
|
30
|
+
<Example />
|
|
31
|
+
</PreviewWrapper>
|
|
32
|
+
<PreviewWrapper theme="dark">
|
|
33
|
+
<Example />
|
|
34
|
+
</PreviewWrapper>
|
|
35
|
+
</>
|
|
36
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { QuoteBlock } from './'
|
|
5
|
+
import { QuoteBlockProps } from './QuoteBlock.types'
|
|
6
|
+
import styles from './QuoteBlock.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Quote Block', () => {
|
|
9
|
+
let props: QuoteBlockProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<QuoteBlock {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const quoteBlock = getByTestId('quote-block')
|
|
17
|
+
|
|
18
|
+
expect(quoteBlock).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { QuoteBlockProps } from './QuoteBlock.types'
|
|
3
|
+
|
|
4
|
+
import makeClassName from '../utils/makeClassName'
|
|
5
|
+
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
|
+
|
|
7
|
+
import styles from './QuoteBlock.module.css'
|
|
8
|
+
|
|
9
|
+
export const QuoteBlock: React.FC<QuoteBlockProps> = ({
|
|
10
|
+
block: { data },
|
|
11
|
+
styleContext
|
|
12
|
+
}) => {
|
|
13
|
+
let classNames: (string[] | string | boolean)[][] = [[styles.root, true]]
|
|
14
|
+
|
|
15
|
+
if (styleContext) {
|
|
16
|
+
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div data-testid="quote-block" className={makeClassName(classNames)}>
|
|
21
|
+
<p dangerouslySetInnerHTML={{ __html: data }} />
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "quote",
|
|
3
|
+
"data": "Да, мы отменили проведение конкурса. Нас обвиняют во всех грехах, что мы хотим снести мавзолей и вынести тело Ленина. Где они это взяли? Это невозможно. Очень много негатива.",
|
|
4
|
+
"length": 174,
|
|
5
|
+
"id": "1-6299db8f2ba44119e88e5669cea1a928583c85a604030b300dc2466e8cde8d6d"
|
|
6
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { RawHtmlBlock } from './'
|
|
4
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './RawHtmlBlock.stories.module.css'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Main / RawHtmlBlock',
|
|
9
|
+
component: RawHtmlBlock,
|
|
10
|
+
parameters: {
|
|
11
|
+
themeWrapperSideBySide: true
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const Example: React.FC = () => {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<div className={styles.root}>
|
|
19
|
+
<RawHtmlBlock />
|
|
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 { RawHtmlBlock } from './'
|
|
5
|
+
import { RawHtmlBlockProps } from './RawHtmlBlock.types'
|
|
6
|
+
import styles from './RawHtmlBlock.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Raw Html Block', () => {
|
|
9
|
+
let props: RawHtmlBlockProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<RawHtmlBlock {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const rawHtmlBlock = getByTestId('raw-html-block')
|
|
17
|
+
|
|
18
|
+
expect(rawHtmlBlock).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { RawHtmlBlockProps } from './RawHtmlBlock.types'
|
|
3
|
+
|
|
4
|
+
import { ImportantLead } from '../ImportantLead'
|
|
5
|
+
import { RenderBlocks } from '../RenderBlocks'
|
|
6
|
+
import { Spoiler } from '../Spoiler'
|
|
7
|
+
import { HalfBlock } from '../HalfBlock'
|
|
8
|
+
import { Cover } from '../Cover'
|
|
9
|
+
|
|
10
|
+
import { BlockProvider } from '../utils/BlockContext'
|
|
11
|
+
|
|
12
|
+
export const RawHtmlBlock: React.FC<RawHtmlBlockProps> = ({
|
|
13
|
+
block,
|
|
14
|
+
styleContext,
|
|
15
|
+
isRead,
|
|
16
|
+
isListened,
|
|
17
|
+
isInBookmarks,
|
|
18
|
+
bookmarkAction,
|
|
19
|
+
lightBox
|
|
20
|
+
}) => {
|
|
21
|
+
const context = {
|
|
22
|
+
lightBox: lightBox || null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
switch (block.type) {
|
|
26
|
+
case 'important_lead': {
|
|
27
|
+
return <ImportantLead block={block} styleContext={styleContext} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
case 'spoiler': {
|
|
31
|
+
return <Spoiler block={block} styleContext={styleContext} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
case 'cover': {
|
|
35
|
+
return <Cover block={block} styleContext={styleContext} />
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
case 'half': {
|
|
39
|
+
return <HalfBlock block={block} styleContext={styleContext} />
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
default: {
|
|
43
|
+
return (
|
|
44
|
+
<BlockProvider value={context}>
|
|
45
|
+
<RenderBlocks
|
|
46
|
+
block={block}
|
|
47
|
+
styleContext={styleContext}
|
|
48
|
+
isRead={isRead}
|
|
49
|
+
isListened={isListened}
|
|
50
|
+
isInBookmarks={isInBookmarks}
|
|
51
|
+
bookmarkAction={bookmarkAction}
|
|
52
|
+
/>
|
|
53
|
+
</BlockProvider>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|