@cloud-ru/ds-bottom-sheet 1.2.1-preview-ac2c37a8.0 → 1.2.1
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 +4 -0
- package/README.md +7 -12
- 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 +5 -10
- 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 +5 -10
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/BottomSheet/BottomSheet.tsx +2 -2
- package/src/components/BottomSheetCustom/BottomSheetCustom.tsx +2 -4
- package/src/components/BottomSheetCustom/styles.module.scss +6 -12
- package/src/types.ts +5 -10
|
@@ -52,8 +52,7 @@ export function BottomSheetCustom(props: BottomSheetCustomProps) {
|
|
|
52
52
|
showBackdrop = true,
|
|
53
53
|
lockScroll = true,
|
|
54
54
|
swipeEnabled = true,
|
|
55
|
-
|
|
56
|
-
safeAreaBottom = true,
|
|
55
|
+
safeArea = true,
|
|
57
56
|
snapPoints,
|
|
58
57
|
defaultSnapIndex,
|
|
59
58
|
snapIndex,
|
|
@@ -189,8 +188,7 @@ export function BottomSheetCustom(props: BottomSheetCustomProps) {
|
|
|
189
188
|
// aria-modal только для модального sheet'а: non-modal оставляет фон доступным AT.
|
|
190
189
|
aria-modal={isModal ? 'true' : undefined}
|
|
191
190
|
data-test-id={TEST_IDS.root}
|
|
192
|
-
data-safe-area
|
|
193
|
-
data-safe-area-bottom={safeAreaBottom || undefined}
|
|
191
|
+
data-safe-area={safeArea || undefined}
|
|
194
192
|
data-snap-index={activeSnapIndex}
|
|
195
193
|
// Пустой массив ведёт себя как single fit-content — атрибут не выставляем.
|
|
196
194
|
data-snap-points={snapPoints && snapPoints.length > 0 ? snapPoints.length : undefined}
|
|
@@ -116,20 +116,14 @@
|
|
|
116
116
|
border-top-right-radius: 0;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
// Safe-area:
|
|
120
|
-
//
|
|
121
|
-
&[data-safe-area
|
|
122
|
-
padding-bottom:
|
|
123
|
-
#{base.simple-var(bottomSheet.$bottomSheet, 'anatomy', 'safeArea', 'padding-bottom')},
|
|
124
|
-
env(safe-area-inset-bottom)
|
|
125
|
-
);
|
|
119
|
+
// Safe-area: env-паддинг прямо на `.content`. Нижний — всегда (home-indicator), верхний —
|
|
120
|
+
// только при full-height (верх уходит под notch). Без выреза `env(...)` = 0.
|
|
121
|
+
&[data-safe-area] {
|
|
122
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
126
123
|
}
|
|
127
124
|
|
|
128
|
-
&[data-safe-area-
|
|
129
|
-
padding-top:
|
|
130
|
-
#{base.simple-var(bottomSheet.$bottomSheet, 'anatomy', 'safeArea', 'padding-top')},
|
|
131
|
-
env(safe-area-inset-top)
|
|
132
|
-
);
|
|
125
|
+
&[data-safe-area][data-full-height] {
|
|
126
|
+
padding-top: env(safe-area-inset-top);
|
|
133
127
|
}
|
|
134
128
|
}
|
|
135
129
|
|
package/src/types.ts
CHANGED
|
@@ -89,18 +89,13 @@ export type BottomSheetCustomProps = WithSupportProps<
|
|
|
89
89
|
*/
|
|
90
90
|
closeOnPopstate?: boolean;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
* на
|
|
94
|
-
*
|
|
92
|
+
* Резервировать ли место под iOS notch / home-indicator и Android nav-bar. Реализовано паддингом
|
|
93
|
+
* на `.content` через `env(safe-area-inset-*)`: на устройстве без выреза/индикатора (и на desktop)
|
|
94
|
+
* inset = 0, поэтому никакого «лишнего» отступа не появляется; на notched-устройстве — ровно нужный.
|
|
95
|
+
* Верхний отступ добавляется только когда sheet раскрыт на полный вьюпорт (его верх под notch).
|
|
95
96
|
* @default true
|
|
96
97
|
*/
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Нижний safe-area отступ под iOS home-indicator и Android nav-bar. Размер — токен
|
|
100
|
-
* `safeArea.paddingBottom` (32px), на устройстве с большим `env(safe-area-inset-bottom)` — значение inset.
|
|
101
|
-
* @default true
|
|
102
|
-
*/
|
|
103
|
-
safeAreaBottom?: boolean;
|
|
98
|
+
safeArea?: boolean;
|
|
104
99
|
/**
|
|
105
100
|
* Отключить анимации открытия / закрытия и перехода между snap-точками.
|
|
106
101
|
* @default false
|