@moderneinc/neo-styled-components 4.1.1 → 4.1.2-next.190f9a

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.
@@ -28,6 +28,6 @@ export interface NeoDataGridColumnsPanelProps extends GridColumnsPanelProps {
28
28
  showSearch?: boolean;
29
29
  }
30
30
  export declare const NeoDataGridColumnsPanel: {
31
- ({ showSearch, ...props }: NeoDataGridColumnsPanelProps): import("react/jsx-runtime").JSX.Element;
31
+ ({ showSearch, sx: _sx, theme: _theme, ...props }: NeoDataGridColumnsPanelProps): import("react/jsx-runtime").JSX.Element;
32
32
  displayName: string;
33
33
  };
@@ -1,4 +1,4 @@
1
- import { type ToolbarProps } from '@mui/x-data-grid-pro';
1
+ import { type ToolbarProps } from '@mui/x-data-grid';
2
2
  import type { ReactNode } from 'react';
3
3
  export interface NeoToolbarProps extends ToolbarProps {
4
4
  /**
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentType, ComponentPropsWithoutRef } from 'react';
4
- import { GridDensity, GridFilterPanel } from '@mui/x-data-grid';
4
+ import { GridDensity, GridFilterPanel, ToolbarProps } from '@mui/x-data-grid';
5
5
  import Chip, { ChipProps } from '@mui/material/Chip';
6
6
  import { AlertProps } from '@mui/material/Alert';
7
7
  import { LinkProps } from '@mui/material/Link';
@@ -11,7 +11,7 @@ import * as _mui_material_ToggleButton from '@mui/material/ToggleButton';
11
11
  import { ToggleButtonProps } from '@mui/material/ToggleButton';
12
12
  import { ToggleButtonGroupProps } from '@mui/material/ToggleButtonGroup';
13
13
  import { CheckboxProps } from '@mui/material/Checkbox';
14
- import { GridDensity as GridDensity$1, DataGridProProps, GridSlots, ToolbarProps, GridColumnsPanelProps } from '@mui/x-data-grid-pro';
14
+ import { GridDensity as GridDensity$1, DataGridProProps, GridSlots, GridColumnsPanelProps } from '@mui/x-data-grid-pro';
15
15
  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';
@@ -2771,7 +2771,7 @@ interface NeoDataGridColumnsPanelProps extends GridColumnsPanelProps {
2771
2771
  showSearch?: boolean;
2772
2772
  }
2773
2773
  declare const NeoDataGridColumnsPanel: {
2774
- ({ showSearch, ...props }: NeoDataGridColumnsPanelProps): react_jsx_runtime.JSX.Element;
2774
+ ({ showSearch, sx: _sx, theme: _theme, ...props }: NeoDataGridColumnsPanelProps): react_jsx_runtime.JSX.Element;
2775
2775
  displayName: string;
2776
2776
  };
2777
2777
 
package/dist/index.esm.js CHANGED
@@ -16,7 +16,8 @@ import MuiToggleButton, { toggleButtonClasses } from '@mui/material/ToggleButton
16
16
  import MuiToggleButtonGroup, { toggleButtonGroupClasses } from '@mui/material/ToggleButtonGroup';
17
17
  import MuiCard from '@mui/material/Card';
18
18
  import Checkbox, { checkboxClasses } from '@mui/material/Checkbox';
19
- import { useGridApiContext, useGridSelector, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, GridPanelWrapper, useGridApiRef, gridClasses as gridClasses$1, DataGridPro, ColumnsPanelTrigger, ToolbarButton, gridFilterModelSelector, FilterPanelTrigger, Toolbar } from '@mui/x-data-grid-pro';
19
+ import { useGridApiContext, useGridSelector, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, GridFilterPanel, gridClasses, ColumnsPanelTrigger, ToolbarButton, gridFilterModelSelector, FilterPanelTrigger, gridPaginationModelSelector, gridRowCountSelector, gridRowSelectionCountSelector, QuickFilter, QuickFilterControl, QuickFilterClear, Toolbar } from '@mui/x-data-grid';
20
+ import { useGridApiRef, DataGridPro } from '@mui/x-data-grid-pro';
20
21
  import Button, { buttonClasses } from '@mui/material/Button';
21
22
  import Divider from '@mui/material/Divider';
22
23
  import InputAdornment, { inputAdornmentClasses } from '@mui/material/InputAdornment';
@@ -25,7 +26,6 @@ import TextField from '@mui/material/TextField';
25
26
  import { formLabelClasses } from '@mui/material/FormLabel';
26
27
  import InputLabel, { inputLabelClasses } from '@mui/material/InputLabel';
27
28
  import MuiSelect, { selectClasses } from '@mui/material/Select';
28
- import { GridFilterPanel, gridClasses, useGridApiContext as useGridApiContext$1, useGridSelector as useGridSelector$1, gridPaginationModelSelector, gridRowCountSelector, gridRowSelectionCountSelector, QuickFilter, QuickFilterControl, QuickFilterClear } from '@mui/x-data-grid';
29
29
  import MenuItem, { menuItemClasses } from '@mui/material/MenuItem';
30
30
  import Tooltip, { tooltipClasses } from '@mui/material/Tooltip';
31
31
  import { dayCalendarClasses } from '@mui/x-date-pickers/DateCalendar';
@@ -2008,6 +2008,13 @@ const NeoCodeSnippet = ({ variant = 'outlined', size = 'small', endIcon, childre
2008
2008
  };
2009
2009
  NeoCodeSnippet.displayName = 'NeoCodeSnippet';
2010
2010
 
2011
+ // PanelWrapper was removed from @mui/x-data-grid-pro public API in v8.28.2
2012
+ const PanelWrapper = styled('div')({
2013
+ display: 'flex',
2014
+ flexDirection: 'column',
2015
+ flex: 1,
2016
+ '&:focus': { outline: 0 },
2017
+ });
2011
2018
  const PanelContent = styled(Box)(({ theme }) => ({
2012
2019
  display: 'flex',
2013
2020
  flexDirection: 'column',
@@ -2114,7 +2121,10 @@ const ResetButton = styled(Button)(({ theme }) => ({
2114
2121
  color: colors.grey['400'],
2115
2122
  },
2116
2123
  }));
2117
- const NeoDataGridColumnsPanel = ({ showSearch = false, ...props }) => {
2124
+ const NeoDataGridColumnsPanel = ({ showSearch = false,
2125
+ // Strip MUI-specific props to avoid dual-module Theme type conflict between
2126
+ // @mui/x-data-grid-pro (CJS) and @mui/x-data-grid (ESM) declarations
2127
+ sx: _sx, theme: _theme, ...props }) => {
2118
2128
  const apiRef = useGridApiContext();
2119
2129
  const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);
2120
2130
  const columnVisibilityModel = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
@@ -2149,7 +2159,7 @@ const NeoDataGridColumnsPanel = ({ showSearch = false, ...props }) => {
2149
2159
  };
2150
2160
  // Check if current state differs from initial/default state
2151
2161
  const hasChanges = Object.keys(columnVisibilityModel).length > 0;
2152
- return (jsx(GridPanelWrapper, { ...props, children: jsxs(PanelContent, { sx: { width: 320 }, children: [showSearch && (jsx(StyledSearchField, { placeholder: "Search", variant: "standard", value: searchText, onChange: e => setSearchText(e.target.value), slotProps: {
2162
+ return (jsx(PanelWrapper, { ...props, children: jsxs(PanelContent, { sx: { width: 320 }, children: [showSearch && (jsx(StyledSearchField, { placeholder: "Search", variant: "standard", value: searchText, onChange: e => setSearchText(e.target.value), slotProps: {
2153
2163
  input: {
2154
2164
  startAdornment: (jsx(InputAdornment, { position: "start", children: jsx(Search, {}) })),
2155
2165
  disableUnderline: true,
@@ -2710,17 +2720,17 @@ function NeoDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
2710
2720
  // Fix for MUI X 8.15.0+ scroll shadow issue - backgroundColor must be on main, not root
2711
2721
  // See: https://github.com/mui/mui-x/issues/20107
2712
2722
  // This must be set to prevent scroll shadow artifacts
2713
- [`& .${gridClasses$1.main}`]: {
2723
+ [`& .${gridClasses.main}`]: {
2714
2724
  backgroundColor: semanticColors.surfaces.white,
2715
2725
  },
2716
2726
  // White background for empty/loading overlays
2717
- [`& .${gridClasses$1.overlay}`]: {
2727
+ [`& .${gridClasses.overlay}`]: {
2718
2728
  backgroundColor: semanticColors.surfaces.white,
2719
2729
  },
2720
2730
  ...getDataGridHeaderStyles(),
2721
2731
  border: `1px solid ${semanticColors.border.secondary}`,
2722
2732
  // Style row selection checkboxes to match header (16px, proper spacing)
2723
- [`& .${gridClasses$1.cellCheckbox}`]: {
2733
+ [`& .${gridClasses.cellCheckbox}`]: {
2724
2734
  [`& .${checkboxClasses.root}`]: {
2725
2735
  padding: `${spacing.spacing_1}px`,
2726
2736
  [`& .${svgIconClasses.root}`]: {
@@ -2730,7 +2740,7 @@ function NeoDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
2730
2740
  },
2731
2741
  },
2732
2742
  // Ensure cells are vertically centered
2733
- [`& .${gridClasses$1.cell}`]: {
2743
+ [`& .${gridClasses.cell}`]: {
2734
2744
  minHeight: density === 'compact' ? 36 : density === 'comfortable' ? 52 : 44,
2735
2745
  paddingLeft: `${spacing.spacing_3}px`,
2736
2746
  paddingRight: `${spacing.spacing_3}px`,
@@ -4207,11 +4217,11 @@ const PaginationText = styled('p')(({ theme }) => ({
4207
4217
  * />
4208
4218
  */
4209
4219
  const NeoFooter = ({ variant = 'pagination', showShadow = false, loading = false, resultCount, onLoadMore, hasMore = true, paginationInfo, onPreviousPage, onNextPage, hasPreviousPage, hasNextPage, showSelected = true, children, }) => {
4210
- const apiRef = useGridApiContext$1();
4220
+ const apiRef = useGridApiContext();
4211
4221
  // Use selectors to reactively subscribe to pagination state changes
4212
- const paginationModel = useGridSelector$1(apiRef, gridPaginationModelSelector);
4213
- const rowCount = useGridSelector$1(apiRef, gridRowCountSelector);
4214
- const selectedCount = useGridSelector$1(apiRef, gridRowSelectionCountSelector);
4222
+ const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
4223
+ const rowCount = useGridSelector(apiRef, gridRowCountSelector);
4224
+ const selectedCount = useGridSelector(apiRef, gridRowSelectionCountSelector);
4215
4225
  // For pagination variant, try to derive info from DataGrid if not provided
4216
4226
  const derivePaginationInfo = () => {
4217
4227
  if (paginationInfo) {
@@ -4347,7 +4357,7 @@ function NeoInfiniteScrollGrid({ onLoadMore, hasNextPage = true, loadMoreAtScrol
4347
4357
  }
4348
4358
  const unsubscribe = apiRef.current?.subscribeEvent?.('scrollPositionChange', (e) => {
4349
4359
  if (!scrollerRef.current) {
4350
- const elem = document.querySelector(`.${gridClasses$1.virtualScroller}`);
4360
+ const elem = document.querySelector(`.${gridClasses.virtualScroller}`);
4351
4361
  if (elem) {
4352
4362
  scrollerRef.current = elem;
4353
4363
  }
@@ -4401,7 +4411,7 @@ function NeoInfiniteScrollGrid({ onLoadMore, hasNextPage = true, loadMoreAtScrol
4401
4411
  },
4402
4412
  }, sx: {
4403
4413
  // Add border at bottom of rows section (above footer)
4404
- [`& .${gridClasses$1.virtualScrollerContent}`]: {
4414
+ [`& .${gridClasses.virtualScrollerContent}`]: {
4405
4415
  borderBottom: `1px solid ${semanticColors.border.primary}`,
4406
4416
  },
4407
4417
  ...userSx,
@@ -4564,7 +4574,7 @@ const StyledFormHelperText = styled(FormHelperText, {
4564
4574
  const NeoInputField = ({ size = 'medium', destructive = false, label, required = false, infoIcon, helperText, errorMessage, startIcon, endIcon, disabled, id, ...props }) => {
4565
4575
  const inputId = id || `neo-input-${Math.random().toString(36).substring(7)}`;
4566
4576
  const helperTextId = helperText || errorMessage ? `${inputId}-helper-text` : undefined;
4567
- return (jsxs(StyledFormControl, { size: size, error: destructive, disabled: disabled, children: [label && (jsxs(StyledInputLabel, { htmlFor: inputId, size: size, infoIcon: !!infoIcon, disabled: disabled, error: destructive, children: [label, required && jsx("span", { "aria-hidden": "true", children: "*" }), infoIcon && jsx(InfoIconWrapper, { children: infoIcon })] })), jsx(StyledInputBase, { id: inputId, size: size, destructive: destructive, disabled: disabled, error: destructive, "aria-describedby": helperTextId, startAdornment: startIcon ? (jsx(InputAdornment, { position: "start", style: { paddingLeft: size === 'small' ? spacing.spacing_1_1_2 : spacing.spacing_2 }, children: startIcon })) : undefined, endAdornment: destructive ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: jsx(CircleAlert, { size: 20 }) })) : endIcon ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: endIcon })) : undefined, ...props }), (helperText || errorMessage) && (jsx(StyledFormHelperText, { id: helperTextId, error: destructive, disabled: disabled, children: destructive ? errorMessage : helperText }))] }));
4577
+ return (jsxs(StyledFormControl, { size: size, error: destructive, disabled: disabled, children: [label && (jsxs(StyledInputLabel, { htmlFor: inputId, size: size, infoIcon: !!infoIcon, disabled: disabled, error: destructive, shrink: true, children: [label, required && jsx("span", { "aria-hidden": "true", children: "*" }), infoIcon && jsx(InfoIconWrapper, { children: infoIcon })] })), jsx(StyledInputBase, { id: inputId, size: size, destructive: destructive, disabled: disabled, error: destructive, "aria-describedby": helperTextId, startAdornment: startIcon ? (jsx(InputAdornment, { position: "start", style: { paddingLeft: size === 'small' ? spacing.spacing_1_1_2 : spacing.spacing_2 }, children: startIcon })) : undefined, endAdornment: destructive ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: jsx(CircleAlert, { size: 20 }) })) : endIcon ? (jsx(InputAdornment, { position: "end", style: { paddingRight: spacing.spacing_1_1_2 }, children: endIcon })) : undefined, ...props }), (helperText || errorMessage) && (jsx(StyledFormHelperText, { id: helperTextId, error: destructive, disabled: disabled, children: destructive ? errorMessage : helperText }))] }));
4568
4578
  };
4569
4579
  NeoInputField.displayName = 'NeoInputField';
4570
4580