@transferwise/components 45.1.1 → 45.3.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.
Files changed (42) hide show
  1. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  2. package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
  3. package/build/es/no-polyfill/avatar/colors/avatarColorTestCases.json +402 -0
  4. package/build/es/no-polyfill/avatar/colors/colors.js +10 -0
  5. package/build/es/no-polyfill/avatar/colors/index.js +1 -0
  6. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  7. package/build/es/no-polyfill/index.js +1 -1
  8. package/build/es/no-polyfill/listItem/ListItem.js +1 -0
  9. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -0
  10. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -0
  11. package/build/es/no-polyfill/listItem/index.js +1 -0
  12. package/build/es/polyfill/avatar/Avatar.js +1 -1
  13. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  14. package/build/es/polyfill/avatar/colors/avatarColorTestCases.json +402 -0
  15. package/build/es/polyfill/avatar/colors/colors.js +10 -0
  16. package/build/es/polyfill/avatar/colors/index.js +1 -0
  17. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  18. package/build/es/polyfill/index.js +1 -1
  19. package/build/es/polyfill/listItem/ListItem.js +1 -0
  20. package/build/es/polyfill/listItem/ListItem.spec.js +1 -0
  21. package/build/es/polyfill/listItem/ListItem.story.js +1 -0
  22. package/build/es/polyfill/listItem/index.js +1 -0
  23. package/build/main.css +1 -1
  24. package/build/styles/avatar/Avatar.css +1 -1
  25. package/build/styles/listItem/ListItem.css +1 -0
  26. package/build/styles/main.css +1 -1
  27. package/build/types/avatar/Avatar.d.ts +18 -22
  28. package/build/types/avatar/Avatar.story.d.ts +3 -34
  29. package/build/types/avatar/colors/colors.d.ts +3 -0
  30. package/build/types/avatar/colors/index.d.ts +1 -0
  31. package/build/types/avatar/index.d.ts +2 -2
  32. package/build/types/avatarWrapper/AvatarWrapper.d.ts +1 -0
  33. package/build/types/avatarWrapper/AvatarWrapper.story.d.ts +4 -1
  34. package/build/types/index.d.ts +1 -0
  35. package/build/types/listItem/ListItem.d.ts +12 -0
  36. package/build/types/listItem/ListItem.spec.d.ts +1 -0
  37. package/build/types/listItem/ListItem.story.d.ts +17 -0
  38. package/build/types/listItem/index.d.ts +1 -0
  39. package/build/umd/no-polyfill/main.js +1 -1
  40. package/build/umd/polyfill/main.js +1 -1
  41. package/package.json +2 -2
  42. package/scripts/generate-type-declarations.js +0 -1
@@ -1,22 +1,18 @@
1
- import * as React from 'react';
2
-
3
- export type AvatarSize = "sm" | "md" | "lg" | 40 | 56;
4
-
5
- export type AvatarTheme = "light" | "dark";
6
-
7
- export type AvatarType = "thumbnail" | "icon" | "emoji" | "initials";
8
-
9
- export interface AvatarProps {
10
- backgroundColor?: string;
11
- children?: React.ReactNode;
12
- className?: string;
13
- outlined?: boolean;
14
- size?: AvatarSize;
15
- theme?: AvatarTheme;
16
- type?: AvatarType;
17
- }
18
-
19
- declare const Avatar: React.FC<AvatarProps>;
20
-
21
- export default Avatar;
22
-
1
+ /// <reference types="react" />
2
+ type NumericAvatarSize = 24 | 40 | 48 | 56 | 72;
3
+ type LegacyAvatarSize = 'sm' | 'md' | 'lg';
4
+ export type AvatarSize = NumericAvatarSize | LegacyAvatarSize;
5
+ export type AvatarTheme = 'light' | 'dark';
6
+ export type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';
7
+ export interface AvatarProps {
8
+ backgroundColor?: string;
9
+ backgroundColorSeed?: string;
10
+ children?: React.ReactNode;
11
+ className?: string;
12
+ outlined?: boolean;
13
+ size?: AvatarSize;
14
+ theme?: AvatarTheme;
15
+ type?: AvatarType;
16
+ }
17
+ declare const Avatar: React.FC<AvatarProps>;
18
+ export default Avatar;
@@ -1,42 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { StoryObj } from '@storybook/react';
3
- import { Size, Theme } from '../common';
4
- import Avatar, { AvatarType } from '.';
3
+ import Avatar from '.';
5
4
  declare const _default: {
6
- component: {
7
- ({ backgroundColor, children, className, outlined, size, theme, type }: {
8
- backgroundColor: any;
9
- children: any;
10
- className: any;
11
- outlined: any;
12
- size: any;
13
- theme: any;
14
- type: any;
15
- }): JSX.Element;
16
- propTypes: {
17
- backgroundColor: any;
18
- children: any;
19
- className: any;
20
- outlined: any;
21
- size: any;
22
- theme: any;
23
- type: any;
24
- };
25
- defaultProps: {
26
- backgroundColor: null;
27
- children: null;
28
- className: null;
29
- outlined: boolean;
30
- size: Size;
31
- theme: Theme;
32
- type: AvatarType;
33
- };
34
- };
5
+ component: import("react").FC<import("./Avatar").AvatarProps>;
35
6
  title: string;
36
7
  tags: string[];
37
8
  };
