@transferwise/components 46.88.2 → 46.89.1

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 (159) hide show
  1. package/build/actionButton/ActionButton.js.map +1 -1
  2. package/build/actionButton/ActionButton.mjs.map +1 -1
  3. package/build/actionOption/ActionOption.js +19 -3
  4. package/build/actionOption/ActionOption.js.map +1 -1
  5. package/build/actionOption/ActionOption.mjs +19 -3
  6. package/build/actionOption/ActionOption.mjs.map +1 -1
  7. package/build/alert/Alert.js +23 -20
  8. package/build/alert/Alert.js.map +1 -1
  9. package/build/alert/Alert.mjs +20 -17
  10. package/build/alert/Alert.mjs.map +1 -1
  11. package/build/avatar/Avatar.js.map +1 -1
  12. package/build/avatar/Avatar.mjs.map +1 -1
  13. package/build/avatar/avatarTypes.js +3 -1
  14. package/build/avatar/avatarTypes.js.map +1 -1
  15. package/build/avatar/avatarTypes.mjs +3 -1
  16. package/build/avatar/avatarTypes.mjs.map +1 -1
  17. package/build/badge/Badge.js.map +1 -1
  18. package/build/badge/Badge.mjs.map +1 -1
  19. package/build/button/Button.js +2 -2
  20. package/build/button/Button.mjs +2 -2
  21. package/build/button/LegacyButton.js.map +1 -1
  22. package/build/button/LegacyButton.mjs.map +1 -1
  23. package/build/carousel/Carousel.js +9 -8
  24. package/build/carousel/Carousel.js.map +1 -1
  25. package/build/carousel/Carousel.mjs +9 -8
  26. package/build/carousel/Carousel.mjs.map +1 -1
  27. package/build/common/action/Action.js +26 -15
  28. package/build/common/action/Action.js.map +1 -1
  29. package/build/common/action/Action.mjs +26 -15
  30. package/build/common/action/Action.mjs.map +1 -1
  31. package/build/common/closeButton/CloseButton.js +2 -1
  32. package/build/common/closeButton/CloseButton.js.map +1 -1
  33. package/build/common/closeButton/CloseButton.mjs +2 -1
  34. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  35. package/build/criticalBanner/CriticalCommsBanner.js +10 -73
  36. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  37. package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
  38. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  39. package/build/iconButton/IconButton.js +2 -2
  40. package/build/iconButton/IconButton.js.map +1 -1
  41. package/build/iconButton/IconButton.mjs +2 -2
  42. package/build/iconButton/IconButton.mjs.map +1 -1
  43. package/build/link/Link.js +2 -2
  44. package/build/link/Link.mjs +2 -2
  45. package/build/main.css +50 -75
  46. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -0
  47. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -0
  48. package/build/primitives/PrimitiveButton/{src/PrimitiveButton.js → PrimitiveButton.js} +1 -1
  49. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -0
  50. package/build/primitives/PrimitiveButton/{src/PrimitiveButton.mjs → PrimitiveButton.mjs} +1 -1
  51. package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -0
  52. package/build/styles/actionOption/ActionOption.css +4 -0
  53. package/build/styles/alert/Alert.css +4 -0
  54. package/build/styles/carousel/Carousel.css +0 -8
  55. package/build/styles/common/closeButton/CloseButton.css +15 -0
  56. package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -73
  57. package/build/styles/main.css +50 -75
  58. package/build/table/TableCell.js +7 -1
  59. package/build/table/TableCell.js.map +1 -1
  60. package/build/table/TableCell.mjs +7 -1
  61. package/build/table/TableCell.mjs.map +1 -1
  62. package/build/test-utils/assets/wise-card.svg +1 -0
  63. package/build/types/actionButton/ActionButton.d.ts +6 -0
  64. package/build/types/actionButton/ActionButton.d.ts.map +1 -1
  65. package/build/types/actionOption/ActionOption.d.ts +2 -1
  66. package/build/types/actionOption/ActionOption.d.ts.map +1 -1
  67. package/build/types/alert/Alert.d.ts +3 -4
  68. package/build/types/alert/Alert.d.ts.map +1 -1
  69. package/build/types/avatar/Avatar.d.ts +3 -0
  70. package/build/types/avatar/Avatar.d.ts.map +1 -1
  71. package/build/types/avatar/avatarTypes.d.ts +3 -0
  72. package/build/types/avatar/avatarTypes.d.ts.map +1 -1
  73. package/build/types/badge/Badge.d.ts +3 -0
  74. package/build/types/badge/Badge.d.ts.map +1 -1
  75. package/build/types/button/LegacyButton.d.ts +27 -0
  76. package/build/types/button/LegacyButton.d.ts.map +1 -1
  77. package/build/types/carousel/Carousel.d.ts.map +1 -1
  78. package/build/types/common/action/Action.d.ts +5 -2
  79. package/build/types/common/action/Action.d.ts.map +1 -1
  80. package/build/types/common/closeButton/CloseButton.d.ts +3 -3
  81. package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
  82. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  83. package/build/types/iconButton/IconButton.d.ts +2 -2
  84. package/build/types/iconButton/IconButton.d.ts.map +1 -1
  85. package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.d.ts → PrimitiveAnchor.d.ts} +1 -1
  86. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.d.ts.map +1 -0
  87. package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.d.ts → PrimitiveAnchor.types.d.ts} +1 -1
  88. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -0
  89. package/build/types/primitives/PrimitiveAnchor/index.d.ts +2 -2
  90. package/build/types/primitives/PrimitiveAnchor/index.d.ts.map +1 -1
  91. package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.d.ts → PrimitiveButton.d.ts} +1 -1
  92. package/build/types/primitives/PrimitiveButton/PrimitiveButton.d.ts.map +1 -0
  93. package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.types.d.ts → PrimitiveButton.types.d.ts} +1 -1
  94. package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -0
  95. package/build/types/primitives/PrimitiveButton/index.d.ts +2 -2
  96. package/build/types/primitives/PrimitiveButton/index.d.ts.map +1 -1
  97. package/build/types/table/TableCell.d.ts +6 -3
  98. package/build/types/table/TableCell.d.ts.map +1 -1
  99. package/package.json +2 -2
  100. package/src/actionButton/ActionButton.story.tsx +6 -1
  101. package/src/actionButton/ActionButton.tsx +6 -0
  102. package/src/actionOption/ActionOption.css +4 -0
  103. package/src/actionOption/ActionOption.less +5 -0
  104. package/src/actionOption/ActionOption.story.tsx +9 -6
  105. package/src/actionOption/ActionOption.tsx +29 -5
  106. package/src/alert/Alert.css +4 -0
  107. package/src/alert/Alert.less +4 -0
  108. package/src/alert/Alert.spec.tsx +0 -30
  109. package/src/alert/Alert.story.tsx +74 -2
  110. package/src/alert/Alert.tsx +18 -21
  111. package/src/avatar/Avatar.tsx +3 -0
  112. package/src/avatar/avatarTypes.ts +3 -1
  113. package/src/badge/Badge.tsx +3 -0
  114. package/src/button/LegacyButton.tsx +27 -0
  115. package/src/carousel/Carousel.css +0 -8
  116. package/src/carousel/Carousel.less +0 -7
  117. package/src/carousel/Carousel.spec.tsx +2 -2
  118. package/src/carousel/Carousel.tsx +11 -10
  119. package/src/common/action/Action.tsx +40 -22
  120. package/src/common/closeButton/CloseButton.css +15 -0
  121. package/src/common/closeButton/CloseButton.less +10 -0
  122. package/src/common/closeButton/CloseButton.tsx +4 -3
  123. package/src/criticalBanner/CriticalCommsBanner.css +33 -73
  124. package/src/criticalBanner/CriticalCommsBanner.less +37 -64
  125. package/src/criticalBanner/CriticalCommsBanner.story.tsx +26 -4
  126. package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
  127. package/src/iconButton/IconButton.tsx +4 -1
  128. package/src/main.css +50 -75
  129. package/src/main.less +1 -0
  130. package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.tsx → PrimitiveAnchor.tsx} +1 -1
  131. package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.ts → PrimitiveAnchor.types.ts} +1 -1
  132. package/src/primitives/PrimitiveAnchor/index.ts +6 -2
  133. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +1 -1
  134. package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -1
  135. package/src/primitives/PrimitiveButton/{src/PrimitiveButton.tsx → PrimitiveButton.tsx} +2 -2
  136. package/src/primitives/PrimitiveButton/{src/PrimitiveButton.types.ts → PrimitiveButton.types.ts} +1 -1
  137. package/src/primitives/PrimitiveButton/index.ts +6 -2
  138. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +1 -1
  139. package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +1 -1
  140. package/src/table/Table.story.tsx +59 -1
  141. package/src/table/TableCell.spec.tsx +17 -0
  142. package/src/table/TableCell.tsx +14 -5
  143. package/src/test-utils/assets/wise-card.svg +1 -0
  144. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +0 -1
  145. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +0 -1
  146. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +0 -1
  147. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +0 -1
  148. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +0 -1
  149. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +0 -1
  150. package/build/types/primitives/PrimitiveAnchor/src/index.d.ts +0 -3
  151. package/build/types/primitives/PrimitiveAnchor/src/index.d.ts.map +0 -1
  152. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +0 -1
  153. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.types.d.ts.map +0 -1
  154. package/build/types/primitives/PrimitiveButton/src/index.d.ts +0 -3
  155. package/build/types/primitives/PrimitiveButton/src/index.d.ts.map +0 -1
  156. package/src/primitives/PrimitiveAnchor/src/index.ts +0 -6
  157. package/src/primitives/PrimitiveButton/src/index.ts +0 -6
  158. /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.js → PrimitiveAnchor.js} +0 -0
  159. /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.mjs → PrimitiveAnchor.mjs} +0 -0
