@bytebrand/fe-ui-core-autobahn 1.0.88 → 1.0.91

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.
@@ -2,8 +2,18 @@
2
2
  // BaseModalWrapper is replaced by a plain fixed overlay + centered surface.
3
3
  // Deliberately NOT the kit ui/Modal — the cookie consent dialog has no title
4
4
  // bar / close button and must not be dismissible without a choice.
5
+ //
6
+ // Rendered via ReactDOM.createPortal into document.body (same technique as
7
+ // ui/Modal.tsx) rather than inline in the page tree: a React hydration-mismatch
8
+ // error ANYWHERE else on the page (a known, separate bug — see the
9
+ // SearchNextPage isMobile SSR/CSR mismatch) can corrupt sibling reconciliation
10
+ // enough that an inline `position: fixed` overlay ends up mounted in the wrong
11
+ // place in the DOM (observed: appearing as plain content below the footer
12
+ // instead of as an overlay). A body-level portal is immune to that — its DOM
13
+ // node never lives inside the page's own React subtree.
5
14
 
6
15
  import * as React from 'react';
16
+ import * as ReactDOM from 'react-dom';
7
17
 
8
18
  import ModalsConfig from './ModalsConfig';
9
19
 
@@ -30,13 +40,19 @@ const SURFACE: React.CSSProperties = {
30
40
  };
31
41
 
32
42
  const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
33
- if (!isVisible) return null;
34
- return (
35
- <div style={OVERLAY} role='dialog' aria-modal='true' aria-label='Cookie-Einstellungen'>
36
- <div style={SURFACE}>
37
- {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
43
+ if (!isVisible || typeof document === 'undefined') return null;
44
+ return ReactDOM.createPortal(
45
+ // wrapped in .md3: autobahn.css scopes every token/utility class (incl.
46
+ // .mbtn used by the modal buttons) under `.md3` and intentionally does
47
+ // nothing outside it — a bare document.body portal loses the theme.
48
+ <div className='md3'>
49
+ <div style={OVERLAY} role='dialog' aria-modal='true' aria-label='Cookie-Einstellungen'>
50
+ <div style={SURFACE}>
51
+ {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
52
+ </div>
38
53
  </div>
39
- </div>
54
+ </div>,
55
+ document.body
40
56
  );
41
57
  };
42
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.88",
3
+ "version": "1.0.91",
4
4
  "description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
5
5
  "main": "index.ts",
6
6
  "license": "UNLICENSED",