@devsym/graph-toolkit-react 1.0.0-next.10 → 1.0.0-next.11
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/AGENTS.md +2 -1
- package/dist/components/People/People.d.ts +16 -0
- package/dist/components/People/People.d.ts.map +1 -0
- package/dist/components/People/People.types.d.ts +55 -0
- package/dist/components/People/People.types.d.ts.map +1 -0
- package/dist/components/People/index.d.ts +6 -0
- package/dist/components/People/index.d.ts.map +1 -0
- package/dist/hooks/usePeopleList.d.ts +62 -0
- package/dist/hooks/usePeopleList.d.ts.map +1 -0
- package/dist/hooks/usePeopleSearch.d.ts +1 -1
- package/dist/hooks/usePeopleSearch.d.ts.map +1 -1
- package/dist/hooks/usePersonData.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +902 -733
- package/dist/providers/MockProvider.d.ts.map +1 -1
- package/dist/utils/graph.d.ts +17 -0
- package/dist/utils/graph.d.ts.map +1 -1
- package/package.json +1 -1
- package/readme.md +48 -8
package/AGENTS.md
CHANGED
|
@@ -141,7 +141,8 @@ export class MyProvider implements IProvider {
|
|
|
141
141
|
| --- | --- | --- |
|
|
142
142
|
| Current user profile (`userId="me"`) | `User.Read` | Required for basic profile fields |
|
|
143
143
|
| Other user profile (`userId="{id/upn}"`) | `User.ReadBasic.All` | May require admin consent |
|
|
144
|
-
|
|
|
144
|
+
| People default suggestions | `User.ReadBasic.All` | Used for the initial `/users` directory list when no explicit people source is provided |
|
|
145
|
+
| PeoplePicker focus suggestions | `User.ReadBasic.All` | Uses the initial `/users` directory list shown before typing |
|
|
145
146
|
| Presence (`showPresence`) | `Presence.Read` | UI still renders without presence |
|
|
146
147
|
| Profile photo (`fetchImage`) | `User.Read` | Falls back to initials if unavailable |
|
|
147
148
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* People component - Display a compact group of people as overlapping avatars
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { PeopleProps } from './People.types';
|
|
6
|
+
/**
|
|
7
|
+
* `People` renders a compact avatar strip similar to the MGT `mgt-people` control.
|
|
8
|
+
*
|
|
9
|
+
* The component can render a supplied list of people, resolve a list of `userIds`, load
|
|
10
|
+
* group members, or default to tenant directory users from `/users`.
|
|
11
|
+
*
|
|
12
|
+
* @param props - Avatar group configuration and people-loading options
|
|
13
|
+
* @returns A compact avatar group, a loading spinner, or `null` when no people are available
|
|
14
|
+
*/
|
|
15
|
+
export declare const People: React.FC<PeopleProps>;
|
|
16
|
+
//# sourceMappingURL=People.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"People.d.ts","sourceRoot":"","sources":["../../../src/components/People/People.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAgB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA6C3D;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAwCxC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* People component types
|
|
3
|
+
*/
|
|
4
|
+
import type { AvatarGroupProps } from '@fluentui/react-components';
|
|
5
|
+
import type { PeopleSearchResult } from '../../providers/IPersonDataProvider';
|
|
6
|
+
/**
|
|
7
|
+
* A person entry rendered by the {@link People} component.
|
|
8
|
+
*
|
|
9
|
+
* This extends the base people search result shape with optional presence fields used
|
|
10
|
+
* for avatar badges when {@link PeopleProps.showPresence} is enabled.
|
|
11
|
+
*/
|
|
12
|
+
export interface PeoplePerson extends PeopleSearchResult {
|
|
13
|
+
/**
|
|
14
|
+
* Current presence activity when available.
|
|
15
|
+
*/
|
|
16
|
+
presenceActivity?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Current presence availability when available.
|
|
19
|
+
*/
|
|
20
|
+
presenceAvailability?: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Props for the {@link People} component.
|
|
24
|
+
*/
|
|
25
|
+
export interface PeopleProps extends Omit<AvatarGroupProps, 'children'> {
|
|
26
|
+
/**
|
|
27
|
+
* A pre-resolved list of people to render.
|
|
28
|
+
*
|
|
29
|
+
* When provided, the component skips list discovery and renders these people directly.
|
|
30
|
+
*/
|
|
31
|
+
people?: PeoplePerson[];
|
|
32
|
+
/**
|
|
33
|
+
* A list of user identifiers to resolve and render.
|
|
34
|
+
*
|
|
35
|
+
* Values can be Microsoft Graph user IDs, UPNs, email addresses, or `"me"`.
|
|
36
|
+
*/
|
|
37
|
+
userIds?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* The ID of a Microsoft Entra ID group whose direct user members should be rendered.
|
|
40
|
+
*/
|
|
41
|
+
groupId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of visible avatars before the remaining people are shown in overflow.
|
|
44
|
+
*
|
|
45
|
+
* Defaults to `3`, matching the MGT `mgt-people` control.
|
|
46
|
+
*/
|
|
47
|
+
showMax?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Whether presence badges should be shown on each avatar.
|
|
50
|
+
*
|
|
51
|
+
* Presence is loaded when the active provider and granted scopes support it.
|
|
52
|
+
*/
|
|
53
|
+
showPresence?: boolean;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=People.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"People.types.d.ts","sourceRoot":"","sources":["../../../src/components/People/People.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IACrE;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/People/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to load a list of people from Microsoft Graph or a compatible provider
|
|
3
|
+
*/
|
|
4
|
+
import type { PeoplePerson } from '../components/People/People.types';
|
|
5
|
+
/**
|
|
6
|
+
* Options for the {@link usePeopleList} hook.
|
|
7
|
+
*/
|
|
8
|
+
export interface UsePeopleListOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Pre-resolved people to render directly.
|
|
11
|
+
*/
|
|
12
|
+
people?: PeoplePerson[];
|
|
13
|
+
/**
|
|
14
|
+
* User identifiers to resolve into person entries.
|
|
15
|
+
*/
|
|
16
|
+
userIds?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Group ID whose direct members should be loaded.
|
|
19
|
+
*/
|
|
20
|
+
groupId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum number of people to load for Graph-backed list queries.
|
|
23
|
+
*
|
|
24
|
+
* Ignored when {@link userIds} or direct {@link people} are provided.
|
|
25
|
+
*/
|
|
26
|
+
maxPeople?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Whether presence information should be loaded when supported.
|
|
29
|
+
*/
|
|
30
|
+
showPresence?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Result returned by the {@link usePeopleList} hook.
|
|
34
|
+
*/
|
|
35
|
+
export interface UsePeopleListResult {
|
|
36
|
+
/**
|
|
37
|
+
* The resolved list of people.
|
|
38
|
+
*/
|
|
39
|
+
people: PeoplePerson[];
|
|
40
|
+
/**
|
|
41
|
+
* Whether loading is currently in progress.
|
|
42
|
+
*/
|
|
43
|
+
loading: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The most recent list-loading error, if any.
|
|
46
|
+
*/
|
|
47
|
+
error: Error | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Hook to load a compact people list for the {@link People} component.
|
|
51
|
+
*
|
|
52
|
+
* Resolution order matches the component inputs:
|
|
53
|
+
* 1. `people` (render directly)
|
|
54
|
+
* 2. `userIds` (resolve each identifier)
|
|
55
|
+
* 3. `groupId` (load direct group members)
|
|
56
|
+
* 4. default tenant directory users (`/users`)
|
|
57
|
+
*
|
|
58
|
+
* @param options - Configuration for how people should be resolved
|
|
59
|
+
* @returns The resolved people, loading state, and any list-level error
|
|
60
|
+
*/
|
|
61
|
+
export declare const usePeopleList: (options?: UsePeopleListOptions) => UsePeopleListResult;
|
|
62
|
+
//# sourceMappingURL=usePeopleList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePeopleList.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeopleList.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAOtE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAwCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,oBAAoB,KAAG,mBA4N9D,CAAC"}
|
|
@@ -32,7 +32,7 @@ export interface UsePeopleSearchResult {
|
|
|
32
32
|
* When used with a {@link MockProvider} the search is performed locally against mock data.
|
|
33
33
|
* With a real provider the hook queries the Microsoft Graph `/users` endpoint using
|
|
34
34
|
* `$search` with `ConsistencyLevel: eventual`. When `loadInitialResults` is enabled and
|
|
35
|
-
* the query is empty, it instead loads
|
|
35
|
+
* the query is empty, it instead loads the first tenant directory users from `/users`.
|
|
36
36
|
*
|
|
37
37
|
* @param query - The search query string
|
|
38
38
|
* @param options - Optional configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeopleSearch.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeopleSearch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAA0B,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"usePeopleSearch.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeopleSearch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAA0B,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAkBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EACb,UAAU,sBAAsB,KAC/B,qBA+FF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePersonData.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersonData.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"usePersonData.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersonData.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAalE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAYD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB,KAAG,UAmP7D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* React components for Microsoft Graph powered by Fluent UI
|
|
5
5
|
*/
|
|
6
6
|
export * from './components/Person';
|
|
7
|
+
export * from './components/People';
|
|
7
8
|
export * from './components/PeoplePicker';
|
|
8
9
|
export * from './providers/IProvider';
|
|
9
10
|
export * from './providers/IPersonDataProvider';
|
|
@@ -13,5 +14,6 @@ export * from './providers/MsalBrowserProvider';
|
|
|
13
14
|
export * from './providers/TeamsHostedProvider';
|
|
14
15
|
export * from './hooks/useGraphClient';
|
|
15
16
|
export * from './hooks/usePersonData';
|
|
17
|
+
export * from './hooks/usePeopleList';
|
|
16
18
|
export * from './hooks/usePeopleSearch';
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAGhD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAGhD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|