@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.
Files changed (134) hide show
  1. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  2. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
  3. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs +1 -1
  4. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
  5. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  6. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
  7. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs +1 -1
  8. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
  9. package/build/field/Field.js +1 -0
  10. package/build/field/Field.js.map +1 -1
  11. package/build/field/Field.mjs +1 -0
  12. package/build/field/Field.mjs.map +1 -1
  13. package/build/header/Header.js +1 -1
  14. package/build/header/Header.js.map +1 -1
  15. package/build/header/Header.mjs +1 -1
  16. package/build/header/Header.mjs.map +1 -1
  17. package/build/index.js +2 -0
  18. package/build/index.js.map +1 -1
  19. package/build/index.mjs +1 -0
  20. package/build/index.mjs.map +1 -1
  21. package/build/inputs/Input.js.map +1 -1
  22. package/build/inputs/Input.mjs.map +1 -1
  23. package/build/inputs/SearchInput.js.map +1 -1
  24. package/build/inputs/SearchInput.mjs.map +1 -1
  25. package/build/inputs/TextArea.js.map +1 -1
  26. package/build/inputs/TextArea.mjs.map +1 -1
  27. package/build/listItem/Prompt/ListItemPrompt.js +1 -0
  28. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  29. package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
  30. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  31. package/build/main.css +31 -0
  32. package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
  33. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
  34. package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
  35. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -0
  36. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  37. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  38. package/build/radioOption/RadioOption.js.map +1 -1
  39. package/build/radioOption/RadioOption.mjs.map +1 -1
  40. package/build/slidingPanel/SlidingPanel.js.map +1 -1
  41. package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
  42. package/build/styles/main.css +31 -0
  43. package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
  44. package/build/table/TableCell.js.map +1 -1
  45. package/build/table/TableCell.mjs.map +1 -1
  46. package/build/tabs/Tabs.js +1 -1
  47. package/build/tabs/Tabs.js.map +1 -1
  48. package/build/tabs/Tabs.mjs +1 -1
  49. package/build/tabs/Tabs.mjs.map +1 -1
  50. package/build/typeahead/Typeahead.js +1 -0
  51. package/build/typeahead/Typeahead.js.map +1 -1
  52. package/build/typeahead/Typeahead.mjs +1 -0
  53. package/build/typeahead/Typeahead.mjs.map +1 -1
  54. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
  55. package/build/types/index.d.ts +2 -1
  56. package/build/types/index.d.ts.map +1 -1
  57. package/build/types/inputs/Input.d.ts.map +1 -1
  58. package/build/types/inputs/SearchInput.d.ts.map +1 -1
  59. package/build/types/inputs/TextArea.d.ts.map +1 -1
  60. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -1
  61. package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -1
  62. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +56 -0
  63. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
  64. package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
  65. package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
  66. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
  67. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  68. package/build/types/prompt/index.d.ts +2 -0
  69. package/build/types/prompt/index.d.ts.map +1 -1
  70. package/build/types/radioOption/RadioOption.d.ts.map +1 -1
  71. package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
  72. package/build/types/table/TableCell.d.ts.map +1 -1
  73. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
  74. package/build/uploadInput/UploadInput.js +1 -1
  75. package/build/uploadInput/UploadInput.js.map +1 -1
  76. package/build/uploadInput/UploadInput.mjs +1 -1
  77. package/build/uploadInput/UploadInput.mjs.map +1 -1
  78. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  79. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  80. package/package.json +3 -3
  81. package/src/actionButton/ActionButton.story.tsx +9 -2
  82. package/src/avatar/Avatar.story.tsx +8 -2
  83. package/src/avatarLayout/AvatarLayout.story.tsx +3 -3
  84. package/src/avatarView/AvatarView.story.tsx +29 -24
  85. package/src/button/_stories/Button.test.story.tsx +10 -5
  86. package/src/checkbox/Checkbox.story.tsx +16 -3
  87. package/src/circularButton/CircularButton.story.tsx +7 -2
  88. package/src/common/bottomSheet/BottomSheet.story.tsx +32 -6
  89. package/src/common/circle/Circle.story.tsx +14 -3
  90. package/src/criticalBanner/CriticalCommsBanner.story.tsx +16 -3
  91. package/src/dateInput/DateInput.test.story.tsx +13 -3
  92. package/src/dateLookup/DateLookup.story.tsx +7 -9
  93. package/src/dateLookup/monthCalendar/table/MonthCalendarTable.tsx +1 -5
  94. package/src/dateLookup/yearCalendar/table/YearCalendarTable.tsx +1 -1
  95. package/src/header/Header.test.story.tsx +10 -5
  96. package/src/header/Header.tsx +1 -1
  97. package/src/index.ts +2 -1
  98. package/src/info/Info.story.tsx +20 -4
  99. package/src/inputs/Input.tsx +8 -9
  100. package/src/inputs/SearchInput.tsx +8 -9
  101. package/src/inputs/TextArea.tsx +6 -7
  102. package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +7 -2
  103. package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +7 -2
  104. package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +7 -2
  105. package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +7 -2
  106. package/src/main.css +31 -0
  107. package/src/main.less +2 -1
  108. package/src/modal/Modal.story.tsx +31 -6
  109. package/src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts +1 -3
  110. package/src/primitives/PrimitiveButton/PrimitiveButton.types.ts +1 -3
  111. package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
  112. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +7 -2
  113. package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +2 -7
  114. package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
  115. package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
  116. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
  117. package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
  118. package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
  119. package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
  120. package/src/prompt/InfoPrompt/index.ts +2 -0
  121. package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
  122. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +5 -5
  123. package/src/prompt/index.ts +5 -0
  124. package/src/radioOption/RadioOption.tsx +2 -1
  125. package/src/select/Select.story.tsx +1 -1
  126. package/src/slidingPanel/SlidingPanel.tsx +4 -2
  127. package/src/snackbar/Snackbar.test.story.tsx +32 -6
  128. package/src/ssr.test.tsx +1 -0
  129. package/src/statusIcon/StatusIcon.story.tsx +9 -5
  130. package/src/table/TableCell.tsx +1 -3
  131. package/src/tabs/Tabs.tsx +1 -1
  132. package/src/tooltip/Tooltip.story.tsx +7 -2
  133. package/src/uploadInput/UploadInput.tsx +1 -1
  134. 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((sentiment) => (
461
- <SentimentSurface
462
- key={`${sentiment}-base`}
463
- sentiment={sentiment}
464
- emphasis="base"
465
- className="p-a-1 d-flex"
466
- style={{ gap: 'var(--size-16)' }}
467
- >
468
- <AvatarView size={32}>
469
- <Bank />
470
- </AvatarView>
471
- <AvatarView size={32} profileName="John Doe" />
472
- <AvatarView size={32}>
473
- <Flag code="JPY" intrinsicSize={32} />
474
- </AvatarView>
475
- <AvatarView size={32} badge={sentiment === 'proposition' ? undefined : { status: sentiment }}>
476
- <Bank />
477
- </AvatarView>
478
- <AvatarView size={32} badge={{ flagCode: 'eu' }}>
479
- <Bank />
480
- </AvatarView>
481
- </SentimentSurface>
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 { withVariantConfig } from '../../../.storybook/helpers';
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
- ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green', 'rtl'], {
36
- parameters: {
37
- padding: '0',
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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['default', 'dark', 'rtl']),
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
- ...withVariantConfig(['default', 'dark', 'rtl', 'mobile'], Multiple),
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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['400%'], All),
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 { withVariantConfig } from '../../../.storybook/helpers';
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
- ...withVariantConfig(['mobile'], Basic),
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
- ...withVariantConfig(['mobile'], WithOverflowContent),
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
- ...withVariantConfig(['dark'], WithOverflowContent),
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
- ...withVariantConfig(['dark', 'mobile'], WithOverflowContent),
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
- ...withVariantConfig(['400%'], WithOverflowContent),
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 { withVariantConfig } from '../../../.storybook/helpers';
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
- ...withVariantConfig(['light', 'dark']),
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
- ...withVariantConfig(['400%']),
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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['default', 'dark', 'rtl']),
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
- ...withVariantConfig(['default', 'dark', 'rtl', 'mobile']),
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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['mobile'], Basic),
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
- ...withVariantConfig(['mobile'], InputError),
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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['400%'], {
66
- ...Basic,
67
- parameters: {
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) => {
@@ -43,7 +43,7 @@ const YearCalendarTable = ({
43
43
  };
44
44
 
45
45
  const isActive = (year: number) => {
46
- return !!(selectedDate && year === selectedDate.getFullYear());
46
+ return !!(year === selectedDate?.getFullYear());
47
47
  };
48
48
 
49
49
  const isThisYear = (year: number) => {
@@ -1,6 +1,6 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import Header, { type HeaderProps } from './Header';
3
- import { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green', 'rtl'], {
89
- parameters: {
90
- padding: '0',
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"
@@ -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 (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
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';
@@ -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 { withVariantConfig } from '../../.storybook/helpers';
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
- ...withVariantConfig(['default', 'dark', 'rtl']),
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
- ...withVariantConfig(['mobile'], OpenedPopover),
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
- ...withVariantConfig(['mobile'], OpenedModal),
70
+ parameters: {
71
+ variants: ['mobile'],
72
+ chromatic: {
73
+ mobile: allModes.largeMobile,
74
+ },
75
+ },
60
76
  };
@@ -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
- extends Merge<
12
- React.ComponentPropsWithRef<'input'>,
13
- {
14
- size?: 'auto' | SizeSmall | SizeMedium | SizeLarge;
15
- shape?: 'rectangle' | 'pill';
16
- 'aria-invalid'?: boolean;
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
- extends Merge<
12
- React.ComponentPropsWithRef<'input'>,
13
- {
14
- size?: Size.SMALL | Size.MEDIUM;
15
- shape?: 'rectangle' | 'pill';
16
- 'aria-invalid'?: boolean;
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,
@@ -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
- extends Merge<
10
- React.ComponentPropsWithRef<'textarea'>,
11
- {
12
- 'aria-invalid'?: boolean;
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 { withVariantConfig } from '../../../../.storybook/helpers';
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
- ...withVariantConfig(['bright-green'], VariantStory),
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 { withVariantConfig } from '../../../../.storybook/helpers';
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
- ...withVariantConfig(['dark'], VariantStory),
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 { withVariantConfig } from '../../../../.storybook/helpers';
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
- ...withVariantConfig(['forest-green'], VariantStory),
19
+ parameters: {
20
+ variants: ['forest-green'],
21
+ chromatic: {
22
+ forestGreen: allModes.forestGreen,
23
+ },
24
+ },
20
25
  args: { variant: 'forest-green' },
21
26
  };
22
27