@transferwise/components 0.0.0-experimental-4242b3a → 0.0.0-experimental-2007f10

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/main.css CHANGED
@@ -2682,6 +2682,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2682
2682
  -webkit-text-decoration: none;
2683
2683
  text-decoration: none;
2684
2684
  }
2685
+ .wds-list-item.disabled {
2686
+ filter: none;
2687
+ opacity: 1;
2688
+ }
2689
+ .wds-list-item.disabled label {
2690
+ cursor: not-allowed;
2691
+ }
2692
+ .wds-list-item.disabled .tw-icon-backslash-circle {
2693
+ color: #768e9c;
2694
+ color: var(--color-content-tertiary);
2695
+ }
2685
2696
  .wds-list-item-spotlight-active {
2686
2697
  background-color: rgba(134,167,189,0.10196);
2687
2698
  background-color: var(--color-background-neutral);
@@ -62,6 +62,17 @@
62
62
  -webkit-text-decoration: none;
63
63
  text-decoration: none;
64
64
  }
65
+ .wds-list-item.disabled {
66
+ filter: none;
67
+ opacity: 1;
68
+ }
69
+ .wds-list-item.disabled label {
70
+ cursor: not-allowed;
71
+ }
72
+ .wds-list-item.disabled .tw-icon-backslash-circle {
73
+ color: #768e9c;
74
+ color: var(--color-content-tertiary);
75
+ }
65
76
  .wds-list-item-spotlight-active {
66
77
  background-color: rgba(134,167,189,0.10196);
67
78
  background-color: var(--color-background-neutral);
@@ -2682,6 +2682,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2682
2682
  -webkit-text-decoration: none;
2683
2683
  text-decoration: none;
2684
2684
  }
2685
+ .wds-list-item.disabled {
2686
+ filter: none;
2687
+ opacity: 1;
2688
+ }
2689
+ .wds-list-item.disabled label {
2690
+ cursor: not-allowed;
2691
+ }
2692
+ .wds-list-item.disabled .tw-icon-backslash-circle {
2693
+ color: #768e9c;
2694
+ color: var(--color-content-tertiary);
2695
+ }
2685
2696
  .wds-list-item-spotlight-active {
2686
2697
  background-color: rgba(134,167,189,0.10196);
2687
2698
  background-color: var(--color-background-neutral);
@@ -32,7 +32,7 @@ const Switch = props => {
32
32
  'np-switch--checked': checked,
33
33
  disabled
34
34
  }, className),
35
- tabIndex: 0,
35
+ tabIndex: disabled ? -1 : 0,
36
36
  role: "switch",
37
37
  "aria-checked": checked,
