@transferwise/components 0.0.0-experimental-b8a9275 → 0.0.0-experimental-2255abe

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 (41) hide show
  1. package/build/alert/Alert.js +1 -1
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +1 -1
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/chips/Chip.js +1 -1
  6. package/build/chips/Chip.js.map +1 -1
  7. package/build/chips/Chip.mjs +1 -1
  8. package/build/chips/Chip.mjs.map +1 -1
  9. package/build/common/closeButton/CloseButton.js +1 -1
  10. package/build/common/closeButton/CloseButton.js.map +1 -1
  11. package/build/common/closeButton/CloseButton.mjs +1 -1
  12. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  13. package/build/main.css +14 -12
  14. package/build/styles/common/circle/Circle.css +1 -0
  15. package/build/styles/common/closeButton/CloseButton.css +1 -0
  16. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +0 -12
  17. package/build/styles/drawer/Drawer.css +8 -0
  18. package/build/styles/main.css +14 -12
  19. package/build/styles/modal/Modal.css +4 -0
  20. package/build/types/alert/Alert.d.ts.map +1 -1
  21. package/package.json +3 -3
  22. package/src/alert/Alert.tsx +5 -1
  23. package/src/chips/Chip.tsx +1 -1
  24. package/src/chips/__snapshots__/Chips.spec.tsx.snap +4 -6
  25. package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -1
  26. package/src/common/circle/Circle.css +1 -0
  27. package/src/common/circle/Circle.less +1 -0
  28. package/src/common/closeButton/CloseButton.css +1 -0
  29. package/src/common/closeButton/CloseButton.less +1 -0
  30. package/src/common/closeButton/CloseButton.tsx +1 -1
  31. package/src/common/closeButton/__snapshots__/CloseButton.spec.tsx.snap +1 -1
  32. package/src/dateLookup/dateTrigger/DateTrigger.css +0 -12
  33. package/src/dateLookup/dateTrigger/DateTrigger.less +0 -11
  34. package/src/drawer/Drawer.css +8 -0
  35. package/src/drawer/Drawer.less +8 -0
  36. package/src/drawer/__snapshots__/Drawer.rtl.spec.tsx.snap +1 -1
  37. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +2 -2
  38. package/src/main.css +14 -12
  39. package/src/modal/Modal.css +4 -0
  40. package/src/modal/Modal.less +4 -0
  41. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +1 -1
@@ -128,7 +128,7 @@ function Alert({
128
128
  })]
129
129
  }), onDismiss && /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
130
130
  ref: closeButtonReference,
131
- className: "m-l-2",
131
+ className: "text-secondary m-l-2",
132
132
  onClick: onDismiss
133
133
  })]
134
134
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport { Sentiment, Size, Typography, Variant } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport { Action } from '../common/action/Action';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n variant?: `${Variant}`;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n arrow,\n action,\n children,\n className,\n dismissible,\n icon,\n onDismiss,\n message,\n size,\n title,\n type = 'neutral',\n variant = 'desktop',\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState(false);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div\n className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}\n data-testid={variant}\n >\n {icon ? (\n <div className=\"alert__icon\">{icon}</div>\n ) : (\n <StatusIcon size={Size.LARGE} sentiment={resolvedType} />\n )}\n <div className=\"alert__message\">\n <div role={Sentiment.NEGATIVE === resolvedType ? 'alert' : 'status'}>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action && <Action action={action} className=\"m-t-1\" />}\n </div>\n </div>\n {onDismiss && (\n <CloseButton ref={closeButtonReference} className=\"m-l-2\" onClick={onDismiss} />\n )}\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","arrow","action","children","className","dismissible","icon","onDismiss","message","size","title","variant","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","closeButtonReference","useRef","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","_jsx","StatusIcon","Size","LARGE","sentiment","role","Sentiment","NEGATIVE","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Action","CloseButton","ref","onClick"],"mappings":";;;;;;;;;;;;;;;;;;AA8BYA,oCAOX;AAPD,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB,CAAA;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB,CAAA;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B,CAAA;AAC7B,CAAC,EAPWA,0BAAkB,KAAlBA,0BAAkB,GAO7B,EAAA,CAAA,CAAA,CAAA;AA2BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU,CAAA;AACnB,IAAA,KAAK,MAAM;AACT,MAAA,OAAO,SAAS,CAAA;AAClB,IAAA,KAAK,OAAO;AACV,MAAA,OAAO,UAAU,CAAA;AACnB,IAAA;AACE,MAAA,OAAOA,IAAI,CAAA;AACf,GAAA;AACF,CAAA;AAEwB,SAAAC,KAAKA,CAAC;EAC5BC,KAAK;EACLC,MAAM;EACNC,QAAQ;EACRC,SAAS;EACTC,WAAW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AAAA,GACE,CAAC,CAAA;AAEV,CAAA;AAEA,SAASgB,oBAAoBA,CAACtB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC,CAAA;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B,CAAA;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC,CAAA;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB,CAAA;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB,CAAA;AAC5B,IAAA,KAAK,SAAS,CAAA;AACd,IAAA;AACE,MAAA,OAAO,OAAO,CAAA;AAClB,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport { Sentiment, Size, Typography, Variant } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport { Action } from '../common/action/Action';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n variant?: `${Variant}`;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n arrow,\n action,\n children,\n className,\n dismissible,\n icon,\n onDismiss,\n message,\n size,\n title,\n type = 'neutral',\n variant = 'desktop',\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState(false);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div\n className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}\n data-testid={variant}\n >\n {icon ? (\n <div className=\"alert__icon\">{icon}</div>\n ) : (\n <StatusIcon size={Size.LARGE} sentiment={resolvedType} />\n )}\n <div className=\"alert__message\">\n <div role={Sentiment.NEGATIVE === resolvedType ? 'alert' : 'status'}>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action && <Action action={action} className=\"m-t-1\" />}\n </div>\n </div>\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"text-secondary m-l-2\"\n onClick={onDismiss}\n />\n )}\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","arrow","action","children","className","dismissible","icon","onDismiss","message","size","title","variant","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","closeButtonReference","useRef","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","_jsx","StatusIcon","Size","LARGE","sentiment","role","Sentiment","NEGATIVE","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Action","CloseButton","ref","onClick"],"mappings":";;;;;;;;;;;;;;;;;;AA8BYA,oCAOX;AAPD,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB,CAAA;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB,CAAA;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B,CAAA;AAC7B,CAAC,EAPWA,0BAAkB,KAAlBA,0BAAkB,GAO7B,EAAA,CAAA,CAAA,CAAA;AA2BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU,CAAA;AACnB,IAAA,KAAK,MAAM;AACT,MAAA,OAAO,SAAS,CAAA;AAClB,IAAA,KAAK,OAAO;AACV,MAAA,OAAO,UAAU,CAAA;AACnB,IAAA;AACE,MAAA,OAAOA,IAAI,CAAA;AACf,GAAA;AACF,CAAA;AAEwB,SAAAC,KAAKA,CAAC;EAC5BC,KAAK;EACLC,MAAM;EACN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EAAEjD,SAAAA;AAAU,KACnB,CACH,CAAA;AAAA,GACE,CAAC,CAAA;AAEV,CAAA;AAEA,SAASgB,oBAAoBA,CAACtB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC,CAAA;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B,CAAA;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC,CAAA;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB,CAAA;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB,CAAA;AAC5B,IAAA,KAAK,SAAS,CAAA;AACd,IAAA;AACE,MAAA,OAAO,OAAO,CAAA;AAClB,GAAA;AACF;;;;"}
@@ -124,7 +124,7 @@ function Alert({
124
124
  })]
125
125
  }), onDismiss && /*#__PURE__*/jsx(CloseButton, {
126
126
  ref: closeButtonReference,
127
- className: "m-l-2",
127
+ className: "text-secondary m-l-2",
128
128
  onClick: onDismiss
129
129
  })]
