@transferwise/components 0.0.0-experimental-e1870f3 → 0.0.0-experimental-302d967
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/flowNavigation/animatedLabel/AnimatedLabel.js +2 -2
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +2 -2
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/{listItem → legacylistItem}/List.js +2 -3
- package/build/legacylistItem/List.js.map +1 -0
- package/build/{listItem → legacylistItem}/List.mjs +2 -3
- package/build/legacylistItem/List.mjs.map +1 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +2 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +2 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.js +2 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.mjs +2 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
- package/build/listItem/Image/ListItemImage.js +6 -2
- package/build/listItem/Image/ListItemImage.js.map +1 -1
- package/build/listItem/Image/ListItemImage.mjs +6 -2
- package/build/listItem/Image/ListItemImage.mjs.map +1 -1
- package/build/listItem/ListItem.js +16 -14
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +16 -14
- 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 -1
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
- package/build/listItem/_stories/images/landscape.svg +1 -0
- package/build/listItem/_stories/images/portrait.svg +1 -0
- package/build/listItem/useListItemMedia.js +21 -0
- package/build/listItem/useListItemMedia.js.map +1 -0
- package/build/listItem/useListItemMedia.mjs +19 -0
- package/build/listItem/useListItemMedia.mjs.map +1 -0
- package/build/main.css +64 -101
- package/build/styles/avatarView/AvatarView.css +1 -3
- package/build/styles/listItem/ListItem.css +63 -98
- package/build/styles/listItem/ListItem.grid.css +17 -11
- package/build/styles/main.css +64 -101
- package/build/types/index.d.ts +4 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/legacylistItem/List.d.ts +6 -0
- package/build/types/legacylistItem/List.d.ts.map +1 -0
- package/build/types/legacylistItem/index.d.ts +2 -0
- package/build/types/legacylistItem/index.d.ts.map +1 -1
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -1
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/listItem/ListItemContext.d.ts +4 -0
- package/build/types/listItem/ListItemContext.d.ts.map +1 -1
- package/build/types/listItem/index.d.ts +0 -2
- package/build/types/listItem/index.d.ts.map +1 -1
- package/build/types/listItem/test-utils.d.ts +7 -0
- package/build/types/listItem/test-utils.d.ts.map +1 -0
- package/build/types/listItem/useListItemMedia.d.ts +6 -0
- package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/avatarView/AvatarView.css +1 -3
- package/src/avatarView/AvatarView.less +1 -2
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
- package/src/index.ts +4 -9
- package/src/legacylistItem/LegacyListItem.story.tsx +2 -2
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +1 -2
- package/src/legacylistItem/List.tsx +10 -0
- package/src/legacylistItem/index.ts +2 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +4 -5
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +3 -0
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +4 -5
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +3 -0
- package/src/listItem/Button/ListItemButton.spec.tsx +10 -35
- package/src/listItem/Button/ListItemButton.story.tsx +8 -9
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +8 -8
- package/src/listItem/Image/ListItemImage.spec.tsx +8 -5
- package/src/listItem/Image/ListItemImage.story.tsx +23 -6
- package/src/listItem/Image/ListItemImage.tsx +12 -4
- package/src/listItem/ListItem.css +63 -98
- package/src/listItem/ListItem.grid.css +17 -11
- package/src/listItem/ListItem.grid.less +24 -16
- package/src/listItem/ListItem.less +60 -113
- package/src/listItem/ListItem.tsx +24 -18
- package/src/listItem/ListItemContext.tsx +5 -0
- package/src/listItem/Navigation/ListItemNavigation.tsx +1 -1
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +7 -7
- package/src/listItem/Switch/ListItemSwitch.story.tsx +2 -3
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +142 -2
- package/src/listItem/_stories/ListItem.story.tsx +7 -45
- package/src/listItem/_stories/ListItem.variants.test.story.tsx +11 -7
- package/src/listItem/_stories/images/landscape.svg +1 -0
- package/src/listItem/_stories/images/portrait.svg +1 -0
- package/src/listItem/index.ts +0 -3
- package/src/listItem/test-utils.tsx +33 -0
- package/src/listItem/useListItemMedia.tsx +13 -0
- package/src/main.css +64 -101
- package/build/listItem/List.js.map +0 -1
- package/build/listItem/List.mjs.map +0 -1
- package/build/types/listItem/List.d.ts +0 -7
- package/build/types/listItem/List.d.ts.map +0 -1
- package/src/listItem/List.tsx +0 -11
- package/src/listItem/_stories/ListItem.scenarios.story.tsx +0 -226
|
@@ -2,7 +2,6 @@ import { useState } from 'react';
|
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { MultiCurrency, Plus } from '@transferwise/icons';
|
|
4
4
|
import { lorem5, lorem10 } from '../../test-utils';
|
|
5
|
-
import Emphasis from '../../emphasis';
|
|
6
5
|
import { ListItem, Props as ItemProps } from '../ListItem';
|
|
7
6
|
import {
|
|
8
7
|
SB_LIST_ITEM_CONTROLS as CONTROLS,
|
|
@@ -10,7 +9,6 @@ import {
|
|
|
10
9
|
SB_LIST_ITEM_PROMPTS as PROMPTS,
|
|
11
10
|
SB_LIST_ITEM_MEDIA as MEDIA,
|
|
12
11
|
} from './subcomponents';
|
|
13
|
-
import { List } from '../List';
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
* List Items let users review or select options from a dynamic list.<br />
|
|
@@ -243,9 +241,9 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
|
243
241
|
const [props, previewProps] = getPropsForPreview(args);
|
|
244
242
|
|
|
245
243
|
return (
|
|
246
|
-
<
|
|
244
|
+
<ol className="list-unstyled">
|
|
247
245
|
<ListItem {...props} {...previewProps} />
|
|
248
|
-
</
|
|
246
|
+
</ol>
|
|
249
247
|
);
|
|
250
248
|
},
|
|
251
249
|
argTypes: previewArgTypes,
|
|
@@ -279,9 +277,9 @@ export const Responsiveness: Story = {
|
|
|
279
277
|
return (
|
|
280
278
|
<ol
|
|
281
279
|
className="list-unstyled"
|
|
282
|
-
style={{ display: 'grid', gridTemplateColumns: '
|
|
280
|
+
style={{ display: 'grid', gridTemplateColumns: '320px 360px 400px', gap: 16 }}
|
|
283
281
|
>
|
|
284
|
-
<div style={{ width: '
|
|
282
|
+
<div style={{ width: '320px' }}>
|
|
285
283
|
<ListItem
|
|
286
284
|
{...args}
|
|
287
285
|
subtitle={lorem10}
|
|
@@ -291,7 +289,7 @@ export const Responsiveness: Story = {
|
|
|
291
289
|
prompt={PROMPTS.interactive}
|
|
292
290
|
/>
|
|
293
291
|
</div>
|
|
294
|
-
<div style={{ width: '
|
|
292
|
+
<div style={{ width: '360px' }}>
|
|
295
293
|
<ListItem
|
|
296
294
|
{...args}
|
|
297
295
|
subtitle={lorem10}
|
|
@@ -301,7 +299,7 @@ export const Responsiveness: Story = {
|
|
|
301
299
|
prompt={PROMPTS.interactive}
|
|
302
300
|
/>
|
|
303
301
|
</div>
|
|
304
|
-
<div style={{ width: '
|
|
302
|
+
<div style={{ width: '400px' }}>
|
|
305
303
|
<ListItem
|
|
306
304
|
{...args}
|
|
307
305
|
subtitle={lorem10}
|
|
@@ -427,7 +425,7 @@ export const Spotlight: Story = {
|
|
|
427
425
|
* All of these limitations were put in place to ensure that the list item is compliant with
|
|
428
426
|
* accessibility guidance and offers consistent experience across all engineering platforms.
|
|
429
427
|
*
|
|
430
|
-
* Please refer to the [design documentation](https://wise.design/components/list-item
|
|
428
|
+
* Please refer to the [design documentation](https://wise.design/components/list-item#:~:text=specific%20list%20item.-,Interaction,-The%20list%20item) for more details.
|
|
431
429
|
*/
|
|
432
430
|
export const Interactivity: Story = {
|
|
433
431
|
render: function Render() {
|
|
@@ -503,8 +501,6 @@ export const Interactivity: Story = {
|
|
|
503
501
|
* to a new icon for improved user experience and accessibility. <br />
|
|
504
502
|
* For the same reason, only the control part of the List Item is dimmed, while all the content
|
|
505
503
|
* retains high contrast and interactivity.
|
|
506
|
-
*
|
|
507
|
-
* Please refer to the [design documentation](https://wise.design/components/list-item#accessibility:~:text=-,Disabled%20states,-) for more details
|
|
508
504
|
*/
|
|
509
505
|
export const Disabled: Story = {
|
|
510
506
|
parameters: {
|
|
@@ -672,37 +668,3 @@ export const Disabled: Story = {
|
|
|
672
668
|
</div>
|
|
673
669
|
),
|
|
674
670
|
};
|
|
675
|
-
|
|
676
|
-
/**
|
|
677
|
-
* For backwards compatibility, all of the ListItem's content elements accept `ReactNode`.
|
|
678
|
-
* That said, most of them should be fed with plain text only. The exception is `valueTitle`
|
|
679
|
-
* and `valueSubtitle` which can be augmented with sentiment colours, strikethrough or bold
|
|
680
|
-
* styles. <br />
|
|
681
|
-
*
|
|
682
|
-
* Please refer to the [design documentation](https://wise.design/components/list-item#content) for more details.
|
|
683
|
-
*/
|
|
684
|
-
export const StylingLabels: Story = {
|
|
685
|
-
args: {
|
|
686
|
-
title: lorem5,
|
|
687
|
-
subtitle: lorem10,
|
|
688
|
-
media: MEDIA.image,
|
|
689
|
-
control: CONTROLS.iconButton,
|
|
690
|
-
prompt: PROMPTS.interactive,
|
|
691
|
-
},
|
|
692
|
-
render: function Render(args) {
|
|
693
|
-
return (
|
|
694
|
-
<ol className="list-unstyled">
|
|
695
|
-
<ListItem
|
|
696
|
-
{...args}
|
|
697
|
-
valueTitle={<Emphasis text="<negative>100 GBP</negative>" />}
|
|
698
|
-
valueSubtitle={<s>125 GBP</s>}
|
|
699
|
-
/>
|
|
700
|
-
<ListItem
|
|
701
|
-
{...args}
|
|
702
|
-
valueTitle={<Emphasis text="<positive>100 GBP</positive>" />}
|
|
703
|
-
valueSubtitle={<strong>125 GBP</strong>}
|
|
704
|
-
/>
|
|
705
|
-
</ol>
|
|
706
|
-
);
|
|
707
|
-
},
|
|
708
|
-
};
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
SB_LIST_ITEM_PROMPTS as PROMPTS,
|
|
10
10
|
type SB_ListItem_ControlType as ControlType,
|
|
11
11
|
} from './subcomponents';
|
|
12
|
-
import { List } from '../List';
|
|
13
12
|
|
|
14
13
|
export default {
|
|
15
14
|
component: ListItem,
|
|
@@ -72,18 +71,23 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
|
|
|
72
71
|
const additionalInfo = isInteractive ? infoWithLink : infoWithoutLink;
|
|
73
72
|
const variants = [
|
|
74
73
|
{ title },
|
|
74
|
+
{ title, valueTitle },
|
|
75
75
|
{ title, subtitle },
|
|
76
|
+
{ title, valueTitle, valueSubtitle },
|
|
76
77
|
{ title, subtitle, inverted: true },
|
|
77
78
|
{ title, subtitle, valueTitle },
|
|
78
79
|
{ title, subtitle, valueTitle, inverted: true },
|
|
79
80
|
{ title, subtitle, valueTitle, valueSubtitle },
|
|
80
81
|
{ title, subtitle, valueTitle, valueSubtitle, inverted: true },
|
|
81
82
|
{ media, title },
|
|
83
|
+
{ media, title, valueTitle },
|
|
84
|
+
{ media, title, subtitle },
|
|
85
|
+
{ media, title, valueTitle, valueSubtitle },
|
|
86
|
+
{ media, title, valueTitle },
|
|
87
|
+
{ media, title, valueSubtitle },
|
|
82
88
|
{ media, title, subtitle },
|
|
83
89
|
{ media, title, subtitle, valueTitle },
|
|
84
90
|
{ media, title, subtitle, valueTitle, valueSubtitle },
|
|
85
|
-
{ media, title },
|
|
86
|
-
{ media, title, subtitle },
|
|
87
91
|
{ media, title, subtitle, additionalInfo: infoWithoutLink },
|
|
88
92
|
isInteractive ? { media, title, subtitle, additionalInfo: infoWithLink } : null,
|
|
89
93
|
{ media, title, subtitle, additionalInfo, valueTitle },
|
|
@@ -144,7 +148,7 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
|
|
|
144
148
|
return storyConfig(
|
|
145
149
|
{
|
|
146
150
|
render: () => (
|
|
147
|
-
<
|
|
151
|
+
<ol className="list-unstyled">
|
|
148
152
|
{variants.map((variant, variantIndex) => (
|
|
149
153
|
<ListItem
|
|
150
154
|
key={`${controlType}-${variantIndex}-${Math.random()}`}
|
|
@@ -152,7 +156,7 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
|
|
|
152
156
|
{...variant}
|
|
153
157
|
/>
|
|
154
158
|
))}
|
|
155
|
-
</
|
|
159
|
+
</ol>
|
|
156
160
|
),
|
|
157
161
|
},
|
|
158
162
|
{ variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'] },
|
|
@@ -178,7 +182,7 @@ export const Switch = generateVariantsForControl('switch');
|
|
|
178
182
|
|
|
179
183
|
export const ButtonControlLabel: Story = {
|
|
180
184
|
render: () => (
|
|
181
|
-
<
|
|
185
|
+
<ol className="list-unstyled">
|
|
182
186
|
<ListItem
|
|
183
187
|
title="Fully interactive button."
|
|
184
188
|
subtitle="It uses default content hierarchy."
|
|
@@ -262,6 +266,6 @@ export const ButtonControlLabel: Story = {
|
|
|
262
266
|
control={CONTROLS.buttonAsLink}
|
|
263
267
|
prompt={PROMPTS.nonInteractive}
|
|
264
268
|
/>
|
|
265
|
-
</
|
|
269
|
+
</ol>
|
|
266
270
|
),
|
|
267
271
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 112 80"><path fill="#9FE870" stroke="#163300" stroke-width="2" d="M1 79V1h110v78z"/><path fill="#163300" stroke="#163300" stroke-width="2" d="M74.2 21.4 60.9 58h-5.8l11.1-30.8.5-1.3H48.6l.8 1.5 3 5.2-4.7 5.5-1.4 1.7h9.1l-1.4 4H37.3l9.5-11.2 1.4-1.6h-1.5L41 21.4h33.1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 80 112"><path fill="#9FE870" stroke="#163300" stroke-width="2" d="M1 1h78v110H1z"/><path fill="#163300" stroke="#163300" stroke-width="2" d="M59 37 45.9 73.8H40l11-30.9.6-1.3H33.4l1 1.5 3 5.2-4.8 5.5-1.4 1.7h9.1l-1.5 4H22.2l9.5-11.2 1.4-1.6h-1.6L26 37h33Z"/></svg>
|
package/src/listItem/index.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { render, type RenderResult } from '../test-utils';
|
|
2
|
+
import { ListItemContext } from './ListItemContext';
|
|
3
|
+
|
|
4
|
+
export const mockSetControlType = jest.fn();
|
|
5
|
+
export const mockSetControlProps = jest.fn();
|
|
6
|
+
export const mockSetMediaSize = jest.fn();
|
|
7
|
+
|
|
8
|
+
export const renderWithListItemContext = (ui: React.ReactNode): RenderResult => {
|
|
9
|
+
return render(
|
|
10
|
+
<ListItemContext.Provider
|
|
11
|
+
value={{
|
|
12
|
+
setControlType: mockSetControlType,
|
|
13
|
+
setControlProps: mockSetControlProps,
|
|
14
|
+
setMediaSize: mockSetMediaSize,
|
|
15
|
+
ids: {
|
|
16
|
+
title: 'title',
|
|
17
|
+
additionalInfo: 'additional-info',
|
|
18
|
+
valueTitle: 'value-title',
|
|
19
|
+
control: 'control',
|
|
20
|
+
prompt: 'prompt',
|
|
21
|
+
},
|
|
22
|
+
props: {},
|
|
23
|
+
describedByIds: 'described-by-ids',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
{ui}
|
|
27
|
+
</ListItemContext.Provider>,
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const clearListItemMocks = () => {
|
|
32
|
+
jest.clearAllMocks();
|
|
33
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext, useEffect } from 'react';
|
|
2
|
+
import { ListItemContext, type ListItemContextData } from './ListItemContext';
|
|
3
|
+
import type { ListItemAvatarViewProps } from './AvatarView';
|
|
4
|
+
|
|
5
|
+
export function useListItemMedia(size?: ListItemAvatarViewProps['size']) {
|
|
6
|
+
const { setMediaSize, mediaSize } = useContext<ListItemContextData>(ListItemContext);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setMediaSize(size);
|
|
10
|
+
}, [size, setMediaSize]);
|
|
11
|
+
|
|
12
|
+
return { mediaSize, setMediaSize };
|
|
13
|
+
}
|
package/src/main.css
CHANGED
|
@@ -454,8 +454,7 @@
|
|
|
454
454
|
right: 0;
|
|
455
455
|
}
|
|
456
456
|
.np-avatar-view .np-avatar-view-content {
|
|
457
|
-
color:
|
|
458
|
-
color: var(--color-content-primary);
|
|
457
|
+
color: var(--color-interactive-primary);
|
|
459
458
|
}
|
|
460
459
|
.np-avatar-view-interactive {
|
|
461
460
|
cursor: pointer;
|
|
@@ -463,7 +462,6 @@
|
|
|
463
462
|
.np-avatar-view-interactive .np-circle {
|
|
464
463
|
background-color: rgba(134,167,189,0.10196);
|
|
465
464
|
background-color: var(--color-background-neutral);
|
|
466
|
-
color: var(--color-interactive-primary);
|
|
467
465
|
}
|
|
468
466
|
.np-avatar-view-non-interactive .np-circle {
|
|
469
467
|
background-color: transparent;
|
|
@@ -2642,21 +2640,21 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2642
2640
|
gap: 4px 16px;
|
|
2643
2641
|
gap: var(--size-4) var(--size-16);
|
|
2644
2642
|
}
|
|
2645
|
-
@container (min-width:
|
|
2643
|
+
@container (min-width: 375px) {
|
|
2646
2644
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2647
2645
|
grid-template-columns: auto 1fr auto;
|
|
2648
2646
|
grid-template-rows: auto auto auto;
|
|
2649
|
-
grid-template-areas: "media body control" "
|
|
2647
|
+
grid-template-areas: "media body control" ". info ." ". prompt prompt";
|
|
2650
2648
|
}
|
|
2651
2649
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-noPrompt {
|
|
2652
2650
|
grid-template-columns: auto 1fr auto;
|
|
2653
2651
|
grid-template-rows: auto auto;
|
|
2654
|
-
grid-template-areas: "media body control" "
|
|
2652
|
+
grid-template-areas: "media body control" ". info .";
|
|
2655
2653
|
}
|
|
2656
2654
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-hasPrompt {
|
|
2657
2655
|
grid-template-columns: auto 1fr auto;
|
|
2658
2656
|
grid-template-rows: auto auto;
|
|
2659
|
-
grid-template-areas: "media body control" "
|
|
2657
|
+
grid-template-areas: "media body control" ". prompt prompt";
|
|
2660
2658
|
}
|
|
2661
2659
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-noPrompt {
|
|
2662
2660
|
grid-template-columns: auto 1fr auto;
|
|
@@ -2666,17 +2664,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2666
2664
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
|
|
2667
2665
|
grid-template-columns: auto 1fr;
|
|
2668
2666
|
grid-template-rows: auto auto;
|
|
2669
|
-
grid-template-areas: "media body" "
|
|
2667
|
+
grid-template-areas: "media body" ". info" ". prompt";
|
|
2670
2668
|
}
|
|
2671
2669
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-noPrompt {
|
|
2672
2670
|
grid-template-columns: auto 1fr;
|
|
2673
2671
|
grid-template-rows: auto auto auto;
|
|
2674
|
-
grid-template-areas: "media body" "
|
|
2672
|
+
grid-template-areas: "media body" ". info";
|
|
2675
2673
|
}
|
|
2676
2674
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-hasPrompt {
|
|
2677
2675
|
grid-template-columns: auto 1fr;
|
|
2678
2676
|
grid-template-rows: auto auto;
|
|
2679
|
-
grid-template-areas: "media body" "
|
|
2677
|
+
grid-template-areas: "media body" ". prompt";
|
|
2680
2678
|
}
|
|
2681
2679
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-noPrompt {
|
|
2682
2680
|
grid-template-columns: auto 1fr;
|
|
@@ -2689,12 +2687,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2689
2687
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2690
2688
|
grid-template-columns: 1fr auto;
|
|
2691
2689
|
grid-template-rows: auto auto auto;
|
|
2692
|
-
grid-template-areas: "body control" "info
|
|
2690
|
+
grid-template-areas: "body control" "info ." "prompt prompt";
|
|
2693
2691
|
}
|
|
2694
2692
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-noPrompt {
|
|
2695
2693
|
grid-template-columns: 1fr auto;
|
|
2696
2694
|
grid-template-rows: auto auto;
|
|
2697
|
-
grid-template-areas: "body control" "info
|
|
2695
|
+
grid-template-areas: "body control" "info .";
|
|
2698
2696
|
}
|
|
2699
2697
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-noInfo-hasPrompt {
|
|
2700
2698
|
grid-template-columns: 1fr auto;
|
|
@@ -2730,11 +2728,14 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2730
2728
|
grid-template-areas: "body";
|
|
2731
2729
|
}
|
|
2732
2730
|
}
|
|
2733
|
-
@container (min-width:
|
|
2731
|
+
@container (min-width: 297px) and (max-width: 375px) {
|
|
2734
2732
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
|
|
2735
2733
|
margin-bottom: 12px;
|
|
2736
2734
|
margin-bottom: var(--size-12);
|
|
2737
2735
|
}
|
|
2736
|
+
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media .wds-list-item-media-image {
|
|
2737
|
+
height: auto;
|
|
2738
|
+
}
|
|
2738
2739
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2739
2740
|
grid-template-columns: 1fr auto;
|
|
2740
2741
|
grid-template-rows: auto auto auto auto;
|
|
@@ -2775,6 +2776,9 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2775
2776
|
margin-bottom: 16px;
|
|
2776
2777
|
margin-bottom: var(--size-16);
|
|
2777
2778
|
}
|
|
2779
|
+
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media .wds-list-item-media-image {
|
|
2780
|
+
height: auto;
|
|
2781
|
+
}
|
|
2778
2782
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
|
|
2779
2783
|
grid-template-columns: auto auto;
|
|
2780
2784
|
grid-template-rows: auto auto auto auto;
|
|
@@ -2858,7 +2862,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2858
2862
|
grid-template-areas: "body";
|
|
2859
2863
|
}
|
|
2860
2864
|
}
|
|
2861
|
-
@container (max-width:
|
|
2865
|
+
@container (max-width: 297px) {
|
|
2862
2866
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2863
2867
|
grid-template-columns: auto 1fr;
|
|
2864
2868
|
grid-template-rows: auto auto auto;
|
|
@@ -3005,8 +3009,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3005
3009
|
background-color: #ffffff;
|
|
3006
3010
|
background-color: var(--color-background-screen);
|
|
3007
3011
|
position: relative;
|
|
3008
|
-
padding: 12px
|
|
3009
|
-
padding: var(--size-12)
|
|
3012
|
+
padding: 12px;
|
|
3013
|
+
padding: var(--size-12);
|
|
3010
3014
|
container-type: inline-size;
|
|
3011
3015
|
}
|
|
3012
3016
|
.wds-list-item + .wds-list-item-spotlight,
|
|
@@ -3040,6 +3044,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3040
3044
|
.wds-list-item-interactive .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
|
|
3041
3045
|
outline: none;
|
|
3042
3046
|
}
|
|
3047
|
+
.wds-list-item-interactive:has(.wds-list-item-control:focus-visible),
|
|
3048
|
+
.wds-list-item-interactive:has(input[type="checkbox"]:focus-visible) {
|
|
3049
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3050
|
+
outline-offset: var(--ring-outline-offset);
|
|
3051
|
+
outline-offset: -1px;
|
|
3052
|
+
}
|
|
3043
3053
|
.wds-list-item-interactive .wds-list-item-additional-info {
|
|
3044
3054
|
--ring-outline-offset: 0;
|
|
3045
3055
|
}
|
|
@@ -3058,68 +3068,45 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3058
3068
|
position: absolute;
|
|
3059
3069
|
inset: 0;
|
|
3060
3070
|
}
|
|
3061
|
-
.wds-list-item-interactive
|
|
3062
|
-
.wds-list-item-interactive.wds-list-item-spotlight:has(input[type="checkbox"]:focus-visible) {
|
|
3063
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3064
|
-
outline-offset: var(--ring-outline-offset);
|
|
3065
|
-
outline-offset: -1px;
|
|
3066
|
-
}
|
|
3067
|
-
.wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
|
|
3071
|
+
.wds-list-item-interactive:not(.disabled):not(:disabled):hover {
|
|
3068
3072
|
background-color: var(--color-background-screen-hover);
|
|
3069
3073
|
}
|
|
3070
|
-
.wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
|
|
3071
|
-
background-color: var(--color-background-screen-active);
|
|
3072
|
-
}
|
|
3073
|
-
.wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
|
|
3074
|
-
background-color: transparent;
|
|
3075
|
-
background-color: initial;
|
|
3076
|
-
}
|
|
3077
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(.wds-list-item-control:focus-visible):before,
|
|
3078
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(input[type="checkbox"]:focus-visible):before {
|
|
3079
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3080
|
-
outline-offset: var(--ring-outline-offset);
|
|
3081
|
-
content: '';
|
|
3082
|
-
position: absolute;
|
|
3083
|
-
inset: 0 -8px;
|
|
3084
|
-
border-radius: 16px;
|
|
3085
|
-
border-radius: var(--radius-medium);
|
|
3086
|
-
outline-offset: -1px;
|
|
3087
|
-
}
|
|
3088
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):hover:before,
|
|
3089
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):active:before {
|
|
3090
|
-
content: '';
|
|
3091
|
-
position: absolute;
|
|
3092
|
-
inset: 0 -8px;
|
|
3093
|
-
border-radius: 16px;
|
|
3094
|
-
border-radius: var(--radius-medium);
|
|
3095
|
-
}
|
|
3096
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):hover:before {
|
|
3097
|
-
background-color: var(--color-background-screen-hover);
|
|
3098
|
-
}
|
|
3099
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):active:before {
|
|
3100
|
-
background-color: var(--color-background-screen-active);
|
|
3101
|
-
}
|
|
3102
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover:before {
|
|
3103
|
-
background-color: transparent;
|
|
3104
|
-
background-color: initial;
|
|
3105
|
-
}
|
|
3106
3074
|
.wds-list-item-interactive:not(.disabled):not(:disabled):hover .wds-list-item-control-wrapper .wds-Button {
|
|
3107
3075
|
background-color: var(--Button-background-hover);
|
|
3108
3076
|
color: var(--Button-color-hover);
|
|
3109
3077
|
transition: none;
|
|
3110
3078
|
}
|
|
3079
|
+
.wds-list-item-interactive:not(.disabled):not(:disabled):active {
|
|
3080
|
+
background-color: var(--color-background-screen-active);
|
|
3081
|
+
}
|
|
3111
3082
|
.wds-list-item-interactive .wds-list-item-button-control .wds-Button {
|
|
3112
3083
|
transition: none;
|
|
3113
3084
|
}
|
|
3085
|
+
.wds-list-item-interactive:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
|
|
3086
|
+
background-color: transparent;
|
|
3087
|
+
background-color: initial;
|
|
3088
|
+
}
|
|
3114
3089
|
.wds-list-item-media {
|
|
3115
3090
|
grid-area: media;
|
|
3091
|
+
display: flex;
|
|
3092
|
+
align-items: center;
|
|
3093
|
+
}
|
|
3094
|
+
.wds-list-item-media-image-wrapper {
|
|
3095
|
+
width: var(--wds-list-item-media-size);
|
|
3096
|
+
height: var(--wds-list-item-media-size);
|
|
3097
|
+
display: flex;
|
|
3098
|
+
align-items: center;
|
|
3099
|
+
justify-content: center;
|
|
3116
3100
|
}
|
|
3117
3101
|
.wds-list-item-media-image {
|
|
3118
|
-
width:
|
|
3119
|
-
height:
|
|
3102
|
+
width: 100%;
|
|
3103
|
+
height: 100%;
|
|
3104
|
+
-o-object-fit: contain;
|
|
3105
|
+
object-fit: contain;
|
|
3120
3106
|
}
|
|
3121
3107
|
.wds-list-item-body {
|
|
3122
3108
|
grid-area: body;
|
|
3109
|
+
align-items: center;
|
|
3123
3110
|
width: 100%;
|
|
3124
3111
|
display: grid;
|
|
3125
3112
|
grid-template-columns: 1fr max-content;
|
|
@@ -3130,11 +3117,18 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3130
3117
|
gap: var(--size-16);
|
|
3131
3118
|
word-break: break-word;
|
|
3132
3119
|
}
|
|
3133
|
-
.wds-list-item-title
|
|
3134
|
-
.wds-list-item-title-value {
|
|
3120
|
+
.wds-list-item-title {
|
|
3135
3121
|
color: #37517e;
|
|
3136
3122
|
color: var(--color-content-primary);
|
|
3137
3123
|
}
|
|
3124
|
+
.wds-list-item-value {
|
|
3125
|
+
text-align: right;
|
|
3126
|
+
}
|
|
3127
|
+
.wds-list-item-body-center {
|
|
3128
|
+
display: flex;
|
|
3129
|
+
flex-direction: row;
|
|
3130
|
+
align-items: center;
|
|
3131
|
+
}
|
|
3138
3132
|
.wds-list-item-additional-info {
|
|
3139
3133
|
grid-area: info;
|
|
3140
3134
|
color: #768e9c;
|
|
@@ -3142,12 +3136,13 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3142
3136
|
margin-top: calc(4px * -1);
|
|
3143
3137
|
margin-top: calc(var(--size-4) * -1);
|
|
3144
3138
|
}
|
|
3145
|
-
.wds-list-item-value {
|
|
3146
|
-
align-items: end;
|
|
3147
|
-
text-align: right;
|
|
3148
|
-
}
|
|
3149
3139
|
.wds-list-item-control-wrapper {
|
|
3150
3140
|
grid-area: control;
|
|
3141
|
+
align-content: center;
|
|
3142
|
+
}
|
|
3143
|
+
.wds-list-item-navigation .tw-icon-chevron-right {
|
|
3144
|
+
color: #c9cbce;
|
|
3145
|
+
color: var(--color-interactive-secondary);
|
|
3151
3146
|
}
|
|
3152
3147
|
.wds-list-item-control {
|
|
3153
3148
|
flex: 0 0 auto;
|
|
@@ -3163,12 +3158,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3163
3158
|
color: #768e9c;
|
|
3164
3159
|
color: var(--color-content-tertiary);
|
|
3165
3160
|
}
|
|
3166
|
-
.wds-list-item-spotlight {
|
|
3167
|
-
padding-left: 12px;
|
|
3168
|
-
padding-left: var(--size-12);
|
|
3169
|
-
padding-right: 12px;
|
|
3170
|
-
padding-right: var(--size-12);
|
|
3171
|
-
}
|
|
3172
3161
|
.wds-list-item-spotlight-active {
|
|
3173
3162
|
background-color: rgba(134,167,189,0.10196);
|
|
3174
3163
|
background-color: var(--color-background-neutral);
|
|
@@ -3181,6 +3170,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3181
3170
|
}
|
|
3182
3171
|
.wds-list-item-spotlight-inactive {
|
|
3183
3172
|
background-color: rgba(134, 167, 189, 0.025);
|
|
3173
|
+
border: 1px dashed rgba(0,0,0,0.10196);
|
|
3174
|
+
border: 1px dashed var(--color-border-neutral);
|
|
3184
3175
|
}
|
|
3185
3176
|
@supports (color: color-mix(in lch, red, blue)) {
|
|
3186
3177
|
.wds-list-item-spotlight-inactive {
|
|
@@ -3193,34 +3184,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3193
3184
|
.wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
|
|
3194
3185
|
background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
|
|
3195
3186
|
}
|
|
3196
|
-
.wds-list-item .wds-list-item-spotlight__border {
|
|
3197
|
-
position: absolute;
|
|
3198
|
-
inset: 0;
|
|
3199
|
-
width: 100%;
|
|
3200
|
-
height: 100%;
|
|
3201
|
-
}
|
|
3202
|
-
.wds-list-item .wds-list-item-spotlight__border rect {
|
|
3203
|
-
--wds-list-item-spotlight-borderWidth: 1px;
|
|
3204
|
-
--wds-list-item-spotlight-borderWidthOffset: 0.5px;
|
|
3205
|
-
--wds-list-item-spotlight-strokeDashSize: calc(var(--size-12) * 0.5);
|
|
3206
|
-
fill: none;
|
|
3207
|
-
stroke: rgba(0,0,0,0.10196);
|
|
3208
|
-
stroke: var(--color-border-neutral);
|
|
3209
|
-
width: calc(100% - 1px);
|
|
3210
|
-
width: calc(100% - var(--wds-list-item-spotlight-borderWidth));
|
|
3211
|
-
height: calc(100% - 1px);
|
|
3212
|
-
height: calc(100% - var(--wds-list-item-spotlight-borderWidth));
|
|
3213
|
-
x: 0.5px;
|
|
3214
|
-
x: var(--wds-list-item-spotlight-borderWidthOffset);
|
|
3215
|
-
y: 0.5px;
|
|
3216
|
-
y: var(--wds-list-item-spotlight-borderWidthOffset);
|
|
3217
|
-
rx: calc(16px - 0.5px);
|
|
3218
|
-
rx: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
|
|
3219
|
-
ry: calc(16px - 0.5px);
|
|
3220
|
-
ry: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
|
|
3221
|
-
stroke-dasharray: calc(12px * 0.5) calc(12px * 0.5);
|
|
3222
|
-
stroke-dasharray: var(--wds-list-item-spotlight-strokeDashSize) var(--wds-list-item-spotlight-strokeDashSize);
|
|
3223
|
-
}
|
|
3224
3187
|
.wds-list-item-prompt {
|
|
3225
3188
|
grid-area: prompt;
|
|
3226
3189
|
display: inline-flex;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../src/listItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n as?: 'ul' | 'ol' | 'div';\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ as: Element = 'ul', className, children }: ListProps) {\n return <Element className={clsx('wds-list', 'list-unstyled', className)}>{children}</Element>;\n}\n"],"names":["List","as","Element","className","children","_jsx","clsx"],"mappings":";;;;;AAQM,SAAUA,IAAIA,CAAC;EAAEC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;EACzE,oBAAOC,cAAA,CAACH,OAAO,EAAA;IAACC,SAAS,EAAEG,SAAI,CAAC,UAAU,EAAE,eAAe,EAAEH,SAAS,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAU,CAAC;AAC/F;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.mjs","sources":["../../src/listItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n as?: 'ul' | 'ol' | 'div';\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ as: Element = 'ul', className, children }: ListProps) {\n return <Element className={clsx('wds-list', 'list-unstyled', className)}>{children}</Element>;\n}\n"],"names":["List","as","Element","className","children","_jsx","clsx"],"mappings":";;;AAQM,SAAUA,IAAIA,CAAC;EAAEC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;EACzE,oBAAOC,GAAA,CAACH,OAAO,EAAA;IAACC,SAAS,EAAEG,IAAI,CAAC,UAAU,EAAE,eAAe,EAAEH,SAAS,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAU,CAAC;AAC/F;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/listItem/List.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAE1E"}
|
package/src/listItem/List.tsx
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
|
|
3
|
-
export interface ListProps {
|
|
4
|
-
as?: 'ul' | 'ol' | 'div';
|
|
5
|
-
className?: string;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function List({ as: Element = 'ul', className, children }: ListProps) {
|
|
10
|
-
return <Element className={clsx('wds-list', 'list-unstyled', className)}>{children}</Element>;
|
|
11
|
-
}
|