@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.
@@ -52,8 +52,7 @@ export function BottomSheetCustom(props: BottomSheetCustomProps) {
52
52
  showBackdrop = true,
53
53
  lockScroll = true,
54
54
  swipeEnabled = true,
55
- safeAreaTop = true,
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-top={(safeAreaTop && isFullHeight) || undefined}
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: токен из макета как минимум, на устройстве с вырезом — env, если он больше.
120
- // Верхний выставляется только при full-height (верх уходит под notch), см. `data-safe-area-top`.
121
- &[data-safe-area-bottom] {
122
- padding-bottom: max(
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-top] {
129
- padding-top: max(
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
- * Верхний safe-area отступ под iOS notch / status-bar. Размер — токен `safeArea.paddingTop` (32px),
93
- * на устройстве с большим `env(safe-area-inset-top)` — значение inset. Применяется, только когда
94
- * sheet раскрыт на полный вьюпорт: у неполного sheet'а верх и так не заходит под notch.
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
- safeAreaTop?: boolean;
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