@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.js CHANGED
@@ -2406,7 +2406,7 @@ function ShadowContainer({
2406
2406
  document.removeEventListener("keydown", protectFocus, { capture: true });
2407
2407
  };
2408
2408
  }, [shadowRoot]);
2409
- return /* @__PURE__ */ jsx("div", { ref: hostRef, id: hostId, className: hostClassName, children: shadowRoot && createPortal(
2409
+ return /* @__PURE__ */ jsx("div", { ref: hostRef, id: hostId, className: hostClassName, style: { height: "100%" }, children: shadowRoot && createPortal(
2410
2410
  /* @__PURE__ */ jsxs(Fragment, { children: [
2411
2411
  /* @__PURE__ */ jsx("style", { children: styles }),
2412
2412
  children
@@ -5166,15 +5166,30 @@ function CopilotContainer({
5166
5166
  }, [currentWidth]);
5167
5167
  useEffect(() => {
5168
5168
  const className = `crow-copilot-open-${position}`;
5169
+ const marginProp = position === "right" ? "margin-right" : "margin-left";
5170
+ const widthVal = `var(--crow-copilot-width, ${currentWidth}px)`;
5169
5171
  if (isOpen) {
5170
5172
  document.body.classList.add(className);
5173
+ document.body.style.setProperty(marginProp, widthVal, "important");
5174
+ document.body.style.setProperty(
5175
+ "width",
5176
+ `calc(100% - ${widthVal})`,
5177
+ "important"
5178
+ );
5179
+ document.body.style.setProperty("overflow-x", "hidden", "important");
5171
5180
  } else {
5172
5181
  document.body.classList.remove(className);
5182
+ document.body.style.removeProperty(marginProp);
5183
+ document.body.style.removeProperty("width");
5184
+ document.body.style.removeProperty("overflow-x");
5173
5185
  }
5174
5186
  return () => {
5175
5187
  document.body.classList.remove(className);
5188
+ document.body.style.removeProperty(marginProp);
5189
+ document.body.style.removeProperty("width");
5190
+ document.body.style.removeProperty("overflow-x");
5176
5191
  };
5177
- }, [isOpen, position]);
5192
+ }, [isOpen, position, currentWidth]);
5178
5193
  useEffect(() => {
5179
5194
  window.crowCopilot = {
5180
5195
  open: () => setIsOpen(true),