@npm-zenwork/tax-remittance-ui 0.5.2 → 0.5.3

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.
@@ -30,6 +30,22 @@ interface ThemeProviderProps {
30
30
  theme?: TaxRemittanceTheme;
31
31
  children: ReactNode;
32
32
  }
33
+ /**
34
+ * The element modals, drawers, dropdowns and toasts must portal into.
35
+ *
36
+ * Do not portal to `document.body` directly. Every rule this package ships is scoped
37
+ * under `.tax-remittance-embedded` so it cannot leak into the host application, which
38
+ * means anything mounted outside that subtree receives none of it — a modal portaled
39
+ * to `document.body` renders as an unstyled static block at the end of the page, with
40
+ * no positioning, backdrop or z-index, and is effectively invisible.
41
+ *
42
+ * This root is a body-level sibling carrying the widget class and the theme variables,
43
+ * so portalled content is styled correctly while still escaping the host's overflow
44
+ * and stacking contexts the way `document.body` did.
45
+ *
46
+ * Always returns an element, so callers can hand it straight to `createPortal`.
47
+ */
48
+ export declare function usePortalRoot(): HTMLElement;
33
49
  /**
34
50
  * Injects the client's brand colors as CSS custom properties on the
35
51
  * `.tax-remittance-embedded` wrapper div.
@@ -42,6 +58,8 @@ interface ThemeProviderProps {
42
58
  * `index.css` maps Tailwind's `--color-brand-*` tokens to these vars
43
59
  * inside the `.tax-remittance-embedded` scope, so shared components
44
60
  * like `<Button>` and `<Input>` automatically respect client themes.
61
+ *
62
+ * It also owns the portal root — see `usePortalRoot`.
45
63
  */
46
64
  export declare function ThemeProvider({ theme, children }: ThemeProviderProps): import("react").JSX.Element;
47
65
  export {};