@transferwise/components 0.0.0-experimental-5f7dae1 → 0.0.0-experimental-20085a3
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/types/Body/Body.d.ts +2 -2
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/Title/Title.d.ts +2 -2
- package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
- package/package.json +1 -1
- package/src/Accordion/_stories/Accordion.rtl.test.story.tsx +71 -0
- package/src/AvatarLayout/_stories/AvatarLayout.rtl.test.story.tsx +77 -0
- package/src/AvatarView/_stories/AvatarView.rtl.test.story.tsx +162 -0
- package/src/Button/LegacyButton/_stories/LegacyButton.rtl.test.story.tsx +32 -0
- package/src/Calendar/_stories/Calendar.rtl.test.story.tsx +52 -0
- package/src/Calendar/_stories/Calendar.test.story.tsx +28 -24
- package/src/Carousel/_stories/Carousel.rtl.test.story.tsx +61 -0
- package/src/Checkbox/_stories/Checkbox.rtl.test.story.tsx +31 -0
- package/src/CheckboxButton/_stories/CheckboxButton.rtl.test.story.tsx +27 -0
- package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +0 -37
- package/src/Chevron/_stories/Chevron.rtl.test.story.tsx +26 -0
- package/src/Chips/_stories/Chips.rtl.test.story.tsx +49 -0
- package/src/Chips/_stories/Chips.test.story.tsx +0 -34
- package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
- package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +25 -0
- package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
- package/src/Decision/_stories/Decision.rtl.test.story.tsx +79 -0
- package/src/DefinitionList/_stories/DefinitionList.rtl.test.story.tsx +63 -0
- package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
- package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
- package/src/Field/_stories/Field.rtl.test.story.tsx +58 -0
- package/src/FlowNavigation/_stories/FlowNavigation.rtl.test.story.tsx +70 -0
- package/src/Header/_stories/Header.rtl.test.story.tsx +37 -0
- package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
- package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
- package/src/Inputs/_stories/InputGroup.rtl.test.story.tsx +69 -0
- package/src/Inputs/_stories/SearchInput.rtl.test.story.tsx +32 -0
- package/src/Inputs/_stories/TextArea.rtl.test.story.tsx +38 -0
- package/src/InstructionsList/_stories/InstructionsList.rtl.test.story.tsx +30 -0
- package/src/Label/_stories/Label.rtl.test.story.tsx +36 -0
- package/src/Link/_stories/Link.rtl.test.story.tsx +26 -0
- package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
- package/src/ListItem/_stories/variants/helpers.tsx +2 -6
- package/src/Logo/_stories/Logo.rtl.test.story.tsx +56 -0
- package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
- package/src/Nudge/_stories/Nudge.rtl.test.story.tsx +37 -0
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +44 -0
- package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
- package/src/Progress/_stories/Progress.rtl.test.story.tsx +27 -0
- package/src/ProgressBar/_stories/ProgressBar.rtl.test.story.tsx +33 -0
- package/src/PromoCard/_stories/PromoCard.rtl.test.story.tsx +42 -0
- package/src/PromoCard/_stories/PromoCardGroup.rtl.test.story.tsx +51 -0
- package/src/Prompt/ActionPrompt/_stories/ActionPrompt.rtl.test.story.tsx +53 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.rtl.test.story.tsx +46 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +0 -30
- package/src/Prompt/InfoPrompt/_stories/InfoPrompt.rtl.test.story.tsx +36 -0
- package/src/Prompt/InlinePrompt/_stories/InlinePrompt.rtl.test.story.tsx +38 -0
- package/src/Radio/_stories/Radio.rtl.test.story.tsx +61 -0
- package/src/RadioGroup/_stories/RadioGroup.rtl.test.story.tsx +66 -0
- package/src/Section/_stories/Section.rtl.test.story.tsx +29 -0
- package/src/SegmentedControl/_stories/SegmentedControl.rtl.test.story.tsx +45 -0
- package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
- package/src/Stepper/_stories/Stepper.rtl.test.story.tsx +24 -0
- package/src/Switch/_stories/Switch.rtl.test.story.tsx +32 -0
- package/src/Switch/_stories/Switch.test.story.tsx +0 -26
- package/src/Table/_stories/Table.rtl.test.story.tsx +104 -0
- package/src/Tabs/_stories/Tabs.rtl.test.story.tsx +72 -0
- package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.rtl.test.story.tsx +48 -0
- package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
- package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
- package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
- package/src/UploadInput/_stories/UploadInput.rtl.test.story.tsx +59 -0
- package/src/_deprecated/Alert/_stories/Alert.rtl.test.story.tsx +37 -0
- package/src/_deprecated/Card/_stories/Card.rtl.test.story.tsx +38 -0
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.rtl.test.story.tsx +28 -0
- package/src/_deprecated/InlineAlert/_stories/InlineAlert.rtl.test.story.tsx +26 -0
- package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.rtl.test.story.tsx +42 -0
- package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
- package/src/common/BottomSheet/_stories/BottomSheet.rtl.test.story.tsx +39 -0
|
@@ -11,7 +11,7 @@ export type BodyProps = HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> &
|
|
|
11
11
|
*/
|
|
12
12
|
preserveNewlines?: boolean;
|
|
13
13
|
};
|
|
14
|
-
declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<
|
|
14
|
+
declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> & {
|
|
15
15
|
/** @default 'body-default' */
|
|
16
16
|
type?: BodyTypes;
|
|
17
17
|
/** @default 'div' */
|
|
@@ -21,6 +21,6 @@ declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTM
|
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
preserveNewlines?: boolean;
|
|
24
|
-
} & import("react").RefAttributes<HTMLDivElement |
|
|
24
|
+
} & import("react").RefAttributes<HTMLDivElement | HTMLSpanElement | HTMLParagraphElement | null>>;
|
|
25
25
|
export default Body;
|
|
26
26
|
//# sourceMappingURL=Body.d.ts.map
|
|
@@ -16,6 +16,6 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
/** @default 'default' */
|
|
17
17
|
type?: "default" | "negative";
|
|
18
18
|
'data-testid'?: string;
|
|
19
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "
|
|
19
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "children" | "className" | "id" | "tabIndex" | "role" | "aria-label"> & import("react").RefAttributes<unknown>>;
|
|
20
20
|
export default IconButton;
|
|
21
21
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/ListItem/_stories/variants/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAML,uBAAuB,IAAI,WAAW,EACvC,MAAM,kBAAkB,CAAC;AAG1B,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAOhG,KAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/ListItem/_stories/variants/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAML,uBAAuB,IAAI,WAAW,EACvC,MAAM,kBAAkB,CAAC;AAG1B,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAOhG,KAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,YA6H1B,CAAC"}
|
|
@@ -55,7 +55,6 @@ declare const _default: import("react").FC<{
|
|
|
55
55
|
selectProps?: Partial<SelectInputProps<CurrencyOptionItem>> | undefined;
|
|
56
56
|
amount: number | null;
|
|
57
57
|
searchPlaceholder?: string | undefined;
|
|
58
|
-
decimals?: number | undefined;
|
|
59
58
|
currencies: readonly CurrencyItem[];
|
|
60
59
|
selectedCurrency: CurrencyOptionItem;
|
|
61
60
|
onCurrencyChange?: ((value: CurrencyOptionItem) => void) | undefined;
|
|
@@ -67,6 +66,7 @@ declare const _default: import("react").FC<{
|
|
|
67
66
|
}) => void) | undefined;
|
|
68
67
|
customActionLabel?: import("react").ReactNode;
|
|
69
68
|
onCustomAction?: (() => void) | undefined;
|
|
69
|
+
decimals?: number | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
export default _default;
|
|
72
72
|
//# sourceMappingURL=MoneyInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/MoneyInput/MoneyInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAGL,SAAS,EACT,UAAU,EACV,SAAS,EAEV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAuB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAKL,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAO/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAoDnE,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,E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?: TitleTypes;
|
|
12
12
|
};
|
|
13
|
-
declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<
|
|
13
|
+
declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement> & React.LiHTMLAttributes<HTMLLIElement> & {
|
|
14
14
|
/**
|
|
15
15
|
* Default value will based one `type` prop
|
|
16
16
|
*/
|
|
@@ -19,6 +19,6 @@ declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<H
|
|
|
19
19
|
* Default value: {@link DEFAULT_TYPE}
|
|
20
20
|
*/
|
|
21
21
|
type?: TitleTypes;
|
|
22
|
-
} & React.RefAttributes<HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement
|
|
22
|
+
} & React.RefAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement>>;
|
|
23
23
|
export default Title;
|
|
24
24
|
//# sourceMappingURL=Title.d.ts.map
|
|
@@ -15,7 +15,7 @@ export default class UploadImageStep extends PureComponent<UploadImageStepProps>
|
|
|
15
15
|
uploadInputRef: import("react").RefObject<HTMLInputElement>;
|
|
16
16
|
onManualUpload: () => void;
|
|
17
17
|
onKeyDown: (event: React.KeyboardEvent<HTMLLabelElement>) => void;
|
|
18
|
-
getImage: () => number | true |
|
|
18
|
+
getImage: () => number | true | import("react").JSX.Element | Iterable<import("react").ReactNode>;
|
|
19
19
|
render(): import("react").JSX.Element;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=UploadImageStep.d.ts.map
|
|
@@ -5,5 +5,5 @@ export declare const UploadItemLink: import("react").ForwardRefExoticComponent<{
|
|
|
5
5
|
singleFileUpload: boolean;
|
|
6
6
|
} & {
|
|
7
7
|
children?: import("react").ReactNode | undefined;
|
|
8
|
-
} & import("react").RefAttributes<
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement | HTMLAnchorElement>>;
|
|
9
9
|
//# sourceMappingURL=UploadItemLink.d.ts.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
import { FastFlag as FastFlagIcon } from '@transferwise/icons';
|
|
4
|
+
|
|
5
|
+
import { forEachColumn, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
+
import Accordion from '../Accordion';
|
|
7
|
+
|
|
8
|
+
const items = [
|
|
9
|
+
{
|
|
10
|
+
title: 'Item with icon',
|
|
11
|
+
subtitle: 'Subtitle text',
|
|
12
|
+
content: 'Content for item with icon.',
|
|
13
|
+
id: 'icon',
|
|
14
|
+
icon: <FastFlagIcon size={24} />,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: 'Plain item without icon',
|
|
18
|
+
content: 'Content for item without icon.',
|
|
19
|
+
id: 'no-icon',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Media with circle',
|
|
23
|
+
subtitle: 'Shows media in a circle',
|
|
24
|
+
content: 'Expanded content with media circle.',
|
|
25
|
+
id: 'media-circle',
|
|
26
|
+
media: (
|
|
27
|
+
<img
|
|
28
|
+
src="https://wise.com/public-resources/assets/spend/card/asset//digital_card_2023.png"
|
|
29
|
+
alt=""
|
|
30
|
+
/>
|
|
31
|
+
),
|
|
32
|
+
showMediaCircle: true,
|
|
33
|
+
showMediaAtAllSizes: true,
|
|
34
|
+
isContainerAligned: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: 'Media without circle',
|
|
38
|
+
subtitle: 'Not container aligned',
|
|
39
|
+
content: 'Expanded content with plain media.',
|
|
40
|
+
id: 'media-no-circle',
|
|
41
|
+
media: (
|
|
42
|
+
<img
|
|
43
|
+
src="https://wise.com/public-resources/assets/spend/card/asset//digital_card_2023.png"
|
|
44
|
+
alt=""
|
|
45
|
+
/>
|
|
46
|
+
),
|
|
47
|
+
showMediaCircle: false,
|
|
48
|
+
showMediaAtAllSizes: false,
|
|
49
|
+
isContainerAligned: false,
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
component: Accordion,
|
|
55
|
+
title: 'Content/Accordion/Tests',
|
|
56
|
+
tags: ['!autodocs', '!manifest'],
|
|
57
|
+
} satisfies Meta<typeof Accordion>;
|
|
58
|
+
|
|
59
|
+
type Story = StoryObj<typeof Accordion>;
|
|
60
|
+
|
|
61
|
+
export const RTLDiff: Story = {
|
|
62
|
+
render: () => <Accordion items={items} indexOpen={0} />,
|
|
63
|
+
play: async ({ canvasElement }) => {
|
|
64
|
+
await forEachColumn(canvasElement, async (column) => {
|
|
65
|
+
const scope = within(column);
|
|
66
|
+
const buttons = scope.getAllByRole('button');
|
|
67
|
+
await userEvent.click(buttons[1]);
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
...withRTLDiff(),
|
|
71
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Freeze } from '@transferwise/icons';
|
|
3
|
+
import { Flag } from '@wise/art';
|
|
4
|
+
|
|
5
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
+
import AvatarLayout from '..';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
component: AvatarLayout,
|
|
10
|
+
title: 'Content/AvatarLayout/Tests',
|
|
11
|
+
tags: ['!autodocs', '!manifest'],
|
|
12
|
+
} satisfies Meta<typeof AvatarLayout>;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof AvatarLayout>;
|
|
15
|
+
|
|
16
|
+
export const RTLDiff: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<>
|
|
19
|
+
<AvatarLayout
|
|
20
|
+
orientation="horizontal"
|
|
21
|
+
size={48}
|
|
22
|
+
avatars={[{ asset: <Flag code="br" /> }, { asset: <Flag code="jp" /> }]}
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<AvatarLayout
|
|
26
|
+
orientation="horizontal"
|
|
27
|
+
size={48}
|
|
28
|
+
interactive
|
|
29
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<AvatarLayout
|
|
33
|
+
orientation="horizontal"
|
|
34
|
+
size={48}
|
|
35
|
+
avatars={[{ profileName: 'Jay Jay' }, { profileName: 'Amy Amy' }]}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<AvatarLayout
|
|
39
|
+
orientation="horizontal"
|
|
40
|
+
size={48}
|
|
41
|
+
interactive
|
|
42
|
+
avatars={[{ asset: <Flag code="gb" /> }, { asset: <Flag code="br" /> }, { asset: '3+' }]}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<AvatarLayout
|
|
46
|
+
orientation="horizontal"
|
|
47
|
+
size={32}
|
|
48
|
+
avatars={[{ asset: <Flag code="eu" /> }, { asset: <Flag code="gb" /> }]}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<AvatarLayout
|
|
52
|
+
orientation="horizontal"
|
|
53
|
+
size={72}
|
|
54
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<AvatarLayout
|
|
58
|
+
orientation="diagonal"
|
|
59
|
+
size={48}
|
|
60
|
+
avatars={[{ asset: <Flag code="br" /> }, { asset: <Flag code="jp" /> }]}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<AvatarLayout
|
|
64
|
+
orientation="diagonal"
|
|
65
|
+
size={48}
|
|
66
|
+
avatars={[{ profileName: 'Jay Jay' }, { profileName: 'Amy Amy' }]}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<AvatarLayout
|
|
70
|
+
orientation="diagonal"
|
|
71
|
+
size={72}
|
|
72
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
73
|
+
/>
|
|
74
|
+
</>
|
|
75
|
+
),
|
|
76
|
+
...withRTLDiff(),
|
|
77
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Freeze, FastFlag, Camera, Convert } from '@transferwise/icons';
|
|
3
|
+
|
|
4
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import AvatarView from '..';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: AvatarView,
|
|
9
|
+
title: 'Content/AvatarView/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof AvatarView>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof AvatarView>;
|
|
14
|
+
|
|
15
|
+
const sizes = [24, 32, 40, 48, 56, 72] as const;
|
|
16
|
+
|
|
17
|
+
export const RTLDiff: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<>
|
|
20
|
+
{/* Badge positioning: bottom-right dot (notification/online) — key RTL indicator */}
|
|
21
|
+
<div
|
|
22
|
+
style={{
|
|
23
|
+
display: 'grid',
|
|
24
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
25
|
+
gap: '1rem',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{sizes.map((size) => (
|
|
30
|
+
<AvatarView key={`notif-${size}`} size={size} badge={{ type: 'notification' }}>
|
|
31
|
+
<Freeze />
|
|
32
|
+
</AvatarView>
|
|
33
|
+
))}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{/* Online dot */}
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
display: 'grid',
|
|
40
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
41
|
+
gap: '1rem',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{sizes.map((size) => (
|
|
46
|
+
<AvatarView key={`online-${size}`} size={size} badge={{ type: 'online' }}>
|
|
47
|
+
<Freeze />
|
|
48
|
+
</AvatarView>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
{/* Badge with flag (bottom-right corner badge) */}
|
|
53
|
+
<div
|
|
54
|
+
style={{
|
|
55
|
+
display: 'grid',
|
|
56
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
57
|
+
gap: '1rem',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
{sizes.map((size) => (
|
|
62
|
+
<AvatarView key={`flag-${size}`} size={size} badge={{ flagCode: 'GBP' }}>
|
|
63
|
+
<Freeze />
|
|
64
|
+
</AvatarView>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
{/* Badge with icon */}
|
|
69
|
+
<div
|
|
70
|
+
style={{
|
|
71
|
+
display: 'grid',
|
|
72
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
73
|
+
gap: '1rem',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{sizes.map((size) => (
|
|
78
|
+
<AvatarView key={`icon-badge-${size}`} size={size} badge={{ icon: <FastFlag /> }}>
|
|
79
|
+
<Freeze />
|
|
80
|
+
</AvatarView>
|
|
81
|
+
))}
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{/* Badge type action with icon (camera) */}
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
display: 'grid',
|
|
88
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
89
|
+
gap: '1rem',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{sizes.map((size) => (
|
|
94
|
+
<AvatarView
|
|
95
|
+
key={`action-${size}`}
|
|
96
|
+
size={size}
|
|
97
|
+
imgSrc="../avatar-square-dude.webp"
|
|
98
|
+
badge={{ type: 'action', icon: <Camera /> }}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{/* Badge type reference with icon */}
|
|
104
|
+
<div
|
|
105
|
+
style={{
|
|
106
|
+
display: 'grid',
|
|
107
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
108
|
+
gap: '1rem',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{sizes.map((size) => (
|
|
113
|
+
<AvatarView
|
|
114
|
+
key={`ref-${size}`}
|
|
115
|
+
size={size}
|
|
116
|
+
imgSrc="../avatar-square-dude.webp"
|
|
117
|
+
badge={{ type: 'reference', icon: <Convert /> }}
|
|
118
|
+
/>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
{/* Selected state (border highlight) */}
|
|
123
|
+
<div
|
|
124
|
+
style={{
|
|
125
|
+
display: 'grid',
|
|
126
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
127
|
+
gap: '1rem',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
{sizes.map((size) => (
|
|
132
|
+
<AvatarView key={`selected-${size}`} size={size} selected interactive>
|
|
133
|
+
<Freeze />
|
|
134
|
+
</AvatarView>
|
|
135
|
+
))}
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{/* Selected + badge combined */}
|
|
139
|
+
<div
|
|
140
|
+
style={{
|
|
141
|
+
display: 'grid',
|
|
142
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
143
|
+
gap: '1rem',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
{sizes.map((size) => (
|
|
148
|
+
<AvatarView
|
|
149
|
+
key={`selected-badge-${size}`}
|
|
150
|
+
size={size}
|
|
151
|
+
selected
|
|
152
|
+
interactive
|
|
153
|
+
badge={{ flagCode: 'USD' }}
|
|
154
|
+
>
|
|
155
|
+
<Freeze />
|
|
156
|
+
</AvatarView>
|
|
157
|
+
))}
|
|
158
|
+
</div>
|
|
159
|
+
</>
|
|
160
|
+
),
|
|
161
|
+
...withRTLDiff(),
|
|
162
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import LegacyButton from '../LegacyButton';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: LegacyButton,
|
|
7
|
+
title: 'Actions/Button/Legacy Button/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof LegacyButton>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof LegacyButton>;
|
|
12
|
+
|
|
13
|
+
export const RTLDiff: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<>
|
|
16
|
+
{/* default (inline) layout */}
|
|
17
|
+
<LegacyButton>Default button</LegacyButton>
|
|
18
|
+
|
|
19
|
+
{/* block layout — full width */}
|
|
20
|
+
<LegacyButton block>Block button</LegacyButton>
|
|
21
|
+
|
|
22
|
+
{/* loading state — appends ProcessIndicator inside button */}
|
|
23
|
+
<LegacyButton loading>Loading button</LegacyButton>
|
|
24
|
+
|
|
25
|
+
{/* loading + block combined */}
|
|
26
|
+
<LegacyButton loading block>
|
|
27
|
+
Loading block button
|
|
28
|
+
</LegacyButton>
|
|
29
|
+
</>
|
|
30
|
+
),
|
|
31
|
+
...withRTLDiff(),
|
|
32
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { forEachColumn, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import Calendar from '../Calendar';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Calendar,
|
|
9
|
+
title: 'Forms/Calendar/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Calendar>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Calendar>;
|
|
14
|
+
|
|
15
|
+
const selectedDate = new Date(2024, 5, 15);
|
|
16
|
+
const minDate = new Date(2024, 2, 1);
|
|
17
|
+
const maxDate = new Date(2024, 9, 31);
|
|
18
|
+
|
|
19
|
+
const disabledRules = {
|
|
20
|
+
weekdays: ['sat', 'sun'] as ('sat' | 'sun')[],
|
|
21
|
+
dates: [new Date(2024, 5, 10)],
|
|
22
|
+
reason: 'Weekends and specific dates are unavailable.',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const RTLDiff: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<>
|
|
28
|
+
<div data-testid="day-view">
|
|
29
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} disabledRules={disabledRules} />
|
|
30
|
+
</div>
|
|
31
|
+
<div data-testid="month-view">
|
|
32
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} />
|
|
33
|
+
</div>
|
|
34
|
+
<div data-testid="year-view">
|
|
35
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} />
|
|
36
|
+
</div>
|
|
37
|
+
</>
|
|
38
|
+
),
|
|
39
|
+
play: async ({ canvasElement }) => {
|
|
40
|
+
await forEachColumn(canvasElement, async (column) => {
|
|
41
|
+
const monthContainer = column.querySelector('[data-testid="month-view"]')!;
|
|
42
|
+
const monthScope = within(monthContainer as HTMLElement);
|
|
43
|
+
await userEvent.click(monthScope.getByRole('button', { name: /year view/iu }));
|
|
44
|
+
await userEvent.click(monthScope.getByRole('button', { name: /2024.*selected year/iu }));
|
|
45
|
+
|
|
46
|
+
const yearContainer = column.querySelector('[data-testid="year-view"]')!;
|
|
47
|
+
const yearScope = within(yearContainer as HTMLElement);
|
|
48
|
+
await userEvent.click(yearScope.getByRole('button', { name: /year view/iu }));
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
...withRTLDiff(),
|
|
52
|
+
};
|
|
@@ -28,17 +28,19 @@ export const YearViewBoundaries: Story = {
|
|
|
28
28
|
await userEvent.click(canvas.getByRole('button', { name: /year view/iu }));
|
|
29
29
|
|
|
30
30
|
// Selected year (within range) is enabled
|
|
31
|
-
await expect(
|
|
32
|
-
|
|
33
|
-
)
|
|
31
|
+
await expect(canvas.getByRole('button', { name: /2024.*selected year/iu })).not.toHaveAttribute(
|
|
32
|
+
'aria-disabled',
|
|
33
|
+
);
|
|
34
34
|
|
|
35
35
|
// Adjacent years outside range are disabled
|
|
36
|
-
await expect(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
await expect(canvas.getByRole('button', { name: /^2023.*not available/iu })).toHaveAttribute(
|
|
37
|
+
'aria-disabled',
|
|
38
|
+
'true',
|
|
39
|
+
);
|
|
40
|
+
await expect(canvas.getByRole('button', { name: /^2025.*not available/iu })).toHaveAttribute(
|
|
41
|
+
'aria-disabled',
|
|
42
|
+
'true',
|
|
43
|
+
);
|
|
42
44
|
|
|
43
45
|
// Both nav arrows disabled — min and max are both in the 2020–2039 block
|
|
44
46
|
await expect(canvas.getByRole('button', { name: /previous 20 years/iu })).toBeDisabled();
|
|
@@ -73,12 +75,14 @@ export const MonthViewBoundaries: Story = {
|
|
|
73
75
|
).not.toHaveAttribute('aria-disabled');
|
|
74
76
|
|
|
75
77
|
// Months outside range are disabled
|
|
76
|
-
await expect(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
await expect(canvas.getByRole('button', { name: /^Feb.*not available/iu })).toHaveAttribute(
|
|
79
|
+
'aria-disabled',
|
|
80
|
+
'true',
|
|
81
|
+
);
|
|
82
|
+
await expect(canvas.getByRole('button', { name: /^Nov.*not available/iu })).toHaveAttribute(
|
|
83
|
+
'aria-disabled',
|
|
84
|
+
'true',
|
|
85
|
+
);
|
|
82
86
|
|
|
83
87
|
// Both nav arrows disabled — min and max are both in 2024
|
|
84
88
|
await expect(canvas.getByRole('button', { name: /previous year/iu })).toBeDisabled();
|
|
@@ -92,23 +96,23 @@ const disabledRules: DisabledRules = {
|
|
|
92
96
|
};
|
|
93
97
|
|
|
94
98
|
/**
|
|
95
|
-
* When a disabled cell receives
|
|
99
|
+
* When a disabled cell receives focus via keyboard navigation,
|
|
96
100
|
* the inline prompt updates to negative sentiment showing the disabled reason.
|
|
97
101
|
*/
|
|
98
102
|
export const DisabledDateFocusUpdatesPrompt: Story = {
|
|
99
103
|
render: () => <Calendar value={new Date(2024, 6, 5)} disabledRules={disabledRules} />,
|
|
100
104
|
play: async ({ canvasElement }) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// Initially prompt is neutral (focused date is enabled)
|
|
105
|
+
// Initially prompt is neutral (focused date is enabled — July 5 is a Friday)
|
|
104
106
|
const prompt = canvasElement.querySelector('.wds-inline-prompt')!;
|
|
105
107
|
await expect(prompt).toHaveClass('wds-prompt--neutral');
|
|
106
108
|
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
// Tab into the calendar grid (past month nav buttons), then arrow right to Saturday (disabled)
|
|
110
|
+
await userEvent.tab();
|
|
111
|
+
await userEvent.tab();
|
|
112
|
+
await userEvent.tab();
|
|
113
|
+
await userEvent.keyboard('{ArrowRight}');
|
|
110
114
|
|
|
111
|
-
// Prompt should switch to negative after
|
|
112
|
-
await waitFor(() => expect(prompt).toHaveClass('wds-prompt--negative'));
|
|
115
|
+
// Prompt should switch to negative after navigating to the disabled date
|
|
116
|
+
await waitFor(async () => expect(prompt).toHaveClass('wds-prompt--negative'));
|
|
113
117
|
},
|
|
114
118
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import Display from '../../Display';
|
|
5
|
+
import Carousel, { type CarouselCard } from '..';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Carousel,
|
|
9
|
+
title: 'Navigation/Carousel/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Carousel>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Carousel>;
|
|
14
|
+
|
|
15
|
+
const sampleCards: CarouselCard[] = [
|
|
16
|
+
{
|
|
17
|
+
id: 'card-1',
|
|
18
|
+
type: 'button',
|
|
19
|
+
content: (
|
|
20
|
+
<div className="d-flex p-a-1 flex-column align-items-center">
|
|
21
|
+
<Display type="display-small">Card one</Display>
|
|
22
|
+
</div>
|
|
23
|
+
),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'card-2',
|
|
27
|
+
type: 'promo',
|
|
28
|
+
href: '#',
|
|
29
|
+
title: 'Promo card',
|
|
30
|
+
description: 'Description for promo card',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'card-3',
|
|
34
|
+
type: 'anchor',
|
|
35
|
+
href: '#',
|
|
36
|
+
hrefTarget: '_blank',
|
|
37
|
+
content: <Display type="display-small">Anchor card</Display>,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'card-4',
|
|
41
|
+
type: 'button',
|
|
42
|
+
content: (
|
|
43
|
+
<div className="d-flex p-a-1 flex-column align-items-center">
|
|
44
|
+
<Display type="display-small">Card four</Display>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'card-5',
|
|
50
|
+
type: 'anchor',
|
|
51
|
+
href: '#',
|
|
52
|
+
content: <Display type="display-small">Card five</Display>,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export const RTLDiff: Story = {
|
|
57
|
+
render: () => (
|
|
58
|
+
<Carousel header="Carousel with navigation arrows" cards={sampleCards} />
|
|
59
|
+
),
|
|
60
|
+
...withRTLDiff(),
|
|
61
|
+
};
|