@redneckz/wildless-cms-uni-blocks 0.13.4 → 0.13.5
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.13.4.js +30 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +110 -85
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +6 -0
- package/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/bundle/ui-kit/Input/InputProps.d.ts +1 -0
- package/bundle/ui-kit/List/ListContent.d.ts +2 -2
- package/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/dist/components/ApplicationForm/renderRegion.js.map +1 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +2 -2
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +6 -0
- package/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/dist/components/Carousel/renderCarouselCards.js +12 -3
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
- package/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
- package/dist/components/Headline/headlineVersionStyles.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +2 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +1 -0
- package/dist/ui-kit/List/List.js +2 -0
- package/dist/ui-kit/List/List.js.map +1 -1
- package/dist/ui-kit/List/ListContent.d.ts +2 -2
- package/dist/ui-kit/List/ListItem.js +1 -0
- package/dist/ui-kit/List/ListItem.js.map +1 -1
- package/dist/ui-kit/Select/Select.d.ts +1 -0
- package/dist/ui-kit/Select/Select.js +18 -4
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/lib/components/ApplicationForm/renderRegion.js.map +1 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +2 -2
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +6 -0
- package/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/lib/components/Carousel/renderCarouselCards.js +12 -3
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
- package/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
- package/lib/components/Headline/headlineVersionStyles.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +2 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +1 -0
- package/lib/ui-kit/List/List.js +2 -0
- package/lib/ui-kit/List/List.js.map +1 -1
- package/lib/ui-kit/List/ListContent.d.ts +2 -2
- package/lib/ui-kit/List/ListItem.js +1 -0
- package/lib/ui-kit/List/ListItem.js.map +1 -1
- package/lib/ui-kit/Select/Select.d.ts +1 -0
- package/lib/ui-kit/Select/Select.js +19 -5
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +111 -22
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegion.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +2 -2
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js +12 -3
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
- package/mobile/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/Footer/buttonSizeStyles.js +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +2 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/dist/ui-kit/List/List.js +2 -0
- package/mobile/dist/ui-kit/List/List.js.map +1 -1
- package/mobile/dist/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/dist/ui-kit/List/ListItem.js +1 -0
- package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +18 -4
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegion.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +2 -2
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js +12 -3
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
- package/mobile/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/Footer/buttonSizeStyles.js +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +2 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/lib/ui-kit/List/List.js +2 -0
- package/mobile/lib/ui-kit/List/List.js.map +1 -1
- package/mobile/lib/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/lib/ui-kit/List/ListItem.js +1 -0
- package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +19 -5
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
- package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
- package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
- package/mobile/src/components/ApplicationForm/renderRegion.tsx +1 -0
- package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
- package/mobile/src/components/Carousel/Carousel.example.json +2 -1
- package/mobile/src/components/Carousel/Carousel.tsx +2 -1
- package/mobile/src/components/Carousel/CarouselContent.ts +7 -0
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +20 -4
- package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +7 -7
- package/mobile/src/components/Footer/buttonSizeStyles.ts +1 -1
- package/mobile/src/components/Headline/headlineVersionStyles.ts +1 -1
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/mobile/src/ui-kit/Input/Input.tsx +2 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +1 -0
- package/mobile/src/ui-kit/List/List.tsx +2 -0
- package/mobile/src/ui-kit/List/ListContent.ts +2 -2
- package/mobile/src/ui-kit/List/ListItem.tsx +1 -0
- package/mobile/src/ui-kit/Select/Select.tsx +46 -12
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
- package/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
- package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
- package/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
- package/src/components/ApplicationForm/renderRegion.tsx +1 -0
- package/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
- package/src/components/Carousel/Carousel.example.json +2 -1
- package/src/components/Carousel/Carousel.fixture.tsx +2 -0
- package/src/components/Carousel/Carousel.tsx +2 -1
- package/src/components/Carousel/CarouselContent.ts +7 -0
- package/src/components/Carousel/renderCarouselCards.tsx +20 -4
- package/src/components/CarouselLinks/CarouselLinks.fixture.tsx +12 -9
- package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.tsx +7 -7
- package/src/components/Headline/headlineVersionStyles.ts +1 -1
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/src/ui-kit/Input/Input.tsx +2 -0
- package/src/ui-kit/Input/InputProps.ts +1 -0
- package/src/ui-kit/List/List.tsx +2 -0
- package/src/ui-kit/List/ListContent.ts +2 -2
- package/src/ui-kit/List/ListItem.tsx +1 -0
- package/src/ui-kit/Select/Select.tsx +46 -12
- package/bundle/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/dist/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/dist/components/Footer/buttonSizeStyles.mobile.js +0 -7
- package/dist/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
- package/lib/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/lib/components/Footer/buttonSizeStyles.mobile.js +0 -5
- package/lib/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
- package/src/components/Footer/buttonSizeStyles.mobile.ts +0 -6
|
@@ -187,6 +187,7 @@ export default {
|
|
|
187
187
|
<Carousel
|
|
188
188
|
className="col-span-12"
|
|
189
189
|
visibleItemCount={0}
|
|
190
|
+
cardSize="big"
|
|
190
191
|
block={{
|
|
191
192
|
type: 'Carousel',
|
|
192
193
|
blocks: new Array(6).fill({
|
|
@@ -203,6 +204,7 @@ export default {
|
|
|
203
204
|
<Carousel
|
|
204
205
|
className="col-span-12"
|
|
205
206
|
visibleItemCount={0}
|
|
207
|
+
cardSize="big"
|
|
206
208
|
block={{
|
|
207
209
|
type: 'Carousel',
|
|
208
210
|
blocks: new Array(6).fill({
|
|
@@ -26,6 +26,7 @@ export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
|
|
|
26
26
|
showDots,
|
|
27
27
|
arrowsPadded = true,
|
|
28
28
|
isGap = true,
|
|
29
|
+
cardSize = 'normal',
|
|
29
30
|
...rest
|
|
30
31
|
}) => {
|
|
31
32
|
const { blocks: childBlocks = [] } = rest.block || {};
|
|
@@ -55,7 +56,7 @@ export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
|
|
|
55
56
|
gap={isGap ? ITEMS_GAP : undefined}
|
|
56
57
|
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
57
58
|
>
|
|
58
|
-
{renderCarouselCards({ noCardBorder, activeIndex, ...rest })}
|
|
59
|
+
{renderCarouselCards({ noCardBorder, activeIndex, cardSize, ...rest })}
|
|
59
60
|
</SwipeListContainer>
|
|
60
61
|
<CarouselScrollButtons
|
|
61
62
|
scroll={scroll}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @title Размер карточек
|
|
5
|
+
* @enumNames ["Нормальный", "Большой"]
|
|
6
|
+
*/
|
|
7
|
+
export type CardSizeMode = 'normal' | 'big';
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* @title Карусель
|
|
5
11
|
*/
|
|
@@ -17,4 +23,5 @@ export type CarouselContent = UniBlockContent & {
|
|
|
17
23
|
isGap?: boolean;
|
|
18
24
|
/** @title Не показывать контур на карточках */
|
|
19
25
|
noCardBorder?: boolean;
|
|
26
|
+
cardSize?: CardSizeMode;
|
|
20
27
|
};
|
|
@@ -5,14 +5,21 @@ import type { BlockDef } from '../../model/ContentPageDef';
|
|
|
5
5
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
7
|
import { renderCardHighlight } from './renderCardHighlight';
|
|
8
|
+
import type { CardSizeMode } from './CarouselContent';
|
|
8
9
|
|
|
9
10
|
const cardBaseStyle = 'relative h-full';
|
|
10
11
|
|
|
12
|
+
const CARD_SIZE_MAP: Record<CardSizeMode, string> = {
|
|
13
|
+
normal: 'sm:min-w-96',
|
|
14
|
+
big: 'sm:min-w-[515px]',
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
export const renderCarouselCards = ({
|
|
12
18
|
noCardBorder,
|
|
13
19
|
activeIndex,
|
|
20
|
+
cardSize = 'normal',
|
|
14
21
|
...rest
|
|
15
|
-
}: UniBlockProps & { noCardBorder?: boolean; activeIndex?: number }) => {
|
|
22
|
+
}: UniBlockProps & { noCardBorder?: boolean; activeIndex?: number; cardSize?: CardSizeMode }) => {
|
|
16
23
|
const { blocks: childBlocks } = rest.block || {};
|
|
17
24
|
const someCardsHighlighted = childBlocks?.some(isCardHighlighted);
|
|
18
25
|
|
|
@@ -21,7 +28,11 @@ export const renderCarouselCards = ({
|
|
|
21
28
|
renderProps: (block: BlockDef, options: BlockRendererOptions, blockIndex) => (
|
|
22
29
|
<div className={cardWrapperStyle(block, { someCardsHighlighted })}>
|
|
23
30
|
{renderBlock(block, options, {
|
|
24
|
-
className: cardStyle(block, {
|
|
31
|
+
className: cardStyle(block, {
|
|
32
|
+
someCardsHighlighted,
|
|
33
|
+
showBorder: !noCardBorder,
|
|
34
|
+
cardSize,
|
|
35
|
+
}),
|
|
25
36
|
blockIndex,
|
|
26
37
|
isActive: blockIndex === activeIndex,
|
|
27
38
|
})}
|
|
@@ -44,11 +55,16 @@ const cardWrapperStyle = (
|
|
|
44
55
|
|
|
45
56
|
const cardStyle = (
|
|
46
57
|
_: BlockDef | undefined,
|
|
47
|
-
{
|
|
58
|
+
{
|
|
59
|
+
someCardsHighlighted,
|
|
60
|
+
showBorder,
|
|
61
|
+
cardSize = 'normal',
|
|
62
|
+
}: { someCardsHighlighted?: boolean; showBorder?: boolean; cardSize?: CardSizeMode },
|
|
48
63
|
) =>
|
|
49
64
|
style(
|
|
50
65
|
cardBaseStyle,
|
|
51
|
-
'min-w-80
|
|
66
|
+
'min-w-80',
|
|
67
|
+
CARD_SIZE_MAP[cardSize], // TODO fix для RecommendationCard
|
|
52
68
|
someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl sm:pt-16' : 'pt-3xl'),
|
|
53
69
|
showBorder &&
|
|
54
70
|
'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider',
|
|
@@ -21,14 +21,17 @@ const MAX_LINKS_COUNT = 10;
|
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
23
|
default: (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
<div className="container grid grid-cols-12">
|
|
25
|
+
<CarouselLinks
|
|
26
|
+
links={links}
|
|
27
|
+
title="О Банке"
|
|
28
|
+
description={description}
|
|
29
|
+
additionalDescription={additionalDescription}
|
|
30
|
+
maxLinksCount={MAX_LINKS_COUNT}
|
|
31
|
+
version="secondary"
|
|
32
|
+
className="col-span-12"
|
|
33
|
+
block={{ type: 'Carousel', blocks: new Array(1).fill(link).flat() }}
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
33
36
|
),
|
|
34
37
|
};
|
|
@@ -53,7 +53,7 @@ const renderLinks = (links: LinkProps[], maxLinksCount: number) => {
|
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
55
|
<Carousel
|
|
56
|
-
className="sm:w-2/3 w-full p-0 sm:p-xs"
|
|
56
|
+
className="@container-normal sm:w-2/3 w-full p-0 sm:p-xs"
|
|
57
57
|
version="secondary"
|
|
58
58
|
itemCount={itemCount}
|
|
59
59
|
arrowsPadded={false}
|
package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx
CHANGED
|
@@ -89,7 +89,7 @@ export const CAROUSEL_RECOMMENDATION_CARD_SECONDARY: CarouselRecommendationCardC
|
|
|
89
89
|
description: 'Описание',
|
|
90
90
|
align: 'text-left',
|
|
91
91
|
icon,
|
|
92
|
-
items: ['Свежие новости', 'Акции и
|
|
92
|
+
items: ['Свежие новости', 'Акции и предложения', 'Ставки и котировки'],
|
|
93
93
|
version: 'secondary',
|
|
94
94
|
socialMedia: socialMediaWithoutText,
|
|
95
95
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
3
|
-
import type { Picture } from '../../model/Picture';
|
|
4
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
3
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
4
|
import { LinkWrapper } from '../../ui-kit/LinkWrapper/LinkWrapper';
|
|
@@ -9,6 +7,8 @@ import { style } from '../../utils/style';
|
|
|
9
7
|
import { SocialMedia } from '../Footer/SocialMedia';
|
|
10
8
|
import { Headline } from '../Headline/Headline';
|
|
11
9
|
import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
|
|
10
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
11
|
+
import type { Picture } from '../../model/Picture';
|
|
12
12
|
|
|
13
13
|
export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {}
|
|
14
14
|
|
|
@@ -27,20 +27,20 @@ export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
|
|
|
27
27
|
}) => {
|
|
28
28
|
return (
|
|
29
29
|
<BlockWrapper
|
|
30
|
-
className={style('relative group-data-gray:bg-main-divider/50
|
|
31
|
-
defaultPadding="p-
|
|
30
|
+
className={style('relative group-data-gray:bg-main-divider/50', className)}
|
|
31
|
+
defaultPadding="p-3xl"
|
|
32
32
|
{...rest}
|
|
33
33
|
>
|
|
34
|
-
<LinkWrapper href={href} target={target}>
|
|
34
|
+
<LinkWrapper href={href} target={target} className={'space-y-lg'}>
|
|
35
35
|
<Headline
|
|
36
36
|
title={title}
|
|
37
37
|
description={description}
|
|
38
|
-
headlineVersion="
|
|
38
|
+
headlineVersion="XS"
|
|
39
39
|
isEmbedded={true}
|
|
40
40
|
align={align}
|
|
41
41
|
/>
|
|
42
42
|
{items.length ? (
|
|
43
|
-
<List className="flex flex-col gap-xs" items={items} listItemSize="
|
|
43
|
+
<List className="flex flex-col gap-xs" items={items} listItemSize="XS" />
|
|
44
44
|
) : null}
|
|
45
45
|
{renderIcon(icon)}
|
|
46
46
|
{socialMedia.length ? <SocialMedia media={socialMedia} /> : null}
|
|
@@ -68,7 +68,7 @@ const renderImageContainer = (
|
|
|
68
68
|
{ className, imageAlign }: { className?: string; imageAlign?: Align },
|
|
69
69
|
) => {
|
|
70
70
|
//TODO Спорное решение
|
|
71
|
-
const fullWidth = image?.props?.image
|
|
71
|
+
const fullWidth = image?.props?.image?.size?.width > 400;
|
|
72
72
|
|
|
73
73
|
return image ? (
|
|
74
74
|
<div
|
|
@@ -21,6 +21,7 @@ export const Input = JSX<InputProps>(
|
|
|
21
21
|
onFocus,
|
|
22
22
|
onBlur,
|
|
23
23
|
pattern,
|
|
24
|
+
autoFocus = false,
|
|
24
25
|
}) => {
|
|
25
26
|
const handleChange = useCallback(
|
|
26
27
|
(e: { target?: { value?: string } }) => {
|
|
@@ -61,6 +62,7 @@ export const Input = JSX<InputProps>(
|
|
|
61
62
|
onFocus={onFocus}
|
|
62
63
|
onBlur={onBlur}
|
|
63
64
|
pattern={pattern}
|
|
65
|
+
autoFocus={autoFocus}
|
|
64
66
|
/>
|
|
65
67
|
</label>
|
|
66
68
|
{children}
|
package/src/ui-kit/List/List.tsx
CHANGED
|
@@ -5,12 +5,14 @@ import { ListItem } from './ListItem';
|
|
|
5
5
|
import type { ListProps } from './ListProps';
|
|
6
6
|
|
|
7
7
|
const TEXT_SIZE_MAP: Record<ListItemSize, string> = {
|
|
8
|
+
XS: 'text-m font-light',
|
|
8
9
|
S: 'text-l font-light',
|
|
9
10
|
M: 'text-h6',
|
|
10
11
|
L: 'text-h5',
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
const ITEM_INDENT_MAP: Record<ListItemSize, string> = {
|
|
15
|
+
XS: 'ml-2xs',
|
|
14
16
|
S: 'ml-xs',
|
|
15
17
|
M: 'ml-s',
|
|
16
18
|
L: 'ml-m',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @title Размер пунктов списка
|
|
3
|
-
* @enumNames ["Маленький", "Средний", "Большой"]
|
|
3
|
+
* @enumNames ["Очень маленький", "Маленький", "Средний", "Большой"]
|
|
4
4
|
*/
|
|
5
|
-
export type ListItemSize = 'S' | 'M' | 'L';
|
|
5
|
+
export type ListItemSize = 'XS' | 'S' | 'M' | 'L';
|
|
6
6
|
|
|
7
7
|
export interface ListContent {
|
|
8
8
|
/** @title Список */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useBool } from '../../hooks/useBool';
|
|
4
4
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
5
5
|
import { LabelProps } from '../../model/HeadlineType';
|
|
6
|
+
import { jaroWinklerDistance } from '../../services/search/jaroWinklerDistance';
|
|
6
7
|
import { Text } from '../../ui-kit/Text/Text';
|
|
7
8
|
import { style } from '../../utils/style';
|
|
8
9
|
import { Icon } from '../Icon/Icon';
|
|
10
|
+
import { Input } from '../Input/Input';
|
|
9
11
|
|
|
10
12
|
export interface Option {
|
|
11
13
|
key: string;
|
|
@@ -20,6 +22,7 @@ export type SelectProps = LabelProps & {
|
|
|
20
22
|
isBorder?: boolean;
|
|
21
23
|
placeholder?: string;
|
|
22
24
|
onChange?: (value: Option) => void;
|
|
25
|
+
isSearch?: boolean;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
export const Select = JSX<SelectProps>(
|
|
@@ -32,13 +35,19 @@ export const Select = JSX<SelectProps>(
|
|
|
32
35
|
isBorder = true,
|
|
33
36
|
placeholder = '',
|
|
34
37
|
onChange,
|
|
38
|
+
isSearch = false,
|
|
35
39
|
}) => {
|
|
36
40
|
const [isOpen, { setFalse: close, toggle }] = useBool();
|
|
37
|
-
const
|
|
41
|
+
const [searchValue, setSearchValue] = useState('');
|
|
42
|
+
const reset = useCallback(() => {
|
|
43
|
+
close();
|
|
44
|
+
setSearchValue('');
|
|
45
|
+
}, []);
|
|
46
|
+
const wrapperRef = useOutsideClick<HTMLDivElement>(reset);
|
|
38
47
|
|
|
39
48
|
const handleChange = useCallback(
|
|
40
49
|
(option: Option) => {
|
|
41
|
-
|
|
50
|
+
reset();
|
|
42
51
|
onChange && onChange(option);
|
|
43
52
|
},
|
|
44
53
|
[onChange],
|
|
@@ -48,17 +57,11 @@ export const Select = JSX<SelectProps>(
|
|
|
48
57
|
|
|
49
58
|
return (
|
|
50
59
|
<div className={className} ref={wrapperRef}>
|
|
51
|
-
{label
|
|
52
|
-
<div className="mb-xs">
|
|
53
|
-
<Text size="text-m" color="text-primary-text" font="font-light">
|
|
54
|
-
{label}
|
|
55
|
-
</Text>
|
|
56
|
-
</div>
|
|
57
|
-
) : null}
|
|
60
|
+
{renderLabel(label)}
|
|
58
61
|
<div className={style('relative', isOpen ? 'z-20' : 'z-10')}>
|
|
59
62
|
<div
|
|
60
63
|
className={style(
|
|
61
|
-
'text-l flex justify-between items-center text-primary-text cursor-pointer',
|
|
64
|
+
'text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10',
|
|
62
65
|
getBorderStyle(isBorder, valid),
|
|
63
66
|
)}
|
|
64
67
|
onClick={toggle}
|
|
@@ -73,10 +76,13 @@ export const Select = JSX<SelectProps>(
|
|
|
73
76
|
height="16"
|
|
74
77
|
/>
|
|
75
78
|
</div>
|
|
79
|
+
{isSearch ? renderSearch(isOpen, searchValue, setSearchValue) : null}
|
|
76
80
|
{options?.length ? (
|
|
77
81
|
<div className={style('h-0', isOpen ? '' : 'overflow-hidden')}>
|
|
78
82
|
<div className="bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
|
|
79
|
-
{options.map(
|
|
83
|
+
{getFilteredOptions(options, searchValue).map(
|
|
84
|
+
renderOption(handleChange, isOpen, isSelected),
|
|
85
|
+
)}
|
|
80
86
|
</div>
|
|
81
87
|
</div>
|
|
82
88
|
) : null}
|
|
@@ -86,6 +92,34 @@ export const Select = JSX<SelectProps>(
|
|
|
86
92
|
},
|
|
87
93
|
);
|
|
88
94
|
|
|
95
|
+
const renderLabel = (label?: string) =>
|
|
96
|
+
label ? (
|
|
97
|
+
<div className="mb-xs">
|
|
98
|
+
<Text size="text-m" color="text-primary-text" font="font-light">
|
|
99
|
+
{label}
|
|
100
|
+
</Text>
|
|
101
|
+
</div>
|
|
102
|
+
) : null;
|
|
103
|
+
|
|
104
|
+
const getFilteredOptions = (options: Option[], searchValue: string) => {
|
|
105
|
+
return searchValue
|
|
106
|
+
? options.filter(
|
|
107
|
+
(_) => jaroWinklerDistance(_.text?.toLowerCase())(searchValue.toLowerCase()) >= 0.6,
|
|
108
|
+
)
|
|
109
|
+
: options;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const renderSearch = (
|
|
113
|
+
isOpen: boolean,
|
|
114
|
+
searchValue: string,
|
|
115
|
+
setSearchValue: (value: string) => void,
|
|
116
|
+
) =>
|
|
117
|
+
isOpen ? (
|
|
118
|
+
<div className={style('absolute top-0 w-full h-full z-20')}>
|
|
119
|
+
<Input type="text" autoFocus value={searchValue} onChange={setSearchValue} />
|
|
120
|
+
</div>
|
|
121
|
+
) : null;
|
|
122
|
+
|
|
89
123
|
const renderOption =
|
|
90
124
|
(
|
|
91
125
|
handleChange: (option: Option) => void,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buttonSizeStyles.mobile.js","sourceRoot":"","sources":["../../../src/components/Footer/buttonSizeStyles.mobile.ts"],"names":[],"mappings":";;AAEa,QAAA,gBAAgB,GAAoC;IAC/D,OAAO,EAAE,WAAW;IACpB,SAAS,EAAE,aAAa;CACzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buttonSizeStyles.mobile.js","sourceRoot":"","sources":["../../../src/components/Footer/buttonSizeStyles.mobile.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAoC;IAC/D,OAAO,EAAE,WAAW;IACpB,SAAS,EAAE,aAAa;CACzB,CAAC"}
|