@snack-uikit/card 0.6.4 → 0.7.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 +18 -1
- package/README.md +1 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Card/styles.module.css +7 -3
- package/dist/components/Footer/components/Dimension/constants.js +1 -0
- package/dist/components/Header/constants.js +2 -0
- package/dist/components/Header/styles.module.css +3 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/helperComponents/Emblem/styled.module.css +6 -0
- package/package.json +8 -8
- package/src/components/Card/Card.tsx +7 -5
- package/src/components/Card/styles.module.scss +6 -11
- package/src/components/Footer/components/Dimension/constants.ts +1 -0
- package/src/components/Header/constants.ts +2 -0
- package/src/components/Header/styles.module.scss +1 -1
- package/src/constants.ts +1 -0
- package/src/helperComponents/Emblem/styled.module.scss +1 -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
|
+
# 0.7.0 (2023-12-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **FF-3960:** add S size ([1ef77b1](https://github.com/cloud-ru-tech/snack-uikit/commit/1ef77b133d182e2601372ad9e6304080d95516ac))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.6.4 (2023-12-25)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
|
@@ -37,7 +48,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
37
48
|
|
|
38
49
|
## 0.6.1 (2023-12-14)
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
### Only dependencies have been changed
|
|
52
|
+
* [@snack-uikit/button@0.15.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
|
|
53
|
+
* [@snack-uikit/droplist@0.12.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/droplist/CHANGELOG.md)
|
|
54
|
+
* [@snack-uikit/icon-predefined@0.4.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/icon-predefined/CHANGELOG.md)
|
|
55
|
+
* [@snack-uikit/promo-tag@0.4.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/promo-tag/CHANGELOG.md)
|
|
56
|
+
* [@snack-uikit/truncate-string@0.4.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
57
|
+
* [@snack-uikit/typography@0.6.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/typography/CHANGELOG.md)
|
|
41
58
|
|
|
42
59
|
|
|
43
60
|
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ import { Card, SearchPrivate } from "@snack-uikit/card";
|
|
|
33
33
|
| outline | `boolean` | - | Управление состоянием наличия обводки |
|
|
34
34
|
| multipleSelection | `boolean` | - | Отображение галочки для режима массового выделения карточек |
|
|
35
35
|
| onClick | `() => void` | - | Колбек на клик по карточке |
|
|
36
|
-
| size | enum Size: `"m"`, `"l"` | - | Размер |
|
|
36
|
+
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
37
37
|
| promoBadge | `string` | - | Текст для PromoBadge |
|
|
38
38
|
| children | `ReactNode` | - | Вложенный контент |
|
|
39
39
|
| header | `ReactElement<HeaderProps, string \| JSXElementConstructor<any>>` | - | Вложенный Header |
|
|
@@ -31,5 +31,5 @@ export function Card(_a) {
|
|
|
31
31
|
}, [onClick]);
|
|
32
32
|
return (_jsx(CardContext.Provider, { value: { size, disabled }, children: _jsxs("div", Object.assign({ ref: localRef, className: cn(styles.card, className) }, extractSupportProps(rest), { onClick: onClick, "data-disabled": disabled || undefined, "data-checked": checked || undefined, "data-outline": outline || undefined, "data-pointer": onClick ? true : undefined,
|
|
33
33
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
34
|
-
tabIndex: 0, onKeyDown: onKeyDown, children: [image, promoBadge && _jsx(PromoBadge, { text: promoBadge }), _jsxs("div", { className: styles.composition, tabIndex: -1, children: [!disabled && functionBadge && (_jsx(FunctionBadgeWrapper, { className: styles.functionBadgeWrapper, children: functionBadge })),
|
|
34
|
+
tabIndex: 0, onKeyDown: onKeyDown, children: [image, promoBadge && _jsx(PromoBadge, { text: promoBadge }), _jsxs("div", { className: styles.composition, tabIndex: -1, children: [!disabled && functionBadge && (_jsx(FunctionBadgeWrapper, { className: styles.functionBadgeWrapper, children: functionBadge })), _jsx("div", { className: styles.contentWrapper, children: _jsxs("div", { className: styles.content, "data-size": size, children: [header || null, children && (_jsx(Typography, { family: 'sans', size: size, purpose: 'body', className: styles.body, children: children })), footer && _jsx("div", { className: styles.footer, children: footer })] }) })] }), !disabled && checked && multipleSelection && _jsx(Check, { className: styles.check })] })) }));
|
|
35
35
|
}
|
|
@@ -137,17 +137,21 @@
|
|
|
137
137
|
box-sizing:border-box;
|
|
138
138
|
max-width:100%;
|
|
139
139
|
}
|
|
140
|
+
.content[data-size=s]{
|
|
141
|
+
padding:var(--space-card-padding-container-s, 8px);
|
|
142
|
+
gap:var(--space-card-gap-s, 4px);
|
|
143
|
+
}
|
|
140
144
|
.content[data-size=m]{
|
|
141
|
-
padding:var(--space-card-padding-container, 16px);
|
|
145
|
+
padding:var(--space-card-padding-container-m, 16px);
|
|
142
146
|
gap:var(--space-card-gap-m, 8px);
|
|
143
147
|
}
|
|
144
148
|
.content[data-size=l]{
|
|
145
|
-
padding:var(--space-card-padding-container,
|
|
149
|
+
padding:var(--space-card-padding-container-l, 24px);
|
|
146
150
|
gap:var(--space-card-gap-l, 16px);
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
.footer{
|
|
150
|
-
padding:var(--space-card-padding-container, 16px);
|
|
151
154
|
position:relative;
|
|
152
155
|
box-sizing:border-box;
|
|
156
|
+
width:100%;
|
|
153
157
|
}
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
border-color:var(--sys-neutral-decor-disabled, #e7e7e7);
|
|
8
8
|
border-style:solid;
|
|
9
9
|
}
|
|
10
|
+
.img[data-size=s]{
|
|
11
|
+
width:var(--size-card-picture-s, 32px);
|
|
12
|
+
height:var(--size-card-picture-s, 32px);
|
|
13
|
+
border-width:var(--border-width-card-picture, 1px);
|
|
14
|
+
border-radius:var(--radius-card-picture, 8px);
|
|
15
|
+
}
|
|
10
16
|
.img[data-size=m]{
|
|
11
17
|
width:var(--size-card-picture-m, 40px);
|
|
12
18
|
height:var(--size-card-picture-m, 40px);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Card",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.7.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"license": "Apache-2.0",
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@snack-uikit/button": "0.15.
|
|
36
|
-
"@snack-uikit/droplist": "0.12.
|
|
37
|
-
"@snack-uikit/icon-predefined": "0.4.
|
|
35
|
+
"@snack-uikit/button": "0.15.1",
|
|
36
|
+
"@snack-uikit/droplist": "0.12.4",
|
|
37
|
+
"@snack-uikit/icon-predefined": "0.4.1",
|
|
38
38
|
"@snack-uikit/icons": "0.19.2",
|
|
39
|
-
"@snack-uikit/promo-tag": "0.4.
|
|
40
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
41
|
-
"@snack-uikit/typography": "0.6.
|
|
39
|
+
"@snack-uikit/promo-tag": "0.4.1",
|
|
40
|
+
"@snack-uikit/truncate-string": "0.4.4",
|
|
41
|
+
"@snack-uikit/typography": "0.6.1",
|
|
42
42
|
"@snack-uikit/utils": "3.2.0",
|
|
43
43
|
"classnames": "2.3.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "57c597a3eebaf6528c0c61b6b27dd244753de1cf"
|
|
46
46
|
}
|
|
@@ -99,12 +99,14 @@ export function Card({
|
|
|
99
99
|
<div className={styles.content} data-size={size}>
|
|
100
100
|
{header || null}
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
{children && (
|
|
103
|
+
<Typography family='sans' size={size} purpose='body' className={styles.body}>
|
|
104
|
+
{children}
|
|
105
|
+
</Typography>
|
|
106
|
+
)}
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
{footer && <div className={styles.footer}>{footer}</div>}
|
|
109
|
+
</div>
|
|
108
110
|
</div>
|
|
109
111
|
</div>
|
|
110
112
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
2
|
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-element';
|
|
3
3
|
|
|
4
|
-
$sizes:
|
|
4
|
+
$sizes: 's', 'm', 'l';
|
|
5
5
|
|
|
6
6
|
.functionBadgeWrapper {
|
|
7
7
|
position: absolute;
|
|
@@ -17,12 +17,12 @@ $sizes: 'm', 'l';
|
|
|
17
17
|
.composition {
|
|
18
18
|
@include composite-var($card-composition-container);
|
|
19
19
|
|
|
20
|
-
box-sizing: border-box;
|
|
20
|
+
box-sizing: border-box;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.card {
|
|
24
24
|
@include composite-var($card-container);
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
position: relative;
|
|
27
27
|
|
|
28
28
|
overflow: hidden;
|
|
@@ -32,7 +32,7 @@ $sizes: 'm', 'l';
|
|
|
32
32
|
padding: 0;
|
|
33
33
|
|
|
34
34
|
text-align: left;
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
background-color: $sys-neutral-background1-level;
|
|
37
37
|
border: 0;
|
|
38
38
|
outline-color: transparent;
|
|
@@ -76,8 +76,6 @@ $sizes: 'm', 'l';
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
79
|
&[data-pointer] {
|
|
82
80
|
* {
|
|
83
81
|
cursor: pointer;
|
|
@@ -153,14 +151,13 @@ $sizes: 'm', 'l';
|
|
|
153
151
|
background-color: $sys-neutral-background;
|
|
154
152
|
outline-color: $sys-neutral-decor-default;
|
|
155
153
|
outline-width: $border-width-card-container;
|
|
156
|
-
|
|
154
|
+
|
|
157
155
|
* {
|
|
158
156
|
cursor: not-allowed;
|
|
159
157
|
}
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
|
|
164
161
|
.body {
|
|
165
162
|
display: block;
|
|
166
163
|
color: $sys-neutral-text-support;
|
|
@@ -186,9 +183,7 @@ $sizes: 'm', 'l';
|
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
.footer {
|
|
189
|
-
@include composite-var($card-footer);
|
|
190
|
-
|
|
191
186
|
position: relative;
|
|
192
187
|
box-sizing: border-box;
|
|
188
|
+
width: 100%;
|
|
193
189
|
}
|
|
194
|
-
|
|
@@ -4,11 +4,13 @@ import { SIZE } from '../../constants';
|
|
|
4
4
|
import { Size } from '../../types';
|
|
5
5
|
|
|
6
6
|
export const TITLE_SIZE_MAP: Record<Size, TypographyProps['size']> = {
|
|
7
|
+
[SIZE.S]: 's',
|
|
7
8
|
[SIZE.M]: 's',
|
|
8
9
|
[SIZE.L]: 'l',
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export const DESCRIPTION_SIZE_MAP: Record<Size, TypographyProps['size']> = {
|
|
13
|
+
[SIZE.S]: 'm',
|
|
12
14
|
[SIZE.M]: 'm',
|
|
13
15
|
[SIZE.L]: 'l',
|
|
14
16
|
};
|
package/src/constants.ts
CHANGED