elbe-ui 1.0.7 → 1.0.8

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.
@@ -1,9 +1,10 @@
1
1
  import type { ElbeChildren } from "../util/types";
2
- export declare function ElbeDialog({ title, open, onClose, children, _style, barrierDismissible, }: {
2
+ export declare function ElbeDialog({ title, open, onClose, children, _style, barrierDismissible, maxWidth, }: {
3
3
  _style?: React.CSSProperties;
4
4
  title: string;
5
5
  open: boolean;
6
6
  onClose: () => void;
7
7
  children: ElbeChildren;
8
8
  barrierDismissible?: boolean;
9
+ maxWidth?: number;
9
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { X } from "lucide-react";
3
3
  import { useEffect } from "react";
4
4
  import { IconButton } from "./button/icon_button";
5
5
  import { Spaced } from "./layout/spaced";
6
- export function ElbeDialog({ title, open, onClose, children, _style, barrierDismissible, }) {
6
+ export function ElbeDialog({ title, open, onClose, children, _style, barrierDismissible, maxWidth, }) {
7
7
  useEffect(() => {
8
8
  if (open) {
9
9
  document.body.style.overflow = "hidden";
@@ -20,7 +20,10 @@ export function ElbeDialog({ title, open, onClose, children, _style, barrierDism
20
20
  e.preventDefault();
21
21
  if (barrierDismissible)
22
22
  onClose();
23
- }, open: open, style: Object.assign({ textAlign: "start" }, (_style !== null && _style !== void 0 ? _style : {})), children: _jsxs("div", { className: "elbe_dialog_base primary card plain-opaque padding-none", style: { maxWidth: "40rem", minWidth: "10rem" }, children: [_jsxs("div", { className: "row cross-center padded main-between", children: [_jsx("div", { className: "body-l b", children: title }), _jsx(IconButton.plain, { ariaLabel: "Close", icon: X, onTap: (e) => {
23
+ }, open: open, style: Object.assign({ textAlign: "start" }, (_style !== null && _style !== void 0 ? _style : {})), children: _jsxs("div", { className: "elbe_dialog_base primary card plain-opaque padding-none", style: {
24
+ maxWidth: `min(${maxWidth !== null && maxWidth !== void 0 ? maxWidth : 40}rem, 100%)`,
25
+ minWidth: "10rem",
26
+ }, children: [_jsxs("div", { className: "row cross-center padded main-between", children: [_jsx("div", { className: "body-l b", children: title }), _jsx(IconButton.plain, { ariaLabel: "Close", icon: X, onTap: (e) => {
24
27
  e.stopPropagation();
25
28
  e.preventDefault();
26
29
  onClose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {