@smart-cloud/ai-kit-ui 1.1.4 → 1.1.6
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 +9 -9
- package/dist/index.js +9 -9
- package/package.json +1 -1
- package/src/ShadowBoundary.tsx +5 -1
- package/src/withAiKitShell.tsx +1 -0
package/package.json
CHANGED
package/src/ShadowBoundary.tsx
CHANGED
|
@@ -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,7 +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
150
|
overlayHost.style.pointerEvents = "none";
|
|
149
151
|
|
|
150
152
|
doc.body.appendChild(overlayHost);
|
|
@@ -253,6 +255,8 @@ export function ShadowBoundary({
|
|
|
253
255
|
outline: "none",
|
|
254
256
|
boxShadow: "none",
|
|
255
257
|
backgroundColor: "transparent",
|
|
258
|
+
zIndex:
|
|
259
|
+
variation === "modal" ? "var(--ai-kit-position-z-index)" : "auto",
|
|
256
260
|
}}
|
|
257
261
|
>
|
|
258
262
|
{portalTarget && shadowRoot && emotionCache
|
package/src/withAiKitShell.tsx
CHANGED
|
@@ -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}
|