@yogiswara/honcho-editor-ui 2.6.8 → 2.6.9
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/components/editor/HPresetDelete.d.ts +7 -0
- package/dist/components/editor/HPresetDelete.js +7 -0
- package/dist/components/modal/HModalDialog.d.ts +12 -0
- package/dist/components/modal/HModalDialog.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ModalDialog from "../modal/HModalDialog";
|
|
3
|
+
function HPresetDeleteDialog(props) {
|
|
4
|
+
return (_jsx(ModalDialog, { isOpen: true, title: "Delete preset?", description: "The preset will be permanently removed.", isLoading: props.isLoading, onCancel: props.onCancel, submitLabel: "Delete", onSubmit: props.onSubmit }));
|
|
5
|
+
}
|
|
6
|
+
;
|
|
7
|
+
export default HPresetDeleteDialog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ModalDialogProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onSubmit: () => void;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
submitLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function ModalDialog(props: ModalDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default ModalDialog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Grid, Typography, useTheme, } from "@mui/material";
|
|
3
|
+
import useHonchoTypography from "../../themes/honchoTheme";
|
|
4
|
+
import useColors from '../../themes/colors';
|
|
5
|
+
const defaultPaperStyle = {
|
|
6
|
+
borderRadius: "28px",
|
|
7
|
+
width: { xs: "100%", sm: "456px" },
|
|
8
|
+
boxShadow: "none",
|
|
9
|
+
};
|
|
10
|
+
function ModalDialog(props) {
|
|
11
|
+
const { isOpen, isLoading = false, title, description, onCancel, onSubmit, cancelLabel = "Cancel", submitLabel = "Confirm", } = props;
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const typography = useHonchoTypography();
|
|
14
|
+
const colors = useColors();
|
|
15
|
+
return (_jsxs(Dialog, { disableScrollLock: true, open: isOpen, onClose: onCancel, "aria-labelledby": "dialog-title", PaperProps: { sx: defaultPaperStyle }, children: ["``", title && (_jsx(DialogTitle, { children: _jsx(Typography, { variant: "labelLarge", color: colors.onSurface, children: title }) })), _jsx(DialogContent, { sx: { padding: { xs: "24px 24px 0 24px", sm: "24px 24px 0 24px" } }, children: description && (_jsx(Typography, { sx: { color: "#656369", fontSize: 14 }, variant: "bodyMedium", children: description })) }), _jsx(DialogActions, { sx: { padding: 3 }, children: _jsxs(Grid, { container: true, direction: "row", justifyContent: "end", alignItems: "center", gap: 1, children: [_jsx(Button, { variant: "text", onClick: onCancel, children: cancelLabel }), _jsx(Button, { variant: "text", color: "error", disabled: isLoading, onClick: onSubmit, children: submitLabel })] }) })] }));
|
|
16
|
+
}
|
|
17
|
+
;
|
|
18
|
+
export default ModalDialog;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export { EditorProvider, useEditorContext } from './lib/context/EditorContext';
|
|
|
29
29
|
export { useImageProcessor } from './lib/hooks/useImageProcessor';
|
|
30
30
|
export { useEditorHeadless } from './lib/hooks/useEditorHeadless';
|
|
31
31
|
export { ImageSize, HonchoEditor, AdjustmentValues, AdjustmentRange, AdjustmentRanges } from './lib/editor/honcho-editor';
|
|
32
|
+
export { default as HPresetDeleteDialog } from './components/editor/HPresetDelete';
|
|
33
|
+
export { default as HModalDialog } from './components/modal/HModalDialog';
|
|
32
34
|
export { useAdjustmentHistory, type UseAdjustmentHistoryReturn, type HistoryInfo, type HistoryActions, type HistoryConfig } from './hooks/useAdjustmentHistory';
|
|
33
35
|
export { useAdjustmentHistoryBatch, type UseAdjustmentHistoryBatchReturn, type BatchAdjustmentState, type ImageAdjustmentConfig, type BatchHistoryInfo, type BatchHistoryActions, type BatchHistoryConfig } from './hooks/useAdjustmentHistoryBatch';
|
|
34
36
|
export { usePreset, type UsePresetReturn, type PresetInfo, type PresetActions, type PresetOptions } from './hooks/usePreset';
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,8 @@ export { EditorProvider, useEditorContext } from './lib/context/EditorContext';
|
|
|
28
28
|
export { useImageProcessor } from './lib/hooks/useImageProcessor';
|
|
29
29
|
export { useEditorHeadless } from './lib/hooks/useEditorHeadless';
|
|
30
30
|
export { HonchoEditor } from './lib/editor/honcho-editor';
|
|
31
|
+
export { default as HPresetDeleteDialog } from './components/editor/HPresetDelete';
|
|
32
|
+
export { default as HModalDialog } from './components/modal/HModalDialog';
|
|
31
33
|
// --- History Hooks ---
|
|
32
34
|
export { useAdjustmentHistory } from './hooks/useAdjustmentHistory';
|
|
33
35
|
export { useAdjustmentHistoryBatch } from './hooks/useAdjustmentHistoryBatch';
|