@transferwise/components 0.0.0-experimental-d4fb387 → 0.0.0-experimental-93ed47e

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 (64) hide show
  1. package/build/alert/Alert.js +29 -17
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +26 -14
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/common/action/Action.js +3 -2
  6. package/build/common/action/Action.js.map +1 -1
  7. package/build/common/action/Action.mjs +3 -2
  8. package/build/common/action/Action.mjs.map +1 -1
  9. package/build/common/propsValues/sentiment.js +1 -0
  10. package/build/common/propsValues/sentiment.js.map +1 -1
  11. package/build/common/propsValues/sentiment.mjs +1 -0
  12. package/build/common/propsValues/sentiment.mjs.map +1 -1
  13. package/build/criticalBanner/CriticalCommsBanner.js +13 -74
  14. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  15. package/build/criticalBanner/CriticalCommsBanner.mjs +14 -75
  16. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  17. package/build/i18n/en.json +1 -0
  18. package/build/i18n/en.json.js +1 -0
  19. package/build/i18n/en.json.js.map +1 -1
  20. package/build/i18n/en.json.mjs +1 -0
  21. package/build/i18n/en.json.mjs.map +1 -1
  22. package/build/main.css +11 -72
  23. package/build/statusIcon/StatusIcon.js +5 -1
  24. package/build/statusIcon/StatusIcon.js.map +1 -1
  25. package/build/statusIcon/StatusIcon.messages.js +3 -0
  26. package/build/statusIcon/StatusIcon.messages.js.map +1 -1
  27. package/build/statusIcon/StatusIcon.messages.mjs +3 -0
  28. package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
  29. package/build/statusIcon/StatusIcon.mjs +5 -1
  30. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  31. package/build/styles/criticalBanner/CriticalCommsBanner.css +7 -72
  32. package/build/styles/main.css +11 -72
  33. package/build/styles/statusIcon/StatusIcon.css +4 -0
  34. package/build/types/alert/Alert.d.ts +2 -1
  35. package/build/types/alert/Alert.d.ts.map +1 -1
  36. package/build/types/common/action/Action.d.ts +3 -1
  37. package/build/types/common/action/Action.d.ts.map +1 -1
  38. package/build/types/common/propsValues/sentiment.d.ts +1 -0
  39. package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
  40. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +3 -1
  41. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  42. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  43. package/build/types/statusIcon/StatusIcon.messages.d.ts +5 -0
  44. package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
  45. package/build/types/test-utils/index.d.ts +2 -0
  46. package/build/types/test-utils/index.d.ts.map +1 -1
  47. package/package.json +3 -3
  48. package/src/alert/Alert.less +4 -0
  49. package/src/alert/Alert.story.tsx +36 -0
  50. package/src/alert/Alert.tsx +26 -8
  51. package/src/button/Button.story.tsx +7 -2
  52. package/src/button/LegacyButton.story.tsx +4 -1
  53. package/src/common/action/Action.tsx +8 -2
  54. package/src/common/propsValues/sentiment.ts +1 -0
  55. package/src/criticalBanner/CriticalCommsBanner.css +7 -72
  56. package/src/criticalBanner/CriticalCommsBanner.less +12 -73
  57. package/src/criticalBanner/CriticalCommsBanner.story.tsx +2 -0
  58. package/src/criticalBanner/CriticalCommsBanner.tsx +18 -51
  59. package/src/i18n/en.json +1 -0
  60. package/src/main.css +11 -72
  61. package/src/statusIcon/StatusIcon.css +4 -0
  62. package/src/statusIcon/StatusIcon.less +4 -0
  63. package/src/statusIcon/StatusIcon.messages.ts +6 -0
  64. package/src/statusIcon/StatusIcon.tsx +8 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/alert/Alert.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,SAAS,EACT,IAAI,EAEJ,OAAO,EAER,MAAM,WAAW,CAAC;AASnB,MAAM,MAAM,WAAW,GAAG;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,WAAW,cAAc;IACzB,MAAM,gBAAgB;IACtB,YAAY,eAAe;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,yIAAyI;IACzI,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;SAGK;IACL,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvD,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kDAAkD;IAClD,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IACvB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAChC,oHAAoH;IACpH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;CAClB;AAeD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,MAAM,EACN,SAAS,EACT,IAAI,EACJ,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAgB,EAChB,OAAmB,EACnB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,WAAW,GACZ,EAAE,UAAU,+BAkIZ"}
