@transferwise/components 0.0.0-experimental-06b4575 → 0.0.0-experimental-7fec974
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/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
- package/build/field/Field.js +1 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +1 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/header/Header.js +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/TextArea.js.map +1 -1
- package/build/inputs/TextArea.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +31 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/styles/main.css +31 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs.map +1 -1
- package/build/tabs/Tabs.js +1 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +1 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +1 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts.map +1 -1
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +56 -0
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
- package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
- package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts.map +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
- package/build/types/table/TableCell.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +1 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +3 -3
- package/src/actionButton/ActionButton.story.tsx +9 -2
- package/src/avatar/Avatar.story.tsx +8 -2
- package/src/avatarLayout/AvatarLayout.story.tsx +3 -3
- package/src/avatarView/AvatarView.story.tsx +29 -24
- package/src/button/_stories/Button.test.story.tsx +10 -5
- package/src/checkbox/Checkbox.story.tsx +16 -3
- package/src/circularButton/CircularButton.story.tsx +7 -2
- package/src/common/bottomSheet/BottomSheet.story.tsx +32 -6
- package/src/common/circle/Circle.story.tsx +14 -3
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +16 -3
- package/src/dateInput/DateInput.test.story.tsx +13 -3
- package/src/dateLookup/DateLookup.story.tsx +7 -9
- package/src/dateLookup/monthCalendar/table/MonthCalendarTable.tsx +1 -5
- package/src/dateLookup/yearCalendar/table/YearCalendarTable.tsx +1 -1
- package/src/header/Header.test.story.tsx +10 -5
- package/src/header/Header.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/info/Info.story.tsx +20 -4
- package/src/inputs/Input.tsx +8 -9
- package/src/inputs/SearchInput.tsx +8 -9
- package/src/inputs/TextArea.tsx +6 -7
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +7 -2
- package/src/main.css +31 -0
- package/src/main.less +2 -1
- package/src/modal/Modal.story.tsx +31 -6
- package/src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts +1 -3
- package/src/primitives/PrimitiveButton/PrimitiveButton.types.ts +1 -3
- package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +7 -2
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +2 -7
- package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
- package/src/prompt/InfoPrompt/index.ts +2 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +5 -5
- package/src/prompt/index.ts +5 -0
- package/src/radioOption/RadioOption.tsx +2 -1
- package/src/select/Select.story.tsx +1 -1
- package/src/slidingPanel/SlidingPanel.tsx +4 -2
- package/src/snackbar/Snackbar.test.story.tsx +32 -6
- package/src/ssr.test.tsx +1 -0
- package/src/statusIcon/StatusIcon.story.tsx +9 -5
- package/src/table/TableCell.tsx +1 -3
- package/src/tabs/Tabs.tsx +1 -1
- package/src/tooltip/Tooltip.story.tsx +7 -2
- package/src/uploadInput/UploadInput.tsx +1 -1
- package/src/withDisplayFormat/WithDisplayFormat.tsx +13 -14
package/build/main.css
CHANGED
|
@@ -5441,6 +5441,37 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5441
5441
|
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5442
5442
|
stroke: currentColor;
|
|
5443
5443
|
}
|
|
5444
|
+
.wds-info-prompt {
|
|
5445
|
+
--Prompt-gap: var(--size-8);
|
|
5446
|
+
--Prompt-padding: 12px;
|
|
5447
|
+
}
|
|
5448
|
+
.wds-info-prompt__content {
|
|
5449
|
+
display: flex;
|
|
5450
|
+
flex-direction: column;
|
|
5451
|
+
justify-content: center;
|
|
5452
|
+
}
|
|
5453
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
5454
|
+
justify-content: flex-start;
|
|
5455
|
+
/* Top align when title exists */
|
|
5456
|
+
}
|
|
5457
|
+
.wds-info-prompt__title,
|
|
5458
|
+
.wds-info-prompt__description {
|
|
5459
|
+
display: block;
|
|
5460
|
+
color: var(--color-sentiment-primary);
|
|
5461
|
+
}
|
|
5462
|
+
.wds-info-prompt__action {
|
|
5463
|
+
margin-top: var(--Prompt-gap);
|
|
5464
|
+
}
|
|
5465
|
+
.wds-info-prompt__media {
|
|
5466
|
+
display: flex;
|
|
5467
|
+
}
|
|
5468
|
+
.wds-info-prompt__media svg {
|
|
5469
|
+
width: 24px;
|
|
5470
|
+
height: 24px;
|
|
5471
|
+
}
|
|
5472
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
5473
|
+
padding: 0;
|
|
5474
|
+
}
|
|
5444
5475
|
.wds-radio-group .np-radio:last-child label {
|
|
5445
5476
|
margin-bottom: 0;
|
|
5446
5477
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
require('../../common/theme.js');
|
|
5
|
+
require('../../common/direction.js');
|
|
6
|
+
require('../../common/propsValues/control.js');
|
|
7
|
+
require('../../common/propsValues/breakpoint.js');
|
|
8
|
+
require('../../common/propsValues/size.js');
|
|
9
|
+
var typography = require('../../common/propsValues/typography.js');
|
|
10
|
+
require('../../common/propsValues/width.js');
|
|
11
|
+
require('../../common/propsValues/type.js');
|
|
12
|
+
require('../../common/propsValues/dateMode.js');
|
|
13
|
+
require('../../common/propsValues/monthFormat.js');
|
|
14
|
+
require('../../common/propsValues/position.js');
|
|
15
|
+
require('../../common/propsValues/layouts.js');
|
|
16
|
+
require('../../common/propsValues/status.js');
|
|
17
|
+
var sentiment = require('../../common/propsValues/sentiment.js');
|
|
18
|
+
require('../../common/propsValues/profileType.js');
|
|
19
|
+
require('../../common/propsValues/variant.js');
|
|
20
|
+
require('../../common/propsValues/scroll.js');
|
|
21
|
+
require('../../common/propsValues/markdownNodeType.js');
|
|
22
|
+
require('../../common/fileType.js');
|
|
23
|
+
var icons = require('@transferwise/icons');
|
|
24
|
+
var clsx = require('clsx');
|
|
25
|
+
require('react-intl');
|
|
26
|
+
require('../../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
29
|
+
var Body = require('../../body/Body.js');
|
|
30
|
+
var Link = require('../../link/Link.js');
|
|
31
|
+
var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');
|
|
32
|
+
|
|
33
|
+
const InfoPrompt = ({
|
|
34
|
+
sentiment: sentiment$1 = 'neutral',
|
|
35
|
+
onDismiss,
|
|
36
|
+
media,
|
|
37
|
+
action,
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
className,
|
|
41
|
+
'data-testid': dataTestId,
|
|
42
|
+
...restProps
|
|
43
|
+
}) => {
|
|
44
|
+
const [shouldFire, setShouldFire] = React.useState();
|
|
45
|
+
const statusIconSentiment = sentiment$1 === 'success' ? sentiment.Sentiment.POSITIVE : sentiment$1;
|
|
46
|
+
const handleTouchStart = () => {
|
|
47
|
+
setShouldFire(true);
|
|
48
|
+
};
|
|
49
|
+
const handleTouchEnd = () => {
|
|
50
|
+
if (shouldFire && action?.href) {
|
|
51
|
+
if (action.target === '_blank') {
|
|
52
|
+
window.top?.open(action.href, '_blank', 'noopener, noreferrer');
|
|
53
|
+
} else {
|
|
54
|
+
window.top?.location.assign(action.href);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
setShouldFire(false);
|
|
58
|
+
};
|
|
59
|
+
const handleTouchMove = () => {
|
|
60
|
+
setShouldFire(false);
|
|
61
|
+
};
|
|
62
|
+
const renderMedia = () => {
|
|
63
|
+
if (media) {
|
|
64
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
65
|
+
className: "wds-info-prompt__media",
|
|
66
|
+
children: media.asset
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (sentiment$1 === 'proposition') {
|
|
70
|
+
return /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {
|
|
71
|
+
size: 24
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
|
|
75
|
+
size: 24,
|
|
76
|
+
sentiment: statusIconSentiment
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/jsxRuntime.jsx(PrimitivePrompt.PrimitivePrompt, {
|
|
80
|
+
sentiment: sentiment$1,
|
|
81
|
+
media: renderMedia(),
|
|
82
|
+
"data-testid": dataTestId,
|
|
83
|
+
className: clsx.clsx('wds-info-prompt', className),
|
|
84
|
+
...restProps,
|
|
85
|
+
onTouchStart: handleTouchStart,
|
|
86
|
+
onTouchEnd: handleTouchEnd,
|
|
87
|
+
onTouchMove: handleTouchMove,
|
|
88
|
+
onDismiss: onDismiss,
|
|
89
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
90
|
+
className: "wds-info-prompt__content",
|
|
91
|
+
children: [title && /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
92
|
+
className: "wds-info-prompt__title",
|
|
93
|
+
type: typography.Typography.BODY_LARGE_BOLD,
|
|
94
|
+
as: "span",
|
|
95
|
+
children: title
|
|
96
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
97
|
+
as: "span",
|
|
98
|
+
className: "wds-info-prompt__description",
|
|
99
|
+
children: description
|
|
100
|
+
}), action && /*#__PURE__*/jsxRuntime.jsx(Link.default, {
|
|
101
|
+
href: action.href,
|
|
102
|
+
target: action.target,
|
|
103
|
+
type: typography.Typography.LINK_DEFAULT,
|
|
104
|
+
className: "wds-info-prompt__action",
|
|
105
|
+
onClick: action.onClick,
|
|
106
|
+
children: action.label
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.InfoPrompt = InfoPrompt;
|
|
113
|
+
//# sourceMappingURL=InfoPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoPrompt.js","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { Sentiment, Typography } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label)\n * if it conveys meaning, or aria-hidden=\"true\" if decorative.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n };\n\n/**\n * InfoPrompt displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated Alert component.\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return <GiftBox size={24} />;\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n return (\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","dataTestId","restProps","shouldFire","setShouldFire","useState","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","size","StatusIcon","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,aAAAA,WAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;AACT,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAQ,EAAW;EACvD,MAAMC,mBAAmB,GACvBZ,WAAS,KAAK,SAAS,GACnBa,mBAAS,CAACC,QAAQ,GACjBd,WAAsD;EAE7D,MAAMe,gBAAgB,GAAGA,MAAK;IAC5BL,aAAa,CAAC,IAAI,CAAC;EACrB,CAAC;EAED,MAAMM,cAAc,GAAGA,MAAK;AAC1B,IAAA,IAAIP,UAAU,IAAIN,MAAM,EAAEc,IAAI,EAAE;AAC9B,MAAA,IAAId,MAAM,CAACe,MAAM,KAAK,QAAQ,EAAE;AAC9BC,QAAAA,MAAM,CAACC,GAAG,EAAEC,IAAI,CAAClB,MAAM,CAACc,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAC;AACjE,MAAA,CAAC,MAAM;QACLE,MAAM,CAACC,GAAG,EAAEE,QAAQ,CAACC,MAAM,CAACpB,MAAM,CAACc,IAAI,CAAC;AAC1C,MAAA;AACF,IAAA;I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EAAC,MAAM;AAAAf,QAAAA,QAAA,EACjFvB;AAAK,OACF,CACP,eACDsB,cAAA,CAACY,YAAI,EAAA;AAACI,QAAAA,EAAE,EAAC,MAAM;AAACpC,QAAAA,SAAS,EAAC,8BAA8B;AAAAqB,QAAAA,QAAA,EACrDtB;AAAW,OACR,CACN,EAACF,MAAM,iBACLuB,cAAA,CAACiB,YAAI,EAAA;QACH1B,IAAI,EAAEd,MAAM,CAACc,IAAK;QAClBC,MAAM,EAAEf,MAAM,CAACe,MAAO;QACtBqB,IAAI,EAAEC,qBAAU,CAACI,YAAa;AAC9BtC,QAAAA,SAAS,EAAC,yBAAyB;QACnCuC,OAAO,EAAE1C,MAAM,CAAC0C,OAAQ;QAAAlB,QAAA,EAEvBxB,MAAM,CAAC2C;AAAK,OACT,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import '../../common/theme.mjs';
|
|
3
|
+
import '../../common/direction.mjs';
|
|
4
|
+
import '../../common/propsValues/control.mjs';
|
|
5
|
+
import '../../common/propsValues/breakpoint.mjs';
|
|
6
|
+
import '../../common/propsValues/size.mjs';
|
|
7
|
+
import { Typography } from '../../common/propsValues/typography.mjs';
|
|
8
|
+
import '../../common/propsValues/width.mjs';
|
|
9
|
+
import '../../common/propsValues/type.mjs';
|
|
10
|
+
import '../../common/propsValues/dateMode.mjs';
|
|
11
|
+
import '../../common/propsValues/monthFormat.mjs';
|
|
12
|
+
import '../../common/propsValues/position.mjs';
|
|
13
|
+
import '../../common/propsValues/layouts.mjs';
|
|
14
|
+
import '../../common/propsValues/status.mjs';
|
|
15
|
+
import { Sentiment } from '../../common/propsValues/sentiment.mjs';
|
|
16
|
+
import '../../common/propsValues/profileType.mjs';
|
|
17
|
+
import '../../common/propsValues/variant.mjs';
|
|
18
|
+
import '../../common/propsValues/scroll.mjs';
|
|
19
|
+
import '../../common/propsValues/markdownNodeType.mjs';
|
|
20
|
+
import '../../common/fileType.mjs';
|
|
21
|
+
import { GiftBox } from '@transferwise/icons';
|
|
22
|
+
import { clsx } from 'clsx';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
26
|
+
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
27
|
+
import Body from '../../body/Body.mjs';
|
|
28
|
+
import Link from '../../link/Link.mjs';
|
|
29
|
+
import { PrimitivePrompt } from '../PrimitivePrompt/PrimitivePrompt.mjs';
|
|
30
|
+
|
|
31
|
+
const InfoPrompt = ({
|
|
32
|
+
sentiment = 'neutral',
|
|
33
|
+
onDismiss,
|
|
34
|
+
media,
|
|
35
|
+
action,
|
|
36
|
+
title,
|
|
37
|
+
description,
|
|
38
|
+
className,
|
|
39
|
+
'data-testid': dataTestId,
|
|
40
|
+
...restProps
|
|
41
|
+
}) => {
|
|
42
|
+
const [shouldFire, setShouldFire] = useState();
|
|
43
|
+
const statusIconSentiment = sentiment === 'success' ? Sentiment.POSITIVE : sentiment;
|
|
44
|
+
const handleTouchStart = () => {
|
|
45
|
+
setShouldFire(true);
|
|
46
|
+
};
|
|
47
|
+
const handleTouchEnd = () => {
|
|
48
|
+
if (shouldFire && action?.href) {
|
|
49
|
+
if (action.target === '_blank') {
|
|
50
|
+
window.top?.open(action.href, '_blank', 'noopener, noreferrer');
|
|
51
|
+
} else {
|
|
52
|
+
window.top?.location.assign(action.href);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
setShouldFire(false);
|
|
56
|
+
};
|
|
57
|
+
const handleTouchMove = () => {
|
|
58
|
+
setShouldFire(false);
|
|
59
|
+
};
|
|
60
|
+
const renderMedia = () => {
|
|
61
|
+
if (media) {
|
|
62
|
+
return /*#__PURE__*/jsx("span", {
|
|
63
|
+
className: "wds-info-prompt__media",
|
|
64
|
+
children: media.asset
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (sentiment === 'proposition') {
|
|
68
|
+
return /*#__PURE__*/jsx(GiftBox, {
|
|
69
|
+
size: 24
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/jsx(StatusIcon, {
|
|
73
|
+
size: 24,
|
|
74
|
+
sentiment: statusIconSentiment
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/jsx(PrimitivePrompt, {
|
|
78
|
+
sentiment: sentiment,
|
|
79
|
+
media: renderMedia(),
|
|
80
|
+
"data-testid": dataTestId,
|
|
81
|
+
className: clsx('wds-info-prompt', className),
|
|
82
|
+
...restProps,
|
|
83
|
+
onTouchStart: handleTouchStart,
|
|
84
|
+
onTouchEnd: handleTouchEnd,
|
|
85
|
+
onTouchMove: handleTouchMove,
|
|
86
|
+
onDismiss: onDismiss,
|
|
87
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
88
|
+
className: "wds-info-prompt__content",
|
|
89
|
+
children: [title && /*#__PURE__*/jsx(Body, {
|
|
90
|
+
className: "wds-info-prompt__title",
|
|
91
|
+
type: Typography.BODY_LARGE_BOLD,
|
|
92
|
+
as: "span",
|
|
93
|
+
children: title
|
|
94
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
95
|
+
as: "span",
|
|
96
|
+
className: "wds-info-prompt__description",
|
|
97
|
+
children: description
|
|
98
|
+
}), action && /*#__PURE__*/jsx(Link, {
|
|
99
|
+
href: action.href,
|
|
100
|
+
target: action.target,
|
|
101
|
+
type: Typography.LINK_DEFAULT,
|
|
102
|
+
className: "wds-info-prompt__action",
|
|
103
|
+
onClick: action.onClick,
|
|
104
|
+
children: action.label
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { InfoPrompt };
|
|
111
|
+
//# sourceMappingURL=InfoPrompt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoPrompt.mjs","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { Sentiment, Typography } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label)\n * if it conveys meaning, or aria-hidden=\"true\" if decorative.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n };\n\n/**\n * InfoPrompt displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated Alert component.\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return <GiftBox size={24} />;\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n return (\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","dataTestId","restProps","shouldFire","setShouldFire","useState","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","size","StatusIcon","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick","label"],"mappings":";;;;;;;;;;;;;;;;;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CuC,OAAO,EAAE1C,MAAM,CAAC0C,OAAQ;QAAAlB,QAAA,EAEvBxB,MAAM,CAAC2C;AAAK,OACT,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;;;AAmCO,MAAMA,eAAe,GAAGA,CAAC;AAC9BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACS,KAAI;AACzB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,oBACEC,cAAA,CAACC,wBAAgB,EAAA;AACfV,IAAAA,SAAS,EAAEA,SAAU;IACrBI,SAAS,EAAEO,SAAI,CAAC,YAAY,EAAE,eAAeX,SAAS,CAAA,CAAE,EAAEI,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbO,eAAA,CAAA,KAAA,EAAA;AACER,MAAAA,SAAS,EAAEO,SAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACR;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHI,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAEO,SAAI,CAAC,2BAA2B,CAAE;AAAAN,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRM,cAAA,CAACI,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,4BAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEhB,SAAU;AAAAE,QAAAA,QAAA,eAEnBI,cAAA,CAACW,WAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAlB,OAAO,iBAAIO,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;AAmCO,MAAMA,eAAe,GAAGA,CAAC;AAC9BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACS,KAAI;AACzB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EAEtB,oBACEC,GAAA,CAACC,gBAAgB,EAAA;AACfV,IAAAA,SAAS,EAAEA,SAAU;IACrBI,SAAS,EAAEO,IAAI,CAAC,YAAY,EAAE,eAAeX,SAAS,CAAA,CAAE,EAAEI,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbO,IAAA,CAAA,KAAA,EAAA;AACER,MAAAA,SAAS,EAAEO,IAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACR;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHI,GAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAEO,IAAI,CAAC,2BAA2B,CAAE;AAAAN,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRM,GAAA,CAACI,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,gBAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEhB,SAAU;AAAAE,QAAAA,QAAA,eAEnBI,GAAA,CAACW,KAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAlB,OAAO,iBAAIO,GAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioOption.js","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends
|
|
1
|
+
{"version":3,"file":"RadioOption.js","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends\n Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;;;;;AA0BA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AAAkB,CACE,EAAA;EACpB,oBACEC,cAAA,CAACC,cAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,cAAA,CAACG,mBAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAAS;AAEtB,GAAA,CACD;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioOption.mjs","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends
|
|
1
|
+
{"version":3,"file":"RadioOption.mjs","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends\n Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;AA0BA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AAAkB,CACE,EAAA;EACpB,oBACEC,GAAA,CAACC,MAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,GAAA,CAACG,WAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAAS;AAEtB,GAAA,CACD;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlidingPanel.js","sources":["../../src/slidingPanel/SlidingPanel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { Position } from '../common';\n\nexport const EXIT_ANIMATION = 350;\n\nexport interface SlidingPanelProps
|
|
1
|
+
{"version":3,"file":"SlidingPanel.js","sources":["../../src/slidingPanel/SlidingPanel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { Position } from '../common';\n\nexport const EXIT_ANIMATION = 350;\n\nexport interface SlidingPanelProps extends Pick<\n React.ComponentPropsWithRef<'div'>,\n 'ref' | 'className' | 'children'\n> {\n position?: `${Position.TOP | Position.RIGHT | Position.BOTTOM | Position.LEFT}`;\n open: boolean;\n showSlidingPanelBorder?: boolean;\n slidingPanelPositionFixed?: boolean;\n testId?: string;\n}\n\nconst SlidingPanel = forwardRef(\n (\n {\n position = 'left',\n open,\n showSlidingPanelBorder,\n slidingPanelPositionFixed,\n className,\n children,\n testId,\n ...rest\n }: Omit<SlidingPanelProps, 'ref'>,\n reference: React.ForwardedRef<HTMLDivElement | null>,\n ) => {\n const localReference = useRef<HTMLDivElement>(null as never);\n useImperativeHandle(reference, () => localReference.current, []);\n\n return (\n <CSSTransition\n {...rest}\n key={`sliding-panel--open-${position}`}\n nodeRef={localReference}\n in={open}\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames=\"sliding-panel\"\n appear\n unmountOnExit\n >\n <div\n ref={localReference}\n data-testid={testId}\n className={clsx(\n 'sliding-panel',\n `sliding-panel--open-${position}`,\n showSlidingPanelBorder && `sliding-panel--border-${position}`,\n slidingPanelPositionFixed && 'sliding-panel--fixed',\n className,\n )}\n >\n {children}\n </div>\n </CSSTransition>\n );\n },\n);\n\nexport default SlidingPanel;\n"],"names":["EXIT_ANIMATION","SlidingPanel","forwardRef","position","open","showSlidingPanelBorder","slidingPanelPositionFixed","className","children","testId","rest","reference","localReference","useRef","useImperativeHandle","current","_createElement","CSSTransition","key","nodeRef","in","timeout","enter","exit","classNames","appear","unmountOnExit","_jsx","ref","clsx"],"mappings":";;;;;;;;;AAMO,MAAMA,cAAc,GAAG;AAa9B,MAAMC,YAAY,gBAAGC,gBAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,IAAI;EACJC,sBAAsB;EACtBC,yBAAyB;EACzBC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACN,GAAGC;AAAI,CACwB,EACjCC,SAAoD,KAClD;AACF,EAAA,MAAMC,cAAc,GAAGC,YAAM,CAAiB,IAAa,CAAC;EAC5DC,yBAAmB,CAACH,SAAS,EAAE,MAAMC,cAAc,CAACG,OAAO,EAAE,EAAE,CAAC;EAEhE,oBACEC,mBAAA,CAACC,kCAAa,EAAA;AAAA,IAAA,GACRP,IAAI;IACRQ,GAAG,EAAE,CAAA,oBAAA,EAAuBf,QAAQ,CAAA,CAAG;AACvCgB,IAAAA,OAAO,EAAEP,cAAe;AACxBQ,IAAAA,EAAE,EAAEhB;AACJ;AAAA;AACAiB,IAAAA,OAAO,EAAE;AAAEC,MAAAA,KAAK,EAAE,CAAC;AAAEC,MAAAA,IAAI,EAAEvB;KAAiB;AAC5CwB,IAAAA,UAAU,EAAC,eAAe;IAC1BC,MAAM,EAAA,IAAA;IACNC,aAAa,EAAA;AAAA,GAAA,eAEbC,cAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAEhB,cAAe;AACpB,IAAA,aAAA,EAAaH,MAAO;IACpBF,SAAS,EAAEsB,SAAI,CACb,eAAe,EACf,CAAA,oBAAA,EAAuB1B,QAAQ,EAAE,EACjCE,sBAAsB,IAAI,CAAA,sBAAA,EAAyBF,QAAQ,EAAE,EAC7DG,yBAAyB,IAAI,sBAAsB,EACnDC,SAAS,CACT;AAAAC,IAAAA,QAAA,EAEDA;AAAQ,GACN,CACQ,CAAC;AAEpB,CAAC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlidingPanel.mjs","sources":["../../src/slidingPanel/SlidingPanel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { Position } from '../common';\n\nexport const EXIT_ANIMATION = 350;\n\nexport interface SlidingPanelProps
|
|
1
|
+
{"version":3,"file":"SlidingPanel.mjs","sources":["../../src/slidingPanel/SlidingPanel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { Position } from '../common';\n\nexport const EXIT_ANIMATION = 350;\n\nexport interface SlidingPanelProps extends Pick<\n React.ComponentPropsWithRef<'div'>,\n 'ref' | 'className' | 'children'\n> {\n position?: `${Position.TOP | Position.RIGHT | Position.BOTTOM | Position.LEFT}`;\n open: boolean;\n showSlidingPanelBorder?: boolean;\n slidingPanelPositionFixed?: boolean;\n testId?: string;\n}\n\nconst SlidingPanel = forwardRef(\n (\n {\n position = 'left',\n open,\n showSlidingPanelBorder,\n slidingPanelPositionFixed,\n className,\n children,\n testId,\n ...rest\n }: Omit<SlidingPanelProps, 'ref'>,\n reference: React.ForwardedRef<HTMLDivElement | null>,\n ) => {\n const localReference = useRef<HTMLDivElement>(null as never);\n useImperativeHandle(reference, () => localReference.current, []);\n\n return (\n <CSSTransition\n {...rest}\n key={`sliding-panel--open-${position}`}\n nodeRef={localReference}\n in={open}\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames=\"sliding-panel\"\n appear\n unmountOnExit\n >\n <div\n ref={localReference}\n data-testid={testId}\n className={clsx(\n 'sliding-panel',\n `sliding-panel--open-${position}`,\n showSlidingPanelBorder && `sliding-panel--border-${position}`,\n slidingPanelPositionFixed && 'sliding-panel--fixed',\n className,\n )}\n >\n {children}\n </div>\n </CSSTransition>\n );\n },\n);\n\nexport default SlidingPanel;\n"],"names":["EXIT_ANIMATION","SlidingPanel","forwardRef","position","open","showSlidingPanelBorder","slidingPanelPositionFixed","className","children","testId","rest","reference","localReference","useRef","useImperativeHandle","current","_createElement","CSSTransition","key","nodeRef","in","timeout","enter","exit","classNames","appear","unmountOnExit","_jsx","ref","clsx"],"mappings":";;;;;AAMO,MAAMA,cAAc,GAAG;AAa9B,MAAMC,YAAY,gBAAGC,UAAU,CAC7B,CACE;AACEC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,IAAI;EACJC,sBAAsB;EACtBC,yBAAyB;EACzBC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACN,GAAGC;AAAI,CACwB,EACjCC,SAAoD,KAClD;AACF,EAAA,MAAMC,cAAc,GAAGC,MAAM,CAAiB,IAAa,CAAC;EAC5DC,mBAAmB,CAACH,SAAS,EAAE,MAAMC,cAAc,CAACG,OAAO,EAAE,EAAE,CAAC;EAEhE,oBACEC,aAAA,CAACC,aAAa,EAAA;AAAA,IAAA,GACRP,IAAI;IACRQ,GAAG,EAAE,CAAA,oBAAA,EAAuBf,QAAQ,CAAA,CAAG;AACvCgB,IAAAA,OAAO,EAAEP,cAAe;AACxBQ,IAAAA,EAAE,EAAEhB;AACJ;AAAA;AACAiB,IAAAA,OAAO,EAAE;AAAEC,MAAAA,KAAK,EAAE,CAAC;AAAEC,MAAAA,IAAI,EAAEvB;KAAiB;AAC5CwB,IAAAA,UAAU,EAAC,eAAe;IAC1BC,MAAM,EAAA,IAAA;IACNC,aAAa,EAAA;AAAA,GAAA,eAEbC,GAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAEhB,cAAe;AACpB,IAAA,aAAA,EAAaH,MAAO;IACpBF,SAAS,EAAEsB,IAAI,CACb,eAAe,EACf,CAAA,oBAAA,EAAuB1B,QAAQ,EAAE,EACjCE,sBAAsB,IAAI,CAAA,sBAAA,EAAyBF,QAAQ,EAAE,EAC7DG,yBAAyB,IAAI,sBAAsB,EACnDC,SAAS,CACT;AAAAC,IAAAA,QAAA,EAEDA;AAAQ,GACN,CACQ,CAAC;AAEpB,CAAC;;;;"}
|
package/build/styles/main.css
CHANGED
|
@@ -5441,6 +5441,37 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5441
5441
|
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5442
5442
|
stroke: currentColor;
|
|
5443
5443
|
}
|
|
5444
|
+
.wds-info-prompt {
|
|
5445
|
+
--Prompt-gap: var(--size-8);
|
|
5446
|
+
--Prompt-padding: 12px;
|
|
5447
|
+
}
|
|
5448
|
+
.wds-info-prompt__content {
|
|
5449
|
+
display: flex;
|
|
5450
|
+
flex-direction: column;
|
|
5451
|
+
justify-content: center;
|
|
5452
|
+
}
|
|
5453
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
5454
|
+
justify-content: flex-start;
|
|
5455
|
+
/* Top align when title exists */
|
|
5456
|
+
}
|
|
5457
|
+
.wds-info-prompt__title,
|
|
5458
|
+
.wds-info-prompt__description {
|
|
5459
|
+
display: block;
|
|
5460
|
+
color: var(--color-sentiment-primary);
|
|
5461
|
+
}
|
|
5462
|
+
.wds-info-prompt__action {
|
|
5463
|
+
margin-top: var(--Prompt-gap);
|
|
5464
|
+
}
|
|
5465
|
+
.wds-info-prompt__media {
|
|
5466
|
+
display: flex;
|
|
5467
|
+
}
|
|
5468
|
+
.wds-info-prompt__media svg {
|
|
5469
|
+
width: 24px;
|
|
5470
|
+
height: 24px;
|
|
5471
|
+
}
|
|
5472
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
5473
|
+
padding: 0;
|
|
5474
|
+
}
|
|
5444
5475
|
.wds-radio-group .np-radio:last-child label {
|
|
5445
5476
|
margin-bottom: 0;
|
|
5446
5477
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.wds-info-prompt {
|
|
2
|
+
--Prompt-gap: var(--size-8);
|
|
3
|
+
--Prompt-padding: 12px;
|
|
4
|
+
}
|
|
5
|
+
.wds-info-prompt__content {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
.wds-info-prompt__content:has(.wds-info-prompt__title) {
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
/* Top align when title exists */
|
|
13
|
+
}
|
|
14
|
+
.wds-info-prompt__title,
|
|
15
|
+
.wds-info-prompt__description {
|
|
16
|
+
display: block;
|
|
17
|
+
color: var(--color-sentiment-primary);
|
|
18
|
+
}
|
|
19
|
+
.wds-info-prompt__action {
|
|
20
|
+
margin-top: var(--Prompt-gap);
|
|
21
|
+
}
|
|
22
|
+
.wds-info-prompt__media {
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
.wds-info-prompt__media svg {
|
|
26
|
+
width: 24px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
}
|
|
29
|
+
.wds-info-prompt .wds-prompt__media-wrapper {
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sources":["../../src/table/TableCell.tsx"],"sourcesContent":["import TableStatusText from './TableStatusText';\nimport StatusIcon from '../statusIcon';\nimport { Flag } from '@wise/art';\nimport React, { ImgHTMLAttributes } from 'react';\nimport { clsx } from 'clsx';\nimport Body from '../body';\nimport Money, { MoneyProps } from '../money';\nimport AvatarView, { AvatarViewProps } from '../avatarView';\n\ninterface TableCellTypeProp {\n type: 'leading' | 'text' | 'currency' | 'status' | 'media';\n}\n\n// `Media`, `Leading` and `Status` cell types have 2 text fields: `primaryText` and `secondaryText`\ninterface TableCellTextProps {\n primaryText?: string;\n secondaryText?: string;\n}\n\n// `Leading`, `Text` and `Currency` cells' types can have a status indicator with `error` or `success` values\ninterface TableCellStatusProp {\n status?: 'error' | 'success';\n}\n\nexport interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {\n media?: ImgHTMLAttributes<HTMLImageElement>;\n}\n\nexport interface TableCellLeading\n extends TableCellTypeProp
|
|
1
|
+
{"version":3,"file":"TableCell.js","sources":["../../src/table/TableCell.tsx"],"sourcesContent":["import TableStatusText from './TableStatusText';\nimport StatusIcon from '../statusIcon';\nimport { Flag } from '@wise/art';\nimport React, { ImgHTMLAttributes } from 'react';\nimport { clsx } from 'clsx';\nimport Body from '../body';\nimport Money, { MoneyProps } from '../money';\nimport AvatarView, { AvatarViewProps } from '../avatarView';\n\ninterface TableCellTypeProp {\n type: 'leading' | 'text' | 'currency' | 'status' | 'media';\n}\n\n// `Media`, `Leading` and `Status` cell types have 2 text fields: `primaryText` and `secondaryText`\ninterface TableCellTextProps {\n primaryText?: string;\n secondaryText?: string;\n}\n\n// `Leading`, `Text` and `Currency` cells' types can have a status indicator with `error` or `success` values\ninterface TableCellStatusProp {\n status?: 'error' | 'success';\n}\n\nexport interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {\n media?: ImgHTMLAttributes<HTMLImageElement>;\n}\n\nexport interface TableCellLeading\n extends TableCellTypeProp, TableCellTextProps, TableCellStatusProp {\n avatar?: Pick<AvatarViewProps, 'badge' | 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n /** @deprecated Use `\"imgSrc\" instead. */\n src?: AvatarViewProps['imgSrc'];\n };\n}\n\nexport interface TableCellText extends TableCellTypeProp, TableCellStatusProp {\n text?: string;\n}\n\nexport interface TableCellCurrency extends TableCellTypeProp, TableCellStatusProp {\n primaryCurrency?: MoneyProps;\n secondaryCurrency?: MoneyProps;\n flag?: boolean;\n}\n\nexport interface TableCellStatus extends TableCellTypeProp, TableCellTextProps {\n sentiment?: 'negative' | 'neutral' | 'positive' | 'warning' | 'pending';\n}\n\nexport interface TableCellType {\n cell?: TableCellLeading & TableCellText & TableCellCurrency & TableCellStatus & TableCellMedia;\n alignment?: 'left' | 'right';\n}\n\n// These properties should be exported only on the lib level to prevent visual issues because of incorrect usage.\nexport interface TableCellProps extends TableCellType {\n className?: string;\n colSpan?: number;\n children?: React.ReactNode;\n}\n\nconst TableCell = ({ cell, alignment = 'left', className, colSpan, children }: TableCellProps) => {\n const getContentMedia = () => {\n let mediaContent = null;\n\n if (cell?.type === 'leading' && cell?.avatar) {\n mediaContent = (\n <AvatarView size={40} {...cell.avatar} imgSrc={cell.avatar.imgSrc ?? cell.avatar.src}>\n {cell.avatar.asset}\n </AvatarView>\n );\n }\n\n if (cell?.type === 'currency' && cell?.primaryCurrency?.currency && cell?.flag !== false) {\n mediaContent = (\n <Flag code={cell?.primaryCurrency?.currency?.toLowerCase()} intrinsicSize={24} />\n );\n }\n\n if (cell?.type === 'status') {\n mediaContent = <StatusIcon size={24} sentiment={cell?.sentiment ?? 'neutral'} />;\n }\n\n if (cell?.type === 'media' && cell.media) {\n // eslint-disable-next-line jsx-a11y/alt-text\n mediaContent = <img {...cell.media} />;\n }\n\n if (mediaContent) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"np-table-content-media\"\n data-testid=\"np-table-content-media\"\n >\n {mediaContent}\n </div>\n );\n }\n };\n\n const formatCurrencyValue = (currency?: MoneyProps) => {\n if (currency) {\n return <Money amount={currency.amount} currency={currency.currency} alwaysShowDecimals />;\n }\n\n return '';\n };\n\n return (\n <td\n className={clsx(\n 'np-table-cell',\n cell?.type ? `np-table-cell--${cell?.type}` : '',\n `np-table-cell--${alignment}`,\n className,\n )}\n colSpan={colSpan}\n >\n {cell?.type === 'text' && cell?.text && (\n <TableStatusText text={cell?.text} status={cell?.status} />\n )}\n {cell?.type && ['leading', 'currency', 'status', 'media'].includes(cell?.type) && (\n <div\n className={clsx('np-table-content', {\n 'np-table-content--reversed': alignment === 'right',\n })}\n data-testid=\"np-table-content\"\n >\n {getContentMedia()}\n <div className=\"np-table-content-body\">\n {(cell?.primaryCurrency ?? cell?.primaryText) && (\n <TableStatusText\n text={\n cell?.type === 'currency'\n ? formatCurrencyValue(cell?.primaryCurrency)\n : (cell?.primaryText ?? '')\n }\n status={cell?.type !== 'status' ? cell?.status : undefined}\n typography=\"default-bold\"\n />\n )}\n {(cell?.secondaryCurrency ?? cell?.secondaryText) && (\n <Body>\n {cell?.type === 'currency'\n ? formatCurrencyValue(cell?.secondaryCurrency)\n : cell?.secondaryText}\n </Body>\n )}\n </div>\n </div>\n )}\n {children}\n </td>\n );\n};\n\nexport default TableCell;\n"],"names":["TableCell","cell","alignment","className","colSpan","children","getContentMedia","mediaContent","type","avatar","_jsx","AvatarView","size","imgSrc","src","asset","primaryCurrency","currency","flag","Flag","code","toLowerCase","intrinsicSize","StatusIcon","sentiment","media","formatCurrencyValue","Money","amount","alwaysShowDecimals","_jsxs","clsx","text","TableStatusText","status","includes","primaryText","undefined","typography","secondaryCurrency","secondaryText","Body"],"mappings":";;;;;;;;;;;;;;AA+DA,MAAMA,SAAS,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA,SAAS,GAAG,MAAM;EAAEC,SAAS;EAAEC,OAAO;AAAEC,EAAAA;AAAQ,CAAkB,KAAI;EAC/F,MAAMC,eAAe,GAAGA,MAAK;IAC3B,IAAIC,YAAY,GAAG,IAAI;IAEvB,IAAIN,IAAI,EAAEO,IAAI,KAAK,SAAS,IAAIP,IAAI,EAAEQ,MAAM,EAAE;MAC5CF,YAAY,gBACVG,cAAA,CAACC,kBAAU,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;QAAA,GAAKX,IAAI,CAACQ,MAAM;QAAEI,MAAM,EAAEZ,IAAI,CAACQ,MAAM,CAACI,MAAM,IAAIZ,IAAI,CAACQ,MAAM,CAACK,GAAI;AAAAT,QAAAA,QAAA,EAClFJ,IAAI,CAACQ,MAAM,CAACM;AAAK,OACR,CACb;AACH,IAAA;AAEA,IAAA,IAAId,IAAI,EAAEO,IAAI,KAAK,UAAU,IAAIP,IAAI,EAAEe,eAAe,EAAEC,QAAQ,IAAIhB,IAAI,EAAEiB,IAAI,KAAK,KAAK,EAAE;MACxFX,YAAY,gBACVG,cAAA,CAACS,QAAI,EAAA;QAACC,IAAI,EAAEnB,IAAI,EAAEe,eAAe,EAAEC,QAAQ,EAAEI,WAAW,EAAG;AAACC,QAAAA,aAAa,EAAE;AAAG,OAAA,CAC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EsC,iBAAiB,CAAC,GAC5CtC,IAAI,EAAEuC;AAAa,SACnB,CACP;AAAA,OACE,CACP;KAAK,CACN,EACAnC,QAAQ;AAAA,GACP,CAAC;AAET;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.mjs","sources":["../../src/table/TableCell.tsx"],"sourcesContent":["import TableStatusText from './TableStatusText';\nimport StatusIcon from '../statusIcon';\nimport { Flag } from '@wise/art';\nimport React, { ImgHTMLAttributes } from 'react';\nimport { clsx } from 'clsx';\nimport Body from '../body';\nimport Money, { MoneyProps } from '../money';\nimport AvatarView, { AvatarViewProps } from '../avatarView';\n\ninterface TableCellTypeProp {\n type: 'leading' | 'text' | 'currency' | 'status' | 'media';\n}\n\n// `Media`, `Leading` and `Status` cell types have 2 text fields: `primaryText` and `secondaryText`\ninterface TableCellTextProps {\n primaryText?: string;\n secondaryText?: string;\n}\n\n// `Leading`, `Text` and `Currency` cells' types can have a status indicator with `error` or `success` values\ninterface TableCellStatusProp {\n status?: 'error' | 'success';\n}\n\nexport interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {\n media?: ImgHTMLAttributes<HTMLImageElement>;\n}\n\nexport interface TableCellLeading\n extends TableCellTypeProp
|
|
1
|
+
{"version":3,"file":"TableCell.mjs","sources":["../../src/table/TableCell.tsx"],"sourcesContent":["import TableStatusText from './TableStatusText';\nimport StatusIcon from '../statusIcon';\nimport { Flag } from '@wise/art';\nimport React, { ImgHTMLAttributes } from 'react';\nimport { clsx } from 'clsx';\nimport Body from '../body';\nimport Money, { MoneyProps } from '../money';\nimport AvatarView, { AvatarViewProps } from '../avatarView';\n\ninterface TableCellTypeProp {\n type: 'leading' | 'text' | 'currency' | 'status' | 'media';\n}\n\n// `Media`, `Leading` and `Status` cell types have 2 text fields: `primaryText` and `secondaryText`\ninterface TableCellTextProps {\n primaryText?: string;\n secondaryText?: string;\n}\n\n// `Leading`, `Text` and `Currency` cells' types can have a status indicator with `error` or `success` values\ninterface TableCellStatusProp {\n status?: 'error' | 'success';\n}\n\nexport interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {\n media?: ImgHTMLAttributes<HTMLImageElement>;\n}\n\nexport interface TableCellLeading\n extends TableCellTypeProp, TableCellTextProps, TableCellStatusProp {\n avatar?: Pick<AvatarViewProps, 'badge' | 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n /** @deprecated Use `\"imgSrc\" instead. */\n src?: AvatarViewProps['imgSrc'];\n };\n}\n\nexport interface TableCellText extends TableCellTypeProp, TableCellStatusProp {\n text?: string;\n}\n\nexport interface TableCellCurrency extends TableCellTypeProp, TableCellStatusProp {\n primaryCurrency?: MoneyProps;\n secondaryCurrency?: MoneyProps;\n flag?: boolean;\n}\n\nexport interface TableCellStatus extends TableCellTypeProp, TableCellTextProps {\n sentiment?: 'negative' | 'neutral' | 'positive' | 'warning' | 'pending';\n}\n\nexport interface TableCellType {\n cell?: TableCellLeading & TableCellText & TableCellCurrency & TableCellStatus & TableCellMedia;\n alignment?: 'left' | 'right';\n}\n\n// These properties should be exported only on the lib level to prevent visual issues because of incorrect usage.\nexport interface TableCellProps extends TableCellType {\n className?: string;\n colSpan?: number;\n children?: React.ReactNode;\n}\n\nconst TableCell = ({ cell, alignment = 'left', className, colSpan, children }: TableCellProps) => {\n const getContentMedia = () => {\n let mediaContent = null;\n\n if (cell?.type === 'leading' && cell?.avatar) {\n mediaContent = (\n <AvatarView size={40} {...cell.avatar} imgSrc={cell.avatar.imgSrc ?? cell.avatar.src}>\n {cell.avatar.asset}\n </AvatarView>\n );\n }\n\n if (cell?.type === 'currency' && cell?.primaryCurrency?.currency && cell?.flag !== false) {\n mediaContent = (\n <Flag code={cell?.primaryCurrency?.currency?.toLowerCase()} intrinsicSize={24} />\n );\n }\n\n if (cell?.type === 'status') {\n mediaContent = <StatusIcon size={24} sentiment={cell?.sentiment ?? 'neutral'} />;\n }\n\n if (cell?.type === 'media' && cell.media) {\n // eslint-disable-next-line jsx-a11y/alt-text\n mediaContent = <img {...cell.media} />;\n }\n\n if (mediaContent) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"np-table-content-media\"\n data-testid=\"np-table-content-media\"\n >\n {mediaContent}\n </div>\n );\n }\n };\n\n const formatCurrencyValue = (currency?: MoneyProps) => {\n if (currency) {\n return <Money amount={currency.amount} currency={currency.currency} alwaysShowDecimals />;\n }\n\n return '';\n };\n\n return (\n <td\n className={clsx(\n 'np-table-cell',\n cell?.type ? `np-table-cell--${cell?.type}` : '',\n `np-table-cell--${alignment}`,\n className,\n )}\n colSpan={colSpan}\n >\n {cell?.type === 'text' && cell?.text && (\n <TableStatusText text={cell?.text} status={cell?.status} />\n )}\n {cell?.type && ['leading', 'currency', 'status', 'media'].includes(cell?.type) && (\n <div\n className={clsx('np-table-content', {\n 'np-table-content--reversed': alignment === 'right',\n })}\n data-testid=\"np-table-content\"\n >\n {getContentMedia()}\n <div className=\"np-table-content-body\">\n {(cell?.primaryCurrency ?? cell?.primaryText) && (\n <TableStatusText\n text={\n cell?.type === 'currency'\n ? formatCurrencyValue(cell?.primaryCurrency)\n : (cell?.primaryText ?? '')\n }\n status={cell?.type !== 'status' ? cell?.status : undefined}\n typography=\"default-bold\"\n />\n )}\n {(cell?.secondaryCurrency ?? cell?.secondaryText) && (\n <Body>\n {cell?.type === 'currency'\n ? formatCurrencyValue(cell?.secondaryCurrency)\n : cell?.secondaryText}\n </Body>\n )}\n </div>\n </div>\n )}\n {children}\n </td>\n );\n};\n\nexport default TableCell;\n"],"names":["TableCell","cell","alignment","className","colSpan","children","getContentMedia","mediaContent","type","avatar","_jsx","AvatarView","size","imgSrc","src","asset","primaryCurrency","currency","flag","Flag","code","toLowerCase","intrinsicSize","StatusIcon","sentiment","media","formatCurrencyValue","Money","amount","alwaysShowDecimals","_jsxs","clsx","text","TableStatusText","status","includes","primaryText","undefined","typography","secondaryCurrency","secondaryText","Body"],"mappings":";;;;;;;;;;AA+DA,MAAMA,SAAS,GAA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