@transferwise/components 46.128.3 → 46.130.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 (121) hide show
  1. package/build/alert/Alert.js +1 -1
  2. package/build/alert/Alert.mjs +1 -1
  3. package/build/card/Card.js.map +1 -1
  4. package/build/card/Card.mjs.map +1 -1
  5. package/build/common/{card/Card.js → baseCard/BaseCard.js} +4 -4
  6. package/build/common/baseCard/BaseCard.js.map +1 -0
  7. package/build/common/{card/Card.mjs → baseCard/BaseCard.mjs} +4 -4
  8. package/build/common/baseCard/BaseCard.mjs.map +1 -0
  9. package/build/common/liveRegion/LiveRegion.js +42 -0
  10. package/build/common/liveRegion/LiveRegion.js.map +1 -0
  11. package/build/common/liveRegion/LiveRegion.mjs +40 -0
  12. package/build/common/liveRegion/LiveRegion.mjs.map +1 -0
  13. package/build/criticalBanner/CriticalCommsBanner.js +68 -3
  14. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  15. package/build/criticalBanner/CriticalCommsBanner.mjs +69 -4
  16. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  17. package/build/flowNavigation/FlowNavigation.js +1 -1
  18. package/build/flowNavigation/FlowNavigation.mjs +1 -1
  19. package/build/index.js +4 -4
  20. package/build/index.mjs +1 -1
  21. package/build/inputs/SelectInput.js +1 -1
  22. package/build/inputs/SelectInput.js.map +1 -1
  23. package/build/inputs/SelectInput.mjs +1 -1
  24. package/build/inputs/SelectInput.mjs.map +1 -1
  25. package/build/inputs/_ButtonInput.js +2 -2
  26. package/build/inputs/_ButtonInput.js.map +1 -1
  27. package/build/inputs/_ButtonInput.mjs +2 -2
  28. package/build/inputs/_ButtonInput.mjs.map +1 -1
  29. package/build/main.css +191 -165
  30. package/build/overlayHeader/OverlayHeader.js +1 -1
  31. package/build/overlayHeader/OverlayHeader.mjs +1 -1
  32. package/build/promoCard/PromoCard.js +2 -2
  33. package/build/promoCard/PromoCard.js.map +1 -1
  34. package/build/promoCard/PromoCard.mjs +2 -2
  35. package/build/promoCard/PromoCard.mjs.map +1 -1
  36. package/build/prompt/InfoPrompt/InfoPrompt.js +35 -29
  37. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  38. package/build/prompt/InfoPrompt/InfoPrompt.mjs +35 -29
  39. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  40. package/build/sentimentSurface/SentimentSurface.js +5 -1
  41. package/build/sentimentSurface/SentimentSurface.js.map +1 -1
  42. package/build/sentimentSurface/SentimentSurface.mjs +5 -1
  43. package/build/sentimentSurface/SentimentSurface.mjs.map +1 -1
  44. package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -15
  45. package/build/styles/inputs/SelectInput.css +8 -0
  46. package/build/styles/listItem/ListItem.css +1 -1
  47. package/build/styles/main.css +191 -165
  48. package/build/styles/sentimentSurface/SentimentSurface.css +100 -100
  49. package/build/types/card/Card.d.ts +1 -1
  50. package/build/types/common/{card/Card.d.ts → baseCard/BaseCard.d.ts} +8 -8
  51. package/build/types/common/baseCard/BaseCard.d.ts.map +1 -0
  52. package/build/types/common/baseCard/index.d.ts +3 -0
  53. package/build/types/common/baseCard/index.d.ts.map +1 -0
  54. package/build/types/common/index.d.ts +2 -0
  55. package/build/types/common/index.d.ts.map +1 -1
  56. package/build/types/common/liveRegion/LiveRegion.d.ts +23 -0
  57. package/build/types/common/liveRegion/LiveRegion.d.ts.map +1 -0
  58. package/build/types/common/liveRegion/index.d.ts +3 -0
  59. package/build/types/common/liveRegion/index.d.ts.map +1 -0
  60. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +4 -1
  61. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  62. package/build/types/criticalBanner/index.d.ts +1 -0
  63. package/build/types/criticalBanner/index.d.ts.map +1 -1
  64. package/build/types/index.d.ts +2 -1
  65. package/build/types/index.d.ts.map +1 -1
  66. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  67. package/build/types/promoCard/PromoCard.d.ts +3 -3
  68. package/build/types/promoCard/PromoCard.d.ts.map +1 -1
  69. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +11 -2
  70. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  71. package/build/types/sentimentSurface/SentimentSurface.d.ts.map +1 -1
  72. package/package.json +2 -2
  73. package/src/card/Card.story.tsx +3 -2
  74. package/src/card/Card.tsx +1 -1
  75. package/src/common/{card/Card.less → baseCard/BaseCard.less} +1 -1
  76. package/src/common/{card/Card.story.tsx → baseCard/BaseCard.story.tsx} +5 -5
  77. package/src/common/{card/Card.test.tsx → baseCard/BaseCard.test.tsx} +11 -12
  78. package/src/common/{card/Card.tsx → baseCard/BaseCard.tsx} +9 -9
  79. package/src/common/baseCard/index.ts +2 -0
  80. package/src/common/index.ts +2 -0
  81. package/src/common/liveRegion/LiveRegion.test.tsx +56 -0
  82. package/src/common/liveRegion/LiveRegion.tsx +49 -0
  83. package/src/common/liveRegion/index.ts +2 -0
  84. package/src/criticalBanner/CriticalCommsBanner.css +33 -15
  85. package/src/criticalBanner/CriticalCommsBanner.less +46 -36
  86. package/src/criticalBanner/CriticalCommsBanner.story.tsx +9 -15
  87. package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +70 -0
  88. package/src/criticalBanner/CriticalCommsBanner.test.tsx +66 -0
  89. package/src/criticalBanner/CriticalCommsBanner.tsx +54 -5
  90. package/src/criticalBanner/index.ts +1 -0
  91. package/src/index.ts +2 -1
  92. package/src/inputs/SelectInput.css +8 -0
  93. package/src/inputs/SelectInput.story.tsx +2 -2
  94. package/src/inputs/SelectInput.test.story.tsx +57 -1
  95. package/src/inputs/SelectInput.test.tsx +33 -1
  96. package/src/inputs/SelectInput.tsx +2 -1
  97. package/src/inputs/_ButtonInput.less +8 -0
  98. package/src/inputs/_ButtonInput.tsx +1 -1
  99. package/src/listItem/ListItem.css +1 -1
  100. package/src/listItem/ListItem.less +4 -2
  101. package/src/listItem/_stories/Breakpoints/ListItem.noMedia.test.story.tsx +62 -0
  102. package/src/listItem/_stories/Breakpoints/ListItem.sideMedia.test.story.tsx +62 -0
  103. package/src/listItem/_stories/Breakpoints/ListItem.stackedMedia.test.story.tsx +62 -0
  104. package/src/listItem/_stories/ListItem.story.tsx +3 -2
  105. package/src/main.css +191 -165
  106. package/src/main.less +2 -2
  107. package/src/promoCard/PromoCard.tsx +6 -5
  108. package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +119 -0
  109. package/src/prompt/InfoPrompt/InfoPrompt.tsx +47 -34
  110. package/src/sentimentSurface/SentimentSurface.css +100 -100
  111. package/src/sentimentSurface/SentimentSurface.less +50 -50
  112. package/src/sentimentSurface/SentimentSurface.test.story.tsx +19 -0
  113. package/src/sentimentSurface/SentimentSurface.tsx +3 -0
  114. package/build/common/card/Card.js.map +0 -1
  115. package/build/common/card/Card.mjs.map +0 -1
  116. package/build/types/common/card/Card.d.ts.map +0 -1
  117. package/build/types/common/card/index.d.ts +0 -3
  118. package/build/types/common/card/index.d.ts.map +0 -1
  119. package/src/common/card/index.ts +0 -2
  120. /package/build/styles/common/{card/Card.css → baseCard/BaseCard.css} +0 -0
  121. /package/src/common/{card/Card.css → baseCard/BaseCard.css} +0 -0
