@transferwise/components 46.88.1 → 46.89.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.
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +19 -3
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +19 -3
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +23 -20
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +20 -17
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatar/avatarTypes.js +3 -1
- package/build/avatar/avatarTypes.js.map +1 -1
- package/build/avatar/avatarTypes.mjs +3 -1
- package/build/avatar/avatarTypes.mjs.map +1 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/button/Button.js +2 -2
- package/build/button/Button.mjs +2 -2
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/carousel/Carousel.js +9 -8
- package/build/carousel/Carousel.js.map +1 -1
- package/build/carousel/Carousel.mjs +9 -8
- package/build/carousel/Carousel.mjs.map +1 -1
- package/build/common/action/Action.js +26 -15
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +26 -15
- package/build/common/action/Action.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js +2 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +2 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +10 -73
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/iconButton/IconButton.js +2 -2
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs +2 -2
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/link/Link.js +2 -2
- package/build/link/Link.mjs +2 -2
- package/build/main.css +46 -75
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -0
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -0
- package/build/primitives/PrimitiveButton/{src/PrimitiveButton.js → PrimitiveButton.js} +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -0
- package/build/primitives/PrimitiveButton/{src/PrimitiveButton.mjs → PrimitiveButton.mjs} +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -0
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/alert/Alert.css +4 -0
- package/build/styles/carousel/Carousel.css +0 -8
- package/build/styles/common/closeButton/CloseButton.css +15 -0
- package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -73
- package/build/styles/main.css +46 -75
- package/build/table/TableCell.js +7 -1
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs +7 -1
- package/build/table/TableCell.mjs.map +1 -1
- package/build/test-utils/assets/wise-card.svg +1 -0
- package/build/types/actionButton/ActionButton.d.ts +6 -0
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +2 -1
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/alert/Alert.d.ts +3 -4
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts +3 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatar/avatarTypes.d.ts +3 -0
- package/build/types/avatar/avatarTypes.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +3 -0
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/button/Button.resolver.d.ts +1 -4
- package/build/types/button/Button.resolver.d.ts.map +1 -1
- package/build/types/button/LegacyButton.d.ts +30 -7
- package/build/types/button/LegacyButton.d.ts.map +1 -1
- package/build/types/carousel/Carousel.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +5 -2
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +3 -3
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +2 -2
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.d.ts → PrimitiveAnchor.d.ts} +1 -1
- package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.d.ts.map +1 -0
- package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.d.ts → PrimitiveAnchor.types.d.ts} +1 -1
- package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -0
- package/build/types/primitives/PrimitiveAnchor/index.d.ts +2 -2
- package/build/types/primitives/PrimitiveAnchor/index.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.d.ts → PrimitiveButton.d.ts} +1 -1
- package/build/types/primitives/PrimitiveButton/PrimitiveButton.d.ts.map +1 -0
- package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.types.d.ts → PrimitiveButton.types.d.ts} +1 -1
- package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -0
- package/build/types/primitives/PrimitiveButton/index.d.ts +2 -2
- package/build/types/primitives/PrimitiveButton/index.d.ts.map +1 -1
- package/build/types/select/Select.d.ts +1 -3
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/table/TableCell.d.ts +6 -3
- package/build/types/table/TableCell.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/actionButton/ActionButton.story.tsx +6 -1
- package/src/actionButton/ActionButton.tsx +6 -0
- package/src/actionOption/ActionOption.story.tsx +9 -6
- package/src/actionOption/ActionOption.tsx +29 -5
- package/src/alert/Alert.css +4 -0
- package/src/alert/Alert.less +4 -0
- package/src/alert/Alert.spec.tsx +0 -30
- package/src/alert/Alert.story.tsx +74 -2
- package/src/alert/Alert.tsx +18 -21
- package/src/avatar/Avatar.tsx +3 -0
- package/src/avatar/avatarTypes.ts +3 -1
- package/src/badge/Badge.tsx +3 -0
- package/src/button/LegacyButton.tsx +31 -9
- package/src/carousel/Carousel.css +0 -8
- package/src/carousel/Carousel.less +0 -7
- package/src/carousel/Carousel.spec.tsx +2 -2
- package/src/carousel/Carousel.tsx +11 -10
- package/src/common/action/Action.tsx +40 -22
- package/src/common/closeButton/CloseButton.css +15 -0
- package/src/common/closeButton/CloseButton.less +10 -0
- package/src/common/closeButton/CloseButton.tsx +4 -3
- package/src/criticalBanner/CriticalCommsBanner.css +33 -73
- package/src/criticalBanner/CriticalCommsBanner.less +37 -64
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +26 -4
- package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
- package/src/iconButton/IconButton.tsx +4 -1
- package/src/main.css +46 -75
- package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.tsx → PrimitiveAnchor.tsx} +1 -1
- package/src/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.types.ts → PrimitiveAnchor.types.ts} +1 -1
- package/src/primitives/PrimitiveAnchor/index.ts +6 -2
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +1 -1
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -1
- package/src/primitives/PrimitiveButton/{src/PrimitiveButton.tsx → PrimitiveButton.tsx} +2 -2
- package/src/primitives/PrimitiveButton/{src/PrimitiveButton.types.ts → PrimitiveButton.types.ts} +1 -1
- package/src/primitives/PrimitiveButton/index.ts +6 -2
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +1 -1
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +1 -1
- package/src/select/Select.tsx +1 -1
- package/src/table/Table.story.tsx +59 -1
- package/src/table/TableCell.spec.tsx +17 -0
- package/src/table/TableCell.tsx +14 -5
- package/src/test-utils/assets/wise-card.svg +1 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +0 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +0 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +0 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +0 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +0 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +0 -1
- package/build/types/primitives/PrimitiveAnchor/src/index.d.ts +0 -3
- package/build/types/primitives/PrimitiveAnchor/src/index.d.ts.map +0 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +0 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.types.d.ts.map +0 -1
- package/build/types/primitives/PrimitiveButton/src/index.d.ts +0 -3
- package/build/types/primitives/PrimitiveButton/src/index.d.ts.map +0 -1
- package/src/primitives/PrimitiveAnchor/src/index.ts +0 -6
- package/src/primitives/PrimitiveButton/src/index.ts +0 -6
- /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.js → PrimitiveAnchor.js} +0 -0
- /package/build/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.mjs → PrimitiveAnchor.mjs} +0 -0
|
@@ -4,12 +4,12 @@ export type Props = {
|
|
|
4
4
|
priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal';
|
|
5
5
|
type?: 'default' | 'negative';
|
|
6
6
|
'data-testid'?: string;
|
|
7
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> & Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'role' | 'children' | 'aria-label'>;
|
|
7
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick'> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> & Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'role' | 'children' | 'aria-label' | 'tabIndex'>;
|
|
8
8
|
declare const IconButton: import("react").ForwardRefExoticComponent<{
|
|
9
9
|
size?: 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
10
10
|
priority?: "primary" | "secondary" | "tertiary" | "minimal";
|
|
11
11
|
type?: "default" | "negative";
|
|
12
12
|
'data-testid'?: string;
|
|
13
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "disabled"> & Pick<HTMLAttributes<HTMLDivElement>, "className" | "role" | "aria-label" | "children"> & import("react").RefAttributes<unknown>>;
|
|
13
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "disabled"> & Pick<HTMLAttributes<HTMLDivElement>, "className" | "tabIndex" | "role" | "aria-label" | "children"> & import("react").RefAttributes<unknown>>;
|
|
14
14
|
export default IconButton;
|
|
15
15
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/iconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAc,cAAc,EAAE,MAAM,OAAO,CAAC;AAK/F,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,G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C5B,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS;WACpD,SAAS,GAAG,UAAU;oBACb,MAAM;wSA0CtB,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
package/build/types/primitives/PrimitiveAnchor/{src/PrimitiveAnchor.d.ts → PrimitiveAnchor.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PrimitiveAnchorProps } from '
|
|
2
|
+
import type { PrimitiveAnchorProps } from '.';
|
|
3
3
|
/**
|
|
4
4
|
* The Primitive `PrimitiveAnchor` component is customisable link element that can be
|
|
5
5
|
* used in various parts of the Wise Design System internally. It supports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveAnchor.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveAnchor/PrimitiveAnchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAE9C;;;;;;;;GAQG;AACH,QAAA,MAAM,eAAe,6GAkGpB,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveAnchor.types.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACtF,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,oBACf,SAAQ,kBAAkB,EACxB,SAAS,EACT,IAAI,CAAC,yBAAyB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,sCAAsC;IACtC,GAAG,CAAC,EAAE,yBAAyB,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;CACtC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from './
|
|
2
|
-
export
|
|
1
|
+
export { default } from './PrimitiveAnchor';
|
|
2
|
+
export type { PrimitiveAnchorProps, PrimitiveAnchorAttributes, PrimitiveAnchorElementRef, } from './PrimitiveAnchor.types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveAnchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveAnchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC"}
|
package/build/types/primitives/PrimitiveButton/{src/PrimitiveButton.d.ts → PrimitiveButton.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PrimitiveButtonProps } from '
|
|
2
|
+
import type { PrimitiveButtonProps } from '.';
|
|
3
3
|
/**
|
|
4
4
|
* The Primitive `PrimitiveButton` component can be used in various parts the Wise Design
|
|
5
5
|
* System internally. It supports different states such as disabled and loading,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveButton.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveButton/PrimitiveButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAE9C;;;;;;;;GAQG;AACH,QAAA,MAAM,eAAe,6GAsGpB,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveButton.types.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveButton/PrimitiveButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC;AACpG,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,oBACf,SAAQ,kBAAkB,EACxB,SAAS,EACT,yBAAyB;IAC3B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,sCAAsC;IACtC,GAAG,CAAC,EAAE,yBAAyB,CAAC;CACjC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from './
|
|
2
|
-
export
|
|
1
|
+
export { default } from './PrimitiveButton';
|
|
2
|
+
export type { PrimitiveButtonProps, PrimitiveButtonAttributes, PrimitiveButtonElementRef, } from './PrimitiveButton.types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/PrimitiveButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC"}
|
|
@@ -43,9 +43,7 @@ export interface SelectProps {
|
|
|
43
43
|
searchPlaceholder?: string;
|
|
44
44
|
classNames?: Record<string, string>;
|
|
45
45
|
dropdownUp?: boolean;
|
|
46
|
-
buttonProps?:
|
|
47
|
-
as?: 'button';
|
|
48
|
-
}>;
|
|
46
|
+
buttonProps?: ButtonProps;
|
|
49
47
|
dropdownProps?: React.ComponentPropsWithoutRef<'ul'>;
|
|
50
48
|
onChange: (value: SelectItem | typeof DEFAULT_SELECTED_OPTION) => void;
|
|
51
49
|
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.tsx"],"names":[],"mappings":"AAKA,OAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAY,IAAI,EAAE,MAAM,WAAW,CAAC;AAkB3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAA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AE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAID;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,WAAW,EACX,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,IAAW,EACX,KAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EAAE,cAAc,EACvB,cAAc,EACd,WAAW,EAAE,eAAoB,EACjC,iBAAiB,EACjB,UAAU,EAAE,cAAkC,EAC9C,UAAU,EACV,aAAa,EACb,WAAW,GACZ,EAAE,WAAW,+BA6cb"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ImgHTMLAttributes } from 'react';
|
|
2
2
|
import { MoneyProps } from '../money';
|
|
3
3
|
interface TableCellTypeProp {
|
|
4
|
-
type: 'leading' | 'text' | 'currency' | 'status';
|
|
4
|
+
type: 'leading' | 'text' | 'currency' | 'status' | 'media';
|
|
5
5
|
}
|
|
6
6
|
interface TableCellTextProps {
|
|
7
7
|
primaryText?: string;
|
|
@@ -10,6 +10,9 @@ interface TableCellTextProps {
|
|
|
10
10
|
interface TableCellStatusProp {
|
|
11
11
|
status?: 'error' | 'success';
|
|
12
12
|
}
|
|
13
|
+
export interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {
|
|
14
|
+
media?: ImgHTMLAttributes<HTMLImageElement>;
|
|
15
|
+
}
|
|
13
16
|
export interface TableCellLeading extends TableCellTypeProp, TableCellTextProps, TableCellStatusProp {
|
|
14
17
|
avatar?: {
|
|
15
18
|
src?: string;
|
|
@@ -27,7 +30,7 @@ export interface TableCellStatus extends TableCellTypeProp, TableCellTextProps {
|
|
|
27
30
|
sentiment?: 'negative' | 'neutral' | 'positive' | 'warning' | 'pending';
|
|
28
31
|
}
|
|
29
32
|
export interface TableCellType {
|
|
30
|
-
cell?: TableCellLeading & TableCellText & TableCellCurrency & TableCellStatus;
|
|
33
|
+
cell?: TableCellLeading & TableCellText & TableCellCurrency & TableCellStatus & TableCellMedia;
|
|
31
34
|
alignment?: 'left' | 'right';
|
|
32
35
|
}
|
|
33
36
|
export interface TableCellProps extends TableCellType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/table/TableCell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/table/TableCell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG7C,UAAU,iBAAiB;IACzB,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC5D;AAGD,UAAU,kBAAkB;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,UAAU,mBAAmB;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,kBAAkB;IAC3E,KAAK,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,gBACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,mBAAmB;IACrB,MAAM,CAAC,EAAE;QACP,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,mBAAmB;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,mBAAmB;IAC/E,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,eAAgB,SAAQ,iBAAiB,EAAE,kBAAkB;IAC5E,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;CACzE;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,iBAAiB,GAAG,eAAe,GAAG,cAAc,CAAC;IAC/F,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAGD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,SAAS,sDAAgE,cAAc,sBA4F5F,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.89.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
"rollup": "^4.18.1",
|
|
92
92
|
"rollup-preserve-directives": "^1.1.1",
|
|
93
93
|
"storybook": "^8.2.2",
|
|
94
|
-
"@transferwise/
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
94
|
+
"@transferwise/less-config": "3.1.0",
|
|
95
|
+
"@transferwise/neptune-css": "14.21.1",
|
|
96
|
+
"@wise/components-theming": "1.6.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@transferwise/icons": "^3.13.1",
|
|
@@ -5,9 +5,14 @@ import { storyConfig } from '../test-utils/story-config';
|
|
|
5
5
|
|
|
6
6
|
import ActionButton from './ActionButton';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* This component is deprecated please use new [Button](?path=/docs/actions-button--docs).
|
|
10
|
+
*
|
|
11
|
+
* For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://wise.design/components/button).
|
|
12
|
+
*/
|
|
8
13
|
export default {
|
|
9
14
|
component: ActionButton,
|
|
10
|
-
title: 'Actions/ActionButton',
|
|
15
|
+
title: 'Actions/ActionButton (Deprecated)',
|
|
11
16
|
tags: ['autodocs'],
|
|
12
17
|
} satisfies Meta<typeof ActionButton>;
|
|
13
18
|
|
|
@@ -3,6 +3,9 @@ import { ButtonHTMLAttributes, forwardRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { Priority, PriorityPrimary, PrioritySecondary, PriorityTertiary } from '../common';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use `<Button />` component instead with `ButtonProps`
|
|
8
|
+
*/
|
|
6
9
|
export type ActionButtonProps = {
|
|
7
10
|
priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary;
|
|
8
11
|
/**
|
|
@@ -11,6 +14,9 @@ export type ActionButtonProps = {
|
|
|
11
14
|
text?: string;
|
|
12
15
|
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
13
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use `<Button v2 size="sm" priority={'primary' / 'secondary-neutral' / 'tertiary'} .. />` component instead
|
|
19
|
+
*/
|
|
14
20
|
const ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(
|
|
15
21
|
(
|
|
16
22
|
{
|
|
@@ -25,12 +25,15 @@ export const Basic: Story = {
|
|
|
25
25
|
render: (args) => <ActionOption {...args} />,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export const
|
|
29
|
-
render: (args) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
export const Variants: Story = {
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<>
|
|
31
|
+
<ActionOption priority="primary" {...args} title="priority = primary" />
|
|
32
|
+
<ActionOption priority="secondary" {...args} title="priority = secondary" />
|
|
33
|
+
<ActionOption priority="secondary-send" {...args} title="priority = secondary-send" />
|
|
34
|
+
<ActionOption priority="tertiary" {...args} title="priority = tertiary" />
|
|
35
|
+
</>
|
|
36
|
+
),
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
export const WithContainerContent: Story = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import Button from '../button';
|
|
4
4
|
import {
|
|
5
5
|
CommonProps,
|
|
6
6
|
Priority,
|
|
@@ -9,6 +9,13 @@ import {
|
|
|
9
9
|
PriorityTertiary,
|
|
10
10
|
} from '../common';
|
|
11
11
|
import Option from '../common/Option';
|
|
12
|
+
import { ButtonPriority } from '../button/Button.types';
|
|
13
|
+
|
|
14
|
+
type ActionOptionPriority =
|
|
15
|
+
| PriorityPrimary
|
|
16
|
+
| PrioritySecondary
|
|
17
|
+
| PriorityTertiary
|
|
18
|
+
| 'secondary-send';
|
|
12
19
|
|
|
13
20
|
export type ActionOptionProps = {
|
|
14
21
|
complex?: boolean;
|
|
@@ -19,7 +26,7 @@ export type ActionOptionProps = {
|
|
|
19
26
|
onClick: () => void;
|
|
20
27
|
title: React.ReactNode;
|
|
21
28
|
action: React.ReactNode;
|
|
22
|
-
priority?:
|
|
29
|
+
priority?: ActionOptionPriority;
|
|
23
30
|
showMediaCircle?: boolean;
|
|
24
31
|
isContainerAligned?: boolean;
|
|
25
32
|
as?: React.ElementType;
|
|
@@ -67,18 +74,35 @@ const ActionOption = ({
|
|
|
67
74
|
return labels.join(', ') || undefined;
|
|
68
75
|
};
|
|
69
76
|
|
|
77
|
+
const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {
|
|
78
|
+
switch (priority) {
|
|
79
|
+
case 'primary':
|
|
80
|
+
return 'primary';
|
|
81
|
+
case 'secondary':
|
|
82
|
+
return 'secondary-neutral';
|
|
83
|
+
case 'tertiary':
|
|
84
|
+
return 'tertiary';
|
|
85
|
+
case 'secondary-send':
|
|
86
|
+
return 'secondary';
|
|
87
|
+
default:
|
|
88
|
+
return 'primary';
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
70
92
|
return (
|
|
71
93
|
<Option
|
|
72
94
|
{...sharedProps}
|
|
73
95
|
button={
|
|
74
|
-
<
|
|
75
|
-
|
|
96
|
+
<Button
|
|
97
|
+
v2
|
|
98
|
+
size="sm"
|
|
99
|
+
priority={mapPriority(priority)}
|
|
76
100
|
disabled={disabled}
|
|
77
101
|
aria-label={getAriaLabel()}
|
|
78
102
|
onClick={onClick}
|
|
79
103
|
>
|
|
80
104
|
{action}
|
|
81
|
-
</
|
|
105
|
+
</Button>
|
|
82
106
|
}
|
|
83
107
|
/>
|
|
84
108
|
);
|
package/src/alert/Alert.css
CHANGED
package/src/alert/Alert.less
CHANGED
package/src/alert/Alert.spec.tsx
CHANGED
|
@@ -445,36 +445,6 @@ describe('Alert', () => {
|
|
|
445
445
|
});
|
|
446
446
|
|
|
447
447
|
describe('with personal theme', () => {
|
|
448
|
-
it('renders mobile variant if passed in', () => {
|
|
449
|
-
render(
|
|
450
|
-
<ThemeProvider theme={Theme.PERSONAL}>
|
|
451
|
-
<Alert message={message} variant={Variant.MOBILE} />
|
|
452
|
-
</ThemeProvider>,
|
|
453
|
-
);
|
|
454
|
-
|
|
455
|
-
expect(screen.getByTestId('mobile')).toBeInTheDocument();
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
it('renders desktop variant if passed in', () => {
|
|
459
|
-
render(
|
|
460
|
-
<ThemeProvider theme={Theme.PERSONAL}>
|
|
461
|
-
<Alert message={message} variant={Variant.DESKTOP} />
|
|
462
|
-
</ThemeProvider>,
|
|
463
|
-
);
|
|
464
|
-
|
|
465
|
-
expect(screen.getByTestId('desktop')).toBeInTheDocument();
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
it('renders desktop variant by default', () => {
|
|
469
|
-
render(
|
|
470
|
-
<ThemeProvider theme={Theme.PERSONAL}>
|
|
471
|
-
<Alert message={message} />
|
|
472
|
-
</ThemeProvider>,
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
expect(screen.getByTestId('desktop')).toBeInTheDocument();
|
|
476
|
-
});
|
|
477
|
-
|
|
478
448
|
it('renders StatusIcon for Personal theme', () => {
|
|
479
449
|
render(
|
|
480
450
|
<ThemeProvider theme={Theme.PERSONAL}>
|
|
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
3
3
|
import { action } from '@storybook/addon-actions';
|
|
4
4
|
import { ClockBorderless } from '@transferwise/icons';
|
|
5
5
|
|
|
6
|
+
import { lorem40 } from '../test-utils';
|
|
6
7
|
import { Sentiment } from '../common';
|
|
7
8
|
import { Button, Field, SelectInput } from '..';
|
|
8
9
|
import Alert, { AlertArrowPosition, type AlertProps as FullAlertProps } from './Alert';
|
|
@@ -43,6 +44,46 @@ type Story = StoryObj<typeof Alert>;
|
|
|
43
44
|
|
|
44
45
|
export const Basic: Story = {};
|
|
45
46
|
|
|
47
|
+
export const Variants: Story = {
|
|
48
|
+
render: ({ message }) => {
|
|
49
|
+
const variants = [
|
|
50
|
+
{ type: Sentiment.POSITIVE, title: 'Positive Title' },
|
|
51
|
+
{ type: Sentiment.NEGATIVE, title: 'Negative Title' },
|
|
52
|
+
{ type: Sentiment.NEUTRAL, title: 'Neutral Title' },
|
|
53
|
+
{ type: Sentiment.WARNING, title: 'Warning Title' },
|
|
54
|
+
{ type: Sentiment.PENDING, title: 'Pending Title' },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
{variants.map((variant) => (
|
|
60
|
+
<Alert
|
|
61
|
+
key={variant.type}
|
|
62
|
+
type={variant.type}
|
|
63
|
+
title={variant.title}
|
|
64
|
+
message={message}
|
|
65
|
+
action={
|
|
66
|
+
variant.type === Sentiment.NEUTRAL
|
|
67
|
+
? { href: '#', text: 'Read more' }
|
|
68
|
+
: { onClick: action('alert action clicked'), text: 'Open' }
|
|
69
|
+
}
|
|
70
|
+
onDismiss={variant.type === Sentiment.NEUTRAL ? action('alert dismissed') : undefined}
|
|
71
|
+
/>
|
|
72
|
+
))}
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
args: {
|
|
77
|
+
message: 'This message can be changed using controls',
|
|
78
|
+
},
|
|
79
|
+
parameters: {
|
|
80
|
+
controls: { exclude: /^(?!message$).*/ },
|
|
81
|
+
},
|
|
82
|
+
argTypes: {
|
|
83
|
+
message: { control: 'text' },
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
46
87
|
export const WithLinkAction: Story = {
|
|
47
88
|
args: {
|
|
48
89
|
action: {
|
|
@@ -84,7 +125,7 @@ const CustomIcon = () => {
|
|
|
84
125
|
justifyContent: 'center',
|
|
85
126
|
}}
|
|
86
127
|
>
|
|
87
|
-
<ClockBorderless size="
|
|
128
|
+
<ClockBorderless size="24" />
|
|
88
129
|
</div>
|
|
89
130
|
);
|
|
90
131
|
};
|
|
@@ -96,11 +137,42 @@ export const WithCustomIcon: Story = {
|
|
|
96
137
|
},
|
|
97
138
|
};
|
|
98
139
|
|
|
99
|
-
export const
|
|
140
|
+
export const WithTitleAndButtonAction: Story = {
|
|
100
141
|
args: {
|
|
101
142
|
type: Sentiment.NEUTRAL,
|
|
102
143
|
title: 'We’re reviewing your information.',
|
|
144
|
+
message:
|
|
145
|
+
'Payments sent to your bank details **today** might not arrive in time for the holidays.',
|
|
103
146
|
onDismiss: () => {},
|
|
147
|
+
action: {
|
|
148
|
+
onClick: action('alert action clicked'),
|
|
149
|
+
text: 'Open',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
export const WithTitleAndButtonActionAndLongBody: Story = {
|
|
154
|
+
args: {
|
|
155
|
+
type: Sentiment.NEUTRAL,
|
|
156
|
+
title: 'We’re reviewing your information.',
|
|
157
|
+
message: lorem40,
|
|
158
|
+
onDismiss: () => {},
|
|
159
|
+
action: {
|
|
160
|
+
onClick: action('alert action clicked'),
|
|
161
|
+
text: 'Open',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const WithTitleAndLinkActionAndLongBody: Story = {
|
|
167
|
+
args: {
|
|
168
|
+
type: Sentiment.NEUTRAL,
|
|
169
|
+
title: 'We’re reviewing your information.',
|
|
170
|
+
message: lorem40,
|
|
171
|
+
onDismiss: () => {},
|
|
172
|
+
action: {
|
|
173
|
+
href: '/',
|
|
174
|
+
text: 'Open',
|
|
175
|
+
},
|
|
104
176
|
},
|
|
105
177
|
};
|
|
106
178
|
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -2,14 +2,7 @@ import { clsx } from 'clsx';
|
|
|
2
2
|
import { useState, useRef, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
import Body from '../body/Body';
|
|
5
|
-
import {
|
|
6
|
-
CloseButton,
|
|
7
|
-
Sentiment,
|
|
8
|
-
Size,
|
|
9
|
-
Typography,
|
|
10
|
-
Variant,
|
|
11
|
-
WDS_LIVE_REGION_DELAY_MS,
|
|
12
|
-
} from '../common';
|
|
5
|
+
import { CloseButton, Sentiment, Size, Typography, WDS_LIVE_REGION_DELAY_MS } from '../common';
|
|
13
6
|
|
|
14
7
|
import StatusIcon from '../statusIcon';
|
|
15
8
|
import Title from '../title/Title';
|
|
@@ -32,6 +25,7 @@ type AlertTypeResolved = `${
|
|
|
32
25
|
| Sentiment.POSITIVE
|
|
33
26
|
| Sentiment.NEUTRAL
|
|
34
27
|
| Sentiment.WARNING
|
|
28
|
+
| Sentiment.PENDING
|
|
35
29
|
| Sentiment.NEGATIVE}`;
|
|
36
30
|
export type AlertType = AlertTypeResolved | AlertTypeDeprecated;
|
|
37
31
|
|
|
@@ -63,7 +57,6 @@ export interface AlertProps {
|
|
|
63
57
|
onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
|
|
64
58
|
/** The type dictates which icon and colour will be used */
|
|
65
59
|
type?: AlertType;
|
|
66
|
-
variant?: `${Variant}`;
|
|
67
60
|
/** @deprecated Use `InlineAlert` instead. */
|
|
68
61
|
arrow?: `${AlertArrowPosition}`;
|
|
69
62
|
/** @deprecated Use `message` instead. Be aware `message` only accepts plain text or text with **bold** markdown. */
|
|
@@ -96,7 +89,6 @@ export default function Alert({
|
|
|
96
89
|
message,
|
|
97
90
|
title,
|
|
98
91
|
type = 'neutral',
|
|
99
|
-
variant = 'desktop',
|
|
100
92
|
arrow,
|
|
101
93
|
children,
|
|
102
94
|
size,
|
|
@@ -186,15 +178,10 @@ export default function Alert({
|
|
|
186
178
|
}}
|
|
187
179
|
onTouchMove={() => setShouldFire(false)}
|
|
188
180
|
>
|
|
189
|
-
<div
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
>
|
|
193
|
-
{icon ? (
|
|
194
|
-
<div className="alert__icon">{icon}</div>
|
|
195
|
-
) : (
|
|
196
|
-
<StatusIcon size={Size.LARGE} sentiment={resolvedType} iconLabel={statusIconLabel} />
|
|
197
|
-
)}
|
|
181
|
+
<div className="alert__icon">
|
|
182
|
+
{icon || <StatusIcon size={32} sentiment={resolvedType} iconLabel={statusIconLabel} />}
|
|
183
|
+
</div>
|
|
184
|
+
<div className={clsx('alert__content', 'd-flex', 'flex-grow-1')}>
|
|
198
185
|
<div className="alert__message">
|
|
199
186
|
<div>
|
|
200
187
|
{title && (
|
|
@@ -206,11 +193,21 @@ export default function Alert({
|
|
|
206
193
|
{children || <InlineMarkdown>{message}</InlineMarkdown>}
|
|
207
194
|
</Body>
|
|
208
195
|
</div>
|
|
209
|
-
{action &&
|
|
196
|
+
{action && (
|
|
197
|
+
<Action
|
|
198
|
+
action={action}
|
|
199
|
+
variant="action-button"
|
|
200
|
+
className="alert__action"
|
|
201
|
+
sentiment="default"
|
|
202
|
+
priority="secondary-neutral"
|
|
203
|
+
/>
|
|
204
|
+
)}
|
|
210
205
|
</div>
|
|
211
206
|
</div>
|
|
212
207
|
{onDismiss && (
|
|
213
|
-
<
|
|
208
|
+
<div className="alert__close">
|
|
209
|
+
<CloseButton ref={closeButtonReference} size="xs" onClick={onDismiss} />
|
|
210
|
+
</div>
|
|
214
211
|
)}
|
|
215
212
|
</div>
|
|
216
213
|
</div>
|
package/src/avatar/Avatar.tsx
CHANGED
|
@@ -15,6 +15,9 @@ export type AvatarTheme = 'light' | 'dark';
|
|
|
15
15
|
|
|
16
16
|
export type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated `Avatar` is deprecated please use `AvatarView` instead
|
|
20
|
+
*/
|
|
18
21
|
export interface AvatarProps {
|
|
19
22
|
backgroundColor?: string;
|
|
20
23
|
backgroundColorSeed?: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated `Avatar` is deprecated please use `AvatarView` instead
|
|
3
|
+
*/
|
|
2
4
|
export enum AvatarType {
|
|
3
5
|
THUMBNAIL = 'thumbnail',
|
|
4
6
|
ICON = 'icon',
|
package/src/badge/Badge.tsx
CHANGED
|
@@ -18,6 +18,9 @@ import { BadgeAssetsProps } from '.';
|
|
|
18
18
|
*/
|
|
19
19
|
type DeprecatedSizes = SizeSmall | SizeMedium | SizeLarge;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated `Badge` is deprecated please use `<AvatarView badge={..} />` instead
|
|
23
|
+
*/
|
|
21
24
|
export type BadgeProps = {
|
|
22
25
|
badge: ReactNode;
|
|
23
26
|
children: ReactNode;
|