@luscii-healthtech/web-ui 2.52.1 → 2.53.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,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { AccordionProps } from "../Accordion/Accordion";
3
- import { ListItemProps } from "../List/List.types";
3
+ import { DraggableListProps, ListItemProps, SortableListProps } from "../List/List.types";
4
4
  import { AccordionItemProps } from "../Accordion/AccordionItem";
5
5
  import { BaseButtonProps } from "../ButtonV2/ButtonProps.type";
6
6
  export interface AccordionListProps extends Omit<AccordionProps, "items"> {
@@ -9,13 +9,24 @@ export interface AccordionListProps extends Omit<AccordionProps, "items"> {
9
9
  searchPlaceholder?: string;
10
10
  emptyListText?: string;
11
11
  };
12
- accordionItems: AccordionListItemProps[];
12
+ accordionItems: AccordionItem[];
13
13
  buttonProps?: BaseButtonProps;
14
14
  isSearchEnabled?: boolean;
15
15
  isLoading?: boolean;
16
16
  }
17
- export interface AccordionListItemProps extends Omit<AccordionItemProps, "content"> {
18
- listItems: ListItemProps[];
19
- }
20
- export declare const AccordionList: React.VFC<AccordionListProps>;
17
+ export declare type AccordionListItemProps<T = ListItemProps> = Omit<AccordionItemProps, "content"> & {
18
+ listItems: T[];
19
+ draggableListType?: "default";
20
+ };
21
+ export declare type DraggableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
22
+ draggableListType: "draggable";
23
+ listItems: DraggableListProps["items"];
24
+ };
25
+ export declare type SortableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
26
+ draggableListType: "sortable";
27
+ draggableIdentifier: string;
28
+ listItems: SortableListProps["items"];
29
+ };
30
+ export declare type AccordionItem = AccordionListItemProps | DraggableAccordionListItemProps | SortableAccordionListItemProps;
31
+ export declare const AccordionList: React.FC<AccordionListProps>;
21
32
  export default AccordionList;
@@ -10,6 +10,8 @@ export declare type BaseListItemProps = {
10
10
  icon?: React.FunctionComponent<IconProps> | string;
11
11
  accessories?: JSX.Element[];
12
12
  onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
13
+ /** Same as onClick to be compatible with listItem */
14
+ handleItemClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
13
15
  onAssetLoadError?: (payload: OnAssetLoadErrorPayload) => void;
14
16
  tooltipId?: string;
15
17
  isSelected?: boolean;
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import type { BaseListProps, BaseListItemProps, OnAssetLoadErrorPayload, DraggableBaseListProps, SortableBaseListProps } from "../BaseList/BaseList.types";
2
3
  export declare type ListItemProps = Omit<BaseListItemProps, "onClick"> & {
3
- handleItemClick?: () => void;
4
+ handleItemClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
4
5
  };
5
6
  export declare type DefaultListProps = Omit<BaseListProps<ListItemProps>, "renderItem" | "itemComponent"> & {
6
7
  onDragEnd?: (itemId: string | number, newIndex: number) => void;