@moderneinc/neo-styled-components 2.0.1-next.58c313 → 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.
@@ -1,6 +1,15 @@
1
1
  import type { BoxProps } from '@mui/material/Box';
2
2
  import type { Breakpoint } from '@mui/material/styles';
3
3
  import { type ReactNode } from 'react';
4
+ /**
5
+ * Breadcrumb item configuration
6
+ */
7
+ export interface BreadcrumbItem {
8
+ /** Link label */
9
+ label: ReactNode;
10
+ /** Link href (omit for current/last item) */
11
+ href?: string;
12
+ }
4
13
  export interface NeoPageContentProps extends BoxProps {
5
14
  /**
6
15
  * Main heading displayed on the page
@@ -12,6 +21,20 @@ export interface NeoPageContentProps extends BoxProps {
12
21
  * Optional subtitle displayed below the page title
13
22
  */
14
23
  subtitle?: ReactNode | string;
24
+ /**
25
+ * Optional breadcrumbs navigation displayed above the page title.
26
+ * Last item is automatically marked as current.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * breadcrumbs={[
31
+ * { label: 'Settings', href: '/settings' },
32
+ * { label: 'Team', href: '/team' },
33
+ * { label: 'Team Details' },
34
+ * ]}
35
+ * ```
36
+ */
37
+ breadcrumbs?: BreadcrumbItem[];
15
38
  /**
16
39
  * Action button displayed in the top-right corner
17
40
  *
@@ -28,6 +51,11 @@ export interface NeoPageContentProps extends BoxProps {
28
51
  * @default false
29
52
  */
30
53
  contentMaxWidth?: Breakpoint | false;
54
+ /**
55
+ * Center content when using contentMaxWidth
56
+ * @default true
57
+ */
58
+ centerContent?: boolean;
31
59
  /**
32
60
  * Disable gutters/padding
33
61
  * @default false
@@ -103,7 +131,7 @@ export interface NeoPageContentProps extends BoxProps {
103
131
  * </NeoPageContent>
104
132
  * ```
105
133
  */
106
- export declare function NeoPageContent({ pageTitle, subtitle, action, sticky, contentMaxWidth, disableGutters, isLoading, showBackToTop, children, sx, ...boxProps }: NeoPageContentProps): import("react/jsx-runtime").JSX.Element;
134
+ export declare function NeoPageContent({ pageTitle, subtitle, breadcrumbs, action, sticky, contentMaxWidth, centerContent, disableGutters, isLoading, showBackToTop, children, sx, ...boxProps }: NeoPageContentProps): import("react/jsx-runtime").JSX.Element;
107
135
  export declare namespace NeoPageContent {
108
136
  var displayName: string;
109
137
  }
package/dist/index.d.ts CHANGED
@@ -1596,6 +1596,15 @@ declare const NeoModalFooter: {
1596
1596
  displayName: string;
1597
1597
  };
1598
1598
 
1599
+ /**
1600
+ * Breadcrumb item configuration
1601
+ */
1602
+ interface BreadcrumbItem {
1603
+ /** Link label */
1604
+ label: ReactNode;
1605
+ /** Link href (omit for current/last item) */
1606
+ href?: string;
1607
+ }
1599
1608
  interface NeoPageContentProps extends BoxProps {
1600
1609
  /**
1601
1610
  * Main heading displayed on the page
@@ -1607,6 +1616,20 @@ interface NeoPageContentProps extends BoxProps {
1607
1616
  * Optional subtitle displayed below the page title
1608
1617
  */
1609
1618
  subtitle?: ReactNode | string;
1619
+ /**
1620
+ * Optional breadcrumbs navigation displayed above the page title.
1621
+ * Last item is automatically marked as current.
1622
+ *
1623
+ * @example
1624
+ * ```tsx
1625
+ * breadcrumbs={[
1626
+ * { label: 'Settings', href: '/settings' },
1627
+ * { label: 'Team', href: '/team' },
1628
+ * { label: 'Team Details' },
1629
+ * ]}
1630
+ * ```
1631
+ */
1632
+ breadcrumbs?: BreadcrumbItem[];
1610
1633
  /**
1611
1634
  * Action button displayed in the top-right corner
1612
1635
  *
@@ -1623,6 +1646,11 @@ interface NeoPageContentProps extends BoxProps {
1623
1646
  * @default false
1624
1647
  */
1625
1648
  contentMaxWidth?: Breakpoint | false;
1649
+ /**
1650
+ * Center content when using contentMaxWidth
1651
+ * @default true
1652
+ */
1653
+ centerContent?: boolean;
1626
1654
  /**
1627
1655
  * Disable gutters/padding
1628
1656
  * @default false
@@ -1698,7 +1726,7 @@ interface NeoPageContentProps extends BoxProps {
1698
1726
  * </NeoPageContent>
1699
1727
  * ```
1700
1728
  */
1701
- declare function NeoPageContent({ pageTitle, subtitle, action, sticky, contentMaxWidth, disableGutters, isLoading, showBackToTop, children, sx, ...boxProps }: NeoPageContentProps): react_jsx_runtime.JSX.Element;
1729
+ declare function NeoPageContent({ pageTitle, subtitle, breadcrumbs, action, sticky, contentMaxWidth, centerContent, disableGutters, isLoading, showBackToTop, children, sx, ...boxProps }: NeoPageContentProps): react_jsx_runtime.JSX.Element;
1702
1730
  declare namespace NeoPageContent {
1703
1731
  var displayName: string;
1704
1732
  }
@@ -2702,4 +2730,4 @@ declare module '@mui/x-data-grid-pro' {
2702
2730
  declare const version: string
2703
2731
 
2704
2732
  export { ActivityScene, CIRCLE_RADIUS, NeoActivityHeader, NeoActivityIndicatorCell, NeoAvatar, NeoBadge, NeoBanner, NeoBreadcrumbLink, NeoBreadcrumbs, NeoButton, NeoButtonGroup, NeoCheckbox, NeoCodeSnippet, NeoDataGrid, NeoDataGridCellContent, NeoDataGridColumnsButton, NeoDataGridColumnsPanel, NeoDataGridFilterPanel, NeoDataGridFilterPanelAddIcon, NeoDataGridFilterPanelDeleteIcon, NeoDataGridFilterPanelRemoveAllIcon, NeoDataGridFiltersButton, NeoDataGridHeaderLabel, NeoSelect as NeoDataGridSelect, NeoDatePicker, NeoDivider, NeoDot, NeoFooter, NeoIconButton, NeoInfiniteScrollGrid, NeoInputField, NeoListItem, NeoListItemButton, NeoLoadingSpinner, NeoMarketplaceCard, NeoMenu, NeoMenuItem, NeoModal, NeoModalContent, NeoModalFooter, NeoModalHeader, NeoMultiBadgesCell, NeoPageContent, NeoPaginatedGrid, NeoProgressbar, NeoQuickFilter, NeoRadio, NeoSelect, NeoMenuItem as NeoSelectOption, NeoSkeleton, NeoStatusBadgeCell, NeoStatusBanner, NeoTab, NeoTabs, NeoTag, NeoToast, NeoToastButton, NeoToggle, NeoToolbar, NeoTooltip, StyledToggleButton as NeoTypologyButton, NeoTypologyControl, NeoUserAvatarCell, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, getDataGridHeaderStyles, version };
2705
- export type { ActivityColor, ActivityEvent, ActivityHeaderSize, DataGridSize, NeoActivityHeaderProps, NeoActivityIndicatorCellProps, NeoAvatarProps, NeoBadgeProps, NeoBannerProps, NeoBreadcrumbLinkProps, NeoBreadcrumbsProps, NeoButtonGroupProps, NeoButtonProps, NeoCheckboxProps, NeoCodeSnippetProps, NeoDataGridCellContentProps, NeoDataGridHeaderLabelProps, NeoDataGridProps, NeoDatePickerProps, NeoDividerProps, NeoDotProps, NeoFooterProps, NeoIconButtonProps, NeoInfiniteScrollGridProps, NeoInputFieldProps, NeoListItemButtonProps, NeoListItemProps, NeoLoadingSpinnerProps, NeoMarketplaceCardProps, NeoMenuItemProps, NeoMenuProps, NeoModalContentProps, NeoModalFooterProps, NeoModalHeaderProps, NeoModalProps, NeoMultiBadgesCellProps, NeoPageContentProps, NeoPaginatedGridProps, NeoProgressbarProps, NeoQuickFilterProps, NeoRadioProps, NeoSelectProps, NeoSkeletonProps, NeoStatusBadgeCellProps, NeoStatusBannerProps, NeoTabProps, NeoTagProps, NeoToastProps, NeoToggleProps, NeoToolbarProps, NeoTooltipProps, NeoTypologyControlProps, NeoUserAvatarCellProps };
2733
+ export type { ActivityColor, ActivityEvent, ActivityHeaderSize, BreadcrumbItem, DataGridSize, NeoActivityHeaderProps, NeoActivityIndicatorCellProps, NeoAvatarProps, NeoBadgeProps, NeoBannerProps, NeoBreadcrumbLinkProps, NeoBreadcrumbsProps, NeoButtonGroupProps, NeoButtonProps, NeoCheckboxProps, NeoCodeSnippetProps, NeoDataGridCellContentProps, NeoDataGridHeaderLabelProps, NeoDataGridProps, NeoDatePickerProps, NeoDividerProps, NeoDotProps, NeoFooterProps, NeoIconButtonProps, NeoInfiniteScrollGridProps, NeoInputFieldProps, NeoListItemButtonProps, NeoListItemProps, NeoLoadingSpinnerProps, NeoMarketplaceCardProps, NeoMenuItemProps, NeoMenuProps, NeoModalContentProps, NeoModalFooterProps, NeoModalHeaderProps, NeoModalProps, NeoMultiBadgesCellProps, NeoPageContentProps, NeoPaginatedGridProps, NeoProgressbarProps, NeoQuickFilterProps, NeoRadioProps, NeoSelectProps, NeoSkeletonProps, NeoStatusBadgeCellProps, NeoStatusBannerProps, NeoTabProps, NeoTagProps, NeoToastProps, NeoToggleProps, NeoToolbarProps, NeoTooltipProps, NeoTypologyControlProps, NeoUserAvatarCellProps };
package/dist/index.esm.js CHANGED
@@ -4047,12 +4047,13 @@ const StyledListItemButton$1 = styled(ListItemButton, {
4047
4047
  prop !== 'secondaryText' &&
4048
4048
  prop !== 'badge' &&
4049
4049
  prop !== 'icon' &&
4050
- prop !== 'isLink',
4051
- })(({ theme, size = 'medium', isLink }) => {
4050
+ prop !== 'isLink' &&
4051
+ prop !== 'hasSecondaryText',
4052
+ })(({ theme, size = 'medium', isLink, hasSecondaryText }) => {
4052
4053
  const config = sizeConfig[size];
4053
4054
  return {
4054
4055
  minHeight: config.height,
4055
- height: config.height,
4056
+ height: hasSecondaryText ? 'auto' : config.height,
4056
4057
  paddingTop: config.paddingTop,
4057
4058
  paddingRight: config.paddingRight,
4058
4059
  paddingBottom: config.paddingBottom,
@@ -4060,6 +4061,8 @@ const StyledListItemButton$1 = styled(ListItemButton, {
4060
4061
  borderRadius: spacing.spacing_3_4, // 6px
4061
4062
  backgroundColor: semanticColors.input.background,
4062
4063
  gap: config.gap,
4064
+ // Icon is always centered vertically per Figma design
4065
+ alignItems: 'center',
4063
4066
  transition: theme.transitions.create(['background-color'], {
4064
4067
  duration: theme.transitions.duration.short,
4065
4068
  }),
@@ -4092,15 +4095,14 @@ const StyledListItemButton$1 = styled(ListItemButton, {
4092
4095
  fontWeight: typography.fontWeight.regular,
4093
4096
  color: semanticColors.typography.bodySecondary,
4094
4097
  },
4095
- // Secondary text styling
4098
+ // Secondary text styling - wraps with word break
4096
4099
  '& .list-item-secondary': {
4097
4100
  fontSize: theme.typography.pxToRem('secondaryFontSize' in config ? config.secondaryFontSize : config.fontSize),
4098
4101
  lineHeight: size === 'large' ? 1.5 : 1.4,
4099
4102
  fontWeight: typography.fontWeight.regular,
4100
4103
  color: semanticColors.typography.bodySecondary,
4101
- overflow: 'hidden',
4102
- textOverflow: 'ellipsis',
4103
- whiteSpace: 'nowrap',
4104
+ wordBreak: 'break-word',
4105
+ whiteSpace: 'normal',
4104
4106
  ...(size === 'large' && {
4105
4107
  marginBottom: -2,
4106
4108
  }),
@@ -4192,7 +4194,7 @@ const NeoListItem = ({ size = 'medium', primaryText, secondaryText, badge, icon,
4192
4194
  const showBadge = badge && size === 'xxlarge';
4193
4195
  // Prepare primary text with badge if needed
4194
4196
  const primaryContent = showBadge ? (jsxs(Fragment, { children: [primaryText, ' ', jsx(Typography, { component: "span", className: "list-item-badge", children: badge })] })) : (primaryText);
4195
- return (jsxs(StyledListItemButton$1, { size: size, isLink: isLink, ...(component && { component }), ...props, children: [icon && jsx(ListItemIcon, { children: icon }), jsx(ListItemText, { primary: primaryContent, secondary: showSecondaryText ? secondaryText : undefined, slotProps: {
4197
+ 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: {
4196
4198
  primary: { className: 'list-item-primary' },
4197
4199
  secondary: { className: 'list-item-secondary' },
4198
4200
  } })] }));
@@ -4769,7 +4771,7 @@ const Subtitle = styled(Typography)(() => ({
4769
4771
  * </NeoPageContent>
4770
4772
  * ```
4771
4773
  */
4772
- function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMaxWidth = false, disableGutters = false, isLoading = false, showBackToTop = true, children, sx, ...boxProps }) {
4774
+ function NeoPageContent({ pageTitle, subtitle, breadcrumbs, action, sticky = false, contentMaxWidth = false, centerContent = true, disableGutters = false, isLoading = false, showBackToTop = true, children, sx, ...boxProps }) {
4773
4775
  const [showBackToTopButton, setShowBackToTopButton] = useState(false);
4774
4776
  const headerRef = useRef(null);
4775
4777
  const containerRef = useRef(null);
@@ -4799,8 +4801,8 @@ function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMa
4799
4801
  // Also try to scroll window in case component is in a different context
4800
4802
  window.scrollTo({ top: 0, behavior: 'smooth' });
4801
4803
  };
4802
- const headerContent = (jsxs(Stack, { ref: headerRef, direction: "row", justifyContent: "space-between", alignItems: "flex-start", sx: { flexShrink: 0, gap: spacing.spacing_2 }, children: [jsxs(Stack, { sx: { gap: spacing.spacing_1, flexGrow: 1 }, children: [jsx(PageTitle, { children: pageTitle }), subtitle &&
4803
- (typeof subtitle === 'string' ? (jsx(Subtitle, { variant: "caption", children: subtitle })) : (subtitle))] }), action] }));
4804
+ const headerContent = (jsxs(Stack, { ref: headerRef, sx: { flexShrink: 0, gap: '0.5rem' }, children: [breadcrumbs && breadcrumbs.length > 0 && (jsx(NeoBreadcrumbs, { children: breadcrumbs.map((item, index) => (jsx(NeoBreadcrumbLink, { href: item.href, current: index === breadcrumbs.length - 1, children: item.label }, item.href ?? index))) })), jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "flex-start", sx: { gap: '1rem' }, children: [jsxs(Stack, { sx: { gap: '0.5rem', flexGrow: 1 }, children: [jsx(PageTitle, { children: pageTitle }), subtitle &&
4805
+ (typeof subtitle === 'string' ? (jsx(Subtitle, { variant: "caption", children: subtitle })) : (subtitle))] }), action] })] }));
4804
4806
  const content = isLoading ? (jsx(Box, { sx: {
4805
4807
  display: 'flex',
4806
4808
  alignItems: 'center',
@@ -4831,8 +4833,8 @@ function NeoPageContent({ pageTitle, subtitle, action, sticky = false, contentMa
4831
4833
  flexDirection: 'column',
4832
4834
  ...(contentMaxWidth !== false && {
4833
4835
  maxWidth: theme => theme.breakpoints.values[contentMaxWidth],
4834
- mx: 'auto',
4835
4836
  width: '100%',
4837
+ ...(centerContent ? { mx: 'auto' } : { alignSelf: 'flex-start' }),
4836
4838
  }),
4837
4839
  }, children: content })] }) }), showBackToTop && (jsx(Fade, { in: showBackToTopButton, children: jsx(Box, { sx: {
4838
4840
  position: 'fixed',