react-better-html 1.1.171 → 1.1.172
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.
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -321,12 +321,18 @@ type ModalComponent = {
|
|
|
321
321
|
(props: ComponentPropWithRef<ModalRef, ModalProps>): React.ReactElement;
|
|
322
322
|
confirmation: (props: ComponentPropWithRef<ModalRef, OmitProps<ModalProps, "maxWidth" | "children" | "overflow"> & {
|
|
323
323
|
message?: string;
|
|
324
|
+
/** @default "Continue" */
|
|
325
|
+
continueButtonText?: string;
|
|
324
326
|
continueButtonLoaderName?: LoaderName | AnyOtherString;
|
|
325
327
|
onContinue?: () => void;
|
|
326
328
|
onCancel?: () => void;
|
|
327
329
|
}>) => React.ReactElement;
|
|
328
330
|
destructive: (props: ComponentPropWithRef<ModalRef, OmitProps<ModalProps, "maxWidth" | "children" | "overflow"> & {
|
|
329
331
|
message?: string;
|
|
332
|
+
/** @default "Delete" */
|
|
333
|
+
deleteButtonText?: string;
|
|
334
|
+
/** @default "trash" */
|
|
335
|
+
deleteButtonIconName?: IconName | AnyOtherString;
|
|
330
336
|
deleteButtonLoaderName?: LoaderName | AnyOtherString;
|
|
331
337
|
onDelete?: () => void;
|
|
332
338
|
onCancel?: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -321,12 +321,18 @@ type ModalComponent = {
|
|
|
321
321
|
(props: ComponentPropWithRef<ModalRef, ModalProps>): React.ReactElement;
|
|
322
322
|
confirmation: (props: ComponentPropWithRef<ModalRef, OmitProps<ModalProps, "maxWidth" | "children" | "overflow"> & {
|
|
323
323
|
message?: string;
|
|
324
|
+
/** @default "Continue" */
|
|
325
|
+
continueButtonText?: string;
|
|
324
326
|
continueButtonLoaderName?: LoaderName | AnyOtherString;
|
|
325
327
|
onContinue?: () => void;
|
|
326
328
|
onCancel?: () => void;
|
|
327
329
|
}>) => React.ReactElement;
|
|
328
330
|
destructive: (props: ComponentPropWithRef<ModalRef, OmitProps<ModalProps, "maxWidth" | "children" | "overflow"> & {
|
|
329
331
|
message?: string;
|
|
332
|
+
/** @default "Delete" */
|
|
333
|
+
deleteButtonText?: string;
|
|
334
|
+
/** @default "trash" */
|
|
335
|
+
deleteButtonIconName?: IconName | AnyOtherString;
|
|
330
336
|
deleteButtonLoaderName?: LoaderName | AnyOtherString;
|
|
331
337
|
onDelete?: () => void;
|
|
332
338
|
onCancel?: () => void;
|
package/dist/index.js
CHANGED
|
@@ -3716,7 +3716,7 @@ var ModalComponent = (0, import_react14.forwardRef)(function Modal({
|
|
|
3716
3716
|
document.body
|
|
3717
3717
|
);
|
|
3718
3718
|
});
|
|
3719
|
-
ModalComponent.confirmation = (0, import_react14.forwardRef)(function Confirmation({ message, continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
|
|
3719
|
+
ModalComponent.confirmation = (0, import_react14.forwardRef)(function Confirmation({ message, continueButtonText = "Continue", continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
|
|
3720
3720
|
const theme2 = useTheme();
|
|
3721
3721
|
const modalRef = (0, import_react14.useRef)(null);
|
|
3722
3722
|
const onCancelElement = (0, import_react14.useCallback)(() => {
|
|
@@ -3739,13 +3739,21 @@ ModalComponent.confirmation = (0, import_react14.forwardRef)(function Confirmati
|
|
|
3739
3739
|
marginTop: theme2.styles.space * 2,
|
|
3740
3740
|
children: [
|
|
3741
3741
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
|
|
3742
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default, { text:
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default, { text: continueButtonText, loaderName: continueButtonLoaderName, onClick: onContinueElement })
|
|
3743
3743
|
]
|
|
3744
3744
|
}
|
|
3745
3745
|
)
|
|
3746
3746
|
] });
|
|
3747
3747
|
});
|
|
3748
|
-
ModalComponent.destructive = (0, import_react14.forwardRef)(function Destructive2({
|
|
3748
|
+
ModalComponent.destructive = (0, import_react14.forwardRef)(function Destructive2({
|
|
3749
|
+
message,
|
|
3750
|
+
deleteButtonText = "Delete",
|
|
3751
|
+
deleteButtonIconName = "trash",
|
|
3752
|
+
deleteButtonLoaderName,
|
|
3753
|
+
onDelete,
|
|
3754
|
+
onCancel,
|
|
3755
|
+
...props
|
|
3756
|
+
}, ref) {
|
|
3749
3757
|
const theme2 = useTheme();
|
|
3750
3758
|
const modalRef = (0, import_react14.useRef)(null);
|
|
3751
3759
|
const onCancelElement = (0, import_react14.useCallback)(() => {
|
|
@@ -3771,8 +3779,8 @@ ModalComponent.destructive = (0, import_react14.forwardRef)(function Destructive
|
|
|
3771
3779
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3772
3780
|
Button_default.destructive,
|
|
3773
3781
|
{
|
|
3774
|
-
icon:
|
|
3775
|
-
text:
|
|
3782
|
+
icon: deleteButtonIconName,
|
|
3783
|
+
text: deleteButtonText,
|
|
3776
3784
|
loaderName: deleteButtonLoaderName,
|
|
3777
3785
|
onClick: onDeleteElement
|
|
3778
3786
|
}
|