38
38
  "aria-label": ariaLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const handleKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === ' ') {\n event.preventDefault();\n onClick();\n }\n };\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <span\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n tabIndex={0}\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n {...inputAttributes}\n aria-labelledby={ariaLabelledby}\n id={id}\n aria-disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? handleKeyDown : undefined}\n >\n <span className=\"np-switch--thumb\" />\n <input type=\"checkbox\" checked={checked} readOnly />\n </span>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","handleKeyDown","event","key","preventDefault","ariaLabelledby","undefined","_jsxs","clsx","tabIndex","role","onKeyDown","children","_jsx","type","readOnly"],"mappings":";;;;;;;;AAuBMA,MAAAA,MAAM,GAAIC,KAAkB,IAAI;EACpC,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAM,GAAA,CAAC;EAElE,MAAM;IACJC,OAAO;IACPC,SAAS;IACTC,EAAE,GAAGL,eAAe,CAACK,EAAE;AACvB,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,iBAAiB,EAAEC,kBAAkB;IACrCC,OAAO;AACPC,IAAAA;AAAQ,GACT,GAAGV,KAAK;EAET,MAAMW,aAAa,GAA0BC,KAAK,IAAI;AACpD,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,EAAE;MACrBD,KAAK,CAACE,cAAc,EAAE;AACtBL,MAAAA,OAAO,EAAE;AACX;GACD;AAED,EAAA,MAAMM,cAAc,GAClB,CAACR,SAAS,GAAGS,SAAS,GAAGR,kBAAkB,KAAKP,eAAe,CAAC,iBAAiB,CAAC;AAEpF,EAAA,oBACEgB,eAAA,CAAA,MAAA,EAAA;AACEZ,IAAAA,SAAS,EAAEa,SAAI,CACb,WAAW,EACX;MACE,sBAAsB,EAAE,CAACd,OAAO;AAChC,MAAA,oBAAoB,EAAEA,OAAO;AAC7BM,MAAAA;KACD,EACDL,SAAS,CACT;AACFc,IAAAA,QAAQ,EAAE,CAAE;AACZC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,cAAA,EAAchB,OAAQ;AACtB,IAAA,YAAA,EAAYG,SAAU;AAAA,IAAA,GAClBN,eAAe;AACnB,IAAA,iBAAA,EAAiBc,cAAe;AAChCT,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,eAAA,EAAeI,QAAS;AACxBD,IAAAA,OAAO,EAAE,CAACC,QAAQ,GAAGD,OAAO,GAAGO,SAAU;AACzCK,IAAAA,SAAS,EAAE,CAACX,QAAQ,GAAGC,aAAa,GAAGK,SAAU;AAAAM,IAAAA,QAAA,gBAEjDC,cAAA,CAAA,MAAA,EAAA;AAAMlB,MAAAA,SAAS,EAAC;KAChB,CAAA,eAAAkB,cAAA,CAAA,OAAA,EAAA;AAAOC,MAAAA,IAAI,EAAC,UAAU;AAACpB,MAAAA,OAAO,EAAEA,OAAQ;MAACqB,QAAQ,EAAA;AAAA,KACnD,CAAA;AAAA,GAAM,CAAC;AAEX;;;;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const handleKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === ' ') {\n event.preventDefault();\n onClick();\n }\n };\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <span\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n tabIndex={disabled ? -1 : 0}\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n {...inputAttributes}\n aria-labelledby={ariaLabelledby}\n id={id}\n aria-disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? handleKeyDown : undefined}\n >\n <span className=\"np-switch--thumb\" />\n <input type=\"checkbox\" checked={checked} readOnly />\n </span>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","handleKeyDown","event","key","preventDefault","ariaLabelledby","undefined","_jsxs","clsx","tabIndex","role","onKeyDown","children","_jsx","type","readOnly"],"mappings":";;;;;;;;AAuBMA,MAAAA,MAAM,GAAIC,KAAkB,IAAI;EACpC,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAM,GAAA,CAAC;EAElE,MAAM;IACJC,OAAO;IACPC,SAAS;IACTC,EAAE,GAAGL,eAAe,CAACK,EAAE;AACvB,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,iBAAiB,EAAEC,kBAAkB;IACrCC,OAAO;AACPC,IAAAA;AAAQ,GACT,GAAGV,KAAK;EAET,MAAMW,aAAa,GAA0BC,KAAK,IAAI;AACpD,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,EAAE;MACrBD,KAAK,CAACE,cAAc,EAAE;AACtBL,MAAAA,OAAO,EAAE;AACX;GACD;AAED,EAAA,MAAMM,cAAc,GAClB,CAACR,SAAS,GAAGS,SAAS,GAAGR,kBAAkB,KAAKP,eAAe,CAAC,iBAAiB,CAAC;AAEpF,EAAA,oBACEgB,eAAA,CAAA,MAAA,EAAA;AACEZ,IAAAA,SAAS,EAAEa,SAAI,CACb,WAAW,EACX;MACE,sBAAsB,EAAE,CAACd,OAAO;AAChC,MAAA,oBAAoB,EAAEA,OAAO;AAC7BM,MAAAA;KACD,EACDL,SAAS,CACT;AACFc,IAAAA,QAAQ,EAAET,QAAQ,GAAG,EAAE,GAAG,CAAE;AAC5BU,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,cAAA,EAAchB,OAAQ;AACtB,IAAA,YAAA,EAAYG,SAAU;AAAA,IAAA,GAClBN,eAAe;AACnB,IAAA,iBAAA,EAAiBc,cAAe;AAChCT,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,eAAA,EAAeI,QAAS;AACxBD,IAAAA,OAAO,EAAE,CAACC,QAAQ,GAAGD,OAAO,GAAGO,SAAU;AACzCK,IAAAA,SAAS,EAAE,CAACX,QAAQ,GAAGC,aAAa,GAAGK,SAAU;AAAAM,IAAAA,QAAA,gBAEjDC,cAAA,CAAA,MAAA,EAAA;AAAMlB,MAAAA,SAAS,EAAC;KAChB,CAAA,eAAAkB,cAAA,CAAA,OAAA,EAAA;AAAOC,MAAAA,IAAI,EAAC,UAAU;AAACpB,MAAAA,OAAO,EAAEA,OAAQ;MAACqB,QAAQ,EAAA;AAAA,KACnD,CAAA;AAAA,GAAM,CAAC;AAEX;;;;"}
