@transferwise/components 0.0.0-experimental-6e04f56 → 0.0.0-experimental-542ae69

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 (232) hide show
  1. package/build/Body/Body.js +1 -1
  2. package/build/Body/Body.js.map +1 -1
  3. package/build/Body/Body.mjs +1 -1
  4. package/build/Body/Body.mjs.map +1 -1
  5. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +1 -1
  6. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
  7. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +1 -1
  8. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
  9. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +1 -1
  10. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
  11. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +1 -1
  12. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
  13. package/build/Calendar/TableLink/TableLink.js +1 -1
  14. package/build/Calendar/TableLink/TableLink.js.map +1 -1
  15. package/build/Calendar/TableLink/TableLink.mjs +1 -1
  16. package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
  17. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js +1 -1
  18. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
  19. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs +1 -1
  20. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
  21. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js +2 -2
  22. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
  23. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs +2 -2
  24. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
  25. package/build/Inputs/SelectInput/Option/SelectInputOption.js +1 -1
  26. package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
  27. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs +1 -1
  28. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
  29. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -3
  30. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
  31. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -3
  32. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
  33. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js +2 -2
  34. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
  35. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs +2 -2
  36. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
  37. package/build/Label/Label.js +1 -1
  38. package/build/Label/Label.js.map +1 -1
  39. package/build/Label/Label.mjs +1 -1
  40. package/build/Label/Label.mjs.map +1 -1
  41. package/build/Snackbar/Snackbar.js +101 -98
  42. package/build/Snackbar/Snackbar.js.map +1 -1
  43. package/build/Snackbar/Snackbar.mjs +102 -99
  44. package/build/Snackbar/Snackbar.mjs.map +1 -1
  45. package/build/Stepper/Stepper.js +1 -1
  46. package/build/Stepper/Stepper.js.map +1 -1
  47. package/build/Stepper/Stepper.mjs +1 -1
  48. package/build/Stepper/Stepper.mjs.map +1 -1
  49. package/build/Table/Header/TableHeader.js +1 -1
  50. package/build/Table/Header/TableHeader.js.map +1 -1
  51. package/build/Table/Header/TableHeader.mjs +1 -1
  52. package/build/Table/Header/TableHeader.mjs.map +1 -1
  53. package/build/Tabs/Tab/Tab.js +1 -1
  54. package/build/Tabs/Tab/Tab.js.map +1 -1
  55. package/build/Tabs/Tab/Tab.mjs +1 -1
  56. package/build/Tabs/Tab/Tab.mjs.map +1 -1
  57. package/build/Tag/Tag.js +1 -1
  58. package/build/Tag/Tag.js.map +1 -1
  59. package/build/Tag/Tag.mjs +1 -1
  60. package/build/Tag/Tag.mjs.map +1 -1
  61. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +2 -2
  62. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
  63. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +2 -2
  64. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
  65. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js +2 -2
  66. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
  67. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs +2 -2
  68. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
  69. package/build/_deprecated/ActionButton/ActionButton.js +1 -1
  70. package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
  71. package/build/_deprecated/ActionButton/ActionButton.mjs +1 -1
  72. package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
  73. package/build/_deprecated/Avatar/Avatar.js +1 -1
  74. package/build/_deprecated/Avatar/Avatar.js.map +1 -1
  75. package/build/_deprecated/Avatar/Avatar.mjs +1 -1
  76. package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
  77. package/build/_deprecated/Select/Select.js +2 -2
  78. package/build/_deprecated/Select/Select.js.map +1 -1
  79. package/build/_deprecated/Select/Select.mjs +2 -2
  80. package/build/_deprecated/Select/Select.mjs.map +1 -1
  81. package/build/common/PropsValues/typography.js +6 -0
  82. package/build/common/PropsValues/typography.js.map +1 -1
  83. package/build/common/PropsValues/typography.mjs +6 -0
  84. package/build/common/PropsValues/typography.mjs.map +1 -1
  85. package/build/main.css +2907 -1535
  86. package/build/styles/Accordion/Accordion.css +2 -1
  87. package/build/styles/Body/Body.css +1 -1
  88. package/build/styles/Chips/Chip/Chip.css +4 -2
  89. package/build/styles/Decision/Decision.css +2 -1
  90. package/build/styles/Inputs/Input/Input.css +62 -66
  91. package/build/styles/Inputs/TextArea/TextArea.css +62 -66
  92. package/build/styles/MoneyInput/MoneyInput.css +6 -3
  93. package/build/styles/Popover/Popover.css +3 -47
  94. package/build/styles/ProgressBar/ProgressBar.css +2 -1
  95. package/build/styles/Table/Table.css +15 -5
  96. package/build/styles/Tile/Tile.css +2 -1
  97. package/build/styles/Typeahead/Typeahead.css +4 -2
  98. package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  99. package/build/styles/_deprecated/Select/Select.css +44 -11
  100. package/build/styles/css/accordion.css +23 -52
  101. package/build/styles/css/button-groups.css +29 -8
  102. package/build/styles/css/buttons.css +26 -2
  103. package/build/styles/css/decision.css +23 -52
  104. package/build/styles/css/dropdowns.css +39 -62
  105. package/build/styles/css/droppable.css +28 -8
  106. package/build/styles/css/footer.css +41 -14
  107. package/build/styles/css/input-groups.css +172 -165
  108. package/build/styles/css/list-group.css +0 -45
  109. package/build/styles/css/navbar.css +39 -62
  110. package/build/styles/css/neptune-addons.css +15 -0
  111. package/build/styles/css/neptune-core.css +250 -526
  112. package/build/styles/css/neptune.css +2759 -1422
  113. package/build/styles/css/popovers.css +35 -60
  114. package/build/styles/css/sequences.css +6 -1
  115. package/build/styles/css/tooltip.css +27 -7
  116. package/build/styles/less/neptune-tokens.less +0 -48
  117. package/build/styles/main.css +2907 -1535
  118. package/build/styles/props/neptune-tokens.css +793 -1
  119. package/build/styles/styles/less/accordion.css +23 -52
  120. package/build/styles/styles/less/button-groups.css +29 -8
  121. package/build/styles/styles/less/buttons.css +26 -2
  122. package/build/styles/styles/less/decision.css +23 -52
  123. package/build/styles/styles/less/dropdowns.css +39 -62
  124. package/build/styles/styles/less/droppable.css +28 -8
  125. package/build/styles/styles/less/footer.css +41 -14
  126. package/build/styles/styles/less/forms/bootstrap-forms.css +137 -91
  127. package/build/styles/styles/less/input-groups.css +172 -165
  128. package/build/styles/styles/less/list-group.css +0 -45
  129. package/build/styles/styles/less/navbar.css +39 -62
  130. package/build/styles/styles/less/neptune-addons.css +15 -0
  131. package/build/styles/styles/less/neptune-core.css +250 -526
  132. package/build/styles/styles/less/neptune.css +2759 -1422
  133. package/build/styles/styles/less/popovers.css +35 -60
  134. package/build/styles/styles/less/sequences.css +6 -1
  135. package/build/styles/styles/less/tooltip.css +27 -7
  136. package/build/types/Snackbar/Snackbar.d.ts +15 -1
  137. package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
  138. package/build/types/common/PropsValues/typography.d.ts +13 -1
  139. package/build/types/common/PropsValues/typography.d.ts.map +1 -1
  140. package/package.json +1 -1
  141. package/src/Accordion/Accordion.css +2 -1
  142. package/src/Accordion/Accordion.less +2 -1
  143. package/src/Body/Body.css +1 -1
  144. package/src/Body/Body.less +1 -1
  145. package/src/Body/Body.test.tsx +4 -4
  146. package/src/Body/Body.tsx +2 -2
  147. package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +2 -2
  148. package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +1 -1
  149. package/src/Calendar/TableLink/TableLink.tsx +1 -1
  150. package/src/Chips/Chip/Chip.css +4 -2
  151. package/src/Chips/Chip/Chip.less +2 -1
  152. package/src/Decision/Decision.css +2 -1
  153. package/src/Decision/Decision.less +2 -1
  154. package/src/DefinitionList/_stories/DefinitionList.story.tsx +1 -1
  155. package/src/Display/_stories/Display.story.tsx +20 -6
  156. package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx +1 -1
  157. package/src/Inputs/Input/Input.css +62 -66
  158. package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +2 -2
  159. package/src/Inputs/SelectInput/Option/SelectInputOption.tsx +1 -1
  160. package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +3 -3
  161. package/src/Inputs/SelectInput/Popover/SelectInputPopover.tsx +2 -2
  162. package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
  163. package/src/Inputs/TextArea/TextArea.css +62 -66
  164. package/src/Inputs/_common.less +5 -5
  165. package/src/Label/Label.tsx +1 -1
  166. package/src/MoneyInput/MoneyInput.css +6 -3
  167. package/src/MoneyInput/MoneyInput.less +7 -4
  168. package/src/PocketSurface/_stories/PocketSurface.story.tsx +2 -2
  169. package/src/Popover/Popover.css +3 -47
  170. package/src/Popover/Popover.less +1 -1
  171. package/src/ProgressBar/ProgressBar.css +2 -1
  172. package/src/ProgressBar/ProgressBar.less +12 -11
  173. package/src/SentimentSurface/_stories/SentimentSurface.story.tsx +1 -1
  174. package/src/Snackbar/Snackbar.tsx +88 -90
  175. package/src/Stepper/Stepper.tsx +1 -1
  176. package/src/Table/Header/TableHeader.tsx +1 -1
  177. package/src/Table/StatusText/TableStatusText.test.tsx +5 -5
  178. package/src/Table/Table.css +15 -5
  179. package/src/Table/Table.less +17 -6
  180. package/src/Tabs/Tab/Tab.tsx +1 -1
  181. package/src/Tag/Tag.tsx +1 -1
  182. package/src/Tag/_stories/Tag.story.tsx +1 -1
  183. package/src/Tile/Tile.css +2 -1
  184. package/src/Tile/Tile.less +2 -1
  185. package/src/Typeahead/Typeahead.css +4 -2
  186. package/src/Typeahead/Typeahead.less +2 -1
  187. package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +2 -2
  188. package/src/Upload/Steps/UploadImageStep/UploadImageStep.tsx +2 -2
  189. package/src/_deprecated/ActionButton/ActionButton.tsx +1 -1
  190. package/src/_deprecated/Avatar/Avatar.tsx +1 -1
  191. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  192. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.less +2 -1
  193. package/src/_deprecated/NavigationOption/_stories/NavigationOption.story.tsx +6 -6
  194. package/src/_deprecated/Select/Select.css +44 -11
  195. package/src/_deprecated/Select/Select.less +10 -5
  196. package/src/_deprecated/Select/Select.tsx +2 -2
  197. package/src/common/PropsValues/typography.ts +20 -1
  198. package/src/main.css +2907 -1535
  199. package/src/styles/less/accordion.css +23 -52
  200. package/src/styles/less/addons/_background-utilities.less +5 -0
  201. package/src/styles/less/button-groups.css +29 -8
  202. package/src/styles/less/button-groups.less +3 -2
  203. package/src/styles/less/buttons.css +26 -2
  204. package/src/styles/less/buttons.less +1 -1
  205. package/src/styles/less/core/_typography.less +67 -221
  206. package/src/styles/less/decision.css +23 -52
  207. package/src/styles/less/decision.less +2 -2
  208. package/src/styles/less/dropdowns.css +39 -62
  209. package/src/styles/less/dropdowns.less +6 -5
  210. package/src/styles/less/droppable.css +28 -8
  211. package/src/styles/less/droppable.less +4 -4
  212. package/src/styles/less/footer.css +41 -14
  213. package/src/styles/less/footer.less +4 -3
  214. package/src/styles/less/forms/bootstrap-forms.css +137 -91
  215. package/src/styles/less/forms/bootstrap-forms.less +70 -57
  216. package/src/styles/less/input-groups.css +172 -165
  217. package/src/styles/less/input-groups.less +5 -5
  218. package/src/styles/less/list-group.css +0 -45
  219. package/src/styles/less/list-group.less +7 -4
  220. package/src/styles/less/mixins/_text-emphasis.less +7 -1
  221. package/src/styles/less/navbar.css +39 -62
  222. package/src/styles/less/neptune-addons.css +15 -0
  223. package/src/styles/less/neptune-core.css +250 -526
  224. package/src/styles/less/neptune.bundle.less +4 -0
  225. package/src/styles/less/neptune.css +2759 -1422
  226. package/src/styles/less/popovers.css +35 -60
  227. package/src/styles/less/popovers.less +3 -3
  228. package/src/styles/less/sequences.css +6 -1
  229. package/src/styles/less/sequences.less +7 -2
  230. package/src/styles/less/tooltip.css +27 -7
  231. package/src/styles/less/tooltip.less +1 -1
  232. package/src/Snackbar/Snackbar.test.tsx +0 -190
