@spteck/react-controls-v2 2.6.1 → 2.6.3

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.
Files changed (67) hide show
  1. package/README.md +64 -30
  2. package/dist/LocalizationProvider-BUBYkX-c.cjs +2 -0
  3. package/dist/{LocalizationProvider-D13keh6K.js → LocalizationProvider-DZ7gAJ1G.js} +205 -23
  4. package/dist/abstractions/index.d.ts +1 -0
  5. package/dist/components/BackgroundVideo/BackgroundVideo.d.ts +25 -0
  6. package/dist/components/BackgroundVideo/IBackgroundVideoProps.d.ts +9 -0
  7. package/dist/components/BackgroundVideo/index.d.ts +3 -0
  8. package/dist/components/Dropzone/mime-types.d.ts +1 -1
  9. package/dist/components/Hero/Hero.d.ts +7 -0
  10. package/dist/components/Hero/HeroItem.d.ts +13 -0
  11. package/dist/components/Hero/HeroOverlay.d.ts +10 -0
  12. package/dist/components/Hero/IHeroProps.d.ts +106 -0
  13. package/dist/components/Hero/index.d.ts +3 -0
  14. package/dist/components/Hero/layouts/HeroCarousel.d.ts +4 -0
  15. package/dist/components/Hero/layouts/HeroFeatured.d.ts +4 -0
  16. package/dist/components/Hero/layouts/HeroFilmstrip.d.ts +4 -0
  17. package/dist/components/Hero/layouts/HeroFullscreen.d.ts +4 -0
  18. package/dist/components/Hero/layouts/HeroGrid.d.ts +4 -0
  19. package/dist/components/Hero/layouts/HeroMosaic.d.ts +4 -0
  20. package/dist/components/Hero/layouts/HeroSplit.d.ts +4 -0
  21. package/dist/components/Hero/useHeroLayout.d.ts +12 -0
  22. package/dist/components/Hero/useHeroStyles.d.ts +26 -0
  23. package/dist/components/index.d.ts +3 -1
  24. package/dist/components/stackv2/IStackV2Props.d.ts +9 -1
  25. package/dist/components/videoPlayer/VideoPlayer.d.ts +2 -2
  26. package/dist/hooks/index.d.ts +2 -0
  27. package/dist/hooks/useAIAssistant.d.ts +3 -24
  28. package/dist/hooks/useAIAssistantParser.d.ts +3 -29
  29. package/dist/hooks/useAppToast.d.ts +4 -24
  30. package/dist/hooks/useBrandCenterFonts.d.ts +2 -30
  31. package/dist/hooks/useExportData.d.ts +25 -0
  32. package/dist/hooks/useFluentEmoji.d.ts +3 -7
  33. package/dist/hooks/useGraphAPI.d.ts +3 -19
  34. package/dist/hooks/useHeroRotation.d.ts +18 -0
  35. package/dist/hooks/useIndexedDB.d.ts +4 -11
  36. package/dist/hooks/useLocalizationStrings.d.ts +2 -12
  37. package/dist/hooks/useLogging.d.ts +3 -10
  38. package/dist/hooks/usePolling.d.ts +3 -5
  39. package/dist/hooks/useTimeZoneHelper.d.ts +3 -12
  40. package/dist/index.cjs +63 -56
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +4773 -3994
  43. package/dist/models/IExportData.d.ts +75 -0
  44. package/dist/models/IUseAIAssistant.d.ts +48 -0
  45. package/dist/models/IUseAIAssistantParser.d.ts +28 -0
  46. package/dist/models/IUseAppToast.d.ts +81 -0
  47. package/dist/models/IUseBrandCenterFonts.d.ts +30 -0
  48. package/dist/models/IUseFluentEmoji.d.ts +25 -0
  49. package/dist/models/IUseGraphAPI.d.ts +39 -0
  50. package/dist/models/IUseHeroRotation.d.ts +11 -0
  51. package/dist/models/IUseIndexedDB.d.ts +31 -0
  52. package/dist/models/IUseLocalizationStrings.d.ts +17 -0
  53. package/dist/models/IUseLogging.d.ts +40 -0
  54. package/dist/models/IUsePolling.d.ts +9 -0
  55. package/dist/models/IUseTimeZoneHelper.d.ts +50 -0
  56. package/dist/models/index.d.ts +15 -0
  57. package/dist/providers.cjs +1 -2
  58. package/dist/providers.js +2 -189
  59. package/dist/utils/index.d.ts +1 -0
  60. package/dist/utils/useExportDataUtils.d.ts +23 -0
  61. package/package.json +5 -2
  62. package/dist/LocalizationProvider-DEmAXWvz.cjs +0 -2
  63. package/dist/components/Stack/IStackProps.d.ts +0 -12
  64. package/dist/components/Stack/Stack.d.ts +0 -4
  65. package/dist/components/Stack/StackItem.d.ts +0 -12
  66. package/dist/components/Stack/index.d.ts +0 -5
  67. package/dist/components/Stack/useStackStyles.d.ts +0 -6
