@transferwise/components 0.0.0-experimental-8809019 → 0.0.0-experimental-45bc551
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/inputs/SelectInput.js +3 -4
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +4 -5
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/_BottomSheet.js +2 -5
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +3 -6
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_Popover.js +0 -2
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +0 -2
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/main.css +97 -77
- package/build/prompt/InlinePrompt/InlinePrompt.js +8 -10
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +9 -11
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +45 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +43 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -0
- package/build/styles/main.css +97 -77
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +2 -23
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +41 -0
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.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/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +30 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/index.d.ts +3 -0
- package/build/types/prompt/PrimitivePrompt/index.d.ts.map +1 -0
- package/package.json +10 -11
- package/src/alert/Alert.tests.story.tsx +1 -0
- package/src/button/_stories/Button.brightGreen.tests.story.tsx +1 -1
- package/src/button/_stories/Button.dark.tests.story.tsx +1 -1
- package/src/button/_stories/Button.default.tests.story.tsx +1 -1
- package/src/button/_stories/Button.forestGreen.tests.story.tsx +1 -1
- package/src/button/_stories/Button.tests.story.tsx +1 -1
- package/src/circularButton/CircularButton.tests.story.tsx +1 -0
- package/src/dateInput/DateInput.tests.story.tsx +1 -0
- package/src/dateLookup/DateLookup.tests.story.tsx +1 -0
- package/src/header/Header.tests.story.tsx +1 -1
- package/src/inputs/SelectInput.spec.tsx +7 -3
- package/src/inputs/SelectInput.tsx +8 -14
- package/src/inputs/_BottomSheet.tsx +4 -7
- package/src/inputs/_Popover.tsx +0 -2
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +1 -1
- package/src/listItem/ListItem.spec.tsx +6 -8
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +1 -1
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.medium.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.neutral.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.personal.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.small.test.story.tsx +1 -1
- package/src/main.css +97 -77
- package/src/main.less +2 -1
- package/src/moneyInput/MoneyInput.spec.tsx +7 -26
- package/src/prompt/InlinePrompt/InlinePrompt.css +2 -23
- package/src/prompt/InlinePrompt/InlinePrompt.less +3 -18
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +6 -6
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +6 -7
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +41 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +37 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +70 -0
- package/src/prompt/PrimitivePrompt/index.ts +2 -0
- package/src/radioGroup/RadioGroup.test.story.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +1 -1
- package/src/snackbar/Snackbar.tests.story.tsx +1 -1
- package/src/stepper/Stepper.tests.story.tsx +1 -0
- package/src/summary/Summary.tests.story.tsx +1 -0
- package/src/title/Title.test.story.tsx +1 -0
- package/src/upload/Upload.tests.story.tsx +1 -0
- package/src/uploadInput/UploadInput.tests.story.tsx +1 -0
- package/src/withId/withId.story.tsx +1 -1
package/src/inputs/_Popover.tsx
CHANGED
|
@@ -51,7 +51,6 @@ export function Popover({
|
|
|
51
51
|
onCloseEnd,
|
|
52
52
|
}: PopoverProps) {
|
|
53
53
|
const { refs, floatingStyles, context } = useFloating<Element>({
|
|
54
|
-
strategy: 'fixed',
|
|
55
54
|
placement,
|
|
56
55
|
middleware: [
|
|
57
56
|
offset(8),
|
|
@@ -93,7 +92,6 @@ export function Popover({
|
|
|
93
92
|
<FloatingPortal>
|
|
94
93
|
<ThemeProvider theme="personal" screenMode={theme === 'personal' ? screenMode : 'light'}>
|
|
95
94
|
<Transition
|
|
96
|
-
as="div"
|
|
97
95
|
show={open}
|
|
98
96
|
leave="transition-opacity"
|
|
99
97
|
leaveTo="opacity-0"
|
|
@@ -1526,10 +1526,9 @@ describe('ListItem', () => {
|
|
|
1526
1526
|
);
|
|
1527
1527
|
expect(screen.queryByText(prompt)).not.toBeInTheDocument();
|
|
1528
1528
|
expect(screen.getByText(disabledPromptMessage)).toBeInTheDocument();
|
|
1529
|
-
expect(
|
|
1530
|
-
'
|
|
1531
|
-
|
|
1532
|
-
);
|
|
1529
|
+
expect(
|
|
1530
|
+
screen.getByTestId('InlinePrompt_Muted').parentNode?.parentNode?.parentNode,
|
|
1531
|
+
).toHaveAttribute('id', expect.stringMatching(/_prompt$/));
|
|
1533
1532
|
});
|
|
1534
1533
|
|
|
1535
1534
|
it('should render muted prompt if disabled and disabledPromptMessage are set', () => {
|
|
@@ -1537,10 +1536,9 @@ describe('ListItem', () => {
|
|
|
1537
1536
|
<ListItem title="Test Title" disabled disabledPromptMessage={disabledPromptMessage} />,
|
|
1538
1537
|
);
|
|
1539
1538
|
expect(screen.getByText(disabledPromptMessage)).toBeInTheDocument();
|
|
1540
|
-
expect(
|
|
1541
|
-
'
|
|
1542
|
-
|
|
1543
|
-
);
|
|
1539
|
+
expect(
|
|
1540
|
+
screen.getByTestId('InlinePrompt_Muted').parentNode?.parentNode?.parentNode,
|
|
1541
|
+
).toHaveAttribute('id', expect.stringMatching(/_prompt$/));
|
|
1544
1542
|
});
|
|
1545
1543
|
});
|
|
1546
1544
|
});
|
|
@@ -21,7 +21,7 @@ const waitForListItem = async (canvas: ReturnType<typeof within>, timeout = 3000
|
|
|
21
21
|
export default {
|
|
22
22
|
component: ListItem,
|
|
23
23
|
title: 'Content/ListItem/tests/focus',
|
|
24
|
-
tags: ['!autodocs'],
|
|
24
|
+
tags: ['!autodocs', '!manifest'],
|
|
25
25
|
parameters: {
|
|
26
26
|
controls: { disable: true },
|
|
27
27
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: bright-green',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: dark',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/theme: forest-green',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/cq: medium',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -11,7 +11,7 @@ import { VariantStory } from './helpers';
|
|
|
11
11
|
export default {
|
|
12
12
|
component: ListItem,
|
|
13
13
|
title: 'Content/ListItem/tests/variants/theme: personal',
|
|
14
|
-
tags: ['!autodocs'],
|
|
14
|
+
tags: ['!autodocs', '!manifest'],
|
|
15
15
|
parameters: {
|
|
16
16
|
controls: { disable: true },
|
|
17
17
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { allModes } from '../../../../.storybook/modes';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/rtl',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
|
@@ -6,7 +6,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
8
|
title: 'Content/ListItem/tests/variants/cq: small',
|
|
9
|
-
tags: ['!autodocs'],
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
12
12
|
actions: { disable: true },
|
package/src/main.css
CHANGED
|
@@ -920,83 +920,6 @@
|
|
|
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
|
-
}
|
|
1000
923
|
.np-dot {
|
|
1001
924
|
--np-dot-size: 14px;
|
|
1002
925
|
position: relative;
|
|
@@ -5412,6 +5335,103 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5412
5335
|
.np-CardGroup .np-Card.np-Card--promoCard {
|
|
5413
5336
|
max-width: 100%;
|
|
5414
5337
|
}
|
|
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
|
+
}
|
|
5415
5435
|
.wds-radio-group .np-radio:last-child label {
|
|
5416
5436
|
margin-bottom: 0;
|
|
5417
5437
|
}
|
package/src/main.less
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
@import "./actionOption/ActionOption.less";
|
|
7
7
|
@import "./alert/Alert.less";
|
|
8
8
|
@import "./avatar/Avatar.less";
|
|
9
|
-
@import "./prompt/InlinePrompt/InlinePrompt.less";
|
|
10
9
|
@import "./avatarView/AvatarView.less";
|
|
11
10
|
@import "./avatarLayout/AvatarLayout.less";
|
|
12
11
|
@import "./iconButton/IconButton.less";
|
|
@@ -61,6 +60,8 @@
|
|
|
61
60
|
@import "./phoneNumberInput/PhoneNumberInput.less";
|
|
62
61
|
@import "./popover/Popover.less";
|
|
63
62
|
@import "./promoCard/PromoCard.less";
|
|
63
|
+
@import "./prompt/PrimitivePrompt/PrimitivePrompt.less";
|
|
64
|
+
@import "./prompt/InlinePrompt/InlinePrompt.less";
|
|
64
65
|
@import "./radioGroup/RadioGroup.less";
|
|
65
66
|
@import "./section/Section.less";
|
|
66
67
|
@import "./slidingPanel/SlidingPanel.less";
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { mockAnimationsApi } from 'jsdom-testing-mocks';
|
|
2
1
|
import {
|
|
3
2
|
mockMatchMedia,
|
|
3
|
+
mockRequestAnimationFrame,
|
|
4
4
|
mockResizeObserver,
|
|
5
5
|
render,
|
|
6
6
|
screen,
|
|
7
7
|
userEvent,
|
|
8
|
-
waitFor,
|
|
9
|
-
within,
|
|
10
8
|
} from '../test-utils';
|
|
11
9
|
|
|
12
10
|
import { MoneyInput, CurrencyItem, CurrencyOptionItem, Field } from '..';
|
|
13
11
|
import { MoneyInputPropsWithInputAttributes } from './MoneyInput';
|
|
12
|
+
import { within } from '@testing-library/react';
|
|
14
13
|
import messages from './MoneyInput.messages';
|
|
15
14
|
|
|
16
15
|
mockMatchMedia();
|
|
17
16
|
mockResizeObserver();
|
|
18
|
-
|
|
17
|
+
mockRequestAnimationFrame();
|
|
19
18
|
|
|
20
19
|
describe('Money Input', () => {
|
|
21
20
|
const popularCurrencies: CurrencyOptionItem[] = [
|
|
@@ -115,30 +114,12 @@ describe('Money Input', () => {
|
|
|
115
114
|
it('calls onCurrencyChange when the user selects a different currency', async () => {
|
|
116
115
|
customRender();
|
|
117
116
|
await openDropdown();
|
|
118
|
-
await userEvent.keyboard('eur');
|
|
119
|
-
|
|
120
|
-
expect(screen.getAllByRole('option')).toHaveLength(1);
|
|
121
|
-
});
|
|
122
|
-
await userEvent.keyboard('{Enter}');
|
|
123
|
-
|
|
124
|
-
await waitFor(() => {
|
|
125
|
-
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(1);
|
|
126
|
-
});
|
|
117
|
+
await userEvent.keyboard('eur{Enter}');
|
|
118
|
+
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(1);
|
|
127
119
|
expect(initialProps.onCurrencyChange).toHaveBeenCalledWith(popularCurrencies[0]);
|
|
128
|
-
|
|
129
|
-
await waitFor(() => {
|
|
130
|
-
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
131
|
-
});
|
|
132
120
|
await openDropdown();
|
|
133
|
-
await userEvent.keyboard('gbp');
|
|
134
|
-
|
|
135
|
-
expect(screen.getAllByRole('option')).toHaveLength(1);
|
|
136
|
-
});
|
|
137
|
-
await userEvent.keyboard('{Enter}');
|
|
138
|
-
|
|
139
|
-
await waitFor(() => {
|
|
140
|
-
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(2);
|
|
141
|
-
});
|
|
121
|
+
await userEvent.keyboard('gbp{Enter}');
|
|
122
|
+
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(2);
|
|
142
123
|
expect(initialProps.onCurrencyChange).toHaveBeenCalledWith(popularCurrencies[2]);
|
|
143
124
|
});
|
|
144
125
|
|
|
@@ -1,18 +1,9 @@
|
|
|
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);
|
|
2
4
|
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);
|
|
12
5
|
border-radius: 10px;
|
|
13
6
|
border-radius: var(--radius-small);
|
|
14
|
-
word-break: break-word;
|
|
15
|
-
word-wrap: break-word;
|
|
16
7
|
}
|
|
17
8
|
.wds-inline-prompt:has(a),
|
|
18
9
|
.wds-inline-prompt:has(button) {
|
|
@@ -54,18 +45,6 @@
|
|
|
54
45
|
position: absolute;
|
|
55
46
|
inset: 0;
|
|
56
47
|
}
|
|
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
|
-
}
|
|
69
48
|
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
70
49
|
width: 16px;
|
|
71
50
|
width: var(--size-16);
|
|
@@ -1,13 +1,9 @@
|
|
|
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
5
|
display: inline-flex;
|
|
3
|
-
text-align: left;
|
|
4
|
-
padding-top: calc(var(--padding-x-small) / 2);
|
|
5
|
-
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
6
|
-
padding-left: calc(var(--padding-x-small) - 1px);
|
|
7
|
-
padding-right: var(--padding-x-small);
|
|
8
6
|
border-radius: var(--radius-small);
|
|
9
|
-
word-break: break-word;
|
|
10
|
-
overflow-wrap: break-word;
|
|
11
7
|
|
|
12
8
|
&:has(a),
|
|
13
9
|
&:has(button) {
|
|
@@ -54,17 +50,6 @@
|
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
&__media-wrapper {
|
|
58
|
-
padding-right: calc(var(--size-12) / 2);
|
|
59
|
-
padding-top: calc(var(--size-4) - 1px);
|
|
60
|
-
padding-bottom: calc(var(--size-4) - 1px);
|
|
61
|
-
|
|
62
|
-
.tw-icon-tags,
|
|
63
|
-
.tw-icon-confetti {
|
|
64
|
-
color: var(--color-sentiment-content-primary);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
53
|
.wds-inline-prompt-process-indicator {
|
|
69
54
|
width: var(--size-16);
|
|
70
55
|
height: var(--size-16);
|
|
@@ -32,8 +32,8 @@ describe('InlinePrompt', () => {
|
|
|
32
32
|
describe(sentiment, () => {
|
|
33
33
|
it('should apply correct styles', () => {
|
|
34
34
|
render(<InlinePrompt {...defaultProps} sentiment={sentiment} />);
|
|
35
|
-
expect(screen.getByText('Prompt message').parentElement).toHaveClass(
|
|
36
|
-
`wds-
|
|
35
|
+
expect(screen.getByText('Prompt message').parentElement?.parentElement).toHaveClass(
|
|
36
|
+
`wds-prompt--${sentiment === Sentiment.POSITIVE ? 'success' : sentiment}`,
|
|
37
37
|
);
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -47,7 +47,7 @@ describe('InlinePrompt', () => {
|
|
|
47
47
|
describe('muted state', () => {
|
|
48
48
|
it('should render icon and apply css', () => {
|
|
49
49
|
render(<InlinePrompt {...defaultProps} muted sentiment={sentiment} />);
|
|
50
|
-
expect(screen.getByText('Prompt message').parentElement).toHaveClass(
|
|
50
|
+
expect(screen.getByText('Prompt message').parentElement?.parentElement).toHaveClass(
|
|
51
51
|
'wds-inline-prompt--muted',
|
|
52
52
|
);
|
|
53
53
|
expect(screen.getByTestId('InlinePrompt_Muted')).toBeInTheDocument();
|
|
@@ -63,7 +63,7 @@ describe('InlinePrompt', () => {
|
|
|
63
63
|
describe('loading state', () => {
|
|
64
64
|
it('should render icon and apply css', () => {
|
|
65
65
|
render(<InlinePrompt {...defaultProps} sentiment={sentiment} loading />);
|
|
66
|
-
expect(screen.getByText('Prompt message').parentElement).toHaveClass(
|
|
66
|
+
expect(screen.getByText('Prompt message').parentElement?.parentElement).toHaveClass(
|
|
67
67
|
'wds-inline-prompt--loading',
|
|
68
68
|
);
|
|
69
69
|
expect(screen.getByTestId('InlinePrompt_ProcessIndicator')).toBeInTheDocument();
|
|
@@ -134,7 +134,7 @@ describe('InlinePrompt', () => {
|
|
|
134
134
|
);
|
|
135
135
|
const el = screen.getByTestId('prompt');
|
|
136
136
|
// The component should have both the original class and the SentimentSurface class
|
|
137
|
-
expect(el).toHaveClass('wds-
|
|
137
|
+
expect(el).toHaveClass('wds-prompt--success');
|
|
138
138
|
expect(el).toHaveClass('wds-sentiment-surface');
|
|
139
139
|
});
|
|
140
140
|
|
|
@@ -143,7 +143,7 @@ describe('InlinePrompt', () => {
|
|
|
143
143
|
<InlinePrompt {...defaultProps} sentiment={Sentiment.NEGATIVE} data-testid="prompt" />,
|
|
144
144
|
);
|
|
145
145
|
const el = screen.getByTestId('prompt');
|
|
146
|
-
expect(el).toHaveClass('wds-
|
|
146
|
+
expect(el).toHaveClass('wds-prompt--negative');
|
|
147
147
|
expect(el).toHaveClass('wds-sentiment-surface');
|
|
148
148
|
});
|
|
149
149
|
});
|
|
@@ -4,7 +4,7 @@ import ProcessIndicator from '../../processIndicator';
|
|
|
4
4
|
import StatusIcon from '../../statusIcon';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import Body from '../../body';
|
|
7
|
-
import
|
|
7
|
+
import { PrimitivePrompt } from '../PrimitivePrompt';
|
|
8
8
|
|
|
9
9
|
export type InlinePromptProps = {
|
|
10
10
|
/**
|
|
@@ -60,7 +60,7 @@ export const InlinePrompt = ({
|
|
|
60
60
|
mediaLabel,
|
|
61
61
|
width = 'auto',
|
|
62
62
|
'data-testid': dataTestId,
|
|
63
|
-
...
|
|
63
|
+
...restProps
|
|
64
64
|
}: InlinePromptProps) => {
|
|
65
65
|
const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;
|
|
66
66
|
|
|
@@ -87,12 +87,12 @@ export const InlinePrompt = ({
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
|
-
<
|
|
90
|
+
<PrimitivePrompt
|
|
91
91
|
sentiment={surfaceSentiment}
|
|
92
|
+
media={renderMedia()}
|
|
92
93
|
data-testid={dataTestId}
|
|
93
94
|
className={clsx(
|
|
94
95
|
'wds-inline-prompt',
|
|
95
|
-
`wds-inline-prompt--${sentiment}`,
|
|
96
96
|
{
|
|
97
97
|
'wds-inline-prompt--full-width': width === 'full',
|
|
98
98
|
'wds-inline-prompt--muted': muted,
|
|
@@ -100,10 +100,9 @@ export const InlinePrompt = ({
|
|
|
100
100
|
},
|
|
101
101
|
className,
|
|
102
102
|
)}
|
|
103
|
-
{...
|
|
103
|
+
{...restProps}
|
|
104
104
|
>
|
|
105
|
-
<div className="wds-inline-prompt__media-wrapper">{renderMedia()}</div>
|
|
106
105
|
<Body>{children}</Body>
|
|
107
|
-
</
|
|
106
|
+
</PrimitivePrompt>
|
|
108
107
|
);
|
|
109
108
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.wds-prompt {
|
|
2
|
+
border-radius: 10px;
|
|
3
|
+
border-radius: var(--radius-small);
|
|
4
|
+
display: flex;
|
|
5
|
+
word-wrap: break-word;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
8
|
+
text-align: left;
|
|
9
|
+
word-break: break-word;
|
|
10
|
+
}
|
|
11
|
+
.wds-prompt__content-wrapper {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-gap: 16px;
|
|
14
|
+
grid-gap: var(--Prompt-gap, var(--size-16));
|
|
15
|
+
gap: 16px;
|
|
16
|
+
gap: var(--Prompt-gap, var(--size-16));
|
|
17
|
+
grid-template-columns: auto 1fr;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
.wds-prompt__media-wrapper {
|
|
21
|
+
align-self: flex-start;
|
|
22
|
+
padding-top: calc(4px - 1px);
|
|
23
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
24
|
+
}
|
|
25
|
+
.wds-prompt__media-wrapper .tw-icon-tags,
|
|
26
|
+
.wds-prompt__media-wrapper .tw-icon-confetti {
|
|
27
|
+
color: var(--color-sentiment-content-primary);
|
|
28
|
+
}
|
|
29
|
+
.wds-prompt__actions-wrapper {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
34
|
+
grid-column-start: 2;
|
|
35
|
+
}
|
|
36
|
+
@media (max-width: 991px) {
|
|
37
|
+
.wds-prompt__actions-wrapper {
|
|
38
|
+
grid-column: span 2;
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.wds-prompt {
|
|
2
|
+
border-radius: var(--radius-small);
|
|
3
|
+
display: flex;
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
6
|
+
text-align: left;
|
|
7
|
+
word-break: break-word;
|
|
8
|
+
|
|
9
|
+
&__content-wrapper {
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: var(--Prompt-gap, var(--size-16));
|
|
12
|
+
grid-template-columns: auto 1fr;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__media-wrapper {
|
|
17
|
+
align-self: flex-start;
|
|
18
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
19
|
+
|
|
20
|
+
.tw-icon-tags,
|
|
21
|
+
.tw-icon-confetti {
|
|
22
|
+
color: var(--color-sentiment-content-primary);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__actions-wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
30
|
+
grid-column-start: 2;
|
|
31
|
+
|
|
32
|
+
@media (--screen-md-max) {
|
|
33
|
+
grid-column: span 2;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|