react-better-html 1.1.170 → 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 +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +28 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -6
- 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;
|
|
@@ -602,6 +608,11 @@ type FormProps = {
|
|
|
602
608
|
/** @default false */
|
|
603
609
|
submitButtonIsDisabled?: boolean;
|
|
604
610
|
cancelButtonText?: string;
|
|
611
|
+
cancelButtonLoaderName?: LoaderName | AnyOtherString;
|
|
612
|
+
cancelButtonIsLoading?: boolean;
|
|
613
|
+
cancelButtonId?: string;
|
|
614
|
+
/** @default false */
|
|
615
|
+
cancelButtonIsDisabled?: boolean;
|
|
605
616
|
/** @default "right" */
|
|
606
617
|
actionButtonsLocation?: "left" | "center" | "right";
|
|
607
618
|
gap?: React.CSSProperties["gap"];
|
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;
|
|
@@ -602,6 +608,11 @@ type FormProps = {
|
|
|
602
608
|
/** @default false */
|
|
603
609
|
submitButtonIsDisabled?: boolean;
|
|
604
610
|
cancelButtonText?: string;
|
|
611
|
+
cancelButtonLoaderName?: LoaderName | AnyOtherString;
|
|
612
|
+
cancelButtonIsLoading?: boolean;
|
|
613
|
+
cancelButtonId?: string;
|
|
614
|
+
/** @default false */
|
|
615
|
+
cancelButtonIsDisabled?: boolean;
|
|
605
616
|
/** @default "right" */
|
|
606
617
|
actionButtonsLocation?: "left" | "center" | "right";
|
|
607
618
|
gap?: React.CSSProperties["gap"];
|
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
|
}
|
|
@@ -7534,6 +7542,10 @@ var FormComponent = (0, import_react22.forwardRef)(function Form({
|
|
|
7534
7542
|
submitButtonId,
|
|
7535
7543
|
submitButtonIsDisabled,
|
|
7536
7544
|
cancelButtonText,
|
|
7545
|
+
cancelButtonLoaderName,
|
|
7546
|
+
cancelButtonIsLoading,
|
|
7547
|
+
cancelButtonId,
|
|
7548
|
+
cancelButtonIsDisabled,
|
|
7537
7549
|
actionButtonsLocation = "right",
|
|
7538
7550
|
gap,
|
|
7539
7551
|
isDestructive,
|
|
@@ -7567,7 +7579,17 @@ var FormComponent = (0, import_react22.forwardRef)(function Form({
|
|
|
7567
7579
|
marginTop: theme2.styles.space,
|
|
7568
7580
|
children: [
|
|
7569
7581
|
renderActionButtons,
|
|
7570
|
-
onClickCancel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7582
|
+
onClickCancel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7583
|
+
Button_default.secondary,
|
|
7584
|
+
{
|
|
7585
|
+
text: cancelButtonText ?? "Cancel",
|
|
7586
|
+
isLoading: cancelButtonIsLoading,
|
|
7587
|
+
loaderName: cancelButtonLoaderName,
|
|
7588
|
+
disabled: cancelButtonIsDisabled,
|
|
7589
|
+
id: cancelButtonId,
|
|
7590
|
+
onClick: onClickCancel
|
|
7591
|
+
}
|
|
7592
|
+
),
|
|
7571
7593
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7572
7594
|
SubmitButtonTag,
|
|
7573
7595
|
{
|