@moderneinc/design-system-components 6.0.1-next.96e38b → 6.0.1-next.b078e1

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,5 @@
1
- import { type GridSlotsComponent, GridFilterPanel as MuiGridFilterPanel } from '@mui/x-data-grid';
1
+ import { type GridSlotProps, type GridSlotsComponent, GridFilterPanel as MuiGridFilterPanel } from '@mui/x-data-grid';
2
2
  import type React from 'react';
3
- import { ModSelect } from '../Select/Select';
4
3
  /**
5
4
  * Icon components for DataGrid filter panel slots
6
5
  * These must be passed to the DataGrid's slots prop
@@ -17,18 +16,19 @@ export declare const ModDataGridFilterPanelRemoveAllIcon: {
17
16
  (): import("react/jsx-runtime").JSX.Element;
18
17
  displayName: string;
19
18
  };
19
+ export type ModDataGridSelectProps = GridSlotProps['baseSelect'];
20
20
  /**
21
- * ModSelect, typed for the DataGrid `baseSelect` slot.
21
+ * ModDataGridSelect - ModSelect adapted to the DataGrid `baseSelect` slot contract.
22
22
  *
23
- * The grid's own `SelectProps` shares MUI's prop names and semantics, but types
24
- * `onChange` as a bare `ChangeEventHandler` and adds `aria-*`/`data-*` index
25
- * signatures — structurally incompatible, behaviourally identical. Asserted
26
- * once here rather than at every call site; #721 tracks replacing the assertion
27
- * with a real adapter. Intersected rather than replaced so direct consumers keep
28
- * `ModSelectProps` — casting to the slot type alone drops `variant`, `MenuProps`
29
- * and the `SelectChangeEvent` signature.
23
+ * Kept structurally parallel to MUI's own `BaseSelect` (`@mui/x-data-grid/material`) so the two
24
+ * can be diffed on upgrade.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <ModDataGrid rows={rows} columns={columns} slots={{ baseSelect: ModDataGridSelect }} />
29
+ * ```
30
30
  */
