@snack-uikit/notification 0.10.15 → 0.10.16

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.10.16 (2025-02-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **PDS-564:** rendering without wrapping the target ([5fdc13a](https://github.com/cloud-ru-tech/snack-uikit/commit/5fdc13a1f3c982f4ed50c58cba32ca0d0a4df7a0))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.10.15 (2025-02-05)
7
18
 
8
19
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -130,7 +130,6 @@ const cards = [
130
130
  ### Props
131
131
  | name | type | default value | description |
132
132
  |------|------|---------------|-------------|
133
- | children* | `ReactNode \| ChildrenFunction` | - | Триггер поповера (подробнее читайте ниже) |
134
133
  | content* | `ReactElement<NotificationPanelProps, typeof NotificationPanel>` | - | |
135
134
  | contentClassName | `string` | - | CSS-класс для элемента содержащего контент |
136
135
  | className | `string` | - | CSS-класс |
@@ -140,6 +139,7 @@ const cards = [
140
139
  | hoverDelayOpen | `number` | - | Задержка открытия по ховеру |
141
140
  | hoverDelayClose | `number` | - | Задержка закрытия по ховеру |
142
141
  | offset | `number` | 0 | Отступ поповера от его триггер-элемента (в пикселях). |
142
+ | children | `ReactNode \| ChildrenFunction` | - | Триггер поповера (подробнее читайте ниже) |
143
143
  | closeOnEscapeKey | `boolean` | true | Закрывать ли по нажатию на кнопку `Esc` |
144
144
  | triggerClickByKeys | `boolean` | true | Вызывается ли попоповер по нажатию клавиш Enter/Space (при trigger = `click`) |
145
145
  | triggerRef | `ForwardedRef<HTMLElement \| ReferenceType>` | - | Ref ссылка на триггер |
@@ -8,4 +8,4 @@ export type NotificationPanelPopoverProps = WithSupportProps<{
8
8
  contentClassName?: string;
9
9
  } & Pick<PopoverPrivateProps, 'className' | 'triggerClassName' | 'open' | 'onOpenChange' | 'hoverDelayOpen' | 'hoverDelayClose' | 'offset' | 'children' | 'closeOnEscapeKey' | 'triggerClickByKeys' | 'triggerRef'> & Partial<Pick<PopoverPrivateProps, 'trigger' | 'placement'>>>;
10
10
  /** Компонент-обёртка для NotificationPanel для использования как выпадающий элемент */
11
- export declare function NotificationPanelPopover({ content, trigger, placement, children, contentClassName, ...otherProps }: NotificationPanelPopoverProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare function NotificationPanelPopover({ content, trigger, placement, children, triggerRef, contentClassName, ...otherProps }: NotificationPanelPopoverProps): import("react/jsx-runtime").JSX.Element | null;
@@ -28,10 +28,11 @@ function NotificationPanelPopover(_a) {
28
28
  trigger = 'click',
29
29
  placement = 'bottom-end',
30
30
  children,
31
+ triggerRef,
31
32
  contentClassName
32
33
  } = _a,
33
- otherProps = __rest(_a, ["content", "trigger", "placement", "children", "contentClassName"]);
34
- if (!children) {
34
+ otherProps = __rest(_a, ["content", "trigger", "placement", "children", "triggerRef", "contentClassName"]);
35
+ if (!children && !triggerRef) {
35
36
  return null;
36
37
  }
37
38
  return (0, jsx_runtime_1.jsx)(popover_private_1.PopoverPrivate, Object.assign({
@@ -45,6 +46,7 @@ function NotificationPanelPopover(_a) {
45
46
  })
46
47
  }),
47
48
  trigger: trigger,
49
+ triggerRef: triggerRef,
48
50
  hasArrow: false,
49
51
  heightStrategy: 'lte'
50
52
  }, otherProps, {
@@ -8,4 +8,4 @@ export type NotificationPanelPopoverProps = WithSupportProps<{
8
8
  contentClassName?: string;
9
9
  } & Pick<PopoverPrivateProps, 'className' | 'triggerClassName' | 'open' | 'onOpenChange' | 'hoverDelayOpen' | 'hoverDelayClose' | 'offset' | 'children' | 'closeOnEscapeKey' | 'triggerClickByKeys' | 'triggerRef'> & Partial<Pick<PopoverPrivateProps, 'trigger' | 'placement'>>>;
10
10
  /** Компонент-обёртка для NotificationPanel для использования как выпадающий элемент */
11
- export declare function NotificationPanelPopover({ content, trigger, placement, children, contentClassName, ...otherProps }: NotificationPanelPopoverProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare function NotificationPanelPopover({ content, trigger, placement, children, triggerRef, contentClassName, ...otherProps }: NotificationPanelPopoverProps): import("react/jsx-runtime").JSX.Element | null;
@@ -15,9 +15,9 @@ import { PopoverPrivate } from '@snack-uikit/popover-private';
15
15
  import styles from './styles.module.css';
16
16
  /** Компонент-обёртка для NotificationPanel для использования как выпадающий элемент */
17
17
  export function NotificationPanelPopover(_a) {
18
- var { content, trigger = 'click', placement = 'bottom-end', children, contentClassName } = _a, otherProps = __rest(_a, ["content", "trigger", "placement", "children", "contentClassName"]);
19
- if (!children) {
18
+ var { content, trigger = 'click', placement = 'bottom-end', children, triggerRef, contentClassName } = _a, otherProps = __rest(_a, ["content", "trigger", "placement", "children", "triggerRef", "contentClassName"]);
19
+ if (!children && !triggerRef) {
20
20
  return null;
21
21
  }
22
- return (_jsx(PopoverPrivate, Object.assign({ fallbackPlacements: [], placement: placement, popoverContent: _jsx("div", { className: styles.notificationPanelPopoverWrap, children: _jsx("div", { className: cn(styles.notificationPanelPopover, contentClassName), children: content }) }), trigger: trigger, hasArrow: false, heightStrategy: 'lte' }, otherProps, { children: children })));
22
+ return (_jsx(PopoverPrivate, Object.assign({ fallbackPlacements: [], placement: placement, popoverContent: _jsx("div", { className: styles.notificationPanelPopoverWrap, children: _jsx("div", { className: cn(styles.notificationPanelPopover, contentClassName), children: content }) }), trigger: trigger, triggerRef: triggerRef, hasArrow: false, heightStrategy: 'lte' }, otherProps, { children: children })));
23
23
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Notification",
7
- "version": "0.10.15",
7
+ "version": "0.10.16",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -37,19 +37,19 @@
37
37
  "scripts": {},
38
38
  "dependencies": {
39
39
  "@snack-uikit/button": "0.19.7",
40
- "@snack-uikit/chips": "0.25.0",
40
+ "@snack-uikit/chips": "0.25.1",
41
41
  "@snack-uikit/icons": "0.24.2",
42
- "@snack-uikit/info-block": "0.6.11",
43
- "@snack-uikit/link": "0.15.7",
44
- "@snack-uikit/list": "0.24.2",
45
- "@snack-uikit/popover-private": "0.14.3",
42
+ "@snack-uikit/info-block": "0.6.12",
43
+ "@snack-uikit/link": "0.15.8",
44
+ "@snack-uikit/list": "0.24.3",
45
+ "@snack-uikit/popover-private": "0.14.4",
46
46
  "@snack-uikit/scroll": "0.9.3",
47
47
  "@snack-uikit/skeleton": "0.6.2",
48
- "@snack-uikit/tag": "0.12.2",
49
- "@snack-uikit/truncate-string": "0.6.7",
48
+ "@snack-uikit/tag": "0.12.3",
49
+ "@snack-uikit/truncate-string": "0.6.8",
50
50
  "@snack-uikit/typography": "0.8.4",
51
51
  "@snack-uikit/utils": "3.7.0",
52
52
  "classnames": "2.5.1"
53
53
  },
54
- "gitHead": "70bed6c518009afe4292cb9d12baf08a16700781"
54
+ "gitHead": "c29d4a3f518a9a287566b4ccb7648b5243e1977b"
55
55
  }
@@ -35,10 +35,11 @@ export function NotificationPanelPopover({
35
35
  trigger = 'click',
36
36
  placement = 'bottom-end',
37
37
  children,
38
+ triggerRef,
38
39
  contentClassName,
39
40
  ...otherProps
40
41
  }: NotificationPanelPopoverProps) {
41
- if (!children) {
42
+ if (!children && !triggerRef) {
42
43
  return null;
43
44
  }
44
45
 
@@ -52,6 +53,7 @@ export function NotificationPanelPopover({
52
53
  </div>
53
54
  }
54
55
  trigger={trigger}
56
+ triggerRef={triggerRef}
55
57
  hasArrow={false}
56
58
  heightStrategy='lte'
57
59
  {...otherProps}