UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 1.79 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("@mui/material/Typography"),r=require("@mui/material/Dialog"),i=require("@mui/material/DialogTitle"),t=require("@mui/material/DialogActions"),o=require("@mui/material/Button"),n=require("@mui/material/useMediaQuery"),l=require("@mui/material/styles"),u=require("./Upload/ImageUpload.container.js"),s=require("./Crop/ImageCrop.container.js"),c=require("./ImageCropDialog.styles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(a),p=d(r),g=d(i),f=d(t),x=d(o),j=d(n);exports.default=({cropperRef:a,currentPage:r,onBack:i,onNext:t,imageUploadTitle:o,imageCropTitle:n,initialImage:d,currentImage:h,onImageUploaded:y,cropShape:C,cropDimensions:b,onCancel:q,onSave:v,onClose:I,sx:S,t:U,...D})=>{const k="upload"===r,T=h?"string"==typeof h?h:h instanceof File?URL.createObjectURL(h):d:d,R=l.useTheme(),A=j.default(R.breakpoints.down("sm"));return e.jsxs(p.default,{...D,fullScreen:A,sx:[c.dialogStyles,...Array.isArray(S)?S:[S]],children:[e.jsx(g.default,{component:m.default,variant:"h6",fontWeight:"700",children:k?o||U("Update part thumbnail"):n||U("Edit selected image")}),k&&e.jsx(u.ImageUpload,{currentImage:T,onImageChange:y,t:U}),!k&&e.jsx(s.ImageCrop,{cropperRef:a,imageSrc:"string"==typeof T?T:void 0,onCancel:q,onSave:v,cropShape:C,cropDimensions:b,t:U}),e.jsxs(f.default,{children:[e.jsx(x.default,{"aria-label":U("Cancel"),onClick:i,"data-testid":"image-crop-dialog-back-button",children:U(k?"Cancel":"Previous")}),e.jsx(x.default,{variant:"contained","aria-label":U(k?"Next":"Save"),disabled:!("string"==typeof T||T instanceof File)||""===T,onClick:t,"data-testid":"image-crop-dialog-next-button",children:U(k?"Next":"Save")})]})]})};