@transferwise/components 46.107.0 → 46.108.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/header/Header.js +1 -0
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -0
- package/build/header/Header.mjs.map +1 -1
- package/build/link/Link.js +6 -2
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +6 -2
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/ListItem.js +20 -8
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +20 -8
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/ListItemContext.js.map +1 -1
- package/build/listItem/ListItemContext.mjs.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.js +1 -3
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs +2 -4
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.js +74 -0
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.js.map +1 -0
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.mjs +72 -0
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.mjs.map +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js +10 -15
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +11 -16
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +94 -74
- package/build/styles/link/Link.css +7 -0
- package/build/styles/listItem/ListItem.css +87 -74
- package/build/styles/listItem/Prompt/InlinePrompt/InlinePrompt.css +153 -0
- package/build/styles/listItem/Prompt/ListItemPrompt.css +72 -72
- package/build/styles/main.css +94 -74
- package/build/types/header/Header.d.ts +1 -0
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/link/Link.d.ts +1 -1
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +10 -1
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/listItem/ListItemContext.d.ts +2 -1
- package/build/types/listItem/ListItemContext.d.ts.map +1 -1
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -1
- package/build/types/listItem/Prompt/InlinePrompt/InlinePrompt.d.ts +15 -0
- package/build/types/listItem/Prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -0
- package/build/types/listItem/Prompt/InlinePrompt/index.d.ts +3 -0
- package/build/types/listItem/Prompt/InlinePrompt/index.d.ts.map +1 -0
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +4 -6
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -1
- package/build/types/listItem/_stories/helpers.d.ts.map +1 -1
- package/build/types/listItem/_stories/subcomponents.d.ts +1 -0
- package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -1
- package/build/types/listItem/useListItemControl.d.ts +1 -1
- package/package.json +3 -3
- package/src/header/Header.story.tsx +14 -0
- package/src/header/Header.tsx +2 -0
- package/src/link/Link.css +7 -0
- package/src/link/Link.less +8 -0
- package/src/link/Link.spec.tsx +28 -0
- package/src/link/Link.story.tsx +72 -16
- package/src/link/Link.tsx +5 -1
- package/src/listItem/ListItem.css +87 -74
- package/src/listItem/ListItem.less +19 -4
- package/src/listItem/ListItem.spec.tsx +33 -0
- package/src/listItem/ListItem.tsx +38 -12
- package/src/listItem/ListItemContext.tsx +2 -1
- package/src/listItem/Navigation/ListItemNavigation.spec.tsx +1 -10
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -22
- package/src/listItem/Navigation/ListItemNavigation.tsx +2 -3
- package/src/listItem/Prompt/InlinePrompt/InlinePrompt.css +153 -0
- package/src/listItem/Prompt/InlinePrompt/InlinePrompt.less +162 -0
- package/src/listItem/Prompt/InlinePrompt/InlinePrompt.spec.tsx +66 -0
- package/src/listItem/Prompt/InlinePrompt/InlinePrompt.tsx +56 -0
- package/src/listItem/Prompt/InlinePrompt/index.ts +2 -0
- package/src/listItem/Prompt/ListItemPrompt.css +72 -72
- package/src/listItem/Prompt/ListItemPrompt.less +2 -130
- package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +4 -2
- package/src/listItem/Prompt/ListItemPrompt.tsx +14 -14
- package/src/listItem/_stories/ListItem.disabled.story.tsx +433 -0
- package/src/listItem/_stories/ListItem.story.tsx +1 -177
- package/src/listItem/_stories/helpers.tsx +1 -0
- package/src/listItem/_stories/subcomponents.tsx +5 -0
- package/src/main.css +94 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/link/Link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,WAAW,CAAC;AAI/D,MAAM,MAAM,KAAK,GAAG,oBAAoB,GACtC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAAC;AAE7E;;;;GAIG;AACH,QAAA,MAAM,IAAI,GAAI,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/link/Link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,WAAW,CAAC;AAI/D,MAAM,MAAM,KAAK,GAAG,oBAAoB,GACtC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAAC;AAE7E;;;;GAIG;AACH,QAAA,MAAM,IAAI,GAAI,mGAUX,KAAK,gCAuCP,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -13,7 +13,16 @@ export type ListItemProps = {
|
|
|
13
13
|
* Swaps vertical hierarchy of title and subtitle and their corresponding right values.
|
|
14
14
|
*/
|
|
15
15
|
inverted?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Disables the control and renders the ListItem in greyscale and with slightly decreased opacity.
|
|
18
|
+
*/
|
|
16
19
|
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If set, it'll extend the `disabled` state, overriding existing or injecting uniquely styled prompt with the message provided via this prop. <br />
|
|
22
|
+
* **NB:** This message cannot house more than **1** link or inline button.<br />
|
|
23
|
+
* **NB:** It must be used together with `disabled` prop and will be disregarded otherwise.
|
|
24
|
+
*/
|
|
25
|
+
disabledPromptMessage?: ReactNode;
|
|
17
26
|
/**
|
|
18
27
|
* Highlights the list item as an action to be taken or already taken. <br />
|
|
19
28
|
*/
|
|
@@ -61,7 +70,7 @@ export type ListItemProps = {
|
|
|
61
70
|
* @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
|
62
71
|
*/
|
|
63
72
|
export declare const ListItem: {
|
|
64
|
-
({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, className, valueColumnWidth, id, }: ListItemProps): import("react").JSX.Element;
|
|
73
|
+
({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, disabledPromptMessage, className, valueColumnWidth, id, }: ListItemProps): import("react").JSX.Element;
|
|
65
74
|
Image: {
|
|
66
75
|
({ alt, size, className, ...props }: import("./Image").ListItemImageProps): import("react").JSX.Element;
|
|
67
76
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML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AAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;0MAiBlB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsOf,CAAC;AA6GF,eAAe,QAAQ,CAAC"}
|
|
@@ -13,8 +13,9 @@ export type ListItemContextData = {
|
|
|
13
13
|
control: string;
|
|
14
14
|
prompt?: string;
|
|
15
15
|
};
|
|
16
|
-
props: Pick<ListItemProps, 'disabled' | 'inverted'>;
|
|
16
|
+
props: Pick<ListItemProps, 'disabled' | 'inverted' | 'disabledPromptMessage'>;
|
|
17
17
|
mediaSize?: ListItemMediaSize;
|
|
18
|
+
isPartiallyInteractive?: boolean;
|
|
18
19
|
describedByIds: string;
|
|
19
20
|
};
|
|
20
21
|
export declare const ListItemContext: import("react").Context<ListItemContextData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemContext.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CA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M,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,uBAAuB,CAAC,CAAC;IAC9E,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,8CAE3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM7D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;yBAA2C,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM7D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;yBAA2C,uBAAuB;;CAkBxF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Sentiment } from '../../../common';
|
|
2
|
+
export type InlinePromptProps = {
|
|
3
|
+
sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Use for short-lived inline prompts to avoid swap of the icon (which is bad UX for short-lived prompts, e.g. when submit form)
|
|
7
|
+
*/
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare const InlinePrompt: ({ sentiment, muted, loading, className, children, ...rest }: InlinePromptProps) => import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=InlinePrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlinePrompt.d.ts","sourceRoot":"","sources":["../../../../../src/listItem/Prompt/InlinePrompt/InlinePrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,6DAO1B,iBAAiB,gCA4BnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/listItem/Prompt/InlinePrompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ListItemPromptProps =
|
|
3
|
-
sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
};
|
|
1
|
+
import { type InlinePromptProps } from './InlinePrompt';
|
|
2
|
+
export type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'muted'>;
|
|
6
3
|
/**
|
|
7
|
-
* This component allows for rendering an Inline Prompt. <br />
|
|
4
|
+
* This component allows for rendering an Inline Prompt. <br />
|
|
5
|
+
* In the future it will be a thin wrapper around a standalone component.<br />
|
|
8
6
|
*
|
|
9
7
|
* Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.
|
|
10
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/ListItemPrompt.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/ListItemPrompt.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,CAAC;AAE9F;;;;;GAKG;AACH,eAAO,MAAM,MAAM;8BAAiD,mBAAmB;;CActF,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,KAAG,KAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,KAAG,KAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SASxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC5B,OAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAgB,EAAE,gBAAa,KAAG,SAoBvE,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,eAAe,GACzB,kBAAiB,MAAM,EAAO,MAC9B,iBAAgB,MAAM,EAAO;;;;;;CAG7B,CAAC"}
|
|
@@ -20,6 +20,7 @@ export declare const SB_LIST_ITEM_PROMPTS: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const SB_LIST_ITEM_MEDIA: {
|
|
22
22
|
readonly image: import("react").JSX.Element;
|
|
23
|
+
readonly avatarFlag: import("react").JSX.Element;
|
|
23
24
|
readonly avatarSingle: import("react").JSX.Element;
|
|
24
25
|
readonly avatarDouble: import("react").JSX.Element;
|
|
25
26
|
readonly avatarDiagonal: import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/subcomponents.tsx"],"names":[],"mappings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B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ListItemTypes, ListItemControlProps } from './ListItem';
|
|
2
2
|
export declare function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps): {
|
|
3
|
-
baseItemProps: Pick<import("./ListItem").ListItemProps, "disabled" | "inverted">;
|
|
3
|
+
baseItemProps: Pick<import("./ListItem").ListItemProps, "disabled" | "inverted" | "disabledPromptMessage">;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=useListItemControl.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.108.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"storybook-addon-tag-badges": "^2.0.2",
|
|
85
85
|
"storybook-addon-test-codegen": "^2.0.1",
|
|
86
86
|
"@transferwise/less-config": "3.1.2",
|
|
87
|
+
"@transferwise/neptune-css": "14.24.6",
|
|
87
88
|
"@wise/components-theming": "1.6.4",
|
|
88
|
-
"@wise/wds-configs": "0.0.0"
|
|
89
|
-
"@transferwise/neptune-css": "14.24.5"
|
|
89
|
+
"@wise/wds-configs": "0.0.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@transferwise/icons": "^3.22.4",
|
|
@@ -98,6 +98,7 @@ export const Playground: Story = {
|
|
|
98
98
|
'aria-label': 'Action',
|
|
99
99
|
text: 'Click me',
|
|
100
100
|
onClick: () => alert('Action clicked!'),
|
|
101
|
+
disabled: false,
|
|
101
102
|
},
|
|
102
103
|
},
|
|
103
104
|
};
|
|
@@ -133,6 +134,19 @@ export const ActionAsLink: Story = {
|
|
|
133
134
|
argTypes: hideControls(['as', 'className', 'level', 'title', 'testId']),
|
|
134
135
|
};
|
|
135
136
|
|
|
137
|
+
export const DisabledAction: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
title: 'Header with Disabled Action',
|
|
140
|
+
action: {
|
|
141
|
+
'aria-label': 'Disabled action',
|
|
142
|
+
text: 'Disabled Action',
|
|
143
|
+
onClick: () => alert('This should not fire!'),
|
|
144
|
+
disabled: true,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
argTypes: hideControls(['as', 'className', 'level', 'title', 'testId']),
|
|
148
|
+
};
|
|
149
|
+
|
|
136
150
|
/**
|
|
137
151
|
* Demonstrates a `Header` rendered as a custom HTML element.
|
|
138
152
|
*/
|
package/src/header/Header.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import React, { useEffect, useRef, FunctionComponent, ReactNode } from 'react';
|
|
|
8
8
|
type ActionProps = AriaLabelProperty & {
|
|
9
9
|
text: string;
|
|
10
10
|
onClick?: (event: React.MouseEvent) => void;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
type ButtonActionProps = ActionProps;
|
|
@@ -58,6 +59,7 @@ const HeaderAction = React.forwardRef<
|
|
|
58
59
|
aria-label={action['aria-label']}
|
|
59
60
|
href={'href' in action ? action.href : undefined}
|
|
60
61
|
target={'target' in action ? action.target : undefined}
|
|
62
|
+
disabled={action.disabled}
|
|
61
63
|
onClick={action.onClick}
|
|
62
64
|
>
|
|
63
65
|
{action.text}
|
package/src/link/Link.css
CHANGED
package/src/link/Link.less
CHANGED
package/src/link/Link.spec.tsx
CHANGED
|
@@ -74,4 +74,32 @@ describe('Link', () => {
|
|
|
74
74
|
|
|
75
75
|
expect(link).toHaveAttribute('aria-label', 'make me accessible');
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
it('renders disabled button with attribute and class', () => {
|
|
79
|
+
const onClick = jest.fn();
|
|
80
|
+
render(
|
|
81
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
82
|
+
<Link disabled onClick={onClick}>
|
|
83
|
+
button as link
|
|
84
|
+
</Link>,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const link = screen.getByText('button as link');
|
|
88
|
+
expect(link.tagName).toBe('BUTTON');
|
|
89
|
+
expect(link).toHaveClass('np-link--disabled');
|
|
90
|
+
expect(link).toBeDisabled();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('passes disabled attribute to anchor element when rendered as link', () => {
|
|
94
|
+
render(
|
|
95
|
+
<Link {...props} disabled>
|
|
96
|
+
disabled link
|
|
97
|
+
</Link>,
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const link = screen.getByText('disabled link');
|
|
101
|
+
|
|
102
|
+
expect(link).toHaveClass('np-link--disabled');
|
|
103
|
+
expect(link.tagName).toBe('A');
|
|
104
|
+
});
|
|
77
105
|
});
|
package/src/link/Link.story.tsx
CHANGED
|
@@ -36,68 +36,124 @@ export const Basic = () => {
|
|
|
36
36
|
>
|
|
37
37
|
button as Link
|
|
38
38
|
</Link>
|
|
39
|
+
|
|
40
|
+
<Title type={Typography.TITLE_SCREEN} className="m-t-3">
|
|
41
|
+
Disabled links
|
|
42
|
+
</Title>
|
|
43
|
+
<Link href="#" disabled className="m-t-3">
|
|
44
|
+
Disabled link
|
|
45
|
+
</Link>
|
|
46
|
+
<Link type={Typography.LINK_LARGE} href="#" disabled className="m-t-3">
|
|
47
|
+
Disabled large link
|
|
48
|
+
</Link>
|
|
49
|
+
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
|
|
50
|
+
<Link className="m-t-3" disabled onClick={() => console.log('click disabled button')}>
|
|
51
|
+
Disabled button as Link
|
|
52
|
+
</Link>
|
|
53
|
+
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
|
|
54
|
+
<Link
|
|
55
|
+
className="m-t-3"
|
|
56
|
+
type={Typography.LINK_LARGE}
|
|
57
|
+
disabled
|
|
58
|
+
onClick={() => console.log('click disabled button')}
|
|
59
|
+
>
|
|
60
|
+
Disabled button as Link (large)
|
|
61
|
+
</Link>
|
|
62
|
+
|
|
39
63
|
<Title type={Typography.TITLE_SCREEN} className="m-t-3">
|
|
40
64
|
Links via <code>{'<Link />'}</code> component in all types of body copy
|
|
41
65
|
</Title>
|
|
42
66
|
<Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
|
|
43
|
-
We
|
|
67
|
+
We're building the world's{' '}
|
|
44
68
|
<Link href="#" target="_blank">
|
|
45
69
|
most international account
|
|
46
70
|
</Link>
|
|
47
|
-
. We
|
|
71
|
+
. We're building the world's most international account
|
|
48
72
|
</Body>
|
|
49
73
|
<Body type={Typography.BODY_LARGE} className="m-t-3">
|
|
50
|
-
We
|
|
74
|
+
We're building the world's{' '}
|
|
51
75
|
<Link href="#" target="_blank">
|
|
52
76
|
most international account
|
|
53
77
|
</Link>
|
|
54
|
-
. We
|
|
78
|
+
. We're building the world's most international account
|
|
55
79
|
</Body>
|
|
56
80
|
<Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
|
|
57
|
-
We
|
|
81
|
+
We're building the world's{' '}
|
|
58
82
|
<Link href="#" target="_blank">
|
|
59
83
|
most international account
|
|
60
84
|
</Link>
|
|
61
|
-
. We
|
|
85
|
+
. We're building the world's most international account
|
|
62
86
|
</Body>
|
|
63
87
|
<Body type={Typography.BODY_DEFAULT} className="m-t-3">
|
|
64
|
-
We
|
|
88
|
+
We're building the world's{' '}
|
|
65
89
|
<Link href="#" target="_blank">
|
|
66
90
|
most international account
|
|
67
91
|
</Link>
|
|
68
|
-
. We
|
|
92
|
+
. We're building the world's most international account
|
|
93
|
+
</Body>
|
|
94
|
+
|
|
95
|
+
<Title type={Typography.TITLE_SCREEN} className="m-t-3">
|
|
96
|
+
Disabled links in body copy
|
|
97
|
+
</Title>
|
|
98
|
+
<Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
|
|
99
|
+
We're building the world's{' '}
|
|
100
|
+
<Link href="#" disabled>
|
|
101
|
+
most international account
|
|
102
|
+
</Link>
|
|
103
|
+
. We're building the world's most international account
|
|
104
|
+
</Body>
|
|
105
|
+
<Body type={Typography.BODY_LARGE} className="m-t-3">
|
|
106
|
+
We're building the world's{' '}
|
|
107
|
+
<Link href="#" disabled>
|
|
108
|
+
most international account
|
|
109
|
+
</Link>
|
|
110
|
+
. We're building the world's most international account
|
|
111
|
+
</Body>
|
|
112
|
+
<Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
|
|
113
|
+
We're building the world's{' '}
|
|
114
|
+
<Link href="#" disabled>
|
|
115
|
+
most international account
|
|
116
|
+
</Link>
|
|
117
|
+
. We're building the world's most international account
|
|
118
|
+
</Body>
|
|
119
|
+
<Body type={Typography.BODY_DEFAULT} className="m-t-3">
|
|
120
|
+
We're building the world's{' '}
|
|
121
|
+
<Link href="#" disabled>
|
|
122
|
+
most international account
|
|
123
|
+
</Link>
|
|
124
|
+
. We're building the world's most international account
|
|
69
125
|
</Body>
|
|
70
126
|
|
|
71
127
|
<Title type={Typography.TITLE_SCREEN} className="m-t-3">
|
|
72
128
|
Links via <code>{'<a>'}</code> tag in all types of body copy
|
|
73
129
|
</Title>
|
|
74
130
|
<Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
|
|
75
|
-
We
|
|
131
|
+
We're building the world's{' '}
|
|
76
132
|
<a href="#" target="_blank">
|
|
77
133
|
most international account
|
|
78
134
|
</a>
|
|
79
|
-
. We
|
|
135
|
+
. We're building the world's most international account
|
|
80
136
|
</Body>
|
|
81
137
|
<Body type={Typography.BODY_LARGE} className="m-t-3">
|
|
82
|
-
We
|
|
138
|
+
We're building the world's{' '}
|
|
83
139
|
<a href="#" target="_blank">
|
|
84
140
|
most international account
|
|
85
141
|
</a>
|
|
86
|
-
. We
|
|
142
|
+
. We're building the world's most international account
|
|
87
143
|
</Body>
|
|
88
144
|
<Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
|
|
89
|
-
We
|
|
145
|
+
We're building the world's{' '}
|
|
90
146
|
<a href="#" target="_blank">
|
|
91
147
|
most international account
|
|
92
148
|
</a>
|
|
93
|
-
. We
|
|
149
|
+
. We're building the world's most international account
|
|
94
150
|
</Body>
|
|
95
151
|
<Body type={Typography.BODY_DEFAULT} className="m-t-3">
|
|
96
|
-
We
|
|
152
|
+
We're building the world's{' '}
|
|
97
153
|
<a href="#" target="_blank">
|
|
98
154
|
most international account
|
|
99
155
|
</a>
|
|
100
|
-
. We
|
|
156
|
+
. We're building the world's most international account
|
|
101
157
|
</Body>
|
|
102
158
|
</>
|
|
103
159
|
);
|
package/src/link/Link.tsx
CHANGED
|
@@ -24,6 +24,7 @@ const Link = ({
|
|
|
24
24
|
type = Typography.LINK_DEFAULT,
|
|
25
25
|
'aria-label': ariaLabel,
|
|
26
26
|
onClick,
|
|
27
|
+
disabled,
|
|
27
28
|
...props
|
|
28
29
|
}: Props) => {
|
|
29
30
|
const { formatMessage } = useIntl();
|
|
@@ -35,6 +36,7 @@ const Link = ({
|
|
|
35
36
|
'd-inline-flex',
|
|
36
37
|
{
|
|
37
38
|
[`np-text-${type}`]: type,
|
|
39
|
+
'np-link--disabled': disabled,
|
|
38
40
|
},
|
|
39
41
|
className,
|
|
40
42
|
);
|
|
@@ -43,7 +45,8 @@ const Link = ({
|
|
|
43
45
|
<PrimitiveButton
|
|
44
46
|
type="button"
|
|
45
47
|
aria-label={ariaLabel}
|
|
46
|
-
className={clsx(classNames, 'btn-unstyled'
|
|
48
|
+
className={clsx(classNames, 'btn-unstyled')}
|
|
49
|
+
disabled={disabled}
|
|
47
50
|
onClick={onClick}
|
|
48
51
|
>
|
|
49
52
|
{children}
|
|
@@ -55,6 +58,7 @@ const Link = ({
|
|
|
55
58
|
className={classNames}
|
|
56
59
|
aria-label={ariaLabel}
|
|
57
60
|
rel={isBlank ? 'noreferrer' : undefined}
|
|
61
|
+
disabled={disabled}
|
|
58
62
|
onClick={onClick}
|
|
59
63
|
{...props}
|
|
60
64
|
>
|