@moderneinc/design-system-components 6.0.0-rename.0
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
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @moderneinc/design-system-components
|
|
2
|
+
|
|
3
|
+
Styled MUI components for Moderne applications, built on top of `@moderneinc/design-system-tokens` design tokens.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @moderneinc/design-system-components @mui/material react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { /* components will be exported here */ } from '@moderneinc/design-system-components';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Required stylesheet
|
|
18
|
+
|
|
19
|
+
**Every component in this package renders its colours through CSS custom
|
|
20
|
+
properties.** Import the stylesheet once at your app root:
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import '@moderneinc/design-system-tokens/semantic-colors.css';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Without it, every colour resolves to an unset custom property. Nothing throws —
|
|
27
|
+
inherited properties inherit, backgrounds fall to their initial value, and SVG
|
|
28
|
+
`fill`/`stroke` fall back to black. The UI simply looks wrong.
|
|
29
|
+
|
|
30
|
+
## Dark mode
|
|
31
|
+
|
|
32
|
+
With the stylesheet imported, set `data-theme` on the document root:
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
document.documentElement.dataset.theme = 'dark' // or 'light'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Components follow automatically — no provider, no re-render. The design system deliberately
|
|
39
|
+
does not emit `@media (prefers-color-scheme: dark)`, so an app opts in when it
|
|
40
|
+
is ready rather than flipping the moment it upgrades.
|
|
41
|
+
|
|
42
|
+
If you need a literal colour — canvas, WebGL, a charting library, or colour maths
|
|
43
|
+
like `alpha()` — a CSS variable won't resolve. Use the literal-hex exports:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
import { semanticColorsLight, semanticColorsDark } from '@moderneinc/design-system-tokens';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Note that appending a hex alpha suffix no longer works, because the value is now
|
|
50
|
+
a `var()` reference rather than a hex string:
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
// Broken: yields "var(--mod-border-primary)80", which the browser discards
|
|
54
|
+
`${semanticColors.border.primary}80`
|
|
55
|
+
|
|
56
|
+
// Correct
|
|
57
|
+
`color-mix(in srgb, ${semanticColors.border.primary} 50%, transparent)`
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
This package is part of the design-system monorepo.
|
|
63
|
+
|
|
64
|
+
- **Build**: `npm run build`
|
|
65
|
+
- **Test**: `npm test`
|
|
66
|
+
- **Development**: See monorepo root for workspace commands
|
|
67
|
+
|
|
68
|
+
## Dependencies
|
|
69
|
+
|
|
70
|
+
- `@moderneinc/design-system-tokens` - Design tokens and primitives
|
|
71
|
+
- `@mui/material` - Material-UI component library
|
|
72
|
+
- `react` - React library
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
UNLICENSED - Proprietary to Moderne
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { GridDensity } from '@mui/x-data-grid';
|
|
2
|
+
/**
|
|
3
|
+
* Size variant for ActivityHeader (matches DataGrid size variants)
|
|
4
|
+
* Alias for MUI's GridDensity type
|
|
5
|
+
*/
|
|
6
|
+
export type ActivityHeaderSize = GridDensity;
|
|
7
|
+
/**
|
|
8
|
+
* Activity color type for ModActivityHeader
|
|
9
|
+
*/
|
|
10
|
+
export type ActivityColor = 'commitJob' | 'recipeRun' | 'visualization';
|
|
11
|
+
/**
|
|
12
|
+
* Props for ModActivityHeader component
|
|
13
|
+
*/
|
|
14
|
+
export interface ModActivityHeaderProps {
|
|
15
|
+
/**
|
|
16
|
+
* Size variant matching DataGrid row heights
|
|
17
|
+
* @default 'compact'
|
|
18
|
+
*/
|
|
19
|
+
size?: GridDensity;
|
|
20
|
+
/**
|
|
21
|
+
* Activity type color to display
|
|
22
|
+
* @default 'commitJob'
|
|
23
|
+
*/
|
|
24
|
+
color?: ActivityColor;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ModActivityHeader - Header cell showing activity type legend for DataGrid
|
|
28
|
+
*
|
|
29
|
+
* A header cell component that displays a visual legend of activity event types
|
|
30
|
+
* using colored dots. Designed to be used as the column header for activity
|
|
31
|
+
* timeline columns in DataGrid.
|
|
32
|
+
*
|
|
33
|
+
* **Design Tokens:**
|
|
34
|
+
* - `semanticColors.activity.commitJob` - Blue dot for commit job events (#2F42FF)
|
|
35
|
+
* - `semanticColors.activity.recipeRun` - Purple dot for recipe run events (#992FB9)
|
|
36
|
+
* - `#27AA88` - Teal dot for visualization events (hardcoded - needs design token fix)
|
|
37
|
+
* - `semanticColors.border.secondary` - Bottom border (#e5e7eb)
|
|
38
|
+
* - `spacing.spacing_1_1_2` - Dot size (12px)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // In DataGrid column definition
|
|
42
|
+
* {
|
|
43
|
+
* field: 'activity',
|
|
44
|
+
* headerName: '',
|
|
45
|
+
* width: 34,
|
|
46
|
+
* renderHeader: () => <ModActivityHeader size="condensed" color="commitJob" />,
|
|
47
|
+
* renderCell: (params) => (
|
|
48
|
+
* <ModActivityIndicatorCell
|
|
49
|
+
* event={params.row.eventType}
|
|
50
|
+
* scene={params.row.scene}
|
|
51
|
+
* />
|
|
52
|
+
* )
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
export declare const ModActivityHeader: {
|
|
56
|
+
({ size, color, }: ModActivityHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
displayName: string;
|
|
58
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const CIRCLE_RADIUS = 6;
|
|
2
|
+
/**
|
|
3
|
+
* Event type for activity indicator
|
|
4
|
+
*/
|
|
5
|
+
export type ActivityEvent = 'commit-job' | 'recipe-run' | 'visualization' | 'none';
|
|
6
|
+
/**
|
|
7
|
+
* Scene types based on moderne-ui ActivityRowScenes
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ActivityScene {
|
|
10
|
+
BLANK = "blank",
|
|
11
|
+
CIRCLE = "circle",
|
|
12
|
+
CIRCLE_WITH_RIGHT_PATH = "circle-with-right-path",
|
|
13
|
+
CIRCLE_WITH_TOP_PATH = "circle-with-top-path",
|
|
14
|
+
CIRCLE_WITH_TOP_AND_BOTTOM_PATH = "circle-with-top-and-bottom-path",
|
|
15
|
+
PATH_CORNER = "path-corner",
|
|
16
|
+
PATH_CORNER_WITH_HORIZONTAL = "path-corner-with-horizontal",
|
|
17
|
+
PATH_VERTICAL = "path-vertical",
|
|
18
|
+
PATH_HORIZONTAL = "path-horizontal"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for ModActivityIndicatorCell component
|
|
22
|
+
*/
|
|
23
|
+
export interface ModActivityIndicatorCellProps {
|
|
24
|
+
/**
|
|
25
|
+
* Type of activity event (determines color for circle/dot)
|
|
26
|
+
*/
|
|
27
|
+
event?: ActivityEvent;
|
|
28
|
+
/**
|
|
29
|
+
* Secondary event type for path color (e.g., when a recipe-run connects to a commit-job)
|
|
30
|
+
* If not specified, paths use the primary event color
|
|
31
|
+
*/
|
|
32
|
+
secondaryEvent?: ActivityEvent;
|
|
33
|
+
/**
|
|
34
|
+
* Scene to render (combines shapes and paths)
|
|
35
|
+
*/
|
|
36
|
+
scene?: ActivityScene;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to show the event dot
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
showDot?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* ModActivityIndicatorCell - Timeline activity indicator for DataGrid cells
|
|
45
|
+
*
|
|
46
|
+
* Based on moderne-ui's RecentActivitySceneSelector with solid filled circles.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // In DataGrid column definition
|
|
50
|
+
* {
|
|
51
|
+
* field: 'activity',
|
|
52
|
+
* headerName: '',
|
|
53
|
+
* width: 35,
|
|
54
|
+
* renderCell: (params) => (
|
|
55
|
+
* <ModActivityIndicatorCell
|
|
56
|
+
* event="commit-job"
|
|
57
|
+
* scene={ActivityScene.CIRCLE_WITH_TOP_AND_BOTTOM_PATH}
|
|
58
|
+
* />
|
|
59
|
+
* )
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
export declare const ModActivityIndicatorCell: {
|
|
63
|
+
({ event, secondaryEvent, scene, showDot, }: ModActivityIndicatorCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type AlertProps } from '@mui/material/Alert';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
type Intent = 'success' | 'error' | 'warning' | 'offline' | 'info';
|
|
4
|
+
type AlertType = 'outlined' | 'filled';
|
|
5
|
+
type AlertSize = 'default' | 'compact';
|
|
6
|
+
export interface ModAlertProps extends Omit<AlertProps, 'severity' | 'variant' | 'color'> {
|
|
7
|
+
/**
|
|
8
|
+
* The intent/purpose of the alert
|
|
9
|
+
* @default "success"
|
|
10
|
+
*/
|
|
11
|
+
intent?: Intent;
|
|
12
|
+
/**
|
|
13
|
+
* Visual type: outlined (light bg) or filled (solid bg)
|
|
14
|
+
* @default "outlined"
|
|
15
|
+
*/
|
|
16
|
+
type?: AlertType;
|
|
17
|
+
/**
|
|
18
|
+
* Vertical density. `default` is page-level (64px fixed height,
|
|
19
|
+
* supports title + description). `compact` is inline-panel use
|
|
20
|
+
* (auto height, 40px min, single-line optimized for terse messages).
|
|
21
|
+
* @default "default"
|
|
22
|
+
*/
|
|
23
|
+
size?: AlertSize;
|
|
24
|
+
/**
|
|
25
|
+
* The title text displayed in the alert
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional supporting description text
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Custom icon to display (defaults to intent-based icon)
|
|
34
|
+
*/
|
|
35
|
+
icon?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Optional action element (typically a button) displayed on the right
|
|
38
|
+
*/
|
|
39
|
+
action?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Optional content rendered below the title inside the alert container.
|
|
42
|
+
* Use for rich content like stack traces or code blocks. When present,
|
|
43
|
+
* the alert expands to auto height and top-aligns its icon and action.
|
|
44
|
+
*/
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* ModAlert - Alert component for displaying contextual status messages
|
|
49
|
+
*/
|
|
50
|
+
export declare const ModAlert: {
|
|
51
|
+
({ intent, type, size, title, description, icon, action, children, ...props }: ModAlertProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
displayName: string;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ChipProps } from '@mui/material/Chip';
|
|
2
|
+
type BadgeSize = 'small' | 'medium';
|
|
3
|
+
type BadgeVariant = 'filled' | 'outlined';
|
|
4
|
+
type BadgeShape = 'square' | 'rounded';
|
|
5
|
+
export interface ModBadgeProps extends Omit<ChipProps, 'variant' | 'size'> {
|
|
6
|
+
/**
|
|
7
|
+
* The color/state of the badge. Ignored when `variant="outlined"`.
|
|
8
|
+
* @default "default"
|
|
9
|
+
*/
|
|
10
|
+
color?: 'default' | 'error' | 'warning' | 'success' | 'info';
|
|
11
|
+
/**
|
|
12
|
+
* Visual density of the badge. `small` is 20px tall, `medium` is 24px tall.
|
|
13
|
+
* @default "medium"
|
|
14
|
+
*/
|
|
15
|
+
size?: BadgeSize;
|
|
16
|
+
/**
|
|
17
|
+
* Visual treatment. `filled` uses a per-color tinted background;
|
|
18
|
+
* `outlined` uses a transparent background with a neutral secondary border.
|
|
19
|
+
* @default "filled"
|
|
20
|
+
*/
|
|
21
|
+
variant?: BadgeVariant;
|
|
22
|
+
/**
|
|
23
|
+
* Corner treatment. `square` = borderRadius.xS, `rounded` = borderRadius.full.
|
|
24
|
+
* Deliberately defaults to `square` even though Figma's Shape default differs —
|
|
25
|
+
* this keeps existing consumers rendering unchanged. Don't "fix" it.
|
|
26
|
+
* @default "square"
|
|
27
|
+
*/
|
|
28
|
+
shape?: BadgeShape;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ModBadge - Status badge component based on MUI Chip
|
|
32
|
+
*
|
|
33
|
+
* `deleteIcon` still works via ChipProps — MUI renders it only when `onDelete`
|
|
34
|
+
* is also set.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ModBadge: {
|
|
37
|
+
({ size, variant, shape, ...props }: ModBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type AlertProps } from '@mui/material/Alert';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
type Intent = 'info' | 'success' | 'error' | 'warning' | 'neutral';
|
|
4
|
+
type BannerType = 'outlined' | 'filled';
|
|
5
|
+
export interface ModBannerProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
|
|
6
|
+
/**
|
|
7
|
+
* The intent/purpose of the banner
|
|
8
|
+
* @default "info"
|
|
9
|
+
*/
|
|
10
|
+
intent?: Intent;
|
|
11
|
+
/**
|
|
12
|
+
* Visual type: outlined (light bg) or filled (solid bg)
|
|
13
|
+
* @default "outlined"
|
|
14
|
+
*/
|
|
15
|
+
type?: BannerType;
|
|
16
|
+
/**
|
|
17
|
+
* The message text to display
|
|
18
|
+
*/
|
|
19
|
+
message: string;
|
|
20
|
+
/**
|
|
21
|
+
* Horizontal alignment of the message content
|
|
22
|
+
* @default "left"
|
|
23
|
+
*/
|
|
24
|
+
messagePosition?: 'left' | 'center';
|
|
25
|
+
/**
|
|
26
|
+
* Optional link text to display after the message
|
|
27
|
+
*/
|
|
28
|
+
linkText?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the close button
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showClose?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Custom icon to display (optional)
|
|
36
|
+
* If not provided, no icon will be shown
|
|
37
|
+
*/
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when close button is clicked
|
|
41
|
+
*/
|
|
42
|
+
onClose?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when link text is clicked
|
|
45
|
+
*/
|
|
46
|
+
onLinkClick?: () => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const ModBanner: {
|
|
49
|
+
({ intent, type, message, messagePosition, linkText, showClose, icon, onClose, onLinkClick, ...props }: ModBannerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type LinkProps } from '@mui/material/Link';
|
|
2
|
+
import type { ElementType, ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* ModBreadcrumbs - Navigation breadcrumb component
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4563-122872
|
|
7
|
+
*/
|
|
8
|
+
export interface ModBreadcrumbsProps {
|
|
9
|
+
/** Breadcrumb items as Link elements */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Additional CSS classes */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ModBreadcrumbLinkProps extends Omit<LinkProps, 'color'> {
|
|
15
|
+
/** Marks this breadcrumb as the current page (sets aria-current="page") */
|
|
16
|
+
current?: boolean;
|
|
17
|
+
/** Link content */
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Custom link component for client-side navigation (e.g., Next.js Link) */
|
|
20
|
+
component?: ElementType;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* ModBreadcrumbLink - Individual breadcrumb link
|
|
24
|
+
*
|
|
25
|
+
* Use this component as children of ModBreadcrumbs to create breadcrumb items.
|
|
26
|
+
* Set `current` prop on the last item to indicate the current page.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <ModBreadcrumbs>
|
|
31
|
+
* <ModBreadcrumbLink href="/settings">Settings</ModBreadcrumbLink>
|
|
32
|
+
* <ModBreadcrumbLink href="/team">Team</ModBreadcrumbLink>
|
|
33
|
+
* <ModBreadcrumbLink current>Team Details</ModBreadcrumbLink>
|
|
34
|
+
* </ModBreadcrumbs>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function ModBreadcrumbLink({ current, children, component, ...props }: ModBreadcrumbLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* ModBreadcrumbs - Navigation breadcrumb component
|
|
40
|
+
*
|
|
41
|
+
* Provides hierarchical navigation with styled links and chevron separators.
|
|
42
|
+
* Use ModBreadcrumbLink components as children to create breadcrumb items.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <ModBreadcrumbs>
|
|
47
|
+
* <ModBreadcrumbLink href="/settings">Settings</ModBreadcrumbLink>
|
|
48
|
+
* <ModBreadcrumbLink href="/team">Team</ModBreadcrumbLink>
|
|
49
|
+
* <ModBreadcrumbLink current>Team Details</ModBreadcrumbLink>
|
|
50
|
+
* </ModBreadcrumbs>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function ModBreadcrumbs({ children, className }: ModBreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import ButtonBase from '@mui/material/ButtonBase';
|
|
2
|
+
import React, { type ElementType, type ReactNode } from 'react';
|
|
3
|
+
declare module '@mui/material/ButtonBase' {
|
|
4
|
+
interface ButtonBasePropsVariantOverrides {
|
|
5
|
+
primary: true;
|
|
6
|
+
secondary: true;
|
|
7
|
+
destructive: true;
|
|
8
|
+
tertiary: true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'tertiary';
|
|
12
|
+
type ButtonSize = 'small' | 'medium';
|
|
13
|
+
type ModButtonOwnProps = {
|
|
14
|
+
/**
|
|
15
|
+
* The visual variant of the button
|
|
16
|
+
* @default "primary"
|
|
17
|
+
*/
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
/**
|
|
20
|
+
* The size of the button
|
|
21
|
+
* @default "medium"
|
|
22
|
+
*/
|
|
23
|
+
size?: ButtonSize;
|
|
24
|
+
/**
|
|
25
|
+
* Show loading spinner instead of children
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Button content
|
|
31
|
+
*/
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* URL to link to. When provided, the button renders as a link element.
|
|
35
|
+
*/
|
|
36
|
+
href?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Icon placed before the button label
|
|
39
|
+
*/
|
|
40
|
+
startIcon?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Icon placed after the button label
|
|
43
|
+
*/
|
|
44
|
+
endIcon?: ReactNode;
|
|
45
|
+
};
|
|
46
|
+
export type ModButtonProps<C extends ElementType = typeof ButtonBase> = ModButtonOwnProps & Omit<React.ComponentPropsWithoutRef<C>, keyof ModButtonOwnProps> & {
|
|
47
|
+
component?: C;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* ModButton - Text button component based on MUI ButtonBase
|
|
51
|
+
*/
|
|
52
|
+
export declare function ModButton<C extends ElementType = typeof ButtonBase>({ variant, size, loading, children, disabled, startIcon, endIcon, ...rest }: ModButtonProps<C>): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare namespace ModButton {
|
|
54
|
+
var displayName: string;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ToggleButtonProps as MuiToggleButtonProps } from '@mui/material/ToggleButton';
|
|
2
|
+
export interface ModButtonTabProps extends Omit<MuiToggleButtonProps, 'color'> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the tab is currently selected.
|
|
5
|
+
* When used inside ModButtonGroup, this is computed automatically from the group's value.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ModButtonTab - A tab-style toggle button for use within ModButtonGroup
|
|
12
|
+
*/
|
|
13
|
+
export declare const ModButtonTab: {
|
|
14
|
+
({ children, ...props }: ModButtonTabProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ToggleButtonGroupProps as MuiToggleButtonGroupProps } from '@mui/material/ToggleButtonGroup';
|
|
2
|
+
type ButtonTabGroupSize = 'small' | 'medium';
|
|
3
|
+
export interface ModButtonTabGroupProps extends Omit<MuiToggleButtonGroupProps, 'orientation' | 'color' | 'fullWidth'> {
|
|
4
|
+
/**
|
|
5
|
+
* The size of the button tab group
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: ButtonTabGroupSize;
|
|
9
|
+
/**
|
|
10
|
+
* Whether only one button can be selected at a time
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
exclusive?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ModButtonTabGroup - Button tab group container
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ModButtonTabGroup value={selected} onChange={(_, val) => setSelected(val)} size="medium">
|
|
21
|
+
* <ModButtonTab value="tab1">Tab 1</ModButtonTab>
|
|
22
|
+
* <ModButtonTab value="tab2">Tab 2</ModButtonTab>
|
|
23
|
+
* <ModButtonTab value="tab3">Tab 3</ModButtonTab>
|
|
24
|
+
* </ModButtonTabGroup>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const ModButtonTabGroup: {
|
|
28
|
+
({ size, exclusive, ...props }: ModButtonTabGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SvgIconProps } from '@mui/material/SvgIcon';
|
|
2
|
+
/**
|
|
3
|
+
* ModCanceledIcon - Outlined circle struck through by a horizontal line.
|
|
4
|
+
*
|
|
5
|
+
* Marks a CANCELED state. Color comes entirely from `currentColor` (stroke plus
|
|
6
|
+
* a 10% fill tint); set it via the `color`/`sx` prop or a parent.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ModCanceledIcon: {
|
|
9
|
+
(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CardProps } from '@mui/material/Card';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export type ModCardSize = 'small' | 'large';
|
|
4
|
+
export interface ModCardSmallProps extends Omit<CardProps, 'children' | 'title'> {
|
|
5
|
+
size: 'small';
|
|
6
|
+
logo: ReactNode;
|
|
7
|
+
recipeCount: string;
|
|
8
|
+
title: ReactNode | string;
|
|
9
|
+
description: string;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface ModCardLargeProps extends Omit<CardProps, 'children' | 'title'> {
|
|
15
|
+
size: 'large';
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
cardTheme?: 'light' | 'dark';
|
|
18
|
+
showIcon?: boolean;
|
|
19
|
+
showGel?: boolean;
|
|
20
|
+
showButtons?: boolean;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
gel?: ReactNode;
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export type ModCardProps = ModCardSmallProps | ModCardLargeProps;
|
|
29
|
+
export declare const ModCard: {
|
|
30
|
+
(props: ModCardProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type CheckboxProps } from '@mui/material/Checkbox';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* ModCheckbox uses Lucide icons (square / square-check / square-minus): a rounded
|
|
5
|
+
* outline drawn in `currentColor`, with the check/minus mark sharing that stroke —
|
|
6
|
+
* so a single per-state `color` (set in StyledCheckbox) drives every variant.
|
|
7
|
+
*
|
|
8
|
+
* Checkbox sizes: xs=12x12, small=16x16, medium=20x20
|
|
9
|
+
*/
|
|
10
|
+
type CheckboxSize = 'xs' | 'small' | 'medium';
|
|
11
|
+
declare module '@mui/material/Checkbox' {
|
|
12
|
+
interface CheckboxPropsSizeOverrides {
|
|
13
|
+
xs: true;
|
|
14
|
+
small: true;
|
|
15
|
+
medium: true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
declare const StyledCheckbox: import("@emotion/styled").StyledComponent<CheckboxProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
19
|
+
size?: CheckboxSize;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
export interface ModCheckboxProps extends Omit<CheckboxProps, 'size'> {
|
|
23
|
+
/**
|
|
24
|
+
* The size of the checkbox
|
|
25
|
+
* @default "medium"
|
|
26
|
+
*/
|
|
27
|
+
size?: CheckboxSize;
|
|
28
|
+
/**
|
|
29
|
+
* The label text displayed next to the checkbox
|
|
30
|
+
*/
|
|
31
|
+
label?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* The helper text displayed below the label
|
|
34
|
+
*/
|
|
35
|
+
helperText?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* ModCheckbox - Checkbox component based on MUI Checkbox
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Basic checkbox
|
|
42
|
+
* <ModCheckbox />
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // With label
|
|
46
|
+
* <ModCheckbox label="Remember me" />
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // With label and helper text
|
|
50
|
+
* <ModCheckbox label="Remember me" helperText="Save my login details for next time." />
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Small size
|
|
54
|
+
* <ModCheckbox size="small" label="Remember me" />
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* // Extra small size
|
|
58
|
+
* <ModCheckbox size="xs" label="Remember me" />
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Controlled
|
|
62
|
+
* <ModCheckbox checked={isChecked} onChange={handleChange} label="Remember me" />
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Indeterminate state (for "select all" checkboxes)
|
|
66
|
+
* <ModCheckbox indeterminate={true} label="Select all" />
|
|
67
|
+
*/
|
|
68
|
+
export declare const ModCheckbox: {
|
|
69
|
+
({ size, label, helperText, disabled, icon, checkedIcon, indeterminateIcon, className, ...props }: ModCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
displayName: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Base styled checkbox component without label wrapper
|
|
74
|
+
* Used internally by ModCheckbox and directly in DataGrid
|
|
75
|
+
*
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
export { StyledCheckbox as ModCheckboxBase };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type ModCheckboxProps } from '../Checkbox/Checkbox';
|
|
3
|
+
type CheckboxWithTextSize = 'small' | 'medium';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the ModCheckboxWithText component
|
|
6
|
+
*/
|
|
7
|
+
export interface ModCheckboxWithTextProps extends Omit<ModCheckboxProps, 'size'> {
|
|
8
|
+
/**
|
|
9
|
+
* The size of the checkbox with text
|
|
10
|
+
* @default "small"
|
|
11
|
+
*/
|
|
12
|
+
size?: CheckboxWithTextSize;
|
|
13
|
+
/**
|
|
14
|
+
* The label text displayed next to the checkbox
|
|
15
|
+
*/
|
|
16
|
+
label?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The helper text displayed below the label
|
|
19
|
+
*/
|
|
20
|
+
helperText?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* ModCheckboxWithText - Checkbox with label and supporting text
|
|
24
|
+
*
|
|
25
|
+
* Thin wrapper around ModCheckbox that maps the Figma "Checkbox with text"
|
|
26
|
+
* component to the existing ModCheckbox with label + helperText.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ModCheckboxWithText: {
|
|
29
|
+
({ size, ...props }: ModCheckboxWithTextProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
export {};
|