@luscii-healthtech/web-ui 37.3.0 → 37.4.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.
@@ -3,7 +3,14 @@ import "./Title.scss";
3
3
  import { type TextColor } from "../Text/Text";
4
4
  export type TitleStyle = "xs" | "sm" | "base" | "lg" | "xl" | "2xl";
5
5
  type SharedProps = {
6
+ /**
7
+ * @deprecated, use variant instead
8
+ */
6
9
  type?: TitleStyle;
10
+ /**
11
+ * @default "base"
12
+ */
13
+ variant?: TitleStyle;
7
14
  color?: TextColor;
8
15
  className?: string;
9
16
  ref?: React.ForwardedRef<HTMLHeadingElement>;
@@ -1464,7 +1464,7 @@ const ToasterPanel = ({ message = "", title = "", type = TOASTER_TYPE_OPTIONS.SU
1464
1464
  const isFailure = type === TOASTER_TYPE_OPTIONS.FAILURE;
1465
1465
  return React__namespace.default.createElement(
1466
1466
  "div",
1467
- { "data-test-id": `toaster-panel-${type}`, className: classNames__default.default("ui-rounded-md ui-shadow-lg", "ui-max-h-19 ui-min-h-13 ui-w-104", "ui-relative", "ui-overflow-hidden", {
1467
+ { role: "status", "data-test-id": `toaster-panel-${type}`, className: classNames__default.default("ui-rounded-md ui-shadow-lg", "ui-max-h-19 ui-min-h-13 ui-w-104", "ui-relative", "ui-overflow-hidden", {
1468
1468
  "type-success": isSuccess,
1469
1469
  "type-failure": isFailure,
1470
1470
  "ui-bg-red-50": isFailure,
@@ -1509,7 +1509,7 @@ const ToasterPanel = ({ message = "", title = "", type = TOASTER_TYPE_OPTIONS.SU
1509
1509
  "ui-bg-red-50": isFailure,
1510
1510
  "ui-bg-green-50": isSuccess
1511
1511
  }) },
1512
- React__namespace.default.createElement("div", { "data-test-id": "toaster-progress-bar", className: classNames__default.default("ui-transiation progress-reverse ui-h-full ui-w-full ui-origin-left ui-animate-[progress-reverse_5s_linear_forwards] ui-duration-[3000ms]", {
1512
+ React__namespace.default.createElement("div", { "data-test-id": "toaster-progress-bar", className: classNames__default.default("ui-transiation progress-reverse ui-duration-[3000ms] ui-h-full ui-w-full ui-origin-left ui-animate-[progress-reverse_5s_linear_forwards]", {
1513
1513
  "ui-bg-red-400": isFailure,
1514
1514
  "ui-bg-green-400": isSuccess
1515
1515
  }), onAnimationEnd })
@@ -1537,22 +1537,23 @@ var css_248z$g = "/**\n * --- DEPRECATED ---\n * DON'T USE ANYTHING FROM THIS FI
1537
1537
  styleInject(css_248z$g);
1538
1538
 
1539
1539
  const Title = (props) => {
1540
- const { type = "base", color, className, ref, text, children } = props;
1541
- const isSmallTitle = type === "xs" || type === "sm";
1540
+ const { variant: variantFromProps = "base", type, className, text, children, color, ref } = props;
1541
+ const variant = type ? type : variantFromProps;
1542
+ const isSmallTitle = variant === "xs" || variant === "sm";
1542
1543
  const containerClassName = classNames__default.default("ui-font-bold ui-leading-inherit ui-antialiased", allowedColors[color !== null && color !== void 0 ? color : "base"], {
1543
1544
  "title-inter": isSmallTitle,
1544
1545
  "title-avenir": !isSmallTitle
1545
1546
  //this is used to load the correct font from the css
1546
1547
  }, {
1547
- "ui-text-base": type === "xs",
1548
- "ui-text-xl": type === "sm",
1549
- "ui-text-2xl": type === "base",
1550
- "ui-text-3xl": type === "lg",
1551
- "ui-text-4xl ": type === "xl",
1552
- "ui-text-6xl ": type === "2xl"
1548
+ "ui-text-base": variant === "xs",
1549
+ "ui-text-xl": variant === "sm",
1550
+ "ui-text-2xl": variant === "base",
1551
+ "ui-text-3xl": variant === "lg",
1552
+ "ui-text-4xl ": variant === "xl",
1553
+ "ui-text-6xl ": variant === "2xl"
1553
1554
  }, className);
1554
1555
  let ContainerElement;
1555
- switch (type) {
1556
+ switch (variant) {
1556
1557
  case "sm":
1557
1558
  ContainerElement = "h5";
1558
1559
  break;
@@ -1595,7 +1596,7 @@ const AccordionItem = ({ id, title, content, isCollapsedByDefault = false, onClo
1595
1596
  "ui-border-b ui-border-slate-200": !isCollapsed
1596
1597
  }) },
1597
1598
  React__namespace.default.createElement(Chevron, { className: "ui-shrink-0 ui-self-center ui-text-slate-500" }),
1598
- isString__default.default(title) ? React__namespace.default.createElement(Title, { type: "xs" }, title) : title
1599
+ isString__default.default(title) ? React__namespace.default.createElement(Title, { variant: "xs" }, title) : title
1599
1600
  ),
1600
1601
  React__namespace.default.createElement("div", { className: classNames__default.default({ "ui-hidden": isCollapsed }) }, content)
1601
1602
  );
@@ -1664,8 +1665,8 @@ const BaseListHeader = ({ title, button, transparent, withBorder }) => {
1664
1665
  return React__namespace.default.createElement(
1665
1666
  "div",
1666
1667
  { "data-test-id": "base-list-header", className },
1667
- typeof title === "string" && React__namespace.default.createElement(Title, { type: "xs", text: title }),
1668
- title && typeof title === "object" && React__namespace.default.createElement(Title, Object.assign({ type: "xs" }, title)),
1668
+ typeof title === "string" && React__namespace.default.createElement(Title, { variant: "xs", text: title }),
1669
+ title && typeof title === "object" && React__namespace.default.createElement(Title, Object.assign({ variant: "xs" }, title)),
1669
1670
  button && React__namespace.default.createElement("div", { className: "ui-space-x-3" }, React__namespace.default.createElement(button.buttonType, button.buttonProps))
1670
1671
  );
1671
1672
  };
@@ -2516,7 +2517,7 @@ const CenteredHero = ({ title, text, image, slots, background = "slate-50", imag
2516
2517
  "ui-max-h-36": imageSize === "small",
2517
2518
  "ui-max-h-72": imageSize === "large"
2518
2519
  }) }),
2519
- title && React__namespace.default.createElement(Title, { type: "base" }, title),
2520
+ title && React__namespace.default.createElement(Title, { variant: "base" }, title),
2520
2521
  text && React__namespace.default.createElement(Text, { className: "ui-text-center" }, text),
2521
2522
  (slots === null || slots === void 0 ? void 0 : slots.bottom) && React__namespace.default.createElement(Box, { mt: "m" }, slots === null || slots === void 0 ? void 0 : slots.bottom)
2522
2523
  );
@@ -2589,7 +2590,7 @@ const AccordionList = (_a) => {
2589
2590
  React__namespace.default.createElement(
2590
2591
  React__namespace.default.Fragment,
2591
2592
  null,
2592
- title && React__namespace.default.createElement(Title, { type: "sm" }, title),
2593
+ title && React__namespace.default.createElement(Title, { variant: "sm" }, title),
2593
2594
  headerActions && React__namespace.default.createElement(React__namespace.default.Fragment, null, headerActions)
2594
2595
  )
2595
2596
  ),
@@ -3183,7 +3184,7 @@ const ConfirmationDialogTitle = (props) => {
3183
3184
  "ui-items-center ui-justify-center": (_a = props.title) === null || _a === void 0 ? void 0 : _a.icon
3184
3185
  }) },
3185
3186
  props.title.icon && React__namespace.default.createElement(IconComponentOrKey, { name: props.title.icon, className: "dialog-header-icon ui-h-12 ui-w-12 ui-text-primary" }),
3186
- React__namespace.default.createElement(Title, { text: props.title.title, type: "sm" })
3187
+ React__namespace.default.createElement(Title, { variant: "sm" }, props.title.title)
3187
3188
  ) : null;
3188
3189
  };
3189
3190
 
@@ -5001,7 +5002,7 @@ function Page({
5001
5002
  });
5002
5003
  const accessoriesContent = accessories instanceof Function ? accessories() : accessories;
5003
5004
  const childrenOrContentProp = children || (content instanceof Function ? content() : content);
5004
- return /* @__PURE__ */ React__namespace.default.createElement("div", { id, className: containerClassnames }, /* @__PURE__ */ React__namespace.default.createElement(NavLayout, __spreadValues$1({ menu: navMenu }, navLayoutProps), /* @__PURE__ */ React__namespace.default.createElement("div", { className: mergedPageClasses, "data-test-id": dataTestId }, /* @__PURE__ */ React__namespace.default.createElement("div", { className: accessoryClasses }, /* @__PURE__ */ React__namespace.default.createElement(Title, { "data-test-id": `${dataTestId}-title`, text: maybeTitle }), isPolling && /* @__PURE__ */ React__namespace.default.createElement(
5005
+ return /* @__PURE__ */ React__namespace.default.createElement("div", { id, className: containerClassnames }, /* @__PURE__ */ React__namespace.default.createElement(NavLayout, __spreadValues$1({ menu: navMenu }, navLayoutProps), /* @__PURE__ */ React__namespace.default.createElement("div", { className: mergedPageClasses, "data-test-id": dataTestId }, /* @__PURE__ */ React__namespace.default.createElement("div", { className: accessoryClasses }, /* @__PURE__ */ React__namespace.default.createElement(Title, { "data-test-id": `${dataTestId}-title` }, maybeTitle), isPolling && /* @__PURE__ */ React__namespace.default.createElement(
5005
5006
  LoadingIndicator,
5006
5007
  {
5007
5008
  asSpinner: true,
@@ -5571,7 +5572,7 @@ const SectionHeader = ({ title, aside, isLoading = false }) => {
5571
5572
  React__namespace.default.createElement(
5572
5573
  Stack,
5573
5574
  { axis: "x", justify: "center", align: "center", gap: "xs" },
5574
- typeof title === "string" ? React__namespace.default.createElement(Title, { type: "sm" }, title) : title,
5575
+ typeof title === "string" ? React__namespace.default.createElement(Title, { variant: "sm" }, title) : title,
5575
5576
  isLoading && React__namespace.default.createElement(LoadingIndicator, { asSpinner: true })
5576
5577
  ),
5577
5578
  aside
@@ -6184,7 +6185,7 @@ const TimelineHeader = ({ title, buttons, withBorder = true }) => {
6184
6185
  return React__namespace.default.createElement(
6185
6186
  "div",
6186
6187
  { "data-test-id": "timeline-header", className },
6187
- title && React__namespace.default.createElement(Title, Object.assign({ type: "sm" }, typeof title === "object" ? title : { text: title })),
6188
+ title && React__namespace.default.createElement(Title, Object.assign({ variant: "sm" }, typeof title === "object" ? title : { text: title })),
6188
6189
  hasButtons && React__namespace.default.createElement("div", { className: "ui-flex ui-flex-row ui-space-x-4" }, buttons.map(({ buttonType: ButtonComponent, buttonProps }) => React__namespace.default.createElement(ButtonComponent, Object.assign({}, buttonProps))))
6189
6190
  );
6190
6191
  };
@@ -6449,7 +6450,7 @@ function Card(props) {
6449
6450
  )
6450
6451
  );
6451
6452
  }
6452
- Card.Title = (props) => React__namespace.default.createElement(Title, Object.assign({ type: "sm" }, props));
6453
+ Card.Title = (props) => React__namespace.default.createElement(Title, Object.assign({ variant: "sm" }, props));
6453
6454
  Card.TopBar = TopBar;
6454
6455
  Card.Padding = Padding;
6455
6456
  Card.Section = Section;
@@ -6463,7 +6464,7 @@ function RenderTopBar(props) {
6463
6464
  React__namespace.default.createElement(
6464
6465
  TopBar,
6465
6466
  { className: "ui-flex ui-flex-wrap ui-items-center ui-justify-between" },
6466
- React__namespace.default.createElement(Title, { type: "sm" }, title),
6467
+ React__namespace.default.createElement(Title, { variant: "sm" }, title),
6467
6468
  React__namespace.default.createElement(Actions$1, null, actions)
6468
6469
  )
6469
6470
  );
@@ -6486,7 +6487,7 @@ function RenderTopBar(props) {
6486
6487
  React__namespace.default.createElement(
6487
6488
  TopBar,
6488
6489
  null,
6489
- React__namespace.default.createElement(Title, { type: "sm" }, title)
6490
+ React__namespace.default.createElement(Title, { variant: "sm" }, title)
6490
6491
  )
6491
6492
  );
6492
6493
  }
@@ -7029,7 +7030,7 @@ const LoadingState = () => {
7029
7030
  { width: "full" },
7030
7031
  React__namespace.default.createElement(
7031
7032
  Title,
7032
- { type: "xs" },
7033
+ { variant: "xs" },
7033
7034
  React__namespace.default.createElement(Skeleton, { width: 120 })
7034
7035
  ),
7035
7036
  React__namespace.default.createElement(
@@ -7077,7 +7078,7 @@ const TimelineCard = ({ title, subtitle, icon, leadingIcon, trailingIcon, status
7077
7078
  React__namespace.default.createElement(
7078
7079
  Stack,
7079
7080
  { width: "full" },
7080
- (presentation === "bold" || presentation === "highlighted") && React__namespace.default.createElement(Title, { type: "xs" }, title),
7081
+ (presentation === "bold" || presentation === "highlighted") && React__namespace.default.createElement(Title, { variant: "xs" }, title),
7081
7082
  presentation === "default" && React__namespace.default.createElement(Text, { variant: "base", color: "slate-500" }, title),
7082
7083
  typeof subtitle === "string" ? React__namespace.default.createElement(Text, { variant: "sm", color: "slate-500" }, subtitle) : subtitle
7083
7084
  )