@cloud-ru/uikit-product-site-case-card 0.4.2 → 0.4.4

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/components/CaseCard/CaseCard.d.ts +19 -0
  3. package/dist/cjs/components/CaseCard/CaseCard.js +23 -0
  4. package/dist/cjs/components/CaseCard/index.d.ts +1 -0
  5. package/dist/cjs/components/CaseCard/index.js +17 -0
  6. package/dist/cjs/components/CaseCard/styles.module.css +69 -0
  7. package/dist/cjs/components/index.d.ts +1 -0
  8. package/dist/cjs/components/index.js +17 -0
  9. package/dist/cjs/helperComponents/SkeletonTextContainer.d.ts +1 -0
  10. package/dist/cjs/helperComponents/SkeletonTextContainer.js +12 -0
  11. package/dist/cjs/helperComponents/index.d.ts +1 -0
  12. package/dist/cjs/helperComponents/index.js +5 -0
  13. package/dist/cjs/helperComponents/styles.module.css +18 -0
  14. package/dist/cjs/index.d.ts +1 -0
  15. package/dist/cjs/index.js +17 -0
  16. package/dist/esm/components/CaseCard/CaseCard.d.ts +19 -0
  17. package/dist/esm/components/CaseCard/CaseCard.js +17 -0
  18. package/dist/esm/components/CaseCard/index.d.ts +1 -0
  19. package/dist/esm/components/CaseCard/index.js +1 -0
  20. package/dist/esm/components/CaseCard/styles.module.css +69 -0
  21. package/dist/esm/components/index.d.ts +1 -0
  22. package/dist/esm/components/index.js +1 -0
  23. package/dist/esm/helperComponents/SkeletonTextContainer.d.ts +1 -0
  24. package/dist/esm/helperComponents/SkeletonTextContainer.js +6 -0
  25. package/dist/esm/helperComponents/index.d.ts +1 -0
  26. package/dist/esm/helperComponents/index.js +1 -0
  27. package/dist/esm/helperComponents/styles.module.css +18 -0
  28. package/dist/esm/index.d.ts +1 -0
  29. package/dist/esm/index.js +1 -0
  30. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
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
+ ## 0.4.4 (2025-11-13)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
10
+
11
+
12
+
13
+
14
+
15
+ ## 0.4.3 (2025-11-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
21
+
22
+
23
+
24
+
25
+
6
26
  ## 0.4.2 (2025-11-12)
7
27
 
8
28
  ### Only dependencies have been changed