130
130
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.mjs","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport { Sentiment, Size, Typography, Variant } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport { Action } from '../common/action/Action';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n variant?: `${Variant}`;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n arrow,\n action,\n children,\n className,\n dismissible,\n icon,\n onDismiss,\n message,\n size,\n title,\n type = 'neutral',\n variant = 'desktop',\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState(false);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div\n className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}\n data-testid={variant}\n >\n {icon ? (\n <div className=\"alert__icon\">{icon}</div>\n ) : (\n <StatusIcon size={Size.LARGE} sentiment={resolvedType} />\n )}\n <div className=\"alert__message\">\n <div role={Sentiment.NEGATIVE === resolvedType ? 'alert' : 'status'}>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action && <Action action={action} className=\"m-t-1\" />}\n </div>\n </div>\n {onDismiss && (\n <CloseButton ref={closeButtonReference} className=\"m-l-2\" onClick={onDismiss} />\n )}\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","arrow","action","children","className","dismissible","icon","onDismiss","message","size","title","variant","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","closeButtonReference","useRef","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","_jsx","StatusIcon","Size","LARGE","sentiment","role","Sentiment","NEGATIVE","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Action","CloseButton","ref","onClick"],"mappings":";;;;;;;;;;;;;;IA8BYA,mBAOX;AAPD,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB,CAAA;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB,CAAA;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B,CAAA;AAC7B,CAAC,EAPWA,kBAAkB,KAAlBA,kBAAkB,GAO7B,EAAA,CAAA,CAAA,CAAA;AA2BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU,CAAA;AACnB,IAAA,KAAK,MA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AA;AAAO,UAAG,CAAA;AAAA,OACpD,CACP,CAAA;AAAA,KAAK,CACL,EAACG,SAAS,iBACR+B,GAAA,CAACgB,WAAW,EAAA;AAACC,MAAAA,GAAG,EAAEpC,oBAAqB;AAACf,MAAAA,SAAS,EAAC,OAAO;AAACoD,MAAAA,OAAO,EAAEjD,SAAAA;AAAU,KAAG,CACjF,CAAA;AAAA,GACE,CAAC,CAAA;AAEV,CAAA;AAEA,SAASgB,oBAAoBA,CAACtB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC,CAAA;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B,CAAA;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC,CAAA;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB,CAAA;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB,CAAA;AAC5B,IAAA,KAAK,SAAS,CAAA;AACd,IAAA;AACE,MAAA,OAAO,OAAO,CAAA;AAClB,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"Alert.mjs","sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useState, useRef, useEffect } from 'react';\n\nimport Body from '../body/Body';\nimport { Sentiment, Size, Typography, Variant } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport StatusIcon from '../statusIcon';\nimport Title from '../title/Title';\nimport { logActionRequired } from '../utilities';\n\nimport InlineMarkdown from './inlineMarkdown';\nimport { Action } from '../common/action/Action';\n\nexport type AlertAction = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype AlertTypeDeprecated = `${Sentiment.SUCCESS | Sentiment.INFO | Sentiment.ERROR}`;\ntype AlertTypeResolved = `${\n | Sentiment.POSITIVE\n | Sentiment.NEUTRAL\n | Sentiment.WARNING\n | Sentiment.NEGATIVE}`;\nexport type AlertType = AlertTypeResolved | AlertTypeDeprecated;\n\nexport enum AlertArrowPosition {\n TOP_LEFT = 'up-left',\n TOP = 'up-center',\n TOP_RIGHT = 'up-right',\n BOTTOM_LEFT = 'down-left',\n BOTTOM = 'down-center',\n BOTTOM_RIGHT = 'down-right',\n}\n\nexport interface AlertProps {\n /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */\n action?: AlertAction;\n className?: string;\n /** An optional icon. If not provided, we will default the icon to something appropriate for the type */\n icon?: React.ReactNode;\n /** Title for the alert component */\n title?: string;\n /** The main body of the alert. Accepts plain text and bold words specified with **double stars */\n message?: string;\n /** The presence of the onDismiss handler will trigger the visibility of the close button */\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n /** The type dictates which icon and colour will be used */\n type?: AlertType;\n variant?: `${Variant}`;\n /** @deprecated Use `InlineAlert` instead. */\n arrow?: `${AlertArrowPosition}`;\n /** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */\n children?: React.ReactNode;\n /** @deprecated Use `onDismiss` instead. */\n dismissible?: boolean;\n /** @deprecated Alert component doesn't support `size` anymore, please remove this prop. */\n size?: `${Size}`;\n}\n\nfunction resolveType(type: AlertType): AlertTypeResolved {\n switch (type) {\n case 'success':\n return 'positive';\n case 'info':\n return 'neutral';\n case 'error':\n return 'negative';\n default:\n return type;\n }\n}\n\nexport default function Alert({\n arrow,\n action,\n children,\n className,\n dismissible,\n icon,\n onDismiss,\n message,\n size,\n title,\n type = 'neutral',\n variant = 'desktop',\n}: AlertProps) {\n useEffect(() => {\n if (arrow !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.\",\n );\n }\n }, [arrow]);\n\n useEffect(() => {\n if (children !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'children' anymore, use 'message' instead.\",\n );\n }\n }, [children]);\n\n useEffect(() => {\n if (dismissible !== undefined) {\n logActionRequired(\n \"Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.\",\n );\n }\n }, [dismissible]);\n\n useEffect(() => {\n if (size !== undefined) {\n logActionRequired(\"Alert component doesn't support 'size' anymore, please remove that prop.\");\n }\n }, [size]);\n\n const resolvedType = resolveType(type);\n useEffect(() => {\n if (resolvedType !== type) {\n logActionRequired(\n `Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`,\n );\n }\n }, [resolvedType, type]);\n\n const [shouldFire, setShouldFire] = useState(false);\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n\n return (\n <div\n className={clsx(\n 'alert d-flex',\n `alert-${resolvedType}`,\n arrow != null && alertArrowClassNames(arrow),\n className,\n )}\n data-testid=\"alert\"\n onTouchStart={() => setShouldFire(true)}\n onTouchEnd={(event) => {\n if (\n shouldFire &&\n action?.href &&\n // Check if current event is triggered from closeButton\n event.target instanceof Node &&\n closeButtonReference.current &&\n !closeButtonReference.current.contains(event.target)\n ) {\n if (action.target === '_blank') {\n window.top?.open(action.href);\n } else {\n window.top?.location.assign(action.href);\n }\n }\n setShouldFire(false);\n }}\n onTouchMove={() => setShouldFire(false)}\n >\n <div\n className={clsx('alert__content', 'd-flex', 'flex-grow-1', variant)}\n data-testid={variant}\n >\n {icon ? (\n <div className=\"alert__icon\">{icon}</div>\n ) : (\n <StatusIcon size={Size.LARGE} sentiment={resolvedType} />\n )}\n <div className=\"alert__message\">\n <div role={Sentiment.NEGATIVE === resolvedType ? 'alert' : 'status'}>\n {title && (\n <Title className=\"m-b-1\" type={Typography.TITLE_BODY}>\n {title}\n </Title>\n )}\n <Body as=\"span\" className=\"d-block\" type={Typography.BODY_LARGE}>\n {children || <InlineMarkdown>{message}</InlineMarkdown>}\n </Body>\n </div>\n {action && <Action action={action} className=\"m-t-1\" />}\n </div>\n </div>\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"text-secondary m-l-2\"\n onClick={onDismiss}\n />\n )}\n </div>\n );\n}\n\nfunction alertArrowClassNames(arrow: `${AlertArrowPosition}`) {\n switch (arrow) {\n case 'down-center':\n return 'arrow arrow-bottom arrow-center';\n case 'down-left':\n return 'arrow arrow-bottom arrow-left';\n case 'down-right':\n return 'arrow arrow-bottom arrow-right';\n case 'up-center':\n return 'arrow arrow-center';\n case 'up-right':\n return 'arrow arrow-right';\n case 'up-left':\n default:\n return 'arrow';\n }\n}\n"],"names":["AlertArrowPosition","resolveType","type","Alert","arrow","action","children","className","dismissible","icon","onDismiss","message","size","title","variant","useEffect","undefined","logActionRequired","resolvedType","shouldFire","setShouldFire","useState","closeButtonReference","useRef","_jsxs","clsx","alertArrowClassNames","onTouchStart","onTouchEnd","event","href","target","Node","current","contains","window","top","open","location","assign","onTouchMove","_jsx","StatusIcon","Size","LARGE","sentiment","role","Sentiment","NEGATIVE","Title","Typography","TITLE_BODY","Body","as","BODY_LARGE","InlineMarkdown","Action","CloseButton","ref","onClick"],"mappings":";;;;;;;;;;;;;;IA8BYA,mBAOX;AAPD,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpBA,EAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,WAAiB,CAAA;AACjBA,EAAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,UAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,WAAyB,CAAA;AACzBA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB,CAAA;AACtBA,EAAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,YAA2B,CAAA;AAC7B,CAAC,EAPWA,kBAAkB,KAAlBA,kBAAkB,GAO7B,EAAA,CAAA,CAAA,CAAA;AA2BD,SAASC,WAAWA,CAACC,IAAe,EAAA;AAClC,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,SAAS;AACZ,MAAA,OAAO,UAAU,C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ACE,UAAAA,SAAS,EAAC,OAAA;AAAO,UAAG,CAAA;AAAA,OACpD,CACP,CAAA;AAAA,KAAK,CACL,EAACG,SAAS,iBACR+B,GAAA,CAACgB,WAAW,EAAA;AACVC,MAAAA,GAAG,EAAEpC,oBAAqB;AAC1Bf,MAAAA,SAAS,EAAC,sBAAsB;AAChCoD,MAAAA,OAAO,EAAEjD,SAAAA;AAAU,KACnB,CACH,CAAA;AAAA,GACE,CAAC,CAAA;AAEV,CAAA;AAEA,SAASgB,oBAAoBA,CAACtB,KAA8B,EAAA;AAC1D,EAAA,QAAQA,KAAK;AACX,IAAA,KAAK,aAAa;AAChB,MAAA,OAAO,iCAAiC,CAAA;AAC1C,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,+BAA+B,CAAA;AACxC,IAAA,KAAK,YAAY;AACf,MAAA,OAAO,gCAAgC,CAAA;AACzC,IAAA,KAAK,WAAW;AACd,MAAA,OAAO,oBAAoB,CAAA;AAC7B,IAAA,KAAK,UAAU;AACb,MAAA,OAAO,mBAAmB,CAAA;AAC5B,IAAA,KAAK,SAAS,CAAA;AACd,IAAA;AACE,MAAA,OAAO,OAAO,CAAA;AAClB,GAAA;AACF;;;;"}
@@ -56,7 +56,7 @@ const Chip = ({
56
56
  ref: closeButtonReference,
57
57
  "aria-label": closeButton?.['aria-label'],
58
58
  size: "sm",
59
- filled: true,
59
+ filled: isModern,
60
60
  onClick: onRemove
61
61
  }) : null]
62
62
  }, value);
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../src/chips/Chip.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport Body from '../body/Body';\nimport { AriaLabelProperty, CommonProps, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton/CloseButton';\n\nexport type ChipValue = string | number;\n\nexport type Props = {\n value?: ChipValue;\n label: string;\n onRemove?: () => void;\n onClick?: () => void;\n onKeyPress?: () => void;\n closeButton?: AriaLabelProperty;\n 'aria-checked'?: boolean;\n role?: string;\n} & AriaLabelProperty &\n CommonProps;\n\nconst Chip = ({\n label,\n value,\n onRemove,\n onClick,\n onKeyPress,\n className = undefined,\n 'aria-label': ariaLabel,\n 'aria-checked': ariaChecked,\n role,\n closeButton,\n}: Props) => {\n const isActionable = onClick || onKeyPress;\n const defaultRole = isActionable ? 'button' : undefined;\n const tabIndex = isActionable ? 0 : -1;\n\n const { isModern } = useTheme();\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n const previousCloseButtonShown = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {\n closeButtonReference.current?.focus();\n }\n previousCloseButtonShown.current = closeButtonReference.current != null;\n }, [onRemove]);\n\n return (\n <div\n key={value}\n role={role ?? defaultRole}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n aria-checked={ariaChecked}\n className={clsx(\n 'np-chip',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n onRemove ? 'np-chip--removable' : '',\n className,\n )}\n {...(isActionable && { onClick, onKeyPress })}\n >\n {isModern ? (\n <Body aria-hidden={!!onRemove} type={Typography.BODY_DEFAULT_BOLD}>\n {label}\n </Body>\n ) : (\n <span aria-hidden=\"false\" className=\"np-chip-label\">\n {label}\n </span>\n )}\n {onRemove ? (\n <CloseButton\n ref={closeButtonReference}\n aria-label={closeButton?.['aria-label']}\n size=\"sm\"\n filled\n onClick={onRemove}\n />\n ) : null}\n </div>\n );\n};\n\nexport default Chip;\n"],"names":["Chip","label","value","onRemove","onClick","onKeyPress","className","undefined","ariaLabel","ariaChecked","role","closeButton","isActionable","defaultRole","tabIndex","isModern","useTheme","closeButtonReference","useRef","previousCloseButtonShown","useEffect","current","focus","_jsxs","clsx","children","_jsx","Body","type","Typography","BODY_DEFAULT_BOLD","CloseButton","ref","size","filled"],"mappings":";;;;;;;;;;AAsBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,KAA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oB,GAAG,EAAE,EACpCG,SAAS,CACT;AAAA,IAAA,IACGM,YAAY,IAAI;MAAER,OAAO;AAAEC,MAAAA,UAAAA;KAAY,CAAA;AAAAoB,IAAAA,QAAA,EAE3CV,CAAAA,QAAQ,gBACPW,cAAA,CAACC,IAAI,EAAA;MAAC,aAAa,EAAA,CAAC,CAACxB,QAAS;MAACyB,IAAI,EAAEC,qBAAU,CAACC,iBAAkB;AAAAL,MAAAA,QAAA,EAC/DxB,KAAAA;KACG,CAAC,gBAEPyB,cAAA,CAAA,MAAA,EAAA;AAAM,MAAA,aAAA,EAAY,OAAO;AAACpB,MAAAA,SAAS,EAAC,eAAe;AAAAmB,MAAAA,QAAA,EAChDxB,KAAAA;AAAK,KACF,CACP,EACAE,QAAQ,gBACPuB,cAAA,CAACK,uBAAW,EAAA;AACVC,MAAAA,GAAG,EAAEf,oBAAqB;MAC1B,YAAYN,EAAAA,WAAW,GAAG,YAAY,CAAE;AACxCsB,MAAAA,IAAI,EAAC,IAAI;MACTC,MAAM,EAAA,IAAA;AACN9B,MAAAA,OAAO,EAAED,QAAAA;KACT,CAAA,GACA,IAAI,CAAA;AAAA,GAAA,EAhCHD,KAiCF,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../../src/chips/Chip.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport Body from '../body/Body';\nimport { AriaLabelProperty, CommonProps, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton/CloseButton';\n\nexport type ChipValue = string | number;\n\nexport type Props = {\n value?: ChipValue;\n label: string;\n onRemove?: () => void;\n onClick?: () => void;\n onKeyPress?: () => void;\n closeButton?: AriaLabelProperty;\n 'aria-checked'?: boolean;\n role?: string;\n} & AriaLabelProperty &\n CommonProps;\n\nconst Chip = ({\n label,\n value,\n onRemove,\n onClick,\n onKeyPress,\n className = undefined,\n 'aria-label': ariaLabel,\n 'aria-checked': ariaChecked,\n role,\n closeButton,\n}: Props) => {\n const isActionable = onClick || onKeyPress;\n const defaultRole = isActionable ? 'button' : undefined;\n const tabIndex = isActionable ? 0 : -1;\n\n const { isModern } = useTheme();\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n const previousCloseButtonShown = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {\n closeButtonReference.current?.focus();\n }\n previousCloseButtonShown.current = closeButtonReference.current != null;\n }, [onRemove]);\n\n return (\n <div\n key={value}\n role={role ?? defaultRole}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n aria-checked={ariaChecked}\n className={clsx(\n 'np-chip',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n onRemove ? 'np-chip--removable' : '',\n className,\n )}\n {...(isActionable && { onClick, onKeyPress })}\n >\n {isModern ? (\n <Body aria-hidden={!!onRemove} type={Typography.BODY_DEFAULT_BOLD}>\n {label}\n </Body>\n ) : (\n <span aria-hidden=\"false\" className=\"np-chip-label\">\n {label}\n </span>\n )}\n {onRemove ? (\n <CloseButton\n ref={closeButtonReference}\n aria-label={closeButton?.['aria-label']}\n size=\"sm\"\n filled={isModern}\n onClick={onRemove}\n />\n ) : null}\n </div>\n );\n};\n\nexport default Chip;\n"],"names":["Chip","label","value","onRemove","onClick","onKeyPress","className","undefined","ariaLabel","ariaChecked","role","closeButton","isActionable","defaultRole","tabIndex","isModern","useTheme","closeButtonReference","useRef","previousCloseButtonShown","useEffect","current","focus","_jsxs","clsx","children","_jsx","Body","type","Typography","BODY_DEFAULT_BOLD","CloseButton","ref","size","filled"],"mappings":";;;;;;;;;;AAsBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,OAAO;EACPC,UAAU;AACVC,EAAAA,SAAS,GAAGC,SAAS;AACrB,EAAA,YAAY,EAAEC,SAAS;AACvB,EAAA,cAAc,EAAEC,WAAW;EAC3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,gBACPW,cAAA,CAACC,IAAI,EAAA;MAAC,aAAa,EAAA,CAAC,CAACxB,QAAS;MAACyB,IAAI,EAAEC,qBAAU,CAACC,iBAAkB;AAAAL,MAAAA,QAAA,EAC/DxB,KAAAA;KACG,CAAC,gBAEPyB,cAAA,CAAA,MAAA,EAAA;AAAM,MAAA,aAAA,EAAY,OAAO;AAACpB,MAAAA,SAAS,EAAC,eAAe;AAAAmB,MAAAA,QAAA,EAChDxB,KAAAA;AAAK,KACF,CACP,EACAE,QAAQ,gBACPuB,cAAA,CAACK,uBAAW,EAAA;AACVC,MAAAA,GAAG,EAAEf,oBAAqB;MAC1B,YAAYN,EAAAA,WAAW,GAAG,YAAY,CAAE;AACxCsB,MAAAA,IAAI,EAAC,IAAI;AACTC,MAAAA,MAAM,EAAEnB,QAAS;AACjBX,MAAAA,OAAO,EAAED,QAAAA;KAAS,CAClB,GACA,IAAI,CAAA;AAAA,GAAA,EAhCHD,KAiCF,CAAC,CAAA;AAEV;;;;"}
@@ -54,7 +54,7 @@ const Chip = ({
54
54
  ref: closeButtonReference,
55
55
  "aria-label": closeButton?.['aria-label'],
56
56
  size: "sm",
57
- filled: true,
57
+ filled: isModern,
58
58
  onClick: onRemove
59
59
  }) : null]
