@transferwise/components 46.144.1 → 46.146.0

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 (209) hide show
  1. package/build/calendar/Calendar.js +159 -0
  2. package/build/calendar/Calendar.js.map +1 -0
  3. package/build/{dateLookup/DateLookup.messages.js → calendar/Calendar.messages.js} +1 -1
  4. package/build/calendar/Calendar.messages.js.map +1 -0
  5. package/build/{dateLookup/DateLookup.messages.mjs → calendar/Calendar.messages.mjs} +1 -1
  6. package/build/calendar/Calendar.messages.mjs.map +1 -0
  7. package/build/calendar/Calendar.mjs +155 -0
  8. package/build/calendar/Calendar.mjs.map +1 -0
  9. package/build/{dateLookup → calendar}/dateHeader/DateHeader.js +4 -4
  10. package/build/calendar/dateHeader/DateHeader.js.map +1 -0
  11. package/build/{dateLookup → calendar}/dateHeader/DateHeader.mjs +1 -1
  12. package/build/calendar/dateHeader/DateHeader.mjs.map +1 -0
  13. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.js +2 -2
  14. package/build/calendar/dayCalendar/DayCalendar.js.map +1 -0
  15. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.mjs +1 -1
  16. package/build/calendar/dayCalendar/DayCalendar.mjs.map +1 -0
  17. package/build/calendar/dayCalendar/table/DayCalendarTable.js.map +1 -0
  18. package/build/calendar/dayCalendar/table/DayCalendarTable.mjs.map +1 -0
  19. package/build/calendar/getFocusableTime/getFocusableTime.js.map +1 -0
  20. package/build/calendar/getFocusableTime/getFocusableTime.mjs.map +1 -0
  21. package/build/calendar/getStartOfDay/getStartOfDay.js.map +1 -0
  22. package/build/calendar/getStartOfDay/getStartOfDay.mjs.map +1 -0
  23. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.js +2 -2
  24. package/build/calendar/monthCalendar/MonthCalendar.js.map +1 -0
  25. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.mjs +1 -1
  26. package/build/calendar/monthCalendar/MonthCalendar.mjs.map +1 -0
  27. package/build/calendar/monthCalendar/table/MonthCalendarTable.js.map +1 -0
  28. package/build/calendar/monthCalendar/table/MonthCalendarTable.mjs.map +1 -0
  29. package/build/{dateLookup → calendar}/tableLink/TableLink.js +2 -2
  30. package/build/calendar/tableLink/TableLink.js.map +1 -0
  31. package/build/{dateLookup → calendar}/tableLink/TableLink.mjs +1 -1
  32. package/build/calendar/tableLink/TableLink.mjs.map +1 -0
  33. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.js +2 -2
  34. package/build/calendar/yearCalendar/YearCalendar.js.map +1 -0
  35. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.mjs +1 -1
  36. package/build/calendar/yearCalendar/YearCalendar.mjs.map +1 -0
  37. package/build/calendar/yearCalendar/table/YearCalendarTable.js.map +1 -0
  38. package/build/calendar/yearCalendar/table/YearCalendarTable.mjs.map +1 -0
  39. package/build/dateLookup/DateLookup.js +28 -168
  40. package/build/dateLookup/DateLookup.js.map +1 -1
  41. package/build/dateLookup/DateLookup.mjs +29 -169
  42. package/build/dateLookup/DateLookup.mjs.map +1 -1
  43. package/build/index.js +2 -0
  44. package/build/index.js.map +1 -1
  45. package/build/index.mjs +1 -0
  46. package/build/index.mjs.map +1 -1
  47. package/build/main.css +624 -688
  48. package/build/prompt/InfoPrompt/InfoPrompt.js +1 -1
  49. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  50. package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -2
  51. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  52. package/build/sentimentSurface/SentimentSurface.js +9 -2
  53. package/build/sentimentSurface/SentimentSurface.js.map +1 -1
  54. package/build/sentimentSurface/SentimentSurface.mjs +9 -2
  55. package/build/sentimentSurface/SentimentSurface.mjs.map +1 -1
  56. package/build/styles/calendar/Calendar.css +83 -0
  57. package/build/styles/dateLookup/DateLookup.css +0 -90
  58. package/build/styles/main.css +624 -688
  59. package/build/styles/sentimentSurface/SentimentSurface.css +325 -337
  60. package/build/types/calendar/Calendar.d.ts +13 -0
  61. package/build/types/calendar/Calendar.d.ts.map +1 -0
  62. package/build/types/{dateLookup/DateLookup.messages.d.ts → calendar/Calendar.messages.d.ts} +1 -1
  63. package/build/types/calendar/Calendar.messages.d.ts.map +1 -0
  64. package/build/types/calendar/dateHeader/DateHeader.d.ts.map +1 -0
  65. package/build/types/calendar/dateHeader/index.d.ts.map +1 -0
  66. package/build/types/calendar/dayCalendar/DayCalendar.d.ts.map +1 -0
  67. package/build/types/calendar/dayCalendar/index.d.ts.map +1 -0
  68. package/build/types/calendar/dayCalendar/table/DayCalendarTable.d.ts.map +1 -0
  69. package/build/types/calendar/dayCalendar/table/index.d.ts.map +1 -0
  70. package/build/types/calendar/getFocusableTime/getFocusableTime.d.ts.map +1 -0
  71. package/build/types/calendar/getStartOfDay/getStartOfDay.d.ts.map +1 -0
  72. package/build/types/calendar/getStartOfDay/index.d.ts.map +1 -0
  73. package/build/types/calendar/index.d.ts +3 -0
  74. package/build/types/calendar/index.d.ts.map +1 -0
  75. package/build/types/{dateLookup → calendar}/monthCalendar/MonthCalendar.d.ts +1 -1
  76. package/build/types/calendar/monthCalendar/MonthCalendar.d.ts.map +1 -0
  77. package/build/types/calendar/monthCalendar/index.d.ts.map +1 -0
  78. package/build/types/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.d.ts +1 -1
  79. package/build/types/calendar/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -0
  80. package/build/types/calendar/monthCalendar/table/index.d.ts.map +1 -0
  81. package/build/types/calendar/tableLink/TableLink.d.ts.map +1 -0
  82. package/build/types/calendar/tableLink/index.d.ts.map +1 -0
  83. package/build/types/{dateLookup → calendar}/yearCalendar/YearCalendar.d.ts +1 -1
  84. package/build/types/calendar/yearCalendar/YearCalendar.d.ts.map +1 -0
  85. package/build/types/calendar/yearCalendar/index.d.ts.map +1 -0
  86. package/build/types/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.d.ts +1 -1
  87. package/build/types/calendar/yearCalendar/table/YearCalendarTable.d.ts.map +1 -0
  88. package/build/types/calendar/yearCalendar/table/index.d.ts.map +1 -0
  89. package/build/types/dateLookup/DateLookup.d.ts +2 -26
  90. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  91. package/build/types/index.d.ts +2 -0
  92. package/build/types/index.d.ts.map +1 -1
  93. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +3 -2
  94. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  95. package/build/types/sentimentSurface/SentimentSurface.d.ts.map +1 -1
  96. package/package.json +2 -2
  97. package/src/calendar/Calendar.css +83 -0
  98. package/src/calendar/Calendar.less +79 -0
  99. package/src/calendar/Calendar.story.tsx +92 -0
  100. package/src/calendar/Calendar.test.tsx +138 -0
  101. package/src/calendar/Calendar.tsx +165 -0
  102. package/src/{dateLookup → calendar}/dateHeader/DateHeader.tsx +1 -1
  103. package/src/{dateLookup → calendar}/dayCalendar/DayCalendar.tsx +1 -1
  104. package/src/calendar/index.ts +2 -0
  105. package/src/{dateLookup → calendar}/monthCalendar/MonthCalendar.tsx +2 -2
  106. package/src/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.tsx +1 -1
  107. package/src/{dateLookup → calendar}/tableLink/TableLink.tsx +1 -1
  108. package/src/{dateLookup → calendar}/yearCalendar/YearCalendar.tsx +2 -2
  109. package/src/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.tsx +1 -1
  110. package/src/criticalBanner/CriticalCommsBanner.test.tsx +1 -1
  111. package/src/dateLookup/DateLookup.css +0 -90
  112. package/src/dateLookup/DateLookup.less +0 -91
  113. package/src/dateLookup/DateLookup.test.tsx +0 -124
  114. package/src/dateLookup/DateLookup.tsx +31 -161
  115. package/src/index.ts +2 -0
  116. package/src/main.css +624 -688
  117. package/src/main.less +1 -0
  118. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +42 -0
  119. package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +65 -1
  120. package/src/prompt/InfoPrompt/InfoPrompt.tsx +15 -4
  121. package/src/sentimentSurface/SentimentSurface.css +325 -337
  122. package/src/sentimentSurface/SentimentSurface.docs.mdx +2 -0
  123. package/src/sentimentSurface/SentimentSurface.less +2 -322
  124. package/src/sentimentSurface/SentimentSurface.story.tsx +4 -0
  125. package/src/sentimentSurface/SentimentSurface.test.story.tsx +1 -5
  126. package/src/sentimentSurface/SentimentSurface.test.tsx +84 -3
  127. package/src/sentimentSurface/SentimentSurface.tsx +10 -2
  128. package/build/dateLookup/DateLookup.messages.js.map +0 -1
  129. package/build/dateLookup/DateLookup.messages.mjs.map +0 -1
  130. package/build/dateLookup/dateHeader/DateHeader.js.map +0 -1
  131. package/build/dateLookup/dateHeader/DateHeader.mjs.map +0 -1
  132. package/build/dateLookup/dayCalendar/DayCalendar.js.map +0 -1
  133. package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +0 -1
  134. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +0 -1
  135. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +0 -1
  136. package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +0 -1
  137. package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +0 -1
  138. package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +0 -1
  139. package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +0 -1
  140. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +0 -1
  141. package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +0 -1
  142. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +0 -1
  143. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +0 -1
  144. package/build/dateLookup/tableLink/TableLink.js.map +0 -1
  145. package/build/dateLookup/tableLink/TableLink.mjs.map +0 -1
  146. package/build/dateLookup/yearCalendar/YearCalendar.js.map +0 -1
  147. package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +0 -1
  148. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +0 -1
  149. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +0 -1
  150. package/build/types/dateLookup/DateLookup.messages.d.ts.map +0 -1
  151. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +0 -1
  152. package/build/types/dateLookup/dateHeader/index.d.ts.map +0 -1
  153. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +0 -1
  154. package/build/types/dateLookup/dayCalendar/index.d.ts.map +0 -1
  155. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +0 -1
  156. package/build/types/dateLookup/dayCalendar/table/index.d.ts.map +0 -1
  157. package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts.map +0 -1
  158. package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts.map +0 -1
  159. package/build/types/dateLookup/getStartOfDay/index.d.ts.map +0 -1
  160. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +0 -1
  161. package/build/types/dateLookup/monthCalendar/index.d.ts.map +0 -1
  162. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +0 -1
  163. package/build/types/dateLookup/monthCalendar/table/index.d.ts.map +0 -1
  164. package/build/types/dateLookup/tableLink/TableLink.d.ts.map +0 -1
  165. package/build/types/dateLookup/tableLink/index.d.ts.map +0 -1
  166. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +0 -1
  167. package/build/types/dateLookup/yearCalendar/index.d.ts.map +0 -1
  168. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +0 -1
  169. package/build/types/dateLookup/yearCalendar/table/index.d.ts.map +0 -1
  170. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.js +0 -0
  171. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.mjs +0 -0
  172. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.js +0 -0
  173. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.mjs +0 -0
  174. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.js +0 -0
  175. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.mjs +0 -0
  176. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.js +0 -0
  177. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.mjs +0 -0
  178. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.js +0 -0
  179. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.mjs +0 -0
  180. /package/build/types/{dateLookup → calendar}/dateHeader/DateHeader.d.ts +0 -0
  181. /package/build/types/{dateLookup → calendar}/dateHeader/index.d.ts +0 -0
  182. /package/build/types/{dateLookup → calendar}/dayCalendar/DayCalendar.d.ts +0 -0
  183. /package/build/types/{dateLookup → calendar}/dayCalendar/index.d.ts +0 -0
  184. /package/build/types/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.d.ts +0 -0
  185. /package/build/types/{dateLookup → calendar}/dayCalendar/table/index.d.ts +0 -0
  186. /package/build/types/{dateLookup → calendar}/getFocusableTime/getFocusableTime.d.ts +0 -0
  187. /package/build/types/{dateLookup → calendar}/getStartOfDay/getStartOfDay.d.ts +0 -0
  188. /package/build/types/{dateLookup → calendar}/getStartOfDay/index.d.ts +0 -0
  189. /package/build/types/{dateLookup → calendar}/monthCalendar/index.d.ts +0 -0
  190. /package/build/types/{dateLookup → calendar}/monthCalendar/table/index.d.ts +0 -0
  191. /package/build/types/{dateLookup → calendar}/tableLink/TableLink.d.ts +0 -0
  192. /package/build/types/{dateLookup → calendar}/tableLink/index.d.ts +0 -0
  193. /package/build/types/{dateLookup → calendar}/yearCalendar/index.d.ts +0 -0
  194. /package/build/types/{dateLookup → calendar}/yearCalendar/table/index.d.ts +0 -0
  195. /package/src/{dateLookup/DateLookup.messages.ts → calendar/Calendar.messages.ts} +0 -0
  196. /package/src/{dateLookup → calendar}/dateHeader/index.ts +0 -0
  197. /package/src/{dateLookup → calendar}/dayCalendar/index.ts +0 -0
  198. /package/src/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.tsx +0 -0
  199. /package/src/{dateLookup → calendar}/dayCalendar/table/index.ts +0 -0
  200. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusable.test.ts +0 -0
  201. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusableTime.tsx +0 -0
  202. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.test.js +0 -0
  203. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.tsx +0 -0
  204. /package/src/{dateLookup → calendar}/getStartOfDay/index.ts +0 -0
  205. /package/src/{dateLookup → calendar}/monthCalendar/index.ts +0 -0
  206. /package/src/{dateLookup → calendar}/monthCalendar/table/index.ts +0 -0
  207. /package/src/{dateLookup → calendar}/tableLink/index.ts +0 -0
  208. /package/src/{dateLookup → calendar}/yearCalendar/index.ts +0 -0
  209. /package/src/{dateLookup → calendar}/yearCalendar/table/index.ts +0 -0
