@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,55 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Dropdown, Menu } from './'
|
|
4
|
+
import { Button } from '../Button'
|
|
5
|
+
import { SvgSymbol } from '../SvgSymbol'
|
|
6
|
+
|
|
7
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
8
|
+
import styles from './Dropdown.stories.module.css'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Main / Dropdown',
|
|
12
|
+
component: Dropdown,
|
|
13
|
+
parameters: {
|
|
14
|
+
themeWrapperSideBySide: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Example: React.FC = () => {
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<div className={styles.root}>
|
|
22
|
+
<Dropdown>
|
|
23
|
+
<Button size="auto" theme="ghost" styleContext="isInDropdown">
|
|
24
|
+
<u>Открыть меню</u>
|
|
25
|
+
<span>
|
|
26
|
+
<SvgSymbol icon="arrow" />
|
|
27
|
+
</span>
|
|
28
|
+
</Button>
|
|
29
|
+
|
|
30
|
+
<Menu>
|
|
31
|
+
<ul>
|
|
32
|
+
<li>
|
|
33
|
+
<a href="#target">Первый элемент</a>
|
|
34
|
+
</li>
|
|
35
|
+
<li>
|
|
36
|
+
<a href="#target">Второй элемент</a>
|
|
37
|
+
</li>
|
|
38
|
+
</ul>
|
|
39
|
+
</Menu>
|
|
40
|
+
</Dropdown>
|
|
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 { Dropdown } from './'
|
|
5
|
+
import { DropdownProps } from './Dropdown.types'
|
|
6
|
+
import styles from './Dropdown.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Dropdown', () => {
|
|
9
|
+
let props: DropdownProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<Dropdown {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const dropdown = getByTestId('dropdown')
|
|
17
|
+
|
|
18
|
+
expect(dropdown).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { DropdownProps } from './Dropdown.types'
|
|
3
|
+
import makeClassName from '../utils/makeClassName'
|
|
4
|
+
import makeStyleContext from '../utils/makeStyleContext'
|
|
5
|
+
|
|
6
|
+
import styles from './Dropdown.module.css'
|
|
7
|
+
|
|
8
|
+
export const Menu: React.FC<DropdownProps> = ({ children }) => {
|
|
9
|
+
return (
|
|
10
|
+
<div data-testid="dropdown" className={styles.menu}>
|
|
11
|
+
{children}
|
|
12
|
+
</div>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Dropdown: React.FC<DropdownProps> = ({
|
|
17
|
+
children,
|
|
18
|
+
active,
|
|
19
|
+
styleContext
|
|
20
|
+
}) => {
|
|
21
|
+
let classNames: (string[] | string | boolean)[][] = [
|
|
22
|
+
[styles.root, true],
|
|
23
|
+
[styles.active, !!active && !!styles.active]
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
if (styleContext) {
|
|
27
|
+
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div data-testid="dropdown" className={makeClassName(classNames)}>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
margin: 15px 0;
|
|
7
|
+
|
|
8
|
+
@media $mobile {
|
|
9
|
+
margin: 25px 0 20px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.root:first-child {
|
|
14
|
+
margin-top: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.root:last-child {
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.root figcaption {
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-width: 650px;
|
|
24
|
+
margin-right: auto;
|
|
25
|
+
margin-left: auto;
|
|
26
|
+
|
|
27
|
+
font-family: $secondaryFont;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.object {
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.objectWrap {
|
|
35
|
+
position: relative;
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-flow: column nowrap;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.objectWrap iframe {
|
|
42
|
+
display: block;
|
|
43
|
+
|
|
44
|
+
width: 100px;
|
|
45
|
+
min-width: 100%;
|
|
46
|
+
|
|
47
|
+
border-width: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.proportional iframe,
|
|
51
|
+
.proportional video {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.objectWrap img,
|
|
60
|
+
.objectWrap video {
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.attachment {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: flex-end;
|
|
68
|
+
flex-direction: row;
|
|
69
|
+
flex-wrap: nowrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.attachment figcaption {
|
|
73
|
+
padding-left: 12px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.default,
|
|
77
|
+
.xs {
|
|
78
|
+
max-width: 650px;
|
|
79
|
+
|
|
80
|
+
@media $mobile {
|
|
81
|
+
margin-right: auto;
|
|
82
|
+
margin-left: auto;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.full {
|
|
87
|
+
max-width: 980px;
|
|
88
|
+
|
|
89
|
+
@media $mobile {
|
|
90
|
+
margin-right: auto;
|
|
91
|
+
margin-left: auto;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.full .object {
|
|
96
|
+
margin-right: -20px;
|
|
97
|
+
margin-left: -20px;
|
|
98
|
+
|
|
99
|
+
@media $mobile {
|
|
100
|
+
margin-right: 0;
|
|
101
|
+
margin-left: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.super_full {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.super_full .figure {
|
|
110
|
+
@media $mobile {
|
|
111
|
+
margin-right: -15px;
|
|
112
|
+
margin-left: -15px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dark iframe {
|
|
117
|
+
background-color: transparent;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.isInGroupedBlock {
|
|
121
|
+
max-width: none;
|
|
122
|
+
|
|
123
|
+
@media $mobile {
|
|
124
|
+
margin: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.isInGroupedBlock .figure {
|
|
129
|
+
@media $mobile {
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.isInGroupedBlock figcaption {
|
|
135
|
+
max-width: none;
|
|
136
|
+
margin-right: 0;
|
|
137
|
+
margin-left: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-frozen='true'] {
|
|
141
|
+
position: relative;
|
|
142
|
+
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-frozen='true']::after {
|
|
147
|
+
position: absolute;
|
|
148
|
+
top: 0;
|
|
149
|
+
right: 0;
|
|
150
|
+
bottom: 0;
|
|
151
|
+
left: 0;
|
|
152
|
+
|
|
153
|
+
content: '';
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
|
|
156
|
+
background-image: url("data:image/svg+xml,%3Csvg width='70' height='70' viewBox='0 0 70 70' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle fill-opacity='.5' fill='%23000' cx='35' cy='35' r='35'/%3E%3Cpath d='M35 66.75c2.816 0 5.585-.367 8.256-1.084.667-.18 1.062-.865.883-1.532-.18-.666-.866-1.062-1.533-.883-2.46.662-5.01 1-7.607 1-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25zm15.946-4.29c2.41-1.4 4.624-3.114 6.587-5.092.487-.49.484-1.282-.006-1.768s-1.282-.484-1.768.006c-1.81 1.823-3.852 3.403-6.07 4.694-.598.347-.8 1.113-.453 1.71.347.596 1.112.798 1.71.45zm11.632-11.716c1.382-2.417 2.442-5.007 3.147-7.713.174-.667-.226-1.35-.894-1.524-.667-.174-1.35.227-1.524.895-.65 2.492-1.625 4.877-2.898 7.102-.343.6-.135 1.363.464 1.706.6.343 1.363.135 1.706-.464zm4.172-15.912c-.015-2.816-.397-5.583-1.128-8.25-.183-.666-.87-1.058-1.537-.875-.665.183-1.057.87-.874 1.536.675 2.457 1.026 5.006 1.04 7.602.003.69.566 1.247 1.256 1.243.69-.003 1.247-.566 1.244-1.256zM62.376 18.91c-1.414-2.402-3.14-4.608-5.128-6.56-.492-.485-1.283-.478-1.767.015-.483.492-.476 1.284.016 1.767 1.833 1.8 3.423 3.834 4.726 6.046.35.595 1.117.793 1.712.443.594-.35.793-1.116.442-1.71zM50.598 7.34c-2.424-1.37-5.02-2.416-7.73-3.107-.668-.17-1.35.233-1.52.902-.17.67.234 1.35.903 1.52 2.496.637 4.886 1.6 7.118 2.86.6.34 1.363.13 1.703-.472.34-.602.13-1.364-.472-1.704zM34.665 3.25c-2.815.03-5.58.425-8.244 1.17-.664.187-1.052.877-.865 1.542.186.664.875 1.052 1.54.866 2.454-.687 5-1.052 7.596-1.078.69-.008 1.245-.573 1.238-1.263-.007-.692-.573-1.245-1.263-1.238zm-15.903 4.46c-2.393 1.426-4.59 3.163-6.533 5.162-.482.495-.47 1.287.024 1.768.496.48 1.287.47 1.768-.026 1.79-1.842 3.815-3.443 6.02-4.758.594-.354.788-1.12.434-1.714-.353-.593-1.12-.787-1.714-.433zM7.256 19.55c-1.357 2.43-2.39 5.032-3.065 7.745-.166.67.242 1.348.912 1.515.67.167 1.348-.24 1.515-.91.623-2.5 1.573-4.894 2.822-7.133.335-.603.12-1.365-.484-1.7-.603-.338-1.364-.122-1.7.48zM3.254 35.5c.043 2.813.454 5.577 1.214 8.237.19.663.882 1.047 1.545.857.664-.19 1.05-.88.86-1.545-.7-2.45-1.08-4.995-1.12-7.59-.01-.69-.578-1.24-1.27-1.23-.69.01-1.24.58-1.23 1.27zm4.543 15.88c1.44 2.385 3.188 4.573 5.197 6.505.497.478 1.29.463 1.767-.035.48-.497.464-1.29-.033-1.767-1.85-1.78-3.463-3.797-4.79-5.995-.356-.59-1.125-.78-1.716-.425-.59.357-.78 1.125-.423 1.716zm11.9 11.444c2.44 1.343 5.046 2.36 7.763 3.023.67.162 1.347-.25 1.51-.92.164-.67-.247-1.347-.918-1.51-2.502-.61-4.902-1.547-7.147-2.784-.605-.333-1.365-.113-1.698.492-.334.604-.114 1.365.49 1.698z' fill='%23FFF' fill-rule='nonzero'/%3E%3Cpath d='M19.838 34.99c0 4.39 3.297 7.265 7.35 7.265 2.437 0 4.39-1.008 5.776-2.54v-5.25h-6.636v2.162h4.178v2.184c-.63.59-1.89 1.26-3.317 1.26-2.774.002-4.832-2.14-4.832-5.08s2.058-5.062 4.83-5.062c1.576 0 2.9.82 3.634 1.87l2.015-1.134c-1.134-1.617-2.92-2.92-5.65-2.92-4.052 0-7.35 2.857-7.35 7.245zm15.487 6.992h2.457V27.977h-2.456v14.007zm5.24 0h2.457v-6.047h6.992v-2.163h-6.992V30.14l7.14-.002v-2.163h-9.597v14.008z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E");
|
|
157
|
+
background-repeat: no-repeat;
|
|
158
|
+
background-position: center;
|
|
159
|
+
background-size: 70px 70px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.gameEmbed {
|
|
163
|
+
width: 100%;
|
|
164
|
+
max-width: 650px;
|
|
165
|
+
margin: 0 auto;
|
|
166
|
+
|
|
167
|
+
border-radius: 2px;
|
|
168
|
+
background: #fff;
|
|
169
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.gameEmbed iframe {
|
|
173
|
+
display: block;
|
|
174
|
+
|
|
175
|
+
width: 100%;
|
|
176
|
+
|
|
177
|
+
border-width: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.mobile {
|
|
181
|
+
@media $mobile {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.mobile .figure {
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
|
|
189
|
+
border-radius: 8px 8px 0 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.desktop {
|
|
193
|
+
display: none;
|
|
194
|
+
|
|
195
|
+
@media $mobile {
|
|
196
|
+
display: block;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.control {
|
|
201
|
+
position: absolute;
|
|
202
|
+
z-index: 10;
|
|
203
|
+
right: -8px;
|
|
204
|
+
bottom: 12px;
|
|
205
|
+
|
|
206
|
+
width: 28px;
|
|
207
|
+
height: 28px;
|
|
208
|
+
margin: 0;
|
|
209
|
+
padding: 0;
|
|
210
|
+
|
|
211
|
+
color: #fff;
|
|
212
|
+
border-width: 0;
|
|
213
|
+
border-radius: 14px;
|
|
214
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
215
|
+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E %3Cg fill='%23FEFEFE' fill-rule='evenodd' opacity='.7'%3E %3Cpath d='M12.726 16H3.275A3.276 3.276 0 0 1 0 12.725v-9.45A3.276 3.276 0 0 1 3.275 0h9.45A3.275 3.275 0 0 1 16 3.275v9.45A3.275 3.275 0 0 1 12.726 16zm0-2c.703 0 1.274-.571 1.274-1.275v-9.45C14 2.571 13.429 2 12.726 2H3.275C2.57 2 2 2.571 2 3.275v9.45C2 13.429 2.57 14 3.275 14h9.45z' fill-rule='nonzero'/%3E %3Cpath d='M4.97 8.307l7.046 7.046a.5.5 0 0 0 .708-.707l-7.4-7.4a.5.5 0 0 0-.708 0l-3.97 3.97a.5.5 0 0 0 .708.707L4.97 8.307z' fill-rule='nonzero'/%3E %3Cpath d='M10.875 5.832l3.771 3.771a.5.5 0 0 0 .707-.707l-4.125-4.125a.5.5 0 0 0-.707 0l-4.19 4.19a.5.5 0 1 0 .707.707l3.837-3.836z' fill-rule='nonzero'/%3E %3Cpath d='M5.865 4.269a.894.894 0 1 1-1.787 0 .894.894 0 0 1 1.787 0'/%3E %3C/g%3E %3C/svg%3E");
|
|
216
|
+
background-repeat: no-repeat;
|
|
217
|
+
background-position: center;
|
|
218
|
+
box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.15);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.raw_html {
|
|
222
|
+
margin: 0 auto;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.youtube .object,
|
|
226
|
+
.vimeo .object,
|
|
227
|
+
.onetv .object,
|
|
228
|
+
.coub .object,
|
|
229
|
+
.facebook_video .object,
|
|
230
|
+
.figure {
|
|
231
|
+
margin-right: -20px;
|
|
232
|
+
margin-left: -20px;
|
|
233
|
+
|
|
234
|
+
@media $mobile {
|
|
235
|
+
margin-right: auto;
|
|
236
|
+
margin-left: auto;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.card.youtube .object,
|
|
241
|
+
.card.vimeo .object,
|
|
242
|
+
.card.onetv .object,
|
|
243
|
+
.card.coub .object,
|
|
244
|
+
.card.facebook_video .object,
|
|
245
|
+
.card .figure,
|
|
246
|
+
.slide.youtube .object,
|
|
247
|
+
.slide.vimeo .object,
|
|
248
|
+
.slide.onetv .object,
|
|
249
|
+
.slide.coub .object,
|
|
250
|
+
.slide.facebook_video .object,
|
|
251
|
+
.slide .figure {
|
|
252
|
+
margin-right: -11px;
|
|
253
|
+
margin-left: -11px;
|
|
254
|
+
|
|
255
|
+
@media $landscapeTablet {
|
|
256
|
+
margin-right: auto;
|
|
257
|
+
margin-left: auto;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.card:not(.cc):last-child,
|
|
262
|
+
.slide:not(.cc):last-child {
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
|
|
265
|
+
margin-bottom: -16px;
|
|
266
|
+
|
|
267
|
+
border-radius: 0 0 8px 8px;
|
|
268
|
+
|
|
269
|
+
@media $landscapeTablet {
|
|
270
|
+
margin-bottom: -24px;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.isInAnswer {
|
|
275
|
+
margin-top: 12px;
|
|
276
|
+
margin-bottom: 12px;
|
|
277
|
+
|
|
278
|
+
@media $landscapeTablet {
|
|
279
|
+
margin-top: 10px;
|
|
280
|
+
margin-bottom: 10px;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.isInAnswer .figure {
|
|
285
|
+
margin-right: 0;
|
|
286
|
+
margin-left: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.picture.default .figure {
|
|
290
|
+
margin-right: 0;
|
|
291
|
+
margin-left: 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.picture.default img {
|
|
295
|
+
border-radius: 2px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.wrapper {
|
|
299
|
+
position: relative;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.wrapper .objectWrap {
|
|
303
|
+
position: static;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* VISIBILITY */
|
|
307
|
+
|
|
308
|
+
.mobile {
|
|
309
|
+
@media $mobile {
|
|
310
|
+
display: none;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.desktop {
|
|
315
|
+
display: none;
|
|
316
|
+
|
|
317
|
+
@media $mobile {
|
|
318
|
+
display: block;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* XS */
|
|
323
|
+
.xs {
|
|
324
|
+
@media $contentWidth {
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
flex-flow: row nowrap;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.xs .figure {
|
|
332
|
+
flex-shrink: 0;
|
|
333
|
+
|
|
334
|
+
max-width: 33.3333333%;
|
|
335
|
+
margin-right: 0;
|
|
336
|
+
margin-left: 0;
|
|
337
|
+
|
|
338
|
+
@media $contentWidth {
|
|
339
|
+
width: 216px;
|
|
340
|
+
margin-right: 15px;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.xs .figure figcaption {
|
|
345
|
+
padding-top: 12px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.xs + h3,
|
|
349
|
+
.xs + h4 {
|
|
350
|
+
margin-top: 0;
|
|
351
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { EmbedBlockContainer } from './'
|
|
4
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './EmbedBlock.stories.module.css'
|
|
6
|
+
|
|
7
|
+
import mock from './mock.json'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Main / EmbedBlock',
|
|
11
|
+
component: EmbedBlockContainer,
|
|
12
|
+
parameters: {
|
|
13
|
+
themeWrapperSideBySide: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Example: React.FC = () => {
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div className={styles.root}>
|
|
21
|
+
{mock.blocks.map(block => (
|
|
22
|
+
<EmbedBlockContainer block={block} lang="ru" key={block.id} />
|
|
23
|
+
// <span>{block.id}</span>
|
|
24
|
+
))}
|
|
25
|
+
</div>
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Default: React.FC = () => (
|
|
31
|
+
<>
|
|
32
|
+
<PreviewWrapper theme="light">
|
|
33
|
+
<Example />
|
|
34
|
+
</PreviewWrapper>
|
|
35
|
+
<PreviewWrapper theme="dark">
|
|
36
|
+
<Example />
|
|
37
|
+
</PreviewWrapper>
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { EmbedBlockContainer } from './'
|
|
5
|
+
import { EmbedBlockProps } from './EmbedBlock.types'
|
|
6
|
+
import styles from './EmbedBlock.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Embed Block', () => {
|
|
9
|
+
let props: EmbedBlockProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<EmbedBlockContainer {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const embedBlock = getByTestId('embed-block')
|
|
17
|
+
|
|
18
|
+
expect(embedBlock).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|