@cloud-ru/ds-bottom-sheet 2.2.0 → 2.2.1-preview-2f5fa273.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
@@ -707,6 +707,8 @@ export function NonModal() {
707
707
  | `swipeEnabled` | `boolean` | `true` | Включает swipe-down для закрытия / swipe-up для раскрытия на следующий snap-point. <br/> В режиме `forced` свайп отключён независимо от значения свойства. <br/> При `swipeEnabled=false` snap-point по-прежнему можно переключить через controlled `snapIndex` prop'ом. |
708
708
  | `title` | `ReactNode` | — | Заголовок в шапке. |
709
709
  | `withDividers` | `boolean` | `true` | Тонкие линии между topBar↔body и body↔footer: разграничивают закреплённые шапку и подвал <br/> от прокручиваемого под ними содержимого. Передайте `false`, чтобы убрать обе линии. |
710
+ | `withFooterDivider` | `boolean` | `true` | Разделитель над футером. По умолчанию используется `withDividers`. |
711
+ | `withHeaderDivider` | `boolean` | `true` | Разделитель под шапкой. По умолчанию используется `withDividers`. |
710
712
 
711
713
  #### Related types
712
714
 
@@ -1,3 +1,3 @@
1
1
  import { BottomSheetProps } from '../../types';
2
2
  /** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
3
- export declare function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers, swipeEnabled, className, ...rest }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers, withHeaderDivider, withFooterDivider, swipeEnabled, className, ...rest }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ function isMediaProps(value) {
14
14
  return typeof value === 'object' && value !== null && !(0, react_1.isValidElement)(value) && 'src' in value && 'alt' in value;
15
15
  }
16
16
  /** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
17
- function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, swipeEnabled = true,
17
+ function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, withHeaderDivider = withDividers, withFooterDivider = withDividers, swipeEnabled = true,
18
18
  // safeAreaTop/safeAreaBottom уходят в `...rest` → BottomSheetCustom (env-паддинг на `.content`).
19
19
  className, ...rest }) {
20
20
  const hasHeader = Boolean(title || onBackButtonClick || actionButton || slotAfterTitle || subtitle || slotSecondTitle);
@@ -33,5 +33,5 @@ className, ...rest }) {
33
33
  return ((0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom, { ...rest, swipeEnabled: swipeEnabled, ...(title ? { 'aria-labelledby': titleId } : {}), className: className, disableMotions: false, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.root, children: [hasMedia &&
34
34
  (isMediaProps(media) ? ((0, jsx_runtime_1.jsx)(popup_private_1.PopupMedia, { ...media })) : (
35
35
  // ReactNode-media: тот же data-media-kind-контракт со значением 'custom'.
36
- (0, jsx_runtime_1.jsx)("div", { "data-test-id": constants_1.TEST_IDS.media, "data-media-kind": 'custom', children: media }))), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.contentBlock, children: [hasHeader && ((0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Header, { title: title, titleId: titleId, slotAfterTitle: slotAfterTitle, subtitle: subtitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, actionButton: actionButton })), withDividers && hasHeader && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.dividerTop, "aria-hidden": true })), (0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Body, { bodyPadding: bodyPadding, children: content }), withDividers && hasFooter && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.dividerBottom, "aria-hidden": true })), hasFooter && (0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Footer, { children: footerContent })] })] }) }));
36
+ (0, jsx_runtime_1.jsx)("div", { "data-test-id": constants_1.TEST_IDS.media, "data-media-kind": 'custom', children: media }))), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.contentBlock, children: [hasHeader && ((0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Header, { title: title, titleId: titleId, slotAfterTitle: slotAfterTitle, subtitle: subtitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, actionButton: actionButton })), withHeaderDivider && hasHeader && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.dividerTop, "aria-hidden": true })), (0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Body, { bodyPadding: bodyPadding, children: content }), withFooterDivider && hasFooter && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.dividerBottom, "aria-hidden": true })), hasFooter && (0, jsx_runtime_1.jsx)(BottomSheetCustom_1.BottomSheetCustom.Footer, { children: footerContent })] })] }) }));
37
37
  }
@@ -140,6 +140,10 @@ export type BottomSheetProps = Omit<BottomSheetCustomProps, 'children' | 'disabl
140
140
  * @default true
141
141
  */
142
142
  withDividers?: boolean;
143
+ /** Разделитель под шапкой. По умолчанию используется `withDividers`. */
144
+ withHeaderDivider?: boolean;
145
+ /** Разделитель над футером. По умолчанию используется `withDividers`. */
146
+ withFooterDivider?: boolean;
143
147
  /**
144
148
  * Основная кнопка действия — объект пропсов `Button` (по умолчанию `view='filled'`,
145
149
  * `appearance='primary'`). Ширина зависит от `footerActionsOrientation` и числа кнопок.
@@ -1,3 +1,3 @@
1
1
  import { BottomSheetProps } from '../../types.js';
2
2
  /** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
3
- export declare function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers, swipeEnabled, className, ...rest }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers, withHeaderDivider, withFooterDivider, swipeEnabled, className, ...rest }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ function isMediaProps(value) {
8
8
  return typeof value === 'object' && value !== null && !isValidElement(value) && 'src' in value && 'alt' in value;
9
9
  }
10
10
  /** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
11
- export function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, swipeEnabled = true,
11
+ export function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, withHeaderDivider = withDividers, withFooterDivider = withDividers, swipeEnabled = true,
12
12
  // safeAreaTop/safeAreaBottom уходят в `...rest` → BottomSheetCustom (env-паддинг на `.content`).
13
13
  className, ...rest }) {
14
14
  const hasHeader = Boolean(title || onBackButtonClick || actionButton || slotAfterTitle || subtitle || slotSecondTitle);
@@ -27,5 +27,5 @@ className, ...rest }) {
27
27
  return (_jsx(BottomSheetCustom, { ...rest, swipeEnabled: swipeEnabled, ...(title ? { 'aria-labelledby': titleId } : {}), className: className, disableMotions: false, children: _jsxs("div", { className: styles.root, children: [hasMedia &&
28
28
  (isMediaProps(media) ? (_jsx(PopupMedia, { ...media })) : (
29
29
  // ReactNode-media: тот же data-media-kind-контракт со значением 'custom'.
30
- _jsx("div", { "data-test-id": TEST_IDS.media, "data-media-kind": 'custom', children: media }))), _jsxs("div", { className: styles.contentBlock, children: [hasHeader && (_jsx(BottomSheetCustom.Header, { title: title, titleId: titleId, slotAfterTitle: slotAfterTitle, subtitle: subtitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, actionButton: actionButton })), withDividers && hasHeader && (_jsx("div", { className: styles.divider, "data-test-id": TEST_IDS.dividerTop, "aria-hidden": true })), _jsx(BottomSheetCustom.Body, { bodyPadding: bodyPadding, children: content }), withDividers && hasFooter && (_jsx("div", { className: styles.divider, "data-test-id": TEST_IDS.dividerBottom, "aria-hidden": true })), hasFooter && _jsx(BottomSheetCustom.Footer, { children: footerContent })] })] }) }));
30
+ _jsx("div", { "data-test-id": TEST_IDS.media, "data-media-kind": 'custom', children: media }))), _jsxs("div", { className: styles.contentBlock, children: [hasHeader && (_jsx(BottomSheetCustom.Header, { title: title, titleId: titleId, slotAfterTitle: slotAfterTitle, subtitle: subtitle, slotSecondTitle: slotSecondTitle, onBackButtonClick: onBackButtonClick, actionButton: actionButton })), withHeaderDivider && hasHeader && (_jsx("div", { className: styles.divider, "data-test-id": TEST_IDS.dividerTop, "aria-hidden": true })), _jsx(BottomSheetCustom.Body, { bodyPadding: bodyPadding, children: content }), withFooterDivider && hasFooter && (_jsx("div", { className: styles.divider, "data-test-id": TEST_IDS.dividerBottom, "aria-hidden": true })), hasFooter && _jsx(BottomSheetCustom.Footer, { children: footerContent })] })] }) }));
31
31
  }
@@ -140,6 +140,10 @@ export type BottomSheetProps = Omit<BottomSheetCustomProps, 'children' | 'disabl
140
140
  * @default true
141
141
  */
142
142
  withDividers?: boolean;
143
+ /** Разделитель под шапкой. По умолчанию используется `withDividers`. */
144
+ withHeaderDivider?: boolean;
145
+ /** Разделитель над футером. По умолчанию используется `withDividers`. */
146
+ withFooterDivider?: boolean;
143
147
  /**
144
148
  * Основная кнопка действия — объект пропсов `Button` (по умолчанию `view='filled'`,
145
149
  * `appearance='primary'`). Ширина зависит от `footerActionsOrientation` и числа кнопок.