@transferwise/components 0.0.0-experimental-4533565 → 0.0.0-experimental-da1781d

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 (127) hide show
  1. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  2. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  3. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -1
  4. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  5. package/build/index.js +3 -3
  6. package/build/index.mjs +2 -2
  7. package/build/{listItem/ListItem.js → legacylistItem/LegacyListItem.js} +3 -3
  8. package/build/legacylistItem/LegacyListItem.js.map +1 -0
  9. package/build/{listItem/ListItem.mjs → legacylistItem/LegacyListItem.mjs} +3 -3
  10. package/build/legacylistItem/LegacyListItem.mjs.map +1 -0
  11. package/build/legacylistItem/List.js.map +1 -0
  12. package/build/legacylistItem/List.mjs.map +1 -0
  13. package/build/main.css +60 -57
  14. package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
  15. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  16. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
  17. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  18. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  19. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
  20. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs +2 -2
  21. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
  22. package/build/styles/legacylistItem/LegacyListItem.css +6 -0
  23. package/build/styles/listItem/ListItem.css +185 -3
  24. package/build/styles/main.css +60 -57
  25. package/build/styles/switch/Switch.css +3 -0
  26. package/build/types/index.d.ts +3 -3
  27. package/build/types/index.d.ts.map +1 -1
  28. package/build/types/legacylistItem/LegacyListItem.d.ts +13 -0
  29. package/build/types/legacylistItem/LegacyListItem.d.ts.map +1 -0
  30. package/build/types/legacylistItem/List.d.ts.map +1 -0
  31. package/build/types/legacylistItem/index.d.ts +5 -0
  32. package/build/types/legacylistItem/index.d.ts.map +1 -0
  33. package/build/types/listItem/ListItem.d.ts +38 -8
  34. package/build/types/listItem/ListItem.d.ts.map +1 -1
  35. package/build/types/listItem/ListItemAdditionalInfo.d.ts +9 -0
  36. package/build/types/listItem/ListItemAdditionalInfo.d.ts.map +1 -0
  37. package/build/types/listItem/ListItemButton.d.ts +4 -0
  38. package/build/types/listItem/ListItemButton.d.ts.map +1 -0
  39. package/build/types/listItem/ListItemCheckbox.d.ts +4 -0
  40. package/build/types/listItem/ListItemCheckbox.d.ts.map +1 -0
  41. package/build/types/listItem/ListItemIconButton.d.ts +7 -0
  42. package/build/types/listItem/ListItemIconButton.d.ts.map +1 -0
  43. package/build/types/listItem/ListItemMedia.d.ts +19 -0
  44. package/build/types/listItem/ListItemMedia.d.ts.map +1 -0
  45. package/build/types/listItem/ListItemNavigation.d.ts +4 -0
  46. package/build/types/listItem/ListItemNavigation.d.ts.map +1 -0
  47. package/build/types/{item/ItemSwitch.d.ts → listItem/ListItemSwitch.d.ts} +1 -1
  48. package/build/types/listItem/ListItemSwitch.d.ts.map +1 -0
  49. package/build/types/listItem/index.d.ts +4 -3
  50. package/build/types/listItem/index.d.ts.map +1 -1
  51. package/build/types/{item → listItem}/prompt/Prompt.d.ts +3 -3
  52. package/build/types/listItem/prompt/Prompt.d.ts.map +1 -0
  53. package/build/types/listItem/useItemControl.d.ts +5 -0
  54. package/build/types/listItem/useItemControl.d.ts.map +1 -0
  55. package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts +2 -2
  56. package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts.map +1 -1
  57. package/package.json +3 -3
  58. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  59. package/src/index.ts +3 -3
  60. package/src/legacylistItem/LegacyListItem.css +6 -0
  61. package/src/legacylistItem/LegacyListItem.less +7 -0
  62. package/src/legacylistItem/LegacyListItem.story.tsx +120 -0
  63. package/src/{listItem/ListItem.tests.story.tsx → legacylistItem/LegacyListItem.tests.story.tsx} +7 -7
  64. package/src/legacylistItem/LegacyListItem.tsx +53 -0
  65. package/src/legacylistItem/index.ts +4 -0
  66. package/src/listItem/ListItem.css +185 -3
  67. package/src/listItem/ListItem.less +180 -5
  68. package/src/listItem/ListItem.story.tsx +250 -97
  69. package/src/listItem/ListItem.tsx +167 -37
  70. package/src/{item/ItemAdditionalInfo.tsx → listItem/ListItemAdditionalInfo.tsx} +5 -5
  71. package/src/{item/ItemButton.spec.tsx → listItem/ListItemButton.spec.tsx} +4 -4
  72. package/src/{item/ItemButton.tsx → listItem/ListItemButton.tsx} +2 -2
  73. package/src/{item/ItemCheckbox.tsx → listItem/ListItemCheckbox.tsx} +5 -2
  74. package/src/{item/ItemIconButton.tsx → listItem/ListItemIconButton.tsx} +2 -2
  75. package/src/{item/ItemMedia.tsx → listItem/ListItemMedia.tsx} +9 -9
  76. package/src/{item/ItemNavigation.tsx → listItem/ListItemNavigation.tsx} +2 -2
  77. package/src/listItem/index.ts +9 -3
  78. package/src/{item → listItem}/prompt/Prompt.spec.tsx +12 -12
  79. package/src/{item → listItem}/prompt/Prompt.story.tsx +27 -27
  80. package/src/{item → listItem}/prompt/Prompt.tsx +4 -4
  81. package/src/listItem/useItemControl.tsx +12 -0
  82. package/src/main.css +60 -57
  83. package/src/main.less +2 -2
  84. package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +4 -4
  85. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +22 -0
  86. package/src/phoneNumberInput/PhoneNumberInput.tsx +1 -1
  87. package/src/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.ts +4 -3
  88. package/src/switch/Switch.css +3 -0
  89. package/src/switch/Switch.less +1 -0
  90. package/build/listItem/List.js.map +0 -1
  91. package/build/listItem/List.mjs.map +0 -1
  92. package/build/listItem/ListItem.js.map +0 -1
  93. package/build/listItem/ListItem.mjs.map +0 -1
  94. package/build/styles/item/Item.css +0 -188
  95. package/build/types/item/Item.d.ts +0 -43
  96. package/build/types/item/Item.d.ts.map +0 -1
  97. package/build/types/item/ItemAdditionalInfo.d.ts +0 -9
  98. package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
  99. package/build/types/item/ItemButton.d.ts +0 -4
  100. package/build/types/item/ItemButton.d.ts.map +0 -1
  101. package/build/types/item/ItemCheckbox.d.ts +0 -4
  102. package/build/types/item/ItemCheckbox.d.ts.map +0 -1
  103. package/build/types/item/ItemIconButton.d.ts +0 -7
  104. package/build/types/item/ItemIconButton.d.ts.map +0 -1
  105. package/build/types/item/ItemMedia.d.ts +0 -19
  106. package/build/types/item/ItemMedia.d.ts.map +0 -1
  107. package/build/types/item/ItemNavigation.d.ts +0 -4
  108. package/build/types/item/ItemNavigation.d.ts.map +0 -1
  109. package/build/types/item/ItemSwitch.d.ts.map +0 -1
  110. package/build/types/item/index.d.ts +0 -6
  111. package/build/types/item/index.d.ts.map +0 -1
  112. package/build/types/item/prompt/Prompt.d.ts.map +0 -1
  113. package/build/types/item/useItemControl.d.ts +0 -5
  114. package/build/types/item/useItemControl.d.ts.map +0 -1
  115. package/build/types/listItem/List.d.ts.map +0 -1
  116. package/src/item/Item.css +0 -188
  117. package/src/item/Item.less +0 -182
  118. package/src/item/Item.story.tsx +0 -273
  119. package/src/item/Item.tsx +0 -181
  120. package/src/item/index.ts +0 -6
  121. package/src/item/useItemControl.tsx +0 -12
  122. /package/build/{listItem → legacylistItem}/List.js +0 -0
  123. /package/build/{listItem → legacylistItem}/List.mjs +0 -0
  124. /package/build/types/{listItem → legacylistItem}/List.d.ts +0 -0
  125. /package/src/{listItem/ListItem.spec.tsx → legacylistItem/LegacyListItem.spec.tsx} +0 -0
  126. /package/src/{listItem → legacylistItem}/List.tsx +0 -0
  127. /package/src/{item/ItemSwitch.tsx → listItem/ListItemSwitch.tsx} +0 -0
