@transferwise/components 0.0.0-experimental-3ab6847 → 0.0.0-experimental-0e85724

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.
Files changed (42) hide show
  1. package/build/ListItem/ListItem.js +2 -0
  2. package/build/ListItem/ListItem.js.map +1 -1
  3. package/build/ListItem/ListItem.mjs +2 -0
  4. package/build/ListItem/ListItem.mjs.map +1 -1
  5. package/build/Snackbar/Snackbar.js +101 -98
  6. package/build/Snackbar/Snackbar.js.map +1 -1
  7. package/build/Snackbar/Snackbar.mjs +102 -99
  8. package/build/Snackbar/Snackbar.mjs.map +1 -1
  9. package/build/i18n/de.json +1 -0
  10. package/build/i18n/de.json.js +1 -0
  11. package/build/i18n/de.json.js.map +1 -1
  12. package/build/i18n/de.json.mjs +1 -0
  13. package/build/i18n/de.json.mjs.map +1 -1
  14. package/build/i18n/fr.json +1 -0
  15. package/build/i18n/fr.json.js +1 -0
  16. package/build/i18n/fr.json.js.map +1 -1
  17. package/build/i18n/fr.json.mjs +1 -0
  18. package/build/i18n/fr.json.mjs.map +1 -1
  19. package/build/i18n/th.json +1 -0
  20. package/build/i18n/th.json.js +1 -0
  21. package/build/i18n/th.json.js.map +1 -1
  22. package/build/i18n/th.json.mjs +1 -0
  23. package/build/i18n/th.json.mjs.map +1 -1
  24. package/build/main.css +5 -0
  25. package/build/styles/ListItem/ListItem.css +5 -0
  26. package/build/styles/main.css +5 -0
  27. package/build/types/ListItem/ListItem.d.ts +6 -1
  28. package/build/types/ListItem/ListItem.d.ts.map +1 -1
  29. package/build/types/Snackbar/Snackbar.d.ts +15 -1
  30. package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/src/ListItem/ListItem.css +5 -0
  33. package/src/ListItem/ListItem.less +4 -0
  34. package/src/ListItem/ListItem.test.tsx +17 -0
  35. package/src/ListItem/ListItem.tsx +7 -0
  36. package/src/ListItem/_stories/ListItem.layout.test.story.tsx +23 -0
  37. package/src/ListItem/_stories/ListItem.story.tsx +8 -0
  38. package/src/Snackbar/Snackbar.tsx +88 -90
  39. package/src/i18n/de.json +1 -0
  40. package/src/i18n/fr.json +1 -0
  41. package/src/i18n/th.json +1 -0
  42. package/src/main.css +5 -0
@@ -1,122 +1,125 @@
1
- import { useRef, useState, useEffect } from 'react';
1
+ import { Component, createRef } from 'react';
2
2
  import { CSSTransition } from 'react-transition-group';
3
3
  import Button from '../Button/Button.resolver.mjs';
4
4
  import Body from '../Body/Body.mjs';
5
+ import { DirectionContext } from '../Provider/Direction/DirectionProvider.mjs';
5
6
  import withNextPortalWrapper from '../WithNextPortal/WithNextPortal.mjs';
6
7
  import { jsx, jsxs } from 'react/jsx-runtime';
7
8
 
8
9
  const CSS_TRANSITION_DURATION = 400;
