@bytebrand/fe-ui-core-autobahn 1.0.158 → 1.0.159

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.
Files changed (2) hide show
  1. package/package.json +30 -30
  2. package/ui/Modal.tsx +10 -2
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.158",
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
- "main": "index.ts",
6
- "license": "UNLICENSED",
7
- "peerDependencies": {
8
- "react": "^18.0.0",
9
- "react-dom": "^18.0.0"
10
- },
11
- "dependencies": {
12
- "@bytebrand/car-schema-selectors": "^2.0.7",
13
- "@bytebrand/fe-financing": "^5.14.20",
14
- "classnames": "2.2.6",
15
- "clsx": "^2.1.1",
16
- "d3-format": "1.4.5",
17
- "js-cookie": "^2.2.0",
18
- "lodash": "^4.17.21",
19
- "lucide-react": "^0.288.0",
20
- "mobx-react": "^7.6.0",
21
- "moment": "^2.29.1",
22
- "qs": "^6.6.0",
23
- "react-device-detect": "^2.1.2",
24
- "react-grid-system": "^5.0.2",
25
- "react-lazyload": "^3.2.0",
26
- "react-scroll": "^1.9.3",
27
- "react-slick": "^0.29.0",
28
- "slick-carousel": "1.8.1"
29
- }
30
- }
1
+ {
2
+ "name": "@bytebrand/fe-ui-core-autobahn",
3
+ "version": "1.0.159",
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
+ "main": "index.ts",
6
+ "license": "UNLICENSED",
7
+ "peerDependencies": {
8
+ "react": "^18.0.0",
9
+ "react-dom": "^18.0.0"
10
+ },
11
+ "dependencies": {
12
+ "@bytebrand/car-schema-selectors": "^2.0.7",
13
+ "@bytebrand/fe-financing": "^5.14.20",
14
+ "classnames": "2.2.6",
15
+ "clsx": "^2.1.1",
16
+ "d3-format": "1.4.5",
17
+ "js-cookie": "^2.2.0",
18
+ "lodash": "^4.17.21",
19
+ "lucide-react": "^0.288.0",
20
+ "mobx-react": "^7.6.0",
21
+ "moment": "^2.29.1",
22
+ "qs": "^6.6.0",
23
+ "react-device-detect": "^2.1.2",
24
+ "react-grid-system": "^5.0.2",
25
+ "react-lazyload": "^3.2.0",
26
+ "react-scroll": "^1.9.3",
27
+ "react-slick": "^0.29.0",
28
+ "slick-carousel": "1.8.1"
29
+ }
30
+ }
package/ui/Modal.tsx CHANGED
@@ -136,7 +136,10 @@ const Modal: React.FunctionComponent<ModalProps> = ({
136
136
  const prevOverflow = document.body.style.overflow;
137
137
  document.body.style.overflow = 'hidden';
138
138
 
139
- // focus the dialog surface, not its first control: a header icon would take the :focus-visible ring on open.
139
+ // move focus to the first control in the body/footer (an input, a link, a button) so forms are
140
+ // ready to type into and browser autofill can offer itself; the head row (close + headerAction
141
+ // icons) is skipped so a header icon never takes the :focus-visible ring on open. Falls back to
142
+ // the surface itself when the body has nothing focusable.
140
143
  // { preventScroll: true }: this runs at the very first animation frame of the mobile
141
144
  // sheet's own mmodal-sheet-up entrance (md3.css) — at that instant the surface's actual
142
145
  // computed transform is still the keyframe's `from` state (translateY(100%), pushed
@@ -148,7 +151,12 @@ const Modal: React.FunctionComponent<ModalProps> = ({
148
151
  // skips that native auto-scroll entirely, so the CSS animation alone moves the sheet
149
152
  // (same fix as fe-main's BaseModal.tsx, which hit this same glitch first).
150
153
  const surface = surfaceRef.current;
151
- if (surface) surface.focus({ preventScroll: true });
154
+ if (surface) {
155
+ const first = Array.prototype.slice
156
+ .call(surface.querySelectorAll<HTMLElement>(FOCUSABLE))
157
+ .find((el: HTMLElement) => !el.closest('.mmodal-head'));
158
+ (first || surface).focus({ preventScroll: true });
159
+ }
152
160
 
153
161
  return () => {
154
162
  document.body.style.overflow = prevOverflow;