@redneckz/wildless-cms-uni-blocks 0.9.0 → 0.9.2

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.
Files changed (105) hide show
  1. package/bin/migration-scripts/0.8.24.js +6 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +18 -12
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  6. package/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  7. package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  8. package/bundle/components/Footer/FooterContent.d.ts +2 -2
  9. package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  10. package/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  11. package/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
  12. package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  13. package/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  14. package/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
  15. package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  16. package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  17. package/dist/components/Filtration/FiltrationInner.js +1 -1
  18. package/dist/components/Filtration/FiltrationInner.js.map +1 -1
  19. package/dist/components/Footer/FooterContent.d.ts +2 -2
  20. package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  21. package/dist/components/ProductBlock/ProductBlockInner.js +2 -2
  22. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  23. package/dist/ui-kit/Foldable/DefaultFoldButton.js +3 -5
  24. package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  25. package/lib/common.css +1 -1
  26. package/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  27. package/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
  28. package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  29. package/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  30. package/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
  31. package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  32. package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  33. package/lib/components/Filtration/FiltrationInner.js +1 -1
  34. package/lib/components/Filtration/FiltrationInner.js.map +1 -1
  35. package/lib/components/Footer/FooterContent.d.ts +2 -2
  36. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
  37. package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  38. package/lib/components/ProductBlock/ProductBlockInner.js +2 -2
  39. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  40. package/lib/ui-kit/Foldable/DefaultFoldButton.js +3 -5
  41. package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  42. package/mobile/bundle/bundle.umd.js +4 -6
  43. package/mobile/bundle/bundle.umd.min.js +1 -1
  44. package/mobile/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  45. package/mobile/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  46. package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  47. package/mobile/bundle/components/Footer/FooterContent.d.ts +2 -2
  48. package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  49. package/mobile/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  50. package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
  51. package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  52. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  53. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
  54. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  55. package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  56. package/mobile/dist/components/Filtration/FiltrationInner.js +1 -1
  57. package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
  58. package/mobile/dist/components/Footer/FooterContent.d.ts +2 -2
  59. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  60. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +3 -5
  61. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  62. package/mobile/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
  63. package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
  64. package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
  65. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
  66. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
  67. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  68. package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
  69. package/mobile/lib/components/Filtration/FiltrationInner.js +1 -1
  70. package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
  71. package/mobile/lib/components/Footer/FooterContent.d.ts +2 -2
  72. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -0
  73. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +3 -5
  74. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  75. package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
  76. package/mobile/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
  77. package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
  78. package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
  79. package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
  80. package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
  81. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
  82. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
  83. package/mobile/src/components/Filtration/FiltrationInner.tsx +2 -2
  84. package/mobile/src/components/Footer/Footer.ui.json +1 -11
  85. package/mobile/src/components/Footer/FooterContent.ts +2 -3
  86. package/mobile/src/components/ProductBlock/ProductBlock.example.json +2 -1
  87. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -0
  88. package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +3 -9
  89. package/package.json +1 -1
  90. package/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
  91. package/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
  92. package/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
  93. package/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
  94. package/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
  95. package/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
  96. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
  97. package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
  98. package/src/components/Filtration/FiltrationInner.tsx +2 -2
  99. package/src/components/Footer/Footer.ui.json +1 -11
  100. package/src/components/Footer/FooterContent.ts +2 -3
  101. package/src/components/ProductBlock/ProductBlock.example.json +2 -1
  102. package/src/components/ProductBlock/ProductBlock.fixture.tsx +17 -0
  103. package/src/components/ProductBlock/ProductBlockContent.ts +2 -0
  104. package/src/components/ProductBlock/ProductBlockInner.tsx +4 -1
  105. package/src/ui-kit/Foldable/DefaultFoldButton.tsx +3 -9
@@ -2088,7 +2088,12 @@
2088
2088
  iconVersion: icon?.iconVersion ?? (version === 'secondary' ? 'white' : 'color'),
2089
2089
  });
2090
2090
 
