@luscii-healthtech/web-ui 27.12.0 → 27.13.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.
@@ -1,11 +1,25 @@
1
1
  import React from "react";
2
2
  type Props = {
3
3
  children: React.ReactNode;
4
+ /**
5
+ * Use this prop to apply a custom class name to the root element
6
+ */
4
7
  className?: string;
5
- disabled?: boolean;
8
+ /**
9
+ * Use this prop to control the height of the collapsed content
10
+ * for example by using Tailwinds line-clamp utility classes.
11
+ * Hiding the overflow will be handled by the component.
12
+ *
13
+ * If this prop is not supplied, the component will not collapse and get the height of the content.
14
+ *
15
+ * @example "h-20"
16
+ * @example "ui-line-clamp-5"
17
+ */
18
+ contentClassName?: string;
6
19
  isCollapsed?: boolean;
7
20
  onClick?: () => void;
8
21
  moreIndicator?: React.ReactNode;
22
+ showMoreIndicator?: boolean;
9
23
  };
10
24
  export declare const Collapse: (props: Props) => React.JSX.Element;
11
25
  export {};
@@ -2149,9 +2149,9 @@ const ModalBase = (props) => {
2149
2149
  { 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", {
2150
2150
  "ui-overflow-y-hidden": props.scrollableContent,
2151
2151
  "ui-mt-17": props.withExtraMarginTop,
2152
- "ui-w-80": size === "small",
2153
- "ui-w-132": size === "medium",
2154
- "ui-w-216": size === "wide"
2152
+ "md:ui-w-80": size === "small",
2153
+ "md:ui-w-132": size === "medium",
2154
+ "md:ui-w-216": size === "wide"
2155
2155
  }) },
2156
2156
  props.title && React__namespace.default.createElement(ModalHeader, { title: props.title, onCloseClick: props.onCloseClick }),
2157
2157
  React__namespace.default.createElement(
@@ -6194,15 +6194,20 @@ const Indicator = () => {
6194
6194
  HoverIndicatorControl.Indicator = Indicator;
6195
6195
 
6196
6196
  const Collapse = (props) => {
6197
- const { children, className: classNameFromProps, disabled, isCollapsed, onClick, moreIndicator = React__namespace.default.createElement(Text, { className: "ui-text-center" }, "...") } = props;
6198
- const className = classNames__default.default("w-full", classNameFromProps, {
6197
+ const { children, className, contentClassName: classNameFromProps, isCollapsed, onClick, moreIndicator = React__namespace.default.createElement(Text, { className: "ui-text-center" }, "..."), showMoreIndicator = true } = props;
6198
+ const contentClassName = classNames__default.default("w-full", classNameFromProps, {
6199
6199
  "ui-overflow-hidden": isCollapsed
6200
6200
  });
6201
+ const buttonClassName = classNames__default.default("ui-text-left", className);
6201
6202
  return React__namespace.default.createElement(
6202
6203
  React__namespace.default.Fragment,
6203
6204
  null,
6204
- React__namespace.default.createElement("button", { disabled, className, onClick, "aria-expanded": !isCollapsed }, children),
6205
- isCollapsed && moreIndicator
6205
+ React__namespace.default.createElement(
6206
+ "button",
6207
+ { className: buttonClassName, onClick, "aria-expanded": !isCollapsed },
6208
+ React__namespace.default.createElement("div", { className: contentClassName }, children),
6209
+ isCollapsed && showMoreIndicator && moreIndicator
6210
+ )
6206
6211
  );
6207
6212
  };
6208
6213