Skip to content
Open
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
5 changes: 4 additions & 1 deletion packages/cyberstorm/src/newComponents/Modal/Modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
.modal__overlay {
position: fixed;
background: rgb(0 0 0 / 0.6);
backdrop-filter: blur(10px);
animation: overlay-show 150ms cubic-bezier(0.16, 1, 0.3, 1);
inset: 0;
}

.modal__overlay--blur {
backdrop-filter: blur(10px);
}

.modal__content {
position: fixed;
top: 50%;
Expand Down
12 changes: 11 additions & 1 deletion packages/cyberstorm/src/newComponents/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export interface ModalProps
* Provide the id of an element that describes the dialog.
*/
ariaDescribedby?: string;
/**
* When true, the modal overlay applies a heavy blur effect. Disable for better performance.
*/
enableBackdropBlur?: boolean;
}
// TODO: Style system compatibility is currently degraded, improve to a agreed upon level according to specifications

Expand Down Expand Up @@ -189,6 +193,7 @@ export function Modal(props: ModalProps) {
titleContent,
footerContent,
ariaDescribedby,
enableBackdropBlur = false,
} = props;

const filteredChildren: ReactNode[] = [];
Expand Down Expand Up @@ -244,7 +249,12 @@ export function Modal(props: ModalProps) {
>
{trigger ? <Dialog.Trigger asChild>{trigger}</Dialog.Trigger> : null}
<Dialog.Portal>
<Dialog.Overlay className="modal__overlay">
<Dialog.Overlay
className={classnames(
"modal__overlay",
enableBackdropBlur ? "modal__overlay--blur" : null
)}
>
<Dialog.Content
className={classnames(
"modal",
Expand Down
Loading