@@ -28,7 +28,7 @@ const Switch = props => {
28
28
  'np-switch--checked': checked,
29
29
  disabled
30
30
  }, className),
31
- tabIndex: 0,
31
+ tabIndex: disabled ? -1 : 0,
32
32
  role: "switch",
33
33
  "aria-checked": checked,
34
34
  "aria-label": ariaLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.mjs","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const handleKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === ' ') {\n event.preventDefault();\n onClick();\n }\n };\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <span\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n tabIndex={0}\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n {...inputAttributes}\n aria-labelledby={ariaLabelledby}\n id={id}\n aria-disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? handleKeyDown : undefined}\n >\n <span className=\"np-switch--thumb\" />\n <input type=\"checkbox\" checked={checked} readOnly />\n </span>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","handleKeyDown","event","key","preventDefault","ariaLabelledby","undefined","_jsxs","clsx","tabIndex","role","onKeyDown","children","_jsx","type","readOnly"],"mappings":";;;;AAuBMA,MAAAA,MAAM,GAAIC,KAA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kB,GAAA,CAAA,OAAA,EAAA;AAAOC,MAAAA,IAAI,EAAC,UAAU;AAACpB,MAAAA,OAAO,EAAEA,OAAQ;MAACqB,QAAQ,EAAA;AAAA,KACnD,CAAA;AAAA,GAAM,CAAC;AAEX;;;;"}
1
+ {"version":3,"file":"Switch.mjs","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const handleKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === ' ') {\n event.preventDefault();\n onClick();\n }\n };\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <span\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n tabIndex={disabled ? -1 : 0}\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n {...inputAttributes}\n aria-labelledby={ariaLabelledby}\n id={id}\n aria-disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? handleKeyDown : undefined}\n >\n <span className=\"np-switch--thumb\" />\n <input type=\"checkbox\" checked={checked} readOnly />\n </span>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","handleKeyDown","event","key","preventDefault","ariaLabelledby","undefined","_jsxs","clsx","tabIndex","role","onKeyDown","children","_jsx","type","readOnly"],"mappings":";;;;AAuBMA,MAAAA,MAAM,GAAIC,KAAkB,IAAI;EACpC,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAM,GAAA,CAAC;EAElE,MAAM;IACJC,OAAO;IACPC,SAAS;IACTC,EAAE,GAAGL,eAAe,CAACK,EAAE;AACvB,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,iBAAiB,EAAEC,kBAAkB;IACrCC,OAAO;AACPC,IAAAA;AAAQ,GACT,GAAGV,KAAK;EAET,MAAMW,aAAa,GAA0BC,KAAK,IAAI;AACpD,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,EAAE;MACrBD,KAAK,CAACE,cAAc,EAAE;AACtBL,MAAAA,OAAO,EAAE;AACX;GACD;AAED,EAAA,MAAMM,cAAc,GAClB,CAACR,SAAS,GAAGS,SAAS,GAAGR,kBAAkB,KAAKP,eAAe,CAAC,iBAAiB,CAAC;AAEpF,EAAA,oBACEgB,IAAA,CAAA,MAAA,EAAA;AACEZ,IAAAA,SAAS,EAAEa,IAAI,CACb,WAAW,EACX;MACE,sBAAsB,EAAE,CAACd,OAAO;AAChC,MAAA,oBAAoB,EAAEA,OAAO;AAC7BM,MAAAA;KACD,EACDL,SAAS,CACT;AACFc,IAAAA,QAAQ,EAAET,QAAQ,GAAG,EAAE,GAAG,CAAE;AAC5BU,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,cAAA,EAAchB,OAAQ;AACtB,IAAA,YAAA,EAAYG,SAAU;AAAA,IAA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F,eAAO,MAAM,eAAe,8CAA2C,CAAC;AAExE,eAAO,MAAM,QAAQ;6JAclB,KAAK;;;;;;;;;;;CAgHP,CAAC;AAqFF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF,eAAO,MAAM,UAAU,GAAuB,oBAA0B,uBAAuB,gCAe9F,CAAC"}
1
+ {"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF,eAAO,MAAM,UAAU,GAAuB,oBAA0B,uBAAuB,gCAkB9F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-4242b3a",
3
+ "version": "0.0.0-experimental-2007f10",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -91,10 +91,10 @@
91
91
  "rollup": "^4.41.1",
92
92
  "rollup-preserve-directives": "^1.1.3",
93
93
  "storybook": "^8.6.14",
94
- "@transferwise/less-config": "3.1.2",
95
94
  "@transferwise/neptune-css": "14.24.4",
96
95
  "@wise/components-theming": "1.6.3",
97
- "@wise/wds-configs": "0.0.0"
96
+ "@wise/wds-configs": "0.0.0",
97
+ "@transferwise/less-config": "3.1.2"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@transferwise/icons": "^3.22.0",
@@ -62,6 +62,17 @@
62
62
  -webkit-text-decoration: none;
63
63
  text-decoration: none;
64
64
  }
