@transferwise/components 46.154.0 → 46.155.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.
@@ -10,6 +10,7 @@ var jsxRuntime = require('react/jsx-runtime');
10
10
 
11
11
  const Navigation = function Navigation({
12
12
  href,
13
+ hideIndicator,
13
14
  ...props
14
15
  }) {
15
16
  const {
@@ -22,8 +23,9 @@ const Navigation = function Navigation({
22
23
  ids,
23
24
  describedByIds
24
25
  } = React.useContext(ListItemContext.ListItemContext);
25
- const icon = /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
26
- size: 16
26
+ const icon = hideIndicator ? null : /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
27
+ size: 16,
28
+ "data-testid": "NavigationIndicator"
27
29
  });
28
30
  return href ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
29
31
  children: icon
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemNavigation.js","sources":["../../../src/ListItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight } from '@transferwise/icons';\nimport type { ButtonProps } from '../../Button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../Primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href, ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const icon = <ChevronRight size={16} />;\n\n return href ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n disabled={baseItemProps.disabled}\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","icon","_jsx","ChevronRight","size","_Fragment","children","PrimitiveButton","disabled","id","control","className","onClick","displayName"],"mappings":";;;;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;EAAEC,IAAI;EAAE,GAAGC;AAAK,CAA2B,EAAA;EACvF,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;AAC3D,EAAA,MAAMC,IAAI,gBAAGC,cAAA,CAACC,kBAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,OAAOX,IAAI,gBACTS,cAAA,CAAAG,mBAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGL;AAAI,GAAC,CAAG,gBAEXC,cAAA,CAACK,uBAAe,EAAA;IACdC,QAAQ,EAAEb,aAAa,CAACa,QAAS;AACjC,IAAA,kBAAA,EAAkBV,cAAe;IACjCW,EAAE,EAAEZ,GAAG,CAACa,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAElB,KAAK,CAACkB,OAAkE;AAAAN,IAAAA,QAAA,EAEhFL;AAAI,GACU,CAClB;AACH;AAEAT,UAAU,CAACqB,WAAW,GAAG,qBAAqB;;;;"}
1
+ {"version":3,"file":"ListItemNavigation.js","sources":["../../../src/ListItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight } from '@transferwise/icons';\nimport type { ButtonProps } from '../../Button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../Primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n /**\n * When `true`, the chevron indicator is hidden. Use when surrounding context makes the\n * interactive affordance clear without a directional cue (e.g. a widget row with trailing\n * value content).<br />\n * **NB:** This feature should be used with great care as it can result in the item looking\n * as non-interactive, significantly degrading accessibility, UX, and conversion,\n * especially if used on busy screens with multiple Lists.\n */\n hideIndicator?: boolean;\n};\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({\n href,\n hideIndicator,\n ...props\n}: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const icon = hideIndicator ? null : <ChevronRight size={16} data-testid=\"NavigationIndicator\" />;\n\n return href ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n disabled={baseItemProps.disabled}\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","hideIndicator","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","icon","_jsx","ChevronRight","size","_Fragment","children","PrimitiveButton","disabled","id","control","className","onClick","displayName"],"mappings":";;;;;;;;;;AA2BO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;EAC5CC,IAAI;EACJC,aAAa;EACb,GAAGC;AAAK,CACgB,EAAA;EACxB,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,YAAY,EAAE;IAAEJ,IAAI;IAAE,GAAGE;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;EAC3D,MAAMC,IAAI,GAAGR,aAAa,GAAG,IAAI,gBAAGS,cAAA,CAACC,kBAAY,EAAA;AAACC,IAAAA,IAAI,EAAE,EAAG;IAAC,aAAA,EAAY;AAAqB,GAAA,CAAG;AAEhG,EAAA,OAAOZ,IAAI,gBACTU,cAAA,CAAAG,mBAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGL;AAAI,GAAC,CAAG,gBAEXC,cAAA,CAACK,uBAAe,EAAA;IACdC,QAAQ,EAAEb,aAAa,CAACa,QAAS;AACjC,IAAA,kBAAA,EAAkBV,cAAe;IACjCW,EAAE,EAAEZ,GAAG,CAACa,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAElB,KAAK,CAACkB,OAAkE;AAAAN,IAAAA,QAAA,EAEhFL;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACsB,WAAW,GAAG,qBAAqB;;;;"}
@@ -8,6 +8,7 @@ import { jsx, Fragment } from 'react/jsx-runtime';
8
8
 
