@contact_incruiter/fcc 1.0.9 → 1.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.
@@ -15,7 +15,7 @@ export interface SidebarNavItemConfig {
15
15
  /** Shows a chevron and uses expandedContent as a collapsible panel */
16
16
  hasChevron?: boolean;
17
17
  expandedContent?: ReactNode;
18
- /** Content rendered below the nav row when the sidebar is collapsed and this item is expanded */
18
+ /** Rendered in place of the nav row while the sidebar is collapsed (e.g. one icon per product) */
19
19
  collapsedExpandedContent?: ReactNode;
20
20
  onClick?: () => void;
21
21
  }
@@ -33,12 +33,16 @@ export interface InCruiterSidebarUser {
33
33
  }
34
34
  export interface InCruiterSidebarProps {
35
35
  logoSrc?: string;
36
+ /**
37
+ * @deprecated Pass `user` and `profileItems` to InCruiterTopBar instead. When set, the sidebar
38
+ * still renders the old profile block under the logo, so apps that have not moved yet keep it.
39
+ */
36
40
  user?: InCruiterSidebarUser;
37
41
  /** Main nav items. Defaults to empty — pass your own. */
38
42
  navItems?: SidebarNavItemConfig[];
39
43
  /** Bottom "other" nav items (e.g. Support, Logout). Defaults to empty. */
40
44
  otherItems?: SidebarNavItemConfig[];
41
- /** Profile dropdown items. Defaults to My Profile + Accounts & Billing. */
45
+ /** @deprecated Rows of the old sidebar profile block; only used together with `user`. */
42
46
  profileItems?: SidebarProfileItemConfig[];
43
47
  activeHref?: string;
44
48
  onNavigate?: (href: string) => void;
@@ -55,6 +59,8 @@ export interface SidebarSubItemProps {
55
59
  icon?: string;
56
60
  active: boolean;
57
61
  onClick: () => void;
62
+ /** Collapsed-rail layout: icon stacked over the name. Use it for collapsedExpandedContent. */
63
+ collapsed?: boolean;
58
64
  }
59
- export declare function SidebarSubItem({ name, icon, active, onClick }: SidebarSubItemProps): import("react/jsx-runtime").JSX.Element;
65
+ export declare function SidebarSubItem({ name, icon, active, onClick, collapsed, }: SidebarSubItemProps): import("react/jsx-runtime").JSX.Element;
60
66
  export declare function InCruiterSidebar({ logoSrc, user, navItems, otherItems, profileItems, activeHref, onNavigate, collapsed: collapsedProp, onToggleCollapse, defaultExpandedItem, children, }: InCruiterSidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode, type Ref } from 'react';
2
+ import type { InCruiterSidebarUser, SidebarProfileItemConfig } from './InCruiterSidebar';
2
3
  export interface TopBarNavLink {
3
4
  label: string;
4
5
  active?: boolean;
@@ -20,5 +21,30 @@ export interface InCruiterTopBarProps {
20
21
  navLinks?: TopBarNavLink[];
21
22
  /** ReactNode rendered just before navLinks (e.g. a "What's New" button) */
22
23
  rightExtra?: ReactNode;
24
+ /** Signed-in user — shows their avatar after the bell, which opens the profile menu */
25
+ user?: InCruiterSidebarUser;
26
+ /** Profile menu rows (My Profile, Accounts & Billing, …): onClick, else link in a new tab, else href */
27
+ profileItems?: SidebarProfileItemConfig[];
28
+ /** Receives the href of a profile row that has neither onClick nor link */
29
+ onNavigate?: (href: string) => void;
30
+ /** Accessible name of the tabs' <nav> (e.g. "Main") */
31
+ navLabel?: string;
32
+ /** Passed to the avatar's ProfileMenu as buttonLabel, title and zIndex */
33
+ profileButtonLabel?: string;
34
+ profileTitle?: string;
35
+ profileMenuZIndex?: number;
23
36
  }
24
- export declare function InCruiterTopBar({ title, notificationCount, onBellClick, bellRef, notificationDropdown, leftButton, navLinks, rightExtra, }: InCruiterTopBarProps): import("react/jsx-runtime").JSX.Element;
37
+ /** The top bar's avatar menu, exported on its own for apps that keep their own header */
38
+ export interface ProfileMenuProps {
39
+ user: InCruiterSidebarUser;
40
+ items: SidebarProfileItemConfig[];
41
+ onNavigate?: (href: string) => void;
42
+ /** Accessible name of the avatar button. Defaults to "Profile menu". */
43
+ buttonLabel?: string;
44
+ /** Tooltip on the avatar (e.g. the signed-in email) */
45
+ title?: string;
46
+ /** z-index of the open menu, which is portalled to <body>. Defaults to 1050. */
47
+ zIndex?: number;
48
+ }
49
+ export declare function ProfileMenu({ user, items, onNavigate, buttonLabel, title, zIndex, }: ProfileMenuProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function InCruiterTopBar({ title, notificationCount, onBellClick, bellRef, notificationDropdown, leftButton, navLinks, rightExtra, user, profileItems, onNavigate, navLabel, profileButtonLabel, profileTitle, profileMenuZIndex, }: InCruiterTopBarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { InCruiterSidebarUser } from './InCruiterSidebar';
2
+ export interface UserAvatarProps {
3
+ user: InCruiterSidebarUser;
4
+ size?: number;
5
+ /** Draws a brand-coloured ring around the avatar */
6
+ highlighted?: boolean;
7
+ }
8
+ /** Round photo, or initials on a gradient when there is no photo */
9
+ export declare function UserAvatar({ user, size, highlighted }: UserAvatarProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contact_incruiter/fcc",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "InCruiter Front-end Component Collection — reusable React components for InCruiter products",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",