@snack-uikit/notification 0.5.3 → 0.5.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.
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.5.4 (2023-12-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **FF-3960:** support link props renaming ([990b35e](https://github.com/cloud-ru-tech/snack-uikit/commit/990b35e6f0ea091c499b337e721add2f1606a251))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.5.3 (2023-12-25)
7
18
 
8
19
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -88,7 +88,7 @@ const cards = [
88
88
  | appearance | enum Appearance: `"neutral"`, `"error"`, `"errorCritical"`, `"warning"`, `"success"` | neutral | Тип уведомления |
89
89
  | label | `string` | - | Лейбл перед заголовком |
90
90
  | unread | `boolean` | - | Управление состоянием прочитано/не прочитано |
91
- | link | `Omit<LinkProps, "data-test-id" \| "size" \| "onColor" \| "onSurface">` | - | Ссылка |
91
+ | link | `Omit<LinkProps, "data-test-id" \| "appearance" \| "size" \| "textMode">` | - | Ссылка |
92
92
  | onClick | `MouseEventHandler<HTMLDivElement>` | - | Колбэк клика по карточке |
93
93
  | onVisible | `(cardId: string) => void` | - | Колбэк при попадании карточки в область видимости на 80% |
94
94
  | actions | `Pick<DroplistItemSingleProps, "onClick" \| "option" \| "caption" \| "description" \| "tagLabel" \| "disabled" \| "icon">[]` | - | Дополнительные действия у карточки |
@@ -17,7 +17,7 @@ export type NotificationCardProps = WithSupportProps<{
17
17
  /** Контент уведомления */
18
18
  content: ReactNode;
19
19
  /** Ссылка */
20
- link?: Omit<LinkProps, 'size' | 'onColor' | 'onSurface' | 'data-test-id'>;
20
+ link?: Omit<LinkProps, 'size' | 'appearance' | 'textMode' | 'data-test-id'>;
21
21
  /** Дата уведомления */
22
22
  date: string;
23
23
  /** Колбэк клика по карточке */
@@ -55,5 +55,5 @@ export function NotificationCard(_a) {
55
55
  e.stopPropagation();
56
56
  (_a = link === null || link === void 0 ? void 0 : link.onClick) === null || _a === void 0 ? void 0 : _a.call(link, e);
57
57
  };
58
- return (_jsxs("div", Object.assign({ ref: cardRef, role: 'button', onClick: onClick, tabIndex: 0 }, extractSupportProps(rest), { "data-appearance": appearance, "data-unread": unread || undefined, "data-clickable": Boolean(onClick) || undefined, "data-droplist-open": isDroplistOpen || undefined, className: cn(styles.notificationCard, className), children: [(actions === null || actions === void 0 ? void 0 : actions.length) && (_jsx(NotificationCardFunction, { actions: actions, open: isDroplistOpen, setDroplistOpen: setDroplistOpen })), label && (_jsx(Typography.LightLabelS, { tag: 'div', className: styles.notificationCardLabel, children: _jsx(TruncateString, { maxLines: 1, text: label, "data-test-id": TEST_IDS.label }) })), _jsxs("div", { className: styles.notificationCardTitle, children: [_jsx("div", { className: styles.notificationCardTitleIcon, children: icon }), _jsx(Typography.SansTitleS, { tag: 'div', className: styles.notificationCardTitleText, children: _jsx(TruncateString, { maxLines: 2, text: title, "data-test-id": TEST_IDS.title }) })] }), content && (_jsx(Typography.SansBodyS, { tag: 'div', className: styles.notificationCardContent, "data-test-id": TEST_IDS.content, children: content })), showFooter && (_jsxs("div", { className: styles.notificationCardFooter, children: [link && (_jsx(Link, Object.assign({}, link, { onClick: handleLinkClick, onColor: linkOnColor, onSurface: 'decor', size: 's', "data-test-id": TEST_IDS.link }))), date && (_jsx(Typography.LightLabelS, { className: styles.notificationCardDate, "data-test-id": TEST_IDS.date, children: date }))] }))] })));
58
+ return (_jsxs("div", Object.assign({ ref: cardRef, role: 'button', onClick: onClick, tabIndex: 0 }, extractSupportProps(rest), { "data-appearance": appearance, "data-unread": unread || undefined, "data-clickable": Boolean(onClick) || undefined, "data-droplist-open": isDroplistOpen || undefined, className: cn(styles.notificationCard, className), children: [(actions === null || actions === void 0 ? void 0 : actions.length) && (_jsx(NotificationCardFunction, { actions: actions, open: isDroplistOpen, setDroplistOpen: setDroplistOpen })), label && (_jsx(Typography.LightLabelS, { tag: 'div', className: styles.notificationCardLabel, children: _jsx(TruncateString, { maxLines: 1, text: label, "data-test-id": TEST_IDS.label }) })), _jsxs("div", { className: styles.notificationCardTitle, children: [_jsx("div", { className: styles.notificationCardTitleIcon, children: icon }), _jsx(Typography.SansTitleS, { tag: 'div', className: styles.notificationCardTitleText, children: _jsx(TruncateString, { maxLines: 2, text: title, "data-test-id": TEST_IDS.title }) })] }), content && (_jsx(Typography.SansBodyS, { tag: 'div', className: styles.notificationCardContent, "data-test-id": TEST_IDS.content, children: content })), showFooter && (_jsxs("div", { className: styles.notificationCardFooter, children: [link && (_jsx(Link, Object.assign({}, link, { onClick: handleLinkClick, appearance: linkOnColor, textMode: 'default', size: 's', "data-test-id": TEST_IDS.link }))), date && (_jsx(Typography.LightLabelS, { className: styles.notificationCardDate, "data-test-id": TEST_IDS.date, children: date }))] }))] })));
59
59
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Notification",
7
- "version": "0.5.3",
7
+ "version": "0.5.4",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -32,19 +32,19 @@
32
32
  "license": "Apache-2.0",
33
33
  "scripts": {},
34
34
  "dependencies": {
35
- "@snack-uikit/button": "0.15.0",
36
- "@snack-uikit/chips": "0.10.3",
37
- "@snack-uikit/droplist": "0.12.3",
38
- "@snack-uikit/icon-predefined": "0.4.0",
35
+ "@snack-uikit/button": "0.15.1",
36
+ "@snack-uikit/chips": "0.10.4",
37
+ "@snack-uikit/droplist": "0.12.4",
38
+ "@snack-uikit/icon-predefined": "0.4.1",
39
39
  "@snack-uikit/icons": "0.19.2",
40
- "@snack-uikit/link": "0.9.3",
40
+ "@snack-uikit/link": "0.10.0",
41
41
  "@snack-uikit/popover-private": "0.12.2",
42
42
  "@snack-uikit/scroll": "0.5.0",
43
43
  "@snack-uikit/skeleton": "0.3.2",
44
- "@snack-uikit/truncate-string": "0.4.3",
45
- "@snack-uikit/typography": "0.6.0",
44
+ "@snack-uikit/truncate-string": "0.4.4",
45
+ "@snack-uikit/typography": "0.6.1",
46
46
  "@snack-uikit/utils": "3.2.0",
47
47
  "classnames": "2.3.2"
48
48
  },
49
- "gitHead": "420ccb07e016ae79a8b783e88c24f2045fadc026"
49
+ "gitHead": "57c597a3eebaf6528c0c61b6b27dd244753de1cf"
50
50
  }
@@ -27,7 +27,7 @@ export type NotificationCardProps = WithSupportProps<{
27
27
  /** Контент уведомления */
28
28
  content: ReactNode;
29
29
  /** Ссылка */
30
- link?: Omit<LinkProps, 'size' | 'onColor' | 'onSurface' | 'data-test-id'>;
30
+ link?: Omit<LinkProps, 'size' | 'appearance' | 'textMode' | 'data-test-id'>;
31
31
  /** Дата уведомления */
32
32
  date: string;
33
33
  /** Колбэк клика по карточке */
@@ -59,7 +59,7 @@ export function NotificationCard({
59
59
  className,
60
60
  ...rest
61
61
  }: NotificationCardProps) {
62
- const { icon, linkOnColor } = useMemo<{ icon: ReturnType<typeof getIcon>; linkOnColor: LinkProps['onColor'] }>(
62
+ const { icon, linkOnColor } = useMemo<{ icon: ReturnType<typeof getIcon>; linkOnColor: LinkProps['appearance'] }>(
63
63
  () => ({
64
64
  icon: getIcon(appearance),
65
65
  linkOnColor: appearance === APPEARANCE.ErrorCritical ? 'red' : undefined,
@@ -148,8 +148,8 @@ export function NotificationCard({
148
148
  <Link
149
149
  {...link}
150
150
  onClick={handleLinkClick}
151
- onColor={linkOnColor}
152
- onSurface='decor'
151
+ appearance={linkOnColor}
152
+ textMode='default'
153
153
  size='s'
154
154
  data-test-id={TEST_IDS.link}
155
155
  />