Skip to content

Commit 3084012

Browse files
Fix modal backdrop (#131)
* Fix modal backdrop * Bump version to 1.0.0-beta.22
1 parent b542d6d commit 3084012

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@synergycodes/axiom",
33
"type": "module",
4-
"version": "1.0.0-beta.21",
4+
"version": "1.0.0-beta.22",
55
"description": "A React library for creating node-based UIs and diagram-driven applications. Perfect for React Flow users, providing ready-to-use node templates and components that work seamlessly with React Flow's ecosystem.",
66
"keywords": [
77
"react",

packages/ui/src/components/modal/modal.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
left: 0;
7575
width: 100%;
7676
height: 100%;
77-
z-index: 1;
77+
z-index: 0;
7878
inset: 0;
7979
background-color: color-mix(
8080
in srgb,

packages/ui/src/components/modal/modal.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const Modal = forwardRef<HTMLDivElement, ModalProps>(
6767
open={open}
6868
onClose={onClose}
6969
slots={{
70-
backdrop: (props) => <Backdrop {...props} onClose={onClose} />,
70+
backdrop: Backdrop,
7171
}}
7272
>
7373
<Fade in={open}>
@@ -112,23 +112,26 @@ export const Modal = forwardRef<HTMLDivElement, ModalProps>(
112112
/**
113113
* Backdrop component for the modal that dims the background
114114
*/
115-
const Backdrop = forwardRef<
116-
HTMLDivElement,
117-
{ open?: boolean; className: string; onClose?: () => void }
118-
>((props, ref) => {
119-
const { open, className, onClose } = props;
115+
const Backdrop = forwardRef<HTMLDivElement, BackdropProps>((props, ref) => {
116+
const { open, className } = props;
120117

121118
return (
122119
<Fade in={open}>
123-
<div className={clsx(styles['backdrop'], className)} ref={ref}>
124-
{onClose && (
125-
<button
126-
onClick={onClose}
127-
className={styles['backdrop-close']}
128-
type="button"
129-
/>
120+
<div
121+
{...props}
122+
ref={ref}
123+
className={clsx(
124+
{ 'base-Backdrop-open': open },
125+
styles['backdrop'],
126+
className,
130127
)}
131-
</div>
128+
/>
132129
</Fade>
133130
);
134131
});
132+
133+
type BackdropProps = {
134+
open?: boolean;
135+
className: string;
136+
onClose?: () => void;
137+
};

0 commit comments

Comments
 (0)