@@ -0,0 +1,75 @@
1
+ import type * as React from 'react';
2
+ /** Style applied to the header row cells of an Excel export. */
3
+ export interface IExcelHeaderStyle {
4
+ /** Background fill colour as ARGB hex, e.g. `'FF4472C4'`. No fill when omitted. */
5
+ bgColor?: string;
6
+ /** Font colour as ARGB hex. Defaults to `'FF000000'` (black). */
7
+ fontColor?: string;
8
+ /** Bold header font. Defaults to `true`. */
9
+ bold?: boolean;
10
+ /** Font size in points. Defaults to `12`. */
11
+ fontSize?: number;
12
+ }
13
+ /** Async data fetcher that calls back with progress as it loads pages. */
14
+ export type ExportDataFetcher<T> = (onProgress: (current: number, total: number) => void) => Promise<T[]>;
15
+ export interface IExportExcelOptions {
16
+ /** Output file name without extension. Defaults to `'export'`. */
17
+ fileName?: string;
18
+ /** Main worksheet name. Defaults to `'Sheet1'`. */
19
+ sheetName?: string;
20
+ /** Header row style. */
21
+ headerStyle?: IExcelHeaderStyle;
22
+ /** Additional sheets to append after the main data sheet. */
23
+ extraSheets?: Array<{
24
+ sheetName: string;
25
+ data: Record<string, unknown>[];
26
+ }>;
27
+ /** Appends an "Export Info" sheet with execution date and row count. */
28
+ includeMetaSheet?: boolean;
29
+ /** Title shown in the progress dialog. Defaults to `'Exporting to Excel…'`. */
30
+ dialogTitle?: string;
31
+ }
32
+ export interface IExportJSONOptions {
33
+ /** Output file name without extension. Defaults to `'export'`. */
34
+ fileName?: string;
35
+ /** JSON indentation spaces. Defaults to `2`. */
36
+ indent?: number;
37
+ /** Title shown in the progress dialog. Defaults to `'Exporting to JSON…'`. */
38
+ dialogTitle?: string;
39
+ }
40
+ export interface IExportCSVOptions {
41
+ /** Output file name without extension. Defaults to `'export'`. */
42
+ fileName?: string;
43
+ /** Column delimiter. Defaults to `','`. */
44
+ delimiter?: string;
45
+ /** Title shown in the progress dialog. Defaults to `'Exporting to CSV…'`. */
46
+ dialogTitle?: string;
47
+ }
48
+ /** Return type of {@link useExportData}. */
49
+ export interface IUseExportData {
50
+ /**
51
+ * Download data as an `.xlsx` workbook.
52
+ * Pass a static array or an async {@link ExportDataFetcher} for paginated sources.
53
+ */
54
+ exportToExcel: <T extends Record<string, unknown>>(data: T[] | ExportDataFetcher<T>, options?: IExportExcelOptions) => Promise<void>;
55
+ /**
56
+ * Download data as a `.json` file.
57
+ * Pass a value or an async function that resolves the value.
58
+ */
59
+ exportToJSON: <T>(data: T | (() => Promise<T>), options?: IExportJSONOptions) => Promise<void>;
60
+ /**
61
+ * Download data as a `.csv` file.
62
+ * Pass a static array or an async {@link ExportDataFetcher} for paginated sources.
63
+ */
64
+ exportToCSV: <T extends Record<string, unknown>>(data: T[] | ExportDataFetcher<T>, options?: IExportCSVOptions) => Promise<void>;
65
+ /**
66
+ * Render this element once in your component tree to show the progress dialog.
67
+ * @example
68
+ * ```tsx
69
+ * const { exportToExcel, ProgressDialog } = useExportData();
70
+ * return <><Button onClick={() => exportToExcel(fetcher)}>Export</Button>{ProgressDialog}</>;
71
+ * ```
72
+ */
73
+ ProgressDialog: React.ReactElement;
74
+ }
75
+ //# sourceMappingURL=IExportData.d.ts.map
@@ -0,0 +1,48 @@
1
+ export interface AIAssistantConfig {
2
+ /** API endpoint URL for the AI Assistant service. */
3
+ endpoint?: string;
4
+ /** MCP server configurations keyed by server name. */
5
+ mcpServers?: Record<string, unknown>;
6
+ /** Optional external control of the conversation session ID. */
7
+ conversationId?: string;
8
+ /** Custom HTTP headers added to every request. */
9
+ requestHeaders?: Record<string, string>;
10
+ }
11
+ export interface AIAssistantMessage {
12
+ /** System instructions prepended to the conversation. */
13
+ instructions?: string;
14
+ /** User message text to send. */
15
+ input: string;
16
+ /** IANA timezone string (e.g. `'America/New_York'`). */
17
+ timezone?: string;
18
+ /** Locale code (e.g. `'en-US'`). */
19
+ locale?: string;
20
+ /** Prior conversation turns as serialised message strings. */
21
+ history?: string[];
22
+ /** Per-message MCP server overrides. */
23
+ mcpServers?: Record<string, unknown>;
24
+ }
25
+ export interface IUseAIAssistantReturn {
26
+ /** The latest streamed response text. */
27
+ response: string;
28
+ /** `true` while a request is currently in flight. */
29
+ isLoading: boolean;
30
+ /** Error message from the last failed request, or `null`. */
31
+ error: string | null;
32
+ /**
33
+ * Send a message and optionally receive streaming progress updates.
34
+ * @param message - Message payload to send.
35
+ * @param onProgress - Optional callback invoked with each streamed chunk.
36
+ * @returns Resolves to the complete response text.
37
+ */
38
+ sendMessage: (message: AIAssistantMessage, onProgress?: (text: string) => void) => Promise<string>;
39
+ /** Abort the current in-flight request. */
40
+ cancelRequest: () => void;
41
+ /** Reset the conversation session, starting a fresh turn history. */
42
+ resetConversation: () => void;
43
+ /** Active conversation session ID (useful for resuming a session). */
44
+ conversationId: string;
45
+ }
46
+ /** @deprecated Use `IUseAIAssistantReturn` instead. */
47
+ export type UseAIAssistantResult = IUseAIAssistantReturn;
48
+ //# sourceMappingURL=IUseAIAssistant.d.ts.map
@@ -0,0 +1,28 @@
1
+ export interface ParsedAIResponse<T = unknown> {
2
+ /** Parsed, strongly-typed JSON payload extracted from the response. */
3
+ data: T | undefined;
4
+ /** Raw text content as returned from the SSE stream. */
5
+ rawText: string;
6
+ /** Whether the response payload was valid JSON. */
7
+ isJson: boolean;
8
+ /** Error message if parsing failed. */
9
+ error?: string;
10
+ }
11
+ export interface ParserOptions {
12
+ /** Strip markdown code-fence blocks from the response. Defaults to `true`. */
13
+ stripMarkdown?: boolean;
14
+ /** Emit verbose debug logs to the console. Defaults to `false`. */
15
+ debug?: boolean;
16
+ }
17
+ export interface IUseAIAssistantParserReturn {
18
+ /**
19
+ * Parse a raw SSE response string into typed data and metadata.
20
+ * @param rawResponse - The raw text received from the AI endpoint.
21
+ * @param options - Optional parsing configuration.
22
+ * @returns A `ParsedAIResponse<T>` containing the extracted data and metadata.
23
+ */
24
+ parseSSEResponse: <T = unknown>(rawResponse: string, options?: ParserOptions) => ParsedAIResponse<T>;
25
+ }
26
+ /** @deprecated Use `IUseAIAssistantParserReturn` instead. */
27
+ export type UseAIAssistantParserReturn = IUseAIAssistantParserReturn;
28
+ //# sourceMappingURL=IUseAIAssistantParser.d.ts.map
@@ -0,0 +1,81 @@
1
+ import { IToastContent } from './IToastContent';
2
+ import { IToastOptions } from './IToastOptions';
3
+ import type * as React from 'react';
4
+ export interface IAppToasterConfig {
5
+ /** Custom toaster element ID. Defaults to `'app-toaster'`. */
6
+ toasterId?: string;
7
+ /** Screen position for all toasts. Defaults to `'bottom-end'`. */
8
+ position?: 'top-start' | 'top' | 'top-end' | 'bottom-start' | 'bottom' | 'bottom-end';
9
+ /** Text direction for the toaster container. */
10
+ dir?: 'ltr' | 'rtl';
11
+ /** Pause the toast auto-dismiss countdown while the cursor is hovered over it. */
12
+ pauseOnHover?: boolean;
13
+ /** Pause the toast auto-dismiss countdown while the browser window loses focus. */
14
+ pauseOnWindowBlur?: boolean;
15
+ }
16
+ export interface IUseAppToastReturn {
17
+ /**
18
+ * Show a fully customised toast and return its generated ID.
19
+ * @param content - Toast content (title, body, actions, media, etc.).
20
+ * @param options - Optional display options (intent, timeout, position…).
21
+ */
22
+ showToast: (content: IToastContent, options?: IToastOptions) => string;
23
+ /**
24
+ * Show a success toast and return its ID.
25
+ * @param title - Primary toast heading.
26
+ * @param body - Optional secondary text.
27
+ * @param options - Display options (excluding `intent`).
28
+ */
29
+ showSuccessToast: (title: string | React.ReactNode, body?: string | React.ReactNode, options?: Omit<IToastOptions, 'intent'>) => string;
30
+ /**
31
+ * Show an error toast and return its ID.
32
+ * @param title - Primary toast heading.
33
+ * @param body - Optional secondary text.
34
+ * @param options - Display options (excluding `intent`).
35
+ */
36
+ showErrorToast: (title: string | React.ReactNode, body?: string | React.ReactNode, options?: Omit<IToastOptions, 'intent'>) => string;
37
+ /**
38
+ * Show a warning toast and return its ID.
39
+ * @param title - Primary toast heading.
40
+ * @param body - Optional secondary text.
41
+ * @param options - Display options (excluding `intent`).
42
+ */
43
+ showWarningToast: (title: string | React.ReactNode, body?: string | React.ReactNode, options?: Omit<IToastOptions, 'intent'>) => string;
44
+ /**
45
+ * Show an informational toast and return its ID.
46
+ * @param title - Primary toast heading.
47
+ * @param body - Optional secondary text.
48
+ * @param options - Display options (excluding `intent`).
49
+ */
50
+ showInfoToast: (title: string | React.ReactNode, body?: string | React.ReactNode, options?: Omit<IToastOptions, 'intent'>) => string;
51
+ /**
52
+ * Dismiss a specific toast by its ID.
53
+ * @param toastId - The ID returned by `showToast` (or one of its shorthand variants).
54
+ */
55
+ dismissToast: (toastId: string) => void;
56
+ /** Dismiss all currently visible toasts. */
57
+ dismissAllToasts: () => void;
58
+ /**
59
+ * Update the content or options of an already-visible toast.
60
+ * @param toastId - The ID of the toast to update.
61
+ * @param content - Partial content overrides.
62
+ * @param options - Partial display-option overrides.
63
+ */
64
+ updateToast: (toastId: string, content: Partial<IToastContent>, options?: Partial<IToastOptions>) => void;
65
+ /**
66
+ * Resume the auto-dismiss countdown of a paused toast.
67
+ * @param toastId - The ID of the toast to resume.
68
+ */
69
+ playToast: (toastId: string) => void;
70
+ /**
71
+ * Pause the auto-dismiss countdown of a visible toast.
72
+ * @param toastId - The ID of the toast to pause.
73
+ */
74
+ pauseToast: (toastId: string) => void;
75
+ /**
76
+ * Mount this component once in your application tree to enable toast rendering.
77
+ * Typically placed near the root of your app alongside `FluentProvider`.
78
+ */
79
+ ToasterProvider: React.ComponentType;
80
+ }
81
+ //# sourceMappingURL=IUseAppToast.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { IBrandCenterFont } from '../abstractions/IBrandCenterFonts';
2
+ export type { IBrandCenterFont } from '../abstractions/IBrandCenterFonts';
3
+ export interface IUseBrandCenterFontsOptions {
4
+ /** SharePoint site URL. When omitted, reads from `pageContext.web.absoluteUrl`. */
5
+ siteUrl?: string;
6
+ /**
7
+ * Disable fetching from the Brand Center API and supply fonts directly
8
+ * via the `fonts` property instead.
9
+ */
10
+ disabled?: boolean;
11
+ /** Provide Brand Center fonts directly, bypassing the API fetch. */
12
+ fonts?: IBrandCenterFont[];
13
+ }
14
+ export interface IUseBrandCenterFontsReturn {
15
+ /** Available Brand Center fonts, or Fluent UI defaults if none are configured. */
16
+ fonts: IBrandCenterFont[];
17
+ /** Font family names ready for use in CSS or a typography control. */
18
+ fontFamilyNames: string[];
19
+ /** The organisation's designated default font, or `undefined` if not set. */
20
+ defaultFont: IBrandCenterFont | undefined;
21
+ /** `true` while fonts are being fetched from the Brand Center API. */
22
+ loading: boolean;
23
+ /** Error message if the fetch failed, or `undefined` on success. */
24
+ error: string | undefined;
25
+ /** Whether Brand Center fonts are configured for this tenant. */
26
+ isBrandCenterAvailable: boolean;
27
+ /** Re-fetch fonts from the Brand Center API. */
28
+ refresh: () => Promise<void>;
29
+ }
30
+ //# sourceMappingURL=IUseBrandCenterFonts.d.ts.map
@@ -0,0 +1,25 @@
1
+ /** Visual style variant for a Fluent / Teams emoji. */
2
+ export type TeamsReactionImageStyle = '3D' | 'Color' | 'Flat' | 'HighContrast';
3
+ export interface IUseFluentEmojiReturn {
4
+ /**
5
+ * Retrieve the asset URL for a given emoji reaction type and style.
6
+ * @param reactionType - Emoji key (e.g. `'like'`, `'heart'`).
7
+ * @param style - Desired image style. Defaults to `'3D'`.
8
+ * @returns The asset URL, or `undefined` if the emoji is not found.
9
+ */
10
+ getEmoji: (reactionType: string, style?: TeamsReactionImageStyle) => string | undefined;
11
+ /**
12
+ * List all available emoji reaction-type keys.
13
+ * @returns An array of emoji key strings.
14
+ */
15
+ getAvailableEmojis: () => string[];
16
+ /**
17
+ * Check whether an emoji exists for the given reaction type and style.
18
+ * @param reactionType - Emoji key to check.
19
+ * @param style - Image style to check. Defaults to `'3D'`.
20
+ */
21
+ hasEmoji: (reactionType: string, style?: TeamsReactionImageStyle) => boolean;
22
+ }
23
+ /** @deprecated Use `IUseFluentEmojiReturn` instead. */
24
+ export type IUseFluentEmojiResult = IUseFluentEmojiReturn;
25
+ //# sourceMappingURL=IUseFluentEmoji.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { User } from '@microsoft/microsoft-graph-types';
2
+ import { IGraphProvider } from '../abstractions/IGraphProvider';
3
+ export interface IUserInfo {
4
+ displayName?: string;
5
+ email?: string;
6
+ jobTitle?: string;
7
+ officeLocation?: string;
8
+ mobilePhone?: string;
9
+ businessPhones?: string[];
10
+ }
11
+ export interface IUseGraphAPIReturn {
12
+ /**
13
+ * Fetch a single user by their Azure AD object ID or UPN.
14
+ * @param userId - Azure AD object ID or user principal name.
15
+ * @returns The Graph `User` object, or `null` if not found.
16
+ */
17
+ getUser: (userId: string) => Promise<User | null>;
18
+ /**
19
+ * Fetch the currently signed-in user's full Graph profile.
20
+ * @returns The Graph `User` object for the current user, or `null`.
21
+ */
22
+ getCurrentUser: () => Promise<User | null>;
23
+ /**
24
+ * Search for users by display name or UPN prefix.
25
+ * @param query - Search string.
26
+ * @param top - Maximum number of results to return. Defaults to `10`.
27
+ * @returns An array of matching Graph `User` objects.
28
+ */
29
+ searchUsers: (query: string, top?: number) => Promise<User[]>;
30
+ /**
31
+ * Retrieve a user's profile photo as a base-64 data URL.
32
+ * @param userId - Azure AD object ID or UPN of the target user.
33
+ * @returns A data URL string, or `null` if no photo is available.
34
+ */
35
+ getUserPhoto: (userId: string) => Promise<string | null>;
36
+ /** The underlying Graph client adapter, or `undefined` if not configured. */
37
+ graphClient: IGraphProvider | undefined;
38
+ }
39
+ //# sourceMappingURL=IUseGraphAPI.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { IHeroItem, IHeroRotation } from '../components/Hero/IHeroProps';
2
+ export type { IHeroItem, IHeroRotation } from '../components/Hero/IHeroProps';
3
+ export interface IUseHeroRotationOptions {
4
+ /** Full pool of hero items provided by the consumer. */
5
+ items: IHeroItem[];
6
+ /** Number of visible slots the layout displays at one time. */
7
+ slots: number;
8
+ /** Optional rotation configuration (interval, auto-start, etc.). */
9
+ rotation?: IHeroRotation;
10
+ }
11
+ //# sourceMappingURL=IUseHeroRotation.d.ts.map
@@ -0,0 +1,31 @@
1
+ export interface IUseIndexedDBCacheReturn<T> {
2
+ /**
3
+ * Retrieve a cached value by key.
4
+ * @param key - Cache entry key.
5
+ * @returns The cached value, or `undefined` if not found or expired.
6
+ */
7
+ getCachedData: (key: string) => Promise<T | undefined>;
8
+ /**
9
+ * Persist a value in the cache.
10
+ * @param key - Cache entry key.
11
+ * @param value - Value to cache.
12
+ * @param expirationInMinutes - Time-to-live in minutes. Omit to cache indefinitely.
13
+ */
14
+ setCachedData: (key: string, value: T, expirationInMinutes?: number) => Promise<void>;
15
+ /**
16
+ * Remove a single entry from the cache.
17
+ * @param key - Cache entry key to remove.
18
+ */
19
+ removeCachedData: (key: string) => Promise<void>;
20
+ /** Delete all entries from the IndexedDB cache. */
21
+ clearCache: () => Promise<void>;
22
+ }
23
+ export interface IUseCachedDataReturn<T> {
24
+ /** The fetched (and cached) data, or `undefined` while loading or on error. */
25
+ data: T | undefined;
26
+ /** `true` while the fetcher is running for the first time or after a cache miss. */
27
+ loading: boolean;
28
+ /** Error thrown by the fetcher, or `undefined` on success. */
29
+ error: Error | undefined;
30
+ }
31
+ //# sourceMappingURL=IUseIndexedDB.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { ILibraryStrings } from '../localization/ILibraryStrings';
2
+ export interface ILocalizationContext {
3
+ /** The active localization provider instance. */
4
+ provider: unknown;
5
+ /** Resolved localisation strings for the current locale. */
6
+ strings: ILibraryStrings;
7
+ /** Active locale code (e.g. `'en-US'`, `'pt-PT'`). */
8
+ locale: string;
9
+ /** Whether the active locale uses right-to-left text direction. */
10
+ isRtl: boolean;
11
+ /**
12
+ * Switch the active locale at runtime.
13
+ * @param locale - Target locale code.
14
+ */
15
+ setLocale: (locale: string) => Promise<void>;
16
+ }
17
+ //# sourceMappingURL=IUseLocalizationStrings.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { LogLevel, ErrorType } from '../abstractions/ILoggingProvider';
2
+ export interface IUseLoggingReturn {
3
+ /**
4
+ * Write a message at the given log level.
5
+ * @param message - Human-readable log message.
6
+ * @param level - Log severity. Defaults to `LogLevel.Info`.
7
+ * @param data - Optional structured data to attach to the entry.
8
+ */
9
+ log: (message: string, level?: LogLevel, data?: unknown) => void;
10
+ /**
11
+ * Record an error with optional stack trace and categorisation.
12
+ * @param message - Human-readable error summary.
13
+ * @param err - The caught `Error` object, if available.
14
+ * @param errorType - Optional semantic error category.
15
+ */
16
+ error: (message: string, err?: Error, errorType?: ErrorType) => void;
17
+ /**
18
+ * Write a warning-level message.
19
+ * @param message - Human-readable warning message.
20
+ * @param data - Optional structured data to attach to the entry.
21
+ */
22
+ warn: (message: string, data?: unknown) => void;
23
+ /**
24
+ * Write an informational message.
25
+ * @param message - Human-readable info message.
26
+ * @param data - Optional structured data to attach to the entry.
27
+ */
28
+ info: (message: string, data?: unknown) => void;
29
+ /**
30
+ * Write a verbose / debug message.
31
+ * @param message - Human-readable verbose message.
32
+ * @param data - Optional structured data to attach to the entry.
33
+ */
34
+ verbose: (message: string, data?: unknown) => void;
35
+ /** Reference to the `LogLevel` enum for use in consuming code. */
36
+ LogLevel: typeof LogLevel;
37
+ /** Reference to the `ErrorType` enum for use in consuming code. */
38
+ ErrorType: typeof ErrorType;
39
+ }
40
+ //# sourceMappingURL=IUseLogging.d.ts.map
@@ -0,0 +1,9 @@
1
+ export interface IUsePollingReturn {
2
+ /** Start (or restart) the polling interval. */
3
+ startPolling: () => void;
4
+ /** Stop the polling interval and cancel any pending tick. */
5
+ stopPolling: () => void;
6
+ /** `true` while polling is active. */
7
+ isPolling: boolean;
8
+ }
9
+ //# sourceMappingURL=IUsePolling.d.ts.map
@@ -0,0 +1,50 @@
1
+ export interface IUseTimeZoneHelperReturn {
2
+ /** The resolved timezone string used by this hook instance (e.g. `'America/New_York'`). */
3
+ timeZone: string;
4
+ /**
5
+ * Convert a UTC `Date` to the hook's configured timezone (or an override).
6
+ * @param date - Source UTC date.
7
+ * @param targetTimeZone - Override timezone. Defaults to the hook's configured timezone.
8
+ */
9
+ convertToUserTimeZone: (date: Date, targetTimeZone?: string) => Date;
10
+ /**
11
+ * Convert a local (timezone-aware) `Date` back to UTC.
12
+ * @param date - Source local date.
13
+ * @param sourceTimeZone - Override source timezone. Defaults to the hook's configured timezone.
14
+ */
15
+ convertFromUserTimeZone: (date: Date, sourceTimeZone?: string) => Date;
16
+ /**
17
+ * Format a date in a specific timezone using a `date-fns` format string.
18
+ * @param date - Date to format.
19
+ * @param formatStr - `date-fns` format pattern (e.g. `'PPPp'`).
20
+ * @param targetTimeZone - Override timezone. Defaults to the hook's configured timezone.
21
+ */
22
+ formatInTimeZone: (date: Date, formatStr: string, targetTimeZone?: string) => string;
23
+ /** Return the IANA timezone string of the current browser / user environment. */
24
+ getUserTimeZone: () => string;
25
+ /**
26
+ * Return a human-readable relative label (e.g. `'2 hours ago'`, `'Yesterday'`).
27
+ * @param date - Date or ISO string to compare against now.
28
+ */
29
+ getFormatRelative: (date: Date | string) => string;
30
+ /**
31
+ * Normalise a date or ISO string to a UTC `Date`.
32
+ * @param date - Source date or ISO string.
33
+ */
34
+ convertDateToUTC: (date: Date | string) => Date;
35
+ /**
36
+ * Format a date or ISO string using a `date-fns` format pattern.
37
+ * @param date - Source date or ISO string.
38
+ * @param formatString - `date-fns` format pattern. Defaults to `'PPP'`.
39
+ */
40
+ formatDate: (date: Date | string, formatString?: string) => string;
41
+ /** Return the UTC offset in minutes for the hook's configured timezone. */
42
+ getTimezoneOffset: () => number;
43
+ /**
44
+ * Convert a date or ISO string to a formatted string in the given timezone.
45
+ * @param date - Source date or ISO string.
46
+ * @param tz - Override timezone. Defaults to the hook's configured timezone.
47
+ */
48
+ convertToTimezone: (date: Date | string, tz?: string) => string;
49
+ }
50
+ //# sourceMappingURL=IUseTimeZoneHelper.d.ts.map
@@ -1,2 +1,17 @@
1
1
  export * from './IAppCardContainer';
