@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.
- package/bin/migration-scripts/0.8.24.js +6 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +18 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/dist/components/Filtration/FiltrationInner.js +1 -1
- package/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/dist/components/Footer/FooterContent.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/dist/components/ProductBlock/ProductBlockInner.js +2 -2
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/ui-kit/Foldable/DefaultFoldButton.js +3 -5
- package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/lib/components/Filtration/FiltrationInner.js +1 -1
- package/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/lib/components/Footer/FooterContent.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/lib/components/ProductBlock/ProductBlockInner.js +2 -2
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/ui-kit/Foldable/DefaultFoldButton.js +3 -5
- package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +4 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/dist/components/Filtration/FiltrationInner.js +1 -1
- package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/dist/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +3 -5
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/lib/components/Filtration/FiltrationInner.js +1 -1
- package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
- package/mobile/lib/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -0
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +3 -5
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/mobile/src/components/Filtration/FiltrationInner.tsx +2 -2
- package/mobile/src/components/Footer/Footer.ui.json +1 -11
- package/mobile/src/components/Footer/FooterContent.ts +2 -3
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +2 -1
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -0
- package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +3 -9
- package/package.json +1 -1
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/src/components/Filtration/FiltrationInner.tsx +2 -2
- package/src/components/Footer/Footer.ui.json +1 -11
- package/src/components/Footer/FooterContent.ts +2 -3
- package/src/components/ProductBlock/ProductBlock.example.json +2 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +17 -0
- package/src/components/ProductBlock/ProductBlockContent.ts +2 -0
- package/src/components/ProductBlock/ProductBlockInner.tsx +4 -1
- package/src/ui-kit/Foldable/DefaultFoldButton.tsx +3 -9
|
@@ -16,19 +16,13 @@ interface DefaultFoldButtonProps {
|
|
|
16
16
|
|
|
17
17
|
export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
|
|
18
18
|
({ className = '', label, icon, dataTheme = '', disabled = false, onClick }) => {
|
|
19
|
-
const STATE_STYLE =
|
|
20
|
-
'hover:bg-primary-hover focus:border-primary-text active:bg-primary-active outline-none';
|
|
21
|
-
const DIMENSIONS_STYLE = 'flex justify-center w-full px-0 py-5';
|
|
22
|
-
|
|
23
19
|
return (
|
|
24
20
|
<button
|
|
25
21
|
className={style(
|
|
26
|
-
'
|
|
27
|
-
STATE_STYLE,
|
|
28
|
-
DIMENSIONS_STYLE,
|
|
22
|
+
'flex justify-center w-full px-0 py-5 border border-transparent outline-none focus:border-primary-text',
|
|
29
23
|
disabled
|
|
30
|
-
? 'bg-main-divider text-main-disabled
|
|
31
|
-
: '',
|
|
24
|
+
? 'bg-main-divider text-main-disabled hover:bg-main-divider'
|
|
25
|
+
: 'bg-primary-main text-white hover:bg-primary-hove',
|
|
32
26
|
className,
|
|
33
27
|
)}
|
|
34
28
|
onClick={onClick}
|
package/package.json
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
3
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
6
|
-
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
7
6
|
import { style } from '../../utils/style';
|
|
8
|
-
import
|
|
7
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
8
|
+
import { useLink } from '../../hooks/useLink';
|
|
9
9
|
import type { CarouselEventCardContent } from './CarouselEventCardContent';
|
|
10
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
10
11
|
|
|
11
12
|
export interface CarouselEventCardProps extends CarouselEventCardContent, UniBlockProps {}
|
|
12
13
|
|
|
13
14
|
export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
14
|
-
({ className = '', icon, title, description, href, target, ...rest }) =>
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
({ className = '', icon, title, description, href, target, ...rest }) => {
|
|
16
|
+
const link = useLink();
|
|
17
|
+
const adjustedProps = link({ href, target });
|
|
18
|
+
const tagName = href ? 'a' : 'section';
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<BlockWrapper
|
|
22
|
+
className={style('flex flex-col w-[365px]', className)}
|
|
23
|
+
extraProps={adjustedProps}
|
|
24
|
+
tag={tagName}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
17
27
|
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
18
28
|
{icon?.src ? <Img image={icon} /> : null}
|
|
19
29
|
{title ? (
|
|
@@ -26,7 +36,7 @@ export const CarouselEventCard = JSX<CarouselEventCardProps>(
|
|
|
26
36
|
</Text>
|
|
27
37
|
</div>
|
|
28
38
|
) : null}
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
</BlockWrapper>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
32
42
|
);
|
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import type { Picture } from '../../model/Picture';
|
|
5
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
3
|
+
import { HEADLINE_SMALL_VERSION } from '../Headline/headlineVersionStyles';
|
|
7
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
5
|
import { List } from '../../ui-kit/List/List';
|
|
9
6
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
10
|
-
import {
|
|
7
|
+
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
11
8
|
import { style } from '../../utils/style';
|
|
12
|
-
import {
|
|
9
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
10
|
+
import { useLink } from '../../hooks/useLink';
|
|
11
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
13
12
|
import type { CarouselProductCardContent, ListProps } from './CarouselProductCardContent';
|
|
13
|
+
import type { Picture } from '../../model/Picture';
|
|
14
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
14
15
|
|
|
15
16
|
export interface CarouselProductCardProps extends CarouselProductCardContent, UniBlockProps {}
|
|
16
17
|
|
|
17
18
|
export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
18
19
|
({
|
|
20
|
+
additionalDescription,
|
|
21
|
+
align = 'text-center',
|
|
22
|
+
button = {},
|
|
19
23
|
className = '',
|
|
20
|
-
title,
|
|
21
|
-
headlineSmallVersion = 'H6',
|
|
22
24
|
description,
|
|
23
|
-
|
|
25
|
+
headlineSmallVersion = 'H6',
|
|
26
|
+
href,
|
|
24
27
|
icon,
|
|
28
|
+
isDotted = true,
|
|
25
29
|
items = [],
|
|
26
|
-
|
|
30
|
+
target,
|
|
31
|
+
title,
|
|
27
32
|
version = 'primary',
|
|
28
|
-
isDotted = true,
|
|
29
|
-
align = 'text-center',
|
|
30
33
|
...rest
|
|
31
34
|
}) => {
|
|
35
|
+
const link = useLink();
|
|
36
|
+
const adjustedProps = link({ href, target });
|
|
37
|
+
const tagName = href ? 'a' : 'section';
|
|
38
|
+
|
|
32
39
|
return (
|
|
33
40
|
<BlockWrapper
|
|
34
41
|
className={style(
|
|
@@ -37,6 +44,8 @@ export const CarouselProductCard = JSX<CarouselProductCardProps>(
|
|
|
37
44
|
align,
|
|
38
45
|
className,
|
|
39
46
|
)}
|
|
47
|
+
extraProps={adjustedProps}
|
|
48
|
+
tag={tagName}
|
|
40
49
|
version={version}
|
|
41
50
|
{...rest}
|
|
42
51
|
>
|
|
@@ -3,6 +3,7 @@ import type { ButtonCommonIconProps } from '../../model/Button';
|
|
|
3
3
|
import type { AdditionalDescriptionProps, HeadlineSmallProps } from '../../model/HeadlineType';
|
|
4
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
5
5
|
import type { IconProps } from '../../model/Picture';
|
|
6
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
6
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -21,7 +22,8 @@ export type CarouselProductCardContent = UniBlockContent &
|
|
|
21
22
|
AdditionalDescriptionProps &
|
|
22
23
|
IconProps &
|
|
23
24
|
ButtonCommonIconProps &
|
|
24
|
-
BulletsProps &
|
|
25
|
+
BulletsProps &
|
|
26
|
+
LinkCommonProps & {
|
|
25
27
|
/** @title Список */
|
|
26
28
|
items?: ListProps[];
|
|
27
29
|
align?: TextAlign;
|
|
@@ -51,8 +51,8 @@ export const FiltrationInner = JSX<FiltrationInnerProps>(
|
|
|
51
51
|
}}
|
|
52
52
|
renderFoldButton={({ isUnfolded, onToggle }) => (
|
|
53
53
|
<DefaultFoldButton
|
|
54
|
-
className=
|
|
55
|
-
disabled={
|
|
54
|
+
className={style('mt-11', topItemsCount < 1 ? 'hidden' : '')}
|
|
55
|
+
disabled={!hiddenBlocks?.length}
|
|
56
56
|
label={label}
|
|
57
57
|
icon={ICONS[Number(isUnfolded)]}
|
|
58
58
|
dataTheme={rest.options?.page?.colorPalette}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
|
+
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @title Тип контакта
|
|
@@ -27,7 +28,5 @@ export type SubMenuItem = LinkProps & IconProps;
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* @title Подвал
|
|
30
|
-
* @hidden
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
export type FooterContent = {};
|
|
32
|
+
export type FooterContent = UniBlockContent & {};
|
|
@@ -93,6 +93,23 @@ export default {
|
|
|
93
93
|
/>
|
|
94
94
|
</div>
|
|
95
95
|
),
|
|
96
|
+
'primary with back button direction left': (
|
|
97
|
+
<div className="container grid grid-cols-12">
|
|
98
|
+
<ProductBlock
|
|
99
|
+
className="col-span-12"
|
|
100
|
+
backwardButton={backwardButton}
|
|
101
|
+
headlineVersion="L"
|
|
102
|
+
title="Потребительский кредит наличными"
|
|
103
|
+
description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
|
|
104
|
+
benefitsCountOfRow={2}
|
|
105
|
+
benefits={benefits}
|
|
106
|
+
benefitsVersion="normal"
|
|
107
|
+
buttons={buttons}
|
|
108
|
+
image={image}
|
|
109
|
+
directionRight={false}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
),
|
|
96
113
|
'primary with color benefits': (
|
|
97
114
|
<div className="container grid grid-cols-12">
|
|
98
115
|
<ProductBlock
|
|
@@ -29,12 +29,16 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
29
29
|
version = 'primary',
|
|
30
30
|
isDotted = true,
|
|
31
31
|
textBlockClassName = '',
|
|
32
|
+
directionRight = true,
|
|
32
33
|
}) => {
|
|
33
34
|
const benefitsCount = benefits?.filter((_) => _.label)?.length;
|
|
34
35
|
const benefitsContainerStyles = getBenefitsContainerStyles(benefitsCountOfRow);
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
38
|
<div className={style('flex grow justify-between items-stretch h-full', className)}>
|
|
39
|
+
{image?.src ? (
|
|
40
|
+
<Img className={`mt-[-50px] ${directionRight ? 'order-2' : ''}`} image={image} />
|
|
41
|
+
) : null}
|
|
38
42
|
<div className={style('flex flex-col', textBlockClassName)}>
|
|
39
43
|
<Headline
|
|
40
44
|
className="!p-0 max-w-[600px]"
|
|
@@ -67,7 +71,6 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
67
71
|
{footnote ? <p className="text-m-light pt-12">{footnote}</p> : null}
|
|
68
72
|
</div>
|
|
69
73
|
</div>
|
|
70
|
-
{image?.src && <Img className="mt-[-50px]" image={image} />}
|
|
71
74
|
</div>
|
|
72
75
|
);
|
|
73
76
|
},
|
|
@@ -16,19 +16,13 @@ interface DefaultFoldButtonProps {
|
|
|
16
16
|
|
|
17
17
|
export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
|
|
18
18
|
({ className = '', label, icon, dataTheme = '', disabled = false, onClick }) => {
|
|
19
|
-
const STATE_STYLE =
|
|
20
|
-
'hover:bg-primary-hover focus:border-primary-text active:bg-primary-active outline-none';
|
|
21
|
-
const DIMENSIONS_STYLE = 'flex justify-center w-full px-0 py-5';
|
|
22
|
-
|
|
23
19
|
return (
|
|
24
20
|
<button
|
|
25
21
|
className={style(
|
|
26
|
-
'
|
|
27
|
-
STATE_STYLE,
|
|
28
|
-
DIMENSIONS_STYLE,
|
|
22
|
+
'flex justify-center w-full px-0 py-5 border border-transparent outline-none focus:border-primary-text',
|
|
29
23
|
disabled
|
|
30
|
-
? 'bg-main-divider text-main-disabled
|
|
31
|
-
: '',
|
|
24
|
+
? 'bg-main-divider text-main-disabled hover:bg-main-divider'
|
|
25
|
+
: 'bg-primary-main text-white hover:bg-primary-hove',
|
|
32
26
|
className,
|
|
33
27
|
)}
|
|
34
28
|
onClick={onClick}
|