@spunto/design-system 0.79.1 → 0.80.0
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/README.md +3 -1
- package/package.json +1 -1
- package/src/components/spunto-provider.tsx +3 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,9 @@ const nextConfig = { transpilePackages: ["@spunto/design-system"] }
|
|
|
99
99
|
- _Overlays_ (plug into the `SpuntoProvider` umbrella) — `Dialog`, `AlertDialog`
|
|
100
100
|
(a confirmation variant, non-dismissible), `Sheet`, `Tooltip`. Their portals render
|
|
101
101
|
into the provider's overlay container; `Tooltip`'s shared delay group is mounted by
|
|
102
|
-
the provider too.
|
|
102
|
+
the provider too. An app's own overlay portals there as well
|
|
103
|
+
(`useOverlayContainer()`, `null` without a provider): left in `document.body`, it
|
|
104
|
+
covers the `Select` or the menu opened from inside it.
|
|
103
105
|
- _ActionMenu_ — `ActionMenu` (+`ActionMenuItem`, `ActionMenuEntry`), the `⋯` menu
|
|
104
106
|
**described instead of assembled**: `items` is a list of `{ label, icon?, onClick }`
|
|
105
107
|
(or `href`, for a real `<a>` via Base UI's `Menu.LinkItem`) and the component builds
|
package/package.json
CHANGED
|
@@ -71,7 +71,9 @@ const OverlayContainerContext = createContext<HTMLElement | null>(null)
|
|
|
71
71
|
/**
|
|
72
72
|
* Container element the design-system overlays portal into, provided by the
|
|
73
73
|
* nearest `SpuntoProvider` (or `null` → Base UI's `document.body` default).
|
|
74
|
-
*
|
|
74
|
+
* An app's own overlay portals into it too (`<Portal container={… ?? undefined}>`):
|
|
75
|
+
* left in `document.body`, it sits after this node and covers, at the same
|
|
76
|
+
* z-index, every `Select` or menu opened from inside it.
|
|
75
77
|
*/
|
|
76
78
|
export function useOverlayContainer(): HTMLElement | null {
|
|
77
79
|
return useContext(OverlayContainerContext)
|
package/src/index.ts
CHANGED
|
@@ -309,7 +309,7 @@ export type { KbdProps } from "./components/kbd"
|
|
|
309
309
|
// Toasts — imperative `toast()` API + the umbrella client provider that renders
|
|
310
310
|
// them. `SpuntoProvider` mounts the toast viewport, the tooltip delay group, and
|
|
311
311
|
// the overlay portal container that dialogs/selects render into.
|
|
312
|
-
export { SpuntoProvider } from "./components/spunto-provider"
|
|
312
|
+
export { SpuntoProvider, useOverlayContainer } from "./components/spunto-provider"
|
|
313
313
|
export type { SpuntoProviderProps, ToastPosition } from "./components/spunto-provider"
|
|
314
314
|
export { toast } from "./components/toast"
|
|
315
315
|
export type { ToastFn, ToastOptions, ToastVariant, ToastAction } from "./components/toast"
|