2091
- const CarouselEventCard = JSX(({ className = '', icon, title, description, href, target, ...rest }) => (jsx(BlockWrapper, { className: style('flex flex-col w-[365px]', className), ...rest, children: jsxs("a", { href: href, target: target, role: "link", children: [icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-2", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Text, { font: "font-light", size: "text-s", color: "text-secondary-text", children: description }) })) : null] }) })));
2091
+ const CarouselEventCard = JSX(({ className = '', icon, title, description, href, target, ...rest }) => {
2092
+ const link = useLink();
2093
+ const adjustedProps = link({ href, target });
2094
+ const tagName = href ? 'a' : 'section';
2095
+ return (jsxs(BlockWrapper, { className: style('flex flex-col w-[365px]', className), extraProps: adjustedProps, tag: tagName, ...rest, children: [icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-2", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Text, { font: "font-light", size: "text-s", color: "text-secondary-text", children: description }) })) : null] }));
2096
+ });
2092
2097
 
2093
2098
  const BaseTile = JSX(({ className = '', title = '', buttons, image, children }) => (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className: "flex grow w-full justify-between", children: [jsxs("div", { className: "flex flex-col justify-between w-full", children: [jsx("div", { className: "h-full", children: children }), buttons ? jsx("div", { className: "mt-auto pt-8", children: buttons }) : null] }), image] })] })));
2094
2099
 
@@ -2152,8 +2157,11 @@
2152
2157
  };
2153
2158
  const List = JSX(({ className = '', hasIndent, isDotted, itemClassName = '', items, listItemSize = 'M' }) => items?.length ? (jsx("section", { className: `text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text ${TEXT_SIZE_MAP[listItemSize]} ${hasIndent ? ITEM_INDENT_MAP[listItemSize] : ''} ${className}`, role: "list", children: items.map((item, i) => (jsx(ListItem, { className: itemClassName, isDotted: isDotted, size: listItemSize, children: item }, String(i)))) })) : null);
2154
2159
 
2155
- const CarouselProductCard = JSX(({ className = '', title, headlineSmallVersion = 'H6', description, additionalDescription, icon, items = [], button = {}, version = 'primary', isDotted = true, align = 'text-center', ...rest }) => {
2156
- return (jsxs(BlockWrapper, { className: style('flex flex-col justify-between items-stretch min-w-[260px] h-full w-full p-6', 'box-border border-solid border border-gray', align, className), version: version, ...rest, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$3(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), renderItems(items, isDotted, version), renderAdditionalDescription$1(additionalDescription)] }), renderButtonsSection([button], { buttonClassName: 'mt-6 w-full' })] }));
2160
+ const CarouselProductCard = JSX(({ additionalDescription, align = 'text-center', button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, items = [], target, title, version = 'primary', ...rest }) => {
2161
+ const link = useLink();
2162
+ const adjustedProps = link({ href, target });
2163
+ const tagName = href ? 'a' : 'section';
2164
+ return (jsxs(BlockWrapper, { className: style('flex flex-col justify-between items-stretch min-w-[260px] h-full w-full p-6', 'box-border border-solid border border-gray', align, className), extraProps: adjustedProps, tag: tagName, version: version, ...rest, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$3(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), renderItems(items, isDotted, version), renderAdditionalDescription$1(additionalDescription)] }), renderButtonsSection([button], { buttonClassName: 'mt-6 w-full' })] }));
2157
2165
  });
