@transferwise/components 0.0.0-experimental-a12c97e → 0.0.0-experimental-302d967
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +2 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +2 -0
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.js +2 -0
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.mjs +2 -0
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
- package/build/listItem/Image/ListItemImage.js +6 -2
- package/build/listItem/Image/ListItemImage.js.map +1 -1
- package/build/listItem/Image/ListItemImage.mjs +6 -2
- package/build/listItem/Image/ListItemImage.mjs.map +1 -1
- package/build/listItem/ListItem.js +16 -14
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +16 -14
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/ListItemContext.js.map +1 -1
- package/build/listItem/ListItemContext.mjs.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.js +1 -1
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
- package/build/listItem/_stories/images/landscape.svg +1 -0
- package/build/listItem/_stories/images/portrait.svg +1 -0
- package/build/listItem/useListItemMedia.js +21 -0
- package/build/listItem/useListItemMedia.js.map +1 -0
- package/build/listItem/useListItemMedia.mjs +19 -0
- package/build/listItem/useListItemMedia.mjs.map +1 -0
- package/build/main.css +64 -101
- package/build/styles/avatarView/AvatarView.css +1 -3
- package/build/styles/listItem/ListItem.css +63 -98
- package/build/styles/listItem/ListItem.grid.css +17 -11
- package/build/styles/main.css +64 -101
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs.map +1 -1
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -1
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/listItem/ListItemContext.d.ts +4 -0
- package/build/types/listItem/ListItemContext.d.ts.map +1 -1
- package/build/types/listItem/test-utils.d.ts +7 -0
- package/build/types/listItem/test-utils.d.ts.map +1 -0
- package/build/types/listItem/useListItemMedia.d.ts +6 -0
- package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
- package/build/types/switch/Switch.d.ts +1 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatarView/AvatarView.css +1 -3
- package/src/avatarView/AvatarView.less +1 -2
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +8 -58
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -3
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +3 -0
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +3 -21
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +3 -0
- package/src/listItem/Button/ListItemButton.spec.tsx +10 -35
- package/src/listItem/Button/ListItemButton.story.tsx +37 -95
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -18
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +2 -15
- package/src/listItem/Image/ListItemImage.spec.tsx +8 -5
- package/src/listItem/Image/ListItemImage.story.tsx +23 -6
- package/src/listItem/Image/ListItemImage.tsx +12 -4
- package/src/listItem/ListItem.css +63 -98
- package/src/listItem/ListItem.grid.css +17 -11
- package/src/listItem/ListItem.grid.less +24 -16
- package/src/listItem/ListItem.less +60 -113
- package/src/listItem/ListItem.tsx +24 -18
- package/src/listItem/ListItemContext.tsx +5 -0
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +2 -5
- package/src/listItem/Navigation/ListItemNavigation.tsx +1 -1
- package/src/listItem/Radio/ListItemRadio.story.tsx +0 -10
- package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -8
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +142 -2
- package/src/listItem/_stories/ListItem.story.tsx +141 -243
- package/src/listItem/_stories/ListItem.variants.test.story.tsx +7 -2
- package/src/listItem/_stories/images/landscape.svg +1 -0
- package/src/listItem/_stories/images/portrait.svg +1 -0
- package/src/listItem/test-utils.tsx +33 -0
- package/src/listItem/useListItemMedia.tsx +13 -0
- package/src/main.css +64 -101
- package/src/switch/Switch.tsx +1 -1
- package/build/types/listItem/_stories/helpers.d.ts +0 -27
- package/build/types/listItem/_stories/helpers.d.ts.map +0 -1
- package/src/listItem/_stories/ListItem.scenarios.story.tsx +0 -209
- package/src/listItem/_stories/helpers.tsx +0 -53
|
@@ -1 +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 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 { ListItemContext, type ListItemContextData } 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 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 ids,\n props: { disabled, inverted },\n describedByIds,\n }),\n [describedByIds],\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 {(() => {\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 })}\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 >\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 'align-items-center': !subtitle,\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\n className={clsx('wds-list-item-view d-flex flex-row', {\n 'align-items-center': !subtitle,\n })}\n >\n {children}\n </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 'align-items-center': !subtitle,\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","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;AAmGO,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;AACV,EAAA,MAAMC,QAAQ,GAAGC,KAAK,EAAE;EACxB,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAAuB,EAAE,CAAC;EAC1E,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,QAAQ,CAAgB,iBAAiB,CAAC;AAChF,EAAA,MAAMG,GAAG,GAA+B;IACtCvB,KAAK,EAA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AG,CAACd,OAAQ;AACrBE,MAAAA,SAAS,EAAEyC,IAAI,CAAC,oBAAoB,EAAE;QACpC,oBAAoB,EAAE,CAACnD,QAAQ;QAC/BwE,SAAS,EAAE,CAAC/D,QAAQ;AACpBgE,QAAAA,gBAAgB,EAAE,CAAClD;AACpB,OAAA,CAAE;AAAA0B,MAAAA,QAAA,EAEFA;AAAQ,KACJ,CAEP,EAACiB,YAAY,EAAE;AAAA,GACH,CAAC;AAEnB;AAEAtE,QAAQ,CAAC8E,KAAK,GAAGA,KAAK;AACtB9E,QAAQ,CAAC+E,UAAU,GAAGA,UAAU;AAChC/E,QAAQ,CAACgF,YAAY,GAAGA,YAAY;AACpChF,QAAQ,CAACiF,cAAc,GAAGA,cAAc;AACxCjF,QAAQ,CAACkF,QAAQ,GAAGA,QAAQ;AAC5BlF,QAAQ,CAACmF,KAAK,GAAGA,KAAK;AACtBnF,QAAQ,CAACoF,UAAU,GAAGA,UAAU;AAChCpF,QAAQ,CAACqF,UAAU,GAAGA,UAAU;AAChCrF,QAAQ,CAACsF,MAAM,GAAGA,MAAM;AACxBtF,QAAQ,CAACuF,MAAM,GAAGA,MAAM;AACxBvF,QAAQ,CAACwF,MAAM,GAAGA,MAAM;;;;"}
|
|
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 <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","clsx","_jsxs","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;AACV,EAAA,MAAMC,QAAQ,G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AAY,EAAE;AAAA,KACZ,CAAC;AAEV,EAAA;AAEA;AACA;EACA,MAAMI,YAAY,GAAGpD,WAAW,KAAK,OAAO,GAAG,KAAK,GAAG,UAAU;EACjE,oBACEiC,IAAA,CAACmB,YAAY,EAAA;AAAC9D,IAAAA,SAAS,EAAE0C,IAAI,CAAC,2BAA2B,EAAE1C,SAAS,CAAE;AAAAyC,IAAAA,QAAA,gBACpEJ,GAAA,CAAA,OAAA,EAAA;MACE0B,OAAO,EAAEjD,GAAG,CAAChB,OAAQ;AACrBE,MAAAA,SAAS,EAAE0C,IAAI,CAAC,oBAAoB,EAAE;QACpCsB,SAAS,EAAE,CAACjE,QAAQ;AACpBkE,QAAAA,gBAAgB,EAAE,CAAClD;AACpB,OAAA,CAAE;AAAA0B,MAAAA,QAAA,EAEFA;AAAQ,KACJ,CAEP,EAACiB,YAAY,EAAE;AAAA,GACH,CAAC;AAEnB;AAEAxE,QAAQ,CAACgF,KAAK,GAAGA,KAAK;AACtBhF,QAAQ,CAACiF,UAAU,GAAGA,UAAU;AAChCjF,QAAQ,CAACkF,YAAY,GAAGA,YAAY;AACpClF,QAAQ,CAACmF,cAAc,GAAGA,cAAc;AACxCnF,QAAQ,CAACoF,QAAQ,GAAGA,QAAQ;AAC5BpF,QAAQ,CAACqF,KAAK,GAAGA,KAAK;AACtBrF,QAAQ,CAACsF,UAAU,GAAGA,UAAU;AAChCtF,QAAQ,CAACuF,UAAU,GAAGA,UAAU;AAChCvF,QAAQ,CAACwF,MAAM,GAAGA,MAAM;AACxBxF,QAAQ,CAACyF,MAAM,GAAGA,MAAM;AACxBzF,QAAQ,CAAC0F,MAAM,GAAGA,MAAM;;;;"}
|
|
@@ -1 +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';\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => 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 describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;;;
|
|
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;;;;"}
|
|
@@ -1 +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';\n\nexport type ListItemContextData = {\n setControlType: (type: ListItemTypes) => void;\n setControlProps: (props: ListItemControlProps) => 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 describedByIds: string;\n};\n\nexport const ListItemContext = createContext<ListItemContextData>(\n null as unknown as ListItemContextData,\n);\n"],"names":["ListItemContext","createContext"],"mappings":";;
|
|
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;;;;"}
|
|
@@ -24,7 +24,7 @@ const Navigation = function Navigation({
|
|
|
24
24
|
} = React.useContext(ListItemContext.ListItemContext);
|
|
25
25
|
const isLink = href !== '#';
|
|
26
26
|
const icon = /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
|
|
27
|
-
size:
|
|
27
|
+
size: 16
|
|
28
28
|
});
|
|
29
29
|
if (baseItemProps.disabled) return /*#__PURE__*/jsxRuntime.jsx(icons.BackslashCircle, {
|
|
30
30
|
size: 24
|
|
@@ -1 +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={
|
|
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;;;;"}
|
|
@@ -22,7 +22,7 @@ const Navigation = function Navigation({
|
|
|
22
22
|
} = useContext(ListItemContext);
|
|
23
23
|
const isLink = href !== '#';
|
|
24
24
|
const icon = /*#__PURE__*/jsx(ChevronRight, {
|
|
25
|
-
size:
|
|
25
|
+
size: 16
|
|
26
26
|
});
|
|
27
27
|
if (baseItemProps.disabled) return /*#__PURE__*/jsx(BackslashCircle, {
|
|
28
28
|
size: 24
|
|
@@ -1 +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={
|
|
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 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 112 80"><path fill="#9FE870" stroke="#163300" stroke-width="2" d="M1 79V1h110v78z"/><path fill="#163300" stroke="#163300" stroke-width="2" d="M74.2 21.4 60.9 58h-5.8l11.1-30.8.5-1.3H48.6l.8 1.5 3 5.2-4.7 5.5-1.4 1.7h9.1l-1.4 4H37.3l9.5-11.2 1.4-1.6h-1.5L41 21.4h33.1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 80 112"><path fill="#9FE870" stroke="#163300" stroke-width="2" d="M1 1h78v110H1z"/><path fill="#163300" stroke="#163300" stroke-width="2" d="M59 37 45.9 73.8H40l11-30.9.6-1.3H33.4l1 1.5 3 5.2-4.8 5.5-1.4 1.7h9.1l-1.5 4H22.2l9.5-11.2 1.4-1.6h-1.6L26 37h33Z"/></svg>
|
|
@@ -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;;;;"}
|
package/build/main.css
CHANGED
|
@@ -454,8 +454,7 @@
|
|
|
454
454
|
right: 0;
|
|
455
455
|
}
|
|
456
456
|
.np-avatar-view .np-avatar-view-content {
|
|
457
|
-
color:
|
|
458
|
-
color: var(--color-content-primary);
|
|
457
|
+
color: var(--color-interactive-primary);
|
|
459
458
|
}
|
|
460
459
|
.np-avatar-view-interactive {
|
|
461
460
|
cursor: pointer;
|
|
@@ -463,7 +462,6 @@
|
|
|
463
462
|
.np-avatar-view-interactive .np-circle {
|
|
464
463
|
background-color: rgba(134,167,189,0.10196);
|
|
465
464
|
background-color: var(--color-background-neutral);
|
|
466
|
-
color: var(--color-interactive-primary);
|
|
467
465
|
}
|
|
468
466
|
.np-avatar-view-non-interactive .np-circle {
|
|
469
467
|
background-color: transparent;
|
|
@@ -2642,21 +2640,21 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2642
2640
|
gap: 4px 16px;
|
|
2643
2641
|
gap: var(--size-4) var(--size-16);
|
|
2644
2642
|
}
|
|
2645
|
-
@container (min-width:
|
|
2643
|
+
@container (min-width: 375px) {
|
|
2646
2644
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2647
2645
|
grid-template-columns: auto 1fr auto;
|
|
2648
2646
|
grid-template-rows: auto auto auto;
|
|
2649
|
-
grid-template-areas: "media body control" "
|
|
2647
|
+
grid-template-areas: "media body control" ". info ." ". prompt prompt";
|
|
2650
2648
|
}
|
|
2651
2649
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-noPrompt {
|
|
2652
2650
|
grid-template-columns: auto 1fr auto;
|
|
2653
2651
|
grid-template-rows: auto auto;
|
|
2654
|
-
grid-template-areas: "media body control" "
|
|
2652
|
+
grid-template-areas: "media body control" ". info .";
|
|
2655
2653
|
}
|
|
2656
2654
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-hasPrompt {
|
|
2657
2655
|
grid-template-columns: auto 1fr auto;
|
|
2658
2656
|
grid-template-rows: auto auto;
|
|
2659
|
-
grid-template-areas: "media body control" "
|
|
2657
|
+
grid-template-areas: "media body control" ". prompt prompt";
|
|
2660
2658
|
}
|
|
2661
2659
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-noPrompt {
|
|
2662
2660
|
grid-template-columns: auto 1fr auto;
|
|
@@ -2666,17 +2664,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2666
2664
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
|
|
2667
2665
|
grid-template-columns: auto 1fr;
|
|
2668
2666
|
grid-template-rows: auto auto;
|
|
2669
|
-
grid-template-areas: "media body" "
|
|
2667
|
+
grid-template-areas: "media body" ". info" ". prompt";
|
|
2670
2668
|
}
|
|
2671
2669
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-noPrompt {
|
|
2672
2670
|
grid-template-columns: auto 1fr;
|
|
2673
2671
|
grid-template-rows: auto auto auto;
|
|
2674
|
-
grid-template-areas: "media body" "
|
|
2672
|
+
grid-template-areas: "media body" ". info";
|
|
2675
2673
|
}
|
|
2676
2674
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-hasPrompt {
|
|
2677
2675
|
grid-template-columns: auto 1fr;
|
|
2678
2676
|
grid-template-rows: auto auto;
|
|
2679
|
-
grid-template-areas: "media body" "
|
|
2677
|
+
grid-template-areas: "media body" ". prompt";
|
|
2680
2678
|
}
|
|
2681
2679
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-noPrompt {
|
|
2682
2680
|
grid-template-columns: auto 1fr;
|
|
@@ -2689,12 +2687,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2689
2687
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2690
2688
|
grid-template-columns: 1fr auto;
|
|
2691
2689
|
grid-template-rows: auto auto auto;
|
|
2692
|
-
grid-template-areas: "body control" "info
|
|
2690
|
+
grid-template-areas: "body control" "info ." "prompt prompt";
|
|
2693
2691
|
}
|
|
2694
2692
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-hasInfo-noPrompt {
|
|
2695
2693
|
grid-template-columns: 1fr auto;
|
|
2696
2694
|
grid-template-rows: auto auto;
|
|
2697
|
-
grid-template-areas: "body control" "info
|
|
2695
|
+
grid-template-areas: "body control" "info .";
|
|
2698
2696
|
}
|
|
2699
2697
|
.wds-list-item-gridWrapper.wds-list-item-noMedia-hasControl.wds-list-item-noInfo-hasPrompt {
|
|
2700
2698
|
grid-template-columns: 1fr auto;
|
|
@@ -2730,11 +2728,14 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2730
2728
|
grid-template-areas: "body";
|
|
2731
2729
|
}
|
|
2732
2730
|
}
|
|
2733
|
-
@container (min-width:
|
|
2731
|
+
@container (min-width: 297px) and (max-width: 375px) {
|
|
2734
2732
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
|
|
2735
2733
|
margin-bottom: 12px;
|
|
2736
2734
|
margin-bottom: var(--size-12);
|
|
2737
2735
|
}
|
|
2736
|
+
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media .wds-list-item-media-image {
|
|
2737
|
+
height: auto;
|
|
2738
|
+
}
|
|
2738
2739
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2739
2740
|
grid-template-columns: 1fr auto;
|
|
2740
2741
|
grid-template-rows: auto auto auto auto;
|
|
@@ -2775,6 +2776,9 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2775
2776
|
margin-bottom: 16px;
|
|
2776
2777
|
margin-bottom: var(--size-16);
|
|
2777
2778
|
}
|
|
2779
|
+
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media .wds-list-item-media-image {
|
|
2780
|
+
height: auto;
|
|
2781
|
+
}
|
|
2778
2782
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
|
|
2779
2783
|
grid-template-columns: auto auto;
|
|
2780
2784
|
grid-template-rows: auto auto auto auto;
|
|
@@ -2858,7 +2862,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2858
2862
|
grid-template-areas: "body";
|
|
2859
2863
|
}
|
|
2860
2864
|
}
|
|
2861
|
-
@container (max-width:
|
|
2865
|
+
@container (max-width: 297px) {
|
|
2862
2866
|
.wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
|
|
2863
2867
|
grid-template-columns: auto 1fr;
|
|
2864
2868
|
grid-template-rows: auto auto auto;
|
|
@@ -3005,8 +3009,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3005
3009
|
background-color: #ffffff;
|
|
3006
3010
|
background-color: var(--color-background-screen);
|
|
3007
3011
|
position: relative;
|
|
3008
|
-
padding: 12px
|
|
3009
|
-
padding: var(--size-12)
|
|
3012
|
+
padding: 12px;
|
|
3013
|
+
padding: var(--size-12);
|
|
3010
3014
|
container-type: inline-size;
|
|
3011
3015
|
}
|
|
3012
3016
|
.wds-list-item + .wds-list-item-spotlight,
|
|
@@ -3040,6 +3044,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3040
3044
|
.wds-list-item-interactive .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
|
|
3041
3045
|
outline: none;
|
|
3042
3046
|
}
|
|
3047
|
+
.wds-list-item-interactive:has(.wds-list-item-control:focus-visible),
|
|
3048
|
+
.wds-list-item-interactive:has(input[type="checkbox"]:focus-visible) {
|
|
3049
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3050
|
+
outline-offset: var(--ring-outline-offset);
|
|
3051
|
+
outline-offset: -1px;
|
|
3052
|
+
}
|
|
3043
3053
|
.wds-list-item-interactive .wds-list-item-additional-info {
|
|
3044
3054
|
--ring-outline-offset: 0;
|
|
3045
3055
|
}
|
|
@@ -3058,68 +3068,45 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3058
3068
|
position: absolute;
|
|
3059
3069
|
inset: 0;
|
|
3060
3070
|
}
|
|
3061
|
-
.wds-list-item-interactive
|
|
3062
|
-
.wds-list-item-interactive.wds-list-item-spotlight:has(input[type="checkbox"]:focus-visible) {
|
|
3063
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3064
|
-
outline-offset: var(--ring-outline-offset);
|
|
3065
|
-
outline-offset: -1px;
|
|
3066
|
-
}
|
|
3067
|
-
.wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
|
|
3071
|
+
.wds-list-item-interactive:not(.disabled):not(:disabled):hover {
|
|
3068
3072
|
background-color: var(--color-background-screen-hover);
|
|
3069
3073
|
}
|
|
3070
|
-
.wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
|
|
3071
|
-
background-color: var(--color-background-screen-active);
|
|
3072
|
-
}
|
|
3073
|
-
.wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
|
|
3074
|
-
background-color: transparent;
|
|
3075
|
-
background-color: initial;
|
|
3076
|
-
}
|
|
3077
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(.wds-list-item-control:focus-visible):before,
|
|
3078
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(input[type="checkbox"]:focus-visible):before {
|
|
3079
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
3080
|
-
outline-offset: var(--ring-outline-offset);
|
|
3081
|
-
content: '';
|
|
3082
|
-
position: absolute;
|
|
3083
|
-
inset: 0 -8px;
|
|
3084
|
-
border-radius: 16px;
|
|
3085
|
-
border-radius: var(--radius-medium);
|
|
3086
|
-
outline-offset: -1px;
|
|
3087
|
-
}
|
|
3088
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):hover:before,
|
|
3089
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):active:before {
|
|
3090
|
-
content: '';
|
|
3091
|
-
position: absolute;
|
|
3092
|
-
inset: 0 -8px;
|
|
3093
|
-
border-radius: 16px;
|
|
3094
|
-
border-radius: var(--radius-medium);
|
|
3095
|
-
}
|
|
3096
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):hover:before {
|
|
3097
|
-
background-color: var(--color-background-screen-hover);
|
|
3098
|
-
}
|
|
3099
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):not(.disabled):not(:disabled):active:before {
|
|
3100
|
-
background-color: var(--color-background-screen-active);
|
|
3101
|
-
}
|
|
3102
|
-
.wds-list-item-interactive:not(.wds-list-item-spotlight):has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover:before {
|
|
3103
|
-
background-color: transparent;
|
|
3104
|
-
background-color: initial;
|
|
3105
|
-
}
|
|
3106
3074
|
.wds-list-item-interactive:not(.disabled):not(:disabled):hover .wds-list-item-control-wrapper .wds-Button {
|
|
3107
3075
|
background-color: var(--Button-background-hover);
|
|
3108
3076
|
color: var(--Button-color-hover);
|
|
3109
3077
|
transition: none;
|
|
3110
3078
|
}
|
|
3079
|
+
.wds-list-item-interactive:not(.disabled):not(:disabled):active {
|
|
3080
|
+
background-color: var(--color-background-screen-active);
|
|
3081
|
+
}
|
|
3111
3082
|
.wds-list-item-interactive .wds-list-item-button-control .wds-Button {
|
|
3112
3083
|
transition: none;
|
|
3113
3084
|
}
|
|
3085
|
+
.wds-list-item-interactive:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
|
|
3086
|
+
background-color: transparent;
|
|
3087
|
+
background-color: initial;
|
|
3088
|
+
}
|
|
3114
3089
|
.wds-list-item-media {
|
|
3115
3090
|
grid-area: media;
|
|
3091
|
+
display: flex;
|
|
3092
|
+
align-items: center;
|
|
3093
|
+
}
|
|
3094
|
+
.wds-list-item-media-image-wrapper {
|
|
3095
|
+
width: var(--wds-list-item-media-size);
|
|
3096
|
+
height: var(--wds-list-item-media-size);
|
|
3097
|
+
display: flex;
|
|
3098
|
+
align-items: center;
|
|
3099
|
+
justify-content: center;
|
|
3116
3100
|
}
|
|
3117
3101
|
.wds-list-item-media-image {
|
|
3118
|
-
width:
|
|
3119
|
-
height:
|
|
3102
|
+
width: 100%;
|
|
3103
|
+
height: 100%;
|
|
3104
|
+
-o-object-fit: contain;
|
|
3105
|
+
object-fit: contain;
|
|
3120
3106
|
}
|
|
3121
3107
|
.wds-list-item-body {
|
|
3122
3108
|
grid-area: body;
|
|
3109
|
+
align-items: center;
|
|
3123
3110
|
width: 100%;
|
|
3124
3111
|
display: grid;
|
|
3125
3112
|
grid-template-columns: 1fr max-content;
|
|
@@ -3130,11 +3117,18 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3130
3117
|
gap: var(--size-16);
|
|
3131
3118
|
word-break: break-word;
|
|
3132
3119
|
}
|
|
3133
|
-
.wds-list-item-title
|
|
3134
|
-
.wds-list-item-title-value {
|
|
3120
|
+
.wds-list-item-title {
|
|
3135
3121
|
color: #37517e;
|
|
3136
3122
|
color: var(--color-content-primary);
|
|
3137
3123
|
}
|
|
3124
|
+
.wds-list-item-value {
|
|
3125
|
+
text-align: right;
|
|
3126
|
+
}
|
|
3127
|
+
.wds-list-item-body-center {
|
|
3128
|
+
display: flex;
|
|
3129
|
+
flex-direction: row;
|
|
3130
|
+
align-items: center;
|
|
3131
|
+
}
|
|
3138
3132
|
.wds-list-item-additional-info {
|
|
3139
3133
|
grid-area: info;
|
|
3140
3134
|
color: #768e9c;
|
|
@@ -3142,12 +3136,13 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3142
3136
|
margin-top: calc(4px * -1);
|
|
3143
3137
|
margin-top: calc(var(--size-4) * -1);
|
|
3144
3138
|
}
|
|
3145
|
-
.wds-list-item-value {
|
|
3146
|
-
align-items: end;
|
|
3147
|
-
text-align: right;
|
|
3148
|
-
}
|
|
3149
3139
|
.wds-list-item-control-wrapper {
|
|
3150
3140
|
grid-area: control;
|
|
3141
|
+
align-content: center;
|
|
3142
|
+
}
|
|
3143
|
+
.wds-list-item-navigation .tw-icon-chevron-right {
|
|
3144
|
+
color: #c9cbce;
|
|
3145
|
+
color: var(--color-interactive-secondary);
|
|
3151
3146
|
}
|
|
3152
3147
|
.wds-list-item-control {
|
|
3153
3148
|
flex: 0 0 auto;
|
|
@@ -3163,12 +3158,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3163
3158
|
color: #768e9c;
|
|
3164
3159
|
color: var(--color-content-tertiary);
|
|
3165
3160
|
}
|
|
3166
|
-
.wds-list-item-spotlight {
|
|
3167
|
-
padding-left: 12px;
|
|
3168
|
-
padding-left: var(--size-12);
|
|
3169
|
-
padding-right: 12px;
|
|
3170
|
-
padding-right: var(--size-12);
|
|
3171
|
-
}
|
|
3172
3161
|
.wds-list-item-spotlight-active {
|
|
3173
3162
|
background-color: rgba(134,167,189,0.10196);
|
|
3174
3163
|
background-color: var(--color-background-neutral);
|
|
@@ -3181,6 +3170,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3181
3170
|
}
|
|
3182
3171
|
.wds-list-item-spotlight-inactive {
|
|
3183
3172
|
background-color: rgba(134, 167, 189, 0.025);
|
|
3173
|
+
border: 1px dashed rgba(0,0,0,0.10196);
|
|
3174
|
+
border: 1px dashed var(--color-border-neutral);
|
|
3184
3175
|
}
|
|
3185
3176
|
@supports (color: color-mix(in lch, red, blue)) {
|
|
3186
3177
|
.wds-list-item-spotlight-inactive {
|
|
@@ -3193,34 +3184,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3193
3184
|
.wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
|
|
3194
3185
|
background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
|
|
3195
3186
|
}
|
|
3196
|
-
.wds-list-item .wds-list-item-spotlight__border {
|
|
3197
|
-
position: absolute;
|
|
3198
|
-
inset: 0;
|
|
3199
|
-
width: 100%;
|
|
3200
|
-
height: 100%;
|
|
3201
|
-
}
|
|
3202
|
-
.wds-list-item .wds-list-item-spotlight__border rect {
|
|
3203
|
-
--wds-list-item-spotlight-borderWidth: 1px;
|
|
3204
|
-
--wds-list-item-spotlight-borderWidthOffset: 0.5px;
|
|
3205
|
-
--wds-list-item-spotlight-strokeDashSize: calc(var(--size-12) * 0.5);
|
|
3206
|
-
fill: none;
|
|
3207
|
-
stroke: rgba(0,0,0,0.10196);
|
|
3208
|
-
stroke: var(--color-border-neutral);
|
|
3209
|
-
width: calc(100% - 1px);
|
|
3210
|
-
width: calc(100% - var(--wds-list-item-spotlight-borderWidth));
|
|
3211
|
-
height: calc(100% - 1px);
|
|
3212
|
-
height: calc(100% - var(--wds-list-item-spotlight-borderWidth));
|
|
3213
|
-
x: 0.5px;
|
|
3214
|
-
x: var(--wds-list-item-spotlight-borderWidthOffset);
|
|
3215
|
-
y: 0.5px;
|
|
3216
|
-
y: var(--wds-list-item-spotlight-borderWidthOffset);
|
|
3217
|
-
rx: calc(16px - 0.5px);
|
|
3218
|
-
rx: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
|
|
3219
|
-
ry: calc(16px - 0.5px);
|
|
3220
|
-
ry: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
|
|
3221
|
-
stroke-dasharray: calc(12px * 0.5) calc(12px * 0.5);
|
|
3222
|
-
stroke-dasharray: var(--wds-list-item-spotlight-strokeDashSize) var(--wds-list-item-spotlight-strokeDashSize);
|
|
3223
|
-
}
|
|
3224
3187
|
.wds-list-item-prompt {
|
|
3225
3188
|
grid-area: prompt;
|
|
3226
3189
|
display: inline-flex;
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
right: 0;
|
|
20
20
|
}
|
|
21
21
|
.np-avatar-view .np-avatar-view-content {
|
|
22
|
-
color:
|
|
23
|
-
color: var(--color-content-primary);
|
|
22
|
+
color: var(--color-interactive-primary);
|
|
24
23
|
}
|
|
25
24
|
.np-avatar-view-interactive {
|
|
26
25
|
cursor: pointer;
|
|
@@ -28,7 +27,6 @@
|
|
|
28
27
|
.np-avatar-view-interactive .np-circle {
|
|
29
28
|
background-color: rgba(134,167,189,0.10196);
|
|
30
29
|
background-color: var(--color-background-neutral);
|
|
31
|
-
color: var(--color-interactive-primary);
|
|
32
30
|
}
|
|
33
31
|
.np-avatar-view-non-interactive .np-circle {
|
|
34
32
|
background-color: transparent;
|