@cloud-ru/ds-bottom-sheet 1.1.8-preview-b163635c.0 → 1.2.1-preview-ac2c37a8.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/CHANGELOG.md +6 -0
- package/README.md +12 -7
- package/dist/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/cjs/components/BottomSheet/BottomSheet.js +2 -2
- package/dist/cjs/components/BottomSheetCustom/BottomSheetCustom.js +2 -2
- package/dist/cjs/components/BottomSheetCustom/styles.module.css +4 -4
- package/dist/cjs/style.css +4 -4
- package/dist/cjs/types.d.ts +10 -5
- package/dist/esm/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +2 -2
- package/dist/esm/components/BottomSheetCustom/BottomSheetCustom.js +2 -2
- package/dist/esm/components/BottomSheetCustom/styles.module.css +4 -4
- package/dist/esm/style.css +4 -4
- package/dist/esm/types.d.ts +10 -5
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.tsx +2 -2
- package/src/components/BottomSheetCustom/BottomSheetCustom.tsx +4 -2
- package/src/components/BottomSheetCustom/styles.module.scss +12 -6
- package/src/types.ts +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# 1.2.0 (2026-10-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **FF-9223:** add SNAP_POINTS_PRESET constant ([939b55b](https://github.com/cloud-ru-tech/snack-v2/commit/939b55bb810568f381897e9cff73e4a0a74eb478))
|
|
11
|
+
|
|
6
12
|
## 1.1.7 (2026-09-30)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @ds/bottom-sheet
|
package/README.md
CHANGED
|
@@ -63,11 +63,14 @@ mobile-вьюпорте и всегда идут в столбик.
|
|
|
63
63
|
Тонкие линии между topBar↔body и body↔footer. Разграничивают закреплённые шапку и подвал от
|
|
64
64
|
прокручиваемого под ними содержимого. Передайте `withDividers={false}`, чтобы убрать обе линии.
|
|
65
65
|
|
|
66
|
-
### SafeArea (default `
|
|
67
|
-
|
|
68
|
-
`env(safe-area-inset-*)`
|
|
69
|
-
|
|
70
|
-
`
|
|
66
|
+
### SafeArea (default `safeAreaTop=true`, `safeAreaBottom=true`)
|
|
67
|
+
Отступы, резервирующие место под iOS notch / home-indicator и Android nav-bar. Размер — 32px из
|
|
68
|
+
токена `safeArea`; если `env(safe-area-inset-*)` устройства больше, берётся он.
|
|
69
|
+
|
|
70
|
+
- `safeAreaBottom` — снизу: футер не уходит под home-indicator.
|
|
71
|
+
- `safeAreaTop` — сверху, только когда sheet раскрыт на весь вьюпорт (`snapPoints` = `1` / `100dvh`).
|
|
72
|
+
|
|
73
|
+
Передайте `false`, если рамку safe-area с этой стороны обеспечивает окружение (например, нативная оболочка webview).
|
|
71
74
|
|
|
72
75
|
### Snap points (default `undefined` → height auto)
|
|
73
76
|
По дефолту sheet `height: auto` (один snap по высоте контента). Когда задан `snapPoints`-массив, sheet поддерживает несколько фиксированных позиций (iOS-detents-аналог):
|
|
@@ -682,7 +685,8 @@ export function NonModal() {
|
|
|
682
685
|
| `onSnapIndexChange` | `((snapIndex: number) => void)` | — | Callback изменения активного snap'а (пересечение swipe-границы или click по UI). <br/> Не вызывается при программной смене controlled `snapIndex`. |
|
|
683
686
|
| `open` | `boolean` | — | Управление состоянием показан / не показан. |
|
|
684
687
|
| `rootClassName` | `string` | — | CSS-класс корневого элемента portal'а. |
|
|
685
|
-
| `
|
|
688
|
+
| `safeAreaBottom` | `boolean` | `true` | Нижний safe-area отступ под iOS home-indicator и Android nav-bar. Размер — токен <br/> `safeArea.paddingBottom` (32px), на устройстве с большим `env(safe-area-inset-bottom)` — значение inset. |
|
|
689
|
+
| `safeAreaTop` | `boolean` | `true` | Верхний safe-area отступ под iOS notch / status-bar. Размер — токен `safeArea.paddingTop` (32px), <br/> на устройстве с большим `env(safe-area-inset-top)` — значение inset. Применяется, только когда <br/> sheet раскрыт на полный вьюпорт: у неполного sheet'а верх и так не заходит под notch. |
|
|
686
690
|
| `showBackdrop` | `boolean` | `true` | Отображение тёмной подложки за sheet'ом. При `false` фон не затемняется и click-outside <br/> не закрывает sheet (нет backdrop-узла, по которому ловится клик). |
|
|
687
691
|
| `slotAfterTitle` | `ReactNode` | — | Slot справа от title (внутри той же строки) — типично `QuestionTooltip`, status badge. |
|
|
688
692
|
| `slotSecondTitle` | `ReactNode` | — | Slot под подзаголовком — типично `SearchBar`, `SegmentControl`, `Filter`. |
|
|
@@ -941,7 +945,8 @@ export function CustomDisableMotions() {
|
|
|
941
945
|
| `onSnapIndexChange` | `((snapIndex: number) => void)` | — | Callback изменения активного snap'а (пересечение swipe-границы или click по UI). <br/> Не вызывается при программной смене controlled `snapIndex`. |
|
|
942
946
|
| `open` | `boolean` | — | Управление состоянием показан / не показан. |
|
|
943
947
|
| `rootClassName` | `string` | — | CSS-класс корневого элемента portal'а. |
|
|
944
|
-
| `
|
|
948
|
+
| `safeAreaBottom` | `boolean` | `true` | Нижний safe-area отступ под iOS home-indicator и Android nav-bar. Размер — токен <br/> `safeArea.paddingBottom` (32px), на устройстве с большим `env(safe-area-inset-bottom)` — значение inset. |
|
|
949
|
+
| `safeAreaTop` | `boolean` | `true` | Верхний safe-area отступ под iOS notch / status-bar. Размер — токен `safeArea.paddingTop` (32px), <br/> на устройстве с большим `env(safe-area-inset-top)` — значение inset. Применяется, только когда <br/> sheet раскрыт на полный вьюпорт: у неполного sheet'а верх и так не заходит под notch. |
|
|
945
950
|
| `showBackdrop` | `boolean` | `true` | Отображение тёмной подложки за sheet'ом. При `false` фон не затемняется и click-outside <br/> не закрывает sheet (нет backdrop-узла, по которому ловится клик). |
|
|
946
951
|
| `snapIndex` | `number` | — | Controlled-индекс активного snap'а. Если задан, sheet всегда находится на этом snap'е; <br/> swipe-up/down вызывают `onSnapIndexChange`, но не меняют позицию сами — consumer должен <br/> передать новое значение. |
|
|
947
952
|
| `snapPoints` | `SnapPoint` | — | Массив фиксированных позиций sheet'а от меньшей к большей. По дефолту `undefined` — <br/> sheet `height: auto` с одним snap'ом по высоте контента. <br/> Пример: `[0.5, 1]` — sheet открывается на половину экрана, drag вверх раскрывает <br/> до full-viewport; drag вниз ниже `0.5` ведёт к закрытию. <br/> Контракт массива (движок не сортирует и не дедуплицирует — порядок и различимость на <br/> стороне потребителя): <br/> - строго по возрастанию: индекс `0` — самая компактная позиция, последний — top / expanded; <br/> - значения должны резолвиться в различные высоты (`['50%', 0.5]` на типичном вьюпорте дадут <br/> одну высоту → дубль-индекс будет недостижим свайпом); <br/> - `'fit-content'` имеет смысл только как ЕДИНСТВЕННЫЙ snap (без `snapPoints`); внутри массива <br/> фиксированных позиций его «контентная» высота не определена. |
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BottomSheetProps } from '../../types';
|
|
2
|
-
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer +
|
|
2
|
+
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
|
|
3
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;
|
|
@@ -14,9 +14,9 @@ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
|
14
14
|
function isMediaProps(value) {
|
|
15
15
|
return typeof value === 'object' && value !== null && !(0, react_1.isValidElement)(value) && 'src' in value && 'alt' in value;
|
|
16
16
|
}
|
|
17
|
-
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer +
|
|
17
|
+
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
|
|
18
18
|
function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, swipeEnabled = true,
|
|
19
|
-
//
|
|
19
|
+
// safeAreaTop/safeAreaBottom уходят в `...rest` → BottomSheetCustom (env-паддинг на `.content`).
|
|
20
20
|
className, ...rest }) {
|
|
21
21
|
const hasHeader = Boolean(title || onBackButtonClick || actionButton || slotAfterTitle || subtitle || slotSecondTitle);
|
|
22
22
|
const hasMedia = media != null;
|
|
@@ -34,7 +34,7 @@ function resolveContainer(container, portalContextNode) {
|
|
|
34
34
|
* Pointer-Events swipe / snap-engine. Готовая анатомия — `BottomSheet`.
|
|
35
35
|
*/
|
|
36
36
|
function BottomSheetCustom(props) {
|
|
37
|
-
const { open, onClose, showBackdrop = true, lockScroll = true, swipeEnabled = true,
|
|
37
|
+
const { open, onClose, showBackdrop = true, lockScroll = true, swipeEnabled = true, safeAreaTop = true, safeAreaBottom = true, snapPoints, defaultSnapIndex, snapIndex, onSnapIndexChange, closeOnPopstate = true, disableMotions = false, container, className, rootClassName, children, ...rest } = props;
|
|
38
38
|
// Sheet модальный, если затемняет фон или лочит скролл. Non-modal не прячет фон от AT,
|
|
39
39
|
// не ловит фокус и закрывается по Esc при фокусе снаружи.
|
|
40
40
|
const isModal = showBackdrop || lockScroll;
|
|
@@ -113,7 +113,7 @@ function BottomSheetCustom(props) {
|
|
|
113
113
|
return (0, react_dom_1.createPortal)(
|
|
114
114
|
// RemoveScroll лочит фон-скролл (refcount для вложенных sheet'ов); `enabled={lockScroll}` —
|
|
115
115
|
// для non-modal фон остаётся прокручиваемым.
|
|
116
|
-
(0, jsx_runtime_1.jsx)(react_remove_scroll_1.RemoveScroll, { enabled: lockScroll, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, rootClassName), "data-active": isActive || undefined, "data-disable-motions": disableMotions || undefined, children: [showBackdrop && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.backdrop, "data-test-id": constants_1.TEST_IDS.backdrop, onClick: handleBackdropClick, "aria-hidden": true })), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.contentWrapper, "data-active": isActive || undefined, "data-full-height": isFullHeight || undefined, children: (0, jsx_runtime_1.jsxs)("div", { ref: mergeRefCb, className: (0, classnames_1.default)(styles_module_scss_1.default.content, themeClassName, className), role: 'dialog', "aria-modal": isModal ? 'true' : undefined, "data-test-id": constants_1.TEST_IDS.root, "data-safe-area":
|
|
116
|
+
(0, jsx_runtime_1.jsx)(react_remove_scroll_1.RemoveScroll, { enabled: lockScroll, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, rootClassName), "data-active": isActive || undefined, "data-disable-motions": disableMotions || undefined, children: [showBackdrop && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.backdrop, "data-test-id": constants_1.TEST_IDS.backdrop, onClick: handleBackdropClick, "aria-hidden": true })), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.contentWrapper, "data-active": isActive || undefined, "data-full-height": isFullHeight || undefined, children: (0, jsx_runtime_1.jsxs)("div", { ref: mergeRefCb, className: (0, classnames_1.default)(styles_module_scss_1.default.content, themeClassName, className), role: 'dialog', "aria-modal": isModal ? 'true' : undefined, "data-test-id": constants_1.TEST_IDS.root, "data-safe-area-top": (safeAreaTop && isFullHeight) || undefined, "data-safe-area-bottom": safeAreaBottom || undefined, "data-snap-index": activeSnapIndex, "data-snap-points": snapPoints && snapPoints.length > 0 ? snapPoints.length : undefined, "data-swipe-enabled": swipeEnabled || undefined, "data-dragging": isDragging || undefined, "data-full-height": isFullHeight || undefined, ...supportProps, ...(swipeEnabled ? dragHandlers : {}), children: [swipeEnabled && (0, jsx_runtime_1.jsx)(helperComponents_1.Handle, {}), (0, jsx_runtime_1.jsx)(popup_private_1.OverlaySurfaceProvider, { surface: popup_private_1.OVERLAY_SURFACE.Sheet, children: children })] }) })] }) }), targetNode);
|
|
117
117
|
}
|
|
118
118
|
BottomSheetCustom.Header = popup_private_1.PopupHeader;
|
|
119
119
|
BottomSheetCustom.Body = popup_private_1.PopupBody;
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
border-top-left-radius:0;
|
|
78
78
|
border-top-right-radius:0;
|
|
79
79
|
}
|
|
80
|
-
.content[data-safe-area]{
|
|
81
|
-
padding-bottom:env(safe-area-inset-bottom);
|
|
80
|
+
.content[data-safe-area-bottom]{
|
|
81
|
+
padding-bottom:max(var(--sn-bottomSheet-anatomy-safeArea-paddingBottom, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-bottom));
|
|
82
82
|
}
|
|
83
|
-
.content[data-safe-area
|
|
84
|
-
padding-top:env(safe-area-inset-top);
|
|
83
|
+
.content[data-safe-area-top]{
|
|
84
|
+
padding-top:max(var(--sn-bottomSheet-anatomy-safeArea-paddingTop, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-top));
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@media (prefers-reduced-motion: reduce){
|
package/dist/cjs/style.css
CHANGED
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
border-top-left-radius:0;
|
|
105
105
|
border-top-right-radius:0;
|
|
106
106
|
}
|
|
107
|
-
.content[data-safe-area]{
|
|
108
|
-
padding-bottom:env(safe-area-inset-bottom);
|
|
107
|
+
.content[data-safe-area-bottom]{
|
|
108
|
+
padding-bottom:max(var(--sn-bottomSheet-anatomy-safeArea-paddingBottom, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-bottom));
|
|
109
109
|
}
|
|
110
|
-
.content[data-safe-area
|
|
111
|
-
padding-top:env(safe-area-inset-top);
|
|
110
|
+
.content[data-safe-area-top]{
|
|
111
|
+
padding-top:max(var(--sn-bottomSheet-anatomy-safeArea-paddingTop, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-top));
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
@media (prefers-reduced-motion: reduce){
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -74,13 +74,18 @@ export type BottomSheetCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
74
74
|
*/
|
|
75
75
|
closeOnPopstate?: boolean;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
* на
|
|
79
|
-
*
|
|
80
|
-
* Верхний отступ добавляется только когда sheet раскрыт на полный вьюпорт (его верх под notch).
|
|
77
|
+
* Верхний safe-area отступ под iOS notch / status-bar. Размер — токен `safeArea.paddingTop` (32px),
|
|
78
|
+
* на устройстве с большим `env(safe-area-inset-top)` — значение inset. Применяется, только когда
|
|
79
|
+
* sheet раскрыт на полный вьюпорт: у неполного sheet'а верх и так не заходит под notch.
|
|
81
80
|
* @default true
|
|
82
81
|
*/
|
|
83
|
-
|
|
82
|
+
safeAreaTop?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Нижний safe-area отступ под iOS home-indicator и Android nav-bar. Размер — токен
|
|
85
|
+
* `safeArea.paddingBottom` (32px), на устройстве с большим `env(safe-area-inset-bottom)` — значение inset.
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
safeAreaBottom?: boolean;
|
|
84
89
|
/**
|
|
85
90
|
* Отключить анимации открытия / закрытия и перехода между snap-точками.
|
|
86
91
|
* @default false
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BottomSheetProps } from '../../types.js';
|
|
2
|
-
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer +
|
|
2
|
+
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
|
|
3
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;
|
|
@@ -8,9 +8,9 @@ import styles from './styles.module.css';
|
|
|
8
8
|
function isMediaProps(value) {
|
|
9
9
|
return typeof value === 'object' && value !== null && !isValidElement(value) && 'src' in value && 'alt' in value;
|
|
10
10
|
}
|
|
11
|
-
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer +
|
|
11
|
+
/** Обёртка `@cloud-ru/ds-bottom-sheet` с готовой анатомией: media + header + body + footer + safe-area + dividers. */
|
|
12
12
|
export function BottomSheet({ title, slotAfterTitle, subtitle, slotSecondTitle, onBackButtonClick, actionButton, media, content, bodyPadding = true, approveButton, cancelButton, additionalButton, footerActionsOrientation, footer, footerTestIds, withDividers = true, swipeEnabled = true,
|
|
13
|
-
//
|
|
13
|
+
// safeAreaTop/safeAreaBottom уходят в `...rest` → BottomSheetCustom (env-паддинг на `.content`).
|
|
14
14
|
className, ...rest }) {
|
|
15
15
|
const hasHeader = Boolean(title || onBackButtonClick || actionButton || slotAfterTitle || subtitle || slotSecondTitle);
|
|
16
16
|
const hasMedia = media != null;
|
|
@@ -28,7 +28,7 @@ function resolveContainer(container, portalContextNode) {
|
|
|
28
28
|
* Pointer-Events swipe / snap-engine. Готовая анатомия — `BottomSheet`.
|
|
29
29
|
*/
|
|
30
30
|
export function BottomSheetCustom(props) {
|
|
31
|
-
const { open, onClose, showBackdrop = true, lockScroll = true, swipeEnabled = true,
|
|
31
|
+
const { open, onClose, showBackdrop = true, lockScroll = true, swipeEnabled = true, safeAreaTop = true, safeAreaBottom = true, snapPoints, defaultSnapIndex, snapIndex, onSnapIndexChange, closeOnPopstate = true, disableMotions = false, container, className, rootClassName, children, ...rest } = props;
|
|
32
32
|
// Sheet модальный, если затемняет фон или лочит скролл. Non-modal не прячет фон от AT,
|
|
33
33
|
// не ловит фокус и закрывается по Esc при фокусе снаружи.
|
|
34
34
|
const isModal = showBackdrop || lockScroll;
|
|
@@ -107,7 +107,7 @@ export function BottomSheetCustom(props) {
|
|
|
107
107
|
return createPortal(
|
|
108
108
|
// RemoveScroll лочит фон-скролл (refcount для вложенных sheet'ов); `enabled={lockScroll}` —
|
|
109
109
|
// для non-modal фон остаётся прокручиваемым.
|
|
110
|
-
_jsx(RemoveScroll, { enabled: lockScroll, children: _jsxs("div", { className: cn(styles.root, rootClassName), "data-active": isActive || undefined, "data-disable-motions": disableMotions || undefined, children: [showBackdrop && (_jsx("div", { className: styles.backdrop, "data-test-id": TEST_IDS.backdrop, onClick: handleBackdropClick, "aria-hidden": true })), _jsx("div", { className: styles.contentWrapper, "data-active": isActive || undefined, "data-full-height": isFullHeight || undefined, children: _jsxs("div", { ref: mergeRefCb, className: cn(styles.content, themeClassName, className), role: 'dialog', "aria-modal": isModal ? 'true' : undefined, "data-test-id": TEST_IDS.root, "data-safe-area":
|
|
110
|
+
_jsx(RemoveScroll, { enabled: lockScroll, children: _jsxs("div", { className: cn(styles.root, rootClassName), "data-active": isActive || undefined, "data-disable-motions": disableMotions || undefined, children: [showBackdrop && (_jsx("div", { className: styles.backdrop, "data-test-id": TEST_IDS.backdrop, onClick: handleBackdropClick, "aria-hidden": true })), _jsx("div", { className: styles.contentWrapper, "data-active": isActive || undefined, "data-full-height": isFullHeight || undefined, children: _jsxs("div", { ref: mergeRefCb, className: cn(styles.content, themeClassName, className), role: 'dialog', "aria-modal": isModal ? 'true' : undefined, "data-test-id": TEST_IDS.root, "data-safe-area-top": (safeAreaTop && isFullHeight) || undefined, "data-safe-area-bottom": safeAreaBottom || undefined, "data-snap-index": activeSnapIndex, "data-snap-points": snapPoints && snapPoints.length > 0 ? snapPoints.length : undefined, "data-swipe-enabled": swipeEnabled || undefined, "data-dragging": isDragging || undefined, "data-full-height": isFullHeight || undefined, ...supportProps, ...(swipeEnabled ? dragHandlers : {}), children: [swipeEnabled && _jsx(Handle, {}), _jsx(OverlaySurfaceProvider, { surface: OVERLAY_SURFACE.Sheet, children: children })] }) })] }) }), targetNode);
|
|
111
111
|
}
|
|
112
112
|
BottomSheetCustom.Header = PopupHeader;
|
|
113
113
|
BottomSheetCustom.Body = PopupBody;
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
border-top-left-radius:0;
|
|
78
78
|
border-top-right-radius:0;
|
|
79
79
|
}
|
|
80
|
-
.content[data-safe-area]{
|
|
81
|
-
padding-bottom:env(safe-area-inset-bottom);
|
|
80
|
+
.content[data-safe-area-bottom]{
|
|
81
|
+
padding-bottom:max(var(--sn-bottomSheet-anatomy-safeArea-paddingBottom, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-bottom));
|
|
82
82
|
}
|
|
83
|
-
.content[data-safe-area
|
|
84
|
-
padding-top:env(safe-area-inset-top);
|
|
83
|
+
.content[data-safe-area-top]{
|
|
84
|
+
padding-top:max(var(--sn-bottomSheet-anatomy-safeArea-paddingTop, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-top));
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@media (prefers-reduced-motion: reduce){
|
package/dist/esm/style.css
CHANGED
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
border-top-left-radius:0;
|
|
105
105
|
border-top-right-radius:0;
|
|
106
106
|
}
|
|
107
|
-
.content[data-safe-area]{
|
|
108
|
-
padding-bottom:env(safe-area-inset-bottom);
|
|
107
|
+
.content[data-safe-area-bottom]{
|
|
108
|
+
padding-bottom:max(var(--sn-bottomSheet-anatomy-safeArea-paddingBottom, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-bottom));
|
|
109
109
|
}
|
|
110
|
-
.content[data-safe-area
|
|
111
|
-
padding-top:env(safe-area-inset-top);
|
|
110
|
+
.content[data-safe-area-top]{
|
|
111
|
+
padding-top:max(var(--sn-bottomSheet-anatomy-safeArea-paddingTop, var(--sn-primitive-dimension-32, 32px)), env(safe-area-inset-top));
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
@media (prefers-reduced-motion: reduce){
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -74,13 +74,18 @@ export type BottomSheetCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
74
74
|
*/
|
|
75
75
|
closeOnPopstate?: boolean;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
* на
|
|
79
|
-
*
|
|
80
|
-
* Верхний отступ добавляется только когда sheet раскрыт на полный вьюпорт (его верх под notch).
|
|
77
|
+
* Верхний safe-area отступ под iOS notch / status-bar. Размер — токен `safeArea.paddingTop` (32px),
|
|
78
|
+
* на устройстве с большим `env(safe-area-inset-top)` — значение inset. Применяется, только когда
|
|
79
|
+
* sheet раскрыт на полный вьюпорт: у неполного sheet'а верх и так не заходит под notch.
|
|
81
80
|
* @default true
|
|
82
81
|
*/
|
|
83
|
-
|
|
82
|
+
safeAreaTop?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Нижний safe-area отступ под iOS home-indicator и Android nav-bar. Размер — токен
|
|
85
|
+
* `safeArea.paddingBottom` (32px), на устройстве с большим `env(safe-area-inset-bottom)` — значение inset.
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
safeAreaBottom?: boolean;
|
|
84
89
|
/**
|
|
85
90
|
* Отключить анимации открытия / закрытия и перехода между snap-точками.
|
|
86
91
|
* @default false
|