31
- export declare const ModDataGridSelect: typeof ModSelect & GridSlotsComponent["baseSelect"];
31
+ export declare const ModDataGridSelect: GridSlotsComponent['baseSelect'];
32
32
  /**
33
33
  * ModDataGridFilterPanel - MUI GridFilterPanel with design system styling and Lucide icons
34
34
  *
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { GridColumnsPanelProps, GridDensity as GridDensity$1, DataGridProProps, GridSlots } from '@mui/x-data-grid-pro';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentPropsWithoutRef, ComponentType, FunctionComponent } from 'react';
5
- import { GridDensity, GridFilterPanel, GridSlotsComponent, GridRenderCellParams, ToolbarProps } from '@mui/x-data-grid';
5
+ import { GridDensity, GridFilterPanel, GridSlotsComponent, GridSlotProps, GridRenderCellParams, ToolbarProps } from '@mui/x-data-grid';
6
6
  import { AlertProps } from '@mui/material/Alert';
7
7
  import Chip, { ChipProps } from '@mui/material/Chip';
8
8
  import { LinkProps } from '@mui/material/Link';
@@ -13,7 +13,6 @@ import { SvgIconProps } from '@mui/material/SvgIcon';
13
13
  import { CardProps } from '@mui/material/Card';
14
14
  import { CheckboxProps } from '@mui/material/Checkbox';
15
15
  import { SxProps, Theme, Breakpoint } from '@mui/material/styles';
16
- import { SelectProps, SelectChangeEvent } from '@mui/material/Select';
17
16
  import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
18
17
  import { PickersShortcutsItem } from '@mui/x-date-pickers/PickersShortcuts';
19
18
  import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
@@ -31,6 +30,7 @@ import { LinearProgressProps } from '@mui/material/LinearProgress';
31
30
  import { RadioProps } from '@mui/material/Radio';
32
31
  import * as _mui_material from '@mui/material';
33
32
  import { BoxProps as BoxProps$1 } from '@mui/material';
33
+ import { SelectProps, SelectChangeEvent } from '@mui/material/Select';
34
34
  import { SkeletonProps } from '@mui/material/Skeleton';
35
35
  import { TableProps } from '@mui/material/Table';
36
36
  import * as _mui_system from '@mui/system';
@@ -1033,118 +1033,6 @@ declare namespace ModDataGridColumnsButton {
1033
1033
  var displayName: string;
1034
1034
  }
1035
1035
 
1036
- type ModMenuItemOwnProps = {
1037
- /**
1038
- * Optional icon to display on the left side
1039
- * Note: Cannot be directly mapped from Figma (ReactNode)
1040
- */
1041
- icon?: ReactNode;
1042
- /**
1043
- * Optional keyboard shortcut to display on the right side
1044
- * @example "⌘+P" or "Ctrl+K"
1045
- * Note: Cannot be directly mapped from Figma (ReactNode/string)
1046
- */
1047
- shortcut?: string;
1048
- /**
1049
- * Optional secondary text to display next to the primary label
1050
- * @example "@username" or supporting text
1051
- * Note: Cannot be directly mapped from Figma (ReactNode/string)
1052
- */
1053
- secondaryText?: string;
1054
- /**
1055
- * URL to navigate to. Supplying `href` roots the item at an anchor instead of the `li`
1056
- * MUI defaults to, so it navigates and offers the browser's open-in-new-tab on middle-
1057
- * or right-click. Pass `component` explicitly (e.g. a router link such as Next.js
1058
- * `Link`) to override that default.
1059
- *
1060
- * The anchor then sits directly inside `MenuList`'s `ul`. `role="menuitem"` keeps that
1061
- * correct for ARIA, but `ul`'s content model permits only `li`, so HTML validators and
1062
- * axe-core's `list` rule flag it. This is the pattern MUI's own docs use for link menu
1063
- * items, and what `ModListItem` already produces inside `List`.
1064
- */
1065
- href?: string;
1066
- /**
1067
- * Anchor `target`, e.g. `_blank`. Only meaningful with `href` — without one the item
1068
- * roots at `li` and this renders as an inert attribute, the same trap as #722.
1069
- */
1070
- target?: string;
1071
- /**
1072
- * Anchor `rel`, e.g. `noopener noreferrer`. Only meaningful with `href` — without one
1073
- * the item roots at `li` and this renders as an inert attribute.
1074
- */
1075
- rel?: string;
1076
- /**
1077
- * Menu item content (text label)
1078
- */
1079
- children?: ReactNode;
1080
- };
1081
- type ModMenuItemProps<C extends ElementType = typeof MenuItem> = ModMenuItemOwnProps & Omit<ComponentPropsWithoutRef<C>, keyof ModMenuItemOwnProps> & {
1082
- /**
1083
- * Root element or component. Naming one bypasses the `href` → anchor default, so pass
1084
- * a link component (`'a'`, Next.js `Link`, …) if the item still has to navigate:
1085
- * `component="div"` with an `href` renders an inert attribute. `component="button"` is
1086
- * the exception — ButtonBase promotes a `button` root to an anchor itself.
1087
- *
1088
- * @default 'li', or 'a' when `href` is set
1089
- */
1090
- component?: C;
1091
- };
1092
- /**
1093
- * ModMenuItem - Menu item component based on MUI MenuItem
1094
- *
1095
- * @example
1096
- * ```tsx
1097
- * // With icon and shortcut
1098
- * <ModMenuItem icon={<UserIcon />} shortcut="⌘+P">
1099
- * View profile
1100
- * </ModMenuItem>
1101
- *
1102
- * // With secondary text (user list pattern from Figma node 4305:41844)
1103
- * <ModMenuItem secondaryText="@phoenix">Phoenix Baker</ModMenuItem>
1104
- * <ModMenuItem secondaryText="@olivia">Olivia Rhye</ModMenuItem>
1105
- *
1106
- * // Disabled state
1107
- * <ModMenuItem disabled>Disabled item</ModMenuItem>
1108
- *
1109
- * // As an anchor — `href` alone is enough
1110
- * <ModMenuItem href="/api-explorer">API explorer</ModMenuItem>
1111
- *
1112
- * // External link
1113
- * <ModMenuItem href="https://docs.example.com" target="_blank" rel="noopener noreferrer">
1114
- * Documentation
1115
- * </ModMenuItem>
1116
- *
1117
- * // Client-side routing (Next.js) — an explicit `component` wins over the anchor default
1118
- * <ModMenuItem component={NextLink} href="/api-explorer">API explorer</ModMenuItem>
1119
- * ```
1120
- */
1121
- declare function ModMenuItem<C extends ElementType = typeof MenuItem>({ icon, shortcut, secondaryText, children, component, href, ...rest }: ModMenuItemProps<C>): react_jsx_runtime.JSX.Element;
1122
- declare namespace ModMenuItem {
1123
- var displayName: string;
1124
- }
1125
-
1126
- type ModSelectProps = SelectProps;
1127
- /**
1128
- * ModSelect - Select component with design system styling
1129
- *
1130
- * A styled version of MUI's Select that uses design system tokens, Lucide ChevronDown icon,
1131
- * and ModMenu/ModMenuItem for the dropdown list.
1132
- *
1133
- * @example
1134
- * ```tsx
1135
- * import { ModSelect, ModSelectOption } from '@moderneinc/design-system-components'
1136
- *
1137
- * <ModSelect value={value} onChange={handleChange}>
1138
- * <ModSelectOption value="option1">Option 1</ModSelectOption>
1139
- * <ModSelectOption value="option2">Option 2</ModSelectOption>
1140
- * </ModSelect>
1141
- * ```
1142
- */
1143
- declare const ModSelect: {
1144
- (props: ModSelectProps): react_jsx_runtime.JSX.Element;
1145
- displayName: string;
1146
- };
1147
-
1148
1036
  /**
1149
1037
  * Icon components for DataGrid filter panel slots
1150
1038
  * These must be passed to the DataGrid's slots prop
@@ -1161,18 +1049,19 @@ declare const ModDataGridFilterPanelRemoveAllIcon: {
1161
1049
  (): react_jsx_runtime.JSX.Element;
1162
1050
  displayName: string;
1163
1051
  };
1052
+ type ModDataGridSelectProps = GridSlotProps['baseSelect'];
1164
1053
  /**
1165
- * ModSelect, typed for the DataGrid `baseSelect` slot.
1054
+ * ModDataGridSelect - ModSelect adapted to the DataGrid `baseSelect` slot contract.
1055
+ *
1056
+ * Kept structurally parallel to MUI's own `BaseSelect` (`@mui/x-data-grid/material`) so the two
1057
+ * can be diffed on upgrade.
1166
1058
  *
1167
- * The grid's own `SelectProps` shares MUI's prop names and semantics, but types
1168
- * `onChange` as a bare `ChangeEventHandler` and adds `aria-*`/`data-*` index
1169
- * signatures — structurally incompatible, behaviourally identical. Asserted
1170
- * once here rather than at every call site; #721 tracks replacing the assertion
1171
- * with a real adapter. Intersected rather than replaced so direct consumers keep
1172
- * `ModSelectProps` — casting to the slot type alone drops `variant`, `MenuProps`
1173
- * and the `SelectChangeEvent` signature.
1059
+ * @example
1060
+ * ```tsx
1061
+ * <ModDataGrid rows={rows} columns={columns} slots={{ baseSelect: ModDataGridSelect }} />
1062
+ * ```
1174
1063
  */
