@firecms/ui 3.0.0-tw4.15 → 3.0.0-tw4.16

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.
@@ -19,6 +19,7 @@ export type DialogProps = {
19
19
  * If `true`, the dialog will not focus the first focusable element when opened.
20
20
  */
21
21
  disableInitialFocus?: boolean;
22
+ portalContainer?: HTMLElement | null;
22
23
  };
23
24
  declare const widthClasses: {
24
25
  xs: string;
@@ -34,5 +35,5 @@ declare const widthClasses: {
34
35
  "7xl": string;
35
36
  full: string;
36
37
  };
37
- export declare const Dialog: ({ open, onOpenChange, children, className, containerClassName, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, disableInitialFocus }: DialogProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const Dialog: ({ open, onOpenChange, children, className, containerClassName, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, disableInitialFocus, portalContainer }: DialogProps) => import("react/jsx-runtime").JSX.Element;
38
39
  export {};
@@ -12,8 +12,9 @@ export declare function MenubarTrigger({ children, onSelect, className }: {
12
12
  onSelect?: (event: React.SyntheticEvent) => void;
13
13
  className?: string;
14
14
  }): import("react/jsx-runtime").JSX.Element;
15
- export declare function MenubarPortal({ children, }: {
15
+ export declare function MenubarPortal({ children, portalContainer, }: {
16
16
  children: React.ReactNode;
17
+ portalContainer?: HTMLElement | null;
17
18
  }): import("react/jsx-runtime").JSX.Element;
18
19
  export declare function MenubarContent({ children, className, align, sideOffset, alignOffset, onSelect, ...rest }: {
19
20
  children: React.ReactNode;
@@ -36,6 +36,7 @@ interface MultiSelectProps<T extends MultiSelectValue = string> {
36
36
  invisible?: boolean;
37
37
  children: React.ReactNode;
38
38
  renderValues?: (values: T[]) => React.ReactNode;
39
+ portalContainer?: HTMLElement | null;
39
40
  }
40
41
  export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<string> & React.RefAttributes<HTMLButtonElement>>;
41
42
  export interface MultiSelectItemProps<T extends MultiSelectValue = string> {
@@ -13,6 +13,7 @@ interface SheetProps {
13
13
  style?: React.CSSProperties;
14
14
  overlayClassName?: string;
15
15
  overlayStyle?: React.CSSProperties;
16
+ portalContainer?: HTMLElement | null;
16
17
  }
17
18
  export declare const Sheet: React.FC<SheetProps>;
18
19
  export {};
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ export interface PortalContainerContextType {
3
+ container: HTMLElement | null;
4
+ }
5
+ export interface PortalContainerProviderProps {
6
+ container: HTMLElement | null;
7
+ children: React.ReactNode;
8
+ }
9
+ /**
10
+ * Provider component that sets the portal container for all descendants.
11
+ * This can be used at any level of the tree to specify where portals should be attached.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const containerRef = useRef<HTMLDivElement>(null);
16
+ *
17
+ * <div ref={containerRef}>
18
+ * <PortalContainerProvider container={containerRef.current}>
19
+ * <YourComponents />
20
+ * </PortalContainerProvider>
21
+ * </div>
22
+ * ```
23
+ */
24
+ export declare function PortalContainerProvider({ container, children }: PortalContainerProviderProps): import("react/jsx-runtime").JSX.Element;
25
+ /**
26
+ * Hook to access the portal container from context.
27
+ * Returns null if no provider is found in the tree.
28
+ *
29
+ * @returns The portal container element or null
30
+ */
31
+ export declare function usePortalContainer(): HTMLElement | null;
@@ -2,3 +2,4 @@ export * from "./useInjectStyles";
2
2
  export * from "./useOutsideAlerter";
3
3
  export * from "./useDebounceValue";
4
4
  export * from "./useIconStyles";
5
+ export * from "./PortalContainerContext";