@transferwise/components 46.88.2 → 46.89.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/build/actionButton/ActionButton.js.map +1 -1
  2. package/build/actionButton/ActionButton.mjs.map +1 -1
  3. package/build/actionOption/ActionOption.js +19 -3
  4. package/build/actionOption/ActionOption.js.map +1 -1
  5. package/build/actionOption/ActionOption.mjs +19 -3
  6. package/build/actionOption/ActionOption.mjs.map +1 -1
  7. package/build/alert/Alert.js +23 -20
  8. package/build/alert/Alert.js.map +1 -1
  9. package/build/alert/Alert.mjs +20 -17
  10. package/build/alert/Alert.mjs.map +1 -1
  11. package/build/avatar/Avatar.js.map +1 -1
  12. package/build/avatar/Avatar.mjs.map +1 -1
  13. package/build/avatar/avatarTypes.js +3 -1
  14. package/build/avatar/avatarTypes.js.map +1 -1
  15. package/build/avatar/avatarTypes.mjs +3 -1
  16. package/build/avatar/avatarTypes.mjs.map +1 -1
  17. package/build/badge/Badge.js.map +1 -1
  18. package/build/badge/Badge.mjs.map +1 -1
  19. package/build/button/Button.js +2 -2
  20. package/build/button/Button.mjs +2 -2
  21. package/build/button/LegacyButton.js.map +1 -1
  22. package/build/button/LegacyButton.mjs.map +1 -1
  23. package/build/carousel/Carousel.js +9 -8
  24. package/build/carousel/Carousel.js.map +1 -1
  25. package/build/carousel/Carousel.mjs +9 -8
  26. package/build/carousel/Carousel.mjs.map +1 -1
  27. package/build/common/action/Action.js +26 -15
  28. package/build/common/action/Action.js.map +1 -1
  29. package/build/common/action/Action.mjs +26 -15
  30. package/build/common/action/Action.mjs.map +1 -1
  31. package/build/common/closeButton/CloseButton.js +2 -1
  32. package/build/common/closeButton/CloseButton.js.map +1 -1
  33. package/build/common/closeButton/CloseButton.mjs +2 -1
  34. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  35. package/build/criticalBanner/CriticalCommsBanner.js +10 -73
  36. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  37. package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
  38. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  39. package/build/iconButton/IconButton.js +2 -2
  40. package/build/iconButton/IconButton.js.map +1 -1
  41. package/build/iconButton/IconButton.mjs +2 -2
  42. package/build/iconButton/IconButton.mjs.map +1 -1
  43. package/build/link/Link.js +2 -2
  44. package/build/link/Link.mjs +2 -2
  45. package/build/main.css +50 -75
  46. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -0
  47. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -0
  48. package/build/primitives/PrimitiveButton/{src/PrimitiveButton.js → PrimitiveButton.js} +1 -1
  49. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -0
  50. package/build/primitives/PrimitiveButton/{src/PrimitiveButton.mjs → PrimitiveButton.mjs} +1 -1
  51. package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -0
  52. package/build/styles/actionOption/ActionOption.css +4 -0
  53. package/build/styles/alert/Alert.css +4 -0
  54. package/build/styles/carousel/Carousel.css +0 -8
  55. package/build/styles/common/closeButton/CloseButton.css +15 -0
  56. package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -73
  57. package/build/styles/main.css +50 -75
  58. package/build/table/TableCell.js +7 -1
  59. package/build/table/TableCell.js.map +1 -1
  60. package/build/table/TableCell.mjs +7 -1
  61. package/build/table/TableCell.mjs.map +1 -1
  62. package/build/test-utils/assets/wise-card.svg +1 -0
  63. package/build/types/actionButton/ActionButton.d.ts +6 -0
  64. package/build/types/actionButton/ActionButton.d.ts.map +1 -1
  65. package/build/types/actionOption/ActionOption.d.ts +2 -1
  66. package/build/types/actionOption/ActionOption.d.ts.map +1 -1
  67. package/build/types/alert/Alert.d.ts +3 -4
  68. package/build/types/alert/Alert.d.ts.map +1 -1
  69. package/build/types/avatar/Avatar.d.ts +3 -0
  70. package/build/types/avatar/Avatar.d.ts.map +1 -1
  71. package/build/types/avatar/avatarTypes.d.ts +3 -0
  72. package/build/types/avatar/avatarTypes.d.ts.map +1 -1
  73. package/build/types/badge/Badge.d.ts +3 -0
  74. package/build/types/badge/Badge.d.ts.map +1 -1
  75. package/build/types/button/LegacyButton.d.ts +27 -0
  76. package/build/types/button/LegacyButton.d.ts.map +1 -1
  77. package/build/types/carousel/Carousel.d.ts.map +1 -1
  78. package/build/types/common/action/Action.d.ts +5 -2
  79. package/build/types/common/action/Action.d.ts.map +1 -1
  80. package/build/types/common/closeButton/CloseButton.d.ts +3 -3
  81. package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
  82. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  83. package/build/types/iconButton/IconButton.d.ts +2 -2
  84. package/build/types/iconButton/IconButton.d.ts.map +1 -1
  85. package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.d.ts → PrimitiveAnchor.d.ts} +1 -1
  86. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.d.ts.map +1 -0
  87. package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.d.ts → PrimitiveAnchor.types.d.ts} +1 -1
  88. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -0
  89. package/build/types/primitives/PrimitiveAnchor/index.d.ts +2 -2
  90. package/build/types/primitives/PrimitiveAnchor/index.d.ts.map +1 -1
  91. package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.d.ts → PrimitiveButton.d.ts} +1 -1
  92. package/build/types/primitives/PrimitiveButton/PrimitiveButton.d.ts.map +1 -0
  93. package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.types.d.ts → PrimitiveButton.types.d.ts} +1 -1
  94. package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -0
  95. package/build/types/primitives/PrimitiveButton/index.d.ts +2 -2
  96. package/build/types/primitives/PrimitiveButton/index.d.ts.map +1 -1
  97. package/build/types/table/TableCell.d.ts +6 -3
  98. package/build/types/table/TableCell.d.ts.map +1 -1
  99. package/package.json +2 -2
  100. package/src/actionButton/ActionButton.story.tsx +6 -1
  101. package/src/actionButton/ActionButton.tsx +6 -0
  102. package/src/actionOption/ActionOption.css +4 -0
  103. package/src/actionOption/ActionOption.less +5 -0
  104. package/src/actionOption/ActionOption.story.tsx +9 -6
  105. package/src/actionOption/ActionOption.tsx +29 -5
  106. package/src/alert/Alert.css +4 -0
  107. package/src/alert/Alert.less +4 -0
  108. package/src/alert/Alert.spec.tsx +0 -30
  109. package/src/alert/Alert.story.tsx +74 -2
  110. package/src/alert/Alert.tsx +18 -21
  111. package/src/avatar/Avatar.tsx +3 -0
  112. package/src/avatar/avatarTypes.ts +3 -1
  113. package/src/badge/Badge.tsx +3 -0
  114. package/src/button/LegacyButton.tsx +27 -0
  115. package/src/carousel/Carousel.css +0 -8
  116. package/src/carousel/Carousel.less +0 -7
  117. package/src/carousel/Carousel.spec.tsx +2 -2
  118. package/src/carousel/Carousel.tsx +11 -10
  119. package/src/common/action/Action.tsx +40 -22
  120. package/src/common/closeButton/CloseButton.css +15 -0
  121. package/src/common/closeButton/CloseButton.less +10 -0
  122. package/src/common/closeButton/CloseButton.tsx +4 -3
  123. package/src/criticalBanner/CriticalCommsBanner.css +33 -73
  124. package/src/criticalBanner/CriticalCommsBanner.less +37 -64
  125. package/src/criticalBanner/CriticalCommsBanner.story.tsx +26 -4
  126. package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
  127. package/src/iconButton/IconButton.tsx +4 -1
  128. package/src/main.css +50 -75
  129. package/src/main.less +1 -0
  130. package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.tsx → PrimitiveAnchor.tsx} +1 -1
  131. package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.ts → PrimitiveAnchor.types.ts} +1 -1
  132. package/src/primitives/PrimitiveAnchor/index.ts +6 -2
  133. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +1 -1
  134. package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -1
  135. package/src/primitives/PrimitiveButton/{src/PrimitiveButton.tsx → PrimitiveButton.tsx} +2 -2
  136. package/src/primitives/PrimitiveButton/{src/PrimitiveButton.types.ts → PrimitiveButton.types.ts} +1 -1
  137. package/src/primitives/PrimitiveButton/index.ts +6 -2
  138. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +1 -1
  139. package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +1 -1
  140. package/src/table/Table.story.tsx +59 -1
  141. package/src/table/TableCell.spec.tsx +17 -0
  142. package/src/table/TableCell.tsx +14 -5
  143. package/src/test-utils/assets/wise-card.svg +1 -0
  144. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +0 -1
  145. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +0 -1
  146. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +0 -1
  147. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +0 -1
  148. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +0 -1
  149. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +0 -1
  150. package/build/types/primitives/PrimitiveAnchor/src/index.d.ts +0 -3
  151. package/build/types/primitives/PrimitiveAnchor/src/index.d.ts.map +0 -1
  152. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +0 -1
  153. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.types.d.ts.map +0 -1
  154. package/build/types/primitives/PrimitiveButton/src/index.d.ts +0 -3
  155. package/build/types/primitives/PrimitiveButton/src/index.d.ts.map +0 -1
  156. package/src/primitives/PrimitiveAnchor/src/index.ts +0 -6
  157. package/src/primitives/PrimitiveButton/src/index.ts +0 -6
  158. /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.js → PrimitiveAnchor.js} +0 -0
  159. /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.mjs → PrimitiveAnchor.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;MAsBaA,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;QACvBC,MAAI,GAAGC,SAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;AACVC,EAAAA,MAAAA;AAAM,CACW,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;EACtBX,SAAS,KAAKU,IAAI,CAACE,aAAa,CAACC,oBAAQ,CAACb,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMc,IAAI,GAAGV,MAAM,GAAGW,qBAAe,GAAGC,WAAK,CAAA;AAE7C,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbd,SAAS,EAAEe,SAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,wBAAwB,EAAEnB,MAAI,KAAKC,SAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,MAAI,KAAKC,SAAI,CAACmB,KAAAA;KAC3C,EACDhB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1Be,IAAAA,QAAQ,EAAEf,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBF,IAAAA,OAAO,EAAEA,OAAQ;IAAAiB,QAAA,eAEjBN,cAAA,CAACH,IAAI,EAAA;MAACb,IAAI,EAAEA,MAAI,KAAKC,SAAI,CAACsB,KAAK,GAAG,EAAE,GAAG,EAAA;KACzC,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;MAsBaA,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;QACvBC,MAAI,GAAGC,SAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;AACVC,EAAAA,MAAAA;AAAM,CACW,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;EACtBX,SAAS,KAAKU,IAAI,CAACE,aAAa,CAACC,oBAAQ,CAACb,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMc,IAAI,GAAGV,MAAM,GAAGW,qBAAe,GAAGC,WAAK,CAAA;AAE7C,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbd,SAAS,EAAEe,SAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,0BAA0B,EAAEnB,MAAI,KAAKC,SAAI,CAACmB,WAAW;AACrD,MAAA,wBAAwB,EAAEpB,MAAI,KAAKC,SAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,MAAI,KAAKC,SAAI,CAACoB,KAAAA;KAC3C,EACDjB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1BgB,IAAAA,QAAQ,EAAEhB,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBF,IAAAA,OAAO,EAAEA,OAAQ;IAAAkB,QAAA,eAEjBP,cAAA,CAACH,IAAI,EAAA;AAACb,MAAAA,IAAI,EAAEA,MAAI,KAAKC,SAAI,CAACuB,KAAK,IAAIxB,MAAI,KAAKC,SAAI,CAACmB,WAAW,GAAG,EAAE,GAAG,EAAA;KACtE,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
