@cloud-ru/ds-drawer 1.1.1 → 1.1.2-preview-86f06def.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/README.md CHANGED
@@ -252,7 +252,7 @@ export function NestedDrawer() {
252
252
  | `data-test-id` | `string` | — | |
253
253
  | `disableMotions` | `boolean` | `false` | Отключить анимации |
254
254
  | `footer` | `(ReactElement<any, string \| JSXElementConstructor<any>> & (string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<...> \| ReactPortal \| null))` | — | Футер <br/> Произвольный футер. Приоритетнее `approveButton` / `cancelButton` / `additionalButton`. |
255
- | `footerActionsOrientation` | `"horizontal"` \| `"vertical"` | `'horizontal'` | Ориентация кнопок футера. Применяется только при двух кнопках; игнорируется при заданном `footer`. |
255
+ | `footerActionsOrientation` | `"horizontal"` \| `"vertical"` | `'horizontal'` | Ориентация кнопок футера. Игнорируется при заданном `footer`. Без значения раскладку <br/> выбирает поверхность: два действия — в строку, три — стопкой. |
256
256
  | `heightAuto` | `boolean` | `false` | Высота панели по контенту (только при `position: "top" \| "bottom"`). |
257
257
  | `media` | `ReactNode` | — | Медиа-контент |
258
258
  | `nestedDrawer` | `DrawerProps` | — | Вложенный Drawer |
@@ -273,7 +273,7 @@ export function NestedDrawer() {
273
273
  | `swipeEnabled` | `boolean` | `true` | Включает swipe-down для закрытия / swipe-up для раскрытия на следующий snap-point. <br/> При `swipeEnabled=false` snap-point по-прежнему можно переключить через controlled `snapIndex` prop'ом. |
274
274
  | `title` | `ReactNode` | — | Заголовок. Типографика зависит от поверхности: `title-l` на sheet, `headline-s` на window (modal/drawer). |
275
275
  | `width` | `Width` | `'s'` | Ширина (только при position: "left" \| "right") |
276
- | `withDividers` | `boolean` | `false` | Только mobile: разделители между шапкой/контентом/футером sheet'а. |
276
+ | `withDividers` | `boolean` | `true` | Только mobile: разделители между шапкой/контентом/футером sheet'а. |
277
277
 
278
278
  ##### Related types
279
279
 
@@ -293,7 +293,7 @@ export function NestedDrawer() {
293
293
  | `data-test-id` | `string \| undefined` | — | |
294
294
  | `disableMotions` | `boolean \| undefined` | — | Отключить анимации |
295
295
  | `footer` | `(ReactElement<any, string \| JSXElementConstructor<any>> & (string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null)) \| undefined` | — | Футер <br/> Произвольный футер. Приоритетнее `approveButton` / `cancelButton` / `additionalButton`. |
296
- | `footerActionsOrientation` | `"horizontal"` \| `"vertical"` | — | Ориентация кнопок футера. Применяется только при двух кнопках; игнорируется при заданном `footer`. |
296
+ | `footerActionsOrientation` | `"horizontal"` \| `"vertical"` | — | Ориентация кнопок футера. Игнорируется при заданном `footer`. Без значения раскладку <br/> выбирает поверхность: два действия — в строку, три — стопкой. |
297
297
  | `heightAuto` | `boolean \| undefined` | — | Высота панели по контенту (только при `position: "top" \| "bottom"`). |
298
298
  | `media` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | Медиа-контент |
299
299
  | `nestedDrawer` | `DrawerProps` | — | Вложенный Drawer |
@@ -325,7 +325,7 @@ export function NestedDrawer() {
325
325
  `Drawer` — адаптивный компонент с переключением поверхности (surface-swap). Раскладку он берёт из `AdaptiveProvider` (контекст `@cloud-ru/ds-adaptive`); публичный API единый для обеих платформ:
326
326
 
327
327
  - **desktop** (по умолчанию) — панель, выезжающая со стороны экрана (`left`/`right`/`top`/`bottom`).
328
- - **mobile** — контент рендерится в `BottomSheet` из `@cloud-ru/ds-bottom-sheet` (панель снизу со свайпом для закрытия).
328
+ - **mobile** — контент рендерится в `BottomSheet` из `@cloud-ru/ds-bottom-sheet` (панель снизу со свайпом для закрытия). По умолчанию sheet раскрыт на весь вьюпорт (`snapPoints={[1]}`, константа `MOBILE_SNAP_POINTS_DEFAULT`); другую высоту задаёт свой `snapPoints` — например `['fit-content']` по высоте контента или `[0.5, 1]` с раскрытием свайпом.
329
329
 
330
330
  Верстайте под desktop и поставьте один `<AdaptiveProvider>` в корне приложения — mobile-поверхность включается автоматически (desktop-first). Пропа `layoutType` у компонента нет: источник раскладки — только контекст.
331
331
 
@@ -358,6 +358,7 @@ export function NestedDrawer() {
358
358
  | `position`, `width`, `heightAuto`, `nestedDrawer` | используется | игнорируется |
359
359
  | `title`, `subtitle`, `slotAfterTitle`, `onBackButtonClick`, `media`, `content`, `footer` | используется | используется |
360
360
  | `open`, `onClose`, `showBlackout`, `container`, `closeOnPopstate`, `className`, `rootClassName` | используется | используется |
361
+ | `swipeEnabled`, `snapPoints`, `snapIndex`, `onSnapIndexChange`, `safeArea`, `withDividers` | игнорируется | используется |
361
362
 
362
363
  Подробнее о модели адаптивности — **Adaptive**.
363
364
 
@@ -8,12 +8,13 @@ import { DrawerCustomProps } from '../DrawerCustom';
8
8
  *
9
9
  * Только desktop: `position`, `width`, `heightAuto`, `nestedDrawer` (на mobile игнорируются).
10
10
  * Только mobile: `swipeEnabled`, `snapPoints`, `snapIndex`, `onSnapIndexChange`, `safeArea`, `withDividers`
11
- * (на desktop-панели игнорируются — это анатомия `BottomSheet`).
11
+ * (на desktop-панели игнорируются — это анатомия `BottomSheet`). `snapPoints` по умолчанию —
12
+ * `MOBILE_SNAP_POINTS_DEFAULT` (`[1]`): sheet открывается на весь вьюпорт.
12
13
  */
13
14
  export type DrawerProps = WithSupportProps<Omit<DrawerCustomProps, 'nestedDrawer' | 'push' | 'resizable'> & Pick<BottomSheetProps, 'swipeEnabled' | 'snapPoints' | 'snapIndex' | 'onSnapIndexChange' | 'safeArea'> & Pick<DialogHeaderProps, 'title' | 'slotAfterTitle' | 'slotSecondTitle' | 'onBackButtonClick'> & Pick<DialogBodyProps, 'content'> & {
14
15
  /** Ссылка на скроллируемый контейнер контента (например, для дозагрузки по скроллу). */
15
16
  contentRef?: Ref<HTMLElement>;
16
- /** Только mobile: разделители между шапкой/контентом/футером sheet'а. @default false */
17
+ /** Только mobile: разделители между шапкой/контентом/футером sheet'а. @default true */
17
18
  withDividers?: boolean;
18
19
  /** Текстовая строка-подзаголовок под title. */
19
20
  subtitle?: ReactNode;
@@ -28,7 +29,8 @@ export type DrawerProps = WithSupportProps<Omit<DrawerCustomProps, 'nestedDrawer
28
29
  /** Дополнительная (третья) кнопка — пропсы `Button` (дефолт `view='simple'`, `appearance='neutral'`). */
29
30
  additionalButton?: BottomSheetActionButton;
30
31
  /**
31
- * Ориентация кнопок футера. Применяется только при двух кнопках; игнорируется при заданном `footer`.
32
+ * Ориентация кнопок футера. Игнорируется при заданном `footer`. Без значения раскладку
33
+ * выбирает поверхность: два действия — в строку, три — стопкой.
32
34
  * @default 'horizontal'
33
35
  */
34
36
  footerActionsOrientation?: FooterActionsOrientation;
@@ -1,8 +1,9 @@
1
1
  import { DialogBody, DialogBodyProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps } from '../../helperComponents';
2
2
  import { DrawerCustomProps } from './types';
3
3
  /**
4
- * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom`, иначе `DrawerFrame`.
5
- * Композиция одна (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
4
+ * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom` (по умолчанию
5
+ * full-screen, см. `MOBILE_SNAP_POINTS_DEFAULT`), иначе — `DrawerFrame`. Композиция одна
6
+ * (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
6
7
  */
7
8
  export declare function DrawerCustom(props: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
8
9
  export declare namespace DrawerCustom {
@@ -62,13 +62,14 @@ function DrawerFrame(props) {
62
62
  }, size: isPredefinedWidth ? 'null' : width, ...(0, utils_1.extractSupportProps)(rest), "data-content-wrapper": true, "data-position": position, "data-width": isPredefinedWidth ? width : undefined, "data-height-auto": heightAutoVertical ? true : undefined, "data-acrylic-appearance": 'neutral', "data-acrylic-level": '1Level', prefixCls: styles_module_scss_1.default.prefixCls, ...(disableMotions ? {} : constants_2.motionProps), children: (0, jsx_runtime_1.jsxs)(react_remove_scroll_1.RemoveScroll, { enabled: showBlackout || outerScrollLock, removeScrollBar: false, ref: focusTrapRef, className: styles_module_scss_1.default.scrollLock, children: [showButtonClosed && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.showButtonClosedWrapper, children: (0, jsx_runtime_1.jsx)(popup_private_1.PopupCloseButton, { className: styles_module_scss_1.default.showButtonClosed, "aria-label": 'close drawer', "data-test-id": constants_1.TEST_IDS.closeButton, onClick: onClose }) })), (0, jsx_runtime_1.jsx)(bottom_sheet_1.OverlaySurfaceProvider, { surface: bottom_sheet_1.OVERLAY_SURFACE.Drawer, bodyHeightAuto: heightAutoVertical, children: children }), tooltip, nestedDrawer] }) }));
63
63
  }
64
64
  /**
65
- * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom`, иначе `DrawerFrame`.
66
- * Композиция одна (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
65
+ * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom` (по умолчанию
66
+ * full-screen, см. `MOBILE_SNAP_POINTS_DEFAULT`), иначе — `DrawerFrame`. Композиция одна
67
+ * (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
67
68
  */
68
69
  function DrawerCustom(props) {
69
70
  const { layoutType } = (0, adaptive_1.useAdaptiveLayout)();
70
71
  if ((0, adaptive_1.isMobileLayout)(layoutType)) {
71
- const { open, onClose, children, className, rootClassName, container, closeOnPopstate, showBlackout, snapPoints, swipeEnabled, safeArea, disableMotions, ...rest } = props;
72
+ const { open, onClose, children, className, rootClassName, container, closeOnPopstate, showBlackout, snapPoints = constants_1.MOBILE_SNAP_POINTS_DEFAULT, swipeEnabled, safeArea, disableMotions, ...rest } = props;
72
73
  return ((0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetCustom, { open: open, onClose: onClose, container: container, className: className, rootClassName: rootClassName, closeOnPopstate: closeOnPopstate, showBackdrop: showBlackout, snapPoints: snapPoints, swipeEnabled: swipeEnabled, safeArea: safeArea, disableMotions: disableMotions, ...(0, utils_1.extractSupportProps)(rest), children: children }));
73
74
  }
74
75
  return (0, jsx_runtime_1.jsx)(DrawerFrame, { ...props });
@@ -1,3 +1,4 @@
1
+ import { SnapPoint } from '@cloud-ru/ds-bottom-sheet';
1
2
  export declare const TEST_IDS: {
2
3
  readonly closeButton: "drawer__close-button";
3
4
  readonly header: "drawer__header";
@@ -26,3 +27,8 @@ export declare const POSITION: {
26
27
  readonly Top: "top";
27
28
  readonly Bottom: "bottom";
28
29
  };
30
+ /**
31
+ * Snap-точки мобильной поверхности дровера по умолчанию: одна позиция на весь вьюпорт.
32
+ * Дровер на mobile открывается сразу full-screen; swipe-down закрывает его.
33
+ */
34
+ export declare const MOBILE_SNAP_POINTS_DEFAULT: SnapPoint[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.POSITION = exports.WIDTH_AS_VALUES = exports.WIDTH = exports.TEST_IDS = void 0;
3
+ exports.MOBILE_SNAP_POINTS_DEFAULT = exports.POSITION = exports.WIDTH_AS_VALUES = exports.WIDTH = exports.TEST_IDS = void 0;
4
4
  exports.TEST_IDS = {
5
5
  closeButton: 'drawer__close-button',
6
6
  header: 'drawer__header',
@@ -29,3 +29,8 @@ exports.POSITION = {
29
29
  Top: 'top',
30
30
  Bottom: 'bottom',
31
31
  };
32
+ /**
33
+ * Snap-точки мобильной поверхности дровера по умолчанию: одна позиция на весь вьюпорт.
34
+ * Дровер на mobile открывается сразу full-screen; swipe-down закрывает его.
35
+ */
36
+ exports.MOBILE_SNAP_POINTS_DEFAULT = [1];
@@ -9,7 +9,7 @@ export type DialogFooterProps = SheetFooterProps & {
9
9
  cancelButton?: BottomSheetActionButton;
10
10
  /** Дополнительная (третья) кнопка. */
11
11
  additionalButton?: BottomSheetActionButton;
12
- /** Ориентация кнопок при ровно двух действиях. */
12
+ /** Ориентация кнопок; без значения по числу действий (два в строку, три стопкой). */
13
13
  footerActionsOrientation?: FooterActionsOrientation;
14
14
  };
15
15
  /**
@@ -10,13 +10,9 @@ const constants_1 = require("../../constants");
10
10
  * (`subtitle` 1:1, `showBlackout→showBackdrop`, остальное 1:1). Internal. Desktop-only пропы
11
11
  * уходят в `...rest`.
12
12
  */
13
- function MobileDrawer({ content, media, title, slotAfterTitle, slotSecondTitle, subtitle, onBackButtonClick, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, className, rootClassName, open, onClose, showBlackout, container, closeOnPopstate, swipeEnabled, snapPoints, snapIndex, onSnapIndexChange, safeArea, withDividers = false, ...rest }) {
13
+ function MobileDrawer({ content, media, title, slotAfterTitle, slotSecondTitle, subtitle, onBackButtonClick, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, className, rootClassName, open, onClose, showBlackout, container, closeOnPopstate, swipeEnabled, snapPoints = constants_1.MOBILE_SNAP_POINTS_DEFAULT, snapIndex, onSnapIndexChange, safeArea, withDividers, ...rest }) {
14
14
  // Футер собирает сам `BottomSheet`.
15
- return ((0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheet
16
- // Дефолт `withDividers` в sheet'е — `true`; у Drawer'а вид исторически без разделителей.
17
- , {
18
- // Дефолт `withDividers` в sheet'е — `true`; у Drawer'а вид исторически без разделителей.
19
- withDividers: withDividers, open: open, onClose: onClose, showBackdrop: showBlackout, title: title, subtitle: subtitle, slotAfterTitle: slotAfterTitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, media: media, content: content, approveButton: approveButton, cancelButton: cancelButton, additionalButton: additionalButton, footerActionsOrientation: footerActionsOrientation, footer: footer,
15
+ return ((0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheet, { withDividers: withDividers, open: open, onClose: onClose, showBackdrop: showBlackout, title: title, subtitle: subtitle, slotAfterTitle: slotAfterTitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, media: media, content: content, approveButton: approveButton, cancelButton: cancelButton, additionalButton: additionalButton, footerActionsOrientation: footerActionsOrientation, footer: footer,
20
16
  // Те же id футера, что у desktop-поверхности — стабильный селектор при свапе surface.
21
17
  footerTestIds: {
22
18
  approve: constants_1.TEST_IDS.footerApprove,
@@ -8,12 +8,13 @@ import { DrawerCustomProps } from '../DrawerCustom/index.js';
8
8
  *
9
9
  * Только desktop: `position`, `width`, `heightAuto`, `nestedDrawer` (на mobile игнорируются).
10
10
  * Только mobile: `swipeEnabled`, `snapPoints`, `snapIndex`, `onSnapIndexChange`, `safeArea`, `withDividers`
11
- * (на desktop-панели игнорируются — это анатомия `BottomSheet`).
11
+ * (на desktop-панели игнорируются — это анатомия `BottomSheet`). `snapPoints` по умолчанию —
12
+ * `MOBILE_SNAP_POINTS_DEFAULT` (`[1]`): sheet открывается на весь вьюпорт.
12
13
  */
13
14
  export type DrawerProps = WithSupportProps<Omit<DrawerCustomProps, 'nestedDrawer' | 'push' | 'resizable'> & Pick<BottomSheetProps, 'swipeEnabled' | 'snapPoints' | 'snapIndex' | 'onSnapIndexChange' | 'safeArea'> & Pick<DialogHeaderProps, 'title' | 'slotAfterTitle' | 'slotSecondTitle' | 'onBackButtonClick'> & Pick<DialogBodyProps, 'content'> & {
14
15
  /** Ссылка на скроллируемый контейнер контента (например, для дозагрузки по скроллу). */
15
16
  contentRef?: Ref<HTMLElement>;
16
- /** Только mobile: разделители между шапкой/контентом/футером sheet'а. @default false */
17
+ /** Только mobile: разделители между шапкой/контентом/футером sheet'а. @default true */
17
18
  withDividers?: boolean;
18
19
  /** Текстовая строка-подзаголовок под title. */
19
20
  subtitle?: ReactNode;
@@ -28,7 +29,8 @@ export type DrawerProps = WithSupportProps<Omit<DrawerCustomProps, 'nestedDrawer
28
29
  /** Дополнительная (третья) кнопка — пропсы `Button` (дефолт `view='simple'`, `appearance='neutral'`). */
29
30
  additionalButton?: BottomSheetActionButton;
30
31
  /**
31
- * Ориентация кнопок футера. Применяется только при двух кнопках; игнорируется при заданном `footer`.
32
+ * Ориентация кнопок футера. Игнорируется при заданном `footer`. Без значения раскладку
33
+ * выбирает поверхность: два действия — в строку, три — стопкой.
32
34
  * @default 'horizontal'
33
35
  */
34
36
  footerActionsOrientation?: FooterActionsOrientation;
@@ -1,8 +1,9 @@
1
1
  import { DialogBody, DialogBodyProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps } from '../../helperComponents/index.js';
2
2
  import { DrawerCustomProps } from './types.js';
3
3
  /**
4
- * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom`, иначе `DrawerFrame`.
5
- * Композиция одна (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
4
+ * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom` (по умолчанию
5
+ * full-screen, см. `MOBILE_SNAP_POINTS_DEFAULT`), иначе — `DrawerFrame`. Композиция одна
6
+ * (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
6
7
  */
7
8
  export declare function DrawerCustom(props: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
8
9
  export declare namespace DrawerCustom {
@@ -8,7 +8,7 @@ import RcDrawerImport from '@rc-component/drawer';
8
8
  import cn from 'classnames';
9
9
  import { useMemo } from 'react';
10
10
  import { RemoveScroll } from 'react-remove-scroll';
11
- import { TEST_IDS, WIDTH_AS_VALUES } from '../../constants.js';
11
+ import { MOBILE_SNAP_POINTS_DEFAULT, TEST_IDS, WIDTH_AS_VALUES } from '../../constants.js';
12
12
  import { DialogBody, DialogFooter, DialogHeader, } from '../../helperComponents/index.js';
13
13
  import { interopDefault } from '../../utils/interopDefault.js';
14
14
  import { motionProps } from './constants.js';
@@ -56,13 +56,14 @@ function DrawerFrame(props) {
56
56
  }, size: isPredefinedWidth ? 'null' : width, ...extractSupportProps(rest), "data-content-wrapper": true, "data-position": position, "data-width": isPredefinedWidth ? width : undefined, "data-height-auto": heightAutoVertical ? true : undefined, "data-acrylic-appearance": 'neutral', "data-acrylic-level": '1Level', prefixCls: styles.prefixCls, ...(disableMotions ? {} : motionProps), children: _jsxs(RemoveScroll, { enabled: showBlackout || outerScrollLock, removeScrollBar: false, ref: focusTrapRef, className: styles.scrollLock, children: [showButtonClosed && (_jsx("div", { className: styles.showButtonClosedWrapper, children: _jsx(PopupCloseButton, { className: styles.showButtonClosed, "aria-label": 'close drawer', "data-test-id": TEST_IDS.closeButton, onClick: onClose }) })), _jsx(OverlaySurfaceProvider, { surface: OVERLAY_SURFACE.Drawer, bodyHeightAuto: heightAutoVertical, children: children }), tooltip, nestedDrawer] }) }));
57
57
  }
58
58
  /**
59
- * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom`, иначе `DrawerFrame`.
60
- * Композиция одна (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
59
+ * Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom` (по умолчанию
60
+ * full-screen, см. `MOBILE_SNAP_POINTS_DEFAULT`), иначе — `DrawerFrame`. Композиция одна
61
+ * (surface-aware слоты `.Header/.Body/.Footer`). Форс — `withLayoutType`.
61
62
  */
62
63
  export function DrawerCustom(props) {
63
64
  const { layoutType } = useAdaptiveLayout();
64
65
  if (isMobileLayout(layoutType)) {
65
- const { open, onClose, children, className, rootClassName, container, closeOnPopstate, showBlackout, snapPoints, swipeEnabled, safeArea, disableMotions, ...rest } = props;
66
+ const { open, onClose, children, className, rootClassName, container, closeOnPopstate, showBlackout, snapPoints = MOBILE_SNAP_POINTS_DEFAULT, swipeEnabled, safeArea, disableMotions, ...rest } = props;
66
67
  return (_jsx(BottomSheetCustom, { open: open, onClose: onClose, container: container, className: className, rootClassName: rootClassName, closeOnPopstate: closeOnPopstate, showBackdrop: showBlackout, snapPoints: snapPoints, swipeEnabled: swipeEnabled, safeArea: safeArea, disableMotions: disableMotions, ...extractSupportProps(rest), children: children }));
67
68
  }
68
69
  return _jsx(DrawerFrame, { ...props });
@@ -1,3 +1,4 @@
1
+ import { SnapPoint } from '@cloud-ru/ds-bottom-sheet';
1
2
  export declare const TEST_IDS: {
2
3
  readonly closeButton: "drawer__close-button";
3
4
  readonly header: "drawer__header";
@@ -26,3 +27,8 @@ export declare const POSITION: {
26
27
  readonly Top: "top";
27
28
  readonly Bottom: "bottom";
28
29
  };
30
+ /**
31
+ * Snap-точки мобильной поверхности дровера по умолчанию: одна позиция на весь вьюпорт.
32
+ * Дровер на mobile открывается сразу full-screen; swipe-down закрывает его.
33
+ */
34
+ export declare const MOBILE_SNAP_POINTS_DEFAULT: SnapPoint[];
@@ -26,3 +26,8 @@ export const POSITION = {
26
26
  Top: 'top',
27
27
  Bottom: 'bottom',
28
28
  };
29
+ /**
30
+ * Snap-точки мобильной поверхности дровера по умолчанию: одна позиция на весь вьюпорт.
31
+ * Дровер на mobile открывается сразу full-screen; swipe-down закрывает его.
32
+ */
33
+ export const MOBILE_SNAP_POINTS_DEFAULT = [1];
@@ -9,7 +9,7 @@ export type DialogFooterProps = SheetFooterProps & {
9
9
  cancelButton?: BottomSheetActionButton;
10
10
  /** Дополнительная (третья) кнопка. */
11
11
  additionalButton?: BottomSheetActionButton;
12
- /** Ориентация кнопок при ровно двух действиях. */
12
+ /** Ориентация кнопок; без значения по числу действий (два в строку, три стопкой). */
13
13
  footerActionsOrientation?: FooterActionsOrientation;
14
14
  };
15
15
  /**
@@ -1,19 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BottomSheet } from '@cloud-ru/ds-bottom-sheet';
3
3
  import { extractSupportProps } from '@cloud-ru/ds-utils';
4
- import { TEST_IDS } from '../../constants.js';
4
+ import { MOBILE_SNAP_POINTS_DEFAULT, TEST_IDS } from '../../constants.js';
5
5
  /**
6
6
  * Mobile-поверхность Drawer'а: контент в `BottomSheet`, слоты маппятся на API sheet'а
7
7
  * (`subtitle` 1:1, `showBlackout→showBackdrop`, остальное 1:1). Internal. Desktop-only пропы
8
8
  * уходят в `...rest`.
9
9
  */
10
- export function MobileDrawer({ content, media, title, slotAfterTitle, slotSecondTitle, subtitle, onBackButtonClick, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, className, rootClassName, open, onClose, showBlackout, container, closeOnPopstate, swipeEnabled, snapPoints, snapIndex, onSnapIndexChange, safeArea, withDividers = false, ...rest }) {
10
+ export function MobileDrawer({ content, media, title, slotAfterTitle, slotSecondTitle, subtitle, onBackButtonClick, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, className, rootClassName, open, onClose, showBlackout, container, closeOnPopstate, swipeEnabled, snapPoints = MOBILE_SNAP_POINTS_DEFAULT, snapIndex, onSnapIndexChange, safeArea, withDividers, ...rest }) {
11
11
  // Футер собирает сам `BottomSheet`.
12
- return (_jsx(BottomSheet
13
- // Дефолт `withDividers` в sheet'е — `true`; у Drawer'а вид исторически без разделителей.
14
- , {
15
- // Дефолт `withDividers` в sheet'е — `true`; у Drawer'а вид исторически без разделителей.
16
- withDividers: withDividers, open: open, onClose: onClose, showBackdrop: showBlackout, title: title, subtitle: subtitle, slotAfterTitle: slotAfterTitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, media: media, content: content, approveButton: approveButton, cancelButton: cancelButton, additionalButton: additionalButton, footerActionsOrientation: footerActionsOrientation, footer: footer,
12
+ return (_jsx(BottomSheet, { withDividers: withDividers, open: open, onClose: onClose, showBackdrop: showBlackout, title: title, subtitle: subtitle, slotAfterTitle: slotAfterTitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, media: media, content: content, approveButton: approveButton, cancelButton: cancelButton, additionalButton: additionalButton, footerActionsOrientation: footerActionsOrientation, footer: footer,
17
13
  // Те же id футера, что у desktop-поверхности — стабильный селектор при свапе surface.
18
14
  footerTestIds: {
19
15
  approve: TEST_IDS.footerApprove,