1175
- declare const ModDataGridSelect: typeof ModSelect & GridSlotsComponent["baseSelect"];
1064
+ declare const ModDataGridSelect: GridSlotsComponent['baseSelect'];
1176
1065
  /**
1177
1066
  * ModDataGridFilterPanel - MUI GridFilterPanel with design system styling and Lucide icons
1178
1067
  *
@@ -1913,6 +1802,96 @@ declare const ModMenu: {
1913
1802
  displayName: string;
1914
1803
  };
1915
1804
 
1805
+ type ModMenuItemOwnProps = {
1806
+ /**
1807
+ * Optional icon to display on the left side
1808
+ * Note: Cannot be directly mapped from Figma (ReactNode)
1809
+ */
1810
+ icon?: ReactNode;
1811
+ /**
1812
+ * Optional keyboard shortcut to display on the right side
1813
+ * @example "⌘+P" or "Ctrl+K"
1814
+ * Note: Cannot be directly mapped from Figma (ReactNode/string)
1815
+ */
1816
+ shortcut?: string;
1817
+ /**
1818
+ * Optional secondary text to display next to the primary label
1819
+ * @example "@username" or supporting text
1820
+ * Note: Cannot be directly mapped from Figma (ReactNode/string)
1821
+ */
1822
+ secondaryText?: string;
1823
+ /**
1824
+ * URL to navigate to. Supplying `href` roots the item at an anchor instead of the `li`
1825
+ * MUI defaults to, so it navigates and offers the browser's open-in-new-tab on middle-
1826
+ * or right-click. Pass `component` explicitly (e.g. a router link such as Next.js
1827
+ * `Link`) to override that default.
1828
+ *
1829
+ * The anchor then sits directly inside `MenuList`'s `ul`. `role="menuitem"` keeps that
1830
+ * correct for ARIA, but `ul`'s content model permits only `li`, so HTML validators and
1831
+ * axe-core's `list` rule flag it. This is the pattern MUI's own docs use for link menu
1832
+ * items, and what `ModListItem` already produces inside `List`.
1833
+ */
1834
+ href?: string;
1835
+ /**
1836
+ * Anchor `target`, e.g. `_blank`. Only meaningful with `href` — without one the item
1837
+ * roots at `li` and this renders as an inert attribute, the same trap as #722.
1838
+ */
1839
+ target?: string;
1840
+ /**
1841
+ * Anchor `rel`, e.g. `noopener noreferrer`. Only meaningful with `href` — without one
1842
+ * the item roots at `li` and this renders as an inert attribute.
1843
+ */
1844
+ rel?: string;
1845
+ /**
1846
+ * Menu item content (text label)
1847
+ */
1848
+ children?: ReactNode;
1849
+ };
1850
+ type ModMenuItemProps<C extends ElementType = typeof MenuItem> = ModMenuItemOwnProps & Omit<ComponentPropsWithoutRef<C>, keyof ModMenuItemOwnProps> & {
1851
+ /**
1852
+ * Root element or component. Naming one bypasses the `href` → anchor default, so pass
1853
+ * a link component (`'a'`, Next.js `Link`, …) if the item still has to navigate:
1854
+ * `component="div"` with an `href` renders an inert attribute. `component="button"` is
1855
+ * the exception — ButtonBase promotes a `button` root to an anchor itself.
1856
+ *
1857
+ * @default 'li', or 'a' when `href` is set
1858
+ */
1859
+ component?: C;
1860
+ };
1861
+ /**
1862
+ * ModMenuItem - Menu item component based on MUI MenuItem
1863
+ *
1864
+ * @example
1865
+ * ```tsx
1866
+ * // With icon and shortcut
1867
+ * <ModMenuItem icon={<UserIcon />} shortcut="⌘+P">
1868
+ * View profile
1869
+ * </ModMenuItem>
1870
+ *
1871
+ * // With secondary text (user list pattern from Figma node 4305:41844)
1872
+ * <ModMenuItem secondaryText="@phoenix">Phoenix Baker</ModMenuItem>
1873
+ * <ModMenuItem secondaryText="@olivia">Olivia Rhye</ModMenuItem>
1874
+ *
1875
+ * // Disabled state
1876
+ * <ModMenuItem disabled>Disabled item</ModMenuItem>
1877
+ *
1878
+ * // As an anchor — `href` alone is enough
1879
+ * <ModMenuItem href="/api-explorer">API explorer</ModMenuItem>
1880
+ *
1881
+ * // External link
1882
+ * <ModMenuItem href="https://docs.example.com" target="_blank" rel="noopener noreferrer">
1883
+ * Documentation
1884
+ * </ModMenuItem>
1885
+ *
1886
+ * // Client-side routing (Next.js) — an explicit `component` wins over the anchor default
1887
+ * <ModMenuItem component={NextLink} href="/api-explorer">API explorer</ModMenuItem>
1888
+ * ```
1889
+ */
1890
+ declare function ModMenuItem<C extends ElementType = typeof MenuItem>({ icon, shortcut, secondaryText, children, component, href, ...rest }: ModMenuItemProps<C>): react_jsx_runtime.JSX.Element;
1891
+ declare namespace ModMenuItem {
1892
+ var displayName: string;
1893
+ }
1894
+
1916
1895
  interface ModActionsCellProps extends Omit<GridRenderCellParams, 'api'> {
1917
1896
  api?: GridRenderCellParams['api'];
1918
1897
  children: ReactNode;
@@ -2589,6 +2568,28 @@ declare const ModSearchChip: {
2589
2568
  displayName: string;
2590
2569
  };
2591
2570
 
2571
+ type ModSelectProps = SelectProps;
2572
+ /**
2573
+ * ModSelect - Select component with design system styling
2574
+ *
2575
+ * A styled version of MUI's Select that uses design system tokens, Lucide ChevronDown icon,
2576
+ * and ModMenu/ModMenuItem for the dropdown list.
2577
+ *
2578
+ * @example
2579
+ * ```tsx
2580
+ * import { ModSelect, ModSelectOption } from '@moderneinc/design-system-components'
2581
+ *
2582
+ * <ModSelect value={value} onChange={handleChange}>
2583
+ * <ModSelectOption value="option1">Option 1</ModSelectOption>
2584
+ * <ModSelectOption value="option2">Option 2</ModSelectOption>
2585
+ * </ModSelect>
2586
+ * ```
2587
+ */
2588
+ declare const ModSelect: {
2589
+ (props: ModSelectProps): react_jsx_runtime.JSX.Element;
2590
+ displayName: string;
2591
+ };
2592
+
2592
2593
  interface ModSelectFieldOption {
2593
2594
  value: string | number;
2594
2595
  label: ReactNode;
@@ -3217,4 +3218,4 @@ declare module '@mui/x-data-grid-pro' {
3217
3218
  declare const version: string
3218
3219
 
3219
3220
  export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, version };
3220
- export type { ActivityColor, ActivityEvent, ActivityHeaderSize, BreadcrumbItem, DataGridSize, IconWrapperSize, ModActionsCellProps, ModActivityHeaderProps, ModActivityIndicatorCellProps, ModAlertProps, ModAvatarCellProps, ModBadgeProps, ModBannerProps, ModBreadcrumbLinkProps, ModBreadcrumbsProps, ModButtonProps, ModButtonTabGroupProps, ModButtonTabProps, ModCardLargeProps, ModCardProps, ModCardSize, ModCardSmallProps, ModCheckboxProps, ModCheckboxWithTextProps, ModCodeSnippetProps, ModDataGridCellContentProps, ModDataGridHeaderLabelProps, ModDataGridProps, ModDatePickerProps, ModDividerProps, ModDotProps, ModDownloadToastProps, ModMenuItemProps as ModDropdownMenuItemProps, ModMenuProps as ModDropdownMenuProps, ModSelectProps as ModDropdownProps, ModFilledStatusIconProps, ModFilterChipProps, ModFooterProps, ModGeneralAvatarProps, ModIconButtonProps, ModIconCellProps, ModIconWrapperProps, ModInfiniteScrollGridProps, ModInputFieldProps, ModListItemButtonProps, ModListItemProps, ModLoadingSpinnerProps, ModLogoCellProps, ModMenuItemProps, ModMenuProps, ModModalContentProps, ModModalFooterProps, ModModalHeaderProps, ModModalProps, ModMultiBadgesCellProps, ModNavigationAvatarProps, ModNavigationItemProps, ModPageContentProps, ModPaginatedGridProps, ModProgressCellProps, ModProgressbarProps, ModQuickFilterProps, ModRadioProps, ModRipplingDotProps, ModSearchChipProps, ModSelectFieldChangeEvent, ModSelectFieldOption, ModSelectFieldProps, ModSelectProps, ModSideNavProps, ModSkeletonProps, ModStatusBadgeCellProps, ModStatusCellProps, ModStatusCellVariant, ModTabPanelProps, ModTabProps, ModTableColumn, ModTableProps, ModTagProps, ModToastProps, ModToggleButtonGroupProps, ModToggleButtonProps, ModToggleProps, ModToolbarProps, ModTooltipProps, ModTreeItemData, ModTreeItemProps, ModTreeViewProps, ModTypologyControlProps, ModUserAvatarCellProps, ModVibratingDotProps };
3221
+ export type { ActivityColor, ActivityEvent, ActivityHeaderSize, BreadcrumbItem, DataGridSize, IconWrapperSize, ModActionsCellProps, ModActivityHeaderProps, ModActivityIndicatorCellProps, ModAlertProps, ModAvatarCellProps, ModBadgeProps, ModBannerProps, ModBreadcrumbLinkProps, ModBreadcrumbsProps, ModButtonProps, ModButtonTabGroupProps, ModButtonTabProps, ModCardLargeProps, ModCardProps, ModCardSize, ModCardSmallProps, ModCheckboxProps, ModCheckboxWithTextProps, ModCodeSnippetProps, ModDataGridCellContentProps, ModDataGridHeaderLabelProps, ModDataGridProps, ModDataGridSelectProps, ModDatePickerProps, ModDividerProps, ModDotProps, ModDownloadToastProps, ModMenuItemProps as ModDropdownMenuItemProps, ModMenuProps as ModDropdownMenuProps, ModSelectProps as ModDropdownProps, ModFilledStatusIconProps, ModFilterChipProps, ModFooterProps, ModGeneralAvatarProps, ModIconButtonProps, ModIconCellProps, ModIconWrapperProps, ModInfiniteScrollGridProps, ModInputFieldProps, ModListItemButtonProps, ModListItemProps, ModLoadingSpinnerProps, ModLogoCellProps, ModMenuItemProps, ModMenuProps, ModModalContentProps, ModModalFooterProps, ModModalHeaderProps, ModModalProps, ModMultiBadgesCellProps, ModNavigationAvatarProps, ModNavigationItemProps, ModPageContentProps, ModPaginatedGridProps, ModProgressCellProps, ModProgressbarProps, ModQuickFilterProps, ModRadioProps, ModRipplingDotProps, ModSearchChipProps, ModSelectFieldChangeEvent, ModSelectFieldOption, ModSelectFieldProps, ModSelectProps, ModSideNavProps, ModSkeletonProps, ModStatusBadgeCellProps, ModStatusCellProps, ModStatusCellVariant, ModTabPanelProps, ModTabProps, ModTableColumn, ModTableProps, ModTagProps, ModToastProps, ModToggleButtonGroupProps, ModToggleButtonProps, ModToggleProps, ModToolbarProps, ModTooltipProps, ModTreeItemData, ModTreeItemProps, ModTreeViewProps, ModTypologyControlProps, ModUserAvatarCellProps, ModVibratingDotProps };
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { semanticColors, spacing, typography, borderRadius, shadows, colors, semanticColorsDark, semanticTypography } from '@moderneinc/design-system-tokens';
3
3
  import Box from '@mui/material/Box';
4
- import { styled, alpha } from '@mui/material/styles';
4
+ import { styled, useTheme, alpha } from '@mui/material/styles';
5
5
  import Chip, { chipClasses } from '@mui/material/Chip';
6
6
  import MuiAvatar from '@mui/material/Avatar';
7
7
  import SvgIcon from '@mui/material/SvgIcon';
@@ -9,7 +9,7 @@ import Alert, { alertClasses } from '@mui/material/Alert';
9
9
  import ButtonBase, { buttonBaseClasses } from '@mui/material/ButtonBase';
10
10
  import { BadgeInfo, WifiOff, TriangleAlert, CircleAlert, CircleCheckBig, X, ChevronRight, Square, SquareCheck, SquareMinus, Search, ChevronDown, Plus, Trash2, ArrowUp, ArrowDown, ChevronsUpDown, Columns3, ListFilter, HelpCircle, CalendarDays, Minus, ChevronLeft, AlertCircle, ChevronUp } from 'lucide-react';
11
11
  import IconButton, { iconButtonClasses } from '@mui/material/IconButton';
12
- import React, { useState, useRef, useCallback, useMemo, useEffect, createContext, useContext, useLayoutEffect, Children, isValidElement, cloneElement, forwardRef } from 'react';
12
+ import React, { useState, useRef, useCallback, useMemo, forwardRef, useEffect, createContext, useContext, useLayoutEffect, Children, isValidElement, cloneElement } from 'react';
13
13
  import Breadcrumbs, { breadcrumbsClasses } from '@mui/material/Breadcrumbs';
14
14
  import Link from '@mui/material/Link';
15
15
  import CircularProgress from '@mui/material/CircularProgress';
@@ -24,9 +24,11 @@ import Divider from '@mui/material/Divider';
24
24
  import InputAdornment, { inputAdornmentClasses } from '@mui/material/InputAdornment';
25
25
  import InputBase, { inputBaseClasses } from '@mui/material/InputBase';
26
26
  import TextField from '@mui/material/TextField';
27
+ import FormControl from '@mui/material/FormControl';
27
28
  import { formLabelClasses } from '@mui/material/FormLabel';
28
- import InputLabel, { inputLabelClasses } from '@mui/material/InputLabel';
29
+ import MuiInputLabel, { inputLabelClasses } from '@mui/material/InputLabel';
29
30
  import MuiSelect, { selectClasses } from '@mui/material/Select';
31
+ import { mergeSlotProps, useForkRef } from '@mui/material/utils';
30
32
  import MenuItem, { menuItemClasses } from '@mui/material/MenuItem';
31
33
  import Tooltip, { tooltipClasses } from '@mui/material/Tooltip';
32
34
  import { dayCalendarClasses } from '@mui/x-date-pickers/DateCalendar';
@@ -41,7 +43,6 @@ import { startOfDay, endOfDay, subDays, startOfMonth, subMonths, endOfMonth, sta
41
43
  import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
42
44
  import Paper, { paperClasses } from '@mui/material/Paper';
43
45
  import Stack from '@mui/material/Stack';
44
- import FormControl from '@mui/material/FormControl';
45
46
  import FormHelperText, { formHelperTextClasses } from '@mui/material/FormHelperText';
46
47
  import ListItemButton, { listItemButtonClasses } from '@mui/material/ListItemButton';
47
48
  import ListItemIcon, { listItemIconClasses } from '@mui/material/ListItemIcon';
@@ -1932,26 +1933,23 @@ const StyledSelect = styled(MuiSelect)({
1932
1933
  * </ModSelect>
1933
1934
  * ```
1934
1935
  */
1935
- const ModSelect = (props) => {
1936
- const paperSlotProps = props.MenuProps?.slotProps?.paper;
1937
- const incomingPaperSx = typeof paperSlotProps === 'function' ? undefined : paperSlotProps?.sx;
1938
- return (jsx(StyledSelect, { ...props, IconComponent: ChevronDownIcon, variant: "standard", MenuProps: {
1939
- ...props.MenuProps,
1940
- slotProps: {
1941
- ...props.MenuProps?.slotProps,
1942
- paper: {
1943
- sx: {
1944
- backgroundColor: semanticColors.surfaces.white,
1945
- borderRadius: `${borderRadius.s}px`,
1946
- border: `1px solid ${semanticColors.border.primary}`,
1947
- boxShadow: `${shadows.dropdown.x}px ${shadows.dropdown.y}px ${shadows.dropdown.blur}px ${shadows.dropdown.spread}px ${shadows.dropdown.shadow}`,
1948
- marginTop: 1,
1949
- ...incomingPaperSx,
1950
- },
1936
+ const ModSelect = (props) => (jsx(StyledSelect, { ...props, IconComponent: ChevronDownIcon, variant: "standard", MenuProps: {
1937
+ ...props.MenuProps,
1938
+ slotProps: {
1939
+ ...props.MenuProps?.slotProps,
1940
+ // Caller wins, caller `sx` last — and unlike a spread, handles `sx` arrays and the
1941
+ // callback form of `slotProps.paper`.
1942
+ paper: mergeSlotProps(props.MenuProps?.slotProps?.paper, {
1943
+ sx: {
1944
+ backgroundColor: semanticColors.surfaces.white,
1945
+ borderRadius: `${borderRadius.s}px`,
1946
+ border: `1px solid ${semanticColors.border.primary}`,
1947
+ boxShadow: `${shadows.dropdown.x}px ${shadows.dropdown.y}px ${shadows.dropdown.blur}px ${shadows.dropdown.spread}px ${shadows.dropdown.shadow}`,
1948
+ marginTop: 1,
1951
1949
  },
1952
- },
1953
- } }));
1954
- };
1950
+ }),
1951
+ },
1952
+ } }));
1955
1953
  ModSelect.displayName = 'ModSelect';
1956
1954
 
1957
1955
  /**
@@ -2075,6 +2073,10 @@ const StyledGridFilterPanel = styled(GridFilterPanel)({
2075
2073
  [`& .${gridClasses.filterForm} .${inputLabelClasses.root}.${inputLabelClasses.focused}`]: {
2076
2074
  color: semanticColors.typography.input.label,
2077
2075
  },
2076
+ // Reclaim the 16px MUI's standard Input reserves for a floating label; these sit statically.
2077
+ [`& .${gridClasses.filterForm} label + .${inputBaseClasses.root}`]: {
2078
+ marginTop: 0,
2079
+ },
2078
2080
  // Remove fieldset/legend
2079
2081
  '& fieldset': {
2080
2082
  display: 'none',
@@ -2137,17 +2139,36 @@ const StyledGridFilterPanel = styled(GridFilterPanel)({
2137
2139
  });
2138
2140
  StyledGridFilterPanel.displayName = 'StyledGridFilterPanel';
2139
2141
  /**
2140
- * ModSelect, typed for the DataGrid `baseSelect` slot.
2141
- *
2142
- * The grid's own `SelectProps` shares MUI's prop names and semantics, but types
2143
- * `onChange` as a bare `ChangeEventHandler` and adds `aria-*`/`data-*` index
2144
- * signatures — structurally incompatible, behaviourally identical. Asserted
2145
- * once here rather than at every call site; #721 tracks replacing the assertion
2146
- * with a real adapter. Intersected rather than replaced so direct consumers keep
2147
- * `ModSelectProps` — casting to the slot type alone drops `variant`, `MenuProps`
2148
- * and the `SelectChangeEvent` signature.
2142
+ * ModDataGridSelect - ModSelect adapted to the DataGrid `baseSelect` slot contract.
2143
+ *
2144
+ * Kept structurally parallel to MUI's own `BaseSelect` (`@mui/x-data-grid/material`) so the two
2145
+ * can be diffed on upgrade.
2146
+ *
2147
+ * @example
2148
+ * ```tsx
2149
+ * <ModDataGrid rows={rows} columns={columns} slots={{ baseSelect: ModDataGridSelect }} />
2150
+ * ```
2149
2151
  */
2150
- const ModDataGridSelect = ModSelect;
2152
+ const ModDataGridSelect = forwardRef(function ModDataGridSelect({ id, label, labelId, disabled, fullWidth, size, style, slotProps, material, onChange, onClose, onKeyDown, ...rest }, ref) {
2153
+ const theme = useTheme();
2154
+ const hasLabel = label !== undefined;
2155
+ // The grid omits `size` in edit cells, where MUI's adapter falls back to the theme's TextField
2156
+ // default — without this the select renders medium beside small fields.
2157
+ const computedSize = size ?? theme.components?.MuiTextField?.defaultProps?.size;
2158
+ return (jsxs(FormControl
2159
+ // Bridges Ref<HTMLElement> to FormControl's Ref<HTMLDivElement>; neither direct form typechecks.
2160
+ , {
2161
+ // Bridges Ref<HTMLElement> to FormControl's Ref<HTMLDivElement>; neither direct form typechecks.
2162
+ ref: useForkRef(ref), disabled: disabled, fullWidth: fullWidth, size: computedSize, style: style, children: [hasLabel && (jsx(MuiInputLabel, { id: labelId, htmlFor: id, variant: "standard", shrink: true, children: label })), jsx(ModSelect, { ...rest, id: id, label: label, labelId: hasLabel ? labelId : undefined, size: computedSize, displayEmpty: true, inputProps: slotProps?.htmlInput,
2163
+ // The grid types this as a ChangeEventHandler; MUI emits a SelectChangeEvent. MUI's own
2164
+ // adapter forwards it unchanged, so the divergence is only in the type.
2165
+ onChange: onChange, MenuProps: {
2166
+ // Must stay absent when absent: MUI spreads MenuProps over its own `onClose: handleClose`,
2167
+ // so an explicit `undefined` stops Escape and backdrop click closing the menu.
2168
+ ...(onClose && { onClose }),
2169
+ slotProps: { paper: { onKeyDown } },
2170
+ }, ...material })] }));
2171
+ });
2151
2172
  /**
2152
2173
  * ModDataGridFilterPanel - MUI GridFilterPanel with design system styling and Lucide icons
2153
2174
  *
@@ -3565,7 +3586,7 @@ const StyledFormControl = styled(FormControl, {
3565
3586
  width: '100%',
3566
3587
  };
3567
3588
  });
3568
- const StyledInputLabel = styled(InputLabel, {
3589
+ const StyledInputLabel = styled(MuiInputLabel, {
3569
3590
  shouldForwardProp: prop => prop !== 'size' && prop !== 'infoIcon',
3570
3591
  })(({ theme }) => ({
3571
3592
  position: 'static',