60
60
  }, value);
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../src/chips/Chip.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport Body from '../body/Body';\nimport { AriaLabelProperty, CommonProps, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton/CloseButton';\n\nexport type ChipValue = string | number;\n\nexport type Props = {\n value?: ChipValue;\n label: string;\n onRemove?: () => void;\n onClick?: () => void;\n onKeyPress?: () => void;\n closeButton?: AriaLabelProperty;\n 'aria-checked'?: boolean;\n role?: string;\n} & AriaLabelProperty &\n CommonProps;\n\nconst Chip = ({\n label,\n value,\n onRemove,\n onClick,\n onKeyPress,\n className = undefined,\n 'aria-label': ariaLabel,\n 'aria-checked': ariaChecked,\n role,\n closeButton,\n}: Props) => {\n const isActionable = onClick || onKeyPress;\n const defaultRole = isActionable ? 'button' : undefined;\n const tabIndex = isActionable ? 0 : -1;\n\n const { isModern } = useTheme();\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n const previousCloseButtonShown = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {\n closeButtonReference.current?.focus();\n }\n previousCloseButtonShown.current = closeButtonReference.current != null;\n }, [onRemove]);\n\n return (\n <div\n key={value}\n role={role ?? defaultRole}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n aria-checked={ariaChecked}\n className={clsx(\n 'np-chip',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n onRemove ? 'np-chip--removable' : '',\n className,\n )}\n {...(isActionable && { onClick, onKeyPress })}\n >\n {isModern ? (\n <Body aria-hidden={!!onRemove} type={Typography.BODY_DEFAULT_BOLD}>\n {label}\n </Body>\n ) : (\n <span aria-hidden=\"false\" className=\"np-chip-label\">\n {label}\n </span>\n )}\n {onRemove ? (\n <CloseButton\n ref={closeButtonReference}\n aria-label={closeButton?.['aria-label']}\n size=\"sm\"\n filled\n onClick={onRemove}\n />\n ) : null}\n </div>\n );\n};\n\nexport default Chip;\n"],"names":["Chip","label","value","onRemove","onClick","onKeyPress","className","undefined","ariaLabel","ariaChecked","role","closeButton","isActionable","defaultRole","tabIndex","isModern","useTheme","closeButtonReference","useRef","previousCloseButtonShown","useEffect","current","focus","_jsxs","clsx","children","_jsx","Body","type","Typography","BODY_DEFAULT_BOLD","CloseButton","ref","size","filled"],"mappings":";;;;;;;;AAsBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,OAAO;EACPC,UAAU;AACVC,EAAAA,SAAS,GAAGC,SAAS;AACrB,EAAA,YAAY,EAAEC,SAAS;AACvB,EA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QAAA,EAE3CV,CAAAA,QAAQ,gBACPW,GAAA,CAACC,IAAI,EAAA;MAAC,aAAa,EAAA,CAAC,CAACxB,QAAS;MAACyB,IAAI,EAAEC,UAAU,CAACC,iBAAkB;AAAAL,MAAAA,QAAA,EAC/DxB,KAAAA;KACG,CAAC,gBAEPyB,GAAA,CAAA,MAAA,EAAA;AAAM,MAAA,aAAA,EAAY,OAAO;AAACpB,MAAAA,SAAS,EAAC,eAAe;AAAAmB,MAAAA,QAAA,EAChDxB,KAAAA;AAAK,KACF,CACP,EACAE,QAAQ,gBACPuB,GAAA,CAACK,WAAW,EAAA;AACVC,MAAAA,GAAG,EAAEf,oBAAqB;MAC1B,YAAYN,EAAAA,WAAW,GAAG,YAAY,CAAE;AACxCsB,MAAAA,IAAI,EAAC,IAAI;MACTC,MAAM,EAAA,IAAA;AACN9B,MAAAA,OAAO,EAAED,QAAAA;KACT,CAAA,GACA,IAAI,CAAA;AAAA,GAAA,EAhCHD,KAiCF,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../src/chips/Chip.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\n\nimport Body from '../body/Body';\nimport { AriaLabelProperty, CommonProps, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton/CloseButton';\n\nexport type ChipValue = string | number;\n\nexport type Props = {\n value?: ChipValue;\n label: string;\n onRemove?: () => void;\n onClick?: () => void;\n onKeyPress?: () => void;\n closeButton?: AriaLabelProperty;\n 'aria-checked'?: boolean;\n role?: string;\n} & AriaLabelProperty &\n CommonProps;\n\nconst Chip = ({\n label,\n value,\n onRemove,\n onClick,\n onKeyPress,\n className = undefined,\n 'aria-label': ariaLabel,\n 'aria-checked': ariaChecked,\n role,\n closeButton,\n}: Props) => {\n const isActionable = onClick || onKeyPress;\n const defaultRole = isActionable ? 'button' : undefined;\n const tabIndex = isActionable ? 0 : -1;\n\n const { isModern } = useTheme();\n\n const closeButtonReference = useRef<HTMLButtonElement>(null);\n const previousCloseButtonShown = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {\n closeButtonReference.current?.focus();\n }\n previousCloseButtonShown.current = closeButtonReference.current != null;\n }, [onRemove]);\n\n return (\n <div\n key={value}\n role={role ?? defaultRole}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n aria-checked={ariaChecked}\n className={clsx(\n 'np-chip',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n onRemove ? 'np-chip--removable' : '',\n className,\n )}\n {...(isActionable && { onClick, onKeyPress })}\n >\n {isModern ? (\n <Body aria-hidden={!!onRemove} type={Typography.BODY_DEFAULT_BOLD}>\n {label}\n </Body>\n ) : (\n <span aria-hidden=\"false\" className=\"np-chip-label\">\n {label}\n </span>\n )}\n {onRemove ? (\n <CloseButton\n ref={closeButtonReference}\n aria-label={closeButton?.['aria-label']}\n size=\"sm\"\n filled={isModern}\n onClick={onRemove}\n />\n ) : null}\n </div>\n );\n};\n\nexport default Chip;\n"],"names":["Chip","label","value","onRemove","onClick","onKeyPress","className","undefined","ariaLabel","ariaChecked","role","closeButton","isActionable","defaultRole","tabIndex","isModern","useTheme","closeButtonReference","useRef","previousCloseButtonShown","useEffect","current","focus","_jsxs","clsx","children","_jsx","Body","type","Typography","BODY_DEFAULT_BOLD","CloseButton","ref","size","filled"],"mappings":";;;;;;;;AAsBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,OAAO;EACPC,UAAU;AACVC,EAAAA,SAAS,GAAGC,SAAS;AACrB,EAAA,YAAY,EAAEC,SAAS;AACvB,EAAA,cAAc,EAAEC,WAAW;EAC3BC,IAAI;AACJC,EAAAA,WAAAA;AAAW,CACL,KAAI;AACV,EAAA,MAAMC,YAAY,GAAGR,OAAO,IAAIC,UAAU,CAAA;AAC1C,EAAA,MAAMQ,WA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AA,EAC/DxB,KAAAA;KACG,CAAC,gBAEPyB,GAAA,CAAA,MAAA,EAAA;AAAM,MAAA,aAAA,EAAY,OAAO;AAACpB,MAAAA,SAAS,EAAC,eAAe;AAAAmB,MAAAA,QAAA,EAChDxB,KAAAA;AAAK,KACF,CACP,EACAE,QAAQ,gBACPuB,GAAA,CAACK,WAAW,EAAA;AACVC,MAAAA,GAAG,EAAEf,oBAAqB;MAC1B,YAAYN,EAAAA,WAAW,GAAG,YAAY,CAAE;AACxCsB,MAAAA,IAAI,EAAC,IAAI;AACTC,MAAAA,MAAM,EAAEnB,QAAS;AACjBX,MAAAA,OAAO,EAAED,QAAAA;KAAS,CAClB,GACA,IAAI,CAAA;AAAA,GAAA,EAhCHD,KAiCF,CAAC,CAAA;AAEV;;;;"}
@@ -35,7 +35,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
35
35
  as: "button",
36
36
  size: isTinyViewport ? size$1 * 2 : size$1,
37
37
  type: "button",
38
- className: clsx.clsx('np-close-button', 'text-primary', className),
38
+ className: clsx.clsx('np-close-button', className),
39
39
  "aria-label": ariaLabel,
40
40
  "aria-disabled": isDisabled,
41
41
  disabled: isDisabled,
@@ -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';\nimport Circle, { CircleProps } from '../circle';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { ShapeSize } from '../circle/Circle';\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\nconst mapLegacySize = {\n [String(Size.SMALL)]: 32,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size: sizeProp = 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 const size = mapLegacySize[sizeProp];\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Circle\n ref={reference}\n as=\"button\"\n size={isTinyViewport ? ((size * 2) as ShapeSize) : size}\n type=\"button\"\n className={clsx('np-close-button', 'text-primary', className)}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n // @ts-expect-error it's button element\n onClick={onClick}\n >\n <Icon size={sizeProp === Size.SMALL ? 16 : 24} />\n </Circle>\n );\n});\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","CloseButton","forwardRef","ariaLabel","size","sizeProp","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","ref","as","type","clsx","disabled","children"],"mappings":";;;;;;;;;;;;;AAuBA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;MAElCC,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD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,"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';\nimport Circle, { CircleProps } from '../circle';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { ShapeSize } from '../circle/Circle';\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\nconst mapLegacySize = {\n [String(Size.SMALL)]: 32,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size: sizeProp = 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 const size = mapLegacySize[sizeProp];\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Circle\n ref={reference}\n as=\"button\"\n size={isTinyViewport ? ((size * 2) as ShapeSize) : size}\n type=\"button\"\n className={clsx('np-close-button', className)}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n // @ts-expect-error it's button element\n onClick={onClick}\n >\n <Icon size={sizeProp === Size.SMALL ? 16 : 24} />\n </Circle>\n );\n});\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","CloseButton","forwardRef","ariaLabel","size","sizeProp","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","ref","as","type","clsx","disabled","children"],"mappings":";;;;;;;;;;;;;AAuBA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;MAElCC,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;AACvBC,EAAAA,IAAI,EAAEC,QAAQ,GAAGR,SAAI,CAACE,MAAM;AAC5BO,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;EACtBV,SAAS,KAAKS,IAAI,CAACE,aAAa,CAACC,oBAAQ,CAACZ,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMa,IAAI,GAAGV,MAAM,GAAGW,qBAAe,GAAGC,WAAK,CAAA;AAC7C,EAAA,MAAMd,MAAI,GAAGT,aAAa,CAACU,QAAQ,CAAC,CAAA;EACpC,MAAMc,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;EACxE,oBACEC,cAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,GAAG,EAAEd,SAAU;AACfe,IAAAA,EAAE,EAAC,QAAQ;AACXtB,IAAAA,IAAI,EAAEe,cAAc,GAAKf,MAAI,GAAG,CAAC,GAAkBA,MAAK;AACxDuB,IAAAA,IAAI,EAAC,QAAQ;AACbpB,IAAAA,SAAS,EAAEqB,SAAI,CAAC,iBAAiB,EAAErB,SAAS,CAAE;AAC9C,IAAA,YAAA,EAAYJ,SAAU;AACtB,IAAA,eAAA,EAAeM,UAAW;AAC1BoB,IAAAA,QAAQ,EAAEpB,UAAW;IACrB,aAAaC,EAAAA,MAAAA;AACb;AAAA;AACAF,IAAAA,OAAO,EAAEA,OAAQ;IAAAsB,QAAA,eAEjBP,cAAA,CAACP,IAAI,EAAA;MAACZ,IAAI,EAAEC,QAAQ,KAAKR,SAAI,CAACC,KAAK,GAAG,EAAE,GAAG,EAAA;KAC7C,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
@@ -33,7 +33,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
33
33
  as: "button",