65
+ .wds-list-item.disabled {
66
+ filter: none;
67
+ opacity: 1;
68
+ }
69
+ .wds-list-item.disabled label {
70
+ cursor: not-allowed;
71
+ }
72
+ .wds-list-item.disabled .tw-icon-backslash-circle {
73
+ color: #768e9c;
74
+ color: var(--color-content-tertiary);
75
+ }
65
76
  .wds-list-item-spotlight-active {
66
77
  background-color: rgba(134,167,189,0.10196);
67
78
  background-color: var(--color-background-neutral);
@@ -72,6 +72,19 @@
72
72
  }
73
73
  }
74
74
 
75
+ &.disabled {
76
+ filter: none;
77
+ opacity: 1;
78
+
79
+ label {
80
+ cursor: not-allowed;
81
+ }
82
+
83
+ .tw-icon-backslash-circle {
84
+ color: var(--color-content-tertiary);
85
+ }
86
+ }
87
+
75
88
  &-spotlight {
76
89
  &-active {
77
90
  background-color: var(--color-background-neutral);
@@ -458,4 +458,125 @@ export const ButtonInteractivity: Story = {
458
458
  },
459
459
  };
460
460
 
461
+ export const Disabled: Story = {
462
+ render: () => (
463
+ <div>
464
+ <ListItem
465
+ disabled
466
+ media={
467
+ <ListItem.AvatarView>
468
+ <MultiCurrency />
469
+ </ListItem.AvatarView>
470
+ }
471
+ title="Navigation"
472
+ subtitle={lorem5}
473
+ control={<ListItem.Navigation onClick={() => {}} />}
474
+ />
475
+ <ListItem
476
+ disabled
477
+ media={
478
+ <ListItem.AvatarView>
479
+ <MultiCurrency />
480
+ </ListItem.AvatarView>
481
+ }
482
+ title="Button secondary neutral"
483
+ subtitle={lorem5}
484
+ control={<ListItem.Button priority="secondary-neutral">Secondary Neutral</ListItem.Button>}
485
+ />
486
+ <ListItem
487
+ disabled
488
+ media={
489
+ <ListItem.AvatarView>
490
+ <MultiCurrency />
491
+ </ListItem.AvatarView>
492
+ }
493
+ title="Button primary"
494
+ subtitle={lorem5}
495
+ control={<ListItem.Button priority="primary">Primary</ListItem.Button>}
496
+ />
497
+ <ListItem
498
+ disabled
499
+ media={
500
+ <ListItem.AvatarView>
501
+ <MultiCurrency />
502
+ </ListItem.AvatarView>
503
+ }
504
+ title="Button tertiary"
505
+ subtitle={lorem5}
506
+ control={<ListItem.Button priority="tertiary">Tertiary</ListItem.Button>}
507
+ />
508
+ <ListItem
509
+ disabled
510
+ media={
511
+ <ListItem.AvatarView>
512
+ <MultiCurrency />
513
+ </ListItem.AvatarView>
514
+ }
515
+ title="Icon Button"
516
+ subtitle={lorem5}
517
+ control={
518
+ <ListItem.IconButton>
519
+ <Plus />
520
+ </ListItem.IconButton>
521
+ }
522
+ />
523
+ <ListItem
524
+ disabled
525
+ media={
526
+ <ListItem.AvatarView>
527
+ <MultiCurrency />
528
+ </ListItem.AvatarView>
529
+ }
530
+ title="Checkbox"
531
+ subtitle={lorem5}
532
+ control={<ListItem.Checkbox />}
533
+ />
534
+ <ListItem
535
+ disabled
536
+ media={
537
+ <ListItem.AvatarView>
538
+ <MultiCurrency />
539
+ </ListItem.AvatarView>
540
+ }
541
+ title="Checkbox checked"
542
+ subtitle={lorem5}
543
+ control={<ListItem.Checkbox checked />}
544
+ />
545
+ <ListItem
546
+ disabled
547
+ media={
548
+ <ListItem.AvatarView>
549
+ <MultiCurrency />
550
+ </ListItem.AvatarView>
551
+ }
552
+ title="Checkbox indeterminate"
553
+ subtitle={lorem5}
554
+ control={<ListItem.Checkbox indeterminate />}
555
+ />
556
+ <ListItem
557
+ disabled
558
+ media={
559
+ <ListItem.AvatarView>
560
+ <MultiCurrency />
561
+ </ListItem.AvatarView>
562
+ }
563
+ title="Switch on"
564
+ subtitle={lorem5}
565
+ control={<ListItem.Switch checked onClick={() => {}} />}
566
+ />
567
+ <ListItem
568
+ disabled
569
+ media={
570
+ <ListItem.AvatarView>
571
+ <MultiCurrency />
572
+ </ListItem.AvatarView>
573
+ }
574
+ title="Switch off"
575
+ subtitle={lorem5}
576
+ control={<ListItem.Switch onClick={() => {}} />}
577
+ />
578
+ </div>
579
+ ),
580
+ };
581
+
461
582
  // add intaces with dark mode
@@ -134,6 +134,7 @@ export const ListItem = ({
134
134
  {
135
135
  'wds-list-item-interactive':
136
136
  controlType !== 'non-interactive' &&
137
+ !disabled &&
137
138
  !(controlProps as ListItemButtonProps | ListItemIconButtonProps)
138
139
  ?.partiallyInteractive,
139
140
  },
@@ -144,6 +145,7 @@ export const ListItem = ({
144
145
  { disabled },
145
146
  className,
146
147
  )}
148
+ aria-disabled={disabled}
147
149
  aria-describedby={[ids.additionalInfo].join(' ')}
148
150
  >
149
151
  <View {...{ prompt, controlType, controlProps }}>
@@ -6,7 +6,7 @@ export type ListItemButtonProps = Omit<NewButtonProps, 'v2' | 'size' | 'disabled
6
6
  };
7
7
 
8
8
  export const Button = ({
9
- priority = 'secondary-neutral',
9
+ priority = 'secondary',
10
10
  partiallyInteractive,
11
11
  ...props
12
12
  }: ListItemButtonProps) => {
@@ -8,7 +8,10 @@ export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'ta
8
8
  export const Navigation = function Navigation({ href = '#', ...props }: ListItemNavigationProps) {
9
9
  const { baseItemProps } = useItemControl('navigation', { href, ...props });
10
10
  const isLink = href !== '#';
11
- const icon = baseItemProps.disabled ? <BackslashCircle size={24} /> : <ChevronRight size={24} />;
11
+ const icon = <ChevronRight size={24} />;
12
+
13
+ if (baseItemProps.disabled) return <BackslashCircle size={24} />;
14
+
12
15
  return isLink ? (
13
16
  <>{icon}</>
14
17
  ) : (
package/src/main.css CHANGED
@@ -2682,6 +2682,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2682
2682
  -webkit-text-decoration: none;
2683
2683
  text-decoration: none;
2684
2684
  }
2685
+ .wds-list-item.disabled {
2686
+ filter: none;
2687
+ opacity: 1;
2688
+ }
2689
+ .wds-list-item.disabled label {
2690
+ cursor: not-allowed;
2691
+ }
2692
+ .wds-list-item.disabled .tw-icon-backslash-circle {
2693
+ color: #768e9c;
2694
+ color: var(--color-content-tertiary);
2695
+ }
2685
2696
  .wds-list-item-spotlight-active {
2686
2697
  background-color: rgba(134,167,189,0.10196);
2687
2698
  background-color: var(--color-background-neutral);
@@ -55,7 +55,7 @@ const Switch = (props: SwitchProps) => {
55
55
  },
56
56
  className,
57
57
  )}
58
- tabIndex={0}
58
+ tabIndex={disabled ? -1 : 0}
59
59
  role="switch"
60
60
  aria-checked={checked}
61
61
  aria-label={ariaLabel}