hisd3-ui-kit 4.0.0 → 4.1.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 +32 -7
- package/dist/index.cjs.js +401 -109
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +116 -10
- package/dist/index.js +401 -109
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -21,13 +21,32 @@ declare const HISD3_NEUTRALS: {
|
|
|
21
21
|
readonly bgContainer: "#F3F2F0";
|
|
22
22
|
readonly bgElevated: "#FFFFFF";
|
|
23
23
|
readonly bgFilled: "#E6E4E1";
|
|
24
|
+
readonly bgFilledHover: "#DBD8D4";
|
|
24
25
|
readonly text: "#171717";
|
|
25
26
|
readonly textSecondary: "#4A4A4A";
|
|
26
27
|
readonly textTertiary: "#6E6E6E";
|
|
27
|
-
|
|
28
|
-
readonly
|
|
28
|
+
/** Structural rules: sidebar edge, header bottom, table header. */
|
|
29
|
+
readonly border: "#D9D5CE";
|
|
30
|
+
/** Quieter rules: table rows, dividers inside popups. */
|
|
31
|
+
readonly borderSecondary: "#E7E4DE";
|
|
32
|
+
/** Near-black, used for hover/focus emphasis on controls. */
|
|
33
|
+
readonly borderStrong: "#1F1F1F";
|
|
29
34
|
readonly white: "#FFFFFF";
|
|
30
35
|
};
|
|
36
|
+
/** Border weights. "hairline" is the default modern look. */
|
|
37
|
+
declare const HISD3_BORDER_PRESETS: {
|
|
38
|
+
readonly hairline: {
|
|
39
|
+
readonly width: 1;
|
|
40
|
+
readonly border: "#D9D5CE";
|
|
41
|
+
readonly borderSecondary: "#E7E4DE";
|
|
42
|
+
};
|
|
43
|
+
readonly bold: {
|
|
44
|
+
readonly width: 2;
|
|
45
|
+
readonly border: "#1F1F1F";
|
|
46
|
+
readonly borderSecondary: "#CFCDC9";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type HISD3Borders = keyof typeof HISD3_BORDER_PRESETS;
|
|
31
50
|
declare const HISD3_FONT_FAMILY = "'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif";
|
|
32
51
|
/** Archivo is used for both body (400) and headings (800). */
|
|
33
52
|
declare const HISD3_FONT_WEIGHT_HEADING = 800;
|
|
@@ -37,7 +56,12 @@ interface HISD3ThemeOptions {
|
|
|
37
56
|
primary?: HISD3Preset | string;
|
|
38
57
|
/** Corner radius in px. The Backoffice look is square (0). */
|
|
39
58
|
radius?: number;
|
|
40
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Border treatment. "hairline" (default) uses 1px warm-grey rules;
|
|
61
|
+
* "bold" restores the 2px near-black look.
|
|
62
|
+
*/
|
|
63
|
+
borders?: HISD3Borders;
|
|
64
|
+
/** Explicit border width in px; overrides the `borders` preset. */
|
|
41
65
|
lineWidth?: number;
|
|
42
66
|
/** Override / extend the generated antd theme. */
|
|
43
67
|
overrides?: ThemeConfig;
|
|
@@ -52,7 +76,9 @@ declare const tint: (hex: string, amount: number) => string;
|
|
|
52
76
|
* <ConfigProvider theme={createHisd3Theme({ primary: "teal" })}>
|
|
53
77
|
* ```
|
|
54
78
|
*/
|
|
55
|
-
declare const createHisd3Theme: ({ primary, radius, lineWidth, overrides, }?: HISD3ThemeOptions) => ThemeConfig;
|
|
79
|
+
declare const createHisd3Theme: ({ primary, radius, borders, lineWidth, overrides, }?: HISD3ThemeOptions) => ThemeConfig;
|
|
80
|
+
/** CSS emitted by HISD3Provider so styled components follow the border preset. */
|
|
81
|
+
declare const borderVarsCss: (borders?: HISD3Borders, lineWidth?: number) => string;
|
|
56
82
|
/** Default HISD3 theme — the red "Backoffice" look. */
|
|
57
83
|
declare const hisd3AntdTheme: ThemeConfig;
|
|
58
84
|
/** @deprecated use HISD3_PRESETS / createHisd3Theme */
|
|
@@ -707,6 +733,11 @@ interface HISD3SidebarProps {
|
|
|
707
733
|
hideHeaderBar?: boolean;
|
|
708
734
|
/** Where the brand block links to. Default "/". */
|
|
709
735
|
brandHref?: string;
|
|
736
|
+
/**
|
|
737
|
+
* Hide the account card in the sider footer / top nav — use when the account
|
|
738
|
+
* lives in the header instead (`HISD3AvatarMenu`).
|
|
739
|
+
*/
|
|
740
|
+
hideAccountCard?: boolean;
|
|
710
741
|
children: React.ReactNode;
|
|
711
742
|
}
|
|
712
743
|
declare const HISD3Sidebar: React.FC<HISD3SidebarProps>;
|
|
@@ -754,6 +785,79 @@ declare const HISD3PageBody: styled_components_dist_types.IStyledComponentBase<"
|
|
|
754
785
|
*/
|
|
755
786
|
declare const HISD3PageHeader: React.FC<HISD3PageHeaderProps>;
|
|
756
787
|
|
|
788
|
+
interface HISD3Notification {
|
|
789
|
+
id: string;
|
|
790
|
+
title: React.ReactNode;
|
|
791
|
+
/** Secondary line, e.g. "Folio 19370 was posted". */
|
|
792
|
+
description?: React.ReactNode;
|
|
793
|
+
/** Right-aligned relative time, e.g. "2h". */
|
|
794
|
+
time?: React.ReactNode;
|
|
795
|
+
/** Unread items get a tinted row and a dot. */
|
|
796
|
+
unread?: boolean;
|
|
797
|
+
/** Leading avatar image; falls back to `icon`. */
|
|
798
|
+
avatarSrc?: string;
|
|
799
|
+
icon?: React.ReactNode;
|
|
800
|
+
onClick?: (notification: HISD3Notification) => void;
|
|
801
|
+
}
|
|
802
|
+
interface HISD3NotificationButtonProps {
|
|
803
|
+
items?: HISD3Notification[];
|
|
804
|
+
/** Diameter of the circular button in px. Default 40. */
|
|
805
|
+
size?: number;
|
|
806
|
+
/** Badge count. Defaults to the number of unread items. */
|
|
807
|
+
count?: number;
|
|
808
|
+
loading?: boolean;
|
|
809
|
+
title?: React.ReactNode;
|
|
810
|
+
/** Shown as a link in the panel header when there are unread items. */
|
|
811
|
+
onMarkAllRead?: () => void;
|
|
812
|
+
/** Renders a footer row, e.g. "See all notifications". */
|
|
813
|
+
onSeeAll?: () => void;
|
|
814
|
+
seeAllLabel?: React.ReactNode;
|
|
815
|
+
emptyText?: React.ReactNode;
|
|
816
|
+
onOpenChange?: (open: boolean) => void;
|
|
817
|
+
className?: string;
|
|
818
|
+
}
|
|
819
|
+
declare const HeaderIconButton: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
820
|
+
$size?: number;
|
|
821
|
+
}>> & string;
|
|
822
|
+
/** Bell button with an unread badge and a Facebook-style notifications panel. */
|
|
823
|
+
declare const HISD3NotificationButton: React.FC<HISD3NotificationButtonProps>;
|
|
824
|
+
|
|
825
|
+
interface HISD3AvatarMenuProps {
|
|
826
|
+
account: IUserEmployee;
|
|
827
|
+
avatarSrc?: string;
|
|
828
|
+
/** Settings entry target. Pass `null` to hide the Settings entry. */
|
|
829
|
+
settingsUrl?: string | null;
|
|
830
|
+
onSettings?: () => void;
|
|
831
|
+
onLogout: () => Promise<void> | void;
|
|
832
|
+
/** Ask for confirmation before logging out. Default true. */
|
|
833
|
+
confirmLogout?: boolean;
|
|
834
|
+
/** Extra entries above Settings / Logout. */
|
|
835
|
+
extraItems?: MenuProps["items"];
|
|
836
|
+
/** Circle (Facebook-style) or square to match the rest of the design. */
|
|
837
|
+
shape?: "circle" | "square";
|
|
838
|
+
/** Diameter in px. Default 40. */
|
|
839
|
+
size?: number;
|
|
840
|
+
/** Hide the small chevron badge on the avatar. */
|
|
841
|
+
hideChevron?: boolean;
|
|
842
|
+
className?: string;
|
|
843
|
+
}
|
|
844
|
+
declare const getInitials: (fullName?: string) => string;
|
|
845
|
+
/**
|
|
846
|
+
* Circular avatar button for the top-right of the header. Clicking it opens a
|
|
847
|
+
* menu showing who is signed in, plus Settings and Logout (with a confirm
|
|
848
|
+
* dialog by default).
|
|
849
|
+
*/
|
|
850
|
+
declare const HISD3AvatarMenu: React.FC<HISD3AvatarMenuProps>;
|
|
851
|
+
|
|
852
|
+
interface HISD3HeaderActionsProps {
|
|
853
|
+
children: React.ReactNode;
|
|
854
|
+
/** Insert a vertical rule before the last child (e.g. before the avatar). */
|
|
855
|
+
divided?: boolean;
|
|
856
|
+
className?: string;
|
|
857
|
+
}
|
|
858
|
+
/** Spacing wrapper for the top-right header controls. */
|
|
859
|
+
declare const HISD3HeaderActions: React.FC<HISD3HeaderActionsProps>;
|
|
860
|
+
|
|
757
861
|
interface HISD3TablePagination {
|
|
758
862
|
current: number;
|
|
759
863
|
pageSize: number;
|
|
@@ -827,11 +931,13 @@ declare const HISD3SearchInput: React.FC<HISD3SearchInputProps>;
|
|
|
827
931
|
|
|
828
932
|
/** Shared layout metrics so the sidebar brand block and page top bar line up. */
|
|
829
933
|
declare const HISD3_LAYOUT: {
|
|
830
|
-
readonly siderWidth:
|
|
831
|
-
readonly siderCollapsedWidth:
|
|
832
|
-
|
|
833
|
-
readonly
|
|
934
|
+
readonly siderWidth: 260;
|
|
935
|
+
readonly siderCollapsedWidth: 64;
|
|
936
|
+
/** Height of both the sidebar brand block and the page top bar. */
|
|
937
|
+
readonly topBarHeight: 60;
|
|
938
|
+
/** Horizontal padding used by the top bar, title block and page body. */
|
|
939
|
+
readonly pageGutter: 28;
|
|
834
940
|
};
|
|
835
941
|
|
|
836
|
-
export { AppAnimateGroups, AppAnimates, AppMotionAnimate, AuthType, Fonts, FooterType, HISD3Button, HISD3Input, HISD3PageBody, HISD3PageHeader, HISD3Provider, HISD3SearchInput, HISD3Sidebar, HISD3Table, HISD3Tabs, HISD3Tag, HISD3_COLORS, HISD3_FONT_FAMILY, HISD3_FONT_WEIGHT_BODY, HISD3_FONT_WEIGHT_HEADING, HISD3_LAYOUT, HISD3_NEUTRALS, HISD3_PRESETS, HeaderType, LayoutDirection, LayoutType, MenuStyle, MessageType, NavStyle, RoutePermittedRole, RouteTransition, ThemeMode, ThemeStyle, ThemeStyleRadius, UserMenu, createHisd3Theme, hisd3AntdTheme, resolvePrimary, tint, useInsideHISD3Provider };
|
|
837
|
-
export type { HISD3BreadcrumbItem, HISD3ButtonProps, HISD3ButtonVariant, HISD3InputProps, HISD3MenuItem, HISD3PageHeaderProps, HISD3Preset, HISD3ProviderProps, HISD3SearchInputProps, HISD3SidebarProps, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeOptions, IUserEmployee, StyledTheme, UserMenuProps };
|
|
942
|
+
export { AppAnimateGroups, AppAnimates, AppMotionAnimate, AuthType, Fonts, FooterType, HISD3AvatarMenu, HISD3Button, HISD3HeaderActions, HISD3Input, HISD3NotificationButton, HISD3PageBody, HISD3PageHeader, HISD3Provider, HISD3SearchInput, HISD3Sidebar, HISD3Table, HISD3Tabs, HISD3Tag, HISD3_BORDER_PRESETS, HISD3_COLORS, HISD3_FONT_FAMILY, HISD3_FONT_WEIGHT_BODY, HISD3_FONT_WEIGHT_HEADING, HISD3_LAYOUT, HISD3_NEUTRALS, HISD3_PRESETS, HeaderIconButton, HeaderType, LayoutDirection, LayoutType, MenuStyle, MessageType, NavStyle, RoutePermittedRole, RouteTransition, ThemeMode, ThemeStyle, ThemeStyleRadius, UserMenu, borderVarsCss, createHisd3Theme, getInitials, hisd3AntdTheme, resolvePrimary, tint, useInsideHISD3Provider };
|
|
943
|
+
export type { HISD3AvatarMenuProps, HISD3Borders, HISD3BreadcrumbItem, HISD3ButtonProps, HISD3ButtonVariant, HISD3HeaderActionsProps, HISD3InputProps, HISD3MenuItem, HISD3Notification, HISD3NotificationButtonProps, HISD3PageHeaderProps, HISD3Preset, HISD3ProviderProps, HISD3SearchInputProps, HISD3SidebarProps, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeOptions, IUserEmployee, StyledTheme, UserMenuProps };
|