34
34
  size: isTinyViewport ? size * 2 : size,
35
35
  type: "button",
36
- className: clsx('np-close-button', 'text-primary', className),
36
+ className: clsx('np-close-button', className),
37
37
  "aria-label": ariaLabel,
38
38
  "aria-disabled": isDisabled,
39
39
  disabled: isDisabled,
@@ -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';\nimport Circle, { CircleProps } from '../circle';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { ShapeSize } from '../circle/Circle';\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\nconst mapLegacySize = {\n [String(Size.SMALL)]: 32,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size: sizeProp = 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 const size = mapLegacySize[sizeProp];\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Circle\n ref={reference}\n as=\"button\"\n size={isTinyViewport ? ((size * 2) as ShapeSize) : size}\n type=\"button\"\n className={clsx('np-close-button', 'text-primary', className)}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n // @ts-expect-error it's button element\n onClick={onClick}\n >\n <Icon size={sizeProp === Size.SMALL ? 16 : 24} />\n </Circle>\n );\n});\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","CloseButton","forwardRef","ariaLabel","size","sizeProp","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","ref","as","type","clsx","disabled","children"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;MAElCC,WAAW,gBAAGC,UAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;AACvBC,EAAAA,IAAI,EAAEC,QAAQ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ossCircleFill } 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';\nimport Circle, { CircleProps } from '../circle';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { ShapeSize } from '../circle/Circle';\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\nconst mapLegacySize = {\n [String(Size.SMALL)]: 32,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size: sizeProp = 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 const size = mapLegacySize[sizeProp];\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Circle\n ref={reference}\n as=\"button\"\n size={isTinyViewport ? ((size * 2) as ShapeSize) : size}\n type=\"button\"\n className={clsx('np-close-button', className)}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n // @ts-expect-error it's button element\n onClick={onClick}\n >\n <Icon size={sizeProp === Size.SMALL ? 16 : 24} />\n </Circle>\n );\n});\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","CloseButton","forwardRef","ariaLabel","size","sizeProp","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","ref","as","type","clsx","disabled","children"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;MAElCC,WAAW,gBAAGC,UAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;AACvBC,EAAAA,IAAI,EAAEC,QAAQ,GAAGR,IAAI,CAACE,MAAM;AAC5BO,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;EACtBV,SAAS,KAAKS,IAAI,CAACE,aAAa,CAACC,QAAQ,CAACZ,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMa,IAAI,GAAGV,MAAM,GAAGW,eAAe,GAAGC,KAAK,CAAA;AAC7C,EAAA,MAAMd,IAAI,GAAGT,aAAa,CAACU,QAAQ,CAAC,CAAA;EACpC,MAAMc,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;EACxE,oBACEC,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,GAAG,EAAEd,SAAU;AACfe,IAAAA,EAAE,EAAC,QAAQ;AACXtB,IAAAA,IAAI,EAAEe,cAAc,GAAKf,IAAI,GAAG,CAAC,GAAkBA,IAAK;AACxDuB,IAAAA,IAAI,EAAC,QAAQ;AACbpB,IAAAA,SAAS,EAAEqB,IAAI,CAAC,iBAAiB,EAAErB,SAAS,CAAE;AAC9C,IAAA,YAAA,EAAYJ,SAAU;AACtB,IAAA,eAAA,EAAeM,UAAW;AAC1BoB,IAAAA,QAAQ,EAAEpB,UAAW;IACrB,aAAaC,EAAAA,MAAAA;AACb;AAAA;AACAF,IAAAA,OAAO,EAAEA,OAAQ;IAAAsB,QAAA,eAEjBP,GAAA,CAACP,IAAI,EAAA;MAACZ,IAAI,EAAEC,QAAQ,KAAKR,IAAI,CAACC,KAAK,GAAG,EAAE,GAAG,EAAA;KAC7C,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
package/build/main.css CHANGED
@@ -1156,6 +1156,7 @@ div.critical-comms .critical-comms-body {
1156
1156
  border-radius: var(--radius-full);
1157
1157
  width: var(--circle-size);
1158
1158
  height: var(--circle-size);
1159
+ flex-shrink: 0;
1159
1160
  }