@@ -0,0 +1,19 @@
1
+ import { MouseEvent } from 'react';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ export type CaseCardProps = WithLayoutType<{
4
+ /** Ссылка на img логотип */
5
+ img: string;
6
+ /** Ссылка переход по нажатию на карточку */
7
+ href?: string;
8
+ /** Список категорий */
9
+ categories?: Array<string>;
10
+ /** Флаг показа или скрытия списка категорий */
11
+ visibleCategories?: boolean;
12
+ /** Описание, где выделенные слова помечаются тегом <mark></mark> */
13
+ description: string;
14
+ /** Состояние загрузки */
15
+ loading?: boolean;
16
+ /** Событие клика на карточку */
17
+ onClick?(e: MouseEvent<HTMLDivElement | HTMLAnchorElement>): void;
18
+ }>;
19
+ export declare function CaseCard({ layoutType, img, description, categories, href, visibleCategories, onClick, loading, }: CaseCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CaseCard = CaseCard;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const card_1 = require("@snack-uikit/card");
9
+ const skeleton_1 = require("@snack-uikit/skeleton");
10
+ const typography_1 = require("@snack-uikit/typography");
11
+ const helperComponents_1 = require("../../helperComponents");
12
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
13
+ const SIZE_CARD_LAYOUT_TYPE = {
14
+ mobile: 'm',
15
+ tablet: 'm',
16
+ desktop: 'l',
17
+ desktopSmall: 'l',
18
+ };
19
+ function CaseCard({ layoutType, img, description, categories, href, visibleCategories = true, onClick, loading, }) {
20
+ const categoryTextSize = layoutType === 'desktop' || layoutType === 'desktopSmall' ? 'm' : 's';
21
+ const descriptionTextSize = layoutType === 'mobile' ? 's' : 'm';
22
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { href: href, onClick: onClick, size: SIZE_CARD_LAYOUT_TYPE[layoutType], children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: loading, className: styles_module_scss_1.default.skeletonIcon, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("img", { src: img, className: styles_module_scss_1.default.image, alt: 'img', "data-layout-type": layoutType }) }) }), loading ? ((0, jsx_runtime_1.jsx)(helperComponents_1.SkeletonTextContainer, {})) : ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textContainer, children: [visibleCategories && categories && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.categoryGroup, children: categories.map(item => ((0, jsx_runtime_1.jsx)(typography_1.Typography, { family: 'sans', purpose: 'body', size: categoryTextSize, className: styles_module_scss_1.default.category, children: item }, item))) })), (0, jsx_runtime_1.jsx)(typography_1.Typography, { family: 'sans', purpose: 'title', size: descriptionTextSize, className: styles_module_scss_1.default.description, children: (0, jsx_runtime_1.jsx)("span", { dangerouslySetInnerHTML: { __html: description }, "data-layout-type": layoutType }) })] }))] }) }));
23
+ }
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CaseCard"), exports);
@@ -0,0 +1,69 @@
1
+ @charset "UTF-8";
2
+ .container{
3
+ box-sizing:border-box;
4
+ width:100%;
5
+ height:216px;
6
+ background:var(--sys-neutral-background2-level, #ffffff);
7
+ display:flex;
8
+ justify-content:space-between;
9
+ flex-direction:column;
10
+ }
11
+ .container[data-layout-type=tablet]{
12
+ height:232px;
13
+ }
14
+ .container[data-layout-type=mobile]{
15
+ height:192px;
16
+ }
17
+
18
+ .image{
19
+ height:46px;
20
+ }
21
+ .image[data-layout-type=mobile]{
22
+ height:42px;
23
+ }
24
+
25
+ .categoryGroup{
26
+ display:flex;
27
+ flex-direction:row;
28
+ gap:4px;
29
+ align-items:center;
30
+ flex-wrap:wrap;
31
+ }
32
+
33
+ .category{
34
+ color:var(--sys-neutral-text-support, #6d707f);
35
+ }
36
+ .category:not(:last-child)::after{
37
+ content:"·";
38
+ margin-left:4px;
39
+ color:var(--sys-neutral-text-support, #6d707f);
40
+ }
41
+
42
+ .textContainer{
43
+ display:flex;
44
+ flex-direction:column;
45
+ gap:4px;
46
+ }
47
+
48
+ .description{
49
+ color:var(--sys-neutral-text-main, #41424e);
50
+ }
51
+ .description mark{
52
+ color:var(--sys-primary-text-light, #6aaf90);
53
+ background-color:unset;
54
+ }
55
+ .description span{
56
+ display:-webkit-box;
57
+ overflow:hidden;
58
+ text-overflow:ellipsis;
59
+ -webkit-line-clamp:3;
60
+ -webkit-box-orient:vertical;
61
+ }
62
+ .description span[data-layout-type=mobile]{
63
+ -webkit-line-clamp:5;
64
+ }
65
+
66
+ .skeletonIcon{
67
+ width:120px;
68
+ height:40px;
69
+ }
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CaseCard"), exports);
@@ -0,0 +1 @@
1
+ export declare function SkeletonTextContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SkeletonTextContainer = SkeletonTextContainer;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const skeleton_1 = require("@snack-uikit/skeleton");
9
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
10
+ function SkeletonTextContainer() {
11
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.root, children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: 124, className: styles_module_scss_1.default.skeletonItems }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, className: styles_module_scss_1.default.skeletonTitle }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: 200, className: styles_module_scss_1.default.skeletonText })] }));
12
+ }
@@ -0,0 +1 @@
1
+ export { SkeletonTextContainer } from './SkeletonTextContainer';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SkeletonTextContainer = void 0;
4
+ var SkeletonTextContainer_1 = require("./SkeletonTextContainer");
5
+ Object.defineProperty(exports, "SkeletonTextContainer", { enumerable: true, get: function () { return SkeletonTextContainer_1.SkeletonTextContainer; } });
@@ -0,0 +1,18 @@
1
+ .root{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:8px;
5
+ }
6
+
7
+ .skeletonItems{
8
+ height:12px;
9
+ }
10
+
11
+ .skeletonText{
12
+ height:14px;
13
+ }
14
+
15
+ .skeletonTitle{
16
+ width:100%;
17
+ height:14px;
18
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components"), exports);
@@ -0,0 +1,19 @@
1
+ import { MouseEvent } from 'react';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ export type CaseCardProps = WithLayoutType<{
4
+ /** Ссылка на img логотип */
5
+ img: string;
6
+ /** Ссылка переход по нажатию на карточку */
7
+ href?: string;
8
+ /** Список категорий */
9
+ categories?: Array<string>;
10
+ /** Флаг показа или скрытия списка категорий */
11
+ visibleCategories?: boolean;
12
+ /** Описание, где выделенные слова помечаются тегом <mark></mark> */
13
+ description: string;
14
+ /** Состояние загрузки */
15
+ loading?: boolean;
16
+ /** Событие клика на карточку */
17
+ onClick?(e: MouseEvent<HTMLDivElement | HTMLAnchorElement>): void;
18
+ }>;
19
+ export declare function CaseCard({ layoutType, img, description, categories, href, visibleCategories, onClick, loading, }: CaseCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card } from '@snack-uikit/card';
3
+ import { Skeleton } from '@snack-uikit/skeleton';
4
+ import { Typography } from '@snack-uikit/typography';
5
+ import { SkeletonTextContainer } from '../../helperComponents';
6
+ import styles from './styles.module.css';
7
+ const SIZE_CARD_LAYOUT_TYPE = {
8
+ mobile: 'm',
9
+ tablet: 'm',
10
+ desktop: 'l',
11
+ desktopSmall: 'l',
12
+ };
13
+ export function CaseCard({ layoutType, img, description, categories, href, visibleCategories = true, onClick, loading, }) {
14
+ const categoryTextSize = layoutType === 'desktop' || layoutType === 'desktopSmall' ? 'm' : 's';
15
+ const descriptionTextSize = layoutType === 'mobile' ? 's' : 'm';
16
+ return (_jsx(Card, { href: href, onClick: onClick, size: SIZE_CARD_LAYOUT_TYPE[layoutType], children: _jsxs("div", { className: styles.container, "data-layout-type": layoutType, children: [_jsx(Skeleton, { loading: loading, className: styles.skeletonIcon, children: _jsx("div", { children: _jsx("img", { src: img, className: styles.image, alt: 'img', "data-layout-type": layoutType }) }) }), loading ? (_jsx(SkeletonTextContainer, {})) : (_jsxs("div", { className: styles.textContainer, children: [visibleCategories && categories && (_jsx("div", { className: styles.categoryGroup, children: categories.map(item => (_jsx(Typography, { family: 'sans', purpose: 'body', size: categoryTextSize, className: styles.category, children: item }, item))) })), _jsx(Typography, { family: 'sans', purpose: 'title', size: descriptionTextSize, className: styles.description, children: _jsx("span", { dangerouslySetInnerHTML: { __html: description }, "data-layout-type": layoutType }) })] }))] }) }));
17
+ }
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1,69 @@
1
+ @charset "UTF-8";
2
+ .container{
3
+ box-sizing:border-box;
4
+ width:100%;
5
+ height:216px;
6
+ background:var(--sys-neutral-background2-level, #ffffff);
7
+ display:flex;
8
+ justify-content:space-between;
9
+ flex-direction:column;
10
+ }
11
+ .container[data-layout-type=tablet]{
12
+ height:232px;
13
+ }
14
+ .container[data-layout-type=mobile]{
15
+ height:192px;
16
+ }
17
+
18
+ .image{
19
+ height:46px;
20
+ }
21
+ .image[data-layout-type=mobile]{
22
+ height:42px;
23
+ }
24
+
25
+ .categoryGroup{
26
+ display:flex;
27
+ flex-direction:row;
28
+ gap:4px;
29
+ align-items:center;
30
+ flex-wrap:wrap;
31
+ }
32
+
33
+ .category{
34
+ color:var(--sys-neutral-text-support, #6d707f);
35
+ }
36
+ .category:not(:last-child)::after{
37
+ content:"·";
38
+ margin-left:4px;
39
+ color:var(--sys-neutral-text-support, #6d707f);
40
+ }
41
+
42
+ .textContainer{
43
+ display:flex;
44
+ flex-direction:column;
45
+ gap:4px;
46
+ }
47
+
48
+ .description{
49
+ color:var(--sys-neutral-text-main, #41424e);
50
+ }
51
+ .description mark{
52
+ color:var(--sys-primary-text-light, #6aaf90);
53
+ background-color:unset;
54
+ }
55
+ .description span{
56
+ display:-webkit-box;
57
+ overflow:hidden;
58
+ text-overflow:ellipsis;
59
+ -webkit-line-clamp:3;
60
+ -webkit-box-orient:vertical;
61
+ }
62
+ .description span[data-layout-type=mobile]{
63
+ -webkit-line-clamp:5;
64
+ }
65
+
66
+ .skeletonIcon{
67
+ width:120px;
68
+ height:40px;
69
+ }
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1 @@
1
+ export * from './CaseCard';
@@ -0,0 +1 @@
1
+ export declare function SkeletonTextContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Skeleton } from '@snack-uikit/skeleton';
3
+ import styles from './styles.module.css';
4
+ export function SkeletonTextContainer() {
5
+ return (_jsxs("div", { className: styles.root, children: [_jsx(Skeleton, { loading: true, width: 124, className: styles.skeletonItems }), _jsx(Skeleton, { loading: true, className: styles.skeletonTitle }), _jsx(Skeleton, { loading: true, width: 200, className: styles.skeletonText })] }));
6
+ }
@@ -0,0 +1 @@
1
+ export { SkeletonTextContainer } from './SkeletonTextContainer';
@@ -0,0 +1 @@
1
+ export { SkeletonTextContainer } from './SkeletonTextContainer';
@@ -0,0 +1,18 @@
1
+ .root{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:8px;
5
+ }
6
+
7
+ .skeletonItems{
8
+ height:12px;
9
+ }
10
+
11
+ .skeletonText{
12
+ height:14px;
13
+ }
14
+
15
+ .skeletonTitle{
16
+ width:100%;
17
+ height:14px;
18
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export * from './components';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-site-case-card",
3
3
  "title": "Site-case-card",
4
- "version": "0.4.2",
4
+ "version": "0.4.4",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -30,13 +30,14 @@
30
30
  "name": "Akhremenko Grigorii",
31
31
  "url": "https://github.com/AGrigorii"
32
32
  },
33
+ "contributors": [],
33
34
  "license": "Apache-2.0",
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
38
  "scripts": {},
38
39
  "dependencies": {
39
- "@cloud-ru/uikit-product-utils": "7.0.0",
40
+ "@cloud-ru/uikit-product-utils": "7.0.2",
40
41
  "@snack-uikit/card": "0.20.4",
41
42
  "@snack-uikit/skeleton": "0.6.9",
42
43
  "@snack-uikit/typography": "0.8.10"
@@ -44,5 +45,5 @@
44
45
  "devDependencies": {
45
46
  "@sbercloud/figma-tokens-cloud-platform": "17.7.6"
46
47
  },
47
- "gitHead": "e8bd79bc92b26a8f52611972eec98a867536ccd3"
48
+ "gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
48
49
  }