Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 97 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
},
"peerDependencies": {
"@ariakit/react": "~0.4.19",
"@base-ui/react": "^1.6.0",
"classnames": "^2.2.5",
"react": ">=18.0.0 <20.0.0",
"react-compiler-runtime": "^1.0.0",
Expand All @@ -73,6 +74,7 @@
},
"devDependencies": {
"@ariakit/react": "0.4.19",
"@base-ui/react": "1.6.0",
"@babel/cli": "7.29.7",
"@babel/core": "7.29.7",
"@babel/plugin-transform-runtime": "7.29.7",
Expand Down Expand Up @@ -156,10 +158,8 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"aria-hidden": "1.2.6",
"dayjs": "1.11.21",
"patch-package": "8.0.1",
"react-focus-lock": "2.13.7",
"react-keyed-flatten-children": "1.3.0",
"react-markdown": "5.0.3",
"use-callback-ref": "1.3.3"
Expand Down
17 changes: 17 additions & 0 deletions scripts/jestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,20 @@ if (!window.ResizeObserver) {
window.ResizeObserver = ResizeObserver
global.ResizeObserver = ResizeObserver
}

/**
* When focus falls back to the body, jsdom fires focusout events with the document as the
* `relatedTarget`, something browsers never do. Base UI's focus manager then calls
* `relatedTarget.hasAttribute(...)`, which does not exist on documents and throws. Give the
* document a no-op `hasAttribute` so those events are processed as not matching any element.
*
* @see https://github.com/mui/base-ui/blob/master/packages/react/src/floating-ui-react/components/FloatingFocusManager.tsx
*/
if (!('hasAttribute' in document)) {
Object.defineProperty(Document.prototype, 'hasAttribute', {
value: function hasAttribute() {
return false
},
configurable: true,
})
}
10 changes: 5 additions & 5 deletions src/modal/modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
z-index: var(--reactist-stacking-order-modal);
}

.overlay > [data-focus-lock-disabled] {
.overlay > .wrapper {
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -40,10 +40,10 @@
padding: var(--reactist-spacing-xxlarge);
}

.overlay.fitContent > [data-focus-lock-disabled] {
.overlay.fitContent > .wrapper {
padding-top: var(--reactist-modal-padding-top);
}
.overlay.fitContent > [data-focus-lock-disabled] .container {
.overlay.fitContent > .wrapper .container {
max-height: calc(100vh - 2 * var(--reactist-modal-padding-top));
}

Expand Down Expand Up @@ -96,7 +96,7 @@
width: 100% !important;
max-height: none;
}
.overlay.expand:not(.xsmall):not(.small) > [data-focus-lock-disabled] {
.overlay.expand:not(.xsmall):not(.small) > .wrapper {
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
Expand All @@ -112,7 +112,7 @@
width: 100% !important;
max-height: none;
}
.overlay.expand > [data-focus-lock-disabled] {
.overlay.expand > .wrapper {
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
Expand Down
Loading
Loading