1160
1161
  .np-bottom-sheet {
1161
1162
  border-radius: 10px 10px 0 0;
@@ -1260,6 +1261,7 @@ div.critical-comms .critical-comms-body {
1260
1261
  --Card-padding: var(--size-16);
1261
1262
  }
1262
1263
  .np-close-button {
1264
+ color: var(--color-interactive-primary);
1263
1265
  background: none;
1264
1266
  border: none;
1265
1267
  }
@@ -1604,9 +1606,6 @@ button.np-option {
1604
1606
  padding-left: var(--size-16);
1605
1607
  }
1606
1608
  .clear-btn {
1607
- transition: color 0.15s ease-in-out;
1608
- color: #c9cbce;
1609
- color: var(--color-interactive-secondary);
1610
1609
  position: absolute;
1611
1610
  top: 16px;
1612
1611
  top: var(--size-16);
@@ -1644,15 +1643,6 @@ button.np-option {
1644
1643
  .np-theme-personal .clear-btn--lg {
1645
1644
  top: 20px;
1646
1645
  }
1647
- .clear-btn:not(.disabled):not(:disabled):hover,
1648
- .clear-btn:not(.disabled):not(:disabled):focus {
1649
- color: #d03238;
1650
- color: var(--color-interactive-negative-hover);
1651
- }
1652
- .clear-btn:not(.disabled):not(:disabled):active {
1653
- color: #bf1e2c;
1654
- color: var(--color-interactive-negative-active);
1655
- }
1656
1646
  .np-decision .decision {
1657
1647
  display: flex;
1658
1648
  }
@@ -1829,6 +1819,14 @@ button.np-option {
1829
1819
  padding: var(--size-16);
1830
1820
  }
1831
1821
  }
1822
+ .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
1823
+ margin-top: calc(8px * -1);
1824
+ margin-top: calc(var(--size-8) * -1);
1825
+ margin-right: calc(8px * -1);
1826
+ margin-right: calc(var(--size-8) * -1);
1827
+ margin-bottom: calc(8px * -1);
1828
+ margin-bottom: calc(var(--size-8) * -1);
1829
+ }
1832
1830
  .np-drawer .np-drawer-header.np-drawer-header--withborder {
1833
1831
  box-shadow: inset 0 -1px 0 0 #e2e6e8;
1834
1832
  }
@@ -3141,6 +3139,10 @@ a {
3141
3139
  box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
3142
3140
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
3143
3141
  }
3142
+ .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
3143
+ margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
3144
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
3145
+ }
3144
3146
  .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