@@ -1,13 +1,43 @@
1
- import { ElementType, FC, ReactNode } from 'react';
2
- export type ListItemProps = {
1
+ import { ReactNode } from 'react';
2
+ export type ListItemTypes = 'non-interactive' | 'navigation' | 'radio' | 'checkbox' | 'switch' | 'button' | 'icon-button';
3
+ export type Props = {
4
+ as?: 'li' | 'div' | 'span';
5
+ inverted?: boolean;
6
+ disabled?: boolean;
7
+ spotlight?: 'active' | 'inactive';
3
8
  title: ReactNode;
4
- value: ReactNode;
9
+ subtitle?: ReactNode;
10
+ additionalInfo?: ReactNode;
11
+ valueTitle?: ReactNode;
12
+ valueSubtitle?: ReactNode;
5
13
  media?: ReactNode;
6
- action?: ReactNode;
7
- className?: string;
8
- isContainerAligned?: boolean;
9
- as?: ElementType;
14
+ control?: ReactNode;
15
+ prompt?: ReactNode;
16
+ };
17
+ export type ListItemContextData = {
18
+ setControlType: (type: ListItemTypes) => void;
19
+ ids: {
20
+ label: string;
21
+ additionalInfo: string;
22
+ value: string;
23
+ control: string;
24
+ prompt: string;
25
+ };
26
+ props: Pick<Props, 'as' | 'disabled' | 'inverted'>;
27
+ };
28
+ export declare const ListItemContext: import("react").Context<ListItemContextData>;
29
+ export declare const ListItem: {
30
+ ({ as: View, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, }: Props): import("react").JSX.Element;
31
+ Image: ({ alt, size, ...props }: import("./ListItemMedia").ListItemImageProps) => import("react").JSX.Element;
32
+ AvatarView: ({ className, size, ...props }: import("./ListItemMedia").ListItemAvatarViewProps) => import("react").JSX.Element;
33
+ AvatarLayout: ({ className, size, ...props }: import("./ListItemMedia").ListItemAvatarLayoutProps) => import("react").JSX.Element;
34
+ AdditionalInfo: ({ children, action }: import("./ListItemAdditionalInfo").ListItemAdditionalInfoProps) => import("react").JSX.Element;
35
+ Checkbox: (props: import("./ListItemCheckbox").ListItemCheckboxProps) => import("react").JSX.Element;
36
+ IconButton: (props: import("./ListItemIconButton").ListItemIconButtonProps) => import("react").JSX.Element;
37
+ Navigation: ({ onClick }: import("./ListItemNavigation").ListItemNavigationProps) => import("react").JSX.Element;
38
+ Button: ({ priority, ...props }: import("./ListItemButton").ListItemButtonProps) => import("react").JSX.Element;
39
+ Switch: (props: import("..").SwitchProps) => import("react").JSX.Element;
40
+ Prompt: ({ type, children, action }: import("./prompt/Prompt").ListItemPromptProps) => import("react").JSX.Element;
10
41
  };
11
- declare const ListItem: FC<ListItemProps>;
12
42
  export default ListItem;
13
43
  //# sourceMappingURL=ListItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAInD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmC/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAA4B,MAAM,OAAO,CAAC;AAa3E,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,YAAY,GACZ,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;CACpD,CAAC;AAIF,eAAO,MAAM,eAAe,8CAA2C,CAAC;AAExE,eAAO,MAAM,QAAQ;uIAalB,KAAK;;;;;;;;;;;CAqGP,CAAC;AAeF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { LinkProps } from '../link';
3
+ export type ListItemAdditionalInfoProps = PropsWithChildren<{
4
+ action?: Pick<LinkProps, 'href' | 'onClick' | 'target'> & {
5
+ label?: string;
6
+ };
7
+ }>;
8
+ export declare const AdditionalInfo: ({ children, action }: ListItemAdditionalInfoProps) => import("react").JSX.Element;
9
+ //# sourceMappingURL=ListItemAdditionalInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemAdditionalInfo.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemAdditionalInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAGtD,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9E,CAAC,CAAC;AAEH,eAAO,MAAM,cAAc,yBAAmC,2BAA2B,gCAoBxF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { NewButtonProps } from '../button';
2
+ export type ListItemButtonProps = Omit<NewButtonProps, 'v2' | 'size' | 'disabled'>;
3
+ export declare const Button: ({ priority, ...props }: ListItemButtonProps) => import("react").JSX.Element;
4
+ //# sourceMappingURL=ListItemButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,cAAc,EAAE,MAAM,WAAW,CAAC;AAGlE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC,CAAC;AAEnF,eAAO,MAAM,MAAM,2BAA0C,mBAAmB,gCAY/E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { CheckboxButtonProps } from '../checkboxButton/CheckboxButton';
2
+ export type ListItemCheckboxProps = Pick<CheckboxButtonProps, 'checked' | 'indeterminate' | 'onChange'>;
3
+ export declare const Checkbox: (props: ListItemCheckboxProps) => import("react").JSX.Element;
4
+ //# sourceMappingURL=ListItemCheckbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemCheckbox.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemCheckbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,mBAAmB,EACnB,SAAS,GAAG,eAAe,GAAG,UAAU,CACzC,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAoB,qBAAqB,gCAI7D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IconButtonProps } from '../iconButton';
2
+ import { ReactNode } from 'react';
3
+ export type ListItemIconButtonProps = Pick<IconButtonProps, 'onClick' | 'href' | 'target'> & {
4
+ children: ReactNode;
5
+ };
6
+ export declare const IconButton: (props: ListItemIconButtonProps) => import("react").JSX.Element;
7
+ //# sourceMappingURL=ListItemIconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemIconButton.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;IAC3F,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,UAAoB,uBAAuB,gCAIjE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { AvatarViewProps } from '../avatarView';
2
+ import { AvatarLayoutProps } from '../avatarLayout';
3
+ import { ImageProps } from '../image/Image';
4
+ type SizeProp = {
5
+ size?: 32 | 40 | 48 | 56 | 72;
6
+ };
7
+ export type ListItemAvatarViewProps = Omit<AvatarViewProps, 'size' | 'interactive'> & SizeProp;
8
+ export declare const AvatarView: ({ className, size, ...props }: ListItemAvatarViewProps) => import("react").JSX.Element;
9
+ export type ListItemAvatarLayoutProps = Omit<AvatarLayoutProps, 'size' | 'interactive'> & SizeProp;
10
+ export declare const AvatarLayout: ({ className, size, ...props }: ListItemAvatarLayoutProps) => import("react").JSX.Element;
11
+ export type ListItemImageProps = Omit<ImageProps, 'stretch' | 'shrink' | 'id' | 'alt'> & SizeProp & {
12
+ alt?: string;
13
+ };
14
+ /**
15
+ * TODO: mention that image is for rare cases not for DS illustrations, they discouraged
16
+ */
17
+ export declare const Image: ({ alt, size, ...props }: ListItemImageProps) => import("react").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=ListItemMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemMedia.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAA+B,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAwB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGlE,KAAK,QAAQ,GAAG;IAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,QAAQ,CAAC;AAE/F,eAAO,MAAM,UAAU,kCAAwC,uBAAuB,gCAQrF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,QAAQ,CAAC;AAEnG,eAAO,MAAM,YAAY,kCAAwC,yBAAyB,gCAQzF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC,GACpF,QAAQ,GAAG;IACT,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,KAAK,4BAAuC,kBAAkB,gCAY1E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ButtonProps } from '../button/Button.types';
2
+ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href'>;
3
+ export declare const Navigation: ({ onClick }: ListItemNavigationProps) => import("react").JSX.Element;
4
+ //# sourceMappingURL=ListItemNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,UAAU,gBAAoC,uBAAuB,gCAIjF,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { SwitchProps } from '../switch';
2
2
  export declare const Switch: (props: SwitchProps) => import("react").JSX.Element;
