@transferwise/components 45.24.0 → 45.25.0
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,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SizeSmall, SizeLarge } from '../common';
|
|
2
|
+
import { Position, SizeSmall, SizeLarge } from '../common';
|
|
3
3
|
export interface Props {
|
|
4
4
|
'aria-label': string;
|
|
5
5
|
/**
|
|
@@ -23,7 +23,11 @@ export interface Props {
|
|
|
23
23
|
* Title displayed inside a Popover a Modal
|
|
24
24
|
*/
|
|
25
25
|
title?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Prferred placement of the Popover, does not apply to Modal
|
|
28
|
+
*/
|
|
29
|
+
preferredPlacement?: Position;
|
|
26
30
|
}
|
|
27
|
-
declare const Info: ({ className, content, onClick, presentation, size, title, "aria-label": ariaLabel, }: Props) => import("react").JSX.Element;
|
|
31
|
+
declare const Info: ({ className, content, onClick, presentation, size, title, "aria-label": ariaLabel, preferredPlacement, }: Props) => import("react").JSX.Element;
|
|
28
32
|
export default Info;
|
|
29
33
|
//# sourceMappingURL=Info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAQ,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMjE,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB;;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,QAAQ,CAAC;CAC/B;AAED,QAAA,MAAM,IAAI,6GASP,KAAK,gCAgDP,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
package/src/info/Info.tsx
CHANGED
|
@@ -31,6 +31,10 @@ export interface Props {
|
|
|
31
31
|
* Title displayed inside a Popover a Modal
|
|
32
32
|
*/
|
|
33
33
|
title?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Prferred placement of the Popover, does not apply to Modal
|
|
36
|
+
*/
|
|
37
|
+
preferredPlacement?: Position;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
const Info = ({
|
|
@@ -41,6 +45,7 @@ const Info = ({
|
|
|
41
45
|
size = Size.SMALL,
|
|
42
46
|
title = undefined,
|
|
43
47
|
'aria-label': ariaLabel,
|
|
48
|
+
preferredPlacement = Position.BOTTOM,
|
|
44
49
|
}: Props) => {
|
|
45
50
|
const [open, setOpen] = useState(false);
|
|
46
51
|
|
|
@@ -75,7 +80,7 @@ const Info = ({
|
|
|
75
80
|
<Modal body={content} open={open} title={title} onClose={() => setOpen(false)} />
|
|
76
81
|
</>
|
|
77
82
|
) : (
|
|
78
|
-
<Popover content={content} preferredPlacement={
|
|
83
|
+
<Popover content={content} preferredPlacement={preferredPlacement} title={title}>
|
|
79
84
|
<button
|
|
80
85
|
type="button"
|
|
81
86
|
{...buttonProps}
|