@tracktor/design-system 3.12.0 → 3.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # [Versions](https://github.com/Tracktor/design-system/releases)
2
2
 
3
- ## v3.12.0
4
- ### Feat
5
- - Add a sheet file compatible with `ListAvatar`
3
+ ## v3.12.1
4
+ ### Fix
5
+ - Export type `ListAvatar`
@@ -1,6 +1,38 @@
1
1
  import { ChipProps, ListItemButtonProps, SxProps } from '@mui/material';
2
2
  import { MouseEvent, ReactNode } from 'react';
3
- interface ListAvatarProps {
3
+ interface ListAvatarItemBase {
4
+ Avatar?: ReactNode;
5
+ id?: string | number | null;
6
+ title?: ReactNode;
7
+ subtitle?: ReactNode;
8
+ image?: string | null;
9
+ thumbnail?: string | null;
10
+ icon?: ReactNode;
11
+ chipLabel?: ReactNode;
12
+ chipColor?: ChipProps["color"] | string;
13
+ secondaryAction?: ReactNode;
14
+ }
15
+ export interface ListAvatarClickPayload {
16
+ id?: string | number | null;
17
+ image?: string | null;
18
+ thumbnail?: string | null;
19
+ subtitle?: ReactNode;
20
+ title?: ReactNode;
21
+ icon?: ReactNode;
22
+ isFile: boolean;
23
+ isPdf: boolean;
24
+ }
25
+ export interface ListAvatarAction {
26
+ title?: string | null;
27
+ subtitle?: string | null;
28
+ image?: string | null;
29
+ icon?: ReactNode;
30
+ onClick?: ListItemButtonProps["onClick"];
31
+ }
32
+ export interface ListAvatarItem extends ListAvatarItemBase {
33
+ onClick?: (event: MouseEvent<HTMLLIElement>, item: ListAvatarClickPayload) => void;
34
+ }
35
+ export interface ListAvatarProps {
4
36
  /**
5
37
  * Empty message
6
38
  */
@@ -32,38 +64,11 @@ interface ListAvatarProps {
32
64
  /**
33
65
  * List items
34
66
  */
35
- items?: {
36
- id?: string | number | null;
37
- title?: ReactNode;
38
- subtitle?: ReactNode;
39
- image?: string | null;
40
- thumbnail?: string | null;
41
- icon?: ReactNode;
42
- chipLabel?: ReactNode;
43
- chipColor?: ChipProps["color"] | string;
44
- secondaryAction?: ReactNode;
45
- onClick?: (event: MouseEvent<HTMLLIElement>, item: {
46
- id?: NonNullable<ListAvatarProps["items"]>[number]["id"];
47
- image?: NonNullable<ListAvatarProps["items"]>[number]["image"];
48
- thumbnail?: NonNullable<ListAvatarProps["items"]>[number]["thumbnail"];
49
- subtitle?: NonNullable<ListAvatarProps["items"]>[number]["subtitle"];
50
- title?: NonNullable<ListAvatarProps["items"]>[number]["title"];
51
- icon?: NonNullable<ListAvatarProps["items"]>[number]["icon"];
52
- isFile: boolean;
53
- isPdf: boolean;
54
- }) => void;
55
- Avatar?: ReactNode;
56
- }[];
67
+ items?: ListAvatarItem[];
57
68
  /**
58
69
  * Action
59
70
  */
60
- action?: {
61
- title?: string | null;
62
- subtitle?: string | null;
63
- image?: string | null;
64
- icon?: ReactNode;
65
- onClick?: ListItemButtonProps["onClick"];
66
- };
71
+ action?: ListAvatarAction;
67
72
  }
68
73
  export declare const ListAvatar: ({ Empty, action, items, fullWidth, sx, alwaysDisplaySecondaryAction, isLoading, disableLightbox, numberLoadingItems, }: ListAvatarProps) => string | number | true | Iterable<ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element | null;
69
74
  export default ListAvatar;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tracktor/design-system",
3
3
  "description": "Tracktor Design System",
4
4
  "sideEffects": false,
5
- "version": "3.12.0",
5
+ "version": "3.12.1",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",