@cloud-ru/ds-uikit-product-card-predefined 3.1.5 → 3.1.7-preview-71f1139f.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 +4 -0
- package/dist/cjs/components/CardServiceInfo/styles.module.css +5 -0
- package/dist/cjs/components/CardServiceLight/CardServiceLight.js +1 -4
- package/dist/cjs/components/CardServiceLight/styles.module.css +5 -5
- package/dist/cjs/style.css +10 -5
- package/dist/esm/components/CardServiceInfo/styles.module.css +5 -0
- package/dist/esm/components/CardServiceLight/CardServiceLight.js +1 -4
- package/dist/esm/components/CardServiceLight/styles.module.css +5 -5
- package/dist/esm/style.css +10 -5
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +17 -18
- package/src/components/CardServiceInfo/styles.module.scss +7 -0
- package/src/components/CardServiceLight/CardServiceLight.tsx +2 -5
- package/src/components/CardServiceLight/styles.module.scss +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
## 3.1.6 (2026-09-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ds/uikit-product-card-predefined
|
|
9
|
+
|
|
6
10
|
## 3.1.5 (2026-09-28)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @ds/uikit-product-card-predefined
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
--card-actions-surface-inset-top:var(--sn-primitive-dimension-4, 4px);
|
|
3
3
|
--card-actions-surface-inset-right:var(--sn-primitive-dimension-4, 4px);
|
|
4
4
|
}
|
|
5
|
+
.actions[data-actions-visibility=always]{
|
|
6
|
+
position:absolute;
|
|
7
|
+
top:var(--card-actions-surface-inset-top);
|
|
8
|
+
right:var(--card-actions-surface-inset-right);
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
.titleContainer{
|
|
7
12
|
display:flex;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CardServiceLight = CardServiceLight;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const adaptive_1 = require("@cloud-ru/ds-adaptive");
|
|
9
8
|
const theme_1 = require("@cloud-ru/ds-theme");
|
|
10
9
|
const truncate_string_1 = require("@cloud-ru/ds-truncate-string");
|
|
11
10
|
const typography_1 = require("@cloud-ru/ds-typography");
|
|
@@ -18,8 +17,6 @@ const helperComponents_1 = require("../../helperComponents");
|
|
|
18
17
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
19
18
|
const TARGET_BLANK = '_blank';
|
|
20
19
|
function CardServiceLight({ as, innerRef, icon, title, promoTag, truncate, actionsVisibility: actionsVisibilityProp, favorite, tooltip, className, disabled = false, expandable, 'data-test-id': dataTestId, ...rest }) {
|
|
21
|
-
const { layoutType } = (0, adaptive_1.useAdaptiveLayout)();
|
|
22
|
-
const isMobile = (0, adaptive_1.isMobileLayout)(layoutType);
|
|
23
20
|
const Component = as ?? 'button';
|
|
24
21
|
const cardRef = (0, react_1.useRef)(null);
|
|
25
22
|
const tooltipTriggerRef = (0, react_1.useRef)(null);
|
|
@@ -91,7 +88,7 @@ function CardServiceLight({ as, innerRef, icon, title, promoTag, truncate, actio
|
|
|
91
88
|
: onClick,
|
|
92
89
|
};
|
|
93
90
|
}
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)(Component, { ref: (0, merge_refs_1.default)(innerRef, cardRef), className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": dataTestId ?? constants_1.TEST_IDS.cardServiceLight, "data-disabled": disabled || undefined, "aria-disabled": Component !== 'button' && disabled ? true : undefined, tabIndex: Component !== 'button' && disabled ? -1 : undefined, onKeyDown: handleKeyDown, "data-tooltip-open": isTooltipOpen || undefined, ...polymorphicProps, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.stateLayer, "data-state": 'emptyNeutralOnBackground', "aria-hidden": true }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container,
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(Component, { ref: (0, merge_refs_1.default)(innerRef, cardRef), className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": dataTestId ?? constants_1.TEST_IDS.cardServiceLight, "data-disabled": disabled || undefined, "aria-disabled": Component !== 'button' && disabled ? true : undefined, tabIndex: Component !== 'button' && disabled ? -1 : undefined, onKeyDown: handleKeyDown, "data-tooltip-open": isTooltipOpen || undefined, ...polymorphicProps, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.stateLayer, "data-state": 'emptyNeutralOnBackground', "aria-hidden": true }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, children: [icon && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.icon, children: icon }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { as: 'span', variant: 'body', size: 'm', className: styles_module_scss_1.default.title, "data-test-id": constants_1.TEST_IDS.cardServiceLightTitle, children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: title, maxLines: truncate?.title, variant: 'end' }) }), promoTag && ((0, jsx_runtime_1.jsx)(helperComponents_1.CardPromoTag, { promoTag: promoTag, tooltipTrigger: tooltipTrigger, innerRef: promoTagTooltipTriggerRef, "data-test-id": constants_1.TEST_IDS.cardServiceLightPromoTag, className: compactThemeClassName }))] })] }), (0, jsx_runtime_1.jsx)(helperComponents_1.CardActionsSurface, { actionsSize: 'm', actionsVisibility: actionsVisibility, className: styles_module_scss_1.default.cardActions, onTooltipOpenChange: setIsTooltipOpen, tooltip: tooltip
|
|
95
92
|
? {
|
|
96
93
|
...tooltip,
|
|
97
94
|
'data-test-id': constants_1.TEST_IDS.cardServiceLightTooltip,
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
visibility:initial;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.cardActions{
|
|
7
|
+
margin-left:var(--sn-primitive-dimension-4, 4px);
|
|
8
|
+
}
|
|
6
9
|
.cardActions[data-actions-visibility=always]{
|
|
7
10
|
position:relative;
|
|
8
11
|
}
|
|
@@ -12,8 +15,8 @@
|
|
|
12
15
|
position:relative;
|
|
13
16
|
display:flex;
|
|
14
17
|
align-items:center;
|
|
18
|
+
box-sizing:border-box;
|
|
15
19
|
width:100%;
|
|
16
|
-
min-width:228px;
|
|
17
20
|
padding:0;
|
|
18
21
|
border:none;
|
|
19
22
|
border-radius:var(--sn-density-radius-3xs, var(--sn-platform-comfort-radius-3xs, var(--sn-primitive-dimension-2, 2px)));
|
|
@@ -32,7 +35,7 @@
|
|
|
32
35
|
}
|
|
33
36
|
.root:focus-visible{
|
|
34
37
|
outline:var(--sn-theme-color-primary-accent, var(--sn-brand-color-primary-50, #389f74)) solid var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
35
|
-
outline-offset:
|
|
38
|
+
outline-offset:calc(-1 * var(--sn-primitive-strokeWeight-strokeSemiBold, 2px));
|
|
36
39
|
}
|
|
37
40
|
.root:not([data-disabled]):hover .cardActions, .root:not([data-disabled]):focus-visible .cardActions, .root:not([data-disabled])[data-tooltip-open] .cardActions, .root:not([data-disabled]):has(*:focus-visible) .cardActions{
|
|
38
41
|
position:relative;
|
|
@@ -134,9 +137,6 @@
|
|
|
134
137
|
padding:var(--sn-primitive-dimension-4, 4px);
|
|
135
138
|
border-radius:inherit;
|
|
136
139
|
}
|
|
137
|
-
.container[data-mobile]{
|
|
138
|
-
min-height:var(--sn-primitive-dimension-40, 40px);
|
|
139
|
-
}
|
|
140
140
|
|
|
141
141
|
.icon{
|
|
142
142
|
flex-shrink:0;
|
package/dist/cjs/style.css
CHANGED
|
@@ -388,6 +388,11 @@
|
|
|
388
388
|
--card-actions-surface-inset-top:var(--sn-primitive-dimension-4, 4px);
|
|
389
389
|
--card-actions-surface-inset-right:var(--sn-primitive-dimension-4, 4px);
|
|
390
390
|
}
|
|
391
|
+
.actions[data-actions-visibility=always]{
|
|
392
|
+
position:absolute;
|
|
393
|
+
top:var(--card-actions-surface-inset-top);
|
|
394
|
+
right:var(--card-actions-surface-inset-right);
|
|
395
|
+
}
|
|
391
396
|
|
|
392
397
|
.titleContainer{
|
|
393
398
|
display:flex;
|
|
@@ -490,6 +495,9 @@
|
|
|
490
495
|
visibility:initial;
|
|
491
496
|
}
|
|
492
497
|
|
|
498
|
+
.cardActions{
|
|
499
|
+
margin-left:var(--sn-primitive-dimension-4, 4px);
|
|
500
|
+
}
|
|
493
501
|
.cardActions[data-actions-visibility=always]{
|
|
494
502
|
position:relative;
|
|
495
503
|
}
|
|
@@ -499,8 +507,8 @@
|
|
|
499
507
|
position:relative;
|
|
500
508
|
display:flex;
|
|
501
509
|
align-items:center;
|
|
510
|
+
box-sizing:border-box;
|
|
502
511
|
width:100%;
|
|
503
|
-
min-width:228px;
|
|
504
512
|
padding:0;
|
|
505
513
|
border:none;
|
|
506
514
|
border-radius:var(--sn-density-radius-3xs, var(--sn-platform-comfort-radius-3xs, var(--sn-primitive-dimension-2, 2px)));
|
|
@@ -519,7 +527,7 @@
|
|
|
519
527
|
}
|
|
520
528
|
.root:focus-visible{
|
|
521
529
|
outline:var(--sn-theme-color-primary-accent, var(--sn-brand-color-primary-50, #389f74)) solid var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
522
|
-
outline-offset:
|
|
530
|
+
outline-offset:calc(-1 * var(--sn-primitive-strokeWeight-strokeSemiBold, 2px));
|
|
523
531
|
}
|
|
524
532
|
.root:not([data-disabled]):hover .cardActions, .root:not([data-disabled]):focus-visible .cardActions, .root:not([data-disabled])[data-tooltip-open] .cardActions, .root:not([data-disabled]):has(*:focus-visible) .cardActions{
|
|
525
533
|
position:relative;
|
|
@@ -621,9 +629,6 @@
|
|
|
621
629
|
padding:var(--sn-primitive-dimension-4, 4px);
|
|
622
630
|
border-radius:inherit;
|
|
623
631
|
}
|
|
624
|
-
.container[data-mobile]{
|
|
625
|
-
min-height:var(--sn-primitive-dimension-40, 40px);
|
|
626
|
-
}
|
|
627
632
|
|
|
628
633
|
.icon{
|
|
629
634
|
flex-shrink:0;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
--card-actions-surface-inset-top:var(--sn-primitive-dimension-4, 4px);
|
|
3
3
|
--card-actions-surface-inset-right:var(--sn-primitive-dimension-4, 4px);
|
|
4
4
|
}
|
|
5
|
+
.actions[data-actions-visibility=always]{
|
|
6
|
+
position:absolute;
|
|
7
|
+
top:var(--card-actions-surface-inset-top);
|
|
8
|
+
right:var(--card-actions-surface-inset-right);
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
.titleContainer{
|
|
7
12
|
display:flex;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isMobileLayout, useAdaptiveLayout } from '@cloud-ru/ds-adaptive';
|
|
3
2
|
import { useThemeClassnames } from '@cloud-ru/ds-theme';
|
|
4
3
|
import { TruncateString } from '@cloud-ru/ds-truncate-string';
|
|
5
4
|
import { Typography } from '@cloud-ru/ds-typography';
|
|
@@ -12,8 +11,6 @@ import { CardActionsSurface, CardPromoTag, createCardActionsKeyDownHandler } fro
|
|
|
12
11
|
import styles from './styles.module.css';
|
|
13
12
|
const TARGET_BLANK = '_blank';
|
|
14
13
|
export function CardServiceLight({ as, innerRef, icon, title, promoTag, truncate, actionsVisibility: actionsVisibilityProp, favorite, tooltip, className, disabled = false, expandable, 'data-test-id': dataTestId, ...rest }) {
|
|
15
|
-
const { layoutType } = useAdaptiveLayout();
|
|
16
|
-
const isMobile = isMobileLayout(layoutType);
|
|
17
14
|
const Component = as ?? 'button';
|
|
18
15
|
const cardRef = useRef(null);
|
|
19
16
|
const tooltipTriggerRef = useRef(null);
|
|
@@ -85,7 +82,7 @@ export function CardServiceLight({ as, innerRef, icon, title, promoTag, truncate
|
|
|
85
82
|
: onClick,
|
|
86
83
|
};
|
|
87
84
|
}
|
|
88
|
-
return (_jsxs(Component, { ref: mergeRefs(innerRef, cardRef), className: cn(styles.root, className), "data-test-id": dataTestId ?? TEST_IDS.cardServiceLight, "data-disabled": disabled || undefined, "aria-disabled": Component !== 'button' && disabled ? true : undefined, tabIndex: Component !== 'button' && disabled ? -1 : undefined, onKeyDown: handleKeyDown, "data-tooltip-open": isTooltipOpen || undefined, ...polymorphicProps, children: [_jsx("span", { className: styles.stateLayer, "data-state": 'emptyNeutralOnBackground', "aria-hidden": true }), _jsxs("div", { className: styles.container,
|
|
85
|
+
return (_jsxs(Component, { ref: mergeRefs(innerRef, cardRef), className: cn(styles.root, className), "data-test-id": dataTestId ?? TEST_IDS.cardServiceLight, "data-disabled": disabled || undefined, "aria-disabled": Component !== 'button' && disabled ? true : undefined, tabIndex: Component !== 'button' && disabled ? -1 : undefined, onKeyDown: handleKeyDown, "data-tooltip-open": isTooltipOpen || undefined, ...polymorphicProps, children: [_jsx("span", { className: styles.stateLayer, "data-state": 'emptyNeutralOnBackground', "aria-hidden": true }), _jsxs("div", { className: styles.container, children: [icon && _jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { className: styles.content, children: [_jsx(Typography, { as: 'span', variant: 'body', size: 'm', className: styles.title, "data-test-id": TEST_IDS.cardServiceLightTitle, children: _jsx(TruncateString, { text: title, maxLines: truncate?.title, variant: 'end' }) }), promoTag && (_jsx(CardPromoTag, { promoTag: promoTag, tooltipTrigger: tooltipTrigger, innerRef: promoTagTooltipTriggerRef, "data-test-id": TEST_IDS.cardServiceLightPromoTag, className: compactThemeClassName }))] })] }), _jsx(CardActionsSurface, { actionsSize: 'm', actionsVisibility: actionsVisibility, className: styles.cardActions, onTooltipOpenChange: setIsTooltipOpen, tooltip: tooltip
|
|
89
86
|
? {
|
|
90
87
|
...tooltip,
|
|
91
88
|
'data-test-id': TEST_IDS.cardServiceLightTooltip,
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
visibility:initial;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.cardActions{
|
|
7
|
+
margin-left:var(--sn-primitive-dimension-4, 4px);
|
|
8
|
+
}
|
|
6
9
|
.cardActions[data-actions-visibility=always]{
|
|
7
10
|
position:relative;
|
|
8
11
|
}
|
|
@@ -12,8 +15,8 @@
|
|
|
12
15
|
position:relative;
|
|
13
16
|
display:flex;
|
|
14
17
|
align-items:center;
|
|
18
|
+
box-sizing:border-box;
|
|
15
19
|
width:100%;
|
|
16
|
-
min-width:228px;
|
|
17
20
|
padding:0;
|
|
18
21
|
border:none;
|
|
19
22
|
border-radius:var(--sn-density-radius-3xs, var(--sn-platform-comfort-radius-3xs, var(--sn-primitive-dimension-2, 2px)));
|
|
@@ -32,7 +35,7 @@
|
|
|
32
35
|
}
|
|
33
36
|
.root:focus-visible{
|
|
34
37
|
outline:var(--sn-theme-color-primary-accent, var(--sn-brand-color-primary-50, #389f74)) solid var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
35
|
-
outline-offset:
|
|
38
|
+
outline-offset:calc(-1 * var(--sn-primitive-strokeWeight-strokeSemiBold, 2px));
|
|
36
39
|
}
|
|
37
40
|
.root:not([data-disabled]):hover .cardActions, .root:not([data-disabled]):focus-visible .cardActions, .root:not([data-disabled])[data-tooltip-open] .cardActions, .root:not([data-disabled]):has(*:focus-visible) .cardActions{
|
|
38
41
|
position:relative;
|
|
@@ -134,9 +137,6 @@
|
|
|
134
137
|
padding:var(--sn-primitive-dimension-4, 4px);
|
|
135
138
|
border-radius:inherit;
|
|
136
139
|
}
|
|
137
|
-
.container[data-mobile]{
|
|
138
|
-
min-height:var(--sn-primitive-dimension-40, 40px);
|
|
139
|
-
}
|
|
140
140
|
|
|
141
141
|
.icon{
|
|
142
142
|
flex-shrink:0;
|
package/dist/esm/style.css
CHANGED
|
@@ -388,6 +388,11 @@
|
|
|
388
388
|
--card-actions-surface-inset-top:var(--sn-primitive-dimension-4, 4px);
|
|
389
389
|
--card-actions-surface-inset-right:var(--sn-primitive-dimension-4, 4px);
|
|
390
390
|
}
|
|
391
|
+
.actions[data-actions-visibility=always]{
|
|
392
|
+
position:absolute;
|
|
393
|
+
top:var(--card-actions-surface-inset-top);
|
|
394
|
+
right:var(--card-actions-surface-inset-right);
|
|
395
|
+
}
|
|
391
396
|
|
|
392
397
|
.titleContainer{
|
|
393
398
|
display:flex;
|
|
@@ -490,6 +495,9 @@
|
|
|
490
495
|
visibility:initial;
|
|
491
496
|
}
|
|
492
497
|
|
|
498
|
+
.cardActions{
|
|
499
|
+
margin-left:var(--sn-primitive-dimension-4, 4px);
|
|
500
|
+
}
|
|
493
501
|
.cardActions[data-actions-visibility=always]{
|
|
494
502
|
position:relative;
|
|
495
503
|
}
|
|
@@ -499,8 +507,8 @@
|
|
|
499
507
|
position:relative;
|
|
500
508
|
display:flex;
|
|
501
509
|
align-items:center;
|
|
510
|
+
box-sizing:border-box;
|
|
502
511
|
width:100%;
|
|
503
|
-
min-width:228px;
|
|
504
512
|
padding:0;
|
|
505
513
|
border:none;
|
|
506
514
|
border-radius:var(--sn-density-radius-3xs, var(--sn-platform-comfort-radius-3xs, var(--sn-primitive-dimension-2, 2px)));
|
|
@@ -519,7 +527,7 @@
|
|
|
519
527
|
}
|
|
520
528
|
.root:focus-visible{
|
|
521
529
|
outline:var(--sn-theme-color-primary-accent, var(--sn-brand-color-primary-50, #389f74)) solid var(--sn-primitive-strokeWeight-strokeSemiBold, 2px);
|
|
522
|
-
outline-offset:
|
|
530
|
+
outline-offset:calc(-1 * var(--sn-primitive-strokeWeight-strokeSemiBold, 2px));
|
|
523
531
|
}
|
|
524
532
|
.root:not([data-disabled]):hover .cardActions, .root:not([data-disabled]):focus-visible .cardActions, .root:not([data-disabled])[data-tooltip-open] .cardActions, .root:not([data-disabled]):has(*:focus-visible) .cardActions{
|
|
525
533
|
position:relative;
|
|
@@ -621,9 +629,6 @@
|
|
|
621
629
|
padding:var(--sn-primitive-dimension-4, 4px);
|
|
622
630
|
border-radius:inherit;
|
|
623
631
|
}
|
|
624
|
-
.container[data-mobile]{
|
|
625
|
-
min-height:var(--sn-primitive-dimension-40, 40px);
|
|
626
|
-
}
|
|
627
632
|
|
|
628
633
|
.icon{
|
|
629
634
|
flex-shrink:0;
|