@moderneinc/neo-styled-components 0.0.0-development → 1.6.1-next.1d7c75

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/index.d.ts CHANGED
@@ -1,10 +1,453 @@
1
+ /// <reference path="./types.d.ts" />
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ChipProps } from '@mui/material/Chip';
4
+ import { ButtonBaseProps } from '@mui/material/ButtonBase';
5
+ import * as React$1 from 'react';
6
+ import { ReactNode } from 'react';
7
+ import { IconButtonProps } from '@mui/material/IconButton';
8
+ import { InputBaseProps } from '@mui/material/InputBase';
9
+ import * as _mui_system from '@mui/system';
10
+ import * as _mui_material_styles from '@mui/material/styles';
11
+ import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
12
+ import * as _mui_material_Tabs from '@mui/material/Tabs';
13
+ import { TabProps } from '@mui/material/Tab';
14
+ import { AlertProps } from '@mui/material/Alert';
15
+ import Button from '@mui/material/Button';
16
+
17
+ interface NeoBadgeProps extends Omit<ChipProps, 'variant' | 'size'> {
18
+ /**
19
+ * The color/state of the badge
20
+ * @default "default"
21
+ */
22
+ color?: 'default' | 'error' | 'warning' | 'success' | 'info';
23
+ }
24
+ /**
25
+ * NeoBadge - Status badge component based on MUI Chip
26
+ *
27
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system-w--correct-set-of-tokens?node-id=4091-17230
28
+ *
29
+ * Figma Props Mapping:
30
+ * - state (Neutral|Error|Warning|Success|Info) → color (default|error|warning|success|info)
31
+ * - iconLeading → icon prop (pass React element)
32
+ * - iconTrailing → deleteIcon prop (pass React element)
33
+ * - Label → label prop
34
+ */
35
+ declare const NeoBadge: {
36
+ (props: NeoBadgeProps): react_jsx_runtime.JSX.Element;
37
+ displayName: string;
38
+ };
39
+
40
+ declare module '@mui/material/ButtonBase' {
41
+ interface ButtonBasePropsVariantOverrides {
42
+ primary: true;
43
+ secondary: true;
44
+ destructive: true;
45
+ link: true;
46
+ linkColor: true;
47
+ }
48
+ }
49
+ type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'link' | 'linkColor';
50
+ type ButtonSize = 'small' | 'medium';
51
+ interface NeoButtonProps extends Omit<ButtonBaseProps, 'children'> {
52
+ /**
53
+ * The visual variant of the button
54
+ * @default "primary"
55
+ *
56
+ * @figma Hierarchy
57
+ */
58
+ variant?: ButtonVariant;
59
+ /**
60
+ * The size of the button
61
+ * @default "medium"
62
+ *
63
+ * @figma Size
64
+ */
65
+ size?: ButtonSize;
66
+ /**
67
+ * Show loading spinner instead of children
68
+ * @default false
69
+ *
70
+ * @figma State=Loading
71
+ */
72
+ loading?: boolean;
73
+ /**
74
+ * Button content
75
+ */
76
+ children?: ReactNode;
77
+ }
78
+ /**
79
+ * NeoButton - Text button component based on MUI ButtonBase
80
+ *
81
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
82
+ *
83
+ * Figma Props Mapping:
84
+ * - Hierarchy (Primary|Secondary|Destructive|Link|Link Color) → variant prop
85
+ * - Size (Small|Medium) → size prop
86
+ * - State=Disabled → disabled prop
87
+ * - State=Loading → loading prop
88
+ * - State=Hover → CSS :hover
89
+ * - State=Pressed → CSS :active
90
+ * - State=Focused → CSS :focus-visible
91
+ */
92
+ declare const NeoButton: {
93
+ ({ variant, size, loading, children, disabled, ...props }: NeoButtonProps): react_jsx_runtime.JSX.Element;
94
+ displayName: string;
95
+ };
96
+
97
+ type IconButtonSize = 'small' | 'medium';
98
+ interface NeoIconButtonProps extends Omit<IconButtonProps, 'color' | 'size'> {
99
+ /**
100
+ * The size of the icon button
101
+ * @default "medium"
102
+ *
103
+ * @figma Size
104
+ */
105
+ size?: IconButtonSize;
106
+ }
107
+ /**
108
+ * NeoIconButton - Icon-only button component based on MUI IconButton
109
+ *
110
+ * Simple, neutral icon button with transparent background and icon color states.
111
+ *
112
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4086-7590
113
+ *
114
+ * Figma Props Mapping:
115
+ * - Hierarchy=Icon → Single default style (no variant prop)
116
+ * - Size (Small|Medium) → size prop
117
+ * - State=Disabled → disabled prop
118
+ * - State=Hover → CSS :hover
119
+ * - State=Pressed → CSS :active
120
+ * - State=Focused → CSS :focus-visible
121
+ */
122
+ declare const NeoIconButton: {
123
+ ({ size, ...props }: NeoIconButtonProps): react_jsx_runtime.JSX.Element;
124
+ displayName: string;
125
+ };
126
+
127
+ type InputFieldSize = 'small' | 'medium';
128
+ interface NeoInputFieldProps extends Omit<InputBaseProps, 'size'> {
129
+ /**
130
+ * The size of the input field
131
+ * @default "medium"
132
+ *
133
+ * @figma Size
134
+ */
135
+ size?: InputFieldSize;
136
+ /**
137
+ * Show error/destructive state with red styling
138
+ * @default false
139
+ *
140
+ * @figma Destructive
141
+ */
142
+ destructive?: boolean;
143
+ /**
144
+ * Label text for the input
145
+ *
146
+ * @figma Label
147
+ */
148
+ label?: string;
149
+ /**
150
+ * Show required indicator (asterisk)
151
+ * @default false
152
+ *
153
+ * @figma Required indicator
154
+ */
155
+ required?: boolean;
156
+ /**
157
+ * Info icon to display next to the label
158
+ *
159
+ * @figma Info icon
160
+ */
161
+ infoIcon?: ReactNode;
162
+ /**
163
+ * Helper text displayed below the input (normal state)
164
+ *
165
+ * @figma Helper text
166
+ */
167
+ helperText?: string;
168
+ /**
169
+ * Error message displayed below the input (destructive state)
170
+ * Takes precedence over helperText when destructive is true
171
+ *
172
+ * @figma Error message
173
+ */
174
+ errorMessage?: string;
175
+ /**
176
+ * Icon to display at the start of the input
177
+ *
178
+ * @figma Left icon
179
+ */
180
+ startIcon?: ReactNode;
181
+ /**
182
+ * Icon to display at the end of the input
183
+ * In destructive state, an error icon is automatically shown
184
+ *
185
+ * @figma Right icon
186
+ */
187
+ endIcon?: ReactNode;
188
+ }
189
+ /**
190
+ * NeoInputField - Form input field component using MUI FormControl composition
191
+ *
192
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4091-23373
193
+ *
194
+ * Figma Props Mapping:
195
+ * - Size (small|medium) → size prop
196
+ * - Destructive (false|true) → destructive prop
197
+ * - State=Placeholder → empty value with placeholder text
198
+ * - State=Hover → CSS :hover
199
+ * - State=Filled → value prop with text
200
+ * - State=Focused → CSS :focus
201
+ * - State=Disabled → disabled prop
202
+ * - Label → label prop
203
+ * - Required indicator (*) → required prop
204
+ * - Info icon → infoIcon prop
205
+ * - Helper text → helperText prop
206
+ * - Error message → errorMessage prop (shown when destructive=true)
207
+ * - Left icon → startIcon prop
208
+ * - Right icon → endIcon prop (auto error icon when destructive=true)
209
+ */
210
+ declare const NeoInputField: {
211
+ ({ size, destructive, label, required, infoIcon, helperText, errorMessage, startIcon, endIcon, disabled, id, ...props }: NeoInputFieldProps): react_jsx_runtime.JSX.Element;
212
+ displayName: string;
213
+ };
214
+
215
+ interface ComponentSelector {
216
+ __emotion_styles: any;
217
+ }
218
+
219
+ /**
220
+ * @desc Utility type for getting props type of React component.
221
+ * It takes `defaultProps` into an account - making props with defaults optional.
222
+ */
223
+ type PropsOf<C extends keyof ReactJSX.IntrinsicElements | React.JSXElementConstructor<any>> = ReactJSX.LibraryManagedAttributes<C, React.ComponentProps<C>>;
224
+
225
+ type IsPreReact19$1 = 2 extends Parameters<React.FunctionComponent<any>>['length'] ? true : false;
226
+ /** @ts-ignore */
227
+ type ReactJSXElement = true extends IsPreReact19$1 ? JSX.Element : React.JSX.Element;
228
+ /** @ts-ignore */
229
+ type ReactJSXElementClass = true extends IsPreReact19$1 ? JSX.ElementClass : React.JSX.ElementClass;
230
+ /** @ts-ignore */
231
+ type ReactJSXElementAttributesProperty = true extends IsPreReact19$1 ? JSX.ElementAttributesProperty : React.JSX.ElementAttributesProperty;
232
+ /** @ts-ignore */
233
+ type ReactJSXElementChildrenAttribute = true extends IsPreReact19$1 ? JSX.ElementChildrenAttribute : React.JSX.ElementChildrenAttribute;
234
+ /** @ts-ignore */
235
+ type ReactJSXLibraryManagedAttributes<C, P> = true extends IsPreReact19$1 ? JSX.LibraryManagedAttributes<C, P> : React.JSX.LibraryManagedAttributes<C, P>;
236
+ /** @ts-ignore */
237
+ type ReactJSXIntrinsicAttributes = true extends IsPreReact19$1 ? JSX.IntrinsicAttributes : React.JSX.IntrinsicAttributes;
238
+ /** @ts-ignore */
239
+ type ReactJSXIntrinsicClassAttributes<T> = true extends IsPreReact19$1 ? JSX.IntrinsicClassAttributes<T> : React.JSX.IntrinsicClassAttributes<T>;
240
+ /** @ts-ignore */
241
+ type ReactJSXIntrinsicElements$1 = true extends IsPreReact19$1 ? JSX.IntrinsicElements : React.JSX.IntrinsicElements;
242
+ /** @ts-ignore */
243
+ type ReactJSXElementType = true extends IsPreReact19$1 ? string | React.JSXElementConstructor<any> : React.JSX.ElementType;
244
+ declare namespace ReactJSX {
245
+ type ElementType = ReactJSXElementType;
246
+ interface Element extends ReactJSXElement {
247
+ }
248
+ interface ElementClass extends ReactJSXElementClass {
249
+ }
250
+ interface ElementAttributesProperty extends ReactJSXElementAttributesProperty {
251
+ }
252
+ interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {
253
+ }
254
+ type LibraryManagedAttributes<C, P> = ReactJSXLibraryManagedAttributes<C, P>;
255
+ interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {
256
+ }
257
+ interface IntrinsicClassAttributes<T> extends ReactJSXIntrinsicClassAttributes<T> {
258
+ }
259
+ type IntrinsicElements = ReactJSXIntrinsicElements$1;
260
+ }
261
+
262
+ type IsPreReact19 = 2 extends Parameters<React.FunctionComponent<any>>['length'] ? true : false;
263
+ /** @ts-ignore */
264
+ type ReactJSXIntrinsicElements = true extends IsPreReact19 ? JSX.IntrinsicElements : React.JSX.IntrinsicElements;
265
+
266
+ /**
267
+ * @typeparam ComponentProps Props which will be included when withComponent is called
268
+ * @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
269
+ */
270
+ interface StyledComponent<ComponentProps extends {}, SpecificComponentProps extends {} = {}, JSXProps extends {} = {}> extends React.FC<ComponentProps & SpecificComponentProps & JSXProps>, ComponentSelector {
271
+ withComponent<C extends React.ComponentClass<React.ComponentProps<C>>>(component: C): StyledComponent<ComponentProps & PropsOf<C>, {}, {
272
+ ref?: React.Ref<InstanceType<C>>;
273
+ }>;
274
+ withComponent<C extends React.ComponentType<React.ComponentProps<C>>>(component: C): StyledComponent<ComponentProps & PropsOf<C>>;
275
+ withComponent<Tag extends keyof ReactJSXIntrinsicElements>(tag: Tag): StyledComponent<ComponentProps, ReactJSXIntrinsicElements[Tag]>;
276
+ }
277
+
278
+ /**
279
+ * NeoTabs - Tabs container component based on MUI Tabs
280
+ *
281
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=3368-26152
282
+ *
283
+ * Figma Props Mapping:
284
+ * - Horizontal tab bar → default layout
285
+ * - Tab selection → value prop + onChange
286
+ * - Active indicator → styled via indicator slot
287
+ */
288
+ declare const NeoTabs: StyledComponent<_mui_material_Tabs.TabsOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "style" | "classes" | "children" | "sx" | "variant" | "slots" | "slotProps" | "aria-label" | "aria-labelledby" | "onChange" | "action" | "value" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
289
+ interface NeoTabProps extends Omit<TabProps, 'label'> {
290
+ /**
291
+ * The label for the tab
292
+ *
293
+ * @figma Text layer in tab
294
+ */
295
+ label: ReactNode;
296
+ /**
297
+ * Optional count to display in a tag next to the label
298
+ * @default undefined
299
+ *
300
+ * @figma Tag with number (999)
301
+ */
302
+ count?: number | string;
303
+ /**
304
+ * Tab value identifier
305
+ *
306
+ * @figma Used for Current=True/False state
307
+ */
308
+ value: string | number;
309
+ }
310
+ /**
311
+ * NeoTab - Individual tab button component based on MUI Tab
312
+ *
313
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=3368-26152
314
+ *
315
+ * Figma Props Mapping:
316
+ * - Current=True/False → Controlled by parent NeoTabs value
317
+ * - State=Default → default styling
318
+ * - State=Hover → CSS :hover
319
+ * - State=Focus → CSS :focus-visible
320
+ * - Tag count → count prop (renders NeoTag)
321
+ * - Text label → label prop
322
+ */
323
+ declare const NeoTab: {
324
+ ({ label, count, ...props }: NeoTabProps): react_jsx_runtime.JSX.Element;
325
+ displayName: string;
326
+ };
327
+
328
+ declare module '@mui/material/Chip' {
329
+ interface ChipPropsColorOverrides {
330
+ violet: true;
331
+ }
332
+ interface ChipPropsSizeOverrides {
333
+ large: true;
334
+ }
335
+ interface ChipPropsVariantOverrides {
336
+ outlined: true;
337
+ filled: true;
338
+ }
339
+ }
340
+ interface NeoTagProps extends Omit<ChipProps, 'variant' | 'size'> {
341
+ /**
342
+ * The size of the tag
343
+ * @figma m (sm|md|lg)
344
+ * @default "small"
345
+ */
346
+ size?: 'small' | 'medium' | 'large';
347
+ /**
348
+ * The variant style of the tag
349
+ * @figma type (light|dark)
350
+ * @default "outlined"
351
+ */
352
+ variant?: 'outlined' | 'filled';
353
+ /**
354
+ * The color/state of the tag
355
+ * @figma state (Neutral|Error|Warning|Success|Info|Violet)
356
+ * @default "default"
357
+ */
358
+ color?: 'default' | 'error' | 'warning' | 'success' | 'info' | 'violet';
359
+ }
360
+ /**
361
+ * NeoTag - Small pill-shaped label component based on MUI Chip
362
+ *
363
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4120-34533
364
+ *
365
+ * Figma Props Mapping:
366
+ * - m (sm|md|lg) → size (small|medium|large)
367
+ * - type (light|dark) → variant (outlined|filled)
368
+ * - state (Neutral|Error|Warning|Success|Info|Violet) → color (default|error|warning|success|info|violet)
369
+ * - Label text → label prop
370
+ */
371
+ declare const NeoTag: {
372
+ ({ size, variant, ...props }: NeoTagProps): react_jsx_runtime.JSX.Element;
373
+ displayName: string;
374
+ };
375
+
376
+ interface NeoToastProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
377
+ /**
378
+ * The visual style variant of the toast
379
+ * @default "default"
380
+ */
381
+ variant?: 'default' | 'dark' | 'brand' | 'error' | 'success' | 'info' | 'download';
382
+ /**
383
+ * The title/header text
384
+ */
385
+ title?: string;
386
+ /**
387
+ * The body/supporting text
388
+ */
389
+ message?: string;
390
+ /**
391
+ * Whether to show the close button
392
+ * @default true
393
+ */
394
+ showClose?: boolean;
395
+ /**
396
+ * Custom action buttons (for default toast types)
397
+ * Pass action buttons as children of this prop
398
+ */
399
+ actions?: ReactNode;
400
+ /**
401
+ * Progress value (0-100) for download variant
402
+ */
403
+ progress?: number;
404
+ /**
405
+ * File name for download variant
406
+ */
407
+ fileName?: string;
408
+ /**
409
+ * Callback when close button is clicked
410
+ */
411
+ onClose?: () => void;
412
+ }
413
+ /**
414
+ * NeoToast - Notification/Toast component based on MUI Alert
415
+ *
416
+ * @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4122-37223
417
+ *
418
+ * Figma Props Mapping:
419
+ * - type (Light mode|Dark mode|Brand color|Error|Success|Info|Download) → variant (default|dark|brand|error|success|info|download)
420
+ * - header → title (string)
421
+ * - supportingText → message (string)
422
+ * - xCloseButton → showClose (boolean)
423
+ * - actions → actions (ReactNode)
424
+ * - Progress bar → progress (number 0-100)
425
+ */
426
+ declare const NeoToast: {
427
+ ({ variant, title, message, showClose, actions, progress, fileName, onClose, ...props }: NeoToastProps): react_jsx_runtime.JSX.Element;
428
+ displayName: string;
429
+ };
430
+ /**
431
+ * Helper component for creating toast action buttons with proper styling
432
+ */
433
+ declare const NeoToastButton: {
434
+ ({ primary, variant, children, ...props }: {
435
+ primary?: boolean;
436
+ variant?: NeoToastProps["variant"];
437
+ children: ReactNode;
438
+ } & Omit<React.ComponentProps<typeof Button>, "variant">): react_jsx_runtime.JSX.Element;
439
+ displayName: string;
440
+ };
441
+
1
442
  /**
2
443
  * @moderneinc/neo-styled-components
3
444
  *
4
- * Styled MUI components using Moderne design tokens
445
+ * TypeScript declarations for Moderne styled components
5
446
  */
6
447
 
7
- // Placeholder - components will be added here
8
- declare const version = '0.0.0-development'
448
+ // Include MUI type augmentations
449
+
450
+ declare const version: string
9
451
 
10
- export { version };
452
+ export { NeoBadge, NeoButton, NeoIconButton, NeoInputField, NeoTab, NeoTabs, NeoTag, NeoToast, NeoToastButton, version };
453
+ export type { NeoBadgeProps, NeoButtonProps, NeoIconButtonProps, NeoInputFieldProps, NeoTabProps, NeoTagProps, NeoToastProps };