@transferwise/components 46.117.1 → 46.119.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/dateLookup/dayCalendar/DayCalendar.js +4 -4
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -4
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.js +4 -4
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.js +4 -4
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
- package/build/dimmer/Dimmer.js +4 -4
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/index.js +4 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +2 -0
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +4 -4
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +4 -4
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +2 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +2 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +2 -2
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +2 -2
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +3 -3
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCardGroup.js +2 -2
- package/build/promoCard/PromoCardGroup.js.map +1 -1
- package/build/promoCard/PromoCardGroup.mjs +2 -2
- package/build/promoCard/PromoCardGroup.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +8 -3
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +8 -3
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +2 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +2 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +2 -2
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +9 -2
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/upload/Upload.js +2 -2
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +2 -2
- package/build/upload/Upload.mjs.map +1 -1
- package/package.json +37 -37
- package/src/accordion/AccordionItem/__snapshots__/AccordionItem.spec.js.snap +1 -1
- package/src/accordion/__snapshots__/Accordion.spec.js.snap +1 -1
- package/src/actionButton/__snapshots__/ActionButton.spec.tsx.snap +1 -1
- package/src/alert/Alert.story.tsx +1 -1
- package/src/alert/Alert.tests.story.tsx +1 -1
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +1 -1
- package/src/button/Button.vars.less +28 -7
- package/src/checkbox/__snapshots__/Checkbox.spec.tsx.snap +1 -1
- package/src/chevron/__snapshots__/Chevron.spec.tsx.snap +1 -1
- package/src/chips/__snapshots__/Chips.spec.tsx.snap +1 -1
- package/src/common/RadioButton/__snapshots__/RadioButton.spec.tsx.snap +1 -1
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -1
- package/src/common/card/__snapshots__/Card.spec.tsx.snap +1 -1
- package/src/common/closeButton/__snapshots__/CloseButton.spec.tsx.snap +1 -1
- package/src/common/flowHeader/__snapshots__/FlowHeader.spec.tsx.snap +1 -1
- package/src/common/panel/__snapshots__/Panel.spec.tsx.snap +1 -1
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -1
- package/src/iconButton/IconButton.story.tsx +2 -2
- package/src/index.ts +4 -0
- package/src/inlineAlert/InlineAlert.story.tsx +1 -1
- package/src/inputs/SelectInput.tsx +21 -19
- package/src/link/Link.story.tsx +2 -2
- package/src/listItem/Prompt/ListItemPrompt.spec.tsx +48 -0
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +1 -0
- package/src/listItem/Prompt/ListItemPrompt.tsx +7 -2
- package/src/logo/__snapshots__/Logo.spec.tsx.snap +1 -1
- package/src/nudge/Nudge.story.tsx +1 -1
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +1 -1
- package/src/popover/__snapshots__/Popover.spec.tsx.snap +1 -1
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +1 -1
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +1 -1
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +29 -1
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +45 -4
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +12 -4
- package/src/provider/theme/ThemeProvider.story.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.story.tsx +163 -102
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +6 -2
- package/src/tile/__snapshots__/Tile.spec.tsx.snap +1 -1
- package/src/{neptune-css/NeptuneCSS.story.tsx → tokens/tokens.story.tsx} +2 -2
- package/src/tooltip/__snapshots__/Tooltip.spec.tsx.snap +1 -1
- package/src/withId/withId.story.tsx +1 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { Defrost } from '@transferwise/icons';
|
|
2
|
+
import { Bank, Defrost } from '@transferwise/icons';
|
|
3
3
|
import Body from '../body';
|
|
4
4
|
import Button from '../button';
|
|
5
5
|
import Header from '../header';
|
|
6
6
|
import Link from '../link';
|
|
7
7
|
import IconButton from '../iconButton';
|
|
8
8
|
import StatusIcon from '../statusIcon';
|
|
9
|
+
import AvatarView from '../avatarView';
|
|
9
10
|
import SentimentSurface from './SentimentSurface';
|
|
10
11
|
import type { Sentiment, Emphasis } from './SentimentSurface.types';
|
|
11
12
|
|
|
@@ -30,7 +31,7 @@ const withComponentGrid = (Story: () => JSX.Element) => (
|
|
|
30
31
|
*/
|
|
31
32
|
const meta: Meta<typeof SentimentSurface> = {
|
|
32
33
|
component: SentimentSurface,
|
|
33
|
-
title: '
|
|
34
|
+
title: 'Foundations/SentimentSurface',
|
|
34
35
|
argTypes: {
|
|
35
36
|
sentiment: {
|
|
36
37
|
control: 'select',
|
|
@@ -228,12 +229,12 @@ export const EmphasisLevels: Story = {
|
|
|
228
229
|
|
|
229
230
|
/**
|
|
230
231
|
* By default, `SentimentSurface` exposes the tokens as CSS custom properties and also applies
|
|
231
|
-
* the base styles for `background-color` and `color`.
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
232
|
+
* the base styles for `background-color` and `color`. However, you can choose to expose said
|
|
233
|
+
* properties without rendering them, by setting the `hasBaseStyles` prop to `false`.
|
|
234
|
+
* This is useful when you want to create custom components that adapt to the sentiment context
|
|
235
|
+
* without applying default styles.
|
|
235
236
|
*/
|
|
236
|
-
export const
|
|
237
|
+
export const RenderingBaseStyles: Story = {
|
|
237
238
|
render: (args) => (
|
|
238
239
|
<>
|
|
239
240
|
<SentimentSurface
|
|
@@ -243,8 +244,8 @@ export const BaseStyles: Story = {
|
|
|
243
244
|
<div className="p-a-2">This example exposes and applies the tokens.</div>
|
|
244
245
|
</SentimentSurface>
|
|
245
246
|
<SentimentSurface
|
|
246
|
-
hasBaseStyles={false}
|
|
247
247
|
sentiment="success"
|
|
248
|
+
hasBaseStyles={false}
|
|
248
249
|
style={{ border: `1px dashed var(--color-sentiment-content-primary)` }}
|
|
249
250
|
>
|
|
250
251
|
<div className="p-a-2">This example only exposes the tokens without applying them.</div>
|
|
@@ -260,85 +261,25 @@ export const BaseStyles: Story = {
|
|
|
260
261
|
</SentimentSurface>
|
|
261
262
|
</>
|
|
262
263
|
),
|
|
263
|
-
parameters: {
|
|
264
|
-
controls: { disable: true },
|
|
265
|
-
},
|
|
266
|
-
decorators: [withComponentGrid],
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* The component exposes token groups for all 5 sentiment types (`negative`, `warning`, `neutral`, `proposition` and `success`) each of them with two emphasis levels (`base` and `elevated`).
|
|
271
|
-
*/
|
|
272
|
-
export const ExposedTokens: Story = {
|
|
273
|
-
render: () => (
|
|
274
|
-
<section style={{ display: 'flex', flexDirection: 'column', gap: '32px', maxWidth: '100%' }}>
|
|
275
|
-
{sentiments.map((sentiment) =>
|
|
276
|
-
emphasisLevels.map((emphasis) => (
|
|
277
|
-
<SentimentSurface
|
|
278
|
-
key={`${sentiment}-${emphasis}`}
|
|
279
|
-
sentiment={sentiment}
|
|
280
|
-
emphasis={emphasis}
|
|
281
|
-
style={{
|
|
282
|
-
padding: '24px',
|
|
283
|
-
borderRadius: '16px',
|
|
284
|
-
}}
|
|
285
|
-
>
|
|
286
|
-
<h4
|
|
287
|
-
className="d-block m-b-2 text-capitalize np-text-title-body"
|
|
288
|
-
style={{
|
|
289
|
-
color: 'inherit',
|
|
290
|
-
}}
|
|
291
|
-
>
|
|
292
|
-
{sentiment} - {emphasis}
|
|
293
|
-
</h4>
|
|
294
|
-
<div
|
|
295
|
-
style={{
|
|
296
|
-
display: 'grid',
|
|
297
|
-
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
|
|
298
|
-
gap: '24px',
|
|
299
|
-
}}
|
|
300
|
-
>
|
|
301
|
-
{tokenCategories.map((category) => (
|
|
302
|
-
<div key={category.name}>
|
|
303
|
-
<h5
|
|
304
|
-
style={{
|
|
305
|
-
color: 'inherit',
|
|
306
|
-
fontSize: '12px',
|
|
307
|
-
fontWeight: 600,
|
|
308
|
-
marginBottom: '8px',
|
|
309
|
-
textTransform: 'uppercase',
|
|
310
|
-
letterSpacing: '0.5px',
|
|
311
|
-
opacity: 0.8,
|
|
312
|
-
}}
|
|
313
|
-
>
|
|
314
|
-
{category.name}
|
|
315
|
-
</h5>
|
|
316
|
-
{category.tokens.map((token) => (
|
|
317
|
-
<TokenSwatch key={token} token={token} />
|
|
318
|
-
))}
|
|
319
|
-
</div>
|
|
320
|
-
))}
|
|
321
|
-
</div>
|
|
322
|
-
</SentimentSurface>
|
|
323
|
-
)),
|
|
324
|
-
)}
|
|
325
|
-
</section>
|
|
326
|
-
),
|
|
327
264
|
parameters: {
|
|
328
265
|
controls: { disable: true },
|
|
329
266
|
docs: {
|
|
330
|
-
|
|
331
|
-
|
|
267
|
+
source: {
|
|
268
|
+
// Storybook strips out props that are set to false, so we need to hack it back in :/
|
|
269
|
+
transform: async (source: string) => {
|
|
270
|
+
if (source.includes('hasBaseStyles')) {
|
|
271
|
+
return source;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return source.replace(
|
|
275
|
+
/(<\/SentimentSurface>\s+<SentimentSurface(\s+)sentiment="success")/g,
|
|
276
|
+
'$1$2hasBaseStyles={false}',
|
|
277
|
+
);
|
|
278
|
+
},
|
|
332
279
|
},
|
|
333
280
|
},
|
|
334
281
|
},
|
|
335
|
-
decorators: [
|
|
336
|
-
(Story: () => JSX.Element) => (
|
|
337
|
-
<div style={{ padding: '2rem', maxWidth: '1200px' }}>
|
|
338
|
-
<Story />
|
|
339
|
-
</div>
|
|
340
|
-
),
|
|
341
|
-
],
|
|
282
|
+
decorators: [withComponentGrid],
|
|
342
283
|
};
|
|
343
284
|
|
|
344
285
|
/**
|
|
@@ -348,6 +289,12 @@ export const NestingSurfaces: Story = {
|
|
|
348
289
|
parameters: {
|
|
349
290
|
controls: { disable: true },
|
|
350
291
|
},
|
|
292
|
+
/**
|
|
293
|
+
* As agreed with the design team, this story is temporarily hidden from the public view until we
|
|
294
|
+
* have proper discussion and documentation around when and how to use nested SentimentSurfaces.
|
|
295
|
+
* This is to prevent misuse and confusion among consumers.
|
|
296
|
+
*/
|
|
297
|
+
tags: ['!dev', '!autodocs'],
|
|
351
298
|
render: (args) => {
|
|
352
299
|
return (
|
|
353
300
|
<SentimentSurface sentiment="success" emphasis="base" className="p-a-1">
|
|
@@ -364,7 +311,9 @@ export const NestingSurfaces: Story = {
|
|
|
364
311
|
};
|
|
365
312
|
|
|
366
313
|
/**
|
|
367
|
-
* Some DS components (namely `Button`, `StatusIcon`,
|
|
314
|
+
* Some DS components (namely `Button`, `Link`, `StatusIcon`, `IconButton`) automatically adapt to the sentiment context when used within a `SentimentSurface`. <br/>
|
|
315
|
+
*
|
|
316
|
+
* > ⚠️ You should not mix sentiments within the same surface. For example, avoid using a `StatusIcon` with `sentiment="negative"` inside a `SentimentSurface` with `sentiment="success"`.
|
|
368
317
|
*/
|
|
369
318
|
export const SentimentAwareComponents: Story = {
|
|
370
319
|
name: 'Sentiment-aware Components',
|
|
@@ -377,34 +326,71 @@ export const SentimentAwareComponents: Story = {
|
|
|
377
326
|
},
|
|
378
327
|
},
|
|
379
328
|
render: function Render(args) {
|
|
380
|
-
const
|
|
381
|
-
<
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
</
|
|
329
|
+
const BODY = [
|
|
330
|
+
<Body key="body">
|
|
331
|
+
This text and its <Link href="#">inline links</Link> should use sentiment-matched colour.
|
|
332
|
+
</Body>,
|
|
333
|
+
<Button key="button1" v2 priority="primary" size="sm">
|
|
334
|
+
Primary
|
|
335
|
+
</Button>,
|
|
336
|
+
<Button key="button2" v2 priority="secondary" size="sm">
|
|
337
|
+
Secondary
|
|
338
|
+
</Button>,
|
|
339
|
+
<IconButton key="iconButton" size={32}>
|
|
340
|
+
<Defrost />
|
|
341
|
+
</IconButton>,
|
|
342
|
+
<AvatarView key="avatar" size={32}>
|
|
343
|
+
<Bank />
|
|
344
|
+
</AvatarView>,
|
|
345
|
+
<AvatarView key="avatar-initials" size={32} profileName="John Doe" />,
|
|
346
|
+
];
|
|
347
|
+
const STATUS_SUCCESS = <StatusIcon size={32} sentiment="success" />;
|
|
348
|
+
const STATUS_NEGATIVE = <StatusIcon size={32} sentiment="negative" />;
|
|
349
|
+
const AVATAR_SUCCESS = (
|
|
350
|
+
<AvatarView
|
|
351
|
+
size={32}
|
|
352
|
+
imgSrc="../avatar-rectangle-fox.webp"
|
|
353
|
+
badge={{ status: 'success' }}
|
|
354
|
+
interactive
|
|
355
|
+
/>
|
|
356
|
+
);
|
|
357
|
+
const AVATAR_NEGATIVE = (
|
|
358
|
+
<AvatarView
|
|
359
|
+
size={32}
|
|
360
|
+
imgSrc="../avatar-rectangle-fox.webp"
|
|
361
|
+
badge={{ status: 'negative' }}
|
|
362
|
+
interactive
|
|
363
|
+
/>
|
|
396
364
|
);
|
|
397
365
|
|
|
398
366
|
return (
|
|
399
367
|
<>
|
|
400
|
-
<Header level="group" title="
|
|
401
|
-
|
|
368
|
+
<Header level="group" title="Plain container" />
|
|
369
|
+
<div className="p-a-2 m-b-2 sentimentAwareComponent">
|
|
370
|
+
{BODY}
|
|
371
|
+
{AVATAR_SUCCESS}
|
|
372
|
+
{AVATAR_NEGATIVE}
|
|
373
|
+
{STATUS_SUCCESS}
|
|
374
|
+
{STATUS_NEGATIVE}
|
|
375
|
+
</div>
|
|
402
376
|
|
|
403
377
|
<Header level="group" title="Success sentiment surface" />
|
|
404
|
-
<SentimentSurface sentiment="success">
|
|
378
|
+
<SentimentSurface sentiment="success">
|
|
379
|
+
<div className="p-a-2 m-b-2 sentimentAwareComponent">
|
|
380
|
+
{BODY}
|
|
381
|
+
{AVATAR_SUCCESS}
|
|
382
|
+
{STATUS_SUCCESS}
|
|
383
|
+
</div>
|
|
384
|
+
</SentimentSurface>
|
|
405
385
|
|
|
406
386
|
<Header level="group" title="Negative sentiment surface" />
|
|
407
|
-
<SentimentSurface sentiment="negative">
|
|
387
|
+
<SentimentSurface sentiment="negative">
|
|
388
|
+
<div className="p-a-2 m-b-2 sentimentAwareComponent">
|
|
389
|
+
{BODY}
|
|
390
|
+
{AVATAR_NEGATIVE}
|
|
391
|
+
{STATUS_NEGATIVE}
|
|
392
|
+
</div>
|
|
393
|
+
</SentimentSurface>
|
|
408
394
|
</>
|
|
409
395
|
);
|
|
410
396
|
},
|
|
@@ -516,3 +502,78 @@ function View() {
|
|
|
516
502
|
},
|
|
517
503
|
},
|
|
518
504
|
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The component exposes token groups for all 5 sentiment types (`negative`, `warning`, `neutral`, `proposition` and `success`) each of them with two emphasis levels (`base` and `elevated`).
|
|
508
|
+
*/
|
|
509
|
+
export const ExposedTokens: Story = {
|
|
510
|
+
render: () => (
|
|
511
|
+
<section style={{ display: 'flex', flexDirection: 'column', gap: '32px', maxWidth: '100%' }}>
|
|
512
|
+
{sentiments.map((sentiment) =>
|
|
513
|
+
emphasisLevels.map((emphasis) => (
|
|
514
|
+
<SentimentSurface
|
|
515
|
+
key={`${sentiment}-${emphasis}`}
|
|
516
|
+
sentiment={sentiment}
|
|
517
|
+
emphasis={emphasis}
|
|
518
|
+
style={{
|
|
519
|
+
padding: '24px',
|
|
520
|
+
borderRadius: '16px',
|
|
521
|
+
}}
|
|
522
|
+
>
|
|
523
|
+
<h4
|
|
524
|
+
className="d-block m-b-2 text-capitalize np-text-title-body"
|
|
525
|
+
style={{
|
|
526
|
+
color: 'inherit',
|
|
527
|
+
}}
|
|
528
|
+
>
|
|
529
|
+
{sentiment} - {emphasis}
|
|
530
|
+
</h4>
|
|
531
|
+
<div
|
|
532
|
+
style={{
|
|
533
|
+
display: 'grid',
|
|
534
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
|
|
535
|
+
gap: '24px',
|
|
536
|
+
}}
|
|
537
|
+
>
|
|
538
|
+
{tokenCategories.map((category) => (
|
|
539
|
+
<div key={category.name}>
|
|
540
|
+
<h5
|
|
541
|
+
style={{
|
|
542
|
+
color: 'inherit',
|
|
543
|
+
fontSize: '12px',
|
|
544
|
+
fontWeight: 600,
|
|
545
|
+
marginBottom: '8px',
|
|
546
|
+
textTransform: 'uppercase',
|
|
547
|
+
letterSpacing: '0.5px',
|
|
548
|
+
opacity: 0.8,
|
|
549
|
+
}}
|
|
550
|
+
>
|
|
551
|
+
{category.name}
|
|
552
|
+
</h5>
|
|
553
|
+
{category.tokens.map((token) => (
|
|
554
|
+
<TokenSwatch key={token} token={token} />
|
|
555
|
+
))}
|
|
556
|
+
</div>
|
|
557
|
+
))}
|
|
558
|
+
</div>
|
|
559
|
+
</SentimentSurface>
|
|
560
|
+
)),
|
|
561
|
+
)}
|
|
562
|
+
</section>
|
|
563
|
+
),
|
|
564
|
+
parameters: {
|
|
565
|
+
controls: { disable: true },
|
|
566
|
+
docs: {
|
|
567
|
+
canvas: {
|
|
568
|
+
sourceState: 'hidden',
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
decorators: [
|
|
573
|
+
(Story: () => JSX.Element) => (
|
|
574
|
+
<div style={{ padding: '2rem', maxWidth: '1200px' }}>
|
|
575
|
+
<Story />
|
|
576
|
+
</div>
|
|
577
|
+
),
|
|
578
|
+
],
|
|
579
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { ThemeProvider, type Theming } from '@wise/components-theming';
|
|
3
|
-
import SentimentSurface from './SentimentSurface';
|
|
4
3
|
import Button from '../button';
|
|
4
|
+
import SentimentSurface from './SentimentSurface';
|
|
5
5
|
import type { Sentiment, Emphasis } from './SentimentSurface.types';
|
|
6
6
|
|
|
7
7
|
const sentiments: Sentiment[] = ['negative', 'success', 'proposition', 'warning', 'neutral'];
|
|
@@ -21,13 +21,14 @@ const screenModes: Theming['screenMode'][] = ['light', 'dark'];
|
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
23
|
component: SentimentSurface,
|
|
24
|
-
title: '
|
|
24
|
+
title: 'Foundations/SentimentSurface/Tests',
|
|
25
25
|
tags: ['!autodocs'],
|
|
26
26
|
} satisfies Meta<typeof SentimentSurface>;
|
|
27
27
|
|
|
28
28
|
type Story = StoryObj<typeof SentimentSurface>;
|
|
29
29
|
|
|
30
30
|
export const NestedSentiments: Story = {
|
|
31
|
+
tags: ['!dev'],
|
|
31
32
|
render: () => (
|
|
32
33
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
|
|
33
34
|
<SentimentSurface sentiment="negative" emphasis="base">
|
|
@@ -86,6 +87,9 @@ const ButtonsGrid = () => (
|
|
|
86
87
|
<Button v2 priority="secondary-neutral" style={{ marginLeft: '8px' }}>
|
|
87
88
|
Secondary Neutral
|
|
88
89
|
</Button>
|
|
90
|
+
<Button v2 priority="tertiary" style={{ marginLeft: '8px' }}>
|
|
91
|
+
Tertiary
|
|
92
|
+
</Button>
|
|
89
93
|
</SentimentSurface>
|
|
90
94
|
)),
|
|
91
95
|
)}
|