@transferwise/components 0.0.0-experimental-215a547 → 0.0.0-experimental-0dbf5cd

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.
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { SizeSmall, SizeLarge } from '../common';
3
3
  import { PopoverPreferredPlacement } from '../popover';
4
- export interface Props {
4
+ export interface InfoProps {
5
5
  'aria-label'?: string;
6
6
  /**
7
7
  * Extra classes applied to Info
@@ -29,6 +29,6 @@ export interface Props {
29
29
  */
30
30
  preferredPlacement?: PopoverPreferredPlacement;
31
31
  }
32
- declare const Info: ({ className, content, onClick, presentation, size, title, "aria-label": ariaLabel, preferredPlacement, }: Props) => import("react").JSX.Element;
32
+ declare const Info: ({ className, content, onClick, presentation, size, title, "aria-label": ariaLabel, preferredPlacement, }: InfoProps) => import("react").JSX.Element;
33
33
  export default Info;
34
34
  //# sourceMappingURL=Info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAkB,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAKhE,MAAM,WAAW,KAAK;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;CAChD;AAED,QAAA,MAAM,IAAI,6GASP,KAAK,gCAiDP,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAkB,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAKhE,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;CAChD;AAED,QAAA,MAAM,IAAI,6GASP,SAAS,gCAiDX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { InfoPresentation } from './infoPresentations';
2
2
  export { default } from './Info';
3
- export type { Props as InfoProps } from './Info';
3
+ export type { InfoProps } from './Info';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/info/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,YAAY,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/info/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-215a547",
3
+ "version": "0.0.0-experimental-0dbf5cd",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -93,8 +93,8 @@
93
93
  "react-intl": "^6.6.6",
94
94
  "rollup": "^4.17.2",
95
95
  "storybook": "^8.1.10",
96
- "@transferwise/less-config": "3.1.0",
97
96
  "@wise/components-theming": "1.3.0",
97
+ "@transferwise/less-config": "3.1.0",
98
98
  "@transferwise/neptune-css": "14.10.0"
99
99
  },
