@cloud-ru/uikit-product-site-section 1.5.5-preview-0099cd8a.0 → 1.6.0
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/CHANGELOG.md +11 -0
- package/README.md +1 -0
- package/dist/cjs/components/SectionLeading/SectionLeading.d.ts +2 -2
- package/dist/cjs/components/SectionLeading/SectionLeading.js +2 -2
- package/dist/esm/components/SectionLeading/SectionLeading.d.ts +2 -2
- package/dist/esm/components/SectionLeading/SectionLeading.js +2 -2
- package/package.json +2 -2
- package/src/components/SectionLeading/SectionLeading.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.6.0 (2026-06-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **SITE-11474:** add show more button for section leading ([405df9c](https://github.com/cloud-ru-tech/uikit-product/commit/405df9ca5bb7c47c9c35b01325a7a0d01f9e67cb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 1.5.4 (2026-06-10)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
222
222
|
| items* | `CardLeadingItem[]` | - | Массив айтемов |
|
|
223
223
|
| title | `string` | - | Название секции |
|
|
224
|
+
| subtitle | `string` | - | Подзаголовок секции |
|
|
224
225
|
| description | `string` | - | Описание секции |
|
|
225
226
|
| titleSectionSize | enum Size: `"s"`, `"m"`, `"l"` | m | Размер шрифтов заголовка и подзаголовка |
|
|
226
227
|
| titleTag | enum SectionTag: `"h2"`, `"h3"`, `"h4"` | - | Тег заголовка |
|
|
@@ -2,7 +2,7 @@ import { WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils'
|
|
|
2
2
|
import { CarouselProps } from '@snack-uikit/carousel';
|
|
3
3
|
import { CardLeadingItem } from '../../helperComponents';
|
|
4
4
|
import { SectionBasicProps } from '../SectionBasic';
|
|
5
|
-
export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBasicProps, 'title' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'> & Pick<CarouselProps, 'autoSwipe'> & {
|
|
5
|
+
export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBasicProps, 'title' | 'subtitle' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'> & Pick<CarouselProps, 'autoSwipe'> & {
|
|
6
6
|
/** id секции */
|
|
7
7
|
id?: string;
|
|
8
8
|
/** Массив айтемов */
|
|
@@ -12,4 +12,4 @@ export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBa
|
|
|
12
12
|
/** CSS - класснейм */
|
|
13
13
|
className?: string;
|
|
14
14
|
}>>;
|
|
15
|
-
export declare function SectionLeading({ id, title, description, titleSectionSize, titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe, ...rest }: SectionLeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function SectionLeading({ id, title, subtitle, description, titleSectionSize, titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe, ...rest }: SectionLeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,7 @@ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
|
27
27
|
const utils_1 = require("./utils");
|
|
28
28
|
const MOBILE_LAYOUTS = ['tablet', 'mobile'];
|
|
29
29
|
function SectionLeading(_a) {
|
|
30
|
-
var { id, title, description, titleSectionSize = 'm', titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "moreButton", "className", "layoutType", "autoSwipe"]);
|
|
30
|
+
var { id, title, subtitle, description, titleSectionSize = 'm', titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "subtitle", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "moreButton", "className", "layoutType", "autoSwipe"]);
|
|
31
31
|
const [currentPage, setCurrentPage] = (0, react_1.useState)(0);
|
|
32
32
|
const [itemsPerPageAmount, setItemsPerPageAmount] = (0, react_1.useState)(0);
|
|
33
33
|
const wrapperRef = (0, react_1.useRef)(null);
|
|
@@ -53,5 +53,5 @@ function SectionLeading(_a) {
|
|
|
53
53
|
}
|
|
54
54
|
return items.length > itemsPerPageAmount;
|
|
55
55
|
}, [items.length, itemsPerPageAmount, layoutType]);
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)(SectionBasic_1.SectionBasic, Object.assign({ id: id, layoutType: layoutType, className: className, backgroundColor: backgroundColor, title: title, description: description, titleSectionSize: titleSectionSize, titleTag: titleTag, moreButton: moreButton }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsxs)("div", { ref: wrapperRef, className: styles_module_scss_1.default.leadingSection, "data-layout-type": layoutType, children: [itemsPerPageAmount > 0 && ((0, jsx_runtime_1.jsx)(carousel_1.Carousel, { state: { page: currentPage, onChange: setCurrentPage }, arrows: showArrows, controlsVisibility: 'always', showItems: itemsPerPageAmount, pagination: items.length > itemsPerPageAmount, swipe: items.length > itemsPerPageAmount, autoSwipe: autoSwipe, infiniteScroll: true, gap: '2px', children: items.map(item => ((0, jsx_runtime_1.jsx)(helperComponents_1.CardLeading, Object.assign({}, item, { layoutType: layoutType, "data-test-id": item['data-test-id'] }), item.label))) })), footerDescription && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footerDescription, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyL, { className: styles_module_scss_1.default.footerDescriptionText, children: footerDescription }) }))] }) })));
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(SectionBasic_1.SectionBasic, Object.assign({ id: id, layoutType: layoutType, className: className, backgroundColor: backgroundColor, title: title, subtitle: subtitle, description: description, titleSectionSize: titleSectionSize, titleTag: titleTag, moreButton: moreButton }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsxs)("div", { ref: wrapperRef, className: styles_module_scss_1.default.leadingSection, "data-layout-type": layoutType, children: [itemsPerPageAmount > 0 && ((0, jsx_runtime_1.jsx)(carousel_1.Carousel, { state: { page: currentPage, onChange: setCurrentPage }, arrows: showArrows, controlsVisibility: 'always', showItems: itemsPerPageAmount, pagination: items.length > itemsPerPageAmount, swipe: items.length > itemsPerPageAmount, autoSwipe: autoSwipe, infiniteScroll: true, gap: '2px', children: items.map(item => ((0, jsx_runtime_1.jsx)(helperComponents_1.CardLeading, Object.assign({}, item, { layoutType: layoutType, "data-test-id": item['data-test-id'] }), item.label))) })), footerDescription && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footerDescription, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyL, { className: styles_module_scss_1.default.footerDescriptionText, children: footerDescription }) }))] }) })));
|
|
57
57
|
}
|
|
@@ -2,7 +2,7 @@ import { WithLayoutType, WithSupportProps } from '@cloud-ru/uikit-product-utils'
|
|
|
2
2
|
import { CarouselProps } from '@snack-uikit/carousel';
|
|
3
3
|
import { CardLeadingItem } from '../../helperComponents';
|
|
4
4
|
import { SectionBasicProps } from '../SectionBasic';
|
|
5
|
-
export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBasicProps, 'title' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'> & Pick<CarouselProps, 'autoSwipe'> & {
|
|
5
|
+
export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBasicProps, 'title' | 'subtitle' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'> & Pick<CarouselProps, 'autoSwipe'> & {
|
|
6
6
|
/** id секции */
|
|
7
7
|
id?: string;
|
|
8
8
|
/** Массив айтемов */
|
|
@@ -12,4 +12,4 @@ export type SectionLeadingProps = WithSupportProps<WithLayoutType<Pick<SectionBa
|
|
|
12
12
|
/** CSS - класснейм */
|
|
13
13
|
className?: string;
|
|
14
14
|
}>>;
|
|
15
|
-
export declare function SectionLeading({ id, title, description, titleSectionSize, titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe, ...rest }: SectionLeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function SectionLeading({ id, title, subtitle, description, titleSectionSize, titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe, ...rest }: SectionLeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,7 +21,7 @@ import styles from './styles.module.css';
|
|
|
21
21
|
import { calculateAmountOfItemsPerPage } from './utils';
|
|
22
22
|
const MOBILE_LAYOUTS = ['tablet', 'mobile'];
|
|
23
23
|
export function SectionLeading(_a) {
|
|
24
|
-
var { id, title, description, titleSectionSize = 'm', titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "moreButton", "className", "layoutType", "autoSwipe"]);
|
|
24
|
+
var { id, title, subtitle, description, titleSectionSize = 'm', titleTag, items, footerDescription, backgroundColor, moreButton, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "subtitle", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "moreButton", "className", "layoutType", "autoSwipe"]);
|
|
25
25
|
const [currentPage, setCurrentPage] = useState(0);
|
|
26
26
|
const [itemsPerPageAmount, setItemsPerPageAmount] = useState(0);
|
|
27
27
|
const wrapperRef = useRef(null);
|
|
@@ -47,5 +47,5 @@ export function SectionLeading(_a) {
|
|
|
47
47
|
}
|
|
48
48
|
return items.length > itemsPerPageAmount;
|
|
49
49
|
}, [items.length, itemsPerPageAmount, layoutType]);
|
|
50
|
-
return (_jsx(SectionBasic, Object.assign({ id: id, layoutType: layoutType, className: className, backgroundColor: backgroundColor, title: title, description: description, titleSectionSize: titleSectionSize, titleTag: titleTag, moreButton: moreButton }, extractSupportProps(rest), { children: _jsxs("div", { ref: wrapperRef, className: styles.leadingSection, "data-layout-type": layoutType, children: [itemsPerPageAmount > 0 && (_jsx(Carousel, { state: { page: currentPage, onChange: setCurrentPage }, arrows: showArrows, controlsVisibility: 'always', showItems: itemsPerPageAmount, pagination: items.length > itemsPerPageAmount, swipe: items.length > itemsPerPageAmount, autoSwipe: autoSwipe, infiniteScroll: true, gap: '2px', children: items.map(item => (_jsx(CardLeading, Object.assign({}, item, { layoutType: layoutType, "data-test-id": item['data-test-id'] }), item.label))) })), footerDescription && (_jsx("div", { className: styles.footerDescription, "data-layout-type": layoutType, children: _jsx(Typography.SansBodyL, { className: styles.footerDescriptionText, children: footerDescription }) }))] }) })));
|
|
50
|
+
return (_jsx(SectionBasic, Object.assign({ id: id, layoutType: layoutType, className: className, backgroundColor: backgroundColor, title: title, subtitle: subtitle, description: description, titleSectionSize: titleSectionSize, titleTag: titleTag, moreButton: moreButton }, extractSupportProps(rest), { children: _jsxs("div", { ref: wrapperRef, className: styles.leadingSection, "data-layout-type": layoutType, children: [itemsPerPageAmount > 0 && (_jsx(Carousel, { state: { page: currentPage, onChange: setCurrentPage }, arrows: showArrows, controlsVisibility: 'always', showItems: itemsPerPageAmount, pagination: items.length > itemsPerPageAmount, swipe: items.length > itemsPerPageAmount, autoSwipe: autoSwipe, infiniteScroll: true, gap: '2px', children: items.map(item => (_jsx(CardLeading, Object.assign({}, item, { layoutType: layoutType, "data-test-id": item['data-test-id'] }), item.label))) })), footerDescription && (_jsx("div", { className: styles.footerDescription, "data-layout-type": layoutType, children: _jsx(Typography.SansBodyL, { className: styles.footerDescriptionText, children: footerDescription }) }))] }) })));
|
|
51
51
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-site-section",
|
|
3
3
|
"title": "Site Section",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@cloud-ru/uikit-product-locale": "*",
|
|
68
68
|
"@snack-uikit/figma-tokens": "*"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "ee17cdbcb95c43481520b9e727a37d3eff1e585d"
|
|
71
71
|
}
|
|
@@ -14,7 +14,7 @@ export type SectionLeadingProps = WithSupportProps<
|
|
|
14
14
|
WithLayoutType<
|
|
15
15
|
Pick<
|
|
16
16
|
SectionBasicProps,
|
|
17
|
-
'title' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'
|
|
17
|
+
'title' | 'subtitle' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'
|
|
18
18
|
> &
|
|
19
19
|
Pick<CarouselProps, 'autoSwipe'> & {
|
|
20
20
|
/** id секции */
|
|
@@ -34,6 +34,7 @@ const MOBILE_LAYOUTS = ['tablet', 'mobile'];
|
|
|
34
34
|
export function SectionLeading({
|
|
35
35
|
id,
|
|
36
36
|
title,
|
|
37
|
+
subtitle,
|
|
37
38
|
description,
|
|
38
39
|
titleSectionSize = 'm',
|
|
39
40
|
titleTag,
|
|
@@ -86,6 +87,7 @@ export function SectionLeading({
|
|
|
86
87
|
className={className}
|
|
87
88
|
backgroundColor={backgroundColor}
|
|
88
89
|
title={title}
|
|
90
|
+
subtitle={subtitle}
|
|
89
91
|
description={description}
|
|
90
92
|
titleSectionSize={titleSectionSize}
|
|
91
93
|
titleTag={titleTag}
|