@smart-cloud/ai-kit-ui 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-cloud/ai-kit-ui",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -18,6 +18,8 @@ export type ShadowBoundaryProps = {
18
18
  /** ID of the element inside the shadow root used as the portal target. */
19
19
  rootElementId: string;
20
20
 
21
+ /** Variation of the shadow boundary behavior. */
22
+ variation?: "default" | "modal";
21
23
  /**
22
24
  * Where to create the shadow root:
23
25
  * - "local": attach shadow to this component's host element (keeps layout positioning).
@@ -106,6 +108,7 @@ export function ShadowBoundary({
106
108
  children,
107
109
  rootElementId,
108
110
  mode = "local",
111
+ variation = "default",
109
112
  overlayRootId = "ai-kit-overlay-root",
110
113
  }: ShadowBoundaryProps) {
111
114
  const hostRef = useRef<HTMLDivElement | null>(null);
@@ -144,8 +147,6 @@ export function ShadowBoundary({
144
147
  overlayHost.style.inset = "0";
145
148
  overlayHost.style.width = "0";
146
149
  overlayHost.style.height = "0";
147
- overlayHost.style.zIndex = "2147483647"; // max z-index
148
- overlayHost.style.pointerEvents = "none";
149
150
 
150
151
  doc.body.appendChild(overlayHost);
151
152
  }
@@ -154,6 +155,11 @@ export function ShadowBoundary({
154
155
  host = hostRef.current;
155
156
  }
156
157
 
158
+ if (variation === "modal") {
159
+ host.style.zIndex = "2147483647"; // max z-index
160
+ host.style.pointerEvents = "none";
161
+ }
162
+
157
163
  // 2) Ensure shadow root
158
164
  const shadow = host.shadowRoot ?? host.attachShadow({ mode: "open" });
159
165
 
@@ -162,6 +162,7 @@ export function withAiKitShell<P extends object>(
162
162
  return (
163
163
  <ShadowBoundary
164
164
  mode={variation === "modal" && !showOpenButton ? "overlay" : "local"}
165
+ variation={variation}
165
166
  overlayRootId="ai-kit-overlay-root"
166
167
  stylesheets={stylesheets}
167
168
  innerCSS={innerCSS}