sage-nexus-ui 1.3.6 → 1.4.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/dist/assets/images/favicon.ico.mjs +1 -0
- package/dist/assets/images/urls.mjs +1 -0
- package/dist/components/Alert.mjs +1 -0
- package/dist/components/Code.mjs +1 -0
- package/dist/components/Container.mjs +1 -0
- package/dist/components/FaviconLinks.mjs +1 -0
- package/dist/components/Grid.mjs +1 -0
- package/dist/components/Link.mjs +1 -0
- package/dist/components/Select.mjs +1 -0
- package/dist/components/StatusBadge.mjs +1 -0
- package/dist/components/Switch.mjs +1 -0
- package/dist/generated/version.mjs +1 -0
- package/dist/index.d.ts +106 -24
- package/dist/index.mjs +1 -1
- package/package.json +3 -1
- package/readme.md +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a="assets/images/favicon.ico";export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./nexus-logo-favicon.svg.mjs";import m from"./favicon.ico.mjs";import{SAGE_NEXUS_UI_VERSION as r}from"../../generated/version.mjs";const i=r,s=(r=!0)=>({svg:r?`${o}?v=${i}`:o,ico:r?`${m}?v=${i}`:m});export{s as getFaviconUrls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Alert as t}from"@mui/material";export{AlertTitle}from"@mui/material";const m=m=>r(t,{...m});export{m as Alert};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Typography as r}from"@mui/material";import{forwardRef as e}from"react";const a=e(({sx:e,...a},t)=>o(r,{ref:t,variant:"body2",component:"code",sx:[{fontFamily:'"SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace',fontSize:"0.78rem",color:"text.secondary",backgroundColor:"action.hover",borderRadius:"4px",px:.75,py:.25},...Array.isArray(e)?e:e?[e]:[]],...a}));a.displayName="Code";export{a as Code};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Container as t}from"@mui/material";const m=m=>r(t,{...m});export{m as Container};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as r,Fragment as e,jsx as s}from"react/jsx-runtime";import o from"../assets/images/nexus-logo-favicon.svg.mjs";import i from"../assets/images/favicon.ico.mjs";import{SAGE_NEXUS_UI_VERSION as t}from"../generated/version.mjs";const m=t,n=({versioned:t=!0,svgAttrs:n,icoAttrs:c})=>{const a=t?`${i}?v=${m}`:i;return r(e,{children:[s("link",{rel:"icon",type:"image/svg+xml",href:t?`${o}?v=${m}`:o,...n}),s("link",{rel:"icon",href:a,...c})]})};export{n as FaviconLinks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Grid as m}from"@mui/material";const t=t=>r(m,{...t});export{t as Grid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Link as o}from"@mui/material";import{useTokens as e}from"../theme/useTokens.mjs";const t=({openInNewTab:t=!1,children:n,sx:i,...a})=>{const m=e().text.blues;return r(o,{target:t?"_blank":void 0,rel:t?"noopener noreferrer":void 0,sx:[{color:m,textDecorationColor:m,"&:hover":{color:m,opacity:.8}},...Array.isArray(i)?i:i?[i]:[]],...a,children:n})};export{t as Link};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{FormControl as i,InputLabel as r,Select as a,MenuItem as o}from"@mui/material";export{MenuItem}from"@mui/material";const t=({label:t,options:m,formControlSx:n,id:d,children:s,size:c="small",...u})=>{const p=d?`${d}-label`:void 0;return e(i,{size:c,sx:n,children:[t&&l(r,{id:p,children:t}),l(a,{id:d,labelId:p,label:t,size:c,...u,children:m?m.map(e=>l(o,{value:e.value,children:e.label},e.value)):s})]})};export{t as Select};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Chip as o}from"@mui/material";import{useTheme as e}from"@mui/material/styles";import{colours as a}from"../theme/tokens.mjs";const t=({variant:t="neutral",label:l})=>{const b=e(),n="dark"===b.palette.mode,i={success:{bg:n?"rgba(0, 166, 92, 0.18)":"rgba(0, 166, 92, 0.12)",color:n?a.brilliantGreen:a.jade},warning:{bg:n?"rgba(233, 135, 91, 0.18)":"rgba(233, 135, 91, 0.12)",color:a.amber},error:{bg:n?"rgba(204, 15, 75, 0.18)":"rgba(204, 15, 75, 0.10)",color:a.cherry},info:{bg:n?"rgba(0, 214, 222, 0.14)":"rgba(45, 96, 255, 0.10)",color:n?a.cyan:a.blue},neutral:{bg:b.palette.action.hover,color:b.palette.text.secondary}},{bg:m,color:g}=i[t];return r(o,{label:l,size:"small",sx:{backgroundColor:m,color:g,border:"none",boxShadow:"none",fontWeight:600,fontSize:"0.7rem",height:22,"& .MuiChip-label":{px:1.25}}})};export{t as StatusBadge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Switch as t}from"@mui/material";const m=m=>r(t,{...m});export{m as Switch};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="1.4.0";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AlertProps, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, SxProps, SwitchProps, Theme as Theme$1, AccordionSummaryProps, ButtonProps, CardProps as CardProps$1, PaperProps, BoxProps, CollapseProps, ButtonBaseProps, ChipProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
|
|
3
|
+
export { AlertProps, AlertTitle, BoxProps, ButtonBaseProps, ChipProps, CollapseProps, ContainerProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, GridProps, MenuItem, PaperProps, StackProps, SwitchProps, TabProps, TabsProps, TextFieldProps, Theme, alpha, useMediaQuery, useTheme } from '@mui/material';
|
|
1
4
|
import * as react from 'react';
|
|
2
5
|
import react__default, { ReactNode, ReactElement, CSSProperties, PropsWithChildren } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { BoxProps, ButtonBaseProps, ChipProps, CollapseProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, PaperProps, StackProps, TabProps, TabsProps, TextFieldProps, Theme, alpha, useMediaQuery, useTheme } from '@mui/material';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { Theme, SxProps as SxProps$2 } from '@mui/material/styles';
|
|
6
7
|
import { DataGridProps } from '@mui/x-data-grid';
|
|
7
8
|
export { DataGridProps, GridColDef, GridColumnVisibilityModel, GridPaginationModel, GridRenderCellParams, GridRowsProp, GridSortModel, GridValueGetter } from '@mui/x-data-grid';
|
|
8
9
|
import { SxProps as SxProps$1 } from '@mui/system';
|
|
9
|
-
import { Theme as Theme$1, SxProps as SxProps$2 } from '@mui/material/styles';
|
|
10
10
|
export { default as nexusLogoNode } from './assets/images/nexus-logo-node.svg';
|
|
11
11
|
export { default as nexusLogoFavicon } from './assets/images/nexus-logo-favicon.svg';
|
|
12
|
+
export { default as nexusLogoIco } from './assets/images/favicon.ico';
|
|
12
13
|
|
|
13
14
|
declare const getFiscalPeriod: (date: Date) => {
|
|
14
15
|
fiscalYear: number;
|
|
@@ -17,6 +18,72 @@ declare const getFiscalPeriod: (date: Date) => {
|
|
|
17
18
|
};
|
|
18
19
|
declare const formatDate: (date: Date) => string;
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Themed inline alert for info / success / warning / error messages.
|
|
23
|
+
* Accepts all MUI AlertProps — use `severity` to set the variant.
|
|
24
|
+
*/
|
|
25
|
+
declare const Alert: (props: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type Props$1 = Omit<TypographyProps, "variant" | "component">;
|
|
28
|
+
/**
|
|
29
|
+
* Monospace inline code / path snippet.
|
|
30
|
+
* Renders as a `<code>` element using the system monospace font stack.
|
|
31
|
+
* Colour inherits from `text.secondary` by default.
|
|
32
|
+
*/
|
|
33
|
+
declare const Code: react.ForwardRefExoticComponent<Omit<Props$1, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
34
|
+
|
|
35
|
+
declare const Container: (props: ContainerProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
declare const Grid: (props: GridProps) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
interface LinkProps extends LinkProps$1 {
|
|
40
|
+
/** Open in a new tab. Defaults to false. */
|
|
41
|
+
openInNewTab?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Styled anchor component for inline navigation.
|
|
45
|
+
* Uses the `text.blues` semantic token (from `useTokens()`).
|
|
46
|
+
*
|
|
47
|
+
* For button-shaped links use `PrimaryButtonLink` / `SecondaryButtonLink`.
|
|
48
|
+
*/
|
|
49
|
+
declare const Link: ({ openInNewTab, children, sx, ...rest }: LinkProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
interface SelectOption {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
}
|
|
55
|
+
interface SelectProps extends Omit<SelectProps$1, "label"> {
|
|
56
|
+
/** Floating label rendered above the select. */
|
|
57
|
+
label?: string;
|
|
58
|
+
/** Convenience prop: renders `MenuItem`s from an array instead of requiring children. */
|
|
59
|
+
options?: SelectOption[];
|
|
60
|
+
/** `sx` passed to the wrapping `FormControl`. */
|
|
61
|
+
formControlSx?: SxProps<Theme>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A single-value (or multi-value) select field that bundles
|
|
65
|
+
* `FormControl + InputLabel + Select` into one component.
|
|
66
|
+
*
|
|
67
|
+
* Use `options` for a simple array-driven list, or pass `<MenuItem>` children directly.
|
|
68
|
+
*/
|
|
69
|
+
declare const Select: ({ label, options, formControlSx, id, children, size, ...rest }: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type StatusBadgeVariant = "success" | "warning" | "error" | "info" | "neutral";
|
|
72
|
+
interface StatusBadgeProps {
|
|
73
|
+
variant?: StatusBadgeVariant;
|
|
74
|
+
label: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Inline semantic status pill.
|
|
78
|
+
* Use for conveying status at a glance: success / warning / error / info / neutral.
|
|
79
|
+
*
|
|
80
|
+
* For RAG-specific statuses (On Track / At Risk / Off Track) prefer `RagChip`.
|
|
81
|
+
* For domain-specific workflow statuses prefer `StatusChip`.
|
|
82
|
+
*/
|
|
83
|
+
declare const StatusBadge: ({ variant, label, }: StatusBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
declare const Switch: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
20
87
|
/**
|
|
21
88
|
* Typed wrappers around MUI Typography that fix the `variant` prop and
|
|
22
89
|
* inherit colour from the sageTheme TYPOGRAPHY_COLOURS map.
|
|
@@ -42,7 +109,7 @@ declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, }: ActionBar
|
|
|
42
109
|
|
|
43
110
|
interface AccordionGroupProps {
|
|
44
111
|
children: ReactNode;
|
|
45
|
-
sx?: SxProps<Theme>;
|
|
112
|
+
sx?: SxProps<Theme$1>;
|
|
46
113
|
}
|
|
47
114
|
declare const AccordionGroup: ({ children, sx }: AccordionGroupProps) => react_jsx_runtime.JSX.Element;
|
|
48
115
|
interface AccordionGroupItemProps {
|
|
@@ -52,8 +119,8 @@ interface AccordionGroupItemProps {
|
|
|
52
119
|
disabled?: boolean;
|
|
53
120
|
summaryProps?: Omit<AccordionSummaryProps, "children" | "expandIcon">;
|
|
54
121
|
expandIcon?: ReactNode;
|
|
55
|
-
sx?: SxProps<Theme>;
|
|
56
|
-
detailsSx?: SxProps<Theme>;
|
|
122
|
+
sx?: SxProps<Theme$1>;
|
|
123
|
+
detailsSx?: SxProps<Theme$1>;
|
|
57
124
|
}
|
|
58
125
|
declare const AccordionGroupItem: ({ summary, children, defaultExpanded, disabled, summaryProps, expandIcon, sx, detailsSx, }: AccordionGroupItemProps) => react_jsx_runtime.JSX.Element;
|
|
59
126
|
|
|
@@ -66,8 +133,8 @@ interface AccordionSingleProps {
|
|
|
66
133
|
disabled?: boolean;
|
|
67
134
|
summaryProps?: Omit<AccordionSummaryProps, "children" | "expandIcon">;
|
|
68
135
|
expandIcon?: ReactNode;
|
|
69
|
-
sx?: SxProps<Theme>;
|
|
70
|
-
detailsSx?: SxProps<Theme>;
|
|
136
|
+
sx?: SxProps<Theme$1>;
|
|
137
|
+
detailsSx?: SxProps<Theme$1>;
|
|
71
138
|
}
|
|
72
139
|
declare const AccordionSingle: ({ summary, children, defaultExpanded, expanded, onChange, disabled, summaryProps, expandIcon, sx, detailsSx, }: AccordionSingleProps) => react_jsx_runtime.JSX.Element;
|
|
73
140
|
|
|
@@ -130,9 +197,9 @@ interface CheckboxGroupProps {
|
|
|
130
197
|
labels?: string[];
|
|
131
198
|
selectedValues?: string[];
|
|
132
199
|
onChange?: (values: string[]) => void;
|
|
133
|
-
rootSx?: SxProps$1<Theme
|
|
134
|
-
groupSx?: SxProps$1<Theme
|
|
135
|
-
titleSx?: SxProps$1<Theme
|
|
200
|
+
rootSx?: SxProps$1<Theme>;
|
|
201
|
+
groupSx?: SxProps$1<Theme>;
|
|
202
|
+
titleSx?: SxProps$1<Theme>;
|
|
136
203
|
}
|
|
137
204
|
declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
138
205
|
|
|
@@ -175,9 +242,9 @@ interface LocationMultiSelectProps {
|
|
|
175
242
|
emptyLabel?: string;
|
|
176
243
|
selectedLocations?: string[];
|
|
177
244
|
onLocationsChange?: (next: string[]) => void;
|
|
178
|
-
formControlSx?: SxProps<Theme
|
|
179
|
-
menuSx?: SxProps<Theme
|
|
180
|
-
selectSx?: SxProps<Theme
|
|
245
|
+
formControlSx?: SxProps<Theme>;
|
|
246
|
+
menuSx?: SxProps<Theme>;
|
|
247
|
+
selectSx?: SxProps<Theme>;
|
|
181
248
|
}
|
|
182
249
|
declare const LocationMultiSelect: react__default.FC<LocationMultiSelectProps>;
|
|
183
250
|
|
|
@@ -302,8 +369,8 @@ interface SearchInputProps {
|
|
|
302
369
|
onSearchChange: (value: string) => void;
|
|
303
370
|
placeholder?: string;
|
|
304
371
|
searchValue?: string;
|
|
305
|
-
sx?: SxProps<Theme
|
|
306
|
-
styles?: SxProps<Theme
|
|
372
|
+
sx?: SxProps<Theme>;
|
|
373
|
+
styles?: SxProps<Theme>;
|
|
307
374
|
}
|
|
308
375
|
declare const SearchInput: react__default.FC<SearchInputProps>;
|
|
309
376
|
|
|
@@ -324,7 +391,7 @@ interface SideBladeProps {
|
|
|
324
391
|
/** Width of the blade when collapsed (px). Default: 64 */
|
|
325
392
|
collapsedWidth?: number;
|
|
326
393
|
/** Additional sx overrides applied to the Drawer Paper */
|
|
327
|
-
sx?: SxProps<Theme>;
|
|
394
|
+
sx?: SxProps<Theme$1>;
|
|
328
395
|
}
|
|
329
396
|
/**
|
|
330
397
|
* SideBlade — a mini-variant persistent Drawer that expands/collapses.
|
|
@@ -378,6 +445,21 @@ interface TooltipProps extends Omit<TooltipProps$1, "title"> {
|
|
|
378
445
|
}
|
|
379
446
|
declare const Tooltip: ({ title, children, ...rest }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
380
447
|
|
|
448
|
+
declare const getFaviconUrls: (versioned?: boolean) => {
|
|
449
|
+
svg: string;
|
|
450
|
+
ico: string;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type FaviconLinksProps = {
|
|
454
|
+
/** Append version query param for cache-busting (default true) */
|
|
455
|
+
versioned?: boolean;
|
|
456
|
+
/** Optional additional attributes to add to the svg link */
|
|
457
|
+
svgAttrs?: react__default.LinkHTMLAttributes<HTMLLinkElement>;
|
|
458
|
+
/** Optional additional attributes to add to the ico link */
|
|
459
|
+
icoAttrs?: react__default.LinkHTMLAttributes<HTMLLinkElement>;
|
|
460
|
+
};
|
|
461
|
+
declare const FaviconLinks: react__default.FC<FaviconLinksProps>;
|
|
462
|
+
|
|
381
463
|
type ThemeMode = "light" | "dark";
|
|
382
464
|
type ModeTokens = {
|
|
383
465
|
background: {
|
|
@@ -438,7 +520,7 @@ declare module "@mui/material/Typography" {
|
|
|
438
520
|
}
|
|
439
521
|
}
|
|
440
522
|
|
|
441
|
-
declare const createSageTheme: (mode?: ThemeMode) => Theme
|
|
523
|
+
declare const createSageTheme: (mode?: ThemeMode) => Theme;
|
|
442
524
|
|
|
443
525
|
declare const useTokens: () => ModeTokens;
|
|
444
526
|
|
|
@@ -461,7 +543,7 @@ type GradientBorderOptions = {
|
|
|
461
543
|
borderRadius?: number;
|
|
462
544
|
padding?: number;
|
|
463
545
|
};
|
|
464
|
-
declare const getGradientBorderStyles: (theme: Theme
|
|
546
|
+
declare const getGradientBorderStyles: (theme: Theme, options?: GradientBorderOptions) => {
|
|
465
547
|
position: string;
|
|
466
548
|
borderRadius: number;
|
|
467
549
|
border: string;
|
|
@@ -480,8 +562,8 @@ declare const getGradientBorderStyles: (theme: Theme$1, options?: GradientBorder
|
|
|
480
562
|
pointerEvents: string;
|
|
481
563
|
};
|
|
482
564
|
};
|
|
483
|
-
declare const leftPipe: SxProps$2<Theme
|
|
484
|
-
declare const expandableText: (isExpanded: boolean) => SxProps$2<Theme
|
|
565
|
+
declare const leftPipe: SxProps$2<Theme>;
|
|
566
|
+
declare const expandableText: (isExpanded: boolean) => SxProps$2<Theme>;
|
|
485
567
|
|
|
486
|
-
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AiButton, AiCard, AiGlassCard, AiGlassPaper, AiPaper, Body1, Body2, Box, ButtonBase, Caption, Card, CheckboxGroup, Chip, Collapse, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, H1, H2, H3, H4, IconButton, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MuiAppThemeProvider, NexusDataGrid, NexusHome, NexusLogo, Paper, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SearchInput, SecondaryButton, SecondaryButtonLink, SideBlade, Skeleton, SkillChip, Stack, StatusChip, Tab, Tabs, TextField, ThemeModeProvider, ThemeToggle, Tooltip, colours, createSageTheme, expandableText, fontSageHeadline, fontSageText, fontSageUI, formatDate, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, leftPipe, useThemeMode, useTokens };
|
|
487
|
-
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, AiButtonProps, AiCardProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, CardProps, CardTrend, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, LoadingSpinnerNexusProps, ModeTokens, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SideBladeProps, SkeletonProps, ThemeMode, TooltipProps };
|
|
568
|
+
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AiButton, AiCard, AiGlassCard, AiGlassPaper, AiPaper, Alert, Body1, Body2, Box, ButtonBase, Caption, Card, CheckboxGroup, Chip, Code, Collapse, Container, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FaviconLinks, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MuiAppThemeProvider, NexusDataGrid, NexusHome, NexusLogo, Paper, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SearchInput, SecondaryButton, SecondaryButtonLink, Select, SideBlade, Skeleton, SkillChip, Stack, StatusBadge, StatusChip, Switch, Tab, Tabs, TextField, ThemeModeProvider, ThemeToggle, Tooltip, colours, createSageTheme, expandableText, fontSageHeadline, fontSageText, fontSageUI, formatDate, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, leftPipe, useThemeMode, useTokens };
|
|
569
|
+
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, AiButtonProps, AiCardProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, CardProps, CardTrend, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, LinkProps, LoadingSpinnerNexusProps, ModeTokens, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SelectOption, SelectProps, SideBladeProps, SkeletonProps, StatusBadgeProps, StatusBadgeVariant, ThemeMode, TooltipProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{formatDate,getFiscalPeriod}from"./components/DateFormats.mjs";export{ActionBarTitle,Body1,Body2,Caption,H1,H2,H3,H4}from"./components/Typography.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/AiButton.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"./components/Box.mjs";export{Collapse}from"./components/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/ButtonBase.mjs";export{Card}from"./components/Card.mjs";export{CheckboxGroup}from"./components/CheckboxGroup.mjs";export{Chip}from"./components/Chip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/Dialog.mjs";export{Divider}from"./components/Divider.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/IconButton.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/LogoOptions/index.mjs";export{NexusHome}from"./components/NexusHome.mjs";export{default as NexusLogo}from"./components/NexusLogo.mjs";export{Paper}from"./components/Paper.mjs";export{PrimaryButton}from"./components/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{SecondaryButtonLink}from"./components/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade.mjs";export{Skeleton}from"./components/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/Tab.mjs";export{Tabs}from"./components/Tabs.mjs";export{TextField}from"./components/TextField.mjs";export{ThemeToggle}from"./components/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{createSageTheme}from"./theme/sageTheme.mjs";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./theme/tokens.mjs";export{useTokens}from"./theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./theme/MuiAppThemeProvider.mjs";export{ThemeModeProvider,useThemeMode}from"./theme/ThemeContext.mjs";export{alpha,useMediaQuery,useTheme}from"@mui/material";export{expandableText,getGradientBorderStyles,leftPipe}from"./theme/sxHelpers.mjs";
|
|
1
|
+
export{formatDate,getFiscalPeriod}from"./components/DateFormats.mjs";export{Alert}from"./components/Alert.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/Container.mjs";export{Grid}from"./components/Grid.mjs";export{Link}from"./components/Link.mjs";export{Select}from"./components/Select.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{Switch}from"./components/Switch.mjs";export{ActionBarTitle,Body1,Body2,Caption,H1,H2,H3,H4}from"./components/Typography.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/AiButton.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"./components/Box.mjs";export{Collapse}from"./components/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/ButtonBase.mjs";export{Card}from"./components/Card.mjs";export{CheckboxGroup}from"./components/CheckboxGroup.mjs";export{Chip}from"./components/Chip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/Dialog.mjs";export{Divider}from"./components/Divider.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/IconButton.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/LogoOptions/index.mjs";export{NexusHome}from"./components/NexusHome.mjs";export{default as NexusLogo}from"./components/NexusLogo.mjs";export{Paper}from"./components/Paper.mjs";export{PrimaryButton}from"./components/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{SecondaryButtonLink}from"./components/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade.mjs";export{Skeleton}from"./components/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/Tab.mjs";export{Tabs}from"./components/Tabs.mjs";export{TextField}from"./components/TextField.mjs";export{ThemeToggle}from"./components/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{default as nexusLogoIco}from"./assets/images/favicon.ico.mjs";export{getFaviconUrls}from"./assets/images/urls.mjs";export{FaviconLinks}from"./components/FaviconLinks.mjs";export{createSageTheme}from"./theme/sageTheme.mjs";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./theme/tokens.mjs";export{useTokens}from"./theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./theme/MuiAppThemeProvider.mjs";export{ThemeModeProvider,useThemeMode}from"./theme/ThemeContext.mjs";export{AlertTitle,MenuItem,alpha,useMediaQuery,useTheme}from"@mui/material";export{expandableText,getGradientBorderStyles,leftPipe}from"./theme/sxHelpers.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sage-nexus-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Nexus core components",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "emsmart-sage",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"scripts": {
|
|
26
|
+
"prebuild": "node scripts/write-version.mjs",
|
|
26
27
|
"build": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\" && rollup -c",
|
|
27
28
|
"build-storybook": "storybook build",
|
|
28
29
|
"generate-favicon": "node scripts/generate-favicon.mjs",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"@mui/material": "^9.0.1",
|
|
55
56
|
"@mui/x-data-grid": "^9.0.0",
|
|
56
57
|
"@rollup/plugin-alias": "^6.0.0",
|
|
58
|
+
"@rollup/plugin-json": "^5.0.0",
|
|
57
59
|
"@rollup/plugin-commonjs": "^29.0.2",
|
|
58
60
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
59
61
|
"@rollup/plugin-terser": "^1.0.0",
|
package/readme.md
CHANGED
|
@@ -1 +1,109 @@
|
|
|
1
1
|
Small component library for personal use.
|
|
2
|
+
|
|
3
|
+
## Favicon usage
|
|
4
|
+
|
|
5
|
+
This package exports the favicon assets and a small helper to make adding
|
|
6
|
+
favicon links in consuming apps trivial.
|
|
7
|
+
|
|
8
|
+
Files available in package:
|
|
9
|
+
|
|
10
|
+
- `nexus-logo-favicon.svg` — modern SVG favicon
|
|
11
|
+
- `favicon.ico` — multi-size ICO (legacy support)
|
|
12
|
+
|
|
13
|
+
Quick copy approach (recommended):
|
|
14
|
+
|
|
15
|
+
1. Add and then run these asset copy scripts in the consuming project's package.json:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"scripts": {
|
|
19
|
+
"copy-sage-assets": "cpx \"node_modules/sage-nexus-ui/dist/assets/images/*\" public/assets/sage-nexus-ui/",
|
|
20
|
+
"postinstall": "npm run copy-sage-assets"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Add links in your HTML head:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<link
|
|
28
|
+
rel="icon"
|
|
29
|
+
type="image/svg+xml"
|
|
30
|
+
href="/assets/sage-nexus-ui/nexus-logo-favicon.svg"
|
|
31
|
+
/>
|
|
32
|
+
<link rel="icon" href="/assets/sage-nexus-ui/favicon.ico" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or, use the React helper exported by this package:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { FaviconLinks } from "sage-nexus-ui";
|
|
39
|
+
|
|
40
|
+
function AppHead() {
|
|
41
|
+
return <FaviconLinks />; // adds versioned SVG and ICO links
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Next.js example
|
|
46
|
+
|
|
47
|
+
If you use Next.js (Pages or App router), you can copy the built assets into your `public/` folder and render the helper component from the app head so the favicon is present on first render.
|
|
48
|
+
|
|
49
|
+
1. Copy assets during install/build (example `package.json` scripts in the consuming app):
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
"scripts": {
|
|
53
|
+
"copy-sage-assets": "cpx \"node_modules/sage-nexus-ui/dist/assets/images/*\" public/assets/sage-nexus-ui/",
|
|
54
|
+
"postinstall": "npm run copy-sage-assets"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
2. Pages router (`pages/_document.tsx`) example — server-side rendered so the links are available immediately:
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// pages/_document.tsx
|
|
62
|
+
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
63
|
+
import { FaviconLinks } from "sage-nexus-ui";
|
|
64
|
+
|
|
65
|
+
class MyDocument extends Document {
|
|
66
|
+
render() {
|
|
67
|
+
return (
|
|
68
|
+
<Html>
|
|
69
|
+
<Head>
|
|
70
|
+
<FaviconLinks />
|
|
71
|
+
</Head>
|
|
72
|
+
<body>
|
|
73
|
+
<Main />
|
|
74
|
+
<NextScript />
|
|
75
|
+
</body>
|
|
76
|
+
</Html>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default MyDocument;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. App router (`app/layout.tsx`) example:
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
// app/layout.tsx
|
|
88
|
+
import { FaviconLinks } from "sage-nexus-ui";
|
|
89
|
+
|
|
90
|
+
export default function RootLayout({
|
|
91
|
+
children,
|
|
92
|
+
}: {
|
|
93
|
+
children: React.ReactNode;
|
|
94
|
+
}) {
|
|
95
|
+
return (
|
|
96
|
+
<html>
|
|
97
|
+
<head>
|
|
98
|
+
<FaviconLinks />
|
|
99
|
+
</head>
|
|
100
|
+
<body>{children}</body>
|
|
101
|
+
</html>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Notes:
|
|
107
|
+
|
|
108
|
+
- Copying assets into `public/` ensures the files are served as static assets (no runtime JS required) and avoids a flash-of-default-favicon.
|
|
109
|
+
- The `FaviconLinks` helper uses versioned URLs by default to help cache-busting when you publish a new library version.
|