@@ -22,6 +22,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
22
22
  ref: reference,
23
23
  type: "button",
24
24
  className: clsx('np-close-button', 'close btn-link', 'text-no-decoration', {
25
+ 'np-close-button--x-small': size === Size.EXTRA_SMALL,
25
26
  'np-close-button--large': size === Size.MEDIUM,
26
27
  'np-close-button--x-large': size === Size.LARGE
27
28
  }, className),
@@ -31,7 +32,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
31
32
  "data-testid": testId,
32
33
  onClick: onClick,
33
34
  children: /*#__PURE__*/jsx(Icon, {
34
- size: size === Size.SMALL ? 16 : 24
35
+ size: size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24
35
36
  })
36
37
  });
37
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CloseButton.mjs","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;MAsBaA,WAAW,gBAAGC,UAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,IAAI,GAAGC,IAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;AACVC,EAAAA,MAAAA;AAAM,CACW,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;EACtBX,SAAS,KAAKU,IAAI,CAACE,aAAa,CAACC,QAAQ,CAACb,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMc,IAAI,GAAGV,MAAM,GAAGW,eAAe,GAAGC,KAAK,CAAA;AAE7C,EAAA,oBACEC,GAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbd,SAAS,EAAEe,IAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,wBAAwB,EAAEnB,IAAI,KAAKC,IAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,IAAI,KAAKC,IAAI,CAACmB,KAAAA;KAC3C,EACDhB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1Be,IAAAA,QAAQ,EAAEf,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBF,IAAAA,OAAO,EAAEA,OAAQ;IAAAiB,QAAA,eAEjBN,GAAA,CAACH,IAAI,EAAA;MAACb,IAAI,EAAEA,IAAI,KAAKC,IAAI,CAACsB,KAAK,GAAG,EAAE,GAAG,EAAA;KACzC,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"CloseButton.mjs","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disab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;AAEb,CAAC;;;;"}
@@ -1,36 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var icons = require('@transferwise/icons');
4
- var componentsTheming = require('@wise/components-theming');
3
+ var Alert = require('../alert/Alert.js');
5
4
  var clsx = require('clsx');
6
- var avatarTypes = require('../avatar/avatarTypes.js');
7
- var Avatar = require('../avatar/Avatar.js');
8
- var Body = require('../body/Body.js');
9
- var Button_resolver = require('../button/Button.resolver.js');
10
- require('../common/theme.js');
11
- require('../common/direction.js');
12
- var control = require('../common/propsValues/control.js');
13
- require('../common/propsValues/breakpoint.js');
14
- var size = require('../common/propsValues/size.js');
15
- var typography = require('../common/propsValues/typography.js');
16
- require('../common/propsValues/width.js');
17
- require('../common/propsValues/type.js');
18
- require('../common/propsValues/dateMode.js');
19
- require('../common/propsValues/monthFormat.js');
20
- require('../common/propsValues/position.js');
21
- require('../common/propsValues/layouts.js');
22
- require('../common/propsValues/status.js');
23
- require('../common/propsValues/sentiment.js');
24
- require('../common/propsValues/profileType.js');
25
- require('../common/propsValues/variant.js');
26
- require('../common/propsValues/scroll.js');
27
- require('../common/propsValues/markdownNodeType.js');
28
- require('../common/fileType.js');
29
- require('react');
30
- require('react-intl');
31
- require('../common/closeButton/CloseButton.messages.js');
32
5
  var jsxRuntime = require('react/jsx-runtime');
33
- var Title = require('../title/Title.js');
34
6
 
