@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
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Sentiment } from '../../sentimentSurface';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export type PrimitivePromptProps = {
|
|
4
|
-
/**
|
|
5
|
-
* The sentiment determines the colour scheme
|
|
6
|
-
* @default success
|
|
7
|
-
*/
|
|
8
|
-
sentiment?: Sentiment;
|
|
9
|
-
/**
|
|
10
|
-
* Media to be displayed on the prompt (icon/image/etc).
|
|
11
|
-
*/
|
|
12
|
-
media: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Any actions to be displayed on the prompt.
|
|
15
|
-
*/
|
|
16
|
-
actions?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Handler called when the close button is clicked. If not provided, then the close button is hidden.
|
|
19
|
-
*/
|
|
20
|
-
onDismiss?: () => void;
|
|
21
|
-
id?: string;
|
|
22
|
-
className?: string;
|
|
23
|
-
'data-testid'?: string;
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.
|
|
28
|
-
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
29
|
-
export declare const PrimitivePrompt: ({ sentiment, media, actions, onDismiss, className, children, ...restProps }: PrimitivePromptProps) => import("react").JSX.Element;
|
|
30
|
-
//# sourceMappingURL=PrimitivePrompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIrE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;8GAE8G;AAC9G,eAAO,MAAM,eAAe,GAAI,6EAQ7B,oBAAoB,gCA0BtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Cross } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import SentimentSurface, { Sentiment } from '../../sentimentSurface';
|
|
4
|
-
import IconButton from '../../iconButton';
|
|
5
|
-
import { useIntl } from 'react-intl';
|
|
6
|
-
import closeBtnMessages from '../../common/closeButton/CloseButton.messages';
|
|
7
|
-
import { ReactNode } from 'react';
|
|
8
|
-
|
|
9
|
-
export type PrimitivePromptProps = {
|
|
10
|
-
/**
|
|
11
|
-
* The sentiment determines the colour scheme
|
|
12
|
-
* @default success
|
|
13
|
-
*/
|
|
14
|
-
sentiment?: Sentiment;
|
|
15
|
-
/**
|
|
16
|
-
* Media to be displayed on the prompt (icon/image/etc).
|
|
17
|
-
*/
|
|
18
|
-
media: ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Any actions to be displayed on the prompt.
|
|
21
|
-
*/
|
|
22
|
-
actions?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Handler called when the close button is clicked. If not provided, then the close button is hidden.
|
|
25
|
-
*/
|
|
26
|
-
onDismiss?: () => void;
|
|
27
|
-
id?: string;
|
|
28
|
-
className?: string;
|
|
29
|
-
'data-testid'?: string;
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.
|
|
35
|
-
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
36
|
-
export const PrimitivePrompt = ({
|
|
37
|
-
sentiment = 'success',
|
|
38
|
-
media,
|
|
39
|
-
actions,
|
|
40
|
-
onDismiss,
|
|
41
|
-
className,
|
|
42
|
-
children,
|
|
43
|
-
...restProps
|
|
44
|
-
}: PrimitivePromptProps) => {
|
|
45
|
-
const intl = useIntl();
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<SentimentSurface
|
|
49
|
-
sentiment={sentiment}
|
|
50
|
-
className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}
|
|
51
|
-
{...restProps}
|
|
52
|
-
>
|
|
53
|
-
<div className="wds-prompt__content-wrapper">
|
|
54
|
-
<div className={clsx('wds-prompt__media-wrapper')}>{media}</div>
|
|
55
|
-
{children}
|
|
56
|
-
{actions && <div className="wds-prompt__actions-wrapper">{actions}</div>}
|
|
57
|
-
</div>
|
|
58
|
-
{onDismiss && (
|
|
59
|
-
<IconButton
|
|
60
|
-
size={24}
|
|
61
|
-
priority="secondary"
|
|
62
|
-
aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}
|
|
63
|
-
onClick={onDismiss}
|
|
64
|
-
>
|
|
65
|
-
<Cross />
|
|
66
|
-
</IconButton>
|
|
67
|
-
)}
|
|
68
|
-
</SentimentSurface>
|
|
69
|
-
);
|
|
70
|
-
};
|