@nextelco/common-ui 2.1.23 → 2.1.25

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.
@@ -6,12 +6,19 @@ interface Props {
6
6
  className?: string;
7
7
  /** Passa para UserAvatar: cartão de detalhes em hover. Default: off. */
8
8
  showCard?: boolean;
9
+ /**
10
+ * Fornece um token do Graph (scope `User.Read`) usando o MSAL DA APP.
11
+ * PREFERIR isto: evita o `useMsal` interno, que pode ler um `MsalContext`
12
+ * diferente quando o bundler duplica o `@azure/msal-react` (→ account null →
13
+ * sem foto). Com `getToken`, a foto do próprio (/me) resolve sempre.
14
+ * Ex.: `getToken={() => msalInstance.acquireTokenSilent({scopes:['User.Read'],account}).then(r=>r.accessToken)}`
15
+ */
16
+ getToken?: () => Promise<string>;
9
17
  }
10
18
  /**
11
- * Avatar com a foto real do MS Graph (por oid). Fallback: iniciais (UserAvatar).
12
- * O token do Graph é obtido via MSAL (`useMsal`) da app consumidora.
13
- *
14
- * Peers necessários: @azure/msal-react, @azure/msal-browser.
19
+ * Avatar com a foto real do MS Graph. Fallback: iniciais (UserAvatar).
20
+ * Token: via `getToken` (recomendado) ou, em alternativa, via `useMsal` interno.
21
+ * Peers: @azure/msal-react, @azure/msal-browser.
15
22
  */
16
- export default function PhotoAvatar({ oid, name, email, className, showCard }: Props): React.JSX.Element;
23
+ export default function PhotoAvatar({ oid, name, email, className, showCard, getToken }: Props): React.JSX.Element;
17
24
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextelco/common-ui",
3
- "version": "2.1.23",
3
+ "version": "2.1.25",
4
4
  "description": "",
5
5
  "main": "dist/bundle.js",
6
6
  "types": "dist/types/index.d.ts",