Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@synergycodes/overflow-ui",
"type": "module",
"version": "1.0.0-beta.24",
"version": "1.0.0-beta.25",
"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.",
"keywords": [
"react",
Expand Down
77 changes: 42 additions & 35 deletions packages/ui/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,44 @@ import type { WithIcon } from '@ui/shared/types/with-icon';
import { X } from '@phosphor-icons/react';
import type { FooterVariant } from './types';

type ModalProps = Partial<WithIcon> & {
/**
* Title displayed in the modal header
*/
title: string;
/**
* Optional subtitle displayed below the title
*/
subtitle?: string;
/**
* Content to be displayed in the modal body
*/
children?: ReactNode;
/**
* Content to be displayed in the modal footer
*/
footer?: ReactNode;
/**
* Size variant of the modal
*/
size?: 'regular' | 'large';
/**
* Variant of the footer styling
*/
footerVariant?: FooterVariant;
/**
* Controls the visibility of the modal
*/
open: boolean;
/**
* Callback function called when the modal is closed
*/
onClose?: () => void;
};
type ModalProps = React.DetailedHTMLProps<
React.HTMLAttributes<HTMLDivElement>,
HTMLDivElement
> &
Partial<WithIcon> & {
/**
* Title displayed in the modal header
*/
title: string;
/**
* Optional subtitle displayed below the title
*/
subtitle?: string;
/**
* Content to be displayed in the modal body
*/
children?: ReactNode;
/**
* Content to be displayed in the modal footer
*/
footer?: ReactNode;
/**
* Size variant of the modal
*/
size?: 'regular' | 'large';
/**
* Variant of the footer styling
*/
footerVariant?: FooterVariant;
/**
* Controls the visibility of the modal
*/
open: boolean;
/**
* Callback function called when the modal is closed
*/
onClose?: () => void;
};

/**
* A modal dialog component that appears on top of the main content,
Expand All @@ -58,17 +62,20 @@ export const Modal = forwardRef<HTMLDivElement, ModalProps>(
footerVariant = 'integrated',
open,
onClose,
className,
...rest
},
ref,
) => {
return (
<BaseModal
className={styles['modal-base']}
className={clsx(styles['modal-base'], className)}
open={open}
onClose={onClose}
slots={{
backdrop: Backdrop,
}}
{...rest}
>
<Fade in={open}>
<div className={clsx(styles['modal'], styles[size])} ref={ref}>
Expand Down