@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
|
+
overflow: hidden;
|
|
5
|
+
|
|
6
|
+
transform: translateZ(0);
|
|
7
|
+
|
|
8
|
+
font-family: $secondaryFont;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.list {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-flow: row wrap;
|
|
14
|
+
|
|
15
|
+
margin: 0 0 0 -10px;
|
|
16
|
+
padding: 0;
|
|
17
|
+
|
|
18
|
+
list-style: none;
|
|
19
|
+
|
|
20
|
+
@media $landscapeTablet {
|
|
21
|
+
margin: 0 0 0 -15px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.item {
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
min-width: 42px;
|
|
29
|
+
height: 32px;
|
|
30
|
+
padding-right: 10px;
|
|
31
|
+
padding-left: 10px;
|
|
32
|
+
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: color 250ms ease;
|
|
35
|
+
text-align: center;
|
|
36
|
+
|
|
37
|
+
color: #808080;
|
|
38
|
+
|
|
39
|
+
line-height: 1;
|
|
40
|
+
|
|
41
|
+
@media $landscapeTablet {
|
|
42
|
+
padding-right: 15px;
|
|
43
|
+
padding-left: 15px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.item:last-child {
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.item::before {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 7px;
|
|
54
|
+
left: 0;
|
|
55
|
+
|
|
56
|
+
height: 18px;
|
|
57
|
+
|
|
58
|
+
content: '';
|
|
59
|
+
vertical-align: middle;
|
|
60
|
+
|
|
61
|
+
border-left: 1px solid rgba(0, 0, 0, 0.15);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.item:empty {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.isInTopbar {
|
|
69
|
+
height: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.isInTopbar .item {
|
|
73
|
+
height: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.center {
|
|
77
|
+
width: 100%;
|
|
78
|
+
max-width: 650px;
|
|
79
|
+
margin-right: auto;
|
|
80
|
+
margin-left: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.game {
|
|
84
|
+
margin-top: 11px;
|
|
85
|
+
|
|
86
|
+
@media $mobile {
|
|
87
|
+
margin-top: 18px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.game .list,
|
|
92
|
+
.gameSurvey .list {
|
|
93
|
+
justify-content: center;
|
|
94
|
+
|
|
95
|
+
@media $mobile {
|
|
96
|
+
display: flex;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.game .item:last-child {
|
|
101
|
+
width: 260px;
|
|
102
|
+
|
|
103
|
+
@media $mobile {
|
|
104
|
+
width: auto;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.game .item:last-child::before {
|
|
109
|
+
content: none;
|
|
110
|
+
|
|
111
|
+
@media $mobile {
|
|
112
|
+
content: '';
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.gameSurvey .item:first-child::before,
|
|
117
|
+
.game .item:first-child::before {
|
|
118
|
+
content: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.game .list,
|
|
122
|
+
.gameSurvey .list {
|
|
123
|
+
@media $landscapeTablet {
|
|
124
|
+
margin-left: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dark .item::before {
|
|
129
|
+
border-left-color: rgba(255, 255, 255, 0.2);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-context="prodano"] .root {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Toolbar } from './'
|
|
4
|
+
import { ToolbarButton } from '../ToolbarButton'
|
|
5
|
+
import { ToolbarButtonTypes } from '../ToolbarButton/ToolbarButton.types'
|
|
6
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
import styles from './Toolbar.stories.module.css'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Main / Toolbar',
|
|
13
|
+
component: Toolbar,
|
|
14
|
+
parameters: {
|
|
15
|
+
themeWrapperSideBySide: true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const buttons: { type: ToolbarButtonTypes; label?: string }[] = [
|
|
20
|
+
{
|
|
21
|
+
type: 'fb',
|
|
22
|
+
label: '23,4K'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'vk',
|
|
26
|
+
label: '481'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'ok'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: 'tw'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'tg'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'reaction',
|
|
39
|
+
label: 'Связаться с редакцией'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: 'bookmark'
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
const Example: React.FC = () => {
|
|
47
|
+
const [bookmark, setBookmark] = useState(false)
|
|
48
|
+
const handleButton = (type: string): void => {
|
|
49
|
+
alert(type)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const handleBookmark = (): void => {
|
|
53
|
+
setBookmark(!bookmark)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<div className={styles.root}>
|
|
59
|
+
<Toolbar>
|
|
60
|
+
{buttons.map((button, index) => (
|
|
61
|
+
<ToolbarButton
|
|
62
|
+
type={button.type}
|
|
63
|
+
onClick={(): void =>
|
|
64
|
+
button.type === 'bookmark'
|
|
65
|
+
? handleBookmark()
|
|
66
|
+
: handleButton(button.type)
|
|
67
|
+
}
|
|
68
|
+
key={`${index}-${button.type}`}
|
|
69
|
+
isActive={button.type === 'bookmark' && bookmark}
|
|
70
|
+
>
|
|
71
|
+
{button.label && button.label}
|
|
72
|
+
</ToolbarButton>
|
|
73
|
+
))}
|
|
74
|
+
</Toolbar>
|
|
75
|
+
</div>
|
|
76
|
+
</>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const Default: React.FC = () => (
|
|
81
|
+
<>
|
|
82
|
+
<PreviewWrapper theme="light">
|
|
83
|
+
<Example />
|
|
84
|
+
</PreviewWrapper>
|
|
85
|
+
<PreviewWrapper theme="dark">
|
|
86
|
+
<Example />
|
|
87
|
+
</PreviewWrapper>
|
|
88
|
+
</>
|
|
89
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
|
|
4
|
+
import { Toolbar } from './'
|
|
5
|
+
import { ToolbarProps } from './Toolbar.types'
|
|
6
|
+
import styles from './Toolbar.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Toolbar', () => {
|
|
9
|
+
let props: ToolbarProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<Toolbar {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const toolbar = getByTestId('toolbar')
|
|
17
|
+
|
|
18
|
+
expect(toolbar).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { Children } from 'react'
|
|
2
|
+
import { ToolbarProps } from './Toolbar.types'
|
|
3
|
+
|
|
4
|
+
import makeStyleContext from '../utils/makeStyleContext'
|
|
5
|
+
import makeClassName from '../utils/makeClassName'
|
|
6
|
+
|
|
7
|
+
import styles from './Toolbar.module.css'
|
|
8
|
+
|
|
9
|
+
export const Toolbar: React.FC<ToolbarProps> = ({ children, styleContext }) => {
|
|
10
|
+
let classNames: (string[] | string | boolean)[][] = [[styles.root, true]]
|
|
11
|
+
|
|
12
|
+
if (styleContext) {
|
|
13
|
+
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const renderItems = (): JSX.Element[] =>
|
|
17
|
+
Children.map(children, (item: JSX.Element, index) => (
|
|
18
|
+
<li className={styles.item} key={`${index}-${item.props.type}`}>
|
|
19
|
+
{React.cloneElement(item)}
|
|
20
|
+
</li>
|
|
21
|
+
))
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div data-testid="toolbar" className={makeClassName(classNames)}>
|
|
25
|
+
<ul className={styles.list}>{renderItems()}</ul>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@import '../vars.css';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
height: 100%;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0 1px 0 0;
|
|
7
|
+
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
|
|
10
|
+
color: inherit;
|
|
11
|
+
border-width: 0;
|
|
12
|
+
outline: none;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
|
|
15
|
+
font-family: $secondaryFont;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: 1;
|
|
19
|
+
|
|
20
|
+
appearance: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.root::after {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
|
|
30
|
+
content: '';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root:hover {
|
|
34
|
+
opacity: 0.6;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dark {
|
|
38
|
+
color: #fff;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dark:hover {
|
|
42
|
+
opacity: 0.6;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dark svg {
|
|
46
|
+
color: #262626;
|
|
47
|
+
|
|
48
|
+
fill: #fff;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dark.bookmark svg {
|
|
52
|
+
color: #fff;
|
|
53
|
+
|
|
54
|
+
fill: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dark.bookmark.isActive svg {
|
|
58
|
+
fill: currentColor;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.dark::before {
|
|
62
|
+
border-left-color: rgba(255, 255, 255, 0.2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.root [data-theme='dark'] {
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.dark [data-theme='dark'] {
|
|
70
|
+
visibility: visible;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dark [data-theme='light'] {
|
|
74
|
+
visibility: hidden;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.text {
|
|
78
|
+
display: inline-block;
|
|
79
|
+
|
|
80
|
+
padding-left: 5px;
|
|
81
|
+
|
|
82
|
+
vertical-align: middle;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.text:empty {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.bookmark {
|
|
90
|
+
color: #999;
|
|
91
|
+
|
|
92
|
+
fill: transparent;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.isActive {
|
|
96
|
+
fill: currentColor;
|
|
97
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { ToolbarButton } from './'
|
|
4
|
+
import { PreviewWrapper } from '_storybook/PreviewWrapper'
|
|
5
|
+
import styles from './ToolbarButton.stories.module.css'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Main / ToolbarButton',
|
|
9
|
+
component: ToolbarButton,
|
|
10
|
+
parameters: {
|
|
11
|
+
themeWrapperSideBySide: true
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const Example: React.FC = () => {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<div className={styles.root}>
|
|
19
|
+
<ToolbarButton type="fb" onClick={(): void => alert('Hello Button')}>
|
|
20
|
+
42
|
|
21
|
+
</ToolbarButton>
|
|
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 { ToolbarButton } from './'
|
|
5
|
+
import { ToolbarButtonProps } from './ToolbarButton.types'
|
|
6
|
+
import styles from './ToolbarButton.module.css'
|
|
7
|
+
|
|
8
|
+
describe('Toolbar Button', () => {
|
|
9
|
+
let props: ToolbarButtonProps
|
|
10
|
+
|
|
11
|
+
const renderComponent = () => render(<ToolbarButton {...props} />)
|
|
12
|
+
|
|
13
|
+
it('should have root style', () => {
|
|
14
|
+
const { getByTestId } = renderComponent()
|
|
15
|
+
|
|
16
|
+
const toolbarButton = getByTestId('toolbar-button')
|
|
17
|
+
|
|
18
|
+
expect(toolbarButton).toHaveClass(styles.root)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
export type ToolbarButtonTypes =
|
|
4
|
+
| 'vk'
|
|
5
|
+
| 'fb'
|
|
6
|
+
| 'tw'
|
|
7
|
+
| 'tg'
|
|
8
|
+
| 'ok'
|
|
9
|
+
| 'reaction'
|
|
10
|
+
| 'bookmark'
|
|
11
|
+
| 'cross'
|
|
12
|
+
|
|
13
|
+
export interface ToolbarButtonProps {
|
|
14
|
+
type: ToolbarButtonTypes
|
|
15
|
+
theme?: string
|
|
16
|
+
isActive?: boolean
|
|
17
|
+
onClick: (type: string) => void
|
|
18
|
+
children: React.ReactNode
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ToolbarButtonProps } from './ToolbarButton.types'
|
|
3
|
+
|
|
4
|
+
import { SvgSymbol } from '../SvgSymbol/'
|
|
5
|
+
import makeClassName from '../utils/makeClassName'
|
|
6
|
+
|
|
7
|
+
import styles from './ToolbarButton.module.css'
|
|
8
|
+
|
|
9
|
+
export const ToolbarButton: React.FC<ToolbarButtonProps> = ({
|
|
10
|
+
children,
|
|
11
|
+
type,
|
|
12
|
+
theme,
|
|
13
|
+
isActive,
|
|
14
|
+
onClick
|
|
15
|
+
}) => {
|
|
16
|
+
const classNames: (string[] | string | boolean)[][] = [
|
|
17
|
+
[styles.root, true],
|
|
18
|
+
[styles[type], !!styles[type]],
|
|
19
|
+
[styles[theme], !!styles[theme] && !!theme],
|
|
20
|
+
[styles.isActive, !!isActive]
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<button
|
|
25
|
+
data-testid="toolbar-button"
|
|
26
|
+
className={makeClassName(classNames)}
|
|
27
|
+
type="button"
|
|
28
|
+
onClick={(): void => onClick(type)}
|
|
29
|
+
>
|
|
30
|
+
<SvgSymbol size="medium" icon={type} styleContext="isInToolbar" />
|
|
31
|
+
{children && <span className={styles.text}>{children}</span>}
|
|
32
|
+
</button>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'PF Regal';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
|
|
5
|
+
src: url('https://meduza.io/static/fonts/PFRegal/PFRegalTextPro-RegularB.woff')
|
|
6
|
+
format('woff');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'PF Regal';
|
|
11
|
+
font-style: italic;
|
|
12
|
+
|
|
13
|
+
src: url('https://meduza.io/static/fonts/PFRegal/PFRegalTextPro-RegularBItalic.woff')
|
|
14
|
+
format('woff');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: 'PF Regal';
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
|
|
21
|
+
src: url('https://meduza.io/static/fonts/PFRegal/PFRegalTextPro-Bold.woff')
|
|
22
|
+
format('woff');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: 'PF Regal';
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
font-style: italic;
|
|
29
|
+
|
|
30
|
+
src: url('https://meduza.io/static/fonts/PFRegal/PFRegalTextPro-BoldItalic.woff')
|
|
31
|
+
format('woff');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'Proxima Nova';
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
|
|
39
|
+
src: url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Regular.woff2')
|
|
40
|
+
format('woff2'),
|
|
41
|
+
url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Regular.woff')
|
|
42
|
+
format('woff');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: 'Proxima Nova';
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
font-style: normal;
|
|
49
|
+
|
|
50
|
+
src: url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Semibold.woff2')
|
|
51
|
+
format('woff2'),
|
|
52
|
+
url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Semibold.woff')
|
|
53
|
+
format('woff');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: 'Proxima Nova';
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
font-style: normal;
|
|
60
|
+
|
|
61
|
+
src: url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Bold.woff2')
|
|
62
|
+
format('woff2'),
|
|
63
|
+
url('https://meduza.io/static/fonts/ProximaNovaNew/ProximaNova-Bold.woff')
|
|
64
|
+
format('woff');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.root {
|
|
68
|
+
color: #000;
|
|
69
|
+
background: #fff;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.sideBySide {
|
|
73
|
+
@media (min-width: 1200px) {
|
|
74
|
+
display: grid;
|
|
75
|
+
|
|
76
|
+
grid-template-columns: 1fr 1fr;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.wrapper {
|
|
81
|
+
padding: 40px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.wrapper.light {
|
|
85
|
+
background-color: #fff;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.wrapper.dark {
|
|
89
|
+
color: #fff;
|
|
90
|
+
background-color: #1a1a1a;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.wrapper > h2 {
|
|
94
|
+
margin-top: 0;
|
|
95
|
+
margin-bottom: 30px;
|
|
96
|
+
|
|
97
|
+
color: inherit;
|
|
98
|
+
|
|
99
|
+
font-family: 'Proxima Nova', sans-serif;
|
|
100
|
+
font-size: 32px;
|
|
101
|
+
font-weight: bold;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
h1,
|
|
106
|
+
h2,
|
|
107
|
+
h3,
|
|
108
|
+
h4,
|
|
109
|
+
h5,
|
|
110
|
+
h6 {
|
|
111
|
+
margin: 0;
|
|
112
|
+
padding: 0;
|
|
113
|
+
|
|
114
|
+
font-weight: normal;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
* { box-sizing: border-box; }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import makeClassName from 'utils/makeClassName'
|
|
3
|
+
import styles from './PreviewWrapper.module.css'
|
|
4
|
+
|
|
5
|
+
export interface PreviewWrapperProps {
|
|
6
|
+
theme: 'light' | 'dark'
|
|
7
|
+
children: JSX.Element[] | JSX.Element
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const PreviewWrapper: React.FC<PreviewWrapperProps> = ({
|
|
11
|
+
theme,
|
|
12
|
+
children
|
|
13
|
+
}) => (
|
|
14
|
+
<div
|
|
15
|
+
className={makeClassName([
|
|
16
|
+
[styles.wrapper, true],
|
|
17
|
+
[styles[theme], !!theme]
|
|
18
|
+
])}
|
|
19
|
+
>
|
|
20
|
+
<h2>{theme === 'dark' ? 'Dark theme' : 'Light theme'}</h2>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
)
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const MediaQuerySizes = {
|
|
2
|
+
MOBILE: 512,
|
|
3
|
+
PORTRAIT_TABLET: 768,
|
|
4
|
+
LANDSCAPE_TABLET: 1024,
|
|
5
|
+
DESKTOP: 1010,
|
|
6
|
+
WIDE_DESKTOP: 1200
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const imageBreakpoints = {
|
|
10
|
+
325: '(min-width: 0)',
|
|
11
|
+
520: '(min-width: 325px)',
|
|
12
|
+
600: '(min-width: 600px)',
|
|
13
|
+
650: '(min-width: 650px)',
|
|
14
|
+
980: '(min-width: 1000px)',
|
|
15
|
+
1335: '(min-width: 1000px)'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const imageConditionalKeys = {
|
|
19
|
+
xs: [325],
|
|
20
|
+
superFull: [1335, 650, 520, 325],
|
|
21
|
+
full: [980, 650, 520, 325],
|
|
22
|
+
default: [650, 520, 325],
|
|
23
|
+
narrow: [600, 325]
|
|
24
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
1
|
export * from './Button'
|
|
2
|
+
export * from './SvgSymbol'
|
|
3
|
+
export * from './Switcher'
|
|
4
|
+
export * from './Image'
|
|
5
|
+
export * from './DotsOnImage'
|
|
6
|
+
export * from './Lazy'
|
|
7
|
+
export * from './Tag'
|
|
8
|
+
export * from './Table'
|
|
9
|
+
export * from './MediaCaption'
|
|
10
|
+
export * from './MaterialNote'
|
|
11
|
+
export * from './BookmarkButton'
|
|
12
|
+
export * from './MaterialTitle'
|
|
13
|
+
export * from './Dropdown'
|
|
14
|
+
export * from './Toolbar'
|
|
15
|
+
export * from './Popover'
|
|
16
|
+
export * from './Meta'
|
|
17
|
+
export * from './Timestamp'
|
|
18
|
+
export * from './EmbedBlock'
|
|
19
|
+
export * from './QuoteBlock'
|
|
20
|
+
export * from './CardTitle'
|
|
21
|
+
export * from './ChapterBlock'
|
|
22
|
+
export * from './Cover'
|
|
23
|
+
export * from './RenderBlocks'
|
|
24
|
+
export * from './GroupedBlock'
|
|
25
|
+
export * from './HalfBlock'
|
|
26
|
+
export * from './RawHtmlBlock'
|
|
27
|
+
export * from './ImportantLead'
|
|
28
|
+
export * from './ListBlock'
|
|
29
|
+
export * from './RelatedBlock'
|
|
30
|
+
export * from './RichTitle'
|
|
31
|
+
export * from './SimpleBlock'
|
|
32
|
+
export * from './SimpleTitle'
|
|
33
|
+
export * from './SourceBlock'
|
|
34
|
+
export * from './Spoiler'
|
|
35
|
+
export * from './MetaItem'
|
|
36
|
+
export * from './MetaItemLive'
|
|
37
|
+
export * from './DocumentItemsCount'
|
|
38
|
+
export * from './ToolbarButton'
|
|
39
|
+
// /* PLOP_INJECT_LINK */ //
|