@transferwise/components 0.0.0-experimental-06b4575 → 0.0.0-experimental-7fec974
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/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
- package/build/field/Field.js +1 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +1 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/header/Header.js +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/TextArea.js.map +1 -1
- package/build/inputs/TextArea.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +31 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/styles/main.css +31 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs.map +1 -1
- package/build/tabs/Tabs.js +1 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +1 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +1 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts.map +1 -1
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +56 -0
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
- package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
- package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts.map +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
- package/build/types/table/TableCell.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +1 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +3 -3
- package/src/actionButton/ActionButton.story.tsx +9 -2
- package/src/avatar/Avatar.story.tsx +8 -2
- package/src/avatarLayout/AvatarLayout.story.tsx +3 -3
- package/src/avatarView/AvatarView.story.tsx +29 -24
- package/src/button/_stories/Button.test.story.tsx +10 -5
- package/src/checkbox/Checkbox.story.tsx +16 -3
- package/src/circularButton/CircularButton.story.tsx +7 -2
- package/src/common/bottomSheet/BottomSheet.story.tsx +32 -6
- package/src/common/circle/Circle.story.tsx +14 -3
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +16 -3
- package/src/dateInput/DateInput.test.story.tsx +13 -3
- package/src/dateLookup/DateLookup.story.tsx +7 -9
- package/src/dateLookup/monthCalendar/table/MonthCalendarTable.tsx +1 -5
- package/src/dateLookup/yearCalendar/table/YearCalendarTable.tsx +1 -1
- package/src/header/Header.test.story.tsx +10 -5
- package/src/header/Header.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/info/Info.story.tsx +20 -4
- package/src/inputs/Input.tsx +8 -9
- package/src/inputs/SearchInput.tsx +8 -9
- package/src/inputs/TextArea.tsx +6 -7
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +7 -2
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +7 -2
- package/src/main.css +31 -0
- package/src/main.less +2 -1
- package/src/modal/Modal.story.tsx +31 -6
- package/src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts +1 -3
- package/src/primitives/PrimitiveButton/PrimitiveButton.types.ts +1 -3
- package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +7 -2
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +2 -7
- package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
- package/src/prompt/InfoPrompt/index.ts +2 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +5 -5
- package/src/prompt/index.ts +5 -0
- package/src/radioOption/RadioOption.tsx +2 -1
- package/src/select/Select.story.tsx +1 -1
- package/src/slidingPanel/SlidingPanel.tsx +4 -2
- package/src/snackbar/Snackbar.test.story.tsx +32 -6
- package/src/ssr.test.tsx +1 -0
- package/src/statusIcon/StatusIcon.story.tsx +9 -5
- package/src/table/TableCell.tsx +1 -3
- package/src/tabs/Tabs.tsx +1 -1
- package/src/tooltip/Tooltip.story.tsx +7 -2
- package/src/uploadInput/UploadInput.tsx +1 -1
- package/src/withDisplayFormat/WithDisplayFormat.tsx +13 -14
|
@@ -288,7 +288,7 @@ export const EdgeInstances: Story = {
|
|
|
288
288
|
/**
|
|
289
289
|
* Like [AvatarView](?path=/docs/content-avatarview--docs#sentiment-awareness), `AvatarLayout` is sentiment-aware (note: not all features are supported) and will automatically adjust its colours if wrapped inside the
|
|
290
290
|
* [SentimentSurface](?path=/docs/content-sentimentsurface--docs) component.
|
|
291
|
-
*
|
|
291
|
+
*
|
|
292
292
|
* Features like: `interactive` are not supported.
|
|
293
293
|
* Also `AvatarLayout` isn't supported on `"elevated"` state of `SentimentSurface`.
|
|
294
294
|
*/
|
|
@@ -302,7 +302,7 @@ export const SentimentAwareness: Story = {
|
|
|
302
302
|
},
|
|
303
303
|
render: (args) => (
|
|
304
304
|
<>
|
|
305
|
-
{(['success', 'warning', 'negative', 'neutral', 'proposition'] as const).map((sentiment) =>
|
|
305
|
+
{(['success', 'warning', 'negative', 'neutral', 'proposition'] as const).map((sentiment) => (
|
|
306
306
|
<SentimentSurface
|
|
307
307
|
key={`${sentiment}-base`}
|
|
308
308
|
sentiment={sentiment}
|
|
@@ -316,7 +316,7 @@ export const SentimentAwareness: Story = {
|
|
|
316
316
|
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
317
317
|
/>
|
|
318
318
|
</SentimentSurface>
|
|
319
|
-
)}
|
|
319
|
+
))}
|
|
320
320
|
</>
|
|
321
321
|
),
|
|
322
322
|
decorators: [
|
|
@@ -440,7 +440,7 @@ export const Profiles: Story = {
|
|
|
440
440
|
/**
|
|
441
441
|
* `AvatarView` is sentiment-aware (note: not all features are supported) and will automatically adjust its colours if wrapped inside the
|
|
442
442
|
* [SentimentSurface](?path=/docs/content-sentimentsurface--docs) component.
|
|
443
|
-
*
|
|
443
|
+
*
|
|
444
444
|
* Features like `online`, `notification`, `selected`, and `interactive` are not supported.
|
|
445
445
|
* For badge (`<AvatarView badge={}>`) only `flagCode` is supported.
|
|
446
446
|
* Also `AvatarView` isn't supported on `"elevated"` state of `SentimentSurface`.
|
|
@@ -457,29 +457,34 @@ export const SentimentAwareness: Story = {
|
|
|
457
457
|
render: () => {
|
|
458
458
|
return (
|
|
459
459
|
<>
|
|
460
|
-
{(['success', 'warning', 'negative', 'neutral', 'proposition'] as const).map(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
<
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
<
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
460
|
+
{(['success', 'warning', 'negative', 'neutral', 'proposition'] as const).map(
|
|
461
|
+
(sentiment) => (
|
|
462
|
+
<SentimentSurface
|
|
463
|
+
key={`${sentiment}-base`}
|
|
464
|
+
sentiment={sentiment}
|
|
465
|
+
emphasis="base"
|
|
466
|
+
className="p-a-1 d-flex"
|
|
467
|
+
style={{ gap: 'var(--size-16)' }}
|
|
468
|
+
>
|
|
469
|
+
<AvatarView size={32}>
|
|
470
|
+
<Bank />
|
|
471
|
+
</AvatarView>
|
|
472
|
+
<AvatarView size={32} profileName="John Doe" />
|
|
473
|
+
<AvatarView size={32}>
|
|
474
|
+
<Flag code="JPY" intrinsicSize={32} />
|
|
475
|
+
</AvatarView>
|
|
476
|
+
<AvatarView
|
|
477
|
+
size={32}
|
|
478
|
+
badge={sentiment === 'proposition' ? undefined : { status: sentiment }}
|
|
479
|
+
>
|
|
480
|
+
<Bank />
|
|
481
|
+
</AvatarView>
|
|
482
|
+
<AvatarView size={32} badge={{ flagCode: 'eu' }}>
|
|
483
|
+
<Bank />
|
|
484
|
+
</AvatarView>
|
|
485
|
+
</SentimentSurface>
|
|
486
|
+
),
|
|
487
|
+
)}
|
|
483
488
|
</>
|
|
484
489
|
);
|
|
485
490
|
},
|
|
@@ -3,7 +3,7 @@ import { ArrowRight, ChevronRight, Freeze } from '@transferwise/icons';
|
|
|
3
3
|
import { expect, userEvent, within } from 'storybook/test';
|
|
4
4
|
import Button from '../Button.resolver';
|
|
5
5
|
import { ButtonPriority } from '../Button.types';
|
|
6
|
-
import {
|
|
6
|
+
import { allModes } from '../../../.storybook/modes';
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof Button> = {
|
|
9
9
|
component: Button,
|
|
@@ -32,11 +32,16 @@ const buttonPriorities = ['primary', 'secondary', 'secondary-neutral', 'tertiary
|
|
|
32
32
|
const buttonSizes = ['sm', 'md', 'lg'] as const;
|
|
33
33
|
export const AllVariants: Story = {
|
|
34
34
|
tags: ['!autodocs'],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
parameters: {
|
|
36
|
+
padding: '0',
|
|
37
|
+
variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'],
|
|
38
|
+
chromatic: {
|
|
39
|
+
dark: allModes.dark,
|
|
40
|
+
brightGreen: allModes.brightGreen,
|
|
41
|
+
forestGreen: allModes.forestGreen,
|
|
42
|
+
rtl: allModes.rtl,
|
|
38
43
|
},
|
|
39
|
-
}
|
|
44
|
+
},
|
|
40
45
|
render: () => (
|
|
41
46
|
<div
|
|
42
47
|
className="button-variants"
|
|
@@ -5,7 +5,7 @@ import { Field } from '../field/Field';
|
|
|
5
5
|
import { lorem10 } from '../test-utils';
|
|
6
6
|
|
|
7
7
|
import Checkbox from './Checkbox';
|
|
8
|
-
import {
|
|
8
|
+
import { allModes } from '../../.storybook/modes';
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Checkbox> = {
|
|
11
11
|
component: Checkbox,
|
|
@@ -33,12 +33,25 @@ export const Multiple: Story = {
|
|
|
33
33
|
</>
|
|
34
34
|
);
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
parameters: {
|
|
37
|
+
variants: ['default', 'dark', 'rtl'],
|
|
38
|
+
chromatic: {
|
|
39
|
+
dark: allModes.dark,
|
|
40
|
+
rtl: allModes.rtl,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
37
43
|
};
|
|
38
44
|
|
|
39
45
|
export const MultipleMobile: Story = {
|
|
40
46
|
...Multiple,
|
|
41
|
-
|
|
47
|
+
parameters: {
|
|
48
|
+
variants: ['default', 'dark', 'rtl', 'mobile'],
|
|
49
|
+
chromatic: {
|
|
50
|
+
dark: allModes.dark,
|
|
51
|
+
rtl: allModes.rtl,
|
|
52
|
+
mobile: allModes.largeMobile,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
42
55
|
};
|
|
43
56
|
|
|
44
57
|
export const WithinField = {
|
|
@@ -6,7 +6,7 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
6
6
|
import CircularButton from './CircularButton';
|
|
7
7
|
import Title from '../title';
|
|
8
8
|
import Body from '../body';
|
|
9
|
-
import {
|
|
9
|
+
import { allModes } from '../../.storybook/modes';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
component: CircularButton,
|
|
@@ -89,5 +89,10 @@ export const All: Story = {
|
|
|
89
89
|
|
|
90
90
|
export const All400Zoom: Story = {
|
|
91
91
|
...All,
|
|
92
|
-
|
|
92
|
+
parameters: {
|
|
93
|
+
variants: ['400%'],
|
|
94
|
+
chromatic: {
|
|
95
|
+
'400%': allModes.zoom400,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
93
98
|
};
|
|
@@ -11,7 +11,7 @@ import Title from '../../title/Title';
|
|
|
11
11
|
import { Typography } from '../propsValues/typography';
|
|
12
12
|
|
|
13
13
|
import BottomSheet from './BottomSheet';
|
|
14
|
-
import {
|
|
14
|
+
import { allModes } from '../../../.storybook/modes';
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
component: BottomSheet,
|
|
@@ -67,7 +67,12 @@ export const Basic: Story = {
|
|
|
67
67
|
|
|
68
68
|
export const BasicMobile: Story = {
|
|
69
69
|
...Basic,
|
|
70
|
-
|
|
70
|
+
parameters: {
|
|
71
|
+
variants: ['mobile'],
|
|
72
|
+
chromatic: {
|
|
73
|
+
mobile: allModes.largeMobile,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
71
76
|
};
|
|
72
77
|
|
|
73
78
|
export const WithOverflowContent: Story = {
|
|
@@ -101,20 +106,41 @@ export const WithOverflowContent: Story = {
|
|
|
101
106
|
|
|
102
107
|
export const WithOverflowContentMobile: Story = {
|
|
103
108
|
...WithOverflowContent,
|
|
104
|
-
|
|
109
|
+
parameters: {
|
|
110
|
+
variants: ['mobile'],
|
|
111
|
+
chromatic: {
|
|
112
|
+
mobile: allModes.largeMobile,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
105
115
|
};
|
|
106
116
|
|
|
107
117
|
export const WithOverflowContentDark: Story = {
|
|
108
118
|
...WithOverflowContent,
|
|
109
|
-
|
|
119
|
+
parameters: {
|
|
120
|
+
variants: ['dark'],
|
|
121
|
+
chromatic: {
|
|
122
|
+
dark: allModes.dark,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
110
125
|
};
|
|
111
126
|
|
|
112
127
|
export const WithOverflowContentDarkMobile: Story = {
|
|
113
128
|
...WithOverflowContent,
|
|
114
|
-
|
|
129
|
+
parameters: {
|
|
130
|
+
variants: ['dark', 'mobile'],
|
|
131
|
+
chromatic: {
|
|
132
|
+
dark: allModes.dark,
|
|
133
|
+
mobile: allModes.largeMobile,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
115
136
|
};
|
|
116
137
|
|
|
117
138
|
export const WithOverflowContentZoom400: Story = {
|
|
118
139
|
...WithOverflowContent,
|
|
119
|
-
|
|
140
|
+
parameters: {
|
|
141
|
+
variants: ['400%'],
|
|
142
|
+
chromatic: {
|
|
143
|
+
'400%': allModes.zoom400,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
120
146
|
};
|
|
@@ -3,7 +3,7 @@ import Circle from './Circle';
|
|
|
3
3
|
import { Profile } from '@transferwise/icons';
|
|
4
4
|
import { CircleProps } from '.';
|
|
5
5
|
import Body from '../../body';
|
|
6
|
-
import {
|
|
6
|
+
import { allModes } from '../../../.storybook/modes';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Internal/Circle',
|
|
@@ -46,7 +46,13 @@ export const Sizes: Story = {
|
|
|
46
46
|
</div>
|
|
47
47
|
);
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
parameters: {
|
|
50
|
+
variants: ['light', 'dark'],
|
|
51
|
+
chromatic: {
|
|
52
|
+
light: allModes.light,
|
|
53
|
+
dark: allModes.dark,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
50
56
|
};
|
|
51
57
|
|
|
52
58
|
export const FixedSize: Story = {
|
|
@@ -77,5 +83,10 @@ export const FixedSize: Story = {
|
|
|
77
83
|
</div>
|
|
78
84
|
);
|
|
79
85
|
},
|
|
80
|
-
|
|
86
|
+
parameters: {
|
|
87
|
+
variants: ['400%'],
|
|
88
|
+
chromatic: {
|
|
89
|
+
zoom400: allModes.zoom400,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
81
92
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
import CriticalCommsBanner from '.';
|
|
4
|
-
import {
|
|
4
|
+
import { allModes } from '../../.storybook/modes';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: CriticalCommsBanner,
|
|
@@ -24,7 +24,13 @@ export const Variants: Story = {
|
|
|
24
24
|
subtitle: 'Add money within the next 30 days',
|
|
25
25
|
action: { label: 'Take action', href: 'https://wise.com' },
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
parameters: {
|
|
28
|
+
variants: ['default', 'dark', 'rtl'],
|
|
29
|
+
chromatic: {
|
|
30
|
+
dark: allModes.dark,
|
|
31
|
+
rtl: allModes.rtl,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
export const Mobile: Story = {
|
|
@@ -34,5 +40,12 @@ export const Mobile: Story = {
|
|
|
34
40
|
subtitle: 'Add money within the next 30 days',
|
|
35
41
|
action: { label: 'Take action', href: 'https://wise.com' },
|
|
36
42
|
},
|
|
37
|
-
|
|
43
|
+
parameters: {
|
|
44
|
+
variants: ['default', 'dark', 'rtl', 'mobile'],
|
|
45
|
+
chromatic: {
|
|
46
|
+
dark: allModes.dark,
|
|
47
|
+
rtl: allModes.rtl,
|
|
48
|
+
mobile: allModes.largeMobile,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
38
51
|
};
|
|
@@ -6,7 +6,7 @@ import { lorem10 } from '../test-utils';
|
|
|
6
6
|
|
|
7
7
|
import Provider from '../provider/Provider';
|
|
8
8
|
import translations from '../i18n';
|
|
9
|
-
import {
|
|
9
|
+
import { allModes } from '../../.storybook/modes';
|
|
10
10
|
|
|
11
11
|
const meta: Meta<typeof DateInput> = {
|
|
12
12
|
component: DateInput,
|
|
@@ -223,10 +223,20 @@ export const NoNonDigitsAllowed: Story = {
|
|
|
223
223
|
|
|
224
224
|
export const BasicMobile: Story = {
|
|
225
225
|
...Basic,
|
|
226
|
-
|
|
226
|
+
parameters: {
|
|
227
|
+
variants: ['mobile'],
|
|
228
|
+
chromatic: {
|
|
229
|
+
mobile: allModes.largeMobile,
|
|
230
|
+
},
|
|
231
|
+
},
|
|
227
232
|
};
|
|
228
233
|
|
|
229
234
|
export const InputErrorMobile: Story = {
|
|
230
235
|
...InputError,
|
|
231
|
-
|
|
236
|
+
parameters: {
|
|
237
|
+
variants: ['mobile'],
|
|
238
|
+
chromatic: {
|
|
239
|
+
mobile: allModes.largeMobile,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
232
242
|
};
|
|
@@ -4,7 +4,7 @@ import { StoryObj } from '@storybook/react-webpack5';
|
|
|
4
4
|
import { Field } from '..';
|
|
5
5
|
import { Size } from '../common';
|
|
6
6
|
import DateLookup, { type DateLookupProps } from './DateLookup';
|
|
7
|
-
import {
|
|
7
|
+
import { allModes } from '../../.storybook/modes';
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
component: DateLookup,
|
|
@@ -61,15 +61,13 @@ export const Basic: Story = {
|
|
|
61
61
|
};
|
|
62
62
|
export const Basic400Zoom: Story = {
|
|
63
63
|
...Basic,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
chromatic: {
|
|
69
|
-
delay: 2000,
|
|
70
|
-
},
|
|
64
|
+
parameters: {
|
|
65
|
+
chromatic: {
|
|
66
|
+
delay: 2000,
|
|
67
|
+
zoom400: allModes.zoom400,
|
|
71
68
|
},
|
|
72
|
-
|
|
69
|
+
variants: ['400%'],
|
|
70
|
+
},
|
|
73
71
|
};
|
|
74
72
|
|
|
75
73
|
export const WithField: Story = {
|
|
@@ -43,11 +43,7 @@ const MonthCalendarTable = ({
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const isActive = (month: number) => {
|
|
46
|
-
return !!(
|
|
47
|
-
selectedDate &&
|
|
48
|
-
month === selectedDate.getMonth() &&
|
|
49
|
-
viewYear === selectedDate.getFullYear()
|
|
50
|
-
);
|
|
46
|
+
return !!(month === selectedDate?.getMonth() && viewYear === selectedDate.getFullYear());
|
|
51
47
|
};
|
|
52
48
|
|
|
53
49
|
const isThisMonth = (month: number) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import Header, { type HeaderProps } from './Header';
|
|
3
|
-
import {
|
|
3
|
+
import { allModes } from '../../.storybook/modes';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Header> = {
|
|
6
6
|
component: Header,
|
|
@@ -85,11 +85,16 @@ export const SectionTrailingSpaceWithAction: Story = {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
export const AllVariants: Story = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
parameters: {
|
|
89
|
+
padding: '0',
|
|
90
|
+
variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'],
|
|
91
|
+
chromatic: {
|
|
92
|
+
dark: allModes.dark,
|
|
93
|
+
brightGreen: allModes.brightGreen,
|
|
94
|
+
forestGreen: allModes.forestGreen,
|
|
95
|
+
rtl: allModes.rtl,
|
|
91
96
|
},
|
|
92
|
-
}
|
|
97
|
+
},
|
|
93
98
|
render: () => (
|
|
94
99
|
<div
|
|
95
100
|
className="header-variants"
|
package/src/header/Header.tsx
CHANGED
|
@@ -100,7 +100,7 @@ const Header: FunctionComponent<HeaderProps> = React.forwardRef(
|
|
|
100
100
|
useEffect(() => {
|
|
101
101
|
if (as === 'legend' && internalRef.current) {
|
|
102
102
|
const { parentElement } = internalRef.current;
|
|
103
|
-
if (
|
|
103
|
+
if (parentElement?.tagName.toLowerCase() !== 'fieldset') {
|
|
104
104
|
console.warn(
|
|
105
105
|
'Legends should be the first child in a fieldset, and this is not possible when including an action',
|
|
106
106
|
);
|
package/src/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type { EmphasisProps } from './emphasis';
|
|
|
36
36
|
export type { FieldProps } from './field/Field';
|
|
37
37
|
export type { InfoProps } from './info';
|
|
38
38
|
export type { InlinePromptProps, ActionPromptProps } from './prompt';
|
|
39
|
+
export type { InfoPromptProps, InfoPromptAction, InfoPromptMedia } from './prompt';
|
|
39
40
|
export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
|
|
40
41
|
export type { InputProps } from './inputs/Input';
|
|
41
42
|
export type { InputGroupProps } from './inputs/InputGroup';
|
|
@@ -171,7 +172,7 @@ export { default as Header } from './header';
|
|
|
171
172
|
export { default as Image } from './image';
|
|
172
173
|
export { default as Info } from './info';
|
|
173
174
|
export { default as InlineAlert } from './inlineAlert';
|
|
174
|
-
export { InlinePrompt, ActionPrompt } from './prompt';
|
|
175
|
+
export { InfoPrompt, InlinePrompt, ActionPrompt } from './prompt';
|
|
175
176
|
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat';
|
|
176
177
|
export { Input } from './inputs/Input';
|
|
177
178
|
export { InputGroup } from './inputs/InputGroup';
|
package/src/info/Info.story.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { userEvent, within } from 'storybook/test';
|
|
|
4
4
|
import { lorem10 } from '../test-utils';
|
|
5
5
|
|
|
6
6
|
import Info, { InfoPresentation } from '.';
|
|
7
|
-
import {
|
|
7
|
+
import { allModes } from '../../.storybook/modes';
|
|
8
8
|
|
|
9
9
|
const meta = {
|
|
10
10
|
component: Info,
|
|
@@ -27,7 +27,13 @@ export default meta;
|
|
|
27
27
|
type Story = StoryObj<typeof meta>;
|
|
28
28
|
|
|
29
29
|
export const Basic: Story = {
|
|
30
|
-
|
|
30
|
+
parameters: {
|
|
31
|
+
variants: ['default', 'dark', 'rtl'],
|
|
32
|
+
chromatic: {
|
|
33
|
+
dark: allModes.dark,
|
|
34
|
+
rtl: allModes.rtl,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
31
37
|
};
|
|
32
38
|
|
|
33
39
|
export const OpenedPopover = {
|
|
@@ -44,7 +50,12 @@ export const OpenedPopover = {
|
|
|
44
50
|
|
|
45
51
|
export const OpenedPopoverMobile: Story = {
|
|
46
52
|
...OpenedPopover,
|
|
47
|
-
|
|
53
|
+
parameters: {
|
|
54
|
+
variants: ['mobile'],
|
|
55
|
+
chromatic: {
|
|
56
|
+
mobile: allModes.largeMobile,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
48
59
|
};
|
|
49
60
|
|
|
50
61
|
export const OpenedModal = {
|
|
@@ -56,5 +67,10 @@ export const OpenedModal = {
|
|
|
56
67
|
|
|
57
68
|
export const OpenedModalMobile: Story = {
|
|
58
69
|
...OpenedModal,
|
|
59
|
-
|
|
70
|
+
parameters: {
|
|
71
|
+
variants: ['mobile'],
|
|
72
|
+
chromatic: {
|
|
73
|
+
mobile: allModes.largeMobile,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
60
76
|
};
|
package/src/inputs/Input.tsx
CHANGED
|
@@ -7,15 +7,14 @@ import { inputClassNameBase } from './_common';
|
|
|
7
7
|
import { useInputAttributes } from './contexts';
|
|
8
8
|
import { useInputPaddings } from './InputGroup';
|
|
9
9
|
|
|
10
|
-
export interface InputProps
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> {}
|
|
10
|
+
export interface InputProps extends Merge<
|
|
11
|
+
React.ComponentPropsWithRef<'input'>,
|
|
12
|
+
{
|
|
13
|
+
size?: 'auto' | SizeSmall | SizeMedium | SizeLarge;
|
|
14
|
+
shape?: 'rectangle' | 'pill';
|
|
15
|
+
'aria-invalid'?: boolean;
|
|
16
|
+
}
|
|
17
|
+
> {}
|
|
19
18
|
|
|
20
19
|
export const Input = forwardRef(function Input(
|
|
21
20
|
{ size = 'auto', shape = 'rectangle', className, ...restProps }: InputProps,
|
|
@@ -7,15 +7,14 @@ import { Merge } from '../utils';
|
|
|
7
7
|
import { Input } from './Input';
|
|
8
8
|
import { InputGroup } from './InputGroup';
|
|
9
9
|
|
|
10
|
-
export interface SearchInputProps
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> {}
|
|
10
|
+
export interface SearchInputProps extends Merge<
|
|
11
|
+
React.ComponentPropsWithRef<'input'>,
|
|
12
|
+
{
|
|
13
|
+
size?: Size.SMALL | Size.MEDIUM;
|
|
14
|
+
shape?: 'rectangle' | 'pill';
|
|
15
|
+
'aria-invalid'?: boolean;
|
|
16
|
+
}
|
|
17
|
+
> {}
|
|
19
18
|
|
|
20
19
|
export const SearchInput = forwardRef(function SearchInput(
|
|
21
20
|
{ shape = 'pill', size = Size.MEDIUM, disabled, className, ...restProps }: SearchInputProps,
|
package/src/inputs/TextArea.tsx
CHANGED
|
@@ -5,13 +5,12 @@ import { Merge } from '../utils';
|
|
|
5
5
|
import { inputClassNameBase } from './_common';
|
|
6
6
|
import { useInputAttributes } from './contexts';
|
|
7
7
|
|
|
8
|
-
export interface TextAreaProps
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
> {}
|
|
8
|
+
export interface TextAreaProps extends Merge<
|
|
9
|
+
React.ComponentPropsWithRef<'textarea'>,
|
|
10
|
+
{
|
|
11
|
+
'aria-invalid'?: boolean;
|
|
12
|
+
}
|
|
13
|
+
> {}
|
|
15
14
|
|
|
16
15
|
export const TextArea = forwardRef(function TextArea(
|
|
17
16
|
{ className, ...restProps }: TextAreaProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { allModes } from '../../../../.storybook/modes';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,7 +16,12 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
19
|
+
parameters: {
|
|
20
|
+
variants: ['bright-green'],
|
|
21
|
+
chromatic: {
|
|
22
|
+
'bright-green': allModes.brightGreen,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
args: { variant: 'bright-green' },
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { allModes } from '../../../../.storybook/modes';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,7 +16,12 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
19
|
+
parameters: {
|
|
20
|
+
variants: ['dark'],
|
|
21
|
+
chromatic: {
|
|
22
|
+
dark: allModes.dark,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
args: { variant: 'dark' },
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { allModes } from '../../../../.storybook/modes';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,7 +16,12 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
19
|
+
parameters: {
|
|
20
|
+
variants: ['forest-green'],
|
|
21
|
+
chromatic: {
|
|
22
|
+
forestGreen: allModes.forestGreen,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
args: { variant: 'forest-green' },
|
|
21
26
|
};
|
|
22
27
|
|