@transferwise/components 0.0.0-experimental-6528439 → 0.0.0-experimental-1ffdc56

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 (189) hide show
  1. package/build/alert/Alert.js +33 -17
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +30 -14
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/avatarLayout/AvatarLayout.js +9 -2
  6. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  7. package/build/avatarLayout/AvatarLayout.mjs +9 -2
  8. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  9. package/build/button/Button.js +86 -79
  10. package/build/button/Button.js.map +1 -1
  11. package/build/button/Button.mjs +87 -80
  12. package/build/button/Button.mjs.map +1 -1
  13. package/build/button/Button.resolver.js +74 -0
  14. package/build/button/Button.resolver.js.map +1 -0
  15. package/build/button/Button.resolver.mjs +72 -0
  16. package/build/button/Button.resolver.mjs.map +1 -0
  17. package/build/button/LegacyButton.js +114 -0
  18. package/build/button/LegacyButton.js.map +1 -0
  19. package/build/button/LegacyButton.mjs +112 -0
  20. package/build/button/LegacyButton.mjs.map +1 -0
  21. package/build/common/action/Action.js +26 -15
  22. package/build/common/action/Action.js.map +1 -1
  23. package/build/common/action/Action.mjs +26 -15
  24. package/build/common/action/Action.mjs.map +1 -1
  25. package/build/common/propsValues/sentiment.js +1 -0
  26. package/build/common/propsValues/sentiment.js.map +1 -1
  27. package/build/common/propsValues/sentiment.mjs +1 -0
  28. package/build/common/propsValues/sentiment.mjs.map +1 -1
  29. package/build/criticalBanner/CriticalCommsBanner.js +10 -73
  30. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  31. package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
  32. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  33. package/build/dimmer/Dimmer.js +67 -41
  34. package/build/dimmer/Dimmer.js.map +1 -1
  35. package/build/dimmer/Dimmer.mjs +69 -43
  36. package/build/dimmer/Dimmer.mjs.map +1 -1
  37. package/build/header/Header.js +2 -2
  38. package/build/header/Header.js.map +1 -1
  39. package/build/header/Header.mjs +1 -1
  40. package/build/i18n/en.json +1 -0
  41. package/build/i18n/en.json.js +1 -0
  42. package/build/i18n/en.json.js.map +1 -1
  43. package/build/i18n/en.json.mjs +1 -0
  44. package/build/i18n/en.json.mjs.map +1 -1
  45. package/build/index.js +2 -2
  46. package/build/index.mjs +1 -1
  47. package/build/inputs/_BottomSheet.js +8 -1
  48. package/build/inputs/_BottomSheet.js.map +1 -1
  49. package/build/inputs/_BottomSheet.mjs +9 -2
  50. package/build/inputs/_BottomSheet.mjs.map +1 -1
  51. package/build/inputs/_Popover.js +8 -1
  52. package/build/inputs/_Popover.js.map +1 -1
  53. package/build/inputs/_Popover.mjs +9 -2
  54. package/build/inputs/_Popover.mjs.map +1 -1
  55. package/build/link/Link.js +8 -3
  56. package/build/link/Link.js.map +1 -1
  57. package/build/link/Link.mjs +8 -3
  58. package/build/link/Link.mjs.map +1 -1
  59. package/build/main.css +250 -72
  60. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +2 -4
  61. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
  62. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +2 -4
  63. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
  64. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +3 -5
  65. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
  66. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +3 -5
  67. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
  68. package/build/select/Select.js +2 -2
  69. package/build/select/Select.js.map +1 -1
  70. package/build/select/Select.mjs +1 -1
  71. package/build/statusIcon/StatusIcon.js +5 -1
  72. package/build/statusIcon/StatusIcon.js.map +1 -1
  73. package/build/statusIcon/StatusIcon.messages.js +3 -0
  74. package/build/statusIcon/StatusIcon.messages.js.map +1 -1
  75. package/build/statusIcon/StatusIcon.messages.mjs +3 -0
  76. package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
  77. package/build/statusIcon/StatusIcon.mjs +5 -1
  78. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  79. package/build/styles/avatarLayout/AvatarLayout.css +11 -0
  80. package/build/styles/button/Button.css +220 -15
  81. package/build/styles/button/Button.vars.css +46 -0
  82. package/build/styles/button/LegacyButton.css +23 -0
  83. package/build/styles/criticalBanner/CriticalCommsBanner.css +7 -72
  84. package/build/styles/main.css +250 -72
  85. package/build/styles/statusIcon/StatusIcon.css +4 -0
  86. package/build/types/alert/Alert.d.ts +2 -1
  87. package/build/types/alert/Alert.d.ts.map +1 -1
  88. package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
  89. package/build/types/button/Button.d.ts +2 -23
  90. package/build/types/button/Button.d.ts.map +1 -1
  91. package/build/types/button/Button.resolver.d.ts +35 -0
  92. package/build/types/button/Button.resolver.d.ts.map +1 -0
  93. package/build/types/button/Button.types.d.ts +70 -0
  94. package/build/types/button/Button.types.d.ts.map +1 -0
  95. package/build/types/button/LegacyButton.d.ts +44 -0
  96. package/build/types/button/LegacyButton.d.ts.map +1 -0
  97. package/build/types/button/index.d.ts +2 -2
  98. package/build/types/button/index.d.ts.map +1 -1
  99. package/build/types/common/action/Action.d.ts +4 -1
  100. package/build/types/common/action/Action.d.ts.map +1 -1
  101. package/build/types/common/propsValues/sentiment.d.ts +1 -0
  102. package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
  103. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  104. package/build/types/dimmer/Dimmer.d.ts.map +1 -1
  105. package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
  106. package/build/types/inputs/_Popover.d.ts.map +1 -1
  107. package/build/types/link/Link.d.ts +2 -2
  108. package/build/types/link/Link.d.ts.map +1 -1
  109. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
  110. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +6 -2
  111. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
  112. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
  113. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  114. package/build/types/statusIcon/StatusIcon.messages.d.ts +5 -0
  115. package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
  116. package/build/types/test-utils/index.d.ts +2 -0
  117. package/build/types/test-utils/index.d.ts.map +1 -1
  118. package/build/types/test-utils/story-config.d.ts +1 -1
  119. package/build/types/test-utils/story-config.d.ts.map +1 -1
  120. package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
  121. package/build/upload/steps/completeStep/completeStep.js +2 -2
  122. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  123. package/build/upload/steps/completeStep/completeStep.mjs +1 -1
  124. package/build/upload/steps/processingStep/processingStep.js +2 -2
  125. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  126. package/build/upload/steps/processingStep/processingStep.mjs +1 -1
  127. package/build/uploadInput/UploadInput.js +3 -3
  128. package/build/uploadInput/UploadInput.js.map +1 -1
  129. package/build/uploadInput/UploadInput.mjs +1 -1
  130. package/build/withNextPortal/withNextPortal.js +2 -5
  131. package/build/withNextPortal/withNextPortal.js.map +1 -1
  132. package/build/withNextPortal/withNextPortal.mjs +2 -5
  133. package/build/withNextPortal/withNextPortal.mjs.map +1 -1
  134. package/package.json +5 -5
  135. package/src/alert/Alert.story.tsx +36 -0
  136. package/src/alert/Alert.tests.story.tsx +1 -1
  137. package/src/alert/Alert.tsx +37 -8
  138. package/src/avatarLayout/AvatarLayout.css +11 -0
  139. package/src/avatarLayout/AvatarLayout.less +18 -1
  140. package/src/avatarLayout/AvatarLayout.tsx +10 -2
  141. package/src/button/Button.accessibility.docs.mdx +103 -0
  142. package/src/button/Button.css +220 -15
  143. package/src/button/Button.less +228 -13
  144. package/src/button/Button.resolver.tsx +73 -0
  145. package/src/button/Button.spec.tsx +215 -226
  146. package/src/button/Button.story.tsx +761 -134
  147. package/src/button/Button.tests.story.tsx +27 -0
  148. package/src/button/Button.tsx +99 -132
  149. package/src/button/Button.types.ts +92 -0
  150. package/src/button/Button.vars.css +46 -0
  151. package/src/button/Button.vars.less +57 -0
  152. package/src/button/LegacyButton.css +23 -0
  153. package/src/button/LegacyButton.less +24 -0
  154. package/src/button/LegacyButton.spec.tsx +147 -0
  155. package/src/button/LegacyButton.story.tsx +228 -0
  156. package/src/button/LegacyButton.tsx +177 -0
  157. package/src/button/index.ts +2 -3
  158. package/src/common/action/Action.tsx +39 -21
  159. package/src/common/bottomSheet/BottomSheet.spec.tsx +3 -6
  160. package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -5
  161. package/src/common/propsValues/sentiment.ts +1 -0
  162. package/src/criticalBanner/CriticalCommsBanner.css +7 -72
  163. package/src/criticalBanner/CriticalCommsBanner.less +12 -73
  164. package/src/criticalBanner/CriticalCommsBanner.story.tsx +13 -9
  165. package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
  166. package/src/dimmer/Dimmer.tsx +72 -44
  167. package/src/field/Field.story.tsx +1 -1
  168. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -2
  169. package/src/i18n/en.json +1 -0
  170. package/src/inputs/SelectInput.story.tsx +1 -1
  171. package/src/inputs/_BottomSheet.tsx +9 -3
  172. package/src/inputs/_Popover.tsx +10 -4
  173. package/src/label/Label.story.tsx +1 -1
  174. package/src/link/Link.tsx +15 -6
  175. package/src/main.css +250 -72
  176. package/src/main.less +1 -0
  177. package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +2 -8
  178. package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +7 -2
  179. package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -3
  180. package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +4 -12
  181. package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +16 -13
  182. package/src/statusIcon/StatusIcon.css +4 -0
  183. package/src/statusIcon/StatusIcon.less +4 -0
  184. package/src/statusIcon/StatusIcon.messages.ts +6 -0
  185. package/src/statusIcon/StatusIcon.tsx +8 -1
  186. package/src/test-utils/Parameters.d.ts +9 -1
  187. package/src/test-utils/story-config.ts +10 -1
  188. package/src/withNextPortal/withNextPortal.tsx +1 -10
  189. package/src/button/__snapshots__/Button.spec.tsx.snap +0 -309