35
7
  function CriticalCommsBanner({
36
8
  title,
@@ -38,52 +10,17 @@ function CriticalCommsBanner({
38
10
  action,
39
11
  className
40
12
  }) {
41
- const {
42
- isModern
43
- } = componentsTheming.useTheme();
44
13
  return /*#__PURE__*/jsxRuntime.jsx("div", {
45
14
  className: clsx.clsx('critical-comms', className),
46
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
47
- className: "critical-comms-body",
48
- children: [/*#__PURE__*/jsxRuntime.jsx(Avatar, {
49
- size: size.Size.MEDIUM,
50
- type: avatarTypes.AvatarType.ICON,
51
- className: clsx.clsx(isModern ? 'm-r-2' : 'm-r-1'),
52
- backgroundColor: isModern ? 'var(--color-sentiment-negative)' : 'var(--color-background-negative)',
53
- children: isModern ? /*#__PURE__*/jsxRuntime.jsx(icons.AlertCircleFill, {}) : /*#__PURE__*/jsxRuntime.jsx(icons.Alert, {
54
- size: 24
55
- })
56
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
57
- className: "critical-comms-content d-flex align-items-center flex-grow-1",
58
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
59
- className: clsx.clsx('flex-grow-1', {
60
- 'p-x-2': !isModern
61
- }),
62
- children: [/*#__PURE__*/jsxRuntime.jsx(Title, {
63
- type: isModern ? typography.Typography.TITLE_BODY : typography.Typography.TITLE_GROUP,
64
- className: "critical-comms--title",
65
- children: title
66
- }), /*#__PURE__*/jsxRuntime.jsx(Body, {
67
- className: "critical-comms--subtitle",
68
- children: subtitle
69
- })]
70
- }), action ? /*#__PURE__*/jsxRuntime.jsx("div", {
71
- className: "critical-comms--cta",
72
- children: /*#__PURE__*/jsxRuntime.jsx(Button_resolver, {
73
- block: isModern,
74
- size: size.Size.SMALL,
75
- type: control.ControlType.NEGATIVE,
76
- priority: isModern ? control.Priority.SECONDARY : control.Priority.PRIMARY,
77
- className: "cta-btn",
78
- onClick: () => {
79
- if (action) {
80
- window.location.href = action.href;
81
- }
82
- },
83
- children: action.label
84
- })
85
- }) : null]
86
- })]
15
+ children: /*#__PURE__*/jsxRuntime.jsx(Alert.default, {
16
+ title: title,
17
+ message: subtitle,
18
+ action: {
19
+ target: action?.href,
20
+ text: action?.label
21
+ },
22
+ className: className,
23
+ type: "warning"
87
24
  })
88
25
  });
