@transferwise/components 0.0.0-experimental-29d0f94 → 0.0.0-experimental-4b1de0a
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 +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js +5 -2
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs +5 -2
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/initials.js +1 -4
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +1 -4
- package/build/common/initials.mjs.map +1 -1
- package/build/i18n/de.json +0 -2
- package/build/i18n/de.json.js +0 -2
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +0 -2
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/fr.json +0 -2
- package/build/i18n/fr.json.js +0 -2
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +0 -2
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +0 -2
- package/build/i18n/hu.json.js +0 -2
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +0 -2
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/it.json +0 -2
- package/build/i18n/it.json.js +0 -2
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +0 -2
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +0 -2
- package/build/i18n/ja.json.js +0 -2
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +0 -2
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +0 -2
- package/build/i18n/pl.json.js +0 -2
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +0 -2
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/ro.json +0 -2
- package/build/i18n/ro.json.js +0 -2
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +0 -2
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +0 -2
- package/build/i18n/ru.json.js +0 -2
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +0 -2
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/tr.json +0 -2
- package/build/i18n/tr.json.js +0 -2
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +0 -2
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +0 -2
- package/build/i18n/zh-CN.json.js +0 -2
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +0 -2
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +0 -2
- package/build/i18n/zh-HK.json.js +0 -2
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +0 -2
- 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 +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +56 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +54 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +23 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +21 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js +23 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs +21 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -0
- package/build/listItem/Button/ListItemButton.js +43 -0
- package/build/listItem/Button/ListItemButton.js.map +1 -0
- package/build/listItem/Button/ListItemButton.mjs +41 -0
- package/build/listItem/Button/ListItemButton.mjs.map +1 -0
- package/build/listItem/Checkbox/ListItemCheckbox.js +30 -0
- package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -0
- package/build/listItem/Checkbox/ListItemCheckbox.mjs +28 -0
- package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -0
- package/build/listItem/IconButton/ListItemIconButton.js +42 -0
- package/build/listItem/IconButton/ListItemIconButton.js.map +1 -0
- package/build/listItem/IconButton/ListItemIconButton.mjs +40 -0
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -0
- package/build/listItem/Image/ListItemImage.js +31 -0
- package/build/listItem/Image/ListItemImage.js.map +1 -0
- package/build/listItem/Image/ListItemImage.mjs +29 -0
- package/build/listItem/Image/ListItemImage.mjs.map +1 -0
- package/build/listItem/ListItem.js +312 -0
- package/build/listItem/ListItem.js.map +1 -0
- package/build/listItem/ListItem.mjs +307 -0
- package/build/listItem/ListItem.mjs.map +1 -0
- package/build/listItem/ListItemContext.js +8 -0
- package/build/listItem/ListItemContext.js.map +1 -0
- package/build/listItem/ListItemContext.mjs +6 -0
- package/build/listItem/ListItemContext.mjs.map +1 -0
- package/build/listItem/Navigation/ListItemNavigation.js +45 -0
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -0
- package/build/listItem/Navigation/ListItemNavigation.mjs +43 -0
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js +59 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs +54 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -0
- package/build/listItem/Radio/ListItemRadio.js +30 -0
- package/build/listItem/Radio/ListItemRadio.js.map +1 -0
- package/build/listItem/Radio/ListItemRadio.mjs +28 -0
- package/build/listItem/Radio/ListItemRadio.mjs.map +1 -0
- package/build/listItem/Switch/ListItemSwitch.js +30 -0
- package/build/listItem/Switch/ListItemSwitch.js.map +1 -0
- package/build/listItem/Switch/ListItemSwitch.mjs +28 -0
- package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -0
- package/build/listItem/useListItemControl.js +22 -0
- package/build/listItem/useListItemControl.js.map +1 -0
- package/build/listItem/useListItemControl.mjs +20 -0
- package/build/listItem/useListItemControl.mjs.map +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 +773 -1
- package/build/styles/avatarView/AvatarView.css +3 -1
- package/build/styles/listItem/ListItem.css +770 -0
- package/build/styles/listItem/ListItem.grid.css +370 -0
- package/build/styles/main.css +773 -1
- package/build/switch/Switch.js +2 -0
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs +2 -0
- package/build/switch/Switch.mjs.map +1 -1
- package/build/test-utils/assets/placeholder-landscape.svg +1 -0
- package/build/test-utils/assets/placeholder-portrait.svg +1 -0
- 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 +3 -1
- 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 +3 -0
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/image/index.d.ts +1 -0
- package/build/types/image/index.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +15 -0
- package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +1 -0
- package/build/types/listItem/AdditionalInfo/index.d.ts +3 -0
- package/build/types/listItem/AdditionalInfo/index.d.ts.map +1 -0
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +18 -0
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -0
- package/build/types/listItem/AvatarLayout/index.d.ts +3 -0
- package/build/types/listItem/AvatarLayout/index.d.ts.map +1 -0
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +16 -0
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -0
- package/build/types/listItem/AvatarView/index.d.ts +3 -0
- package/build/types/listItem/AvatarView/index.d.ts.map +1 -0
- package/build/types/listItem/Button/ListItemButton.d.ts +20 -0
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -0
- package/build/types/listItem/Button/index.d.ts +3 -0
- package/build/types/listItem/Button/index.d.ts.map +1 -0
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +14 -0
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +1 -0
- package/build/types/listItem/Checkbox/index.d.ts +3 -0
- package/build/types/listItem/Checkbox/index.d.ts.map +1 -0
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +18 -0
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -0
- package/build/types/listItem/IconButton/index.d.ts +3 -0
- package/build/types/listItem/IconButton/index.d.ts.map +1 -0
- package/build/types/listItem/Image/ListItemImage.d.ts +25 -0
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -0
- package/build/types/listItem/Image/index.d.ts +3 -0
- package/build/types/listItem/Image/index.d.ts.map +1 -0
- package/build/types/listItem/ListItem.d.ts +113 -0
- package/build/types/listItem/ListItem.d.ts.map +1 -0
- package/build/types/listItem/ListItemContext.d.ts +22 -0
- package/build/types/listItem/ListItemContext.d.ts.map +1 -0
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts +15 -0
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -0
- package/build/types/listItem/Navigation/index.d.ts +3 -0
- package/build/types/listItem/Navigation/index.d.ts.map +1 -0
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +16 -0
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -0
- package/build/types/listItem/Prompt/index.d.ts +3 -0
- package/build/types/listItem/Prompt/index.d.ts.map +1 -0
- package/build/types/listItem/Radio/ListItemRadio.d.ts +14 -0
- package/build/types/listItem/Radio/ListItemRadio.d.ts.map +1 -0
- package/build/types/listItem/Radio/index.d.ts +3 -0
- package/build/types/listItem/Radio/index.d.ts.map +1 -0
- package/build/types/listItem/Switch/ListItemSwitch.d.ts +14 -0
- package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +1 -0
- package/build/types/listItem/Switch/index.d.ts +3 -0
- package/build/types/listItem/Switch/index.d.ts.map +1 -0
- package/build/types/listItem/_stories/helpers.d.ts +27 -0
- package/build/types/listItem/_stories/helpers.d.ts.map +1 -0
- package/build/types/listItem/_stories/subcomponents.d.ts +18 -0
- package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -0
- package/build/types/listItem/index.d.ts +14 -0
- package/build/types/listItem/index.d.ts.map +1 -0
- 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/useListItemControl.d.ts +5 -0
- package/build/types/listItem/useListItemControl.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/build/types/switch/Switch.d.ts +3 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/avatarView/AvatarView.css +3 -1
- package/src/avatarView/AvatarView.less +2 -1
- package/src/button/Button.spec.tsx +18 -0
- package/src/button/Button.tsx +5 -1
- 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 +6 -1
- package/src/common/initials.spec.tsx +0 -13
- package/src/common/initials.ts +0 -5
- package/src/i18n/de.json +0 -2
- package/src/i18n/fr.json +0 -2
- package/src/i18n/hu.json +0 -2
- package/src/i18n/it.json +0 -2
- package/src/i18n/ja.json +0 -2
- package/src/i18n/pl.json +0 -2
- package/src/i18n/ro.json +0 -2
- package/src/i18n/ru.json +0 -2
- package/src/i18n/tr.json +0 -2
- package/src/i18n/zh-CN.json +0 -2
- package/src/i18n/zh-HK.json +0 -2
- package/src/iconButton/IconButton.story.tsx +1 -1
- package/src/iconButton/IconButton.tsx +1 -1
- package/src/image/Image.tsx +3 -0
- package/src/image/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +56 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +195 -0
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +36 -0
- package/src/listItem/AdditionalInfo/index.ts +2 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +59 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +121 -0
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +27 -0
- package/src/listItem/AvatarLayout/index.ts +2 -0
- package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +75 -0
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +336 -0
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +27 -0
- package/src/listItem/AvatarView/index.ts +2 -0
- package/src/listItem/Button/ListItemButton.spec.tsx +68 -0
- package/src/listItem/Button/ListItemButton.story.tsx +466 -0
- package/src/listItem/Button/ListItemButton.tsx +56 -0
- package/src/listItem/Button/index.ts +2 -0
- package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +82 -0
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +125 -0
- package/src/listItem/Checkbox/ListItemCheckbox.tsx +33 -0
- package/src/listItem/Checkbox/index.ts +2 -0
- package/src/listItem/IconButton/ListItemIconButton.spec.tsx +119 -0
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +249 -0
- package/src/listItem/IconButton/ListItemIconButton.tsx +56 -0
- package/src/listItem/IconButton/index.ts +2 -0
- package/src/listItem/Image/ListItemImage.spec.tsx +30 -0
- package/src/listItem/Image/ListItemImage.story.tsx +77 -0
- package/src/listItem/Image/ListItemImage.tsx +48 -0
- package/src/listItem/Image/index.ts +2 -0
- package/src/listItem/ListItem.css +770 -0
- package/src/listItem/ListItem.grid.css +370 -0
- package/src/listItem/ListItem.grid.less +622 -0
- package/src/listItem/ListItem.less +421 -0
- package/src/listItem/ListItem.spec.tsx +1496 -0
- package/src/listItem/ListItem.tsx +447 -0
- package/src/listItem/ListItemContext.tsx +27 -0
- package/src/listItem/Navigation/ListItemNavigation.spec.tsx +59 -0
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +109 -0
- package/src/listItem/Navigation/ListItemNavigation.tsx +40 -0
- package/src/listItem/Navigation/index.ts +2 -0
- package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +201 -0
- package/src/listItem/Prompt/ListItemPrompt.tsx +32 -0
- package/src/listItem/Prompt/index.ts +2 -0
- package/src/listItem/Radio/ListItemRadio.spec.tsx +66 -0
- package/src/listItem/Radio/ListItemRadio.story.tsx +108 -0
- package/src/listItem/Radio/ListItemRadio.tsx +33 -0
- package/src/listItem/Radio/index.ts +2 -0
- package/src/listItem/Switch/ListItemSwitch.spec.tsx +47 -0
- package/src/listItem/Switch/ListItemSwitch.story.tsx +77 -0
- package/src/listItem/Switch/ListItemSwitch.tsx +33 -0
- package/src/listItem/Switch/index.ts +2 -0
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +250 -0
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +353 -0
- package/src/listItem/_stories/ListItem.scenarios.story.tsx +209 -0
- package/src/listItem/_stories/ListItem.story.tsx +772 -0
- package/src/listItem/_stories/ListItem.variants.test.story.tsx +271 -0
- package/src/listItem/_stories/helpers.tsx +53 -0
- package/src/listItem/_stories/subcomponents.tsx +139 -0
- package/src/listItem/index.ts +14 -0
- package/src/listItem/test-utils.tsx +33 -0
- package/src/listItem/useListItemControl.tsx +18 -0
- package/src/listItem/useListItemMedia.tsx +13 -0
- package/src/main.css +773 -1
- package/src/main.less +1 -0
- package/src/switch/Switch.tsx +5 -1
- package/src/test-utils/assets/placeholder-landscape.svg +1 -0
- package/src/test-utils/assets/placeholder-portrait.svg +1 -0
- package/src/test-utils/Parameters.d.ts +0 -77
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.mjs","sources":["../../src/listItem/ListItem.tsx"],"sourcesContent":["/* eslint-disable functional/immutable-data */\nimport {\n useContext,\n useId,\n useMemo,\n useState,\n useEffect,\n type PropsWithChildren,\n type ReactNode,\n} from 'react';\nimport { Typography } from '../common';\nimport Body from '../body';\nimport { AdditionalInfo } from './AdditionalInfo';\nimport { IconButton, type ListItemIconButtonProps } from './IconButton';\nimport { Checkbox, type ListItemCheckboxProps } from './Checkbox';\nimport { Navigation, type ListItemNavigationProps } from './Navigation';\nimport { clsx } from 'clsx';\nimport { Button, type ListItemButtonProps } from './Button';\nimport { Radio, type ListItemRadioProps } from './Radio';\nimport { Switch, type ListItemSwitchProps } from './Switch';\nimport { AvatarLayout } from './AvatarLayout';\nimport { AvatarView } from './AvatarView';\nimport { Image } from './Image';\nimport { Prompt } from './Prompt';\nimport { PrimitiveAnchor } from '../primitives';\nimport {\n ListItemContext,\n type ListItemContextData,\n type ListItemMediaSize,\n} from './ListItemContext';\n\nexport type ListItemTypes =\n | 'non-interactive'\n | 'navigation'\n | 'radio'\n | 'checkbox'\n | 'switch'\n | 'button'\n | 'icon-button';\n\nexport type ListItemControlProps =\n | ListItemNavigationProps\n | ListItemCheckboxProps\n | ListItemButtonProps\n | ListItemIconButtonProps\n | ListItemRadioProps\n | ListItemSwitchProps;\n\nexport type Props = {\n as?: 'li' | 'div';\n /**\n * Swaps vertical hierarchy of title and subtitle and their corresponding right values.\n */\n inverted?: boolean;\n disabled?: boolean;\n /**\n * Highlights the list item as an action to be taken or already taken. <br />\n */\n spotlight?: 'active' | 'inactive';\n title: ReactNode;\n subtitle?: ReactNode;\n /**\n * Requires `<ListItem.AdditionalInfo />` component as a sole child. <br />\n * Can be only rendered if `subtitle` is also provided.\n */\n additionalInfo?: ReactNode;\n valueTitle?: ReactNode;\n valueSubtitle?: ReactNode;\n /**\n * Requires one of the following as a sole child: <br />\n * `<ListItem.AvatarView />`,\n * `<ListItem.AvatarLayout />` or\n * `<ListItem.Image />`\n */\n media?: ReactNode;\n /**\n * Requires one of the following as a sole child: <br/>\n * `<ListItem.Button />`, <br/>\n * `<ListItem.Checkbox />`, <br/>\n * `<ListItem.IconButton />`, <br/>\n * `<ListItem.Navigation />`, <br/>\n * `<ListItem.Radio />`, or\n * `<ListItem.Switch />`\n */\n control?: ReactNode;\n /**\n * Requires `<ListItem.Prompt />` component as a sole child.\n */\n prompt?: ReactNode;\n className?: string;\n /**\n * 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 />\n * Controls the width ratio of left side content (title and subtitle) to the right side content.\n */\n valueColumnWidth?: number;\n id?: string;\n role?: string;\n 'aria-labelledby'?: string;\n};\n\n/**\n * @see [Design documentation](https://wise.design/components/list-item)\n * @see [Storybook documentation](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n */\nexport const ListItem = ({\n as: ListItemElement = 'li',\n title,\n subtitle,\n additionalInfo,\n prompt,\n inverted,\n media,\n spotlight,\n valueTitle,\n valueSubtitle,\n control = null,\n disabled,\n className,\n valueColumnWidth,\n role,\n id,\n 'aria-labelledby': ariaLabelledby,\n}: Props) => {\n const idPrefix = useId();\n const [controlProps, setControlProps] = useState<ListItemControlProps>({});\n const [controlType, setControlType] = useState<ListItemTypes>('non-interactive');\n const [mediaSize, setMediaSize] = useState<ListItemMediaSize | undefined>();\n\n const ids: ListItemContextData['ids'] = {\n title: `${idPrefix}_title`,\n ...(subtitle ? { subtitle: `${idPrefix}_subtitle` } : {}),\n ...(valueTitle ? { valueTitle: `${idPrefix}_value-title` } : {}),\n ...(valueSubtitle ? { valueSubtitle: `${idPrefix}_value-subtitle` } : {}),\n control: `${idPrefix}_control`,\n ...(prompt ? { prompt: `${idPrefix}_prompt` } : {}),\n ...(additionalInfo ? { additionalInfo: `${idPrefix}_additional-info` } : {}),\n };\n\n const isPartiallyInteractive = Boolean(\n (controlType === 'button' || controlType === 'icon-button') &&\n (controlProps as ListItemButtonProps | ListItemIconButtonProps)?.partiallyInteractive,\n );\n const isFullyInteractive = controlType !== 'non-interactive' && !isPartiallyInteractive;\n const isButtonAsLink =\n (controlType === 'button' || controlType === 'icon-button') &&\n Boolean((controlProps as ListItemButtonProps | ListItemIconButtonProps)?.href);\n\n const titlesAndValues = [\n inverted ? ids.subtitle : ids.title,\n inverted ? ids.title : ids.subtitle,\n inverted ? ids.valueSubtitle : ids.valueTitle,\n inverted ? ids.valueTitle : ids.valueSubtitle,\n ].join(' ');\n const additionalInfoPrompt = [ids.additionalInfo, ids.prompt].filter(Boolean).join(' ');\n\n const describedByIds = useMemo(() => {\n return isFullyInteractive && !isButtonAsLink\n ? additionalInfoPrompt\n : `${titlesAndValues} ${additionalInfoPrompt}`;\n }, [isFullyInteractive]);\n\n const listItemContext = useMemo(\n () => ({\n setControlType,\n setControlProps,\n setMediaSize,\n ids,\n props: { disabled, inverted },\n mediaSize,\n describedByIds,\n }),\n [describedByIds, mediaSize],\n );\n const gridColumnsStyle = {\n '--wds-list-item-body-left': valueColumnWidth ? `${100 - valueColumnWidth}fr` : '50fr',\n '--wds-list-item-body-right': valueColumnWidth ? `${valueColumnWidth}fr` : '50fr',\n } as React.CSSProperties;\n\n const getFeatureClassName = () => {\n const partials = [];\n const hasMedia = Boolean(media);\n const hasControl = Boolean(control);\n const hasInfo = Boolean(additionalInfo);\n const hasPrompt = Boolean(prompt);\n\n if (hasMedia && hasControl) {\n partials.push('wds-list-item-hasMedia-hasControl');\n }\n\n if (hasMedia && !hasControl) {\n partials.push('wds-list-item-hasMedia-noControl');\n }\n\n if (!hasMedia && hasControl) {\n partials.push('wds-list-item-noMedia-hasControl');\n }\n\n if (!hasMedia && !hasControl) {\n partials.push('wds-list-item-noMedia-noControl');\n }\n\n if (hasInfo && hasPrompt) {\n partials.push('wds-list-item-hasInfo-hasPrompt');\n }\n if (hasInfo && !hasPrompt) {\n partials.push('wds-list-item-hasInfo-noPrompt');\n }\n if (!hasInfo && hasPrompt) {\n partials.push('wds-list-item-noInfo-hasPrompt');\n }\n if (!hasInfo && !hasPrompt) {\n partials.push('wds-list-item-noInfo-noPrompt');\n }\n\n return partials.join(' ');\n };\n\n return (\n <ListItemContext.Provider value={listItemContext}>\n <ListItemElement\n className={clsx(\n 'wds-list-item',\n `wds-list-item-${controlType}`,\n getFeatureClassName(),\n {\n 'wds-list-item-interactive': isFullyInteractive,\n 'wds-list-item-partially-interactive': isPartiallyInteractive,\n [`wds-list-item-spotlight wds-list-item-spotlight-${spotlight}`]:\n isFullyInteractive && !!spotlight,\n disabled,\n },\n className,\n )}\n id={id}\n role={role}\n aria-disabled={disabled}\n aria-labelledby={ariaLabelledby}\n >\n {spotlight === 'inactive' && (\n <svg aria-hidden=\"true\" className=\"wds-list-item-spotlight__border\">\n <rect />\n </svg>\n )}\n\n <View\n {...{\n isPartiallyInteractive,\n subtitle,\n additionalInfo,\n disabled,\n prompt,\n controlType,\n controlProps,\n }}\n className={getFeatureClassName()}\n >\n {media && <div className=\"wds-list-item-media\">{media}</div>}\n\n {/* Title + Subtitle + Values - Group */}\n <div\n className=\"wds-list-item-body\"\n style={valueColumnWidth ? gridColumnsStyle : undefined}\n >\n {/* Title + Subtitle + Values - Group */}\n <span\n className={clsx({\n 'wds-list-item-body-center': title && !subtitle,\n })}\n >\n {(() => {\n const titles = [\n <Body\n key={ids.title}\n id={ids.title}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-list-item-title\"\n >\n {title}\n </Body>,\n ];\n if (subtitle) {\n titles.push(\n <Body key={ids.subtitle} id={ids.subtitle} className=\"wds-list-item-subtitle\">\n {subtitle}\n </Body>,\n );\n }\n return inverted ? [...titles].reverse() : titles;\n })()}\n </span>\n\n {(valueTitle || valueSubtitle) && (\n <span\n className={clsx('wds-list-item-value', {\n 'flex-column': valueTitle !== undefined || valueSubtitle !== undefined,\n 'wds-list-item-body-center':\n (valueTitle && !valueSubtitle) || (!valueTitle && valueSubtitle),\n })}\n >\n {(() => {\n const values = [];\n if (valueTitle) {\n values.push(\n <Body\n key={ids.valueTitle}\n id={ids.valueTitle}\n type={Typography.BODY_LARGE_BOLD}\n className=\"wds-list-item-title-value\"\n >\n {valueTitle}\n </Body>,\n );\n }\n if (valueSubtitle) {\n values.push(\n <Body\n key={ids.valueSubtitle}\n id={ids.valueSubtitle}\n className=\"wds-list-item-subtitle-value\"\n >\n {valueSubtitle}\n </Body>,\n );\n }\n return inverted ? [...values].reverse() : values;\n })()}\n </span>\n )}\n </div>\n\n {control === null ? null : (\n <Body\n className={clsx('wds-list-item-control-wrapper', {\n 'wds-list-item-button-control': controlType === 'button',\n })}\n style={\n {\n '--wds-list-item-control-wrapper-height': mediaSize ? `${mediaSize}px` : 'auto',\n } as React.CSSProperties\n }\n >\n {control}\n </Body>\n )}\n </View>\n </ListItemElement>\n </ListItemContext.Provider>\n );\n};\n\ntype ViewProps = PropsWithChildren<{\n isPartiallyInteractive: boolean;\n controlType?: ListItemTypes;\n controlProps?: ListItemControlProps;\n}> &\n Pick<Props, 'subtitle' | 'additionalInfo' | 'disabled' | 'prompt' | 'className'>;\n\nfunction View({\n children,\n subtitle,\n additionalInfo,\n prompt,\n disabled,\n isPartiallyInteractive,\n controlType = 'non-interactive',\n controlProps,\n className = '',\n}: ViewProps) {\n const { ids, describedByIds } = useContext<ListItemContextData>(ListItemContext);\n const isLinkControl = ['navigation'].includes(controlType);\n\n const isHrefProvided =\n isLinkControl &&\n !!(controlProps as ListItemNavigationProps)?.href &&\n (controlProps as ListItemNavigationProps)?.href !== '#';\n\n const renderExtras = () => (\n <>\n {Boolean(subtitle) && additionalInfo}\n {prompt}\n </>\n );\n\n if (isLinkControl && isHrefProvided) {\n return (\n // for link instances of .Navigation, .IconButton, .Button\n <div className={clsx('wds-list-item-gridWrapper', className)}>\n <PrimitiveAnchor\n aria-describedby={describedByIds}\n href={(controlProps as ListItemNavigationProps)?.href}\n target={(controlProps as ListItemNavigationProps)?.target}\n className={clsx('wds-list-item-view d-flex flex-row', {\n 'wds-list-item-control': controlType === 'navigation',\n })}\n disabled={disabled}\n >\n {children}\n </PrimitiveAnchor>\n\n {renderExtras()}\n </div>\n );\n }\n\n if (isPartiallyInteractive || controlType === 'non-interactive') {\n return (\n <div className={clsx('wds-list-item-gridWrapper', className)}>\n <div className={clsx('wds-list-item-view d-flex flex-row')}>{children}</div>\n\n {renderExtras()}\n </div>\n );\n }\n\n // for form control instances of .Radio, .Checkbox, .Switch, .Button, .Navigation etc\n // Radio cannot be wrapped in a <fieldset> element to announce it as a group.\n const InputWrapper = controlType === 'radio' ? 'div' : 'fieldset';\n return (\n <InputWrapper className={clsx('wds-list-item-gridWrapper', className)}>\n <label\n htmlFor={ids.control}\n className={clsx('wds-list-item-view', {\n clickable: !disabled,\n fullyInteractive: !isPartiallyInteractive,\n })}\n >\n {children}\n </label>\n\n {renderExtras()}\n </InputWrapper>\n );\n}\n\nListItem.Image = Image;\nListItem.AvatarView = AvatarView;\nListItem.AvatarLayout = AvatarLayout;\nListItem.AdditionalInfo = AdditionalInfo;\nListItem.Checkbox = Checkbox;\nListItem.Radio = Radio;\nListItem.IconButton = IconButton;\nListItem.Navigation = Navigation;\nListItem.Button = Button;\nListItem.Switch = Switch;\nListItem.Prompt = Prompt;\n\nexport default ListItem;\n"],"names":["ListItem","as","ListItemElement","title","subtitle","additionalInfo","prompt","inverted","media","spotlight","valueTitle","valueSubtitle","control","disabled","className","valueColumnWidth","role","id","ariaLabelledby","idPrefix","useId","controlProps","setControlProps","useState","controlType","setControlType","mediaSize","setMediaSize","ids","isPartiallyInteractive","Boolean","partiallyInteractive","isFullyInteractive","isButtonAsLink","href","titlesAndValues","join","additionalInfoPrompt","filter","describedByIds","useMemo","listItemContext","props","gridColumnsStyle","getFeatureClassName","partials","hasMedia","hasControl","hasInfo","hasPrompt","push","_jsx","ListItemContext","Provider","value","children","_jsxs","clsx","View","style","undefined","titles","Body","type","Typography","BODY_LARGE_BOLD","reverse","values","useContext","isLinkControl","includes","isHrefProvided","renderExtras","_Fragment","PrimitiveAnchor","target","InputWrapper","htmlFor","clickable","fullyInteractive","Image","AvatarView","AvatarLayout","AdditionalInfo","Checkbox","Radio","IconButton","Navigation","Button","Switch","Prompt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAwGO,MAAMA,QAAQ,GAAGA,CAAC;EACvBC,EAAE,EAAEC,eAAe,GAAG,IAAI;EAC1BC,KAAK;EACLC,QAAQ;EACRC,cAAc;EACdC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,SAAS;EACTC,UAAU;EACVC,aAAa;AACbC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,SAAS;EACTC,gBAAgB;EAChBC,IAAI;EACJC,EAAE;AACF,EAAA,iBAAiB,EAAEC;AAAc,CAC3B,KAAI;A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AM;AACxBzF,QAAQ,CAAC0F,MAAM,GAAGA,MAAM;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemContext.js","sources":["../../src/listItem/ListItemContext.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => void;\n setMediaSize: (size: ListItemMediaSize | undefined) => void;\n ids: {\n title: string;\n subtitle?: string;\n valueTitle?: string;\n valueSubtitle?: string;\n additionalInfo?: string;\n control: string;\n prompt?: string;\n };\n props: Pick<ListItemProps, 'disabled' | 'inverted'>;\n mediaSize?: ListItemAvatarViewProps['size'];\n describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;;;MAwBaA,eAAe,gBAAGC,mBAAa,CAC1C,IAAsC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemContext.mjs","sources":["../../src/listItem/ListItemContext.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type { ListItemTypes, ListItemControlProps, Props as ListItemProps } from './ListItem';\nimport type { ListItemAvatarViewProps } from './AvatarView';\n\nexport type ListItemMediaSize = 32 | 40 | 48 | 56 | 72;\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => void;\n setMediaSize: (size: ListItemMediaSize | undefined) => void;\n ids: {\n title: string;\n subtitle?: string;\n valueTitle?: string;\n valueSubtitle?: string;\n additionalInfo?: string;\n control: string;\n prompt?: string;\n };\n props: Pick<ListItemProps, 'disabled' | 'inverted'>;\n mediaSize?: ListItemAvatarViewProps['size'];\n describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;MAwBaA,eAAe,gBAAGC,aAAa,CAC1C,IAAsC;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var icons = require('@transferwise/icons');
|
|
4
|
+
var useListItemControl = require('../useListItemControl.js');
|
|
5
|
+
var PrimitiveButton = require('../../primitives/PrimitiveButton/PrimitiveButton.js');
|
|
6
|
+
require('../../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var ListItemContext = require('../ListItemContext.js');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
const Navigation = function Navigation({
|
|
12
|
+
href = '#',
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
baseItemProps
|
|
17
|
+
} = useListItemControl.useListItemControl('navigation', {
|
|
18
|
+
href,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
const {
|
|
22
|
+
ids,
|
|
23
|
+
describedByIds
|
|
24
|
+
} = React.useContext(ListItemContext.ListItemContext);
|
|
25
|
+
const isLink = href !== '#';
|
|
26
|
+
const icon = /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
|
|
27
|
+
size: 16
|
|
28
|
+
});
|
|
29
|
+
if (baseItemProps.disabled) return /*#__PURE__*/jsxRuntime.jsx(icons.BackslashCircle, {
|
|
30
|
+
size: 24
|
|
31
|
+
});
|
|
32
|
+
return isLink ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
33
|
+
children: icon
|
|
34
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(PrimitiveButton.default, {
|
|
35
|
+
"aria-describedby": describedByIds,
|
|
36
|
+
id: ids.control,
|
|
37
|
+
className: "btn-unstyled wds-list-item-control",
|
|
38
|
+
onClick: props.onClick,
|
|
39
|
+
children: icon
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
Navigation.displayName = 'ListItem.Navigation';
|
|
43
|
+
|
|
44
|
+
exports.Navigation = Navigation;
|
|
45
|
+
//# sourceMappingURL=ListItemNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemNavigation.js","sources":["../../../src/listItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight, BackslashCircle } from '@transferwise/icons';\nimport type { ButtonProps } from '../../button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href = '#', ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const isLink = href !== '#';\n const icon = <ChevronRight size={16} />;\n\n if (baseItemProps.disabled) return <BackslashCircle size={24} />;\n\n return isLink ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","isLink","icon","_jsx","ChevronRight","size","disabled","BackslashCircle","_Fragment","children","PrimitiveButton","id","control","className","onClick","displayName"],"mappings":";;;;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;AAAEC,EAAAA,IAAI,GAAG,GAAG;EAAE,GAAGC;AAAK,CAA2B,EAAA;EAC7F,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;AAC3D,EAAA,MAAMC,MAAM,GAAGR,IAAI,KAAK,GAAG;AAC3B,EAAA,MAAMS,IAAI,gBAAGC,cAAA,CAACC,kBAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,IAAIV,aAAa,CAACW,QAAQ,EAAE,oBAAOH,cAAA,CAACI,qBAAe,EAAA;AAACF,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEhE,EAAA,OAAOJ,MAAM,gBACXE,cAAA,CAAAK,mBAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGP;AAAI,IAAI,gBAEXC,cAAA,CAACO,uBAAe,EAAA;AACd,IAAA,kBAAA,EAAkBZ,cAAe;IACjCa,EAAE,EAAEd,GAAG,CAACe,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAEpB,KAAK,CAACoB,OAAkE;AAAAL,IAAAA,QAAA,EAEhFP;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACuB,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BackslashCircle, ChevronRight } from '@transferwise/icons';
|
|
2
|
+
import { useListItemControl } from '../useListItemControl.mjs';
|
|
3
|
+
import PrimitiveButton from '../../primitives/PrimitiveButton/PrimitiveButton.mjs';
|
|
4
|
+
import '../../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
|
|
5
|
+
import { useContext } from 'react';
|
|
6
|
+
import { ListItemContext } from '../ListItemContext.mjs';
|
|
7
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
const Navigation = function Navigation({
|
|
10
|
+
href = '#',
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
baseItemProps
|
|
15
|
+
} = useListItemControl('navigation', {
|
|
16
|
+
href,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
const {
|
|
20
|
+
ids,
|
|
21
|
+
describedByIds
|
|
22
|
+
} = useContext(ListItemContext);
|
|
23
|
+
const isLink = href !== '#';
|
|
24
|
+
const icon = /*#__PURE__*/jsx(ChevronRight, {
|
|
25
|
+
size: 16
|
|
26
|
+
});
|
|
27
|
+
if (baseItemProps.disabled) return /*#__PURE__*/jsx(BackslashCircle, {
|
|
28
|
+
size: 24
|
|
29
|
+
});
|
|
30
|
+
return isLink ? /*#__PURE__*/jsx(Fragment, {
|
|
31
|
+
children: icon
|
|
32
|
+
}) : /*#__PURE__*/jsx(PrimitiveButton, {
|
|
33
|
+
"aria-describedby": describedByIds,
|
|
34
|
+
id: ids.control,
|
|
35
|
+
className: "btn-unstyled wds-list-item-control",
|
|
36
|
+
onClick: props.onClick,
|
|
37
|
+
children: icon
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
Navigation.displayName = 'ListItem.Navigation';
|
|
41
|
+
|
|
42
|
+
export { Navigation };
|
|
43
|
+
//# sourceMappingURL=ListItemNavigation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemNavigation.mjs","sources":["../../../src/listItem/Navigation/ListItemNavigation.tsx"],"sourcesContent":["import { ChevronRight, BackslashCircle } from '@transferwise/icons';\nimport type { ButtonProps } from '../../button/Button.types';\nimport { useListItemControl } from '../useListItemControl';\nimport { PrimitiveButton } from '../../primitives';\nimport { useContext } from 'react';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href' | 'target'>;\n\n/**\n * This component allows for rendering a control functionally synonymous with HTML `anchor` or a\n * `button`, giving users a rich way to choose between options and navigate to another screen or\n * step in a flow. It offers only a subset of features of the HTML element in line with the\n * ListItem's constraints.<br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---navigation) for details.\n */\nexport const Navigation = function Navigation({ href = '#', ...props }: ListItemNavigationProps) {\n const { baseItemProps } = useListItemControl('navigation', { href, ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n const isLink = href !== '#';\n const icon = <ChevronRight size={16} />;\n\n if (baseItemProps.disabled) return <BackslashCircle size={24} />;\n\n return isLink ? (\n <>{icon}</>\n ) : (\n <PrimitiveButton\n aria-describedby={describedByIds}\n id={ids.control}\n className=\"btn-unstyled wds-list-item-control\"\n onClick={props.onClick as React.MouseEventHandler<HTMLButtonElement> | undefined}\n >\n {icon}\n </PrimitiveButton>\n );\n};\n\nNavigation.displayName = 'ListItem.Navigation';\n"],"names":["Navigation","href","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","isLink","icon","_jsx","ChevronRight","size","disabled","BackslashCircle","_Fragment","children","PrimitiveButton","id","control","className","onClick","displayName"],"mappings":";;;;;;;;AAiBO,MAAMA,UAAU,GAAG,SAASA,UAAUA,CAAC;AAAEC,EAAAA,IAAI,GAAG,GAAG;EAAE,GAAGC;AAAK,CAA2B,EAAA;EAC7F,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,YAAY,EAAE;IAAEH,IAAI;IAAE,GAAGC;AAAK,GAAE,CAAC;EAC9E,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;AAC3D,EAAA,MAAMC,MAAM,GAAGR,IAAI,KAAK,GAAG;AAC3B,EAAA,MAAMS,IAAI,gBAAGC,GAAA,CAACC,YAAY,EAAA;AAACC,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEvC,EAAA,IAAIV,aAAa,CAACW,QAAQ,EAAE,oBAAOH,GAAA,CAACI,eAAe,EAAA;AAACF,IAAAA,IAAI,EAAE;AAAG,GAAA,CAAG;AAEhE,EAAA,OAAOJ,MAAM,gBACXE,GAAA,CAAAK,QAAA,EAAA;AAAAC,IAAAA,QAAA,EAAGP;AAAI,IAAI,gBAEXC,GAAA,CAACO,eAAe,EAAA;AACd,IAAA,kBAAA,EAAkBZ,cAAe;IACjCa,EAAE,EAAEd,GAAG,CAACe,OAAQ;AAChBC,IAAAA,SAAS,EAAC,oCAAoC;IAC9CC,OAAO,EAAEpB,KAAK,CAACoB,OAAkE;AAAAL,IAAAA,QAAA,EAEhFP;AAAI,GACU,CAClB;AACH;AAEAV,UAAU,CAACuB,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
require('../../common/theme.js');
|
|
8
|
+
require('../../common/direction.js');
|
|
9
|
+
require('../../common/propsValues/control.js');
|
|
10
|
+
require('../../common/propsValues/breakpoint.js');
|
|
11
|
+
require('../../common/propsValues/size.js');
|
|
12
|
+
require('../../common/propsValues/typography.js');
|
|
13
|
+
require('../../common/propsValues/width.js');
|
|
14
|
+
require('../../common/propsValues/type.js');
|
|
15
|
+
require('../../common/propsValues/dateMode.js');
|
|
16
|
+
require('../../common/propsValues/monthFormat.js');
|
|
17
|
+
require('../../common/propsValues/position.js');
|
|
18
|
+
require('../../common/propsValues/layouts.js');
|
|
19
|
+
require('../../common/propsValues/status.js');
|
|
20
|
+
var sentiment = require('../../common/propsValues/sentiment.js');
|
|
21
|
+
require('../../common/propsValues/profileType.js');
|
|
22
|
+
require('../../common/propsValues/variant.js');
|
|
23
|
+
require('../../common/propsValues/scroll.js');
|
|
24
|
+
require('../../common/propsValues/markdownNodeType.js');
|
|
25
|
+
require('../../common/fileType.js');
|
|
26
|
+
require('@transferwise/icons');
|
|
27
|
+
require('react-intl');
|
|
28
|
+
require('../../common/closeButton/CloseButton.messages.js');
|
|
29
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
30
|
+
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
31
|
+
var Body = require('../../body/Body.js');
|
|
32
|
+
var ListItemContext = require('../ListItemContext.js');
|
|
33
|
+
|
|
34
|
+
const Prompt = ({
|
|
35
|
+
sentiment: sentiment$1 = sentiment.Sentiment.NEUTRAL,
|
|
36
|
+
children
|
|
37
|
+
}) => {
|
|
38
|
+
const {
|
|
39
|
+
ids
|
|
40
|
+
} = React.useContext(ListItemContext.ListItemContext);
|
|
41
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
42
|
+
id: ids.prompt,
|
|
43
|
+
className: clsx.clsx('wds-list-item-prompt', sentiment$1),
|
|
44
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
45
|
+
className: "np-prompt-icon",
|
|
46
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
|
|
47
|
+
size: 16,
|
|
48
|
+
sentiment: sentiment$1
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
51
|
+
children: children
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
Prompt.displayName = 'ListItem.Prompt';
|
|
56
|
+
|
|
57
|
+
exports.Prompt = Prompt;
|
|
58
|
+
exports.default = Prompt;
|
|
59
|
+
//# sourceMappingURL=ListItemPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { clsx } from 'clsx';\nimport { Sentiment } from '../../common';\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\n\nexport type ListItemPromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n children: React.ReactNode;\n};\n\n/**\n * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({ sentiment = Sentiment.NEUTRAL, children }: ListItemPromptProps) => {\n const { ids } = useContext<ListItemContextData>(ListItemContext);\n\n return (\n <div id={ids.prompt} className={clsx('wds-list-item-prompt', sentiment)}>\n <div className=\"np-prompt-icon\">\n <StatusIcon size={16} sentiment={sentiment} />\n </div>\n <Body>{children}</Body>\n </div>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","children","ids","useContext","ListItemContext","_jsxs","id","prompt","className","clsx","_jsx","StatusIcon","size","Body","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,MAAM,GAAGA,CAAC;aAAEC,WAAS,GAAGC,mBAAS,CAACC,OAAO;AAAEC,EAAAA;AAAQ,CAAuB,KAAI;EACzF,MAAM;AAAEC,IAAAA;AAAG,GAAE,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;AAEhE,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;IAAKC,EAAE,EAAEJ,GAAG,CAACK,MAAO;AAACC,IAAAA,SAAS,EAAEC,SAAI,CAAC,sBAAsB,EAAEX,WAAS,CAAE;AAAAG,IAAAA,QAAA,gBACtES,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,gBAAgB;MAAAP,QAAA,eAC7BS,cAAA,CAACC,kBAAU,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;AAACd,QAAAA,SAAS,EAAEA;OAAU;AAC7C,KAAK,CACL,eAAAY,cAAA,CAACG,YAAI,EAAA;AAAAZ,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;AAEAJ,MAAM,CAACiB,WAAW,GAAG,iBAAiB;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import '../../common/theme.mjs';
|
|
4
|
+
import '../../common/direction.mjs';
|
|
5
|
+
import '../../common/propsValues/control.mjs';
|
|
6
|
+
import '../../common/propsValues/breakpoint.mjs';
|
|
7
|
+
import '../../common/propsValues/size.mjs';
|
|
8
|
+
import '../../common/propsValues/typography.mjs';
|
|
9
|
+
import '../../common/propsValues/width.mjs';
|
|
10
|
+
import '../../common/propsValues/type.mjs';
|
|
11
|
+
import '../../common/propsValues/dateMode.mjs';
|
|
12
|
+
import '../../common/propsValues/monthFormat.mjs';
|
|
13
|
+
import '../../common/propsValues/position.mjs';
|
|
14
|
+
import '../../common/propsValues/layouts.mjs';
|
|
15
|
+
import '../../common/propsValues/status.mjs';
|
|
16
|
+
import { Sentiment } from '../../common/propsValues/sentiment.mjs';
|
|
17
|
+
import '../../common/propsValues/profileType.mjs';
|
|
18
|
+
import '../../common/propsValues/variant.mjs';
|
|
19
|
+
import '../../common/propsValues/scroll.mjs';
|
|
20
|
+
import '../../common/propsValues/markdownNodeType.mjs';
|
|
21
|
+
import '../../common/fileType.mjs';
|
|
22
|
+
import '@transferwise/icons';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
26
|
+
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
27
|
+
import Body from '../../body/Body.mjs';
|
|
28
|
+
import { ListItemContext } from '../ListItemContext.mjs';
|
|
29
|
+
|
|
30
|
+
const Prompt = ({
|
|
31
|
+
sentiment = Sentiment.NEUTRAL,
|
|
32
|
+
children
|
|
33
|
+
}) => {
|
|
34
|
+
const {
|
|
35
|
+
ids
|
|
36
|
+
} = useContext(ListItemContext);
|
|
37
|
+
return /*#__PURE__*/jsxs("div", {
|
|
38
|
+
id: ids.prompt,
|
|
39
|
+
className: clsx('wds-list-item-prompt', sentiment),
|
|
40
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
41
|
+
className: "np-prompt-icon",
|
|
42
|
+
children: /*#__PURE__*/jsx(StatusIcon, {
|
|
43
|
+
size: 16,
|
|
44
|
+
sentiment: sentiment
|
|
45
|
+
})
|
|
46
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
47
|
+
children: children
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
Prompt.displayName = 'ListItem.Prompt';
|
|
52
|
+
|
|
53
|
+
export { Prompt, Prompt as default };
|
|
54
|
+
//# sourceMappingURL=ListItemPrompt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { clsx } from 'clsx';\nimport { Sentiment } from '../../common';\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\n\nexport type ListItemPromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n children: React.ReactNode;\n};\n\n/**\n * This component allows for rendering an Inline Prompt. <br />In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({ sentiment = Sentiment.NEUTRAL, children }: ListItemPromptProps) => {\n const { ids } = useContext<ListItemContextData>(ListItemContext);\n\n return (\n <div id={ids.prompt} className={clsx('wds-list-item-prompt', sentiment)}>\n <div className=\"np-prompt-icon\">\n <StatusIcon size={16} sentiment={sentiment} />\n </div>\n <Body>{children}</Body>\n </div>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","children","ids","useContext","ListItemContext","_jsxs","id","prompt","className","clsx","_jsx","StatusIcon","size","Body","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,MAAM,GAAGA,CAAC;EAAEC,SAAS,GAAGC,SAAS,CAACC,OAAO;AAAEC,EAAAA;AAAQ,CAAuB,KAAI;EACzF,MAAM;AAAEC,IAAAA;AAAG,GAAE,GAAGC,UAAU,CAAsBC,eAAe,CAAC;AAEhE,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;IAAKC,EAAE,EAAEJ,GAAG,CAACK,MAAO;AAACC,IAAAA,SAAS,EAAEC,IAAI,CAAC,sBAAsB,EAAEX,SAAS,CAAE;AAAAG,IAAAA,QAAA,gBACtES,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,gBAAgB;MAAAP,QAAA,eAC7BS,GAAA,CAACC,UAAU,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;AAACd,QAAAA,SAAS,EAAEA;OAAU;AAC7C,KAAK,CACL,eAAAY,GAAA,CAACG,IAAI,EAAA;AAAAZ,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;AAEAJ,MAAM,CAACiB,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var RadioButton = require('../../common/RadioButton/RadioButton.js');
|
|
5
|
+
var useListItemControl = require('../useListItemControl.js');
|
|
6
|
+
var ListItemContext = require('../ListItemContext.js');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
const Radio = function (props) {
|
|
10
|
+
const {
|
|
11
|
+
baseItemProps
|
|
12
|
+
} = useListItemControl.useListItemControl('radio', {
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
const {
|
|
16
|
+
ids,
|
|
17
|
+
describedByIds
|
|
18
|
+
} = React.useContext(ListItemContext.ListItemContext);
|
|
19
|
+
return /*#__PURE__*/jsxRuntime.jsx(RadioButton.default, {
|
|
20
|
+
...props,
|
|
21
|
+
"aria-describedby": describedByIds,
|
|
22
|
+
className: "wds-list-item-control",
|
|
23
|
+
disabled: baseItemProps.disabled,
|
|
24
|
+
id: ids.control
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
Radio.displayName = 'ListItem.Radio';
|
|
28
|
+
|
|
29
|
+
exports.Radio = Radio;
|
|
30
|
+
//# sourceMappingURL=ListItemRadio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemRadio.js","sources":["../../../src/listItem/Radio/ListItemRadio.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport RadioButton, { type RadioButtonProps } from '../../common/RadioButton/RadioButton';\nimport { useListItemControl } from '../useListItemControl';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemRadioProps = Omit<\n RadioButtonProps,\n 'disabled' | 'readOnly' | 'className' | 'id'\n>;\n\n/**\n * This component allows for rendering a Button control. It's a thin wrapper around the\n * [Button component](https://storybook.wise.design/?path=/docs/content-button--docs), but offers only\n * a subset of its features in line with the ListItem's constraints. <br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.\n */\nexport const Radio = function (props: ListItemRadioProps) {\n const { baseItemProps } = useListItemControl('radio', { ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n\n return (\n <RadioButton\n {...props}\n aria-describedby={describedByIds}\n className=\"wds-list-item-control\"\n disabled={baseItemProps.disabled}\n id={ids.control}\n />\n );\n};\n\nRadio.displayName = 'ListItem.Radio';\n"],"names":["Radio","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","_jsx","RadioButton","className","disabled","id","control","displayName"],"mappings":";;;;;;;;MAiBaA,KAAK,GAAG,UAAUC,KAAyB,EAAA;EACtD,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,OAAO,EAAE;IAAE,GAAGF;AAAK,GAAE,CAAC;EACnE,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;EAE3D,oBACEC,cAAA,CAACC,mBAAW,EAAA;AAAA,IAAA,GACNR,KAAK;AACT,IAAA,kBAAA,EAAkBI,cAAe;AACjCK,IAAAA,SAAS,EAAC,uBAAuB;IACjCC,QAAQ,EAAET,aAAa,CAACS,QAAS;IACjCC,EAAE,EAAER,GAAG,CAACS;AAAQ,GAAA,CAChB;AAEN;AAEAb,KAAK,CAACc,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import RadioButton from '../../common/RadioButton/RadioButton.mjs';
|
|
3
|
+
import { useListItemControl } from '../useListItemControl.mjs';
|
|
4
|
+
import { ListItemContext } from '../ListItemContext.mjs';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const Radio = function (props) {
|
|
8
|
+
const {
|
|
9
|
+
baseItemProps
|
|
10
|
+
} = useListItemControl('radio', {
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
const {
|
|
14
|
+
ids,
|
|
15
|
+
describedByIds
|
|
16
|
+
} = useContext(ListItemContext);
|
|
17
|
+
return /*#__PURE__*/jsx(RadioButton, {
|
|
18
|
+
...props,
|
|
19
|
+
"aria-describedby": describedByIds,
|
|
20
|
+
className: "wds-list-item-control",
|
|
21
|
+
disabled: baseItemProps.disabled,
|
|
22
|
+
id: ids.control
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Radio.displayName = 'ListItem.Radio';
|
|
26
|
+
|
|
27
|
+
export { Radio };
|
|
28
|
+
//# sourceMappingURL=ListItemRadio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemRadio.mjs","sources":["../../../src/listItem/Radio/ListItemRadio.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport RadioButton, { type RadioButtonProps } from '../../common/RadioButton/RadioButton';\nimport { useListItemControl } from '../useListItemControl';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemRadioProps = Omit<\n RadioButtonProps,\n 'disabled' | 'readOnly' | 'className' | 'id'\n>;\n\n/**\n * This component allows for rendering a Button control. It's a thin wrapper around the\n * [Button component](https://storybook.wise.design/?path=/docs/content-button--docs), but offers only\n * a subset of its features in line with the ListItem's constraints. <br />\n * <br />\n * Please refer to the [Design documentation](https://wise.design/components/list-item---button) for details.\n */\nexport const Radio = function (props: ListItemRadioProps) {\n const { baseItemProps } = useListItemControl('radio', { ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n\n return (\n <RadioButton\n {...props}\n aria-describedby={describedByIds}\n className=\"wds-list-item-control\"\n disabled={baseItemProps.disabled}\n id={ids.control}\n />\n );\n};\n\nRadio.displayName = 'ListItem.Radio';\n"],"names":["Radio","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","_jsx","RadioButton","className","disabled","id","control","displayName"],"mappings":";;;;;;MAiBaA,KAAK,GAAG,UAAUC,KAAyB,EAAA;EACtD,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,OAAO,EAAE;IAAE,GAAGF;AAAK,GAAE,CAAC;EACnE,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;EAE3D,oBACEC,GAAA,CAACC,WAAW,EAAA;AAAA,IAAA,GACNR,KAAK;AACT,IAAA,kBAAA,EAAkBI,cAAe;AACjCK,IAAAA,SAAS,EAAC,uBAAuB;IACjCC,QAAQ,EAAET,aAAa,CAACS,QAAS;IACjCC,EAAE,EAAER,GAAG,CAACS;AAAQ,GAAA,CAChB;AAEN;AAEAb,KAAK,CAACc,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Switch$1 = require('../../switch/Switch.js');
|
|
5
|
+
var useListItemControl = require('../useListItemControl.js');
|
|
6
|
+
var ListItemContext = require('../ListItemContext.js');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
const Switch = function (props) {
|
|
10
|
+
const {
|
|
11
|
+
baseItemProps
|
|
12
|
+
} = useListItemControl.useListItemControl('switch', {
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
const {
|
|
16
|
+
ids,
|
|
17
|
+
describedByIds
|
|
18
|
+
} = React.useContext(ListItemContext.ListItemContext);
|
|
19
|
+
return /*#__PURE__*/jsxRuntime.jsx(Switch$1.default, {
|
|
20
|
+
...props,
|
|
21
|
+
"aria-describedby": describedByIds,
|
|
22
|
+
className: "wds-list-item-control",
|
|
23
|
+
disabled: baseItemProps.disabled,
|
|
24
|
+
id: ids.control
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
Switch.displayName = 'ListItem.Switch';
|
|
28
|
+
|
|
29
|
+
exports.Switch = Switch;
|
|
30
|
+
//# sourceMappingURL=ListItemSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSwitch.js","sources":["../../../src/listItem/Switch/ListItemSwitch.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport SwitchComp, { type SwitchProps } from '../../switch';\nimport { useListItemControl } from '../useListItemControl';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemSwitchProps = Omit<\n SwitchProps,\n 'disabled' | 'id' | 'aria-labelledby' | 'aria-label'\n>;\n\n/**\n * This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the\n * [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),\n * but offers only a subset of its features in line with the ListItem's constraints. <br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.\n */\nexport const Switch = function (props: ListItemSwitchProps) {\n const { baseItemProps } = useListItemControl('switch', { ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n\n return (\n <SwitchComp\n {...props}\n aria-describedby={describedByIds}\n className=\"wds-list-item-control\"\n disabled={baseItemProps.disabled}\n id={ids.control}\n />\n );\n};\n\nSwitch.displayName = 'ListItem.Switch';\n"],"names":["Switch","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","_jsx","SwitchComp","className","disabled","id","control","displayName"],"mappings":";;;;;;;;MAiBaA,MAAM,GAAG,UAAUC,KAA0B,EAAA;EACxD,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,qCAAkB,CAAC,QAAQ,EAAE;IAAE,GAAGF;AAAK,GAAE,CAAC;EACpE,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;EAE3D,oBACEC,cAAA,CAACC,gBAAU,EAAA;AAAA,IAAA,GACLR,KAAK;AACT,IAAA,kBAAA,EAAkBI,cAAe;AACjCK,IAAAA,SAAS,EAAC,uBAAuB;IACjCC,QAAQ,EAAET,aAAa,CAACS,QAAS;IACjCC,EAAE,EAAER,GAAG,CAACS;AAAQ,GAAA,CAChB;AAEN;AAEAb,MAAM,CAACc,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import Switch$1 from '../../switch/Switch.mjs';
|
|
3
|
+
import { useListItemControl } from '../useListItemControl.mjs';
|
|
4
|
+
import { ListItemContext } from '../ListItemContext.mjs';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const Switch = function (props) {
|
|
8
|
+
const {
|
|
9
|
+
baseItemProps
|
|
10
|
+
} = useListItemControl('switch', {
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
const {
|
|
14
|
+
ids,
|
|
15
|
+
describedByIds
|
|
16
|
+
} = useContext(ListItemContext);
|
|
17
|
+
return /*#__PURE__*/jsx(Switch$1, {
|
|
18
|
+
...props,
|
|
19
|
+
"aria-describedby": describedByIds,
|
|
20
|
+
className: "wds-list-item-control",
|
|
21
|
+
disabled: baseItemProps.disabled,
|
|
22
|
+
id: ids.control
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Switch.displayName = 'ListItem.Switch';
|
|
26
|
+
|
|
27
|
+
export { Switch };
|
|
28
|
+
//# sourceMappingURL=ListItemSwitch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSwitch.mjs","sources":["../../../src/listItem/Switch/ListItemSwitch.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport SwitchComp, { type SwitchProps } from '../../switch';\nimport { useListItemControl } from '../useListItemControl';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemSwitchProps = Omit<\n SwitchProps,\n 'disabled' | 'id' | 'aria-labelledby' | 'aria-label'\n>;\n\n/**\n * This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the\n * [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),\n * but offers only a subset of its features in line with the ListItem's constraints. <br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.\n */\nexport const Switch = function (props: ListItemSwitchProps) {\n const { baseItemProps } = useListItemControl('switch', { ...props });\n const { ids, describedByIds } = useContext(ListItemContext);\n\n return (\n <SwitchComp\n {...props}\n aria-describedby={describedByIds}\n className=\"wds-list-item-control\"\n disabled={baseItemProps.disabled}\n id={ids.control}\n />\n );\n};\n\nSwitch.displayName = 'ListItem.Switch';\n"],"names":["Switch","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","_jsx","SwitchComp","className","disabled","id","control","displayName"],"mappings":";;;;;;MAiBaA,MAAM,GAAG,UAAUC,KAA0B,EAAA;EACxD,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,QAAQ,EAAE;IAAE,GAAGF;AAAK,GAAE,CAAC;EACpE,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;EAE3D,oBACEC,GAAA,CAACC,QAAU,EAAA;AAAA,IAAA,GACLR,KAAK;AACT,IAAA,kBAAA,EAAkBI,cAAe;AACjCK,IAAAA,SAAS,EAAC,uBAAuB;IACjCC,QAAQ,EAAET,aAAa,CAACS,QAAS;IACjCC,EAAE,EAAER,GAAG,CAACS;AAAQ,GAAA,CAChB;AAEN;AAEAb,MAAM,CAACc,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var ListItemContext = require('./ListItemContext.js');
|
|
5
|
+
|
|
6
|
+
function useListItemControl(controlType, controlProps) {
|
|
7
|
+
const {
|
|
8
|
+
setControlType,
|
|
9
|
+
setControlProps,
|
|
10
|
+
props: baseItemProps
|
|
11
|
+
} = React.useContext(ListItemContext.ListItemContext);
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
setControlType(controlType);
|
|
14
|
+
setControlProps(controlProps);
|
|
15
|
+
}, [controlType, controlProps, setControlType, setControlProps]);
|
|
16
|
+
return {
|
|
17
|
+
baseItemProps
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.useListItemControl = useListItemControl;
|
|
22
|
+
//# sourceMappingURL=useListItemControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListItemControl.js","sources":["../../src/listItem/useListItemControl.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { ListItemContext, type ListItemContextData } from './ListItemContext';\nimport type { ListItemTypes, ListItemControlProps } from './ListItem';\n\nexport function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps) {\n const {\n setControlType,\n setControlProps,\n props: baseItemProps,\n } = useContext<ListItemContextData>(ListItemContext);\n\n useEffect(() => {\n setControlType(controlType);\n setControlProps(controlProps);\n }, [controlType, controlProps, setControlType, setControlProps]);\n\n return { baseItemProps };\n}\n"],"names":["useListItemControl","controlType","controlProps","setControlType","setControlProps","props","baseItemProps","useContext","ListItemContext","useEffect"],"mappings":";;;;;AAIM,SAAUA,kBAAkBA,CAACC,WAA0B,EAAEC,YAAkC,EAAA;EAC/F,MAAM;IACJC,cAAc;IACdC,eAAe;AACfC,IAAAA,KAAK,EAAEC;AAAa,GACrB,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;AAEpDC,EAAAA,eAAS,CAAC,MAAK;IACbN,cAAc,CAACF,WAAW,CAAC;IAC3BG,eAAe,CAACF,YAAY,CAAC;EAC/B,CAAC,EAAE,CAACD,WAAW,EAAEC,YAAY,EAAEC,cAAc,EAAEC,eAAe,CAAC,CAAC;EAEhE,OAAO;AAAEE,IAAAA;GAAe;AAC1B;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useContext, useEffect } from 'react';
|
|
2
|
+
import { ListItemContext } from './ListItemContext.mjs';
|
|
3
|
+
|
|
4
|
+
function useListItemControl(controlType, controlProps) {
|
|
5
|
+
const {
|
|
6
|
+
setControlType,
|
|
7
|
+
setControlProps,
|
|
8
|
+
props: baseItemProps
|
|
9
|
+
} = useContext(ListItemContext);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setControlType(controlType);
|
|
12
|
+
setControlProps(controlProps);
|
|
13
|
+
}, [controlType, controlProps, setControlType, setControlProps]);
|
|
14
|
+
return {
|
|
15
|
+
baseItemProps
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useListItemControl };
|
|
20
|
+
//# sourceMappingURL=useListItemControl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListItemControl.mjs","sources":["../../src/listItem/useListItemControl.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { ListItemContext, type ListItemContextData } from './ListItemContext';\nimport type { ListItemTypes, ListItemControlProps } from './ListItem';\n\nexport function useListItemControl(controlType: ListItemTypes, controlProps: ListItemControlProps) {\n const {\n setControlType,\n setControlProps,\n props: baseItemProps,\n } = useContext<ListItemContextData>(ListItemContext);\n\n useEffect(() => {\n setControlType(controlType);\n setControlProps(controlProps);\n }, [controlType, controlProps, setControlType, setControlProps]);\n\n return { baseItemProps };\n}\n"],"names":["useListItemControl","controlType","controlProps","setControlType","setControlProps","props","baseItemProps","useContext","ListItemContext","useEffect"],"mappings":";;;AAIM,SAAUA,kBAAkBA,CAACC,WAA0B,EAAEC,YAAkC,EAAA;EAC/F,MAAM;IACJC,cAAc;IACdC,eAAe;AACfC,IAAAA,KAAK,EAAEC;AAAa,GACrB,GAAGC,UAAU,CAAsBC,eAAe,CAAC;AAEpDC,EAAAA,SAAS,CAAC,MAAK;IACbN,cAAc,CAACF,WAAW,CAAC;IAC3BG,eAAe,CAACF,YAAY,CAAC;EAC/B,CAAC,EAAE,CAACD,WAAW,EAAEC,YAAY,EAAEC,cAAc,EAAEC,eAAe,CAAC,CAAC;EAEhE,OAAO;AAAEE,IAAAA;GAAe;AAC1B;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;"}
|