@moderneinc/neo-styled-components 2.0.2-next.b7dcad → 2.0.3-next.901bb3
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/PageContent/PageContent.d.ts +29 -1
- package/dist/index.d.ts +30 -2
- package/dist/index.esm.js +14 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4049,12 +4049,13 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
|
4049
4049
|
prop !== 'secondaryText' &&
|
|
4050
4050
|
prop !== 'badge' &&
|
|
4051
4051
|
prop !== 'icon' &&
|
|
4052
|
-
prop !== 'isLink'
|
|
4053
|
-
|
|
4052
|
+
prop !== 'isLink' &&
|
|
4053
|
+
prop !== 'hasSecondaryText',
|
|
4054
|
+
})(({ theme, size = 'medium', isLink, hasSecondaryText }) => {
|
|
4054
4055
|
const config = sizeConfig[size];
|
|
4055
4056
|
return {
|
|
4056
4057
|
minHeight: config.height,
|
|
4057
|
-
height: config.height,
|
|
4058
|
+
height: hasSecondaryText ? 'auto' : config.height,
|
|
4058
4059
|
paddingTop: config.paddingTop,
|
|
4059
4060
|
paddingRight: config.paddingRight,
|
|
4060
4061
|
paddingBottom: config.paddingBottom,
|
|
@@ -4062,6 +4063,8 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
|
4062
4063
|
borderRadius: neoDesign.spacing.spacing_3_4, // 6px
|
|
4063
4064
|
backgroundColor: neoDesign.semanticColors.input.background,
|
|
4064
4065
|
gap: config.gap,
|
|
4066
|
+
// Icon is always centered vertically per Figma design
|
|
4067
|
+
alignItems: 'center',
|
|
4065
4068
|
transition: theme.transitions.create(['background-color'], {
|
|
4066
4069
|
duration: theme.transitions.duration.short,
|
|
4067
4070
|
}),
|
|
@@ -4094,15 +4097,14 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
|
4094
4097
|
fontWeight: neoDesign.typography.fontWeight.regular,
|
|
4095
4098
|
color: neoDesign.semanticColors.typography.bodySecondary,
|
|
4096
4099
|
},
|
|
4097
|
-
// Secondary text styling
|
|
4100
|
+
// Secondary text styling - wraps with word break
|
|
4098
4101
|
'& .list-item-secondary': {
|
|
4099
4102
|
fontSize: theme.typography.pxToRem('secondaryFontSize' in config ? config.secondaryFontSize : config.fontSize),
|
|
4100
4103
|
lineHeight: size === 'large' ? 1.5 : 1.4,
|
|
4101
4104
|
fontWeight: neoDesign.typography.fontWeight.regular,
|
|
4102
4105
|
color: neoDesign.semanticColors.typography.bodySecondary,
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
whiteSpace: 'nowrap',
|
|
4106
|
+
wordBreak: 'break-word',
|
|
4107
|
+
whiteSpace: 'normal',
|
|
4106
4108
|
...(size === 'large' && {
|
|
4107
4109
|
marginBottom: -2,
|
|
4108
4110
|
}),
|
|
@@ -4194,7 +4196,7 @@ const NeoListItem = ({ size = 'medium', primaryText, secondaryText, badge, icon,
|
|
|
4194
4196
|
const showBadge = badge && size === 'xxlarge';
|
|
4195
4197
|
// Prepare primary text with badge if needed
|
|
4196
4198
|
const primaryContent = showBadge ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [primaryText, ' ', jsxRuntime.jsx(Typography, { component: "span", className: "list-item-badge", children: badge })] })) : (primaryText);
|
|
4197
|
-
return (jsxRuntime.jsxs(StyledListItemButton$1, { size: size, isLink: isLink, ...(component && { component }), ...props, children: [icon && jsxRuntime.jsx(ListItemIcon, { children: icon }), jsxRuntime.jsx(ListItemText, { primary: primaryContent, secondary: showSecondaryText ? secondaryText : undefined, slotProps: {
|
|
4199
|
+
return (jsxRuntime.jsxs(StyledListItemButton$1, { size: size, isLink: isLink, hasSecondaryText: !!showSecondaryText, ...(component && { component }), ...props, children: [icon && jsxRuntime.jsx(ListItemIcon, { children: icon }), jsxRuntime.jsx(ListItemText, { primary: primaryContent, secondary: showSecondaryText ? secondaryText : undefined, sx: { minWidth: 0, flex: 1 }, slotProps: {
|
|
4198
4200
|
primary: { className: 'list-item-primary' },
|
|
4199
4201
|
secondary: { className: 'list-item-secondary' },
|
|
4200
4202
|
} })] }));
|
|
@@ -4771,7 +4773,7 @@ const Subtitle = styles.styled(Typography)(() => ({
|
|
|
4771
4773
|
* </NeoPageContent>
|
|
4772
4774
|
* ```
|
|
4773
4775
|
*/
|
|
4774
|
-
function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMaxWidth = false, disableGutters = false, isLoading = false, showBackToTop = true, children, sx, ...boxProps }) {
|
|
4776
|
+
function NeoPageContent({ pageTitle, subtitle, breadcrumbs, action, sticky = false, contentMaxWidth = false, centerContent = true, disableGutters = false, isLoading = false, showBackToTop = true, children, sx, ...boxProps }) {
|
|
4775
4777
|
const [showBackToTopButton, setShowBackToTopButton] = react.useState(false);
|
|
4776
4778
|
const headerRef = react.useRef(null);
|
|
4777
4779
|
const containerRef = react.useRef(null);
|
|
@@ -4801,8 +4803,8 @@ function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMa
|
|
|
4801
4803
|
// Also try to scroll window in case component is in a different context
|
|
4802
4804
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
4803
4805
|
};
|
|
4804
|
-
const headerContent = (jsxRuntime.jsxs(Stack, { ref: headerRef, direction: "row", justifyContent: "space-between", alignItems: "flex-start", sx: {
|
|
4805
|
-
|
|
4806
|
+
const headerContent = (jsxRuntime.jsxs(Stack, { ref: headerRef, sx: { flexShrink: 0, gap: '0.5rem' }, children: [breadcrumbs && breadcrumbs.length > 0 && (jsxRuntime.jsx(NeoBreadcrumbs, { children: breadcrumbs.map((item, index) => (jsxRuntime.jsx(NeoBreadcrumbLink, { href: item.href, current: index === breadcrumbs.length - 1, children: item.label }, item.href ?? index))) })), jsxRuntime.jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "flex-start", sx: { gap: '1rem' }, children: [jsxRuntime.jsxs(Stack, { sx: { gap: '0.5rem', flexGrow: 1 }, children: [jsxRuntime.jsx(PageTitle, { children: pageTitle }), subtitle &&
|
|
4807
|
+
(typeof subtitle === 'string' ? (jsxRuntime.jsx(Subtitle, { variant: "caption", children: subtitle })) : (subtitle))] }), action] })] }));
|
|
4806
4808
|
const content = isLoading ? (jsxRuntime.jsx(Box, { sx: {
|
|
4807
4809
|
display: 'flex',
|
|
4808
4810
|
alignItems: 'center',
|
|
@@ -4833,8 +4835,8 @@ function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMa
|
|
|
4833
4835
|
flexDirection: 'column',
|
|
4834
4836
|
...(contentMaxWidth !== false && {
|
|
4835
4837
|
maxWidth: theme => theme.breakpoints.values[contentMaxWidth],
|
|
4836
|
-
mx: 'auto',
|
|
4837
4838
|
width: '100%',
|
|
4839
|
+
...(centerContent ? { mx: 'auto' } : { alignSelf: 'flex-start' }),
|
|
4838
4840
|
}),
|
|
4839
4841
|
}, children: content })] }) }), showBackToTop && (jsxRuntime.jsx(Fade, { in: showBackToTopButton, children: jsxRuntime.jsx(Box, { sx: {
|
|
4840
4842
|
position: 'fixed',
|