@usecrow/ui 0.1.70 → 0.1.71

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.cjs CHANGED
@@ -2433,7 +2433,7 @@ function ShadowContainer({
2433
2433
  document.removeEventListener("keydown", protectFocus, { capture: true });
2434
2434
  };
2435
2435
  }, [shadowRoot]);
2436
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: hostRef, id: hostId, className: hostClassName, children: shadowRoot && reactDom.createPortal(
2436
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: hostRef, id: hostId, className: hostClassName, style: { height: "100%" }, children: shadowRoot && reactDom.createPortal(
2437
2437
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2438
2438
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: styles }),
2439
2439
  children
@@ -5193,15 +5193,30 @@ function CopilotContainer({
5193
5193
  }, [currentWidth]);
5194
5194
  React3.useEffect(() => {
5195
5195
  const className = `crow-copilot-open-${position}`;
5196
+ const marginProp = position === "right" ? "margin-right" : "margin-left";
5197
+ const widthVal = `var(--crow-copilot-width, ${currentWidth}px)`;
5196
5198
  if (isOpen) {
5197
5199
  document.body.classList.add(className);
5200
+ document.body.style.setProperty(marginProp, widthVal, "important");
5201
+ document.body.style.setProperty(
5202
+ "width",
5203
+ `calc(100% - ${widthVal})`,
5204
+ "important"
5205
+ );
5206
+ document.body.style.setProperty("overflow-x", "hidden", "important");
5198
5207
  } else {
5199
5208
  document.body.classList.remove(className);
5209
+ document.body.style.removeProperty(marginProp);
5210
+ document.body.style.removeProperty("width");
5211
+ document.body.style.removeProperty("overflow-x");
5200
5212
  }
5201
5213
  return () => {
5202
5214
  document.body.classList.remove(className);
5215
+ document.body.style.removeProperty(marginProp);
5216
+ document.body.style.removeProperty("width");
5217
+ document.body.style.removeProperty("overflow-x");
5203
5218
  };
5204
- }, [isOpen, position]);
5219
+ }, [isOpen, position, currentWidth]);
5205
5220
  React3.useEffect(() => {
5206
5221
  window.crowCopilot = {
5207
5222
  open: () => setIsOpen(true),