@moderneinc/design-system-components 6.0.0-next.02da4a
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/README.md +76 -0
- package/dist/ActivityHeader/ActivityHeader.d.ts +58 -0
- package/dist/ActivityIndicatorCell/ActivityIndicatorCell.d.ts +65 -0
- package/dist/Alert/Alert.d.ts +54 -0
- package/dist/Badge/Badge.d.ts +40 -0
- package/dist/Banner/Banner.d.ts +52 -0
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +53 -0
- package/dist/Button/Button.d.ts +56 -0
- package/dist/ButtonTab/ButtonTab.d.ts +16 -0
- package/dist/ButtonTabGroup/ButtonTabGroup.d.ts +31 -0
- package/dist/CanceledIcon/CanceledIcon.d.ts +11 -0
- package/dist/Card/Card.d.ts +32 -0
- package/dist/Checkbox/Checkbox.d.ts +78 -0
- package/dist/CheckboxWithText/CheckboxWithText.d.ts +32 -0
- package/dist/CodeSnippet/CodeSnippet.d.ts +38 -0
- package/dist/DataGrid/DataGrid.d.ts +58 -0
- package/dist/DataGrid/DataGrid.styles.d.ts +14 -0
- package/dist/DataGridCell/DataGridCell.d.ts +120 -0
- package/dist/DataGridColumnsButton/DataGridColumnsButton.d.ts +15 -0
- package/dist/DataGridColumnsPanel/DataGridColumnsPanel.d.ts +31 -0
- package/dist/DataGridFilterPanel/DataGridFilterPanel.d.ts +55 -0
- package/dist/DataGridFiltersButton/DataGridFiltersButton.d.ts +16 -0
- package/dist/DataGridHeaderCell/DataGridHeaderCell.d.ts +8 -0
- package/dist/DataGridHeaderLabel/DataGridHeaderLabel.d.ts +17 -0
- package/dist/DatePicker/DatePicker.d.ts +97 -0
- package/dist/DatePickerListItem/DatePickerListItem.d.ts +4 -0
- package/dist/DatePickerMenu/DatePickerMenu.d.ts +4 -0
- package/dist/DateTimeCell/DateTimeCell.d.ts +17 -0
- package/dist/Divider/Divider.d.ts +30 -0
- package/dist/Dot/Dot.d.ts +36 -0
- package/dist/DownloadToast/DownloadToast.d.ts +45 -0
- package/dist/DropdownInputField/DropdownInputField.d.ts +17 -0
- package/dist/EmptyState/EmptyState.d.ts +17 -0
- package/dist/FilledStatusIcons/FilledStatusIcons.d.ts +41 -0
- package/dist/FilterChip/FilterChip.d.ts +40 -0
- package/dist/Footer/Footer.d.ts +111 -0
- package/dist/GeneralAvatar/GeneralAvatar.d.ts +23 -0
- package/dist/IconButton/IconButton.d.ts +42 -0
- package/dist/IconWrapper/IconWrapper.d.ts +20 -0
- package/dist/InfiniteScrollGrid/InfiniteScrollGrid.d.ts +44 -0
- package/dist/InputField/InputField.d.ts +65 -0
- package/dist/LinkCell/LinkCell.d.ts +17 -0
- package/dist/ListItem/ListItem.d.ts +71 -0
- package/dist/ListItemButton/ListItemButton.d.ts +64 -0
- package/dist/LoadingSpinner/LoadingSpinner.d.ts +28 -0
- package/dist/Menu/Menu.d.ts +30 -0
- package/dist/MenuItem/MenuItem.d.ts +69 -0
- package/dist/ModActionsCell/ModActionsCell.d.ts +9 -0
- package/dist/ModAvatarCell/ModAvatarCell.d.ts +24 -0
- package/dist/ModIconCell/ModIconCell.d.ts +13 -0
- package/dist/ModLogoCell/ModLogoCell.d.ts +23 -0
- package/dist/ModProgressCell/ModProgressCell.d.ts +20 -0
- package/dist/ModStatusCell/ModStatusCell.d.ts +29 -0
- package/dist/Modal/Modal.d.ts +106 -0
- package/dist/NavIconButton/NavIconButton.d.ts +17 -0
- package/dist/NavigationAvatar/NavigationAvatar.d.ts +13 -0
- package/dist/NavigationItem/NavigationItem.d.ts +55 -0
- package/dist/PageContent/PageContent.d.ts +150 -0
- package/dist/PaginatedGrid/PaginatedGrid.d.ts +32 -0
- package/dist/ProgressSpinner/ProgressSpinner.d.ts +17 -0
- package/dist/Progressbar/Progressbar.d.ts +35 -0
- package/dist/QuickFilter/QuickFilter.d.ts +42 -0
- package/dist/Radio/Radio.d.ts +59 -0
- package/dist/RadioButtonWithText/RadioButtonWithText.d.ts +4 -0
- package/dist/RipplingDot/RipplingDot.d.ts +12 -0
- package/dist/SearchChip/SearchChip.d.ts +17 -0
- package/dist/Select/Select.d.ts +24 -0
- package/dist/SelectField/SelectField.d.ts +64 -0
- package/dist/SideNav/ModSideNavContext.d.ts +5 -0
- package/dist/SideNav/SideNav.d.ts +33 -0
- package/dist/Skeleton/Skeleton.d.ts +29 -0
- package/dist/TabPanel/TabPanel.d.ts +47 -0
- package/dist/Table/Table.d.ts +64 -0
- package/dist/Tabs/Tabs.d.ts +28 -0
- package/dist/Tag/Tag.d.ts +51 -0
- package/dist/Toast/Toast.d.ts +66 -0
- package/dist/Toggle/Toggle.d.ts +52 -0
- package/dist/ToggleButton/ToggleButton.d.ts +34 -0
- package/dist/ToggleButtonGroup/ToggleButtonGroup.d.ts +33 -0
- package/dist/ToggleButtonWithText/ToggleButtonWithText.d.ts +4 -0
- package/dist/Toolbar/Toolbar.d.ts +51 -0
- package/dist/Tooltip/Tooltip.d.ts +46 -0
- package/dist/TopNav/TopNav.d.ts +4 -0
- package/dist/TourModal/TourModal.d.ts +4 -0
- package/dist/Tree/Tree.d.ts +38 -0
- package/dist/TypologyControl/TypologyControl.d.ts +19 -0
- package/dist/VibratingDot/VibratingDot.d.ts +12 -0
- package/dist/index.d.ts +3147 -0
- package/dist/index.esm.js +7414 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +7527 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/colorHelpers.d.ts +7 -0
- package/dist/utils/focusRing.d.ts +10 -0
- package/dist/utils/muiProps.d.ts +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InputBaseProps } from '@mui/material/InputBase';
|
|
2
|
+
export interface ModSearchChipProps extends Omit<InputBaseProps, 'startAdornment' | 'endAdornment' | 'type'> {
|
|
3
|
+
/**
|
|
4
|
+
* Handler for clearing the search value (shows X icon when provided and value is non-empty)
|
|
5
|
+
*/
|
|
6
|
+
onClear?: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* ModSearchChip - Pill-shaped search input for inline search functionality.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <ModSearchChip placeholder="Search titles" value={query} onChange={handleChange} onClear={handleClear} />
|
|
13
|
+
*/
|
|
14
|
+
export declare const ModSearchChip: {
|
|
15
|
+
({ onClear, value, ...props }: ModSearchChipProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SelectProps as MuiSelectProps } from '@mui/material/Select';
|
|
2
|
+
import { ModMenuItem } from '../MenuItem/MenuItem';
|
|
3
|
+
export type ModSelectProps = MuiSelectProps;
|
|
4
|
+
/**
|
|
5
|
+
* ModSelect - Select component with design system styling
|
|
6
|
+
*
|
|
7
|
+
* A styled version of MUI's Select that uses design system tokens, Lucide ChevronDown icon,
|
|
8
|
+
* and ModMenu/ModMenuItem for the dropdown list.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { ModSelect, ModSelectOption } from '@moderneinc/design-system-components'
|
|
13
|
+
*
|
|
14
|
+
* <ModSelect value={value} onChange={handleChange}>
|
|
15
|
+
* <ModSelectOption value="option1">Option 1</ModSelectOption>
|
|
16
|
+
* <ModSelectOption value="option2">Option 2</ModSelectOption>
|
|
17
|
+
* </ModSelect>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const ModSelect: {
|
|
21
|
+
(props: ModSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
export { ModMenuItem as ModSelectOption };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { SelectChangeEvent, SelectProps } from '@mui/material/Select';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { type ModInputFieldSize } from '../InputField/InputField';
|
|
4
|
+
import { ModSelectOption } from '../Select/Select';
|
|
5
|
+
export interface ModSelectFieldOption {
|
|
6
|
+
value: string | number;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ModSelectFieldProps extends Omit<SelectProps, 'size' | 'variant' | 'error' | 'children'> {
|
|
11
|
+
/**
|
|
12
|
+
* Form-control size.
|
|
13
|
+
* @default 'medium'
|
|
14
|
+
*/
|
|
15
|
+
size?: ModInputFieldSize;
|
|
16
|
+
/**
|
|
17
|
+
* Show error/destructive state with red label + helper text styling.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
destructive?: boolean;
|
|
21
|
+
/** Label text rendered above the select. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Show required indicator (asterisk) next to the label. @default false */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Optional info icon rendered next to the label. */
|
|
26
|
+
infoIcon?: ReactNode;
|
|
27
|
+
/** Helper text rendered below the select (normal state). */
|
|
28
|
+
helperText?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Error message rendered below the select when `destructive` is true.
|
|
31
|
+
* Takes precedence over helperText when destructive.
|
|
32
|
+
*/
|
|
33
|
+
errorMessage?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Convenience option list. Each entry becomes a ModSelectOption.
|
|
36
|
+
* Use `children` instead for custom option content.
|
|
37
|
+
*/
|
|
38
|
+
options?: ModSelectFieldOption[];
|
|
39
|
+
/** Custom option content. Overrides `options` if both are provided. */
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* ModSelectField — composite of ModInputField's form chrome (label,
|
|
44
|
+
* helper text, error state) wrapped around ModSelect. Mirrors the
|
|
45
|
+
* MUI `<TextField select>` ergonomics with design system tokens, so
|
|
46
|
+
* consumers don't have to compose the two manually.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* <ModSelectField
|
|
50
|
+
* label="Response format"
|
|
51
|
+
* value={format}
|
|
52
|
+
* onChange={e => setFormat(e.target.value)}
|
|
53
|
+
* options={[
|
|
54
|
+
* { value: 'json', label: 'JSON' },
|
|
55
|
+
* { value: 'plain', label: 'Plain text' },
|
|
56
|
+
* ]}
|
|
57
|
+
* />
|
|
58
|
+
*/
|
|
59
|
+
export declare const ModSelectField: {
|
|
60
|
+
({ size, destructive, label, required, infoIcon, helperText, errorMessage, options, children, disabled, id, ...selectProps }: ModSelectFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
63
|
+
export { ModSelectOption };
|
|
64
|
+
export type ModSelectFieldChangeEvent<T = unknown> = SelectChangeEvent<T>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export type ModSideNavProps = {
|
|
3
|
+
/** Controlled collapsed state. */
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
/** Called with the next collapsed value when the edge-handle is activated. */
|
|
6
|
+
onCollapsedChange: (next: boolean) => void;
|
|
7
|
+
/** Fixed top slot (e.g. product logo). */
|
|
8
|
+
header?: ReactNode;
|
|
9
|
+
/** Fixed bottom slot (e.g. tenant branding). */
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
/** Scrolling content slot — the nav items. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
} & Pick<ComponentPropsWithoutRef<'nav'>, 'className' | 'id' | 'aria-label'>;
|
|
14
|
+
/**
|
|
15
|
+
* ModSideNav
|
|
16
|
+
*
|
|
17
|
+
* Collapsible vertical navigation rail with fixed `header`/`footer` slots and a
|
|
18
|
+
* scrolling content area. Controlled via `collapsed` + `onCollapsedChange`;
|
|
19
|
+
* broadcasts collapsed state to descendant `ModNavigationItem`s through context.
|
|
20
|
+
*
|
|
21
|
+
* The scroll area's top and bottom edges fade into the fixed slots, each fade
|
|
22
|
+
* appearing only while there is content to scroll toward in that direction.
|
|
23
|
+
*
|
|
24
|
+
* A chevron handle on the rail's trailing edge (beside the tenant-logo row)
|
|
25
|
+
* toggles the controlled state. Consumers that want the rail to auto-collapse
|
|
26
|
+
* on viewport changes compute `collapsed` themselves (e.g. via `useMediaQuery`)
|
|
27
|
+
* and pass it in — see the `AutoCollapseOnResize` Storybook story for the
|
|
28
|
+
* pattern.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ModSideNav({ collapsed, onCollapsedChange, header, footer, children, className, id, 'aria-label': ariaLabel, }: ModSideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare namespace ModSideNav {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SkeletonProps } from '@mui/material/Skeleton';
|
|
2
|
+
/**
|
|
3
|
+
* Extended props for ModSkeleton component
|
|
4
|
+
*/
|
|
5
|
+
export interface ModSkeletonProps extends Omit<SkeletonProps, 'variant' | 'animation'> {
|
|
6
|
+
/**
|
|
7
|
+
* Color theme variant for the skeleton
|
|
8
|
+
* @default "light"
|
|
9
|
+
*/
|
|
10
|
+
colorTheme?: 'light' | 'dark';
|
|
11
|
+
/**
|
|
12
|
+
* Animation position (direction)
|
|
13
|
+
* @default "start"
|
|
14
|
+
*/
|
|
15
|
+
position?: 'start' | 'end';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ModSkeleton - Loading skeleton component based on MUI Skeleton
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <ModSkeleton width={200} height={32} />
|
|
23
|
+
* <ModSkeleton colorTheme="dark" position="end" width={200} height={32} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const ModSkeleton: {
|
|
27
|
+
({ colorTheme, position, ...props }: ModSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type BoxProps } from '@mui/material/Box';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
type TabPanelVariant = 'default' | 'flush';
|
|
4
|
+
export interface ModTabPanelProps extends Omit<BoxProps, 'role'> {
|
|
5
|
+
/** This panel's identity — must match `currentValue` for the panel to render. */
|
|
6
|
+
value: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* The currently selected tab value. When equal to `value`, this panel
|
|
9
|
+
* renders its children. Otherwise the panel is hidden (and removed from
|
|
10
|
+
* the accessibility tree via `hidden`).
|
|
11
|
+
*/
|
|
12
|
+
currentValue: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* Layout density.
|
|
15
|
+
* - `default`: 16px top padding — for standard content tabs.
|
|
16
|
+
* - `flush`: zero padding — for full-bleed sidebar/panel/canvas layouts
|
|
17
|
+
* where content must sit flush against the tab bar's bottom border.
|
|
18
|
+
* @default 'default'
|
|
19
|
+
*/
|
|
20
|
+
variant?: TabPanelVariant;
|
|
21
|
+
/** Panel content. */
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ModTabPanel — completes the ModTabs + ModTab + ModTabPanel set.
|
|
26
|
+
*
|
|
27
|
+
* Lightweight ARIA-compliant tab panel that renders children when its
|
|
28
|
+
* `value` matches `currentValue`. No MUI Lab / TabContext dependency.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const [tab, setTab] = useState('overview')
|
|
32
|
+
* return (
|
|
33
|
+
* <>
|
|
34
|
+
* <ModTabs value={tab} onChange={(_, v) => setTab(v)}>
|
|
35
|
+
* <ModTab value="overview" label="Overview" />
|
|
36
|
+
* <ModTab value="details" label="Details" />
|
|
37
|
+
* </ModTabs>
|
|
38
|
+
* <ModTabPanel value="overview" currentValue={tab}>...</ModTabPanel>
|
|
39
|
+
* <ModTabPanel value="details" currentValue={tab} variant="flush">...</ModTabPanel>
|
|
40
|
+
* </>
|
|
41
|
+
* )
|
|
42
|
+
*/
|
|
43
|
+
export declare const ModTabPanel: {
|
|
44
|
+
({ value, currentValue, variant, children, ...boxProps }: ModTabPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TableProps } from '@mui/material/Table';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
type TableSize = 'small' | 'medium';
|
|
4
|
+
type TableVariant = 'bordered' | 'plain';
|
|
5
|
+
type CellAlign = 'left' | 'center' | 'right';
|
|
6
|
+
export interface ModTableColumn {
|
|
7
|
+
/** Unique key — looked up against each row to find the cell value. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Header label rendered in the thead. */
|
|
10
|
+
header: ReactNode;
|
|
11
|
+
/** Cell text alignment. @default 'left' */
|
|
12
|
+
align?: CellAlign;
|
|
13
|
+
/** Column width — any CSS length (e.g. '120px', '20%'). */
|
|
14
|
+
width?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ModTableProps extends Omit<TableProps, 'size'> {
|
|
17
|
+
/** Column definitions. Order in the array determines render order. */
|
|
18
|
+
columns: ModTableColumn[];
|
|
19
|
+
/**
|
|
20
|
+
* Row data. Each row is a record keyed by `column.key`. Cell values
|
|
21
|
+
* may be any ReactNode (strings, badges, icons, etc.).
|
|
22
|
+
*/
|
|
23
|
+
rows: Array<Record<string, ReactNode>>;
|
|
24
|
+
/**
|
|
25
|
+
* Cell density.
|
|
26
|
+
* - 'small': tight padding for dense lists.
|
|
27
|
+
* - 'medium': comfortable padding for read-heavy tables.
|
|
28
|
+
* @default 'small'
|
|
29
|
+
*/
|
|
30
|
+
size?: TableSize;
|
|
31
|
+
/**
|
|
32
|
+
* Container chrome.
|
|
33
|
+
* - 'bordered': container border + borderRadius.card.
|
|
34
|
+
* - 'plain': no container chrome — for embedding inside an existing surface.
|
|
35
|
+
* @default 'bordered'
|
|
36
|
+
*/
|
|
37
|
+
variant?: TableVariant;
|
|
38
|
+
/** Optional accessible label for the table. */
|
|
39
|
+
ariaLabel?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ModTable — lightweight read-only table for static data (schema rows,
|
|
43
|
+
* key/value summaries, response metadata). For interactive grids with
|
|
44
|
+
* sorting / filtering / pagination, use ModDataGrid instead.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <ModTable
|
|
48
|
+
* columns={[
|
|
49
|
+
* { key: 'name', header: 'Property' },
|
|
50
|
+
* { key: 'type', header: 'Type', align: 'center', width: '120px' },
|
|
51
|
+
* { key: 'description', header: 'Description' },
|
|
52
|
+
* ]}
|
|
53
|
+
* rows={[
|
|
54
|
+
* { name: 'id', type: 'string', description: 'Resource identifier' },
|
|
55
|
+
* { name: 'count', type: 'number', description: 'Item count' },
|
|
56
|
+
* ]}
|
|
57
|
+
* size="small"
|
|
58
|
+
* />
|
|
59
|
+
*/
|
|
60
|
+
export declare const ModTable: {
|
|
61
|
+
({ columns, rows, size, variant, ariaLabel, ...tableProps }: ModTableProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type TabProps } from '@mui/material/Tab';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* ModTabs - Tabs container component based on MUI Tabs
|
|
5
|
+
*/
|
|
6
|
+
export declare const ModTabs: import("@emotion/styled").StyledComponent<import("@mui/material").TabsOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style" | "children" | "sx" | "className" | "aria-label" | "aria-labelledby" | "onChange" | "classes" | "action" | "value" | "variant" | "orientation" | "slots" | "slotProps" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "scrollButtons" | "selectionFollowsFocus" | "textColor" | "visibleScrollbar"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
7
|
+
export interface ModTabProps extends Omit<TabProps, 'label'> {
|
|
8
|
+
/**
|
|
9
|
+
* The label for the tab
|
|
10
|
+
*/
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional count to display in a tag next to the label
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
count?: number | string;
|
|
17
|
+
/**
|
|
18
|
+
* Tab value identifier
|
|
19
|
+
*/
|
|
20
|
+
value: string | number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* ModTab - Individual tab button component based on MUI Tab
|
|
24
|
+
*/
|
|
25
|
+
export declare const ModTab: {
|
|
26
|
+
({ label, count, ...props }: ModTabProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import Chip, { type ChipProps } from '@mui/material/Chip';
|
|
2
|
+
import type { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
3
|
+
declare module '@mui/material/Chip' {
|
|
4
|
+
interface ChipPropsColorOverrides {
|
|
5
|
+
violet: true;
|
|
6
|
+
beta: true;
|
|
7
|
+
}
|
|
8
|
+
interface ChipPropsSizeOverrides {
|
|
9
|
+
large: true;
|
|
10
|
+
}
|
|
11
|
+
interface ChipPropsVariantOverrides {
|
|
12
|
+
outlined: true;
|
|
13
|
+
filled: true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
type TagShape = 'square' | 'rounded';
|
|
17
|
+
export type ModTagOwnProps = {
|
|
18
|
+
/**
|
|
19
|
+
* The size of the tag
|
|
20
|
+
* @default "small"
|
|
21
|
+
*/
|
|
22
|
+
size?: 'small' | 'medium' | 'large';
|
|
23
|
+
/**
|
|
24
|
+
* The variant style of the tag
|
|
25
|
+
* @default "outlined"
|
|
26
|
+
*/
|
|
27
|
+
variant?: 'outlined' | 'filled';
|
|
28
|
+
/**
|
|
29
|
+
* The intent/purpose of the tag
|
|
30
|
+
* @default "default"
|
|
31
|
+
*/
|
|
32
|
+
intent?: 'default' | 'error' | 'warning' | 'success' | 'info' | 'violet' | 'beta';
|
|
33
|
+
/**
|
|
34
|
+
* Corner treatment. `square` = borderRadius.xS, `rounded` = borderRadius.full.
|
|
35
|
+
* Deliberately defaults to `square` even though Figma's Shape default differs —
|
|
36
|
+
* this keeps existing consumers rendering unchanged. Don't "fix" it.
|
|
37
|
+
* @default "square"
|
|
38
|
+
*/
|
|
39
|
+
shape?: TagShape;
|
|
40
|
+
};
|
|
41
|
+
export type ModTagProps<C extends ElementType = typeof Chip> = ModTagOwnProps & Omit<ChipProps, keyof ModTagOwnProps | 'component' | 'color'> & Omit<ComponentPropsWithoutRef<C>, keyof ModTagOwnProps | keyof ChipProps> & {
|
|
42
|
+
component?: C;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* ModTag - Small label component based on MUI Chip
|
|
46
|
+
*/
|
|
47
|
+
export declare function ModTag<C extends ElementType = typeof Chip>({ size, variant, intent, shape, ...props }: ModTagProps<C>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare namespace ModTag {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type AlertProps } from '@mui/material/Alert';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
type Intent = 'neutral' | 'info' | 'success' | 'error' | 'warning';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The Figma design no longer has Filled/Outlined styles. Retained for API
|
|
7
|
+
* compatibility only; all toasts render the single tinted style.
|
|
8
|
+
*/
|
|
9
|
+
type ToastType = 'outlined' | 'filled';
|
|
10
|
+
export interface ModToastProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
|
|
11
|
+
/**
|
|
12
|
+
* The intent/purpose of the toast
|
|
13
|
+
* @default "neutral"
|
|
14
|
+
*/
|
|
15
|
+
intent?: Intent;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated The Figma design no longer has Filled/Outlined styles. Ignored; all
|
|
18
|
+
* toasts render the single tinted style.
|
|
19
|
+
*/
|
|
20
|
+
type?: ToastType;
|
|
21
|
+
/**
|
|
22
|
+
* The title/header text
|
|
23
|
+
*/
|
|
24
|
+
title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The body/supporting text
|
|
27
|
+
*/
|
|
28
|
+
message?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the close button
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showClose?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Custom action buttons (for default toast types)
|
|
36
|
+
* Pass action buttons as children of this prop
|
|
37
|
+
*/
|
|
38
|
+
actions?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when close button is clicked
|
|
41
|
+
*/
|
|
42
|
+
onClose?: () => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* ModToast - Notification/Toast component based on MUI Alert
|
|
46
|
+
*/
|
|
47
|
+
export declare const ModToast: {
|
|
48
|
+
({ intent, type: _type, title, message, showClose, actions, onClose, ...props }: ModToastProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Helper component for creating toast action buttons with proper styling
|
|
53
|
+
*/
|
|
54
|
+
export declare const ModToastButton: {
|
|
55
|
+
({ primary, intent, type: _type, children, ...props }: {
|
|
56
|
+
primary?: boolean;
|
|
57
|
+
intent?: Intent;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated The Figma design no longer has Filled/Outlined styles. Ignored.
|
|
60
|
+
*/
|
|
61
|
+
type?: ToastType;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
} & Omit<React.ComponentProps<typeof Button>, "variant" | "type">): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type SwitchProps } from '@mui/material/Switch';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
declare module '@mui/material/Switch' {
|
|
4
|
+
interface SwitchPropsSizeOverrides {
|
|
5
|
+
small: true;
|
|
6
|
+
medium: true;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
type ToggleSize = 'small' | 'medium';
|
|
10
|
+
export interface ModToggleProps extends Omit<SwitchProps, 'size'> {
|
|
11
|
+
/**
|
|
12
|
+
* The size of the toggle
|
|
13
|
+
* @default "medium"
|
|
14
|
+
*/
|
|
15
|
+
size?: ToggleSize;
|
|
16
|
+
/**
|
|
17
|
+
* The label text displayed next to the toggle
|
|
18
|
+
*/
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The helper text displayed below the label
|
|
22
|
+
*/
|
|
23
|
+
helperText?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* ModToggle - Binary on/off switch component based on MUI Switch
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Basic toggle
|
|
30
|
+
* <ModToggle />
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With label
|
|
34
|
+
* <ModToggle label="Remember me" />
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // With label and helper text
|
|
38
|
+
* <ModToggle label="Remember me" helperText="Save my login details for next time." />
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Small size
|
|
42
|
+
* <ModToggle size="small" label="Remember me" />
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Controlled
|
|
46
|
+
* <ModToggle checked={isChecked} onChange={handleChange} label="Remember me" />
|
|
47
|
+
*/
|
|
48
|
+
export declare const ModToggle: {
|
|
49
|
+
({ size, label, helperText, disabled, ...props }: ModToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ToggleButtonProps as MuiToggleButtonProps } from '@mui/material/ToggleButton';
|
|
2
|
+
type ToggleButtonSize = 'small' | 'medium';
|
|
3
|
+
/**
|
|
4
|
+
* Visual style of the toggle. Set automatically by ModToggleButtonGroup.
|
|
5
|
+
* - `default`: buttons fill a bordered pill; selected is a tinted band.
|
|
6
|
+
* - `segmented`: buttons are raised pills on a sunken track; selected lifts to
|
|
7
|
+
* the card surface in accent text (the Morpheus segmented control).
|
|
8
|
+
*/
|
|
9
|
+
export type ToggleButtonVariant = 'default' | 'segmented';
|
|
10
|
+
export interface ModToggleButtonProps extends Omit<MuiToggleButtonProps, 'color' | 'size'> {
|
|
11
|
+
/**
|
|
12
|
+
* Size of the toggle button. Set automatically by ModToggleButtonGroup
|
|
13
|
+
* when used as a child; set explicitly only for standalone use.
|
|
14
|
+
* @default 'medium'
|
|
15
|
+
*/
|
|
16
|
+
size?: ToggleButtonSize;
|
|
17
|
+
/**
|
|
18
|
+
* Visual style. Set automatically by ModToggleButtonGroup; set explicitly
|
|
19
|
+
* only for standalone use.
|
|
20
|
+
* @default 'default'
|
|
21
|
+
*/
|
|
22
|
+
variant?: ToggleButtonVariant;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ModToggleButton — a single button in a segmented control. Use inside
|
|
26
|
+
* ModToggleButtonGroup; the group manages selection state and forwards
|
|
27
|
+
* size and variant to its children. Suitable for inline toolbar mode switches
|
|
28
|
+
* ("Table" / "Raw"). For page-level tabs, prefer ModButtonTab.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ModToggleButton: {
|
|
31
|
+
({ children, size, variant, ...props }: ModToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ToggleButtonGroupProps as MuiToggleButtonGroupProps } from '@mui/material/ToggleButtonGroup';
|
|
2
|
+
import { type ToggleButtonVariant } from '../ToggleButton/ToggleButton';
|
|
3
|
+
type ToggleButtonGroupSize = 'small' | 'medium';
|
|
4
|
+
export interface ModToggleButtonGroupProps extends Omit<MuiToggleButtonGroupProps, 'orientation' | 'color' | 'size' | 'fullWidth'> {
|
|
5
|
+
/**
|
|
6
|
+
* Size of the buttons in the group. Forwarded to each ModToggleButton child.
|
|
7
|
+
* @default 'medium'
|
|
8
|
+
*/
|
|
9
|
+
size?: ToggleButtonGroupSize;
|
|
10
|
+
/**
|
|
11
|
+
* Visual style, forwarded to each child. `segmented` renders raised pills on
|
|
12
|
+
* a sunken track with the selected pill lifted to the card surface in accent
|
|
13
|
+
* text (Morpheus). `default` is a bordered pill with a tinted selection.
|
|
14
|
+
* @default 'default'
|
|
15
|
+
*/
|
|
16
|
+
variant?: ToggleButtonVariant;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* ModToggleButtonGroup — segmented control wrapping MUI ToggleButtonGroup with
|
|
20
|
+
* design system tokens. Use for inline toolbar mode switches (e.g. "Table" / "Raw" in a
|
|
21
|
+
* panel header). For page-level tab navigation, prefer ModButtonTabGroup.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <ModToggleButtonGroup value={mode} exclusive onChange={(_, v) => v && setMode(v)} variant="segmented" size="small">
|
|
25
|
+
* <ModToggleButton value="table">Table</ModToggleButton>
|
|
26
|
+
* <ModToggleButton value="raw">Raw</ModToggleButton>
|
|
27
|
+
* </ModToggleButtonGroup>
|
|
28
|
+
*/
|
|
29
|
+
export declare const ModToggleButtonGroup: {
|
|
30
|
+
({ size, variant, children, ...props }: ModToggleButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModToggleButtonWithText
|
|
3
|
+
*/
|
|
4
|
+
export declare const ModToggleButtonWithText: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ToolbarProps } from '@mui/x-data-grid';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface ModToolbarProps extends ToolbarProps {
|
|
4
|
+
/**
|
|
5
|
+
* Toolbar content (typically ModQuickFilter, ModButton, ModToggle, etc.)
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ModToolbar - Styled toolbar component for data grid controls
|
|
11
|
+
*
|
|
12
|
+
* A composable toolbar component that provides consistent styling for data grid toolbars.
|
|
13
|
+
* Uses justify-space-between layout. Wrap left-side controls in a Box with gap, and right-side
|
|
14
|
+
* controls in another Box.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Basic toolbar with search
|
|
18
|
+
* <ModToolbar>
|
|
19
|
+
* <Box sx={{ display: 'flex', gap: 2, alignItems: 'center' }}>
|
|
20
|
+
* <ModQuickFilter placeholder="Search..." />
|
|
21
|
+
* </Box>
|
|
22
|
+
* </ModToolbar>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Full toolbar with left controls and right actions
|
|
26
|
+
* <ModToolbar>
|
|
27
|
+
* <Box sx={{ display: 'flex', gap: 2, alignItems: 'center' }}>
|
|
28
|
+
* <ModQuickFilter placeholder="Search..." />
|
|
29
|
+
* <ModButton variant="secondary" size="small">
|
|
30
|
+
* <SlidersHorizontal size={20} />
|
|
31
|
+
* Filters
|
|
32
|
+
* <ModTag label="4" variant="filled" color="info" />
|
|
33
|
+
* </ModButton>
|
|
34
|
+
* <ModButton variant="secondary" size="small">
|
|
35
|
+
* <Columns3 size={16} />
|
|
36
|
+
* Columns
|
|
37
|
+
* </ModButton>
|
|
38
|
+
* <ModToggle size="small" label="Toggle option" checked={true} />
|
|
39
|
+
* </Box>
|
|
40
|
+
* <Box sx={{ display: 'flex', gap: 2, alignItems: 'center', height: 40 }}>
|
|
41
|
+
* <ModButton variant="secondary" size="small">
|
|
42
|
+
* Actions
|
|
43
|
+
* <ChevronDown size={16} />
|
|
44
|
+
* </ModButton>
|
|
45
|
+
* </Box>
|
|
46
|
+
* </ModToolbar>
|
|
47
|
+
*/
|
|
48
|
+
export declare const ModToolbar: {
|
|
49
|
+
({ children, ...props }: ModToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Variant type for ModTooltip
|
|
5
|
+
*/
|
|
6
|
+
type TooltipVariant = 'light' | 'dark' | 'brand';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the ModTooltip component
|
|
9
|
+
*/
|
|
10
|
+
export interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'> {
|
|
11
|
+
/**
|
|
12
|
+
* The visual style variant
|
|
13
|
+
* @default "light"
|
|
14
|
+
*/
|
|
15
|
+
variant?: TooltipVariant;
|
|
16
|
+
/**
|
|
17
|
+
* The main tooltip content. Accepts a string or any ReactNode, so callers can
|
|
18
|
+
* compose richer content when the `description` variant isn't enough.
|
|
19
|
+
*/
|
|
20
|
+
title: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Optional supporting description text. When provided, shows a larger tooltip
|
|
23
|
+
* with a heading + body hierarchy: title (13px semibold) above a muted
|
|
24
|
+
* description (12px medium).
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ModTooltip - Tooltip component following design system
|
|
31
|
+
*
|
|
32
|
+
* Provides contextual information when users hover over or focus on an element.
|
|
33
|
+
* Supports three visual variants (light, dark, brand) and optional supporting text.
|
|
34
|
+
*
|
|
35
|
+
* Design Tokens Used:
|
|
36
|
+
* - Light: surfaces.tooltip, typography.tooltip.default
|
|
37
|
+
* - Dark: surfaces.white, typography.body
|
|
38
|
+
* - Brand: surfaces.snackbarBrand, typography.linkWhite (both fixed across modes)
|
|
39
|
+
* - Shadow: neutralMedium (0px 8px 15px 0px rgba(31,41,55,0.1))
|
|
40
|
+
* - Typography: fontSize.xs (12), fontSize.caption (13), fontWeight.medium (500), fontWeight.semiBold (600)
|
|
41
|
+
*/
|
|
42
|
+
export declare const ModTooltip: {
|
|
43
|
+
({ variant, title, description, children, arrow, placement, ...props }: ModTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
export {};
|