@@ -45,7 +45,7 @@ const InfoPrompt = ({
45
45
  ...restProps
46
46
  }) => {
47
47
  const [shouldFire, setShouldFire] = React.useState();
48
- const announceOnChange = [title, description, action?.label].filter(Boolean).join('|');
48
+ const announceOnChange = [title, React.Children.toArray(description).map(child => /*#__PURE__*/React.isValidElement(child) ? child.props.children : child).join(''), action?.label].filter(Boolean).join('|');
49
49
  const statusIconSentiment = sentiment$1 === 'success' ? sentiment.Sentiment.POSITIVE : sentiment$1;
50
50
  const handleTouchStart = () => {
51
51
  setShouldFire(true);
@@ -1 +1 @@
1
- {"version":3,"file":"InfoPrompt.js","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { LiveRegion, Sentiment, Typography } from '../../common';\nimport type { AriaLive } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label) if it conveys meaning.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'aria-live' | 'role'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n className?: string;\n /**\n * Sets the ARIA live region politeness level.\n * - `'polite'` — announced after the current speech (default)\n * - `'assertive'` — interrupts the current speech immediately\n * - `'off'` — disables the live region entirely\n * @default 'polite'\n */\n 'aria-live'?: AriaLive;\n };\n\n/**\n * `InfoPrompt` displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated `Alert` component (run codemod to migrate: **`npx \\@wise/wds-codemods@latest info-prompt`**).\n *\n * Guidance can be found in the [design system](https://docs.wise.design/components/info-prompt).\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'aria-live': ariaLive = 'polite',\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const announceOnChange = [title, description, action?.label].filter(Boolean).join('|');\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return (\n <span className=\"wds-info-prompt__media\">\n <GiftBox />\n </span>\n );\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n // Render content directly in LiveRegion\n return (\n <LiveRegion aria-live={ariaLive} announceOnChange={announceOnChange}>\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","ariaLive","dataTestId","restProps","shouldFire","setShouldFire","useState","announceOnChange","label","filter","Boolean","join","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","StatusIcon","size","LiveRegion","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,aAAAA,WAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;EACT,WAAW,EAAEC,QAAQ,GAAG,QAAQ;AAChC,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAQ,EAAW;EACvD,MAAMC,gBAAgB,GAAG,CAACT,KAAK,EAAEC,WAAW,EAAEF,MAAM,EAAEW,KAAK,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EACtF,MAAMC,mBAAmB,GACvBlB,WAAS,KAAK,SAAS,GACnBmB,mBAAS,CAACC,QAAQ,GACjBpB,WAAsD;EAE7D,MAAMqB,gBAAgB,GAAGA,MAAK;IAC5BV,aAAa,CAAC,IAAI,CAAC;EACrB,CAAC;EAED,MAAMW,cAAc,GAAGA,MAAK;AAC1B,IAAA,IAAIZ,UAAU,IAAIP,MAAM,EAAEoB,IAAI,EAAE;AAC9B,MAAA,IAAIpB,MAAM,CAACqB,MAAM,KAAK,QAAQ,EAAE;AAC9BC,QAAAA,MAAM,CAACC,GAAG,EAAEC,IAAI,CAACxB,MAAM,CAACoB,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAC;AACjE,MAAA,CAAC,MAAM;QACLE,MAAM,CAACC,GAAG,EAAEE,QAAQ,CAACC,MAAM,CAAC1B,MAAM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eAErBW,eAAA,CAAA,KAAA,EAAA;AAAKtC,QAAAA,SAAS,EAAC,0BAA0B;AAAA2B,QAAAA,QAAA,EAAA,CACtC7B,KAAK,iBACJ4B,cAAA,CAACa,YAAI,EAAA;AAACvC,UAAAA,SAAS,EAAC,wBAAwB;UAACwC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAhB,UAAAA,QAAA,EACjF7B;AAAK,SACF,CACP,eACD4B,cAAA,CAACa,YAAI,EAAA;AAACI,UAAAA,EAAE,EAAC,MAAM;AAAC3C,UAAAA,SAAS,EAAC,8BAA8B;AAAA2B,UAAAA,QAAA,EACrD5B;AAAW,SACR,CACN,EAACF,MAAM,iBACL6B,cAAA,CAACkB,YAAI,EAAA;UACH3B,IAAI,EAAEpB,MAAM,CAACoB,IAAK;UAClBC,MAAM,EAAErB,MAAM,CAACqB,MAAO;UACtBsB,IAAI,EAAEC,qBAAU,CAACI,YAAa;AAC9B7C,UAAAA,SAAS,EAAC,yBAAyB;UACnC8C,OAAO,EAAEjD,MAAM,CAACiD,OAAQ;UAAAnB,QAAA,EAEvB9B,MAAM,CAACW;AAAK,SACT,CACP;OACE;KACU;AACnB,GAAY,CAAC;AAEjB;;;;"}
1
+ {"version":3,"file":"InfoPrompt.js","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { Children, HTMLAttributes, ReactNode, isValidElement, useState } from 'react';\nimport { LiveRegion, Sentiment, Typography } from '../../common';\nimport type { AriaLive } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label) if it conveys meaning.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'aria-live' | 'role'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description content for the prompt (required). Accepts plain text or rich content (ReactNode).\n * If the description contains an interactive element, the `action` prop must not be used simultaneously.\n */\n description: ReactNode;\n className?: string;\n /**\n * Sets the ARIA live region politeness level.\n * - `'polite'` — announced after the current speech (default)\n * - `'assertive'` — interrupts the current speech immediately\n * - `'off'` — disables the live region entirely\n * @default 'polite'\n */\n 'aria-live'?: AriaLive;\n };\n\n/**\n * `InfoPrompt` displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated `Alert` component (run codemod to migrate: **`npx \\@wise/wds-codemods@latest info-prompt`**).\n *\n * Guidance can be found in the [design system](https://docs.wise.design/components/info-prompt).\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'aria-live': ariaLive = 'polite',\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const announceOnChange = [\n title,\n Children.toArray(description)\n .map((child) =>\n isValidElement<{ children?: ReactNode }>(child) ? child.props.children : child,\n )\n .join(''),\n action?.label,\n ]\n .filter(Boolean)\n .join('|');\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return (\n <span className=\"wds-info-prompt__media\">\n <GiftBox />\n </span>\n );\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n // Render content directly in LiveRegion\n return (\n <LiveRegion aria-live={ariaLive} announceOnChange={announceOnChange}>\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","ariaLive","dataTestId","restProps","shouldFire","setShouldFire","useState","announceOnChange","Children","toArray","map","child","isValidElement","props","children","join","label","filter","Boolean","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","asset","GiftBox","StatusIcon","size","LiveRegion","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,aAAAA,WAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;EACT,WAAW,EAAEC,QAAQ,GAAG,QAAQ;AAChC,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAQ,EAAW;EACvD,MAAMC,gBAAgB,GAAG,CACvBT,KAAK,EACLU,cAAQ,CAACC,OAAO,CAACV,WAAW,CAAC,CAC1BW,GAAG,CAAEC,KAAK,iBACTC,oBAAc,CAA2BD,KAAK,CAAC,GAAGA,KAAK,CAACE,KAAK,CAACC,QAAQ,GAAGH,KAAK,CAC/E,CACAI,IAAI,CAAC,EAAE,CAAC,EACXlB,MAAM,EAAEmB,KAAK,CACd,CACEC,MAAM,CAACC,OAAO,CAAC,CACfH,IAAI,CAAC,GAAG,CAAC;EACZ,MAAMI,mBAAmB,GACvBzB,WAAS,KAAK,SAAS,GACnB0B,mBAAS,CAACC,QAAQ,GACjB3B,WAAsD;EAE7D,MAAM4B,gBAAgB,GAAGA,MAAK;IAC5BjB,aAAa,CAAC,IAAI,CAAC;EACrB,CAAC;EAED,MAAMkB,cAAc,GAAGA,MAAK;AAC1B,IAAA,IAAInB,UAAU,IAAIP,MAAM,EAAE2B,IAAI,EAAE;AAC9B,MAAA,IAAI3B,MAAM,CAAC4B,MAAM,KAAK,QAAQ,EAAE;AAC9BC,QAAAA,MAAM,CAACC,GAAG,EAAE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AAA,YAAY,EAAEnB,gBAAiB;AAC/BoB,MAAAA,UAAU,EAAEnB,cAAe;AAC3BoB,MAAAA,WAAW,EAAEZ,eAAgB;AAC7BpC,MAAAA,SAAS,EAAEA,SAAU;AAAAmB,MAAAA,QAAA,eAErB8B,eAAA,CAAA,KAAA,EAAA;AAAK5C,QAAAA,SAAS,EAAC,0BAA0B;AAAAc,QAAAA,QAAA,EAAA,CACtChB,KAAK,iBACJmC,cAAA,CAACY,YAAI,EAAA;AAAC7C,UAAAA,SAAS,EAAC,wBAAwB;UAAC8C,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAnC,UAAAA,QAAA,EACjFhB;AAAK,SACF,CACP,eACDmC,cAAA,CAACY,YAAI,EAAA;AAACI,UAAAA,EAAE,EAAC,MAAM;AAACjD,UAAAA,SAAS,EAAC,8BAA8B;AAAAc,UAAAA,QAAA,EACrDf;AAAW,SACR,CACN,EAACF,MAAM,iBACLoC,cAAA,CAACiB,YAAI,EAAA;UACH1B,IAAI,EAAE3B,MAAM,CAAC2B,IAAK;UAClBC,MAAM,EAAE5B,MAAM,CAAC4B,MAAO;UACtBqB,IAAI,EAAEC,qBAAU,CAACI,YAAa;AAC9BnD,UAAAA,SAAS,EAAC,yBAAyB;UACnCoD,OAAO,EAAEvD,MAAM,CAACuD,OAAQ;UAAAtC,QAAA,EAEvBjB,MAAM,CAACmB;AAAK,SACT,CACP;OACE;KACU;AACnB,GAAY,CAAC;AAEjB;;;;"}
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
1
+ import { useState, Children, isValidElement } from 'react';
2
2
  import '../../common/theme.mjs';
3
3
  import '../../common/direction.mjs';
4
4
  import '@transferwise/neptune-tokens';
@@ -43,7 +43,7 @@ const InfoPrompt = ({
43
43
  ...restProps
44
44
  }) => {
45
45
  const [shouldFire, setShouldFire] = useState();
46
- const announceOnChange = [title, description, action?.label].filter(Boolean).join('|');
46
+ const announceOnChange = [title, Children.toArray(description).map(child => /*#__PURE__*/isValidElement(child) ? child.props.children : child).join(''), action?.label].filter(Boolean).join('|');
47
47
  const statusIconSentiment = sentiment === 'success' ? Sentiment.POSITIVE : sentiment;
48
48
  const handleTouchStart = () => {
49
49
  setShouldFire(true);
@@ -1 +1 @@
1
- {"version":3,"file":"InfoPrompt.mjs","sources":["../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode, useState } from 'react';\nimport { LiveRegion, Sentiment, Typography } from '../../common';\nimport type { AriaLive } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label) if it conveys meaning.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'aria-live' | 'role'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description text for the prompt (required)\n */\n description: string;\n className?: string;\n /**\n * Sets the ARIA live region politeness level.\n * - `'polite'` — announced after the current speech (default)\n * - `'assertive'` — interrupts the current speech immediately\n * - `'off'` — disables the live region entirely\n * @default 'polite'\n */\n 'aria-live'?: AriaLive;\n };\n\n/**\n * `InfoPrompt` displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated `Alert` component (run codemod to migrate: **`npx \\@wise/wds-codemods@latest info-prompt`**).\n *\n * Guidance can be found in the [design system](https://docs.wise.design/components/info-prompt).\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'aria-live': ariaLive = 'polite',\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const announceOnChange = [title, description, action?.label].filter(Boolean).join('|');\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return (\n <span className=\"wds-info-prompt__media\">\n <GiftBox />\n </span>\n );\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n // Render content directly in LiveRegion\n return (\n <LiveRegion aria-live={ariaLive} announceOnChange={announceOnChange}>\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","ariaLive","dataTestId","restProps","shouldFire","setShouldFire","useState","announceOnChange","label","filter","Boolean","join","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","children","asset","GiftBox","StatusIcon","size","LiveRegion","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,EAAAA,SAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;EACT,WAAW,EAAEC,QAAQ,GAAG,QAAQ;AAChC,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,QAAQ,EAAW;EACvD,MAAMC,gBAAgB,GAAG,CAACT,KAAK,EAAEC,WAAW,EAAEF,MAAM,EAAEW,KAAK,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EACtF,MAAMC,mBAAmB,GACvBlB,SAAS,KAAK,SAAS,GACnBmB,SAAS,CAACC,QAAQ,GACjBpB,SAAsD;EAE7D,MAAMqB,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prompt/InfoPrompt/InfoPrompt.tsx"],"sourcesContent":["import { Children, HTMLAttributes, ReactNode, isValidElement, useState } from 'react';\nimport { LiveRegion, Sentiment, Typography } from '../../common';\nimport type { AriaLive } from '../../common';\nimport { GiftBox } from '@transferwise/icons';\nimport type { Sentiment as SurfaceSentiment } from '../../sentimentSurface';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport Link, { LinkProps } from '../../link';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\n\nexport type InfoPromptAction = Pick<LinkProps, 'href' | 'target' | 'onClick'> & {\n /**\n * The label text for the action link\n */\n label: string;\n};\n\nexport type InfoPromptMedia = {\n /**\n * The icon/image asset to display.\n * The asset should include its own accessibility attributes (e.g. title, aria-label) if it conveys meaning.\n */\n asset: ReactNode;\n};\n\nexport type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'aria-live' | 'role'> &\n Pick<PrimitivePromptProps, 'data-testid'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: SurfaceSentiment;\n /**\n * Handler called when the close button is clicked.\n * If not provided, the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Custom media to override the default status icon.\n * Success and proposition sentiments support 2 status variations: standard checkmark & confetti.\n */\n media?: InfoPromptMedia;\n /**\n * Action link to be displayed below the description\n */\n action?: InfoPromptAction;\n /**\n * Title content for the prompt\n */\n title?: string;\n /**\n * Description content for the prompt (required). Accepts plain text or rich content (ReactNode).\n * If the description contains an interactive element, the `action` prop must not be used simultaneously.\n */\n description: ReactNode;\n className?: string;\n /**\n * Sets the ARIA live region politeness level.\n * - `'polite'` — announced after the current speech (default)\n * - `'assertive'` — interrupts the current speech immediately\n * - `'off'` — disables the live region entirely\n * @default 'polite'\n */\n 'aria-live'?: AriaLive;\n };\n\n/**\n * `InfoPrompt` displays important contextual messages to users within a screen.\n * It provides a visually distinct way to communicate information, warnings, errors,\n * or positive feedback with optional actions and dismissal capabilities.\n *\n * Use this component to replace the deprecated `Alert` component (run codemod to migrate: **`npx \\@wise/wds-codemods@latest info-prompt`**).\n *\n * Guidance can be found in the [design system](https://docs.wise.design/components/info-prompt).\n */\nexport const InfoPrompt = ({\n sentiment = 'neutral',\n onDismiss,\n media,\n action,\n title,\n description,\n className,\n 'aria-live': ariaLive = 'polite',\n 'data-testid': dataTestId,\n ...restProps\n}: InfoPromptProps) => {\n const [shouldFire, setShouldFire] = useState<boolean>();\n const announceOnChange = [\n title,\n Children.toArray(description)\n .map((child) =>\n isValidElement<{ children?: ReactNode }>(child) ? child.props.children : child,\n )\n .join(''),\n action?.label,\n ]\n .filter(Boolean)\n .join('|');\n const statusIconSentiment =\n sentiment === 'success'\n ? Sentiment.POSITIVE\n : (sentiment as Exclude<SurfaceSentiment, 'proposition'>);\n\n const handleTouchStart = () => {\n setShouldFire(true);\n };\n\n const handleTouchEnd = () => {\n if (shouldFire && action?.href) {\n if (action.target === '_blank') {\n window.top?.open(action.href, '_blank', 'noopener, noreferrer');\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n };\n\n const handleTouchMove = () => {\n setShouldFire(false);\n };\n\n const renderMedia = () => {\n if (media) {\n return <span className=\"wds-info-prompt__media\">{media.asset}</span>;\n }\n\n if (sentiment === 'proposition') {\n return (\n <span className=\"wds-info-prompt__media\">\n <GiftBox />\n </span>\n );\n }\n\n return <StatusIcon size={24} sentiment={statusIconSentiment} />;\n };\n\n // Render content directly in LiveRegion\n return (\n <LiveRegion aria-live={ariaLive} announceOnChange={announceOnChange}>\n <PrimitivePrompt\n sentiment={sentiment}\n media={renderMedia()}\n data-testid={dataTestId}\n className={clsx('wds-info-prompt', className)}\n {...restProps}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onDismiss={onDismiss}\n >\n <div className=\"wds-info-prompt__content\">\n {title && (\n <Body className=\"wds-info-prompt__title\" type={Typography.BODY_LARGE_BOLD} as=\"span\">\n {title}\n </Body>\n )}\n <Body as=\"span\" className=\"wds-info-prompt__description\">\n {description}\n </Body>\n {action && (\n <Link\n href={action.href}\n target={action.target}\n type={Typography.LINK_DEFAULT}\n className=\"wds-info-prompt__action\"\n onClick={action.onClick}\n >\n {action.label}\n </Link>\n )}\n </div>\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n"],"names":["InfoPrompt","sentiment","onDismiss","media","action","title","description","className","ariaLive","dataTestId","restProps","shouldFire","setShouldFire","useState","announceOnChange","Children","toArray","map","child","isValidElement","props","children","join","label","filter","Boolean","statusIconSentiment","Sentiment","POSITIVE","handleTouchStart","handleTouchEnd","href","target","window","top","open","location","assign","handleTouchMove","renderMedia","_jsx","asset","GiftBox","StatusIcon","size","LiveRegion","PrimitivePrompt","clsx","onTouchStart","onTouchEnd","onTouchMove","_jsxs","Body","type","Typography","BODY_LARGE_BOLD","as","Link","LINK_DEFAULT","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EO,MAAMA,UAAU,GAAGA,CAAC;AACzBC,EAAAA,SAAS,GAAG,SAAS;EACrBC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC,SAAS;EACT,WAAW,EAAEC,QAAQ,GAAG,QAAQ;AAChC,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAS,CACI,KAAI;EACpB,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,QAAQ,EAAW;EACvD,MAAMC,gBAAgB,GAAG,CACvBT,KAAK,EACLU,QAAQ,CAACC,OAAO,CAACV,WAAW,CAAC,CAC1BW,GAAG,CAAEC,KAAK,iBACTC,cAAc,CAA2BD,KAAK,CAAC,GAAGA,KAAK,CAACE,KAAK,CAACC,QAAQ,GAAGH,KAAK,CAC/E,CACAI,IAAI,CAAC,EAAE,CAAC,EACXlB,MAAM,EAAEmB,KAAK,CACd,CACEC,MAAM,CAACC,OAA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M,CAACuD,OAAQ;UAAAtC,QAAA,EAEvBjB,MAAM,CAACmB;AAAK,SACT,CACP;OACE;KACU;AACnB,GAAY,CAAC;AAEjB;;;;"}
@@ -22,9 +22,16 @@ const SentimentSurface = /*#__PURE__*/React.forwardRef(function SentimentSurface
22
22
  const Element = as ?? 'div';
23
23
  const BASE_CLASS = 'wds-sentiment-surface';
24
24
  const {
25
- className: closestBrandTheme
25
+ className: closestBrandTheme,
26
+ isScreenModeDark: isDark,
27
+ theme
26
28
  } = componentsTheming.useTheme();
27
- const classNames = clsx.clsx(closestBrandTheme, BASE_CLASS, `${BASE_CLASS}-${sentiment}-${emphasis}`, hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`, className);
29
+ const getThemeBrightness = () => {
30
+ const isForestGreen = theme.includes('forest-green');
31
+ const isPlatform = theme.includes('platform');
32
+ return isForestGreen || isDark && !isPlatform ? 'dark' : 'light';
33
+ };
34
+ const classNames = clsx.clsx(closestBrandTheme, BASE_CLASS, `wds-sentiment-${sentiment}-${getThemeBrightness()}-${emphasis}`, hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`, className);
28
35
  const sentimentProps = {
29
36
  ref,
30
37
  id,
@@ -1 +1 @@
1
- {"version":3,"file":"SentimentSurface.js","sources":["../../src/sentimentSurface/SentimentSurface.tsx"],"sourcesContent":["import { forwardRef, ElementType, ForwardedRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport {\n SentimentSurfaceComponentProps,\n SentimentSurfaceComponent,\n} from './SentimentSurface.types';\nimport { useTheme } from '@wise/components-theming';\n\n/**\n * SentimentSurface is a polymorphic container component that exposes and, optionally, applies\n * contextual colour tokens as CSS custom properties, based on sentiment types (`negative`,\n * `warning`, `neutral`, `success`, `proposition`).\n *\n * @param {ElementType} [as='div'] - Optional prop to override the HTML element rendered.\n * @param {Sentiment} sentiment - Required prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [hasBaseStyles=true] - If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.\n * @param {ReactNode} [children] - Content to render inside the surface.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {CSSProperties} [style] - Inline styles to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage with negative sentiment\n * <SentimentSurface sentiment=\"negative\">\n * Your payment has failed\n * </SentimentSurface>\n * ```\n *\n * @see {@link SentimentSurface} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/sentiment-surface--docs|Storybook Wise Design}\n */\n// @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\nconst SentimentSurface: SentimentSurfaceComponent = forwardRef(function SentimentSurface<\n T extends ElementType = 'div',\n>(\n {\n as,\n sentiment,\n emphasis = 'base',\n hasBaseStyles = true,\n style,\n className,\n children,\n id,\n 'data-testid': dataTestId,\n ...props\n }: SentimentSurfaceComponentProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const Element = as ?? 'div';\n const BASE_CLASS = 'wds-sentiment-surface';\n const { className: closestBrandTheme } = useTheme();\n const classNames = clsx(\n closestBrandTheme,\n BASE_CLASS,\n `${BASE_CLASS}-${sentiment}-${emphasis}`,\n hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,\n className,\n );\n const sentimentProps = {\n ref,\n id,\n 'data-testid': dataTestId,\n className: classNames,\n style,\n ...props,\n };\n\n return (\n // @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\n <Element {...sentimentProps}>{children}</Element>\n );\n});\n\nSentimentSurface.displayName = 'SentimentSurface';\n\nexport default SentimentSurface;\n"],"names":["SentimentSurface","forwardRef","as","sentiment","emphasis","hasBaseStyles","style","className","children","id","dataTestId","props","ref","Element","BASE_CLASS","closestBrandTheme","useTheme","classNames","clsx","sentimentProps","_jsx","displayName"],"mappings":";;;;;;;;;AAqCA,MAAMA,gBAAgB,gBAA8BC,gBAAU,CAAC,SAASD,gBAAgBA,CAGtF;EACEE,EAAE;EACFC,SAAS;AACTC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,aAAa,GAAG,IAAI;EACpBC,KAAK;EACLC,SAAS;EACTC,QAAQ;EACRC,EAAE;AACF,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAK,CAC0B,EACpCC,GAA8B,EAAA;AAE9B,EAAA,MAAMC,OAAO,GAAGX,EAAE,IAAI,KAAK;EAC3B,MAAMY,UAAU,GAAG,uBAAuB;EAC1C,MAAM;AAAEP,IAAAA,SAAS,EAAEQ;GAAmB,GAAGC,0BAAQ,EAAE;EACnD,MAAMC,UAAU,GAAGC,SAAI,CACrBH,iBAAiB,EACjBD,UAAU,EACV,CAAA,EAAGA,UAAU,CAAA,CAAA,EAAIX,SAAS,CAAA,CAAA,EAAIC,QAAQ,CAAA,CAAE,EACxCC,aAAa,IAAI,GAAGS,UAAU,CAAA,eAAA,CAAiB,EAC/CP,SAAS,CACV;AACD,EAAA,MAAMY,cAAc,GAAG;IACrBP,GAAG;IACHH,EAAE;AACF,IAAA,aAAa,EAAEC,UAAU;AACzBH,IAAAA,SAAS,EAAEU,UAAU;IACrBX,KAAK;IACL,GAAGK;GACJ;AAED,EAAA;AAAA;AACE;AACAS,IAAAA,cAAA,CAACP,OAAO,EAAA;AAAA,MAAA,GAAKM,cAAc;AAAAX,MAAAA,QAAA,EAAGA;KAAkB;AAAC;AAErD,CAAC;AAEDR,gBAAgB,CAACqB,WAAW,GAAG,kBAAkB;;;;"}
1
+ {"version":3,"file":"SentimentSurface.js","sources":["../../src/sentimentSurface/SentimentSurface.tsx"],"sourcesContent":["import { forwardRef, ElementType, ForwardedRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport {\n SentimentSurfaceComponentProps,\n SentimentSurfaceComponent,\n} from './SentimentSurface.types';\nimport { useTheme } from '@wise/components-theming';\n\n/**\n * SentimentSurface is a polymorphic container component that exposes and, optionally, applies\n * contextual colour tokens as CSS custom properties, based on sentiment types (`negative`,\n * `warning`, `neutral`, `success`, `proposition`).\n *\n * @param {ElementType} [as='div'] - Optional prop to override the HTML element rendered.\n * @param {Sentiment} sentiment - Required prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [hasBaseStyles=true] - If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.\n * @param {ReactNode} [children] - Content to render inside the surface.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {CSSProperties} [style] - Inline styles to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage with negative sentiment\n * <SentimentSurface sentiment=\"negative\">\n * Your payment has failed\n * </SentimentSurface>\n * ```\n *\n * @see {@link SentimentSurface} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/sentiment-surface--docs|Storybook Wise Design}\n */\n// @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\nconst SentimentSurface: SentimentSurfaceComponent = forwardRef(function SentimentSurface<\n T extends ElementType = 'div',\n>(\n {\n as,\n sentiment,\n emphasis = 'base',\n hasBaseStyles = true,\n style,\n className,\n children,\n id,\n 'data-testid': dataTestId,\n ...props\n }: SentimentSurfaceComponentProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const Element = as ?? 'div';\n const BASE_CLASS = 'wds-sentiment-surface';\n const { className: closestBrandTheme, isScreenModeDark: isDark, theme } = useTheme();\n\n const getThemeBrightness = () => {\n const isForestGreen = theme.includes('forest-green');\n const isPlatform = theme.includes('platform');\n\n return isForestGreen || (isDark && !isPlatform) ? 'dark' : 'light';\n };\n\n const classNames = clsx(\n closestBrandTheme,\n BASE_CLASS,\n `wds-sentiment-${sentiment}-${getThemeBrightness()}-${emphasis}`,\n hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,\n className,\n );\n const sentimentProps = {\n ref,\n id,\n 'data-testid': dataTestId,\n className: classNames,\n style,\n ...props,\n };\n\n return (\n // @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\n <Element {...sentimentProps}>{children}</Element>\n );\n});\n\nSentimentSurface.displayName = 'SentimentSurface';\n\nexport default SentimentSurface;\n"],"names":["SentimentSurface","forwardRef","as","sentiment","emphasis","hasBaseStyles","style","className","children","id","dataTestId","props","ref","Element","BASE_CLASS","closestBrandTheme","isScreenModeDark","isDark","theme","useTheme","getThemeBrightness","isForestGreen","includes","isPlatform","classNames","clsx","sentimentProps","_jsx","displayName"],"mappings":";;;;;;;;;AAqCA,MAAMA,gBAAgB,gBAA8BC,gBAAU,CAAC,SAASD,gBAAgBA,CAGtF;EACEE,EAAE;EACFC,SAAS;AACTC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,aAAa,GAAG,IAAI;EACpBC,KAAK;EACLC,SAAS;EACTC,QAAQ;EACRC,EAAE;AACF,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAK,CAC0B,EACpCC,GAA8B,EAAA;AAE9B,EAAA,MAAMC,OAAO,GAAGX,EAAE,IAAI,KAAK;EAC3B,MAAMY,UAAU,GAAG,uBAAuB;EAC1C,MAAM;AAAEP,IAAAA,SAAS,EAAEQ,iBAAiB;AAAEC,IAAAA,gBAAgB,EAAEC,MAAM;AAAEC,IAAAA;GAAO,GAAGC,0BAAQ,EAAE;EAEpF,MAAMC,kBAAkB,GAAGA,MAAK;AAC9B,IAAA,MAAMC,aAAa,GAAGH,KAAK,CAACI,QAAQ,CAAC,cAAc,CAAC;AACpD,IAAA,MAAMC,UAAU,GAAGL,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC;IAE7C,OAAOD,aAAa,IAAKJ,MAAM,IAAI,CAACM,UAAW,GAAG,MAAM,GAAG,OAAO;EACpE,CAAC;EAED,MAAMC,UAAU,GAAGC,SAAI,CACrBV,iBAAiB,EACjBD,UAAU,EACV,CAAA,cAAA,EAAiBX,SAAS,CAAA,CAAA,EAAIiB,kBAAkB,EAAE,CAAA,CAAA,EAAIhB,QAAQ,CAAA,CAAE,EAChEC,aAAa,IAAI,CAAA,EAAGS,UAAU,CAAA,eAAA,CAAiB,EAC/CP,SAAS,CACV;AACD,EAAA,MAAMmB,cAAc,GAAG;IACrBd,GAAG;IACHH,EAAE;AACF,IAAA,aAAa,EAAEC,UAAU;AACzBH,IAAAA,SAAS,EAAEiB,UAAU;IACrBlB,KAAK;IACL,GAAGK;GACJ;AAED,EAAA;AAAA;AACE;AACAgB,IAAAA,cAAA,CAACd,OAAO,EAAA;AAAA,MAAA,GAAKa,cAAc;AAAAlB,MAAAA,QAAA,EAAGA;KAAkB;AAAC;AAErD,CAAC;AAEDR,gBAAgB,CAAC4B,WAAW,GAAG,kBAAkB;;;;"}
@@ -18,9 +18,16 @@ const SentimentSurface = /*#__PURE__*/forwardRef(function SentimentSurface({
18
18
  const Element = as ?? 'div';
19
19
  const BASE_CLASS = 'wds-sentiment-surface';
20
20
  const {
21
- className: closestBrandTheme
21
+ className: closestBrandTheme,
22
+ isScreenModeDark: isDark,
23
+ theme
22
24
  } = useTheme();
23
- const classNames = clsx(closestBrandTheme, BASE_CLASS, `${BASE_CLASS}-${sentiment}-${emphasis}`, hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`, className);
25
+ const getThemeBrightness = () => {
26
+ const isForestGreen = theme.includes('forest-green');
27
+ const isPlatform = theme.includes('platform');
28
+ return isForestGreen || isDark && !isPlatform ? 'dark' : 'light';
29
+ };
30
+ const classNames = clsx(closestBrandTheme, BASE_CLASS, `wds-sentiment-${sentiment}-${getThemeBrightness()}-${emphasis}`, hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`, className);
24
31
  const sentimentProps = {
25
32
  ref,
26
33
  id,
@@ -1 +1 @@
1
- {"version":3,"file":"SentimentSurface.mjs","sources":["../../src/sentimentSurface/SentimentSurface.tsx"],"sourcesContent":["import { forwardRef, ElementType, ForwardedRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport {\n SentimentSurfaceComponentProps,\n SentimentSurfaceComponent,\n} from './SentimentSurface.types';\nimport { useTheme } from '@wise/components-theming';\n\n/**\n * SentimentSurface is a polymorphic container component that exposes and, optionally, applies\n * contextual colour tokens as CSS custom properties, based on sentiment types (`negative`,\n * `warning`, `neutral`, `success`, `proposition`).\n *\n * @param {ElementType} [as='div'] - Optional prop to override the HTML element rendered.\n * @param {Sentiment} sentiment - Required prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [hasBaseStyles=true] - If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.\n * @param {ReactNode} [children] - Content to render inside the surface.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {CSSProperties} [style] - Inline styles to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage with negative sentiment\n * <SentimentSurface sentiment=\"negative\">\n * Your payment has failed\n * </SentimentSurface>\n * ```\n *\n * @see {@link SentimentSurface} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/sentiment-surface--docs|Storybook Wise Design}\n */\n// @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\nconst SentimentSurface: SentimentSurfaceComponent = forwardRef(function SentimentSurface<\n T extends ElementType = 'div',\n>(\n {\n as,\n sentiment,\n emphasis = 'base',\n hasBaseStyles = true,\n style,\n className,\n children,\n id,\n 'data-testid': dataTestId,\n ...props\n }: SentimentSurfaceComponentProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const Element = as ?? 'div';\n const BASE_CLASS = 'wds-sentiment-surface';\n const { className: closestBrandTheme } = useTheme();\n const classNames = clsx(\n closestBrandTheme,\n BASE_CLASS,\n `${BASE_CLASS}-${sentiment}-${emphasis}`,\n hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,\n className,\n );\n const sentimentProps = {\n ref,\n id,\n 'data-testid': dataTestId,\n className: classNames,\n style,\n ...props,\n };\n\n return (\n // @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\n <Element {...sentimentProps}>{children}</Element>\n );\n});\n\nSentimentSurface.displayName = 'SentimentSurface';\n\nexport default SentimentSurface;\n"],"names":["SentimentSurface","forwardRef","as","sentiment","emphasis","hasBaseStyles","style","className","children","id","dataTestId","props","ref","Element","BASE_CLASS","closestBrandTheme","useTheme","classNames","clsx","sentimentProps","_jsx","displayName"],"mappings":";;;;;AAqCA,MAAMA,gBAAgB,gBAA8BC,UAAU,CAAC,SAASD,gBAAgBA,CAGtF;EACEE,EAAE;EACFC,SAAS;AACTC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,aAAa,GAAG,IAAI;EACpBC,KAAK;EACLC,SAAS;EACTC,QAAQ;EACRC,EAAE;AACF,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAK,CAC0B,EACpCC,GAA8B,EAAA;AAE9B,EAAA,MAAMC,OAAO,GAAGX,EAAE,IAAI,KAAK;EAC3B,MAAMY,UAAU,GAAG,uBAAuB;EAC1C,MAAM;AAAEP,IAAAA,SAAS,EAAEQ;GAAmB,GAAGC,QAAQ,EAAE;EACnD,MAAMC,UAAU,GAAGC,IAAI,CACrBH,iBAAiB,EACjBD,UAAU,EACV,CAAA,EAAGA,UAAU,CAAA,CAAA,EAAIX,SAAS,CAAA,CAAA,EAAIC,QAAQ,CAAA,CAAE,EACxCC,aAAa,IAAI,GAAGS,UAAU,CAAA,eAAA,CAAiB,EAC/CP,SAAS,CACV;AACD,EAAA,MAAMY,cAAc,GAAG;IACrBP,GAAG;IACHH,EAAE;AACF,IAAA,aAAa,EAAEC,UAAU;AACzBH,IAAAA,SAAS,EAAEU,UAAU;IACrBX,KAAK;IACL,GAAGK;GACJ;AAED,EAAA;AAAA;AACE;AACAS,IAAAA,GAAA,CAACP,OAAO,EAAA;AAAA,MAAA,GAAKM,cAAc;AAAAX,MAAAA,QAAA,EAAGA;KAAkB;AAAC;AAErD,CAAC;AAEDR,gBAAgB,CAACqB,WAAW,GAAG,kBAAkB;;;;"}
1
+ {"version":3,"file":"SentimentSurface.mjs","sources":["../../src/sentimentSurface/SentimentSurface.tsx"],"sourcesContent":["import { forwardRef, ElementType, ForwardedRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport {\n SentimentSurfaceComponentProps,\n SentimentSurfaceComponent,\n} from './SentimentSurface.types';\nimport { useTheme } from '@wise/components-theming';\n\n/**\n * SentimentSurface is a polymorphic container component that exposes and, optionally, applies\n * contextual colour tokens as CSS custom properties, based on sentiment types (`negative`,\n * `warning`, `neutral`, `success`, `proposition`).\n *\n * @param {ElementType} [as='div'] - Optional prop to override the HTML element rendered.\n * @param {Sentiment} sentiment - Required prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [hasBaseStyles=true] - If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering.\n * @param {ReactNode} [children] - Content to render inside the surface.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {CSSProperties} [style] - Inline styles to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage with negative sentiment\n * <SentimentSurface sentiment=\"negative\">\n * Your payment has failed\n * </SentimentSurface>\n * ```\n *\n * @see {@link SentimentSurface} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/sentiment-surface--docs|Storybook Wise Design}\n */\n// @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\nconst SentimentSurface: SentimentSurfaceComponent = forwardRef(function SentimentSurface<\n T extends ElementType = 'div',\n>(\n {\n as,\n sentiment,\n emphasis = 'base',\n hasBaseStyles = true,\n style,\n className,\n children,\n id,\n 'data-testid': dataTestId,\n ...props\n }: SentimentSurfaceComponentProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const Element = as ?? 'div';\n const BASE_CLASS = 'wds-sentiment-surface';\n const { className: closestBrandTheme, isScreenModeDark: isDark, theme } = useTheme();\n\n const getThemeBrightness = () => {\n const isForestGreen = theme.includes('forest-green');\n const isPlatform = theme.includes('platform');\n\n return isForestGreen || (isDark && !isPlatform) ? 'dark' : 'light';\n };\n\n const classNames = clsx(\n closestBrandTheme,\n BASE_CLASS,\n `wds-sentiment-${sentiment}-${getThemeBrightness()}-${emphasis}`,\n hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,\n className,\n );\n const sentimentProps = {\n ref,\n id,\n 'data-testid': dataTestId,\n className: classNames,\n style,\n ...props,\n };\n\n return (\n // @ts-expect-error - Generic forwardRef limitation. See: https://fettblog.eu/typescript-react-generic-forward-refs/\n <Element {...sentimentProps}>{children}</Element>\n );\n});\n\nSentimentSurface.displayName = 'SentimentSurface';\n\nexport default SentimentSurface;\n"],"names":["SentimentSurface","forwardRef","as","sentiment","emphasis","hasBaseStyles","style","className","children","id","dataTestId","props","ref","Element","BASE_CLASS","closestBrandTheme","isScreenModeDark","isDark","theme","useTheme","getThemeBrightness","isForestGreen","includes","isPlatform","classNames","clsx","sentimentProps","_jsx","displayName"],"mappings":";;;;;AAqCA,MAAMA,gBAAgB,gBAA8BC,UAAU,CAAC,SAASD,gBAAgBA,CAGtF;EACEE,EAAE;EACFC,SAAS;AACTC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,aAAa,GAAG,IAAI;E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endar {
2
+ min-width: 300px;
3
+ text-align: center;
4
+ table-layout: fixed;
5
+ border: none;
6
+ background-color: inherit;
7
+ }
8
+ .tw-date-lookup-calendar thead {
9
+ background-color: transparent;
10
+ background-color: initial;
11
+ }
12
+ .tw-date-lookup-calendar > tbody > tr > td.weekend button {
13
+ color: #5d7079;
14
+ color: var(--color-content-secondary);
15
+ }
16
+ .tw-date-lookup-calendar > tbody > tr > td {
17
+ border: none;
18
+ padding: 4px;
19
+ padding: var(--size-4);
20
+ }
21
+ @media (max-width: 320px) {
22
+ .tw-date-lookup-calendar > tbody > tr > td {
23
+ padding: 0;
24
+ }
25
+ }
26
+ .tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
27
+ padding: 1px;
28
+ }
29
+ .tw-date-lookup-calendar > tbody > tr > td button {
30
+ width: 100%;
31
+ padding: 4px 0;
32
+ padding: var(--size-4) 0;
33
+ color: #0097c7;
34
+ color: var(--color-content-accent);
35
+ border: transparent;
36
+ border-radius: 10px;
37
+ border-radius: var(--radius-small);
38
+ background-color: transparent;
39
+ font-weight: 600;
40
+ font-weight: var(--font-weight-semi-bold);
41
+ color: #37517e;
42
+ color: var(--color-content-primary);
43
+ }
44
+ @media (max-width: 320px) {
45
+ .tw-date-lookup-calendar > tbody > tr > td button {
46
+ padding: 0;
47
+ }
48
+ }
49
+ .tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option {
50
+ height: 40px;
51
+ height: var(--size-40);
52
+ border-radius: 9999px;
53
+ border-radius: var(--radius-full);
54
+ line-height: 40px;
55
+ line-height: var(--size-40);
56
+ width: 40px;
57
+ width: var(--size-40);
58
+ padding: 0;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ }
63
+ .tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option.today {
64
+ -webkit-text-decoration: underline;
65
+ text-decoration: underline;
66
+ text-decoration-thickness: 2px;
67
+ text-underline-offset: 4px;
68
+ }
69
+ .tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus,
70
+ .tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled) {
71
+ background-color: var(--color-background-screen-hover);
72
+ }
73
+ .tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
74
+ background-color: var(--color-interactive-primary);
75
+ color: var(--color-interactive-contrast);
76
+ }
77
+ .tw-date-lookup-calendar abbr {
78
+ -webkit-text-decoration: none;
79
+ text-decoration: none;
80
+ }
81
+ .tw-date-lookup-header-current-container {
82
+ display: inline;
83
+ }
@@ -1,93 +1,3 @@
1
1
  .tw-date-lookup-menu {
2
2
  width: 400px;
3
3
  }
4
- .tw-date-lookup-calendar {
5
- min-width: 300px;
6
- text-align: center;
7
- table-layout: fixed;
8
- background-color: inherit;
9
- }
10
- .tw-date-lookup-calendar > tbody > tr > td.weekend button {
11
- color: #5d7079;
12
- color: var(--color-content-secondary);
13
- }
14
- .tw-date-lookup-calendar > tbody > tr > td {
15
- padding: 4px;
16
- padding: var(--size-4);
17
- }
18
- @media (max-width: 320px) {
19
- .tw-date-lookup-calendar > tbody > tr > td {
20
- padding: 0;
21
- }
22
- }
23
- .tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
24
- padding: 1px;
25
- }
26
- .tw-date-lookup-calendar > tbody > tr > td button {
27
- width: 100%;
28
- padding: 4px 0;
29
- padding: var(--size-4) 0;
30
- color: #0097c7;
31
- color: var(--color-content-accent);
32
- border: transparent;
33
- border-radius: 10px;
34
- border-radius: var(--radius-small);
35
- background-color: transparent;
36
- font-weight: 600;
37
- font-weight: var(--font-weight-semi-bold);
38
- color: #37517e;
39
- color: var(--color-content-primary);
40
- }
41
- @media (max-width: 320px) {
42
- .tw-date-lookup-calendar > tbody > tr > td button {
43
- padding: 0;
44
- }
45
- }
46
- .tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option {
47
- height: 40px;
48
- height: var(--size-40);
49
- border-radius: 9999px;
50
- border-radius: var(--radius-full);
51
- line-height: 40px;
52
- line-height: var(--size-40);
53
- width: 40px;
54
- width: var(--size-40);
55
- padding: 0;
56
- display: inline-flex;
57
- align-items: center;
58
- justify-content: center;
59
- }
60
- .tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option.today {
61
- -webkit-text-decoration: underline;
62
- text-decoration: underline;
63
- text-decoration-thickness: 2px;
64
- text-underline-offset: 4px;
65
- }
66
- .tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus,
67
- .tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled) {
68
- background-color: var(--color-background-screen-hover);
69
- }
70
- .tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
71
- background-color: var(--color-interactive-primary);
72
- color: var(--color-interactive-contrast);
73
- }
74
- .tw-date-lookup-calendar abbr {
75
- -webkit-text-decoration: none;
76
- text-decoration: none;
77
- }
78
- .tw-date-lookup-header-current-container {
79
- display: inline;
80
- }
81
- .np-theme-personal.tw-date-lookup-menu .table-bordered,
82
- .np-theme-personal .tw-date-lookup-menu .table-bordered {
83
- border: none;
84
- }
85
- .np-theme-personal.tw-date-lookup-menu thead,
86
- .np-theme-personal .tw-date-lookup-menu thead {
87
- background-color: transparent;
88
- background-color: initial;
89
- }
90
- .np-theme-personal.tw-date-lookup-menu td,
91
- .np-theme-personal .tw-date-lookup-menu td {
92
- border: none;
93
- }