@@ -2,14 +2,7 @@ import { clsx } from 'clsx';
2
2
  import { useState, useRef, useEffect } from 'react';
3
3
 
4
4
  import Body from '../body/Body';
5
- import {
6
- CloseButton,
7
- Sentiment,
8
- Size,
9
- Typography,
10
- Variant,
11
- WDS_LIVE_REGION_DELAY_MS,
12
- } from '../common';
5
+ import { CloseButton, Sentiment, Size, Typography, WDS_LIVE_REGION_DELAY_MS } from '../common';
13
6
 
14
7
  import StatusIcon from '../statusIcon';
15
8
  import Title from '../title/Title';
@@ -32,6 +25,7 @@ type AlertTypeResolved = `${
32
25
  | Sentiment.POSITIVE
33
26
  | Sentiment.NEUTRAL
34
27
  | Sentiment.WARNING
28
+ | Sentiment.PENDING
35
29
  | Sentiment.NEGATIVE}`;
36
30
  export type AlertType = AlertTypeResolved | AlertTypeDeprecated;
37
31
 
@@ -63,7 +57,6 @@ export interface AlertProps {
63
57
  onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
64
58
  /** The type dictates which icon and colour will be used */
65
59
  type?: AlertType;
66
- variant?: `${Variant}`;
67
60
  /** @deprecated Use `InlineAlert` instead. */
68
61
  arrow?: `${AlertArrowPosition}`;
69
62
  /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */
@@ -96,7 +89,6 @@ export default function Alert({
96
89
  message,
97
90
  title,
98
91
  type = 'neutral',
99
- variant = 'desktop',
100
92
  arrow,
101
93
  children,
102
94
  size,
@@ -186,15 +178,10 @@ export default function Alert({
186
178
  }}
187
179
  onTouchMove={() => setShouldFire(false)}
188
180
  >
189
- <div
190
- className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}
191
- data-testid={variant}
192
- >
193
- {icon ? (
194
- <div className="alert__icon">{icon}</div>
195
- ) : (
196
- <StatusIcon size={Size.LARGE} sentiment={resolvedType} iconLabel={statusIconLabel} />
197
- )}
181
+ <div className="alert__icon">
182
+ {icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}
183
+ </div>
184
+ <div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>
198
185
  <div className="alert__message">
199
186
  <div>
200
187
  {title && (
@@ -206,11 +193,21 @@ export default function Alert({
206
193
  {children || <InlineMarkdown>{message}</InlineMarkdown>}
207
194
  </Body>
208
195
  </div>
209
- {action && <Action action={action} variant="action-button" className="m-t-1" />}
196
+ {action && (
197
+ <Action
198
+ action={action}
199
+ variant="action-button"
200
+ className="alert__action"
201
+ sentiment="default"
202
+ priority="secondary-neutral"
203
+ />
204
+ )}
210
205
  </div>
211
206
  </div>
212
207
  {onDismiss && (
213
- <CloseButton ref={closeButtonReference} className="m-l-2" onClick={onDismiss} />
208
+ <div className="alert__close">
209
+ <CloseButton ref={closeButtonReference} size="xs" onClick={onDismiss} />
210
+ </div>
214
211
  )}
215
212
  </div>
216
213
  </div>
@@ -15,6 +15,9 @@ export type AvatarTheme = 'light' | 'dark';
15
15
 
16
16
  export type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';
17
17
 
18
+ /**
19
+ * @deprecated `Avatar` is deprecated please use `AvatarView` instead
20
+ */
18
21
  export interface AvatarProps {
19
22
  backgroundColor?: string;
20
23
  backgroundColorSeed?: string;
@@ -1,4 +1,6 @@
1
- // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
1
+ /**
2
+ * @deprecated `Avatar` is deprecated please use `AvatarView` instead
3
+ */
2
4
  export enum AvatarType {
3
5
  THUMBNAIL = 'thumbnail',
4
6
  ICON = 'icon',
@@ -18,6 +18,9 @@ import { BadgeAssetsProps } from '.';
18
18
  */
19
19
  type DeprecatedSizes = SizeSmall | SizeMedium | SizeLarge;
20
20
 
21
+ /**
22
+ * @deprecated `Badge` is deprecated please use `<AvatarView badge={..} />` instead
23
+ */
21
24
  export type BadgeProps = {
22
25
  badge: ReactNode;
23
26
  children: ReactNode;
@@ -30,6 +30,15 @@ type DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';
30
30
  /** @deprecated */
31
31
  type DeprecatedSizes = SizeExtraSmall;
32
32
 
33
+ /**
34
+ * @deprecated use new button instead APIs
35
+ * @example
36
+ * ```
37
+ * import { Button, ButtonProps } from '@transferwise/components';
38
+ *
39
+ * <Button v2>...</Button>
40
+ * ```
41
+ */
33
42
  export type CommonProps = {
34
43
  v2?: false;
35
44
 
@@ -60,10 +69,28 @@ export type CommonProps = {
60
69
  htmlType?: 'submit' | 'reset' | 'button';
61
70
  };
62
71
 
72
+ /**
73
+ * @deprecated use new button instead APIs
74
+ * @example
75
+ * ```
76
+ * import { Button, ButtonProps } from '@transferwise/components';
77
+ *
78
+ * <Button v2>...</Button>
79
+ * ```
80
+ */
63
81
  export type ButtonProps = CommonProps & Omit<React.ComponentPropsWithRef<'button'>, 'type'>;
64
82
 
65
83
  type AnchorProps = CommonProps & Omit<React.ComponentPropsWithRef<'a'>, 'type'>;
66
84
 
85
+ /**
86
+ * @deprecated use new button instead APIs
87
+ * @example
88
+ * ```
89
+ * import { Button, ButtonProps } from '@transferwise/components';
90
+ *
91
+ * <Button v2>...</Button>
92
+ * ```
93
+ */
67
94
  export type LegacyButtonProps = ButtonProps | AnchorProps;
68
95
 
69
96
  /**
@@ -99,14 +99,6 @@
99
99
  padding: 24px;
100
100
  padding: var(--size-24);
101
101
  }
102
- .carousel__scroll-button {
103
- width: 32px;
104
- width: var(--size-32);
105
- height: 32px;
106
- height: var(--size-32);
107
- align-items: center;
108
- justify-content: center;
109
- }
110
102
  .carousel__indicators {
111
103
  display: flex;
112
104
  justify-content: center;
@@ -107,13 +107,6 @@
107
107
  padding: var(--size-24);
108
108
  }
109
109
 
110
- .carousel__scroll-button {
111
- width: var(--size-32);
112
- height: var(--size-32);
113
- align-items: center;
114
- justify-content: center;
115
- }
116
-
117
110
  .carousel__indicators {
118
111
  display: flex;
119
112
  justify-content: center;
@@ -1,11 +1,11 @@
1
- import { fireEvent, render, screen } from '@testing-library/react';
2
- import { userEvent } from '../test-utils';
1
+ import { userEvent, fireEvent, render, screen, mockMatchMedia } from '../test-utils';
3
2
 
4
3
  import Display from '../display';
5
4
  import Title from '../title';
6
5
 
7
6
  import Carousel, { type CarouselCard } from './Carousel';
8
7
 
8
+ mockMatchMedia();
9
9
  jest.mock('@wise/components-theming', () => ({
10
10
  ...jest.requireActual<Record<string, unknown>>('@wise/components-theming'),
11
11
  useTheme: jest.fn().mockReturnValue({ theme: 'personal' }),
@@ -2,7 +2,7 @@ import { ChevronLeft, ChevronRight } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
3
  import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from 'react';
4
4
 
5
- import ActionButton from '../actionButton';
5
+ import IconButton from '../iconButton';
6
6
  import Title from '../title';
7
7
  import type { PromoCardLinkProps } from '../promoCard/PromoCard';
8
8
  import PromoCard from '../promoCard/PromoCard';
@@ -169,29 +169,30 @@ const Carousel: React.FC<CarouselProps> = ({ header, className, cards, onClick }
169
169
  header
170
170
  )}
171
171
  {areActionButtonsEnabled ? (
172
- <div className="hidden-xs">
173
- <ActionButton
174
- className="carousel__scroll-button"
172
+ <div className="hidden-xs d-inline-flex">
173
+ <IconButton
174
+ size={32}
175
175
  tabIndex={-1}
176
- priority="secondary"
176
+ priority="tertiary"
177
177
  disabled={!isLeftActionButtonEnabled}
178
178
  aria-hidden="true"
179
179
  data-testid="scroll-carousel-left"
180
180
  onClick={() => scrollCarousel('left')}
181
181
  >
182
182
  <ChevronLeft />
183
- </ActionButton>
184
- <ActionButton
183
+ </IconButton>
184
+ <IconButton
185
+ size={32}
185
186
  tabIndex={-1}
186
- className="carousel__scroll-button m-l-1"
187
- priority="secondary"
187
+ className="m-l-1"
188
+ priority="tertiary"
188
189
  aria-hidden="true"
189
190
  data-testid="scroll-carousel-right"
190
191
  disabled={scrollIsAtEnd}
191
192
  onClick={() => scrollCarousel()}
192
193
  >
193
194
  <ChevronRight />
194
- </ActionButton>
195
+ </IconButton>
195
196
  </div>
196
197
  ) : null}
197
198
  </div>
@@ -1,8 +1,9 @@
1
1
  import { clsx } from 'clsx';
2
2
  import Link from '../../link';
3
3
  import { Typography } from '../propsValues/typography';
4
- import ActionButton from '../../actionButton';
5
4
  import { Priority } from '../propsValues/control';
5
+ import Button from '../../button';
6
+ import { ButtonPriority, ButtonSentiment } from '../../button/Button.types';
6
7
 
7
8
  export type ActionOptions = {
8
9
  'aria-label'?: string;
@@ -13,12 +14,20 @@ export type ActionOptions = {
13
14
  };
14
15
 
15
16
  type Props = {
16
- variant?: 'button' | 'action-button';
17
17
  action: ActionOptions;
18
18
  className?: string;
19
+ variant?: 'button' | 'action-button';
20
+ sentiment?: ButtonSentiment;
21
+ priority?: ButtonPriority;
19
22
  };
20
23
 
21
- export function Action({ action, className, variant = 'button' }: Props) {
24
+ export function Action({
25
+ action,
26
+ className,
27
+ variant = 'button',
28
+ sentiment = 'default',
29
+ priority = Priority.SECONDARY,
30
+ }: Props) {
22
31
  if ('href' in action) {
23
32
  return (
24
33
  <Link
@@ -34,23 +43,32 @@ export function Action({ action, className, variant = 'button' }: Props) {
34
43
  );
35
44
  }
36
45
 
37
- return variant === 'button' ? (
38
- <button
39
- type="button"
40
- aria-label={action['aria-label']}
41
- className={clsx('btn-unstyled np-text-link-large', className)}
42
- onClick={action.onClick}
43
- >
44
- {action.text}
45
- </button>
46
- ) : (
47
- <ActionButton
48
- aria-label={action['aria-label']}
49
- priority={Priority.SECONDARY}
50
- className={clsx(className)}
51
- onClick={action.onClick}
52
- >
53
- {action.text}
54
- </ActionButton>
55
- );
46
+ switch (variant) {
47
+ case 'action-button':
48
+ return (
49
+ <Button
50
+ v2
51
+ size="sm"
52
+ sentiment={sentiment}
53
+ aria-label={action['aria-label']}
54
+ priority={priority}
55
+ className={clsx(className)}
56
+ onClick={action.onClick}
57
+ >
58
+ {action.text}
59
+ </Button>
60
+ );
61
+ case 'button':
62
+ default:
63
+ return (
64
+ <button
65
+ type="button"
66
+ aria-label={action['aria-label']}
67
+ className={clsx('btn-unstyled np-text-link-large', className)}
68
+ onClick={action.onClick}
69
+ >
70
+ {action.text}
71
+ </button>
72
+ );
73
+ }
56
74
  }
@@ -39,6 +39,21 @@
39
39
  width: var(--size-64);
40
40
  }
41
41
  }
42
+ .np-theme-personal .np-close-button--x-small {
43
+ height: 24px;
44
+ height: var(--size-24);
45
+ width: 24px;
46
+ width: var(--size-24);
47
+ flex-shrink: 0;
48
+ }
49
+ @media (max-width: 320px) {
50
+ .np-theme-personal .np-close-button--x-small {
51
+ height: 48px;
52
+ height: var(--size-48);
53
+ width: 48px;
54
+ width: var(--size-48);
55
+ }
56
+ }
42
57
  .np-theme-personal .np-close-button--large {
43
58
  height: 40px;
44
59
  height: var(--size-40);
@@ -33,6 +33,16 @@
33
33
  border-radius: var(--radius-full);
34
34
  transition: background-color 0.1s ease;
35
35
 
36
+ &--x-small {
37
+ height: var(--size-24);
38
+ width: var(--size-24);
39
+ @media (--screen-400-zoom) {
40
+ height: var(--size-48);
41
+ width: var(--size-48);
42
+ }
43
+ flex-shrink: 0;
44
+ }
45
+
36
46
  &--large {
37
47
  height: var(--size-40);
38
48
  width: var(--size-40);
@@ -3,7 +3,7 @@ import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { useIntl } from 'react-intl';
5
5
 
6
- import { Size, SizeLarge, SizeMedium, SizeSmall } from '../propsValues/size';
6
+ import { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';
7
7
 
8
8
  import messages from './CloseButton.messages';
9
9
 
@@ -11,7 +11,7 @@ export type CloseButtonProps = Pick<
11
11
  React.ComponentPropsWithoutRef<'button'>,
12
12
  'aria-label' | 'className' | 'onClick'
13
13
  > & {
14
- size?: SizeSmall | SizeMedium | SizeLarge;
14
+ size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;
15
15
  filled?: boolean;
16
16
  isDisabled?: boolean;
17
17
  testId?: string;
@@ -45,6 +45,7 @@ export const CloseButton = forwardRef(function CloseButton(
45
45
  'close btn-link',
46
46
  'text-no-decoration',
47
47
  {
48
+ 'np-close-button--x-small': size === Size.EXTRA_SMALL,
48
49
  'np-close-button--large': size === Size.MEDIUM,
49
50
  'np-close-button--x-large': size === Size.LARGE,
50
51
  },
@@ -56,7 +57,7 @@ export const CloseButton = forwardRef(function CloseButton(
56
57
  data-testid={testId}
57
58
  onClick={onClick}
58
59
  >
59
- <Icon size={size === Size.SMALL ? 16 : 24} />
60
+ <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />
60
61
  </button>
61
62
  );
62
63
  });
@@ -1,76 +1,36 @@
1
- div.critical-comms {
2
- --critical-comms-background-color: var(--color-background-negative);
3
- --critical-comms-title-color: var(--color-content-negative);
4
- --critical-comms-subtitle-color: var(--color-content-secondary);
5
- --critical-comms-subtitle-color-padding-left: var(--size-16);
6
- --critical-comms-vertical-spacing: var(--size-8);
7
- background-color: rgba(255,135,135,0.10196);
8
- background-color: var(--critical-comms-background-color);
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
- }
13
- .np-theme-personal div.critical-comms,
14
- .np-theme-personal--dark div.critical-comms {
15
- --critical-comms-background-color: var(--color-sentiment-negative);
16
- --critical-comms-title-color: var(--color-contrast);
17
- --critical-comms-subtitle-color: var(--color-contrast);
18
- --critical-comms-subtitle-color-padding-left: 0;
19
- --critical-comms-vertical-spacing: var(--size-16);
20
- padding: 24px;
21
- padding: var(--padding-medium);
22
- }
23
- .np-theme-personal div.critical-comms .tw-icon-alert-circle-fill,
24
- .np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill {
25
- color: var(--color-contrast);
26
- }
27
- .np-theme-personal div.critical-comms .tw-icon-alert-circle-fill svg,
28
- .np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill svg {
29
- width: 48px;
30
- height: 48px;
31
- }
32
- .np-theme-personal div.critical-comms .cta-btn,
33
- .np-theme-personal--dark div.critical-comms .cta-btn {
34
- background-color: var(--color-contrast);
35
- }
36
- .np-theme-personal div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus,
37
- .np-theme-personal--dark div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus {
38
- outline-color: var(--color-contrast);
39
- }
40
- @media (max-width: 767px) {
41
- div.critical-comms {
42
- display: inline;
43
- display: initial;
1
+ .np-theme-personal .critical-comms .alert-warning {
2
+ color: var(--color-contrast-overlay);
3
+ background-color: var(--color-sentiment-negative);
4
+ }
5
+ .np-theme-personal .critical-comms .alert-warning .np-text-title-body {
6
+ color: var(--color-contrast-overlay);
7
+ }
8
+ .np-theme-personal .critical-comms .status-circle.warning {
9
+ background-color: #ffffff;
10
+ background-color: var(--color-background-screen);
11
+ }
12
+ .np-theme-personal .critical-comms .status-circle.warning .status-icon {
13
+ color: var(--color-contrast-theme);
14
+ }
15
+ .np-theme-personal .critical-comms .alert__message .alert__action {
16
+ margin-top: 16px;
17
+ margin-top: var(--size-16);
18
+ }
19
+ .np-theme-personal .critical-comms .wds-Button {
20
+ --Button-background: var(--color-contrast-overlay);
21
+ --Button-background-hover: var(--color-sentiment-negative-secondary-hover);
22
+ --Button-background-active: var(--color-sentiment-negative-secondary-active);
23
+ }
24
+ @media (min-width: 768px) {
25
+ .np-theme-personal .critical-comms .alert-warning .alert__message {
26
+ flex-direction: row;
27
+ justify-content: space-between;
28
+ align-items: center;
29
+ width: 100%;
44
30
  }
45
- }
46
- div.critical-comms .critical-comms--title {
47
- color: var(--critical-comms-title-color);
48
- }
49
- div.critical-comms .critical-comms--subtitle {
50
- color: var(--critical-comms-subtitle-color);
51
- }
52
- div.critical-comms .critical-comms--cta {
53
- padding-left: 0;
54
- }
55
- @media (max-width: 767px) {
56
- div.critical-comms .critical-comms--cta {
57
- padding-left: var(--critical-comms-subtitle-color-padding-left);
58
- padding-top: var(--critical-comms-vertical-spacing);
59
- min-width: 100%;
60
- }
61
- }
62
- div.critical-comms .critical-comms-body {
63
- display: flex;
64
- width: 100%;
65
- }
66
- @media (max-width: 767px) {
67
- div.critical-comms .critical-comms-body {
68
- flex-direction: column;
69
- }
70
- }
71
- @media (max-width: 767px) {
72
- div.critical-comms .critical-comms-content {
73
- padding-top: var(--critical-comms-vertical-spacing);
74
- flex-wrap: wrap;
31
+ .np-theme-personal .critical-comms .alert-warning .alert__message .alert__action {
32
+ margin-top: 0;
33
+ margin-left: 16px;
34
+ margin-left: var(--padding-small);
75
35
  }
76
36
  }
@@ -1,78 +1,51 @@
1
- div.critical-comms {
2
- --critical-comms-background-color: var(--color-background-negative);
3
- --critical-comms-title-color: var(--color-content-negative);
4
- --critical-comms-subtitle-color: var(--color-content-secondary);
5
- --critical-comms-subtitle-color-padding-left: var(--size-16);
6
- --critical-comms-vertical-spacing: var(--size-8);
7
-
8
- .np-theme-personal &,
9
- .np-theme-personal--dark & {
10
- --critical-comms-background-color: var(--color-sentiment-negative);
11
- --critical-comms-title-color: var(--color-contrast);
12
- --critical-comms-subtitle-color: var(--color-contrast);
13
- --critical-comms-subtitle-color-padding-left: 0;
14
- --critical-comms-vertical-spacing: var(--size-16);
15
-
16
- padding: var(--padding-medium);
17
-
18
- .tw-icon-alert-circle-fill {
19
- color: var(--color-contrast);
20
-
21
- svg {
22
- width: 48px;
23
- height: 48px;
1
+ .np-theme-personal {
2
+ .critical-comms {
3
+ .alert-warning {
4
+ color: var(--color-contrast-overlay);
5
+ background-color: var(--color-sentiment-negative);
6
+
7
+ .np-text-title-body {
8
+ color: var(--color-contrast-overlay);
24
9
  }
25
10
  }
26
11
 
27
- .cta-btn {
28
- background-color: var(--color-contrast);
12
+ .status-circle.warning {
13
+ background-color: var(--color-background-screen);
29
14
 
30
- &:not(.disabled,:disabled):focus {
31
- outline-color: var(--color-contrast);
15
+ .status-icon {
16
+ color: var(--color-contrast-theme);
32
17
  }
33
18
  }
34
- }
35
-
36
- background-color: var(--critical-comms-background-color);
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
-
41
- @media (--screen-sm-max) {
42
- display: initial;
43
- }
44
-
45
- .critical-comms--title {
46
- color: var(--critical-comms-title-color);
47
- }
48
-
49
- .critical-comms--subtitle {
50
- color: var(--critical-comms-subtitle-color);
51
- }
52
19
 
53
- .critical-comms--cta {
54
- padding-left: 0;
55
-
56
- @media (--screen-sm-max) {
57
- padding-left: var(--critical-comms-subtitle-color-padding-left);
58
- padding-top: var(--critical-comms-vertical-spacing);
59
- min-width: 100%;
20
+ .alert__message {
21
+ .alert__action {
22
+ margin-top: var(--size-16);
23
+ }
60
24
  }
61
- }
62
-
63
- .critical-comms-body {
64
- display: flex;
65
- width: 100%;
66
25
 
67
- @media (--screen-sm-max) {
68
- flex-direction: column;
26
+ .wds-Button {
27
+ --Button-background: var(--color-contrast-overlay);
28
+ --Button-background-hover: var(--color-sentiment-negative-secondary-hover);
29
+ --Button-background-active: var(--color-sentiment-negative-secondary-active);
69
30
  }
70
31
  }
71
32
 
72
- .critical-comms-content {
73
- @media (--screen-sm-max) {
74
- padding-top: var(--critical-comms-vertical-spacing);
75
- flex-wrap: wrap;
33
+
34
+ @media (--screen-md) {
35
+ .critical-comms {
36
+ .alert-warning {
37
+ .alert__message {
38
+ flex-direction: row;
39
+ justify-content: space-between;
40
+ align-items: center;
41
+ width: 100%;
42
+
43
+ .alert__action {
44
+ margin-top: 0;
45
+ margin-left: var(--padding-small);
46
+ }
47
+ }
48
+ }
76
49
  }
77
50
  }
78
- }
51
+ }