38
9
  export default _default;
39
10
  type Story = StoryObj<typeof Avatar>;
40
- export declare const Emoji: Story;
41
- export declare const Flag: Story;
42
- export declare const Table: Story;
11
+ export declare const Tables: Story;
@@ -0,0 +1,3 @@
1
+ declare const avatarColors: readonly ["--color-bright-blue", "--color-bright-yellow", "--color-bright-pink", "--color-bright-orange"];
2
+ export declare const getAvatarColorFromSeed: (seed: string) => (typeof avatarColors)[number];
3
+ export {};
@@ -0,0 +1 @@
1
+ export * from './colors';
@@ -1,2 +1,2 @@
1
- export { AvatarType } from "./avatarTypes";
2
- export { default } from "./Avatar";
1
+ export { AvatarType } from './avatarTypes';
2
+ export { default } from './Avatar';
@@ -13,6 +13,7 @@ export interface AvatarWrapperBadgeProps {
13
13
  export interface AvatarWrapperProps {
14
14
  url?: string;
15
15
  profileType?: AvatarWrapperProfileType;
16
+ profileId?: number;
16
17
  badgeUrl?: string;
17
18
  badgeAltText?: string;
18
19
  badgeStatusIcon?: AvatarWrapperBadgeStatusIcon;
@@ -4,9 +4,10 @@ import { Sentiment } from '../common';
4
4
  import AvatarWrapper from './AvatarWrapper';
5
5
  declare const _default: {
6
6
  component: {
7
- ({ url, profileType, badgeUrl, badgeAltText, badgeStatusIcon, name, avatarProps, badgeProps, }: {
7
+ ({ url, profileType, profileId, badgeUrl, badgeAltText, badgeStatusIcon, name, avatarProps, badgeProps, }: {
8
8
  url: any;
9
9
  profileType: any;
10
+ profileId: any;
10
11
  badgeUrl: any;
11
12
  badgeAltText: any;
12
13
  badgeStatusIcon: any;
@@ -17,6 +18,7 @@ declare const _default: {
17
18
  defaultProps: {
18
19
  url: undefined;
19
20
  profileType: undefined;
21
+ profileId: undefined;
20
22
  badgeUrl: undefined;
21
23
  badgeAltText: undefined;
22
24
  badgeStatusIcon: undefined;
@@ -27,6 +29,7 @@ declare const _default: {
27
29
  propTypes: {
28
30
  url: any;
29
31
  profileType: any;
32
+ profileId: any;
30
33
  badgeUrl: any;
31
34
  badgeAltText: any;
32
35
  badgeStatusIcon: any;
@@ -86,6 +86,7 @@ export { default as Upload } from './upload';
86
86
  export { default as UploadInput } from './uploadInput';
87
87
  export { SnackbarConsumer, SnackbarContext } from './snackbar/SnackbarContext';
88
88
  export { default as CriticalCommsBanner } from './criticalBanner';
89
+ export { default as ListItem } from './listItem';
89
90
  /**
90
91
  * Hooks
91
92
  */
@@ -0,0 +1,12 @@
1
+ import { ElementType, FC, ReactNode } from 'react';
2
+ type ListItemProps = {
3
+ title: ReactNode;
4
+ value: string;
5
+ media?: ReactNode;
6
+ action?: ReactNode;
7
+ className?: string;
8
+ isContainerAligned?: boolean;
9
+ as?: ElementType;
10
+ };
11
+ declare const ListItem: FC<ListItemProps>;
12
+ export default ListItem;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ component: import("react").FC<{
4
+ title: import("react").ReactNode;
5
+ value: string;
6
+ media?: import("react").ReactNode;
7
+ action?: import("react").ReactNode;
8
+ className?: string | undefined;
9
+ isContainerAligned?: boolean | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ }>;
12
+ title: string;
13
+ tags: string[];
14
+ };
15
+ export default _default;
16
+ export declare const Basic: () => JSX.Element;
17
+ export declare const Variants: () => JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./ListItem";