@luscii-healthtech/web-ui 44.5.2 → 44.6.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.
@@ -2000,19 +2000,27 @@ const ModalFooter = (props) => {
2000
2000
  }), children: [props.footerLeadingAccessory && (typeof props.footerLeadingAccessory === "string" ? jsxRuntime.jsx(Text, { variant: "base", color: "slate-500", children: props.footerLeadingAccessory }) : props.footerLeadingAccessory), props.footerLeadingComponent && (typeof props.footerLeadingComponent === "string" ? jsxRuntime.jsx(Text, { variant: "base", color: "slate-500", children: props.footerLeadingComponent }) : jsxRuntime.jsx(SecondaryButton, Object.assign({ "data-test-id": "modal-footer-leading-secondary-button" }, props.footerLeadingComponent))), jsxRuntime.jsxs("div", { className: "ui:flex ui:flex-row ui:space-x-2", children: [props.footerTrailingComponents.secondaryButton, props.footerTrailingComponents.secondaryButtonProps && jsxRuntime.jsx(SecondaryButton, Object.assign({ "data-test-id": "modal-footer-trailing-secondary-button" }, props.footerTrailingComponents.secondaryButtonProps)), props.footerTrailingComponents.primaryButton, props.footerTrailingComponents.primaryButtonProps && jsxRuntime.jsx(PrimaryButton, Object.assign({ "data-test-id": "modal-footer-trailing-primary-button" }, props.footerTrailingComponents.primaryButtonProps))] })] });
2001
2001
  };
2002
2002
 
2003
+ const TOP_BOTTOM_MARGIN_REM = 7.5;
2004
+ const TOP_BOTTOM_EXTRA_MARGIN_REM = 8.5;
2003
2005
  const ModalBase = (props) => {
2004
2006
  var _a;
2005
- const { size = "medium", withContentPaddingY = true, isOpen = false } = props;
2007
+ const { size = "medium", withContentPaddingY = true, isOpen = false, autoMaxContentHeight = false } = props;
2006
2008
  return jsxRuntime.jsxs(ReactModal__default.default, { isOpen, data: { "test-id": (_a = props.dataTestId) !== null && _a !== void 0 ? _a : "react-modal" }, contentLabel: props.title, overlayClassName: classNames__default.default("ui:px-2 ui:py-15", "ui:z-20", "ui:fixed ui:top-0 ui:bottom-0 ui:left-0 ui:right-0", "ui:overflow-x-hidden ui:overflow-y-auto", "ui:bg-overlay"), onRequestClose: props.onCloseClick, shouldFocusAfterRender: false, shouldCloseOnOverlayClick: false, className: classNames__default.default("ui:mx-auto ui:my-0", "ui:relative", "ui:rounded-lg ui:bg-white ui:shadow-lg ui:outline-none", {
2009
+ "ui:flex ui:flex-col": props.scrollableContent && autoMaxContentHeight,
2007
2010
  "ui:overflow-y-hidden": props.scrollableContent,
2008
2011
  "ui:mt-17": props.withExtraMarginTop,
2009
2012
  "ui:md:w-120": size === "dialog-medium",
2010
2013
  "ui:md:w-80": size === "small" || size === "dialog-small",
2011
2014
  "ui:md:w-132": size === "medium",
2012
2015
  "ui:md:w-216": size === "wide"
2013
- }), children: [props.title && jsxRuntime.jsx(ModalHeader, { title: props.title, onCloseClick: props.onCloseClick }), jsxRuntime.jsx("div", { className: classNames__default.default({
2016
+ }), style: {
2017
+ content: props.scrollableContent && autoMaxContentHeight ? {
2018
+ height: props.withExtraMarginTop ? `calc(100vh - ${TOP_BOTTOM_MARGIN_REM} - ${TOP_BOTTOM_EXTRA_MARGIN_REM})` : `calc(100vh - ${TOP_BOTTOM_MARGIN_REM})`
2019
+ } : {}
2020
+ }, children: [props.title && jsxRuntime.jsx(ModalHeader, { title: props.title, onCloseClick: props.onCloseClick }), jsxRuntime.jsx("div", { className: classNames__default.default({
2014
2021
  "ui:rounded-t-lg": !props.title,
2015
- "ui:max-h-135 ui:overflow-y-auto": props.scrollableContent
2022
+ "ui:flex-1 ui:overflow-y-auto ui:min-h-0": props.scrollableContent && autoMaxContentHeight,
2023
+ "ui:max-h-135 ui:overflow-y-auto": props.scrollableContent && !autoMaxContentHeight
2016
2024
  }), children: jsxRuntime.jsx("div", { className: classNames__default.default("ui:px-6", {
2017
2025
  "ui:py-6": withContentPaddingY
2018
2026
  }), children: props.children }) }), jsxRuntime.jsx(ModalFooter, { footerLeadingAccessory: props.footerLeadingAccessory, footerLeadingComponent: props.footerLeadingComponent, footerTrailingComponents: props.footerTrailingComponents })] });