89
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as DangerIcon, AlertCircleFill } from '@transferwise/icons';\nimport { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\n\nimport Avatar, { AvatarType } from '../avatar';\nimport Body from '../body';\nimport Button from '../button';\nimport { ControlType, Priority, Size, Typography } from '../common';\nimport Title from '../title';\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href: string;\n };\n className?: string;\n};\n\nfunction CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {\n const { isModern } = useTheme();\n return (\n <div className={clsx('critical-comms', className)}>\n <div className=\"critical-comms-body\">\n <Avatar\n size={Size.MEDIUM}\n type={AvatarType.ICON}\n className={clsx(isModern ? 'm-r-2' : 'm-r-1')}\n backgroundColor={\n isModern ? 'var(--color-sentiment-negative)' : 'var(--color-background-negative)'\n }\n >\n {isModern ? <AlertCircleFill /> : <DangerIcon size={24} />}\n </Avatar>\n <div className=\"critical-comms-content d-flex align-items-center flex-grow-1\">\n <div className={clsx('flex-grow-1', { 'p-x-2': !isModern })}>\n <Title\n type={isModern ? Typography.TITLE_BODY : Typography.TITLE_GROUP}\n className=\"critical-comms--title\"\n >\n {title}\n </Title>\n <Body className=\"critical-comms--subtitle\">{subtitle}</Body>\n </div>\n {action ? (\n <div className=\"critical-comms--cta\">\n <Button\n block={isModern}\n size={Size.SMALL}\n type={ControlType.NEGATIVE}\n priority={isModern ? Priority.SECONDARY : Priority.PRIMARY}\n className=\"cta-btn\"\n onClick={() => {\n if (action) {\n window.location.href = action.href;\n }\n }}\n >\n {action.label}\n </Button>\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["CriticalCommsBanner","title","subtitle","action","className","isModern","useTheme","_jsx","clsx","children","_jsxs","Avatar","size","Size","MEDIUM","type","AvatarType","ICON","backgroundColor","AlertCircleFill","DangerIcon","Title","Typography","TITLE_BODY","TITLE_GROUP","Body","Button","block","SMALL","ControlType","NEGATIVE","priority","Priority","SECONDARY","PRIMARY","onClick","window","location","href","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC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A;AAACrB,YAAAA,SAAS,EAAC,0BAA0B;AAAAK,YAAAA,QAAA,EAAEP,QAAAA;AAAQ,WAAO,CAC7D,CAAA;AAAA,SAAK,CACL,EAACC,MAAM,gBACLI,cAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,qBAAqB;UAAAK,QAAA,eAClCF,cAAA,CAACmB,eAAM,EAAA;AACLC,YAAAA,KAAK,EAAEtB,QAAS;YAChBO,IAAI,EAAEC,SAAI,CAACe,KAAM;YACjBb,IAAI,EAAEc,mBAAW,CAACC,QAAS;YAC3BC,QAAQ,EAAE1B,QAAQ,GAAG2B,gBAAQ,CAACC,SAAS,GAAGD,gBAAQ,CAACE,OAAQ;AAC3D9B,YAAAA,SAAS,EAAC,SAAS;YACnB+B,OAAO,EAAEA,MAAK;AACZ,cAAA,IAAIhC,MAAM,EAAE;AACViC,gBAAAA,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAGnC,MAAM,CAACmC,IAAI,CAAA;AACpC,eAAA;aACA;YAAA7B,QAAA,EAEDN,MAAM,CAACoC,KAAAA;WACF,CAAA;SACL,CAAC,GACJ,IAAI,CAAA;AAAA,OACL,CACP,CAAA;KAAK,CAAA;AACP,GAAK,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import Alert from '../alert';\nimport { clsx } from 'clsx';\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href: string;\n };\n className?: string;\n};\n\nfunction CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {\n return (\n <div className={clsx('critical-comms', className)}>\n <Alert\n title={title}\n message={subtitle}\n action={{ target: action?.href, text: action?.label }}\n className={className}\n type=\"warning\"\n />\n </div>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["CriticalCommsBanner","title","subtitle","action","className","_jsx","clsx","children","Alert","message","target","href","text","label","type"],"mappings":";;;;;;AAaA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;AAAEC,EAAAA,SAAAA;AAAqC,CAAA,EAAA;AAC3F,EAAA,oBACEC,cAAA,CAAA,KAAA,EAAA;AAAKD,IAAAA,SAAS,EAAEE,SAAI,CAAC,gBAAgB,EAAEF,SAAS,CAAE;IAAAG,QAAA,eAChDF,cAAA,CAACG,aAAK,EAAA;AACJP,MAAAA,KAAK,EAAEA,KAAM;AACbQ,MAAAA,OAAO,EAAEP,QAAS;AAClBC,MAAAA,MAAM,EAAE;QAAEO,MAAM,EAAEP,MAAM,EAAEQ,IAAI;QAAEC,IAAI,EAAET,MAAM,EAAEU,KAAAA;OAAQ;AACtDT,MAAAA,SAAS,EAAEA,SAAU;AACrBU,MAAAA,IAAI,EAAC,SAAA;KAET,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
@@ -1,34 +1,6 @@
1
- import { AlertCircleFill, Alert } from '@transferwise/icons';
2
- import { useTheme } from '@wise/components-theming';
1
+ import Alert from '../alert/Alert.mjs';
3
2
  import { clsx } from 'clsx';
4
- import { AvatarType } from '../avatar/avatarTypes.mjs';
5
- import Avatar from '../avatar/Avatar.mjs';
6
- import Body from '../body/Body.mjs';
7
- import Button from '../button/Button.resolver.mjs';
8
- import '../common/theme.mjs';
9
- import '../common/direction.mjs';
10
- import { ControlType, Priority } from '../common/propsValues/control.mjs';
11
- import '../common/propsValues/breakpoint.mjs';
12
- import { Size } from '../common/propsValues/size.mjs';
13
- import { Typography } from '../common/propsValues/typography.mjs';
14
- import '../common/propsValues/width.mjs';
15
- import '../common/propsValues/type.mjs';
16
- import '../common/propsValues/dateMode.mjs';
17
- import '../common/propsValues/monthFormat.mjs';
18
- import '../common/propsValues/position.mjs';
19
- import '../common/propsValues/layouts.mjs';
20
- import '../common/propsValues/status.mjs';
21
- import '../common/propsValues/sentiment.mjs';
22
- import '../common/propsValues/profileType.mjs';
23
- import '../common/propsValues/variant.mjs';
24
- import '../common/propsValues/scroll.mjs';
25
- import '../common/propsValues/markdownNodeType.mjs';
26
- import '../common/fileType.mjs';
27
- import 'react';
28
- import 'react-intl';
29
- import '../common/closeButton/CloseButton.messages.mjs';
30
- import { jsx, jsxs } from 'react/jsx-runtime';
31
- import Title from '../title/Title.mjs';
3
+ import { jsx } from 'react/jsx-runtime';
32
4
 
33
5
  function CriticalCommsBanner({
34
6
  title,
@@ -36,52 +8,17 @@ function CriticalCommsBanner({
36
8
  action,
37
9
  className
38
10
  }) {
39
- const {
40
- isModern
41
- } = useTheme();
42
11
  return /*#__PURE__*/jsx("div", {
43
12
  className: clsx('critical-comms', className),
44
- children: /*#__PURE__*/jsxs("div", {
45
- className: "critical-comms-body",
46
- children: [/*#__PURE__*/jsx(Avatar, {
47
- size: Size.MEDIUM,
48
- type: AvatarType.ICON,
49
- className: clsx(isModern ? 'm-r-2' : 'm-r-1'),
50
- backgroundColor: isModern ? 'var(--color-sentiment-negative)' : 'var(--color-background-negative)',
51
- children: isModern ? /*#__PURE__*/jsx(AlertCircleFill, {}) : /*#__PURE__*/jsx(Alert, {
52
- size: 24
53
- })
54
- }), /*#__PURE__*/jsxs("div", {
55
- className: "critical-comms-content d-flex align-items-center flex-grow-1",
56
- children: [/*#__PURE__*/jsxs("div", {
57
- className: clsx('flex-grow-1', {
58
- 'p-x-2': !isModern
59
- }),
60
- children: [/*#__PURE__*/jsx(Title, {
61
- type: isModern ? Typography.TITLE_BODY : Typography.TITLE_GROUP,
62
- className: "critical-comms--title",
63
- children: title
64
- }), /*#__PURE__*/jsx(Body, {
65
- className: "critical-comms--subtitle",
66
- children: subtitle
67
- })]
68
- }), action ? /*#__PURE__*/jsx("div", {
69
- className: "critical-comms--cta",
70
- children: /*#__PURE__*/jsx(Button, {
71
- block: isModern,
72
- size: Size.SMALL,
73
- type: ControlType.NEGATIVE,
74
- priority: isModern ? Priority.SECONDARY : Priority.PRIMARY,
75
- className: "cta-btn",
76
- onClick: () => {
77
- if (action) {
78
- window.location.href = action.href;
79
- }
80
- },
81
- children: action.label
82
- })
83
- }) : null]
84
- })]
13
+ children: /*#__PURE__*/jsx(Alert, {
14
+ title: title,
15
+ message: subtitle,
16
+ action: {
17
+ target: action?.href,
18
+ text: action?.label
19
+ },
20
+ className: className,
21
+ type: "warning"
85
22
  })
86
23
  });
87
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as DangerIcon, AlertCircleFill } from '@transferwise/icons';\nimport { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\n\nimport Avatar, { AvatarType } from '../avatar';\nimport Body from '../body';\nimport Button from '../button';\nimport { ControlType, Priority, Size, Typography } from '../common';\nimport Title from '../title';\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href: string;\n };\n className?: string;\n};\n\nfunction CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {\n const { isModern } = useTheme();\n return (\n <div className={clsx('critical-comms', className)}>\n <div className=\"critical-comms-body\">\n <Avatar\n size={Size.MEDIUM}\n type={AvatarType.ICON}\n className={clsx(isModern ? 'm-r-2' : 'm-r-1')}\n backgroundColor={\n isModern ? 'var(--color-sentiment-negative)' : 'var(--color-background-negative)'\n }\n >\n {isModern ? <AlertCircleFill /> : <DangerIcon size={24} />}\n </Avatar>\n <div className=\"critical-comms-content d-flex align-items-center flex-grow-1\">\n <div className={clsx('flex-grow-1', { 'p-x-2': !isModern })}>\n <Title\n type={isModern ? Typography.TITLE_BODY : Typography.TITLE_GROUP}\n className=\"critical-comms--title\"\n >\n {title}\n </Title>\n <Body className=\"critical-comms--subtitle\">{subtitle}</Body>\n </div>\n {action ? (\n <div className=\"critical-comms--cta\">\n <Button\n block={isModern}\n size={Size.SMALL}\n type={ControlType.NEGATIVE}\n priority={isModern ? Priority.SECONDARY : Priority.PRIMARY}\n className=\"cta-btn\"\n onClick={() => {\n if (action) {\n window.location.href = action.href;\n }\n }}\n >\n {action.label}\n </Button>\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["CriticalCommsBanner","title","subtitle","action","className","isModern","useTheme","_jsx","clsx","children","_jsxs","Avatar","size","Size","MEDIUM","type","AvatarType","ICON","backgroundColor","AlertCircleFill","DangerIcon","Title","Typography","TITLE_BODY","TITLE_GROUP","Body","Button","block","SMALL","ControlType","NEGATIVE","priority","Priority","SECONDARY","PRIMARY","onClick","window","location","href","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;AAAEC,EAAAA,SAAAA;AAAqC,CAAA,EAAA;EAC3F,MAAM;AAAEC,IAAAA,QAAAA;GAAU,GAAGC,QAAQ,EAAE,CAAA;AAC/B,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AAAKH,IAAAA,SAAS,EAAEI,IAAI,CAAC,gBAAgB,EAAEJ,SAAS,CAAE;AAAAK,IAAAA,QAAA,eAChDC,IAAA,CAAA,KAAA,EAAA;AAAKN,MAAAA,SAAS,EAAC,qBAAqB;MAAAK,QAAA,EAAA,cAClCF,GAAA,CAACI,MAAM,EAAA;QACLC,IAAI,EAAEC,IAAI,CAACC,MAAO;QAClBC,IAAI,EAAEC,UAAU,CAACC,IAAK;QACtBb,SAAS,EAAEI,IAAI,CAACH,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAE;AAC9Ca,QAAAA,eAAe,EACbb,QAAQ,GAAG,iCAAiC,GAAG,kCAChD;QAAAI,QAAA,EAEAJ,QAAQ,gBAAGE,GAAA,CAACY,eAAe,EAAA,EAAG,CAAA,gBAAGZ,GAAA,CAACa,KAAU,EAAA;AAACR,UAAAA,IAAI,EAAE,EAAA;SAAG,CAAA;OACjD,CACR,eAAAF,IA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AAEV;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import Alert from '../alert';\nimport { clsx } from 'clsx';\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href: string;\n };\n className?: string;\n};\n\nfunction CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {\n return (\n <div className={clsx('critical-comms', className)}>\n <Alert\n title={title}\n message={subtitle}\n action={{ target: action?.href, text: action?.label }}\n className={className}\n type=\"warning\"\n />\n </div>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["CriticalCommsBanner","title","subtitle","action","className","_jsx","clsx","children","Alert","message","target","href","text","label","type"],"mappings":";;;;AAaA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;AAAEC,EAAAA,SAAAA;AAAqC,CAAA,EAAA;AAC3F,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AAAKD,IAAAA,SAAS,EAAEE,IAAI,CAAC,gBAAgB,EAAEF,SAAS,CAAE;IAAAG,QAAA,eAChDF,GAAA,CAACG,KAAK,EAAA;AACJP,MAAAA,KAAK,EAAEA,KAAM;AACbQ,MAAAA,OAAO,EAAEP,QAAS;AAClBC,MAAAA,MAAM,EAAE;QAAEO,MAAM,EAAEP,MAAM,EAAEQ,IAAI;QAAEC,IAAI,EAAET,MAAM,EAAEU,KAAAA;OAAQ;AACtDT,MAAAA,SAAS,EAAEA,SAAU;AACrBU,MAAAA,IAAI,EAAC,SAAA;KAET,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var PrimitiveButton = require('../primitives/PrimitiveButton/src/PrimitiveButton.js');
5
- var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/src/PrimitiveAnchor.js');
4
+ var PrimitiveButton = require('../primitives/PrimitiveButton/PrimitiveButton.js');
5
+ var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
6
6
  var Circle = require('../common/circle/Circle.js');
7
7
  var clsx = require('clsx');
8
8
  var jsxRuntime = require('react/jsx-runtime');
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.js","sources":["../../src/iconButton/IconButton.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef, HTMLAttributes } from 'react';\nimport { PrimitiveAnchor, PrimitiveButton } from '../primitives';\nimport Circle from '../common/circle';\nimport { clsx } from 'clsx';\n\nexport type Props = {\n size?: 16 | 24 | 32 | 40 | 48 | 56 | 72;\n priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal';\n type?: 'default' | 'negative';\n 'data-testid'?: string;\n} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> &\n Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> &\n Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'role' | 'children' | 'aria-label'>;\n\nconst IconButton = forwardRef(function IconButton(\n {\n size = 48,\n href = '#',\n children,\n className,\n priority = 'primary',\n type = 'default',\n ...props\n }: Props,\n ref,\n) {\n const isLink = href !== '#';\n return (\n // @ts-expect-error it's either link or `button` element so it has `onClick` / `href`\n <Circle\n ref={ref}\n as={isLink ? PrimitiveAnchor : PrimitiveButton}\n size={size}\n fixedSize\n className={clsx(\n 'np-icon-button',\n `np-icon-button-${priority}-${type}`,\n {\n disabled: props.disabled,\n },\n className,\n )}\n {...(isLink ? { href } : {})}\n {...props}\n >\n {children}\n </Circle>\n );\n});\n\nexport default IconButton;\n"],"names":["IconButton","forwardRef","size","href","children","className","priority","type","props","ref","isLink","_jsx","Circle","as","PrimitiveAnchor","PrimitiveButton","fixedSize","clsx","disabled"],"mappings":";;;;;;;;;AAcA,MAAMA,UAAU,gBAAGC,gBAAU,CAAC,SAASD,UAAUA,CAC/C;AACEE,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,IAAI,GAAG,GAAG;EACVC,QAAQ;EACRC,SAAS;AACTC,EAAAA,QAAQ,GAAG,SAAS;AACpBC,EAAAA,IAAI,GAAG,SAAS;EAChB,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;AAEH,EAAA,MAAMC,MAAM,GAAGP,IAAI,KAAK,GAAG,CAAA;AAC3B,EAAA;AAAA;AACE;AACAQ,IAAAA,cAAA,CAACC,MAAM,EAAA;AACLH,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,EAAE,EAAEH,MAAM,GAAGI,eAAe,GAAGC,eAAgB;AAC/Cb,MAAAA,IAAI,EAAEA,IAAK;MACXc,SAAS,EAAA,IAAA;MACTX,SAAS,EAAEY,SAAI,CACb,gBAAgB,EAChB,kBAAkBX,QAAQ,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAE,EACpC;QACEW,QAAQ,EAAEV,KAAK,CAACU,QAAAA;OACjB,EACDb,SAAS,CACT;AAAA,MAAA,IACGK,MAAM,GAAG;AAAEP,QAAAA,IAAAA;OAAM,GAAG,EAAE,CAAA;AAAA,MAAA,GACvBK,KAAK;AAAAJ,MAAAA,QAAA,EAERA,QAAAA;KACK,CAAA;AAAC,IAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"IconButton.js","sources":["../../src/iconButton/IconButton.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef, HTMLAttributes } from 'react';\nimport { PrimitiveAnchor, PrimitiveButton } from '../primitives';\nimport Circle from '../common/circle';\nimport { clsx } from 'clsx';\n\nexport type Props = {\n size?: 16 | 24 | 32 | 40 | 48 | 56 | 72;\n priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal';\n type?: 'default' | 'negative';\n 'data-testid'?: string;\n} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> &\n Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> &\n Pick<\n HTMLAttributes<HTMLDivElement>,\n 'className' | 'role' | 'children' | 'aria-label' | 'tabIndex'\n >;\n\nconst IconButton = forwardRef(function IconButton(\n {\n size = 48,\n href = '#',\n children,\n className,\n priority = 'primary',\n type = 'default',\n ...props\n }: Props,\n ref,\n) {\n const isLink = href !== '#';\n return (\n // @ts-expect-error it's either link or `button` element so it has `onClick` / `href`\n <Circle\n ref={ref}\n as={isLink ? PrimitiveAnchor : PrimitiveButton}\n size={size}\n fixedSize\n className={clsx(\n 'np-icon-button',\n `np-icon-button-${priority}-${type}`,\n {\n disabled: props.disabled,\n },\n className,\n )}\n {...(isLink ? { href } : {})}\n {...props}\n >\n {children}\n </Circle>\n );\n});\n\nexport default IconButton;\n"],"names":["IconButton","forwardRef","size","href","children","className","priority","type","props","ref","isLink","_jsx","Circle","as","PrimitiveAnchor","PrimitiveButton","fixedSize","clsx","disabled"],"mappings":";;;;;;;;;AAiBA,MAAMA,UAAU,gBAAGC,gBAAU,CAAC,SAASD,UAAUA,CAC/C;AACEE,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,IAAI,GAAG,GAAG;EACVC,QAAQ;EACRC,SAAS;AACTC,EAAAA,QAAQ,GAAG,SAAS;AACpBC,EAAAA,IAAI,GAAG,SAAS;EAChB,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;AAEH,EAAA,MAAMC,MAAM,GAAGP,IAAI,KAAK,GAAG,CAAA;AAC3B,EAAA;AAAA;AACE;AACAQ,IAAAA,cAAA,CAACC,MAAM,EAAA;AACLH,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,EAAE,EAAEH,MAAM,GAAGI,eAAe,GAAGC,eAAgB;AAC/Cb,MAAAA,IAAI,EAAEA,IAAK;MACXc,SAAS,EAAA,IAAA;MACTX,SAAS,EAAEY,SAAI,CACb,gBAAgB,EAChB,kBAAkBX,QAAQ,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAE,EACpC;QACEW,QAAQ,EAAEV,KAAK,CAACU,QAAAA;OACjB,EACDb,SAAS,CACT;AAAA,MAAA,IACGK,MAAM,GAAG;AAAEP,QAAAA,IAAAA;OAAM,GAAG,EAAE,CAAA;AAAA,MAAA,GACvBK,KAAK;AAAAJ,MAAAA,QAAA,EAERA,QAAAA;KACK,CAAA;AAAC,IAAA;AAEb,CAAC;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
- import PrimitiveButton from '../primitives/PrimitiveButton/src/PrimitiveButton.mjs';
3
- import PrimitiveAnchor from '../primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs';
2
+ import PrimitiveButton from '../primitives/PrimitiveButton/PrimitiveButton.mjs';
3
+ import PrimitiveAnchor from '../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
4
4
  import Circle from '../common/circle/Circle.mjs';
5
5
  import { clsx } from 'clsx';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.mjs","sources":["../../src/iconButton/IconButton.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef, HTMLAttributes } from 'react';\nimport { PrimitiveAnchor, PrimitiveButton } from '../primitives';\nimport Circle from '../common/circle';\nimport { clsx } from 'clsx';\n\nexport type Props = {\n size?: 16 | 24 | 32 | 40 | 48 | 56 | 72;\n priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal';\n type?: 'default' | 'negative';\n 'data-testid'?: string;\n} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> &\n Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> &\n Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'role' | 'children' | 'aria-label'>;\n\nconst IconButton = forwardRef(function IconButton(\n {\n size = 48,\n href = '#',\n children,\n className,\n priority = 'primary',\n type = 'default',\n ...props\n }: Props,\n ref,\n) {\n const isLink = href !== '#';\n return (\n // @ts-expect-error it's either link or `button` element so it has `onClick` / `href`\n <Circle\n ref={ref}\n as={isLink ? PrimitiveAnchor : PrimitiveButton}\n size={size}\n fixedSize\n className={clsx(\n 'np-icon-button',\n `np-icon-button-${priority}-${type}`,\n {\n disabled: props.disabled,\n },\n className,\n )}\n {...(isLink ? { href } : {})}\n {...props}\n >\n {children}\n </Circle>\n );\n});\n\nexport default IconButton;\n"],"names":["IconButton","forwardRef","size","href","children","className","priority","type","props","ref","isLink","_jsx","Circle","as","PrimitiveAnchor","PrimitiveButton","fixedSize","clsx","disabled"],"mappings":";;;;;;;AAcA,MAAMA,UAAU,gBAAGC,UAAU,CAAC,SAASD,UAAUA,CAC/C;AACEE,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,IAAI,GAAG,GAAG;EACVC,QAAQ;EACRC,SAAS;AACTC,EAAAA,QAAQ,GAAG,SAAS;AACpBC,EAAAA,IAAI,GAAG,SAAS;EAChB,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;AAEH,EAAA,MAAMC,MAAM,GAAGP,IAAI,KAAK,GAAG,CAAA;AAC3B,EAAA;AAAA;AACE;AACAQ,IAAAA,GAAA,CAACC,MAAM,EAAA;AACLH,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,EAAE,EAAEH,MAAM,GAAGI,eAAe,GAAGC,eAAgB;AAC/Cb,MAAAA,IAAI,EAAEA,IAAK;MACXc,SAAS,EAAA,IAAA;MACTX,SAAS,EAAEY,IAAI,CACb,gBAAgB,EAChB,kBAAkBX,QAAQ,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAE,EACpC;QACEW,QAAQ,EAAEV,KAAK,CAACU,QAAAA;OACjB,EACDb,SAAS,CACT;AAAA,MAAA,IACGK,MAAM,GAAG;AAAEP,QAAAA,IAAAA;OAAM,GAAG,EAAE,CAAA;AAAA,MAAA,GACvBK,KAAK;AAAAJ,MAAAA,QAAA,EAERA,QAAAA;KACK,CAAA;AAAC,IAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"IconButton.mjs","sources":["../../src/iconButton/IconButton.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef, HTMLAttributes } from 'react';\nimport { PrimitiveAnchor, PrimitiveButton } from '../primitives';\nimport Circle from '../common/circle';\nimport { clsx } from 'clsx';\n\nexport type Props = {\n size?: 16 | 24 | 32 | 40 | 48 | 56 | 72;\n priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal';\n type?: 'default' | 'negative';\n 'data-testid'?: string;\n} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> &\n Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> &\n Pick<\n HTMLAttributes<HTMLDivElement>,\n 'className' | 'role' | 'children' | 'aria-label' | 'tabIndex'\n >;\n\nconst IconButton = forwardRef(function IconButton(\n {\n size = 48,\n href = '#',\n children,\n className,\n priority = 'primary',\n type = 'default',\n ...props\n }: Props,\n ref,\n) {\n const isLink = href !== '#';\n return (\n // @ts-expect-error it's either link or `button` element so it has `onClick` / `href`\n <Circle\n ref={ref}\n as={isLink ? PrimitiveAnchor : PrimitiveButton}\n size={size}\n fixedSize\n className={clsx(\n 'np-icon-button',\n `np-icon-button-${priority}-${type}`,\n {\n disabled: props.disabled,\n },\n className,\n )}\n {...(isLink ? { href } : {})}\n {...props}\n >\n {children}\n </Circle>\n );\n});\n\nexport default IconButton;\n"],"names":["IconButton","forwardRef","size","href","children","className","priority","type","props","ref","isLink","_jsx","Circle","as","PrimitiveAnchor","PrimitiveButton","fixedSize","clsx","disabled"],"mappings":";;;;;;;AAiBA,MAAMA,UAAU,gBAAGC,UAAU,CAAC,SAASD,UAAUA,CAC/C;AACEE,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,IAAI,GAAG,GAAG;EACVC,QAAQ;EACRC,SAAS;AACTC,EAAAA,QAAQ,GAAG,SAAS;AACpBC,EAAAA,IAAI,GAAG,SAAS;EAChB,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;AAEH,EAAA,MAAMC,MAAM,GAAGP,IAAI,KAAK,GAAG,CAAA;AAC3B,EAAA;AAAA;AACE;AACAQ,IAAAA,GAAA,CAACC,MAAM,EAAA;AACLH,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,EAAE,EAAEH,MAAM,GAAGI,eAAe,GAAGC,eAAgB;AAC/Cb,MAAAA,IAAI,EAAEA,IAAK;MACXc,SAAS,EAAA,IAAA;MACTX,SAAS,EAAEY,IAAI,CACb,gBAAgB,EAChB,kBAAkBX,QAAQ,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAE,EACpC;QACEW,QAAQ,EAAEV,KAAK,CAACU,QAAAA;OACjB,EACDb,SAAS,CACT;AAAA,MAAA,IACGK,MAAM,GAAG;AAAEP,QAAAA,IAAAA;OAAM,GAAG,EAAE,CAAA;AAAA,MAAA,GACvBK,KAAK;AAAAJ,MAAAA,QAAA,EAERA,QAAAA;KACK,CAAA;AAAC,IAAA;AAEb,CAAC;;;;"}
@@ -3,8 +3,8 @@
3
3
  var icons = require('@transferwise/icons');
4
4
  var clsx = require('clsx');
5
5
  var reactIntl = require('react-intl');
6
- require('../primitives/PrimitiveButton/src/PrimitiveButton.js');
7
- var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/src/PrimitiveAnchor.js');
6
+ require('../primitives/PrimitiveButton/PrimitiveButton.js');
7
+ var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
8
8
  var Link_messages = require('./Link.messages.js');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
@@ -1,8 +1,8 @@
1
1
  import { NavigateAway } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
3
  import { useIntl } from 'react-intl';
4
- import '../primitives/PrimitiveButton/src/PrimitiveButton.mjs';
5
- import PrimitiveAnchor from '../primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs';
4
+ import '../primitives/PrimitiveButton/PrimitiveButton.mjs';
5
+ import PrimitiveAnchor from '../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
6
6
  import messages from './Link.messages.mjs';
7
7
  import { jsxs, jsx } from 'react/jsx-runtime';
8
8
 
package/build/main.css CHANGED
@@ -1,77 +1,37 @@
1
- div.critical-comms {
2
- --critical-comms-background-color: var(--color-background-negative);
3
- --critical-comms-title-color: var(--color-content-negative);
4
- --critical-comms-subtitle-color: var(--color-content-secondary);
5
- --critical-comms-subtitle-color-padding-left: var(--size-16);
6
- --critical-comms-vertical-spacing: var(--size-8);
7
- background-color: rgba(255,135,135,0.10196);
8
- background-color: var(--critical-comms-background-color);
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
- }
13
- .np-theme-personal div.critical-comms,
14
- .np-theme-personal--dark div.critical-comms {
15
- --critical-comms-background-color: var(--color-sentiment-negative);
16
- --critical-comms-title-color: var(--color-contrast);
17
- --critical-comms-subtitle-color: var(--color-contrast);
18
- --critical-comms-subtitle-color-padding-left: 0;
19
- --critical-comms-vertical-spacing: var(--size-16);
20
- padding: 24px;
21
- padding: var(--padding-medium);
22
- }
23
- .np-theme-personal div.critical-comms .tw-icon-alert-circle-fill,
24
- .np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill {
25
- color: var(--color-contrast);
26
- }
27
- .np-theme-personal div.critical-comms .tw-icon-alert-circle-fill svg,
28
- .np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill svg {
29
- width: 48px;
30
- height: 48px;
31
- }
32
- .np-theme-personal div.critical-comms .cta-btn,
33
- .np-theme-personal--dark div.critical-comms .cta-btn {
34
- background-color: var(--color-contrast);
35
- }
36
- .np-theme-personal div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus,
37
- .np-theme-personal--dark div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus {
38
- outline-color: var(--color-contrast);
39
- }
40
- @media (max-width: 767px) {
41
- div.critical-comms {
42
- display: inline;
43
- display: initial;
44
- }
1
+ .np-theme-personal .critical-comms .alert-warning {
2
+ color: var(--color-contrast-overlay);
3
+ background-color: var(--color-sentiment-negative);
45
4
  }
46
- div.critical-comms .critical-comms--title {
47
- color: var(--critical-comms-title-color);
5
+ .np-theme-personal .critical-comms .alert-warning .np-text-title-body {
6
+ color: var(--color-contrast-overlay);
48
7
  }
49
- div.critical-comms .critical-comms--subtitle {
50
- color: var(--critical-comms-subtitle-color);
8
+ .np-theme-personal .critical-comms .status-circle.warning {
9
+ background-color: #ffffff;
10
+ background-color: var(--color-background-screen);
51
11
  }
52
- div.critical-comms .critical-comms--cta {
53
- padding-left: 0;
12
+ .np-theme-personal .critical-comms .status-circle.warning .status-icon {
13
+ color: var(--color-contrast-theme);
54
14
  }
55
- @media (max-width: 767px) {
56
- div.critical-comms .critical-comms--cta {
57
- padding-left: var(--critical-comms-subtitle-color-padding-left);
58
- padding-top: var(--critical-comms-vertical-spacing);
59
- min-width: 100%;
60
- }
15
+ .np-theme-personal .critical-comms .alert__message .alert__action {
16
+ margin-top: 16px;
17
+ margin-top: var(--size-16);
61
18
  }
62
- div.critical-comms .critical-comms-body {
63
- display: flex;
64
- width: 100%;
19
+ .np-theme-personal .critical-comms .wds-Button {
20
+ --Button-background: var(--color-contrast-overlay);
21
+ --Button-background-hover: var(--color-sentiment-negative-secondary-hover);
22
+ --Button-background-active: var(--color-sentiment-negative-secondary-active);
65
23
  }
66
- @media (max-width: 767px) {
67
- div.critical-comms .critical-comms-body {
68
- flex-direction: column;
24
+ @media (min-width: 768px) {
25
+ .np-theme-personal .critical-comms .alert-warning .alert__message {
26
+ flex-direction: row;
27
+ justify-content: space-between;
28
+ align-items: center;
29
+ width: 100%;
69
30
  }
70
- }
71
- @media (max-width: 767px) {
72
- div.critical-comms .critical-comms-content {
73
- padding-top: var(--critical-comms-vertical-spacing);
74
- flex-wrap: wrap;
31
+ .np-theme-personal .critical-comms .alert-warning .alert__message .alert__action {
32
+ margin-top: 0;
33
+ margin-left: 16px;
34
+ margin-left: var(--padding-small);
75
35
  }
76
36
  }
77
37
  .tw-date-lookup-calendar > tbody > tr > td.weekend button {
@@ -216,9 +176,17 @@ div.critical-comms .critical-comms-body {
216
176
  .np-action-btn:not(:disabled):focus {
217
177
  box-shadow: none;
218
178
  }
179
+ .tw-action-option .wds-Button--tertiary:hover {
180
+ background-color: transparent;
181
+ background-color: initial;
182
+ }
219
183
  .wds-alert__liveRegion {
220
184
  display: contents;
221
185
  }
186
+ .alert__close {
187
+ min-width: 48px;
188
+ min-width: var(--size-48);
189
+ }
222
190
  .tw-avatar {
223
191
  position: relative;
224
192
  border-radius: 50%;
@@ -1154,14 +1122,6 @@ div.critical-comms .critical-comms-body {
1154
1122
  padding: 24px;
1155
1123
  padding: var(--size-24);
1156
1124
  }
1157
- .carousel__scroll-button {
1158
- width: 32px;
1159
- width: var(--size-32);
1160
- height: 32px;
1161
- height: var(--size-32);
1162
- align-items: center;
1163
- justify-content: center;
1164
- }
1165
1125
  .carousel__indicators {
1166
1126
  display: flex;
1167
1127
  justify-content: center;
@@ -1647,6 +1607,21 @@ div.critical-comms .critical-comms-body {
1647
1607
  width: var(--size-64);
1648
1608
  }
1649
1609
  }
1610
+ .np-theme-personal .np-close-button--x-small {
1611
+ height: 24px;
1612
+ height: var(--size-24);
1613
+ width: 24px;
1614
+ width: var(--size-24);
1615
+ flex-shrink: 0;
1616
+ }
1617
+ @media (max-width: 320px) {
1618
+ .np-theme-personal .np-close-button--x-small {
1619
+ height: 48px;
1620
+ height: var(--size-48);
1621
+ width: 48px;
1622
+ width: var(--size-48);
1623
+ }
1624
+ }
1650
1625
  .np-theme-personal .np-close-button--large {
1651
1626
  height: 40px;
1652
1627
  height: var(--size-40);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimitiveAnchor.js","sources":["../../../src/primitives/PrimitiveAnchor/PrimitiveAnchor.tsx"],"sourcesContent":["import React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport type { PrimitiveAnchorProps } from '.';\n\n/**\n * The Primitive `PrimitiveAnchor` component is customisable link element that can be\n * used in various parts of the Wise Design System internally. It supports\n * different states such as disabled and provides event handlers for common\n * interactions like click, focus, blur, mouse enter, mouse leave, and key down.\n *\n * @see {@link PrimitiveAnchor} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-anchor--docs|Storybook Wise Design}\n */\nconst PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(\n (\n {\n children,\n className,\n href,\n id,\n disabled = false,\n testId,\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const anchorClasses = clsx(className);\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLAnchorElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are set to handle the `disabled` state for the link:\n *\n * - `aria-disabled`: Exposes the link as disabled to assistive technologies.\n * - `href`: Removed when `disabled` is true to prevent navigation.\n * - `role`: Set to 'link' when `disabled` is true to ensure the element\n * is still exposed as a link.\n *\n * For more details, refer to Scott O'Hara's article on disabling links:\n * https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n const anchorProps = {\n 'aria-disabled': disabled || undefined,\n className: anchorClasses,\n 'data-testid': testId,\n href: disabled ? undefined : href,\n id,\n ref,\n role: disabled ? 'link' : undefined,\n rel: props.target === '_blank' ? 'noopener noreferrer' : undefined,\n onClick: handleClick,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <a {...anchorProps}>{children}</a>;\n },\n);\n\nPrimitiveAnchor.displayName = 'PrimitiveAnchor';\n\nexport default PrimitiveAnchor;\n"],"names":["PrimitiveAnchor","forwardRef","children","className","href","id","disabled","testId","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","anchorClasses","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKeyDown","anchorProps","undefined","role","rel","target","_jsx","displayName"],"mappings":";;;;;;AAaA,MAAMA,eAAe,gBAAGC,gBAAU,CAChC,CACE;EACEC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJC,EAAE;AACFC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,MAAM;EACNC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,YAAY;EACZC,SAAS;EACT,GAAGC,KAAAA;CACJ,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,aAAa,GAAGC,SAAI,CAACd,SAAS,CAAC,CAAA;AAErC,EAAA,MAAMe,WAAW,GAAGC,iBAAW,CAC5BC,KAA0C,IAAI;AAC7C,IAAA,IAAId,QAAQ,EAAE;MACZc,KAAK,CAACC,cAAc,EAAE,CAAA;AACxB,KAAC,MAAM;MACLb,OAAO,GAAGY,KAAK,CAAC,CAAA;AAClB,KAAA;AACF,GAAC,EACD,CAACd,QAAQ,EAAEE,OAAO,CAAC,CACpB,CAAA;AAED,EAAA,MAAMc,WAAW,GAAGH,iBAAW,CAC5BC,KAA0C,I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AAEa,gBAAgB;AAC9BZ,IAAAA,SAAS,EAAEa,aAAa;IACxB,GAAGZ,KAAAA;GACJ,CAAA;AAED,EAAA,oBAAOkB,cAAA,CAAA,GAAA,EAAA;AAAA,IAAA,GAAOL,WAAW;AAAAzB,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAI,CAAC,CAAA;AAC3C,CAAC,EACF;AAEDF,eAAe,CAACiC,WAAW,GAAG,iBAAiB;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimitiveAnchor.mjs","sources":["../../../src/primitives/PrimitiveAnchor/PrimitiveAnchor.tsx"],"sourcesContent":["import React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport type { PrimitiveAnchorProps } from '.';\n\n/**\n * The Primitive `PrimitiveAnchor` component is customisable link element that can be\n * used in various parts of the Wise Design System internally. It supports\n * different states such as disabled and provides event handlers for common\n * interactions like click, focus, blur, mouse enter, mouse leave, and key down.\n *\n * @see {@link PrimitiveAnchor} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-anchor--docs|Storybook Wise Design}\n */\nconst PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(\n (\n {\n children,\n className,\n href,\n id,\n disabled = false,\n testId,\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const anchorClasses = clsx(className);\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLAnchorElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are set to handle the `disabled` state for the link:\n *\n * - `aria-disabled`: Exposes the link as disabled to assistive technologies.\n * - `href`: Removed when `disabled` is true to prevent navigation.\n * - `role`: Set to 'link' when `disabled` is true to ensure the element\n * is still exposed as a link.\n *\n * For more details, refer to Scott O'Hara's article on disabling links:\n * https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n const anchorProps = {\n 'aria-disabled': disabled || undefined,\n className: anchorClasses,\n 'data-testid': testId,\n href: disabled ? undefined : href,\n id,\n ref,\n role: disabled ? 'link' : undefined,\n rel: props.target === '_blank' ? 'noopener noreferrer' : undefined,\n onClick: handleClick,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <a {...anchorProps}>{children}</a>;\n },\n);\n\nPrimitiveAnchor.displayName = 'PrimitiveAnchor';\n\nexport default PrimitiveAnchor;\n"],"names":["PrimitiveAnchor","forwardRef","children","className","href","id","disabled","testId","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","anchorClasses","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKeyDown","anchorProps","undefined","role","rel","target","_jsx","displayName"],"mappings":";;;;AAaA,MAAMA,eAAe,gBAAGC,UAAU,CAChC,CACE;EACEC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJC,EAAE;AACFC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,MAAM;EACNC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,Y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ACxB,IAAA,aAAa,EAAET,MAAM;AACrBH,IAAAA,IAAI,EAAEE,QAAQ,GAAGsB,SAAS,GAAGxB,IAAI;IACjCC,EAAE;IACFU,GAAG;AACHc,IAAAA,IAAI,EAAEvB,QAAQ,GAAG,MAAM,GAAGsB,SAAS;IACnCE,GAAG,EAAEhB,KAAK,CAACiB,MAAM,KAAK,QAAQ,GAAG,qBAAqB,GAAGH,SAAS;AAClEpB,IAAAA,OAAO,EAAEU,WAAW;AACpBT,IAAAA,OAAO,EAAEa,WAAW;AACpBZ,IAAAA,MAAM,EAAEa,UAAU;AAClBZ,IAAAA,YAAY,EAAEa,gBAAgB;AAC9BZ,IAAAA,YAAY,EAAEa,gBAAgB;AAC9BZ,IAAAA,SAAS,EAAEa,aAAa;IACxB,GAAGZ,KAAAA;GACJ,CAAA;AAED,EAAA,oBAAOkB,GAAA,CAAA,GAAA,EAAA;AAAA,IAAA,GAAOL,WAAW;AAAAzB,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAI,CAAC,CAAA;AAC3C,CAAC,EACF;AAEDF,eAAe,CAACiC,WAAW,GAAG,iBAAiB;;;;"}
@@ -3,7 +3,7 @@
3
3
  var React = require('react');
4
4
  var clsx = require('clsx');
5
5
  var reactIntl = require('react-intl');
6
- var Button_messages = require('../../../i18n/commonMessages/Button.messages.js');
6
+ var Button_messages = require('../../i18n/commonMessages/Button.messages.js');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
 
9
9
  /* eslint-disable react/button-has-type */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimitiveButton.js","sources":["../../../src/primitives/PrimitiveButton/PrimitiveButton.tsx"],"sourcesContent":["/* eslint-disable react/button-has-type */\nimport React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport { useIntl, MessageDescriptor } from 'react-intl';\nimport messages from '../../i18n/commonMessages/Button.messages';\nimport type { PrimitiveButtonProps } from '.';\n\n/**\n * The Primitive `PrimitiveButton` component can be used in various parts the Wise Design\n * System internally. It supports different states such as disabled and loading,\n * and provides event handlers for common interactions like click, focus, blur,\n * mouse enter, mouse leave, and keydown.\n *\n * @see {@link PrimitiveButton} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-button--docs|Storybook Wise Design}\n */\nconst PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(\n (\n {\n children,\n className,\n id,\n disabled = false,\n loading = false,\n testId,\n type = 'button',\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const intl = useIntl();\n const classNames = clsx(className);\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, loading, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are used to manage the `disabled` and `loading`\n * states for the button:\n *\n * - `aria-disabled`: Communicates to assistive technologies that the button\n * is disabled when it is either disabled or loading.\n * - `aria-label`: Provides an accessible label for the button, using a\n * localized loading message when the button is in a loading state.\n * - `aria-live`: Ensures that updates to the button's content are announced\n * by assistive technologies, set to 'polite' during loading.\n */\n const buttonProps = {\n 'aria-disabled': loading || undefined,\n 'aria-busy': loading || undefined,\n 'aria-label': loading ? intl.formatMessage(messages.loadingAriaLabel) : props['aria-label'],\n 'aria-live': (loading ? 'polite' : 'off') as 'polite' | 'off' | 'assertive' | undefined,\n className: classNames,\n 'data-testid': testId,\n disabled,\n id,\n ref,\n type,\n onBlur: handleBlur,\n onClick: handleClick,\n onFocus: handleFocus,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <button {...buttonProps}>{children}</button>;\n },\n);\n\nPrimitiveButton.displayName = 'PrimitiveButton';\n\nexport default PrimitiveButton;\n"],"names":["PrimitiveButton","forwardRef","children","className","id","disabled","loading","testId","type","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","intl","useIntl","classNames","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKeyDown","buttonProps","undefined","formatMessage","messages","loadingAriaLabel","_jsx","displayName"],"mappings":";;;;;;;;AAAA;AAgBA,MAAMA,eAAe,gBAAGC,gBAAU,CAChC,CACE;EACEC,QAAQ;EACRC,SAAS;EACTC,EAAE;AACFC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;AACNC,EAAAA,IAAI,GAAG,QAAQ;EACfC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,YAAY;EACZC,SAAS;EACT,GAAGC,KAAAA;CACJ,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AACtB,EAAA,MAAMC,UAAU,GAAGC,SAAI,CAACjB,SAAS,CAAC,CAAA;AAElC,EAAA,MAAMkB,WAAW,GAAGC,iBAAW,CAC5BC,KAA0C,IAAI;IAC7C,IAAIlB,QAAQ,IAAIC,OAAO,EAAE;MACvBiB,KAAK,CAACC,cAAc,EAAE,CAAA;AACxB,KAAC,MAAM;MACLf,OAAO,GAAGc,KAAK,CAAC,CAAA;AACl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FY,GAAG;IACHR,IAAI;AACJG,IAAAA,MAAM,EAAEe,UAAU;AAClBjB,IAAAA,OAAO,EAAEY,WAAW;AACpBX,IAAAA,OAAO,EAAEe,WAAW;AACpBb,IAAAA,YAAY,EAAEe,gBAAgB;AAC9Bd,IAAAA,YAAY,EAAEe,gBAAgB;AAC9Bd,IAAAA,SAAS,EAAEe,aAAa;IACxB,GAAGd,KAAAA;GACJ,CAAA;AAED,EAAA,oBAAOoB,cAAA,CAAA,QAAA,EAAA;AAAA,IAAA,GAAYL,WAAW;AAAA5B,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAS,CAAC,CAAA;AACrD,CAAC,EACF;AAEDF,eAAe,CAACoC,WAAW,GAAG,iBAAiB;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, useCallback } from 'react';
2
2
  import { clsx } from 'clsx';
3
3
  import { useIntl } from 'react-intl';
4
- import messages from '../../../i18n/commonMessages/Button.messages.mjs';
4
+ import messages from '../../i18n/commonMessages/Button.messages.mjs';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  /* eslint-disable react/button-has-type */