100
100
  "peerDependencies": {
@@ -1,13 +1,10 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { userEvent, within } from '@storybook/test';
3
- import * as React from 'react';
4
3
 
5
4
  import { DateInput, DateMode, Info, InlineAlert, Title, Typography } from '..';
6
5
  import { lorem10, storyConfig } from '../test-utils';
7
6
 
8
- import { DateInputProps } from './DateInput';
9
-
10
- export default {
7
+ const meta = {
11
8
  component: DateInput,
12
9
  title: 'Forms/DateInput',
13
10
  args: {
@@ -20,16 +17,24 @@ export default {
20
17
  tags: ['autodocs'],
21
18
  } satisfies Meta<typeof DateInput>;
22
19
 
23
- type Story = StoryObj<DateInputProps>;
20
+ export default meta;
24
21
 
25
- export const Basic: StoryObj = {};
22
+ type Story = StoryObj<typeof meta>;
26
23
 
27
- Basic.play = async ({ canvasElement }) => {
28
- const canvas = within(canvasElement);
29
- await userEvent.click(canvas.getByRole('button'));
30
- };
24
+ export const Basic = {
25
+ args: {
26
+ onChange: () => {},
27
+ },
28
+ play: async ({ canvasElement }) => {
29
+ const canvas = within(canvasElement);
30
+ await userEvent.click(canvas.getByRole('button'));
31
+ },
32
+ } satisfies Story;
31
33
 
32
- export const WithLabel: Story = {
34
+ export const WithLabel = {
35
+ args: {
36
+ onChange: () => {},
37
+ },
33
38
  render: (args) => {
34
39
  const id1 = 'date-input-group-label-1';
35
40
  const label = 'Date of Birth';
@@ -71,11 +76,11 @@ export const WithLabel: Story = {
71
76
  </>
72
77
  );
73
78
  },
74
- };
79
+ } satisfies Story;
75
80
 
76
- export const BasicMobile: Story = storyConfig(Basic, { variants: ['mobile'] });
81
+ export const BasicMobile = storyConfig(Basic, { variants: ['mobile'] });
77
82
 
78
- export const InputError: Story = {
83
+ export const InputError = {
79
84
  ...Basic,
80
85
  render: (args) => (
81
86
  <div className="form-group has-error">
@@ -83,6 +88,6 @@ export const InputError: Story = {
83
88
  <InlineAlert type="error">{lorem10}</InlineAlert>
84
89
  </div>
85
90
  ),
86
- };
91
+ } satisfies Story;
87
92
 
88
- export const InputErrorMobile: Story = storyConfig(InputError, { variants: ['mobile'] });
93
+ export const InputErrorMobile = storyConfig(InputError, { variants: ['mobile'] });
@@ -5,7 +5,7 @@ import { lorem10, storyConfig } from '../test-utils';
5
5
 
6
6
  import Info, { InfoPresentation } from '.';
7
7
 
8
- export default {
8
+ const meta = {
9
9
  component: Info,
10
10
  title: 'Dialogs/Info',
11
11
  args: {
@@ -20,16 +20,18 @@ export default {
20
20
  ),
21
21
  } satisfies Meta<typeof Info>;
22
22
 
23
- type Story = StoryObj<typeof Info>;
23
+ export default meta;
24
24
 
25
- export const Basic: Story = storyConfig(
25
+ type Story = StoryObj<typeof meta>;
26
+
27
+ export const Basic = storyConfig<typeof meta>(
26
28
  {},
27
29
  {
28
30
  variants: ['default', 'dark', 'rtl'],
29
31
  },
30
32
  );
31
33
 
32
- export const OpenedPopover: Story = {
34
+ export const OpenedPopover = {
33
35
  parameters: {
34
36
  chromatic: {
35
37
  delay: 1000,
@@ -39,15 +41,19 @@ export const OpenedPopover: Story = {
39
41
  const canvas = within(canvasElement);
40
42
  await userEvent.click(canvas.getByRole('button'));
41
43
  },
42
- };
44
+ } satisfies Story;
43
45
 
44
- export const OpenedPopoverMobile: Story = storyConfig(OpenedPopover, { variants: ['mobile'] });
46
+ export const OpenedPopoverMobile = storyConfig(OpenedPopover, {
47
+ variants: ['mobile'],
48
+ });
45
49
 
46
- export const OpenedModal: Story = {
50
+ export const OpenedModal = {
47
51
  ...OpenedPopover,
48
52
  args: {
49
53
  presentation: InfoPresentation.MODAL,
50
54
  },
51
- };
55
+ } satisfies Story;
52
56
 
53
- export const OpenedModalMobile: Story = storyConfig(OpenedModal, { variants: ['mobile'] });
57
+ export const OpenedModalMobile = storyConfig(OpenedModal, {
58
+ variants: ['mobile'],
59
+ });
package/src/info/Info.tsx CHANGED
@@ -10,7 +10,7 @@ import Popover, { PopoverPreferredPlacement } from '../popover';
10
10
  import messages from './Info.messages';
11
11
  import { InfoPresentation } from './infoPresentations';
12
12
 
13
- export interface Props {
13
+ export interface InfoProps {
14
14
  'aria-label'?: string;
15
15
  /**
16
16
  * Extra classes applied to Info
@@ -48,7 +48,7 @@ const Info = ({
48
48
  title = undefined,
49
49
  'aria-label': ariaLabel,
50
50
  preferredPlacement = Position.BOTTOM,
51
- }: Props) => {
51
+ }: InfoProps) => {
52
52
  const intl = useIntl();
53
53
  const [open, setOpen] = useState(false);
54
54
  ariaLabel ??= intl.formatMessage(messages.ariaLabel);
package/src/info/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { InfoPresentation } from './infoPresentations';
2
2
  export { default } from './Info';
3
- export type { Props as InfoProps } from './Info';
3
+ export type { InfoProps } from './Info';