Skip to content

Commit

Permalink
[FX-4717] Delete icon property (#4530)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashuk authored Sep 6, 2024
1 parent ffb935b commit 8a29ff0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
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
'@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

0 comments on commit 8a29ff0

Please sign in to comment.