3145
3147
  box-shadow: none;
3146
3148
  }
@@ -3,4 +3,5 @@
3
3
  border-radius: var(--radius-full);
4
4
  width: var(--circle-size);
5
5
  height: var(--circle-size);
6
+ flex-shrink: 0;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  .np-close-button {
2
+ color: var(--color-interactive-primary);
2
3
  background: none;
3
4
  border: none;
4
5
  }
@@ -9,9 +9,6 @@
9
9
  padding-left: var(--size-16);
10
10
  }
11
11
  .clear-btn {
12
- transition: color 0.15s ease-in-out;
13
- color: #c9cbce;
14
- color: var(--color-interactive-secondary);
15
12
  position: absolute;
16
13
  top: 16px;
17
14
  top: var(--size-16);
@@ -49,12 +46,3 @@
49
46
  .np-theme-personal .clear-btn--lg {
50
47
  top: 20px;
51
48
  }
52
- .clear-btn:not(.disabled):not(:disabled):hover,
53
- .clear-btn:not(.disabled):not(:disabled):focus {
54
- color: #d03238;
55
- color: var(--color-interactive-negative-hover);
56
- }
57
- .clear-btn:not(.disabled):not(:disabled):active {
58
- color: #bf1e2c;
59
- color: var(--color-interactive-negative-active);
60
- }
@@ -34,6 +34,14 @@
34
34
  padding: var(--size-16);
35
35
  }
36
36
  }
37
+ .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
38
+ margin-top: calc(8px * -1);
39
+ margin-top: calc(var(--size-8) * -1);
40
+ margin-right: calc(8px * -1);
41
+ margin-right: calc(var(--size-8) * -1);
42
+ margin-bottom: calc(8px * -1);
43
+ margin-bottom: calc(var(--size-8) * -1);
44
+ }
37
45
  .np-drawer .np-drawer-header.np-drawer-header--withborder {
38
46
  box-shadow: inset 0 -1px 0 0 #e2e6e8;
39
47
  }
@@ -1156,6 +1156,7 @@ div.critical-comms .critical-comms-body {
1156
1156
  border-radius: var(--radius-full);
1157
1157
  width: var(--circle-size);
1158
1158
  height: var(--circle-size);
1159
+ flex-shrink: 0;
1159
1160
  }
