@cloud-ru/uikit-product-site-section 1.1.8-preview-481817ca.0 → 1.1.8
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 +13 -22
- package/dist/cjs/components/SectionContentTabs/SectionContentTabs.js +2 -2
- package/dist/esm/components/SectionContentTabs/SectionContentTabs.js +2 -2
- package/package.json +5 -5
- package/src/components/SectionContentTabs/SectionContentTabs.tsx +2 -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.1.8 (2026-03-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **SITE-10810:** pass tab onClick prop to SectionContentTabs tab ([4c33bb9](https://github.com/cloud-ru-tech/uikit-product/commit/4c33bb9606d9dfb5fe571d364ffedddb2d38ba58))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 1.1.7 (2026-02-27)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
| content* | `ContentBasicTab[] \| CardBasicArray \| ContentInfoTab[] \| CardInfoArray \| ContentNumericTab[] \| CardNumericArray \| ContentProductTab[] \| CardProductArray` | - | |
|
|
47
47
|
| type* | "basic" \| "info" \| "numeric" \| "product" | - | |
|
|
48
48
|
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
49
|
-
| columnsConfig* | `ColumnsConfig
|
|
49
|
+
| columnsConfig* | `WithSupportProps<WithLayoutType<{ children: ReactNode; columnsConfig: ColumnsConfig; gap?: "s" \| "m" \| "l" \| "xs"; className?: string; }>>` | - | Конфигурация настройки колонок для разных layoutType |
|
|
50
50
|
| id | `string` | - | id секции |
|
|
51
51
|
| title | `string` | - | Название секции |
|
|
52
52
|
| subtitle | `string` | - | Название подзаголовка секции |
|
|
@@ -157,9 +157,9 @@
|
|
|
157
157
|
| button | `Omit<ButtonFilledProps, "size" \| "fullWidth">` | - | Кнопка действия |
|
|
158
158
|
| backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | neutral-background1-level | Цвет фона |
|
|
159
159
|
| contentPosition | "left" \| "right" | left | Местоположение контента в секции |
|
|
160
|
-
| video | `
|
|
161
|
-
| onPlay | `
|
|
162
|
-
| onError | `
|
|
160
|
+
| video | `any` | - | |
|
|
161
|
+
| onPlay | `any` | - | |
|
|
162
|
+
| onError | `any` | - | |
|
|
163
163
|
| image | `{ src: string; alt?: string; }` | - | Ссылка на изображение |
|
|
164
164
|
| titleTag | enum SectionTag: `"h2"`, `"h3"`, `"h4"` | - | Тег заголовка |
|
|
165
165
|
## SectionContentList
|
|
@@ -174,9 +174,9 @@
|
|
|
174
174
|
| items | `Item[]` | - | Список элементов |
|
|
175
175
|
| backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | - | Цвет фона |
|
|
176
176
|
| contentPosition | "left" \| "right" | left | Местоположение контента в секции |
|
|
177
|
-
| video | `
|
|
178
|
-
| onPlay | `
|
|
179
|
-
| onError | `
|
|
177
|
+
| video | `any` | - | |
|
|
178
|
+
| onPlay | `any` | - | |
|
|
179
|
+
| onError | `any` | - | |
|
|
180
180
|
| image | `{ src: string; alt?: string; }` | - | Ссылка на изображение |
|
|
181
181
|
| titleTag | enum SectionTag: `"h2"`, `"h3"`, `"h4"` | - | Тег заголовка |
|
|
182
182
|
## SectionContentTabs
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
| name | type | default value | description |
|
|
233
233
|
|------|------|---------------|-------------|
|
|
234
234
|
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
235
|
-
| items* | `
|
|
235
|
+
| items* | `WithSupportProps<WithLayoutType<{ title: string; description?: string; href: string; target?: HTMLAttributeAnchorTarget; onClick?(e?: MouseEvent<HTMLAnchorElement \| HTMLDivElement, MouseEvent>): void; logo: { ...; }; tag?: Omit<...>; disabled?: boolean; className?: string; }>>[]` | - | Массив айтемов |
|
|
236
236
|
| title | `string` | - | Название секции |
|
|
237
237
|
| subtitle | `string` | - | Подзаголовок секции |
|
|
238
238
|
| description | `string` | - | Описание секции |
|
|
@@ -257,9 +257,9 @@
|
|
|
257
257
|
| titleTag | enum SectionTag: `"h2"`, `"h3"`, `"h4"` | - | Тег заголовка |
|
|
258
258
|
| id | `string` | - | id секции |
|
|
259
259
|
| backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | - | Цвет фона |
|
|
260
|
-
| video | `
|
|
261
|
-
| onPlay | `
|
|
262
|
-
| onError | `
|
|
260
|
+
| video | `any` | - | |
|
|
261
|
+
| onPlay | `any` | - | |
|
|
262
|
+
| onError | `any` | - | |
|
|
263
263
|
| image | `{ src: string; alt?: string; }` | - | Ссылка на изображение |
|
|
264
264
|
## SectionPersonalManager
|
|
265
265
|
### Props
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
| title | `string` | - | |
|
|
273
273
|
| description | `string` | - | |
|
|
274
274
|
| card | `{ title: string; text: string; }` | - | |
|
|
275
|
-
| benefits | `Pick<
|
|
275
|
+
| benefits | `Pick<WithSupportProps<WithLayoutType<{ title: string; description?: string; icon?: ReactNode \| IconElement \| { src: string; alt?: string; }; className?: string; }>>, "title" \| "icon">[]` | - | |
|
|
276
276
|
| withoutBenefits | `boolean` | - | |
|
|
277
277
|
| className | `string` | - | CSS-класс |
|
|
278
278
|
## SectionPromoList
|
|
@@ -299,20 +299,11 @@
|
|
|
299
299
|
| id | `string` | - | id секции |
|
|
300
300
|
| className | `string` | - | CSS-класс |
|
|
301
301
|
| backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | - | Цвет фона |
|
|
302
|
-
| gap | "s" \| "m" \| "l" \| "xs" | s | Размер отступов сетки |
|
|
302
|
+
| gap | `WithSupportProps<WithLayoutType<{ children: ReactNode; columnsConfig: ColumnsConfig; gap?: "s" \| "m" \| "l" \| "xs"; className?: string; }>>` | s | Размер отступов сетки |
|
|
303
303
|
## SectionTable
|
|
304
304
|
### Props
|
|
305
305
|
| name | type | default value | description |
|
|
306
306
|
|------|------|---------------|-------------|
|
|
307
|
-
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
308
|
-
| rows* | `Cell[][]` | - | |
|
|
309
|
-
| id | `string` | - | id секции |
|
|
310
|
-
| className | `string` | - | CSS-класс |
|
|
311
|
-
| title | `string` | - | Заголовок |
|
|
312
|
-
| subtitle | `string` | - | Подзаголовок |
|
|
313
|
-
| description | `string` | - | Описание |
|
|
314
|
-
| backgroundColor | enum SectionColor: `"neutral-background1-level"`, `"neutral-background"`, `"graphite-accent-default"` | - | Фон подложки |
|
|
315
|
-
| withHeader | `boolean` | - | |
|
|
316
307
|
## SectionCarousel
|
|
317
308
|
### Props
|
|
318
309
|
| name | type | default value | description |
|
|
@@ -36,8 +36,8 @@ function SectionContentTabs(_a) {
|
|
|
36
36
|
var { id, title, tabs, activeTab: activeTabProp, onActiveTabChange, button, className, layoutType, backgroundColor, titleTag, 'data-test-id': dataTestId = 'section-content-tabs' } = _a, rest = __rest(_a, ["id", "title", "tabs", "activeTab", "onActiveTabChange", "button", "className", "layoutType", "backgroundColor", "titleTag", 'data-test-id']);
|
|
37
37
|
const [activeTab, setActiveTab] = (0, uncontrollable_1.useUncontrolledProp)(activeTabProp, tabs[0].id, onActiveTabChange);
|
|
38
38
|
const isDesktop = ['desktop', 'desktopSmall'].includes(layoutType);
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(SectionBasic_1.SectionBasic, Object.assign({ id: id, layoutType: layoutType, title: title, className: className, backgroundColor: backgroundColor, "data-test-id": dataTestId, titleTag: titleTag }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsx)(tabs_1.Tabs, { value: activeTab, onChange: setActiveTab, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.sectionContent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabsWrapper, { [styles_module_scss_1.default.desktopTabsWrapper]: isDesktop }), children: [(0, jsx_runtime_1.jsx)(tabs_1.Tabs.TabBar, { orientation: isDesktop ? 'vertical' : 'horizontal', markerPosition: isDesktop ? 'before' : 'after', className: (0, classnames_1.default)({ [styles_module_scss_1.default.desktopTabs]: isDesktop }), children: tabs.map(({ id, title, disabled, icon }) => ((0, jsx_runtime_1.jsx)(tabs_1.Tabs.Tab, { value: id,
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(SectionBasic_1.SectionBasic, Object.assign({ id: id, layoutType: layoutType, title: title, className: className, backgroundColor: backgroundColor, "data-test-id": dataTestId, titleTag: titleTag }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: (0, jsx_runtime_1.jsx)(tabs_1.Tabs, { value: activeTab, onChange: setActiveTab, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.sectionContent, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabsWrapper, { [styles_module_scss_1.default.desktopTabsWrapper]: isDesktop }), children: [(0, jsx_runtime_1.jsx)(tabs_1.Tabs.TabBar, { orientation: isDesktop ? 'vertical' : 'horizontal', markerPosition: isDesktop ? 'before' : 'after', className: (0, classnames_1.default)({ [styles_module_scss_1.default.desktopTabs]: isDesktop }), children: tabs.map(({ id, title, disabled, icon, onClick }) => ((0, jsx_runtime_1.jsx)(tabs_1.Tabs.Tab, { value: id,
|
|
40
40
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
41
|
// @ts-ignore
|
|
42
|
-
label: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }), (0, jsx_runtime_1.jsx)(TabIcon, { icon: icon })] }), disabled: disabled }, id))) }), Boolean(button) && ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, button, { fullWidth: !isDesktop, size: 'l', "data-test-id": `${dataTestId}__button` })))] }), tabs.map(({ id, mediaTitle, mediaSubtitle, mediaDescription, image, video, onPlay }) => ((0, jsx_runtime_1.jsxs)(tabs_1.Tabs.TabContent, { value: id, className: styles_module_scss_1.default.mediaWrapper, children: [image && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, children: (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, src: image.src, alt: image.alt || title || 'section-content-image', "data-test-id": `${dataTestId}__image` }) })), video && ((0, jsx_runtime_1.jsx)(uikit_product_site_media_1.SiteVideo, { video: video, onPlay: onPlay, layoutType: layoutType, "data-test-id": `${dataTestId}__video` })), (mediaTitle || mediaSubtitle) && ((0, jsx_runtime_1.jsx)(helperComponents_1.SectionTitle, { titleSectionSize: 's', layoutType: layoutType, title: mediaTitle, description: mediaSubtitle })), mediaDescription && (0, jsx_runtime_1.jsx)(helperComponents_1.SectionTitle, { layoutType: layoutType, description: mediaDescription })] }, id)))] }) }) })));
|
|
42
|
+
label: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }), (0, jsx_runtime_1.jsx)(TabIcon, { icon: icon })] }), disabled: disabled, onClick: onClick }, id))) }), Boolean(button) && ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({}, button, { fullWidth: !isDesktop, size: 'l', "data-test-id": `${dataTestId}__button` })))] }), tabs.map(({ id, mediaTitle, mediaSubtitle, mediaDescription, image, video, onPlay }) => ((0, jsx_runtime_1.jsxs)(tabs_1.Tabs.TabContent, { value: id, className: styles_module_scss_1.default.mediaWrapper, children: [image && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageWrapper, children: (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, src: image.src, alt: image.alt || title || 'section-content-image', "data-test-id": `${dataTestId}__image` }) })), video && ((0, jsx_runtime_1.jsx)(uikit_product_site_media_1.SiteVideo, { video: video, onPlay: onPlay, layoutType: layoutType, "data-test-id": `${dataTestId}__video` })), (mediaTitle || mediaSubtitle) && ((0, jsx_runtime_1.jsx)(helperComponents_1.SectionTitle, { titleSectionSize: 's', layoutType: layoutType, title: mediaTitle, description: mediaSubtitle })), mediaDescription && (0, jsx_runtime_1.jsx)(helperComponents_1.SectionTitle, { layoutType: layoutType, description: mediaDescription })] }, id)))] }) }) })));
|
|
43
43
|
}
|
|
@@ -30,8 +30,8 @@ export function SectionContentTabs(_a) {
|
|
|
30
30
|
var { id, title, tabs, activeTab: activeTabProp, onActiveTabChange, button, className, layoutType, backgroundColor, titleTag, 'data-test-id': dataTestId = 'section-content-tabs' } = _a, rest = __rest(_a, ["id", "title", "tabs", "activeTab", "onActiveTabChange", "button", "className", "layoutType", "backgroundColor", "titleTag", 'data-test-id']);
|
|
31
31
|
const [activeTab, setActiveTab] = useUncontrolledProp(activeTabProp, tabs[0].id, onActiveTabChange);
|
|
32
32
|
const isDesktop = ['desktop', 'desktopSmall'].includes(layoutType);
|
|
33
|
-
return (_jsx(SectionBasic, Object.assign({ id: id, layoutType: layoutType, title: title, className: className, backgroundColor: backgroundColor, "data-test-id": dataTestId, titleTag: titleTag }, extractSupportProps(rest), { children: _jsx(Tabs, { value: activeTab, onChange: setActiveTab, children: _jsxs("div", { className: styles.sectionContent, "data-layout-type": layoutType, children: [_jsxs("div", { className: cn(styles.tabsWrapper, { [styles.desktopTabsWrapper]: isDesktop }), children: [_jsx(Tabs.TabBar, { orientation: isDesktop ? 'vertical' : 'horizontal', markerPosition: isDesktop ? 'before' : 'after', className: cn({ [styles.desktopTabs]: isDesktop }), children: tabs.map(({ id, title, disabled, icon }) => (_jsx(Tabs.Tab, { value: id,
|
|
33
|
+
return (_jsx(SectionBasic, Object.assign({ id: id, layoutType: layoutType, title: title, className: className, backgroundColor: backgroundColor, "data-test-id": dataTestId, titleTag: titleTag }, extractSupportProps(rest), { children: _jsx(Tabs, { value: activeTab, onChange: setActiveTab, children: _jsxs("div", { className: styles.sectionContent, "data-layout-type": layoutType, children: [_jsxs("div", { className: cn(styles.tabsWrapper, { [styles.desktopTabsWrapper]: isDesktop }), children: [_jsx(Tabs.TabBar, { orientation: isDesktop ? 'vertical' : 'horizontal', markerPosition: isDesktop ? 'before' : 'after', className: cn({ [styles.desktopTabs]: isDesktop }), children: tabs.map(({ id, title, disabled, icon, onClick }) => (_jsx(Tabs.Tab, { value: id,
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
35
|
// @ts-ignore
|
|
36
|
-
label: _jsxs(_Fragment, { children: [_jsx(RichText, { richText: title }), _jsx(TabIcon, { icon: icon })] }), disabled: disabled }, id))) }), Boolean(button) && (_jsx(ButtonFilled, Object.assign({}, button, { fullWidth: !isDesktop, size: 'l', "data-test-id": `${dataTestId}__button` })))] }), tabs.map(({ id, mediaTitle, mediaSubtitle, mediaDescription, image, video, onPlay }) => (_jsxs(Tabs.TabContent, { value: id, className: styles.mediaWrapper, children: [image && (_jsx("div", { className: styles.imageWrapper, children: _jsx("img", { className: styles.image, src: image.src, alt: image.alt || title || 'section-content-image', "data-test-id": `${dataTestId}__image` }) })), video && (_jsx(SiteVideo, { video: video, onPlay: onPlay, layoutType: layoutType, "data-test-id": `${dataTestId}__video` })), (mediaTitle || mediaSubtitle) && (_jsx(SectionTitle, { titleSectionSize: 's', layoutType: layoutType, title: mediaTitle, description: mediaSubtitle })), mediaDescription && _jsx(SectionTitle, { layoutType: layoutType, description: mediaDescription })] }, id)))] }) }) })));
|
|
36
|
+
label: _jsxs(_Fragment, { children: [_jsx(RichText, { richText: title }), _jsx(TabIcon, { icon: icon })] }), disabled: disabled, onClick: onClick }, id))) }), Boolean(button) && (_jsx(ButtonFilled, Object.assign({}, button, { fullWidth: !isDesktop, size: 'l', "data-test-id": `${dataTestId}__button` })))] }), tabs.map(({ id, mediaTitle, mediaSubtitle, mediaDescription, image, video, onPlay }) => (_jsxs(Tabs.TabContent, { value: id, className: styles.mediaWrapper, children: [image && (_jsx("div", { className: styles.imageWrapper, children: _jsx("img", { className: styles.image, src: image.src, alt: image.alt || title || 'section-content-image', "data-test-id": `${dataTestId}__image` }) })), video && (_jsx(SiteVideo, { video: video, onPlay: onPlay, layoutType: layoutType, "data-test-id": `${dataTestId}__video` })), (mediaTitle || mediaSubtitle) && (_jsx(SectionTitle, { titleSectionSize: 's', layoutType: layoutType, title: mediaTitle, description: mediaSubtitle })), mediaDescription && _jsx(SectionTitle, { layoutType: layoutType, description: mediaDescription })] }, id)))] }) }) })));
|
|
37
37
|
}
|
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.1.8
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@cloud-ru/uikit-product-icons": "17.0.5",
|
|
40
|
-
"@cloud-ru/uikit-product-mobile-fields": "2.0.
|
|
41
|
-
"@cloud-ru/uikit-product-site-cards": "1.1.
|
|
40
|
+
"@cloud-ru/uikit-product-mobile-fields": "2.0.7",
|
|
41
|
+
"@cloud-ru/uikit-product-site-cards": "1.1.5",
|
|
42
42
|
"@cloud-ru/uikit-product-site-case-card": "1.1.2",
|
|
43
43
|
"@cloud-ru/uikit-product-site-grid": "1.1.2",
|
|
44
44
|
"@cloud-ru/uikit-product-site-layout": "1.1.2",
|
|
45
45
|
"@cloud-ru/uikit-product-site-media": "1.1.5",
|
|
46
46
|
"@cloud-ru/uikit-product-site-rich-text": "1.1.2",
|
|
47
|
-
"@cloud-ru/uikit-product-site-table": "1.1.
|
|
47
|
+
"@cloud-ru/uikit-product-site-table": "1.1.2",
|
|
48
48
|
"@cloud-ru/uikit-product-utils": "9.0.2",
|
|
49
49
|
"@snack-uikit/accordion": "0.11.0",
|
|
50
50
|
"@snack-uikit/button": "0.19.7",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@cloud-ru/uikit-product-locale": "*",
|
|
68
68
|
"@snack-uikit/figma-tokens": "*"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "015956d43324a417a39c0ee5eb6eb906a123592a"
|
|
71
71
|
}
|
|
@@ -92,7 +92,7 @@ export function SectionContentTabs({
|
|
|
92
92
|
markerPosition={isDesktop ? 'before' : 'after'}
|
|
93
93
|
className={cn({ [styles.desktopTabs]: isDesktop })}
|
|
94
94
|
>
|
|
95
|
-
{tabs.map(({ id, title, disabled, icon }) => (
|
|
95
|
+
{tabs.map(({ id, title, disabled, icon, onClick }) => (
|
|
96
96
|
<Tabs.Tab
|
|
97
97
|
key={id}
|
|
98
98
|
value={id}
|
|
@@ -105,6 +105,7 @@ export function SectionContentTabs({
|
|
|
105
105
|
</>
|
|
106
106
|
}
|
|
107
107
|
disabled={disabled}
|
|
108
|
+
onClick={onClick}
|
|
108
109
|
/>
|
|
109
110
|
))}
|
|
110
111
|
</Tabs.TabBar>
|