@cloud-ru/uikit-product-site-section 1.5.4 → 1.5.5-preview-2d60b98c.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/README.md CHANGED
@@ -221,10 +221,12 @@
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"` | - | Тег заголовка |
227
228
  | backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | - | Цвет фона |
229
+ | moreButton | `{ label?: string; href?: string; onClick: MouseEventHandler<HTMLElement>; 'data-test-id'?: string; }` | - | Кнопка внизу секции |
228
230
  | autoSwipe | `number` | 9 | Автоматическое переключение слайдов в секундах |
229
231
  | id | `string` | - | id секции |
230
232
  | footerDescription | `string` | - | Описание секции |
@@ -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'> & 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, 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, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "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 }, (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'> & 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, 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, className, layoutType, autoSwipe = 9 } = _a, rest = __rest(_a, ["id", "title", "description", "titleSectionSize", "titleTag", "items", "footerDescription", "backgroundColor", "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 }, 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.5.4",
4
+ "version": "1.5.5-preview-2d60b98c.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": "92d679e9b52484574ef7848f1b46241c465ce197"
70
+ "gitHead": "f9e6d40898c030c1458576df2c7f3c2ef9fea446"
71
71
  }
@@ -12,7 +12,10 @@ import { calculateAmountOfItemsPerPage } from './utils';
12
12
 
13
13
  export type SectionLeadingProps = WithSupportProps<
14
14
  WithLayoutType<
15
- Pick<SectionBasicProps, 'title' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor'> &
15
+ Pick<
16
+ SectionBasicProps,
17
+ 'title' | 'subtitle' | 'description' | 'titleSectionSize' | 'titleTag' | 'backgroundColor' | 'moreButton'
18
+ > &
16
19
  Pick<CarouselProps, 'autoSwipe'> & {
17
20
  /** id секции */
18
21
  id?: string;
@@ -31,12 +34,14 @@ const MOBILE_LAYOUTS = ['tablet', 'mobile'];
31
34
  export function SectionLeading({
32
35
  id,
33
36
  title,
37
+ subtitle,
34
38
  description,
35
39
  titleSectionSize = 'm',
36
40
  titleTag,
37
41
  items,
38
42
  footerDescription,
39
43
  backgroundColor,
44
+ moreButton,
40
45
  className,
41
46
  layoutType,
42
47
  autoSwipe = 9,
@@ -82,9 +87,11 @@ export function SectionLeading({
82
87
  className={className}
83
88
  backgroundColor={backgroundColor}
84
89
  title={title}
90
+ subtitle={subtitle}
85
91
  description={description}
86
92
  titleSectionSize={titleSectionSize}
87
93
  titleTag={titleTag}
94
+ moreButton={moreButton}
88
95
  {...extractSupportProps(rest)}
89
96
  >
90
97
  <div ref={wrapperRef} className={styles.leadingSection} data-layout-type={layoutType}>