@transferwise/components 0.0.0-experimental-36d28a2 → 0.0.0-experimental-18e9dad

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 (72) hide show
  1. package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
  2. package/build/es/no-polyfill/display/Display.js +1 -1
  3. package/build/es/no-polyfill/image/Image.js +1 -1
  4. package/build/es/no-polyfill/index.js +1 -1
  5. package/build/es/no-polyfill/loader/Loader.js +1 -1
  6. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  7. package/build/es/no-polyfill/nudge/Nudge.spec.js +1 -1
  8. package/build/es/no-polyfill/nudge/Nudge.story.js +1 -1
  9. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  10. package/build/es/polyfill/display/Display.js +1 -1
  11. package/build/es/polyfill/image/Image.js +1 -1
  12. package/build/es/polyfill/index.js +1 -1
  13. package/build/es/polyfill/loader/Loader.js +1 -1
  14. package/build/es/polyfill/nudge/Nudge.js +1 -1
  15. package/build/es/polyfill/nudge/Nudge.spec.js +1 -1
  16. package/build/es/polyfill/nudge/Nudge.story.js +1 -1
  17. package/build/main.css +1 -1
  18. package/build/styles/main.css +1 -1
  19. package/build/types/avatar/index.d.ts +0 -1
  20. package/build/types/common/closeButton/CloseButton.d.ts +0 -4
  21. package/build/types/display/Display.d.ts +1 -1
  22. package/build/types/image/Image.d.ts +0 -1
  23. package/build/types/index.d.ts +0 -3
  24. package/build/types/nudge/Nudge.d.ts +8 -1
  25. package/build/types/nudge/Nudge.story.d.ts +1 -1
  26. package/build/umd/no-polyfill/main.js +1 -1
  27. package/build/umd/polyfill/main.js +1 -1
  28. package/package.json +1 -1
  29. package/build/es/no-polyfill/common/card/Card.js +0 -21
  30. package/build/es/no-polyfill/common/card/Card.spec.js +0 -6
  31. package/build/es/no-polyfill/common/card/Card.story.js +0 -1
  32. package/build/es/no-polyfill/common/card/index.js +0 -1
  33. package/build/es/no-polyfill/promoCard/PromoCard.js +0 -51
  34. package/build/es/no-polyfill/promoCard/PromoCard.spec.js +0 -13
  35. package/build/es/no-polyfill/promoCard/PromoCard.story.js +0 -1
  36. package/build/es/no-polyfill/promoCard/PromoCardContext.js +0 -19
  37. package/build/es/no-polyfill/promoCard/PromoCardContext.spec.js +0 -4
  38. package/build/es/no-polyfill/promoCard/PromoCardGroup.js +0 -20
  39. package/build/es/no-polyfill/promoCard/PromoCardGroup.spec.js +0 -5
  40. package/build/es/no-polyfill/promoCard/PromoCardGroup.story.js +0 -1
  41. package/build/es/no-polyfill/promoCard/PromoCardIndicator.js +0 -16
  42. package/build/es/no-polyfill/promoCard/index.js +0 -1
  43. package/build/es/polyfill/common/card/Card.js +0 -21
  44. package/build/es/polyfill/common/card/Card.spec.js +0 -6
  45. package/build/es/polyfill/common/card/Card.story.js +0 -1
  46. package/build/es/polyfill/common/card/index.js +0 -1
  47. package/build/es/polyfill/promoCard/PromoCard.js +0 -51
  48. package/build/es/polyfill/promoCard/PromoCard.spec.js +0 -13
  49. package/build/es/polyfill/promoCard/PromoCard.story.js +0 -1
  50. package/build/es/polyfill/promoCard/PromoCardContext.js +0 -19
  51. package/build/es/polyfill/promoCard/PromoCardContext.spec.js +0 -4
  52. package/build/es/polyfill/promoCard/PromoCardGroup.js +0 -20
  53. package/build/es/polyfill/promoCard/PromoCardGroup.spec.js +0 -5
  54. package/build/es/polyfill/promoCard/PromoCardGroup.story.js +0 -1
  55. package/build/es/polyfill/promoCard/PromoCardIndicator.js +0 -16
  56. package/build/es/polyfill/promoCard/index.js +0 -1
  57. package/build/styles/common/card/Card.css +0 -1
  58. package/build/styles/promoCard/PromoCard.css +0 -1
  59. package/build/types/common/card/Card.d.ts +0 -40
  60. package/build/types/common/card/Card.spec.d.ts +0 -1
  61. package/build/types/common/card/Card.story.d.ts +0 -6
  62. package/build/types/common/card/index.d.ts +0 -1
  63. package/build/types/promoCard/PromoCard.d.ts +0 -123
  64. package/build/types/promoCard/PromoCard.spec.d.ts +0 -1
  65. package/build/types/promoCard/PromoCard.story.d.ts +0 -10
  66. package/build/types/promoCard/PromoCardContext.d.ts +0 -45
  67. package/build/types/promoCard/PromoCardContext.spec.d.ts +0 -1
  68. package/build/types/promoCard/PromoCardGroup.d.ts +0 -55
  69. package/build/types/promoCard/PromoCardGroup.spec.d.ts +0 -1
  70. package/build/types/promoCard/PromoCardGroup.story.d.ts +0 -8
  71. package/build/types/promoCard/PromoCardIndicator.d.ts +0 -31
  72. package/build/types/promoCard/index.d.ts +0 -2
