@luscii-healthtech/web-ui 27.7.0 → 27.8.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.
@@ -3,7 +3,7 @@ import { CategorizedFilters, FilterBarLocalization, OnFilterBarFilterChange } fr
3
3
  type ActiveFiltersProps = {
4
4
  filters: CategorizedFilters;
5
5
  onRemoveActiveFilter: OnFilterBarFilterChange;
6
- localization: Pick<FilterBarLocalization, "filtersLabel">;
6
+ localization: Pick<FilterBarLocalization, "filtersLabel" | "removeFilterOptionLabelGetter">;
7
7
  };
8
8
  export declare const ActiveFilters: React.FC<ActiveFiltersProps>;
9
9
  export {};
@@ -57,6 +57,12 @@ export type FilterBarLocalization = {
57
57
  * @default "Filters"
58
58
  */
59
59
  filtersLabel: string;
60
+ /**
61
+ * Function for assigning a label to the remove button of an active filter.
62
+ * @param {TransformedFilterOption} activeFilter
63
+ * @default (activeFilter) => `Remove filter ${activeFilter.label}`
64
+ */
65
+ removeFilterOptionLabelGetter?: (activeFilter: TransformedFilterOption) => string;
60
66
  };
61
67
  export type TransformedFilterOption = {
62
68
  id: string;
@@ -25,6 +25,8 @@ type Props = {
25
25
  * @default "default"
26
26
  */
27
27
  state?: "default" | "highlighted" | "bold";
28
+ disabled?: boolean;
29
+ onClick?: () => void;
28
30
  };
29
31
  export declare const TimelineCard: FC<Props>;
30
32
  export {};
@@ -5657,8 +5657,11 @@ const CloseIcon = () => React__namespace.default.createElement(
5657
5657
  { className: "ui-h-2 ui-w-2", stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
5658
5658
  React__namespace.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" })
5659
5659
  );
5660
+ const defaultRemoveFilterOptionLabelGetter = (activeFilter) => `Remove filter ${activeFilter.label}`;
5660
5661
  const ActiveFilters = (props) => {
5662
+ var _a;
5661
5663
  const { onRemoveActiveFilter, filters, localization } = props;
5664
+ const removeFilterOptionLabelGetter = (_a = localization === null || localization === void 0 ? void 0 : localization.removeFilterOptionLabelGetter) !== null && _a !== void 0 ? _a : defaultRemoveFilterOptionLabelGetter;
5662
5665
  const activeFilters = filters.flatMap((categorizedFilter) => {
5663
5666
  return categorizedFilter.options.map((categorizedFilterOption) => {
5664
5667
  return categorizedFilterOption;
@@ -5681,7 +5684,7 @@ const ActiveFilters = (props) => {
5681
5684
  React__namespace.default.createElement("span", null, activeFilter.label),
5682
5685
  React__namespace.default.createElement(
5683
5686
  "button",
5684
- { type: "button", className: "ui-mx-1 ui-inline-flex ui-h-4 ui-w-4 ui-flex-shrink-0 ui-rounded-full ui-p-1 ui-text-gray-400 hover:ui-bg-gray-200 hover:ui-text-gray-500", onClick: () => onRemoveActiveFilter({
5687
+ { type: "button", "aria-label": removeFilterOptionLabelGetter(activeFilter), className: "ui-mx-1 ui-inline-flex ui-h-4 ui-w-4 ui-flex-shrink-0 ui-rounded-full ui-p-1 ui-text-gray-400 hover:ui-bg-gray-200 hover:ui-text-gray-500", onClick: () => onRemoveActiveFilter({
5685
5688
  changedFilterOption: {
5686
5689
  isChecked: false,
5687
5690
  id: activeFilter.id,
@@ -6052,13 +6055,15 @@ const StatusIndicator = (props) => {
6052
6055
  );
6053
6056
  };
6054
6057
 
6055
- const TimelineCard = ({ title, subtitle, icon, statusText, state = "default" }) => {
6058
+ const TimelineCard = ({ title, subtitle, icon, statusText, state = "default", disabled = false, onClick }) => {
6056
6059
  return React__namespace.default.createElement(
6057
6060
  Stack,
6058
6061
  { axis: "x", width: "full", align: "center" },
6059
6062
  React__namespace.default.createElement(
6060
6063
  Card,
6061
- { className: "ui-w-full ui-border ui-border-primary-dark ui-border-slate-200", padding: false, elevation: state === "highlighted" ? "medium" : "surface" },
6064
+ { as: onClick ? "button" : "div", className: classNames__default.default("ui-w-full ui-border ui-border-slate-100", {
6065
+ "hover:ui-border-slate-200 focus:ui-border-blue-800 focus:ui-outline-primary": onClick
6066
+ }), padding: false, elevation: state === "highlighted" ? "medium" : "surface", onClick, disabled },
6062
6067
  React__namespace.default.createElement(
6063
6068
  Box,
6064
6069
  { className: classNames__default.default({
@@ -6071,8 +6076,8 @@ const TimelineCard = ({ title, subtitle, icon, statusText, state = "default" })
6071
6076
  React__namespace.default.createElement(
6072
6077
  Stack,
6073
6078
  { gap: "m", axis: "x", align: "center" },
6074
- icon && icon.url && React__namespace.default.createElement("img", { className: "ui-flex-shrink-0", width: 24, height: 24, src: icon.url }),
6075
- icon && icon.iconKey && React__namespace.default.createElement(Icon, { className: "ui-flex-shrink-0", name: icon.iconKey }),
6079
+ (icon === null || icon === void 0 ? void 0 : icon.url) && React__namespace.default.createElement("img", { className: "ui-flex-shrink-0", width: 24, height: 24, src: icon.url }),
6080
+ (icon === null || icon === void 0 ? void 0 : icon.iconKey) && React__namespace.default.createElement(Icon, { className: "ui-flex-shrink-0", name: icon.iconKey }),
6076
6081
  React__namespace.default.createElement(
6077
6082
  Stack,
6078
6083
  null,