2158
2166
  const renderImage$3 = (image) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`, image: image, asSVG: true })) : null] }));
2159
2167
  const renderCardTitle = (headlineSmallVersion, title) => title ? jsx(Text, { size: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
@@ -2542,11 +2550,9 @@
2542
2550
  };
2543
2551
 
2544
2552
  const DefaultFoldButton = JSX(({ className = '', label, icon, dataTheme = '', disabled = false, onClick }) => {
2545
- const STATE_STYLE = 'hover:bg-primary-hover focus:border-primary-text active:bg-primary-active outline-none';
2546
- const DIMENSIONS_STYLE = 'flex justify-center w-full px-0 py-5';
2547
- return (jsxs("button", { className: style('border border-transparent bg-primary-main font-sans text-white cursor-pointer', STATE_STYLE, DIMENSIONS_STYLE, disabled
2548
- ? 'bg-main-divider text-main-disabled cursor-not-allowed hover:bg-main-divider active:bg-main-divider'
2549
- : '', className), onClick: onClick, disabled: disabled, "data-theme": dataTheme, children: [jsx("span", { className: "text-h4 pr-3", children: label }), icon ? (jsx(ImgInner, { image: {
2553
+ return (jsxs("button", { className: style('flex justify-center w-full px-0 py-5 border border-transparent outline-none focus:border-primary-text', disabled
2554
+ ? 'bg-main-divider text-main-disabled hover:bg-main-divider'
2555
+ : 'bg-primary-main text-white hover:bg-primary-hove', className), onClick: onClick, disabled: disabled, "data-theme": dataTheme, children: [jsx("span", { className: "text-h4 pr-3", children: label }), icon ? (jsx(ImgInner, { image: {
2550
2556
  icon,
2551
2557
  iconVersion: 'white',
2552
2558
  }, className: "flex-shrink-0 my-auto", width: "20", height: "20", asSVG: true })) : null] }));
@@ -2574,7 +2580,7 @@
2574
2580
  : [blocksToRender, []];
2575
2581
  return (jsxs("div", { children: [jsx("div", { className: style(blocksToRender.length ? 'hidden' : ''), children: jsx(ErrorBlock, { error: { errorContentType: 'Image' }, title: "\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0435\u0439 \u0438\u043F\u043E\u0442\u0435\u0447\u043D\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B", subtitle: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }), jsxs("div", { className: style(blocksToRender.length ? '' : 'hidden'), children: [jsx("div", { className: resultsGridStyle, children: renderBlocksList(visibleBlocks, { ...rest.options, parent: block }) }), jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => {
2576
2582
  return (jsx(FoldableSection, { className: resultsGridStyle, isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
2577
- }, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: "mt-11", disabled: topItemsCount > hiddenBlocks.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
2583
+ }, renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { className: style('mt-11', topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
2578
2584
  });
2579
2585
 
2580
2586
  const SlideCheckboxGroup = JSX(({ value, onChange, items = [], multiple }) => {
@@ -3869,10 +3875,10 @@
3869
3875
 
3870
3876
  const renderBenefit$1 = (version = 'primary', benefitsVersion = 'normal') => ({ icon, label, description }, i) => (jsx(BenefitItem, { icon: icon, label: label, description: description, version: version, benefitsVersion: benefitsVersion }, String(i)));
3871
3877
 
3872
- const ProductBlockInner = JSX(({ className = '', title, headlineVersion = 'L', description, benefitsCountOfRow = 3, benefits, benefitsVersion, buttons, footnote, image, __html, items, version = 'primary', isDotted = true, textBlockClassName = '', }) => {
3878
+ const ProductBlockInner = JSX(({ className = '', title, headlineVersion = 'L', description, benefitsCountOfRow = 3, benefits, benefitsVersion, buttons, footnote, image, __html, items, version = 'primary', isDotted = true, textBlockClassName = '', directionRight = true, }) => {
3873
3879
  const benefitsCount = benefits?.filter((_) => _.label)?.length;
3874
3880
  const benefitsContainerStyles = getBenefitsContainerStyles(benefitsCountOfRow);
3875
- return (jsxs("div", { className: style('flex grow justify-between items-stretch h-full', className), children: [jsxs("div", { className: style('flex flex-col', textBlockClassName), children: [jsx(Headline, { className: "!p-0 max-w-[600px]", title: title, description: description, headlineVersion: headlineVersion, align: "text-left" }), jsxs("div", { className: "flex flex-col justify-between h-full", children: [jsxs(BaseTile, { buttons: renderButtonsSection(buttons), children: [benefitsCount ? (jsx("div", { className: benefitsContainerStyles, children: benefits?.map(renderBenefit$1(version, benefitsVersion)) })) : null, __html ? (jsx("div", { className: "mt-5", children: jsx(RichText, { __html: __html }) })) : null, items?.length ? (jsx(List, { className: "mt-5 text-h6", items: items, itemClassName: "mb-[7px]", isDotted: isDotted })) : null] }), footnote ? jsx("p", { className: "text-m-light pt-12", children: footnote }) : null] })] }), image?.src && jsx(ImgInner, { className: "mt-[-50px]", image: image })] }));
3881
+ return (jsxs("div", { className: style('flex grow justify-between items-stretch h-full', className), children: [image?.src ? (jsx(ImgInner, { className: `mt-[-50px] ${directionRight ? 'order-2' : ''}`, image: image })) : null, jsxs("div", { className: style('flex flex-col', textBlockClassName), children: [jsx(Headline, { className: "!p-0 max-w-[600px]", title: title, description: description, headlineVersion: headlineVersion, align: "text-left" }), jsxs("div", { className: "flex flex-col justify-between h-full", children: [jsxs(BaseTile, { buttons: renderButtonsSection(buttons), children: [benefitsCount ? (jsx("div", { className: benefitsContainerStyles, children: benefits?.map(renderBenefit$1(version, benefitsVersion)) })) : null, __html ? (jsx("div", { className: "mt-5", children: jsx(RichText, { __html: __html }) })) : null, items?.length ? (jsx(List, { className: "mt-5 text-h6", items: items, itemClassName: "mb-[7px]", isDotted: isDotted })) : null] }), footnote ? jsx("p", { className: "text-m-light pt-12", children: footnote }) : null] })] })] }));
3876
3882
  });
3877
3883
  const getBenefitsContainerStyles = (benefitsCountOfRow = 2) => `gap-6 mt-6 ${benefitsCountOfRow > 2
3878
3884
  ? 'inline-grid grid-cols-[auto_auto_auto]'
@@ -4814,7 +4820,7 @@
4814
4820
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4815
4821
  }
4816
4822
 
4817
- const packageVersion = "0.9.0";
4823
+ const packageVersion = "0.9.2";
4818
4824
 
4819
4825
  exports.Blocks = Blocks;
4820
4826
  exports.ContentPage = ContentPage;