@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.
Files changed (81) hide show
  1. package/build/types/Body/Body.d.ts +2 -2
  2. package/build/types/IconButton/IconButton.d.ts +1 -1
  3. package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
  4. package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
  5. package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
  6. package/build/types/Title/Title.d.ts +2 -2
  7. package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
  8. package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
  9. package/package.json +1 -1
  10. package/src/Accordion/_stories/Accordion.rtl.test.story.tsx +71 -0
  11. package/src/AvatarLayout/_stories/AvatarLayout.rtl.test.story.tsx +77 -0
  12. package/src/AvatarView/_stories/AvatarView.rtl.test.story.tsx +162 -0
  13. package/src/Button/LegacyButton/_stories/LegacyButton.rtl.test.story.tsx +32 -0
  14. package/src/Calendar/_stories/Calendar.rtl.test.story.tsx +52 -0
  15. package/src/Calendar/_stories/Calendar.test.story.tsx +28 -24
  16. package/src/Carousel/_stories/Carousel.rtl.test.story.tsx +61 -0
  17. package/src/Checkbox/_stories/Checkbox.rtl.test.story.tsx +31 -0
  18. package/src/CheckboxButton/_stories/CheckboxButton.rtl.test.story.tsx +27 -0
  19. package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +0 -37
  20. package/src/Chevron/_stories/Chevron.rtl.test.story.tsx +26 -0
  21. package/src/Chips/_stories/Chips.rtl.test.story.tsx +49 -0
  22. package/src/Chips/_stories/Chips.test.story.tsx +0 -34
  23. package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
  24. package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +25 -0
  25. package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
  26. package/src/Decision/_stories/Decision.rtl.test.story.tsx +79 -0
  27. package/src/DefinitionList/_stories/DefinitionList.rtl.test.story.tsx +63 -0
  28. package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
  29. package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
  30. package/src/Field/_stories/Field.rtl.test.story.tsx +58 -0
  31. package/src/FlowNavigation/_stories/FlowNavigation.rtl.test.story.tsx +70 -0
  32. package/src/Header/_stories/Header.rtl.test.story.tsx +37 -0
  33. package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
  34. package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
  35. package/src/Inputs/_stories/InputGroup.rtl.test.story.tsx +69 -0
  36. package/src/Inputs/_stories/SearchInput.rtl.test.story.tsx +32 -0
  37. package/src/Inputs/_stories/TextArea.rtl.test.story.tsx +38 -0
  38. package/src/InstructionsList/_stories/InstructionsList.rtl.test.story.tsx +30 -0
  39. package/src/Label/_stories/Label.rtl.test.story.tsx +36 -0
  40. package/src/Link/_stories/Link.rtl.test.story.tsx +26 -0
  41. package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
  42. package/src/ListItem/_stories/variants/helpers.tsx +2 -6
  43. package/src/Logo/_stories/Logo.rtl.test.story.tsx +56 -0
  44. package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
  45. package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
  46. package/src/Nudge/_stories/Nudge.rtl.test.story.tsx +37 -0
  47. package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +44 -0
  48. package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
  49. package/src/Progress/_stories/Progress.rtl.test.story.tsx +27 -0
  50. package/src/ProgressBar/_stories/ProgressBar.rtl.test.story.tsx +33 -0
  51. package/src/PromoCard/_stories/PromoCard.rtl.test.story.tsx +42 -0
  52. package/src/PromoCard/_stories/PromoCardGroup.rtl.test.story.tsx +51 -0
  53. package/src/Prompt/ActionPrompt/_stories/ActionPrompt.rtl.test.story.tsx +53 -0
  54. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.rtl.test.story.tsx +46 -0
  55. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +0 -30
  56. package/src/Prompt/InfoPrompt/_stories/InfoPrompt.rtl.test.story.tsx +36 -0
  57. package/src/Prompt/InlinePrompt/_stories/InlinePrompt.rtl.test.story.tsx +38 -0
  58. package/src/Radio/_stories/Radio.rtl.test.story.tsx +61 -0
  59. package/src/RadioGroup/_stories/RadioGroup.rtl.test.story.tsx +66 -0
  60. package/src/Section/_stories/Section.rtl.test.story.tsx +29 -0
  61. package/src/SegmentedControl/_stories/SegmentedControl.rtl.test.story.tsx +45 -0
  62. package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
  63. package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
  64. package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
  65. package/src/Stepper/_stories/Stepper.rtl.test.story.tsx +24 -0
  66. package/src/Switch/_stories/Switch.rtl.test.story.tsx +32 -0
  67. package/src/Switch/_stories/Switch.test.story.tsx +0 -26
  68. package/src/Table/_stories/Table.rtl.test.story.tsx +104 -0
  69. package/src/Tabs/_stories/Tabs.rtl.test.story.tsx +72 -0
  70. package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.rtl.test.story.tsx +48 -0
  71. package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
  72. package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
  73. package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
  74. package/src/UploadInput/_stories/UploadInput.rtl.test.story.tsx +59 -0
  75. package/src/_deprecated/Alert/_stories/Alert.rtl.test.story.tsx +37 -0
  76. package/src/_deprecated/Card/_stories/Card.rtl.test.story.tsx +38 -0
  77. package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.rtl.test.story.tsx +28 -0
  78. package/src/_deprecated/InlineAlert/_stories/InlineAlert.rtl.test.story.tsx +26 -0
  79. package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.rtl.test.story.tsx +42 -0
  80. package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
  81. package/src/common/BottomSheet/_stories/BottomSheet.rtl.test.story.tsx +39 -0
