@rovula/ui 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,7 +41,10 @@ export const ConfirmDialog = ({ open, onOpenChange, title, description, children
|
|
|
41
41
|
const handleSubmit = () => {
|
|
42
42
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
43
43
|
};
|
|
44
|
-
return (_jsxs(AlertDialog, { open: open, onOpenChange: handleOpenChange, children: [trigger && _jsx(AlertDialogTrigger, { asChild: true, children: trigger }), _jsxs(AlertDialogContent, { className: contentClassName, "data-testid": testId,
|
|
44
|
+
return (_jsxs(AlertDialog, { open: open, onOpenChange: handleOpenChange, children: [trigger && _jsx(AlertDialogTrigger, { asChild: true, children: trigger }), _jsxs(AlertDialogContent, { className: contentClassName, "data-testid": testId, onCloseAutoFocus: (event) => {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
document.body.style.pointerEvents = "auto";
|
|
47
|
+
}, children: [_jsxs(AlertDialogHeader, { className: headerClassName, children: [_jsx(AlertDialogTitle, { className: titleClassName, "data-testid": testId && `${testId}-title`, children: title }), description && (_jsx(AlertDialogDescription, { className: descriptionClassName, "data-testid": testId && `${testId}-description`, children: description }))] }), children, requiresInput && (_jsxs(FormRoot, { className: "flex flex-col gap-4 w-full", onSubmit: handleSubmit, children: [_jsxs("p", { className: "typography-small1 text-text-contrast-max", children: ["Type \u201C", typeToConfirm, "\u201D to proceed."] }), _jsx(Field, { name: "confirmInput", component: TextInput, componentProps: {
|
|
45
48
|
label: "Type to confirm",
|
|
46
49
|
required: true,
|
|
47
50
|
hasClearIcon: true,
|
package/package.json
CHANGED
|
@@ -129,7 +129,14 @@ export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
|
|
129
129
|
return (
|
|
130
130
|
<AlertDialog open={open} onOpenChange={handleOpenChange}>
|
|
131
131
|
{trigger && <AlertDialogTrigger asChild>{trigger}</AlertDialogTrigger>}
|
|
132
|
-
<AlertDialogContent
|
|
132
|
+
<AlertDialogContent
|
|
133
|
+
className={contentClassName}
|
|
134
|
+
data-testid={testId}
|
|
135
|
+
onCloseAutoFocus={(event) => {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
document.body.style.pointerEvents = "auto";
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
133
140
|
<AlertDialogHeader className={headerClassName}>
|
|
134
141
|
<AlertDialogTitle
|
|
135
142
|
className={titleClassName}
|