@transferwise/components 46.135.0 → 46.135.2
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/badge/BadgeAssets.js +2 -1
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs +2 -1
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/common/panel/Panel.js +49 -54
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +54 -59
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/main.css +26 -14
- package/build/select/Select.js +1 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/css/neptune.css +22 -11
- package/build/styles/less/neptune-tokens.less +3 -2
- package/build/styles/main.css +26 -14
- package/build/styles/modal/Modal.css +2 -2
- package/build/styles/props/neptune-tokens.css +2 -1
- package/build/styles/select/Select.css +2 -1
- package/build/styles/styles/less/neptune.css +22 -11
- package/build/tooltip/Tooltip.js +29 -50
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +30 -51
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/types/badge/BadgeAssets.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/package.json +11 -13
- package/src/avatarView/AvatarView.story.tsx +1 -1
- package/src/avatarView/AvatarView.test.story.tsx +108 -1
- package/src/badge/BadgeAssets.tsx +2 -0
- package/src/common/panel/Panel.tsx +56 -49
- package/src/main.css +26 -14
- package/src/modal/Modal.css +2 -2
- package/src/modal/Modal.less +1 -1
- package/src/select/Select.css +2 -1
- package/src/select/Select.less +6 -5
- package/src/select/Select.test.story.tsx +59 -0
- package/src/select/Select.tsx +1 -1
- package/src/styles/less/neptune.css +22 -11
- package/src/tooltip/Tooltip.tsx +26 -45
package/build/tooltip/Tooltip.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var react = require('@floating-ui/react');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var React = require('react');
|
|
7
|
-
var reactPopper = require('react-popper');
|
|
8
8
|
require('../common/theme.js');
|
|
9
9
|
require('../common/direction.js');
|
|
10
10
|
require('../common/propsValues/control.js');
|
|
@@ -30,7 +30,6 @@ require('react-intl');
|
|
|
30
30
|
require('../common/closeButton/CloseButton.messages.js');
|
|
31
31
|
var jsxRuntime = require('react/jsx-runtime');
|
|
32
32
|
|
|
33
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
34
33
|
const Tooltip = ({
|
|
35
34
|
position: position$1 = position.Position.TOP,
|
|
36
35
|
children = undefined,
|
|
@@ -39,51 +38,35 @@ const Tooltip = ({
|
|
|
39
38
|
className
|
|
40
39
|
}) => {
|
|
41
40
|
const [open, setOpen] = React.useState(false);
|
|
42
|
-
const
|
|
43
|
-
const [arrowElement, setArrowElement] = React.useState(null);
|
|
44
|
-
const [popperElement, setPopperElement] = React.useState(null);
|
|
41
|
+
const arrowRef = React.useRef(null);
|
|
45
42
|
const fallbackId = React.useId();
|
|
46
43
|
const tooltipId = id ?? fallbackId;
|
|
47
|
-
const modifiers = [];
|
|
48
|
-
modifiers.push({
|
|
49
|
-
name: 'arrow',
|
|
50
|
-
options: {
|
|
51
|
-
element: arrowElement,
|
|
52
|
-
options: {
|
|
53
|
-
padding: 8 // 8px from the edges of the popper
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
// This lets you displace a popper element from its reference element.
|
|
58
|
-
modifiers.push({
|
|
59
|
-
name: 'offset',
|
|
60
|
-
options: {
|
|
61
|
-
offset: [0, 16]
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
modifiers.push({
|
|
65
|
-
name: 'flip',
|
|
66
|
-
options: {
|
|
67
|
-
fallbackPlacements: position.Position.TOP
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
44
|
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
45
|
+
refs,
|
|
46
|
+
floatingStyles,
|
|
47
|
+
placement,
|
|
48
|
+
middlewareData
|
|
49
|
+
} = react.useFloating({
|
|
75
50
|
placement: position$1,
|
|
76
|
-
|
|
51
|
+
middleware: [react.offset(16), react.flip({
|
|
52
|
+
fallbackPlacements: [position.Position.TOP]
|
|
53
|
+
}), react.arrow({
|
|
54
|
+
element: arrowRef,
|
|
55
|
+
padding: 8
|
|
56
|
+
})],
|
|
57
|
+
whileElementsMounted: open ? react.autoUpdate : undefined,
|
|
58
|
+
open
|
|
77
59
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
60
|
+
const arrowStyle = {
|
|
61
|
+
...(middlewareData.arrow?.x != null ? {
|
|
62
|
+
left: middlewareData.arrow.x
|
|
63
|
+
} : {}),
|
|
64
|
+
...(middlewareData.arrow?.y != null ? {
|
|
65
|
+
top: middlewareData.arrow.y
|
|
66
|
+
} : {})
|
|
67
|
+
};
|
|
85
68
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
86
|
-
ref:
|
|
69
|
+
ref: refs.setReference,
|
|
87
70
|
className: "tw-tooltip-container",
|
|
88
71
|
onMouseOver: () => setOpen(true),
|
|
89
72
|
onFocus: () => setOpen(true),
|
|
@@ -92,23 +75,19 @@ const Tooltip = ({
|
|
|
92
75
|
children: [children ? /*#__PURE__*/React.cloneElement(children, {
|
|
93
76
|
'aria-describedby': `${tooltipId}-tooltip`
|
|
94
77
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
95
|
-
|
|
96
|
-
ref: setPopperElement,
|
|
78
|
+
ref: refs.setFloating,
|
|
97
79
|
className: clsx.clsx('np-tooltip', 'np-panel', open ? `np-panel--open np-tooltip--open` : null, className),
|
|
98
|
-
style:
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
...attributes.popper,
|
|
80
|
+
style: floatingStyles,
|
|
81
|
+
"data-popper-placement": placement,
|
|
102
82
|
"aria-hidden": !open,
|
|
103
83
|
role: "tooltip",
|
|
104
84
|
id: `${tooltipId}-tooltip`,
|
|
105
85
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
106
86
|
className: "np-panel__content tooltip-inner",
|
|
107
87
|
children: [label, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
108
|
-
|
|
109
|
-
ref: setArrowElement,
|
|
88
|
+
ref: arrowRef,
|
|
110
89
|
className: clsx.clsx('np-panel__arrow'),
|
|
111
|
-
style:
|
|
90
|
+
style: arrowStyle
|
|
112
91
|
})]
|
|
113
92
|
})
|
|
114
93
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../src/tooltip/Tooltip.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../src/tooltip/Tooltip.tsx"],"sourcesContent":["import {\n arrow as arrowMiddleware,\n autoUpdate,\n flip,\n offset,\n useFloating,\n} from '@floating-ui/react';\nimport { clsx } from 'clsx';\nimport {\n AriaAttributes,\n CSSProperties,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n cloneElement,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { CommonProps, Position } from '../common';\nimport {\n PositionBottom,\n PositionLeft,\n PositionRight,\n PositionTop,\n} from '../common/propsValues/position';\n\nexport type TooltipProps = PropsWithChildren<{\n position?: PositionTop | PositionRight | PositionBottom | PositionLeft;\n label: ReactNode;\n id?: string;\n}> &\n CommonProps;\n\nconst Tooltip = ({\n position = Position.TOP,\n children = undefined,\n label,\n id,\n className,\n}: TooltipProps) => {\n const [open, setOpen] = useState(false);\n const arrowRef = useRef<HTMLDivElement | null>(null);\n\n const fallbackId = useId();\n const tooltipId = id ?? fallbackId;\n\n const { refs, floatingStyles, placement, middlewareData } = useFloating({\n placement: position,\n middleware: [\n offset(16),\n flip({ fallbackPlacements: [Position.TOP] }),\n arrowMiddleware({ element: arrowRef, padding: 8 }),\n ],\n whileElementsMounted: open ? autoUpdate : undefined,\n open,\n });\n\n const arrowStyle: CSSProperties = {\n ...(middlewareData.arrow?.x != null ? { left: middlewareData.arrow.x } : {}),\n ...(middlewareData.arrow?.y != null ? { top: middlewareData.arrow.y } : {}),\n };\n\n return (\n <span\n ref={refs.setReference}\n className=\"tw-tooltip-container\"\n onMouseOver={() => setOpen(true)}\n onFocus={() => setOpen(true)}\n onMouseOut={() => setOpen(false)}\n onBlur={() => setOpen(false)}\n >\n {children\n ? cloneElement(children as ReactElement<Pick<AriaAttributes, 'aria-describedby'>>, {\n 'aria-describedby': `${tooltipId}-tooltip`,\n })\n : null}\n <div\n ref={refs.setFloating}\n className={clsx(\n 'np-tooltip',\n 'np-panel',\n open ? `np-panel--open np-tooltip--open` : null,\n className,\n )}\n style={floatingStyles}\n data-popper-placement={placement}\n aria-hidden={!open}\n role=\"tooltip\"\n id={`${tooltipId}-tooltip`}\n >\n <div className=\"np-panel__content tooltip-inner\">\n {label}\n <div ref={arrowRef} className={clsx('np-panel__arrow')} style={arrowStyle} />\n </div>\n </div>\n </span>\n );\n};\n\nexport default Tooltip;\n"],"names":["Tooltip","position","Position","TOP","children","undefined","label","id","className","open","setOpen","useState","arrowRef","useRef","fallbackId","useId","tooltipId","refs","floatingStyles","placement","middlewareData","useFloating","middleware","offset","flip","fallbackPlacements","arrowMiddleware","element","padding","whileElementsMounted","autoUpdate","arrowStyle","arrow","x","left","y","top","_jsxs","ref","setReference","onMouseOver","onFocus","onMouseOut","onBlur","cloneElement","_jsx","setFloating","clsx","style","role"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAMA,OAAO,GAAGA,CAAC;YACfC,UAAQ,GAAGC,iBAAQ,CAACC,GAAG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
import { clsx } from 'clsx';
|
|
2
|
-
import { useState, useRef, useId,
|
|
3
|
-
import { usePopper } from 'react-popper';
|
|
3
|
+
import { useState, useRef, useId, cloneElement } from 'react';
|
|
4
4
|
import '../common/theme.mjs';
|
|
5
5
|
import '../common/direction.mjs';
|
|
6
6
|
import '../common/propsValues/control.mjs';
|
|
@@ -26,7 +26,6 @@ import 'react-intl';
|
|
|
26
26
|
import '../common/closeButton/CloseButton.messages.mjs';
|
|
27
27
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
28
28
|
|
|
29
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
30
29
|
const Tooltip = ({
|
|
31
30
|
position = Position.TOP,
|
|
32
31
|
children = undefined,
|
|
@@ -35,51 +34,35 @@ const Tooltip = ({
|
|
|
35
34
|
className
|
|
36
35
|
}) => {
|
|
37
36
|
const [open, setOpen] = useState(false);
|
|
38
|
-
const
|
|
39
|
-
const [arrowElement, setArrowElement] = useState(null);
|
|
40
|
-
const [popperElement, setPopperElement] = useState(null);
|
|
37
|
+
const arrowRef = useRef(null);
|
|
41
38
|
const fallbackId = useId();
|
|
42
39
|
const tooltipId = id ?? fallbackId;
|
|
43
|
-
const modifiers = [];
|
|
44
|
-
modifiers.push({
|
|
45
|
-
name: 'arrow',
|
|
46
|
-
options: {
|
|
47
|
-
element: arrowElement,
|
|
48
|
-
options: {
|
|
49
|
-
padding: 8 // 8px from the edges of the popper
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
// This lets you displace a popper element from its reference element.
|
|
54
|
-
modifiers.push({
|
|
55
|
-
name: 'offset',
|
|
56
|
-
options: {
|
|
57
|
-
offset: [0, 16]
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
modifiers.push({
|
|
61
|
-
name: 'flip',
|
|
62
|
-
options: {
|
|
63
|
-
fallbackPlacements: Position.TOP
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
40
|
const {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
refs,
|
|
42
|
+
floatingStyles,
|
|
43
|
+
placement,
|
|
44
|
+
middlewareData
|
|
45
|
+
} = useFloating({
|
|
71
46
|
placement: position,
|
|
72
|
-
|
|
47
|
+
middleware: [offset(16), flip({
|
|
48
|
+
fallbackPlacements: [Position.TOP]
|
|
49
|
+
}), arrow({
|
|
50
|
+
element: arrowRef,
|
|
51
|
+
padding: 8
|
|
52
|
+
})],
|
|
53
|
+
whileElementsMounted: open ? autoUpdate : undefined,
|
|
54
|
+
open
|
|
73
55
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
56
|
+
const arrowStyle = {
|
|
57
|
+
...(middlewareData.arrow?.x != null ? {
|
|
58
|
+
left: middlewareData.arrow.x
|
|
59
|
+
} : {}),
|
|
60
|
+
...(middlewareData.arrow?.y != null ? {
|
|
61
|
+
top: middlewareData.arrow.y
|
|
62
|
+
} : {})
|
|
63
|
+
};
|
|
81
64
|
return /*#__PURE__*/jsxs("span", {
|
|
82
|
-
ref:
|
|
65
|
+
ref: refs.setReference,
|
|
83
66
|
className: "tw-tooltip-container",
|
|
84
67
|
onMouseOver: () => setOpen(true),
|
|
85
68
|
onFocus: () => setOpen(true),
|
|
@@ -88,23 +71,19 @@ const Tooltip = ({
|
|
|
88
71
|
children: [children ? /*#__PURE__*/cloneElement(children, {
|
|
89
72
|
'aria-describedby': `${tooltipId}-tooltip`
|
|
90
73
|
}) : null, /*#__PURE__*/jsx("div", {
|
|
91
|
-
|
|
92
|
-
ref: setPopperElement,
|
|
74
|
+
ref: refs.setFloating,
|
|
93
75
|
className: clsx('np-tooltip', 'np-panel', open ? `np-panel--open np-tooltip--open` : null, className),
|
|
94
|
-
style:
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
...attributes.popper,
|
|
76
|
+
style: floatingStyles,
|
|
77
|
+
"data-popper-placement": placement,
|
|
98
78
|
"aria-hidden": !open,
|
|
99
79
|
role: "tooltip",
|
|
100
80
|
id: `${tooltipId}-tooltip`,
|
|
101
81
|
children: /*#__PURE__*/jsxs("div", {
|
|
102
82
|
className: "np-panel__content tooltip-inner",
|
|
103
83
|
children: [label, /*#__PURE__*/jsx("div", {
|
|
104
|
-
|
|
105
|
-
ref: setArrowElement,
|
|
84
|
+
ref: arrowRef,
|
|
106
85
|
className: clsx('np-panel__arrow'),
|
|
107
|
-
style:
|
|
86
|
+
style: arrowStyle
|
|
108
87
|
})]
|
|
109
88
|
})
|
|
110
89
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.mjs","sources":["../../src/tooltip/Tooltip.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Tooltip.mjs","sources":["../../src/tooltip/Tooltip.tsx"],"sourcesContent":["import {\n arrow as arrowMiddleware,\n autoUpdate,\n flip,\n offset,\n useFloating,\n} from '@floating-ui/react';\nimport { clsx } from 'clsx';\nimport {\n AriaAttributes,\n CSSProperties,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n cloneElement,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { CommonProps, Position } from '../common';\nimport {\n PositionBottom,\n PositionLeft,\n PositionRight,\n PositionTop,\n} from '../common/propsValues/position';\n\nexport type TooltipProps = PropsWithChildren<{\n position?: PositionTop | PositionRight | PositionBottom | PositionLeft;\n label: ReactNode;\n id?: string;\n}> &\n CommonProps;\n\nconst Tooltip = ({\n position = Position.TOP,\n children = undefined,\n label,\n id,\n className,\n}: TooltipProps) => {\n const [open, setOpen] = useState(false);\n const arrowRef = useRef<HTMLDivElement | null>(null);\n\n const fallbackId = useId();\n const tooltipId = id ?? fallbackId;\n\n const { refs, floatingStyles, placement, middlewareData } = useFloating({\n placement: position,\n middleware: [\n offset(16),\n flip({ fallbackPlacements: [Position.TOP] }),\n arrowMiddleware({ element: arrowRef, padding: 8 }),\n ],\n whileElementsMounted: open ? autoUpdate : undefined,\n open,\n });\n\n const arrowStyle: CSSProperties = {\n ...(middlewareData.arrow?.x != null ? { left: middlewareData.arrow.x } : {}),\n ...(middlewareData.arrow?.y != null ? { top: middlewareData.arrow.y } : {}),\n };\n\n return (\n <span\n ref={refs.setReference}\n className=\"tw-tooltip-container\"\n onMouseOver={() => setOpen(true)}\n onFocus={() => setOpen(true)}\n onMouseOut={() => setOpen(false)}\n onBlur={() => setOpen(false)}\n >\n {children\n ? cloneElement(children as ReactElement<Pick<AriaAttributes, 'aria-describedby'>>, {\n 'aria-describedby': `${tooltipId}-tooltip`,\n })\n : null}\n <div\n ref={refs.setFloating}\n className={clsx(\n 'np-tooltip',\n 'np-panel',\n open ? `np-panel--open np-tooltip--open` : null,\n className,\n )}\n style={floatingStyles}\n data-popper-placement={placement}\n aria-hidden={!open}\n role=\"tooltip\"\n id={`${tooltipId}-tooltip`}\n >\n <div className=\"np-panel__content tooltip-inner\">\n {label}\n <div ref={arrowRef} className={clsx('np-panel__arrow')} style={arrowStyle} />\n </div>\n </div>\n </span>\n );\n};\n\nexport default Tooltip;\n"],"names":["Tooltip","position","Position","TOP","children","undefined","label","id","className","open","setOpen","useState","arrowRef","useRef","fallbackId","useId","tooltipId","refs","floatingStyles","placement","middlewareData","useFloating","middleware","offset","flip","fallbackPlacements","arrowMiddleware","element","padding","whileElementsMounted","autoUpdate","arrowStyle","arrow","x","left","y","top","_jsxs","ref","setReference","onMouseOver","onFocus","onMouseOut","onBlur","cloneElement","_jsx","setFloating","clsx","style","role"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAMA,OAAO,GAAGA,CAAC;EACfC,QAAQ,GAAGC,QAAQ,CAACC,GAAG;AACvBC,EAAAA,QAAQ,GAAGC,SAAS;EACpBC,KAAK;EACLC,EAAE;AACFC,EAAAA;AAAS,CACI,KAAI;EACjB,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,QAAQ,CAAC,KAAK,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AQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC1D,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAW,EACX,IAAe,EACf,IAAI,GACL,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"BadgeAssets.d.ts","sourceRoot":"","sources":["../../../src/badge/BadgeAssets.tsx"],"names":[],"mappings":"AAEA,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC1D,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAW,EACX,IAAe,EACf,IAAI,GACL,EAAE,KAAK,sCAqCP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../src/common/panel/Panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../src/common/panel/Panel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAY,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAgBxF,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,WAAW,CAAC;IACvE,SAAS,EAAE,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC,GACA,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,QAAA,MAAM,KAAK;YAZD,OAAO;WACR,OAAO;cACJ,OAAO;WACV,OAAO;cACJ,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,KAAK,IAAI;eACtC,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,WAAW;eAC3D,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC;kBAC7B,OAAO;qBACJ,OAAO;;;mFAiGxB,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAQA,OAAO,EAGL,iBAAiB,EAEjB,SAAS,EAKV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAY,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC3C,QAAQ,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,YAAY,CAAC;IACvE,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC,GACA,WAAW,CAAC;AAEd,QAAA,MAAM,OAAO,GAAI,+CAMd,YAAY,gCA0Dd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.135.
|
|
3
|
+
"version": "46.135.2",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
50
50
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
51
51
|
"@rollup/plugin-url": "^8.0.2",
|
|
52
|
-
"@storybook/addon-a11y": "^10.3.
|
|
53
|
-
"@storybook/addon-docs": "^10.3.
|
|
52
|
+
"@storybook/addon-a11y": "^10.3.5",
|
|
53
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
54
54
|
"@storybook/addon-mcp": "^0.4.1",
|
|
55
55
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
|
|
56
|
-
"@storybook/react-webpack5": "^10.3.
|
|
56
|
+
"@storybook/react-webpack5": "^10.3.5",
|
|
57
57
|
"@testing-library/dom": "^10.4.1",
|
|
58
58
|
"@testing-library/jest-dom": "^6.9.1",
|
|
59
59
|
"@testing-library/react": "^16.3.2",
|
|
60
60
|
"@testing-library/user-event": "^14.6.1",
|
|
61
|
-
"@transferwise/icons": "^4.
|
|
61
|
+
"@transferwise/icons": "^4.4.3",
|
|
62
62
|
"@tsconfig/recommended": "^1.0.13",
|
|
63
63
|
"@types/babel__core": "^7.20.5",
|
|
64
64
|
"@types/commonmark": "^0.27.10",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"@types/react": "^18.3.28",
|
|
70
70
|
"@types/react-dom": "^18.3.7",
|
|
71
71
|
"@types/react-transition-group": "4.4.12",
|
|
72
|
-
"@wise/art": "^2.
|
|
72
|
+
"@wise/art": "^2.30.1",
|
|
73
73
|
"@wise/eslint-config": "^13.3.0",
|
|
74
74
|
"babel-plugin-formatjs": "^10.5.41",
|
|
75
75
|
"eslint": "^9.39.4",
|
|
76
|
-
"eslint-plugin-storybook": "^10.3.
|
|
76
|
+
"eslint-plugin-storybook": "^10.3.5",
|
|
77
77
|
"gulp": "^5.0.1",
|
|
78
78
|
"jest": "^30.3.0",
|
|
79
79
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react-intl": "^7.1.14",
|
|
84
84
|
"rollup": "^4.60.1",
|
|
85
85
|
"rollup-preserve-directives": "^1.1.3",
|
|
86
|
-
"storybook": "^10.3.
|
|
86
|
+
"storybook": "^10.3.5",
|
|
87
87
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
88
88
|
"storybook-addon-test-codegen": "^3.0.1",
|
|
89
89
|
"@transferwise/less-config": "3.1.2",
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@babel/runtime": "^7.29.2",
|
|
105
105
|
"@floating-ui/react": "^0.27.19",
|
|
106
|
-
"@headlessui/react": "^2.2.
|
|
107
|
-
"@popperjs/core": "^2.11.8",
|
|
106
|
+
"@headlessui/react": "^2.2.10",
|
|
108
107
|
"@react-aria/focus": "^3.21.5",
|
|
109
108
|
"@react-aria/overlays": "^3.31.2",
|
|
110
109
|
"@transferwise/formatting": "^2.14.0",
|
|
110
|
+
"@transferwise/neptune-tokens": "^8.21.0",
|
|
111
111
|
"@transferwise/neptune-validation": "^3.3.3",
|
|
112
112
|
"clsx": "^2.1.1",
|
|
113
113
|
"commonmark": "^0.31.2",
|
|
@@ -116,10 +116,8 @@
|
|
|
116
116
|
"lodash.clamp": "^4.0.3",
|
|
117
117
|
"lodash.debounce": "^4.0.8",
|
|
118
118
|
"merge-props": "^6.0.0",
|
|
119
|
-
"react-popper": "^2.3.0",
|
|
120
119
|
"react-transition-group": "^4.4.5",
|
|
121
|
-
"virtua": "^0.48.8"
|
|
122
|
-
"@transferwise/neptune-tokens": "^8.20.3"
|
|
120
|
+
"virtua": "^0.48.8"
|
|
123
121
|
},
|
|
124
122
|
"publishConfig": {
|
|
125
123
|
"access": "public",
|
|
@@ -207,7 +207,7 @@ export const Badge: Story = {
|
|
|
207
207
|
className="d-flex align-items-center justify-content-center"
|
|
208
208
|
style={{
|
|
209
209
|
backgroundColor: 'var(--color-bright-pink)',
|
|
210
|
-
color: 'var(--color-
|
|
210
|
+
color: 'var(--color-dark-maroon)',
|
|
211
211
|
width: '100%',
|
|
212
212
|
height: '100%',
|
|
213
213
|
}}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Camera,
|
|
4
|
+
Convert,
|
|
5
|
+
FastFlag,
|
|
6
|
+
Graph,
|
|
7
|
+
Leaf,
|
|
8
|
+
Money,
|
|
9
|
+
PlusCircle,
|
|
10
|
+
Rewards,
|
|
11
|
+
} from '@transferwise/icons';
|
|
3
12
|
import AvatarView from '.';
|
|
4
13
|
import { getBrandColorFromSeed, getInitials, ProfileType } from '../common';
|
|
5
14
|
import Display from '../display';
|
|
15
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
6
16
|
|
|
7
17
|
const meta: Meta<typeof AvatarView> = {
|
|
8
18
|
component: AvatarView,
|
|
@@ -112,3 +122,100 @@ export const ProfileBrokenImageFallback: Story = {
|
|
|
112
122
|
);
|
|
113
123
|
},
|
|
114
124
|
};
|
|
125
|
+
|
|
126
|
+
/** Badge types across default and dark themes to verify icon color visibility. */
|
|
127
|
+
export const BadgeVariants: Story = {
|
|
128
|
+
render: function Render() {
|
|
129
|
+
return (
|
|
130
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
131
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
132
|
+
<AvatarView size={32} badge={{ type: 'action' }}>
|
|
133
|
+
<Money />
|
|
134
|
+
</AvatarView>
|
|
135
|
+
<AvatarView size={48} badge={{ type: 'action' }}>
|
|
136
|
+
<Money />
|
|
137
|
+
</AvatarView>
|
|
138
|
+
<AvatarView size={32} badge={{ type: 'action', icon: <Camera /> }}>
|
|
139
|
+
<Money />
|
|
140
|
+
</AvatarView>
|
|
141
|
+
<AvatarView
|
|
142
|
+
size={48}
|
|
143
|
+
imgSrc="../avatar-square-dude.webp"
|
|
144
|
+
badge={{ type: 'action', icon: <Camera /> }}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
148
|
+
<AvatarView size={32} badge={{ type: 'reference' }}>
|
|
149
|
+
<Money />
|
|
150
|
+
</AvatarView>
|
|
151
|
+
<AvatarView size={48} badge={{ type: 'reference' }}>
|
|
152
|
+
<Money />
|
|
153
|
+
</AvatarView>
|
|
154
|
+
<AvatarView size={32} badge={{ type: 'reference', icon: <Convert /> }}>
|
|
155
|
+
<Money />
|
|
156
|
+
</AvatarView>
|
|
157
|
+
<AvatarView
|
|
158
|
+
size={48}
|
|
159
|
+
imgSrc="../avatar-square-dude.webp"
|
|
160
|
+
badge={{ type: 'reference', icon: <Convert /> }}
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
164
|
+
<AvatarView size={32} badge={{ icon: <FastFlag /> }}>
|
|
165
|
+
<Money />
|
|
166
|
+
</AvatarView>
|
|
167
|
+
<AvatarView size={48} badge={{ icon: <FastFlag /> }}>
|
|
168
|
+
<Money />
|
|
169
|
+
</AvatarView>
|
|
170
|
+
<AvatarView size={32} badge={{ status: 'warning' }}>
|
|
171
|
+
<Money />
|
|
172
|
+
</AvatarView>
|
|
173
|
+
<AvatarView size={48} badge={{ status: 'negative' }}>
|
|
174
|
+
<Money />
|
|
175
|
+
</AvatarView>
|
|
176
|
+
</div>
|
|
177
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
178
|
+
<AvatarView
|
|
179
|
+
size={32}
|
|
180
|
+
imgSrc="../avatar-square-dude.webp"
|
|
181
|
+
badge={{
|
|
182
|
+
asset: (
|
|
183
|
+
<div
|
|
184
|
+
className="d-flex align-items-center justify-content-center"
|
|
185
|
+
style={{
|
|
186
|
+
backgroundColor: 'var(--color-bright-pink)',
|
|
187
|
+
color: 'var(--color-dark-maroon)',
|
|
188
|
+
width: '100%',
|
|
189
|
+
height: '100%',
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
192
|
+
<Leaf />
|
|
193
|
+
</div>
|
|
194
|
+
),
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
<AvatarView
|
|
198
|
+
size={48}
|
|
199
|
+
imgSrc="../avatar-square-dude.webp"
|
|
200
|
+
badge={{
|
|
201
|
+
asset: (
|
|
202
|
+
<div
|
|
203
|
+
className="d-flex align-items-center justify-content-center"
|
|
204
|
+
style={{
|
|
205
|
+
backgroundColor: 'var(--color-bright-pink)',
|
|
206
|
+
color: 'var(--color-dark-maroon)',
|
|
207
|
+
width: '100%',
|
|
208
|
+
height: '100%',
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
<Leaf />
|
|
212
|
+
</div>
|
|
213
|
+
),
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
);
|
|
219
|
+
},
|
|
220
|
+
...withVariantConfig(['default', 'dark']),
|
|
221
|
+
};
|
|
@@ -51,6 +51,8 @@ export default function BadgeAssets({
|
|
|
51
51
|
type === 'action'
|
|
52
52
|
? 'var(--color-interactive-accent)'
|
|
53
53
|
: 'var(--color-background-neutral)',
|
|
54
|
+
color:
|
|
55
|
+
type === 'action' ? 'var(--color-interactive-control)' : 'var(--color-content-primary)',
|
|
54
56
|
}}
|
|
55
57
|
>
|
|
56
58
|
{icon ?? <Plus />}
|