@@ -1,3 +1,4 @@
1
+ import { Priority } from '../propsValues/control';
1
2
  export type ActionOptions = {
2
3
  'aria-label'?: string;
3
4
  href?: string;
@@ -9,7 +10,8 @@ type Props = {
9
10
  variant?: 'button' | 'action-button';
10
11
  action: ActionOptions;
11
12
  className?: string;
13
+ priority?: Priority;
12
14
  };
13
- export declare function Action({ action, className, variant }: Props): import("react").JSX.Element;
15
+ export declare function Action({ action, className, variant, priority, }: Props): import("react").JSX.Element;
14
16
  export {};
15
17
  //# sourceMappingURL=Action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/common/action/Action.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAC;IACrC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAkB,EAAE,EAAE,KAAK,+BAmCtE"}
1
+ {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/common/action/Action.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAC;IACrC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,EACT,OAAkB,EAClB,QAA6B,GAC9B,EAAE,KAAK,+BAmCP"}
@@ -4,6 +4,7 @@ export declare enum Sentiment {
4
4
  POSITIVE = "positive",
5
5
  WARNING = "warning",
6
6
  PENDING = "pending",
7
+ CRITICAL = "critical",
7
8
  /**
8
9
  * @deprecated
9
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sentiment.d.ts","sourceRoot":"","sources":["../../../../src/common/propsValues/sentiment.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IAEnB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,OAAO,YAAY;CACpB"}
1
+ {"version":3,"file":"sentiment.d.ts","sourceRoot":"","sources":["../../../../src/common/propsValues/sentiment.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IAErB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,OAAO,YAAY;CACpB"}
@@ -1,3 +1,4 @@
1
+ import { Variant } from '../common';
1
2
  export type CriticalCommsBannerProps = {
2
3
  title: string;
3
4
  subtitle?: string;
@@ -6,7 +7,8 @@ export type CriticalCommsBannerProps = {
6
7
  href: string;
7
8
  };
8
9
  className?: string;
10
+ variant?: Variant;
9
11
  };
10
- declare function CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps): import("react").JSX.Element;
12
+ declare function CriticalCommsBanner({ title, subtitle, action, className, variant, }: CriticalCommsBannerProps): import("react").JSX.Element;
11
13
  export default CriticalCommsBanner;
12
14
  //# sourceMappingURL=CriticalCommsBanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalCommsBanner.d.ts","sourceRoot":"","sources":["../../../src/criticalBanner/CriticalCommsBanner.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAS,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,wBAAwB,+BA+C5F;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CriticalCommsBanner.d.ts","sourceRoot":"","sources":["../../../src/criticalBanner/CriticalCommsBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,iBAAS,mBAAmB,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE,wBAAwB,+BAa1B;AAED,eAAe,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAM1F;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACtD;;;;SAIK;IACL,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAQF,QAAA,MAAM,UAAU,6CAA+D,eAAe,gCA8D7F,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAM1F;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACtD;;;;SAIK;IACL,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAQF,QAAA,MAAM,UAAU,6CAA+D,eAAe,gCAqE7F,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -14,6 +14,11 @@ declare const _default: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ criticalLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
17
22
  pendingLabel: {
18
23
  id: string;
19
24
  defaultMessage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.messages.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA+BG"}
1
+ {"version":3,"file":"StatusIcon.messages.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAqCG"}
@@ -37,6 +37,7 @@ declare function customRender(ui: ReactElement, { locale, messages, ...renderOpt
37
37
  "neptune.SelectInput.noResultsFound": string;
38
38
  "neptune.SelectOption.action.label": string;
39
39
  "neptune.SelectOption.selected.action.label": string;
40
+ "neptune.StatusIcon.iconLabel.critical": string;
40
41
  "neptune.StatusIcon.iconLabel.error": string;
41
42
  "neptune.StatusIcon.iconLabel.information": string;
42
43
  "neptune.StatusIcon.iconLabel.pending": string;
@@ -117,6 +118,7 @@ declare function customRenderHook(callback: () => unknown, { locale, messages }?
117
118
  "neptune.SelectInput.noResultsFound": string;
118
119
  "neptune.SelectOption.action.label": string;
119
120
  "neptune.SelectOption.selected.action.label": string;
121
+ "neptune.StatusIcon.iconLabel.critical": string;
120
122
  "neptune.StatusIcon.iconLabel.error": string;
121
123
  "neptune.StatusIcon.iconLabel.information": string;
122
124
  "neptune.StatusIcon.iconLabel.pending": string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test-utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAM,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAMxD;;;;GAIG;AACH,iBAAS,YAAY,CACnB,EAAE,EAAE,YAAY,EAChB,EAAE,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;;;;;;;;;;;;;;;;CAAK,uEAKhD;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,gBAAgB,IAAI,UAAU,EAAE,SAAS,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-d4fb387",
3
+ "version": "0.0.0-experimental-93ed47e",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -92,12 +92,12 @@
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
94
  "@transferwise/less-config": "3.1.0",
95
- "@transferwise/neptune-css": "0.0.0-experimental-d4fb387",
95
+ "@transferwise/neptune-css": "0.0.0-experimental-93ed47e",
96
96
  "@wise/components-theming": "1.6.1"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
100
- "@transferwise/neptune-css": "0.0.0-experimental-d4fb387",
100
+ "@transferwise/neptune-css": "0.0.0-experimental-93ed47e",
101
101
  "@wise/art": "^2.16",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
@@ -1,3 +1,7 @@
1
1
  .wds-alert__liveRegion {
2
2
  display: contents;
3
3
  }
4
+
5
+ .alert__message {
6
+ // padding-left: 16px !important; this shouldn't be necessary
7
+ }
@@ -96,11 +96,47 @@ export const WithCustomIcon: Story = {
96
96
  },
97
97
  };
98
98
 
99
+ export const WithShortTitle: Story = {
100
+ args: {
101
+ type: Sentiment.NEUTRAL,
102
+ title: 'We’re reviewing your information.',
103
+ message:
104
+ 'Payments sent to your bank details **today** might not arrive in time for the holidays.',
105
+ onDismiss: () => {},
106
+ action: {
107
+ onClick: action('alert action clicked'),
108
+ // href: '/',
109
+ text: 'Open',
110
+ },
111
+ },
112
+ };
99
113
  export const WithTitle: Story = {
100
114
  args: {
101
115
  type: Sentiment.NEUTRAL,
102
116
  title: 'We’re reviewing your information.',
117
+ message:
118
+ 'Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays.',
103
119
  onDismiss: () => {},
120
+ action: {
121
+ onClick: action('alert action clicked'),
122
+ // href: '/',
123
+ text: 'Open',
124
+ },
125
+ },
126
+ };
127
+
128
+ export const WithTitleLink: Story = {
129
+ args: {
130
+ type: Sentiment.NEUTRAL,
131
+ title: 'We’re reviewing your information.',
132
+ message:
133
+ 'Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays. Payments sent to your bank details **today** might not arrive in time for the holidays.',
134
+ onDismiss: () => {},
135
+ action: {
136
+ // onClick: action('alert action clicked'),
137
+ href: '/',
138
+ text: 'Open',
139
+ },
104
140
  },
105
141
  };
106
142
 
@@ -32,7 +32,8 @@ type AlertTypeResolved = `${
32
32
  | Sentiment.POSITIVE
33
33
  | Sentiment.NEUTRAL
34
34
  | Sentiment.WARNING
35
- | Sentiment.NEGATIVE}`;
35
+ | Sentiment.NEGATIVE
36
+ | Sentiment.CRITICAL}`;
36
37
  export type AlertType = AlertTypeResolved | AlertTypeDeprecated;
37
38
 
38
39
  export enum AlertArrowPosition {
@@ -63,6 +64,7 @@ export interface AlertProps {
63
64
  onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
64
65
  /** The type dictates which icon and colour will be used */
65
66
  type?: AlertType;
67
+ /** @deprecated They both look behave the same. */
66
68
  variant?: `${Variant}`;
67
69
  /** @deprecated Use `InlineAlert` instead. */
68
70
  arrow?: `${AlertArrowPosition}`;
@@ -152,9 +154,20 @@ export default function Alert({
152
154
 
153
155
  const closeButtonReference = useRef<HTMLButtonElement>(null);
154
156
 
157
+ const showButtonBelow = () => {
158
+ if (variant === 'desktop' && resolvedType === 'critical') {
159
+ return false;
160
+ }
161
+ return true;
162
+ };
163
+
155
164
  return (
156
165
  <div
157
- role={resolvedType === Sentiment.NEGATIVE ? 'alert' : 'status'}
166
+ role={
167
+ resolvedType === Sentiment.NEGATIVE || resolvedType === Sentiment.CRITICAL
168
+ ? 'alert'
169
+ : 'status'
170
+ }
158
171
  className="wds-alert__liveRegion"
159
172
  >
160
173
  <div
@@ -186,15 +199,13 @@ export default function Alert({
186
199
  }}
187
200
  onTouchMove={() => setShouldFire(false)}
188
201
  >
202
+ <div className="alert__icon">
203
+ {icon || <StatusIcon size={48} sentiment={resolvedType} iconLabel={statusIconLabel} />}
204
+ </div>
189
205
  <div
190
206
  className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}
191
207
  data-testid={variant}
192
208
  >
193
- {icon ? (
194
- <div className="alert__icon">{icon}</div>
195
- ) : (
196
- <StatusIcon size={Size.LARGE} sentiment={resolvedType} iconLabel={statusIconLabel} />
197
- )}
198
209
  <div className="alert__message">
199
210
  <div>
200
211
  {title && (
@@ -206,9 +217,16 @@ export default function Alert({
206
217
  {children || <InlineMarkdown>{message}</InlineMarkdown>}
207
218
  </Body>
208
219
  </div>
209
- {action && <Action action={action} variant="action-button" className="m-t-1" />}
220
+ {action && showButtonBelow() && (
221
+ <Action action={action} variant="action-button" className="m-t-2" />
222
+ )}
210
223
  </div>
211
224
  </div>
225
+ {action && !showButtonBelow() && (
226
+ <div className="action__desktop">
227
+ <Action action={action} variant="action-button" />
228
+ </div>
229
+ )}
212
230
  {onDismiss && (
213
231
  <CloseButton ref={closeButtonReference} className="m-l-2" onClick={onDismiss} />
214
232
  )}
@@ -143,6 +143,12 @@ const getPropsForPreview = (args: PreviewStoryArgs) => {
143
143
  ];
144
144
  };
145
145
 
146
+ /**
147
+ * The stories below document the new Button API, which requires `v2` prop to function. <br />For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://wise.design/components/button). <br />
148
+ * You can still find the old Button documentation under [Legacy Button](?path=/docs/actions-button-legacy--docs)
149
+ *
150
+ *
151
+ */
146
152
  const meta: Meta<typeof Button> = {
147
153
  component: Button,
148
154
  title: 'Actions/Button',
@@ -299,8 +305,7 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
299
305
  };
300
306
 
301
307
  /**
302
- * There are two different types of button that, default and negative,
303
- * these designed to emphasise the nature of the action. <br />
308
+ * There are two different types of button default and negative – designed to emphasise the nature of the action. <br />
304
309
  * **NB:** Sentiment only applies to `primary` and `secondary` priorities. <br />
305
310
  * [Design documentation](https://wise.design/components/button#types)
306
311
  */
@@ -5,6 +5,9 @@ import { useState } from 'react';
5
5
  import Button from '.';
6
6
  import LegacyButton from './LegacyButton';
7
7
 
8
+ // needed for the SB to show correct name in the Source blocks
9
+ LegacyButton.displayName = 'Button';
10
+
8
11
  const withContainer = (Story: any) => (
9
12
  <div
10
13
  style={{
@@ -21,7 +24,7 @@ const withContainer = (Story: any) => (
21
24
 
22
25
  const meta: Meta<typeof LegacyButton> = {
23
26
  component: LegacyButton,
24
- title: 'Actions/Button/Legacy',
27
+ title: 'Actions/Button/Legacy Button',
25
28
  args: {
26
29
  size: undefined,
27
30
  priority: undefined,
@@ -16,9 +16,15 @@ type Props = {
16
16
  variant?: 'button' | 'action-button';
17
17
  action: ActionOptions;
18
18
  className?: string;
19
+ priority?: Priority;
19
20
  };
20
21
 
21
- export function Action({ action, className, variant = 'button' }: Props) {
22
+ export function Action({
23
+ action,
24
+ className,
25
+ variant = 'button',
26
+ priority = Priority.SECONDARY,
27
+ }: Props) {
22
28
  if ('href' in action) {
23
29
  return (
24
30
  <Link
@@ -46,7 +52,7 @@ export function Action({ action, className, variant = 'button' }: Props) {
46
52
  ) : (
47
53
  <ActionButton
48
54
  aria-label={action['aria-label']}
49
- priority={Priority.SECONDARY}
55
+ priority={priority}
50
56
  className={clsx(className)}
51
57
  onClick={action.onClick}
52
58
  >
@@ -4,6 +4,7 @@ export enum Sentiment {
4
4
  POSITIVE = 'positive',
5
5
  WARNING = 'warning',
6
6
  PENDING = 'pending',
7
+ CRITICAL = 'critical',
7
8
 
8
9
  /**
9
10
  * @deprecated
@@ -1,76 +1,11 @@
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);
1
+ .np-theme-personal .critical-comms .alert-critical {
2
+ color: var(--color-contrast-overlay);
3
+ background-color: var(--color-sentiment-negative) !important;
39
4
  }
40
- @media (max-width: 767px) {
41
- div.critical-comms {
42
- display: inline;
43
- display: initial;
44
- }
5
+ .np-theme-personal .critical-comms .alert-critical .np-text-title-body {
6
+ color: var(--color-contrast-overlay);
45
7
  }
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 {
8
+ .np-theme-personal .critical-comms .action__desktop {
63
9
  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;
75
- }
10
+ align-items: center;
76
11
  }
@@ -1,78 +1,17 @@
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;
24
- }
25
- }
26
-
27
- .cta-btn {
28
- background-color: var(--color-contrast);
29
-
30
- &:not(.disabled,:disabled):focus {
31
- outline-color: var(--color-contrast);
1
+ .np-theme-personal {
2
+ .critical-comms {
3
+ .alert-critical {
4
+ color: var(--color-contrast-overlay);
5
+ background-color: var(--color-sentiment-negative) !important;
6
+
7
+ .np-text-title-body {
8
+ color: var(--color-contrast-overlay);
32
9
  }
33
10
  }
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
-
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%;
60
- }
61
- }
62
-
63
- .critical-comms-body {
64
- display: flex;
65
- width: 100%;
66
-
67
- @media (--screen-sm-max) {
68
- flex-direction: column;
69
- }
70
- }
71
11
 
72
- .critical-comms-content {
73
- @media (--screen-sm-max) {
74
- padding-top: var(--critical-comms-vertical-spacing);
75
- flex-wrap: wrap;
12
+ .action__desktop {
13
+ display: flex;
14
+ align-items: center;
76
15
  }
77
16
  }
78
- }
17
+ }
@@ -1,6 +1,7 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
 
3
3
  import CriticalCommsBanner from '.';
4
+ import { Variant } from '../common';
4
5
 
5
6
  export default {
6
7
  component: CriticalCommsBanner,
@@ -15,5 +16,6 @@ export const Basic: Story = {
15
16
  title: 'Your account is overdrawn',
16
17
  subtitle: 'Add money within the next 30 days',
17
18
  action: { label: 'Take action', href: 'https://wise.com' },
19
+ variant: Variant.DESKTOP,
18
20
  },
19
21
  };
@@ -1,12 +1,6 @@
1
- import { Alert as DangerIcon, AlertCircleFill } from '@transferwise/icons';
2
- import { useTheme } from '@wise/components-theming';
1
+ import Alert from '../alert';
3
2
  import { clsx } from 'clsx';
4
-
5
- import Avatar, { AvatarType } from '../avatar';
6
- import Body from '../body';
7
- import Button from '../button';
8
- import { ControlType, Priority, Size, Typography } from '../common';
9
- import Title from '../title';
3
+ import { Variant } from '../common';
10
4
 
11
5
  export type CriticalCommsBannerProps = {
12
6
  title: string;
@@ -16,53 +10,26 @@ export type CriticalCommsBannerProps = {
16
10
  href: string;
17
11
  };
18
12
  className?: string;
13
+ variant?: Variant;
19
14
  };
20
15
 
21
- function CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {
22
- const { isModern } = useTheme();
16
+ function CriticalCommsBanner({
17
+ title,
18
+ subtitle,
19
+ action,
20
+ className,
21
+ variant,
22
+ }: CriticalCommsBannerProps) {
23
23
  return (
24
24
  <div className={clsx('critical-comms', className)}>
25
- <div className="critical-comms-body">
26
- <Avatar
27
- size={Size.MEDIUM}
28
- type={AvatarType.ICON}
29
- className={clsx(isModern ? 'm-r-2' : 'm-r-1')}
30
- backgroundColor={
31
- isModern ? 'var(--color-sentiment-negative)' : 'var(--color-background-negative)'
32
- }
33
- >
34
- {isModern ? <AlertCircleFill /> : <DangerIcon size={24} />}
35
- </Avatar>
36
- <div className="critical-comms-content d-flex align-items-center flex-grow-1">
37
- <div className={clsx('flex-grow-1', { 'p-x-2': !isModern })}>
38
- <Title
39
- type={isModern ? Typography.TITLE_BODY : Typography.TITLE_GROUP}
40
- className="critical-comms--title"
41
- >
42
- {title}
43
- </Title>
44
- <Body className="critical-comms--subtitle">{subtitle}</Body>
45
- </div>
46
- {action ? (
47
- <div className="critical-comms--cta">
48
- <Button
49
- block={isModern}
50
- size={Size.SMALL}
51
- type={ControlType.NEGATIVE}
52
- priority={isModern ? Priority.SECONDARY : Priority.PRIMARY}
53
- className="cta-btn"
54
- onClick={() => {
55
- if (action) {
56
- window.location.href = action.href;
57
- }
58
- }}
59
- >
60
- {action.label}
61
- </Button>
62
- </div>
63
- ) : null}
64
- </div>
65
- </div>
25
+ <Alert
26
+ title={title}
27
+ message={subtitle}
28
+ action={{ target: action?.href, text: action?.label }}
29
+ className={className}
30
+ type="critical"
31
+ variant={variant}
32
+ />
66
33
  </div>
67
34
  );
68
35
  }
package/src/i18n/en.json CHANGED
@@ -27,6 +27,7 @@
27
27
  "neptune.SelectInput.noResultsFound": "No results found",
28
28
  "neptune.SelectOption.action.label": "Choose",
29
29
  "neptune.SelectOption.selected.action.label": "Change chosen option",
30
+ "neptune.StatusIcon.iconLabel.critical": "Critical:",
30
31
  "neptune.StatusIcon.iconLabel.error": "Error:",
31
32
  "neptune.StatusIcon.iconLabel.information": "Information:",
32
33
  "neptune.StatusIcon.iconLabel.pending": "Pending:",