9
- const Snackbar = props => {
10
- const bodyRef = useRef(null);
11
- const leaveTimeout = useRef(0);
12
- const transitionTimeout = useRef(0);
13
- /** The props of the last committed render, as `this.props` was in the class component. */
14
- const committedProps = useRef(props);
15
- const [state, setState] = useState({
16
- visible: false,
17
- text: ''
18
- });
19
- useEffect(() => () => {
20
- window.clearTimeout(leaveTimeout.current);
21
- window.clearTimeout(transitionTimeout.current);
22
- }, []);
23
- // Runs after every render to mirror the componentDidUpdate lifecycle this component previously
24
- // relied on, including the shouldComponentUpdate guard that ignored every update without text.
25
- // Both rules below are disabled on purpose: the dependency-less effect and its synchronous state
26
- // updates are what keep this conversion behaviour-identical to the class component.
27
- /* eslint-disable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
28
- useEffect(() => {
29
- const previousProps = committedProps.current;
30
- committedProps.current = props;
10
+ class Snackbar extends Component {
11
+ bodyRef = /*#__PURE__*/createRef();
12
+ timeout = 0;
13
+ transitionTimeout = 0;
14
+ constructor(props) {
15
+ super(props);
16
+ this.state = {
17
+ visible: false,
18
+ text: ''
19
+ };
20
+ }
21
+ componentWillUnmount() {
22
+ window.clearTimeout(this.timeout);
23
+ window.clearTimeout(this.transitionTimeout);
24
+ }
25
+ shouldComponentUpdate(nextProps, nextState) {
26
+ if (!nextProps.text) {
27
+ return false;
28
+ }
29
+ if (nextProps.timestamp === this.props.timestamp && nextState.visible === this.state.visible && nextState.text === this.state.text) {
30
+ return false;
31
+ }
32
+ return true;
33
+ }
34
+ setLeaveTimeout = () => {
35
+ const {
36
+ timeout
37
+ } = this.props;
38
+ this.timeout = window.setTimeout(() => {
39
+ this.setState({
40
+ visible: false
41
+ });
42
+ }, timeout);
43
+ };
44
+ componentDidUpdate(previousProps) {
31
45
  const {
32
46
  action,
33
47
  text,
34
- timeout,
35
48
  timestamp
36
- } = props;
37
- // shouldComponentUpdate bailed out whenever the incoming text was empty. That also blocked the
38
- // updates scheduled below, so a Snackbar whose text is cleared stays on screen until it is
39
- // given text again. Preserved here deliberately to keep this refactor behaviour-identical.
40
- const updateWhileTextIsPresent = update => {
41
- if (committedProps.current.text) {
42
- update();
43
- }
44
- };
45
- const setLeaveTimeout = () => {
46
- leaveTimeout.current = window.setTimeout(() => {
47
- updateWhileTextIsPresent(() => setState(current => ({
48
- ...current,
49
- visible: false
50
- })));
51
- }, timeout);
52
- };
53
- const show = () => {
54
- setState(current => ({
55
- ...current,
49
+ } = this.props;
50
+ if (!previousProps.text) {
51
+ this.setState({
56
52
  visible: true,
57
53
  action,
58
54
  text
59
- }));
60
- setLeaveTimeout();
61
- };
62
- if (!text) {
63
- return;
64
- }
65
- if (!previousProps.text) {
66
- show();
55
+ }, () => {
56
+ this.setLeaveTimeout();
57
+ });
67
58
  } else if (previousProps.timestamp !== timestamp) {
68
- window.clearTimeout(leaveTimeout.current);
69
- if (state.visible) {
70
- setState(current => ({
71
- ...current,
59
+ window.clearTimeout(this.timeout);
60
+ if (this.state.visible) {
61
+ this.setState({
72
62
  visible: false
73
- }));
74
- transitionTimeout.current = window.setTimeout(() => {
75
- updateWhileTextIsPresent(show);
76
- }, CSS_TRANSITION_DURATION);
63
+ }, () => {
64
+ this.transitionTimeout = window.setTimeout(() => {
65
+ this.setState({
66
+ visible: true,
67
+ action,
68
+ text
69
+ });
70
+ this.setLeaveTimeout();
71
+ }, CSS_TRANSITION_DURATION);
72
+ });
77
73
  } else {
78
- show();
74
+ this.setState({
75
+ visible: true,
76
+ action,
77
+ text
78
+ });
79
+ this.setLeaveTimeout();
79
80
  }
80
81
  }
81
- });
82
- /* eslint-enable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */
83
- const {
84
- action,
85
- text,
86
- visible
87
- } = state;
88
- const {
89
- timeout
90
- } = props;
91
- return /*#__PURE__*/jsx("div", {
92
- className: "snackbar",
93
- "aria-live": "assertive",
94
- role: "alert",
95
- children: /*#__PURE__*/jsx(CSSTransition, {
96
- nodeRef: bodyRef,
97
- in: visible,
98
- classNames: "snackbar__text-container",
99
- timeout: {
100
- appear: 0,
101
- enter: timeout,
102
- exit: CSS_TRANSITION_DURATION
103
- },
104
- unmountOnExit: true,
105
- children: /*#__PURE__*/jsxs(Body, {
106
- ref: bodyRef,
107
- as: "span",
108
- className: "snackbar__text",
109
- children: [text, action ? /*#__PURE__*/jsx(Button, {
110
- className: "snackbar__text__action",
111
- v2: true,
112
- size: "sm",
113
- onClick: action.onClick,
114
- children: action.label
115
- }) : null]
82
+ }
83
+ render() {
84
+ const {
85
+ action,
86
+ text,
87
+ visible
88
+ } = this.state;
89
+ const {
90
+ timeout
91
+ } = this.props;
92
+ return /*#__PURE__*/jsx("div", {
93
+ className: "snackbar",
94
+ "aria-live": "assertive",
95
+ role: "alert",
96
+ children: /*#__PURE__*/jsx(CSSTransition, {
97
+ nodeRef: this.bodyRef,
98
+ in: visible,
99
+ classNames: "snackbar__text-container",
100
+ timeout: {
101
+ appear: 0,
102
+ enter: timeout,
103
+ exit: CSS_TRANSITION_DURATION
104
+ },
105
+ unmountOnExit: true,
106
+ children: /*#__PURE__*/jsxs(Body, {
107
+ ref: this.bodyRef,
108
+ as: "span",
109
+ className: "snackbar__text",
110
+ children: [text, action ? /*#__PURE__*/jsx(Button, {
111
+ className: "snackbar__text__action",
112
+ v2: true,
113
+ size: "sm",
114
+ onClick: action.onClick,
115
+ children: action.label
116
+ }) : null]
117
+ })
116
118
  })
117
- })
118
- });
119
- };
119
+ });
120
+ }
121
+ }
122
+ Snackbar.contextType = DirectionContext;
120
123
  var SnackbarPortal = withNextPortalWrapper(Snackbar);