9
9
  const Navigation = function Navigation({
10
10
  href,
11
+ hideIndicator,
11
12
  ...props
12
13
  }) {
13
14
  const {
@@ -20,8 +21,9 @@ const Navigation = function Navigation({
20
21
  ids,
21
22
  describedByIds
22
23
  } = useContext(ListItemContext);
23
- const icon = /*#__PURE__*/jsx(ChevronRight, {
24
- size: 16
24
+ const icon = hideIndicator ? null : /*#__PURE__*/jsx(ChevronRight, {
25
+ size: 16,
26
+ "data-testid": "NavigationIndicator"
25
27
  });
26
28
  return href ? /*#__PURE__*/jsx(Fragment, {
27
29
  children: icon
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemNavigation.mjs","sources":["../../../src/ListItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight } from '@transferwise/icons';\nimport type { ButtonProps } from '../../Button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../Primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href, ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const icon = <ChevronRight size={16} />;\n\n return href ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n disabled={baseItemProps.disabled}\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","icon","_jsx","ChevronRight","size","_Fragment","children","PrimitiveButton","disabled","id","control","className","onClick","displayName"],"mappings":";;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;EAAEC,IAAI;EAAE,GAAGC;AAAK,CAA2B,EAAA;EACvF,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;AAC3D,EAAA,MAAMC,IAAI,gBAAGC,GAAA,CAACC,YAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,OAAOX,IAAI,gBACTS,GAAA,CAAAG,QAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGL;AAAI,GAAC,CAAG,gBAEXC,GAAA,CAACK,eAAe,EAAA;IACdC,QAAQ,EAAEb,aAAa,CAACa,QAAS;AACjC,IAAA,kBAAA,EAAkBV,cAAe;IACjCW,EAAE,EAAEZ,GAAG,CAACa,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAElB,KAAK,CAACkB,OAAkE;AAAAN,IAAAA,QAAA,EAEhFL;AAAI,GACU,CAClB;AACH;AAEAT,UAAU,CAACqB,WAAW,GAAG,qBAAqB;;;;"}
1
+ {"version":3,"file":"ListItemNavigation.mjs","sources":["../../../src/ListItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight } from '@transferwise/icons';\nimport type { ButtonProps } from '../../Button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../Primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n /**\n * When `true`, the chevron indicator is hidden. Use when surrounding context makes the\n * interactive affordance clear without a directional cue (e.g. a widget row with trailing\n * value content).<br />\n * **NB:** This feature should be used with great care as it can result in the item looking\n * as non-interactive, significantly degrading accessibility, UX, and conversion,\n * especially if used on busy screens with multiple Lists.\n */\n hideIndicator?: boolean;\n};\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({\n href,\n hideIndicator,\n ...props\n}: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const icon = hideIndicator ? null : <ChevronRight size={16} data-testid=\"NavigationIndicator\" />;\n\n return href ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n disabled={baseItemProps.disabled}\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","hideIndicator","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","icon","_jsx","ChevronRight","size","_Fragment","children","PrimitiveButton","disabled","id","control","className","onClick","displayName"],"mappings":";;;;;;;;AA2BO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;EAC5CC,IAAI;EACJC,aAAa;EACb,GAAGC;AAAK,CACgB,EAAA;EACxB,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,YAAY,EAAE;IAAEJ,IAAI;IAAE,GAAGE;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;EAC3D,MAAMC,IAAI,GAAGR,aAAa,GAAG,IAAI,gBAAGS,GAAA,CAACC,YAAY,EAAA;AAACC,IAAAA,IAAI,EAAE,EAAG;IAAC,aAAA,EAAY;AAAqB,GAAA,CAAG;AAEhG,EAAA,OAAOZ,IAAI,gBACTU,GAAA,CAAAG,QAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGL;AAAI,GAAC,CAAG,gBAEXC,GAAA,CAACK,eAAe,EAAA;IACdC,QAAQ,EAAEb,aAAa,CAACa,QAAS;AACjC,IAAA,kBAAA,EAAkBV,cAAe;IACjCW,EAAE,EAAEZ,GAAG,CAACa,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAElB,KAAK,CAACkB,OAAkE;AAAAN,IAAAA,QAAA,EAEhFL;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACsB,WAAW,GAAG,qBAAqB;;;;"}
@@ -102,7 +102,7 @@ export declare const ListItem: {
102
102
  displayName: string;
103
103
  };
104
104
  Navigation: {
105
- ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
105
+ ({ href, hideIndicator, ...props }: ListItemNavigationProps): import("react").JSX.Element;
106
106
  displayName: string;
107
107
  };
108
108
  Button: import("react").ForwardRefExoticComponent<Omit<import("..").ButtonProps, "block" | "disabled" | "size" | "v2" | "addonStart"> & {
@@ -1,5 +1,15 @@
1
1
  import type { ButtonProps } from '../../Button/Button.types';
2
- export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;
2
+ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
3
+ /**
4
+ * When `true`, the chevron indicator is hidden. Use when surrounding context makes the
5
+ * interactive affordance clear without a directional cue (e.g. a widget row with trailing
6
+ * value content).<br />
7
+ * **NB:** This feature should be used with great care as it can result in the item looking
8
+ * as non-interactive, significantly degrading accessibility, UX, and conversion,
9
+ * especially if used on busy screens with multiple Lists.
10
+ */
11
+ hideIndicator?: boolean;
12
+ };
3
13
  /**
4
14
  * This component allows for rendering a control functionally synonymous with HTML `anchor` or a
5
15
  * `button`, giving users a rich way to choose between options and navigate to another screen or
@@ -9,7 +19,7 @@ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'ta
9
19
  * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.
10
20
  */
11
21
  export declare const Navigation: {
12
- ({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
22
+ ({ href, hideIndicator, ...props }: ListItemNavigationProps): import("react").JSX.Element;
13
23
  displayName: string;
14
24
  };
15
25
  //# sourceMappingURL=ListItemNavigation.d.ts.map
@@ -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;;CAkBxF,CAAC"}
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,GAAG;IACvF;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;wCAIpB,uBAAuB;;CAkBzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.154.0",
3
+ "version": "46.155.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -106,7 +106,7 @@
106
106
  },
107
107
  "dependencies": {
108
108
  "@babel/runtime": "^7.29.7",
109
- "@floating-ui/react": "^0.27.19",
109
+ "@floating-ui/react": "^0.27.20",
110
110
  "@headlessui/react": "^2.2.10",
111
111
  "@react-aria/focus": "^3.22.1",
112
112
  "@react-aria/overlays": "^3.32.1",
@@ -121,7 +121,7 @@
121
121
  "lodash.debounce": "^4.0.8",
122
122
  "merge-props": "^6.0.0",
123
123
  "react-transition-group": "^4.4.5",
124
- "virtua": "^0.49.2"
124
+ "virtua": "^0.49.3"
125
125
  },
126
126
  "publishConfig": {
127
127
  "access": "public",
@@ -30,6 +30,29 @@ describe('ListItem.Navigation', () => {
30
30
  });
31
31
  });
32
32
 
33
+ describe('hideIndicator', () => {
34
+ it('renders the chevron by default for a button', () => {
35
+ renderWith({ control: <ListItem.Navigation onClick={() => {}} /> });
36
+ expect(screen.getByTestId('NavigationIndicator')).toBeInTheDocument();
37
+ });
38
+
39
+ it('renders the chevron by default for a link', () => {
40
+ renderWith({ control: <ListItem.Navigation href="/test-path" /> });
41
+ expect(screen.getByTestId('NavigationIndicator')).toBeInTheDocument();
42
+ });
43
+
44
+ it('hides the chevron when hideIndicator is true on a button', () => {
45
+ renderWith({ control: <ListItem.Navigation hideIndicator onClick={() => {}} /> });
46
+ expect(screen.queryByTestId('NavigationIndicator')).not.toBeInTheDocument();
47
+ });
48
+
49
+ it('hides the chevron when hideIndicator is true on a link', () => {
50
+ renderWith({ control: <ListItem.Navigation hideIndicator href="/test-path" /> });
51
+ expect(screen.getByRole('link')).toBeInTheDocument();
52
+ expect(screen.queryByTestId('NavigationIndicator')).not.toBeInTheDocument();
53
+ });
54
+ });
55
+
33
56
  describe('as link', () => {
34
57
  it('renders a link if href is set', () => {
35
58
  renderWith({ control: <ListItem.Navigation href="/test-path" /> });
@@ -5,7 +5,17 @@ import { PrimitiveButton } from '../../Primitives';
5
5
  import { useContext } from 'react';
6
6
  import { ListItemContext } from '../ListItemContext';
7
7
 
8
- export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;
8
+ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
9
+ /**
10
+ * When `true`, the chevron indicator is hidden. Use when surrounding context makes the
11
+ * interactive affordance clear without a directional cue (e.g. a widget row with trailing
12
+ * value content).<br />
13
+ * **NB:** This feature should be used with great care as it can result in the item looking
14
+ * as non-interactive, significantly degrading accessibility, UX, and conversion,
15
+ * especially if used on busy screens with multiple Lists.
16
+ */
17
+ hideIndicator?: boolean;
18
+ };
9
19
 
10
20
  /**
11
21
  * This component allows for rendering a control functionally synonymous with HTML `anchor` or a
@@ -15,10 +25,14 @@ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'ta
15
25
  * <br />
16
26
  * Please refer to the [Design documentation](https://docs.wise.design/components/list-item---navigation) for details.
17
27
  */
18
- export const Navigation = function Navigation({ href, ...props }: ListItemNavigationProps) {
28
+ export const Navigation = function Navigation({
29
+ href,
30
+ hideIndicator,
31
+ ...props
32
+ }: ListItemNavigationProps) {
19
33
  const { baseItemProps } = useListItemControl('navigation', { href, ...props });
20
34
  const { ids, describedByIds } = useContext(ListItemContext);
21
- const icon = <ChevronRight size={16} />;
35
+ const icon = hideIndicator ? null : <ChevronRight size={16} data-testid="NavigationIndicator" />;
22
36
 
23
37
  return href ? (
24
38
  <>{icon}</>
@@ -50,6 +50,39 @@ export const Playground: Story = {
50
50
  },
51
51
  };
52
52
 
53
+ /**
54
+ * Use `hideIndicator` when surrounding context (e.g. trailing value content) makes the
55
+ * interactive affordance clear without a chevron. <br />
56
+ * **NB:** This feature should be used with great care as it can result in the item looking
57
+ * as non-interactive, significantly degrading accessibility, UX, and conversion,
58
+ * especially if used on busy screens with multiple Lists.
59
+ */
60
+ export const WithoutIndicator: Story = {
61
+ parameters: {
62
+ controls: { disable: true },
63
+ },
64
+ render: (args) => {
65
+ return (
66
+ <List>
67
+ <ListItem
68
+ control={<ListItem.Navigation href="#target" hideIndicator onClick={args.onClick} />}
69
+ title="Navigation without chevron"
70
+ subtitle="Interactive row — no directional indicator"
71
+ valueTitle="£1,234.56"
72
+ media={MEDIA.avatarSingle}
73
+ />
74
+
75
+ <ListItem
76
+ control={<ListItem.Navigation hideIndicator onClick={args.onClick} />}
77
+ title="Navigation without chevron (button)"
78
+ subtitle="Triggers a click handler"
79
+ media={MEDIA.avatarSingle}
80
+ />
81
+ </List>
82
+ );
83
+ },
84
+ };
85
+
53
86
  /**
54
87
  * Navigation control can be rendered as HTML anchor or a button
55
88
  */