1160
1161
  .np-bottom-sheet {
1161
1162
  border-radius: 10px 10px 0 0;
@@ -1260,6 +1261,7 @@ div.critical-comms .critical-comms-body {
1260
1261
  --Card-padding: var(--size-16);
1261
1262
  }
1262
1263
  .np-close-button {
1264
+ color: var(--color-interactive-primary);
1263
1265
  background: none;
1264
1266
  border: none;
1265
1267
  }
@@ -1604,9 +1606,6 @@ button.np-option {
1604
1606
  padding-left: var(--size-16);
1605
1607
  }
1606
1608
  .clear-btn {
1607
- transition: color 0.15s ease-in-out;
1608
- color: #c9cbce;
1609
- color: var(--color-interactive-secondary);
1610
1609
  position: absolute;
1611
1610
  top: 16px;
1612
1611
  top: var(--size-16);
@@ -1644,15 +1643,6 @@ button.np-option {
1644
1643
  .np-theme-personal .clear-btn--lg {
1645
1644
  top: 20px;
1646
1645
  }
1647
- .clear-btn:not(.disabled):not(:disabled):hover,
1648
- .clear-btn:not(.disabled):not(:disabled):focus {
1649
- color: #d03238;
1650
- color: var(--color-interactive-negative-hover);
1651
- }
1652
- .clear-btn:not(.disabled):not(:disabled):active {
1653
- color: #bf1e2c;
1654
- color: var(--color-interactive-negative-active);
1655
- }
1656
1646
  .np-decision .decision {
1657
1647
  display: flex;
1658
1648
  }
@@ -1829,6 +1819,14 @@ button.np-option {
1829
1819
  padding: var(--size-16);
1830
1820
  }
1831
1821
  }
1822
+ .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
1823
+ margin-top: calc(8px * -1);
1824
+ margin-top: calc(var(--size-8) * -1);
1825
+ margin-right: calc(8px * -1);
1826
+ margin-right: calc(var(--size-8) * -1);
1827
+ margin-bottom: calc(8px * -1);
1828
+ margin-bottom: calc(var(--size-8) * -1);
1829
+ }
1832
1830
  .np-drawer .np-drawer-header.np-drawer-header--withborder {
1833
1831
  box-shadow: inset 0 -1px 0 0 #e2e6e8;
1834
1832
  }
@@ -3141,6 +3139,10 @@ a {
3141
3139
  box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
3142
3140
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
3143
3141
  }
3142
+ .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
3143
+ margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
3144
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
3145
+ }
3144
3146
  .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
3145
3147
  box-shadow: none;
3146
3148
  }
@@ -37,6 +37,10 @@
37
37
  box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
38
38
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
39
39
  }
40
+ .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
41
+ margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
42
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
43
+ }
40
44
  .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
41
45
  box-shadow: none;
42
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/alert/Alert.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AASjE,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,kDAAkD;AAClD,KAAK,mBAAmB,GAAG,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;AACrF,KAAK,iBAAiB,GAAG,GACrB,SAAS,CAAC,QAAQ,GAClB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,QAAQ,EAAE,CAAC;AACzB,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAEhE,oBAAY,kBAAkB;IAC5B,QAAQ,YAAY;IACpB,GAAG,cAAc;IACjB,SAAS,aAAa;IACtB,WAAW,cAAc;IACzB,MAAM,gBAAgB;IACtB,YAAY,eAAe;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,yIAAyI;IACzI,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,OAAO,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-b8a9275",
3
+ "version": "0.0.0-experimental-2255abe",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -92,12 +92,12 @@
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
94
  "@transferwise/less-config": "3.1.0",
95
- "@transferwise/neptune-css": "0.0.0-experimental-b8a9275",
95
+ "@transferwise/neptune-css": "0.0.0-experimental-2255abe",
96
96
  "@wise/components-theming": "1.6.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
100
- "@transferwise/neptune-css": "0.0.0-experimental-b8a9275",
100
+ "@transferwise/neptune-css": "0.0.0-experimental-2255abe",
101
101
  "@wise/art": "^2.7.0",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
@@ -185,7 +185,11 @@ export default function Alert({
185
185
  </div>
186
186
  </div>
187
187
  {onDismiss && (
188
- <CloseButton ref={closeButtonReference} className="m-l-2" onClick={onDismiss} />
188
+ <CloseButton
189
+ ref={closeButtonReference}
190
+ className="text-secondary m-l-2"
191
+ onClick={onDismiss}
192
+ />
189
193
  )}
190
194
  </div>
191
195
  );
@@ -78,7 +78,7 @@ const Chip = ({
78
78
  ref={closeButtonReference}
79
79
  aria-label={closeButton?.['aria-label']}
80
80
  size="sm"
81
- filled
81
+ filled={isModern}
82
82
  onClick={onRemove}
83
83
  />
84
84
  ) : null}
@@ -123,13 +123,13 @@ exports[`Chips Filter Chips renders as expected 1`] = `
123
123
  </span>
124
124
  <button
125
125
  aria-label="Clear Payments"
126
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary"
126
+ class="np-circle d-flex align-items-center justify-content-center np-close-button"
127
127
  style="--circle-size: var(--size-32);"
128
128
  type="button"
129
129
  >
130
130
  <span
131
- class="tw-icon tw-icon-cross-circle-fill "
132
- data-testid="cross-circle-fill-icon"
131
+ class="tw-icon tw-icon-cross "
132
+ data-testid="cross-icon"
133
133
  >
134
134
  <svg
135
135
  aria-hidden="true"
@@ -141,9 +141,7 @@ exports[`Chips Filter Chips renders as expected 1`] = `
141
141
  width="16"
142
142
  >
143
143
  <path
144
- clip-rule="evenodd"
145
- d="M1.714 12C1.714 6.344 6.343 1.716 12 1.716S22.286 6.343 22.286 12c0 5.657-4.629 10.285-10.286 10.285S1.714 17.658 1.714 12.001ZM12 10.8l4.243-4.244 1.2 1.2L13.2 12l4.243 4.243-1.2 1.2L12 13.2l-4.243 4.243-1.2-1.2L10.8 12 6.557 7.756l1.2-1.2L12 10.8Z"
146
- fill-rule="evenodd"
144
+ d="m19.629 5.915-1.2-1.2-6.257 6.257-6.258-6.257-1.2 1.2 6.258 6.257-6.258 6.257 1.2 1.2 6.258-6.257 6.257 6.257 1.2-1.2-6.258-6.257 6.258-6.257Z"
147
145
  />
148
146
  </svg>
149
147
  </span>
@@ -35,7 +35,7 @@ exports[`BottomSheet renders content when open 1`] = `
35
35
  />
36
36
  <button
37
37
  aria-label="Close"
38
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary sr-only np-bottom-sheet--close-btn"
38
+ class="np-circle d-flex align-items-center justify-content-center np-close-button sr-only np-bottom-sheet--close-btn"
39
39
  style="--circle-size: var(--size-32);"
40
40
  type="button"
41
41
  >
@@ -3,4 +3,5 @@
3
3
  border-radius: var(--radius-full);
4
4
  width: var(--circle-size);
5
5
  height: var(--circle-size);
6
+ flex-shrink: 0;
6
7
  }
@@ -2,4 +2,5 @@
2
2
  border-radius: var(--radius-full);
3
3
  width: var(--circle-size);
4
4
  height: var(--circle-size);
5
+ flex-shrink: 0;
5
6
  }
@@ -1,4 +1,5 @@
1
1
  .np-close-button {
2
+ color: var(--color-interactive-primary);
2
3
  background: none;
3
4
  border: none;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  .np-close-button {
2
+ color: var(--color-interactive-primary);
2
3
  background: none;
3
4
  border: none;
4
5
 
@@ -50,7 +50,7 @@ export const CloseButton = forwardRef(function CloseButton(
50
50
  as="button"
51
51
  size={isTinyViewport ? ((size * 2) as ShapeSize) : size}
52
52
  type="button"
53
- className={clsx('np-close-button', 'text-primary', className)}
53
+ className={clsx('np-close-button', className)}
54
54
  aria-label={ariaLabel}
55
55
  aria-disabled={isDisabled}
56
56
  disabled={isDisabled}
@@ -4,7 +4,7 @@ exports[`CloseButton renders as expected 1`] = `
4
4
  <div>
5
5
  <button
6
6
  aria-label="Close"
7
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary className"
7
+ class="np-circle d-flex align-items-center justify-content-center np-close-button className"
8
8
  style="--circle-size: var(--size-40);"
9
9
  type="button"
10
10
  >
@@ -9,9 +9,6 @@
9
9
  padding-left: var(--size-16);
10
10
  }
