@moderneinc/neo-styled-components 5.0.0-next.b8e05c → 5.0.0-next.c9e7b7

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.
@@ -7,12 +7,6 @@ export interface NeoGeneralAvatarProps extends Omit<AvatarProps, 'variant'> {
7
7
  * @figma Size
8
8
  */
9
9
  size?: AvatarSize;
10
- /**
11
- * Color index for initials background (1-7). Use 0 or omit for image mode.
12
- * @default 0
13
- * @figma Color Index
14
- */
15
- colorIndex?: number;
16
10
  }
17
11
  /**
18
12
  * NeoGeneralAvatar - Avatar with image or colored initials display
@@ -20,7 +14,7 @@ export interface NeoGeneralAvatarProps extends Omit<AvatarProps, 'variant'> {
20
14
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=9600-185
21
15
  */
22
16
  export declare const NeoGeneralAvatar: {
23
- ({ size, colorIndex, children, ...props }: NeoGeneralAvatarProps): import("react/jsx-runtime").JSX.Element;
17
+ ({ size, alt, children, ...props }: NeoGeneralAvatarProps): import("react/jsx-runtime").JSX.Element;
24
18
  displayName: string;
25
19
  };
26
20
  export {};
@@ -1,6 +1,6 @@
1
- import { type MenuItemProps } from '@mui/material/MenuItem';
2
- import type { ReactNode } from 'react';
3
- export interface NeoMenuItemProps extends MenuItemProps {
1
+ import MenuItem from '@mui/material/MenuItem';
2
+ import type { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
3
+ type NeoMenuItemOwnProps = {
4
4
  /**
5
5
  * Optional icon to display on the left side
6
6
  * Note: Cannot be directly mapped from Figma (ReactNode)
@@ -18,12 +18,22 @@ export interface NeoMenuItemProps extends MenuItemProps {
18
18
  * Note: Cannot be directly mapped from Figma (ReactNode/string)
19
19
  */
20
20
  secondaryText?: string;
21
+ /**
22
+ * URL to navigate to. When provided, the menu item renders as an anchor
23
+ * element (via MUI ButtonBase) so users can middle-click or right-click
24
+ * to open in a new tab. For client-side routing, also pass
25
+ * `component={NextLink}` (or your router's link component).
26
+ */
27
+ href?: string;
21
28
  /**
22
29
  * Menu item content (text label)
23
30
  * @figma children mapped from Figma layer content
24
31
  */
25
32
  children?: ReactNode;
26
- }
33
+ };
34
+ export type NeoMenuItemProps<C extends ElementType = typeof MenuItem> = NeoMenuItemOwnProps & Omit<ComponentPropsWithoutRef<C>, keyof NeoMenuItemOwnProps> & {
35
+ component?: C;
36
+ };
27
37
  /**
28
38
  * NeoMenuItem - Menu item component based on MUI MenuItem
29
39
  *
@@ -42,9 +52,21 @@ export interface NeoMenuItemProps extends MenuItemProps {
42
52
  *
43
53
  * // Disabled state
44
54
  * <NeoMenuItem disabled>Disabled item</NeoMenuItem>
55
+ *
56
+ * // As an anchor — middle-click/right-click open in a new tab
57
+ * <NeoMenuItem href="/api-explorer">API explorer</NeoMenuItem>
58
+ *
59
+ * // External link
60
+ * <NeoMenuItem href="https://docs.example.com" target="_blank" rel="noopener noreferrer">
61
+ * Documentation
62
+ * </NeoMenuItem>
63
+ *
64
+ * // Client-side routing (Next.js)
65
+ * <NeoMenuItem component={NextLink} href="/api-explorer">API explorer</NeoMenuItem>
45
66
  * ```
46
67
  */
47
- export declare const NeoMenuItem: {
48
- ({ icon, shortcut, secondaryText, children, ...props }: NeoMenuItemProps): import("react/jsx-runtime").JSX.Element;
49
- displayName: string;
50
- };
68
+ export declare function NeoMenuItem<C extends ElementType = typeof MenuItem>({ icon, shortcut, secondaryText, children, ...rest }: NeoMenuItemProps<C>): import("react/jsx-runtime").JSX.Element;
69
+ export declare namespace NeoMenuItem {
70
+ var displayName: string;
71
+ }
72
+ export {};
@@ -10,6 +10,6 @@ export interface NeoNavigationAvatarProps extends Omit<NeoGeneralAvatarProps, 's
10
10
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=11325-102
11
11
  */
12
12
  export declare const NeoNavigationAvatar: {
13
- ({ colorIndex, children, ...props }: NeoNavigationAvatarProps): import("react/jsx-runtime").JSX.Element;
13
+ ({ children, ...props }: NeoNavigationAvatarProps): import("react/jsx-runtime").JSX.Element;
14
14
  displayName: string;
15
15
  };
@@ -5,14 +5,12 @@ type NeoAvatarCellEmpty = NeoAvatarCellBase & {
5
5
  empty: true;
6
6
  name?: never;
7
7
  src?: never;
8
- colorIndex?: never;
9
8
  label?: never;
10
9
  };
11
10
  type NeoAvatarCellContent = NeoAvatarCellBase & {
12
11
  empty?: false;
13
12
  name?: string;
14
13
  src?: string;
15
- colorIndex?: number;
16
14
  label?: string;
17
15
  };
18
16
  export type NeoAvatarCellProps = NeoAvatarCellEmpty | NeoAvatarCellContent;
@@ -21,7 +19,7 @@ export type NeoAvatarCellProps = NeoAvatarCellEmpty | NeoAvatarCellContent;
21
19
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=13425-1725
22
20
  */
23
21
  export declare const NeoAvatarCell: {
24
- ({ name, src, colorIndex, label, disabled, empty, }: NeoAvatarCellProps): import("react/jsx-runtime").JSX.Element;
22
+ ({ name, src, label, disabled, empty, }: NeoAvatarCellProps): import("react/jsx-runtime").JSX.Element;
25
23
  displayName: string;
26
24
  };
27
25
  export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentType, ComponentPropsWithoutRef } from 'react';
