@phreshos/react-ui 0.1.47 → 0.1.48
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/dialog.js +5 -2
- package/package.json +1 -1
package/dist/dialog.js
CHANGED
|
@@ -53,9 +53,12 @@ export const DialogContent = forwardRef(function DialogContent({ children, class
|
|
|
53
53
|
const padding = containerPadding(visual.spacing);
|
|
54
54
|
const transition = overlayTransition(visual);
|
|
55
55
|
const direction = resolveDirection(properties.dir, useDirection());
|
|
56
|
+
// The width belongs to the centered modal, so a Dialog of any width stays centered; the Surface fills it.
|
|
57
|
+
const { width = "32rem", maxWidth, ...surfaceStyle } = style ?? {};
|
|
56
58
|
return _jsxs(_Fragment, { children: [_jsx(MotionStyle, {}), _jsx(AriaModal, { dir: direction, className: overlayMotionClass, style: {
|
|
57
59
|
...transition,
|
|
58
|
-
width
|
|
60
|
+
width,
|
|
61
|
+
maxWidth: maxWidth ?? `calc(100vw - ${inset * 2}px)`,
|
|
59
62
|
maxHeight: `calc(100vh - ${inset * 2}px)`,
|
|
60
63
|
outline: "none"
|
|
61
64
|
}, children: _jsx(Surface, { className: className, color: color, material: material,
|
|
@@ -67,7 +70,7 @@ export const DialogContent = forwardRef(function DialogContent({ children, class
|
|
|
67
70
|
maxHeight: "inherit",
|
|
68
71
|
padding,
|
|
69
72
|
overflow: "hidden",
|
|
70
|
-
...
|
|
73
|
+
...surfaceStyle
|
|
71
74
|
}, children: _jsx(AriaDialog, { ...properties, ref: ref, style: {
|
|
72
75
|
display: "grid",
|
|
73
76
|
gap: inset,
|