3
- //# sourceMappingURL=ItemSwitch.d.ts.map
3
+ //# sourceMappingURL=ListItemSwitch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSwitch.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/D,eAAO,MAAM,MAAM,UAAoB,WAAW,gCAIjD,CAAC"}
@@ -1,5 +1,6 @@
1
- export { List } from './List';
2
- export type { ListProps } from './List';
1
+ export type { Props as ListItemProps } from './ListItem';
2
+ export type { ListItemAdditionalInfoProps } from './ListItemAdditionalInfo';
3
+ export type { ListItemCheckboxProps } from './ListItemCheckbox';
4
+ export type { ListItemImageProps, ListItemAvatarViewProps, ListItemAvatarLayoutProps, } from './ListItemMedia';
3
5
  export { default } from './ListItem';
4
- export type { ListItemProps } from './ListItem';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { Sentiment } from '../../common';
2
2
  import { LinkProps } from '../../link';
3
- export type ItemPromptProps = {
3
+ export type ListItemPromptProps = {
4
4
  type: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}` | 'discount' | 'savings';
5
5
  children: React.ReactNode;
6
6
  action?: Pick<LinkProps, 'href' | 'target' | 'onClick'> & {
7
7
  'aria-label'?: string;
8
8
  };
9
9
  };
10
- export declare const ItemPrompt: ({ type, children, action }: ItemPromptProps) => import("react").JSX.Element;
11
- export default ItemPrompt;
10
+ export declare const Prompt: ({ type, children, action }: ListItemPromptProps) => import("react").JSX.Element;
11
+ export default Prompt;
12
12
  //# sourceMappingURL=Prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EACA,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,GACpF,UAAU,GACV,SAAS,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrF,CAAC;AAEF,eAAO,MAAM,MAAM,+BAAgC,mBAAmB,gCAyBrE,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ListItemTypes } from './ListItem';
2
+ export declare function useItemControl(controlType: ListItemTypes): {
3
+ baseItemProps: Pick<import("./ListItem").Props, "as" | "disabled" | "inverted">;
4
+ };
5
+ //# sourceMappingURL=useItemControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useItemControl.d.ts","sourceRoot":"","sources":["../../../src/listItem/useItemControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwC,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjF,wBAAgB,cAAc,CAAC,WAAW,EAAE,aAAa;;EAQxD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  *
3
3
  * @param phoneNumber
4
- * @returns True if number that starts with "+" and contains a mix of digits and spaces with at least 4 digits.
4
+ * @returns True if number that starts with "+" and contains a mix of digits and spaces with a configurable min length that defaults to 4.
5
5
  */
6
- export declare const isValidPhoneNumber: (phoneNumber: string) => boolean;
6
+ export declare const isValidPhoneNumber: (phoneNumber: string, minLength?: number) => boolean;
7
7
  //# sourceMappingURL=isValidPhoneNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../src/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,YACsC,CAAC"}
1
+ {"version":3,"file":"isValidPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../src/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,gCAEU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-4533565",
3
+ "version": "0.0.0-experimental-da1781d",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -95,13 +95,13 @@
95
95
  "rollup-preserve-directives": "^1.1.1",
96
96
  "storybook": "^8.2.2",
97
97
  "@transferwise/less-config": "3.1.1",
98
- "@transferwise/neptune-css": "0.0.0-experimental-4533565",
98
+ "@transferwise/neptune-css": "14.24.4",
99
99
  "@wise/components-theming": "1.6.2",
100
100
  "@wise/wds-configs": "0.0.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@transferwise/icons": "^3.21.0",
104
- "@transferwise/neptune-css": "0.0.0-experimental-4533565",
104
+ "@transferwise/neptune-css": "^14.24",
105
105
  "@wise/art": "^2.16",
106
106
  "@wise/components-theming": "^1.0.0",
107
107
  "react": ">=18",
@@ -6,7 +6,7 @@ import BottomSheet from '../../common/bottomSheet';
6
6
  import Option from '../../common/Option';
7
7
  import { Check, ChevronDown } from '@transferwise/icons';
8
8
  import { OverlayIdContext, OverlayIdProvider } from '../../provider/overlay/OverlayIdProvider';
9
- import { List } from '../../listItem';
9
+ import { List } from '../../legacylistItem';
10
10
 
11
11
  export interface AnimatedLabelProps {
12
12
  activeLabel: number;
package/src/index.ts CHANGED
@@ -51,7 +51,7 @@ export type {
51
51
  export type { TextAreaProps } from './inputs/TextArea';
52
52
  export type { InstructionsListProps } from './instructionsList';
53
53
  export type { LabelProps, LabelOptionalProps, LabelDescriptionProps } from './label/Label';
54
- export type { ListProps, ListItemProps } from './listItem';
54
+ export type { ListProps, LegacyListItemProps } from './legacylistItem';
55
55
  export type { LoaderProps } from './loader';
56
56
  export type { MarkdownProps } from './markdown';
57
57
  export type { ModalProps } from './modal';
@@ -109,7 +109,7 @@ export type {
109
109
  TableCellStatus,
110
110
  TableCellType,
111
111
  } from './table';
112
- export type { ItemProps, ItemAdditionalInfoProps, ItemCheckboxProps } from './item';
112
+ export type { ListItemProps, ListItemAdditionalInfoProps, ListItemCheckboxProps } from './listItem';
113
113
 
114
114
  /**
115
115
  * Components
@@ -168,7 +168,7 @@ export { TextArea } from './inputs/TextArea';
168
168
  export { default as InstructionsList } from './instructionsList';
169
169
  export { Label } from './label/Label';
170
170
  export { default as Link } from './link';
171
- export { List, default as ListItem } from './listItem';
171
+ export { List, default as LegacyListItem } from './legacylistItem';
172
172
  export { default as Loader } from './loader';
173
173
  export { default as Logo } from './logo';
174
174
  export { default as Markdown } from './markdown';
@@ -0,0 +1,6 @@
1
+ .np-list-item {
2
+ width: 100%;
3
+ }
4
+ .np-list-item__action {
5
+ flex-shrink: 0;
6
+ }
@@ -0,0 +1,7 @@
1
+ .np-list-item {
2
+ width: 100%;
3
+
4
+ &__action {
5
+ flex-shrink: 0;
6
+ }
7
+ }
@@ -0,0 +1,120 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { Documents, FastFlag } from '@transferwise/icons';
3
+ import { ComponentProps } from 'react';
4
+
5
+ import { Button, IconButton } from '..';
6
+ import AvatarView from '../avatarView';
7
+ import Info from '../info';
8
+ import Title from '../title/Title';
9
+ import LegacyListItem, { List } from '.';
10
+
11
+ export default {
12
+ component: LegacyListItem,
13
+ title: 'Other/LegacyListItem',
14
+ tags: ['autodocs'],
15
+ };
16
+
17
+ const Template = ({
18
+ title = 'Wise',
19
+ value = 'We’re building the world’s most international account',
20
+ ...props
21
+ }: Partial<ComponentProps<typeof LegacyListItem>>) => {
22
+ return <LegacyListItem title={title} value={value} {...props} />;
23
+ };
24
+
25
+ export const Basic = () => {
26
+ return (
27
+ <List>
28
+ <Template />
29
+ </List>
30
+ );
31
+ };
32
+
33
+ export const Variants = () => {
34
+ return (
35
+ <div>
36
+ <div className="m-t-4 m-b-2">
37
+ <Title type="title-body">With Icon Avatar</Title>
38
+ <List>
39
+ <Template media={<AvatarView imgSrc="../tapestry-01.png" />} />
40
+ </List>
41
+ </div>
42
+ <div className="m-t-4 m-b-2">
43
+ <Title type="title-body">With Contact Avatar</Title>
44
+ <List>
45
+ <Template
46
+ title="Sandra Pepper"
47
+ value="Personal account"
48
+ media={<AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />}
49
+ />
50
+ </List>
51
+ </div>
52
+ <div className="m-t-4 m-b-2">
53
+ <Title type="title-body">With Avatar and Action</Title>
54
+ <List>
55
+ <Template
56
+ title="Account holder"
57
+ value="Sandra Pepper"
58
+ media={<AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />}
59
+ action={
60
+ <Button v2 size="sm">
61
+ Share details
62
+ </Button>
63
+ }
64
+ />
65
+ </List>
66
+ </div>
67
+ <div className="m-t-4 m-b-2">
68
+ <Title type="title-body">Text Only List</Title>
69
+ <List>
70
+ <Template title="Sort code" value="23-14-71" />
71
+ <Template title="Account number" value="12345678" />
72
+ </List>
73
+ </div>
74
+ <div className="m-t-4 m-b-2">
75
+ <Title type="title-body">Text With Action Button</Title>
76
+ <List>
77
+ <Template
78
+ title="SWIFT/BIC"
79
+ value="••• •••"
80
+ action={
81
+ <Button v2 size="sm" onClick={() => action('clicked')}>
82
+ Reveal
83
+ </Button>
84
+ }
85
+ />
86
+ </List>
87
+ </div>
88
+ <div className="m-t-4 m-b-2">
89
+ <Title type="title-body">Text With Other Action</Title>
90
+ <List>
91
+ <Template
92
+ title="Account number"
93
+ value="123456789"
94
+ action={
95
+ <IconButton size={24} aria-label="Copy" priority="minimal">
96
+ <Documents />
97
+ </IconButton>
98
+ }
99
+ />
100
+ </List>
101
+ </div>
102
+ <div className="m-t-4 m-b-2">
103
+ <Title type="title-body">Text With Info Action</Title>
104
+ <List>
105
+ <Template
106
+ title="Routing number"
107
+ value="987654"
108
+ action={
109
+ <Info
110
+ size="lg"
111
+ aria-label="More information"
112
+ content="Use this routing number to receive ACH and Wire transfers."
113
+ />
114
+ }
115
+ />
116
+ </List>
117
+ </div>
118
+ </div>
119
+ );
120
+ };
@@ -1,15 +1,15 @@
1
1
  import { FastFlag } from '@transferwise/icons';
2
2
  import Button from '../button';
3
3
  import AvatarView from '../avatarView';
4
- import ListItem, { List, type ListItemProps } from '.';
4
+ import LegacyListItem, { List, type LegacyListItemProps } from '.';
5
5
 
6
6
  export default {
7
- component: ListItem,
8
- title: 'Other/ListItem/tests',
7
+ component: LegacyListItem,
8
+ title: 'Other/LegacyListItem/tests',
9
9
  };
10
10
 
11
11
  export const LongText = () => {
12
- const sharedProps: Partial<ListItemProps> = {
12
+ const sharedProps: Partial<LegacyListItemProps> = {
13
13
  media: <AvatarView profileName="Super Pepa" badge={{ icon: <FastFlag /> }} />,
14
14
  action: (
15
15
  <Button v2 size="sm" onClick={() => {}}>
@@ -21,13 +21,13 @@ export const LongText = () => {
21
21
  return (
22
22
  <div style={{ width: '35rem' }}>
23
23
  <List>
24
- <ListItem
24
+ <LegacyListItem
25
25
  {...sharedProps}
26
26
  title="Default behaviour"
27
27
  value="This is a test of a long word dontbreakme dontbreakme dontbreakme breakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakmebreakme word."
28
28
  />
29
29
 
30
- <ListItem
30
+ <LegacyListItem
31
31
  {...sharedProps}
32
32
  title="Wrapping the long word with a 'span.text-word-break'"
33
33
  value={
@@ -41,7 +41,7 @@ export const LongText = () => {
41
41
  }
42
42
  />
43
43
 
44
- <ListItem
44
+ <LegacyListItem
45
45
  {...sharedProps}
46
46
  title="Using '&amp;shy;' HTML entitty"
47
47
  value="This is a test of a a very long word dontbreakme dontbreakme dontbreakme break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me&shy;break&shy;me word."
@@ -0,0 +1,53 @@
1
+ import { clsx } from 'clsx';
2
+ import { ElementType, FC, ReactNode } from 'react';
3
+
4
+ import Body from '../body/Body';
5
+
6
+ export type LegacyListItemProps = {
7
+ title: ReactNode;
8
+ value: ReactNode;
9
+ media?: ReactNode;
10
+ action?: ReactNode;
11
+ className?: string;
12
+ isContainerAligned?: boolean;
13
+ as?: ElementType;
14
+ };
15
+
16
+ const LegacyListItem: FC<LegacyListItemProps> = ({
17
+ media,
18
+ action,
19
+ className,
20
+ title,
21
+ value,
22
+ isContainerAligned,
23
+ as = 'li',
24
+ ...rest
25
+ }) => {
26
+ const Element = as;
27
+
28
+ return (
29
+ <Element
30
+ className={clsx('np-list-item d-flex align-items-center p-y-2', className, {
31
+ 'p-x-2': !isContainerAligned,
32
+ })}
33
+ {...rest}
34
+ >
35
+ {media}
36
+
37
+ <div className={clsx('d-flex flex-column', { 'p-l-2': !!media, 'p-r-2': !!action })}>
38
+ <Body type="body-default" className="text-secondary m-b-0">
39
+ {title}
40
+ </Body>
41
+ {value && (
42
+ <Body type="body-large" className="text-primary text-overflow-wrap m-b-0">
43
+ {value}
44
+ </Body>
45
+ )}
46
+ </div>
47
+
48
+ {action ? <div className="np-list-item__action m-l-auto">{action}</div> : null}
49
+ </Element>
50
+ );
51
+ };
52
+
53
+ export default LegacyListItem;
@@ -0,0 +1,4 @@
1
+ export { List } from './List';
2
+ export type { ListProps } from './List';
3
+ export { default } from './LegacyListItem';
4
+ export type { LegacyListItemProps } from './LegacyListItem';