@meduza/ui-kit-2 0.1.26 → 0.1.28
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/dist/RichTitle/RichTitle.types.d.ts +2 -0
- package/dist/ui-kit-2.cjs.development.js +20 -11
- 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 +20 -11
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1653 -1573
- package/package.json +1 -1
- package/src/Meta/Meta.module.css +3 -2
- package/src/Meta/MetaContainer.tsx +8 -1
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +118 -34
- package/src/RelatedRichBlock/RelatedRichBlock.stories.tsx +0 -1
- package/src/RelatedRichBlock/index.tsx +18 -12
- package/src/RelatedRichBlock/mock.json +14 -5
- package/src/RichTitle/RichTitle.module.css +3 -5
- package/src/RichTitle/RichTitle.types.ts +1 -0
- package/src/RichTitle/index.tsx +3 -3
- package/src/Tag/Tag.module.css +10 -0
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +12 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface RichTitleProps {
|
|
2
3
|
block: {
|
|
3
4
|
only_on?: string;
|
|
@@ -5,6 +6,7 @@ export interface RichTitleProps {
|
|
|
5
6
|
featured?: boolean;
|
|
6
7
|
first: string;
|
|
7
8
|
second?: string;
|
|
9
|
+
as?: keyof JSX.IntrinsicElements;
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
styleContext?: string[] | string;
|
|
@@ -797,7 +797,7 @@ var makeStyleContext = function makeStyleContext(classNames, styleContext, style
|
|
|
797
797
|
return classNames.concat(context);
|
|
798
798
|
};
|
|
799
799
|
|
|
800
|
-
var styles$8 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
|
|
800
|
+
var styles$8 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","richRelated":"Tag-module_richRelated__2vbQQ","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
|
|
801
801
|
|
|
802
802
|
var Tag = function Tag(_ref) {
|
|
803
803
|
var children = _ref.children,
|
|
@@ -1030,7 +1030,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
1030
1030
|
}, renderItems()));
|
|
1031
1031
|
};
|
|
1032
1032
|
|
|
1033
|
-
var styles$g = {"root":"Meta-module_root__12AG7","rich":"Meta-module_rich__1XBtZ","podcast":"Meta-module_podcast__1m4zo","episode":"Meta-module_episode__1K2Xv","simple":"Meta-module_simple__3vUiI","slide":"Meta-module_slide__3g6fG","card":"Meta-module_card__LE1RK","game":"Meta-module_game__3aNlZ","isInMaterial":"Meta-module_isInMaterial__zaYMy","isInSearchItem":"Meta-module_isInSearchItem__1wbpx","center":"Meta-module_center__3BBPr","half":"Meta-module_half__1xRkT","light":"Meta-module_light__2baE-","dark":"Meta-module_dark__24y9m","hasSource":"Meta-module_hasSource__2lXiN","bookmark":"Meta-module_bookmark__3ot3k","mobile":"Meta-module_mobile__22LGV","desktop":"Meta-module_desktop__1ZGUS"};
|
|
1033
|
+
var styles$g = {"root":"Meta-module_root__12AG7","rich":"Meta-module_rich__1XBtZ","podcast":"Meta-module_podcast__1m4zo","episode":"Meta-module_episode__1K2Xv","simple":"Meta-module_simple__3vUiI","slide":"Meta-module_slide__3g6fG","card":"Meta-module_card__LE1RK","game":"Meta-module_game__3aNlZ","isInMaterial":"Meta-module_isInMaterial__zaYMy","isInSearchItem":"Meta-module_isInSearchItem__1wbpx","center":"Meta-module_center__3BBPr","isInMediaBlock":"Meta-module_isInMediaBlock__3xfPF","half":"Meta-module_half__1xRkT","light":"Meta-module_light__2baE-","dark":"Meta-module_dark__24y9m","hasSource":"Meta-module_hasSource__2lXiN","bookmark":"Meta-module_bookmark__3ot3k","mobile":"Meta-module_mobile__22LGV","desktop":"Meta-module_desktop__1ZGUS"};
|
|
1034
1034
|
|
|
1035
1035
|
var Meta = function Meta(_ref) {
|
|
1036
1036
|
var hasSource = _ref.hasSource,
|
|
@@ -1510,6 +1510,8 @@ var RichTitle = function RichTitle(_ref) {
|
|
|
1510
1510
|
featured = _ref$block$data.featured,
|
|
1511
1511
|
first = _ref$block$data.first,
|
|
1512
1512
|
second = _ref$block$data.second,
|
|
1513
|
+
_ref$block$data$as = _ref$block$data.as,
|
|
1514
|
+
TagName = _ref$block$data$as === void 0 ? 'h1' : _ref$block$data$as,
|
|
1513
1515
|
styleContext = _ref.styleContext;
|
|
1514
1516
|
var classNames = [[styles$n.root, true], [styles$n[onlyOn], true], [styles$n.featured, !!featured]];
|
|
1515
1517
|
|
|
@@ -1517,7 +1519,7 @@ var RichTitle = function RichTitle(_ref) {
|
|
|
1517
1519
|
classNames = makeStyleContext(classNames, styleContext, styles$n);
|
|
1518
1520
|
}
|
|
1519
1521
|
|
|
1520
|
-
return React__default.createElement(
|
|
1522
|
+
return React__default.createElement(TagName, {
|
|
1521
1523
|
"data-testid": "rich-title",
|
|
1522
1524
|
className: makeClassName(classNames)
|
|
1523
1525
|
}, first, second && React__default.createElement("span", null, " ", second));
|
|
@@ -1677,7 +1679,7 @@ var SourceBlock = function SourceBlock(_ref) {
|
|
|
1677
1679
|
}, origin))));
|
|
1678
1680
|
};
|
|
1679
1681
|
|
|
1680
|
-
var styles$s = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","isRich":"RelatedRichBlock-module_isRich__1LnA4","
|
|
1682
|
+
var styles$s = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","body":"RelatedRichBlock-module_body__1ZHZS","isRich":"RelatedRichBlock-module_isRich__1LnA4","hasGradient":"RelatedRichBlock-module_hasGradient__27LOk","picture":"RelatedRichBlock-module_picture__128HJ","isCard":"RelatedRichBlock-module_isCard__2naDz","cover":"RelatedRichBlock-module_cover__3yygp","tag":"RelatedRichBlock-module_tag__3OLyG","center":"RelatedRichBlock-module_center__197sx","dark":"RelatedRichBlock-module_dark__3Y1fE","light":"RelatedRichBlock-module_light__2mUxL","mobile":"RelatedRichBlock-module_mobile__JpCS4","desktop":"RelatedRichBlock-module_desktop__trL0D"};
|
|
1681
1683
|
|
|
1682
1684
|
/* eslint-disable react/jsx-no-target-blank */
|
|
1683
1685
|
var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
@@ -1703,7 +1705,8 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1703
1705
|
|
|
1704
1706
|
var cardType = "is" + toCapitalize(layout);
|
|
1705
1707
|
React.useEffect(function () {
|
|
1706
|
-
setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
1708
|
+
// setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
1709
|
+
setType('richRelated');
|
|
1707
1710
|
}, []);
|
|
1708
1711
|
|
|
1709
1712
|
var _useInView = reactIntersectionObserver.useInView({
|
|
@@ -1734,10 +1737,13 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1734
1737
|
}
|
|
1735
1738
|
|
|
1736
1739
|
if (gradients) {
|
|
1740
|
+
styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
|
|
1737
1741
|
var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
|
|
1738
1742
|
classNames = makeStyleContext(classNames, theme, styles$s);
|
|
1739
|
-
|
|
1740
|
-
|
|
1743
|
+
|
|
1744
|
+
if (onlyOn === 'desktop') {
|
|
1745
|
+
style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
|
|
1746
|
+
}
|
|
1741
1747
|
}
|
|
1742
1748
|
|
|
1743
1749
|
if (type === 'unset') {
|
|
@@ -1759,7 +1765,7 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1759
1765
|
return React__default.createElement("a", {
|
|
1760
1766
|
"data-testid": "related-rich-block",
|
|
1761
1767
|
className: makeClassName(classNames),
|
|
1762
|
-
href: url,
|
|
1768
|
+
href: "/" + url,
|
|
1763
1769
|
target: "_blank",
|
|
1764
1770
|
onClick: function onClick() {
|
|
1765
1771
|
return handleClick();
|
|
@@ -1776,14 +1782,16 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1776
1782
|
}, React__default.createElement(Tag, {
|
|
1777
1783
|
size: "small",
|
|
1778
1784
|
theme: "inherit",
|
|
1779
|
-
styleContext: "
|
|
1785
|
+
styleContext: "richRelated"
|
|
1780
1786
|
}, tag)), React__default.createElement("div", {
|
|
1781
1787
|
className: styles$s.cover
|
|
1788
|
+
}, React__default.createElement("div", {
|
|
1789
|
+
className: styles$s.picture
|
|
1782
1790
|
}, React__default.createElement(Image, {
|
|
1783
1791
|
optimized: urls,
|
|
1784
1792
|
ratio: ratio,
|
|
1785
1793
|
display: "narrow"
|
|
1786
|
-
})), React__default.createElement("div", {
|
|
1794
|
+
}))), React__default.createElement("div", {
|
|
1787
1795
|
className: styles$s.body
|
|
1788
1796
|
}, blocks.map(function (item) {
|
|
1789
1797
|
return React__default.createElement(RenderBlocks, {
|
|
@@ -1985,6 +1993,7 @@ var MetaContainer = function MetaContainer(_ref) {
|
|
|
1985
1993
|
|
|
1986
1994
|
case 'datetime':
|
|
1987
1995
|
{
|
|
1996
|
+
var format = toCamel(component.format) || 'date';
|
|
1988
1997
|
return React__default.createElement(MetaItem, {
|
|
1989
1998
|
hasSource: hasSource,
|
|
1990
1999
|
bullets: true,
|
|
@@ -1992,7 +2001,7 @@ var MetaContainer = function MetaContainer(_ref) {
|
|
|
1992
2001
|
type: "datetime"
|
|
1993
2002
|
}, React__default.createElement(Timestamp, {
|
|
1994
2003
|
publishedAt: component.datetime,
|
|
1995
|
-
type:
|
|
2004
|
+
type: format || 'date',
|
|
1996
2005
|
locale: lang
|
|
1997
2006
|
}));
|
|
1998
2007
|
}
|