diff --git a/package.json b/package.json index a27dc39..b8c0090 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/ui", - "version": "0.0.26", + "version": "0.0.27", "description": "Library of Internxt components", "repository": { "type": "git", @@ -93,7 +93,7 @@ "storybook:build": "storybook build" }, "dependencies": { - "@internxt/css-config": "1.0.3", + "@internxt/css-config": "1.0.5", "@phosphor-icons/react": "^2.1.7", "@radix-ui/react-switch": "^1.1.3", "@radix-ui/themes": "^3.2.0" diff --git a/src/components/dialog/Dialog.tsx b/src/components/dialog/Dialog.tsx index cf26845..658f499 100644 --- a/src/components/dialog/Dialog.tsx +++ b/src/components/dialog/Dialog.tsx @@ -9,10 +9,11 @@ export interface DialogProps { onSecondaryAction: () => void; title: string; subtitle: string; - primaryAction: string; - secondaryAction: string; + primaryAction: string | JSX.Element; + secondaryAction: string | JSX.Element; primaryActionColor: 'primary' | 'danger'; isLoading?: boolean; + maxWidth?: 'sm' | 'md' | 'lg'; } /** @@ -36,11 +37,11 @@ export interface DialogProps { * @property {string} subtitle * - A subtitle for the dialog, displayed below the title. * - * @property {string} primaryAction - * - The label for the primary action button. + * @property {string | JSX.Element} primaryAction + * - The label or content for the primary action button. * * @property {string} secondaryAction - * - The label for the secondary action button. + * - The label or content for the secondary action button. * * @property {('primary' | 'danger')} primaryActionColor * - Defines the color of the primary action button. Can either be 'primary' or 'danger'. @@ -48,6 +49,9 @@ export interface DialogProps { * @property {boolean} [isLoading] * - Optional flag to indicate if the buttons should show a loading state. Defaults to false. * + * @property {'sm' | 'md' | 'lg'} [maxWidth] + * - Optional maximum width for the dialog. Can be 'sm', 'md', or 'lg'. + * * @returns {JSX.Element} * - The rendered dialog component. */ @@ -63,6 +67,7 @@ const Dialog = ({ secondaryAction, primaryActionColor, isLoading, + maxWidth = 'sm', }: DialogProps): JSX.Element => { const [isVisible, setIsVisible] = useState(isOpen); const [transitionOpacity, setTransitionOpacity] = useState('opacity-0'); @@ -107,29 +112,19 @@ const Dialog = ({ {isVisible && (

{title}

diff --git a/src/components/dialog/__test__/__snapshots__/Dialog.test.tsx.snap b/src/components/dialog/__test__/__snapshots__/Dialog.test.tsx.snap index 6583e8f..f437270 100644 --- a/src/components/dialog/__test__/__snapshots__/Dialog.test.tsx.snap +++ b/src/components/dialog/__test__/__snapshots__/Dialog.test.tsx.snap @@ -6,27 +6,11 @@ exports[`Dialog > should match snapshot 1`] = ` class="fixed inset-0 z-50 " >
{showContent && (
{panel(closePopover)}
diff --git a/src/components/popover/__test__/__snapshots__/Popover.test.tsx.snap b/src/components/popover/__test__/__snapshots__/Popover.test.tsx.snap index ae24bd3..0db62b1 100644 --- a/src/components/popover/__test__/__snapshots__/Popover.test.tsx.snap +++ b/src/components/popover/__test__/__snapshots__/Popover.test.tsx.snap @@ -12,6 +12,7 @@ exports[`Popover > should match snapshot 1`] = `