@toptal/picasso-list 4.0.0 → 5.0.0
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.
|
@@ -6,10 +6,6 @@ export declare type Props = BaseProps & {
|
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
index?: number;
|
|
8
8
|
variant?: Variant;
|
|
9
|
-
/**
|
|
10
|
-
* @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
|
|
11
|
-
**/
|
|
12
|
-
icon?: ReactNode;
|
|
13
9
|
/** Style of the bullet/ordinal */
|
|
14
10
|
type?: ListItemType;
|
|
15
11
|
isLastElement?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAMvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAa5C,oBAAY,KAAK,GAAG,SAAS,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,QAAQ;YAAW,KAAK;;CA0BpC,CAAA;AAID,eAAe,QAAQ,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Container } from '@toptal/picasso-container';
|
|
3
3
|
import { Typography } from '@toptal/picasso-typography';
|
|
4
|
-
import { usePropDeprecationWarning } from '@toptal/picasso-utils';
|
|
5
4
|
import { ArrowLongRight16, Check16 } from '@toptal/picasso-icons';
|
|
6
5
|
import { twJoin } from '@toptal/picasso-tailwind-merge';
|
|
7
6
|
import { useListContext } from '../List';
|
|
@@ -18,13 +17,8 @@ const resolveIcon = (type) => {
|
|
|
18
17
|
};
|
|
19
18
|
export const ListItem = (props) => {
|
|
20
19
|
const { styleType: parentType } = useListContext();
|
|
21
|
-
const { children, type,
|
|
22
|
-
|
|
23
|
-
usePropDeprecationWarning({
|
|
24
|
-
props,
|
|
25
|
-
componentName: ListItem.name,
|
|
26
|
-
name: 'icon',
|
|
27
|
-
});
|
|
20
|
+
const { children, type, 'data-testid': testId } = props;
|
|
21
|
+
const icon = resolveIcon(type !== null && type !== void 0 ? type : parentType);
|
|
28
22
|
return (React.createElement("li", { className: twJoin(icon && 'list-none -ml-[1.375rem]', type && listStyleTypeClass[type]), "data-testid": testId },
|
|
29
23
|
React.createElement(Container, { flex: true, direction: 'row', className: 'mt-1' },
|
|
30
24
|
icon && (React.createElement(Container, { inline: true, justifyContent: 'flex-end' }, icon)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AAA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E,EAAC,KAAK,EAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,MAAM,IAChD,QAAQ,CACE,CACH,CACT,CACN,CAAA;AACH,CAAC,CAAA;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA;AAEjC,eAAe,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@ import type { ReactNode } from 'react'
|
|
|
3
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
4
4
|
import { Container } from '@toptal/picasso-container'
|
|
5
5
|
import { Typography } from '@toptal/picasso-typography'
|
|
6
|
-
import { usePropDeprecationWarning } from '@toptal/picasso-utils'
|
|
7
6
|
import { ArrowLongRight16, Check16 } from '@toptal/picasso-icons'
|
|
8
7
|
import { twJoin } from '@toptal/picasso-tailwind-merge'
|
|
9
8
|
|
|
@@ -27,10 +26,6 @@ export type Props = BaseProps & {
|
|
|
27
26
|
children: ReactNode
|
|
28
27
|
index?: number
|
|
29
28
|
variant?: Variant
|
|
30
|
-
/**
|
|
31
|
-
* @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
|
|
32
|
-
**/
|
|
33
|
-
icon?: ReactNode
|
|
34
29
|
/** Style of the bullet/ordinal */
|
|
35
30
|
type?: ListItemType
|
|
36
31
|
isLastElement?: boolean
|
|
@@ -38,19 +33,9 @@ export type Props = BaseProps & {
|
|
|
38
33
|
|
|
39
34
|
export const ListItem = (props: Props) => {
|
|
40
35
|
const { styleType: parentType } = useListContext()
|
|
41
|
-
const {
|
|
42
|
-
children,
|
|
43
|
-
type,
|
|
44
|
-
icon = resolveIcon(type ?? parentType),
|
|
45
|
-
'data-testid': testId,
|
|
46
|
-
} = props
|
|
36
|
+
const { children, type, 'data-testid': testId } = props
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
usePropDeprecationWarning({
|
|
50
|
-
props,
|
|
51
|
-
componentName: ListItem.name,
|
|
52
|
-
name: 'icon',
|
|
53
|
-
})
|
|
38
|
+
const icon = resolveIcon(type ?? parentType)
|
|
54
39
|
|
|
55
40
|
return (
|
|
56
41
|
<li
|