@luscii-healthtech/web-ui 40.2.0 → 40.3.1
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/index.development.js +12 -11
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/ModalDialog.stories.d.ts +4385 -0
- package/dist/web-ui-tailwind.css +12 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5614,7 +5614,9 @@ const useModalDialog = () => React.useContext(context);
|
|
|
5614
5614
|
const ModalDialog = (_a) => {
|
|
5615
5615
|
var { open, className, size, onClose, children, variant = "centered-dialog" } = _a, rest = __rest(_a, ["open", "className", "size", "onClose", "children", "variant"]);
|
|
5616
5616
|
const dialog = React.useRef(null);
|
|
5617
|
-
const classes = classNames__default.default("ui:bg-transparent",
|
|
5617
|
+
const classes = classNames__default.default("ui:bg-transparent", {
|
|
5618
|
+
"ui:max-w-[calc(100dvw-(var(--ui-spacing-xl)))]": variant !== "full-screen"
|
|
5619
|
+
}, {
|
|
5618
5620
|
"ui:my-xl": variant === "centered-dialog",
|
|
5619
5621
|
"ui:mx-auto": variant === "centered-dialog"
|
|
5620
5622
|
}, "ui:top-0", "ui:bottom-auto", {
|
|
@@ -5627,10 +5629,10 @@ const ModalDialog = (_a) => {
|
|
|
5627
5629
|
"ui:bottom-0": variant === "side-modal",
|
|
5628
5630
|
"ui:max-h-full": variant === "side-modal"
|
|
5629
5631
|
}, {
|
|
5630
|
-
"ui:w-screen": variant === "full-screen",
|
|
5631
|
-
"ui:h-screen": variant === "full-screen",
|
|
5632
5632
|
"ui:fixed ui:top-0 ui:bottom-0 ui:left-0 ui:right-0": variant === "full-screen",
|
|
5633
|
-
"ui:p-0": variant === "full-screen"
|
|
5633
|
+
"ui:p-0": variant === "full-screen",
|
|
5634
|
+
"ui:w-screen ui:h-screen": variant === "full-screen",
|
|
5635
|
+
"ui:max-w-screen ui:max-h-screen": variant === "full-screen"
|
|
5634
5636
|
}, className);
|
|
5635
5637
|
React.useEffect(() => {
|
|
5636
5638
|
var _a2, _b;
|
|
@@ -5640,12 +5642,11 @@ const ModalDialog = (_a) => {
|
|
|
5640
5642
|
(_b = dialog.current) === null || _b === void 0 ? void 0 : _b.close();
|
|
5641
5643
|
}
|
|
5642
5644
|
}, [open, variant]);
|
|
5643
|
-
return jsxRuntime.jsx(context.Provider, { value: { $dialog: dialog.current }, children: jsxRuntime.jsx("dialog", Object.assign({ ref: dialog, className: classes, onClose }, rest, { children: jsxRuntime.jsx(
|
|
5644
|
-
"ui:h-screen": variant === "side-modal"
|
|
5645
|
-
}), children: jsxRuntime.jsx(Stack, { width: "full", align: "stretch", className: classNames__default.default({
|
|
5645
|
+
return jsxRuntime.jsx(context.Provider, { value: { $dialog: dialog.current }, children: jsxRuntime.jsx("dialog", Object.assign({ ref: dialog, className: classes, onClose }, rest, { children: jsxRuntime.jsx(Stack, { width: "full", align: "stretch", backgroundColor: "surface", borderRadiusLeft: variant === "side-modal" ? "m" : "none", borderRadius: variant === "centered-dialog" ? "m" : "none", className: classNames__default.default({
|
|
5646
5646
|
"ui:max-h-[calc(100dvh-(var(--ui-spacing-xl))*2)]": variant === "centered-dialog",
|
|
5647
|
-
"ui:h-screen": variant === "side-modal"
|
|
5648
|
-
|
|
5647
|
+
"ui:h-screen": variant === "side-modal" || variant === "full-screen",
|
|
5648
|
+
"ui:w-screen": variant === "full-screen"
|
|
5649
|
+
}), children }) })) });
|
|
5649
5650
|
};
|
|
5650
5651
|
const Body = (_a) => {
|
|
5651
5652
|
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
@@ -5656,7 +5657,7 @@ const Header = (props) => {
|
|
|
5656
5657
|
return jsxRuntime.jsx(Stack, Object.assign({ axis: "x", justify: "between", align: "center", gap: "m", p: "m" }, props));
|
|
5657
5658
|
};
|
|
5658
5659
|
const Footer = (props) => {
|
|
5659
|
-
return jsxRuntime.jsx(Stack, Object.assign({ p: "m", backgroundColor: "background" }, props));
|
|
5660
|
+
return jsxRuntime.jsx(Stack, Object.assign({ as: "footer", p: "m", backgroundColor: "background", className: "ui:rounded-b-[inherit]" }, props));
|
|
5660
5661
|
};
|
|
5661
5662
|
const CloseButton = (props) => {
|
|
5662
5663
|
return jsxRuntime.jsx(TertiaryButton, Object.assign({ leadingIcon: jsxRuntime.jsx(CrossIcon, {}) }, props));
|
|
@@ -5738,7 +5739,7 @@ const FilePreview = (props) => {
|
|
|
5738
5739
|
const onCloseDialog = (event) => {
|
|
5739
5740
|
onClose(event);
|
|
5740
5741
|
};
|
|
5741
|
-
return jsxRuntime.jsx(ModalDialog, { className: backdropClassNames, variant: "full-screen", open: true, onClose: onCloseDialog, children: jsxRuntime.jsxs(Stack, { align: "center", justify: "center", width: "full", className: previewClassNames, children: [jsxRuntime.jsxs(Stack, { axis: "x", gap: "m", className: buttonContainerClassNames, children: [jsxRuntime.jsx("a", { href: downloadUrl !== null && downloadUrl !== void 0 ? downloadUrl : fileUrl, target: "_blank", rel: "noopener noreferrer", onClick: onDownload, children: jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [jsxRuntime.jsx(Tooltip__namespace.Trigger, { children: jsxRuntime.jsx(SecondaryIconButton, { label: localization.downloadButtonLabel, children: jsxRuntime.jsx(DownloadIcon, {}) }) }), jsxRuntime.jsx(ButtonTooltipContent, { children: localization.downloadButtonLabel })] }) }), jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [jsxRuntime.jsx(Tooltip__namespace.Trigger, { children: jsxRuntime.jsx(SecondaryIconButton, { label: localization.closeButtonLabel, onClick: onClose, children: jsxRuntime.jsx(CrossIcon, {}) }) }), jsxRuntime.jsx(ButtonTooltipContent, { children: localization.closeButtonLabel })] })] }), isSupportedImage(fileUrl) && jsxRuntime.jsx(Image$1, { src: fileUrl, className: imageClassNames }), isSupportedFile(fileUrl) && jsxRuntime.jsx("embed", { src: fileUrl, className: fileClassNames })] }) });
|
|
5742
|
+
return jsxRuntime.jsx(ModalDialog, { className: classNames__default.default(backdropClassNames, "ui:[&>div]:bg-transparent"), variant: "full-screen", open: true, onClose: onCloseDialog, children: jsxRuntime.jsxs(Stack, { align: "center", justify: "center", width: "full", className: previewClassNames, children: [jsxRuntime.jsxs(Stack, { axis: "x", gap: "m", className: buttonContainerClassNames, children: [jsxRuntime.jsx("a", { href: downloadUrl !== null && downloadUrl !== void 0 ? downloadUrl : fileUrl, target: "_blank", rel: "noopener noreferrer", onClick: onDownload, children: jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [jsxRuntime.jsx(Tooltip__namespace.Trigger, { children: jsxRuntime.jsx(SecondaryIconButton, { label: localization.downloadButtonLabel, children: jsxRuntime.jsx(DownloadIcon, {}) }) }), jsxRuntime.jsx(ButtonTooltipContent, { children: localization.downloadButtonLabel })] }) }), jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [jsxRuntime.jsx(Tooltip__namespace.Trigger, { children: jsxRuntime.jsx(SecondaryIconButton, { label: localization.closeButtonLabel, onClick: onClose, children: jsxRuntime.jsx(CrossIcon, {}) }) }), jsxRuntime.jsx(ButtonTooltipContent, { children: localization.closeButtonLabel })] })] }), isSupportedImage(fileUrl) && jsxRuntime.jsx(Image$1, { src: fileUrl, className: imageClassNames }), isSupportedFile(fileUrl) && jsxRuntime.jsx("embed", { src: fileUrl, className: fileClassNames })] }) });
|
|
5742
5743
|
};
|
|
5743
5744
|
|
|
5744
5745
|
const AlertWidget = (props) => {
|