@moderneinc/neo-styled-components 5.0.0-next.3c20d2 → 5.0.0-next.3dfbc7

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/Dot/Dot.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { type BadgeProps } from '@mui/material/Badge';
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
2
  type DotSize = 'small' | 'medium' | 'large';
3
3
  type DotVariant = 'solid' | 'outline';
4
4
  type DotColor = 'success' | 'error' | 'warning' | 'info' | 'neutral';
5
- export interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'badgeContent' | 'children'> {
5
+ export interface NeoDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
6
6
  /**
7
7
  * The size of the dot
8
8
  * @default "medium"
@@ -18,9 +18,16 @@ export interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'bad
18
18
  * @default "neutral"
19
19
  */
20
20
  color?: DotColor;
21
+ /**
22
+ * Optional icon rendered centered inside the dot. Use to indicate intent within
23
+ * the dot itself (e.g., a minus icon on a disconnected error dot). SVG children
24
+ * using `currentColor` inherit a white stroke/fill for contrast against the
25
+ * colored background, and are scaled to 70% of the dot size.
26
+ */
27
+ children?: ReactNode;
21
28
  }
22
29
  /**
23
- * NeoDot - Status indicator dot component based on MUI Badge
30
+ * NeoDot - Status indicator dot.
24
31
  *
25
32
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4163-3577
26
33
  *
@@ -30,7 +37,7 @@ export interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'bad
30
37
  * - Color is configurable via color prop (success|error|warning|info|neutral)
31
38
  */
32
39
  export declare const NeoDot: {
33
- ({ size, variant, color, ...props }: NeoDotProps): import("react/jsx-runtime").JSX.Element;
40
+ ({ size, variant, color, children, ...props }: NeoDotProps): import("react/jsx-runtime").JSX.Element;
34
41
  displayName: string;
35
42
  };
36
43
  export {};
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ import * as _mui_material_styles from '@mui/material/styles';
16
16
  import { SxProps, Theme, Breakpoint } from '@mui/material/styles';
17
17
  import { DividerProps } from '@mui/material/Divider';
18
18
  import { PaperProps } from '@mui/material/Paper';
19
- import { BadgeProps } from '@mui/material/Badge';
20
19
  import { AvatarProps } from '@mui/material/Avatar';
21
20
  import { InputBaseProps } from '@mui/material/InputBase';
22
21
  import { MenuProps } from '@mui/material/Menu';
