@snack-uikit/card 0.6.1 → 0.6.3
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 +22 -0
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Footer/components/CallToAction/CallToAction.js +1 -1
- package/dist/components/Footer/components/Dimension/Dimension.js +1 -1
- package/dist/components/FunctionBadge/FunctionBadge.js +2 -2
- package/dist/components/FunctionBadge/constants.js +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/helperComponents/Check/Check.js +1 -1
- package/dist/helperComponents/FunctionBadgeWrapper/FunctionBadgeWrapper.js +1 -1
- package/dist/helperComponents/PromoBadge/PromoBadge.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.6.3 (2023-12-18)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/droplist@0.12.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/droplist/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/icons@0.19.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/icons/CHANGELOG.md)
|
|
11
|
+
* [@snack-uikit/truncate-string@0.4.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 0.6.2 (2023-12-14)
|
|
18
|
+
|
|
19
|
+
### Only dependencies have been changed
|
|
20
|
+
* [@snack-uikit/droplist@0.12.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/droplist/CHANGELOG.md)
|
|
21
|
+
* [@snack-uikit/icons@0.19.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/icons/CHANGELOG.md)
|
|
22
|
+
* [@snack-uikit/truncate-string@0.4.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## 0.6.1 (2023-12-14)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @snack-uikit/card
|
|
@@ -29,7 +29,7 @@ export function Card(_a) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}, [onClick]);
|
|
32
|
-
return (_jsx(CardContext.Provider,
|
|
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
|
|
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 })), _jsxs("div", { className: styles.contentWrapper, children: [_jsxs("div", { className: styles.content, "data-size": size, children: [header || null, _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
|
}
|
|
@@ -16,5 +16,5 @@ import { excludeSupportProps } from '@snack-uikit/utils';
|
|
|
16
16
|
import styles from './styles.module.css';
|
|
17
17
|
export function FooterCallToAction(_a) {
|
|
18
18
|
var { label, icon, className } = _a, rest = __rest(_a, ["label", "icon", "className"]);
|
|
19
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.callToAction, className) }, excludeSupportProps(rest), { children: [_jsx(Typography.SansLabelL,
|
|
19
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.callToAction, className) }, excludeSupportProps(rest), { children: [_jsx(Typography.SansLabelL, { className: styles.label, children: label }), _jsx("span", { className: styles.icon, children: icon })] })));
|
|
20
20
|
}
|
|
@@ -6,5 +6,5 @@ import styles from './styles.module.css';
|
|
|
6
6
|
export function Dimension({ dimension, currentValue, oldValue, size: sizeProp }) {
|
|
7
7
|
const { size: sizeContext } = useCardContext();
|
|
8
8
|
const size = TYPOGRAPHY_SIZE_MAP[sizeProp || sizeContext];
|
|
9
|
-
return (_jsxs("div",
|
|
9
|
+
return (_jsxs("div", { className: styles.wrapper, children: [dimension && (_jsx(Typography, { purpose: 'title', family: 'sans', size: size, className: styles.dimension, children: dimension })), _jsxs("div", { className: styles.valueContainer, children: [_jsx(Typography, { purpose: 'title', family: 'sans', size: size, className: styles.currentValue, children: currentValue }), oldValue && _jsx(Typography.CrossedOutBodyS, { className: styles.oldValue, children: oldValue })] })] }));
|
|
10
10
|
}
|
|
@@ -17,7 +17,7 @@ export function FunctionBadge({ icon, options }) {
|
|
|
17
17
|
e.stopPropagation();
|
|
18
18
|
setIsOpen(isOpen => !isOpen);
|
|
19
19
|
}, []);
|
|
20
|
-
return (_jsx("span",
|
|
20
|
+
return (_jsx("span", { className: styles.wrapper, children: _jsx(Droplist, { open: isOpen, onOpenChange: setIsOpen, firstElementRefCallback: firstElementRefCallback, widthStrategy: 'gte', useScroll: true, onFocusLeave: handleDroplistFocusLeave, "data-test-id": TEST_IDS.droplist, triggerClassName: styles.triggerClassName, placement: 'bottom-end', triggerElement: _jsx("button", { "data-test-id": TEST_IDS.functionBadge, className: styles.button, onKeyDown: handleTriggerKeyDown, onClick: onClick, ref: triggerElementRef, children: icon || _jsx(KebabSVG, {}) }), children: options.map(item => (_createElement(Droplist.ItemSingle, Object.assign({}, item, { key: item.option, className: styles.item, "data-test-id": TEST_IDS.option, onClick: e => {
|
|
21
21
|
handleDroplistItemClick(e, item.onClick);
|
|
22
|
-
}, onKeyDown: handleDroplistItemKeyDown })))) })
|
|
22
|
+
}, onKeyDown: handleDroplistItemKeyDown })))) }) }));
|
|
23
23
|
}
|
|
@@ -23,5 +23,5 @@ export function Header(_a) {
|
|
|
23
23
|
var { title, description, metadata, emblem, className, size: sizeProp } = _a, rest = __rest(_a, ["title", "description", "metadata", "emblem", "className", "size"]);
|
|
24
24
|
const { size: sizeContext } = useCardContext();
|
|
25
25
|
const size = sizeProp || sizeContext;
|
|
26
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.titleLayout, className) }, excludeSupportProps(rest), { "data-size": size
|
|
26
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.titleLayout, className) }, excludeSupportProps(rest), { "data-size": size, children: [emblem && _jsx(Emblem, Object.assign({}, emblem)), _jsxs("div", { className: styles.contentLayout, children: [_jsx(Typography, { family: 'sans', size: TITLE_SIZE_MAP[size], purpose: 'title', className: styles.title, "data-test-id": TEST_IDS.title, children: _jsx(TruncateString, { variant: 'end', maxLines: 1, text: title }) }), metadata && (_jsx(Typography.SansBodyS, { className: styles.metadata, children: _jsx(TruncateString, { variant: 'end', maxLines: 1, text: metadata, "data-test-id": TEST_IDS.metadata }) })), description && (_jsx(Typography, { family: 'sans', size: DESCRIPTION_SIZE_MAP[size], purpose: 'body', className: styles.description, children: _jsx(TruncateString, { variant: 'end', maxLines: 2, text: description, "data-test-id": TEST_IDS.description }) }))] })] })));
|
|
27
27
|
}
|
|
@@ -4,5 +4,5 @@ import { CheckSVG } from '@snack-uikit/icons';
|
|
|
4
4
|
import { TEST_IDS } from '../../constants';
|
|
5
5
|
import styles from './styles.module.css';
|
|
6
6
|
export function Check({ className }) {
|
|
7
|
-
return (_jsx("div",
|
|
7
|
+
return (_jsx("div", { className: styles.checkWrapper, children: _jsx("div", { className: cn(styles.checkContainer, className), "data-test-id": TEST_IDS.check, children: _jsx(CheckSVG, { size: 16 }) }) }));
|
|
8
8
|
}
|
|
@@ -4,5 +4,5 @@ import { FunctionBadgeContext } from '../../context';
|
|
|
4
4
|
import styles from './styles.module.css';
|
|
5
5
|
export function FunctionBadgeWrapper({ children, className }) {
|
|
6
6
|
const [visible, setVisible] = useState(false);
|
|
7
|
-
return (_jsx(FunctionBadgeContext.Provider,
|
|
7
|
+
return (_jsx(FunctionBadgeContext.Provider, { value: { visible, setVisible }, children: _jsx("div", { className: className, "data-visible": visible || undefined, tabIndex: -1, children: _jsx("div", { className: styles.functionBadge, children: _jsx("div", { className: styles.functionRow, children: children }) }) }) }));
|
|
8
8
|
}
|
|
@@ -3,5 +3,5 @@ import { PromoTag } from '@snack-uikit/promo-tag';
|
|
|
3
3
|
import { TEST_IDS } from '../../constants';
|
|
4
4
|
import styles from './styles.module.css';
|
|
5
5
|
export function PromoBadge({ text }) {
|
|
6
|
-
return (_jsx("div",
|
|
6
|
+
return (_jsx("div", { className: styles.promoBadge, children: _jsx(PromoTag, { appearance: 'primary', text: text, "data-test-id": TEST_IDS.promoBadge }) }));
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Card",
|
|
7
|
-
"version": "0.6.
|
|
7
|
+
"version": "0.6.3",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@snack-uikit/button": "0.15.0",
|
|
36
|
-
"@snack-uikit/droplist": "0.12.
|
|
36
|
+
"@snack-uikit/droplist": "0.12.2",
|
|
37
37
|
"@snack-uikit/icon-predefined": "0.4.0",
|
|
38
|
-
"@snack-uikit/icons": "0.19.
|
|
38
|
+
"@snack-uikit/icons": "0.19.2",
|
|
39
39
|
"@snack-uikit/promo-tag": "0.4.0",
|
|
40
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
40
|
+
"@snack-uikit/truncate-string": "0.4.2",
|
|
41
41
|
"@snack-uikit/typography": "0.6.0",
|
|
42
42
|
"@snack-uikit/utils": "3.2.0",
|
|
43
43
|
"classnames": "2.3.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "50ef9bb113ec40897ffb3eeae62539ce82ade899"
|
|
46
46
|
}
|