@transferwise/components 0.0.0-experimental-15914a5 → 0.0.0-experimental-e1870f3

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 (99) hide show
  1. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +2 -2
  2. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  3. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +2 -2
  4. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  5. package/build/index.js +2 -2
  6. package/build/index.mjs +1 -1
  7. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +0 -2
  8. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
  9. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +0 -2
  10. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
  11. package/build/listItem/AvatarView/ListItemAvatarView.js +0 -2
  12. package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -1
  13. package/build/listItem/AvatarView/ListItemAvatarView.mjs +0 -2
  14. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
  15. package/build/listItem/Image/ListItemImage.js +1 -3
  16. package/build/listItem/Image/ListItemImage.js.map +1 -1
  17. package/build/listItem/Image/ListItemImage.mjs +1 -3
  18. package/build/listItem/Image/ListItemImage.mjs.map +1 -1
  19. package/build/{legacylistItem → listItem}/List.js +3 -2
  20. package/build/listItem/List.js.map +1 -0
  21. package/build/{legacylistItem → listItem}/List.mjs +3 -2
  22. package/build/listItem/List.mjs.map +1 -0
  23. package/build/listItem/ListItem.js +14 -16
  24. package/build/listItem/ListItem.js.map +1 -1
  25. package/build/listItem/ListItem.mjs +14 -16
  26. package/build/listItem/ListItem.mjs.map +1 -1
  27. package/build/listItem/ListItemContext.js.map +1 -1
  28. package/build/listItem/ListItemContext.mjs.map +1 -1
  29. package/build/listItem/Navigation/ListItemNavigation.js +1 -1
  30. package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
  31. package/build/listItem/Navigation/ListItemNavigation.mjs +1 -1
  32. package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
  33. package/build/main.css +99 -51
  34. package/build/styles/avatarView/AvatarView.css +3 -1
  35. package/build/styles/listItem/ListItem.css +96 -50
  36. package/build/styles/listItem/ListItem.grid.css +9 -15
  37. package/build/styles/main.css +99 -51
  38. package/build/types/index.d.ts +4 -4
  39. package/build/types/index.d.ts.map +1 -1
  40. package/build/types/legacylistItem/index.d.ts +0 -2
  41. package/build/types/legacylistItem/index.d.ts.map +1 -1
  42. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -1
  43. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -1
  44. package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -1
  45. package/build/types/listItem/List.d.ts +7 -0
  46. package/build/types/listItem/List.d.ts.map +1 -0
  47. package/build/types/listItem/ListItem.d.ts.map +1 -1
  48. package/build/types/listItem/ListItemContext.d.ts +0 -4
  49. package/build/types/listItem/ListItemContext.d.ts.map +1 -1
  50. package/build/types/listItem/index.d.ts +2 -0
  51. package/build/types/listItem/index.d.ts.map +1 -1
  52. package/package.json +1 -1
  53. package/src/avatarView/AvatarView.css +3 -1
  54. package/src/avatarView/AvatarView.less +2 -1
  55. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  56. package/src/index.ts +9 -4
  57. package/src/legacylistItem/LegacyListItem.story.tsx +2 -2
  58. package/src/legacylistItem/LegacyListItem.tests.story.tsx +2 -1
  59. package/src/legacylistItem/index.ts +0 -2
  60. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +5 -4
  61. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +0 -3
  62. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +5 -4
  63. package/src/listItem/AvatarView/ListItemAvatarView.tsx +0 -3
  64. package/src/listItem/Button/ListItemButton.spec.tsx +35 -10
  65. package/src/listItem/Button/ListItemButton.story.tsx +9 -8
  66. package/src/listItem/IconButton/ListItemIconButton.story.tsx +8 -8
  67. package/src/listItem/Image/ListItemImage.spec.tsx +5 -8
  68. package/src/listItem/Image/ListItemImage.story.tsx +6 -23
  69. package/src/listItem/Image/ListItemImage.tsx +1 -4
  70. package/src/listItem/List.tsx +11 -0
  71. package/src/listItem/ListItem.css +96 -50
  72. package/src/listItem/ListItem.grid.css +9 -15
  73. package/src/listItem/ListItem.grid.less +14 -22
  74. package/src/listItem/ListItem.less +111 -46
  75. package/src/listItem/ListItem.tsx +18 -24
  76. package/src/listItem/ListItemContext.tsx +0 -5
  77. package/src/listItem/Navigation/ListItemNavigation.tsx +1 -1
  78. package/src/listItem/Prompt/ListItemPrompt.story.tsx +7 -7
  79. package/src/listItem/Switch/ListItemSwitch.story.tsx +3 -2
  80. package/src/listItem/_stories/ListItem.scenarios.story.tsx +226 -0
  81. package/src/listItem/_stories/ListItem.story.tsx +45 -7
  82. package/src/listItem/_stories/ListItem.variants.test.story.tsx +7 -11
  83. package/src/listItem/index.ts +3 -0
  84. package/src/main.css +99 -51
  85. package/build/legacylistItem/List.js.map +0 -1
  86. package/build/legacylistItem/List.mjs.map +0 -1
  87. package/build/listItem/useListItemMedia.js +0 -21
  88. package/build/listItem/useListItemMedia.js.map +0 -1
  89. package/build/listItem/useListItemMedia.mjs +0 -19
  90. package/build/listItem/useListItemMedia.mjs.map +0 -1
  91. package/build/types/legacylistItem/List.d.ts +0 -6
  92. package/build/types/legacylistItem/List.d.ts.map +0 -1
  93. package/build/types/listItem/test-utils.d.ts +0 -7
  94. package/build/types/listItem/test-utils.d.ts.map +0 -1
  95. package/build/types/listItem/useListItemMedia.d.ts +0 -6
  96. package/build/types/listItem/useListItemMedia.d.ts.map +0 -1
  97. package/src/legacylistItem/List.tsx +0 -10
  98. package/src/listItem/test-utils.tsx +0 -33
  99. package/src/listItem/useListItemMedia.tsx +0 -13
