@transferwise/components 0.0.0-experimental-45bc551 → 0.0.0-experimental-358e009
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/main.css +77 -97
- package/build/prompt/InlinePrompt/InlinePrompt.js +10 -8
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +11 -9
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/styles/main.css +77 -97
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +23 -2
- package/build/tabs/Tabs.js +14 -171
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +16 -173
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js +0 -18
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.mjs +1 -17
- package/build/tabs/utils.mjs.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts +2 -24
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tabs/utils.d.ts +0 -2
- package/build/types/tabs/utils.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/listItem/ListItem.spec.tsx +8 -6
- package/src/main.css +77 -97
- package/src/main.less +1 -2
- package/src/prompt/InlinePrompt/InlinePrompt.css +23 -2
- package/src/prompt/InlinePrompt/InlinePrompt.less +18 -3
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +6 -6
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +7 -6
- package/src/tabs/Tabs.spec.tsx +0 -22
- package/src/tabs/Tabs.story.tsx +1 -45
- package/src/tabs/Tabs.tsx +23 -240
- package/src/tabs/utils.spec.ts +0 -58
- package/src/tabs/utils.ts +0 -20
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +0 -45
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +0 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +0 -43
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +0 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +0 -41
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +0 -30
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +0 -1
- package/build/types/prompt/PrimitivePrompt/index.d.ts +0 -3
- package/build/types/prompt/PrimitivePrompt/index.d.ts.map +0 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +0 -41
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +0 -37
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +0 -70
- package/src/prompt/PrimitivePrompt/index.ts +0 -2
package/build/main.css
CHANGED
|
@@ -920,6 +920,83 @@
|
|
|
920
920
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
921
921
|
border-color: var(--color-interactive-primary-hover);
|
|
922
922
|
}
|
|
923
|
+
.wds-inline-prompt {
|
|
924
|
+
display: inline-flex;
|
|
925
|
+
text-align: left;
|
|
926
|
+
padding-top: calc(8px / 2);
|
|
927
|
+
padding-top: calc(var(--padding-x-small) / 2);
|
|
928
|
+
padding-bottom: calc(8px / 2);
|
|
929
|
+
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
930
|
+
padding-left: calc(8px - 1px);
|
|
931
|
+
padding-left: calc(var(--padding-x-small) - 1px);
|
|
932
|
+
padding-right: 8px;
|
|
933
|
+
padding-right: var(--padding-x-small);
|
|
934
|
+
border-radius: 10px;
|
|
935
|
+
border-radius: var(--radius-small);
|
|
936
|
+
word-break: break-word;
|
|
937
|
+
word-wrap: break-word;
|
|
938
|
+
}
|
|
939
|
+
.wds-inline-prompt:has(a),
|
|
940
|
+
.wds-inline-prompt:has(button) {
|
|
941
|
+
position: relative;
|
|
942
|
+
z-index: 1;
|
|
943
|
+
}
|
|
944
|
+
.wds-inline-prompt:has(a):hover,
|
|
945
|
+
.wds-inline-prompt:has(button):hover {
|
|
946
|
+
background-color: var(--color-sentiment-background-surface-hover);
|
|
947
|
+
}
|
|
948
|
+
.wds-inline-prompt:has(a):active,
|
|
949
|
+
.wds-inline-prompt:has(button):active {
|
|
950
|
+
background-color: var(--color-sentiment-background-surface-active);
|
|
951
|
+
}
|
|
952
|
+
.wds-inline-prompt--full-width {
|
|
953
|
+
width: 100%;
|
|
954
|
+
}
|
|
955
|
+
.wds-inline-prompt--muted {
|
|
956
|
+
opacity: 0.93;
|
|
957
|
+
filter: grayscale(1);
|
|
958
|
+
}
|
|
959
|
+
.wds-inline-prompt a,
|
|
960
|
+
.wds-inline-prompt button {
|
|
961
|
+
color: var(--color-sentiment-content-primary);
|
|
962
|
+
text-underline-offset: calc(4px / 2);
|
|
963
|
+
text-underline-offset: calc(var(--size-4) / 2);
|
|
964
|
+
}
|
|
965
|
+
.wds-inline-prompt a:hover,
|
|
966
|
+
.wds-inline-prompt button:hover {
|
|
967
|
+
color: var(--color-sentiment-content-primary-hover);
|
|
968
|
+
}
|
|
969
|
+
.wds-inline-prompt a:active,
|
|
970
|
+
.wds-inline-prompt button:active {
|
|
971
|
+
color: var(--color-sentiment-content-primary-active);
|
|
972
|
+
}
|
|
973
|
+
.wds-inline-prompt a:first-of-type:before,
|
|
974
|
+
.wds-inline-prompt button:first-of-type:before {
|
|
975
|
+
content: "";
|
|
976
|
+
position: absolute;
|
|
977
|
+
inset: 0;
|
|
978
|
+
}
|
|
979
|
+
.wds-inline-prompt__media-wrapper {
|
|
980
|
+
padding-right: calc(12px / 2);
|
|
981
|
+
padding-right: calc(var(--size-12) / 2);
|
|
982
|
+
padding-top: calc(4px - 1px);
|
|
983
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
984
|
+
padding-bottom: calc(4px - 1px);
|
|
985
|
+
padding-bottom: calc(var(--size-4) - 1px);
|
|
986
|
+
}
|
|
987
|
+
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
988
|
+
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
989
|
+
color: var(--color-sentiment-content-primary);
|
|
990
|
+
}
|
|
991
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
992
|
+
width: 16px;
|
|
993
|
+
width: var(--size-16);
|
|
994
|
+
height: 16px;
|
|
995
|
+
height: var(--size-16);
|
|
996
|
+
}
|
|
997
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
998
|
+
stroke: currentColor;
|
|
999
|
+
}
|
|
923
1000
|
.np-dot {
|
|
924
1001
|
--np-dot-size: 14px;
|
|
925
1002
|
position: relative;
|
|
@@ -5335,103 +5412,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5335
5412
|
.np-CardGroup .np-Card.np-Card--promoCard {
|
|
5336
5413
|
max-width: 100%;
|
|
5337
5414
|
}
|
|
5338
|
-
.wds-prompt {
|
|
5339
|
-
border-radius: 10px;
|
|
5340
|
-
border-radius: var(--radius-small);
|
|
5341
|
-
display: flex;
|
|
5342
|
-
word-wrap: break-word;
|
|
5343
|
-
padding: 8px;
|
|
5344
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
5345
|
-
text-align: left;
|
|
5346
|
-
word-break: break-word;
|
|
5347
|
-
}
|
|
5348
|
-
.wds-prompt__content-wrapper {
|
|
5349
|
-
display: grid;
|
|
5350
|
-
grid-gap: 16px;
|
|
5351
|
-
grid-gap: var(--Prompt-gap, var(--size-16));
|
|
5352
|
-
gap: 16px;
|
|
5353
|
-
gap: var(--Prompt-gap, var(--size-16));
|
|
5354
|
-
grid-template-columns: auto 1fr;
|
|
5355
|
-
width: 100%;
|
|
5356
|
-
}
|
|
5357
|
-
.wds-prompt__media-wrapper {
|
|
5358
|
-
align-self: flex-start;
|
|
5359
|
-
padding-top: calc(4px - 1px);
|
|
5360
|
-
padding-top: calc(var(--size-4) - 1px);
|
|
5361
|
-
}
|
|
5362
|
-
.wds-prompt__media-wrapper .tw-icon-tags,
|
|
5363
|
-
.wds-prompt__media-wrapper .tw-icon-confetti {
|
|
5364
|
-
color: var(--color-sentiment-content-primary);
|
|
5365
|
-
}
|
|
5366
|
-
.wds-prompt__actions-wrapper {
|
|
5367
|
-
display: flex;
|
|
5368
|
-
flex-wrap: wrap;
|
|
5369
|
-
gap: 8px;
|
|
5370
|
-
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
|
-
grid-column-start: 2;
|
|
5372
|
-
}
|
|
5373
|
-
@media (max-width: 991px) {
|
|
5374
|
-
.wds-prompt__actions-wrapper {
|
|
5375
|
-
grid-column: span 2;
|
|
5376
|
-
width: 100%;
|
|
5377
|
-
}
|
|
5378
|
-
}
|
|
5379
|
-
.wds-inline-prompt {
|
|
5380
|
-
--Prompt-gap: calc(var(--size-12) / 2);
|
|
5381
|
-
--Prompt-padding: calc(var(--padding-x-small) / 2) var(--padding-x-small);
|
|
5382
|
-
display: inline-flex;
|
|
5383
|
-
border-radius: 10px;
|
|
5384
|
-
border-radius: var(--radius-small);
|
|
5385
|
-
}
|
|
5386
|
-
.wds-inline-prompt:has(a),
|
|
5387
|
-
.wds-inline-prompt:has(button) {
|
|
5388
|
-
position: relative;
|
|
5389
|
-
z-index: 1;
|
|
5390
|
-
}
|
|
5391
|
-
.wds-inline-prompt:has(a):hover,
|
|
5392
|
-
.wds-inline-prompt:has(button):hover {
|
|
5393
|
-
background-color: var(--color-sentiment-background-surface-hover);
|
|
5394
|
-
}
|
|
5395
|
-
.wds-inline-prompt:has(a):active,
|
|
5396
|
-
.wds-inline-prompt:has(button):active {
|
|
5397
|
-
background-color: var(--color-sentiment-background-surface-active);
|
|
5398
|
-
}
|
|
5399
|
-
.wds-inline-prompt--full-width {
|
|
5400
|
-
width: 100%;
|
|
5401
|
-
}
|
|
5402
|
-
.wds-inline-prompt--muted {
|
|
5403
|
-
opacity: 0.93;
|
|
5404
|
-
filter: grayscale(1);
|
|
5405
|
-
}
|
|
5406
|
-
.wds-inline-prompt a,
|
|
5407
|
-
.wds-inline-prompt button {
|
|
5408
|
-
color: var(--color-sentiment-content-primary);
|
|
5409
|
-
text-underline-offset: calc(4px / 2);
|
|
5410
|
-
text-underline-offset: calc(var(--size-4) / 2);
|
|
5411
|
-
}
|
|
5412
|
-
.wds-inline-prompt a:hover,
|
|
5413
|
-
.wds-inline-prompt button:hover {
|
|
5414
|
-
color: var(--color-sentiment-content-primary-hover);
|
|
5415
|
-
}
|
|
5416
|
-
.wds-inline-prompt a:active,
|
|
5417
|
-
.wds-inline-prompt button:active {
|
|
5418
|
-
color: var(--color-sentiment-content-primary-active);
|
|
5419
|
-
}
|
|
5420
|
-
.wds-inline-prompt a:first-of-type:before,
|
|
5421
|
-
.wds-inline-prompt button:first-of-type:before {
|
|
5422
|
-
content: "";
|
|
5423
|
-
position: absolute;
|
|
5424
|
-
inset: 0;
|
|
5425
|
-
}
|
|
5426
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
5427
|
-
width: 16px;
|
|
5428
|
-
width: var(--size-16);
|
|
5429
|
-
height: 16px;
|
|
5430
|
-
height: var(--size-16);
|
|
5431
|
-
}
|
|
5432
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5433
|
-
stroke: currentColor;
|
|
5434
|
-
}
|
|
5435
5415
|
.wds-radio-group .np-radio:last-child label {
|
|
5436
5416
|
margin-bottom: 0;
|
|
5437
5417
|
}
|
|
@@ -28,7 +28,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
28
28
|
var ProcessIndicator = require('../../processIndicator/ProcessIndicator.js');
|
|
29
29
|
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
30
30
|
var Body = require('../../body/Body.js');
|
|
31
|
-
var
|
|
31
|
+
var SentimentSurface = require('../../sentimentSurface/SentimentSurface.js');
|
|
32
32
|
|
|
33
33
|
const InlinePrompt = ({
|
|
34
34
|
sentiment: sentiment$1 = sentiment.Sentiment.POSITIVE,
|
|
@@ -40,7 +40,7 @@ const InlinePrompt = ({
|
|
|
40
40
|
mediaLabel,
|
|
41
41
|
width = 'auto',
|
|
42
42
|
'data-testid': dataTestId,
|
|
43
|
-
...
|
|
43
|
+
...rest
|
|
44
44
|
}) => {
|
|
45
45
|
const surfaceSentiment = sentiment$1 === sentiment.Sentiment.POSITIVE ? 'success' : sentiment$1;
|
|
46
46
|
const renderMedia = () => {
|
|
@@ -69,19 +69,21 @@ const InlinePrompt = ({
|
|
|
69
69
|
iconLabel: mediaLabel
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
return /*#__PURE__*/jsxRuntime.
|
|
72
|
+
return /*#__PURE__*/jsxRuntime.jsxs(SentimentSurface.default, {
|
|
73
73
|
sentiment: surfaceSentiment,
|
|
74
|
-
media: renderMedia(),
|
|
75
74
|
"data-testid": dataTestId,
|
|
76
|
-
className: clsx.clsx('wds-inline-prompt', {
|
|
75
|
+
className: clsx.clsx('wds-inline-prompt', `wds-inline-prompt--${sentiment$1}`, {
|
|
77
76
|
'wds-inline-prompt--full-width': width === 'full',
|
|
78
77
|
'wds-inline-prompt--muted': muted,
|
|
79
78
|
'wds-inline-prompt--loading': loading
|
|
80
79
|
}, className),
|
|
81
|
-
...
|
|
82
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
80
|
+
...rest,
|
|
81
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
82
|
+
className: "wds-inline-prompt__media-wrapper",
|
|
83
|
+
children: renderMedia()
|
|
84
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
83
85
|
children: children
|
|
84
|
-
})
|
|
86
|
+
})]
|
|
85
87
|
});
|
|
86
88
|
};
|
|
87
89
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlinePrompt.js","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } from '@transferwise/icons';\nimport ProcessIndicator from '../../processIndicator';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport
|
|
1
|
+
{"version":3,"file":"InlinePrompt.js","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } from '@transferwise/icons';\nimport ProcessIndicator from '../../processIndicator';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport SentimentSurface from '../../sentimentSurface';\n\nexport type InlinePromptProps = {\n /**\n * The sentiment determines the colour scheme\n */\n sentiment?:\n | `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`\n | 'proposition';\n /**\n * Replaces the icon with a spinner while waiting for the short-lived action to finish.\n * @default false\n */\n loading?: boolean;\n /**\n * While prompts cannot be fully (visually and functionally) disabled, this prop should be enabled\n * they are associated with actually disabled component (e.g. a disabled list item or input).\n * @default false\n */\n muted?: boolean;\n /**\n * Icon override for all sentiments. If the sentiment uses StatusIcon by default, it will be\n * replaced by a plain icon.\n */\n media?: React.ReactNode;\n /**\n * Override for the sentiment's-derived, default, accessible name announced by the screen readers.\n */\n mediaLabel?: string;\n /**\n * Defines the sizing strategy of the prompt component - either hugging the content or taking full width of the container.\n * @default auto\n */\n width?: 'auto' | 'full';\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: React.ReactNode;\n};\n\n/**\n * Inline prompts appear alongside a specific component on the screen. They help the user stay\n * informed, fix something, or get more out of what they're doing. <br />\n *\n * **NB:** It should be used in favour of `InlineAlert` which will be soon deprecated.\n */\nexport const InlinePrompt = ({\n sentiment = Sentiment.POSITIVE,\n muted = false,\n loading = false,\n className,\n children,\n media = null,\n mediaLabel,\n width = 'auto',\n 'data-testid': dataTestId,\n ...rest\n}: InlinePromptProps) => {\n const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;\n\n const renderMedia = () => {\n if (muted) {\n return <BackslashCircle size={16} data-testid=\"InlinePrompt_Muted\" title={mediaLabel} />;\n }\n\n if (loading) {\n return (\n <ProcessIndicator\n data-testid=\"InlinePrompt_ProcessIndicator\"\n size=\"xxs\"\n className=\"wds-inline-prompt-process-indicator\"\n />\n );\n }\n\n if (sentiment === 'proposition') {\n return media || <GiftBox title={mediaLabel} />;\n }\n\n return media || <StatusIcon size={16} sentiment={sentiment} iconLabel={mediaLabel} />;\n };\n\n return (\n <SentimentSurface\n sentiment={surfaceSentiment}\n data-testid={dataTestId}\n className={clsx(\n 'wds-inline-prompt',\n `wds-inline-prompt--${sentiment}`,\n {\n 'wds-inline-prompt--full-width': width === 'full',\n 'wds-inline-prompt--muted': muted,\n 'wds-inline-prompt--loading': loading,\n },\n className,\n )}\n {...rest}\n >\n <div className=\"wds-inline-prompt__media-wrapper\">{renderMedia()}</div>\n <Body>{children}</Body>\n </SentimentSurface>\n );\n};\n"],"names":["InlinePrompt","sentiment","Sentiment","POSITIVE","muted","loading","className","children","media","mediaLabel","width","dataTestId","rest","surfaceSentiment","renderMedia","_jsx","BackslashCircle","size","title","ProcessIndicator","GiftBox","StatusIcon","iconLabel","_jsxs","SentimentSurface","clsx","Body"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDO,MAAMA,YAAY,GAAGA,CAAC;aAC3BC,WAAS,GAAGC,mBAAS,CAACC,QAAQ;AAC9BC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,QAAQ;AACRC,EAAAA,KAAK,GAAG,IAAI;EACZC,UAAU;AACVC,EAAAA,KAAK,GAAG,MAAM;AACd,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAI,CACW,KAAI;EACtB,MAAMC,gBAAgB,GAAGZ,WAAS,KAAKC,mBAAS,CAACC,QAAQ,GAAG,SAAS,GAA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AAC,cAAA,CAACW,YAAI,EAAA;AAAAnB,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -22,11 +22,11 @@ import { clsx } from 'clsx';
|
|
|
22
22
|
import 'react';
|
|
23
23
|
import 'react-intl';
|
|
24
24
|
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
-
import { jsx } from 'react/jsx-runtime';
|
|
25
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
26
26
|
import ProcessIndicator from '../../processIndicator/ProcessIndicator.mjs';
|
|
27
27
|
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
28
28
|
import Body from '../../body/Body.mjs';
|
|
29
|
-
import
|
|
29
|
+
import SentimentSurface from '../../sentimentSurface/SentimentSurface.mjs';
|
|
30
30
|
|
|
31
31
|
const InlinePrompt = ({
|
|
32
32
|
sentiment = Sentiment.POSITIVE,
|
|
@@ -38,7 +38,7 @@ const InlinePrompt = ({
|
|
|
38
38
|
mediaLabel,
|
|
39
39
|
width = 'auto',
|
|
40
40
|
'data-testid': dataTestId,
|
|
41
|
-
...
|
|
41
|
+
...rest
|
|
42
42
|
}) => {
|
|
43
43
|
const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;
|
|
44
44
|
const renderMedia = () => {
|
|
@@ -67,19 +67,21 @@ const InlinePrompt = ({
|
|
|
67
67
|
iconLabel: mediaLabel
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
return /*#__PURE__*/
|
|
70
|
+
return /*#__PURE__*/jsxs(SentimentSurface, {
|
|
71
71
|
sentiment: surfaceSentiment,
|
|
72
|
-
media: renderMedia(),
|
|
73
72
|
"data-testid": dataTestId,
|
|
74
|
-
className: clsx('wds-inline-prompt', {
|
|
73
|
+
className: clsx('wds-inline-prompt', `wds-inline-prompt--${sentiment}`, {
|
|
75
74
|
'wds-inline-prompt--full-width': width === 'full',
|
|
76
75
|
'wds-inline-prompt--muted': muted,
|
|
77
76
|
'wds-inline-prompt--loading': loading
|
|
78
77
|
}, className),
|
|
79
|
-
...
|
|
80
|
-
children: /*#__PURE__*/jsx(
|
|
78
|
+
...rest,
|
|
79
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
80
|
+
className: "wds-inline-prompt__media-wrapper",
|
|
81
|
+
children: renderMedia()
|
|
82
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
81
83
|
children: children
|
|
82
|
-
})
|
|
84
|
+
})]
|
|
83
85
|
});
|
|
84
86
|
};
|
|
85
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlinePrompt.mjs","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } from '@transferwise/icons';\nimport ProcessIndicator from '../../processIndicator';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport
|
|
1
|
+
{"version":3,"file":"InlinePrompt.mjs","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } from '@transferwise/icons';\nimport ProcessIndicator from '../../processIndicator';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport SentimentSurface from '../../sentimentSurface';\n\nexport type InlinePromptProps = {\n /**\n * The sentiment determines the colour scheme\n */\n sentiment?:\n | `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`\n | 'proposition';\n /**\n * Replaces the icon with a spinner while waiting for the short-lived action to finish.\n * @default false\n */\n loading?: boolean;\n /**\n * While prompts cannot be fully (visually and functionally) disabled, this prop should be enabled\n * they are associated with actually disabled component (e.g. a disabled list item or input).\n * @default false\n */\n muted?: boolean;\n /**\n * Icon override for all sentiments. If the sentiment uses StatusIcon by default, it will be\n * replaced by a plain icon.\n */\n media?: React.ReactNode;\n /**\n * Override for the sentiment's-derived, default, accessible name announced by the screen readers.\n */\n mediaLabel?: string;\n /**\n * Defines the sizing strategy of the prompt component - either hugging the content or taking full width of the container.\n * @default auto\n */\n width?: 'auto' | 'full';\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: React.ReactNode;\n};\n\n/**\n * Inline prompts appear alongside a specific component on the screen. They help the user stay\n * informed, fix something, or get more out of what they're doing. <br />\n *\n * **NB:** It should be used in favour of `InlineAlert` which will be soon deprecated.\n */\nexport const InlinePrompt = ({\n sentiment = Sentiment.POSITIVE,\n muted = false,\n loading = false,\n className,\n children,\n media = null,\n mediaLabel,\n width = 'auto',\n 'data-testid': dataTestId,\n ...rest\n}: InlinePromptProps) => {\n const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;\n\n const renderMedia = () => {\n if (muted) {\n return <BackslashCircle size={16} data-testid=\"InlinePrompt_Muted\" title={mediaLabel} />;\n }\n\n if (loading) {\n return (\n <ProcessIndicator\n data-testid=\"InlinePrompt_ProcessIndicator\"\n size=\"xxs\"\n className=\"wds-inline-prompt-process-indicator\"\n />\n );\n }\n\n if (sentiment === 'proposition') {\n return media || <GiftBox title={mediaLabel} />;\n }\n\n return media || <StatusIcon size={16} sentiment={sentiment} iconLabel={mediaLabel} />;\n };\n\n return (\n <SentimentSurface\n sentiment={surfaceSentiment}\n data-testid={dataTestId}\n className={clsx(\n 'wds-inline-prompt',\n `wds-inline-prompt--${sentiment}`,\n {\n 'wds-inline-prompt--full-width': width === 'full',\n 'wds-inline-prompt--muted': muted,\n 'wds-inline-prompt--loading': loading,\n },\n className,\n )}\n {...rest}\n >\n <div className=\"wds-inline-prompt__media-wrapper\">{renderMedia()}</div>\n <Body>{children}</Body>\n </SentimentSurface>\n );\n};\n"],"names":["InlinePrompt","sentiment","Sentiment","POSITIVE","muted","loading","className","children","media","mediaLabel","width","dataTestId","rest","surfaceSentiment","renderMedia","_jsx","BackslashCircle","size","title","ProcessInd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BACEc,IAAA,CAACC,gBAAgB,EAAA;AACfvB,IAAAA,SAAS,EAAEY,gBAAiB;AAC5B,IAAA,aAAA,EAAaF,UAAW;IACxBL,SAAS,EAAEmB,IAAI,CACb,mBAAmB,EACnB,CAAA,mBAAA,EAAsBxB,SAAS,EAAE,EACjC;MACE,+BAA+B,EAAES,KAAK,KAAK,MAAM;AACjD,MAAA,0BAA0B,EAAEN,KAAK;AACjC,MAAA,4BAA4B,EAAEC;KAC/B,EACDC,SAAS,CACT;AAAA,IAAA,GACEM,IAAI;AAAAL,IAAAA,QAAA,gBAERQ,GAAA,CAAA,KAAA,EAAA;AAAKT,MAAAA,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAAEO,WAAW;AAAE,KAAM,CACtE,eAAAC,GAAA,CAACW,IAAI,EAAA;AAAAnB,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAkB,CAAC;AAEvB;;;;"}
|
package/build/styles/main.css
CHANGED
|
@@ -920,6 +920,83 @@
|
|
|
920
920
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
921
921
|
border-color: var(--color-interactive-primary-hover);
|
|
922
922
|
}
|
|
923
|
+
.wds-inline-prompt {
|
|
924
|
+
display: inline-flex;
|
|
925
|
+
text-align: left;
|
|
926
|
+
padding-top: calc(8px / 2);
|
|
927
|
+
padding-top: calc(var(--padding-x-small) / 2);
|
|
928
|
+
padding-bottom: calc(8px / 2);
|
|
929
|
+
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
930
|
+
padding-left: calc(8px - 1px);
|
|
931
|
+
padding-left: calc(var(--padding-x-small) - 1px);
|
|
932
|
+
padding-right: 8px;
|
|
933
|
+
padding-right: var(--padding-x-small);
|
|
934
|
+
border-radius: 10px;
|
|
935
|
+
border-radius: var(--radius-small);
|
|
936
|
+
word-break: break-word;
|
|
937
|
+
word-wrap: break-word;
|
|
938
|
+
}
|
|
939
|
+
.wds-inline-prompt:has(a),
|
|
940
|
+
.wds-inline-prompt:has(button) {
|
|
941
|
+
position: relative;
|
|
942
|
+
z-index: 1;
|
|
943
|
+
}
|
|
944
|
+
.wds-inline-prompt:has(a):hover,
|
|
945
|
+
.wds-inline-prompt:has(button):hover {
|
|
946
|
+
background-color: var(--color-sentiment-background-surface-hover);
|
|
947
|
+
}
|
|
948
|
+
.wds-inline-prompt:has(a):active,
|
|
949
|
+
.wds-inline-prompt:has(button):active {
|
|
950
|
+
background-color: var(--color-sentiment-background-surface-active);
|
|
951
|
+
}
|
|
952
|
+
.wds-inline-prompt--full-width {
|
|
953
|
+
width: 100%;
|
|
954
|
+
}
|
|
955
|
+
.wds-inline-prompt--muted {
|
|
956
|
+
opacity: 0.93;
|
|
957
|
+
filter: grayscale(1);
|
|
958
|
+
}
|
|
959
|
+
.wds-inline-prompt a,
|
|
960
|
+
.wds-inline-prompt button {
|
|
961
|
+
color: var(--color-sentiment-content-primary);
|
|
962
|
+
text-underline-offset: calc(4px / 2);
|
|
963
|
+
text-underline-offset: calc(var(--size-4) / 2);
|
|
964
|
+
}
|
|
965
|
+
.wds-inline-prompt a:hover,
|
|
966
|
+
.wds-inline-prompt button:hover {
|
|
967
|
+
color: var(--color-sentiment-content-primary-hover);
|
|
968
|
+
}
|
|
969
|
+
.wds-inline-prompt a:active,
|
|
970
|
+
.wds-inline-prompt button:active {
|
|
971
|
+
color: var(--color-sentiment-content-primary-active);
|
|
972
|
+
}
|
|
973
|
+
.wds-inline-prompt a:first-of-type:before,
|
|
974
|
+
.wds-inline-prompt button:first-of-type:before {
|
|
975
|
+
content: "";
|
|
976
|
+
position: absolute;
|
|
977
|
+
inset: 0;
|
|
978
|
+
}
|
|
979
|
+
.wds-inline-prompt__media-wrapper {
|
|
980
|
+
padding-right: calc(12px / 2);
|
|
981
|
+
padding-right: calc(var(--size-12) / 2);
|
|
982
|
+
padding-top: calc(4px - 1px);
|
|
983
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
984
|
+
padding-bottom: calc(4px - 1px);
|
|
985
|
+
padding-bottom: calc(var(--size-4) - 1px);
|
|
986
|
+
}
|
|
987
|
+
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
988
|
+
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
989
|
+
color: var(--color-sentiment-content-primary);
|
|
990
|
+
}
|
|
991
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
992
|
+
width: 16px;
|
|
993
|
+
width: var(--size-16);
|
|
994
|
+
height: 16px;
|
|
995
|
+
height: var(--size-16);
|
|
996
|
+
}
|
|
997
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
998
|
+
stroke: currentColor;
|
|
999
|
+
}
|
|
923
1000
|
.np-dot {
|
|
924
1001
|
--np-dot-size: 14px;
|
|
925
1002
|
position: relative;
|
|
@@ -5335,103 +5412,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5335
5412
|
.np-CardGroup .np-Card.np-Card--promoCard {
|
|
5336
5413
|
max-width: 100%;
|
|
5337
5414
|
}
|
|
5338
|
-
.wds-prompt {
|
|
5339
|
-
border-radius: 10px;
|
|
5340
|
-
border-radius: var(--radius-small);
|
|
5341
|
-
display: flex;
|
|
5342
|
-
word-wrap: break-word;
|
|
5343
|
-
padding: 8px;
|
|
5344
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
5345
|
-
text-align: left;
|
|
5346
|
-
word-break: break-word;
|
|
5347
|
-
}
|
|
5348
|
-
.wds-prompt__content-wrapper {
|
|
5349
|
-
display: grid;
|
|
5350
|
-
grid-gap: 16px;
|
|
5351
|
-
grid-gap: var(--Prompt-gap, var(--size-16));
|
|
5352
|
-
gap: 16px;
|
|
5353
|
-
gap: var(--Prompt-gap, var(--size-16));
|
|
5354
|
-
grid-template-columns: auto 1fr;
|
|
5355
|
-
width: 100%;
|
|
5356
|
-
}
|
|
5357
|
-
.wds-prompt__media-wrapper {
|
|
5358
|
-
align-self: flex-start;
|
|
5359
|
-
padding-top: calc(4px - 1px);
|
|
5360
|
-
padding-top: calc(var(--size-4) - 1px);
|
|
5361
|
-
}
|
|
5362
|
-
.wds-prompt__media-wrapper .tw-icon-tags,
|
|
5363
|
-
.wds-prompt__media-wrapper .tw-icon-confetti {
|
|
5364
|
-
color: var(--color-sentiment-content-primary);
|
|
5365
|
-
}
|
|
5366
|
-
.wds-prompt__actions-wrapper {
|
|
5367
|
-
display: flex;
|
|
5368
|
-
flex-wrap: wrap;
|
|
5369
|
-
gap: 8px;
|
|
5370
|
-
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
|
-
grid-column-start: 2;
|
|
5372
|
-
}
|
|
5373
|
-
@media (max-width: 991px) {
|
|
5374
|
-
.wds-prompt__actions-wrapper {
|
|
5375
|
-
grid-column: span 2;
|
|
5376
|
-
width: 100%;
|
|
5377
|
-
}
|
|
5378
|
-
}
|
|
5379
|
-
.wds-inline-prompt {
|
|
5380
|
-
--Prompt-gap: calc(var(--size-12) / 2);
|
|
5381
|
-
--Prompt-padding: calc(var(--padding-x-small) / 2) var(--padding-x-small);
|
|
5382
|
-
display: inline-flex;
|
|
5383
|
-
border-radius: 10px;
|
|
5384
|
-
border-radius: var(--radius-small);
|
|
5385
|
-
}
|
|
5386
|
-
.wds-inline-prompt:has(a),
|
|
5387
|
-
.wds-inline-prompt:has(button) {
|
|
5388
|
-
position: relative;
|
|
5389
|
-
z-index: 1;
|
|
5390
|
-
}
|
|
5391
|
-
.wds-inline-prompt:has(a):hover,
|
|
5392
|
-
.wds-inline-prompt:has(button):hover {
|
|
5393
|
-
background-color: var(--color-sentiment-background-surface-hover);
|
|
5394
|
-
}
|
|
5395
|
-
.wds-inline-prompt:has(a):active,
|
|
5396
|
-
.wds-inline-prompt:has(button):active {
|
|
5397
|
-
background-color: var(--color-sentiment-background-surface-active);
|
|
5398
|
-
}
|
|
5399
|
-
.wds-inline-prompt--full-width {
|
|
5400
|
-
width: 100%;
|
|
5401
|
-
}
|
|
5402
|
-
.wds-inline-prompt--muted {
|
|
5403
|
-
opacity: 0.93;
|
|
5404
|
-
filter: grayscale(1);
|
|
5405
|
-
}
|
|
5406
|
-
.wds-inline-prompt a,
|
|
5407
|
-
.wds-inline-prompt button {
|
|
5408
|
-
color: var(--color-sentiment-content-primary);
|
|
5409
|
-
text-underline-offset: calc(4px / 2);
|
|
5410
|
-
text-underline-offset: calc(var(--size-4) / 2);
|
|
5411
|
-
}
|
|
5412
|
-
.wds-inline-prompt a:hover,
|
|
5413
|
-
.wds-inline-prompt button:hover {
|
|
5414
|
-
color: var(--color-sentiment-content-primary-hover);
|
|
5415
|
-
}
|
|
5416
|
-
.wds-inline-prompt a:active,
|
|
5417
|
-
.wds-inline-prompt button:active {
|
|
5418
|
-
color: var(--color-sentiment-content-primary-active);
|
|
5419
|
-
}
|
|
5420
|
-
.wds-inline-prompt a:first-of-type:before,
|
|
5421
|
-
.wds-inline-prompt button:first-of-type:before {
|
|
5422
|
-
content: "";
|
|
5423
|
-
position: absolute;
|
|
5424
|
-
inset: 0;
|
|
5425
|
-
}
|
|
5426
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
5427
|
-
width: 16px;
|
|
5428
|
-
width: var(--size-16);
|
|
5429
|
-
height: 16px;
|
|
5430
|
-
height: var(--size-16);
|
|
5431
|
-
}
|
|
5432
|
-
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
5433
|
-
stroke: currentColor;
|
|
5434
|
-
}
|
|
5435
5415
|
.wds-radio-group .np-radio:last-child label {
|
|
5436
5416
|
margin-bottom: 0;
|
|
5437
5417
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
.wds-inline-prompt {
|
|
2
|
-
--Prompt-gap: calc(var(--size-12) / 2);
|
|
3
|
-
--Prompt-padding: calc(var(--padding-x-small) / 2) var(--padding-x-small);
|
|
4
2
|
display: inline-flex;
|
|
3
|
+
text-align: left;
|
|
4
|
+
padding-top: calc(8px / 2);
|
|
5
|
+
padding-top: calc(var(--padding-x-small) / 2);
|
|
6
|
+
padding-bottom: calc(8px / 2);
|
|
7
|
+
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
8
|
+
padding-left: calc(8px - 1px);
|
|
9
|
+
padding-left: calc(var(--padding-x-small) - 1px);
|
|
10
|
+
padding-right: 8px;
|
|
11
|
+
padding-right: var(--padding-x-small);
|
|
5
12
|
border-radius: 10px;
|
|
6
13
|
border-radius: var(--radius-small);
|
|
14
|
+
word-break: break-word;
|
|
15
|
+
word-wrap: break-word;
|
|
7
16
|
}
|
|
8
17
|
.wds-inline-prompt:has(a),
|
|
9
18
|
.wds-inline-prompt:has(button) {
|
|
@@ -45,6 +54,18 @@
|
|
|
45
54
|
position: absolute;
|
|
46
55
|
inset: 0;
|
|
47
56
|
}
|
|
57
|
+
.wds-inline-prompt__media-wrapper {
|
|
58
|
+
padding-right: calc(12px / 2);
|
|
59
|
+
padding-right: calc(var(--size-12) / 2);
|
|
60
|
+
padding-top: calc(4px - 1px);
|
|
61
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
62
|
+
padding-bottom: calc(4px - 1px);
|
|
63
|
+
padding-bottom: calc(var(--size-4) - 1px);
|
|
64
|
+
}
|
|
65
|
+
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
66
|
+
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
67
|
+
color: var(--color-sentiment-content-primary);
|
|
68
|
+
}
|
|
48
69
|
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
49
70
|
width: 16px;
|
|
50
71
|
width: var(--size-16);
|