@moderneinc/neo-styled-components 5.0.0-next.81f348 → 5.0.0-next.d003a0
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/NavigationItem/NavigationItem.d.ts +13 -2
- package/dist/Tag/Tag.d.ts +1 -2
- package/dist/index.d.ts +64 -54
- package/dist/index.esm.js +3 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ButtonBase, { type ButtonBaseProps } from '@mui/material/ButtonBase';
|
|
2
2
|
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
3
|
+
import type { NeoTagOwnProps } from '../Tag/Tag';
|
|
3
4
|
type NeoNavigationItemOwnProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Icon element to display
|
|
@@ -16,10 +17,20 @@ type NeoNavigationItemOwnProps = {
|
|
|
16
17
|
*/
|
|
17
18
|
selected?: boolean;
|
|
18
19
|
/**
|
|
19
|
-
* Optional tag badge content (e.g.,
|
|
20
|
+
* Optional tag badge content (e.g., "Beta")
|
|
20
21
|
* @figma Tag
|
|
21
22
|
*/
|
|
22
23
|
tag?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Slot props for internal sub-components.
|
|
26
|
+
*/
|
|
27
|
+
slotProps?: {
|
|
28
|
+
/**
|
|
29
|
+
* Props forwarded to the NeoTag badge rendered when `tag` is set.
|
|
30
|
+
* Override `intent` to change colour: `'beta'` (periwinkle, default) or `'default'` (grey).
|
|
31
|
+
*/
|
|
32
|
+
badge?: Pick<NeoTagOwnProps, 'intent'>;
|
|
33
|
+
};
|
|
23
34
|
/**
|
|
24
35
|
* Additional content
|
|
25
36
|
*/
|
|
@@ -33,7 +44,7 @@ export type NeoNavigationItemProps<C extends ElementType = typeof ButtonBase> =
|
|
|
33
44
|
*
|
|
34
45
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=8455-6120
|
|
35
46
|
*/
|
|
36
|
-
export declare function NeoNavigationItem<C extends ElementType = typeof ButtonBase>({ icon, label, selected, tag, children, ...props }: NeoNavigationItemProps<C>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function NeoNavigationItem<C extends ElementType = typeof ButtonBase>({ icon, label, selected, tag, slotProps, children, ...props }: NeoNavigationItemProps<C>): import("react/jsx-runtime").JSX.Element;
|
|
37
48
|
export declare namespace NeoNavigationItem {
|
|
38
49
|
var displayName: string;
|
|
39
50
|
}
|
package/dist/Tag/Tag.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module '@mui/material/Chip' {
|
|
|
13
13
|
filled: true;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
type NeoTagOwnProps = {
|
|
16
|
+
export type NeoTagOwnProps = {
|
|
17
17
|
/**
|
|
18
18
|
* The size of the tag
|
|
19
19
|
* @figma Size (Small|Medium|Large)
|
|
@@ -51,4 +51,3 @@ export declare function NeoTag<C extends ElementType = typeof Chip>({ size, vari
|
|
|
51
51
|
export declare namespace NeoTag {
|
|
52
52
|
var displayName: string;
|
|
53
53
|
}
|
|
54
|
-
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1841,6 +1841,58 @@ declare const NeoNavigationAvatar: {
|
|
|
1841
1841
|
displayName: string;
|
|
1842
1842
|
};
|
|
1843
1843
|
|
|
1844
|
+
declare module '@mui/material/Chip' {
|
|
1845
|
+
interface ChipPropsColorOverrides {
|
|
1846
|
+
violet: true;
|
|
1847
|
+
beta: true;
|
|
1848
|
+
}
|
|
1849
|
+
interface ChipPropsSizeOverrides {
|
|
1850
|
+
large: true;
|
|
1851
|
+
}
|
|
1852
|
+
interface ChipPropsVariantOverrides {
|
|
1853
|
+
outlined: true;
|
|
1854
|
+
filled: true;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
type NeoTagOwnProps = {
|
|
1858
|
+
/**
|
|
1859
|
+
* The size of the tag
|
|
1860
|
+
* @figma Size (Small|Medium|Large)
|
|
1861
|
+
* @default "small"
|
|
1862
|
+
*/
|
|
1863
|
+
size?: 'small' | 'medium' | 'large';
|
|
1864
|
+
/**
|
|
1865
|
+
* The variant style of the tag
|
|
1866
|
+
* @figma Variant (Subtle|Filled)
|
|
1867
|
+
* @default "outlined"
|
|
1868
|
+
*/
|
|
1869
|
+
variant?: 'outlined' | 'filled';
|
|
1870
|
+
/**
|
|
1871
|
+
* The intent/purpose of the tag
|
|
1872
|
+
* @figma Intent (Neutral|Error|Warning|Success|Info|Violet)
|
|
1873
|
+
* @default "default"
|
|
1874
|
+
*/
|
|
1875
|
+
intent?: 'default' | 'error' | 'warning' | 'success' | 'info' | 'violet' | 'beta';
|
|
1876
|
+
};
|
|
1877
|
+
type NeoTagProps<C extends ElementType = typeof Chip> = NeoTagOwnProps & Omit<ChipProps, keyof NeoTagOwnProps | 'component' | 'color'> & Omit<ComponentPropsWithoutRef<C>, keyof NeoTagOwnProps | keyof ChipProps> & {
|
|
1878
|
+
component?: C;
|
|
1879
|
+
};
|
|
1880
|
+
/**
|
|
1881
|
+
* NeoTag - Small pill-shaped label component based on MUI Chip
|
|
1882
|
+
*
|
|
1883
|
+
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4120-34533
|
|
1884
|
+
*
|
|
1885
|
+
* Figma Props Mapping:
|
|
1886
|
+
* - Size (Small|Medium|Large) → size (small|medium|large)
|
|
1887
|
+
* - Variant (Subtle|Filled) → variant (outlined|filled)
|
|
1888
|
+
* - Intent (Neutral|Error|Warning|Success|Info|Violet|Beta) → intent (default|error|warning|success|info|violet|beta)
|
|
1889
|
+
* - TEXT Label → label prop
|
|
1890
|
+
*/
|
|
1891
|
+
declare function NeoTag<C extends ElementType = typeof Chip>({ size, variant, intent, ...props }: NeoTagProps<C>): react_jsx_runtime.JSX.Element;
|
|
1892
|
+
declare namespace NeoTag {
|
|
1893
|
+
var displayName: string;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1844
1896
|
type NeoNavigationItemOwnProps = {
|
|
1845
1897
|
/**
|
|
1846
1898
|
* Icon element to display
|
|
@@ -1857,10 +1909,20 @@ type NeoNavigationItemOwnProps = {
|
|
|
1857
1909
|
*/
|
|
1858
1910
|
selected?: boolean;
|
|
1859
1911
|
/**
|
|
1860
|
-
* Optional tag badge content (e.g.,
|
|
1912
|
+
* Optional tag badge content (e.g., "Beta")
|
|
1861
1913
|
* @figma Tag
|
|
1862
1914
|
*/
|
|
1863
1915
|
tag?: string;
|
|
1916
|
+
/**
|
|
1917
|
+
* Slot props for internal sub-components.
|
|
1918
|
+
*/
|
|
1919
|
+
slotProps?: {
|
|
1920
|
+
/**
|
|
1921
|
+
* Props forwarded to the NeoTag badge rendered when `tag` is set.
|
|
1922
|
+
* Override `intent` to change colour: `'beta'` (periwinkle, default) or `'default'` (grey).
|
|
1923
|
+
*/
|
|
1924
|
+
badge?: Pick<NeoTagOwnProps, 'intent'>;
|
|
1925
|
+
};
|
|
1864
1926
|
/**
|
|
1865
1927
|
* Additional content
|
|
1866
1928
|
*/
|
|
@@ -1874,7 +1936,7 @@ type NeoNavigationItemProps<C extends ElementType = typeof ButtonBase__default>
|
|
|
1874
1936
|
*
|
|
1875
1937
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=8455-6120
|
|
1876
1938
|
*/
|
|
1877
|
-
declare function NeoNavigationItem<C extends ElementType = typeof ButtonBase__default>({ icon, label, selected, tag, children, ...props }: NeoNavigationItemProps<C>): react_jsx_runtime.JSX.Element;
|
|
1939
|
+
declare function NeoNavigationItem<C extends ElementType = typeof ButtonBase__default>({ icon, label, selected, tag, slotProps, children, ...props }: NeoNavigationItemProps<C>): react_jsx_runtime.JSX.Element;
|
|
1878
1940
|
declare namespace NeoNavigationItem {
|
|
1879
1941
|
var displayName: string;
|
|
1880
1942
|
}
|
|
@@ -2344,58 +2406,6 @@ declare const NeoTab: {
|
|
|
2344
2406
|
displayName: string;
|
|
2345
2407
|
};
|
|
2346
2408
|
|
|
2347
|
-
declare module '@mui/material/Chip' {
|
|
2348
|
-
interface ChipPropsColorOverrides {
|
|
2349
|
-
violet: true;
|
|
2350
|
-
beta: true;
|
|
2351
|
-
}
|
|
2352
|
-
interface ChipPropsSizeOverrides {
|
|
2353
|
-
large: true;
|
|
2354
|
-
}
|
|
2355
|
-
interface ChipPropsVariantOverrides {
|
|
2356
|
-
outlined: true;
|
|
2357
|
-
filled: true;
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
type NeoTagOwnProps = {
|
|
2361
|
-
/**
|
|
2362
|
-
* The size of the tag
|
|
2363
|
-
* @figma Size (Small|Medium|Large)
|
|
2364
|
-
* @default "small"
|
|
2365
|
-
*/
|
|
2366
|
-
size?: 'small' | 'medium' | 'large';
|
|
2367
|
-
/**
|
|
2368
|
-
* The variant style of the tag
|
|
2369
|
-
* @figma Variant (Subtle|Filled)
|
|
2370
|
-
* @default "outlined"
|
|
2371
|
-
*/
|
|
2372
|
-
variant?: 'outlined' | 'filled';
|
|
2373
|
-
/**
|
|
2374
|
-
* The intent/purpose of the tag
|
|
2375
|
-
* @figma Intent (Neutral|Error|Warning|Success|Info|Violet)
|
|
2376
|
-
* @default "default"
|
|
2377
|
-
*/
|
|
2378
|
-
intent?: 'default' | 'error' | 'warning' | 'success' | 'info' | 'violet' | 'beta';
|
|
2379
|
-
};
|
|
2380
|
-
type NeoTagProps<C extends ElementType = typeof Chip> = NeoTagOwnProps & Omit<ChipProps, keyof NeoTagOwnProps | 'component' | 'color'> & Omit<ComponentPropsWithoutRef<C>, keyof NeoTagOwnProps | keyof ChipProps> & {
|
|
2381
|
-
component?: C;
|
|
2382
|
-
};
|
|
2383
|
-
/**
|
|
2384
|
-
* NeoTag - Small pill-shaped label component based on MUI Chip
|
|
2385
|
-
*
|
|
2386
|
-
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=4120-34533
|
|
2387
|
-
*
|
|
2388
|
-
* Figma Props Mapping:
|
|
2389
|
-
* - Size (Small|Medium|Large) → size (small|medium|large)
|
|
2390
|
-
* - Variant (Subtle|Filled) → variant (outlined|filled)
|
|
2391
|
-
* - Intent (Neutral|Error|Warning|Success|Info|Violet|Beta) → intent (default|error|warning|success|info|violet|beta)
|
|
2392
|
-
* - TEXT Label → label prop
|
|
2393
|
-
*/
|
|
2394
|
-
declare function NeoTag<C extends ElementType = typeof Chip>({ size, variant, intent, ...props }: NeoTagProps<C>): react_jsx_runtime.JSX.Element;
|
|
2395
|
-
declare namespace NeoTag {
|
|
2396
|
-
var displayName: string;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
2409
|
type Intent = 'neutral' | 'info' | 'success' | 'error' | 'warning';
|
|
2400
2410
|
type ToastType = 'outlined' | 'filled';
|
|
2401
2411
|
interface NeoToastProps extends Omit<AlertProps, 'variant' | 'severity' | 'color'> {
|
package/dist/index.esm.js
CHANGED
|
@@ -2167,7 +2167,7 @@ const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
|
|
|
2167
2167
|
gap: theme.spacing(2),
|
|
2168
2168
|
borderRadius: 0,
|
|
2169
2169
|
color: semanticColors.icons.default,
|
|
2170
|
-
fontSize: theme.typography.pxToRem(typography.fontSize.
|
|
2170
|
+
fontSize: theme.typography.pxToRem(typography.fontSize.default),
|
|
2171
2171
|
fontWeight: typography.fontWeight.regular,
|
|
2172
2172
|
lineHeight: `${typography.lineHeight.s}px`,
|
|
2173
2173
|
transition: theme.transitions.create(['background-color'], {
|
|
@@ -5245,28 +5245,13 @@ const Label$2 = styled('span')(({ theme }) => ({
|
|
|
5245
5245
|
width: '100%',
|
|
5246
5246
|
transition: 'color 150ms',
|
|
5247
5247
|
}));
|
|
5248
|
-
const TagPill = styled('span')(({ theme }) => ({
|
|
5249
|
-
display: 'inline-flex',
|
|
5250
|
-
alignItems: 'center',
|
|
5251
|
-
justifyContent: 'center',
|
|
5252
|
-
height: 18,
|
|
5253
|
-
paddingLeft: spacing.spacing_3_4, // 6px
|
|
5254
|
-
paddingRight: spacing.spacing_3_4, // 6px
|
|
5255
|
-
borderRadius: borderRadius.full,
|
|
5256
|
-
backgroundColor: colors.digitalBlue[300], // #8D99FF
|
|
5257
|
-
color: semanticColors.typography.tooltip, // white
|
|
5258
|
-
fontFamily: typography.fontFamily.body,
|
|
5259
|
-
fontWeight: typography.fontWeight.medium,
|
|
5260
|
-
fontSize: theme.typography.pxToRem(typography.fontSize.xs), // 12px
|
|
5261
|
-
lineHeight: 1,
|
|
5262
|
-
}));
|
|
5263
5248
|
/**
|
|
5264
5249
|
* NeoNavigationItem - Vertical navigation item with icon, label, and optional tag
|
|
5265
5250
|
*
|
|
5266
5251
|
* @figma https://www.figma.com/design/fQTkGSFbYyE7LiHuQJsENC/Neo---Moderne-Design-system---2025?node-id=8455-6120
|
|
5267
5252
|
*/
|
|
5268
|
-
function NeoNavigationItem({ icon, label, selected = false, tag, children, ...props }) {
|
|
5269
|
-
return (jsxs(StyledRoot, { selected: selected, disableRipple: true, ...props, children: [jsx(IconPadding, { className: "neo-nav-icon-padding", children: icon }), label && jsx(Label$2, { className: "neo-nav-label", children: label }), tag && jsx(
|
|
5253
|
+
function NeoNavigationItem({ icon, label, selected = false, tag, slotProps, children, ...props }) {
|
|
5254
|
+
return (jsxs(StyledRoot, { selected: selected, disableRipple: true, ...props, children: [jsx(IconPadding, { className: "neo-nav-icon-padding", children: icon }), label && jsx(Label$2, { className: "neo-nav-label", children: label }), tag && (jsx(NeoTag, { size: "medium", variant: "filled", intent: "beta", label: tag, ...slotProps?.badge })), children] }));
|
|
5270
5255
|
}
|
|
5271
5256
|
NeoNavigationItem.displayName = 'NeoNavigationItem';
|
|
5272
5257
|
|