@cloud-ru/uikit-product-site-section 1.7.2 → 1.7.3-preview-60bc6ea0.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 +1 -1
- package/dist/cjs/components/SectionClientsCarousel/SectionClientsCarousel.js +2 -1
- package/dist/cjs/constants.d.ts +2 -0
- package/dist/cjs/constants.js +6 -1
- package/dist/cjs/helperComponents/CardClient/CardClient.d.ts +3 -1
- package/dist/cjs/helperComponents/CardClient/CardClient.js +2 -2
- package/dist/cjs/helperComponents/CardClient/styles.module.css +5 -0
- package/dist/esm/components/SectionClientsCarousel/SectionClientsCarousel.js +2 -1
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +5 -0
- package/dist/esm/helperComponents/CardClient/CardClient.d.ts +3 -1
- package/dist/esm/helperComponents/CardClient/CardClient.js +2 -2
- package/dist/esm/helperComponents/CardClient/styles.module.css +5 -0
- package/package.json +2 -2
- package/src/components/SectionClientsCarousel/SectionClientsCarousel.tsx +6 -1
- package/src/constants.ts +8 -0
- package/src/helperComponents/CardClient/CardClient.tsx +4 -2
- package/src/helperComponents/CardClient/styles.module.scss +8 -1
- package/src/helperComponents/SectionCarousel/styles.module.scss +0 -3
package/README.md
CHANGED
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
| layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
328
328
|
| title | `string` | - | Название секции |
|
|
329
329
|
| subtitle | `string` | - | Подзаголовок секции |
|
|
330
|
-
| titleLink | `PickLinkProps<(<T extends ElementType = "a">({ text, className, textMode, size, purpose, appearance, insideText, truncateVariant, as, ...rest }: LinkProps<T>) => Element), "onClick" \| "appearance" \| "href" \| "target" \| "textMode">` | - | Ссылка в названии |
|
|
330
|
+
| titleLink | `PickLinkProps<(<T extends ElementType = "a">({ text, className, textMode, size, purpose, appearance, insideText, truncateVariant, truncateMaxLines, as, ...rest }: LinkProps<T>) => Element), "onClick" \| "appearance" \| "href" \| "target" \| "textMode">` | - | Ссылка в названии |
|
|
331
331
|
| description | `string` | - | Описание секции |
|
|
332
332
|
| titleSectionSize | enum Size: `"s"`, `"m"`, `"l"` | - | Размер шрифтов заголовка и подзаголовка |
|
|
333
333
|
| titleTag | enum SectionTag: `"h2"`, `"h3"`, `"h4"` | - | Тег заголовка |
|
|
@@ -15,10 +15,11 @@ exports.SectionClientsCarousel = SectionClientsCarousel;
|
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
const react_1 = require("react");
|
|
17
17
|
const figma_tokens_1 = require("@snack-uikit/figma-tokens");
|
|
18
|
+
const constants_1 = require("../../constants");
|
|
18
19
|
const helperComponents_1 = require("../../helperComponents");
|
|
19
20
|
const utils_1 = require("./utils");
|
|
20
21
|
function SectionClientsCarousel(_a) {
|
|
21
22
|
var { items } = _a, props = __rest(_a, ["items"]);
|
|
22
23
|
const carouselProps = (0, react_1.useMemo)(() => (0, utils_1.getCarouselProps)(props.layoutType), [props.layoutType]);
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(helperComponents_1.SectionCarousel, Object.assign({ autoSwipe: 0 }, props, carouselProps, { gap: figma_tokens_1.themeVars.dimension['025m'], children: items.map(item => ((0, jsx_runtime_1.jsx)(helperComponents_1.CardClient, Object.assign({}, item), item.alt))) })));
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(helperComponents_1.SectionCarousel, Object.assign({ autoSwipe: 0 }, props, carouselProps, { gap: figma_tokens_1.themeVars.dimension['025m'], children: items.map(item => ((0, jsx_runtime_1.jsx)(helperComponents_1.CardClient, Object.assign({}, item, { backgroundColor: props.backgroundColor && constants_1.SECTION_COLORS_INVERTED[props.backgroundColor] }), item.alt))) })));
|
|
24
25
|
}
|
package/dist/cjs/constants.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { SectionColor } from './types';
|
|
1
2
|
export declare const SECTION_COLORS: {
|
|
2
3
|
readonly NeutralBackground1Level: "neutral-background1-level";
|
|
3
4
|
readonly NeutralBackground: "neutral-background";
|
|
4
5
|
readonly GraphiteAccentDefault: "graphite-accent-default";
|
|
5
6
|
};
|
|
7
|
+
export declare const SECTION_COLORS_INVERTED: Record<SectionColor, SectionColor>;
|
package/dist/cjs/constants.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SECTION_COLORS = void 0;
|
|
3
|
+
exports.SECTION_COLORS_INVERTED = exports.SECTION_COLORS = void 0;
|
|
4
4
|
exports.SECTION_COLORS = {
|
|
5
5
|
NeutralBackground1Level: 'neutral-background1-level',
|
|
6
6
|
NeutralBackground: 'neutral-background',
|
|
7
7
|
GraphiteAccentDefault: 'graphite-accent-default',
|
|
8
8
|
};
|
|
9
|
+
exports.SECTION_COLORS_INVERTED = {
|
|
10
|
+
[exports.SECTION_COLORS.NeutralBackground]: exports.SECTION_COLORS.NeutralBackground1Level,
|
|
11
|
+
[exports.SECTION_COLORS.NeutralBackground1Level]: exports.SECTION_COLORS.NeutralBackground,
|
|
12
|
+
[exports.SECTION_COLORS.GraphiteAccentDefault]: exports.SECTION_COLORS.NeutralBackground1Level,
|
|
13
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { SectionColor } from '../../../src/types';
|
|
1
2
|
export type CardClientProps = {
|
|
2
3
|
img: string;
|
|
3
4
|
alt: string;
|
|
5
|
+
backgroundColor?: SectionColor;
|
|
4
6
|
};
|
|
5
|
-
export declare function CardClient({ img, alt }: CardClientProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function CardClient({ img, alt, backgroundColor }: CardClientProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CardClient = CardClient;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
9
|
-
function CardClient({ img, alt }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.cardClient, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageBackground }), (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, src: img, alt: alt })] }));
|
|
9
|
+
function CardClient({ img, alt, backgroundColor = 'neutral-background' }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.cardClient, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.imageBackground, "data-background": backgroundColor }), (0, jsx_runtime_1.jsx)("img", { className: styles_module_scss_1.default.image, src: img, alt: alt })] }));
|
|
11
11
|
}
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
position:absolute;
|
|
12
12
|
width:100%;
|
|
13
13
|
height:100%;
|
|
14
|
+
}
|
|
15
|
+
.imageBackground[data-background=neutral-background1-level]{
|
|
16
|
+
background-color:var(--sys-neutral-background1-level, #fdfdfd);
|
|
17
|
+
}
|
|
18
|
+
.imageBackground[data-background=neutral-background]{
|
|
14
19
|
background-color:var(--sys-neutral-background, #eeeff3);
|
|
15
20
|
}
|
|
16
21
|
|
|
@@ -12,10 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
14
|
import { themeVars } from '@snack-uikit/figma-tokens';
|
|
15
|
+
import { SECTION_COLORS_INVERTED } from '../../constants';
|
|
15
16
|
import { CardClient, SectionCarousel } from '../../helperComponents';
|
|
16
17
|
import { getCarouselProps } from './utils';
|
|
17
18
|
export function SectionClientsCarousel(_a) {
|
|
18
19
|
var { items } = _a, props = __rest(_a, ["items"]);
|
|
19
20
|
const carouselProps = useMemo(() => getCarouselProps(props.layoutType), [props.layoutType]);
|
|
20
|
-
return (_jsx(SectionCarousel, Object.assign({ autoSwipe: 0 }, props, carouselProps, { gap: themeVars.dimension['025m'], children: items.map(item => (_jsx(CardClient, Object.assign({}, item), item.alt))) })));
|
|
21
|
+
return (_jsx(SectionCarousel, Object.assign({ autoSwipe: 0 }, props, carouselProps, { gap: themeVars.dimension['025m'], children: items.map(item => (_jsx(CardClient, Object.assign({}, item, { backgroundColor: props.backgroundColor && SECTION_COLORS_INVERTED[props.backgroundColor] }), item.alt))) })));
|
|
21
22
|
}
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { SectionColor } from './types';
|
|
1
2
|
export declare const SECTION_COLORS: {
|
|
2
3
|
readonly NeutralBackground1Level: "neutral-background1-level";
|
|
3
4
|
readonly NeutralBackground: "neutral-background";
|
|
4
5
|
readonly GraphiteAccentDefault: "graphite-accent-default";
|
|
5
6
|
};
|
|
7
|
+
export declare const SECTION_COLORS_INVERTED: Record<SectionColor, SectionColor>;
|
package/dist/esm/constants.js
CHANGED
|
@@ -3,3 +3,8 @@ export const SECTION_COLORS = {
|
|
|
3
3
|
NeutralBackground: 'neutral-background',
|
|
4
4
|
GraphiteAccentDefault: 'graphite-accent-default',
|
|
5
5
|
};
|
|
6
|
+
export const SECTION_COLORS_INVERTED = {
|
|
7
|
+
[SECTION_COLORS.NeutralBackground]: SECTION_COLORS.NeutralBackground1Level,
|
|
8
|
+
[SECTION_COLORS.NeutralBackground1Level]: SECTION_COLORS.NeutralBackground,
|
|
9
|
+
[SECTION_COLORS.GraphiteAccentDefault]: SECTION_COLORS.NeutralBackground1Level,
|
|
10
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { SectionColor } from '../../../src/types';
|
|
1
2
|
export type CardClientProps = {
|
|
2
3
|
img: string;
|
|
3
4
|
alt: string;
|
|
5
|
+
backgroundColor?: SectionColor;
|
|
4
6
|
};
|
|
5
|
-
export declare function CardClient({ img, alt }: CardClientProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function CardClient({ img, alt, backgroundColor }: CardClientProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styles from './styles.module.css';
|
|
3
|
-
export function CardClient({ img, alt }) {
|
|
4
|
-
return (_jsxs("div", { className: styles.cardClient, children: [_jsx("div", { className: styles.imageBackground }), _jsx("img", { className: styles.image, src: img, alt: alt })] }));
|
|
3
|
+
export function CardClient({ img, alt, backgroundColor = 'neutral-background' }) {
|
|
4
|
+
return (_jsxs("div", { className: styles.cardClient, children: [_jsx("div", { className: styles.imageBackground, "data-background": backgroundColor }), _jsx("img", { className: styles.image, src: img, alt: alt })] }));
|
|
5
5
|
}
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
position:absolute;
|
|
12
12
|
width:100%;
|
|
13
13
|
height:100%;
|
|
14
|
+
}
|
|
15
|
+
.imageBackground[data-background=neutral-background1-level]{
|
|
16
|
+
background-color:var(--sys-neutral-background1-level, #fdfdfd);
|
|
17
|
+
}
|
|
18
|
+
.imageBackground[data-background=neutral-background]{
|
|
14
19
|
background-color:var(--sys-neutral-background, #eeeff3);
|
|
15
20
|
}
|
|
16
21
|
|
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.7.
|
|
4
|
+
"version": "1.7.3-preview-60bc6ea0.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": "9eb320b64114557b5e4f1b83cab58ea971fddcce"
|
|
71
71
|
}
|
|
@@ -2,6 +2,7 @@ import { useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { themeVars } from '@snack-uikit/figma-tokens';
|
|
4
4
|
|
|
5
|
+
import { SECTION_COLORS_INVERTED } from '../../constants';
|
|
5
6
|
import { CardClient, CardClientProps, LimitedSectionCarouselProps, SectionCarousel } from '../../helperComponents';
|
|
6
7
|
import { getCarouselProps } from './utils';
|
|
7
8
|
|
|
@@ -16,7 +17,11 @@ export function SectionClientsCarousel({ items, ...props }: SectionClientsCarous
|
|
|
16
17
|
return (
|
|
17
18
|
<SectionCarousel autoSwipe={0} {...props} {...carouselProps} gap={themeVars.dimension['025m']}>
|
|
18
19
|
{items.map(item => (
|
|
19
|
-
<CardClient
|
|
20
|
+
<CardClient
|
|
21
|
+
key={item.alt}
|
|
22
|
+
{...item}
|
|
23
|
+
backgroundColor={props.backgroundColor && SECTION_COLORS_INVERTED[props.backgroundColor]}
|
|
24
|
+
/>
|
|
20
25
|
))}
|
|
21
26
|
</SectionCarousel>
|
|
22
27
|
);
|
package/src/constants.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { SectionColor } from './types';
|
|
2
|
+
|
|
1
3
|
export const SECTION_COLORS = {
|
|
2
4
|
NeutralBackground1Level: 'neutral-background1-level',
|
|
3
5
|
NeutralBackground: 'neutral-background',
|
|
4
6
|
GraphiteAccentDefault: 'graphite-accent-default',
|
|
5
7
|
} as const;
|
|
8
|
+
|
|
9
|
+
export const SECTION_COLORS_INVERTED: Record<SectionColor, SectionColor> = {
|
|
10
|
+
[SECTION_COLORS.NeutralBackground]: SECTION_COLORS.NeutralBackground1Level,
|
|
11
|
+
[SECTION_COLORS.NeutralBackground1Level]: SECTION_COLORS.NeutralBackground,
|
|
12
|
+
[SECTION_COLORS.GraphiteAccentDefault]: SECTION_COLORS.NeutralBackground1Level,
|
|
13
|
+
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { SectionColor } from '../../../src/types';
|
|
1
2
|
import styles from './styles.module.scss';
|
|
2
3
|
|
|
3
4
|
export type CardClientProps = {
|
|
4
5
|
img: string;
|
|
5
6
|
alt: string;
|
|
7
|
+
backgroundColor?: SectionColor;
|
|
6
8
|
};
|
|
7
9
|
|
|
8
|
-
export function CardClient({ img, alt }: CardClientProps) {
|
|
10
|
+
export function CardClient({ img, alt, backgroundColor = 'neutral-background' }: CardClientProps) {
|
|
9
11
|
return (
|
|
10
12
|
<div className={styles.cardClient}>
|
|
11
|
-
<div className={styles.imageBackground} />
|
|
13
|
+
<div className={styles.imageBackground} data-background={backgroundColor} />
|
|
12
14
|
<img className={styles.image} src={img} alt={alt} />
|
|
13
15
|
</div>
|
|
14
16
|
);
|
|
@@ -13,7 +13,14 @@
|
|
|
13
13
|
position: absolute;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
&[data-background='neutral-background1-level'] {
|
|
18
|
+
background-color: var.$sys-neutral-background1-level;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-background='neutral-background'] {
|
|
22
|
+
background-color: var.$sys-neutral-background;
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
.image {
|