@@ -1,123 +0,0 @@
1
- import React, { FunctionComponent } from 'react';
2
- export type ReferenceType = React.Ref<HTMLInputElement>;
3
- export type LinkTarget = '_blank' | '_parent' | '_self' | '_top';
4
- export interface PromoCardCommonProps {
5
- /** Optional prop to specify classNames onto the PromoCard */
6
- className?: string;
7
- /** Optional prop to specify the ID of the PromoCard */
8
- id?: string;
9
- /** Required prop to specify the descriptive text of the PromoCard */
10
- description: string;
11
- /**
12
- * Optional prop to specify the heading level of the PromoCard
13
- *
14
- * @default 'h2'
15
- */
16
- headingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
17
- /** Optional prop to specify text for the indicator label of the PromoCard */
18
- indicatorLabel?: string;
19
- /** Optional prop to specify an image alt text */
20
- imageAlt?: string;
21
- /** Optional prop to specify an image class */
22
- imageClass?: string;
23
- /** Optional prop to specify an image source url */
24
- imageSource: string;
25
- /** Specify whether the PromoCard is disabled, or not */
26
- isDisabled?: boolean;
27
- /** Specify an onClick event handler */
28
- onClick?: () => void;
29
- /** Optional prop to specify the ID used for testing */
30
- testId?: string;
31
- /** Required prop to specify the title text of the PromoCard */
32
- title: string;
33
- }
34
- export interface PromoCardLinkProps extends PromoCardCommonProps {
35
- /**
36
- * Optional prop to prompts a user to save the linked URL instead of
37
- * navigating to it
38
- */
39
- download?: string;
40
- /** Optionally specify an href for your PromoCard to contain an <a> element */
41
- href?: string;
42
- /** Optionally specify the language of the linked URL */
43
- hrefLang?: string;
44
- /**
45
- * Relationship between the PromoCard href URL and the current page. See
46
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
47
- */
48
- rel?: string[];
49
- /** Optional prop to to display where the linked URL will show */
50
- target?: LinkTarget;
51
- /** Only applies to role="radio" or "checkbox" */
52
- defaultChecked?: never;
53
- isChecked?: never;
54
- tabIndex?: never;
55
- type?: never;
56
- reference?: never;
57
- value?: never;
58
- }
59
- export interface PromoCardCheckedProps extends PromoCardCommonProps {
60
- /** Specify the initial checked attribute of the PromoCard */
61
- defaultChecked?: boolean;
62
- /** Specify whether the PromoCard is checked, or not */
63
- isChecked?: boolean;
64
- /** Optional prop to specify the tabIndex of the PromoCard */
65
- tabIndex?: number;
66
- /** Optional property to provide component Ref */
67
- reference?: ReferenceType;
68
- /** Optional prop to specify the input type of the PromoCard */
69
- type?: 'checkbox' | 'radio';
70
- /** Specify the value attribute of the PromoCard if Checkbox or Radio */
71
- value?: string;
72
- /** Only applies to <a />s */
73
- download?: never;
74
- href?: never;
75
- hrefLang?: never;
76
- rel?: never;
77
- target?: never;
78
- }
79
- export type PromoCardProps = PromoCardLinkProps | PromoCardCheckedProps;
80
- export type PolymorphicPromoCard = (props: PromoCardLinkProps | PromoCardCheckedProps) => JSX.Element;
81
- /**
82
- * PromoCard component.
83
- *
84
- * PromoCard is a marketing style component that is used to group marketing
85
- * product related information (such as choosing Card types). It can be used to
86
- * display information in a structured way, and can be customized with various
87
- * props to suit different use cases.
88
- *
89
- * @component
90
- * @param {string} className - Additional class name for the PromoCard.
91
- * @param {string} description - Description text for the PromoCard.
92
- * @param {boolean} defaultChecked - Initial checked state for checkboxes and radios.
93
- * @param {string} download - Download file name for links.
94
- * @param {string} href - URL for links.
95
- * @param {string} hrefLang - Language code for linked URL.
96
- * @param {string} id - ID of the PromoCard.
97
- * @param {string} imageAlt - Alt text for the image.
98
- * @param {string} imageSource - Source URL of the image.
99
- * @param {string} indicatorLabel - Label for the indicator icon.
100
- * @param {boolean} isChecked - Checked state for checkboxes and radios.
101
- * @param {boolean} isDisabled - Whether the PromoCard is disabled.
102
- * @param {Function} onClick - Click event handler for the PromoCard.
103
- * @param {string} rel - Relationship between the URL and the current page.
104
- * @param {number} tabIndex - Tab index for keyboard navigation.
105
- * @param {string} target - Target window for links.
106
- * @param {string} testId - ID used for testing.
107
- * @param {string} title - Title text of the PromoCard.
108
- * @param {('checkbox'|'radio')} type - Type of the PromoCard (checkbox, radio).
109
- * @param {string} value - Value for checkboxes and radios.
110
- * @returns {JSX.Element} The rendered PromoCard component.
111
- * @example
112
- * <PromoCard
113
- * title="Example PromoCard"
114
- * description="This is an example PromoCard with a link variation."
115
- * href="https://example.com"
116
- * target="_blank"
117
- * imageSource="https://example.com/image.png"
118
- * imageAlt="Example Image"
119
- * indicatorLabel="Learn More"
120
- * />
121
- */
122
- declare const PromoCard: FunctionComponent<PromoCardProps>;
123
- export default PromoCard;
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import PromoCard from './PromoCard';
3
- declare const meta: Meta<typeof PromoCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof PromoCard>;
6
- export declare const Default: Story;
7
- export declare const Link: Story;
8
- export declare const Checked: Story;
9
- export declare const Disabled: Story;
10
- export declare const CustomClass: Story;
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * The type of the PromoCard context object.
4
- *
5
- * The context object contains the current state of the PromoCard group, whether
6
- * the group is disabled or not, and a function to call when the group value
7
- * changes. This value is used to provide context to child PromoCard components,
8
- * allowing them to interact with the group and update its state.
9
- */
10
- interface PromoCardContextType {
11
- /**
12
- * The current value of the PromoCard group.
13
- *
14
- * @default ''
15
- */
16
- state: string;
17
- /**
18
- * Whether the PromoCard group is disabled or not.
19
- *
20
- * @default false
21
- */
22
- isDisabled: boolean;
23
- /**
24
- * A function to call when the PromoCard group value changes.
25
- *
26
- * @param {string} value - The new value of the PromoCard group.
27
- * @default () => {}
28
- */
29
- onChange: (value: string) => void;
30
- }
31
- /**
32
- * The PromoCard context object.
33
- */
34
- export declare const PromoCardContext: React.Context<PromoCardContextType>;
35
- /**
36
- * A custom hook for accessing the PromoCard context object.
37
- *
38
- * The `usePromoCardContext` hook is used to access the PromoCard context object
39
- * from within a child PromoCard component. It throws an error if the context
40
- * object is not available, which can help with debugging and development.
41
- *
42
- * @returns {PromoCardContextType} - The PromoCard context object.
43
- */
44
- export declare const usePromoCardContext: () => PromoCardContextType;
45
- export default PromoCardContext;
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- export type AriaRoleRadioGroup = 'radiogroup';
3
- export interface PromoCardGroupProps {
4
- /**
5
- * Optional class name(s) to add to the group container.
6
- */
7
- className?: string;
8
- /**
9
- * The PromoCard components to display inside the group.
10
- */
11
- children: ReactNode;
12
- /**
13
- * The default value for the group.
14
- */
15
- defaultValue?: string;
16
- /**
17
- * Optional ID to add to the group container.
18
- */
19
- id?: string;
20
- /**
21
- * Whether the group is disabled or not.
22
- */
23
- isDisabled?: boolean;
24
- /**
25
- * Optional label to display above the group.
26
- */
27
- label?: string;
28
- /**
29
- * Optional function to call when the group value changes.
30
- */
31
- onChange?: (value: string) => void;
32
- /**
33
- * Optional ID to add to the group container for testing purposes.
34
- */
35
- testId?: string;
36
- }
37
- /**
38
- * PromoCardGroup component.
39
- *
40
- * A PromoCardGroup is a container for PromoCard components that allows the user to select one or more
41
- * cards from a group. It can be used to display a set of related options, and can be customized with
42
- * various props to suit different use cases.
43
- *
44
- * @param {ReactNode} children - The PromoCard components to display inside the group.
45
- * @param {string} className - Optional class name(s) to add to the group container.
46
- * @param {string} defaultValue - The default value for the group.
47
- * @param {string} id - Optional ID to add to the group container.
48
- * @param {boolean} isDisabled=false - Whether the group is disabled or not.
49
- * @param {string} label - Optional label to display above the group.
50
- * @param {Function} onChange - Optional function to call when the group value changes.
51
- * @param {string} testId - Optional ID to add to the group container for testing purposes.
52
- * @returns {JSX.Element} - The PromoCardGroup component.
53
- */
54
- declare const PromoCardGroup: FunctionComponent<PromoCardGroupProps>;
55
- export default PromoCardGroup;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import PromoCardGroup from './PromoCardGroup';
3
- declare const meta: Meta<typeof PromoCardGroup>;
4
- export default meta;
5
- type Story = StoryObj<typeof PromoCardGroup>;
6
- export declare const Default: Story;
7
- export declare const DefaultValue: Story;
8
- export declare const Disabled: Story;
@@ -1,31 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type PromoCardIndicatorProps = {
3
- /** Optional class name(s) to add to the indicator container. */
4
- className?: string;
5
- /** Optional label to display next to the indicator. */
6
- label?: string;
7
- /** Optional icon to display in the indicator. */
8
- icon?: 'check' | 'arrow' | 'download';
9
- /** Optional ID to add to the indicator container for testing purposes. */
10
- testid?: string;
11
- /** Optional children to display inside the indicator. */
12
- children?: ReactNode;
13
- };
14
- /**
15
- * PromoCardIndicator component.
16
- *
17
- * A PromoCardIndicator is a small component that can be used to display
18
- * additional information or actions related to a PromoCard. It can be
19
- * customized with various props to suit different use cases.
20
- *
21
- * @param {string} className - Optional class name(s) to add to the indicator container.
22
- * @param {string} label - Optional label to display next to the indicator.
23
- * @param {string} icon - Optional icon to display in the indicator.
24
- * @param {string} testid - Optional ID to add to the indicator container for testing purposes.
25
- * @param {ReactNode} children - Optional children to display inside the indicator.
26
- * @returns {JSX.Element} - The PromoCardIndicator component.
27
- * @example
28
- * <PromoCardIndicator label="Download" icon="download" />
29
- */
30
- declare const PromoCardIndicator: React.FC<PromoCardIndicatorProps>;
31
- export default PromoCardIndicator;
@@ -1,2 +0,0 @@
1
- export { default } from './PromoCard';
2
- export { default as PromoCardGroup } from './PromoCardGroup';