@transferwise/components 46.116.0 → 46.117.0
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/alert/Alert.js +2 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +2 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/main.css +60 -139
- package/build/prompt/InlinePrompt/InlinePrompt.js +14 -8
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +15 -9
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/sentimentSurface/SentimentSurface.js +6 -5
- package/build/sentimentSurface/SentimentSurface.js.map +1 -1
- package/build/sentimentSurface/SentimentSurface.mjs +6 -5
- package/build/sentimentSurface/SentimentSurface.mjs.map +1 -1
- package/build/styles/button/Button.css +17 -17
- package/build/styles/button/Button.vars.css +16 -16
- package/build/styles/iconButton/IconButton.css +8 -8
- package/build/styles/inputs/Input.css +2 -4
- package/build/styles/inputs/TextArea.css +2 -4
- package/build/styles/link/Link.css +1 -0
- package/build/styles/main.css +60 -139
- package/build/styles/popover/Popover.css +2 -4
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +26 -105
- package/build/styles/sentimentSurface/SentimentSurface.css +4 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +19 -3
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/sentimentSurface/SentimentSurface.d.ts +5 -4
- package/build/types/sentimentSurface/SentimentSurface.d.ts.map +1 -1
- package/build/types/sentimentSurface/SentimentSurface.types.d.ts +4 -16
- package/build/types/sentimentSurface/SentimentSurface.types.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +24 -0
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/alert/Alert.tsx +3 -1
- package/src/button/Button.css +17 -17
- package/src/button/Button.less +1 -1
- package/src/button/Button.story.tsx +75 -110
- package/src/button/Button.tests.story.tsx +189 -0
- package/src/button/Button.vars.css +16 -16
- package/src/button/Button.vars.less +58 -18
- package/src/iconButton/IconButton.css +8 -8
- package/src/iconButton/IconButton.less +35 -4
- package/src/iconButton/IconButton.story.tsx +72 -3
- package/src/inputs/Input.css +2 -4
- package/src/inputs/TextArea.css +2 -4
- package/src/link/Link.css +1 -0
- package/src/link/Link.less +1 -0
- package/src/link/Link.story.tsx +28 -0
- package/src/main.css +60 -139
- package/src/popover/Popover.css +2 -4
- package/src/prompt/InlinePrompt/InlinePrompt.css +26 -105
- package/src/prompt/InlinePrompt/InlinePrompt.less +31 -119
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +87 -29
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +223 -31
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +42 -11
- package/src/sentimentSurface/SentimentSurface.css +4 -1
- package/src/sentimentSurface/SentimentSurface.docs.mdx +37 -478
- package/src/sentimentSurface/SentimentSurface.less +118 -114
- package/src/sentimentSurface/SentimentSurface.spec.tsx +31 -11
- package/src/sentimentSurface/SentimentSurface.story.tsx +325 -147
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +85 -86
- package/src/sentimentSurface/SentimentSurface.tsx +16 -9
- package/src/sentimentSurface/SentimentSurface.types.ts +5 -20
- package/src/test-utils/story-config.ts +0 -1
- package/build/sentimentSurface/classMap.js +0 -17
- package/build/sentimentSurface/classMap.js.map +0 -1
- package/build/sentimentSurface/classMap.mjs +0 -14
- package/build/sentimentSurface/classMap.mjs.map +0 -1
- package/build/types/sentimentSurface/classMap.d.ts +0 -4
- package/build/types/sentimentSurface/classMap.d.ts.map +0 -1
- package/src/sentimentSurface/classMap.ts +0 -15
|
@@ -1,99 +1,32 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeProvider, type Theming } from '@wise/components-theming';
|
|
3
3
|
import SentimentSurface from './SentimentSurface';
|
|
4
|
-
import
|
|
4
|
+
import Button from '../button';
|
|
5
|
+
import type { Sentiment, Emphasis } from './SentimentSurface.types';
|
|
6
|
+
|
|
7
|
+
const sentiments: Sentiment[] = ['negative', 'success', 'proposition', 'warning', 'neutral'];
|
|
8
|
+
const emphasisLevels: Emphasis[] = ['base', 'elevated'];
|
|
9
|
+
|
|
10
|
+
// Themes that support light/dark screen modes
|
|
11
|
+
const themesWithScreenModes: Theming['theme'][] = ['personal', 'business', 'platform'];
|
|
12
|
+
// Themes that don't have light/dark variants
|
|
13
|
+
const themesWithoutScreenModes: Theming['theme'][] = [
|
|
14
|
+
'forest-green',
|
|
15
|
+
'bright-green',
|
|
16
|
+
'business--forest-green',
|
|
17
|
+
'business--bright-green',
|
|
18
|
+
'platform--forest-green',
|
|
19
|
+
];
|
|
20
|
+
const screenModes: Theming['screenMode'][] = ['light', 'dark'];
|
|
5
21
|
|
|
6
22
|
export default {
|
|
7
23
|
component: SentimentSurface,
|
|
8
24
|
title: 'Content/SentimentSurface/Tests',
|
|
25
|
+
tags: ['!autodocs'],
|
|
9
26
|
} satisfies Meta<typeof SentimentSurface>;
|
|
10
27
|
|
|
11
28
|
type Story = StoryObj<typeof SentimentSurface>;
|
|
12
29
|
|
|
13
|
-
export const AllSentiments: Story = {
|
|
14
|
-
render: () => (
|
|
15
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
16
|
-
<SentimentSurface sentiment="negative">
|
|
17
|
-
Negative sentiment - Your payment has failed
|
|
18
|
-
</SentimentSurface>
|
|
19
|
-
<SentimentSurface sentiment="warning">
|
|
20
|
-
Warning sentiment - Action required on your account
|
|
21
|
-
</SentimentSurface>
|
|
22
|
-
<SentimentSurface sentiment="neutral">
|
|
23
|
-
Neutral sentiment - Your account is up to date
|
|
24
|
-
</SentimentSurface>
|
|
25
|
-
<SentimentSurface sentiment="success">
|
|
26
|
-
Success sentiment - Your payment was successful
|
|
27
|
-
</SentimentSurface>
|
|
28
|
-
<SentimentSurface sentiment="proposition">
|
|
29
|
-
Proposition sentiment - Try our new feature
|
|
30
|
-
</SentimentSurface>
|
|
31
|
-
</div>
|
|
32
|
-
),
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const AllEmphasisLevels: Story = {
|
|
36
|
-
render: () => (
|
|
37
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
38
|
-
<SentimentSurface sentiment="neutral" emphasis="base">
|
|
39
|
-
Base emphasis (default)
|
|
40
|
-
</SentimentSurface>
|
|
41
|
-
<SentimentSurface sentiment="neutral" emphasis="elevated">
|
|
42
|
-
Elevated emphasis
|
|
43
|
-
</SentimentSurface>
|
|
44
|
-
</div>
|
|
45
|
-
),
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const PolymorphicRendering: Story = {
|
|
49
|
-
play: async ({ canvasElement }) => {
|
|
50
|
-
const canvas = within(canvasElement);
|
|
51
|
-
|
|
52
|
-
// Test that all elements are rendered with correct tags
|
|
53
|
-
const divElement = canvas.getByText('Rendered as div');
|
|
54
|
-
await expect(divElement.tagName).toBe('DIV');
|
|
55
|
-
|
|
56
|
-
const sectionElement = canvas.getByText('Rendered as section');
|
|
57
|
-
await expect(sectionElement.tagName).toBe('SECTION');
|
|
58
|
-
|
|
59
|
-
const articleElement = canvas.getByText('Rendered as article');
|
|
60
|
-
await expect(articleElement.tagName).toBe('ARTICLE');
|
|
61
|
-
},
|
|
62
|
-
render: () => (
|
|
63
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
64
|
-
<SentimentSurface sentiment="neutral">Rendered as div</SentimentSurface>
|
|
65
|
-
<SentimentSurface sentiment="success" as="section">
|
|
66
|
-
Rendered as section
|
|
67
|
-
</SentimentSurface>
|
|
68
|
-
<SentimentSurface sentiment="proposition" as="article">
|
|
69
|
-
Rendered as article
|
|
70
|
-
</SentimentSurface>
|
|
71
|
-
</div>
|
|
72
|
-
),
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const AllVariants = storyConfig(
|
|
76
|
-
{
|
|
77
|
-
render: () => (
|
|
78
|
-
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px' }}>
|
|
79
|
-
{(['negative', 'warning', 'neutral', 'success', 'proposition'] as const).map(
|
|
80
|
-
(sentiment) => (
|
|
81
|
-
<div key={sentiment} style={{ display: 'contents' }}>
|
|
82
|
-
<SentimentSurface sentiment={sentiment} emphasis="base">
|
|
83
|
-
{sentiment} - base
|
|
84
|
-
</SentimentSurface>
|
|
85
|
-
<SentimentSurface sentiment={sentiment} emphasis="elevated">
|
|
86
|
-
{sentiment} - elevated
|
|
87
|
-
</SentimentSurface>
|
|
88
|
-
</div>
|
|
89
|
-
),
|
|
90
|
-
)}
|
|
91
|
-
</div>
|
|
92
|
-
),
|
|
93
|
-
},
|
|
94
|
-
{ variants: ['default', 'dark'] },
|
|
95
|
-
);
|
|
96
|
-
|
|
97
30
|
export const NestedSentiments: Story = {
|
|
98
31
|
render: () => (
|
|
99
32
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
|
|
@@ -121,3 +54,69 @@ export const NestedSentiments: Story = {
|
|
|
121
54
|
</div>
|
|
122
55
|
),
|
|
123
56
|
};
|
|
57
|
+
|
|
58
|
+
const ButtonsGrid = () => (
|
|
59
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
60
|
+
{emphasisLevels.map((emphasis) =>
|
|
61
|
+
sentiments.map((sentiment) => (
|
|
62
|
+
<SentimentSurface
|
|
63
|
+
key={`${sentiment}-${emphasis}`}
|
|
64
|
+
sentiment={sentiment}
|
|
65
|
+
emphasis={emphasis}
|
|
66
|
+
style={{
|
|
67
|
+
backgroundColor: 'var(--color-sentiment-background-surface)',
|
|
68
|
+
color: 'var(--color-sentiment-content-primary)',
|
|
69
|
+
padding: '16px',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<span
|
|
73
|
+
style={{
|
|
74
|
+
marginRight: '16px',
|
|
75
|
+
textTransform: 'capitalize',
|
|
76
|
+
minWidth: '150px',
|
|
77
|
+
display: 'inline-block',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{sentiment} ({emphasis})
|
|
81
|
+
</span>
|
|
82
|
+
<Button v2>Primary</Button>
|
|
83
|
+
<Button v2 priority="secondary" style={{ marginLeft: '8px' }}>
|
|
84
|
+
Secondary
|
|
85
|
+
</Button>
|
|
86
|
+
<Button v2 priority="secondary-neutral" style={{ marginLeft: '8px' }}>
|
|
87
|
+
Secondary Neutral
|
|
88
|
+
</Button>
|
|
89
|
+
</SentimentSurface>
|
|
90
|
+
)),
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
export const ButtonsAcrossThemes: Story = {
|
|
96
|
+
render: () => (
|
|
97
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>
|
|
98
|
+
{/* Themes with light/dark screen modes */}
|
|
99
|
+
{themesWithScreenModes.map((theme) =>
|
|
100
|
+
screenModes.map((screenMode) => (
|
|
101
|
+
<ThemeProvider key={`${theme}-${screenMode}`} theme={theme} screenMode={screenMode}>
|
|
102
|
+
<div style={{ padding: '16px' }}>
|
|
103
|
+
<h3 style={{ margin: '0 0 16px 0', textTransform: 'capitalize' }}>
|
|
104
|
+
{theme} - {screenMode}
|
|
105
|
+
</h3>
|
|
106
|
+
<ButtonsGrid />
|
|
107
|
+
</div>
|
|
108
|
+
</ThemeProvider>
|
|
109
|
+
)),
|
|
110
|
+
)}
|
|
111
|
+
{/* Themes without light/dark variants */}
|
|
112
|
+
{themesWithoutScreenModes.map((theme) => (
|
|
113
|
+
<ThemeProvider key={theme} theme={theme}>
|
|
114
|
+
<div style={{ padding: '16px' }}>
|
|
115
|
+
<h3 style={{ margin: '0 0 16px 0', textTransform: 'capitalize' }}>{theme}</h3>
|
|
116
|
+
<ButtonsGrid />
|
|
117
|
+
</div>
|
|
118
|
+
</ThemeProvider>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
),
|
|
122
|
+
};
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
SentimentSurfaceComponentProps,
|
|
6
6
|
SentimentSurfaceComponent,
|
|
7
7
|
} from './SentimentSurface.types';
|
|
8
|
-
import { getSentimentSurfaceClassName } from './classMap';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
|
-
* SentimentSurface is a polymorphic container component that
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* SentimentSurface is a polymorphic container component that exposes and, optionally, applies
|
|
11
|
+
* contextual colour tokens as CSS custom properties, based on sentiment types (`negative`,
|
|
12
|
+
* `warning`, `neutral`, `success`, `proposition`).
|
|
14
13
|
*
|
|
15
14
|
* @param {ElementType} [as='div'] - Optional prop to override the HTML element rendered.
|
|
16
15
|
* @param {Sentiment} sentiment - Required prop to set the sentiment type (negative, warning, neutral, success, proposition).
|
|
17
16
|
* @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).
|
|
17
|
+
* @param {boolean} [hasBaseStyles=true] - If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.
|
|
18
18
|
* @param {ReactNode} [children] - Content to render inside the surface.
|
|
19
19
|
* @param {string} [className] - Additional CSS classes to apply.
|
|
20
20
|
* @param {CSSProperties} [style] - Inline styles to apply.
|
|
21
21
|
* @param {string} [id] - Unique identifier for the component.
|
|
22
|
-
* @param {string} [
|
|
22
|
+
* @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.
|
|
23
23
|
*
|
|
24
24
|
* @component
|
|
25
25
|
* @example
|
|
@@ -41,21 +41,28 @@ const SentimentSurface: SentimentSurfaceComponent = forwardRef(function Sentimen
|
|
|
41
41
|
as,
|
|
42
42
|
sentiment,
|
|
43
43
|
emphasis = 'base',
|
|
44
|
-
|
|
44
|
+
hasBaseStyles = true,
|
|
45
45
|
style,
|
|
46
|
+
className,
|
|
46
47
|
children,
|
|
47
48
|
id,
|
|
48
|
-
|
|
49
|
+
'data-testid': dataTestId,
|
|
49
50
|
...props
|
|
50
51
|
}: SentimentSurfaceComponentProps<T>,
|
|
51
52
|
ref: ForwardedRef<HTMLElement>,
|
|
52
53
|
) {
|
|
53
54
|
const Element = as ?? 'div';
|
|
54
|
-
const
|
|
55
|
+
const BASE_CLASS = 'wds-sentiment-surface';
|
|
56
|
+
const classNames = clsx(
|
|
57
|
+
BASE_CLASS,
|
|
58
|
+
`${BASE_CLASS}-${sentiment}-${emphasis}`,
|
|
59
|
+
hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,
|
|
60
|
+
className,
|
|
61
|
+
);
|
|
55
62
|
const sentimentProps = {
|
|
56
63
|
ref,
|
|
57
64
|
id,
|
|
58
|
-
'data-testid':
|
|
65
|
+
'data-testid': dataTestId,
|
|
59
66
|
className: classNames,
|
|
60
67
|
style,
|
|
61
68
|
...props,
|
|
@@ -32,35 +32,20 @@ export interface CommonProps {
|
|
|
32
32
|
emphasis?: Emphasis;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.
|
|
36
|
+
* @default true
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
hasBaseStyles?: boolean;
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
* Additional CSS classes
|
|
41
|
-
*/
|
|
40
|
+
children?: ReactNode;
|
|
42
41
|
className?: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Inline styles
|
|
46
|
-
*/
|
|
47
42
|
style?: CSSProperties;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Unique identifier for the component
|
|
51
|
-
*/
|
|
52
43
|
id?: string;
|
|
53
44
|
|
|
54
45
|
/**
|
|
55
46
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
56
47
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* `data-testid` is strictly controlled through the `testId` prop.
|
|
61
|
-
* This lets consumers know that this data attribute will not be applied.
|
|
62
|
-
*/
|
|
63
|
-
'data-testid'?: never;
|
|
48
|
+
'data-testid'?: string;
|
|
64
49
|
}
|
|
65
50
|
|
|
66
51
|
/**
|
|
@@ -53,7 +53,6 @@ const getViewportWidth = (viewport: (typeof viewports)[keyof typeof viewports])
|
|
|
53
53
|
* The key to 'Large mobile' viewport {@link viewports.mobile2}
|
|
54
54
|
*/
|
|
55
55
|
const mobileViewportKey = 'mobile2';
|
|
56
|
-
// @ts-expect-error viewports has mobile2 property (comes from ...MINIMAL_VIEWPORTS)
|
|
57
56
|
const mobileViewportWidth = getViewportWidth(viewports.mobile2);
|
|
58
57
|
|
|
59
58
|
const zoom400perViewportKey = 'mobile3';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const BASE_CLASS = 'wds-sentiment-surface';
|
|
4
|
-
const sentimentClassMap = {
|
|
5
|
-
negative: `${BASE_CLASS}-negative`,
|
|
6
|
-
warning: `${BASE_CLASS}-warning`,
|
|
7
|
-
neutral: `${BASE_CLASS}-neutral`,
|
|
8
|
-
success: `${BASE_CLASS}-success`,
|
|
9
|
-
proposition: `${BASE_CLASS}-proposition`
|
|
10
|
-
};
|
|
11
|
-
const getSentimentSurfaceClassName = (sentiment, emphasis) => {
|
|
12
|
-
return `${BASE_CLASS} ${sentimentClassMap[sentiment]}-${emphasis}`;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.getSentimentSurfaceClassName = getSentimentSurfaceClassName;
|
|
16
|
-
exports.sentimentClassMap = sentimentClassMap;
|
|
17
|
-
//# sourceMappingURL=classMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classMap.js","sources":["../../src/sentimentSurface/classMap.ts"],"sourcesContent":["import type { Sentiment, Emphasis } from './SentimentSurface.types';\n\nconst BASE_CLASS = 'wds-sentiment-surface';\n\nexport const sentimentClassMap: Record<Sentiment, string> = {\n negative: `${BASE_CLASS}-negative`,\n warning: `${BASE_CLASS}-warning`,\n neutral: `${BASE_CLASS}-neutral`,\n success: `${BASE_CLASS}-success`,\n proposition: `${BASE_CLASS}-proposition`,\n};\n\nexport const getSentimentSurfaceClassName = (sentiment: Sentiment, emphasis: Emphasis): string => {\n return `${BASE_CLASS} ${sentimentClassMap[sentiment]}-${emphasis}`;\n};\n"],"names":["BASE_CLASS","sentimentClassMap","negative","warning","neutral","success","proposition","getSentimentSurfaceClassName","sentiment","emphasis"],"mappings":";;AAEA,MAAMA,UAAU,GAAG,uBAAuB;AAEnC,MAAMC,iBAAiB,GAA8B;EAC1DC,QAAQ,EAAE,CAAA,EAAGF,UAAU,CAAA,SAAA,CAAW;EAClCG,OAAO,EAAE,CAAA,EAAGH,UAAU,CAAA,QAAA,CAAU;EAChCI,OAAO,EAAE,CAAA,EAAGJ,UAAU,CAAA,QAAA,CAAU;EAChCK,OAAO,EAAE,CAAA,EAAGL,UAAU,CAAA,QAAA,CAAU;EAChCM,WAAW,EAAE,GAAGN,UAAU,CAAA,YAAA;;MAGfO,4BAA4B,GAAGA,CAACC,SAAoB,EAAEC,QAAkB,KAAY;EAC/F,OAAO,CAAA,EAAGT,UAAU,CAAA,CAAA,EAAIC,iBAAiB,CAACO,SAAS,CAAC,CAAA,CAAA,EAAIC,QAAQ,CAAA,CAAE;AACpE;;;;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const BASE_CLASS = 'wds-sentiment-surface';
|
|
2
|
-
const sentimentClassMap = {
|
|
3
|
-
negative: `${BASE_CLASS}-negative`,
|
|
4
|
-
warning: `${BASE_CLASS}-warning`,
|
|
5
|
-
neutral: `${BASE_CLASS}-neutral`,
|
|
6
|
-
success: `${BASE_CLASS}-success`,
|
|
7
|
-
proposition: `${BASE_CLASS}-proposition`
|
|
8
|
-
};
|
|
9
|
-
const getSentimentSurfaceClassName = (sentiment, emphasis) => {
|
|
10
|
-
return `${BASE_CLASS} ${sentimentClassMap[sentiment]}-${emphasis}`;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { getSentimentSurfaceClassName, sentimentClassMap };
|
|
14
|
-
//# sourceMappingURL=classMap.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classMap.mjs","sources":["../../src/sentimentSurface/classMap.ts"],"sourcesContent":["import type { Sentiment, Emphasis } from './SentimentSurface.types';\n\nconst BASE_CLASS = 'wds-sentiment-surface';\n\nexport const sentimentClassMap: Record<Sentiment, string> = {\n negative: `${BASE_CLASS}-negative`,\n warning: `${BASE_CLASS}-warning`,\n neutral: `${BASE_CLASS}-neutral`,\n success: `${BASE_CLASS}-success`,\n proposition: `${BASE_CLASS}-proposition`,\n};\n\nexport const getSentimentSurfaceClassName = (sentiment: Sentiment, emphasis: Emphasis): string => {\n return `${BASE_CLASS} ${sentimentClassMap[sentiment]}-${emphasis}`;\n};\n"],"names":["BASE_CLASS","sentimentClassMap","negative","warning","neutral","success","proposition","getSentimentSurfaceClassName","sentiment","emphasis"],"mappings":"AAEA,MAAMA,UAAU,GAAG,uBAAuB;AAEnC,MAAMC,iBAAiB,GAA8B;EAC1DC,QAAQ,EAAE,CAAA,EAAGF,UAAU,CAAA,SAAA,CAAW;EAClCG,OAAO,EAAE,CAAA,EAAGH,UAAU,CAAA,QAAA,CAAU;EAChCI,OAAO,EAAE,CAAA,EAAGJ,UAAU,CAAA,QAAA,CAAU;EAChCK,OAAO,EAAE,CAAA,EAAGL,UAAU,CAAA,QAAA,CAAU;EAChCM,WAAW,EAAE,GAAGN,UAAU,CAAA,YAAA;;MAGfO,4BAA4B,GAAGA,CAACC,SAAoB,EAAEC,QAAkB,KAAY;EAC/F,OAAO,CAAA,EAAGT,UAAU,CAAA,CAAA,EAAIC,iBAAiB,CAACO,SAAS,CAAC,CAAA,CAAA,EAAIC,QAAQ,CAAA,CAAE;AACpE;;;;"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Sentiment, Emphasis } from './SentimentSurface.types';
|
|
2
|
-
export declare const sentimentClassMap: Record<Sentiment, string>;
|
|
3
|
-
export declare const getSentimentSurfaceClassName: (sentiment: Sentiment, emphasis: Emphasis) => string;
|
|
4
|
-
//# sourceMappingURL=classMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classMap.d.ts","sourceRoot":"","sources":["../../../src/sentimentSurface/classMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,WAAW,SAAS,EAAE,UAAU,QAAQ,KAAG,MAEvF,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Sentiment, Emphasis } from './SentimentSurface.types';
|
|
2
|
-
|
|
3
|
-
const BASE_CLASS = 'wds-sentiment-surface';
|
|
4
|
-
|
|
5
|
-
export const sentimentClassMap: Record<Sentiment, string> = {
|
|
6
|
-
negative: `${BASE_CLASS}-negative`,
|
|
7
|
-
warning: `${BASE_CLASS}-warning`,
|
|
8
|
-
neutral: `${BASE_CLASS}-neutral`,
|
|
9
|
-
success: `${BASE_CLASS}-success`,
|
|
10
|
-
proposition: `${BASE_CLASS}-proposition`,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const getSentimentSurfaceClassName = (sentiment: Sentiment, emphasis: Emphasis): string => {
|
|
14
|
-
return `${BASE_CLASS} ${sentimentClassMap[sentiment]}-${emphasis}`;
|
|
15
|
-
};
|