@@ -1,9 +1,10 @@
1
- import { useEffect, useRef, useState } from 'react';
1
+ import { Component, createRef } from 'react';
2
2
  import { CSSTransition } from 'react-transition-group';
3
3
 
4
4
  import Button from '../Button';
5
5
  import Body from '../Body';
6
6
  import type { ThemeDark, ThemeLight } from '../common';
7
+ import { DirectionContext } from '../Provider/Direction';
7
8
  import withNextPortal from '../WithNextPortal/WithNextPortal';
8
9
 
9
10
  const CSS_TRANSITION_DURATION = 400;
@@ -24,105 +25,102 @@ interface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'>
24
25
  visible: boolean;
25
26
  }
26
27
 
27
- export const Snackbar = (props: SnackbarProps) => {
28
- const bodyRef = useRef<HTMLSpanElement>(null);
29
- const leaveTimeout = useRef(0);
30
- const transitionTimeout = useRef(0);
31
- /** The props of the last committed render, as `this.props` was in the class component. */
32
- const committedProps = useRef(props);
33
-
34
- const [state, setState] = useState<SnackbarState>({
35
- visible: false,
36
- text: '',
37
- });
38
-
39
- useEffect(
40
- () => () => {
41
- window.clearTimeout(leaveTimeout.current);
42
- window.clearTimeout(transitionTimeout.current);
43
- },
44
- [],
45
- );
46
-
47
- // Runs after every render to mirror the componentDidUpdate lifecycle this component previously
48
- // relied on, including the shouldComponentUpdate guard that ignored every update without text.
49
- // Both rules below are disabled on purpose: the dependency-less effect and its synchronous state
50
- // updates are what keep this conversion behaviour-identical to the class component.
51
- /* eslint-disable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
52
- useEffect(() => {
53
- const previousProps = committedProps.current;
54
- committedProps.current = props;
55
-
56
- const { action, text, timeout, timestamp } = props;
57
-
58
- // shouldComponentUpdate bailed out whenever the incoming text was empty. That also blocked the
59
- // updates scheduled below, so a Snackbar whose text is cleared stays on screen until it is
60
- // given text again. Preserved here deliberately to keep this refactor behaviour-identical.
61
- const updateWhileTextIsPresent = (update: () => void) => {
62
- if (committedProps.current.text) {
63
- update();
64
- }
65
- };
28
+ export class Snackbar extends Component<SnackbarProps, SnackbarState> {
29
+ bodyRef = createRef<HTMLSpanElement>();
30
+ timeout = 0;
31
+ transitionTimeout = 0;
66
32
 
67
- const setLeaveTimeout = () => {
68
- leaveTimeout.current = window.setTimeout(() => {
69
- updateWhileTextIsPresent(() => setState((current) => ({ ...current, visible: false })));
70
- }, timeout);
33
+ constructor(props: SnackbarProps) {
34
+ super(props);
35
+ this.state = {
36
+ visible: false,
37
+ text: '',
71
38
  };
39
+ }
72
40
 
73
- const show = () => {
74
- setState((current) => ({ ...current, visible: true, action, text }));
75
- setLeaveTimeout();
76
- };
41
+ componentWillUnmount() {
42
+ window.clearTimeout(this.timeout);
43
+ window.clearTimeout(this.transitionTimeout);
44
+ }
77
45
 
78
- if (!text) {
79
- return;
46
+ shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {
47
+ if (!nextProps.text) {
48
+ return false;
80
49
  }
50
+ if (
51
+ nextProps.timestamp === this.props.timestamp &&
52
+ nextState.visible === this.state.visible &&
53
+ nextState.text === this.state.text
54
+ ) {
55
+ return false;
56
+ }
57
+
58
+ return true;
59
+ }
60
+
61
+ setLeaveTimeout = () => {
62
+ const { timeout } = this.props;
63
+
64
+ this.timeout = window.setTimeout(() => {
65
+ this.setState({ visible: false });
66
+ }, timeout);
67
+ };
68
+
69
+ componentDidUpdate(previousProps: SnackbarProps) {
70
+ const { action, text, timestamp } = this.props;
81
71
 
82
72
  if (!previousProps.text) {
83
- show();
73
+ this.setState({ visible: true, action, text }, () => {
74
+ this.setLeaveTimeout();
75
+ });
84
76
  } else if (previousProps.timestamp !== timestamp) {
85
- window.clearTimeout(leaveTimeout.current);
86
-
87
- if (state.visible) {
88
- setState((current) => ({ ...current, visible: false }));
89
- transitionTimeout.current = window.setTimeout(() => {
90
- updateWhileTextIsPresent(show);
91
- }, CSS_TRANSITION_DURATION);
77
+ window.clearTimeout(this.timeout);
78
+
79
+ if (this.state.visible) {
80
+ this.setState({ visible: false }, () => {
81
+ this.transitionTimeout = window.setTimeout(() => {
82
+ this.setState({ visible: true, action, text });
83
+ this.setLeaveTimeout();
84
+ }, CSS_TRANSITION_DURATION);
85
+ });
92
86
  } else {
93
- show();
87
+ this.setState({ visible: true, action, text });
88
+ this.setLeaveTimeout();
94
89
  }
95
90
  }
96
- });
97
- /* eslint-enable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
98
-
99
- const { action, text, visible } = state;
100
- const { timeout } = props;
101
-
102
- return (
103
- <div className="snackbar" aria-live="assertive" role="alert">
104
- <CSSTransition
105
- nodeRef={bodyRef}
106
- in={visible}
107
- classNames="snackbar__text-container"
108
- timeout={{
109
- appear: 0,
110
- enter: timeout,
111
- exit: CSS_TRANSITION_DURATION,
112
- }}
113
- unmountOnExit
114
- >
115
- <Body ref={bodyRef} as="span" className="snackbar__text">
116
- {text}
117
- {action ? (
118
- <Button className="snackbar__text__action" v2 size="sm" onClick={action.onClick}>
119
- {action.label}
120
- </Button>
121
- ) : null}
122
- </Body>
123
- </CSSTransition>
124
- </div>
125
- );
126
- };
91
+ }
92
+
93
+ render() {
94
+ const { action, text, visible } = this.state;
95
+ const { timeout } = this.props;
96
+
97
+ return (
98
+ <div className="snackbar" aria-live="assertive" role="alert">
99
+ <CSSTransition
100
+ nodeRef={this.bodyRef}
101
+ in={visible}
102
+ classNames="snackbar__text-container"
103
+ timeout={{
104
+ appear: 0,
105
+ enter: timeout,
106
+ exit: CSS_TRANSITION_DURATION,
107
+ }}
108
+ unmountOnExit
109
+ >
110
+ <Body ref={this.bodyRef} as="span" className="snackbar__text">
111
+ {text}
112
+ {action ? (
113
+ <Button className="snackbar__text__action" v2 size="sm" onClick={action.onClick}>
114
+ {action.label}
115
+ </Button>
116
+ ) : null}
117
+ </Body>
118
+ </CSSTransition>
119
+ </div>
120
+ );
121
+ }
122
+ }
123
+
124
+ Snackbar.contextType = DirectionContext;
127
125
 
128
126
  export default withNextPortal(Snackbar);
@@ -73,7 +73,7 @@ const Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) =>
73
73
  className={clsx(
74
74
  'hidden-xs',
75
75
  'tw-stepper__step',
76
- active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',
76
+ active ? 'wds-text-body-default-bold tw-stepper__step--active' : 'wds-text-body-default',
77
77
  clickable && 'tw-stepper__step--clickable',
78
78
  step.hoverLabel && 'tw-stepper__step--has-tooltip',
79
79
  )}
@@ -50,7 +50,7 @@ const TableHeader = ({
50
50
  // If headers are empty, we still should render empty headers to keep visual consistency
51
51
  return (
52
52
  <div
53
- className="np-table-header-content np-text-body-default-bold"
53
+ className="np-table-header-content wds-text-body-default-bold"
54
54
  data-testid="np-table-empty-header"
55
55
  >
56
56
  &nbsp;
@@ -13,7 +13,7 @@ describe('TableStatusText Component', () => {
13
13
  it('renders the text and applies the default class', () => {
14
14
  renderComponent();
15
15
  expect(screen.getByText('Status Text')).toBeInTheDocument();
16
- expect(screen.getByText('Status Text')).toHaveClass('np-text-body-default');
16
+ expect(screen.getByText('Status Text')).toHaveClass('wds-text-body-default');
17
17
  });
18
18
 
19
19
  it('applies the custom class name', () => {
@@ -23,12 +23,12 @@ describe('TableStatusText Component', () => {
23
23
 
24
24
  it('applies the default typography class when typography is not provided', () => {
25
25
  renderComponent();
26
- expect(screen.getByText('Status Text')).toHaveClass('np-text-body-default');
26
+ expect(screen.getByText('Status Text')).toHaveClass('wds-text-body-default');
27
27
  });
28
28
 
29
29
  it('applies the typography class when typography equals `default-bold`', () => {
30
30
  renderComponent({ typography: 'default-bold' });
31
- expect(screen.getByText('Status Text')).toHaveClass('np-text-body-default-bold');
31
+ expect(screen.getByText('Status Text')).toHaveClass('wds-text-body-default-bold');
32
32
  });
33
33
 
34
34
  it('does not render any icon when status is not provided', () => {
@@ -39,14 +39,14 @@ describe('TableStatusText Component', () => {
39
39
 
40
40
  it('applies the typography and status classes, renders the error icon when status equals `error`', () => {
41
41
  renderComponent({ status: 'error' });
42
- expect(screen.getByText('Status Text')).toHaveClass('np-text-body-default-bold');
42
+ expect(screen.getByText('Status Text')).toHaveClass('wds-text-body-default-bold');
43
43
  expect(screen.getByText('Status Text')).toHaveClass('np-table-content--error');
44
44
  expect(screen.getByTestId('alert-icon')).toBeInTheDocument();
45
45
  });
46
46
 
47
47
  it('applies the typography and status classes, renders the success icon when status equals `success`', () => {
48
48
  renderComponent({ status: 'success' });
49
- expect(screen.getByText('Status Text')).toHaveClass('np-text-body-default-bold');
49
+ expect(screen.getByText('Status Text')).toHaveClass('wds-text-body-default-bold');
50
50
  expect(screen.getByText('Status Text')).toHaveClass('np-table-content--success');
51
51
  expect(screen.getByTestId('check-icon')).toBeInTheDocument();
52
52
  });
@@ -40,10 +40,16 @@
40
40
  }
41
41
  .np-table-inner-container {
42
42
  background-image: linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0)), linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0));
43
- background-position: left center, right center, left center, right center;
43
+ background-position: left center,
44
+ right center,
45
+ left center,
46
+ right center;
44
47
  background-repeat: no-repeat;
45
48
  background-color: var(--color-contrast-overlay);
46
- background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
49
+ background-size: 15px 100%,
50
+ 15px 100%,
51
+ 15px 100%,
52
+ 15px 100%;
47
53
  background-attachment: local, local, scroll, scroll;
48
54
  overflow-x: auto;
49
55
  border-radius: 10px;
@@ -138,7 +144,9 @@
138
144
  padding-inline-end: 0;
139
145
  }
140
146
  .np-table-header.np-table-header--right > .np-text-body-default,
141
- .np-table-cell.np-table-cell--right > .np-text-body-default {
147
+ .np-table-cell.np-table-cell--right > .np-text-body-default,
148
+ .np-table-header.np-table-header--right > .wds-text-body-default,
149
+ .np-table-cell.np-table-cell--right > .wds-text-body-default {
142
150
  text-align: end;
143
151
  }
144
152
  .np-table-header.np-table-header--right + .np-table-header:not(.np-table-header--right),
@@ -197,7 +205,8 @@
197
205
  .np-table-cell--primary {
198
206
  min-inline-size: 200px;
199
207
  }
200
- .np-table-cell--currency .np-text-body-default {
208
+ .np-table-cell--currency .np-text-body-default,
209
+ .np-table-cell--currency .wds-text-body-default {
201
210
  white-space: nowrap;
202
211
  }
203
212
  .np-table-cell .tw-chevron {
@@ -214,7 +223,8 @@
214
223
  background-color: var(--color-background-neutral);
215
224
  padding: 0;
216
225
  }
217
- .np-table-cell .np-text-body-default-bold {
226
+ .np-table-cell .np-text-body-default-bold,
227
+ .np-table-cell .wds-text-body-default-bold {
218
228
  display: flex;
219
229
  align-items: center;
220
230
  color: #37517e;
@@ -59,10 +59,18 @@
59
59
  linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)),
60
60
  linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0)),
61
61
  linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0));
62
- background-position: left center, right center, left center, right center;
62
+ background-position:
63
+ left center,
64
+ right center,
65
+ left center,
66
+ right center;
63
67
  background-repeat: no-repeat;
64
68
  background-color: var(--color-contrast-overlay);
65
- background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
69
+ background-size:
70
+ 15px 100%,
71
+ 15px 100%,
72
+ 15px 100%,
73
+ 15px 100%;
66
74
  background-attachment: local, local, scroll, scroll;
67
75
  overflow-x: auto;
68
76
  border-radius: @table-inner-border-radius;
@@ -188,7 +196,8 @@
188
196
 
189
197
  &-header.np-table-header--right,
190
198
  &-cell.np-table-cell--right {
191
- > .np-text-body-default {
199
+ > .np-text-body-default,
200
+ > .wds-text-body-default {
192
201
  text-align: right;
193
202
  }
194
203
  }
@@ -249,7 +258,8 @@
249
258
  }
250
259
 
251
260
  &--currency {
252
- .np-text-body-default {
261
+ .np-text-body-default,
262
+ .wds-text-body-default {
253
263
  white-space: nowrap;
254
264
  }
255
265
  }
@@ -266,7 +276,8 @@
266
276
  padding: 0;
267
277
  }
268
278
 
269
- .np-text-body-default-bold {
279
+ .np-text-body-default-bold,
280
+ .wds-text-body-default-bold {
270
281
  display: flex;
271
282
  align-items: center;
272
283
  color: var(--color-content-primary);
@@ -306,7 +317,7 @@
306
317
  &-media {
307
318
  flex-shrink: 0;
308
319
  }
309
-
320
+
310
321
  &-body {
311
322
  display: flex;
312
323
  flex-direction: column;
@@ -49,7 +49,7 @@ const Tab = forwardRef(function Tab(
49
49
  return (
50
50
  <li
51
51
  ref={reference}
52
- className={clsx('tabs__tab', selected ? 'np-text-body-large-bold' : 'np-text-body-large', {
52
+ className={clsx('tabs__tab', selected ? 'wds-text-body-large-bold' : 'wds-text-body-large', {
53
53
  'tabs__tab--selected': selected,
54
54
  clickable: !disabled,
55
55
  disabled,
package/src/Tag/Tag.tsx CHANGED
@@ -58,7 +58,7 @@ const Tag = forwardRef<HTMLSpanElement, TagProps>(function Tag(
58
58
  'wds-tag',
59
59
  `wds-tag--${size}`,
60
60
  `wds-tag--${sentiment}`,
61
- 'np-text-body-default-bold',
61
+ 'wds-text-body-default-bold',
62
62
  className,
63
63
  )}
64
64
  >
@@ -29,7 +29,7 @@ const PHOTO = '../card-payment-bakery.webp';
29
29
 
30
30
  const Label = ({ children }: { children: ReactNode }) => (
31
31
  <span
32
- className="np-text-body-default"
32
+ className="wds-text-body-default"
33
33
  style={{
34
34
  color: 'var(--color-content-secondary)',
35
35
  textTransform: 'capitalize',
package/src/Tile/Tile.css CHANGED
@@ -25,7 +25,8 @@
25
25
  .np-theme-personal .np-tile.decision:active {
26
26
  background-color: var(--color-background-neutral-active);
27
27
  }
28
- .np-theme-personal .np-tile.decision .np-text-body-default {
28
+ .np-theme-personal .np-tile.decision .np-text-body-default,
29
+ .np-theme-personal .np-tile.decision .wds-text-body-default {
29
30
  color: #5d7079;
30
31
  color: var(--color-content-secondary);
31
32
  }
@@ -28,7 +28,8 @@
28
28
  background-color: var(--color-background-neutral-active);
29
29
  }
30
30
 
31
- .np-text-body-default {
31
+ .np-text-body-default,
32
+ .wds-text-body-default {
32
33
  color: var(--color-content-secondary);
33
34
  }
34
35
  }
@@ -180,12 +180,14 @@
180
180
  .np-theme-personal .typeahead .np-chip {
181
181
  margin-block-start: 9px !important;
182
182
  }
183
- .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
183
+ .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold,
184
+ .np-theme-personal .typeahead .np-chip--removable .wds-text-body-default-bold {
184
185
  padding-inline-end: 16px;
185
186
  padding-inline-end: var(--size-16);
186
187
  }
187
188
  @media (max-width: 320px) {
188
- .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
189
+ .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold,
190
+ .np-theme-personal .typeahead .np-chip--removable .wds-text-body-default-bold {
189
191
  padding-inline-end: 32px;
190
192
  padding-inline-end: var(--size-32);
191
193
  }
@@ -232,7 +232,8 @@
232
232
  margin-top: 9px !important;
233
233
  }
234
234
  .np-chip--removable {
235
- .np-text-body-default-bold {
235
+ .np-text-body-default-bold,
236
+ .wds-text-body-default-bold {
236
237
  padding-right: var(--size-16);
237
238
  @media (--screen-400-zoom) {
238
239
  padding-right: var(--size-32);
@@ -30,10 +30,10 @@ const Option = forwardRef<HTMLLIElement, TypeaheadOptionProps<any>>((props, ref)
30
30
  >
31
31
  <a className="dropdown-item" href="#" tabIndex={-1} onClick={onClick}>
32
32
  <Highlight value={label} query={query} />
33
- {note && <span className="np-text-body-default m-l-1">{note}</span>}
33
+ {note && <span className="wds-text-body-default m-l-1">{note}</span>}
34
34
  {secondary && (
35
35
  <Highlight
36
- className="np-text-body-default text-ellipsis"
36
+ className="wds-text-body-default text-ellipsis"
37
37
  value={secondary}
38
38
  query={query}
39
39
  />
@@ -78,8 +78,8 @@ export default class UploadImageStep extends PureComponent<UploadImageStepProps>
78
78
  <div className="droppable-default-card" aria-hidden={isComplete}>
79
79
  <div className="droppable-card-content">
80
80
  <div className="m-b-3">{this.getImage()}</div>
81
- {usLabel && <h4 className="np-text-title-body m-b-1">{usLabel}</h4>}
82
- {usPlaceholder && <p className="np-text-body-large m-b-3">{String(usPlaceholder)}</p>}
81
+ {usLabel && <h4 className="wds-text-title-body m-b-1">{usLabel}</h4>}
82
+ {usPlaceholder && <p className="wds-text-body-large m-b-3">{String(usPlaceholder)}</p>}
83
83
  <label
84
84
  className={`btn btn-primary btn-md ${usDisabled ? 'disabled' : ''}`}
85
85
  role="button"
@@ -36,7 +36,7 @@ const ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(
36
36
  type="button"
37
37
  className={clsx(
38
38
  'np-action-btn',
39
- 'np-text-body-default-bold',
39
+ 'wds-text-body-default-bold',
40
40
  priority === Priority.TERTIARY
41
41
  ? 'btn-priority-3'
42
42
  : priority === Priority.SECONDARY
@@ -86,7 +86,7 @@ const Avatar: React.FC<AvatarProps> = ({
86
86
  className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {
87
87
  'tw-avatar--outlined': outlined,
88
88
  'tw-avatar--branded': Boolean(backgroundColorFromSeed),
89
- 'np-text-title-body': type === 'initials',
89
+ 'wds-text-title-body': type === 'initials',
90
90
  })}
91
91
  aria-label={ariaLabel}
92
92
  >
@@ -8,7 +8,8 @@
8
8
  color: var(--color-sentiment-content-primary);
9
9
  margin-block-end: 0;
10
10
  }
11
- .critical-comms .alert .np-text-title-body {
11
+ .critical-comms .alert .np-text-title-body,
12
+ .critical-comms .alert .wds-text-title-body {
12
13
  color: var(--color-sentiment-content-primary);
13
14
  }
14
15
  .critical-comms .status-circle.negative {
@@ -7,7 +7,8 @@
7
7
  color: var(--color-sentiment-content-primary);
8
8
  margin-bottom: 0;
9
9
 
10
- .np-text-title-body {
10
+ .np-text-title-body,
11
+ .wds-text-title-body {
11
12
  color: var(--color-sentiment-content-primary);
12
13
  }
13
14
  }
@@ -74,7 +74,7 @@ export const Variants: StoryObj<StoryArgs> = {
74
74
  render: ({ hasTitleOnly, ...args }: StoryArgs) => (
75
75
  <div>
76
76
  <div className="m-b-2">
77
- <div className="title-4 m-b-1">Has Title Only</div>
77
+ <div className="wds-text-title-body m-b-1">Has Title Only</div>
78
78
  <NavigationOption
79
79
  {...args}
80
80
  content={null}
@@ -83,7 +83,7 @@ export const Variants: StoryObj<StoryArgs> = {
83
83
  />
84
84
  </div>
85
85
  <div className="m-b-2">
86
- <div className="title-4 m-b-1">Full Content</div>
86
+ <div className="wds-text-title-body m-b-1">Full Content</div>
87
87
  <NavigationOption
88
88
  {...args}
89
89
  content={hasTitleOnly ? null : args.content}
@@ -92,7 +92,7 @@ export const Variants: StoryObj<StoryArgs> = {
92
92
  />
93
93
  </div>
94
94
  <div className="m-b-2">
95
- <div className="title-4 m-b-1">With Icon</div>
95
+ <div className="wds-text-title-body m-b-1">With Icon</div>
96
96
  <NavigationOption
97
97
  {...args}
98
98
  media={<BankIcon size={24} />}
@@ -101,7 +101,7 @@ export const Variants: StoryObj<StoryArgs> = {
101
101
  />
102
102
  </div>
103
103
  <div className="m-b-2">
104
- <div className="title-4 m-b-1">With Icon Avatar</div>
104
+ <div className="wds-text-title-body m-b-1">With Icon Avatar</div>
105
105
  <NavigationOption
106
106
  {...args}
107
107
  showMediaCircle={false}
@@ -115,7 +115,7 @@ export const Variants: StoryObj<StoryArgs> = {
115
115
  />
116
116
  </div>
117
117
  <div className="m-b-2">
118
- <div className="title-4 m-b-1">With Contact Avatar</div>
118
+ <div className="wds-text-title-body m-b-1">With Contact Avatar</div>
119
119
  <NavigationOption
120
120
  {...args}
121
121
  showMediaCircle={false}
@@ -125,7 +125,7 @@ export const Variants: StoryObj<StoryArgs> = {
125
125
  />
126
126
  </div>
127
127
  <div className="m-t-4 m-b-2">
128
- <div className="title-4 m-b-1">Not recommended usage</div>
128
+ <div className="wds-text-title-body m-b-1">Not recommended usage</div>
129
129
  <p>
130
130
  Rendering an Avatar on top of showMediaCircle causes the Avatar background-colour and the
131
131
  circle background-colour to overlap which also causes clipping issues with the Badge