@@ -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,8 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta } from '@storybook/react';
2
2
 
3
3
  import CriticalCommsBanner from '.';
4
+ import { Variant } from '../common';
5
+ import { storyConfig } from '../test-utils';
4
6
 
5
7
  export default {
6
8
  component: CriticalCommsBanner,
@@ -8,12 +10,14 @@ export default {
8
10
  tags: ['autodocs'],
9
11
  } satisfies Meta<typeof CriticalCommsBanner>;
10
12
 
11
- type Story = StoryObj<typeof CriticalCommsBanner>;
12
-
13
- export const Basic: Story = {
14
- args: {
15
- title: 'Your account is overdrawn',
16
- subtitle: 'Add money within the next 30 days',
17
- action: { label: 'Take action', href: 'https://wise.com' },
13
+ export const Basic = storyConfig(
14
+ {
15
+ args: {
16
+ title: 'Your account is overdrawn',
17
+ subtitle: 'Add money within the next 30 days',
18
+ action: { label: 'Take action', href: 'https://wise.com' },
19
+ variant: Variant.DESKTOP,
20
+ },
18
21
  },
19
- };
22
+ { variants: ['default', 'dark', 'rtl'] },
23
+ );
@@ -1,13 +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
3
 
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';
10
-
11
4
  export type CriticalCommsBannerProps = {
12
5
  title: string;
13
6
  subtitle?: string;
@@ -19,50 +12,15 @@ export type CriticalCommsBannerProps = {
19
12
  };
20
13
 
21
14
  function CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {
22
- const { isModern } = useTheme();
23
15
  return (
24
16
  <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>
17
+ <Alert
18
+ title={title}
19
+ message={subtitle}
20
+ action={{ target: action?.href, text: action?.label }}
21
+ className={className}
22
+ type="critical"
23
+ />
66
24
  </div>
67
25
  );
68
26
  }
@@ -1,5 +1,6 @@
1
+ import { ThemeProvider, useTheme } from '@wise/components-theming';
1
2
  import { clsx } from 'clsx';
2
- import { MouseEvent, ReactNode, useCallback, useEffect, useRef } from 'react';
3
+ import { MouseEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
3
4
  import { CSSTransition } from 'react-transition-group';
4
5
 
5
6
  import {
@@ -58,6 +59,7 @@ const Dimmer = ({
58
59
  onClose,
59
60
  onExited: handleExited,
60
61
  }: DimmerProps) => {
62
+ const [hasNotExited, setHasNotExited] = useState(false);
61
63
  const dimmerReference = useRef<HTMLDivElement>(null);
62
64
 
63
65
  const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {
@@ -89,11 +91,15 @@ const Dimmer = ({
89
91
  );
90
92
 
91
93
  const onEnter = () => {
94
+ setHasNotExited(true);
95
+
92
96
  if (dimmerReference.current) {
93
97
  dimmerManager.add(dimmerReference.current);
94
98
  }
95
99
  };
96
100
  const onExited = () => {
101
+ setHasNotExited(false);
102
+
97
103
  if (dimmerReference.current) {
98
104
  dimmerManager.remove(dimmerReference.current);
99
105
  }
@@ -116,54 +122,76 @@ const Dimmer = ({
116
122
  }, [handleKeyDown, open]);
117
123
 
118
124
  return (
119
- <CSSTransition
120
- nodeRef={dimmerReference}
121
- in={open}
122
- appear
123
- // Wait for animation to finish before unmount.
124
- timeout={{ enter: 0, exit: EXIT_ANIMATION }}
125
- classNames={{
126
- enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),
127
- enterDone: clsx('dimmer--enter-done', {
128
- 'dimmer--enter-fade': fadeContentOnEnter,
129
- }),
130
- exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),
131
- }}
132
- unmountOnExit
133
- onEnter={onEnter}
134
- onExited={onExited}
135
- >
136
- <DimmerContentWrapper scrollBody={!transparent}>
137
- <FocusBoundary>
138
- <div
139
- ref={dimmerReference}
140
- className={clsx(
141
- 'dimmer',
142
- { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },
143
- className,
144
- )}
145
- role="presentation"
146
- onClick={handleClick}
147
- >
125
+ <DimmerWrapper open={open} hasNotExited={hasNotExited}>
126
+ <CSSTransition
127
+ nodeRef={dimmerReference}
128
+ in={open}
129
+ appear
130
+ // Wait for animation to finish before unmount.
131
+ timeout={{ enter: 0, exit: EXIT_ANIMATION }}
132
+ classNames={{
133
+ enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),
134
+ enterDone: clsx('dimmer--enter-done', {
135
+ 'dimmer--enter-fade': fadeContentOnEnter,
136
+ }),
137
+ exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),
138
+ }}
139
+ unmountOnExit
140
+ onEnter={onEnter}
141
+ onExited={onExited}
142
+ >
143
+ <DimmerContentWrapper scrollBody={!transparent}>
144
+ <FocusBoundary>
148
145
  <div
146
+ ref={dimmerReference}
149
147
  className={clsx(
150
- 'dimmer-content-positioner',
151
- contentPosition != null && [
152
- 'd-flex justify-content-center',
153
- {
154
- 'align-items-start': contentPosition === 'top',
155
- 'align-items-center': contentPosition === 'center',
156
- 'align-items-end': contentPosition === 'bottom',
157
- },
158
- ],
148
+ 'dimmer',
149
+ { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },
150
+ className,
159
151
  )}
152
+ role="presentation"
153
+ onClick={handleClick}
160
154
  >
161
- {children}
155
+ <div
156
+ className={clsx(
157
+ 'dimmer-content-positioner',
158
+ contentPosition != null && [
159
+ 'd-flex justify-content-center',
160
+ {
161
+ 'align-items-start': contentPosition === 'top',
162
+ 'align-items-center': contentPosition === 'center',
163
+ 'align-items-end': contentPosition === 'bottom',
164
+ },
165
+ ],
166
+ )}
167
+ >
168
+ {children}
169
+ </div>
162
170
  </div>
163
- </div>
164
- </FocusBoundary>
165
- </DimmerContentWrapper>
166
- </CSSTransition>
171
+ </FocusBoundary>
172
+ </DimmerContentWrapper>
173
+ </CSSTransition>
174
+ </DimmerWrapper>
175
+ );
176
+ };
177
+
178
+ const DimmerWrapper: React.ComponentType<{
179
+ open: boolean;
180
+ hasNotExited: boolean;
181
+ children: React.ReactNode;
182
+ }> = ({ open, hasNotExited, children }) => {
183
+ const { screenMode, theme } = useTheme();
184
+
185
+ return open || hasNotExited ? (
186
+ <ThemeProvider
187
+ theme="personal"
188
+ screenMode={theme === 'personal' ? screenMode : 'light'}
189
+ isNotRootProvider
190
+ >
191
+ {children}
192
+ </ThemeProvider>
193
+ ) : (
194
+ <>{children}</>
167
195
  );
168
196
  };
169
197
 
@@ -12,7 +12,7 @@ import Info from '../info';
12
12
 
13
13
  export default {
14
14
  component: Field,
15
- title: 'Field',
15
+ title: 'Forms/Field',
16
16
  tags: ['autodocs'],
17
17
  argTypes: {
18
18
  messageIconLabel: {
@@ -9,10 +9,9 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
9
9
  class="np-flow-header d-flex flex-wrap align-items-center justify-content-between flex__item--12 np-flow-navigation__content p-x-3 np-flow-navigation--xs-max"
10
10
  >
11
11
  <button
12
- aria-disabled="false"
13
12
  aria-label="back to previous step"
14
13
  aria-live="off"
15
- class="wds-Button np-circle d-flex align-items-center justify-content-center np-icon-button np-icon-button-tertiary-default"
14
+ class="np-circle d-flex align-items-center justify-content-center np-icon-button np-icon-button-tertiary-default"
16
15
  style="--circle-size: 40px; --circle-icon-size: 20px; --circle-font-size: 18px;"
17
16
  type="button"
18
17
  >
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:",
@@ -5,7 +5,7 @@ import { Flag } from '@wise/art';
5
5
  import { clsx } from 'clsx';
6
6
  import { useState } from 'react';
7
7
 
8
- import Button from '../button/Button';
8
+ import Button from '../button';
9
9
  import { getMonthNames } from '../common/dateUtils';
10
10
  import Drawer from '../drawer';
11
11
  import { Field } from '../field/Field';
@@ -8,7 +8,7 @@ import {
8
8
  } from '@floating-ui/react';
9
9
  import { Transition } from '@headlessui/react';
10
10
  import { FocusScope } from '@react-aria/focus';
11
- import { ThemedLayer } from '@wise/components-theming';
11
+ import { ThemeProvider, useTheme } from '@wise/components-theming';
12
12
  import { clsx } from 'clsx';
13
13
  import { Fragment, useState } from 'react';
14
14
 
@@ -60,6 +60,8 @@ export function BottomSheet({
60
60
 
61
61
  const [floatingKey, setFloatingKey] = useState(0);
62
62
 
63
+ const { theme, screenMode } = useTheme();
64
+
63
65
  return (
64
66
  <>
65
67
  {open ? <PreventScroll /> : null}
@@ -69,7 +71,11 @@ export function BottomSheet({
69
71
  })}
70
72
 
71
73
  <FloatingPortal>
72
- <ThemedLayer>
74
+ <ThemeProvider
75
+ theme="personal"
76
+ screenMode={theme === 'personal' ? screenMode : 'light'}
77
+ isNotRootProvider
78
+ >
73
79
  <Transition
74
80
  show={open}
75
81
  className="np-bottom-sheet-v2-container"
@@ -125,7 +131,7 @@ export function BottomSheet({
125
131
  </FocusScope>
126
132
  </div>
127
133
  </Transition>
128
- </ThemedLayer>
134
+ </ThemeProvider>
129
135
  </FloatingPortal>
130
136
  </>
131
137
  );
@@ -3,10 +3,10 @@ import {
3
3
  flip,
4
4
  FloatingFocusManager,
5
5
  FloatingPortal,
6
- size as floatingSize,
7
6
  offset,
8
7
  type Placement,
9
8
  shift,
9
+ size as floatingSize,
10
10
  useDismiss,
11
11
  useFloating,
12
12
  useInteractions,
@@ -14,7 +14,7 @@ import {
14
14
  } from '@floating-ui/react';
15
15
  import { Transition } from '@headlessui/react';
16
16
  import { FocusScope } from '@react-aria/focus';
17
- import { ThemedLayer } from '@wise/components-theming';
17
+ import { ThemeProvider, useTheme } from '@wise/components-theming';
18
18
  import { clsx } from 'clsx';
19
19
  import { useState } from 'react';
20
20
 
@@ -79,6 +79,8 @@ export function Popover({
79
79
 
80
80
  const [floatingKey, setFloatingKey] = useState(0);
81
81
 
82
+ const { theme, screenMode } = useTheme();
83
+
82
84
  return (
83
85
  <>
84
86
  {open ? <PreventScroll /> : null}
@@ -88,7 +90,11 @@ export function Popover({
88
90
  })}
89
91
 
90
92
  <FloatingPortal>
91
- <ThemedLayer>
93
+ <ThemeProvider
94
+ theme="personal"
95
+ screenMode={theme === 'personal' ? screenMode : 'light'}
96
+ isNotRootProvider
97
+ >
92
98
  <Transition
93
99
  show={open}
94
100
  leave="transition-opacity"
@@ -125,7 +131,7 @@ export function Popover({
125
131
  </FloatingFocusManager>
126
132
  </FocusScope>
127
133
  </Transition>
128
- </ThemedLayer>
134
+ </ThemeProvider>
129
135
  </FloatingPortal>
130
136
  </>
131
137
  );
@@ -3,7 +3,7 @@ import { Label } from './Label';
3
3
 
4
4
  export default {
5
5
  component: Label,
6
- title: 'Label',
6
+ title: 'Forms/Label',
7
7
  tags: ['autodocs'],
8
8
  };
9
9
 
package/src/link/Link.tsx CHANGED
@@ -1,13 +1,14 @@
1
1
  import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
- import { AnchorHTMLAttributes } from 'react';
4
3
  import { useIntl } from 'react-intl';
4
+ import { PrimitiveAnchor } from '../primitives';
5
+ import type { PrimitiveAnchorProps } from '../primitives';
5
6
 
6
7
  import { LinkLarge, LinkDefault } from '../common';
7
8
 
8
9
  import messages from './Link.messages';
9
10
 
10
- export type Props = AnchorHTMLAttributes<HTMLAnchorElement> & { type?: LinkLarge | LinkDefault };
11
+ export type Props = PrimitiveAnchorProps & { type?: LinkLarge | LinkDefault };
11
12
 
12
13
  /**
13
14
  * Standard Link component with navigate away icon
@@ -24,22 +25,30 @@ const Link = ({
24
25
  onClick,
25
26
  ...props
26
27
  }: Props) => {
28
+ const { formatMessage } = useIntl();
27
29
  const isBlank = target === '_blank';
28
30
 
29
- const { formatMessage } = useIntl();
31
+ const classNames = clsx(
32
+ 'np-link',
33
+ 'd-inline-flex',
34
+ {
35
+ [`np-text-${type}`]: type,
36
+ },
37
+ className,
38
+ );
30
39
 
31
40
  return (
32
- <a
41
+ <PrimitiveAnchor
33
42
  href={href}
34
43
  target={target}
35
- className={clsx('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className)}
44
+ className={classNames}
36
45
  aria-label={ariaLabel}
37
46
  rel={isBlank ? 'noreferrer' : undefined}
38
47
  onClick={onClick}
39
48
  {...props}
40
49
  >
41
50
  {children} {isBlank && <NavigateAwayIcon title={formatMessage(messages.opensInNewTab)} />}
42
- </a>
51
+ </PrimitiveAnchor>
43
52
  );
44
53
  };
45
54