@wasto/cms-components 1.5.15 → 1.5.16
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/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +1 -1
- package/src/components/header/Header.tsx +11 -2
package/dist/index.d.mts
CHANGED
|
@@ -133,15 +133,20 @@ type HeaderProps = {
|
|
|
133
133
|
canGoBack: () => boolean;
|
|
134
134
|
goBack: () => void;
|
|
135
135
|
};
|
|
136
|
-
/** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
|
|
136
|
+
/** Flotte au-dessus du contenu (ex. carte) : fond transparent + safe-area top. */
|
|
137
137
|
readonly overlay?: boolean;
|
|
138
138
|
/**
|
|
139
139
|
* Config layout (`header.elements`) — logo / actions.
|
|
140
140
|
* Si fournie (même vide), le fallback titre d’écran ne s’applique pas.
|
|
141
141
|
*/
|
|
142
142
|
readonly headerConfig?: AppHeaderConfig | null;
|
|
143
|
+
/**
|
|
144
|
+
* Force le padding safe-area top. Par défaut : uniquement en `overlay`
|
|
145
|
+
* (le header React Navigation est déjà placé sous la status bar).
|
|
146
|
+
*/
|
|
147
|
+
readonly safeTop?: boolean;
|
|
143
148
|
};
|
|
144
|
-
declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
|
|
149
|
+
declare function Header({ options, route, navigation, overlay, headerConfig, safeTop, }: HeaderProps): ReactNode;
|
|
145
150
|
|
|
146
151
|
type LocationsMapProps = {
|
|
147
152
|
fullScreen?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -133,15 +133,20 @@ type HeaderProps = {
|
|
|
133
133
|
canGoBack: () => boolean;
|
|
134
134
|
goBack: () => void;
|
|
135
135
|
};
|
|
136
|
-
/** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
|
|
136
|
+
/** Flotte au-dessus du contenu (ex. carte) : fond transparent + safe-area top. */
|
|
137
137
|
readonly overlay?: boolean;
|
|
138
138
|
/**
|
|
139
139
|
* Config layout (`header.elements`) — logo / actions.
|
|
140
140
|
* Si fournie (même vide), le fallback titre d’écran ne s’applique pas.
|
|
141
141
|
*/
|
|
142
142
|
readonly headerConfig?: AppHeaderConfig | null;
|
|
143
|
+
/**
|
|
144
|
+
* Force le padding safe-area top. Par défaut : uniquement en `overlay`
|
|
145
|
+
* (le header React Navigation est déjà placé sous la status bar).
|
|
146
|
+
*/
|
|
147
|
+
readonly safeTop?: boolean;
|
|
143
148
|
};
|
|
144
|
-
declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
|
|
149
|
+
declare function Header({ options, route, navigation, overlay, headerConfig, safeTop, }: HeaderProps): ReactNode;
|
|
145
150
|
|
|
146
151
|
type LocationsMapProps = {
|
|
147
152
|
fullScreen?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -8320,12 +8320,14 @@ function Header({
|
|
|
8320
8320
|
route,
|
|
8321
8321
|
navigation,
|
|
8322
8322
|
overlay = false,
|
|
8323
|
-
headerConfig
|
|
8323
|
+
headerConfig,
|
|
8324
|
+
safeTop
|
|
8324
8325
|
}) {
|
|
8325
8326
|
const { theme } = useTheme();
|
|
8326
8327
|
const t = resolveTheme(theme);
|
|
8327
8328
|
const themedStyles = createThemedStyles14(theme);
|
|
8328
|
-
const
|
|
8329
|
+
const applyTopInset = safeTop ?? overlay;
|
|
8330
|
+
const topInset = useSafeAreaPadding(applyTopInset ? ["top"] : []);
|
|
8329
8331
|
const { hasUnread } = useAnnouncements();
|
|
8330
8332
|
const { push } = useAppNavigation();
|
|
8331
8333
|
const screenTitle = (0, import_react35.useMemo)(
|
package/dist/index.mjs
CHANGED
|
@@ -8398,12 +8398,14 @@ function Header({
|
|
|
8398
8398
|
route,
|
|
8399
8399
|
navigation,
|
|
8400
8400
|
overlay = false,
|
|
8401
|
-
headerConfig
|
|
8401
|
+
headerConfig,
|
|
8402
|
+
safeTop
|
|
8402
8403
|
}) {
|
|
8403
8404
|
const { theme } = useTheme();
|
|
8404
8405
|
const t = resolveTheme(theme);
|
|
8405
8406
|
const themedStyles = createThemedStyles14(theme);
|
|
8406
|
-
const
|
|
8407
|
+
const applyTopInset = safeTop ?? overlay;
|
|
8408
|
+
const topInset = useSafeAreaPadding(applyTopInset ? ["top"] : []);
|
|
8407
8409
|
const { hasUnread } = useAnnouncements();
|
|
8408
8410
|
const { push } = useAppNavigation();
|
|
8409
8411
|
const screenTitle = useMemo20(
|
package/package.json
CHANGED
|
@@ -86,13 +86,18 @@ export type HeaderProps = {
|
|
|
86
86
|
canGoBack: () => boolean;
|
|
87
87
|
goBack: () => void;
|
|
88
88
|
};
|
|
89
|
-
/** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
|
|
89
|
+
/** Flotte au-dessus du contenu (ex. carte) : fond transparent + safe-area top. */
|
|
90
90
|
readonly overlay?: boolean;
|
|
91
91
|
/**
|
|
92
92
|
* Config layout (`header.elements`) — logo / actions.
|
|
93
93
|
* Si fournie (même vide), le fallback titre d’écran ne s’applique pas.
|
|
94
94
|
*/
|
|
95
95
|
readonly headerConfig?: AppHeaderConfig | null;
|
|
96
|
+
/**
|
|
97
|
+
* Force le padding safe-area top. Par défaut : uniquement en `overlay`
|
|
98
|
+
* (le header React Navigation est déjà placé sous la status bar).
|
|
99
|
+
*/
|
|
100
|
+
readonly safeTop?: boolean;
|
|
96
101
|
};
|
|
97
102
|
|
|
98
103
|
function resolveLogoUri(
|
|
@@ -172,11 +177,15 @@ export function Header({
|
|
|
172
177
|
navigation,
|
|
173
178
|
overlay = false,
|
|
174
179
|
headerConfig,
|
|
180
|
+
safeTop,
|
|
175
181
|
}: HeaderProps): ReactNode {
|
|
176
182
|
const { theme } = useTheme();
|
|
177
183
|
const t = resolveTheme(theme);
|
|
178
184
|
const themedStyles = createThemedStyles(theme);
|
|
179
|
-
|
|
185
|
+
// Nav header : RN place déjà sous la status bar → pas de double inset.
|
|
186
|
+
// Overlay (carte) : on flotte sous le notch → inset requis.
|
|
187
|
+
const applyTopInset = safeTop ?? overlay;
|
|
188
|
+
const topInset = useSafeAreaPadding(applyTopInset ? ["top"] : []);
|
|
180
189
|
const { hasUnread } = useAnnouncements();
|
|
181
190
|
const { push } = useAppNavigation();
|
|
182
191
|
|