11
11
  .clear-btn {
12
- transition: color 0.15s ease-in-out;
13
- color: #c9cbce;
14
- color: var(--color-interactive-secondary);
15
12
  position: absolute;
16
13
  top: 16px;
17
14
  top: var(--size-16);
@@ -49,12 +46,3 @@
49
46
  .np-theme-personal .clear-btn--lg {
50
47
  top: 20px;
51
48
  }
52
- .clear-btn:not(.disabled):not(:disabled):hover,
53
- .clear-btn:not(.disabled):not(:disabled):focus {
54
- color: #d03238;
55
- color: var(--color-interactive-negative-hover);
56
- }
57
- .clear-btn:not(.disabled):not(:disabled):active {
58
- color: #bf1e2c;
59
- color: var(--color-interactive-negative-active);
60
- }
@@ -13,8 +13,6 @@
13
13
  }
14
14
 
15
15
  .clear-btn {
16
- transition: color 0.15s ease-in-out;
17
- color: var(--color-interactive-secondary);
18
16
  position: absolute;
19
17
  top: var(--size-16);
20
18
  .right(var(--size-16));
@@ -39,13 +37,4 @@
39
37
  top: 20px;
40
38
  }
41
39
  }
42
-
43
- &:not(.disabled, :disabled):hover,
44
- &:not(.disabled, :disabled):focus {
45
- color: var(--color-interactive-negative-hover);
46
- }
47
-
48
- &:not(.disabled, :disabled):active {
49
- color: var(--color-interactive-negative-active);
50
- }
51
40
  }
@@ -34,6 +34,14 @@
34
34
  padding: var(--size-16);
35
35
  }
36
36
  }
37
+ .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
38
+ margin-top: calc(8px * -1);
39
+ margin-top: calc(var(--size-8) * -1);
40
+ margin-right: calc(8px * -1);
41
+ margin-right: calc(var(--size-8) * -1);
42
+ margin-bottom: calc(8px * -1);
43
+ margin-bottom: calc(var(--size-8) * -1);
44
+ }
37
45
  .np-drawer .np-drawer-header.np-drawer-header--withborder {
38
46
  box-shadow: inset 0 -1px 0 0 #e2e6e8;
39
47
  }
@@ -27,6 +27,14 @@
27
27
  @media (--screen-400-zoom) {
28
28
  padding: var(--size-16);
29
29
  }
30
+
31
+ .np-close-button {
32
+ @close-btn-margin: calc(var(--size-8) * -1);
33
+
34
+ margin-top: @close-btn-margin;
35
+ margin-right: @close-btn-margin;
36
+ margin-bottom: @close-btn-margin;
37
+ }
30
38
  }
31
39
 
32
40
  &.np-drawer-header--withborder {
@@ -20,7 +20,7 @@ exports[`Drawer renders content when open 1`] = `
20
20
  >
21
21
  <button
22
22
  aria-label="Close"
23
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary"
23
+ class="np-circle d-flex align-items-center justify-content-center np-close-button"
24
24
  style="--circle-size: var(--size-40);"
25
25
  type="button"
26
26
  >
@@ -36,7 +36,7 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
36
36
  />
37
37
  <button
38
38
  aria-label="Close"
39
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary"
39
+ class="np-circle d-flex align-items-center justify-content-center np-close-button"
40
40
  style="--circle-size: var(--size-48);"
41
41
  type="button"
42
42
  >
@@ -154,7 +154,7 @@ exports[`FlowNavigation renders as expected 1`] = `
154
154
  />
155
155
  <button
156
156
  aria-label="Close"
157
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary"
157
+ class="np-circle d-flex align-items-center justify-content-center np-close-button"
158
158
  style="--circle-size: var(--size-48);"
159
159
  type="button"
160
160
  >
package/src/main.css CHANGED
@@ -1156,6 +1156,7 @@ div.critical-comms .critical-comms-body {
1156
1156
  border-radius: var(--radius-full);
1157
1157
  width: var(--circle-size);
1158
1158
  height: var(--circle-size);
1159
+ flex-shrink: 0;
1159
1160
  }
1160
1161
  .np-bottom-sheet {
1161
1162
  border-radius: 10px 10px 0 0;
@@ -1260,6 +1261,7 @@ div.critical-comms .critical-comms-body {
1260
1261
  --Card-padding: var(--size-16);
1261
1262
  }
1262
1263
  .np-close-button {
1264
+ color: var(--color-interactive-primary);
1263
1265
  background: none;
1264
1266
  border: none;
1265
1267
  }
@@ -1604,9 +1606,6 @@ button.np-option {
1604
1606
  padding-left: var(--size-16);
1605
1607
  }
1606
1608
  .clear-btn {
1607
- transition: color 0.15s ease-in-out;
1608
- color: #c9cbce;
1609
- color: var(--color-interactive-secondary);
1610
1609
  position: absolute;
1611
1610
  top: 16px;
1612
1611
  top: var(--size-16);
@@ -1644,15 +1643,6 @@ button.np-option {
1644
1643
  .np-theme-personal .clear-btn--lg {
1645
1644
  top: 20px;
1646
1645
  }
1647
- .clear-btn:not(.disabled):not(:disabled):hover,
1648
- .clear-btn:not(.disabled):not(:disabled):focus {
1649
- color: #d03238;
1650
- color: var(--color-interactive-negative-hover);
1651
- }
1652
- .clear-btn:not(.disabled):not(:disabled):active {
1653
- color: #bf1e2c;
1654
- color: var(--color-interactive-negative-active);
1655
- }
1656
1646
  .np-decision .decision {
1657
1647
  display: flex;
1658
1648
  }
@@ -1829,6 +1819,14 @@ button.np-option {
1829
1819
  padding: var(--size-16);
1830
1820
  }
1831
1821
  }
1822
+ .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
1823
+ margin-top: calc(8px * -1);
1824
+ margin-top: calc(var(--size-8) * -1);
1825
+ margin-right: calc(8px * -1);
1826
+ margin-right: calc(var(--size-8) * -1);
1827
+ margin-bottom: calc(8px * -1);
1828
+ margin-bottom: calc(var(--size-8) * -1);
1829
+ }
1832
1830
  .np-drawer .np-drawer-header.np-drawer-header--withborder {
1833
1831
  box-shadow: inset 0 -1px 0 0 #e2e6e8;
1834
1832
  }
@@ -3141,6 +3139,10 @@ a {
3141
3139
  box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
3142
3140
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
3143
3141
  }
3142
+ .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
3143
+ margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
3144
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
3145
+ }
3144
3146
  .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
3145
3147
  box-shadow: none;
3146
3148
  }
@@ -37,6 +37,10 @@
37
37
  box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
38
38
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
39
39
  }
40
+ .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
41
+ margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
42
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
43
+ }
40
44
  .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
41
45
  box-shadow: none;
42
46
  }
@@ -43,6 +43,10 @@
43
43
 
44
44
  .np-theme-personal & {
45
45
  box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
46
+
47
+ .np-close-button {
48
+ margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
49
+ }
46
50
  }
47
51
 
48
52
  &.modal--withoutborder {
@@ -33,7 +33,7 @@ exports[`OverlayHeader renders as expected 1`] = `
33
33
  />
34
34
  <button
35
35
  aria-label="Close"
36
- class="np-circle d-flex align-items-center justify-content-center np-close-button text-primary"
36
+ class="np-circle d-flex align-items-center justify-content-center np-close-button"
37
37
  style="--circle-size: var(--size-48);"
38
38
  type="button"
39
39
  >