3
+ import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentPropsWithoutRef, ComponentType } from 'react';
4
4
  import { GridDensity, GridRenderCellParams, GridFilterPanel, ToolbarProps } from '@mui/x-data-grid';
5
5
  import Chip, { ChipProps } from '@mui/material/Chip';
6
6
  import { AlertProps } from '@mui/material/Alert';
@@ -19,7 +19,7 @@ import { PaperProps } from '@mui/material/Paper';
19
19
  import { AvatarProps } from '@mui/material/Avatar';
20
20
  import { InputBaseProps } from '@mui/material/InputBase';
21
21
  import { MenuProps } from '@mui/material/Menu';
22
- import { MenuItemProps } from '@mui/material/MenuItem';
22
+ import MenuItem from '@mui/material/MenuItem';
23
23
  import { DialogProps } from '@mui/material/Dialog';
24
24
  import { BoxProps } from '@mui/material/Box';
25
25
  import { LinearProgressProps } from '@mui/material/LinearProgress';
@@ -1072,14 +1072,12 @@ type NeoAvatarCellEmpty = NeoAvatarCellBase & {
1072
1072
  empty: true;
1073
1073
  name?: never;
1074
1074
  src?: never;
1075
- colorIndex?: never;
1076
1075
  label?: never;
1077
1076
  };
1078
1077
  type NeoAvatarCellContent = NeoAvatarCellBase & {
1079
1078
  empty?: false;
1080
1079
  name?: string;
1081
1080
  src?: string;
1082
- colorIndex?: number;
1083
1081
  label?: string;
1084
1082
  };
1085
1083
  type NeoAvatarCellProps = NeoAvatarCellEmpty | NeoAvatarCellContent;
@@ -1088,7 +1086,7 @@ type NeoAvatarCellProps = NeoAvatarCellEmpty | NeoAvatarCellContent;
1088
1086
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=13425-1725
1089
1087
  */
1090
1088
  declare const NeoAvatarCell: {
1091
- ({ name, src, colorIndex, label, disabled, empty, }: NeoAvatarCellProps): react_jsx_runtime.JSX.Element;
1089
+ ({ name, src, label, disabled, empty, }: NeoAvatarCellProps): react_jsx_runtime.JSX.Element;
1092
1090
  displayName: string;
1093
1091
  };
1094
1092
 
@@ -1213,7 +1211,7 @@ declare namespace NeoDataGridFiltersButton {
1213
1211
  var displayName: string;
1214
1212
  }
1215
1213
 
