@moderneinc/neo-styled-components 0.0.0-development → 1.6.1-next.69cecf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge.d.ts +23 -0
- package/dist/Button.d.ts +59 -0
- package/dist/IconButton.d.ts +31 -0
- package/dist/Toast.d.ts +68 -0
- package/dist/index.d.ts +191 -4
- package/dist/index.esm.js +710 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +714 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +18 -0
- package/package.json +15 -6
package/dist/Badge.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ChipProps } from '@mui/material/Chip';
|
|
2
|
+
export interface NeoBadgeProps extends Omit<ChipProps, 'variant' | 'size'> {
|
|
3
|
+
/**
|
|
4
|
+
* The color/state of the badge
|
|
5
|
+
* @default "default"
|
|
6
|
+
*/
|
|
7
|
+
color?: 'default' | 'error' | 'warning' | 'success' | 'info';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* NeoBadge - Status badge component based on MUI Chip
|
|
11
|
+
*
|
|
12
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system-w--correct-set-of-tokens?node-id=4091-17230
|
|
13
|
+
*
|
|
14
|
+
* Figma Props Mapping:
|
|
15
|
+
* - state (Neutral|Error|Warning|Success|Info) → color (default|error|warning|success|info)
|
|
16
|
+
* - iconLeading → icon prop (pass React element)
|
|
17
|
+
* - iconTrailing → deleteIcon prop (pass React element)
|
|
18
|
+
* - Label → label prop
|
|
19
|
+
*/
|
|
20
|
+
export declare const NeoBadge: {
|
|
21
|
+
(props: NeoBadgeProps): import("react/jsx-dev-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ButtonBaseProps } from '@mui/material/ButtonBase';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
declare module '@mui/material/ButtonBase' {
|
|
4
|
+
interface ButtonBasePropsVariantOverrides {
|
|
5
|
+
primary: true;
|
|
6
|
+
secondary: true;
|
|
7
|
+
destructive: true;
|
|
8
|
+
link: true;
|
|
9
|
+
linkColor: true;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'link' | 'linkColor';
|
|
13
|
+
type ButtonSize = 'small' | 'medium';
|
|
14
|
+
export interface NeoButtonProps extends Omit<ButtonBaseProps, 'children'> {
|
|
15
|
+
/**
|
|
16
|
+
* The visual variant of the button
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*
|
|
19
|
+
* @figma Hierarchy
|
|
20
|
+
*/
|
|
21
|
+
variant?: ButtonVariant;
|
|
22
|
+
/**
|
|
23
|
+
* The size of the button
|
|
24
|
+
* @default "medium"
|
|
25
|
+
*
|
|
26
|
+
* @figma Size
|
|
27
|
+
*/
|
|
28
|
+
size?: ButtonSize;
|
|
29
|
+
/**
|
|
30
|
+
* Show loading spinner instead of children
|
|
31
|
+
* @default false
|
|
32
|
+
*
|
|
33
|
+
* @figma State=Loading
|
|
34
|
+
*/
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Button content
|
|
38
|
+
*/
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* NeoButton - Text button component based on MUI ButtonBase
|
|
43
|
+
*
|
|
44
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
|
|
45
|
+
*
|
|
46
|
+
* Figma Props Mapping:
|
|
47
|
+
* - Hierarchy (Primary|Secondary|Destructive|Link|Link Color) → variant prop
|
|
48
|
+
* - Size (Small|Medium) → size prop
|
|
49
|
+
* - State=Disabled → disabled prop
|
|
50
|
+
* - State=Loading → loading prop
|
|
51
|
+
* - State=Hover → CSS :hover
|
|
52
|
+
* - State=Pressed → CSS :active
|
|
53
|
+
* - State=Focused → CSS :focus-visible
|
|
54
|
+
*/
|
|
55
|
+
export declare const NeoButton: {
|
|
56
|
+
({ variant, size, loading, children, disabled, ...props }: NeoButtonProps): import("react/jsx-dev-runtime").JSX.Element;
|
|
57
|
+
displayName: string;
|
|
58
|
+
};
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type IconButtonProps } from '@mui/material/IconButton';
|
|
2
|
+
type IconButtonSize = 'small' | 'medium';
|
|
3
|
+
export interface NeoIconButtonProps extends Omit<IconButtonProps, 'color' | 'size'> {
|
|
4
|
+
/**
|
|
5
|
+
* The size of the icon button
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*
|
|
8
|
+
* @figma Size
|
|
9
|
+
*/
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* NeoIconButton - Icon-only button component based on MUI IconButton
|
|
14
|
+
*
|
|
15
|
+
* Simple, neutral icon button with transparent background and icon color states.
|
|
16
|
+
*
|
|
17
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
|
|
18
|
+
*
|
|
19
|
+
* Figma Props Mapping:
|
|
20
|
+
* - Hierarchy=Icon → Single default style (no variant prop)
|
|
21
|
+
* - Size (Small|Medium) → size prop
|
|
22
|
+
* - State=Disabled → disabled prop
|
|
23
|
+
* - State=Hover → CSS :hover
|
|
24
|
+
* - State=Pressed → CSS :active
|
|
25
|
+
* - State=Focused → CSS :focus-visible
|
|
26
|
+
*/
|
|
27
|
+
export declare const NeoIconButton: {
|
|
28
|
+
({ size, ...props }: NeoIconButtonProps): import("react/jsx-dev-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type AlertProps } from '@mui/material/Alert';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export interface NeoToastProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
|
|
5
|
+
/**
|
|
6
|
+
* The visual style variant of the toast
|
|
7
|
+
* @default "default"
|
|
8
|
+
*/
|
|
9
|
+
variant?: 'default' | 'dark' | 'brand' | 'error' | 'success' | 'info' | 'download';
|
|
10
|
+
/**
|
|
11
|
+
* The title/header text
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The body/supporting text
|
|
16
|
+
*/
|
|
17
|
+
message?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to show the close button
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
showClose?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Custom action buttons (for default toast types)
|
|
25
|
+
* Pass action buttons as children of this prop
|
|
26
|
+
*/
|
|
27
|
+
actions?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Progress value (0-100) for download variant
|
|
30
|
+
*/
|
|
31
|
+
progress?: number;
|
|
32
|
+
/**
|
|
33
|
+
* File name for download variant
|
|
34
|
+
*/
|
|
35
|
+
fileName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when close button is clicked
|
|
38
|
+
*/
|
|
39
|
+
onClose?: () => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* NeoToast - Notification/Toast component based on MUI Alert
|
|
43
|
+
*
|
|
44
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4122-37223
|
|
45
|
+
*
|
|
46
|
+
* Figma Props Mapping:
|
|
47
|
+
* - type (Light mode|Dark mode|Brand color|Error|Success|Info|Download) → variant (default|dark|brand|error|success|info|download)
|
|
48
|
+
* - header → title (string)
|
|
49
|
+
* - supportingText → message (string)
|
|
50
|
+
* - xCloseButton → showClose (boolean)
|
|
51
|
+
* - actions → actions (ReactNode)
|
|
52
|
+
* - Progress bar → progress (number 0-100)
|
|
53
|
+
*/
|
|
54
|
+
export declare const NeoToast: {
|
|
55
|
+
({ variant, title, message, showClose, actions, progress, fileName, onClose, ...props }: NeoToastProps): import("react/jsx-dev-runtime").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Helper component for creating toast action buttons with proper styling
|
|
60
|
+
*/
|
|
61
|
+
export declare const NeoToastButton: {
|
|
62
|
+
({ primary, variant, children, ...props }: {
|
|
63
|
+
primary?: boolean;
|
|
64
|
+
variant?: NeoToastProps["variant"];
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
} & Omit<React.ComponentProps<typeof Button>, "variant">): import("react/jsx-dev-runtime").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,197 @@
|
|
|
1
|
+
/// <reference path="./types.d.ts" />
|
|
2
|
+
import * as react_jsx_dev_runtime from 'react/jsx-dev-runtime';
|
|
3
|
+
import { ChipProps } from '@mui/material/Chip';
|
|
4
|
+
import { ButtonBaseProps } from '@mui/material/ButtonBase';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { IconButtonProps } from '@mui/material/IconButton';
|
|
7
|
+
import { AlertProps } from '@mui/material/Alert';
|
|
8
|
+
import Button from '@mui/material/Button';
|
|
9
|
+
|
|
10
|
+
interface NeoBadgeProps extends Omit<ChipProps, 'variant' | 'size'> {
|
|
11
|
+
/**
|
|
12
|
+
* The color/state of the badge
|
|
13
|
+
* @default "default"
|
|
14
|
+
*/
|
|
15
|
+
color?: 'default' | 'error' | 'warning' | 'success' | 'info';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* NeoBadge - Status badge component based on MUI Chip
|
|
19
|
+
*
|
|
20
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system-w--correct-set-of-tokens?node-id=4091-17230
|
|
21
|
+
*
|
|
22
|
+
* Figma Props Mapping:
|
|
23
|
+
* - state (Neutral|Error|Warning|Success|Info) → color (default|error|warning|success|info)
|
|
24
|
+
* - iconLeading → icon prop (pass React element)
|
|
25
|
+
* - iconTrailing → deleteIcon prop (pass React element)
|
|
26
|
+
* - Label → label prop
|
|
27
|
+
*/
|
|
28
|
+
declare const NeoBadge: {
|
|
29
|
+
(props: NeoBadgeProps): react_jsx_dev_runtime.JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
declare module '@mui/material/ButtonBase' {
|
|
34
|
+
interface ButtonBasePropsVariantOverrides {
|
|
35
|
+
primary: true;
|
|
36
|
+
secondary: true;
|
|
37
|
+
destructive: true;
|
|
38
|
+
link: true;
|
|
39
|
+
linkColor: true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'link' | 'linkColor';
|
|
43
|
+
type ButtonSize = 'small' | 'medium';
|
|
44
|
+
interface NeoButtonProps extends Omit<ButtonBaseProps, 'children'> {
|
|
45
|
+
/**
|
|
46
|
+
* The visual variant of the button
|
|
47
|
+
* @default "primary"
|
|
48
|
+
*
|
|
49
|
+
* @figma Hierarchy
|
|
50
|
+
*/
|
|
51
|
+
variant?: ButtonVariant;
|
|
52
|
+
/**
|
|
53
|
+
* The size of the button
|
|
54
|
+
* @default "medium"
|
|
55
|
+
*
|
|
56
|
+
* @figma Size
|
|
57
|
+
*/
|
|
58
|
+
size?: ButtonSize;
|
|
59
|
+
/**
|
|
60
|
+
* Show loading spinner instead of children
|
|
61
|
+
* @default false
|
|
62
|
+
*
|
|
63
|
+
* @figma State=Loading
|
|
64
|
+
*/
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Button content
|
|
68
|
+
*/
|
|
69
|
+
children?: ReactNode;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* NeoButton - Text button component based on MUI ButtonBase
|
|
73
|
+
*
|
|
74
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
|
|
75
|
+
*
|
|
76
|
+
* Figma Props Mapping:
|
|
77
|
+
* - Hierarchy (Primary|Secondary|Destructive|Link|Link Color) → variant prop
|
|
78
|
+
* - Size (Small|Medium) → size prop
|
|
79
|
+
* - State=Disabled → disabled prop
|
|
80
|
+
* - State=Loading → loading prop
|
|
81
|
+
* - State=Hover → CSS :hover
|
|
82
|
+
* - State=Pressed → CSS :active
|
|
83
|
+
* - State=Focused → CSS :focus-visible
|
|
84
|
+
*/
|
|
85
|
+
declare const NeoButton: {
|
|
86
|
+
({ variant, size, loading, children, disabled, ...props }: NeoButtonProps): react_jsx_dev_runtime.JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
type IconButtonSize = 'small' | 'medium';
|
|
91
|
+
interface NeoIconButtonProps extends Omit<IconButtonProps, 'color' | 'size'> {
|
|
92
|
+
/**
|
|
93
|
+
* The size of the icon button
|
|
94
|
+
* @default "medium"
|
|
95
|
+
*
|
|
96
|
+
* @figma Size
|
|
97
|
+
*/
|
|
98
|
+
size?: IconButtonSize;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* NeoIconButton - Icon-only button component based on MUI IconButton
|
|
102
|
+
*
|
|
103
|
+
* Simple, neutral icon button with transparent background and icon color states.
|
|
104
|
+
*
|
|
105
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
|
|
106
|
+
*
|
|
107
|
+
* Figma Props Mapping:
|
|
108
|
+
* - Hierarchy=Icon → Single default style (no variant prop)
|
|
109
|
+
* - Size (Small|Medium) → size prop
|
|
110
|
+
* - State=Disabled → disabled prop
|
|
111
|
+
* - State=Hover → CSS :hover
|
|
112
|
+
* - State=Pressed → CSS :active
|
|
113
|
+
* - State=Focused → CSS :focus-visible
|
|
114
|
+
*/
|
|
115
|
+
declare const NeoIconButton: {
|
|
116
|
+
({ size, ...props }: NeoIconButtonProps): react_jsx_dev_runtime.JSX.Element;
|
|
117
|
+
displayName: string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
interface NeoToastProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
|
|
121
|
+
/**
|
|
122
|
+
* The visual style variant of the toast
|
|
123
|
+
* @default "default"
|
|
124
|
+
*/
|
|
125
|
+
variant?: 'default' | 'dark' | 'brand' | 'error' | 'success' | 'info' | 'download';
|
|
126
|
+
/**
|
|
127
|
+
* The title/header text
|
|
128
|
+
*/
|
|
129
|
+
title?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The body/supporting text
|
|
132
|
+
*/
|
|
133
|
+
message?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Whether to show the close button
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
showClose?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Custom action buttons (for default toast types)
|
|
141
|
+
* Pass action buttons as children of this prop
|
|
142
|
+
*/
|
|
143
|
+
actions?: ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Progress value (0-100) for download variant
|
|
146
|
+
*/
|
|
147
|
+
progress?: number;
|
|
148
|
+
/**
|
|
149
|
+
* File name for download variant
|
|
150
|
+
*/
|
|
151
|
+
fileName?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Callback when close button is clicked
|
|
154
|
+
*/
|
|
155
|
+
onClose?: () => void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* NeoToast - Notification/Toast component based on MUI Alert
|
|
159
|
+
*
|
|
160
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4122-37223
|
|
161
|
+
*
|
|
162
|
+
* Figma Props Mapping:
|
|
163
|
+
* - type (Light mode|Dark mode|Brand color|Error|Success|Info|Download) → variant (default|dark|brand|error|success|info|download)
|
|
164
|
+
* - header → title (string)
|
|
165
|
+
* - supportingText → message (string)
|
|
166
|
+
* - xCloseButton → showClose (boolean)
|
|
167
|
+
* - actions → actions (ReactNode)
|
|
168
|
+
* - Progress bar → progress (number 0-100)
|
|
169
|
+
*/
|
|
170
|
+
declare const NeoToast: {
|
|
171
|
+
({ variant, title, message, showClose, actions, progress, fileName, onClose, ...props }: NeoToastProps): react_jsx_dev_runtime.JSX.Element;
|
|
172
|
+
displayName: string;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Helper component for creating toast action buttons with proper styling
|
|
176
|
+
*/
|
|
177
|
+
declare const NeoToastButton: {
|
|
178
|
+
({ primary, variant, children, ...props }: {
|
|
179
|
+
primary?: boolean;
|
|
180
|
+
variant?: NeoToastProps["variant"];
|
|
181
|
+
children: ReactNode;
|
|
182
|
+
} & Omit<React.ComponentProps<typeof Button>, "variant">): react_jsx_dev_runtime.JSX.Element;
|
|
183
|
+
displayName: string;
|
|
184
|
+
};
|
|
185
|
+
|
|
1
186
|
/**
|
|
2
187
|
* @moderneinc/neo-styled-components
|
|
3
188
|
*
|
|
4
|
-
*
|
|
189
|
+
* TypeScript declarations for Moderne styled components
|
|
5
190
|
*/
|
|
6
191
|
|
|
7
|
-
//
|
|
8
|
-
|
|
192
|
+
// Include MUI type augmentations
|
|
193
|
+
|
|
194
|
+
declare const version: string
|
|
9
195
|
|
|
10
|
-
export { version };
|
|
196
|
+
export { NeoBadge, NeoButton, NeoIconButton, NeoToast, NeoToastButton, version };
|
|
197
|
+
export type { NeoBadgeProps, NeoButtonProps, NeoIconButtonProps, NeoToastProps };
|