@mamrp/components 1.7.70 → 1.7.72

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.mts CHANGED
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
@@ -1051,16 +1051,40 @@ function DraggablePaper({
1051
1051
  ...props
1052
1052
  }) {
1053
1053
  const nodeRef = (0, import_react8.useRef)(null);
1054
+ const [position, setPosition] = (0, import_react8.useState)({ x: 0, y: 0 });
1055
+ const [dragging, setDragging] = (0, import_react8.useState)(false);
1056
+ const handleDrag = (_, data) => {
1057
+ setPosition({ x: data.x, y: data.y });
1058
+ };
1059
+ const handleStart = () => {
1060
+ setDragging(true);
1061
+ };
1062
+ const handleStop = () => {
1063
+ setDragging(false);
1064
+ setPosition({ x: 0, y: 0 });
1065
+ };
1054
1066
  return /* @__PURE__ */ React.createElement(
1055
1067
  import_react_draggable.default,
1056
1068
  {
1057
1069
  nodeRef,
1058
1070
  handle,
1059
1071
  cancel,
1060
- bounds: "parent",
1061
- defaultPosition: { x: 0, y: 0 }
1072
+ position,
1073
+ onStart: handleStart,
1074
+ onDrag: handleDrag,
1075
+ onStop: handleStop
1062
1076
  },
1063
- /* @__PURE__ */ React.createElement(import_material10.Paper, { ref: nodeRef, ...props })
1077
+ /* @__PURE__ */ React.createElement(
1078
+ import_material10.Paper,
1079
+ {
1080
+ ref: nodeRef,
1081
+ ...props,
1082
+ sx: {
1083
+ transition: dragging ? "none" : "transform 250ms cubic-bezier(0.4, 0, 0.2, 1)",
1084
+ ...props.sx
1085
+ }
1086
+ }
1087
+ )
1064
1088
  );
1065
1089
  }
1066
1090