@@ -0,0 +1,71 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { userEvent, within } from 'storybook/test';
3
+ import { Person } from '@transferwise/icons';
4
+
5
+ import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
6
+ import Select from '..';
7
+
8
+ export default {
9
+ component: Select,
10
+ title: 'Forms/Select/Tests/RTL Diff',
11
+ tags: ['!autodocs', '!manifest'],
12
+ } satisfies Meta<typeof Select>;
13
+
14
+ type Story = StoryObj<typeof Select>;
15
+
16
+ const options = [
17
+ { header: 'Popular' },
18
+ { value: 'gbp', label: 'British pound', currency: 'gbp', icon: <Person /> },
19
+ { value: 'eur', label: 'Euro', currency: 'eur', icon: <Person /> },
20
+ { value: 'usd', label: 'US Dollar', currency: 'usd', note: 'United States dollar' },
21
+ { separator: true },
22
+ { header: 'Other' },
23
+ { value: 'cad', label: 'Canadian dollar', currency: 'cad' },
24
+ { value: 'aud', label: 'Australian dollar', currency: 'aud' },
25
+ ];
26
+
27
+ const selected = { value: 'gbp', label: 'British pound', currency: 'gbp', icon: <Person /> };
28
+
29
+ export const TriggerVariants: Story = {
30
+ render: () => (
31
+ <>
32
+ <Select
33
+ size="lg"
34
+ placeholder="Select currency"
35
+ selected={selected}
36
+ options={options}
37
+ onChange={() => {}}
38
+ />
39
+ <Select
40
+ size="md"
41
+ placeholder="Select currency"
42
+ selected={selected}
43
+ options={options}
44
+ onChange={() => {}}
45
+ />
46
+ <Select size="sm" placeholder="Select currency" options={options} onChange={() => {}} />
47
+ </>
48
+ ),
49
+ ...withRTLDiff(),
50
+ };
51
+
52
+ export const OpenDropdown: Story = {
53
+ render: () => (
54
+ <Select
55
+ size="lg"
56
+ search
57
+ searchPlaceholder="Type a currency"
58
+ placeholder="Select currency"
59
+ selected={selected}
60
+ options={options}
61
+ onChange={() => {}}
62
+ />
63
+ ),
64
+ play: async ({ canvasElement }) => {
65
+ const canvas = within(canvasElement);
66
+ const trigger = canvas.queryByRole('button');
67
+ if (!trigger) return;
68
+ await userEvent.click(trigger);
69
+ },
70
+ ...withRTLDiff({ renderAs: 'iframe', width: '80%' }),
71
+ };
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { FastFlag } from '@transferwise/icons';
3
+
4
+ import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
5
+ import { lorem10 } from '../../../test-utils';
6
+ import ListItem from '../../../ListItem';
7
+ import Title from '../../../Title/Title';
8
+ import { Typography } from '../../PropsValues/typography';
9
+ import BottomSheet from '../BottomSheet';
10
+
11
+ export default {
12
+ component: BottomSheet,
13
+ title: 'Dialogs/BottomSheet/Tests',
14
+ tags: ['!autodocs', '!manifest'],
15
+ } satisfies Meta<typeof BottomSheet>;
16
+
17
+ type Story = StoryObj<typeof BottomSheet>;
18
+
19
+ export const RTLDiff: Story = {
20
+ render: () => (
21
+ <BottomSheet open aria-label="Manage your card">
22
+ <Title type={Typography.TITLE_SECTION}>Money without borders</Title>
23
+ {lorem10}
24
+ <br />
25
+ <br />
26
+ <ListItem
27
+ title="List item"
28
+ subtitle="Button and icon are vertically centered."
29
+ control={<ListItem.Navigation href="#" />}
30
+ media={
31
+ <ListItem.AvatarView>
32
+ <FastFlag />
33
+ </ListItem.AvatarView>
34
+ }
35
+ />
36
+ </BottomSheet>
37
+ ),
38
+ ...withRTLDiff({ renderAs: 'iframe' }),
39
+ };