121
124
 
122
125
  export { Snackbar, SnackbarPortal as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.mjs","sources":["../../src/Snackbar/Snackbar.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../Button';\nimport Body from '../Body';\nimport type { ThemeDark, ThemeLight } from '../common';\nimport withNextPortal from '../WithNextPortal/WithNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport const Snackbar = (props: SnackbarProps) => {\n const bodyRef = useRef<HTMLSpanElement>(null);\n const leaveTimeout = useRef(0);\n const transitionTimeout = useRef(0);\n /** The props of the last committed render, as `this.props` was in the class component. */\n const committedProps = useRef(props);\n\n const [state, setState] = useState<SnackbarState>({\n visible: false,\n text: '',\n });\n\n useEffect(\n () => () => {\n window.clearTimeout(leaveTimeout.current);\n window.clearTimeout(transitionTimeout.current);\n },\n [],\n );\n\n // Runs after every render to mirror the componentDidUpdate lifecycle this component previously\n // relied on, including the shouldComponentUpdate guard that ignored every update without text.\n // Both rules below are disabled on purpose: the dependency-less effect and its synchronous state\n // updates are what keep this conversion behaviour-identical to the class component.\n /* eslint-disable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */\n useEffect(() => {\n const previousProps = committedProps.current;\n committedProps.current = props;\n\n const { action, text, timeout, timestamp } = props;\n\n // shouldComponentUpdate bailed out whenever the incoming text was empty. That also blocked the\n // updates scheduled below, so a Snackbar whose text is cleared stays on screen until it is\n // given text again. Preserved here deliberately to keep this refactor behaviour-identical.\n const updateWhileTextIsPresent = (update: () => void) => {\n if (committedProps.current.text) {\n update();\n }\n };\n\n const setLeaveTimeout = () => {\n leaveTimeout.current = window.setTimeout(() => {\n updateWhileTextIsPresent(() => setState((current) => ({ ...current, visible: false })));\n }, timeout);\n };\n\n const show = () => {\n setState((current) => ({ ...current, visible: true, action, text }));\n setLeaveTimeout();\n };\n\n if (!text) {\n return;\n }\n\n if (!previousProps.text) {\n show();\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(leaveTimeout.current);\n\n if (state.visible) {\n setState((current) => ({ ...current, visible: false }));\n transitionTimeout.current = window.setTimeout(() => {\n updateWhileTextIsPresent(show);\n }, CSS_TRANSITION_DURATION);\n } else {\n show();\n }\n }\n });\n /* eslint-enable react-hooks/exhaustive-deps, react-hooks/set-state-in-effect */\n\n const { action, text, visible } = state;\n const { timeout } = props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n};\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","props","bodyRef","useRef","leaveTimeout","transitionTimeout","committedProps","state","setState","useState","visible","text","useEffect","window","clearTimeout","current","previousProps","action","timeout","timestamp","updateWhileTextIsPresent","update","setLeaveTimeout","setTimeout","show","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","withNextPortal"],"mappings":";;;;;;;AAQA,MAAMA,uBAAuB,GAAG,GAAG;AAkB5B,MAAMC,QAAQ,GAAIC,KAAoB,IAAI;AAC/C,EAAA,MAAMC,OAAO,GAAGC,MAAM,CAAkB,IAAI,CAAC;AAC7C,EAAA,MAAMC,YAAY,GAAGD,MAAM,CAAC,CAAC,CAAC;AAC9B,EAAA,MAAME,iBAAiB,GAAGF,MAAM,CAAC,CAAC,CAAC;AACnC;AACA,EAAA,MAAMG,cAAc,GAAGH,MAAM,CAACF,KAAK,CAAC;AAEpC,EAAA,MAAM,CAACM,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAgB;AAChDC,IAAAA,OAAO,EAAE,KAAK;AACdC,IAAAA,IAAI,EAAE;AACP,GAAA,CAAC;EAEFC,SAAS,CACP,MAAM,MAAK;AACTC,IAAAA,MAAM,CAACC,YAAY,CAACV,YAAY,CAACW,OAAO,CAAC;AACzCF,IAAAA,MAAM,CAACC,YAAY,CAACT,iBAAiB,CAACU,OAAO,CAAC;EAChD,CAAC,EACD,EAAE,CACH;AAED;AACA;AACA;AACA;AACA;AACAH,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,MAAMI,aAAa,GAAGV,cAAc,CAACS,OAAO;IAC5CT,cAAc,CAACS,OAAO,GAAGd,KAAK;IAE9B,MAAM;MAAEgB,MAAM;MAAEN,IAAI;MAAEO,OAAO;AAAEC,MAAAA;AAAS,KAAE,GAAGlB,KAAK;AAElD;AACA;AACA;IACA,MAAMmB,wBAAwB,GAAIC,MAAkB,IAAI;AACtD,MAAA,IAAIf,cAAc,CAACS,OAAO,CAACJ,IAAI,EAAE;AAC/BU,QAAAA,MAAM,EAAE;AACV,MAAA;IACF,CAAC;IAED,MAAMC,eAAe,GAAGA,MAAK;AAC3BlB,MAAAA,YAAY,CAACW,OAAO,GAAGF,MAAM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KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAU;AAAC,IAAA,WAAA,EAAU,WAAW;AAACC,IAAAA,IAAI,EAAC,OAAO;IAAAC,QAAA,eAC1DH,GAAA,CAACI,aAAa,EAAA;AACZC,MAAAA,OAAO,EAAE5B,OAAQ;AACjB6B,MAAAA,EAAE,EAAErB,OAAQ;AACZsB,MAAAA,UAAU,EAAC,0BAA0B;AACrCd,MAAAA,OAAO,EAAE;AACPe,QAAAA,MAAM,EAAE,CAAC;AACTC,QAAAA,KAAK,EAAEhB,OAAO;AACdiB,QAAAA,IAAI,EAAEpC;OACN;MACFqC,aAAa,EAAA,IAAA;MAAAR,QAAA,eAEbS,IAAA,CAACC,IAAI,EAAA;AAACC,QAAAA,GAAG,EAAErC,OAAQ;AAACsC,QAAAA,EAAE,EAAC,MAAM;AAACd,QAAAA,SAAS,EAAC,gBAAgB;AAAAE,QAAAA,QAAA,GACrDjB,IAAI,EACJM,MAAM,gBACLQ,GAAA,CAACgB,MAAM,EAAA;AAACf,UAAAA,SAAS,EAAC,wBAAwB;UAACgB,EAAE,EAAA,IAAA;AAACC,UAAAA,IAAI,EAAC,IAAI;UAACC,OAAO,EAAE3B,MAAM,CAAC2B,OAAQ;UAAAhB,QAAA,EAC7EX,MAAM,CAAC4B;SACF,CAAC,GACP,IAAI;OACJ;KACO;AACjB,GAAK,CAAC;AAEV;AAEA,qBAAeC,qBAAc,CAAC9C,QAAQ,CAAC;;"}
1
+ {"version":3,"file":"Snackbar.mjs","sources":["../../src/Snackbar/Snackbar.tsx"],"sourcesContent":["import { Component, createRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../Button';\nimport Body from '../Body';\nimport type { ThemeDark, ThemeLight } from '../common';\nimport { DirectionContext } from '../Provider/Direction';\nimport withNextPortal from '../WithNextPortal/WithNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport class Snackbar extends Component<SnackbarProps, SnackbarState> {\n bodyRef = createRef<HTMLSpanElement>();\n timeout = 0;\n transitionTimeout = 0;\n\n constructor(props: SnackbarProps) {\n super(props);\n this.state = {\n visible: false,\n text: '',\n };\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n window.clearTimeout(this.transitionTimeout);\n }\n\n shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {\n if (!nextProps.text) {\n return false;\n }\n if (\n nextProps.timestamp === this.props.timestamp &&\n nextState.visible === this.state.visible &&\n nextState.text === this.state.text\n ) {\n return false;\n }\n\n return true;\n }\n\n setLeaveTimeout = () => {\n const { timeout } = this.props;\n\n this.timeout = window.setTimeout(() => {\n this.setState({ visible: false });\n }, timeout);\n };\n\n componentDidUpdate(previousProps: SnackbarProps) {\n const { action, text, timestamp } = this.props;\n\n if (!previousProps.text) {\n this.setState({ visible: true, action, text }, () => {\n this.setLeaveTimeout();\n });\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(this.timeout);\n\n if (this.state.visible) {\n this.setState({ visible: false }, () => {\n this.transitionTimeout = window.setTimeout(() => {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }, CSS_TRANSITION_DURATION);\n });\n } else {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }\n }\n }\n\n render() {\n const { action, text, visible } = this.state;\n const { timeout } = this.props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={this.bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={this.bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n }\n}\n\nSnackbar.contextType = DirectionContext;\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","Component","bodyRef","createRef","timeout","transitionTimeout","constructor","props","state","visible","text","componentWillUnmount","window","clearTimeout","shouldComponentUpdate","nextProps","nextState","timestamp","setLeaveTimeout","setTimeout","setState","componentDidUpdate","previousProps","action","render","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","contextType","DirectionContext","withNextPortal"],"mappings":";;;;;;;;AASA,MAAMA,uBAAuB,GAAG,GAAG;AAkB7B,MAAOC,QAAS,SAAQC,SAAuC,CAAA;EACnEC,OAAO,gBAAGC,SAAS,EAAmB;AACtCC,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,iBAAiB,GAAG,CAAC;EAErBC,WAAAA,CAAYC,KAAoB,EAAA;IAC9B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,IAAI,EAAE;KACP;AACH,EAAA;AAEAC,EAAAA,oBAAoBA,GAAA;AAClBC,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACT,OAAO,CAAC;AACjCQ,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACR,iBAAiB,CAAC;AAC7C,EAAA;AAEAS,EAAAA,qBAAqBA,CAACC,SAAwB,EAAEC,SAAwB,EAAA;AACtE,IAAA,IAAI,CAACD,SAAS,CAACL,IAAI,EAAE;AACnB,MAAA,OAAO,KAAK;AACd,IAAA;AACA,IAAA,IACEK,SAAS,CAACE,SAAS,KAAK,IAAI,CAACV,KAAK,CAACU,SAAS,IA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YAAAA,IAAI,EAAC,IAAI;YAACC,OAAO,EAAErB,MAAM,CAACqB,OAAQ;YAAAhB,QAAA,EAC7EL,MAAM,CAACsB;WACF,CAAC,GACP,IAAI;SACJ;OACO;AACjB,KAAK,CAAC;AAEV,EAAA;AACD;AAED7C,QAAQ,CAAC8C,WAAW,GAAGC,gBAAgB;AAEvC,qBAAeC,qBAAc,CAAChD,QAAQ,CAAC;;"}
@@ -35,6 +35,7 @@
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Vorwahl",
38
39
  "neptune.Select.searchPlaceholder": "Wird gesucht...",
39
40
  "neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
40
41
  "neptune.StatusIcon.iconLabel.error": "Fehler:",
@@ -39,6 +39,7 @@ var de = {
39
39
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
40
40
  "neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
41
41
  "neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
42
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Vorwahl",
42
43
  "neptune.Select.searchPlaceholder": "Wird gesucht...",
43
44
  "neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
44
45
  "neptune.StatusIcon.iconLabel.error": "Fehler:",
@@ -1 +1 @@
1
- {"version":3,"file":"de.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"de.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@ var de = {
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Wähle eine Option...",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "Ländercode",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Vorwahl",
38
39
  "neptune.Select.searchPlaceholder": "Wird gesucht...",
39
40
  "neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
40
41
  "neptune.StatusIcon.iconLabel.error": "Fehler:",
@@ -1 +1 @@
1
- {"version":3,"file":"de.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"de.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Indicatif",
38
39
  "neptune.Select.searchPlaceholder": "Recherche...",
39
40
  "neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
40
41
  "neptune.StatusIcon.iconLabel.error": "Erreur :",
@@ -39,6 +39,7 @@ var fr = {
39
39
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
40
40
  "neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
41
41
  "neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
42
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Indicatif",
42
43
  "neptune.Select.searchPlaceholder": "Recherche...",
43
44
  "neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
44
45
  "neptune.StatusIcon.iconLabel.error": "Erreur :",
@@ -1 +1 @@
1
- {"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@ var fr = {
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "Sélectionnez une option…",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "Code pays",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "Indicatif",
38
39
  "neptune.Select.searchPlaceholder": "Recherche...",
39
40
  "neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
40
41
  "neptune.StatusIcon.iconLabel.error": "Erreur :",
@@ -1 +1 @@
1
- {"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
38
39
  "neptune.Select.searchPlaceholder": "ค้นหา...",
39
40
  "neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
40
41
  "neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
@@ -39,6 +39,7 @@ var th = {
39
39
  "neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
40
40
  "neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
41
41
  "neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
42
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
42
43
  "neptune.Select.searchPlaceholder": "ค้นหา...",
43
44
  "neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
44
45
  "neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
@@ -1 +1 @@
1
- {"version":3,"file":"th.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"th.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@ var th = {
35
35
  "neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
36
36
  "neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
37
37
  "neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
38
+ "neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
38
39
  "neptune.Select.searchPlaceholder": "ค้นหา...",
39
40
  "neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
40
41
  "neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
@@ -1 +1 @@
1
- {"version":3,"file":"th.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"th.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/main.css CHANGED
@@ -23806,6 +23806,11 @@ button.np-option {
23806
23806
  padding-inline: 0;
23807
23807
  container-type: inline-size;
23808
23808
  }
23809
+ .wds-list-item-paddingY-24 {
23810
+ padding-block: 24px;
23811
+ padding-block: var(--size-24);
23812
+ padding-inline: 0;
23813
+ }
23809
23814
  .wds-list-item + .wds-list-item-spotlight,
23810
23815
  .wds-list-item-spotlight + .wds-list-item {
23811
23816
  margin-block-start: 16px;
@@ -397,6 +397,11 @@
397
397
  padding-inline: 0;
398
398
  container-type: inline-size;
399
399
  }
400
+ .wds-list-item-paddingY-24 {
401
+ padding-block: 24px;
402
+ padding-block: var(--size-24);
403
+ padding-inline: 0;
404
+ }
400
405
  .wds-list-item + .wds-list-item-spotlight,
401
406
  .wds-list-item-spotlight + .wds-list-item {
402
407
  margin-block-start: 16px;
@@ -23806,6 +23806,11 @@ button.np-option {
23806
23806
  padding-inline: 0;
23807
23807
  container-type: inline-size;
23808
23808
  }
23809
+ .wds-list-item-paddingY-24 {
23810
+ padding-block: 24px;
23811
+ padding-block: var(--size-24);
23812
+ padding-inline: 0;
23813
+ }
23809
23814
  .wds-list-item + .wds-list-item-spotlight,
23810
23815
  .wds-list-item-spotlight + .wds-list-item {
23811
23816
  margin-block-start: 16px;
@@ -28,6 +28,11 @@ export type ListItemProps = {
28
28
  * Highlights the list item as an action to be taken or already taken. <br />
29
29
  */
30
30
  spotlight?: 'active' | 'inactive';
31
+ /**
32
+ * Vertical padding of the list item, in pixels.
33
+ * @default 12
34
+ */
35
+ paddingY?: 12 | 24;
31
36
  title: ReactNode;
32
37
  subtitle?: ReactNode;
33
38
  /**
@@ -72,7 +77,7 @@ export type ListItemProps = {
72
77
  * @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)
73
78
  */
74
79
  export declare const ListItem: {
75
- ({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, disabledPromptMessage, className, valueColumnWidth, id, }: ListItemProps): import("react").JSX.Element;
80
+ ({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, paddingY, valueTitle, valueSubtitle, control, disabled, disabledPromptMessage, className, valueColumnWidth, id, }: ListItemProps): import("react").JSX.Element;
76
81
  Image: {
77
82
  ({ alt, size, className, ...props }: import("./Image").ListItemImageProps): import("react").JSX.Element;
78
83
  displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAY,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAS,KAAK,kBAAkB,EAAE,MAAM,SAAS,CA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AAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;OASG;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;oNAkBlB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Of,CAAC;AA6GF,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { Component } from 'react';
1
2
  import type { ThemeDark, ThemeLight } from '../common';
2
3
  export interface SnackbarProps {
3
4
  action?: {
@@ -10,7 +11,20 @@ export interface SnackbarProps {
10
11
  timeout: number;
11
12
  timestamp: number;
12
13
  }
13
- export declare const Snackbar: (props: SnackbarProps) => import("react").JSX.Element;
14
+ interface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {
15
+ visible: boolean;
16
+ }
17
+ export declare class Snackbar extends Component<SnackbarProps, SnackbarState> {
18
+ bodyRef: import("react").RefObject<HTMLSpanElement>;
19
+ timeout: number;
20
+ transitionTimeout: number;
21
+ constructor(props: SnackbarProps);
22
+ componentWillUnmount(): void;
23
+ shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState): boolean;
24
+ setLeaveTimeout: () => void;
25
+ componentDidUpdate(previousProps: SnackbarProps): void;
26
+ render(): import("react").JSX.Element;
27
+ }
14
28
  declare const _default: (props: SnackbarProps) => import("react").ReactPortal | null;
15
29
  export default _default;
16
30
  //# sourceMappingURL=Snackbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../../../src/Snackbar/Snackbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,gCAmG5C,CAAC;;AAEF,wBAAwC"}
1
+ {"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../../../src/Snackbar/Snackbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAMvD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC9E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,QAAS,SAAQ,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACnE,OAAO,6CAAgC;IACvC,OAAO,SAAK;IACZ,iBAAiB,SAAK;gBAEV,KAAK,EAAE,aAAa;IAQhC,oBAAoB;IAKpB,qBAAqB,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa;IAexE,eAAe,aAMb;IAEF,kBAAkB,CAAC,aAAa,EAAE,aAAa;IAwB/C,MAAM;CA6BP;;AAID,wBAAwC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-3ab6847",
3
+ "version": "0.0.0-experimental-0e85724",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -397,6 +397,11 @@
397
397
  padding-inline: 0;
398
398
  container-type: inline-size;
399
399
  }
400
+ .wds-list-item-paddingY-24 {
401
+ padding-block: 24px;
402
+ padding-block: var(--size-24);
403
+ padding-inline: 0;
404
+ }
400
405
  .wds-list-item + .wds-list-item-spotlight,
401
406
  .wds-list-item-spotlight + .wds-list-item {
402
407
  margin-block-start: 16px;
@@ -11,6 +11,10 @@
11
11
  padding: var(--size-12) 0;
12
12
  container-type: inline-size;
13
13
 
14
+ &-paddingY-24 {
15
+ padding: var(--size-24) 0;
16
+ }
17
+
14
18
  & + .wds-list-item-spotlight,
15
19
  .wds-list-item-spotlight + & {
16
20
  margin-top: var(--size-16);
@@ -1513,6 +1513,23 @@ describe('ListItem', () => {
1513
1513
  });
1514
1514
  });
1515
1515
 
1516
+ describe('paddingY', () => {
1517
+ it('uses the default vertical padding when not set', () => {
1518
+ render(<ListItem title="Test Title" />);
1519
+ expect(screen.getByRole('listitem')).not.toHaveClass('wds-list-item-paddingY-24');
1520
+ });
1521
+
1522
+ it('uses the default vertical padding when set to 12', () => {
1523
+ render(<ListItem title="Test Title" paddingY={12} />);
1524
+ expect(screen.getByRole('listitem')).not.toHaveClass('wds-list-item-paddingY-24');
1525
+ });
1526
+
1527
+ it('uses the larger vertical padding when set to 24', () => {
1528
+ render(<ListItem title="Test Title" paddingY={24} />);
1529
+ expect(screen.getByRole('listitem')).toHaveClass('wds-list-item-paddingY-24');
1530
+ });
1531
+ });
1532
+
1516
1533
  describe('disable states', () => {
1517
1534
  describe('short-lived', () => {
1518
1535
  it('should override existing prompt if disabled and disabledPromptMessage are set', () => {
@@ -59,6 +59,11 @@ export type ListItemProps = {
59
59
  * Highlights the list item as an action to be taken or already taken. <br />
60
60
  */
61
61
  spotlight?: 'active' | 'inactive';
62
+ /**
63
+ * Vertical padding of the list item, in pixels.
64
+ * @default 12
65
+ */
66
+ paddingY?: 12 | 24;
62
67
  title: ReactNode;
63
68
  subtitle?: ReactNode;
64
69
  /**
@@ -112,6 +117,7 @@ export const ListItem = ({
112
117
  inverted,
113
118
  media,
114
119
  spotlight,
120
+ paddingY = 12,
115
121
  valueTitle,
116
122
  valueSubtitle,
117
123
  control = null,
@@ -232,6 +238,7 @@ export const ListItem = ({
232
238
  'wds-list-item-partially-interactive': isPartiallyInteractive,
233
239
  [`wds-list-item-spotlight wds-list-item-spotlight-${spotlight}`]:
234
240
  isFullyInteractive && !!spotlight,
241
+ 'wds-list-item-paddingY-24': paddingY === 24,
235
242
  disabled: disabled && !isPartiallyInteractive,
236
243
  'disabled--has-prompt-reason':
237
244
  !disabledPromptMessage && disabled && !isPartiallyInteractive,
@@ -1,5 +1,6 @@
1
1
  import { Fragment } from 'react';
2
2
  import { Meta, StoryObj } from '@storybook/react-webpack5';
3
+ import { Plane } from '@transferwise/icons';
3
4
  import List from '../../List';
4
5
  import { ListItem, type ListItemProps } from '../ListItem';
5
6
  import { lorem10, lorem20, lorem5 } from '../../test-utils';
@@ -61,6 +62,28 @@ export const GapsBetweenItems: Story = {
61
62
  },
62
63
  };
63
64
 
65
+ export const PaddingY: Story = {
66
+ render: () => {
67
+ const props = {
68
+ title: lorem5,
69
+ subtitle: lorem10,
70
+ media: <ListItem.AvatarLayout size={32} avatars={[{ asset: <Plane /> }, { asset: '7+' }]} />,
71
+ control: CONTROLS.navigation,
72
+ };
73
+ return (
74
+ <List>
75
+ {([12, 24] as const).map((paddingY) => (
76
+ <Fragment key={paddingY}>
77
+ <ListItem {...props} paddingY={paddingY} />
78
+ <ListItem {...props} paddingY={paddingY} spotlight="active" />
79
+ <ListItem {...props} paddingY={paddingY} spotlight="inactive" />
80
+ </Fragment>
81
+ ))}
82
+ </List>
83
+ );
84
+ },
85
+ };
86
+
64
87
  type PreviewStoryArgs = ListItemProps & {
65
88
  previewImageSize: ListItemMediaSize;
66
89
  previewWithLineGuides: boolean;