@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.
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/index.js +3 -3
- package/build/index.mjs +2 -2
- package/build/{listItem/ListItem.js → legacylistItem/LegacyListItem.js} +3 -3
- package/build/legacylistItem/LegacyListItem.js.map +1 -0
- package/build/{listItem/ListItem.mjs → legacylistItem/LegacyListItem.mjs} +3 -3
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -0
- package/build/legacylistItem/List.js.map +1 -0
- package/build/legacylistItem/List.mjs.map +1 -0
- package/build/main.css +60 -57
- package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs +2 -2
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
- package/build/styles/legacylistItem/LegacyListItem.css +6 -0
- package/build/styles/listItem/ListItem.css +185 -3
- package/build/styles/main.css +60 -57
- package/build/styles/switch/Switch.css +3 -0
- package/build/types/index.d.ts +3 -3
- package/build/types/index.d.ts.map +1 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts +13 -0
- package/build/types/legacylistItem/LegacyListItem.d.ts.map +1 -0
- package/build/types/legacylistItem/List.d.ts.map +1 -0
- package/build/types/legacylistItem/index.d.ts +5 -0
- package/build/types/legacylistItem/index.d.ts.map +1 -0
- package/build/types/listItem/ListItem.d.ts +38 -8
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/listItem/ListItemAdditionalInfo.d.ts +9 -0
- package/build/types/listItem/ListItemAdditionalInfo.d.ts.map +1 -0
- package/build/types/listItem/ListItemButton.d.ts +4 -0
- package/build/types/listItem/ListItemButton.d.ts.map +1 -0
- package/build/types/listItem/ListItemCheckbox.d.ts +4 -0
- package/build/types/listItem/ListItemCheckbox.d.ts.map +1 -0
- package/build/types/listItem/ListItemIconButton.d.ts +7 -0
- package/build/types/listItem/ListItemIconButton.d.ts.map +1 -0
- package/build/types/listItem/ListItemMedia.d.ts +19 -0
- package/build/types/listItem/ListItemMedia.d.ts.map +1 -0
- package/build/types/listItem/ListItemNavigation.d.ts +4 -0
- package/build/types/listItem/ListItemNavigation.d.ts.map +1 -0
- package/build/types/{item/ItemSwitch.d.ts → listItem/ListItemSwitch.d.ts} +1 -1
- package/build/types/listItem/ListItemSwitch.d.ts.map +1 -0
- package/build/types/listItem/index.d.ts +4 -3
- package/build/types/listItem/index.d.ts.map +1 -1
- package/build/types/{item → listItem}/prompt/Prompt.d.ts +3 -3
- package/build/types/listItem/prompt/Prompt.d.ts.map +1 -0
- package/build/types/listItem/useItemControl.d.ts +5 -0
- package/build/types/listItem/useItemControl.d.ts.map +1 -0
- package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts +2 -2
- package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
- package/src/index.ts +3 -3
- package/src/legacylistItem/LegacyListItem.css +6 -0
- package/src/legacylistItem/LegacyListItem.less +7 -0
- package/src/legacylistItem/LegacyListItem.story.tsx +120 -0
- package/src/{listItem/ListItem.tests.story.tsx → legacylistItem/LegacyListItem.tests.story.tsx} +7 -7
- package/src/legacylistItem/LegacyListItem.tsx +53 -0
- package/src/legacylistItem/index.ts +4 -0
- package/src/listItem/ListItem.css +185 -3
- package/src/listItem/ListItem.less +180 -5
- package/src/listItem/ListItem.story.tsx +250 -97
- package/src/listItem/ListItem.tsx +167 -37
- package/src/{item/ItemAdditionalInfo.tsx → listItem/ListItemAdditionalInfo.tsx} +5 -5
- package/src/{item/ItemButton.spec.tsx → listItem/ListItemButton.spec.tsx} +4 -4
- package/src/{item/ItemButton.tsx → listItem/ListItemButton.tsx} +2 -2
- package/src/{item/ItemCheckbox.tsx → listItem/ListItemCheckbox.tsx} +5 -2
- package/src/{item/ItemIconButton.tsx → listItem/ListItemIconButton.tsx} +2 -2
- package/src/{item/ItemMedia.tsx → listItem/ListItemMedia.tsx} +9 -9
- package/src/{item/ItemNavigation.tsx → listItem/ListItemNavigation.tsx} +2 -2
- package/src/listItem/index.ts +9 -3
- package/src/{item → listItem}/prompt/Prompt.spec.tsx +12 -12
- package/src/{item → listItem}/prompt/Prompt.story.tsx +27 -27
- package/src/{item → listItem}/prompt/Prompt.tsx +4 -4
- package/src/listItem/useItemControl.tsx +12 -0
- package/src/main.css +60 -57
- package/src/main.less +2 -2
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +4 -4
- package/src/phoneNumberInput/PhoneNumberInput.story.tsx +22 -0
- package/src/phoneNumberInput/PhoneNumberInput.tsx +1 -1
- package/src/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.ts +4 -3
- package/src/switch/Switch.css +3 -0
- package/src/switch/Switch.less +1 -0
- package/build/listItem/List.js.map +0 -1
- package/build/listItem/List.mjs.map +0 -1
- package/build/listItem/ListItem.js.map +0 -1
- package/build/listItem/ListItem.mjs.map +0 -1
- package/build/styles/item/Item.css +0 -188
- package/build/types/item/Item.d.ts +0 -43
- package/build/types/item/Item.d.ts.map +0 -1
- package/build/types/item/ItemAdditionalInfo.d.ts +0 -9
- package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
- package/build/types/item/ItemButton.d.ts +0 -4
- package/build/types/item/ItemButton.d.ts.map +0 -1
- package/build/types/item/ItemCheckbox.d.ts +0 -4
- package/build/types/item/ItemCheckbox.d.ts.map +0 -1
- package/build/types/item/ItemIconButton.d.ts +0 -7
- package/build/types/item/ItemIconButton.d.ts.map +0 -1
- package/build/types/item/ItemMedia.d.ts +0 -19
- package/build/types/item/ItemMedia.d.ts.map +0 -1
- package/build/types/item/ItemNavigation.d.ts +0 -4
- package/build/types/item/ItemNavigation.d.ts.map +0 -1
- package/build/types/item/ItemSwitch.d.ts.map +0 -1
- package/build/types/item/index.d.ts +0 -6
- package/build/types/item/index.d.ts.map +0 -1
- package/build/types/item/prompt/Prompt.d.ts.map +0 -1
- package/build/types/item/useItemControl.d.ts +0 -5
- package/build/types/item/useItemControl.d.ts.map +0 -1
- package/build/types/listItem/List.d.ts.map +0 -1
- package/src/item/Item.css +0 -188
- package/src/item/Item.less +0 -182
- package/src/item/Item.story.tsx +0 -273
- package/src/item/Item.tsx +0 -181
- package/src/item/index.ts +0 -6
- package/src/item/useItemControl.tsx +0 -12
- /package/build/{listItem → legacylistItem}/List.js +0 -0
- /package/build/{listItem → legacylistItem}/List.mjs +0 -0
- /package/build/types/{listItem → legacylistItem}/List.d.ts +0 -0
- /package/src/{listItem/ListItem.spec.tsx → legacylistItem/LegacyListItem.spec.tsx} +0 -0
- /package/src/{listItem → legacylistItem}/List.tsx +0 -0
- /package/src/{item/ItemSwitch.tsx → listItem/ListItemSwitch.tsx} +0 -0
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
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
|
-
|
|
9
|
+
subtitle?: ReactNode;
|
|
10
|
+
additionalInfo?: ReactNode;
|
|
11
|
+
valueTitle?: ReactNode;
|
|
12
|
+
valueSubtitle?: ReactNode;
|
|
5
13
|
media?: ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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":"
|
|
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"}
|
|
@@ -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 {
|
|
2
|
-
export type {
|
|
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,
|
|
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
|
|
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
|
|
11
|
-
export default
|
|
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 @@
|
|
|
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
|
|
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,
|
|
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-
|
|
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": "
|
|
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": "
|
|
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 '../../
|
|
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,
|
|
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 {
|
|
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
|
|
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,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
|
+
};
|
package/src/{listItem/ListItem.tests.story.tsx → legacylistItem/LegacyListItem.tests.story.tsx}
RENAMED
|
@@ -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
|
|
4
|
+
import LegacyListItem, { List, type LegacyListItemProps } from '.';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
component:
|
|
8
|
-
title: 'Other/
|
|
7
|
+
component: LegacyListItem,
|
|
8
|
+
title: 'Other/LegacyListItem/tests',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const LongText = () => {
|
|
12
|
-
const sharedProps: Partial<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
44
|
+
<LegacyListItem
|
|
45
45
|
{...sharedProps}
|
|
46
46
|
title="Using '&shy;' HTML entitty"
|
|
47
47
|
value="This is a test of a a very long word dontbreakme dontbreakme dontbreakme break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­me­break­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;
|