@nextelco/common-ui 1.7.182 → 2.1.1

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.
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { SidebarMenuItem } from '../Sidebar/Sidebar';
3
+ export interface LayoutProps {
4
+ children: React.ReactNode;
5
+ menus: SidebarMenuItem[];
6
+ groupLabels?: Record<string, string>;
7
+ appTitle?: string;
8
+ avatar?: React.ReactNode;
9
+ onLogout?: () => void;
10
+ logoutLabel?: string;
11
+ }
12
+ declare const Layout: ({ children, menus, groupLabels, appTitle, avatar, onLogout, logoutLabel, }: LayoutProps) => React.JSX.Element;
13
+ export default Layout;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ export interface SidebarMenuItem {
3
+ to: string;
4
+ icon: React.ComponentType<{
5
+ size?: number;
6
+ className?: string;
7
+ }>;
8
+ label: string;
9
+ group?: string;
10
+ end?: boolean;
11
+ }
12
+ export interface SidebarProps {
13
+ isOpen?: boolean;
14
+ setIsOpen?: (isOpen: boolean) => void;
15
+ menus: SidebarMenuItem[];
16
+ groupLabels?: Record<string, string>;
17
+ appTitle?: string;
18
+ avatar?: React.ReactNode;
19
+ onLogout?: () => void;
20
+ logoutLabel?: string;
21
+ }
22
+ declare const Sidebar: ({ isOpen, setIsOpen, menus, groupLabels, appTitle, avatar, onLogout, logoutLabel, }: SidebarProps) => React.JSX.Element;
23
+ export default Sidebar;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface TopBarProps {
3
+ searchPlaceholder?: string;
4
+ onSearch?: (value: string) => void;
5
+ right?: React.ReactNode;
6
+ }
7
+ declare const TopBar: ({ searchPlaceholder, onSearch, right }: TopBarProps) => React.JSX.Element;
8
+ export default TopBar;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ oid?: string | null;
4
+ name?: string | null;
5
+ email?: string | null;
6
+ className?: string;
7
+ }
8
+ /**
9
+ * Avatar com a foto real do MS Graph (por oid). Fallback: iniciais (UserAvatar).
10
+ * O token do Graph é obtido via MSAL (`useMsal`) da app consumidora.
11
+ *
12
+ * Peers necessários: @azure/msal-react, @azure/msal-browser, @tanstack/react-query.
13
+ */
14
+ export default function PhotoAvatar({ oid, name, email, className }: Props): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ interface UserAvatarProps {
3
+ name?: string | null;
4
+ photo?: string | null;
5
+ email?: string | null;
6
+ company?: string | null;
7
+ jobTitle?: string | null;
8
+ department?: string | null;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * Avatar de utilizador: mostra a foto (se disponível) ou as iniciais, com um
13
+ * cartão de detalhes em hover (via portal). Usa classes Tailwind — a app
14
+ * consumidora é responsável por gerar o CSS Tailwind.
15
+ */
16
+ export default function UserAvatar({ name, photo, email, company, jobTitle, department, className, }: UserAvatarProps): React.JSX.Element;
17
+ export {};
@@ -2,3 +2,9 @@ export { default as Header } from '../components/layout/Header/Header';
2
2
  export { default as Footer } from '../components/layout/Footer/Footer';
3
3
  export { default as Error } from '../components/layout/Error/Error';
4
4
  export { default as Spinner } from '../components/layout/Spinner/Spinner';
5
+ export { default as Layout } from '../components/layout/Layout/Layout';
6
+ export type { LayoutProps } from '../components/layout/Layout/Layout';
7
+ export { default as Sidebar } from '../components/layout/Sidebar/Sidebar';
8
+ export type { SidebarProps, SidebarMenuItem } from '../components/layout/Sidebar/Sidebar';
9
+ export { default as TopBar } from '../components/layout/TopBar/TopBar';
10
+ export type { TopBarProps } from '../components/layout/TopBar/TopBar';
@@ -1,4 +1,6 @@
1
1
  export { default as Modal } from '../components/molecules/Modal/Modal';
2
- export { default as Sidebar } from '../components/molecules/Sidebar/Sidebar';
2
+ export { default as SidebarDrawer } from '../components/molecules/Sidebar/Sidebar';
3
3
  export { default as MultiTagPicker, Option, } from '../components/molecules/MultiTagPicker/MultiTagPicker';
4
4
  export { default as ConfirmModal } from '../components/molecules/ConfirmModal/ConfirmModal';
5
+ export { default as UserAvatar } from '../components/molecules/UserAvatar/UserAvatar';
6
+ export { default as PhotoAvatar } from '../components/molecules/PhotoAvatar/PhotoAvatar';
@@ -8,3 +8,4 @@ export * from './exports/hooks';
8
8
  export * from './exports/types';
9
9
  export * from './exports/styles';
10
10
  export * from './exports/utils';
11
+ export { default as Sidebar } from './components/layout/Sidebar/Sidebar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextelco/common-ui",
3
- "version": "1.7.182",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "main": "dist/bundle.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -19,10 +19,27 @@
19
19
  "author": "",
20
20
  "license": "ISC",
21
21
  "peerDependencies": {
22
+ "@azure/msal-browser": ">=3",
23
+ "@azure/msal-react": ">=2",
24
+ "@tanstack/react-query": ">=5",
22
25
  "react": "^18.3.1",
23
- "react-dom": "^18.3.1"
26
+ "react-dom": "^18.3.1",
27
+ "react-router-dom": ">=6"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "@azure/msal-react": {
31
+ "optional": true
32
+ },
33
+ "@azure/msal-browser": {
34
+ "optional": true
35
+ },
36
+ "@tanstack/react-query": {
37
+ "optional": true
38
+ }
24
39
  },
25
40
  "devDependencies": {
41
+ "@azure/msal-browser": "^5.17.3",
42
+ "@azure/msal-react": "^5.5.4",
26
43
  "@chromatic-com/storybook": "^4.0.0",
27
44
  "@storybook/addon-docs": "^9.0.0",
28
45
  "@storybook/addon-interactions": "^8.6.14",
@@ -31,6 +48,7 @@
31
48
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
32
49
  "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
33
50
  "@storybook/react-webpack5": "^9.0.0",
51
+ "@tanstack/react-query": "^5.101.4",
34
52
  "@types/js-cookie": "^3.0.6",
35
53
  "@types/react": "^19.0.8",
36
54
  "@types/react-dom": "^19.0.3",
@@ -38,6 +56,7 @@
38
56
  "@types/storybook__react": "^5.2.1",
39
57
  "css-loader": "^7.1.2",
40
58
  "msw": "^2.7.3",
59
+ "react-router-dom": "^6.30.4",
41
60
  "sass": "^1.84.0",
42
61
  "sass-loader": "^16.0.4",
43
62
  "storybook": "^9.0.0",