@cloud-ru/ds-bottom-sheet 2.1.0 → 2.1.2-preview-87834313.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.
@@ -50,6 +50,7 @@ export function BottomSheetCustom(props: BottomSheetCustomProps) {
50
50
  open,
51
51
  onClose,
52
52
  showBackdrop = true,
53
+ backdropBlur = false,
53
54
  lockScroll = true,
54
55
  swipeEnabled = true,
55
56
  safeAreaTop = true,
@@ -173,7 +174,13 @@ export function BottomSheetCustom(props: BottomSheetCustomProps) {
173
174
  data-disable-motions={disableMotions || undefined}
174
175
  >
175
176
  {showBackdrop && (
176
- <div className={styles.backdrop} data-test-id={TEST_IDS.backdrop} onClick={handleBackdropClick} aria-hidden />
177
+ <div
178
+ className={styles.backdrop}
179
+ data-backdrop-blur={backdropBlur || undefined}
180
+ data-test-id={TEST_IDS.backdrop}
181
+ onClick={handleBackdropClick}
182
+ aria-hidden
183
+ />
177
184
  )}
178
185
 
179
186
  <div
@@ -194,6 +194,9 @@ export function useDragEngine({
194
194
  const onPointerDown = useCallback(
195
195
  (event: ReactPointerEvent<HTMLDivElement>) => {
196
196
  if (!swipeEnabled || !isActive) return;
197
+ // События вложенного React-портала всплывают в родительский sheet, хотя его DOM
198
+ // не содержит цель жеста. Такой жест принадлежит только вложенной панели.
199
+ if (!(event.target instanceof Node) || !event.currentTarget.contains(event.target)) return;
197
200
  if (!event.isPrimary || pointerId.current !== null) return;
198
201
  if (event.pointerType === 'mouse' && event.button !== 0) return;
199
202
  if (event.target instanceof Element && event.target.closest(NO_DRAG_SELECTOR)) return;
@@ -23,6 +23,10 @@
23
23
 
24
24
  transition: opacity 0.2s;
25
25
 
26
+ &[data-backdrop-blur] {
27
+ backdrop-filter: blur(base.$sn-theme-effect-backgroundBlur);
28
+ }
29
+
26
30
  .root[data-active] & {
27
31
  opacity: 1;
28
32
  }
package/src/types.ts CHANGED
@@ -38,6 +38,11 @@ export type BottomSheetCustomProps = WithSupportProps<
38
38
  * @default true
39
39
  */
40
40
  showBackdrop?: boolean;
41
+ /**
42
+ * Размытие фона под подложкой. Применяется только при `showBackdrop=true`.
43
+ * @default false
44
+ */
45
+ backdropBlur?: boolean;
41
46
  /**
42
47
  * Блокировать ли скролл фона на время открытия (`react-remove-scroll`). При `false` страница
43
48
  * под sheet'ом остаётся прокручиваемой — для non-modal сценариев (sheet поверх контента, с