@@ -26,13 +26,13 @@ require('../common/propsValues/markdownNodeType.js');
26
26
  require('../common/fileType.js');
27
27
  var constants = require('../common/constants.js');
28
28
  var CloseButton = require('../common/closeButton/CloseButton.js');
29
+ var jsxRuntime = require('react/jsx-runtime');
29
30
  var StatusIcon = require('../statusIcon/StatusIcon.js');
30
31
  var Title = require('../title/Title.js');
31
32
  var logActionRequired = require('../utilities/logActionRequired.js');
32
33
  var InlineMarkdown = require('./inlineMarkdown/InlineMarkdown.js');
33
34
  var Button_resolver = require('../button/Button.resolver.js');
34
35
  var Link = require('../link/Link.js');
35
- var jsxRuntime = require('react/jsx-runtime');
36
36
 
37
37
  exports.AlertArrowPosition = void 0;
38
38
  (function (AlertArrowPosition) {
@@ -22,13 +22,13 @@ import '../common/propsValues/markdownNodeType.mjs';
22
22
  import '../common/fileType.mjs';
23
23
  import { WDS_LIVE_REGION_DELAY_MS } from '../common/constants.mjs';
24
24
  import { CloseButton } from '../common/closeButton/CloseButton.mjs';
25
+ import { jsx, jsxs } from 'react/jsx-runtime';
25
26
  import StatusIcon from '../statusIcon/StatusIcon.mjs';
26
27
  import Title from '../title/Title.mjs';
27
28
  import { logActionRequired } from '../utilities/logActionRequired.mjs';
28
29
  import InlineMarkdown from './inlineMarkdown/InlineMarkdown.mjs';
29
30
  import Button from '../button/Button.resolver.mjs';
30
31
  import Link from '../link/Link.mjs';
31
- import { jsx, jsxs } from 'react/jsx-runtime';
32
32
 
33
33
  var AlertArrowPosition;
34
34
  (function (AlertArrowPosition) {
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated use Navigation pattern (via `NavigationOption` component)\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAI,gBAAGC,gBAAU,CAAC,SAASD,IAAIA,CACnC;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAU,CACf,EACZC,SAAS,EAAA;AAET,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,SAAS,GAAGD,WAAK,EAAE;AACzB,EAAA,MAAME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EN,EAEAa,YAAY,IAAIb,UAAU,iBACzBkB,cAAA,CAACY,YAAI,EAAA;AACHhC,MAAAA,EAAE,EAAC,KAAK;MACRiC,IAAI,EAAEC,qBAAU,CAACC,UAAW;MAC5B1B,SAAS,EAAEU,SAAI,CAAC,kBAAkB,EAAEjB,UAAU,GAAG,SAAS,GAAG,MAAM,CAAE;AACrEM,MAAAA,EAAE,EAAEM,SAAU;AACd,MAAA,iBAAA,EAAiBF,OAAQ;AAAAP,MAAAA,QAAA,EAExBA;AAAQ,KACL,CACP;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAI,gBAAGC,gBAAU,CAAC,SAASD,IAAIA,CACnC;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAU,CACf,EACZC,SAAS,EAAA;AAET,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,SAAS,GAAGD,WAAK,EAAE;AACzB,EAAA,MAAME,YAAY,GAAGC,OAAO,CAACX,QAAQ,CAAC;EAEtC,oBACEY,eAAA,CAAChB,OAAO,EAAA;AACNiB,IAAAA,GAAG,EAAEP,SA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EAAEC,qBAAU,CAACC,UAAW;MAC5B1B,SAAS,EAAEU,SAAI,CAAC,kBAAkB,EAAEjB,UAAU,GAAG,SAAS,GAAG,MAAM,CAAE;AACrEM,MAAAA,EAAE,EAAEM,SAAU;AACd,MAAA,iBAAA,EAAiBF,OAAQ;AAAAP,MAAAA,QAAA,EAExBA;AAAQ,KACL,CACP;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.mjs","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated use Navigation pattern (via `NavigationOption` component)\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAI,gBAAGC,UAAU,CAAC,SAASD,IAAIA,CACnC;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAU,CACf,EACZC,SAAS,EAAA;AAET,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,SAAS,GAAGD,KAAK,EAAE;AACzB,EAAA,MAAME,YAAY,GAAGC,OAAO,CAACX,QAAQ,CAAC;EAEtC,oBACEY,IAAA,CAAChB,OAAO,EAAA;AACNiB,IAAAA,GAAG,EAAEP,SAAU;AACfF,IAAAA,SAAS,EAAEU,IAAI,CAAC,SAAS,EAAEV,SAAS,EAAE;MACpC,mBAAmB,EAAEM,YAAY,IAAIb,UAAU;MA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AACrEM,MAAAA,EAAE,EAAEM,SAAU;AACd,MAAA,iBAAA,EAAiBF,OAAQ;AAAAP,MAAAA,QAAA,EAExBA;AAAQ,KACL,CACP;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Card.mjs","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAI,gBAAGC,UAAU,CAAC,SAASD,IAAIA,CACnC;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAU,CACf,EACZC,SAAS,EAAA;AAET,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,SAAS,GAAGD,KAAK,EAAE;AACzB,EAAA,MAAME,YAAY,GAAGC,OAAO,CAACX,QAAQ,CAAC;EAEtC,oBACEY,IAAA,CAAChB,OAAO,EAAA;AACNiB,IAAAA,GAAG,EAAEP,SAAU;AACfF,IAAAA,SAAS,EAAEU,IAAI,CAAC,SAAS,EAAEV,SAAS,EAAE;MACpC,mBAAmB,EAAEM,YAAY,IAAIb,UAAU;MAC/C,mBAAmB,EAAE,CAACG,QAAQ;MAC9B,mBAAmB,EAAE,CAAC,CAACE;AACxB,KAAA,CAAE;AACHC,IAAAA,EAAE,EAAEA,EAAG;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,GACM,CAAC;AAEd,CAAC;;;;"}
@@ -8,7 +8,7 @@ var CloseButton = require('../closeButton/CloseButton.js');
8
8
  var documentIosClick = require('../domHelpers/documentIosClick.js');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
11
- const Card = /*#__PURE__*/React.forwardRef(({
11
+ const BaseCard = /*#__PURE__*/React.forwardRef(({
12
12
  className,
13
13
  children = null,
14
14
  id,
@@ -41,7 +41,7 @@ const Card = /*#__PURE__*/React.forwardRef(({
41
41
  }), children]
42
42
  });
43
43
  });
44
- Card.displayName = 'Card';
44
+ BaseCard.displayName = 'Card';
45
45
 
46
- exports.default = Card;
47
- //# sourceMappingURL=Card.js.map
46
+ exports.default = BaseCard;
47
+ //# sourceMappingURL=BaseCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseCard.js","sources":["../../../src/common/baseCard/BaseCard.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface BaseCardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * BaseCard component.\n *\n * A BaseCard is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <BaseCard>\n * <p>Hello World!</p>\n * </BaseCard>\n */\nconst BaseCard = forwardRef<HTMLDivElement, BaseCardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nBaseCard.displayName = 'Card';\n\nexport default BaseCard;\n"],"names":["BaseCard","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;;;;;AAkDA,MAAMA,QAAQ,gBAAGC,gBAAU,CACzB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,YAAM,CAAC,IAAI,CAAC;AAEzC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,SAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAAA,CAERI,SAAS,iBACRQ,cAAA,CAACC,uBAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,gCAAe,CAACD,CAAC,CAAC;AAClBZ,QAAAA,SAAS,EAAE;AACb,MAAA;KAAE,CAEL,EACAJ,QAAQ;AAAA,GACN,CAAC;AAEV,CAAC;AAGHH,QAAQ,CAACqB,WAAW,GAAG,MAAM;;;;"}
@@ -4,7 +4,7 @@ import { CloseButton } from '../closeButton/CloseButton.mjs';
4
4
  import { stopPropagation } from '../domHelpers/documentIosClick.mjs';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
7
- const Card = /*#__PURE__*/forwardRef(({
7
+ const BaseCard = /*#__PURE__*/forwardRef(({
8
8
  className,
9
9
  children = null,
10
10
  id,
@@ -37,7 +37,7 @@ const Card = /*#__PURE__*/forwardRef(({
37
37
  }), children]
38
38
  });
39
39
  });
40
- Card.displayName = 'Card';
40
+ BaseCard.displayName = 'Card';
41
41
 
42
- export { Card as default };
43
- //# sourceMappingURL=Card.mjs.map
42
+ export { BaseCard as default };
43
+ //# sourceMappingURL=BaseCard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseCard.mjs","sources":["../../../src/common/baseCard/BaseCard.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface BaseCardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * BaseCard component.\n *\n * A BaseCard is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <BaseCard>\n * <p>Hello World!</p>\n * </BaseCard>\n */\nconst BaseCard = forwardRef<HTMLDivElement, BaseCardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nBaseCard.displayName = 'Card';\n\nexport default BaseCard;\n"],"names":["BaseCard","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;AAkDA,MAAMA,QAAQ,gBAAGC,UAAU,CACzB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,MAAM,CAAC,IAAI,CAAC;AAEzC,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,IAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAAA,CAERI,SAAS,iBACRQ,GAAA,CAACC,WAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,eAAe,CAACD,CAAC,CAAC;AAClBZ,QAAAA,SAAS,EAAE;AACb,MAAA;KAAE,CAEL,EACAJ,QAAQ;AAAA,GACN,CAAC;AAEV,CAAC;AAGHH,QAAQ,CAACqB,WAAW,GAAG,MAAM;;;;"}
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ const ARIA_LIVE_ROLE_MAP = {
6
+ assertive: 'alert',
7
+ polite: 'status'
8
+ };
9
+ /**
10
+ * Renders an ARIA live region with the correct implicit role.
11
+ *
12
+ * - `aria-live="polite"` → `role="status"`
13
+ * - `aria-live="assertive"` → `role="alert"`
14
+ * - `aria-live="off"` → no live region
15
+ *
16
+ * The `role` prop is intentionally excluded from the public API
17
+ * to prevent mismatches between `aria-live` and `role`.
18
+ */
19
+ const LiveRegion = ({
20
+ 'aria-live': ariaLive,
21
+ children,
22
+ ...props
23
+ }) => {
24
+ if (ariaLive === 'off') {
25
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
26
+ children: children
27
+ });
28
+ }
29
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
30
+ role: ARIA_LIVE_ROLE_MAP[ariaLive],
31
+ "aria-live": ariaLive,
32
+ "aria-atomic": "true",
33
+ style: {
34
+ display: 'contents'
35
+ },
36
+ ...props,
37
+ children: children
38
+ });
39
+ };
40
+
41
+ exports.LiveRegion = LiveRegion;
42
+ //# sourceMappingURL=LiveRegion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveRegion.js","sources":["../../../src/common/liveRegion/LiveRegion.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nconst ARIA_LIVE_ROLE_MAP = {\n assertive: 'alert',\n polite: 'status',\n} as const;\n\nexport type AriaLive = 'off' | 'polite' | 'assertive';\n\nexport interface LiveRegionProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'role' | 'aria-live' | 'aria-atomic'\n> {\n /**\n * Determines urgency: 'assertive' interrupts, 'polite' waits for idle, 'off' disables live region.\n */\n 'aria-live': AriaLive;\n /** Test ID for testing tools */\n 'data-testid'?: string;\n children?: ReactNode;\n}\n\n/**\n * Renders an ARIA live region with the correct implicit role.\n *\n * - `aria-live=\"polite\"` → `role=\"status\"`\n * - `aria-live=\"assertive\"` → `role=\"alert\"`\n * - `aria-live=\"off\"` → no live region\n *\n * The `role` prop is intentionally excluded from the public API\n * to prevent mismatches between `aria-live` and `role`.\n */\nexport const LiveRegion = ({ 'aria-live': ariaLive, children, ...props }: LiveRegionProps) => {\n if (ariaLive === 'off') {\n return <>{children}</>;\n }\n\n return (\n <div\n role={ARIA_LIVE_ROLE_MAP[ariaLive]}\n aria-live={ariaLive}\n aria-atomic=\"true\"\n style={{ display: 'contents' }}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["ARIA_LIVE_ROLE_MAP","assertive","polite","LiveRegion","ariaLive","children","props","_jsx","_Fragment","role","style","display"],"mappings":";;;;AAEA,MAAMA,kBAAkB,GAAG;AACzBC,EAAAA,SAAS,EAAE,OAAO;AAClBC,EAAAA,MAAM,EAAE;CACA;AAiBV;;;;;;;;;AASG;AACI,MAAMC,UAAU,GAAGA,CAAC;AAAE,EAAA,WAAW,EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAmB,KAAI;EAC3F,IAAIF,QAAQ,KAAK,KAAK,EAAE;IACtB,oBAAOG,cAAA,CAAAC,mBAAA,EAAA;AAAAH,MAAAA,QAAA,EAAGA;AAAQ,MAAI;AACxB,EAAA;AAEA,EAAA,oBACEE,cAAA,CAAA,KAAA,EAAA;AACEE,IAAAA,IAAI,EAAET,kBAAkB,CAACI,QAAQ,CAAE;AACnC,IAAA,WAAA,EAAWA,QAAS;AACpB,IAAA,aAAA,EAAY,MAAM;AAClBM,IAAAA,KAAK,EAAE;AAAEC,MAAAA,OAAO,EAAE;KAAa;AAAA,IAAA,GAC3BL,KAAK;AAAAD,IAAAA,QAAA,EAERA;AAAQ,GACN,CAAC;AAEV;;;;"}
@@ -0,0 +1,40 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+
3
+ const ARIA_LIVE_ROLE_MAP = {
4
+ assertive: 'alert',
5
+ polite: 'status'
6
+ };
7
+ /**
8
+ * Renders an ARIA live region with the correct implicit role.
9
+ *
10
+ * - `aria-live="polite"` → `role="status"`
11
+ * - `aria-live="assertive"` → `role="alert"`
12
+ * - `aria-live="off"` → no live region
13
+ *
14
+ * The `role` prop is intentionally excluded from the public API
15
+ * to prevent mismatches between `aria-live` and `role`.
16
+ */
17
+ const LiveRegion = ({
18
+ 'aria-live': ariaLive,
19
+ children,
20
+ ...props
21
+ }) => {
22
+ if (ariaLive === 'off') {
23
+ return /*#__PURE__*/jsx(Fragment, {
24
+ children: children
25
+ });
26
+ }
27
+ return /*#__PURE__*/jsx("div", {
28
+ role: ARIA_LIVE_ROLE_MAP[ariaLive],
29
+ "aria-live": ariaLive,
30
+ "aria-atomic": "true",
31
+ style: {
32
+ display: 'contents'
33
+ },
34
+ ...props,
35
+ children: children
36
+ });
37
+ };
38
+
39
+ export { LiveRegion };
40
+ //# sourceMappingURL=LiveRegion.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveRegion.mjs","sources":["../../../src/common/liveRegion/LiveRegion.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nconst ARIA_LIVE_ROLE_MAP = {\n assertive: 'alert',\n polite: 'status',\n} as const;\n\nexport type AriaLive = 'off' | 'polite' | 'assertive';\n\nexport interface LiveRegionProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'role' | 'aria-live' | 'aria-atomic'\n> {\n /**\n * Determines urgency: 'assertive' interrupts, 'polite' waits for idle, 'off' disables live region.\n */\n 'aria-live': AriaLive;\n /** Test ID for testing tools */\n 'data-testid'?: string;\n children?: ReactNode;\n}\n\n/**\n * Renders an ARIA live region with the correct implicit role.\n *\n * - `aria-live=\"polite\"` → `role=\"status\"`\n * - `aria-live=\"assertive\"` → `role=\"alert\"`\n * - `aria-live=\"off\"` → no live region\n *\n * The `role` prop is intentionally excluded from the public API\n * to prevent mismatches between `aria-live` and `role`.\n */\nexport const LiveRegion = ({ 'aria-live': ariaLive, children, ...props }: LiveRegionProps) => {\n if (ariaLive === 'off') {\n return <>{children}</>;\n }\n\n return (\n <div\n role={ARIA_LIVE_ROLE_MAP[ariaLive]}\n aria-live={ariaLive}\n aria-atomic=\"true\"\n style={{ display: 'contents' }}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["ARIA_LIVE_ROLE_MAP","assertive","polite","LiveRegion","ariaLive","children","props","_jsx","_Fragment","role","style","display"],"mappings":";;AAEA,MAAMA,kBAAkB,GAAG;AACzBC,EAAAA,SAAS,EAAE,OAAO;AAClBC,EAAAA,MAAM,EAAE;CACA;AAiBV;;;;;;;;;AASG;AACI,MAAMC,UAAU,GAAGA,CAAC;AAAE,EAAA,WAAW,EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAmB,KAAI;EAC3F,IAAIF,QAAQ,KAAK,KAAK,EAAE;IACtB,oBAAOG,GAAA,CAAAC,QAAA,EAAA;AAAAH,MAAAA,QAAA,EAAGA;AAAQ,MAAI;AACxB,EAAA;AAEA,EAAA,oBACEE,GAAA,CAAA,KAAA,EAAA;AACEE,IAAAA,IAAI,EAAET,kBAAkB,CAACI,QAAQ,CAAE;AACnC,IAAA,WAAA,EAAWA,QAAS;AACpB,IAAA,aAAA,EAAY,MAAM;AAClBM,IAAAA,KAAK,EAAE;AAAEC,MAAAA,OAAO,EAAE;KAAa;AAAA,IAAA,GAC3BL,KAAK;AAAAD,IAAAA,QAAA,EAERA;AAAQ,GACN,CAAC;AAEV;;;;"}
@@ -2,17 +2,81 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Alert = require('../alert/Alert.js');
5
+ var icons = require('@transferwise/icons');
6
6
  var clsx = require('clsx');
7
+ var Alert = require('../alert/Alert.js');
8
+ require('../common/theme.js');
9
+ require('../common/direction.js');
10
+ require('../common/propsValues/control.js');
11
+ require('../common/propsValues/breakpoint.js');
12
+ require('../common/propsValues/size.js');
13
+ require('../common/propsValues/typography.js');
14
+ require('../common/propsValues/width.js');
15
+ require('../common/propsValues/type.js');
16
+ require('../common/propsValues/dateMode.js');
17
+ require('../common/propsValues/monthFormat.js');
18
+ require('../common/propsValues/position.js');
19
+ require('../common/propsValues/layouts.js');
20
+ require('../common/propsValues/status.js');
21
+ var sentiment = require('../common/propsValues/sentiment.js');
22
+ require('../common/propsValues/profileType.js');
23
+ require('../common/propsValues/variant.js');
24
+ require('../common/propsValues/scroll.js');
25
+ require('../common/propsValues/markdownNodeType.js');
26
+ require('../common/fileType.js');
27
+ require('react');
28
+ require('react-intl');
29
+ require('../common/closeButton/CloseButton.messages.js');
7
30
  var jsxRuntime = require('react/jsx-runtime');
31
+ var Circle = require('../common/circle/Circle.js');
32
+ var SentimentSurface = require('../sentimentSurface/SentimentSurface.js');
8
33
 
34
+ const makeSurface = sentiment => {
35
+ const Surface = props => /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default, {
36
+ as: "span",
37
+ emphasis: "elevated",
38
+ sentiment: sentiment,
39
+ ...props
40
+ });
41
+ Surface.displayName = `CriticalCommsSurface(${sentiment})`;
42
+ return Surface;
43
+ };
44
+ const iconBySentiment = {
45
+ [sentiment.Sentiment.NEGATIVE]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
46
+ as: makeSurface(sentiment.Sentiment.NEGATIVE),
47
+ size: 32,
48
+ className: "status-circle negative",
49
+ children: /*#__PURE__*/jsxRuntime.jsx(icons.Alert, {
50
+ className: "status-icon light"
51
+ })
52
+ }),
53
+ [sentiment.Sentiment.WARNING]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
54
+ as: makeSurface(sentiment.Sentiment.WARNING),
55
+ size: 32,
56
+ className: "status-circle warning",
57
+ children: /*#__PURE__*/jsxRuntime.jsx(icons.Alert, {
58
+ className: "status-icon dark"
59
+ })
60
+ }),
61
+ [sentiment.Sentiment.NEUTRAL]: /*#__PURE__*/jsxRuntime.jsx(Circle.default, {
62
+ as: makeSurface(sentiment.Sentiment.NEUTRAL),
63
+ size: 32,
64
+ className: "status-circle neutral",
65
+ children: /*#__PURE__*/jsxRuntime.jsx(icons.ClockBorderless, {
66
+ className: "status-icon dark"
67
+ })
68
+ })
69
+ };
9
70
  function CriticalCommsBanner({
10
71
  title,
11
72
  subtitle,
12
73
  action,
74
+ sentiment: sentiment$1 = sentiment.Sentiment.NEGATIVE,
13
75
  className
14
76
  }) {
15
- return /*#__PURE__*/jsxRuntime.jsx("div", {
77
+ return /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default, {
78
+ sentiment: sentiment$1,
79
+ emphasis: "elevated",
16
80
  className: clsx.clsx('critical-comms', className),
17
81
  children: /*#__PURE__*/jsxRuntime.jsx(Alert.default, {
18
82
  title: title,
@@ -23,7 +87,8 @@ function CriticalCommsBanner({
23
87
  text: action?.label
24
88
  },
25
89
  className: className,
26
- type: "warning"
90
+ type: sentiment$1,
91
+ icon: iconBySentiment[sentiment$1]
27
92
  })
28
93
  });
29
94
  }
@@ -1 +1 @@
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 onClick?: () => void;\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={{ onClick: action?.onClick, 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","onClick","target","href","text","label","type"],"mappings":";;;;;;;;AAcA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;AAAEC,EAAAA;AAAS,CAA4B,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,OAAO,EAAEP,MAAM,EAAEO,OAAO;QAAEC,MAAM,EAAER,MAAM,EAAES,IAAI;QAAEC,IAAI,EAAEV,MAAM,EAAEW;OAAQ;AAChFV,MAAAA,SAAS,EAAEA,SAAU;AACrBW,MAAAA,IAAI,EAAC;KAAS;AAElB,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={{ onClick: action?.onClick, target: action?.href, text: action?.label }}\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","target","href","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,cAAA,CAACC,wBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7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,aAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,OAAO,EAAEJ,QAAS;AAClBC,MAAAA,MAAM,EAAE;QAAEI,OAAO,EAAEJ,MAAM,EAAEI,OAAO;QAAEC,MAAM,EAAEL,MAAM,EAAEM,IAAI;QAAEC,IAAI,EAAEP,MAAM,EAAEQ;OAAQ;AAChFjB,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,WAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,WAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
@@ -1,16 +1,80 @@
1
- import Alert from '../alert/Alert.mjs';
1
+ import { ClockBorderless, Alert } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
+ import Alert$1 from '../alert/Alert.mjs';
4
+ import '../common/theme.mjs';
5
+ import '../common/direction.mjs';
6
+ import '../common/propsValues/control.mjs';
7
+ import '../common/propsValues/breakpoint.mjs';
8
+ import '../common/propsValues/size.mjs';
9
+ import '../common/propsValues/typography.mjs';
10
+ import '../common/propsValues/width.mjs';
11
+ import '../common/propsValues/type.mjs';
12
+ import '../common/propsValues/dateMode.mjs';
13
+ import '../common/propsValues/monthFormat.mjs';
14
+ import '../common/propsValues/position.mjs';
15
+ import '../common/propsValues/layouts.mjs';
16
+ import '../common/propsValues/status.mjs';
17
+ import { Sentiment } from '../common/propsValues/sentiment.mjs';
18
+ import '../common/propsValues/profileType.mjs';
19
+ import '../common/propsValues/variant.mjs';
20
+ import '../common/propsValues/scroll.mjs';
21
+ import '../common/propsValues/markdownNodeType.mjs';
22
+ import '../common/fileType.mjs';
23
+ import 'react';
24
+ import 'react-intl';
25
+ import '../common/closeButton/CloseButton.messages.mjs';
3
26
  import { jsx } from 'react/jsx-runtime';
27
+ import Circle from '../common/circle/Circle.mjs';
28
+ import SentimentSurface from '../sentimentSurface/SentimentSurface.mjs';
4
29
 
30
+ const makeSurface = sentiment => {
31
+ const Surface = props => /*#__PURE__*/jsx(SentimentSurface, {
32
+ as: "span",
33
+ emphasis: "elevated",
34
+ sentiment: sentiment,
35
+ ...props
36
+ });
37
+ Surface.displayName = `CriticalCommsSurface(${sentiment})`;
38
+ return Surface;
39
+ };
40
+ const iconBySentiment = {
41
+ [Sentiment.NEGATIVE]: /*#__PURE__*/jsx(Circle, {
42
+ as: makeSurface(Sentiment.NEGATIVE),
43
+ size: 32,
44
+ className: "status-circle negative",
45
+ children: /*#__PURE__*/jsx(Alert, {
46
+ className: "status-icon light"
47
+ })
48
+ }),
49
+ [Sentiment.WARNING]: /*#__PURE__*/jsx(Circle, {
50
+ as: makeSurface(Sentiment.WARNING),
51
+ size: 32,
52
+ className: "status-circle warning",
53
+ children: /*#__PURE__*/jsx(Alert, {
54
+ className: "status-icon dark"
55
+ })
56
+ }),
57
+ [Sentiment.NEUTRAL]: /*#__PURE__*/jsx(Circle, {
58
+ as: makeSurface(Sentiment.NEUTRAL),
59
+ size: 32,
60
+ className: "status-circle neutral",
61
+ children: /*#__PURE__*/jsx(ClockBorderless, {
62
+ className: "status-icon dark"
63
+ })
64
+ })
65
+ };
5
66
  function CriticalCommsBanner({
6
67
  title,
7
68
  subtitle,
8
69
  action,
70
+ sentiment = Sentiment.NEGATIVE,
9
71
  className
10
72
  }) {
11
- return /*#__PURE__*/jsx("div", {
73
+ return /*#__PURE__*/jsx(SentimentSurface, {
74
+ sentiment: sentiment,
75
+ emphasis: "elevated",
12
76
  className: clsx('critical-comms', className),
13
- children: /*#__PURE__*/jsx(Alert, {
77
+ children: /*#__PURE__*/jsx(Alert$1, {
14
78
  title: title,
15
79
  message: subtitle,
16
80
  action: {
@@ -19,7 +83,8 @@ function CriticalCommsBanner({
19
83
  text: action?.label
20
84
  },
21
85
  className: className,
22
- type: "warning"
86
+ type: sentiment,
87
+ icon: iconBySentiment[sentiment]
23
88
  })
24
89
  });
25
90
  }
@@ -1 +1 @@
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 onClick?: () => void;\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={{ onClick: action?.onClick, 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","onClick","target","href","text","label","type"],"mappings":";;;;AAcA,SAASA,mBAAmBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;AAAEC,EAAAA;AAAS,CAA4B,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,OAAO,EAAEP,MAAM,EAAEO,OAAO;QAAEC,MAAM,EAAER,MAAM,EAAES,IAAI;QAAEC,IAAI,EAAEV,MAAM,EAAEW;OAAQ;AAChFV,MAAAA,SAAS,EAAEA,SAAU;AACrBW,MAAAA,IAAI,EAAC;KAAS;AAElB,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={{ onClick: action?.onClick, target: action?.href, text: action?.label }}\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","target","href","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,GAAA,CAACC,gBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,SAAS,CAACC,QAAQ,gBACjBP,GAAA,CAACQ,MAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,SAAS,CAACC,QAAQ,CAAE;AAACE,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACvFX,GAAA,CAACY,KAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAmB;AAC1C,GAAQ,CACT;AACD,EAAA,CAACJ,SAAS,CAACO,OAAO,gBAChBb,GAAA,CAACQ,MAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,SAAS,CAACO,OAAO,CAAE;AAACJ,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAAuB;IAAAC,QAAA,eACrFX,GAAA,CAACY,KAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAkB;AACzC,GAAQ,CACT;AACD,EAAA,CAACJ,SAAS,CAACQ,OAAO,gBAChBd,GAAA,CAACQ,MAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,SAAS,CAACQ,OAAO,CAAE;AAACL,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAAuB;IAAAC,QAAA,eACrFX,GAAA,CAACe,eAAS,EAAA;AAACL,MAAAA,SAAS,EAAC;KAAkB;GACjC;CAEX;AAED,SAASM,mBAAmBA,CAAC;EAC3BC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNtB,SAAS,GAAGS,SAAS,CAACC,QAAQ;AAC9BG,EAAAA;AAAS,CACgB,EAAA;EACzB,oBACEV,GAAA,CAACC,gBAAgB,EAAA;AACfJ,IAAAA,SAAS,EAAEA,SAAU;AACrBM,IAAAA,QAAQ,EAAC,UAAU;AACnBO,IAAAA,SAAS,EAAEU,IAAI,CAAC,gBAAgB,EAAEV,SAAS,CAAE;IAAAC,QAAA,eAE7CX,GAAA,CAACqB,OAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,OAAO,EAAEJ,QAAS;AAClBC,MAAAA,MAAM,EAAE;QAAEI,OAAO,EAAEJ,MAAM,EAAEI,OAAO;QAAEC,MAAM,EAAEL,MAAM,EAAEM,IAAI;QAAEC,IAAI,EAAEP,MAAM,EAAEQ;OAAQ;AAChFjB,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,SAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,SAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
@@ -24,6 +24,7 @@ require('../common/propsValues/scroll.js');
24
24
  require('../common/propsValues/markdownNodeType.js');
25
25
  require('../common/fileType.js');
26
26
  var CloseButton = require('../common/closeButton/CloseButton.js');
27
+ var jsxRuntime = require('react/jsx-runtime');
27
28
  var FlowHeader = require('../common/flowHeader/FlowHeader.js');
28
29
  var Logo = require('../logo/Logo.js');
29
30
  var Stepper = require('../stepper/Stepper.js');
@@ -32,7 +33,6 @@ var FlowNavigation_messages = require('./FlowNavigation.messages.js');
32
33
  var AnimatedLabel = require('./animatedLabel/AnimatedLabel.js');
33
34
  var IconButton = require('../iconButton/IconButton.js');
34
35
  var icons = require('@transferwise/icons');
35
- var jsxRuntime = require('react/jsx-runtime');
36
36
 
37
37
  const FlowNavigation = ({
38
38
  activeStep = 0,
@@ -20,6 +20,7 @@ import '../common/propsValues/scroll.mjs';
20
20
  import '../common/propsValues/markdownNodeType.mjs';
21
21
  import '../common/fileType.mjs';
22
22
  import { CloseButton } from '../common/closeButton/CloseButton.mjs';
23
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
23
24
  import FlowHeader from '../common/flowHeader/FlowHeader.mjs';
24
25
  import Logo from '../logo/Logo.mjs';
25
26
  import Stepper from '../stepper/Stepper.mjs';
@@ -28,7 +29,6 @@ import messages from './FlowNavigation.messages.mjs';
28
29
  import AnimatedLabel from './animatedLabel/AnimatedLabel.mjs';
29
30
  import IconButton from '../iconButton/IconButton.mjs';
30
31
  import { ArrowLeft } from '@transferwise/icons';
31
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
32
32
 
33
33
  const FlowNavigation = ({
34
34
  activeStep = 0,
package/build/index.js CHANGED
@@ -23,7 +23,7 @@ var Body = require('./body/Body.js');
23
23
  var Button_resolver = require('./button/Button.resolver.js');
24
24
  var IconButton = require('./iconButton/IconButton.js');
25
25
  var Carousel = require('./carousel/Carousel.js');
26
- var Card$1 = require('./card/Card.js');
26
+ var Card = require('./card/Card.js');
27
27
  var Checkbox = require('./checkbox/Checkbox.js');
28
28
  var CheckboxButton = require('./checkboxButton/CheckboxButton.js');
29
29
  var CheckboxOption = require('./checkboxOption/CheckboxOption.js');
@@ -33,7 +33,7 @@ var Chip = require('./chips/Chip.js');
33
33
  var CircularButton = require('./circularButton/CircularButton.js');
34
34
  var Option = require('./common/Option/Option.js');
35
35
  var BottomSheet = require('./common/bottomSheet/BottomSheet.js');
36
- var Card = require('./common/card/Card.js');
36
+ var BaseCard = require('./common/baseCard/BaseCard.js');
37
37
  var CriticalCommsBanner = require('./criticalBanner/CriticalCommsBanner.js');
38
38
  var DateInput = require('./dateInput/DateInput.js');
39
39
  var DateLookup = require('./dateLookup/DateLookup.js');
@@ -173,7 +173,7 @@ exports.Body = Body.default;
173
173
  exports.Button = Button_resolver.default;
174
174
  exports.IconButton = IconButton.default;
175
175
  exports.Carousel = Carousel.default;
176
- exports.Card = Card$1.default;
176
+ exports.Card = Card.default;
177
177
  exports.Checkbox = Checkbox.default;
178
178
  exports.CheckboxButton = CheckboxButton.default;
179
179
  exports.CheckboxOption = CheckboxOption.default;
@@ -183,7 +183,7 @@ exports.Chip = Chip.default;
183
183
  exports.CircularButton = CircularButton.default;
184
184
  exports.Option = Option.default;
185
185
  exports.BottomSheet = BottomSheet.default;
186
- exports.BaseCard = Card.default;
186
+ exports.BaseCard = BaseCard.default;
187
187
  exports.CriticalCommsBanner = CriticalCommsBanner.default;
188
188
  exports.DateInput = DateInput.default;
189
189
  exports.DateLookup = DateLookup.default;
package/build/index.mjs CHANGED
@@ -31,7 +31,7 @@ export { default as Chip } from './chips/Chip.mjs';
31
31
  export { default as CircularButton } from './circularButton/CircularButton.mjs';
32
32
  export { default as Option } from './common/Option/Option.mjs';
33
33
  export { default as BottomSheet } from './common/bottomSheet/BottomSheet.mjs';
34
- export { default as BaseCard } from './common/card/Card.mjs';
34
+ export { default as BaseCard } from './common/baseCard/BaseCard.mjs';
35
35
  export { default as CriticalCommsBanner } from './criticalBanner/CriticalCommsBanner.mjs';
36
36
  export { default as DateInput } from './dateInput/DateInput.mjs';
37
37
  export { default as DateLookup } from './dateLookup/DateLookup.mjs';
@@ -876,7 +876,7 @@ function SelectInputOptionContent({
876
876
  children: note
877
877
  }) : null]
878
878
  }), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
879
- className: clsx.clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
879
+ className: clsx.clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger'),
880
880
  children: description
881
881
  }) : null]
882
882
  })]