@moderneinc/neo-styled-components 3.0.0-next.ff608c → 4.0.0-next.557dc6
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/Tabs/Tabs.d.ts +1 -4
- package/dist/index.d.ts +8 -11
- package/dist/index.esm.js +57 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +57 -16
- 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' | 'xxxlarge';
|
|
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' | 'xxxlarge';
|
|
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/xxxlarge)
|
|
25
25
|
* @figma Recipe name (secondary text)
|
|
26
26
|
*/
|
|
27
27
|
secondaryText?: ReactNode;
|
|
28
28
|
/**
|
|
29
|
-
* Badge content for count display (optional, for xxlarge link variant)
|
|
29
|
+
* Badge content for count display (optional, for xxlarge/xxxlarge 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 six size variants
|
|
61
|
+
* (small to xxxlarge), 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|Extra Large|XX Large|TripleExtraLarge) → size (small|medium|large|xlarge|xxlarge|xxxlarge)
|
|
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/Tabs/Tabs.d.ts
CHANGED
|
@@ -39,10 +39,7 @@ export interface NeoTabProps extends Omit<TabProps, 'label'> {
|
|
|
39
39
|
*
|
|
40
40
|
* Figma Props Mapping:
|
|
41
41
|
* - Current=True/False → Controlled by parent NeoTabs value
|
|
42
|
-
* -
|
|
43
|
-
* - State=Hover → CSS :hover
|
|
44
|
-
* - State=Focus → CSS :focus-visible
|
|
45
|
-
* - Tag count → count prop (renders NeoTag)
|
|
42
|
+
* - Show tag → count prop (renders NeoTag)
|
|
46
43
|
* - Text label → label prop
|
|
47
44
|
*/
|
|
48
45
|
export declare const NeoTab: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2191,10 +2191,7 @@ interface NeoTabProps extends Omit<TabProps, 'label'> {
|
|
|
2191
2191
|
*
|
|
2192
2192
|
* Figma Props Mapping:
|
|
2193
2193
|
* - Current=True/False → Controlled by parent NeoTabs value
|
|
2194
|
-
* -
|
|
2195
|
-
* - State=Hover → CSS :hover
|
|
2196
|
-
* - State=Focus → CSS :focus-visible
|
|
2197
|
-
* - Tag count → count prop (renders NeoTag)
|
|
2194
|
+
* - Show tag → count prop (renders NeoTag)
|
|
2198
2195
|
* - Text label → label prop
|
|
2199
2196
|
*/
|
|
2200
2197
|
declare const NeoTab: {
|
|
@@ -2432,7 +2429,7 @@ declare const NeoToolbar: {
|
|
|
2432
2429
|
|
|
2433
2430
|
declare module '@mui/material/ListItemButton' {
|
|
2434
2431
|
interface ListItemButtonPropsVariantOverrides {
|
|
2435
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
2432
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge';
|
|
2436
2433
|
}
|
|
2437
2434
|
}
|
|
2438
2435
|
/**
|
|
@@ -2444,19 +2441,19 @@ interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' | 'size'
|
|
|
2444
2441
|
* @default "medium"
|
|
2445
2442
|
* @figma size
|
|
2446
2443
|
*/
|
|
2447
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
2444
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge';
|
|
2448
2445
|
/**
|
|
2449
2446
|
* Primary text content (required)
|
|
2450
2447
|
* @figma Placeholder (primary text)
|
|
2451
2448
|
*/
|
|
2452
2449
|
primaryText: ReactNode;
|
|
2453
2450
|
/**
|
|
2454
|
-
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge)
|
|
2451
|
+
* Secondary/supporting text content (optional, shown in large/xlarge/xxlarge/xxxlarge)
|
|
2455
2452
|
* @figma Recipe name (secondary text)
|
|
2456
2453
|
*/
|
|
2457
2454
|
secondaryText?: ReactNode;
|
|
2458
2455
|
/**
|
|
2459
|
-
* Badge content for count display (optional, for xxlarge link variant)
|
|
2456
|
+
* Badge content for count display (optional, for xxlarge/xxxlarge link variant)
|
|
2460
2457
|
* @figma (# recipes)
|
|
2461
2458
|
*/
|
|
2462
2459
|
badge?: ReactNode;
|
|
@@ -2487,14 +2484,14 @@ interface NeoListItemProps extends Omit<ListItemButtonProps, 'children' | 'size'
|
|
|
2487
2484
|
/**
|
|
2488
2485
|
* NeoListItem - Flexible list item component with multiple size variants and states
|
|
2489
2486
|
*
|
|
2490
|
-
* A versatile list item component built on MUI's ListItemButton that supports
|
|
2491
|
-
* (small to
|
|
2487
|
+
* A versatile list item component built on MUI's ListItemButton that supports six size variants
|
|
2488
|
+
* (small to xxxlarge), interactive states (default, selected, disabled, link), and optional
|
|
2492
2489
|
* icons/logos, secondary text, and badges.
|
|
2493
2490
|
*
|
|
2494
2491
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4205-36442
|
|
2495
2492
|
*
|
|
2496
2493
|
* Figma Props Mapping:
|
|
2497
|
-
* - size (
|
|
2494
|
+
* - size (Small|Medium|Large|Extra Large|XX Large|TripleExtraLarge) → size (small|medium|large|xlarge|xxlarge|xxxlarge)
|
|
2498
2495
|
* - state (default|active|disabled|link) → selected, disabled, isLink props
|
|
2499
2496
|
* - showIcon → icon prop (pass ReactNode)
|
|
2500
2497
|
* - showSupportingText → secondaryText prop (pass ReactNode)
|
package/dist/index.esm.js
CHANGED
|
@@ -4778,6 +4778,19 @@ 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
|
+
},
|
|
4781
4794
|
};
|
|
4782
4795
|
const StyledListItemButton$1 = styled(ListItemButton, {
|
|
4783
4796
|
shouldForwardProp: prop => prop !== 'size' &&
|
|
@@ -4822,7 +4835,7 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4822
4835
|
'& .list-item-primary': {
|
|
4823
4836
|
fontSize: theme.typography.pxToRem(config.fontSize),
|
|
4824
4837
|
lineHeight: config.lineHeight,
|
|
4825
|
-
fontWeight: isLink && size === 'xxlarge'
|
|
4838
|
+
fontWeight: isLink && (size === 'xxlarge' || size === 'xxxlarge')
|
|
4826
4839
|
? typography.fontWeight.semiBold
|
|
4827
4840
|
: size === 'small' || size === 'medium'
|
|
4828
4841
|
? typography.fontWeight.regular
|
|
@@ -4833,18 +4846,20 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4833
4846
|
overflow: 'hidden',
|
|
4834
4847
|
textOverflow: 'ellipsis',
|
|
4835
4848
|
whiteSpace: 'nowrap',
|
|
4836
|
-
...(isLink && size === 'xxlarge' && { textDecoration: 'none' }),
|
|
4849
|
+
...(isLink && (size === 'xxlarge' || size === 'xxxlarge') && { textDecoration: 'none' }),
|
|
4837
4850
|
},
|
|
4838
|
-
// Link hover styling (underline on hover for xxlarge)
|
|
4851
|
+
// Link hover styling (underline on hover for xxlarge/xxxlarge)
|
|
4839
4852
|
...(isLink &&
|
|
4840
|
-
size === 'xxlarge' && {
|
|
4853
|
+
(size === 'xxlarge' || size === 'xxxlarge') && {
|
|
4841
4854
|
'&:hover .list-item-primary': {
|
|
4842
4855
|
textDecoration: 'underline',
|
|
4843
4856
|
},
|
|
4844
4857
|
}),
|
|
4845
|
-
// Badge styling (for xxlarge link variant)
|
|
4858
|
+
// Badge styling (for xxlarge/xxxlarge link variant)
|
|
4846
4859
|
'& .list-item-badge': {
|
|
4847
|
-
fontSize: theme.typography.pxToRem(size === 'xxlarge'
|
|
4860
|
+
fontSize: theme.typography.pxToRem(size === 'xxlarge' || size === 'xxxlarge'
|
|
4861
|
+
? config.badgeFontSize || 12
|
|
4862
|
+
: 12),
|
|
4848
4863
|
lineHeight: 1.5,
|
|
4849
4864
|
fontWeight: typography.fontWeight.regular,
|
|
4850
4865
|
color: semanticColors.typography.bodySecondary,
|
|
@@ -4922,14 +4937,14 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4922
4937
|
/**
|
|
4923
4938
|
* NeoListItem - Flexible list item component with multiple size variants and states
|
|
4924
4939
|
*
|
|
4925
|
-
* A versatile list item component built on MUI's ListItemButton that supports
|
|
4926
|
-
* (small to
|
|
4940
|
+
* A versatile list item component built on MUI's ListItemButton that supports six size variants
|
|
4941
|
+
* (small to xxxlarge), interactive states (default, selected, disabled, link), and optional
|
|
4927
4942
|
* icons/logos, secondary text, and badges.
|
|
4928
4943
|
*
|
|
4929
4944
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4205-36442
|
|
4930
4945
|
*
|
|
4931
4946
|
* Figma Props Mapping:
|
|
4932
|
-
* - size (
|
|
4947
|
+
* - size (Small|Medium|Large|Extra Large|XX Large|TripleExtraLarge) → size (small|medium|large|xlarge|xxlarge|xxxlarge)
|
|
4933
4948
|
* - state (default|active|disabled|link) → selected, disabled, isLink props
|
|
4934
4949
|
* - showIcon → icon prop (pass ReactNode)
|
|
4935
4950
|
* - showSupportingText → secondaryText prop (pass ReactNode)
|
|
@@ -4952,9 +4967,10 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4952
4967
|
*/
|
|
4953
4968
|
const NeoListItem = ({ size = 'medium', primaryText, secondaryText, badge, icon, isLink = false, trailingElement, component, ...props }) => {
|
|
4954
4969
|
// Determine if secondary text should be shown based on size
|
|
4955
|
-
const showSecondaryText = secondaryText &&
|
|
4956
|
-
|
|
4957
|
-
|
|
4970
|
+
const showSecondaryText = secondaryText &&
|
|
4971
|
+
(size === 'large' || size === 'xlarge' || size === 'xxlarge' || size === 'xxxlarge');
|
|
4972
|
+
// Determine if badge should be shown (for xxlarge/xxxlarge)
|
|
4973
|
+
const showBadge = badge && (size === 'xxlarge' || size === 'xxxlarge');
|
|
4958
4974
|
// Prepare primary text with badge if needed
|
|
4959
4975
|
const primaryContent = showBadge ? (jsxs(Fragment, { children: [primaryText, ' ', jsx(Typography, { component: "span", className: "list-item-badge", children: badge })] })) : (primaryText);
|
|
4960
4976
|
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: {
|
|
@@ -6129,7 +6145,20 @@ const StyledTab = styled(MuiTab)(({ theme }) => ({
|
|
|
6129
6145
|
color: semanticColors.typography.tab.active,
|
|
6130
6146
|
fontWeight: typography.fontWeight.semiBold,
|
|
6131
6147
|
},
|
|
6148
|
+
'&:hover': {
|
|
6149
|
+
backgroundColor: semanticColors.buttons.secondary.hoverBackground,
|
|
6150
|
+
[`&.${tabClasses.selected}::after`]: {
|
|
6151
|
+
content: '""',
|
|
6152
|
+
position: 'absolute',
|
|
6153
|
+
bottom: 0,
|
|
6154
|
+
left: 0,
|
|
6155
|
+
right: 0,
|
|
6156
|
+
height: 2,
|
|
6157
|
+
backgroundColor: semanticColors.buttons.primary.hover,
|
|
6158
|
+
},
|
|
6159
|
+
},
|
|
6132
6160
|
[`&.${buttonBaseClasses.focusVisible}`]: {
|
|
6161
|
+
color: semanticColors.typography.tab.active,
|
|
6133
6162
|
outline: `2px solid ${semanticColors.border.focus}`,
|
|
6134
6163
|
outlineOffset: -2,
|
|
6135
6164
|
},
|
|
@@ -6137,6 +6166,21 @@ const StyledTab = styled(MuiTab)(({ theme }) => ({
|
|
|
6137
6166
|
color: semanticColors.typography.button.disabled,
|
|
6138
6167
|
cursor: 'not-allowed',
|
|
6139
6168
|
pointerEvents: 'auto',
|
|
6169
|
+
'&:hover': {
|
|
6170
|
+
backgroundColor: 'transparent',
|
|
6171
|
+
},
|
|
6172
|
+
[`&.${tabClasses.selected}`]: {
|
|
6173
|
+
color: semanticColors.typography.button.disabled,
|
|
6174
|
+
'&::after': {
|
|
6175
|
+
content: '""',
|
|
6176
|
+
position: 'absolute',
|
|
6177
|
+
bottom: 0,
|
|
6178
|
+
left: 0,
|
|
6179
|
+
right: 0,
|
|
6180
|
+
height: 2,
|
|
6181
|
+
backgroundColor: semanticColors.buttons.tertiary.disabled,
|
|
6182
|
+
},
|
|
6183
|
+
},
|
|
6140
6184
|
},
|
|
6141
6185
|
}));
|
|
6142
6186
|
const TabLabelContainer = styled('span')(({ theme }) => ({
|
|
@@ -6151,10 +6195,7 @@ const TabLabelContainer = styled('span')(({ theme }) => ({
|
|
|
6151
6195
|
*
|
|
6152
6196
|
* Figma Props Mapping:
|
|
6153
6197
|
* - Current=True/False → Controlled by parent NeoTabs value
|
|
6154
|
-
* -
|
|
6155
|
-
* - State=Hover → CSS :hover
|
|
6156
|
-
* - State=Focus → CSS :focus-visible
|
|
6157
|
-
* - Tag count → count prop (renders NeoTag)
|
|
6198
|
+
* - Show tag → count prop (renders NeoTag)
|
|
6158
6199
|
* - Text label → label prop
|
|
6159
6200
|
*/
|
|
6160
6201
|
const NeoTab = ({ label, count, ...props }) => {
|