@@ -1414,7 +1413,7 @@ declare const NeoDownloadToast: {
1414
1413
  type DotSize = 'small' | 'medium' | 'large';
1415
1414
  type DotVariant = 'solid' | 'outline';
1416
1415
  type DotColor = 'success' | 'error' | 'warning' | 'info' | 'neutral';
1417
- interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'badgeContent' | 'children'> {
1416
+ interface NeoDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
1418
1417
  /**
1419
1418
  * The size of the dot
1420
1419
  * @default "medium"
@@ -1430,9 +1429,16 @@ interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'badgeConte
1430
1429
  * @default "neutral"
1431
1430
  */
1432
1431
  color?: DotColor;
1432
+ /**
1433
+ * Optional icon rendered centered inside the dot. Use to indicate intent within
1434
+ * the dot itself (e.g., a minus icon on a disconnected error dot). SVG children
1435
+ * using `currentColor` inherit a white stroke/fill for contrast against the
1436
+ * colored background, and are scaled to 70% of the dot size.
1437
+ */
1438
+ children?: ReactNode;
1433
1439
  }
1434
1440
  /**
1435
- * NeoDot - Status indicator dot component based on MUI Badge
1441
+ * NeoDot - Status indicator dot.
1436
1442
  *
1437
1443
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4163-3577
1438
1444
  *
@@ -1442,7 +1448,7 @@ interface NeoDotProps extends Omit<BadgeProps, 'variant' | 'color' | 'badgeConte
1442
1448
  * - Color is configurable via color prop (success|error|warning|info|neutral)
1443
1449
  */
1444
1450
  declare const NeoDot: {
1445
- ({ size, variant, color, ...props }: NeoDotProps): react_jsx_runtime.JSX.Element;
1451
+ ({ size, variant, color, children, ...props }: NeoDotProps): react_jsx_runtime.JSX.Element;
1446
1452
  displayName: string;
1447
1453
  };
1448
1454
 
package/dist/index.esm.js CHANGED
@@ -36,7 +36,6 @@ import { pickersCalendarHeaderClasses } from '@mui/x-date-pickers/PickersCalenda
36
36
  import { PickersShortcuts } from '@mui/x-date-pickers/PickersShortcuts';
37
37
  import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
38
38
  import { dateRangePickerDayClasses } from '@mui/x-date-pickers-pro/DateRangePickerDay';
39
- import Badge, { badgeClasses } from '@mui/material/Badge';
40
39
  import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
41
40
  import Paper, { paperClasses } from '@mui/material/Paper';
42
41
  import Stack from '@mui/material/Stack';
@@ -3788,26 +3787,34 @@ const sizeMap = {
3788
3787
  medium: 10,
3789
3788
  large: 12,
3790
3789
  };
3791
- const StyledBadge = styled(Badge)(({ ownerState }) => {
3790
+ const StyledDot = styled('span', {
3791
+ shouldForwardProp: prop => prop !== 'ownerState',
3792
+ })(({ ownerState }) => {
3792
3793
  const size = sizeMap[ownerState.size];
3793
- const color = semanticColors.status[ownerState.color].default;
3794
+ const palette = semanticColors.status[ownerState.color];
3794
3795
  return {
3795
- [`& .${badgeClasses.badge}`]: {
3796
- width: size,
3797
- height: size,
3798
- minWidth: size,
3799
- borderRadius: ownerState.variant === 'solid' ? '50%' : 0,
3800
- padding: 0,
3801
- backgroundColor: ownerState.variant === 'solid' ? color : 'transparent',
3802
- // Remove default badge positioning - make it standalone
3803
- position: 'static',
3804
- transform: 'none',
3805
- overflow: 'visible',
3796
+ display: 'inline-flex',
3797
+ alignItems: 'center',
3798
+ justifyContent: 'center',
3799
+ width: size,
3800
+ height: size,
3801
+ minWidth: size,
3802
+ borderRadius: '50%',
3803
+ flexShrink: 0,
3804
+ boxSizing: 'border-box',
3805
+ backgroundColor: palette.default,
3806
+ color: semanticColors.typography.tooltip,
3807
+ ...(ownerState.variant === 'outline' && {
3808
+ border: `3px solid ${palette.light}`,
3809
+ }),
3810
+ '& > svg': {
3811
+ width: '70%',
3812
+ height: '70%',
3806
3813
  },
3807
3814
  };
3808
3815
  });
3809
3816
  /**
3810
- * NeoDot - Status indicator dot component based on MUI Badge
3817
+ * NeoDot - Status indicator dot.
3811
3818
  *
3812
3819
  * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4163-3577
3813
3820
  *
@@ -3816,26 +3823,8 @@ const StyledBadge = styled(Badge)(({ ownerState }) => {
3816
3823
  * - outline (False|True) → variant prop (solid|outline)
3817
3824
  * - Color is configurable via color prop (success|error|warning|info|neutral)
3818
3825
  */
3819
- const NeoDot = ({ size = 'medium', variant = 'solid', color = 'neutral', ...props }) => {
3820
- const dotSize = sizeMap[size];
3821
- const mediumColor = semanticColors.status[color].default;
3822
- const lightColor = semanticColors.status[color].light;
3823
- // For outline variant, use SVG for precise control
3824
- const renderDot = () => {
3825
- if (variant === 'outline') {
3826
- // SVG approach: outer circle with light fill, inner circle with medium fill
3827
- // Stroke width of ~3px creates the ring effect
3828
- const strokeWidth = 3;
3829
- const radius = dotSize / 2;
3830
- const innerRadius = radius - strokeWidth;
3831
- return (jsxs("svg", { width: dotSize, height: dotSize, viewBox: `0 0 ${dotSize} ${dotSize}`, style: {
3832
- display: 'block',
3833
- borderRadius: '50%',
3834
- }, role: "img", "aria-label": `${color} status indicator`, children: [jsx("title", { children: `${color} status indicator` }), jsx("circle", { cx: radius, cy: radius, r: radius, fill: lightColor }), jsx("circle", { cx: radius, cy: radius, r: innerRadius, fill: mediumColor })] }));
3835
- }
3836
- return jsx("span", { style: { display: 'inline-block', width: 0, height: 0 } });
3837
- };
3838
- return (jsx(StyledBadge, { ...props, ownerState: { size, variant, color }, variant: "dot", children: renderDot() }));
3826
+ const NeoDot = ({ size = 'medium', variant = 'solid', color = 'neutral', children, ...props }) => {
3827
+ return (jsx(StyledDot, { ...props, ownerState: { size, variant, color }, role: "img", "aria-label": props['aria-label'] ?? `${color} status indicator`, children: children }));
3839
3828
  };
3840
3829
  NeoDot.displayName = 'NeoDot';
3841
3830