geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
180 lines (179 loc) • 5.89 kB
JavaScript
import e from "react";
import { Button as t } from "./index.es7.js";
import { Spinner as z } from "./index.es56.js";
import { Save as N, Type as T, Pen as _, Crop as R, Check as F, X as w, Eraser as I, Trash2 as q, Undo as B, Redo as M, RotateCw as O } from "lucide-react";
const j = ({
editorState: n,
canUndo: o,
canRedo: d,
cropState: i,
onSave: l,
onAddTextBox: m,
onOpenStickerSheet: g,
onToggleDrawingMode: h,
onToggleCropMode: p,
onApplyCrop: b,
onCancelCrop: u,
onClearAllLines: E,
onClearAll: C,
onUndo: x,
onRedo: f,
onRotateBackground: k,
onDoneEditing: v,
buttonPositionClass: y,
isEraserEnabled: s,
isTrashEnabled: a,
isDownloading: r
}) => {
if (n.isSheetOpen) return null;
const c = s || a;
return /* @__PURE__ */ e.createElement(e.Fragment, null, n.isEditingText && /* @__PURE__ */ e.createElement("div", { className: "absolute left-4 top-4 z-[100]" }, /* @__PURE__ */ e.createElement(
t,
{
onClick: v,
size: "md",
variant: "secondary",
className: "flex items-center gap-1 px-3 py-1 rounded-md"
},
/* @__PURE__ */ e.createElement("span", null, "Done")
)), /* @__PURE__ */ e.createElement(
"div",
{
className: `absolute ${y} z-[100] flex flex-col items-end gap-2 pr-2`
},
!n.isEditingText && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
t,
{
onClick: l,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: !c || n.isCropping || r
},
r ? /* @__PURE__ */ e.createElement(z, { size: "sm", className: "text-light-1" }) : /* @__PURE__ */ e.createElement(N, { height: 20, width: 20 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: m,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: n.isCropping || r
},
/* @__PURE__ */ e.createElement(T, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: g,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: n.isCropping || r
},
/* @__PURE__ */ e.createElement(
"img",
{
src: "https://frontend-static-files.geoiq.io/strapi/Sticker_Icons_1_fa6b45751f/Sticker_Icons_1_fa6b45751f.svg",
alt: "Sticker"
}
)
), /* @__PURE__ */ e.createElement(
t,
{
onClick: h,
size: "md",
style: n.isDrawingMode ? { backgroundColor: "#3b82f6" } : {},
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: n.isEditingText || n.isCropping || r
},
/* @__PURE__ */ e.createElement(_, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: p,
size: "md",
variant: "secondary",
style: n.isCropping ? { backgroundColor: "#3b82f6" } : {},
className: "cursor-pointer rounded-md border-none bg-none text-light-1 ",
disabled: c || r
},
/* @__PURE__ */ e.createElement(R, { height: 16, width: 16 })
), n.isCropping && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
t,
{
onClick: b,
size: "md",
variant: "secondary",
className: "bg-green-300 border-none rounded-md cursor-pointer text-light-1",
disabled: !i.cropRect.width || !i.cropRect.height || r
},
/* @__PURE__ */ e.createElement(F, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: u,
size: "md",
variant: "secondary",
className: "bg-red-300 border-none rounded-md cursor-pointer text-light-1",
disabled: r
},
/* @__PURE__ */ e.createElement(w, { height: 16, width: 16 })
)), /* @__PURE__ */ e.createElement(
t,
{
onClick: E,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: !s || n.isEditingText || n.isCropping || r
},
/* @__PURE__ */ e.createElement(I, { height: 16, width: 16 }),
" "
), /* @__PURE__ */ e.createElement(
t,
{
onClick: C,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: !a || n.isEditingText || n.isCropping || r
},
/* @__PURE__ */ e.createElement(q, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: x,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: !o || n.isEditingText || n.isCropping || r
},
/* @__PURE__ */ e.createElement(B, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: f,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: !d || n.isEditingText || n.isCropping || r
},
/* @__PURE__ */ e.createElement(M, { height: 16, width: 16 })
), /* @__PURE__ */ e.createElement(
t,
{
onClick: k,
size: "md",
variant: "secondary",
className: "border-none rounded-md cursor-pointer bg-none text-light-1",
disabled: n.isCropping || r
},
/* @__PURE__ */ e.createElement(O, { height: 16, width: 16 })
))
));
};
export {
j as default
};
//# sourceMappingURL=index.es90.js.map