Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FX-4717] Delete icon property #4530

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/quiet-coins-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@toptal/picasso-list': major
sashuk marked this conversation as resolved.
Show resolved Hide resolved
'@toptal/picasso': major
---

### ListItem

- breaking change: `icon` property no longer exists. If your project uses it, please contact the BASE Team to confirm that it should be added to the component.
19 changes: 2 additions & 17 deletions packages/base/List/src/ListItem/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { ReactNode } from 'react'
import type { BaseProps } from '@toptal/picasso-shared'
import { Container } from '@toptal/picasso-container'
import { Typography } from '@toptal/picasso-typography'
import { usePropDeprecationWarning } from '@toptal/picasso-utils'
import { ArrowLongRight16, Check16 } from '@toptal/picasso-icons'
import { twJoin } from '@toptal/picasso-tailwind-merge'

Expand All @@ -27,30 +26,16 @@ export type Props = BaseProps & {
children: ReactNode
index?: number
variant?: Variant
/**
* @deprecated [FX-4717] if you need a custom icon that is not available on the prop `type`, please contact the BASE team to add it to the theme
**/
icon?: ReactNode
/** Style of the bullet/ordinal */
type?: ListItemType
isLastElement?: boolean
}

export const ListItem = (props: Props) => {
const { styleType: parentType } = useListContext()
const {
children,
type,
icon = resolveIcon(type ?? parentType),
'data-testid': testId,
} = props
const { children, type, 'data-testid': testId } = props

// TODO: [FX-4717]
usePropDeprecationWarning({
props,
componentName: ListItem.name,
name: 'icon',
})
const icon = resolveIcon(type ?? parentType)

return (
<li
Expand Down
Loading