2
+ export * from './IExportData';
3
+ export * from './IToastContent';
4
+ export * from './IToastOptions';
5
+ export * from './IUseAIAssistant';
6
+ export * from './IUseAIAssistantParser';
7
+ export * from './IUseAppToast';
8
+ export * from './IUseBrandCenterFonts';
9
+ export * from './IUseFluentEmoji';
10
+ export * from './IUseGraphAPI';
11
+ export * from './IUseHeroRotation';
12
+ export * from './IUseIndexedDB';
13
+ export * from './IUseLocalizationStrings';
14
+ export * from './IUseLogging';
15
+ export * from './IUsePolling';
16
+ export * from './IUseTimeZoneHelper';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LocalizationProvider-DEmAXWvz.cjs`);var t=class{componentName;constructor(e=`ReactControlsUniversal`){this.componentName=e}log(t,n,r){let i=`[${this.componentName}]`;switch(n){case e.O.Verbose:console.debug(i,t,r);break;case e.O.Info:console.info(i,t,r);break;case e.O.Warning:console.warn(i,t,r);break;case e.O.Error:console.error(i,t,r);break;default:console.log(i,t,r)}}error(e,t,n){console.error(`[${this.componentName}]`,e,t,n)}warn(e,t){console.warn(`[${this.componentName}]`,e,t)}info(e,t){console.info(`[${this.componentName}]`,e,t)}verbose(e,t){console.debug(`[${this.componentName}]`,e,t)}},n=class{baseUrl;accessToken;getAccessToken;constructor(e){this.baseUrl=e.baseUrl||`https://graph.microsoft.com/v1.0`,this.accessToken=e.accessToken,this.getAccessToken=e.getAccessToken}async getHeaders(){let e=this.accessToken;if(this.getAccessToken)try{e=await this.getAccessToken([`User.Read`])}catch(e){console.error(`Failed to get access token:`,e)}return{Authorization:e?`Bearer ${e}`:``,"Content-Type":`application/json`}}buildUrl(e){let t=e.startsWith(`/`)?e.slice(1):e;return`${this.baseUrl}/${t}`}async get(e){let t=await this.getHeaders(),n=await fetch(this.buildUrl(e),{method:`GET`,headers:t});if(!n.ok)throw Error(`Graph API error: ${n.status} ${n.statusText}`);return n.json()}async post(e,t){let n=await this.getHeaders(),r=await fetch(this.buildUrl(e),{method:`POST`,headers:n,body:JSON.stringify(t)});if(!r.ok)throw Error(`Graph API error: ${r.status} ${r.statusText}`);return r.json()}async patch(e,t){let n=await this.getHeaders(),r=await fetch(this.buildUrl(e),{method:`PATCH`,headers:n,body:JSON.stringify(t)});if(!r.ok)throw Error(`Graph API error: ${r.status} ${r.statusText}`);return r.json()}async delete(e){let t=await this.getHeaders(),n=await fetch(this.buildUrl(e),{method:`DELETE`,headers:t});if(!n.ok)throw Error(`Graph API error: ${n.status} ${n.statusText}`)}async getWithMetadata(e){let t=await this.getHeaders(),n=await fetch(this.buildUrl(e),{method:`GET`,headers:t});if(!n.ok)throw Error(`Graph API error: ${n.status} ${n.statusText}`);return n.json()}async getBlob(e){let t=this.accessToken;if(this.getAccessToken)try{t=await this.getAccessToken([`User.Read`])}catch(e){console.error(`Failed to get access token:`,e)}let n={Authorization:t?`Bearer ${t}`:``},r=await fetch(this.buildUrl(e),{method:`GET`,headers:n});if(!r.ok){if(r.status===404)return;throw Error(`Graph API error: ${r.status} ${r.statusText}`)}return r.blob()}},r=class{prefix;memoryFallback;isLocalStorageAvailable;constructor(e=`rcu_`){this.prefix=e,this.memoryFallback=new Map,this.isLocalStorageAvailable=this.checkLocalStorageAvailability()}checkLocalStorageAvailability(){try{let e=`__localStorage_test__`;return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch{return!1}}getKey(e){return`${this.prefix}${e}`}async get(e){let t=this.getKey(e);try{let n=null;if(n=this.isLocalStorageAvailable?localStorage.getItem(t):this.memoryFallback.get(t),!n)return;let r=JSON.parse(n);if(r.expiration&&Date.now()>r.expiration){await this.remove(e);return}return r.value}catch(e){console.error(`Error reading from storage:`,e);return}}async set(e,t,n){let r=this.getKey(e);try{let e={value:t,expiration:n?Date.now()+n*60*1e3:void 0},i=JSON.stringify(e);this.isLocalStorageAvailable?localStorage.setItem(r,i):this.memoryFallback.set(r,i)}catch(e){console.error(`Error writing to storage:`,e)}}async remove(e){let t=this.getKey(e);try{this.isLocalStorageAvailable?localStorage.removeItem(t):this.memoryFallback.delete(t)}catch(e){console.error(`Error removing from storage:`,e)}}async clear(){try{this.isLocalStorageAvailable?Object.keys(localStorage).forEach(e=>{e.startsWith(this.prefix)&&localStorage.removeItem(e)}):this.memoryFallback.clear()}catch(e){console.error(`Error clearing storage:`,e)}}async has(e){return await this.get(e)!==void 0}};exports.ConsoleLoggingProvider=t,exports.DefaultGraphClient=n,exports.DefaultLocalizationProvider=e.w,exports.LocalStorageProvider=r,exports.LocalizationProvider=e.t;
2
- //# sourceMappingURL=providers.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LocalizationProvider-BUBYkX-c.cjs`);exports.ConsoleLoggingProvider=e.k,exports.DefaultGraphClient=e.O,exports.DefaultLocalizationProvider=e.T,exports.LocalStorageProvider=e.w,exports.LocalizationProvider=e.t;