@transferwise/components 0.0.0-experimental-751dc12 → 0.0.0-experimental-4341b9c
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/button/Button.js +0 -1
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +0 -1
- package/build/button/Button.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js +2 -5
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs +2 -5
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/initials.js +4 -1
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +4 -1
- package/build/common/initials.mjs.map +1 -1
- package/build/i18n/de.json +2 -0
- package/build/i18n/de.json.js +2 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +2 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/fr.json +2 -0
- package/build/i18n/fr.json.js +2 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +2 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +2 -0
- package/build/i18n/hu.json.js +2 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +2 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/it.json +2 -0
- package/build/i18n/it.json.js +2 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +2 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +2 -0
- package/build/i18n/ja.json.js +2 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +2 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +2 -0
- package/build/i18n/pl.json.js +2 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +2 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +2 -0
- package/build/i18n/pt.json.js +2 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +2 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +2 -0
- package/build/i18n/ro.json.js +2 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +2 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +2 -0
- package/build/i18n/ru.json.js +2 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +2 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/tr.json +2 -0
- package/build/i18n/tr.json.js +2 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +2 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +2 -0
- package/build/i18n/zh-CN.json.js +2 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +2 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +2 -0
- package/build/i18n/zh-HK.json.js +2 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +2 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +0 -709
- package/build/styles/main.css +0 -709
- package/build/switch/Switch.js +0 -2
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs +0 -2
- package/build/switch/Switch.mjs.map +1 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +1 -1
- package/build/types/button/Button.types.d.ts.map +1 -1
- package/build/types/button/index.d.ts +1 -1
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/RadioButton/RadioButton.d.ts +1 -3
- package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
- package/build/types/common/initials.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +2 -2
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -3
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/image/index.d.ts +0 -1
- package/build/types/image/index.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/switch/Switch.d.ts +0 -2
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/button/Button.spec.tsx +0 -18
- package/src/button/Button.tsx +1 -5
- package/src/button/Button.types.ts +1 -1
- package/src/button/index.ts +1 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +4 -4
- package/src/common/RadioButton/RadioButton.tsx +1 -6
- package/src/common/initials.spec.tsx +13 -0
- package/src/common/initials.ts +5 -0
- package/src/i18n/de.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/hu.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/pl.json +2 -0
- package/src/i18n/pt.json +2 -0
- package/src/i18n/ro.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/i18n/zh-CN.json +2 -0
- package/src/i18n/zh-HK.json +2 -0
- package/src/iconButton/IconButton.story.tsx +1 -1
- package/src/iconButton/IconButton.tsx +1 -1
- package/src/image/Image.tsx +0 -3
- package/src/image/index.ts +0 -1
- package/src/index.ts +0 -2
- package/src/main.css +0 -709
- package/src/main.less +0 -1
- package/src/switch/Switch.tsx +0 -4
- package/src/test-utils/Parameters.d.ts +77 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +0 -56
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +0 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +0 -54
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +0 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +0 -23
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +0 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +0 -21
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +0 -1
- package/build/listItem/AvatarView/ListItemAvatarView.js +0 -23
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +0 -1
- package/build/listItem/AvatarView/ListItemAvatarView.mjs +0 -21
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +0 -1
- package/build/listItem/Button/ListItemButton.js +0 -43
- package/build/listItem/Button/ListItemButton.js.map +0 -1
- package/build/listItem/Button/ListItemButton.mjs +0 -41
- package/build/listItem/Button/ListItemButton.mjs.map +0 -1
- package/build/listItem/Checkbox/ListItemCheckbox.js +0 -30
- package/build/listItem/Checkbox/ListItemCheckbox.js.map +0 -1
- package/build/listItem/Checkbox/ListItemCheckbox.mjs +0 -28
- package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +0 -1
- package/build/listItem/IconButton/ListItemIconButton.js +0 -42
- package/build/listItem/IconButton/ListItemIconButton.js.map +0 -1
- package/build/listItem/IconButton/ListItemIconButton.mjs +0 -40
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +0 -1
- package/build/listItem/Image/ListItemImage.js +0 -31
- package/build/listItem/Image/ListItemImage.js.map +0 -1
- package/build/listItem/Image/ListItemImage.mjs +0 -29
- package/build/listItem/Image/ListItemImage.mjs.map +0 -1
- package/build/listItem/ListItem.js +0 -308
- package/build/listItem/ListItem.js.map +0 -1
- package/build/listItem/ListItem.mjs +0 -303
- package/build/listItem/ListItem.mjs.map +0 -1
- package/build/listItem/ListItemContext.js +0 -8
- package/build/listItem/ListItemContext.js.map +0 -1
- package/build/listItem/ListItemContext.mjs +0 -6
- package/build/listItem/ListItemContext.mjs.map +0 -1
- package/build/listItem/Navigation/ListItemNavigation.js +0 -45
- package/build/listItem/Navigation/ListItemNavigation.js.map +0 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs +0 -43
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +0 -1
- package/build/listItem/Prompt/ListItemPrompt.js +0 -59
- package/build/listItem/Prompt/ListItemPrompt.js.map +0 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +0 -54
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +0 -1
- package/build/listItem/Radio/ListItemRadio.js +0 -30
- package/build/listItem/Radio/ListItemRadio.js.map +0 -1
- package/build/listItem/Radio/ListItemRadio.mjs +0 -28
- package/build/listItem/Radio/ListItemRadio.mjs.map +0 -1
- package/build/listItem/Switch/ListItemSwitch.js +0 -30
- package/build/listItem/Switch/ListItemSwitch.js.map +0 -1
- package/build/listItem/Switch/ListItemSwitch.mjs +0 -28
- package/build/listItem/Switch/ListItemSwitch.mjs.map +0 -1
- package/build/listItem/_stories/images/landscape.svg +0 -1
- package/build/listItem/_stories/images/portrait.svg +0 -1
- package/build/listItem/useListItemControl.js +0 -22
- package/build/listItem/useListItemControl.js.map +0 -1
- package/build/listItem/useListItemControl.mjs +0 -20
- package/build/listItem/useListItemControl.mjs.map +0 -1
- package/build/listItem/useListItemMedia.js +0 -21
- package/build/listItem/useListItemMedia.js.map +0 -1
- package/build/listItem/useListItemMedia.mjs +0 -19
- package/build/listItem/useListItemMedia.mjs.map +0 -1
- package/build/styles/listItem/ListItem.css +0 -709
- package/build/styles/listItem/ListItem.grid.css +0 -368
- package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +0 -15
- package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +0 -1
- package/build/types/listItem/AdditionalInfo/index.d.ts +0 -3
- package/build/types/listItem/AdditionalInfo/index.d.ts.map +0 -1
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +0 -18
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +0 -1
- package/build/types/listItem/AvatarLayout/index.d.ts +0 -3
- package/build/types/listItem/AvatarLayout/index.d.ts.map +0 -1
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +0 -16
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +0 -1
- package/build/types/listItem/AvatarView/index.d.ts +0 -3
- package/build/types/listItem/AvatarView/index.d.ts.map +0 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +0 -20
- package/build/types/listItem/Button/ListItemButton.d.ts.map +0 -1
- package/build/types/listItem/Button/index.d.ts +0 -3
- package/build/types/listItem/Button/index.d.ts.map +0 -1
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +0 -14
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +0 -1
- package/build/types/listItem/Checkbox/index.d.ts +0 -3
- package/build/types/listItem/Checkbox/index.d.ts.map +0 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +0 -18
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +0 -1
- package/build/types/listItem/IconButton/index.d.ts +0 -3
- package/build/types/listItem/IconButton/index.d.ts.map +0 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +0 -25
- package/build/types/listItem/Image/ListItemImage.d.ts.map +0 -1
- package/build/types/listItem/Image/index.d.ts +0 -3
- package/build/types/listItem/Image/index.d.ts.map +0 -1
- package/build/types/listItem/ListItem.d.ts +0 -113
- package/build/types/listItem/ListItem.d.ts.map +0 -1
- package/build/types/listItem/ListItemContext.d.ts +0 -22
- package/build/types/listItem/ListItemContext.d.ts.map +0 -1
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts +0 -15
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +0 -1
- package/build/types/listItem/Navigation/index.d.ts +0 -3
- package/build/types/listItem/Navigation/index.d.ts.map +0 -1
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +0 -16
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +0 -1
- package/build/types/listItem/Prompt/index.d.ts +0 -3
- package/build/types/listItem/Prompt/index.d.ts.map +0 -1
- package/build/types/listItem/Radio/ListItemRadio.d.ts +0 -14
- package/build/types/listItem/Radio/ListItemRadio.d.ts.map +0 -1
- package/build/types/listItem/Radio/index.d.ts +0 -3
- package/build/types/listItem/Radio/index.d.ts.map +0 -1
- package/build/types/listItem/Switch/ListItemSwitch.d.ts +0 -14
- package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +0 -1
- package/build/types/listItem/Switch/index.d.ts +0 -3
- package/build/types/listItem/Switch/index.d.ts.map +0 -1
- package/build/types/listItem/_stories/subcomponents.d.ts +0 -18
- package/build/types/listItem/_stories/subcomponents.d.ts.map +0 -1
- package/build/types/listItem/index.d.ts +0 -14
- package/build/types/listItem/index.d.ts.map +0 -1
- package/build/types/listItem/test-utils.d.ts +0 -7
- package/build/types/listItem/test-utils.d.ts.map +0 -1
- package/build/types/listItem/useListItemControl.d.ts +0 -5
- package/build/types/listItem/useListItemControl.d.ts.map +0 -1
- package/build/types/listItem/useListItemMedia.d.ts +0 -6
- package/build/types/listItem/useListItemMedia.d.ts.map +0 -1
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +0 -56
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -145
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +0 -36
- package/src/listItem/AdditionalInfo/index.ts +0 -2
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +0 -59
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -118
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +0 -27
- package/src/listItem/AvatarLayout/index.ts +0 -2
- package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +0 -75
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -318
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +0 -27
- package/src/listItem/AvatarView/index.ts +0 -2
- package/src/listItem/Button/ListItemButton.spec.tsx +0 -68
- package/src/listItem/Button/ListItemButton.story.tsx +0 -408
- package/src/listItem/Button/ListItemButton.tsx +0 -56
- package/src/listItem/Button/index.ts +0 -2
- package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +0 -82
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -107
- package/src/listItem/Checkbox/ListItemCheckbox.tsx +0 -33
- package/src/listItem/Checkbox/index.ts +0 -2
- package/src/listItem/IconButton/ListItemIconButton.spec.tsx +0 -119
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -236
- package/src/listItem/IconButton/ListItemIconButton.tsx +0 -56
- package/src/listItem/IconButton/index.ts +0 -2
- package/src/listItem/Image/ListItemImage.spec.tsx +0 -30
- package/src/listItem/Image/ListItemImage.story.tsx +0 -56
- package/src/listItem/Image/ListItemImage.tsx +0 -48
- package/src/listItem/Image/index.ts +0 -2
- package/src/listItem/ListItem.css +0 -709
- package/src/listItem/ListItem.grid.css +0 -368
- package/src/listItem/ListItem.grid.less +0 -620
- package/src/listItem/ListItem.less +0 -346
- package/src/listItem/ListItem.spec.tsx +0 -1496
- package/src/listItem/ListItem.tsx +0 -441
- package/src/listItem/ListItemContext.tsx +0 -27
- package/src/listItem/Navigation/ListItemNavigation.spec.tsx +0 -59
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -106
- package/src/listItem/Navigation/ListItemNavigation.tsx +0 -40
- package/src/listItem/Navigation/index.ts +0 -2
- package/src/listItem/Prompt/ListItemPrompt.spec.tsx +0 -36
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -201
- package/src/listItem/Prompt/ListItemPrompt.tsx +0 -32
- package/src/listItem/Prompt/index.ts +0 -2
- package/src/listItem/Radio/ListItemRadio.spec.tsx +0 -66
- package/src/listItem/Radio/ListItemRadio.story.tsx +0 -98
- package/src/listItem/Radio/ListItemRadio.tsx +0 -33
- package/src/listItem/Radio/index.ts +0 -2
- package/src/listItem/Switch/ListItemSwitch.spec.tsx +0 -47
- package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -69
- package/src/listItem/Switch/ListItemSwitch.tsx +0 -33
- package/src/listItem/Switch/index.ts +0 -2
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +0 -250
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +0 -338
- package/src/listItem/_stories/ListItem.story.tsx +0 -670
- package/src/listItem/_stories/ListItem.variants.test.story.tsx +0 -271
- package/src/listItem/_stories/images/landscape.svg +0 -1
- package/src/listItem/_stories/images/portrait.svg +0 -1
- package/src/listItem/_stories/subcomponents.tsx +0 -139
- package/src/listItem/index.ts +0 -14
- package/src/listItem/test-utils.tsx +0 -33
- package/src/listItem/useListItemControl.tsx +0 -18
- package/src/listItem/useListItemMedia.tsx +0 -13
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type ListItemIconButtonProps } from './IconButton';
|
|
3
|
-
import { type ListItemCheckboxProps } from './Checkbox';
|
|
4
|
-
import { type ListItemNavigationProps } from './Navigation';
|
|
5
|
-
import { type ListItemButtonProps } from './Button';
|
|
6
|
-
import { type ListItemRadioProps } from './Radio';
|
|
7
|
-
import { type ListItemSwitchProps } from './Switch';
|
|
8
|
-
export type ListItemTypes = 'non-interactive' | 'navigation' | 'radio' | 'checkbox' | 'switch' | 'button' | 'icon-button';
|
|
9
|
-
export type ListItemControlProps = ListItemNavigationProps | ListItemCheckboxProps | ListItemButtonProps | ListItemIconButtonProps | ListItemRadioProps | ListItemSwitchProps;
|
|
10
|
-
export type Props = {
|
|
11
|
-
as?: 'li' | 'div';
|
|
12
|
-
/**
|
|
13
|
-
* Swaps vertical hierarchy of title and subtitle and their corresponding right values.
|
|
14
|
-
*/
|
|
15
|
-
inverted?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Highlights the list item as an action to be taken or already taken. <br />
|
|
19
|
-
*/
|
|
20
|
-
spotlight?: 'active' | 'inactive';
|
|
21
|
-
title: ReactNode;
|
|
22
|
-
subtitle?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Requires `<ListItem.AdditionalInfo />` component as a sole child. <br />
|
|
25
|
-
* Can be only rendered if `subtitle` is also provided.
|
|
26
|
-
*/
|
|
27
|
-
additionalInfo?: ReactNode;
|
|
28
|
-
valueTitle?: ReactNode;
|
|
29
|
-
valueSubtitle?: ReactNode;
|
|
30
|
-
/**
|
|
31
|
-
* Requires one of the following as a sole child: <br />
|
|
32
|
-
* `<ListItem.AvatarView />`,
|
|
33
|
-
* `<ListItem.AvatarLayout />` or
|
|
34
|
-
* `<ListItem.Image />`
|
|
35
|
-
*/
|
|
36
|
-
media?: ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* Requires one of the following as a sole child: <br/>
|
|
39
|
-
* `<ListItem.Button />`, <br/>
|
|
40
|
-
* `<ListItem.Checkbox />`, <br/>
|
|
41
|
-
* `<ListItem.IconButton />`, <br/>
|
|
42
|
-
* `<ListItem.Navigation />`, <br/>
|
|
43
|
-
* `<ListItem.Radio />`, or
|
|
44
|
-
* `<ListItem.Switch />`
|
|
45
|
-
*/
|
|
46
|
-
control?: ReactNode;
|
|
47
|
-
/**
|
|
48
|
-
* Requires `<ListItem.Prompt />` component as a sole child.
|
|
49
|
-
*/
|
|
50
|
-
prompt?: ReactNode;
|
|
51
|
-
className?: string;
|
|
52
|
-
/**
|
|
53
|
-
* A number between `0–100` which resolves to a `fr` value of a `grid-template-columns` declaration. E.g. `valueColumnWidth={25}` will result in a `75fr 25fr`. <br />
|
|
54
|
-
* Controls the width ratio of left side content (title and subtitle) to the right side content.
|
|
55
|
-
*/
|
|
56
|
-
valueColumnWidth?: number;
|
|
57
|
-
id?: string;
|
|
58
|
-
role?: string;
|
|
59
|
-
'aria-labelledby'?: string;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* @see [Design documentation](https://wise.design/components/list-item)
|
|
63
|
-
* @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
|
64
|
-
*/
|
|
65
|
-
export declare const ListItem: {
|
|
66
|
-
({ as: ListItemElement, title, subtitle, additionalInfo, prompt, inverted, media, spotlight, valueTitle, valueSubtitle, control, disabled, className, valueColumnWidth, role, id, "aria-labelledby": ariaLabelledby, }: Props): import("react").JSX.Element;
|
|
67
|
-
Image: {
|
|
68
|
-
({ alt, size, className, ...props }: import("./Image").ListItemImageProps): import("react").JSX.Element;
|
|
69
|
-
displayName: string;
|
|
70
|
-
};
|
|
71
|
-
AvatarView: {
|
|
72
|
-
({ className, size, ...props }: import("./AvatarView").ListItemAvatarViewProps): import("react").JSX.Element;
|
|
73
|
-
displayName: string;
|
|
74
|
-
};
|
|
75
|
-
AvatarLayout: {
|
|
76
|
-
({ className, size, ...props }: import("./AvatarLayout").ListItemAvatarLayoutProps): import("react").JSX.Element;
|
|
77
|
-
displayName: string;
|
|
78
|
-
};
|
|
79
|
-
AdditionalInfo: {
|
|
80
|
-
({ children, action }: import("./AdditionalInfo").ListItemAdditionalInfoProps): import("react").JSX.Element;
|
|
81
|
-
displayName: string;
|
|
82
|
-
};
|
|
83
|
-
Checkbox: {
|
|
84
|
-
(props: ListItemCheckboxProps): import("react").JSX.Element;
|
|
85
|
-
displayName: string;
|
|
86
|
-
};
|
|
87
|
-
Radio: {
|
|
88
|
-
(props: ListItemRadioProps): import("react").JSX.Element;
|
|
89
|
-
displayName: string;
|
|
90
|
-
};
|
|
91
|
-
IconButton: {
|
|
92
|
-
({ priority, ...props }: ListItemIconButtonProps): import("react").JSX.Element;
|
|
93
|
-
displayName: string;
|
|
94
|
-
};
|
|
95
|
-
Navigation: {
|
|
96
|
-
({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
|
|
97
|
-
displayName: string;
|
|
98
|
-
};
|
|
99
|
-
Button: {
|
|
100
|
-
({ priority, partiallyInteractive, ...props }: ListItemButtonProps): import("react").JSX.Element;
|
|
101
|
-
displayName: string;
|
|
102
|
-
};
|
|
103
|
-
Switch: {
|
|
104
|
-
(props: ListItemSwitchProps): import("react").JSX.Element;
|
|
105
|
-
displayName: string;
|
|
106
|
-
};
|
|
107
|
-
Prompt: {
|
|
108
|
-
({ sentiment, children }: import("./Prompt").ListItemPromptProps): import("react").JSX.Element;
|
|
109
|
-
displayName: string;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
export default ListItem;
|
|
113
|
-
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,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,CAAC;AACzD,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAY5D,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,YAAY,GACZ,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;OAQG;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;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;4NAkBlB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4NP,CAAC;AAkGF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';
|
|
2
|
-
import type { ListItemAvatarViewProps } from './AvatarView';
|
|
3
|
-
export type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;
|
|
4
|
-
export type ListItemContextData = {
|
|
5
|
-
setControlType: (type: ListItemTypes) => void;
|
|
6
|
-
setControlProps: (props: ListItemControlProps) => void;
|
|
7
|
-
setMediaSize: (size: ListItemMediaSize | undefined) => void;
|
|
8
|
-
ids: {
|
|
9
|
-
title: string;
|
|
10
|
-
subtitle?: string;
|
|
11
|
-
valueTitle?: string;
|
|
12
|
-
valueSubtitle?: string;
|
|
13
|
-
additionalInfo?: string;
|
|
14
|
-
control: string;
|
|
15
|
-
prompt?: string;
|
|
16
|
-
};
|
|
17
|
-
props: Pick<ListItemProps, 'disabled' | 'inverted'>;
|
|
18
|
-
mediaSize?: ListItemAvatarViewProps['size'];
|
|
19
|
-
describedByIds: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const ListItemContext: import("react").Context<ListItemContextData>;
|
|
22
|
-
//# sourceMappingURL=ListItemContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemContext.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItemContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,GAAG,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,8CAE3B,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from '../../button/Button.types';
|
|
2
|
-
export type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;
|
|
3
|
-
/**
|
|
4
|
-
* This component allows for rendering a control functionally synonymous with HTML `anchor` or a
|
|
5
|
-
* `button`, giving users a rich way to choose between options and navigate to another screen or
|
|
6
|
-
* step in a flow. It offers only a subset of features of the HTML element in line with the
|
|
7
|
-
* ListItem's constraints.<br />
|
|
8
|
-
* <br />
|
|
9
|
-
* Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Navigation: {
|
|
12
|
-
({ href, ...props }: ListItemNavigationProps): import("react").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=ListItemNavigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemNavigation.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/ListItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAM7D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;yBAAiD,uBAAuB;;CAoB9F,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Navigation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Sentiment } from '../../common';
|
|
2
|
-
export type ListItemPromptProps = {
|
|
3
|
-
sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />
|
|
8
|
-
*
|
|
9
|
-
* Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Prompt: {
|
|
12
|
-
({ sentiment, children }: ListItemPromptProps): import("react").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
};
|
|
15
|
-
export default Prompt;
|
|
16
|
-
//# sourceMappingURL=ListItemPrompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/ListItemPrompt.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM;8BAAiD,mBAAmB;;CAWtF,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Prompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type RadioButtonProps } from '../../common/RadioButton/RadioButton';
|
|
2
|
-
export type ListItemRadioProps = Omit<RadioButtonProps, 'disabled' | 'readOnly' | 'className' | 'id'>;
|
|
3
|
-
/**
|
|
4
|
-
* This component allows for rendering a Button control. It's a thin wrapper around the
|
|
5
|
-
* [Button component](https://storybook.wise.design/?path=/docs/content-button--docs), but offers only
|
|
6
|
-
* a subset of its features in line with the ListItem's constraints. <br />
|
|
7
|
-
* <br />
|
|
8
|
-
* Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Radio: {
|
|
11
|
-
(props: ListItemRadioProps): import("react").JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=ListItemRadio.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemRadio.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/ListItemRadio.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAI1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EAChB,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;YAAoB,kBAAkB;;CAavD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Radio/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type SwitchProps } from '../../switch';
|
|
2
|
-
export type ListItemSwitchProps = Omit<SwitchProps, 'disabled' | 'id' | 'aria-labelledby' | 'aria-label'>;
|
|
3
|
-
/**
|
|
4
|
-
* This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the
|
|
5
|
-
* [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),
|
|
6
|
-
* but offers only a subset of its features in line with the ListItem's constraints. <br />
|
|
7
|
-
*
|
|
8
|
-
* Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Switch: {
|
|
11
|
-
(props: ListItemSwitchProps): import("react").JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=ListItemSwitch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemSwitch.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/ListItemSwitch.tsx"],"names":[],"mappings":"AACA,OAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAI5D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,WAAW,EACX,UAAU,GAAG,IAAI,GAAG,iBAAiB,GAAG,YAAY,CACrD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;YAAoB,mBAAmB;;CAazD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/listItem/Switch/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type SB_ListItem_ControlType = 'button' | 'buttonAsLink' | 'partialButton' | 'partialButtonAsLink' | 'iconButton' | 'iconButtonAsLink' | 'iconButtonWithLabel' | 'iconButtonAsLinkWithLabel' | 'partialIconButton' | 'partialIconButtonAsLink' | 'partialIconButtonWithLabel' | 'partialIconButtonAsLinkWithLabel' | 'navigation' | 'navigationAsButton' | 'checkbox' | 'radio' | 'switch';
|
|
3
|
-
export declare const SB_LIST_ITEM_CONTROLS: Record<SB_ListItem_ControlType, ReactNode>;
|
|
4
|
-
export declare const SB_LIST_ITEM_ADDITIONAL_INFO: {
|
|
5
|
-
readonly interactive: import("react").JSX.Element;
|
|
6
|
-
readonly nonInteractive: import("react").JSX.Element;
|
|
7
|
-
};
|
|
8
|
-
export declare const SB_LIST_ITEM_PROMPTS: {
|
|
9
|
-
readonly interactive: import("react").JSX.Element;
|
|
10
|
-
readonly nonInteractive: import("react").JSX.Element;
|
|
11
|
-
};
|
|
12
|
-
export declare const SB_LIST_ITEM_MEDIA: {
|
|
13
|
-
readonly image: import("react").JSX.Element;
|
|
14
|
-
readonly avatarSingle: import("react").JSX.Element;
|
|
15
|
-
readonly avatarDouble: import("react").JSX.Element;
|
|
16
|
-
readonly avatarDiagonal: import("react").JSX.Element;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=subcomponents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/subcomponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,cAAc,GACd,eAAe,GACf,qBAAqB,GACrB,YAAY,GACZ,kBAAkB,GAClB,qBAAqB,GACrB,2BAA2B,GAC3B,mBAAmB,GACnB,yBAAyB,GACzB,4BAA4B,GAC5B,kCAAkC,GAClC,YAAY,GACZ,oBAAoB,GACpB,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,EAAE,SAAS,CA0DnE,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;CAe/B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;CAavB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAoBrB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type { Props as ListItemProps } from './ListItem';
|
|
2
|
-
export type { ListItemAdditionalInfoProps } from './AdditionalInfo';
|
|
3
|
-
export type { ListItemAvatarLayoutProps } from './AvatarLayout';
|
|
4
|
-
export type { ListItemAvatarViewProps } from './AvatarView';
|
|
5
|
-
export type { ListItemButtonProps } from './Button';
|
|
6
|
-
export type { ListItemCheckboxProps } from './Checkbox';
|
|
7
|
-
export type { ListItemIconButtonProps } from './IconButton';
|
|
8
|
-
export type { ListItemImageProps } from './Image';
|
|
9
|
-
export type { ListItemNavigationProps } from './Navigation';
|
|
10
|
-
export type { ListItemPromptProps } from './Prompt';
|
|
11
|
-
export type { ListItemRadioProps } from './Radio';
|
|
12
|
-
export type { ListItemSwitchProps } from './Switch';
|
|
13
|
-
export { default } from './ListItem';
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -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,5 +0,0 @@
|
|
|
1
|
-
import type { ListItemTypes, ListItemControlProps } from './ListItem';
|
|
2
|
-
export declare function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps): {
|
|
3
|
-
baseItemProps: Pick<import("./ListItem").Props, "disabled" | "inverted">;
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=useListItemControl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemControl.d.ts","sourceRoot":"","sources":["../../../src/listItem/useListItemControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB;;EAahG"}
|
|
@@ -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,56 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '../../test-utils';
|
|
2
|
-
import { ListItem, type Props as ListItemProps } from '../ListItem';
|
|
3
|
-
|
|
4
|
-
describe('ListItem.AdditionalInfo', () => {
|
|
5
|
-
const renderWithInfo = (info: ListItemProps['additionalInfo']) =>
|
|
6
|
-
render(<ListItem title="Test title" subtitle="Test subtitle" additionalInfo={info} />);
|
|
7
|
-
|
|
8
|
-
it('renders children content', () => {
|
|
9
|
-
renderWithInfo(
|
|
10
|
-
<ListItem.AdditionalInfo>Additional information content</ListItem.AdditionalInfo>,
|
|
11
|
-
);
|
|
12
|
-
expect(screen.getByText('Additional information content')).toBeInTheDocument();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('renders action button when onClick provided', () => {
|
|
16
|
-
const handleActionClick = jest.fn();
|
|
17
|
-
renderWithInfo(
|
|
18
|
-
<ListItem.AdditionalInfo action={{ label: 'Learn more', onClick: handleActionClick }}>
|
|
19
|
-
Additional info
|
|
20
|
-
</ListItem.AdditionalInfo>,
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
expect(screen.getByRole('button', { name: 'Learn more' })).toBeInTheDocument();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('renders action link with href when provided', () => {
|
|
27
|
-
renderWithInfo(
|
|
28
|
-
<ListItem.AdditionalInfo action={{ label: 'Learn more', href: '/learn' }}>
|
|
29
|
-
Additional info
|
|
30
|
-
</ListItem.AdditionalInfo>,
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const actionLink = screen.getByRole('link', { name: 'Learn more' });
|
|
34
|
-
expect(actionLink).toBeInTheDocument();
|
|
35
|
-
expect(actionLink).toHaveAttribute('href', '/learn');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('renders action link with target when provided', () => {
|
|
39
|
-
renderWithInfo(
|
|
40
|
-
<ListItem.AdditionalInfo action={{ label: 'Learn more', href: '/learn', target: '_blank' }}>
|
|
41
|
-
Additional info
|
|
42
|
-
</ListItem.AdditionalInfo>,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const actionLink = screen.getByRole('link', { name: 'Learn more (opens in new tab)' });
|
|
46
|
-
expect(actionLink).toBeInTheDocument();
|
|
47
|
-
expect(actionLink).toHaveAttribute('target', '_blank');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('does not render action when not provided', () => {
|
|
51
|
-
renderWithInfo(<ListItem.AdditionalInfo>Additional info only</ListItem.AdditionalInfo>);
|
|
52
|
-
|
|
53
|
-
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
|
54
|
-
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { action } from 'storybook/actions';
|
|
3
|
-
import { lorem20 } from '../../test-utils';
|
|
4
|
-
import { ListItem } from '../ListItem';
|
|
5
|
-
import {
|
|
6
|
-
SB_LIST_ITEM_CONTROLS as CONTROLS,
|
|
7
|
-
SB_LIST_ITEM_MEDIA as MEDIA,
|
|
8
|
-
} from '../_stories/subcomponents';
|
|
9
|
-
import type { ListItemAdditionalInfoProps } from './ListItemAdditionalInfo';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Use additional information to add extra details that help make the information clearer for users. Use additional information only after you've used the subtitle.
|
|
13
|
-
*
|
|
14
|
-
* Refer to the [design documentation](https://wise.design/components/list-item#content:~:text=StatusIcon.iconLabel.error-,Additional%20information,-Use%20additional%20information) for more details.
|
|
15
|
-
*/
|
|
16
|
-
export default {
|
|
17
|
-
component: ListItem.AdditionalInfo,
|
|
18
|
-
title: 'Content/ListItem/ListItem.AdditionalInfo',
|
|
19
|
-
parameters: {
|
|
20
|
-
docs: {
|
|
21
|
-
toc: true,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
args: {
|
|
25
|
-
action: {
|
|
26
|
-
label: 'Details about the subject.',
|
|
27
|
-
href: 'https://wise.com',
|
|
28
|
-
target: '_blank',
|
|
29
|
-
},
|
|
30
|
-
children: lorem20,
|
|
31
|
-
},
|
|
32
|
-
argTypes: {
|
|
33
|
-
children: {
|
|
34
|
-
table: {
|
|
35
|
-
type: { summary: 'ReactNode' },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
} satisfies Meta<ListItemAdditionalInfoProps>;
|
|
40
|
-
|
|
41
|
-
type Story = StoryObj<ListItemAdditionalInfoProps>;
|
|
42
|
-
|
|
43
|
-
export const Playground: Story = {
|
|
44
|
-
tags: ['!autodocs'],
|
|
45
|
-
render: (args: ListItemAdditionalInfoProps) => {
|
|
46
|
-
return (
|
|
47
|
-
<ListItem
|
|
48
|
-
title="List item title"
|
|
49
|
-
subtitle="Subtitle goes here"
|
|
50
|
-
media={MEDIA.avatarSingle}
|
|
51
|
-
control={CONTROLS.partialButton}
|
|
52
|
-
additionalInfo={<ListItem.AdditionalInfo {...args} />}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Fully interactive ListItems do not allow for any nested links or inline buttons as that would fail accessibility compliance.
|
|
60
|
-
*
|
|
61
|
-
* Non-interactive or partially-interactive ListItems allow appending a single link or inline button via `action` prop. The restriction has been introduced to ensure that the ListItem remains accessible and adheres to the vendors' best practices for mobile platforms.
|
|
62
|
-
*/
|
|
63
|
-
export const Interactivity: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
action: {
|
|
66
|
-
label: 'Details about the subject.',
|
|
67
|
-
href: 'https://wise.com',
|
|
68
|
-
target: '_blank',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
render: (args: ListItemAdditionalInfoProps) => {
|
|
72
|
-
return (
|
|
73
|
-
<ol className="list-unstyled">
|
|
74
|
-
<ListItem
|
|
75
|
-
title="Fully interactive ListItem"
|
|
76
|
-
subtitle="Subtitle goes here"
|
|
77
|
-
media={MEDIA.avatarSingle}
|
|
78
|
-
control={CONTROLS.button}
|
|
79
|
-
additionalInfo={<ListItem.AdditionalInfo {...args} action={undefined} />}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
<ListItem
|
|
83
|
-
title="Partially interactive ListItem"
|
|
84
|
-
subtitle="Subtitle goes here"
|
|
85
|
-
media={MEDIA.avatarSingle}
|
|
86
|
-
control={CONTROLS.partialButton}
|
|
87
|
-
additionalInfo={<ListItem.AdditionalInfo {...args} />}
|
|
88
|
-
/>
|
|
89
|
-
|
|
90
|
-
<ListItem
|
|
91
|
-
title="Non-interactive ListItem"
|
|
92
|
-
subtitle="Subtitle goes here"
|
|
93
|
-
media={MEDIA.avatarSingle}
|
|
94
|
-
additionalInfo={<ListItem.AdditionalInfo {...args} />}
|
|
95
|
-
/>
|
|
96
|
-
</ol>
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Interactive `ListItem.AdditionalInfo` allows for 2 types of actions: a link or a button.
|
|
103
|
-
*/
|
|
104
|
-
export const Actions: Story = {
|
|
105
|
-
render: (args: ListItemAdditionalInfoProps) => {
|
|
106
|
-
return (
|
|
107
|
-
<ol className="list-unstyled">
|
|
108
|
-
<ListItem
|
|
109
|
-
title="Partially interactive ListItem"
|
|
110
|
-
subtitle="Subtitle goes here"
|
|
111
|
-
media={MEDIA.avatarSingle}
|
|
112
|
-
control={CONTROLS.partialButton}
|
|
113
|
-
additionalInfo={
|
|
114
|
-
<ListItem.AdditionalInfo
|
|
115
|
-
{...args}
|
|
116
|
-
action={{
|
|
117
|
-
label: 'I am a link.',
|
|
118
|
-
href: 'https://wise.com',
|
|
119
|
-
target: '_blank',
|
|
120
|
-
}}
|
|
121
|
-
/>
|
|
122
|
-
}
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
<ListItem
|
|
126
|
-
title="Partially interactive ListItem"
|
|
127
|
-
subtitle="Subtitle goes here"
|
|
128
|
-
media={MEDIA.avatarSingle}
|
|
129
|
-
control={CONTROLS.partialButton}
|
|
130
|
-
additionalInfo={
|
|
131
|
-
<ListItem.AdditionalInfo
|
|
132
|
-
{...args}
|
|
133
|
-
action={{
|
|
134
|
-
label: 'I am a button.',
|
|
135
|
-
onClick: () => {
|
|
136
|
-
action('Button clicked')();
|
|
137
|
-
},
|
|
138
|
-
}}
|
|
139
|
-
/>
|
|
140
|
-
}
|
|
141
|
-
/>
|
|
142
|
-
</ol>
|
|
143
|
-
);
|
|
144
|
-
},
|
|
145
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, useContext } from 'react';
|
|
2
|
-
import { ListItemContext, type ListItemContextData } from '../ListItemContext';
|
|
3
|
-
import Body from '../../body';
|
|
4
|
-
import Link, { LinkProps } from '../../link';
|
|
5
|
-
import { Typography } from '../../common';
|
|
6
|
-
|
|
7
|
-
export type ListItemAdditionalInfoProps = PropsWithChildren<{
|
|
8
|
-
/**
|
|
9
|
-
* Props object to be passed to the [Link](https://storybook.wise.design/?path=/docs/typography-link--docs) component.
|
|
10
|
-
*/
|
|
11
|
-
action?: { label: string } & Pick<LinkProps, 'href' | 'onClick' | 'target'>;
|
|
12
|
-
}>;
|
|
13
|
-
|
|
14
|
-
export const AdditionalInfo = function ({ children, action }: ListItemAdditionalInfoProps) {
|
|
15
|
-
const { ids } = useContext<ListItemContextData>(ListItemContext);
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Body
|
|
19
|
-
type={Typography.BODY_DEFAULT}
|
|
20
|
-
id={ids.additionalInfo}
|
|
21
|
-
className="wds-list-item-additional-info"
|
|
22
|
-
>
|
|
23
|
-
{children}
|
|
24
|
-
{action ? (
|
|
25
|
-
<>
|
|
26
|
-
{' '}
|
|
27
|
-
<Link href={action.href} target={action.target} onClick={action.onClick}>
|
|
28
|
-
{action.label}
|
|
29
|
-
</Link>
|
|
30
|
-
</>
|
|
31
|
-
) : null}
|
|
32
|
-
</Body>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
AdditionalInfo.displayName = 'ListItem.AdditionalInfo';
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { mockMatchMedia, render, screen } from '../../test-utils';
|
|
2
|
-
import { ListItem, type Props as ListItemProps } from '../ListItem';
|
|
3
|
-
|
|
4
|
-
mockMatchMedia();
|
|
5
|
-
|
|
6
|
-
const avatars = [
|
|
7
|
-
{ imgSrc: 'avatar1.jpg', profileName: 'User 1' },
|
|
8
|
-
{ imgSrc: 'avatar2.jpg', profileName: 'User 2' },
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
const renderWithMedia = (media: ListItemProps['media']) =>
|
|
12
|
-
render(<ListItem title="Test Title" media={media} />);
|
|
13
|
-
|
|
14
|
-
describe('ListItem.AvatarLayout', () => {
|
|
15
|
-
it('applies custom className alongside default class', () => {
|
|
16
|
-
renderWithMedia(
|
|
17
|
-
<ListItem.AvatarLayout
|
|
18
|
-
className="custom-class"
|
|
19
|
-
role="group"
|
|
20
|
-
aria-label="Custom avatar group"
|
|
21
|
-
avatars={avatars}
|
|
22
|
-
/>,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
expect(screen.getByRole('group', { name: 'Custom avatar group' })).toHaveClass('custom-class');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders both avatars', () => {
|
|
29
|
-
renderWithMedia(<ListItem.AvatarLayout avatars={avatars} />);
|
|
30
|
-
|
|
31
|
-
const images = screen.getAllByRole('presentation');
|
|
32
|
-
expect(images).toHaveLength(avatars.length);
|
|
33
|
-
expect(images[0]).toHaveAttribute('src', avatars[0].imgSrc);
|
|
34
|
-
expect(images[1]).toHaveAttribute('src', avatars[1].imgSrc);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('renders with single avatar', () => {
|
|
38
|
-
renderWithMedia(<ListItem.AvatarLayout avatars={[avatars[0]]} />);
|
|
39
|
-
expect(screen.getByRole('presentation')).toHaveAttribute('src', avatars[0].imgSrc);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('handles empty avatars array', () => {
|
|
43
|
-
renderWithMedia(<ListItem.AvatarLayout avatars={[]} />);
|
|
44
|
-
expect(screen.queryByRole('img')).not.toBeInTheDocument();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('supports accessibility props', () => {
|
|
48
|
-
renderWithMedia(<ListItem.AvatarLayout aria-label="User avatars" avatars={avatars} />);
|
|
49
|
-
expect(screen.getByLabelText('User avatars')).toBeInTheDocument();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('passes through role', () => {
|
|
53
|
-
renderWithMedia(
|
|
54
|
-
<ListItem.AvatarLayout role="group" aria-label="Avatar group" avatars={avatars} />,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
expect(screen.getByRole('group', { name: 'Avatar group' })).toBeInTheDocument();
|
|
58
|
-
});
|
|
59
|
-
});
|