1216
- interface NeoMenuItemProps extends MenuItemProps {
1214
+ type NeoMenuItemOwnProps = {
1217
1215
  /**
1218
1216
  * Optional icon to display on the left side
1219
1217
  * Note: Cannot be directly mapped from Figma (ReactNode)
@@ -1231,12 +1229,22 @@ interface NeoMenuItemProps extends MenuItemProps {
1231
1229
  * Note: Cannot be directly mapped from Figma (ReactNode/string)
1232
1230
  */
1233
1231
  secondaryText?: string;
1232
+ /**
1233
+ * URL to navigate to. When provided, the menu item renders as an anchor
1234
+ * element (via MUI ButtonBase) so users can middle-click or right-click
1235
+ * to open in a new tab. For client-side routing, also pass
1236
+ * `component={NextLink}` (or your router's link component).
1237
+ */
1238
+ href?: string;
1234
1239
  /**
1235
1240
  * Menu item content (text label)
1236
1241
  * @figma children mapped from Figma layer content
1237
1242
  */
1238
1243
  children?: ReactNode;
1239
- }
1244
+ };
1245
+ type NeoMenuItemProps<C extends ElementType = typeof MenuItem> = NeoMenuItemOwnProps & Omit<ComponentPropsWithoutRef<C>, keyof NeoMenuItemOwnProps> & {
1246
+ component?: C;
1247
+ };
1240
1248
  /**
1241
1249
  * NeoMenuItem - Menu item component based on MUI MenuItem
1242
1250
  *
@@ -1255,12 +1263,23 @@ interface NeoMenuItemProps extends MenuItemProps {
1255
1263
  *
1256
1264
  * // Disabled state
1257
1265
  * <NeoMenuItem disabled>Disabled item</NeoMenuItem>
1266
+ *
1267
+ * // As an anchor — middle-click/right-click open in a new tab
1268
+ * <NeoMenuItem href="/api-explorer">API explorer</NeoMenuItem>
1269
+ *
1270
+ * // External link
1271
+ * <NeoMenuItem href="https://docs.example.com" target="_blank" rel="noopener noreferrer">
1272
+ * Documentation
1273
+ * </NeoMenuItem>
1274
+ *
1275
+ * // Client-side routing (Next.js)
1276
+ * <NeoMenuItem component={NextLink} href="/api-explorer">API explorer</NeoMenuItem>
1258
1277
  * ```
1259
1278
  */
1260
- declare const NeoMenuItem: {
1261
- ({ icon, shortcut, secondaryText, children, ...props }: NeoMenuItemProps): react_jsx_runtime.JSX.Element;
1262
- displayName: string;
1263
- };
1279
+ declare function NeoMenuItem<C extends ElementType = typeof MenuItem>({ icon, shortcut, secondaryText, children, ...rest }: NeoMenuItemProps<C>): react_jsx_runtime.JSX.Element;
1280
+ declare namespace NeoMenuItem {
1281
+ var displayName: string;
1282
+ }
1264
1283
 
1265
1284
  type NeoSelectProps = SelectProps;
1266
1285
  /**
@@ -1502,12 +1521,6 @@ interface NeoGeneralAvatarProps extends Omit<AvatarProps, 'variant'> {
1502
1521
  * @figma Size
1503
1522
  */
1504
1523
  size?: AvatarSize;
1505
- /**
1506
- * Color index for initials background (1-7). Use 0 or omit for image mode.
1507
- * @default 0
1508
- * @figma Color Index
1509
- */
1510
- colorIndex?: number;
1511
1524
  }
1512
1525
  /**
1513
1526
  * NeoGeneralAvatar - Avatar with image or colored initials display
@@ -1515,7 +1528,7 @@ interface NeoGeneralAvatarProps extends Omit<AvatarProps, 'variant'> {
1515
1528
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=9600-185
1516
1529
  */
1517
1530
  declare const NeoGeneralAvatar: {
1518
- ({ size, colorIndex, children, ...props }: NeoGeneralAvatarProps): react_jsx_runtime.JSX.Element;
1531
+ ({ size, alt, children, ...props }: NeoGeneralAvatarProps): react_jsx_runtime.JSX.Element;
1519
1532
  displayName: string;
1520
1533
  };
1521
1534
 
@@ -1848,7 +1861,7 @@ interface NeoNavigationAvatarProps extends Omit<NeoGeneralAvatarProps, 'size'> {
1848
1861
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC?node-id=11325-102
1849
1862
  */
1850
1863
  declare const NeoNavigationAvatar: {
1851
- ({ colorIndex, children, ...props }: NeoNavigationAvatarProps): react_jsx_runtime.JSX.Element;
1864
+ ({ children, ...props }: NeoNavigationAvatarProps): react_jsx_runtime.JSX.Element;
1852
1865
  displayName: string;
1853
1866
  };
1854
1867