@luscii-healthtech/web-ui 37.5.5 → 37.5.6

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,5 +1,5 @@
1
- import React from "react";
2
- import { type Props as BoxProps } from "../Box/Box";
1
+ import React, { type ComponentProps } from "react";
2
+ import { Box } from "../Box/Box";
3
3
  import { type TitleProps } from "../Title/Title";
4
4
  type TitleAndMaybeActions = {
5
5
  title: string;
@@ -30,18 +30,9 @@ type TitleAndMaybeActions = {
30
30
  */
31
31
  actions?: never;
32
32
  };
33
- export type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<C> & {
34
- as?: C;
33
+ export type Props<C extends React.ElementType = "div"> = ComponentProps<typeof Box<C>> & {
35
34
  border?: boolean;
36
35
  children: React.ReactNode;
37
- /**
38
- * Adds a box-shadow to the element based on the design system
39
- */
40
- elevation?: BoxProps<C>["elevation"];
41
- /**
42
- * The elevation from the design system to apply when hovering over the card.
43
- */
44
- elevationOnHover?: BoxProps<C>["elevation"];
45
36
  /**
46
37
  * Whether or not to add the default padding to the card. Set this
47
38
  * to `false` if you want to render something full width inside of the
@@ -27,6 +27,18 @@ type Props = Omit<React.ComponentPropsWithoutRef<"dialog">, "open" | "onClose">
27
27
  * Determines the max-width of the modal.
28
28
  */
29
29
  size?: Size;
30
+ /**
31
+ * Determines the presentation of the modal
32
+ *
33
+ * - `"centered-dialog"`
34
+ * Presents a dialog centered on screen.
35
+ *
36
+ * - `"side-modal"`
37
+ * Presents a dialog on the right side of the screen stretching the full height of the viewport.
38
+ *
39
+ * @default "centered-dialog"
40
+ */
41
+ variant?: "centered-dialog" | "side-modal";
30
42
  };
31
43
  type SubComponents = {
32
44
  /**
@@ -6558,7 +6558,7 @@ function TopBar(props) {
6558
6558
  TopBar.Actions = Actions$1;
6559
6559
 
6560
6560
  function Card(props) {
6561
- const { actions: __, as: Element = "div", children, border, className, elevation, elevationOnHover, padding = true, title: _ } = props, rest = __rest(props, ["actions", "as", "children", "border", "className", "elevation", "elevationOnHover", "padding", "title"]);
6561
+ const { actions: __, as: Element = "div", children, border, className, elevation, elevationOnHover, padding = true, title: _, borderRadius = "m" } = props, rest = __rest(props, ["actions", "as", "children", "border", "className", "elevation", "elevationOnHover", "padding", "title", "borderRadius"]);
6562
6562
  const hasHoverEffect = !(elevation === elevationOnHover || elevationOnHover === void 0);
6563
6563
  const hoverShadowClassName = createShadowClassName(elevationOnHover, {
6564
6564
  modifier: "hover",
@@ -6570,7 +6570,7 @@ function Card(props) {
6570
6570
  });
6571
6571
  return React__namespace.default.createElement(
6572
6572
  Box,
6573
- Object.assign({ as: Element, elevation, borderRadius: "m" }, rest, { className: classes }),
6573
+ Object.assign({ as: Element, elevation, borderRadius }, rest, { className: classes }),
6574
6574
  React__namespace.default.createElement(
6575
6575
  Box,
6576
6576
  { className: "ui-bg-white" },
@@ -7324,12 +7324,19 @@ const Collapse = (props) => {
7324
7324
  };
7325
7325
 
7326
7326
  const ModalDialog = (_a) => {
7327
- var { open, className, size, onClose, children } = _a, rest = __rest(_a, ["open", "className", "size", "onClose", "children"]);
7327
+ var { open, className, size, onClose, children, variant = "centered-dialog" } = _a, rest = __rest(_a, ["open", "className", "size", "onClose", "children", "variant"]);
7328
7328
  const dialog = React.useRef(null);
7329
- const classes = classNames__default.default(className, "ui-bg-transparent", "ui-max-w-[calc(100dvw-theme('spacing.xl'))]", "ui-my-xl", "ui-top-0", "ui-bottom-auto", {
7329
+ const classes = classNames__default.default(className, "ui-bg-transparent", "ui-max-w-[calc(100dvw-theme('spacing.xl'))]", {
7330
+ "ui-my-xl": variant === "centered-dialog"
7331
+ }, "ui-top-0", "ui-bottom-auto", {
7330
7332
  "md:ui-w-80": size === "s",
7331
7333
  "md:ui-w-132": size === "m",
7332
7334
  "md:ui-w-216": size === "l"
7335
+ }, {
7336
+ "ui-right-0": variant === "side-modal",
7337
+ "ui-left-auto": variant === "side-modal",
7338
+ "ui-bottom-0": variant === "side-modal",
7339
+ "ui-max-h-full": variant === "side-modal"
7333
7340
  });
7334
7341
  React.useEffect(() => {
7335
7342
  var _a2, _b;
@@ -7338,14 +7345,19 @@ const ModalDialog = (_a) => {
7338
7345
  } else {
7339
7346
  (_b = dialog.current) === null || _b === void 0 ? void 0 : _b.close();
7340
7347
  }
7341
- }, [open]);
7348
+ }, [open, variant]);
7342
7349
  return React__namespace.default.createElement(
7343
7350
  "dialog",
7344
7351
  Object.assign({ ref: dialog, className: classes, onClose }, rest),
7345
7352
  React__namespace.default.createElement(
7346
7353
  Card,
7347
- { padding: false },
7348
- React__namespace.default.createElement(Stack, { width: "full", align: "stretch", className: "ui-max-h-[calc(100dvh-theme('spacing.xl')*2)]" }, children)
7354
+ { padding: false, borderRadius: variant === "side-modal" ? "none" : "m", className: classNames__default.default({
7355
+ "ui-h-screen": variant === "side-modal"
7356
+ }) },
7357
+ React__namespace.default.createElement(Stack, { width: "full", align: "stretch", className: classNames__default.default({
7358
+ "ui-max-h-[calc(100dvh-theme('spacing.xl')*2)]": variant === "centered-dialog",
7359
+ "ui-h-screen": variant === "side-modal"
7360
+ }) }, children)
7349
7361
  )
7350
7362
  );
7351
7363
  };