@transferwise/components 46.127.1 → 46.128.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/alert/Alert.js +3 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +3 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -1
- package/build/inputs/SelectInput.js +81 -12
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +81 -13
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/listItem/Button/ListItemButton.js +4 -3
- package/build/listItem/Button/ListItemButton.js.map +1 -1
- package/build/listItem/Button/ListItemButton.mjs +5 -4
- package/build/listItem/Button/ListItemButton.mjs.map +1 -1
- package/build/main.css +15 -7
- package/build/prompt/ActionPrompt/ActionPrompt.js +6 -4
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +6 -4
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/styles/main.css +15 -7
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +4 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +7 -5
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +3 -2
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
- package/build/types/alert/Alert.d.ts +15 -0
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +19 -0
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +7 -4
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +4 -4
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +7 -0
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +4 -2
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/alert/Alert.story.tsx +4 -0
- package/src/alert/Alert.test.story.tsx +1 -1
- package/src/alert/Alert.tsx +16 -0
- package/src/iconButton/IconButton.story.tsx +173 -48
- package/src/iconButton/IconButton.test.story.tsx +194 -0
- package/src/index.ts +1 -0
- package/src/inputs/SelectInput.story.tsx +33 -20
- package/src/inputs/SelectInput.test.story.tsx +1285 -5
- package/src/inputs/SelectInput.tsx +93 -15
- package/src/listItem/Button/ListItemButton.tsx +30 -28
- package/src/listItem/_stories/ListItem.story.tsx +0 -1
- package/src/main.css +15 -7
- package/src/prompt/ActionPrompt/ActionPrompt.accessibility.docs.mdx +2 -18
- package/src/prompt/ActionPrompt/ActionPrompt.css +4 -0
- package/src/prompt/ActionPrompt/ActionPrompt.less +5 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +323 -108
- package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +86 -3
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +17 -6
- package/src/prompt/InfoPrompt/InfoPrompt.accessibility.docs.mdx +79 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +7 -5
- package/src/prompt/InfoPrompt/InfoPrompt.less +8 -8
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +112 -82
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +54 -1
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +4 -2
- package/src/prompt/InlinePrompt/InlinePrompt.accessibility.docs.mdx +63 -0
- package/src/prompt/InlinePrompt/InlinePrompt.css +3 -2
- package/src/prompt/InlinePrompt/InlinePrompt.less +2 -2
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +25 -30
- package/src/prompt/InlinePrompt/InlinePrompt.test.story.tsx +21 -0
- package/src/prompt/InlinePrompt/InlinePrompt.test.tsx +10 -3
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
- package/src/sentimentSurface/SentimentSurface.docs.mdx +1 -1
- package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.test.story.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,SAAS,EAQV,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,OAAO,EAAsB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAM1E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA+BrD,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,MAAM;IAC9C,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7C,MAAM,CAAC,EAAE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C,aAAa,CAAC;AAE1E,MAAM,MAAM,6BAA6B,CACvC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,IACtD,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEzD,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,EAAE,EACjG,EAAkB,EAClB,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,+BAclC;AAujBD,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAiD/B"}
|
|
@@ -13,8 +13,11 @@ export type ListItemButtonProps = Omit<NewButtonProps, 'v2' | 'size' | 'disabled
|
|
|
13
13
|
* <br />
|
|
14
14
|
* Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.
|
|
15
15
|
*/
|
|
16
|
-
export declare const Button: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<NewButtonProps, "disabled" | "size" | "block" | "v2" | "addonStart"> & {
|
|
17
|
+
/**
|
|
18
|
+
* Toggles the [interactivity strategy](https://storybook.wise.design/?path=/docs/content-listitem--docs#interactivity) for the whole ListItem.
|
|
19
|
+
*/
|
|
20
|
+
partiallyInteractive?: boolean;
|
|
21
|
+
addonStart?: ButtonAddonIcon;
|
|
22
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
23
|
//# sourceMappingURL=ListItemButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Button/ListItemButton.tsx"],"names":[],"mappings":"AAEA,OAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAIrF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,cAAc,EACd,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CACpD,GAAG;IACF;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Button/ListItemButton.tsx"],"names":[],"mappings":"AAEA,OAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAIrF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,cAAc,EACd,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CACpD,GAAG;IACF;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;IAdjB;;OAEG;2BACoB,OAAO;iBACjB,eAAe;qDAyC7B,CAAC"}
|
|
@@ -103,10 +103,10 @@ export declare const ListItem: {
|
|
|
103
103
|
({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
|
|
104
104
|
displayName: string;
|
|
105
105
|
};
|
|
106
|
-
Button: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
106
|
+
Button: import("react").ForwardRefExoticComponent<Omit<import("..").ButtonProps, "disabled" | "size" | "block" | "v2" | "addonStart"> & {
|
|
107
|
+
partiallyInteractive?: boolean;
|
|
108
|
+
addonStart?: import("../button").ButtonAddonIcon;
|
|
109
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
110
110
|
Switch: {
|
|
111
111
|
(props: ListItemSwitchProps): import("react").JSX.Element;
|
|
112
112
|
displayName: string;
|
|
@@ -23,6 +23,13 @@ export type ActionPromptProps = {
|
|
|
23
23
|
};
|
|
24
24
|
'aria-label'?: AriaAttributes['aria-label'];
|
|
25
25
|
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'sentiment' | 'onDismiss'>;
|
|
26
|
+
/**
|
|
27
|
+
* Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.
|
|
28
|
+
*
|
|
29
|
+
* If your message is about immediate user feedback (e.g., form submission errors, download failures, missing data warnings), use an [info prompt](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) instead.
|
|
30
|
+
*
|
|
31
|
+
* Guidance can be found in the [design system](https://wise.design/components/action-prompt).
|
|
32
|
+
*/
|
|
26
33
|
export declare const ActionPrompt: ({ sentiment, title, description, onDismiss, media, action, actionSecondary, id, className, "data-testid": testId, "aria-label": ariaLabel, }: ActionPromptProps) => import("react").JSX.Element;
|
|
27
34
|
export default ActionPrompt;
|
|
28
35
|
//# sourceMappingURL=ActionPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionPrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAS,MAAM,OAAO,CAAC;AAOzD,OAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OA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<LinkProps, 'href' | 'target' | 'onClick'> &
|
|
|
11
11
|
export type InfoPromptMedia = {
|
|
12
12
|
/**
|
|
13
13
|
* The icon/image asset to display.
|
|
14
|
-
* The asset should include its own accessibility attributes (e.g. title, aria-label)
|
|
15
|
-
* if it conveys meaning, or aria-hidden="true" if decorative.
|
|
14
|
+
* The asset should include its own accessibility attributes (e.g. title, aria-label) if it conveys meaning.
|
|
16
15
|
*/
|
|
17
16
|
asset: ReactNode;
|
|
18
17
|
};
|
|
@@ -44,6 +43,7 @@ export type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & Pi
|
|
|
44
43
|
* Description text for the prompt (required)
|
|
45
44
|
*/
|
|
46
45
|
description: string;
|
|
46
|
+
className?: string;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* InfoPrompt displays important contextual messages to users within a screen.
|
|
@@ -51,6 +51,8 @@ export type InfoPromptProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & Pi
|
|
|
51
51
|
* or positive feedback with optional actions and dismissal capabilities.
|
|
52
52
|
*
|
|
53
53
|
* Use this component to replace the deprecated Alert component.
|
|
54
|
+
*
|
|
55
|
+
* Guidance can be found in the [design system](https://wise.design/components/info-prompt).
|
|
54
56
|
*/
|
|
55
57
|
export declare const InfoPrompt: ({ sentiment, onDismiss, media, action, title, description, className, "data-testid": dataTestId, ...restProps }: InfoPromptProps) => import("react").JSX.Element;
|
|
56
58
|
//# sourceMappingURL=InfoPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoPrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/InfoPrompt/InfoPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAG5D,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI5E,OAAa,EAAE,SAAS,EAAE,MAAM,YAAY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;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,iHAUxB,eAAe,gCAyEjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.128.1",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"storybook-addon-tag-badges": "^3.0.4",
|
|
88
88
|
"storybook-addon-test-codegen": "^3.0.1",
|
|
89
89
|
"@transferwise/less-config": "3.1.2",
|
|
90
|
-
"@transferwise/neptune-css": "14.26.
|
|
91
|
-
"@wise/
|
|
92
|
-
"@wise/
|
|
90
|
+
"@transferwise/neptune-css": "14.26.2",
|
|
91
|
+
"@wise/components-theming": "1.10.1",
|
|
92
|
+
"@wise/wds-configs": "0.0.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@transferwise/icons": "^3 || ^4",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@babel/runtime": "^7.28.4",
|
|
106
|
-
"@floating-ui/react": "^0.27.
|
|
106
|
+
"@floating-ui/react": "^0.27.17",
|
|
107
107
|
"@headlessui/react": "^2.2.9",
|
|
108
108
|
"@popperjs/core": "^2.11.8",
|
|
109
109
|
"@react-aria/focus": "^3.21.3",
|
|
@@ -8,9 +8,13 @@ import { Sentiment, Status } from '../common';
|
|
|
8
8
|
import { Button, Field, SelectInput } from '..';
|
|
9
9
|
import Alert, { AlertArrowPosition, type AlertProps as FullAlertProps } from './Alert';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* > **DEPRECATED** Use [InfoPrompt](?path=/docs/prompts-infoprompt--docs).
|
|
13
|
+
*/
|
|
11
14
|
export default {
|
|
12
15
|
component: Alert,
|
|
13
16
|
title: 'Prompts/Alert',
|
|
17
|
+
tags: ['deprecated'],
|
|
14
18
|
args: {
|
|
15
19
|
type: Sentiment.POSITIVE,
|
|
16
20
|
message:
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -19,6 +19,9 @@ import InlineMarkdown from './inlineMarkdown';
|
|
|
19
19
|
import Button from '../button';
|
|
20
20
|
import Link from '../link';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated `Alert` component is being replaced by the `InfoPrompt` component
|
|
24
|
+
*/
|
|
22
25
|
export type AlertAction = {
|
|
23
26
|
'aria-label'?: string;
|
|
24
27
|
href?: string;
|
|
@@ -37,8 +40,15 @@ type AlertTypeResolved = `${
|
|
|
37
40
|
// remove when all instances of Sentiment.PENDING have been updated to Status.PENDING
|
|
38
41
|
| Sentiment.PENDING
|
|
39
42
|
| Status.PENDING}`;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated `Alert` component is being replaced by the `InfoPrompt` component
|
|
46
|
+
*/
|
|
40
47
|
export type AlertType = AlertTypeResolved | AlertTypeDeprecated;
|
|
41
48
|
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated `Alert` component is being replaced by the `InfoPrompt` component
|
|
51
|
+
*/
|
|
42
52
|
export enum AlertArrowPosition {
|
|
43
53
|
TOP_LEFT = 'up-left',
|
|
44
54
|
TOP = 'up-center',
|
|
@@ -48,6 +58,9 @@ export enum AlertArrowPosition {
|
|
|
48
58
|
BOTTOM_RIGHT = 'down-right',
|
|
49
59
|
}
|
|
50
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated `Alert` component is being replaced by the `InfoPrompt` component
|
|
63
|
+
*/
|
|
51
64
|
export interface AlertProps {
|
|
52
65
|
/** 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 */
|
|
53
66
|
action?: AlertAction;
|
|
@@ -90,6 +103,9 @@ function resolveType(type: AlertType): AlertTypeResolved {
|
|
|
90
103
|
}
|
|
91
104
|
}
|
|
92
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated use [`InfoPrompt`](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) component instead
|
|
108
|
+
*/
|
|
93
109
|
export default function Alert({
|
|
94
110
|
action,
|
|
95
111
|
className,
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ArrowLeft,
|
|
4
|
+
Cross,
|
|
5
|
+
Defrost,
|
|
6
|
+
Edit,
|
|
7
|
+
Menu,
|
|
8
|
+
Plus,
|
|
9
|
+
Settings,
|
|
10
|
+
Star,
|
|
11
|
+
Travel,
|
|
12
|
+
Briefcase,
|
|
13
|
+
Bank,
|
|
14
|
+
Freeze,
|
|
15
|
+
} from '@transferwise/icons';
|
|
3
16
|
import IconButton, { Props } from './IconButton';
|
|
4
17
|
import { action } from 'storybook/actions';
|
|
5
18
|
import Body from '../body';
|
|
@@ -114,48 +127,167 @@ export const Basic: Story = {
|
|
|
114
127
|
*/
|
|
115
128
|
export const SentimentAwareness: Story = {
|
|
116
129
|
render: () => {
|
|
130
|
+
const priorities = ['primary', 'secondary', 'tertiary', 'minimal', 'disabled'] as const;
|
|
131
|
+
const sentiments = ['success', 'warning', 'negative', 'neutral', 'proposition'] as const;
|
|
132
|
+
|
|
117
133
|
return (
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
style={{
|
|
134
|
+
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
135
|
+
{/* Header row with priority labels */}
|
|
136
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', marginBottom: '4px', gap: '8px' }}>
|
|
137
|
+
<div style={{ width: '82px', paddingLeft: '8px' }} />
|
|
138
|
+
{priorities.map((priority) => (
|
|
139
|
+
<div
|
|
140
|
+
key={priority}
|
|
141
|
+
style={{
|
|
142
|
+
width: '32px',
|
|
143
|
+
textAlign: 'center',
|
|
144
|
+
fontSize: '11px',
|
|
145
|
+
fontWeight: 'bold',
|
|
146
|
+
writingMode: 'vertical-rl',
|
|
147
|
+
transform: 'rotate(180deg)',
|
|
148
|
+
height: '60px',
|
|
149
|
+
display: 'flex',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
justifyContent: 'center',
|
|
152
|
+
}}
|
|
126
153
|
>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
{priority}
|
|
155
|
+
</div>
|
|
156
|
+
))}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
{/* Rows for each sentiment with base and elevated emphasis */}
|
|
160
|
+
{sentiments.flatMap((sentiment) => [
|
|
161
|
+
<SentimentSurface
|
|
162
|
+
key={`${sentiment}-base`}
|
|
163
|
+
sentiment={sentiment}
|
|
164
|
+
emphasis="base"
|
|
165
|
+
style={{ display: 'flex', alignItems: 'center', padding: '8px 0', gap: '8px' }}
|
|
166
|
+
>
|
|
167
|
+
<div
|
|
168
|
+
style={{
|
|
169
|
+
width: '82px',
|
|
170
|
+
fontSize: '11px',
|
|
171
|
+
fontWeight: 'bold',
|
|
172
|
+
textAlign: 'left',
|
|
173
|
+
paddingLeft: '8px',
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{sentiment} (base)
|
|
177
|
+
</div>
|
|
178
|
+
<IconButton
|
|
179
|
+
size={32}
|
|
180
|
+
aria-label="Primary action"
|
|
181
|
+
priority="primary"
|
|
182
|
+
type="default"
|
|
183
|
+
onClick={action('button click')}
|
|
184
|
+
>
|
|
185
|
+
<Plus />
|
|
186
|
+
</IconButton>
|
|
187
|
+
<IconButton
|
|
188
|
+
size={32}
|
|
189
|
+
aria-label="Secondary action"
|
|
190
|
+
priority="secondary"
|
|
191
|
+
type="default"
|
|
192
|
+
onClick={action('button click')}
|
|
193
|
+
>
|
|
194
|
+
<Settings />
|
|
195
|
+
</IconButton>
|
|
196
|
+
<IconButton
|
|
197
|
+
size={32}
|
|
198
|
+
aria-label="Tertiary action"
|
|
199
|
+
priority="tertiary"
|
|
200
|
+
type="default"
|
|
201
|
+
onClick={action('button click')}
|
|
202
|
+
>
|
|
203
|
+
<Star />
|
|
204
|
+
</IconButton>
|
|
205
|
+
<IconButton
|
|
206
|
+
size={32}
|
|
207
|
+
aria-label="Minimal action"
|
|
208
|
+
priority="minimal"
|
|
209
|
+
type="default"
|
|
210
|
+
onClick={action('button click')}
|
|
211
|
+
>
|
|
212
|
+
<Travel />
|
|
213
|
+
</IconButton>
|
|
214
|
+
<IconButton
|
|
215
|
+
size={32}
|
|
216
|
+
aria-label="Disabled action"
|
|
217
|
+
priority="primary"
|
|
218
|
+
type="default"
|
|
219
|
+
disabled
|
|
220
|
+
onClick={action('button click')}
|
|
221
|
+
>
|
|
222
|
+
<Menu />
|
|
223
|
+
</IconButton>
|
|
224
|
+
</SentimentSurface>,
|
|
225
|
+
<SentimentSurface
|
|
226
|
+
key={`${sentiment}-elevated`}
|
|
227
|
+
sentiment={sentiment}
|
|
228
|
+
emphasis="elevated"
|
|
229
|
+
style={{ display: 'flex', alignItems: 'center', padding: '8px 0', gap: '8px' }}
|
|
230
|
+
>
|
|
231
|
+
<div
|
|
232
|
+
style={{
|
|
233
|
+
width: '82px',
|
|
234
|
+
fontSize: '11px',
|
|
235
|
+
fontWeight: 'bold',
|
|
236
|
+
textAlign: 'left',
|
|
237
|
+
paddingLeft: '8px',
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
{sentiment} (elevated)
|
|
241
|
+
</div>
|
|
242
|
+
<IconButton
|
|
243
|
+
size={32}
|
|
244
|
+
aria-label="Primary action"
|
|
245
|
+
priority="primary"
|
|
246
|
+
type="default"
|
|
247
|
+
onClick={action('button click')}
|
|
248
|
+
>
|
|
249
|
+
<Briefcase />
|
|
250
|
+
</IconButton>
|
|
251
|
+
<IconButton
|
|
252
|
+
size={32}
|
|
253
|
+
aria-label="Secondary action"
|
|
254
|
+
priority="secondary"
|
|
255
|
+
type="default"
|
|
256
|
+
onClick={action('button click')}
|
|
257
|
+
>
|
|
258
|
+
<Bank />
|
|
259
|
+
</IconButton>
|
|
260
|
+
<IconButton
|
|
261
|
+
size={32}
|
|
262
|
+
aria-label="Tertiary action"
|
|
263
|
+
priority="tertiary"
|
|
264
|
+
type="default"
|
|
265
|
+
onClick={action('button click')}
|
|
266
|
+
>
|
|
267
|
+
<Freeze />
|
|
268
|
+
</IconButton>
|
|
269
|
+
<IconButton
|
|
270
|
+
size={32}
|
|
271
|
+
aria-label="Minimal action"
|
|
272
|
+
priority="minimal"
|
|
273
|
+
type="default"
|
|
274
|
+
onClick={action('button click')}
|
|
275
|
+
>
|
|
276
|
+
<Edit />
|
|
277
|
+
</IconButton>
|
|
278
|
+
<IconButton
|
|
279
|
+
size={32}
|
|
280
|
+
aria-label="Disabled action"
|
|
281
|
+
priority="primary"
|
|
282
|
+
type="default"
|
|
283
|
+
disabled
|
|
284
|
+
onClick={action('button click')}
|
|
285
|
+
>
|
|
286
|
+
<Cross />
|
|
287
|
+
</IconButton>
|
|
288
|
+
</SentimentSurface>,
|
|
289
|
+
])}
|
|
290
|
+
</div>
|
|
159
291
|
);
|
|
160
292
|
},
|
|
161
293
|
parameters: {
|
|
@@ -166,11 +298,4 @@ export const SentimentAwareness: Story = {
|
|
|
166
298
|
},
|
|
167
299
|
},
|
|
168
300
|
},
|
|
169
|
-
decorators: [
|
|
170
|
-
(Story) => (
|
|
171
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
172
|
-
<Story />
|
|
173
|
-
</div>
|
|
174
|
-
),
|
|
175
|
-
],
|
|
176
301
|
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Menu, Plus, Settings, Star, Travel } from '@transferwise/icons';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
|
+
import IconButton from './IconButton';
|
|
5
|
+
import SentimentSurface from '../sentimentSurface';
|
|
6
|
+
import { allModes } from '../../.storybook/modes';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Actions/IconButton/Tests',
|
|
10
|
+
component: IconButton,
|
|
11
|
+
tags: ['!autodocs', '!manifest'],
|
|
12
|
+
} satisfies Meta<typeof IconButton>;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof IconButton>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* IconButton displayed across all themes and sentiments for visual regression testing.
|
|
18
|
+
*/
|
|
19
|
+
export const AllThemesAndSentiments: Story = {
|
|
20
|
+
render: () => {
|
|
21
|
+
const priorities = ['primary', 'secondary', 'tertiary', 'minimal', 'disabled'] as const;
|
|
22
|
+
const sentiments = ['negative', 'warning', 'neutral', 'success', 'proposition'] as const;
|
|
23
|
+
const icons = [Plus, Settings, Star, Travel];
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
27
|
+
{/* Header row with priority labels */}
|
|
28
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', marginBottom: '4px', gap: '8px' }}>
|
|
29
|
+
<div style={{ width: '82px', paddingLeft: '8px' }} />
|
|
30
|
+
{priorities.map((priority) => (
|
|
31
|
+
<div
|
|
32
|
+
key={priority}
|
|
33
|
+
style={{
|
|
34
|
+
width: '32px',
|
|
35
|
+
textAlign: 'center',
|
|
36
|
+
fontSize: '11px',
|
|
37
|
+
fontWeight: 'bold',
|
|
38
|
+
writingMode: 'vertical-rl',
|
|
39
|
+
transform: 'rotate(180deg)',
|
|
40
|
+
height: '60px',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{priority}
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
{/* Rows for each sentiment with base and elevated emphasis */}
|
|
52
|
+
{sentiments.flatMap((sentiment) => [
|
|
53
|
+
<SentimentSurface
|
|
54
|
+
key={`${sentiment}-base`}
|
|
55
|
+
sentiment={sentiment}
|
|
56
|
+
emphasis="base"
|
|
57
|
+
style={{ display: 'flex', alignItems: 'center', padding: '8px 0', gap: '8px' }}
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
width: '82px',
|
|
62
|
+
fontSize: '11px',
|
|
63
|
+
fontWeight: 'bold',
|
|
64
|
+
textAlign: 'left',
|
|
65
|
+
paddingLeft: '8px',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{sentiment} (base)
|
|
69
|
+
</div>
|
|
70
|
+
<IconButton
|
|
71
|
+
size={32}
|
|
72
|
+
aria-label="Primary action"
|
|
73
|
+
priority="primary"
|
|
74
|
+
type="default"
|
|
75
|
+
onClick={action('button click')}
|
|
76
|
+
>
|
|
77
|
+
<Plus />
|
|
78
|
+
</IconButton>
|
|
79
|
+
<IconButton
|
|
80
|
+
size={32}
|
|
81
|
+
aria-label="Secondary action"
|
|
82
|
+
priority="secondary"
|
|
83
|
+
type="default"
|
|
84
|
+
onClick={action('button click')}
|
|
85
|
+
>
|
|
86
|
+
<Settings />
|
|
87
|
+
</IconButton>
|
|
88
|
+
<IconButton
|
|
89
|
+
size={32}
|
|
90
|
+
aria-label="Tertiary action"
|
|
91
|
+
priority="tertiary"
|
|
92
|
+
type="default"
|
|
93
|
+
onClick={action('button click')}
|
|
94
|
+
>
|
|
95
|
+
<Star />
|
|
96
|
+
</IconButton>
|
|
97
|
+
<IconButton
|
|
98
|
+
size={32}
|
|
99
|
+
aria-label="Minimal action"
|
|
100
|
+
priority="minimal"
|
|
101
|
+
type="default"
|
|
102
|
+
onClick={action('button click')}
|
|
103
|
+
>
|
|
104
|
+
<Travel />
|
|
105
|
+
</IconButton>
|
|
106
|
+
<IconButton
|
|
107
|
+
size={32}
|
|
108
|
+
aria-label="Disabled action"
|
|
109
|
+
priority="primary"
|
|
110
|
+
type="default"
|
|
111
|
+
disabled
|
|
112
|
+
onClick={action('button click')}
|
|
113
|
+
>
|
|
114
|
+
<Menu />
|
|
115
|
+
</IconButton>
|
|
116
|
+
</SentimentSurface>,
|
|
117
|
+
<SentimentSurface
|
|
118
|
+
key={`${sentiment}-elevated`}
|
|
119
|
+
sentiment={sentiment}
|
|
120
|
+
emphasis="elevated"
|
|
121
|
+
style={{ display: 'flex', alignItems: 'center', padding: '8px 0', gap: '8px' }}
|
|
122
|
+
>
|
|
123
|
+
<div
|
|
124
|
+
style={{
|
|
125
|
+
width: '82px',
|
|
126
|
+
fontSize: '11px',
|
|
127
|
+
fontWeight: 'bold',
|
|
128
|
+
textAlign: 'left',
|
|
129
|
+
paddingLeft: '8px',
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
{sentiment} (elevated)
|
|
133
|
+
</div>
|
|
134
|
+
<IconButton
|
|
135
|
+
size={32}
|
|
136
|
+
aria-label="Primary action"
|
|
137
|
+
priority="primary"
|
|
138
|
+
type="default"
|
|
139
|
+
onClick={action('button click')}
|
|
140
|
+
>
|
|
141
|
+
<Plus />
|
|
142
|
+
</IconButton>
|
|
143
|
+
<IconButton
|
|
144
|
+
size={32}
|
|
145
|
+
aria-label="Secondary action"
|
|
146
|
+
priority="secondary"
|
|
147
|
+
type="default"
|
|
148
|
+
onClick={action('button click')}
|
|
149
|
+
>
|
|
150
|
+
<Settings />
|
|
151
|
+
</IconButton>
|
|
152
|
+
<IconButton
|
|
153
|
+
size={32}
|
|
154
|
+
aria-label="Tertiary action"
|
|
155
|
+
priority="tertiary"
|
|
156
|
+
type="default"
|
|
157
|
+
onClick={action('button click')}
|
|
158
|
+
>
|
|
159
|
+
<Star />
|
|
160
|
+
</IconButton>
|
|
161
|
+
<IconButton
|
|
162
|
+
size={32}
|
|
163
|
+
aria-label="Minimal action"
|
|
164
|
+
priority="minimal"
|
|
165
|
+
type="default"
|
|
166
|
+
onClick={action('button click')}
|
|
167
|
+
>
|
|
168
|
+
<Travel />
|
|
169
|
+
</IconButton>
|
|
170
|
+
<IconButton
|
|
171
|
+
size={32}
|
|
172
|
+
aria-label="Disabled action"
|
|
173
|
+
priority="primary"
|
|
174
|
+
type="default"
|
|
175
|
+
disabled
|
|
176
|
+
onClick={action('button click')}
|
|
177
|
+
>
|
|
178
|
+
<Menu />
|
|
179
|
+
</IconButton>
|
|
180
|
+
</SentimentSurface>,
|
|
181
|
+
])}
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
},
|
|
185
|
+
parameters: {
|
|
186
|
+
padding: '16px',
|
|
187
|
+
variants: ['default', 'dark', 'bright-green', 'forest-green'],
|
|
188
|
+
chromatic: {
|
|
189
|
+
dark: allModes.dark,
|
|
190
|
+
brightGreen: allModes.brightGreen,
|
|
191
|
+
forestGreen: allModes.forestGreen,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -181,6 +181,7 @@ export {
|
|
|
181
181
|
SelectInput,
|
|
182
182
|
SelectInputOptionContent,
|
|
183
183
|
SelectInputTriggerButton,
|
|
184
|
+
sortByRelevance,
|
|
184
185
|
} from './inputs/SelectInput';
|
|
185
186
|
export { TextArea } from './inputs/TextArea';
|
|
186
187
|
export { default as InstructionsList } from './instructionsList';
|