@@ -2,6 +2,7 @@ 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';
5
6
  import { ListItem, Props as ItemProps } from '../ListItem';
6
7
  import {
7
8
  SB_LIST_ITEM_CONTROLS as CONTROLS,
@@ -9,6 +10,7 @@ import {
9
10
  SB_LIST_ITEM_PROMPTS as PROMPTS,
10
11
  SB_LIST_ITEM_MEDIA as MEDIA,
11
12
  } from './subcomponents';
13
+ import { List } from '../List';
12
14
 
13
15
  /**
14
16
  * List Items let users review or select options from a dynamic list.<br />
@@ -241,9 +243,9 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
241
243
  const [props, previewProps] = getPropsForPreview(args);
242
244
 
243
245
  return (
244
- <ol className="list-unstyled">
246
+ <List key={args.disabled ? 'disabled' : 'enabled'} as="ol">
245
247
  <ListItem {...props} {...previewProps} />
246
- </ol>
248
+ </List>
247
249
  );
248
250
  },
249
251
  argTypes: previewArgTypes,
@@ -277,9 +279,9 @@ export const Responsiveness: Story = {
277
279
  return (
278
280
  <ol
279
281
  className="list-unstyled"
280
- style={{ display: 'grid', gridTemplateColumns: '320px 360px 400px', gap: 16 }}
282
+ style={{ display: 'grid', gridTemplateColumns: '290px 350px 381px', gap: 16 }}
281
283
  >
282
- <div style={{ width: '320px' }}>
284
+ <div style={{ width: '290px' }}>
283
285
  <ListItem
284
286
  {...args}
285
287
  subtitle={lorem10}
@@ -289,7 +291,7 @@ export const Responsiveness: Story = {
289
291
  prompt={PROMPTS.interactive}
290
292
  />
291
293
  </div>
292
- <div style={{ width: '360px' }}>
294
+ <div style={{ width: '350px' }}>
293
295
  <ListItem
294
296
  {...args}
295
297
  subtitle={lorem10}
@@ -299,7 +301,7 @@ export const Responsiveness: Story = {
299
301
  prompt={PROMPTS.interactive}
300
302
  />
301
303
  </div>
302
- <div style={{ width: '400px' }}>
304
+ <div style={{ width: '381px' }}>
303
305
  <ListItem
304
306
  {...args}
305
307
  subtitle={lorem10}
@@ -425,7 +427,7 @@ export const Spotlight: Story = {
425
427
  * All of these limitations were put in place to ensure that the list item is compliant with
426
428
  * accessibility guidance and offers consistent experience across all engineering platforms.
427
429
  *
428
- * Please refer to the [design documentation](https://wise.design/components/list-item#:~:text=specific%20list%20item.-,Interaction,-The%20list%20item) for more details.
430
+ * Please refer to the [design documentation](https://wise.design/components/list-item#interaction) for more details.
429
431
  */
430
432
  export const Interactivity: Story = {
431
433
  render: function Render() {
@@ -501,6 +503,8 @@ export const Interactivity: Story = {
501
503
  * to a new icon for improved user experience and accessibility. <br />
502
504
  * For the same reason, only the control part of the List Item is dimmed, while all the content
503
505
  * 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
504
508
  */
505
509
  export const Disabled: Story = {
506
510
  parameters: {
@@ -668,3 +672,37 @@ export const Disabled: Story = {
668
672
  </div>
669
673
  ),
670
674
  };
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,6 +9,7 @@ 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';
12
13
 
13
14
  export default {
14
15
  component: ListItem,
@@ -71,23 +72,18 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
71
72
  const additionalInfo = isInteractive ? infoWithLink : infoWithoutLink;
72
73
  const variants = [
73
74
  { title },
74
- { title, valueTitle },
75
75
  { title, subtitle },
76
- { title, valueTitle, valueSubtitle },
77
76
  { title, subtitle, inverted: true },
78
77
  { title, subtitle, valueTitle },
79
78
  { title, subtitle, valueTitle, inverted: true },
80
79
  { title, subtitle, valueTitle, valueSubtitle },
81
80
  { title, subtitle, valueTitle, valueSubtitle, inverted: true },
82
81
  { media, title },
83
- { media, title, valueTitle },
84
- { media, title, subtitle },
85
- { media, title, valueTitle, valueSubtitle },
86
- { media, title, valueTitle },
87
- { media, title, valueSubtitle },
88
82
  { media, title, subtitle },
89
83
  { media, title, subtitle, valueTitle },
90
84
  { media, title, subtitle, valueTitle, valueSubtitle },
85
+ { media, title },
86
+ { media, title, subtitle },
91
87
  { media, title, subtitle, additionalInfo: infoWithoutLink },
92
88
  isInteractive ? { media, title, subtitle, additionalInfo: infoWithLink } : null,
93
89
  { media, title, subtitle, additionalInfo, valueTitle },
@@ -148,7 +144,7 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
148
144
  return storyConfig(
149
145
  {
150
146
  render: () => (
151
- <ol className="list-unstyled">
147
+ <List as="ol">
152
148
  {variants.map((variant, variantIndex) => (
153
149
  <ListItem
154
150
  key={`${controlType}-${variantIndex}-${Math.random()}`}
@@ -156,7 +152,7 @@ const generateVariantsForControl = (controlType: ControlType): Story => {
156
152
  {...variant}
157
153
  />
158
154
  ))}
159
- </ol>
155
+ </List>
160
156
  ),
161
157
  },
162
158
  { variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'] },
@@ -182,7 +178,7 @@ export const Switch = generateVariantsForControl('switch');
182
178
 
183
179
  export const ButtonControlLabel: Story = {
184
180
  render: () => (
185
- <ol className="list-unstyled">
181
+ <List as="ol">
186
182
  <ListItem
187
183
  title="Fully interactive button."
188
184
  subtitle="It uses default content hierarchy."
@@ -266,6 +262,6 @@ export const ButtonControlLabel: Story = {
266
262
  control={CONTROLS.buttonAsLink}
267
263
  prompt={PROMPTS.nonInteractive}
268
264
  />
269
- </ol>
265
+ </List>
270
266
  ),
271
267
  };
@@ -12,3 +12,6 @@ export type { ListItemRadioProps } from './Radio';
12
12
  export type { ListItemSwitchProps } from './Switch';
13
13
 
14
14
  export { default } from './ListItem';
15
+
16
+ export { List } from './List';
17
+ export type { ListProps } from './List';
package/src/main.css CHANGED
@@ -454,7 +454,8 @@
454
454
  right: 0;
455
455
  }
456
456
  .np-avatar-view .np-avatar-view-content {
457
- color: var(--color-interactive-primary);
457
+ color: #37517e;
458
+ color: var(--color-content-primary);
458
459
  }
459
460
  .np-avatar-view-interactive {
460
461
  cursor: pointer;
@@ -462,6 +463,7 @@
462
463
  .np-avatar-view-interactive .np-circle {
463
464
  background-color: rgba(134,167,189,0.10196);
464
465
  background-color: var(--color-background-neutral);
466
+ color: var(--color-interactive-primary);
465
467
  }
466
468
  .np-avatar-view-non-interactive .np-circle {
467
469
  background-color: transparent;
@@ -2640,21 +2642,21 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2640
2642
  gap: 4px 16px;
2641
2643
  gap: var(--size-4) var(--size-16);
2642
2644
  }
2643
- @container (min-width: 375px) {
2645
+ @container (min-width: 380px) {
2644
2646
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2645
2647
  grid-template-columns: auto 1fr auto;
2646
2648
  grid-template-rows: auto auto auto;
2647
- grid-template-areas: "media body control" "media info ." ". prompt prompt";
2649
+ grid-template-areas: "media body control" "media info control" "media prompt prompt";
2648
2650
  }
2649
2651
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-noPrompt {
2650
2652
  grid-template-columns: auto 1fr auto;
2651
2653
  grid-template-rows: auto auto;
2652
- grid-template-areas: "media body control" "media info .";
2654
+ grid-template-areas: "media body control" "media info control";
2653
2655
  }
2654
2656
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-hasPrompt {
2655
2657
  grid-template-columns: auto 1fr auto;
2656
2658
  grid-template-rows: auto auto;
2657
- grid-template-areas: "media body control" ". prompt prompt";
2659
+ grid-template-areas: "media body control" "media prompt prompt";
2658
2660
  }
2659
2661
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-noPrompt {
2660
2662
  grid-template-columns: auto 1fr auto;
@@ -2664,7 +2666,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2664
2666
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
2665
2667
  grid-template-columns: auto 1fr;
2666
2668
  grid-template-rows: auto auto;
2667
- grid-template-areas: "media body" "media info" ". prompt";
2669
+ grid-template-areas: "media body" "media info" "media prompt";
2668
2670
  }
2669
2671
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-noPrompt {
2670
2672
  grid-template-columns: auto 1fr;
@@ -2687,12 +2689,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2687
2689
  .wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2688
2690
  grid-template-columns: 1fr auto;
2689
2691
  grid-template-rows: auto auto auto;
2690
- grid-template-areas: "body control" "info ." "prompt prompt";
2692
+ grid-template-areas: "body control" "info control" "prompt prompt";
2691
2693
  }
2692
2694
  .wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-noPrompt {
2693
2695
  grid-template-columns: 1fr auto;
2694
2696
  grid-template-rows: auto auto;
2695
- grid-template-areas: "body control" "info .";
2697
+ grid-template-areas: "body control" "info control";
2696
2698
  }
2697
2699
  .wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-noInfo-hasPrompt {
2698
2700
  grid-template-columns: 1fr auto;
@@ -2728,14 +2730,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2728
2730
  grid-template-areas: "body";
2729
2731
  }
2730
2732
  }
2731
- @container (min-width: 297px) and (max-width: 375px) {
2733
+ @container (min-width: 290px) and (max-width: 380px) {
2732
2734
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
2733
2735
  margin-bottom: 12px;
2734
2736
  margin-bottom: var(--size-12);
2735
2737
  }
2736
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media .wds-list-item-media-image {
2737
- height: auto;
2738
- }
2739
2738
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2740
2739
  grid-template-columns: 1fr auto;
2741
2740
  grid-template-rows: auto auto auto auto;
@@ -2776,9 +2775,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2776
2775
  margin-bottom: 16px;
2777
2776
  margin-bottom: var(--size-16);
2778
2777
  }
2779
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media .wds-list-item-media-image {
2780
- height: auto;
2781
- }
2782
2778
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
2783
2779
  grid-template-columns: auto auto;
2784
2780
  grid-template-rows: auto auto auto auto;
@@ -2862,7 +2858,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2862
2858
  grid-template-areas: "body";
2863
2859
  }
2864
2860
  }
2865
- @container (max-width: 297px) {
2861
+ @container (max-width: 290px) {
2866
2862
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2867
2863
  grid-template-columns: auto 1fr;
2868
2864
  grid-template-rows: auto auto auto;
@@ -3009,8 +3005,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3009
3005
  background-color: #ffffff;
3010
3006
  background-color: var(--color-background-screen);
3011
3007
  position: relative;
3012
- padding: 12px;
3013
- padding: var(--size-12);
3008
+ padding: 12px 0;
3009
+ padding: var(--size-12) 0;
3014
3010
  container-type: inline-size;
3015
3011
  }
3016
3012
  .wds-list-item + .wds-list-item-spotlight,
@@ -3044,12 +3040,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3044
3040
  .wds-list-item-interactive .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
3045
3041
  outline: none;
3046
3042
  }
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
- }
3053
3043
  .wds-list-item-interactive .wds-list-item-additional-info {
3054
3044
  --ring-outline-offset: 0;
3055
3045
  }
@@ -3068,30 +3058,65 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3068
3058
  position: absolute;
3069
3059
  inset: 0;
3070
3060
  }
3071
- .wds-list-item-interactive:not(.disabled):not(:disabled):hover {
3061
+ .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-control:focus-visible),
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 {
3072
3068
  background-color: var(--color-background-screen-hover);
3073
3069
  }
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
+ }
3074
3106
  .wds-list-item-interactive:not(.disabled):not(:disabled):hover .wds-list-item-control-wrapper .wds-Button {
3075
3107
  background-color: var(--Button-background-hover);
3076
3108
  color: var(--Button-color-hover);
3077
3109
  transition: none;
3078
3110
  }
3079
- .wds-list-item-interactive:not(.disabled):not(:disabled):active {
3080
- background-color: var(--color-background-screen-active);
3081
- }
3082
3111
  .wds-list-item-interactive .wds-list-item-button-control .wds-Button {
3083
3112
  transition: none;
3084
3113
  }
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
- }
3089
3114
  .wds-list-item-media {
3090
3115
  grid-area: media;
3091
3116
  }
3092
3117
  .wds-list-item-media-image {
3093
- width: var(--wds-list-item-control-wrapper-height);
3094
- height: var(--wds-list-item-control-wrapper-height);
3118
+ width: var(--item-media-image-size);
3119
+ height: var(--item-media-image-size);
3095
3120
  }
3096
3121
  .wds-list-item-body {
3097
3122
  grid-area: body;
@@ -3105,18 +3130,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3105
3130
  gap: var(--size-16);
3106
3131
  word-break: break-word;
3107
3132
  }
3108
- .wds-list-item-title {
3133
+ .wds-list-item-title,
3134
+ .wds-list-item-title-value {
3109
3135
  color: #37517e;
3110
3136
  color: var(--color-content-primary);
3111
3137
  }
3112
- .wds-list-item-value {
3113
- text-align: right;
3114
- }
3115
- .wds-list-item-body-center {
3116
- display: flex;
3117
- flex-direction: row;
3118
- align-items: center;
3119
- }
3120
3138
  .wds-list-item-additional-info {
3121
3139
  grid-area: info;
3122
3140
  color: #768e9c;
@@ -3124,14 +3142,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3124
3142
  margin-top: calc(4px * -1);
3125
3143
  margin-top: calc(var(--size-4) * -1);
3126
3144
  }
3145
+ .wds-list-item-value {
3146
+ align-items: end;
3147
+ text-align: right;
3148
+ }
3127
3149
  .wds-list-item-control-wrapper {
3128
3150
  grid-area: control;
3129
- align-content: center;
3130
- max-height: var(--wds-list-item-control-wrapper-height);
3131
- }
3132
- .wds-list-item-navigation .tw-icon-chevron-right {
3133
- color: #c9cbce;
3134
- color: var(--color-interactive-secondary);
3135
3151
  }
3136
3152
  .wds-list-item-control {
3137
3153
  flex: 0 0 auto;
@@ -3147,6 +3163,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3147
3163
  color: #768e9c;
3148
3164
  color: var(--color-content-tertiary);
3149
3165
  }
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
+ }
3150
3172
  .wds-list-item-spotlight-active {
3151
3173
  background-color: rgba(134,167,189,0.10196);
3152
3174
  background-color: var(--color-background-neutral);
@@ -3159,8 +3181,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3159
3181
  }
3160
3182
  .wds-list-item-spotlight-inactive {
3161
3183
  background-color: rgba(134, 167, 189, 0.025);
3162
- border: 1px dashed rgba(0,0,0,0.10196);
3163
- border: 1px dashed var(--color-border-neutral);
3164
3184
  }
3165
3185
  @supports (color: color-mix(in lch, red, blue)) {
3166
3186
  .wds-list-item-spotlight-inactive {
@@ -3173,6 +3193,34 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3173
3193
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3174
3194
  background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3175
3195
  }
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
+ }
3176
3224
  .wds-list-item-prompt {
3177
3225
  grid-area: prompt;
3178
3226
  display: inline-flex;
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.js","sources":["../../src/legacylistItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ className, children }: ListProps) {\n return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;\n}\n"],"names":["List","className","children","_jsx","clsx"],"mappings":";;;;;SAOgBA,IAAIA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;AACrD,EAAA,oBAAOC,cAAA,CAAA,IAAA,EAAA;AAAIF,IAAAA,SAAS,EAAEG,SAAI,CAACH,SAAS,EAAE,eAAe,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAK,CAAC;AACzE;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.mjs","sources":["../../src/legacylistItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ className, children }: ListProps) {\n return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;\n}\n"],"names":["List","className","children","_jsx","clsx"],"mappings":";;;SAOgBA,IAAIA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;AACrD,EAAA,oBAAOC,GAAA,CAAA,IAAA,EAAA;AAAIF,IAAAA,SAAS,EAAEG,IAAI,CAACH,SAAS,EAAE,eAAe,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAK,CAAC;AACzE;;;;"}
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var ListItemContext = require('./ListItemContext.js');
5
-
6
- function useListItemMedia(size) {
7
- const {
8
- setMediaSize,
9
- mediaSize
10
- } = React.useContext(ListItemContext.ListItemContext);
11
- React.useEffect(() => {
12
- setMediaSize(size);
13
- }, [size, setMediaSize]);
14
- return {
15
- mediaSize,
16
- setMediaSize
17
- };
18
- }
19
-
20
- exports.useListItemMedia = useListItemMedia;
21
- //# sourceMappingURL=useListItemMedia.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useListItemMedia.js","sources":["../../src/listItem/useListItemMedia.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { ListItemContext, type ListItemContextData } from './ListItemContext';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport function useListItemMedia(size?: ListItemAvatarViewProps['size']) {\n const { setMediaSize, mediaSize } = useContext<ListItemContextData>(ListItemContext);\n\n useEffect(() => {\n setMediaSize(size);\n }, [size, setMediaSize]);\n\n return { mediaSize, setMediaSize };\n}\n"],"names":["useListItemMedia","size","setMediaSize","mediaSize","useContext","ListItemContext","useEffect"],"mappings":";;;;;AAIM,SAAUA,gBAAgBA,CAACC,IAAsC,EAAA;EACrE,MAAM;IAAEC,YAAY;AAAEC,IAAAA;AAAS,GAAE,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;AAEpFC,EAAAA,eAAS,CAAC,MAAK;IACbJ,YAAY,CAACD,IAAI,CAAC;AACpB,EAAA,CAAC,EAAE,CAACA,IAAI,EAAEC,YAAY,CAAC,CAAC;EAExB,OAAO;IAAEC,SAAS;AAAED,IAAAA;GAAc;AACpC;;;;"}
@@ -1,19 +0,0 @@
1
- import { useContext, useEffect } from 'react';
2
- import { ListItemContext } from './ListItemContext.mjs';
3
-
4
- function useListItemMedia(size) {
5
- const {
6
- setMediaSize,
7
- mediaSize
8
- } = useContext(ListItemContext);
9
- useEffect(() => {
10
- setMediaSize(size);
11
- }, [size, setMediaSize]);
12
- return {
13
- mediaSize,
14
- setMediaSize
15
- };
16
- }
17
-
18
- export { useListItemMedia };
19
- //# sourceMappingURL=useListItemMedia.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useListItemMedia.mjs","sources":["../../src/listItem/useListItemMedia.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { ListItemContext, type ListItemContextData } from './ListItemContext';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport function useListItemMedia(size?: ListItemAvatarViewProps['size']) {\n const { setMediaSize, mediaSize } = useContext<ListItemContextData>(ListItemContext);\n\n useEffect(() => {\n setMediaSize(size);\n }, [size, setMediaSize]);\n\n return { mediaSize, setMediaSize };\n}\n"],"names":["useListItemMedia","size","setMediaSize","mediaSize","useContext","ListItemContext","useEffect"],"mappings":";;;AAIM,SAAUA,gBAAgBA,CAACC,IAAsC,EAAA;EACrE,MAAM;IAAEC,YAAY;AAAEC,IAAAA;AAAS,GAAE,GAAGC,UAAU,CAAsBC,eAAe,CAAC;AAEpFC,EAAAA,SAAS,CAAC,MAAK;IACbJ,YAAY,CAACD,IAAI,CAAC;AACpB,EAAA,CAAC,EAAE,CAACA,IAAI,EAAEC,YAAY,CAAC,CAAC;EAExB,OAAO;IAAEC,SAAS;AAAED,IAAAA;GAAc;AACpC;;;;"}
@@ -1,6 +0,0 @@
1
- export interface ListProps {
2
- className?: string;
3
- children?: React.ReactNode;
4
- }
5
- export declare function List({ className, children }: ListProps): import("react").JSX.Element;
6
- //# sourceMappingURL=List.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/legacylistItem/List.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAEtD"}
@@ -1,7 +0,0 @@
1
- import { type RenderResult } from '../test-utils';
2
- export declare const mockSetControlType: jest.Mock<any, any, any>;
3
- export declare const mockSetControlProps: jest.Mock<any, any, any>;
4
- export declare const mockSetMediaSize: jest.Mock<any, any, any>;
5
- export declare const renderWithListItemContext: (ui: React.ReactNode) => RenderResult;
6
- export declare const clearListItemMocks: () => void;
7
- //# sourceMappingURL=test-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/listItem/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAG1D,eAAO,MAAM,kBAAkB,0BAAY,CAAC;AAC5C,eAAO,MAAM,mBAAmB,0BAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,0BAAY,CAAC;AAE1C,eAAO,MAAM,yBAAyB,GAAI,IAAI,KAAK,CAAC,SAAS,KAAG,YAqB/D,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAE9B,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { ListItemAvatarViewProps } from './AvatarView';
2
- export declare function useListItemMedia(size?: ListItemAvatarViewProps['size']): {
3
- mediaSize: 32 | 40 | 48 | 56 | 72 | undefined;
4
- setMediaSize: (size: import("./ListItemContext").ListItemMediaSize | undefined) => void;
5
- };
6
- //# sourceMappingURL=useListItemMedia.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useListItemMedia.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemMedia.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC;;;EAQtE"}
@@ -1,10 +0,0 @@
1
- import { clsx } from 'clsx';
2
-
3
- export interface ListProps {
4
- className?: string;
5
- children?: React.ReactNode;
6
- }
7
-
8
- export function List({ className, children }: ListProps) {
9
- return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;
10
- }
@@ -1,33 +0,0 @@
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
- };
@@ -1,13 +0,0 @@
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
- }