@moderneinc/neo-styled-components 4.0.0-next.557dc6 → 4.0.0-next.86aaff
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/dist/ListItem/ListItem.d.ts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.esm.js +12 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { type ListItemButtonProps } from '@mui/material/ListItemButton';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
declare module '@mui/material/ListItemButton' {
|
|
4
4
|
interface ListItemButtonPropsVariantOverrides {
|
|
5
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'
|
|
5
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -14,19 +14,19 @@ export interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' |
|
|
|
14
14
|
* @default "medium"
|
|
15
15
|
* @figma size
|
|
16
16
|
*/
|
|
17
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'
|
|
17
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
18
18
|
/**
|
|
19
19
|
* Primary text content (required)
|
|
20
20
|
* @figma Placeholder (primary text)
|
|
21
21
|
*/
|
|
22
22
|
primaryText: ReactNode;
|
|
23
23
|
/**
|
|
24
|
-
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge
|
|
24
|
+
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge)
|
|
25
25
|
* @figma Recipe name (secondary text)
|
|
26
26
|
*/
|
|
27
27
|
secondaryText?: ReactNode;
|
|
28
28
|
/**
|
|
29
|
-
* Badge content for count display (optional, for xxlarge
|
|
29
|
+
* Badge content for count display (optional, for xxlarge link variant)
|
|
30
30
|
* @figma (# recipes)
|
|
31
31
|
*/
|
|
32
32
|
badge?: ReactNode;
|
|
@@ -57,14 +57,14 @@ export interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' |
|
|
|
57
57
|
/**
|
|
58
58
|
* NeoListItem - Flexible list item component with multiple size variants and states
|
|
59
59
|
*
|
|
60
|
-
* A versatile list item component built on MUI's ListItemButton that supports
|
|
61
|
-
* (small to
|
|
60
|
+
* A versatile list item component built on MUI's ListItemButton that supports five size variants
|
|
61
|
+
* (small to xxlarge), interactive states (default, selected, disabled, link), and optional
|
|
62
62
|
* icons/logos, secondary text, and badges.
|
|
63
63
|
*
|
|
64
64
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4205-36442
|
|
65
65
|
*
|
|
66
66
|
* Figma Props Mapping:
|
|
67
|
-
* - size (
|
|
67
|
+
* - size (small|medium|large|xlarge|XXL) → size (small|medium|large|xlarge|xxlarge)
|
|
68
68
|
* - state (default|active|disabled|link) → selected, disabled, isLink props
|
|
69
69
|
* - showIcon → icon prop (pass ReactNode)
|
|
70
70
|
* - showSupportingText → secondaryText prop (pass ReactNode)
|
package/dist/index.d.ts
CHANGED
|
@@ -2429,7 +2429,7 @@ declare const NeoToolbar: {
|
|
|
2429
2429
|
|
|
2430
2430
|
declare module '@mui/material/ListItemButton' {
|
|
2431
2431
|
interface ListItemButtonPropsVariantOverrides {
|
|
2432
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'
|
|
2432
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
2435
|
/**
|
|
@@ -2441,19 +2441,19 @@ interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' | 'size'
|
|
|
2441
2441
|
* @default "medium"
|
|
2442
2442
|
* @figma size
|
|
2443
2443
|
*/
|
|
2444
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'
|
|
2444
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
2445
2445
|
/**
|
|
2446
2446
|
* Primary text content (required)
|
|
2447
2447
|
* @figma Placeholder (primary text)
|
|
2448
2448
|
*/
|
|
2449
2449
|
primaryText: ReactNode;
|
|
2450
2450
|
/**
|
|
2451
|
-
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge
|
|
2451
|
+
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge)
|
|
2452
2452
|
* @figma Recipe name (secondary text)
|
|
2453
2453
|
*/
|
|
2454
2454
|
secondaryText?: ReactNode;
|
|
2455
2455
|
/**
|
|
2456
|
-
* Badge content for count display (optional, for xxlarge
|
|
2456
|
+
* Badge content for count display (optional, for xxlarge link variant)
|
|
2457
2457
|
* @figma (# recipes)
|
|
2458
2458
|
*/
|
|
2459
2459
|
badge?: ReactNode;
|
|
@@ -2484,14 +2484,14 @@ interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' | 'size'
|
|
|
2484
2484
|
/**
|
|
2485
2485
|
* NeoListItem - Flexible list item component with multiple size variants and states
|
|
2486
2486
|
*
|
|
2487
|
-
* A versatile list item component built on MUI's ListItemButton that supports
|
|
2488
|
-
* (small to
|
|
2487
|
+
* A versatile list item component built on MUI's ListItemButton that supports five size variants
|
|
2488
|
+
* (small to xxlarge), interactive states (default, selected, disabled, link), and optional
|
|
2489
2489
|
* icons/logos, secondary text, and badges.
|
|
2490
2490
|
*
|
|
2491
2491
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4205-36442
|
|
2492
2492
|
*
|
|
2493
2493
|
* Figma Props Mapping:
|
|
2494
|
-
* - size (
|
|
2494
|
+
* - size (small|medium|large|xlarge|XXL) → size (small|medium|large|xlarge|xxlarge)
|
|
2495
2495
|
* - state (default|active|disabled|link) → selected, disabled, isLink props
|
|
2496
2496
|
* - showIcon → icon prop (pass ReactNode)
|
|
2497
2497
|
* - showSupportingText → secondaryText prop (pass ReactNode)
|
package/dist/index.esm.js
CHANGED
|
@@ -4778,19 +4778,6 @@ const sizeConfig = {
|
|
|
4778
4778
|
badgeFontSize: typography.fontSize.xs,
|
|
4779
4779
|
lineHeight: 1.5,
|
|
4780
4780
|
},
|
|
4781
|
-
xxxlarge: {
|
|
4782
|
-
height: spacing.spacing_10,
|
|
4783
|
-
paddingTop: 1,
|
|
4784
|
-
paddingRight: spacing.spacing_3_4,
|
|
4785
|
-
paddingBottom: 1,
|
|
4786
|
-
paddingLeft: spacing.spacing_3_4,
|
|
4787
|
-
gap: spacing.spacing_2,
|
|
4788
|
-
iconSize: spacing.spacing_6,
|
|
4789
|
-
fontSize: typography.fontSize.h5,
|
|
4790
|
-
secondaryFontSize: typography.fontSize.sm,
|
|
4791
|
-
badgeFontSize: typography.fontSize.xs,
|
|
4792
|
-
lineHeight: 1.5,
|
|
4793
|
-
},
|
|
4794
4781
|
};
|
|
4795
4782
|
const StyledListItemButton$1 = styled(ListItemButton, {
|
|
4796
4783
|
shouldForwardProp: prop => prop !== 'size' &&
|
|
@@ -4835,7 +4822,7 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4835
4822
|
'& .list-item-primary': {
|
|
4836
4823
|
fontSize: theme.typography.pxToRem(config.fontSize),
|
|
4837
4824
|
lineHeight: config.lineHeight,
|
|
4838
|
-
fontWeight: isLink &&
|
|
4825
|
+
fontWeight: isLink && size === 'xxlarge'
|
|
4839
4826
|
? typography.fontWeight.semiBold
|
|
4840
4827
|
: size === 'small' || size === 'medium'
|
|
4841
4828
|
? typography.fontWeight.regular
|
|
@@ -4846,20 +4833,18 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4846
4833
|
overflow: 'hidden',
|
|
4847
4834
|
textOverflow: 'ellipsis',
|
|
4848
4835
|
whiteSpace: 'nowrap',
|
|
4849
|
-
...(isLink &&
|
|
4836
|
+
...(isLink && size === 'xxlarge' && { textDecoration: 'none' }),
|
|
4850
4837
|
},
|
|
4851
|
-
// Link hover styling (underline on hover for xxlarge
|
|
4838
|
+
// Link hover styling (underline on hover for xxlarge)
|
|
4852
4839
|
...(isLink &&
|
|
4853
|
-
|
|
4840
|
+
size === 'xxlarge' && {
|
|
4854
4841
|
'&:hover .list-item-primary': {
|
|
4855
4842
|
textDecoration: 'underline',
|
|
4856
4843
|
},
|
|
4857
4844
|
}),
|
|
4858
|
-
// Badge styling (for xxlarge
|
|
4845
|
+
// Badge styling (for xxlarge link variant)
|
|
4859
4846
|
'& .list-item-badge': {
|
|
4860
|
-
fontSize: theme.typography.pxToRem(size === 'xxlarge' ||
|
|
4861
|
-
? config.badgeFontSize || 12
|
|
4862
|
-
: 12),
|
|
4847
|
+
fontSize: theme.typography.pxToRem(size === 'xxlarge' ? config.badgeFontSize || 12 : 12),
|
|
4863
4848
|
lineHeight: 1.5,
|
|
4864
4849
|
fontWeight: typography.fontWeight.regular,
|
|
4865
4850
|
color: semanticColors.typography.bodySecondary,
|
|
@@ -4937,14 +4922,14 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4937
4922
|
/**
|
|
4938
4923
|
* NeoListItem - Flexible list item component with multiple size variants and states
|
|
4939
4924
|
*
|
|
4940
|
-
* A versatile list item component built on MUI's ListItemButton that supports
|
|
4941
|
-
* (small to
|
|
4925
|
+
* A versatile list item component built on MUI's ListItemButton that supports five size variants
|
|
4926
|
+
* (small to xxlarge), interactive states (default, selected, disabled, link), and optional
|
|
4942
4927
|
* icons/logos, secondary text, and badges.
|
|
4943
4928
|
*
|
|
4944
4929
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4205-36442
|
|
4945
4930
|
*
|
|
4946
4931
|
* Figma Props Mapping:
|
|
4947
|
-
* - size (
|
|
4932
|
+
* - size (small|medium|large|xlarge|XXL) → size (small|medium|large|xlarge|xxlarge)
|
|
4948
4933
|
* - state (default|active|disabled|link) → selected, disabled, isLink props
|
|
4949
4934
|
* - showIcon → icon prop (pass ReactNode)
|
|
4950
4935
|
* - showSupportingText → secondaryText prop (pass ReactNode)
|
|
@@ -4967,10 +4952,9 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4967
4952
|
*/
|
|
4968
4953
|
const NeoListItem = ({ size = 'medium', primaryText, secondaryText, badge, icon, isLink = false, trailingElement, component, ...props }) => {
|
|
4969
4954
|
// Determine if secondary text should be shown based on size
|
|
4970
|
-
const showSecondaryText = secondaryText &&
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
const showBadge = badge && (size === 'xxlarge' || size === 'xxxlarge');
|
|
4955
|
+
const showSecondaryText = secondaryText && (size === 'large' || size === 'xlarge' || size === 'xxlarge');
|
|
4956
|
+
// Determine if badge should be shown (only for xxlarge)
|
|
4957
|
+
const showBadge = badge && size === 'xxlarge';
|
|
4974
4958
|
// Prepare primary text with badge if needed
|
|
4975
4959
|
const primaryContent = showBadge ? (jsxs(Fragment, { children: [primaryText, ' ', jsx(Typography, { component: "span", className: "list-item-badge", children: badge })] })) : (primaryText);
|
|
4976
4960
|
return (jsxs(StyledListItemButton$1, { size: size, isLink: isLink, hasSecondaryText: !!showSecondaryText, ...(component && { component }), ...props, children: [icon && jsx(ListItemIcon, { children: icon }), jsx(ListItemText, { primary: primaryContent, secondary: showSecondaryText ? secondaryText : undefined, sx: { minWidth: 0, flex: 1 }, slotProps: {
|